summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <cmc@openoffice.org>2002-12-12 09:16:26 +0000
committerCaolán McNamara <cmc@openoffice.org>2002-12-12 09:16:26 +0000
commitd2e2b4b88e4d5b70c45693315ec6294091d58cde (patch)
treeee7b07010cd0a93e1ff8da487be98c1d90e53169 /sw
parente2ab7da6e3e8f672830cfe53e7f830d2d48c99c2 (diff)
#i9745# for obscure reasons working with inserting drawing objects differs when inserting into a new document or inserting into an existing document
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8graf.hxx5
-rw-r--r--sw/source/filter/ww8/ww8graf2.cxx23
2 files changed, 19 insertions, 9 deletions
diff --git a/sw/source/filter/ww8/ww8graf.hxx b/sw/source/filter/ww8/ww8graf.hxx
index 5c6fbfdcb09c..d39a060a3fd4 100644
--- a/sw/source/filter/ww8/ww8graf.hxx
+++ b/sw/source/filter/ww8/ww8graf.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ww8graf.hxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: cmc $ $Date: 2002-12-10 12:41:16 $
+ * last change: $Author: cmc $ $Date: 2002-12-12 10:16:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -104,6 +104,7 @@ private:
myeiter MapEscherIdxToIter(ULONG nIdx);
ULONG GetEscherObjectPos(ULONG nSpId);
ULONG GetDrawingObjectPos(short nWwHeight);
+ bool InsertObject(SdrObject *pObject, ULONG nPos);
public:
wwZOrderer(SdrPage* pDrawPg, const SvxMSDffShapeOrders *pShapeOrders,
sal_Int8 nHeaven, sal_Int8 nHell);
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index 9740275ff497..8bfb65e9a2da 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ww8graf2.cxx,v $
*
- * $Revision: 1.44 $
+ * $Revision: 1.45 $
*
- * last change: $Author: cmc $ $Date: 2002-12-12 09:54:01 $
+ * last change: $Author: cmc $ $Date: 2002-12-12 10:16:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -195,7 +195,7 @@ void wwZOrderer::OutsideEscher()
void wwZOrderer::InsertEscherObject(SdrObject* pObject, ULONG nSpId)
{
ULONG nInsertPos = GetEscherObjectPos(nSpId);
- mpDrawPg->InsertObject(pObject,nInsertPos + mnNoInitialObjects + mnInlines);
+ InsertObject(pObject, nInsertPos + mnNoInitialObjects + mnInlines);
}
wwZOrderer::myeiter wwZOrderer::MapEscherIdxToIter(ULONG nIdx)
@@ -264,14 +264,14 @@ void wwZOrderer::InsertDrawingObject(SdrObject* pObj, short nWwHeight)
else
pObj->SetLayer(mnHell);
- mpDrawPg->InsertObject(pObj, nPos + mnNoInitialObjects + mnInlines);
+ InsertObject(pObj, nPos + mnNoInitialObjects + mnInlines);
}
void wwZOrderer::InsertTextLayerObject(SdrObject* pObject)
{
if (maIndexes.empty())
{
- mpDrawPg->InsertObject(pObject, mnNoInitialObjects + mnInlines);
+ InsertObject(pObject, mnNoInitialObjects + mnInlines);
++mnInlines;
}
else
@@ -291,8 +291,7 @@ void wwZOrderer::InsertTextLayerObject(SdrObject* pObject)
aEnd->mnNoInlines++;
nInsertPos += aEnd->mnNoInlines;
- mpDrawPg->InsertObject(pObject,
- mnNoInitialObjects + mnInlines + nInsertPos);
+ InsertObject(pObject, mnNoInitialObjects + mnInlines + nInsertPos);
}
}
@@ -318,6 +317,16 @@ ULONG wwZOrderer::GetDrawingObjectPos(short nWwHeight)
return std::distance(maDrawHeight.begin(), aIter);
}
+bool wwZOrderer::InsertObject(SdrObject* pObject, ULONG nPos)
+{
+ if (!mpDrawPg->IsInserted())
+ {
+ mpDrawPg->InsertObject(pObject, nPos);
+ return true;
+ }
+ return false;
+}
+
#ifdef __WW8_NEEDS_COPY
extern void WW8PicShadowToReal( WW8_PIC_SHADOW* pPicS, WW8_PIC* pPic );
#endif // defined __WW8_NEEDS_COPY