diff options
Diffstat (limited to 'sc/source/filter')
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlimprt.cxx | 32 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlimprt.hxx | 2 |
3 files changed, 37 insertions, 1 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 0d748fcc4071..636fa9dcc75c 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3473,8 +3473,10 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell) return; awt::Point aPoint; + // Hiding row or col does not change the shape geometry. tools::Rectangle aRect = pDoc->GetMMRect(rMyCell.maCellAddress.Col(), rMyCell.maCellAddress.Row(), - rMyCell.maCellAddress.Col(), rMyCell.maCellAddress.Row(), rMyCell.maCellAddress.Tab()); + rMyCell.maCellAddress.Col(), rMyCell.maCellAddress.Row(), rMyCell.maCellAddress.Tab(), + false /*bHiddenAsZero*/); bool bNegativePage = pDoc->IsNegativePage(rMyCell.maCellAddress.Tab()); if (bNegativePage) aPoint.X = aRect.Right(); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index f692d7d04568..e88fe74dd9f2 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -38,6 +38,7 @@ #include <xmloff/xmltoken.hxx> #include <xmloff/xmlerror.hxx> #include <xmloff/ProgressBarHelper.hxx> +#include <svx/svdpage.hxx> #include <svl/languageoptions.hxx> #include <editeng/editstat.hxx> @@ -53,6 +54,7 @@ #include "xmlbodyi.hxx" #include "xmlstyli.hxx" #include <ViewSettingsSequenceDefines.hxx> +#include <userdat.hxx> #include <compiler.hxx> @@ -1657,6 +1659,36 @@ void SAL_CALL ScXMLImport::endDocument() } } + // Initialize and set position and size of objects + if (pDoc && pDoc->GetDrawLayer()) + { + ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); + SCTAB nTabCount = pDoc->GetTableCount(); + for (SCTAB nTab = 0; nTab < nTabCount; ++nTab) + { + const SdrPage* pPage = pDrawLayer->GetPage(nTab); + if (!pPage) + continue; + bool bNegativePage = pDoc->IsNegativePage(nTab); + const size_t nCount = pPage->GetObjCount(); + for (size_t i = 0; i < nCount; ++i) + { + SdrObject* pObj = pPage->GetObj(i); + ScDrawObjData* pData + = ScDrawLayer::GetObjDataTab(pObj, nTab); + // Existance of pData means, that it is a cell anchored object + if (pData) + { + // Finish and correct import based on full size (no hidden row/col) and LTR + pDrawLayer->InitializeCellAnchoredObj(pObj, *pData); + // Adapt object to hidden row/col and RTL + pDrawLayer->RecalcPos(pObj, *pData, bNegativePage, + true /*bUpdateNoteCaptionPos*/); + } + } + } + } + aTables.FixupOLEs(); } if (GetModel().is()) diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index 0a5d2e7f815d..be25dc026062 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -49,10 +49,12 @@ class XMLNumberFormatAttributesExportHelper; class ScEditEngineDefaulter; class ScDocumentImport; class ScMyImpDetectiveOpArray; +class SdrPage; namespace sc { struct ImportPostProcessData; struct PivotTableSources; +class ScDrawObjData; } |