[Libreoffice-commits] .: 2 commits - oox/inc oox/source sc/source

2012-12-13 Thread Libreoffice Gerrit user
 oox/inc/oox/core/relations.hxx|2 ++
 oox/source/core/relations.cxx |6 ++
 oox/source/drawingml/hyperlinkcontext.cxx |4 +++-
 sc/source/filter/inc/worksheetbuffer.hxx  |4 
 sc/source/filter/oox/drawingfragment.cxx  |   22 --
 sc/source/filter/oox/workbookhelper.cxx   |4 ++--
 sc/source/filter/oox/worksheetbuffer.cxx  |   19 +++
 7 files changed, 56 insertions(+), 5 deletions(-)

New commits:
commit 70b960b966d36b1cb12bfb0c71d093fa0c5a3288
Author: Noel Power 
Date:   Thu Dec 13 16:52:50 2012 +

fix sometimes data corruption with xlsx import ( with scenario sheets )

formula import is buffered 'till the end of import. The processing of the
formula data need to happen before the scenario import happens. This is
necessary because sheet numbers stored in the formula addresses can become
invalid as scenario import insertes new hidden sheets upsetting the previous
table order

Change-Id: I9357f028f31bec1b1504ca991f5534f80d79c9bc

diff --git a/sc/source/filter/oox/workbookhelper.cxx 
b/sc/source/filter/oox/workbookhelper.cxx
index a9201ee..e5521e7 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -597,8 +597,6 @@ void WorkbookGlobals::finalize()
 // #i79826# enable updating automatic row height after loading the 
document
 aPropSet.setProperty( PROP_IsAdjustHeightEnabled, true );
 
-getFormulaBuffer().finalizeImport();
-
 // Insert all pivot tables. Must be done after loading all sheets and
 // formulas, because data pilots expect existing source data on
 // creation.
@@ -674,6 +672,8 @@ void WorkbookHelper::finalizeWorkbookImport()
 mrBookGlob.getWorkbookSettings().finalizeImport();
 mrBookGlob.getViewSettings().finalizeImport();
 
+// need to import formulas before scenarios
+mrBookGlob.getFormulaBuffer().finalizeImport();
 /*  Insert scenarios after all sheet processing is done, because new hidden
 sheets are created for scenarios which would confuse code that relies
 on certain sheet indexes. Must be done after pivot tables too. */
commit 2551fec6d2a73d10cfa2aec85ae7d00e237e0294
Author: Noel Power 
Date:   Thu Dec 13 16:26:58 2012 +

fix fdo#58237 import hyperlinks for shapes in xlsx documents

Change-Id: Ib0c661dbb3ce9a2f8c8d29707a1cf0c65aadc81f

diff --git a/oox/inc/oox/core/relations.hxx b/oox/inc/oox/core/relations.hxx
index f840448..94b9908 100644
--- a/oox/inc/oox/core/relations.hxx
+++ b/oox/inc/oox/core/relations.hxx
@@ -79,6 +79,8 @@ public:
 
 /** Returns the external target of the relation with the passed relation 
identifier. */
 ::rtl::OUString getExternalTargetFromRelId( const ::rtl::OUString& 
rRelId ) const;
+/** Returns the internal target of the relation with the passed relation 
identifier. */
+::rtl::OUString getInternalTargetFromRelId( const ::rtl::OUString& 
rRelId ) const;
 
 /** Returns the full fragment path for the target of the passed relation. 
*/
 ::rtl::OUString getFragmentPathFromRelation( const Relation& rRelation 
) const;
diff --git a/oox/source/core/relations.cxx b/oox/source/core/relations.cxx
index 501f515..c49fe63 100644
--- a/oox/source/core/relations.cxx
+++ b/oox/source/core/relations.cxx
@@ -83,6 +83,12 @@ OUString Relations::getExternalTargetFromRelId( const 
OUString& rRelId ) const
 return (pRelation && pRelation->mbExternal) ? pRelation->maTarget : 
OUString();
 }
 
+OUString Relations::getInternalTargetFromRelId( const OUString& rRelId ) const
+{
+const Relation* pRelation = getRelationFromRelId( rRelId );
+return (pRelation && !pRelation->mbExternal) ? pRelation->maTarget : 
OUString();
+}
+
 OUString Relations::getFragmentPathFromRelation( const Relation& rRelation ) 
