diff options
Diffstat (limited to 'sd/source/core/drawdoc3.cxx')
-rwxr-xr-x | sd/source/core/drawdoc3.cxx | 320 |
1 files changed, 160 insertions, 160 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 025700a790fc..7a74c082f7ec 100755 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -80,9 +80,9 @@ using namespace ::com::sun::star; -#define POOL_BUFFER_SIZE (USHORT)32768 -#define BASIC_BUFFER_SIZE (USHORT)8192 -#define DOCUMENT_BUFFER_SIZE (USHORT)32768 +#define POOL_BUFFER_SIZE (sal_uInt16)32768 +#define BASIC_BUFFER_SIZE (sal_uInt16)8192 +#define DOCUMENT_BUFFER_SIZE (sal_uInt16)32768 /************************************************************************* |* @@ -108,24 +108,24 @@ void SdStorageListener::disposing( const lang::EventObject& aEvent ) throw ( uno SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium) { - BOOL bOK = TRUE; + sal_Bool bOK = sal_True; SdDrawDocument* pBookmarkDoc = NULL; String aBookmarkName = rMedium.GetName(); const SfxFilter* pFilter = rMedium.GetFilter(); if ( !pFilter ) { - rMedium.UseInteractionHandler( TRUE ); + rMedium.UseInteractionHandler( sal_True ); SFX_APP()->GetFilterMatcher().GuessFilter( rMedium, &pFilter ); } if ( !pFilter ) { - bOK = FALSE; + bOK = sal_False; } else if ( maBookmarkFile != aBookmarkName && aBookmarkName.Len() ) { - BOOL bCreateGraphicShell = pFilter->GetServiceName().EqualsAscii( "com.sun.star.drawing.DrawingDocument" ); - BOOL bCreateImpressShell = pFilter->GetServiceName().EqualsAscii( "com.sun.star.presentation.PresentationDocument" ); + sal_Bool bCreateGraphicShell = pFilter->GetServiceName().EqualsAscii( "com.sun.star.drawing.DrawingDocument" ); + sal_Bool bCreateImpressShell = pFilter->GetServiceName().EqualsAscii( "com.sun.star.presentation.PresentationDocument" ); if ( bCreateGraphicShell || bCreateImpressShell ) { CloseBookmarkDoc(); @@ -136,10 +136,10 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium) // direkt laden if ( bCreateGraphicShell ) // Draw - mxBookmarkDocShRef = new ::sd::GraphicDocShell(SFX_CREATE_MODE_STANDARD, TRUE); + mxBookmarkDocShRef = new ::sd::GraphicDocShell(SFX_CREATE_MODE_STANDARD, sal_True); else // Impress - mxBookmarkDocShRef = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD, TRUE); + mxBookmarkDocShRef = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD, sal_True); bOK = mxBookmarkDocShRef->DoLoad(&rMedium); if( bOK ) @@ -180,7 +180,7 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(const String& rBookmarkFile) if (maBookmarkFile != rBookmarkFile && rBookmarkFile.Len()) { - SfxMedium* pMedium = new SfxMedium( rBookmarkFile, STREAM_READ, FALSE ); + SfxMedium* pMedium = new SfxMedium( rBookmarkFile, STREAM_READ, sal_False ); pBookmarkDoc = OpenBookmarkDoc(*pMedium); } else if (mxBookmarkDocShRef.Is()) @@ -197,26 +197,26 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(const String& rBookmarkFile) |* \************************************************************************/ -BOOL SdDrawDocument::InsertBookmark( +sal_Bool SdDrawDocument::InsertBookmark( List* pBookmarkList, // Liste der Namen der einzufuegenden Bookmarks List* pExchangeList, // Liste der zu verwendenen Namen - BOOL bLink, // Bookmarks sollen als Verknuepfung eingefuegt werden - BOOL bReplace, // Aktuellen Seiten (Standard&Notiz) werden ersetzt - USHORT nInsertPos, // Einfuegeposition fuer Seiten - BOOL bNoDialogs, // Keine Dialoge anzeigen + sal_Bool bLink, // Bookmarks sollen als Verknuepfung eingefuegt werden + sal_Bool bReplace, // Aktuellen Seiten (Standard&Notiz) werden ersetzt + sal_uInt16 nInsertPos, // Einfuegeposition fuer Seiten + sal_Bool bNoDialogs, // Keine Dialoge anzeigen ::sd::DrawDocShell* pBookmarkDocSh, // Wenn gesetzt, so ist dieses das Source-Dokument - BOOL bCopy, // Seiten werden kopiert + sal_Bool bCopy, // Seiten werden kopiert Point* pObjPos) // Einfuegeposition fuer Objekte { - BOOL bOK = TRUE; - BOOL bInsertPages = FALSE; + sal_Bool bOK = sal_True; + sal_Bool bInsertPages = sal_False; if (!pBookmarkList) { /********************************************************************** * Alle Seiten werden eingefuegt **********************************************************************/ - bInsertPages = TRUE; + bInsertPages = sal_True; } else { @@ -234,20 +234,20 @@ BOOL SdDrawDocument::InsertBookmark( aBookmarkName = maBookmarkFile; } else - bOK = FALSE; + bOK = sal_False; - for (USHORT nPos = 0; bOK && ( nPos < pBookmarkList->Count() ) && !bInsertPages; nPos++) + for (sal_uInt16 nPos = 0; bOK && ( nPos < pBookmarkList->Count() ) && !bInsertPages; nPos++) { /****************************************************************** * Gibt es in der Bookmark-Liste einen Seitennamen? ******************************************************************/ String aBMPgName (*(String*) pBookmarkList->GetObject(nPos)); - BOOL bIsMasterPage; + sal_Bool bIsMasterPage; if( pBookmarkDoc->GetPageByName( aBMPgName, bIsMasterPage ) != SDRPAGE_NOTFOUND ) { // Seite gefunden - bInsertPages = TRUE; + bInsertPages = sal_True; } } } @@ -256,7 +256,7 @@ BOOL SdDrawDocument::InsertBookmark( { // Zuerst werden alle Seiten-Bookmarks eingefuegt bOK = InsertBookmarkAsPage(pBookmarkList, pExchangeList, bLink, bReplace, - nInsertPos, bNoDialogs, pBookmarkDocSh, bCopy, TRUE, FALSE); + nInsertPos, bNoDialogs, pBookmarkDocSh, bCopy, sal_True, sal_False); } if ( bOK && pBookmarkList ) @@ -289,7 +289,7 @@ SdDrawDocument::InsertBookmarkAsPage_PageFunctorBase::~InsertBookmarkAsPage_Page { } -void SdDrawDocument::IterateBookmarkPages( SdDrawDocument* pBookmarkDoc, List* pBookmarkList, USHORT nBMSdPageCount, +void SdDrawDocument::IterateBookmarkPages( SdDrawDocument* pBookmarkDoc, List* pBookmarkList, sal_uInt16 nBMSdPageCount, SdDrawDocument::InsertBookmarkAsPage_PageFunctorBase& rPageIterator ) { // @@ -319,15 +319,15 @@ void SdDrawDocument::IterateBookmarkPages( SdDrawDocument* pBookmarkDoc, List* p if( !pBookmarkList ) { // simply take master page of nPos'th page in source document - pBMMPage = (SdPage*)(&(pBookmarkDoc->GetSdPage((USHORT)nPos, PK_STANDARD)->TRG_GetMasterPage())); + pBMMPage = (SdPage*)(&(pBookmarkDoc->GetSdPage((sal_uInt16)nPos, PK_STANDARD)->TRG_GetMasterPage())); } else { // fetch nPos'th entry from bookmark list, and determine master page String aBMPgName (*(String*) pBookmarkList->GetObject(nPos)); - BOOL bIsMasterPage; + sal_Bool bIsMasterPage; - USHORT nBMPage = pBookmarkDoc->GetPageByName( aBMPgName, bIsMasterPage ); + sal_uInt16 nBMPage = pBookmarkDoc->GetPageByName( aBMPgName, bIsMasterPage ); if (nBMPage != SDRPAGE_NOTFOUND) { @@ -341,7 +341,7 @@ void SdDrawDocument::IterateBookmarkPages( SdDrawDocument* pBookmarkDoc, List* p // enforce that bookmarked page is a standard page and not already a master page if (pBMPage && pBMPage->GetPageKind()==PK_STANDARD && !pBMPage->IsMasterPage()) { - const USHORT nBMSdPage = (nBMPage - 1) / 2; + const sal_uInt16 nBMSdPage = (nBMPage - 1) / 2; pBMMPage = (SdPage*) (&(pBookmarkDoc->GetSdPage(nBMSdPage, PK_STANDARD)->TRG_GetMasterPage())); } } @@ -359,7 +359,7 @@ class InsertBookmarkAsPage_FindDuplicateLayouts : public SdDrawDocument::InsertB { public: InsertBookmarkAsPage_FindDuplicateLayouts( List* pLayoutsToTransfer, SdDrawDocument* pBookmarkDoc, - List* pBookmarkList, USHORT nBMSdPageCount ) : + List* pBookmarkList, sal_uInt16 nBMSdPageCount ) : mpLayoutsToTransfer(pLayoutsToTransfer), mpBookmarkDoc(pBookmarkDoc), mpBookmarkList(pBookmarkList), mnBMSdPageCount(nBMSdPageCount) {} virtual ~InsertBookmarkAsPage_FindDuplicateLayouts() {}; @@ -368,7 +368,7 @@ private: List* mpLayoutsToTransfer; SdDrawDocument* mpBookmarkDoc; List* mpBookmarkList; - USHORT mnBMSdPageCount; + sal_uInt16 mnBMSdPageCount; }; void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc, SdPage* pBMMPage ) @@ -381,18 +381,18 @@ void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc pLayout->Erase( pLayout->SearchAscii( SD_LT_SEPARATOR )); String* pTest = (String*) mpLayoutsToTransfer->First(); - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; while (pTest && !bFound) // found yet? { if (*pLayout == *pTest) - bFound = TRUE; + bFound = sal_True; else pTest = (String*)mpLayoutsToTransfer->Next(); } - const USHORT nMPageCount = rDoc.GetMasterPageCount(); - for (USHORT nMPage = 0; nMPage < nMPageCount && !bFound; nMPage++) + const sal_uInt16 nMPageCount = rDoc.GetMasterPageCount(); + for (sal_uInt16 nMPage = 0; nMPage < nMPageCount && !bFound; nMPage++) { /************************************************************** * Gibt es die Layouts schon im Dokument? @@ -402,7 +402,7 @@ void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc aTest.Erase( aTest.SearchAscii( SD_LT_SEPARATOR )); if (aTest == *pLayout) - bFound = TRUE; + bFound = sal_True; } if (!bFound) @@ -426,22 +426,22 @@ private: }; -BOOL SdDrawDocument::InsertBookmarkAsPage( +sal_Bool SdDrawDocument::InsertBookmarkAsPage( List* pBookmarkList, List* pExchangeList, // Liste der zu verwendenen Namen - BOOL bLink, - BOOL bReplace, - USHORT nInsertPos, - BOOL bNoDialogs, + sal_Bool bLink, + sal_Bool bReplace, + sal_uInt16 nInsertPos, + sal_Bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh, - BOOL bCopy, - BOOL bMergeMasterPages, - BOOL bPreservePageNames) + sal_Bool bCopy, + sal_Bool bMergeMasterPages, + sal_Bool bPreservePageNames) { - BOOL bOK = TRUE; - BOOL bContinue = TRUE; - BOOL bScaleObjects = FALSE; - USHORT nReplacedStandardPages = 0; + sal_Bool bOK = sal_True; + sal_Bool bContinue = sal_True; + sal_Bool bScaleObjects = sal_False; + sal_uInt16 nReplacedStandardPages = 0; SdDrawDocument* pBookmarkDoc = NULL; String aBookmarkName; @@ -462,16 +462,16 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( } else { - return FALSE; + return sal_False; } - const USHORT nSdPageCount = GetSdPageCount(PK_STANDARD); - const USHORT nBMSdPageCount = pBookmarkDoc->GetSdPageCount(PK_STANDARD); - const USHORT nMPageCount = GetMasterPageCount(); + const sal_uInt16 nSdPageCount = GetSdPageCount(PK_STANDARD); + const sal_uInt16 nBMSdPageCount = pBookmarkDoc->GetSdPageCount(PK_STANDARD); + const sal_uInt16 nMPageCount = GetMasterPageCount(); if (nSdPageCount==0 || nBMSdPageCount==0 || nMPageCount==0) { - bContinue = bOK = FALSE; + bContinue = bOK = sal_False; return(bContinue); } @@ -481,18 +481,18 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( // Note that the pointers are used later on as general page pointers. SdPage* pRefPage = GetSdPage(0, PK_STANDARD); Size aSize(pRefPage->GetSize()); - INT32 nLeft = pRefPage->GetLftBorder(); - INT32 nRight = pRefPage->GetRgtBorder(); - INT32 nUpper = pRefPage->GetUppBorder(); - INT32 nLower = pRefPage->GetLwrBorder(); + sal_Int32 nLeft = pRefPage->GetLftBorder(); + sal_Int32 nRight = pRefPage->GetRgtBorder(); + sal_Int32 nUpper = pRefPage->GetUppBorder(); + sal_Int32 nLower = pRefPage->GetLwrBorder(); Orientation eOrient = pRefPage->GetOrientation(); SdPage* pNPage = GetSdPage(0, PK_NOTES); Size aNSize(GetSdPage(0, PK_NOTES)->GetSize()); - INT32 nNLeft = pNPage->GetLftBorder(); - INT32 nNRight = pNPage->GetRgtBorder(); - INT32 nNUpper = pNPage->GetUppBorder(); - INT32 nNLower = pNPage->GetLwrBorder(); + sal_Int32 nNLeft = pNPage->GetLftBorder(); + sal_Int32 nNRight = pNPage->GetRgtBorder(); + sal_Int32 nNUpper = pNPage->GetUppBorder(); + sal_Int32 nNLower = pNPage->GetLwrBorder(); Orientation eNOrient = pRefPage->GetOrientation(); // Seitengroesse und -raender an die Werte der letzten @@ -504,7 +504,7 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( if( !pBookmarkList ) bScaleObjects = pRefPage->IsScaleObjects(); else - bScaleObjects = TRUE; + bScaleObjects = sal_True; } else { @@ -517,7 +517,7 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( pBMPage->GetLwrBorder() != pRefPage->GetLwrBorder()) { String aStr(SdResId(STR_SCALE_OBJECTS)); - USHORT nBut = QueryBox( NULL, WB_YES_NO_CANCEL, aStr).Execute(); + sal_uInt16 nBut = QueryBox( NULL, WB_YES_NO_CANCEL, aStr).Execute(); bScaleObjects = nBut == RET_YES; bContinue = nBut != RET_CANCEL; @@ -562,7 +562,7 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( // Wenn Vorlagen kopiert werden muessen, dann muessen auch die // MasterPages kopiert werden! if( pLayout ) - bMergeMasterPages = TRUE; + bMergeMasterPages = sal_True; while (pLayout) { @@ -574,7 +574,7 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( { if( pUndoMgr ) { - SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction(this, aCreatedStyles, TRUE); + SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction(this, aCreatedStyles, sal_True); pUndoMgr->AddUndoAction(pMovStyles); } } @@ -603,17 +603,17 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( nInsertPos = GetPageCount(); } - USHORT nActualInsertPos = nInsertPos; + sal_uInt16 nActualInsertPos = nInsertPos; List aNameList; - std::set<USHORT> aRenameSet; - USHORT nBMSdPage; + std::set<sal_uInt16> aRenameSet; + sal_uInt16 nBMSdPage; for (nBMSdPage=0; nBMSdPage < nBMSdPageCount; nBMSdPage++) { SdPage* pBMPage = pBookmarkDoc->GetSdPage(nBMSdPage, PK_STANDARD); String pName( pBMPage->GetName() ); - BOOL bIsMasterPage; + sal_Bool bIsMasterPage; if (bLink) { @@ -636,8 +636,8 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( 0xFFFF, // Aber alle anderen nActualInsertPos, // An Position einfuegen bMergeMasterPages, // MasterPages mitnehmen - FALSE, // Aber nur die benoetigten MasterPages - TRUE, // Undo-Aktion erzeugen + sal_False, // Aber nur die benoetigten MasterPages + sal_True, // Undo-Aktion erzeugen bCopy); // Seiten kopieren (oder mergen) for (nBMSdPage=0; nBMSdPage < nBMSdPageCount; nBMSdPage++) @@ -677,19 +677,19 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( if (nInsertPos >= GetPageCount()) { // Seiten werden hinten angefuegt - bReplace = FALSE; + bReplace = sal_False; nInsertPos = GetPageCount(); } - USHORT nActualInsertPos = nInsertPos; + sal_uInt16 nActualInsertPos = nInsertPos; // Collect the bookmarked pages. ::std::vector<SdPage*> aBookmarkedPages (pBookmarkList->Count(), NULL); - for (USHORT nPos = 0; nPos < pBookmarkList->Count(); nPos++) + for (sal_uInt16 nPos = 0; nPos < pBookmarkList->Count(); nPos++) { String aPgName(*(String*) pBookmarkList->GetObject(nPos)); - BOOL bIsMasterPage; - USHORT nBMPage = pBookmarkDoc->GetPageByName( aPgName, bIsMasterPage ); + sal_Bool bIsMasterPage; + sal_uInt16 nBMPage = pBookmarkDoc->GetPageByName( aPgName, bIsMasterPage ); if (nBMPage != SDRPAGE_NOTFOUND) { @@ -697,10 +697,10 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( } } - for (USHORT nPos = 0; nPos < pBookmarkList->Count(); nPos++) + for (sal_uInt16 nPos = 0; nPos < pBookmarkList->Count(); nPos++) { pBMPage = aBookmarkedPages[nPos]; - USHORT nBMPage = pBMPage!=NULL ? pBMPage->GetPageNum() : SDRPAGE_NOTFOUND; + sal_uInt16 nBMPage = pBMPage!=NULL ? pBMPage->GetPageNum() : SDRPAGE_NOTFOUND; if (pBMPage && pBMPage->GetPageKind()==PK_STANDARD && !pBMPage->IsMasterPage()) { @@ -713,8 +713,8 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( // #67905# don't change name if source and dest model are the same! // #96029# avoid renaming if replacing the same page String aPgName(*(String*) pBookmarkList->GetObject(nPos)); - BOOL bIsMasterPage; - USHORT nPageSameName = GetPageByName(aPgName, bIsMasterPage); + sal_Bool bIsMasterPage; + sal_uInt16 nPageSameName = GetPageByName(aPgName, bIsMasterPage); if( pBookmarkDoc != this && nPageSameName != SDRPAGE_NOTFOUND && ( !bReplace || @@ -734,8 +734,8 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( nBMPage+1, // Bis Seite (Notizen) nActualInsertPos, // An Position einfuegen bMergeMasterPages, // MasterPages mitnehmen - FALSE, // Aber nur die benoetigten MasterPages - TRUE, // Undo-Aktion erzeugen + sal_False, // Aber nur die benoetigten MasterPages + sal_True, // Undo-Aktion erzeugen bCopy); // Seiten kopieren (oder mergen) if( bReplace ) @@ -834,17 +834,17 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( |* DrawingEngine gleiche Praesentationslayouts nicht erkennen kann. |* Ueberzaehlige MasterPages entfernen. \*************************************************************************/ - USHORT nNewMPageCount = GetMasterPageCount(); + sal_uInt16 nNewMPageCount = GetMasterPageCount(); // rueckwaerts, damit Nummern nicht durcheinander geraten - for (USHORT nPage = nNewMPageCount - 1; nPage >= nMPageCount; nPage--) + for (sal_uInt16 nPage = nNewMPageCount - 1; nPage >= nMPageCount; nPage--) { pRefPage = (SdPage*) GetMasterPage(nPage); String aMPLayout(pRefPage->GetLayoutName()); PageKind eKind = pRefPage->GetPageKind(); // gibt's den schon? - for (USHORT nTest = 0; nTest < nMPageCount; nTest++) + for (sal_uInt16 nTest = 0; nTest < nMPageCount; nTest++) { SdPage* pTest = (SdPage*) GetMasterPage(nTest); String aTest(pTest->GetLayoutName()); @@ -870,8 +870,8 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( // #96029# nInsertPos > 2 is always true when inserting into non-empty models if (nInsertPos > 0) { - USHORT nSdPageStart = (nInsertPos - 1) / 2; - USHORT nSdPageEnd = GetSdPageCount(PK_STANDARD) - nSdPageCount + + sal_uInt16 nSdPageStart = (nInsertPos - 1) / 2; + sal_uInt16 nSdPageEnd = GetSdPageCount(PK_STANDARD) - nSdPageCount + nSdPageStart - 1; const bool bRemoveEmptyPresObj = pBookmarkDoc && (pBookmarkDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS) && @@ -882,7 +882,7 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( nSdPageEnd = nSdPageStart + nReplacedStandardPages - 1; } - for (USHORT nSdPage = nSdPageStart; nSdPage <= nSdPageEnd; nSdPage++) + for (sal_uInt16 nSdPage = nSdPageStart; nSdPage <= nSdPageEnd; nSdPage++) { pRefPage = GetSdPage(nSdPage, PK_STANDARD); @@ -916,7 +916,7 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( if (bScaleObjects) { Rectangle aBorderRect(nLeft, nUpper, nRight, nLower); - pRefPage->ScaleObjects(aSize, aBorderRect, TRUE); + pRefPage->ScaleObjects(aSize, aBorderRect, sal_True); } pRefPage->SetSize(aSize); pRefPage->SetBorder(nLeft, nUpper, nRight, nLower); @@ -935,7 +935,7 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( if (bScaleObjects) { Rectangle aBorderRect(nNLeft, nNUpper, nNRight, nNLower); - pRefPage->ScaleObjects(aNSize, aBorderRect, TRUE); + pRefPage->ScaleObjects(aNSize, aBorderRect, sal_True); } pRefPage->SetSize(aNSize); @@ -946,7 +946,7 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( pRefPage->RemoveEmptyPresentationObjects(); } - for (USHORT nPage = nMPageCount; nPage < nNewMPageCount; nPage++) + for (sal_uInt16 nPage = nMPageCount; nPage < nNewMPageCount; nPage++) { pRefPage = (SdPage*) GetMasterPage(nPage); if (pRefPage->GetPageKind() == PK_STANDARD) @@ -954,7 +954,7 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( if (bScaleObjects) { Rectangle aBorderRect(nLeft, nUpper, nRight, nLower); - pRefPage->ScaleObjects(aSize, aBorderRect, TRUE); + pRefPage->ScaleObjects(aSize, aBorderRect, sal_True); } pRefPage->SetSize(aSize); pRefPage->SetBorder(nLeft, nUpper, nRight, nLower); @@ -965,7 +965,7 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( if (bScaleObjects) { Rectangle aBorderRect(nNLeft, nNUpper, nNRight, nNLower); - pRefPage->ScaleObjects(aNSize, aBorderRect, TRUE); + pRefPage->ScaleObjects(aNSize, aBorderRect, sal_True); } pRefPage->SetSize(aNSize); pRefPage->SetBorder(nNLeft, nNUpper, nNRight, nNLower); @@ -978,7 +978,7 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( } // #91146# Make absolutely sure no double masterpages are there - RemoveUnnecessaryMasterPages(NULL, TRUE, TRUE); + RemoveUnnecessaryMasterPages(NULL, sal_True, sal_True); if( bUndo ) EndUndo(); @@ -993,15 +993,15 @@ BOOL SdDrawDocument::InsertBookmarkAsPage( |* \************************************************************************/ -BOOL SdDrawDocument::InsertBookmarkAsObject( +sal_Bool SdDrawDocument::InsertBookmarkAsObject( List* pBookmarkList, List* pExchangeList, // Liste der zu verwendenen Namen - BOOL /* bLink */, + sal_Bool /* bLink */, ::sd::DrawDocShell* pBookmarkDocSh, Point* pObjPos) { - BOOL bOK = TRUE; - BOOL bOLEObjFound = FALSE; + sal_Bool bOK = sal_True; + sal_Bool bOLEObjFound = sal_False; ::sd::View* pBMView = NULL; SdDrawDocument* pBookmarkDoc = NULL; @@ -1023,7 +1023,7 @@ BOOL SdDrawDocument::InsertBookmarkAsObject( } else { - return FALSE; + return sal_False; } if (!pBookmarkList) @@ -1037,7 +1037,7 @@ BOOL SdDrawDocument::InsertBookmarkAsObject( SdrPage* pPage; SdrPageView* pPV; - for (USHORT nPos = 0; nPos < pBookmarkList->Count(); nPos++) + for (sal_uInt16 nPos = 0; nPos < pBookmarkList->Count(); nPos++) { /****************************************************************** * Namen der Bookmarks aus Liste holen @@ -1053,7 +1053,7 @@ BOOL SdDrawDocument::InsertBookmarkAsObject( if (pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_OLE2) { - bOLEObjFound = TRUE; + bOLEObjFound = sal_True; } if (!pBMView) @@ -1076,7 +1076,7 @@ BOOL SdDrawDocument::InsertBookmarkAsObject( pPV = pBMView->ShowSdrPage(pPage); } - pBMView->MarkObj(pObj, pPV, FALSE); + pBMView->MarkObj(pObj, pPV, sal_False); } } } @@ -1123,7 +1123,7 @@ BOOL SdDrawDocument::InsertBookmarkAsObject( aObjPos = Rectangle(Point(), pPage->GetSize()).Center(); } - ULONG nCountBefore = 0; + sal_uLong nCountBefore = 0; if (pExchangeList) { @@ -1133,13 +1133,13 @@ BOOL SdDrawDocument::InsertBookmarkAsObject( } if (bOLEObjFound) - pBMView->GetDoc()->SetAllocDocSh(TRUE); + pBMView->GetDoc()->SetAllocDocSh(sal_True); SdDrawDocument* pTmpDoc = (SdDrawDocument*) pBMView->GetAllMarkedModel(); bOK = pView->Paste(*pTmpDoc, aObjPos, pPage); if (bOLEObjFound) - pBMView->GetDoc()->SetAllocDocSh(FALSE); + pBMView->GetDoc()->SetAllocDocSh(sal_False); if (!bOLEObjFound) delete pTmpDoc; // Wird ansonsten von der DocShell zerstoert @@ -1151,9 +1151,9 @@ BOOL SdDrawDocument::InsertBookmarkAsObject( if (pExchangeList) { // Anzahl Objekte nach dem Einfuegen bestimmen - ULONG nCount = pPage->GetObjCount(); + sal_uLong nCount = pPage->GetObjCount(); - for (ULONG nObj = nCountBefore; nObj < nCount; nObj++) + for (sal_uLong nObj = nCountBefore; nObj < nCount; nObj++) { // Zuverwendener Name aus Exchange-Liste holen if (pExchangeList->GetCurObject()) @@ -1225,7 +1225,7 @@ void SdDrawDocument::DisposeLoadedModels() FASTBOOL SdDrawDocument::IsReadOnly() const { - return FALSE; + return sal_False; } @@ -1236,7 +1236,7 @@ FASTBOOL SdDrawDocument::IsReadOnly() const |* \************************************************************************/ -void SdDrawDocument::SetAllocDocSh(BOOL bAlloc) +void SdDrawDocument::SetAllocDocSh(sal_Bool bAlloc) { mbAllocDocSh = bAlloc; @@ -1254,7 +1254,7 @@ void SdDrawDocument::SetAllocDocSh(BOOL bAlloc) |* \************************************************************************/ -List* SdDrawDocument::GetCustomShowList(BOOL bCreate) +List* SdDrawDocument::GetCustomShowList(sal_Bool bCreate) { if (!mpCustomShowList && bCreate) { @@ -1330,9 +1330,9 @@ SvStream* SdDrawDocument::GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) if( pRet ) { // try to get some information from stream - const ULONG nStartPos = pRet->Tell(); - const ULONG nEndPos = pRet->Seek( STREAM_SEEK_TO_END ); - const ULONG nStmLen = nEndPos - nStartPos; + const sal_uLong nStartPos = pRet->Tell(); + const sal_uLong nEndPos = pRet->Seek( STREAM_SEEK_TO_END ); + const sal_uLong nStmLen = nEndPos - nStartPos; sal_uChar aTestByte; // try to read one byte @@ -1353,13 +1353,13 @@ SvStream* SdDrawDocument::GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) |* \************************************************************************/ -void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, BOOL bOnlyDuplicatePages, BOOL bUndo) +void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool bOnlyDuplicatePages, sal_Bool bUndo) { ::sd::View* pView = NULL; SfxUndoManager* pUndoMgr = NULL; if( bUndo && !IsUndoEnabled() ) - bUndo = FALSE; + bUndo = sal_False; if (mpDocSh) { @@ -1372,7 +1372,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, BOOL bOnl /*********************************************************** * Alle MasterPages pruefen ***********************************************************/ - USHORT nSdMasterPageCount = GetMasterSdPageCount( PK_STANDARD ); + sal_uInt16 nSdMasterPageCount = GetMasterSdPageCount( PK_STANDARD ); for (sal_Int32 nMPage = nSdMasterPageCount - 1; nMPage >= 0; nMPage--) { SdPage* pMaster = pMasterPage; @@ -1380,12 +1380,12 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, BOOL bOnl if (!pMaster) { - pMaster = (SdPage*) GetMasterSdPage( (USHORT) nMPage, PK_STANDARD ); - pNotesMaster = (SdPage*) GetMasterSdPage( (USHORT) nMPage, PK_NOTES ); + pMaster = (SdPage*) GetMasterSdPage( (sal_uInt16) nMPage, PK_STANDARD ); + pNotesMaster = (SdPage*) GetMasterSdPage( (sal_uInt16) nMPage, PK_NOTES ); } else { - for ( USHORT nMPg = 0; nMPg < GetMasterPageCount(); nMPg++ ) + for ( sal_uInt16 nMPg = 0; nMPg < GetMasterPageCount(); nMPg++ ) { if ( pMaster == GetMasterPage( nMPg ) ) { @@ -1402,21 +1402,21 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, BOOL bOnl pNotesMaster ) { // Do not delete master pages that have their precious flag set. - BOOL bDeleteMaster = !pMaster->IsPrecious(); + sal_Bool bDeleteMaster = !pMaster->IsPrecious(); String aLayoutName = pMaster->GetLayoutName(); if(bOnlyDuplicatePages ) { // remove only duplicate pages - bDeleteMaster = FALSE; - for (USHORT i = 0; i < GetMasterSdPageCount( PK_STANDARD ); i++) + bDeleteMaster = sal_False; + for (sal_uInt16 i = 0; i < GetMasterSdPageCount( PK_STANDARD ); i++) { SdPage* pMPg = (SdPage*) GetMasterSdPage( i, PK_STANDARD ); if( pMPg != pMaster && pMPg->GetLayoutName() == aLayoutName ) { // duplicate page found -> remove it - bDeleteMaster = TRUE; + bDeleteMaster = sal_True; } } } @@ -1461,15 +1461,15 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, BOOL bOnl EndUndo(); // schon hier, damit sich Joes Actions ZWISCHEN unsere eigenen schieben // alte Layoutvorlagen loeschen, wenn sie nicht mehr benoetigt werden - BOOL bDeleteOldStyleSheets = TRUE; - for ( USHORT nMPg = 0; + sal_Bool bDeleteOldStyleSheets = sal_True; + for ( sal_uInt16 nMPg = 0; nMPg < GetMasterPageCount() && bDeleteOldStyleSheets; nMPg++ ) { SdPage* pMPg = (SdPage*) GetMasterPage(nMPg); if (pMPg->GetLayoutName() == aLayoutName) { - bDeleteOldStyleSheets = FALSE; + bDeleteOldStyleSheets = sal_False; } } @@ -1516,14 +1516,14 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, BOOL bOnl |* Ist rLayoutName leer, so wird die erste MasterPage genommen \************************************************************************/ -void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, +void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum, const String& rLayoutName, SdDrawDocument* pSourceDoc, - BOOL bMaster, - BOOL bCheckMasters) + sal_Bool bMaster, + sal_Bool bCheckMasters) { if( mpDocSh ) - mpDocSh->SetWaitCursor( TRUE ); + mpDocSh->SetWaitCursor( sal_True ); SfxUndoManager* pUndoMgr = mpDocSh->GetUndoManager(); @@ -1550,7 +1550,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, if (pSourceDoc) { List* pReplList = NULL; - BOOL bLayoutReloaded = FALSE; // Wurde ex. Layout wieder geladen? + sal_Bool bLayoutReloaded = sal_False; // Wurde ex. Layout wieder geladen? /********************************************************************* |* LayoutName, Page and Notespage @@ -1568,7 +1568,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, aSearchFor.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR )); aSearchFor.Append( String(SdResId(STR_LAYOUT_OUTLINE))) ; - for (USHORT nMP = 0; nMP < pSourceDoc->GetMasterPageCount(); nMP++) + for (sal_uInt16 nMP = 0; nMP < pSourceDoc->GetMasterPageCount(); nMP++) { SdPage* pMP = (SdPage*) pSourceDoc->GetMasterPage(nMP); @@ -1601,7 +1601,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, pUndoMgr->LeaveListAction(); if( mpDocSh ) - mpDocSh->SetWaitCursor( FALSE ); + mpDocSh->SetWaitCursor( sal_False ); DBG_ERROR( "SdDrawDocument::SetMasterPage() failed!" ); @@ -1610,13 +1610,13 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, if (pSourceDoc != this) { - const USHORT nMasterPageCount = GetMasterPageCount(); - for ( USHORT nMPage = 0; nMPage < nMasterPageCount; nMPage++ ) + const sal_uInt16 nMasterPageCount = GetMasterPageCount(); + for ( sal_uInt16 nMPage = 0; nMPage < nMasterPageCount; nMPage++ ) { SdPage* pCheckMaster = (SdPage*)GetMasterPage(nMPage); if( pCheckMaster->GetName() == aNewLayoutName ) { - bLayoutReloaded = TRUE; + bLayoutReloaded = sal_True; break; } } @@ -1647,7 +1647,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, { // Es ist eine gleichnamige Vorlage vorhanden ist: Inhalte ersetzen #ifdef DBG_UTIL - BOOL bTest = + sal_Bool bTest = #endif pMySheet->SetName(pHisSheet->GetName()); DBG_ASSERT(bTest, "StyleSheet-Umbenennung fehlgeschlagen"); @@ -1677,7 +1677,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, pReplData->aNewName = pMySheet->GetName(); String aTemp(pMySheet->GetName()); - USHORT nPos = aTemp.SearchAscii( SD_LT_SEPARATOR ); + sal_uInt16 nPos = aTemp.SearchAscii( SD_LT_SEPARATOR ); aTemp.Erase(0, nPos); aTemp.Insert(aOldLayoutName, 0); pReplData->aName = aTemp; @@ -1707,7 +1707,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, if (rParentOfOld.Len() > 0 && rParentOfNew.Len() == 0) { - for (ULONG i = 0; i < pReplList->Count(); i++) + for (sal_uLong i = 0; i < pReplList->Count(); i++) { StyleReplaceData* pRD = (StyleReplaceData*)pReplList-> GetObject(i); @@ -1732,7 +1732,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, { // UndoAction fuer das Erzeugen und Einfuegen vorn StyleSheets // auf den UndoManager legen - SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction( this, aCreatedStyles, TRUE); + SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction( this, aCreatedStyles, sal_True); pUndoMgr->AddUndoAction(pMovStyles); } } @@ -1761,7 +1761,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, // dagegen ersetzt, so muss vor der Position der alten Masterpage // eingefuegt werden, damit ab jetzt beim Suchen (z. B. SdPage:: // SetPresentationLayout) die neue Masterpage zuerst gefunden wird - USHORT nInsertPos = rOldMaster.GetPageNum(); + sal_uInt16 nInsertPos = rOldMaster.GetPageNum(); BegUndo(); if (!bLayoutReloaded) @@ -1792,7 +1792,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, if (bMaster || bLayoutReloaded) { - for (USHORT nPage = 1; nPage < GetPageCount(); nPage++) + for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++) { pPage = (SdPage*) GetPage(nPage); String aTest = pPage->GetLayoutName(); @@ -1821,7 +1821,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, (this, pPage->IsMasterPage() ? aLayoutName : aOldLayoutName, aLayoutName, - eAutoLayout, eAutoLayout, FALSE, pPage); + eAutoLayout, eAutoLayout, sal_False, pPage); pUndoMgr->AddUndoAction(pPLUndoAction); } pPage->SetPresentationLayout(aLayoutName); @@ -1842,7 +1842,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, rOldMaster.GetUppBorder(), rOldMaster.GetRgtBorder(), rOldMaster.GetLwrBorder()); - pMaster->ScaleObjects(aSize, aBorderRect, TRUE); + pMaster->ScaleObjects(aSize, aBorderRect, sal_True); pMaster->SetSize(aSize); pMaster->SetBorder(rOldMaster.GetLftBorder(), rOldMaster.GetUppBorder(), @@ -1856,7 +1856,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, rOldNotesMaster.GetUppBorder(), rOldNotesMaster.GetRgtBorder(), rOldNotesMaster.GetLwrBorder()); - pNotesMaster->ScaleObjects(aSize, aNotesBorderRect, TRUE); + pNotesMaster->ScaleObjects(aSize, aNotesBorderRect, sal_True); pNotesMaster->SetSize(aSize); pNotesMaster->SetBorder(rOldNotesMaster.GetLftBorder(), rOldNotesMaster.GetUppBorder(), @@ -1890,9 +1890,9 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, \********************************************************************/ String aName = String(SdResId(STR_LAYOUT_DEFAULT_NAME)); String aTest; - BOOL bNotANewName = TRUE; - USHORT nCount = 0; - USHORT nMPgCount = GetMasterPageCount(); + sal_Bool bNotANewName = sal_True; + sal_uInt16 nCount = 0; + sal_uInt16 nMPgCount = GetMasterPageCount(); for (nCount = 0; bNotANewName; nCount++) { @@ -1902,15 +1902,15 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, aTest += String::CreateFromInt32( nCount ); // gibt's schon eine, die so heisst? - bNotANewName = FALSE; - for (USHORT nMPg = 1; nMPg < nMPgCount; nMPg++) + bNotANewName = sal_False; + for (sal_uInt16 nMPg = 1; nMPg < nMPgCount; nMPg++) { const SdrPage* pTest = GetMasterPage(nMPg); String aPageLayoutName(pTest->GetLayoutName()); aPageLayoutName.Erase( aPageLayoutName.SearchAscii( SD_LT_SEPARATOR )); if (aPageLayoutName == aTest) - bNotANewName = TRUE; + bNotANewName = sal_True; } } aName = aTest; @@ -1927,7 +1927,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, if( bUndo ) { - SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction(this, aCreatedStyles, TRUE); + SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction(this, aCreatedStyles, sal_True); pUndoMgr->AddUndoAction(pMovStyles); } @@ -1938,7 +1938,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, if( bUndo ) BegUndo(); - pMaster = (SdPage*) AllocPage(TRUE); + pMaster = (SdPage*) AllocPage(sal_True); pMaster->SetSize(pSelectedPage->GetSize()); pMaster->SetBorder(pSelectedPage->GetLftBorder(), pSelectedPage->GetUppBorder(), @@ -1953,7 +1953,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, pMaster->SetAutoLayout(AUTOLAYOUT_NONE, true, true); - pNotesMaster = (SdPage*) AllocPage(TRUE); + pNotesMaster = (SdPage*) AllocPage(sal_True); pNotesMaster->SetPageKind(PK_NOTES); pNotesMaster->SetSize(pNotes->GetSize()); pNotesMaster->SetBorder(pNotes->GetLftBorder(), @@ -1978,7 +1978,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, List* pPageList = new List; if (bMaster) { - for (USHORT nPage = 1; nPage < GetPageCount(); nPage++) + for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++) { pPage = (SdPage*) GetPage(nPage); const String s(pPage->GetLayoutName()); @@ -2009,7 +2009,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, SdPresentationLayoutUndoAction * pPLUndoAction = new SdPresentationLayoutUndoAction (this, aOldLayoutName, aName, - eOldAutoLayout, eNewAutoLayout, TRUE, + eOldAutoLayout, eNewAutoLayout, sal_True, pPage); pUndoMgr->AddUndoAction(pPLUndoAction); } @@ -2044,14 +2044,14 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, pUndoMgr->LeaveListAction(); if( mpDocSh ) - mpDocSh->SetWaitCursor( FALSE ); + mpDocSh->SetWaitCursor( sal_False ); } void SdDrawDocument::Merge(SdrModel& rSourceModel, - USHORT nFirstPageNum, USHORT nLastPageNum, - USHORT nDestPos, + sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum, + sal_uInt16 nDestPos, FASTBOOL bMergeMasterPages, FASTBOOL bAllMasterPages, FASTBOOL bUndo, FASTBOOL bTreadSourceAsConst) { |