diff options
Diffstat (limited to 'sfx2/source/doc/objcont.cxx')
-rwxr-xr-x[-rw-r--r--] | sfx2/source/doc/objcont.cxx | 150 |
1 files changed, 59 insertions, 91 deletions
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 096f26ecd06f..a43ccd48214e 100644..100755 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -63,7 +63,7 @@ #include <vcl/oldprintadaptor.hxx> #include <sfx2/app.hxx> -#include "sfxresid.hxx" +#include "sfx2/sfxresid.hxx" #include "appdata.hxx" #include <sfx2/dinfdlg.hxx> #include "fltfnc.hxx" @@ -72,11 +72,11 @@ #include <sfx2/objsh.hxx> #include "objshimp.hxx" #include <sfx2/evntconf.hxx> -#include "sfxhelp.hxx" +#include "sfx2/sfxhelp.hxx" #include <sfx2/dispatch.hxx> #include <sfx2/printer.hxx> +#include "sfx2/basmgr.hxx" #include <sfx2/viewfrm.hxx> -#include "basmgr.hxx" #include <sfx2/doctempl.hxx> #include "doc.hrc" #include <sfx2/sfxbasemodel.hxx> @@ -137,7 +137,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent ) const ::boost::shared_ptr<GDIMetaFile> pFile(new GDIMetaFile); VirtualDevice aDevice; - aDevice.EnableOutput( FALSE ); + aDevice.EnableOutput( sal_False ); MapMode aMode( ((SfxObjectShell*)this)->GetMapUnit() ); aDevice.SetMapMode( aMode ); @@ -245,7 +245,7 @@ void SfxObjectShell::UpdateTime_Impl( // Initialize some local member! Its neccessary for wollow operations! DateTime aNow ; // Date and time at current moment Time n24Time (24,0,0,0) ; // Time-value for 24 hours - see follow calculation - ULONG nDays = 0 ; // Count of days between now and last editing + sal_uIntPtr nDays = 0 ; // Count of days between now and last editing Time nAddTime (0) ; // Value to add on aOldTime // Safe impossible cases! @@ -344,7 +344,7 @@ sal_uInt16 SfxObjectShell::GetContentCount(sal_uInt16 nIdx) //-------------------------------------------------------------------- //TODO/CLEANUP: remove this method -void SfxObjectShell::TriggerHelpPI(USHORT nIdx1, USHORT nIdx2) +void SfxObjectShell::TriggerHelpPI(sal_uInt16 nIdx1, sal_uInt16 nIdx2) { if(nIdx1==CONTENT_STYLE && nIdx2 != INDEX_IGNORE) //StyleSheets { @@ -383,9 +383,9 @@ void SfxObjectShell::GetContent(String &rText, { case INDEX_IGNORE: { - USHORT nTextResId = 0; - USHORT nClosedBitmapResId = 0; // evtl. sp"ater mal unterschiedliche - USHORT nOpenedBitmapResId = 0; // " " " " + sal_uInt16 nTextResId = 0; + sal_uInt16 nClosedBitmapResId = 0; // evtl. sp"ater mal unterschiedliche + sal_uInt16 nOpenedBitmapResId = 0; // " " " " switch(i) { case CONTENT_STYLE: @@ -430,7 +430,7 @@ void SfxObjectShell::GetContent(String &rText, Bitmap SfxObjectShell::GetStyleFamilyBitmap(SfxStyleFamily eFamily) { - USHORT nResId = 0; + sal_uInt16 nResId = 0; switch(eFamily) { case SFX_STYLE_FAMILY_CHAR: @@ -459,16 +459,16 @@ Bitmap SfxObjectShell::GetStyleFamilyBitmap(SfxStyleFamily eFamily) //-------------------------------------------------------------------- -BOOL SfxObjectShell::Insert(SfxObjectShell &rSource, - USHORT nSourceIdx1, - USHORT nSourceIdx2, - USHORT /*nSourceIdx3*/, - USHORT &nIdx1, - USHORT &nIdx2, - USHORT &/*nIdx3*/, - USHORT &/*nDeleted*/) +sal_Bool SfxObjectShell::Insert(SfxObjectShell &rSource, + sal_uInt16 nSourceIdx1, + sal_uInt16 nSourceIdx2, + sal_uInt16 /*nSourceIdx3*/, + sal_uInt16 &nIdx1, + sal_uInt16 &nIdx2, + sal_uInt16 &/*nIdx3*/, + sal_uInt16 &/*nDeleted*/) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if (INDEX_IGNORE == nIdx1 && CONTENT_STYLE == nSourceIdx1) nIdx1 = CONTENT_STYLE; @@ -499,8 +499,8 @@ BOOL SfxObjectShell::Insert(SfxObjectShell &rSource, SfxStyleFamily eOldFamily = pHisSheet->GetFamily(); SfxStyleSheetBase* pExist = pMyPool->Find(aOldName, eOldFamily); - // USHORT nOldHelpId = pExist->GetHelpId(??? VB ueberlegt sich was); - BOOL bUsedOrUserDefined; + // sal_uInt16 nOldHelpId = pExist->GetHelpId(??? VB ueberlegt sich was); + sal_Bool bUsedOrUserDefined; if( pExist ) { bUsedOrUserDefined = @@ -508,13 +508,13 @@ BOOL SfxObjectShell::Insert(SfxObjectShell &rSource, if( ErrorHandler::HandleError( *new MessageInfo( ERRCODE_SFXMSG_STYLEREPLACE, aOldName ) ) != ERRCODE_BUTTON_OK ) - return FALSE; + return sal_False; else { pMyPool->Replace( *pHisSheet, *pExist ); - SetModified( TRUE ); + SetModified( sal_True ); nIdx2 = nIdx1 = INDEX_IGNORE; - return TRUE; + return sal_True; } } @@ -578,13 +578,13 @@ BOOL SfxObjectShell::Insert(SfxObjectShell &rSource, } } - SetModified( TRUE ); + SetModified( sal_True ); if( !bUsedOrUserDefined ) nIdx2 = nIdx1 = INDEX_IGNORE; - bRet = TRUE; + bRet = sal_True; } else - bRet = FALSE; + bRet = sal_False; } return bRet; @@ -592,14 +592,14 @@ BOOL SfxObjectShell::Insert(SfxObjectShell &rSource, //-------------------------------------------------------------------- -BOOL SfxObjectShell::Remove +sal_Bool SfxObjectShell::Remove ( - USHORT nIdx1, - USHORT nIdx2, - USHORT /*nIdx3*/ + sal_uInt16 nIdx1, + sal_uInt16 nIdx2, + sal_uInt16 /*nIdx3*/ ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if (CONTENT_STYLE == nIdx1) { @@ -612,7 +612,7 @@ BOOL SfxObjectShell::Remove String aEmpty; SfxStyleFamily eFamily = pMySheet->GetFamily(); pMyPool->Remove(pMySheet); - bRet = TRUE; + bRet = sal_True; SfxStyleSheetBase* pTestSheet = pMyPool->First(); while (pTestSheet) @@ -634,7 +634,7 @@ BOOL SfxObjectShell::Remove pTestSheet = pMyPool->Next(); } - SetModified( TRUE ); + SetModified( sal_True ); } return bRet; @@ -642,12 +642,12 @@ BOOL SfxObjectShell::Remove //-------------------------------------------------------------------- -BOOL SfxObjectShell::Print +sal_Bool SfxObjectShell::Print ( Printer& rPrt, - USHORT nIdx1, - USHORT /*nIdx2*/, - USHORT /*nIdx3*/, + sal_uInt16 nIdx1, + sal_uInt16 /*nIdx2*/, + sal_uInt16 /*nIdx3*/, const String* pObjectName ) { @@ -661,7 +661,7 @@ BOOL SfxObjectShell::Print pStylePool->GetSearchFamily(), pStylePool->GetSearchMask() ); SfxStyleSheetBase *pStyle = pIter->First(); if ( !pStyle ) - return TRUE; + return sal_True; // pepare adaptor for old style StartPage/EndPage printing boost::shared_ptr< Printer > pPrinter( new Printer( rPrt.GetJobSetup() ) ); @@ -675,8 +675,8 @@ BOOL SfxObjectShell::Print aFont.SetWeight(WEIGHT_BOLD); pPrinter->SetFont(aFont); const Size aPageSize(pPrinter->GetOutputSize()); - const USHORT nXIndent = 200; - USHORT nYIndent = 200; + const sal_uInt16 nXIndent = 200; + sal_uInt16 nYIndent = 200; Point aOutPos(nXIndent, nYIndent); String aHeader(SfxResId(STR_PRINT_STYLES_HEADER)); if ( pObjectName ) @@ -711,13 +711,13 @@ BOOL SfxObjectShell::Print pPrinter->SetFont(aFont); aStr = pStyle->GetDescription(); const char cDelim = ' '; - USHORT nStart = 0, nIdx = 0; + sal_uInt16 nStart = 0, nIdx = 0; nTextHeight = pPrinter->GetTextHeight(); // break text into lines while(nIdx < aStr.Len()) { - USHORT nOld = nIdx; + sal_uInt16 nOld = nIdx; long nTextWidth; nIdx = aStr.Search(cDelim, nStart); nTextWidth = pPrinter->GetTextWidth(aStr, nStart, nIdx-nStart); @@ -738,7 +738,7 @@ BOOL SfxObjectShell::Print } else { - USHORT nChar = 1; + sal_uInt16 nChar = 1; while( nStart + nChar < aStr.Len() && aOutPos.X() + pPrinter->GetTextWidth( @@ -769,9 +769,9 @@ BOOL SfxObjectShell::Print break; } default: - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } //-------------------------------------------------------------------- @@ -805,7 +805,7 @@ void SfxObjectShell::LoadStyles DBG_ASSERT(pMyPool, "Dest-DocumentShell ohne StyleSheetPool"); pSourcePool->SetSearchMask(SFX_STYLE_FAMILY_ALL, 0xffff); Styles_Impl *pFound = new Styles_Impl[pSourcePool->Count()]; - USHORT nFound = 0; + sal_uInt16 nFound = 0; SfxStyleSheetBase *pSource = pSourcePool->First(); while ( pSource ) @@ -824,7 +824,7 @@ void SfxObjectShell::LoadStyles pSource = pSourcePool->Next(); } - for ( USHORT i = 0; i < nFound; ++i ) + for ( sal_uInt16 i = 0; i < nFound; ++i ) { pFound[i].pDest->GetItemSet().PutExtended(pFound[i].pSource->GetItemSet(), SFX_ITEM_DONTCARE, SFX_ITEM_DEFAULT); if(pFound[i].pSource->HasParentSupport()) @@ -897,13 +897,13 @@ void SfxObjectShell::UpdateFromTemplate_Impl( ) { // check existence of template storage aTemplURL = aFoundName; - BOOL bLoad = FALSE; + sal_Bool bLoad = sal_False; // should the document checked against changes in the template ? if ( IsQueryLoadTemplate() ) { // load document info of template - BOOL bOK = FALSE; + sal_Bool bOK = sal_False; util::DateTime aTemplDate; try { @@ -920,7 +920,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl( ) if ( aAny >>= aTemplDate ) { // get modify date from document info - bOK = TRUE; + bOK = sal_True; } } catch ( Exception& ) @@ -937,21 +937,21 @@ void SfxObjectShell::UpdateFromTemplate_Impl( ) // ask user if( bCanUpdateFromTemplate == document::UpdateDocMode::QUIET_UPDATE || bCanUpdateFromTemplate == document::UpdateDocMode::FULL_UPDATE ) - bLoad = TRUE; + bLoad = sal_True; else if ( bCanUpdateFromTemplate == document::UpdateDocMode::ACCORDING_TO_CONFIG ) { String sMessage( SfxResId( STR_QRYTEMPL_MESSAGE ) ); sMessage.SearchAndReplace( String::CreateFromAscii("$(ARG1)"), aTemplName ); sfx2::QueryTemplateBox aBox( GetDialogParent(), sMessage ); if ( RET_YES == aBox.Execute() ) - bLoad = TRUE; + bLoad = sal_True; } if( !bLoad ) { // user refuses, so don't ask again for this document - SetQueryLoadTemplate(FALSE); - SetModified( TRUE ); + SetQueryLoadTemplate(sal_False); + SetModified( sal_True ); } } } @@ -983,38 +983,6 @@ void SfxObjectShell::UpdateFromTemplate_Impl( ) } } -SfxObjectShellRef MakeObjectShellForOrganizer_Impl( const String& aTargetURL, BOOL bForWriting ) -{ - // check for own format - SfxObjectShellRef xDoc; - StreamMode nMode = bForWriting ? SFX_STREAM_READWRITE : SFX_STREAM_READONLY; - SfxMedium *pMed = new SfxMedium( aTargetURL, nMode, FALSE, 0 ); - const SfxFilter* pFilter = NULL; - pMed->UseInteractionHandler(TRUE); - if( SFX_APP()->GetFilterMatcher().GuessFilter( *pMed, &pFilter ) == ERRCODE_NONE && pFilter && pFilter->IsOwnFormat() ) - { - // create document - xDoc = SfxObjectShell::CreateObject( pFilter->GetServiceName(), SFX_CREATE_MODE_ORGANIZER ); - if ( xDoc.Is() ) - { - // partially load, so don't use DoLoad! - xDoc->DoInitNew(0); - // TODO/LATER: make sure that we don't use binary templates! - if( xDoc->LoadFrom( *pMed ) ) - { - // connect to storage, abandon temp. storage - xDoc->DoSaveCompleted( pMed ); - } - else - xDoc.Clear(); - } - } - else - delete pMed; - - return xDoc; -} - sal_Bool SfxObjectShell::IsHelpDocument() const { const SfxFilter* pFilter = GetMedium()->GetFilter(); @@ -1069,14 +1037,14 @@ sal_Bool SfxObjectShell::IsUseUserData() const void SfxObjectShell::SetQueryLoadTemplate( sal_Bool bNew ) { if ( pImp->bQueryLoadTemplate != bNew ) - SetModified( TRUE ); + SetModified( sal_True ); pImp->bQueryLoadTemplate = bNew; } void SfxObjectShell::SetUseUserData( sal_Bool bNew ) { if ( pImp->bUseUserData != bNew ) - SetModified( TRUE ); + SetModified( sal_True ); pImp->bUseUserData = bNew; } @@ -1093,14 +1061,14 @@ sal_Bool SfxObjectShell::IsSaveVersionOnClose() const void SfxObjectShell::SetLoadReadonly( sal_Bool bNew ) { if ( pImp->bLoadReadonly != bNew ) - SetModified( TRUE ); + SetModified( sal_True ); pImp->bLoadReadonly = bNew; } void SfxObjectShell::SetSaveVersionOnClose( sal_Bool bNew ) { if ( pImp->bSaveVersionOnClose != bNew ) - SetModified( TRUE ); + SetModified( sal_True ); pImp->bSaveVersionOnClose = bNew; } |