summaryrefslogtreecommitdiff
path: root/sd/source/ui/func/fuexpand.cxx
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2002-05-07 13:04:19 +0000
committerChristian Lippka <cl@openoffice.org>2002-05-07 13:04:19 +0000
commit6d5a235b31f12625a51614b703c0f0dc0fc808d7 (patch)
tree069b62c31e6f1abc190aa0693c96eac38fa118f8 /sd/source/ui/func/fuexpand.cxx
parent53a5d8eb98abea3004d5a2f8a92aa910a6b4bf0d (diff)
#97794# correct para depth on created pages
Diffstat (limited to 'sd/source/ui/func/fuexpand.cxx')
-rw-r--r--sd/source/ui/func/fuexpand.cxx54
1 files changed, 50 insertions, 4 deletions
diff --git a/sd/source/ui/func/fuexpand.cxx b/sd/source/ui/func/fuexpand.cxx
index 9c47f9ab8e24..67d5a4f9dc6c 100644
--- a/sd/source/ui/func/fuexpand.cxx
+++ b/sd/source/ui/func/fuexpand.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fuexpand.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: dl $ $Date: 2001-10-23 13:49:54 $
+ * last change: $Author: cl $ $Date: 2002-05-07 14:04:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -74,6 +74,13 @@
#include <sfx2/printer.hxx>
#endif
+#ifndef _OUTLOBJ_HXX
+#include <svx/outlobj.hxx>
+#endif
+#ifndef _SVDETC_HXX
+#include <svx/svdetc.hxx>
+#endif
+
#include "app.hrc"
#include "strings.hrc"
#include "fuexpand.hxx"
@@ -213,7 +220,28 @@ FuExpandPage::FuExpandPage(SdViewShell* pViewSh, SdWindow* pWin, SdView* pView,
// Title-Textobjekt erstellen
SdrTextObj* pTextObj = (SdrTextObj*) pPage->GetPresObj(PRESOBJ_TITLE);
- pTextObj->SetOutlinerParaObject(pOutl->CreateParaObject( (USHORT) nParaPos, 1));
+
+//
+ OutlinerParaObject* pOutlinerParaObject = pOutl->CreateParaObject( (USHORT) nParaPos, 1);
+ pOutlinerParaObject->SetOutlinerMode(OUTLINERMODE_TITLEOBJECT);
+
+ if( pOutlinerParaObject->GetDepth(0) != 0 )
+ {
+ SdrOutliner* pTempOutl = SdrMakeOutliner( OUTLINERMODE_TITLEOBJECT, pDoc );
+
+ pTempOutl->SetText( *pOutlinerParaObject );
+ pTempOutl->SetMinDepth(0);
+
+ delete pOutlinerParaObject;
+
+ pTempOutl->SetDepth( pTempOutl->GetParagraph( 0 ), 0 );
+
+ pOutlinerParaObject = pTempOutl->CreateParaObject();
+ delete pTempOutl;
+ }
+
+ pTextObj->SetOutlinerParaObject(pOutlinerParaObject);
+
pTextObj->SetEmptyPresObj(FALSE);
SfxStyleSheet* pSheet = pPage->GetStyleSheetForPresObj(PRESOBJ_TITLE);
@@ -227,7 +255,25 @@ FuExpandPage::FuExpandPage(SdViewShell* pViewSh, SdWindow* pWin, SdView* pView,
SdrTextObj* pTextObj = (SdrTextObj*) pPage->GetPresObj(PRESOBJ_OUTLINE);
pPara = pOutl->GetParagraph( ++nParaPos );
- pTextObj->SetOutlinerParaObject(pOutl->CreateParaObject( (USHORT) nParaPos, (USHORT) nChildCount) );
+ OutlinerParaObject* pOutlinerParaObject = pOutl->CreateParaObject( (USHORT) nParaPos, (USHORT) nChildCount);
+
+// --
+ SdrOutliner* pTempOutl = SdrMakeOutliner( OUTLINERMODE_OUTLINEOBJECT, pDoc );
+ pTempOutl->SetText( *pOutlinerParaObject );
+
+ ULONG nParaCount = pTempOutl->GetParagraphCount();
+ ULONG nPara;
+ for( nPara = 0; nPara < nParaCount; nPara++ )
+ {
+ pTempOutl->SetDepth( pTempOutl->GetParagraph( nPara ), pTempOutl->GetDepth( nPara ) - 1 );
+ }
+
+ delete pOutlinerParaObject;
+ pOutlinerParaObject = pTempOutl->CreateParaObject();
+ delete pTempOutl;
+
+// --
+ pTextObj->SetOutlinerParaObject( pOutlinerParaObject );
pTextObj->SetEmptyPresObj(FALSE);
// Harte Attribute entfernen (Flag auf TRUE)