const
 {
 // no target, no fragment path
diff --git a/oox/source/drawingml/hyperlinkcontext.cxx 
b/oox/source/drawingml/hyperlinkcontext.cxx
index f2d715c..231b7f9 100644
--- a/oox/source/drawingml/hyperlinkcontext.cxx
+++ b/oox/source/drawingml/hyperlinkcontext.cxx
@@ -44,10 +44,12 @@ HyperLinkContext::HyperLinkContext( ContextHandler& rParent,
 {
 OSL_TRACE("OOX: URI rId %s", OUStringToOString (aRelId, 
RTL_TEXTENCODING_UTF8).pData->buffer);
 sHref = getRelations().getExternalTargetFromRelId( aRelId );
+OUString sExtHref = getRelations().getExternalTargetFromRelId( aRelId 
);
+sURL = getRelations().getInternalTargetFromRelId( aRelId );
 if( !sHref.isEmpty() )
 {
 OSL_TRACE("OOX: URI href %s", OUStringToOString (sHref, 
RTL_TEXTENCODING_UTF8).pData->buffer);
-sURL = getFilter().getAbsoluteUrl( sHref );
+sURL = getFilter().getAbsoluteUrl( sExtHref );
 }
 }
 OUString sTooltip = xAttributes->getOptionalValue( R_TOKEN( tooltip ) );
diff --git a/sc/source/filter/inc/workshee

[Libreoffice-commits] .: 2 commits - oox/inc oox/source sc/source

2012-11-24 Thread Libreoffice Gerrit user
 oox/inc/oox/core/xmlfilterbase.hxx   |2 +-
 oox/source/core/xmlfilterbase.cxx|2 +-
 sc/source/filter/oox/excelfilter.cxx |9 -
 3 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit c54534415dd71afffaff929617a4ddfcd599b152
Author: Markus Mohrhard 
Date:   Sat Nov 24 18:56:18 2012 +0100

we need to catch the exception here, fdo#57451

Change-Id: I203aa640e7d4373f3a090a4988c28c6059b93064

diff --git a/sc/source/filter/oox/excelfilter.cxx 
b/sc/source/filter/oox/excelfilter.cxx
index 8320780..fc9d3b5 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -129,7 +129,14 @@ bool ExcelFilter::importDocument() throw()
 WorkbookGlobalsRef xBookGlob = WorkbookHelper::constructGlobals( *this );
 if ( xBookGlob.get() && importFragment( new WorkbookFragment( *xBookGlob, 
aWorkbookPath ) ) )
 {
-importDocumentProperties();
+try
+{
+importDocumentProperties();
+}
+catch( const Exception& e )
+{
+SAL_WARN("sc", "exception when importing document properties " << 
e.Message);
+}
 return true;
 }
 return false;
commit 144a8586b8a3cc16a00807f5968886e73c44c0d9
Author: Markus Mohrhard 
Date:   Sat Nov 24 18:35:12 2012 +0100

this method actually can throw, related fdo#57451

Change-Id: I26b79829029e127eb8b9ab4fbea3e0f02035ee41

diff --git a/oox/inc/oox/core/xmlfilterbase.hxx 
b/oox/inc/oox/core/xmlfilterbase.hxx
index dad67e3..bf066fd 100644
--- a/oox/inc/oox/core/xmlfilterbase.hxx
+++ b/oox/inc/oox/core/xmlfilterbase.hxx
@@ -226,7 +226,7 @@ public:
 
 sal_Int32 getNamespaceId( const ::rtl::OUString& rUrl );
 
-void importDocumentProperties() throw();
+void importDocumentProperties();
 
 protected:
 virtual ::com::sun::star::uno::Reference< 
::com::sun::star::io::XInputStream >
diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index 70b3936..64aec26 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -206,7 +206,7 @@ XmlFilterBase::~XmlFilterBase()
 
 // 
 
-void XmlFilterBase::importDocumentProperties() throw()
+void XmlFilterBase::importDocumentProperties()
 {
 Reference< XMultiServiceFactory > xFactory( getServiceFactory(), UNO_QUERY 
);
 MediaDescriptor aMediaDesc( getMediaDescriptor() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - oox/inc oox/source sc/source

2012-05-04 Thread Noel Power
 oox/inc/oox/vml/vmldrawing.hxx   |1 +
 oox/source/vml/vmldrawing.cxx|2 +-
 oox/source/vml/vmlshape.cxx  |2 +-
 sc/source/filter/inc/xiescher.hxx|1 -
 sc/source/filter/oox/drawingfragment.cxx |   12 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 4d7047860fc5869576f330a437edd6744d59bd61
Author: Noel Power 
Date:   Fri May 4 12:33:57 2012 +0100

remove public: declaration ( remnant of abandoned part of patch )

Change-Id: Iaa27404ca2e604c207568385b7bb2f4ab67ed359

diff --git a/sc/source/filter/inc/xiescher.hxx 
b/sc/source/filter/inc/xiescher.hxx
index 5b09e41..2843b4a 100644
--- a/sc/source/filter/inc/xiescher.hxx
+++ b/sc/source/filter/inc/xiescher.hxx
@@ -175,7 +175,6 @@ protected:
 virtual voidDoPreProcessSdrObj( XclImpDffConverter& rDffConv, 
SdrObject& rSdrObj ) const;
 /** Derived classes may perform additional processing for the passed 
SdrObject after insertion. */
 virtual voidDoPostProcessSdrObj( XclImpDffConverter& rDffConv, 
SdrObject& rSdrObj ) const;
-public:
 SCTAB   GetTab() const { return mnTab; }
 private:
 /** Reads the contents of a BIFF3 OBJ record. */
commit 76bab166e21bc3646ae2d3079aae2c5d9ce0d1e5
Author: Noel Power 
Date:   Fri May 4 12:32:46 2012 +0100

reorganise code a little so ole controls are catered for wrt fdo#49430

Change-Id: Ifb2c0a97f85884c459b1e7bc4616154c0e4aea2a

diff --git a/oox/inc/oox/vml/vmldrawing.hxx b/oox/inc/oox/vml/vmldrawing.hxx
index b9b626e..4a0cf50 100644
--- a/oox/inc/oox/vml/vmldrawing.hxx
+++ b/oox/inc/oox/vml/vmldrawing.hxx
@@ -157,6 +157,7 @@ public:
 model into the form, and the shape into the passed UNO shape 
container. */
 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
 createAndInsertXControlShape(
+const ClientData* pClientData,
 const ::oox::ole::EmbeddedControl& rControl,
 const ::com::sun::star::uno::Reference< 
::com::sun::star::drawing::XShapes >& rxShapes,
 const ::com::sun::star::awt::Rectangle& rShapeRect,
diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx
index 1a3530d..5a6d76d 100644
--- a/oox/source/vml/vmldrawing.cxx
+++ b/oox/source/vml/vmldrawing.cxx
@@ -247,7 +247,7 @@ Reference< XShape > Drawing::createAndInsertXShape( const 
OUString& rService,
 return xShape;
 }
 
-Reference< XShape > Drawing::createAndInsertXControlShape( const 
::oox::ole::EmbeddedControl& rControl,
+Reference< XShape > Drawing::createAndInsertXControlShape( const ClientData* 
pClientData, const ::oox::ole::EmbeddedControl& rControl,
 const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect, 
sal_Int32& rnCtrlIndex ) const
 {
 Reference< XShape > xShape;
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 4000932..92a4538 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -557,7 +557,7 @@ Reference< XShape > ComplexShape::implConvertAndInsert( 
const Reference< XShapes
 {
 // create and return the control shape (including control 
model)
 sal_Int32 nCtrlIndex = -1;
-Reference< XShape > xShape = 
mrDrawing.createAndInsertXControlShape( aControl, rxShapes, rShapeRect, 
nCtrlIndex );
+Reference< XShape > xShape = 
mrDrawing.createAndInsertXControlShape( *this, aControl, rxShapes, rShapeRect, 
nCtrlIndex );
 // on error, proceed and try to create picture from 
replacement image
 if( xShape.is() )
 return xShape;
diff --git a/sc/source/filter/oox/drawingfragment.cxx 
b/sc/source/filter/oox/drawingfragment.cxx
index 012c9a1..977c8de 100644
--- a/sc/source/filter/oox/drawingfragment.cxx
+++ b/sc/source/filter/oox/drawingfragment.cxx
@@ -614,12 +614,6 @@ Reference< XShape > 
VmlDrawing::createAndInsertClientXShape( const ::oox::vml::S
 getBaseFilter().getVbaProject().registerMacroAttacher( 
xAttacher );
 }
 }
-if ( !pClientData->maAnchor.isEmpty() )
-{
-ShapeAnchor aAnchor( *this );
-aAnchor.importVmlAnchor( pClientData->maAnchor );
-aAnchor.applyToXShape( xShape );
-}
 return xShape;
 }
 }
@@ -637,6 +631,12 @@ void VmlDrawing::notifyXShapeInserted( const Reference< 
XShape >& rxShape,
 // convert settings from VML client data
 if( const ::oox::vml::ClientData* pClientData = rShape.getClientData() )
 {
+if ( !pClientData->maAnchor.isEmpty() )
+{
+ShapeAnchor aAnchor( *this );
+aAnchor.importVmlAnchor( pClientData->maAnchor );
+aAnchor.applyToXShape( rxShape );
+}
 // specific setti