summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2012-05-03 16:05:26 +0100
committerNoel Power <noel.power@novell.com>2012-05-03 16:06:43 +0100
commit5813422d3eb9657c5a818057be0ebf831ca6a794 (patch)
treedc3d675b5519267784951767779da626d71290bb
parent9dc4fa1b22a533ba0a6ce0353112c55eef8a14ef (diff)
tweak imported shape position for xls( binary ) format fdo#49430
Change-Id: I32241c727a2e591f6400f8296bae357a38ad458d
-rw-r--r--sc/source/filter/excel/read.cxx9
-rw-r--r--sc/source/filter/excel/xiescher.cxx22
-rw-r--r--sc/source/filter/inc/xiescher.hxx1
3 files changed, 32 insertions, 0 deletions
diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index 08b56bc72d66..0b45e5fa67fd 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -52,6 +52,7 @@
#include "root.hxx"
#include "imp_op.hxx"
#include "excimp8.hxx"
+#include <sfx2/objsh.hxx>
FltError ImportExcel::Read( void )
{
@@ -1309,6 +1310,14 @@ FltError ImportExcel8::Read( void )
PostDocLoad();
pD->CalcAfterLoad();
+ SfxObjectShell* pDocShell = GetDocShell();
+
+ if ( pDocShell )
+ {
+ std::vector< OrientationInfo > savedOrientations;
+ ScGlobal::CaptureShapeOrientationInfo( savedOrientations, pDocShell->GetModel() );
+ ScGlobal::ApplyShapeOrientationInfo( savedOrientations, pDocShell->GetModel(), *pD );
+ }
// import change tracking data
XclImpChangeTrack aImpChTr( GetRoot(), maStrm );
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 74ed03b8d6e9..932f9563dcbd 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -497,6 +497,28 @@ void XclImpDrawObjBase::PreProcessSdrObject( XclImpDffConverter& rDffConv, SdrOb
}
}
+ if ( GetAnchor() )
+ {
+ ScDrawObjData* pAnchor = ScDrawLayer::GetObjData( &rSdrObj, sal_True);
+ if ( pAnchor )
+ {
+ // Temporarily get start position of shape.
+ // At the end of the import we do some post processing
+ // to adjust the shape position to take into account
+ // errors between the drawing layer and the view/grid
+ pAnchor->maStart.SetRow( GetAnchor()->maFirst.mnRow );
+ pAnchor->maStart.SetCol( GetAnchor()->maFirst.mnCol );
+ pAnchor->maStart.SetTab( GetTab() );
+ XclObjAnchor tmpAnchor( *GetAnchor() );
+
+ // Calculate the start offset ( from the cell postion )
+ Rectangle withOffset = tmpAnchor.GetRect( GetRoot(), GetTab(), MAP_100TH_MM );
+ tmpAnchor.mnLX = tmpAnchor.mnTY = tmpAnchor.mnRX = tmpAnchor.mnBY = 0;
+ Rectangle noOffset = tmpAnchor.GetRect( GetRoot(), GetTab(), MAP_100TH_MM );
+ pAnchor->maStartOffset.X() = withOffset.Left() - noOffset.Left();
+ pAnchor->maStartOffset.Y() = withOffset.Top() - noOffset.Top();
+ }
+ }
// call virtual function for object type specific processing
DoPreProcessSdrObj( rDffConv, rSdrObj );
}
diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx
index 2843b4ab2c5e..5b09e41ccfd4 100644
--- a/sc/source/filter/inc/xiescher.hxx
+++ b/sc/source/filter/inc/xiescher.hxx
@@ -175,6 +175,7 @@ protected:
virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
/** Derived classes may perform additional processing for the passed SdrObject after insertion. */
virtual void DoPostProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
+public:
SCTAB GetTab() const { return mnTab; }
private:
/** Reads the contents of a BIFF3 OBJ record. */