diff options
Diffstat (limited to 'sw/source/ui/app')
-rw-r--r-- | sw/source/ui/app/appenv.cxx | 78 | ||||
-rw-r--r-- | sw/source/ui/app/apphdl.cxx | 44 | ||||
-rw-r--r-- | sw/source/ui/app/applab.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/app/appopt.cxx | 114 | ||||
-rw-r--r-- | sw/source/ui/app/docsh.cxx | 211 | ||||
-rw-r--r-- | sw/source/ui/app/docsh2.cxx | 305 | ||||
-rw-r--r-- | sw/source/ui/app/docshini.cxx | 91 | ||||
-rw-r--r-- | sw/source/ui/app/docst.cxx | 155 | ||||
-rw-r--r-- | sw/source/ui/app/docstyle.cxx | 430 | ||||
-rw-r--r-- | sw/source/ui/app/mainwn.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/app/makefile.mk | 95 | ||||
-rw-r--r-- | sw/source/ui/app/mn.src | 506 | ||||
-rw-r--r-- | sw/source/ui/app/swmodul1.cxx | 20 | ||||
-rw-r--r-- | sw/source/ui/app/swmodule.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/app/swwait.cxx | 18 |
15 files changed, 1174 insertions, 909 deletions
diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx index 00621e1e38..53c7bc8b4e 100644 --- a/sw/source/ui/app/appenv.cxx +++ b/sw/source/ui/app/appenv.cxx @@ -92,16 +92,16 @@ String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText aText.EraseAllChars( '\r' ); - USHORT nTokenPos = 0; + sal_uInt16 nTokenPos = 0; while( STRING_NOTFOUND != nTokenPos ) { String aLine = aText.GetToken( 0, '\n', nTokenPos ); while ( aLine.Len() ) { String sTmpText; - BOOL bField = FALSE; + sal_Bool bField = sal_False; - USHORT nPos = aLine.Search( '<' ); + sal_uInt16 nPos = aLine.Search( '<' ); if ( nPos ) { sTmpText = aLine.Copy( 0, nPos ); @@ -122,14 +122,14 @@ String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText // Database fields must contain at least 3 points! String sDBName( sTmpText.Copy( 1, sTmpText.Len() - 2)); - USHORT nCnt = sDBName.GetTokenCount('.'); + sal_uInt16 nCnt = sDBName.GetTokenCount('.'); if (nCnt >= 3) { - ::ReplacePoint(sDBName, TRUE); + ::ReplacePoint(sDBName, sal_True); SwInsertFld_Data aData(TYP_DBFLD, 0, sDBName, aEmptyStr, 0, &rSh ); rFldMgr.InsertFld( aData ); sRet = sDBName; - bField = TRUE; + bField = sal_True; } } } @@ -143,18 +143,18 @@ String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText return sRet; } -void lcl_CopyCollAttr(SwWrtShell* pOldSh, SwWrtShell* pNewSh, USHORT nCollId) +void lcl_CopyCollAttr(SwWrtShell* pOldSh, SwWrtShell* pNewSh, sal_uInt16 nCollId) { - USHORT nCollCnt = pOldSh->GetTxtFmtCollCount(); + sal_uInt16 nCollCnt = pOldSh->GetTxtFmtCollCount(); SwTxtFmtColl* pColl; - for( USHORT nCnt = 0; nCnt < nCollCnt; ++nCnt ) + for( sal_uInt16 nCnt = 0; nCnt < nCollCnt; ++nCnt ) if(nCollId == (pColl = &pOldSh->GetTxtFmtColl(nCnt))->GetPoolFmtId()) pNewSh->GetTxtCollFromPool(nCollId)->SetFmtAttr(pColl->GetAttrSet()); } void SwModule::InsertEnv( SfxRequest& rReq ) { - static USHORT nTitleNo = 0; + static sal_uInt16 nTitleNo = 0; SwDocShell *pMyDocSh; SfxViewFrame *pFrame; @@ -167,7 +167,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) pOldSh = pMyDocSh ? pMyDocSh->GetWrtShell() : 0; // Create new document (don't show!) - SfxObjectShellRef xDocSh( new SwDocShell( SFX_CREATE_MODE_STANDARD ) ); + SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_STANDARD ) ); xDocSh->DoInitNew( 0 ); pFrame = SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 ); pNewView = (SwView*) pFrame->GetViewShell(); @@ -190,7 +190,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) SwEnvCfgItem aEnvCfg; // Check if there's already an envelope. - BOOL bEnvChange = FALSE; + sal_Bool bEnvChange = sal_False; SfxItemSet aSet(GetPool(), FN_ENVELOP, FN_ENVELOP, 0); aSet.Put(aEnvCfg.GetItem()); @@ -238,7 +238,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) if (nMode == ENV_NEWDOC || nMode == ENV_INSERT) { - SwWait aWait( (SwDocShell&)*xDocSh, TRUE ); + SwWait aWait( (SwDocShell&)*xDocSh, sal_True ); // Read dialog and save item to config const SwEnvItem& rItem = pItem ? *pItem : (const SwEnvItem&) pDlg->GetOutputItemSet()->Get(FN_ENVELOP); @@ -253,7 +253,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) { OSL_ENSURE(pOldSh, "No document - wasn't 'Insert' disabled???"); SvxPaperBinItem aItem( RES_PAPER_BIN ); - aItem.SetValue((BYTE)pSh->getIDocumentDeviceAccess()->getPrinter(true)->GetPaperBin()); + aItem.SetValue((sal_uInt8)pSh->getIDocumentDeviceAccess()->getPrinter(true)->GetPaperBin()); pOldSh->GetPageDescFromPool(RES_POOLPAGE_JAKET)->GetMaster().SetFmtAttr(aItem); } @@ -278,7 +278,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) // Here it goes (insert) pSh->StartUndo(UNDO_UI_INSERT_ENVELOPE, NULL); pSh->StartAllAction(); - pSh->SttEndDoc(TRUE); + pSh->SttEndDoc(sal_True); if (bEnvChange) { @@ -286,8 +286,8 @@ void SwModule::InsertEnv( SfxRequest& rReq ) pFollow = pSh->GetPageDesc(pSh->GetCurPageDesc()).GetFollow(); // Delete text from the first page - if ( !pSh->SttNxtPg(TRUE) ) - pSh->EndPg(TRUE); + if ( !pSh->SttNxtPg(sal_True) ) + pSh->EndPg(sal_True); pSh->DelRight(); // Delete frame of the first page if( pSh->GotoFly( rSendMark ) ) @@ -300,7 +300,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) pSh->EnterSelFrmMode(); pSh->DelRight(); } - pSh->SttEndDoc(TRUE); + pSh->SttEndDoc(sal_True); } else // Followup template: page 1 @@ -310,21 +310,21 @@ void SwModule::InsertEnv( SfxRequest& rReq ) if ( pSh->IsCrsrInTbl() ) { pSh->SplitNode(); - pSh->Right( CRSR_SKIP_CHARS, FALSE, 1, FALSE ); + pSh->Right( CRSR_SKIP_CHARS, sal_False, 1, sal_False ); SfxItemSet aBreakSet( pSh->GetAttrPool(), RES_BREAK, RES_BREAK, 0 ); aBreakSet.Put( SvxFmtBreakItem(SVX_BREAK_PAGE_BEFORE, RES_BREAK) ); pSh->SetTblAttr( aBreakSet ); } else - pSh->InsertPageBreak(0, FALSE); - pSh->SttEndDoc(TRUE); + pSh->InsertPageBreak(0, sal_False); + pSh->SttEndDoc(sal_True); } else { pFollow = &pSh->GetPageDesc(pSh->GetCurPageDesc()); // Let's go (print) pSh->StartAllAction(); - pSh->DoUndo(FALSE); + pSh->DoUndo(sal_False); // Again, copy the new collections "Sender" and "Reciever" to // a new document @@ -360,8 +360,8 @@ void SwModule::InsertEnv( SfxRequest& rReq ) long lLeft = rItem.lShiftRight, lUpper = rItem.lShiftDown; - USHORT nPageW = (USHORT) Max(rItem.lWidth, rItem.lHeight), - nPageH = (USHORT) Min(rItem.lWidth, rItem.lHeight); + sal_uInt16 nPageW = (sal_uInt16) Max(rItem.lWidth, rItem.lHeight), + nPageH = (sal_uInt16) Min(rItem.lWidth, rItem.lHeight); switch (rItem.eAlign) { @@ -378,18 +378,18 @@ void SwModule::InsertEnv( SfxRequest& rReq ) } SvxLRSpaceItem aLRMargin( RES_LR_SPACE ); SvxULSpaceItem aULMargin( RES_UL_SPACE ); - aLRMargin.SetLeft ((USHORT) lLeft ); - aULMargin.SetUpper((USHORT) lUpper); + aLRMargin.SetLeft ((sal_uInt16) lLeft ); + aULMargin.SetUpper((sal_uInt16) lUpper); aLRMargin.SetRight(0); aULMargin.SetLower(0); rFmt.SetFmtAttr(aLRMargin); rFmt.SetFmtAttr(aULMargin); // Header and footer - rFmt.SetFmtAttr(SwFmtHeader(BOOL(FALSE))); - pDesc->ChgHeaderShare(FALSE); - rFmt.SetFmtAttr(SwFmtFooter(BOOL(FALSE))); - pDesc->ChgFooterShare(FALSE); + rFmt.SetFmtAttr(SwFmtHeader(sal_Bool(sal_False))); + pDesc->ChgHeaderShare(sal_False); + rFmt.SetFmtAttr(SwFmtFooter(sal_Bool(sal_False))); + pDesc->ChgFooterShare(sal_False); // Page numbering pDesc->SetUseOn(nsUseOnPage::PD_ALL); @@ -413,9 +413,9 @@ void SwModule::InsertEnv( SfxRequest& rReq ) // Apply page description - USHORT nPos; + sal_uInt16 nPos; pSh->FindPageDescByName( pDesc->GetName(), - FALSE, + sal_False, &nPos ); @@ -423,7 +423,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) pSh->ChgCurPageDesc(*pDesc); // Insert Frame - SwFlyFrmAttrMgr aMgr(FALSE, pSh, FRMMGR_TYPE_ENVELP); + SwFlyFrmAttrMgr aMgr(sal_False, pSh, FRMMGR_TYPE_ENVELP); SwFldMgr aFldMgr; aMgr.SetHeightSizeType(ATT_VAR_SIZE); @@ -435,7 +435,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) // Sender if (rItem.bSend) { - pSh->SttEndDoc(TRUE); + pSh->SttEndDoc(sal_True); aMgr.InsertFlyFrm(FLY_AT_PAGE, Point(rItem.lSendFromLeft + lLeft, rItem.lSendFromTop + lUpper), Size (rItem.lAddrFromLeft - rItem.lSendFromLeft, 0)); @@ -450,7 +450,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) } // Addressee - pSh->SttEndDoc(TRUE); + pSh->SttEndDoc(sal_True); aMgr.InsertFlyFrm(FLY_AT_PAGE, Point(rItem.lAddrFromLeft + lLeft, rItem.lAddrFromTop + lUpper), @@ -467,12 +467,12 @@ void SwModule::InsertEnv( SfxRequest& rReq ) pSh->SetPageObjsNewPage(aFlyArr, 1); // Finished - pSh->SttEndDoc(TRUE); + pSh->SttEndDoc(sal_True); pSh->EndAllAction(); if (nMode == ENV_NEWDOC) - pSh->DoUndo(TRUE); + pSh->DoUndo(sal_True); else pSh->EndUndo(UNDO_UI_INSERT_ENVELOPE); @@ -482,7 +482,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) if ( rItem.aAddrText.indexOf('<') >= 0 ) { - static USHORT const aInva[] = + static sal_uInt16 const aInva[] = { SID_SBA_BRW_UPDATE, SID_SBA_BRW_INSERT, @@ -500,7 +500,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) { rReq.AppendItem( rItem ); if ( nMode == ENV_NEWDOC ) - rReq.AppendItem( SfxBoolItem( FN_PARAM_1, TRUE ) ); + rReq.AppendItem( SfxBoolItem( FN_PARAM_1, sal_True ) ); } rReq.Done(); diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx index 78247c5bc1..5f5e5f1524 100644 --- a/sw/source/ui/app/apphdl.cxx +++ b/sw/source/ui/app/apphdl.cxx @@ -28,6 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include <hintids.hxx> #include <tools/urlobj.hxx> @@ -81,6 +82,7 @@ #include <gloslst.hxx> // SwGlossaryList #include <glosdoc.hxx> // SwGlossaryList #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <cfgitems.hxx> #include <prtopt.hxx> #include <modcfg.hxx> @@ -131,7 +133,6 @@ using namespace ::com::sun::star; #define _ExecAddress ExecOther #define _StateAddress StateOther #include <sfx2/msg.hxx> -#include <svx/svxslots.hxx> #include "swslots.hxx" #include <cfgid.h> @@ -197,7 +198,7 @@ void SwModule::StateOther(SfxItemSet &rSet) } break; case SID_ATTR_METRIC: - rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, static_cast< UINT16 >(::GetDfltMetric(bWebView)))); + rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(::GetDfltMetric(bWebView)))); break; case FN_SET_MODOPT_TBLNUMFMT: rSet.Put( SfxBoolItem( nWhich, pModuleConfig-> @@ -217,7 +218,7 @@ SwView* lcl_LoadDoc(SwView* pView, const String& rURL) { SfxStringItem aURL(SID_FILE_NAME, rURL); SfxStringItem aTargetFrameName( SID_TARGETNAME, String::CreateFromAscii("_blank") ); - SfxBoolItem aHidden( SID_HIDDEN, TRUE ); + SfxBoolItem aHidden( SID_HIDDEN, sal_True ); SfxStringItem aReferer(SID_REFERER, pView->GetDocShell()->GetTitle()); SfxObjectItem* pItem = (SfxObjectItem*)pView->GetViewFrame()->GetDispatcher()-> Execute(SID_OPENDOC, SFX_CALLMODE_SYNCHRON, @@ -329,7 +330,7 @@ void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs m_pMMConfig->SetSourceView( m_pView ); m_pView->SetMailMergeConfigItem(0, 0, sal_True); SfxViewFrame* pViewFrame = m_pView->GetViewFrame(); - pViewFrame->ShowChildWindow(FN_MAILMERGE_CHILDWINDOW, FALSE); + pViewFrame->ShowChildWindow(FN_MAILMERGE_CHILDWINDOW, sal_False); OSL_ENSURE(m_pMMConfig, "no MailMergeConfigItem available"); bRestoreWizard = true; } @@ -734,7 +735,7 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) } else if(rHint.ISA(SfxSimpleHint)) { - USHORT nHintId = ((SfxSimpleHint&)rHint).GetId(); + sal_uInt16 nHintId = ((SfxSimpleHint&)rHint).GetId(); if(SFX_HINT_DEINITIALIZING == nHintId) { DELETEZ(pWebUsrPref); @@ -782,26 +783,23 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal { if( pBrdCst == pUserOptions ) { - bAuthorInitialised = FALSE; + bAuthorInitialised = sal_False; } else if( pBrdCst == pUndoOptions ) { - const int nNew = GetUndoOptions().GetUndoCount(); - const int nOld = SwEditShell::GetUndoActionCount(); - if(!nNew || !nOld) - { - sal_Bool bUndo = nNew != 0; + sal_Int32 const nNew = GetUndoOptions().GetUndoCount(); + bool const bUndo = (nNew != 0); + // switch Undo for all DocShells // Iterate through DocShells and switch undos - - TypeId aType(TYPE(SwDocShell)); - SwDocShell* pDocShell = (SwDocShell*)SfxObjectShell::GetFirst(&aType); - while( pDocShell ) - { - pDocShell->GetDoc()->DoUndo( bUndo ); - pDocShell = (SwDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType); - } + TypeId aType(TYPE(SwDocShell)); + SwDocShell * pDocShell = + static_cast<SwDocShell *>(SfxObjectShell::GetFirst(&aType)); + while (pDocShell) + { + pDocShell->GetDoc()->GetIDocumentUndoRedo().DoUndo(bUndo); + pDocShell = static_cast<SwDocShell *>( + SfxObjectShell::GetNext(*pDocShell, &aType)); } - SwEditShell::SetUndoActionCount( static_cast< USHORT >(nNew)); } else if ( pBrdCst == pColorConfig || pBrdCst == pAccessibilityOptions ) { @@ -921,11 +919,11 @@ const SwMasterUsrPref *SwModule::GetUsrPref(sal_Bool bWeb) const { // The SpellChecker is needed in SwMasterUsrPref's Load, but it must not // be created there #58256# - pNonConstModule->pWebUsrPref = new SwMasterUsrPref(TRUE); + pNonConstModule->pWebUsrPref = new SwMasterUsrPref(sal_True); } else if(!bWeb && !pUsrPref) { - pNonConstModule->pUsrPref = new SwMasterUsrPref(FALSE); + pNonConstModule->pUsrPref = new SwMasterUsrPref(sal_False); } return bWeb ? pWebUsrPref : pUsrPref; } @@ -937,7 +935,7 @@ void NewXForms( SfxRequest& rReq ) // copied & excerpted from SwModule::InsertLab(..) // create new document - SfxObjectShellRef xDocSh( new SwDocShell( SFX_CREATE_MODE_STANDARD) ); + SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_STANDARD) ); xDocSh->DoInitNew( 0 ); // initialize XForms diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx index b51dc45495..00809fe954 100644 --- a/sw/source/ui/app/applab.cxx +++ b/sw/source/ui/app/applab.cxx @@ -197,7 +197,7 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) aLabCfg.Commit(); // Create new document - SfxObjectShellRef xDocSh( new SwDocShell( SFX_CREATE_MODE_STANDARD)); + SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_STANDARD)); xDocSh->DoInitNew( 0 ); // Printer diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx index abf875859a..570f060670 100644 --- a/sw/source/ui/app/appopt.cxx +++ b/sw/source/ui/app/appopt.cxx @@ -28,14 +28,15 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#include <hintids.hxx> #include <cmdid.h> // Function-Ids -#include <com/sun/star/i18n/ScriptType.hpp> - #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> +#include <com/sun/star/i18n/ScriptType.hpp> + +#include <hintids.hxx> +#include <cmdid.h> // Funktion-Ids #include <vcl/msgbox.hxx> #include <svl/eitem.hxx> #include <sfx2/request.hxx> @@ -55,6 +56,7 @@ #include <edtwin.hxx> #include <swmodule.hxx> #include <view.hxx> +#include <doc.hxx> #include <wrtsh.hxx> #include <IDocumentDeviceAccess.hxx> #include <uitool.hxx> @@ -71,7 +73,6 @@ #include <editeng/langitem.hxx> #include <unotools/lingucfg.hxx> #include <editeng/unolingu.hxx> - #include <globals.hrc> #include <globals.h> // e.g. global Constants #include <svl/slstitm.hxx> @@ -83,9 +84,9 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; -SfxItemSet* SwModule::CreateItemSet( USHORT nId ) +SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId ) { - BOOL bTextDialog = (nId == SID_SW_EDITOPTIONS) ? TRUE : FALSE; + sal_Bool bTextDialog = (nId == SID_SW_EDITOPTIONS) ? sal_True : sal_False; // the options for the Web- and Textdialog are put together here SwViewOption aViewOpt = *GetUsrPref(!bTextDialog); @@ -97,7 +98,7 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) if(pAppView) { // if Text then no WebView and vice versa - BOOL bWebView = 0 != PTR_CAST(SwWebView, pAppView); + sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pAppView); if( (bWebView && !bTextDialog) ||(!bWebView && bTextDialog)) { aViewOpt = *pAppView->GetWrtShell().GetViewOptions(); @@ -184,20 +185,20 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) pRet->Put(SwPtrItem(FN_PARAM_STDFONTS, GetStdFontConfig())); if( PTR_CAST( SwPagePreView, SfxViewShell::Current())!=0) { - SfxBoolItem aBool(SfxBoolItem(SID_PRINTPREVIEW, TRUE)); + SfxBoolItem aBool(SfxBoolItem(SID_PRINTPREVIEW, sal_True)); pRet->Put(aBool); } FieldUnit eUnit = pPref->GetHScrollMetric(); if(pAppView) pAppView->GetHLinealMetric(eUnit); - pRet->Put(SfxUInt16Item( FN_HSCROLL_METRIC, static_cast< UINT16 >(eUnit))); + pRet->Put(SfxUInt16Item( FN_HSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit))); eUnit = pPref->GetVScrollMetric(); if(pAppView) pAppView->GetVLinealMetric(eUnit); - pRet->Put(SfxUInt16Item( FN_VSCROLL_METRIC, static_cast< UINT16 >(eUnit) )); - pRet->Put(SfxUInt16Item( SID_ATTR_METRIC, static_cast< UINT16 >(pPref->GetMetric()) )); + pRet->Put(SfxUInt16Item( FN_VSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit) )); + pRet->Put(SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(pPref->GetMetric()) )); pRet->Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, pPref->IsApplyCharUnit())); if(bTextDialog) { @@ -206,10 +207,10 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) const SvxTabStopItem& rDefTabs = (const SvxTabStopItem&)pAppView->GetWrtShell(). GetDefault(RES_PARATR_TABSTOP); - pRet->Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, (USHORT)::GetTabDist(rDefTabs))); + pRet->Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, (sal_uInt16)::GetTabDist(rDefTabs))); } else - pRet->Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, (UINT16)pPref->GetDefTab())); + pRet->Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, (sal_uInt16)pPref->GetDefTab())); } // Options for GridTabPage @@ -220,8 +221,8 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) aGridItem.SetGridVisible( aViewOpt.IsGridVisible()); const Size& rSnapSize = aViewOpt.GetSnapSize(); - aGridItem.SetFldDrawX( (USHORT) (rSnapSize.Width() )); - aGridItem.SetFldDrawY( (USHORT) (rSnapSize.Height())); + aGridItem.SetFldDrawX( (sal_uInt16) (rSnapSize.Width() )); + aGridItem.SetFldDrawY( (sal_uInt16) (rSnapSize.Height())); aGridItem.SetFldDivisionX( aViewOpt.GetDivisionX()); aGridItem.SetFldDivisionY( aViewOpt.GetDivisionY()); @@ -229,8 +230,8 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) pRet->Put(aGridItem); // Options for PrintTabPage - SwPrintData* pOpt = pAppView ? - pAppView->GetWrtShell().getIDocumentDeviceAccess()->getPrintData() : + const SwPrintData* pOpt = pAppView ? + &pAppView->GetWrtShell().getIDocumentDeviceAccess()->getPrintData() : 0; if(!pOpt) @@ -250,16 +251,16 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) return pRet; } -void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) +void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) { - BOOL bTextDialog = nId == SID_SW_EDITOPTIONS; + sal_Bool bTextDialog = nId == SID_SW_EDITOPTIONS; SwView* pAppView = GetView(); if(pAppView && pAppView->GetViewFrame() != SfxViewFrame::Current()) pAppView = 0; if(pAppView) { // the text dialog mustn't apply data to the web view and vice versa - BOOL bWebView = 0 != PTR_CAST(SwWebView, pAppView); + sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pAppView); if( (bWebView == bTextDialog)) pAppView = 0; } @@ -274,19 +275,18 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) /*--------------------------------------------------------------------- Interpret the page Documentview -----------------------------------------------------------------------*/ - if( SFX_ITEM_SET == rSet.GetItemState( - FN_PARAM_DOCDISP, FALSE, &pItem )) + if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_DOCDISP, sal_False, &pItem )) { const SwDocDisplayItem* pDocDispItem = (const SwDocDisplayItem*)pItem; if(!aViewOpt.IsViewMetaChars()) { - if( (!aViewOpt.IsTab( TRUE ) && pDocDispItem->bTab) || - (!aViewOpt.IsBlank( TRUE ) && pDocDispItem->bSpace) || - (!aViewOpt.IsParagraph( TRUE ) && pDocDispItem->bParagraphEnd) || - (!aViewOpt.IsLineBreak( TRUE ) && pDocDispItem->bManualBreak) ) + if( (!aViewOpt.IsTab( sal_True ) && pDocDispItem->bTab) || + (!aViewOpt.IsBlank( sal_True ) && pDocDispItem->bSpace) || + (!aViewOpt.IsParagraph( sal_True ) && pDocDispItem->bParagraphEnd) || + (!aViewOpt.IsLineBreak( sal_True ) && pDocDispItem->bManualBreak) ) { - aViewOpt.SetViewMetaChars(TRUE); + aViewOpt.SetViewMetaChars(sal_True); if(pBindings) pBindings->Invalidate(FN_VIEW_META_CHARS); } @@ -304,32 +304,28 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) Elements - interpret Item -----------------------------------------------------------------------*/ - if( SFX_ITEM_SET == rSet.GetItemState( - FN_PARAM_ELEM, FALSE, &pItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ELEM, sal_False, &pItem ) ) { const SwElemItem* pElemItem = (const SwElemItem*)pItem; pElemItem->FillViewOptions( aViewOpt ); } - if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_METRIC, - FALSE, &pItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_METRIC, sal_False, &pItem ) ) { SFX_APP()->SetOptions(rSet); const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem; ::SetDfltMetric((FieldUnit)pMetricItem->GetValue(), !bTextDialog); } - if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT, - FALSE, &pItem ) ) + sal_False, &pItem ) ) { SFX_APP()->SetOptions(rSet); const SfxBoolItem* pCharItem = (const SfxBoolItem*)pItem; ::SetApplyCharUnit(pCharItem->GetValue(), !bTextDialog); } - if( SFX_ITEM_SET == rSet.GetItemState(FN_HSCROLL_METRIC, - FALSE, &pItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState(FN_HSCROLL_METRIC, sal_False, &pItem ) ) { const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem; FieldUnit eUnit = (FieldUnit)pMetricItem->GetValue(); @@ -338,8 +334,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) pAppView->ChangeTabMetric(eUnit); } - if( SFX_ITEM_SET == rSet.GetItemState(FN_VSCROLL_METRIC, - FALSE, &pItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState(FN_VSCROLL_METRIC, sal_False, &pItem ) ) { const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem; FieldUnit eUnit = (FieldUnit)pMetricItem->GetValue(); @@ -348,10 +343,9 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) pAppView->ChangeVLinealMetric(eUnit); } - if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_DEFTABSTOP, - FALSE, &pItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_DEFTABSTOP, sal_False, &pItem ) ) { - USHORT nTabDist = ((const SfxUInt16Item*)pItem)->GetValue(); + sal_uInt16 nTabDist = ((const SfxUInt16Item*)pItem)->GetValue(); pPref->SetDefTab(nTabDist); if(pAppView) { @@ -376,8 +370,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) Interpret page Grid Settings ----------------------------------------------------------------------*/ - if( SFX_ITEM_SET == rSet.GetItemState( - SID_ATTR_GRID_OPTIONS, FALSE, &pItem )) + if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS, sal_False, &pItem )) { const SvxGridItem* pGridItem = (const SvxGridItem*)pItem; @@ -407,8 +400,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) Interpret Writer Printer Options ----------------------------------------------------------------------*/ - if( SFX_ITEM_SET == rSet.GetItemState( - FN_PARAM_ADDPRINTER, FALSE, &pItem )) + if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ADDPRINTER, sal_False, &pItem )) { SwPrintOptions* pOpt = GetPrtOptions(!bTextDialog); if (pOpt) @@ -422,27 +414,35 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet ) } - if( SFX_ITEM_SET == rSet.GetItemState( - FN_PARAM_SHADOWCURSOR, FALSE, &pItem )) + if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, sal_False, &pItem )) { ((SwShadowCursorItem*)pItem)->FillViewOptions( aViewOpt ); if(pBindings) pBindings->Invalidate(FN_SHADOWCURSOR); } - if( SFX_ITEM_SET == rSet.GetItemState( - FN_PARAM_CRSR_IN_PROTECTED, FALSE, &pItem )) + if( pAppView ) + { + SwWrtShell &rWrtSh = pAppView->GetWrtShell(); + const bool bAlignFormulas = rWrtSh.GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ); + pPref->SetAlignMathObjectsToBaseline( bAlignFormulas ); + + // don't align formulas in documents that are currently loading + if (bAlignFormulas && !rWrtSh.GetDoc()->IsInReading()) + rWrtSh.AlignAllFormulasToBaseline(); + } + + if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, sal_False, &pItem )) { aViewOpt.SetCursorInProtectedArea(((const SfxBoolItem*)pItem)->GetValue()); } // set elements for the current view and shell - ApplyUsrPref( aViewOpt, pAppView, - bTextDialog? VIEWOPT_DEST_TEXT : VIEWOPT_DEST_WEB); + ApplyUsrPref( aViewOpt, pAppView, bTextDialog? VIEWOPT_DEST_TEXT : VIEWOPT_DEST_WEB); } -SfxTabPage* SwModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItemSet& rSet ) +SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxItemSet& rSet ) { SfxTabPage* pRet = NULL; SfxAllItemSet aSet(*(rSet.GetPool())); @@ -511,7 +511,7 @@ SfxTabPage* SwModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItemS if(pCurrView) { // if text then not WebView and vice versa - BOOL bWebView = 0 != PTR_CAST(SwWebView, pCurrView); + sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pCurrView); if( (bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE == nId) || (!bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE != nId) ) { @@ -535,6 +535,15 @@ SfxTabPage* SwModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItemS if ( fnCreatePage ) pRet = (*fnCreatePage)( pParent, rSet ); } + if (pRet && (nId == RID_SW_TP_OPTSHDWCRSR || nId == RID_SW_TP_HTML_OPTSHDWCRSR)) + { + SwView* pCurrView = GetView(); + if(pCurrView) + { + aSet.Put( SwWrtShellItem( SID_WRT_SHELL, pCurrView->GetWrtShellPtr() ) ); + pRet->PageCreated(aSet); + } + } } break; #if OSL_DEBUG_LEVEL > 1 @@ -580,5 +589,4 @@ SfxTabPage* SwModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItemS } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index 57c42f8f1a..d350ed7a08 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -66,7 +66,7 @@ #include <fmtfld.hxx> #include <node.hxx> #include <swwait.hxx> -#include <swprtopt.hxx> +#include <printdata.hxx> #include <frmatr.hxx> #include <view.hxx> // for the current view #include <edtwin.hxx> @@ -82,6 +82,7 @@ #include <shellio.hxx> // I/O #include <docstyle.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <docstat.hxx> #include <pagedesc.hxx> #include <pview.hxx> @@ -148,11 +149,11 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr, SwCrsrShell *pCrsrShell, SwPaM* pPaM ) { - BOOL bAPICall = FALSE; + sal_Bool bAPICall = sal_False; const SfxPoolItem* pApiItem; const SfxItemSet* pMedSet; if( 0 != ( pMedSet = rMedium.GetItemSet() ) && SFX_ITEM_SET == - pMedSet->GetItemState( FN_API_CALL, TRUE, &pApiItem ) ) + pMedSet->GetItemState( FN_API_CALL, sal_True, &pApiItem ) ) bAPICall = ((const SfxBoolItem*)pApiItem)->GetValue(); const SfxFilter* pFlt = rMedium.GetFilter(); @@ -196,7 +197,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr, { const SfxItemSet* pSet = rMedium.GetItemSet(); const SfxPoolItem *pPassItem; - if(pSet && SFX_ITEM_SET == pSet->GetItemState(SID_PASSWORD, TRUE, &pPassItem)) + if(pSet && SFX_ITEM_SET == pSet->GetItemState(SID_PASSWORD, sal_True, &pPassItem)) aPasswd = ((const SfxStringItem *)pPassItem)->GetValue(); } @@ -207,19 +208,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr, return 0; } } - if(rMedium.IsStorage()) - { - const SfxItemSet* pSet = rMedium.GetItemSet(); - const SfxPoolItem *pItem; - if(pSet && SFX_ITEM_SET == pSet->GetItemState(SID_PASSWORD, TRUE, &pItem)) - { - OSL_ENSURE(pItem->IsA( TYPE(SfxStringItem) ), "Wrong parameter type"); - comphelper::OStorageHelper::SetCommonStoragePassword( rMedium.GetStorage(), ((const SfxStringItem *)pItem)->GetValue() ); - } - // And for document-paste the FF-Version, when it's the own filter - OSL_ENSURE( /*pRead != ReadSw3 || */pRead != ReadXML || pFlt->GetVersion(), - "No FF version set in filter" ); - } + // #i30171# set the UpdateDocMode at the SwDocShell SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False); nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE; @@ -234,7 +223,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr, const SfxItemSet* pSet; const SfxPoolItem* pItem; if( 0 != ( pSet = rMedium.GetItemSet() ) && SFX_ITEM_SET == - pSet->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) ) + pSet->GetItemState( SID_FILE_FILTEROPTIONS, sal_True, &pItem ) ) aOpt.ReadUserData( ((const SfxStringItem*)pItem)->GetValue() ); if( pRead ) @@ -248,17 +237,17 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr, Description: Loading --------------------------------------------------------------------*/ -BOOL SwDocShell::ConvertFrom( SfxMedium& rMedium ) +sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::ConvertFrom" ); SwReader* pRdr; SwRead pRead = StartConvertFrom(rMedium, &pRdr); if (!pRead) - return FALSE; // #129881# return if no reader is found + return sal_False; // #129881# return if no reader is found SotStorageRef pStg=pRead->getSotStorageRef(); // #i45333# save sot storage ref in case of recursive calls - SwWait aWait( *this, TRUE ); + SwWait aWait( *this, sal_True ); // Suppress SfxProgress, when we are Embedded SW_MOD()->SetEmbeddedLoadSave( @@ -269,7 +258,7 @@ BOOL SwDocShell::ConvertFrom( SfxMedium& rMedium ) /* #106748# Restore the pool default if reading a saved document. */ pDoc->RemoveAllFmtLanguageDependencies(); - ULONG nErr = pRdr->Read( *pRead ); + sal_uLong nErr = pRdr->Read( *pRead ); // Maybe put away one old Doc if ( pDoc != pRdr->GetDoc() ) @@ -289,10 +278,10 @@ BOOL SwDocShell::ConvertFrom( SfxMedium& rMedium ) delete pRdr; - SW_MOD()->SetEmbeddedLoadSave( FALSE ); + SW_MOD()->SetEmbeddedLoadSave( sal_False ); SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); - BOOL bOk = !IsError( nErr ); + sal_Bool bOk = !IsError( nErr ); if ( bOk && !pDoc->IsInLoadAsynchron() ) { @@ -309,13 +298,13 @@ BOOL SwDocShell::ConvertFrom( SfxMedium& rMedium ) --------------------------------------------------------------------*/ -BOOL SwDocShell::Save() +sal_Bool SwDocShell::Save() { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::Save" ); //#i3370# remove quick help to prevent saving of autocorrection suggestions if(pView) pView->GetEditWin().StopQuickHelp(); - SwWait aWait( *this, TRUE ); + SwWait aWait( *this, sal_True ); CalcLayoutForOLEObjects(); // format for OLE objets // #i62875# @@ -327,7 +316,7 @@ BOOL SwDocShell::Save() pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false); } - ULONG nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE; + sal_uLong nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE; if( SfxObjectShell::Save() ) { switch( GetCreateMode() ) @@ -340,16 +329,16 @@ BOOL SwDocShell::Save() { WriterRef xWrt; ::GetXMLWriter( aEmptyStr, GetMedium()->GetBaseURL( true ), xWrt ); - xWrt->SetOrganizerMode( TRUE ); + xWrt->SetOrganizerMode( sal_True ); SwWriter aWrt( *GetMedium(), *pDoc ); nErr = aWrt.Write( xWrt ); - xWrt->SetOrganizerMode( FALSE ); + xWrt->SetOrganizerMode( sal_False ); } break; case SFX_CREATE_MODE_EMBEDDED: // Suppress SfxProgress, if we are Embedded - SW_MOD()->SetEmbeddedLoadSave( TRUE ); + SW_MOD()->SetEmbeddedLoadSave( sal_True ); // no break; case SFX_CREATE_MODE_STANDARD: @@ -360,7 +349,7 @@ BOOL SwDocShell::Save() { if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() ) nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) (*this) ); - pDoc->SetContainsMSVBasic( FALSE ); + pDoc->SetContainsMSVBasic( sal_False ); } // End TableBox Edit! @@ -370,11 +359,11 @@ BOOL SwDocShell::Save() WriterRef xWrt; ::GetXMLWriter( aEmptyStr, GetMedium()->GetBaseURL( true ), xWrt ); - BOOL bLockedView(FALSE); + sal_Bool bLockedView(sal_False); if ( pWrtShell ) { bLockedView = pWrtShell->IsViewLocked(); - pWrtShell->LockView( TRUE ); //lock visible section + pWrtShell->LockView( sal_True ); //lock visible section } SwWriter aWrt( *GetMedium(), *pDoc ); @@ -385,7 +374,7 @@ BOOL SwDocShell::Save() } break; } - SW_MOD()->SetEmbeddedLoadSave( FALSE ); + SW_MOD()->SetEmbeddedLoadSave( sal_False ); } SetError( nErr ? nErr : nVBWarning, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); @@ -406,7 +395,7 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::SaveAs" ); - SwWait aWait( *this, TRUE ); + SwWait aWait( *this, sal_True ); //#i3370# remove quick help to prevent saving of autocorrection suggestions if(pView) pView->GetEditWin().StopQuickHelp(); @@ -454,7 +443,7 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false); } - ULONG nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE; + sal_uLong nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE; uno::Reference < embed::XStorage > xStor = rMedium.GetOutputStorage(); if( SfxObjectShell::SaveAs( rMedium ) ) { @@ -467,7 +456,9 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) // will set the wrong class id. SvGlobalName aClassName; String aAppName, aLongUserName, aUserName; - SfxObjectShellRef xDocSh = + + // The document is closed explicitly, but using SfxObjectShellLock is still more correct here + SfxObjectShellLock xDocSh = new SwGlobalDocShell( SFX_CREATE_MODE_INTERNAL ); // the global document can not be a template xDocSh->SetupStorage( xStor, SotStorage::GetVersion( xStor ), sal_False ); @@ -478,7 +469,7 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) { if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() ) nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) *this ); - pDoc->SetContainsMSVBasic( FALSE ); + pDoc->SetContainsMSVBasic( sal_False ); } // End TableBox Edit! @@ -487,8 +478,8 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) // Remember and preserve Modified-Flag without calling the Link // (for OLE; after Statement from MM) - BOOL bIsModified = pDoc->IsModified(); - SwUndoNoModifiedPosition aOldPos = pDoc->getUndoNoModifiedPosition(); + sal_Bool bIsModified = pDoc->IsModified(); + pDoc->GetIDocumentUndoRedo().LockUndoNoModifiedPosition(); Link aOldOLELnk( pDoc->GetOle2Link() ); pDoc->SetOle2Link( Link() ); @@ -499,11 +490,11 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) WriterRef xWrt; ::GetXMLWriter( aEmptyStr, rMedium.GetBaseURL( true ), xWrt ); - BOOL bLockedView(FALSE); + sal_Bool bLockedView(sal_False); if ( pWrtShell ) { bLockedView = pWrtShell->IsViewLocked(); - pWrtShell->LockView( TRUE ); //lock visible section + pWrtShell->LockView( sal_True ); //lock visible section } SwWriter aWrt( rMedium, *pDoc ); @@ -515,11 +506,11 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) if( bIsModified ) { pDoc->SetModified(); - pDoc->setUndoNoModifiedPosition( aOldPos ); + pDoc->GetIDocumentUndoRedo().UnLockUndoNoModifiedPosition(); } pDoc->SetOle2Link( aOldOLELnk ); - SW_MOD()->SetEmbeddedLoadSave( FALSE ); + SW_MOD()->SetEmbeddedLoadSave( sal_False ); } SetError( nErr ? nErr : nVBWarning, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); @@ -537,12 +528,12 @@ SwSrcView* lcl_GetSourceView( SwDocShell* pSh ) return PTR_CAST( SwSrcView, pViewShell); } -BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) +sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::ConvertTo" ); const SfxFilter* pFlt = rMedium.GetFilter(); if( !pFlt ) - return FALSE; + return sal_False; WriterRef xWriter; SwReaderWriter::GetWriter( pFlt->GetUserData(), rMedium.GetBaseURL( true ), xWriter ); @@ -550,7 +541,7 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) { // Filter not available InfoBox( 0, SW_RESSTR(STR_DLLNOTFOUND) ).Execute(); - return FALSE; + return sal_False; } //#i3370# remove quick help to prevent saving of autocorrection suggestions @@ -565,22 +556,22 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) pView->GetPostItMgr()->UpdateDataOnActiveSidebarWin(); } - ULONG nVBWarning = 0; + sal_uLong nVBWarning = 0; if( pDoc->ContainsMSVBasic() ) { - BOOL bSave = pFlt->GetUserData().EqualsAscii( "CWW8" ) + sal_Bool bSave = pFlt->GetUserData().EqualsAscii( "CWW8" ) && SvtFilterOptions::Get()->IsLoadWordBasicStorage(); if ( bSave ) { - SvStorageRef xStg = new SotStorage( rMedium.GetOutStream(), FALSE ); + SvStorageRef xStg = new SotStorage( rMedium.GetOutStream(), sal_False ); OSL_ENSURE( !xStg->GetError(), "No storage available for storing VBA macros!" ); if ( !xStg->GetError() ) { nVBWarning = SaveOrDelMSVBAStorage( (SfxObjectShell&) *this, *xStg, bSave, String::CreateFromAscii("Macros") ); xStg->Commit(); - pDoc->SetContainsMSVBasic( TRUE ); + pDoc->SetContainsMSVBasic( sal_True ); } } } @@ -637,15 +628,15 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) pFlt->GetUserData().EqualsAscii( FILTER_XMLVW ) ) ) { // determine the own Type - BYTE nMyType = 0; + sal_uInt8 nMyType = 0; if( ISA( SwWebDocShell) ) nMyType = 1; else if( ISA( SwGlobalDocShell) ) nMyType = 2; // determine the desired Type - BYTE nSaveType = 0; - ULONG nSaveClipId = pFlt->GetFormat(); + sal_uInt8 nSaveType = 0; + sal_uLong nSaveClipId = pFlt->GetFormat(); if( SOT_FORMATSTR_ID_STARWRITERWEB_8 == nSaveClipId || SOT_FORMATSTR_ID_STARWRITERWEB_60 == nSaveClipId || SOT_FORMATSTR_ID_STARWRITERWEB_50 == nSaveClipId || @@ -658,9 +649,9 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) nSaveType = 2; // Change Flags of the Document accordingly - BOOL bIsHTMLModeSave = GetDoc()->get(IDocumentSettingAccess::HTML_MODE); - BOOL bIsGlobalDocSave = GetDoc()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT); - BOOL bIsGlblDocSaveLinksSave = GetDoc()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS); + sal_Bool bIsHTMLModeSave = GetDoc()->get(IDocumentSettingAccess::HTML_MODE); + sal_Bool bIsGlobalDocSave = GetDoc()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT); + sal_Bool bIsGlblDocSaveLinksSave = GetDoc()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS); if( nMyType != nSaveType ) { GetDoc()->set(IDocumentSettingAccess::HTML_MODE, 1 == nSaveType); @@ -687,7 +678,7 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) } // Now normally save the Document - BOOL bRet = SaveAs( rMedium ); + sal_Bool bRet = SaveAs( rMedium ); if( nMyType != nSaveType ) { @@ -696,25 +687,6 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) GetDoc()->set(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS, bIsGlblDocSaveLinksSave); } - if( bRet && nMyType != nSaveType ) - { - SvGlobalName aClassName; - String aAppName, aLongUserName, aUserName; - SfxObjectShellRef xDocSh; - switch( nSaveType ) - { - case 0: - xDocSh = new SwDocShell( SFX_CREATE_MODE_INTERNAL ); - break; - case 1: - xDocSh = new SwWebDocShell( SFX_CREATE_MODE_INTERNAL ); - break; - case 2: - xDocSh = new SwGlobalDocShell( SFX_CREATE_MODE_INTERNAL ); - break; - } - } - return bRet; } @@ -728,7 +700,7 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) if( 0 != ( pSet = rMedium.GetItemSet() ) ) { if( SFX_ITEM_SET == pSet->GetItemState( SID_FILE_FILTEROPTIONS, - TRUE, &pItem ) ) + sal_True, &pItem ) ) sItemOpt = ((const SfxStringItem*)pItem)->GetValue(); } if(sItemOpt.Len()) @@ -742,24 +714,24 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) SFX_CREATE_MODE_EMBEDDED == GetCreateMode()); // Span Context in order to suppress the Selection's View - ULONG nErrno; + sal_uLong nErrno; String aFileName( rMedium.GetName() ); // No View, so the whole Document! if ( pWrtShell ) { - SwWait aWait( *this, TRUE ); + SwWait aWait( *this, sal_True ); // #i106906# const sal_Bool bFormerLockView = pWrtShell->IsViewLocked(); pWrtShell->LockView( sal_True ); pWrtShell->StartAllAction(); pWrtShell->Push(); - SwWriter aWrt( rMedium, *pWrtShell, TRUE ); + SwWriter aWrt( rMedium, *pWrtShell, sal_True ); nErrno = aWrt.Write( xWriter, &aFileName ); //JP 16.05.97: In case the SFX revokes the View while saving if( pWrtShell ) { - pWrtShell->Pop(FALSE); + pWrtShell->Pop(sal_False); pWrtShell->EndAllAction(); // #i106906# pWrtShell->LockView( bFormerLockView ); @@ -781,7 +753,7 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) } } - SW_MOD()->SetEmbeddedLoadSave( FALSE ); + SW_MOD()->SetEmbeddedLoadSave( sal_False ); SetError( nErrno ? nErrno : nVBWarning, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); if( !rMedium.IsStorage() ) rMedium.CloseOutStream(); @@ -802,7 +774,7 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xStor ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::SaveCompleted" ); - BOOL bRet = SfxObjectShell::SaveCompleted( xStor ); + sal_Bool bRet = SfxObjectShell::SaveCompleted( xStor ); if( bRet ) { // Do not decide until here, whether Saving was successful or not @@ -814,9 +786,9 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS if( pOLEChildList ) { - BOOL bResetModified = IsEnableSetModified(); + sal_Bool bResetModified = IsEnableSetModified(); if( bResetModified ) - EnableSetModified( FALSE ); + EnableSetModified( sal_False ); uno::Sequence < rtl::OUString > aNames = pOLEChildList->GetObjectNames(); for( sal_Int32 n = aNames.getLength(); n; n-- ) @@ -829,7 +801,7 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS DELETEZ( pOLEChildList ); if( bResetModified ) - EnableSetModified( TRUE ); + EnableSetModified( sal_True ); } return bRet; } @@ -839,12 +811,12 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS --------------------------------------------------------------------*/ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup, - USHORT nAspect ) + sal_uInt16 nAspect ) { //fix #25341# Draw should not affect the Modified - BOOL bResetModified; - if ( TRUE == (bResetModified = IsEnableSetModified()) ) - EnableSetModified( FALSE ); + sal_Bool bResetModified; + if ( sal_True == (bResetModified = IsEnableSetModified()) ) + EnableSetModified( sal_False ); // When there is a JobSetup connected to the Document, we copy it to // reconnect it after PrtOle2. We don't use an empty JobSetup because @@ -866,8 +838,8 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup, pDev->SetFillColor(); pDev->SetLineColor(); pDev->SetBackground(); - BOOL bWeb = 0 != PTR_CAST(SwWebDocShell, this); - SwPrtOptions aOpts( aEmptyStr ); + sal_Bool bWeb = 0 != PTR_CAST(SwWebDocShell, this); + SwPrintData aOpts; ViewShell::PrtOle2( pDoc, SW_MOD()->GetUsrPref(bWeb), aOpts, pDev, aRect ); pDev->Pop(); @@ -877,7 +849,7 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup, delete pOrig; } if ( bResetModified ) - EnableSetModified( TRUE ); + EnableSetModified( sal_True ); } @@ -899,14 +871,14 @@ void SwDocShell::SetVisArea( const Rectangle &rRect ) aRect.Move( nMoveX, nMoveY ); // Calls SfxInPlaceObject::SetVisArea()! - pView->SetVisArea( aRect, TRUE ); + pView->SetVisArea( aRect, sal_True ); } else SfxObjectShell::SetVisArea( aRect ); } -Rectangle SwDocShell::GetVisArea( USHORT nAspect ) const +Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const { if ( nAspect == ASPECT_THUMBNAIL ) { @@ -914,7 +886,7 @@ Rectangle SwDocShell::GetVisArea( USHORT nAspect ) const SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 1 ); SwCntntNode* pNd = pDoc->GetNodes().GoNext( &aIdx ); - const SwRect aPageRect = pNd->FindPageFrmRect( FALSE, 0, FALSE ); + const SwRect aPageRect = pNd->FindPageFrmRect( sal_False, 0, sal_False ); return aPageRect.SVRect(); } return SfxObjectShell::GetVisArea( nAspect ); @@ -938,7 +910,7 @@ void SwDocShell::OnDocumentPrinterChanged( Printer * pNewPrinter ) GetDoc()->setPrinter( 0, true, true ); } -ULONG SwDocShell::GetMiscStatus() const +sal_uLong SwDocShell::GetMiscStatus() const { return SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE; } @@ -982,7 +954,7 @@ sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates ) void SwDocShell::GetState(SfxItemSet& rSet) { SfxWhichIter aIter(rSet); - USHORT nWhich = aIter.FirstWhich(); + sal_uInt16 nWhich = aIter.FirstWhich(); while (nWhich) { @@ -990,7 +962,7 @@ void SwDocShell::GetState(SfxItemSet& rSet) { case SID_PRINTPREVIEW: { - BOOL bDisable = IsInPlaceActive(); + sal_Bool bDisable = IsInPlaceActive(); if ( !bDisable ) { SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this); @@ -999,7 +971,7 @@ void SwDocShell::GetState(SfxItemSet& rSet) if ( PTR_CAST(SwView, pTmpFrm->GetViewShell()) && ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)) { - bDisable = TRUE; + bDisable = sal_True; break; } pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this); @@ -1009,9 +981,9 @@ void SwDocShell::GetState(SfxItemSet& rSet) rSet.DisableItem( SID_PRINTPREVIEW ); else { - SfxBoolItem aBool( SID_PRINTPREVIEW, FALSE ); + SfxBoolItem aBool( SID_PRINTPREVIEW, sal_False ); if( PTR_CAST( SwPagePreView, SfxViewShell::Current()) ) - aBool.SetValue( TRUE ); + aBool.SetValue( sal_True ); rSet.Put( aBool ); } } @@ -1020,7 +992,7 @@ void SwDocShell::GetState(SfxItemSet& rSet) { SfxViewShell* pCurrView = GetView() ? (SfxViewShell*)GetView() : SfxViewShell::Current(); - BOOL bSourceView = 0 != PTR_CAST(SwSrcView, pCurrView); + sal_Bool bSourceView = 0 != PTR_CAST(SwSrcView, pCurrView); rSet.Put(SfxBoolItem(SID_SOURCEVIEW, bSourceView)); } break; @@ -1065,7 +1037,7 @@ void SwDocShell::GetState(SfxItemSet& rSet) case SID_ATTR_YEAR2000: { - const SvNumberFormatter* pFmtr = pDoc->GetNumberFormatter(FALSE); + const SvNumberFormatter* pFmtr = pDoc->GetNumberFormatter(sal_False); rSet.Put( SfxUInt16Item( nWhich, static_cast< sal_uInt16 >( pFmtr ? pFmtr->GetYear2000() @@ -1077,6 +1049,23 @@ void SwDocShell::GetState(SfxItemSet& rSet) rSet.Put( SvxFontListItem( pFontList, SID_ATTR_CHAR_FONTLIST ) ); } break; + case SID_MAIL_PREPAREEXPORT: + { + //check if linked content or possibly hidden content is available + //pDoc->UpdateFlds( NULL, false ); + sfx2::LinkManager& rLnkMgr = pDoc->GetLinkManager(); + const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks(); + sal_Bool bRet = sal_False; + if( rLnks.Count() ) + bRet = sal_True; + else + { + //sections with hidden flag, hidden character attribute, hidden paragraph/text or conditional text fields + bRet = pDoc->HasInvisibleContent(); + } + rSet.Put( SfxBoolItem( nWhich, bRet ) ); + } + break; default: OSL_ENSURE(!this,"You cannot get here!"); @@ -1097,7 +1086,7 @@ IMPL_LINK( SwDocShell, Ole2ModifiedHdl, void *, p ) // Bit 1: -> new state long nStatus = (long)p; if( IsEnableSetModified() ) - SetModified( (nStatus & 2) ? TRUE : FALSE ); + SetModified( (nStatus & 2) ? sal_True : sal_False ); return 0; } @@ -1221,7 +1210,7 @@ void SwDocShell::CalcLayoutForOLEObjects() // read by the binary filter: void SwDocShell::UpdateLinks() { - GetDoc()->UpdateLinks(TRUE); + GetDoc()->UpdateLinks(sal_True); // #i50703# Update footnote numbers SwTxtFtn::SetUniqueSeqRefNo( *GetDoc() ); SwNodeIndex aTmp( GetDoc()->GetNodes() ); @@ -1293,8 +1282,8 @@ bool SwDocShell::HasChangeRecordProtection() const void SwDocShell::SetChangeRecording( bool bActivate ) { - USHORT nOn = bActivate ? nsRedlineMode_t::REDLINE_ON : 0; - USHORT nMode = pWrtShell->GetRedlineMode(); + sal_uInt16 nOn = bActivate ? nsRedlineMode_t::REDLINE_ON : 0; + sal_uInt16 nMode = pWrtShell->GetRedlineMode(); pWrtShell->SetRedlineModeAndCheckInsMode( (nMode & ~nsRedlineMode_t::REDLINE_ON) | nOn); } @@ -1307,7 +1296,7 @@ bool SwDocShell::SetProtectionPassword( const String &rNewPassword ) IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess(); Sequence< sal_Int8 > aPasswd = pIDRA->GetRedlinePassword(); - if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, FALSE, &pItem ) + if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, sal_False, &pItem ) && ((SfxBoolItem*)pItem)->GetValue() == (aPasswd.getLength() > 0)) return false; @@ -1343,7 +1332,7 @@ bool SwDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess(); Sequence< sal_Int8 > aPasswdHash( pIDRA->GetRedlinePassword() ); - if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, FALSE, &pItem ) + if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, sal_False, &pItem ) && ((SfxBoolItem*)pItem)->GetValue() == (aPasswdHash.getLength() != 0)) return false; rPasswordHash = aPasswdHash; diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 5501b0227f..49bdd982ff 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -84,6 +84,7 @@ #include <redlndlg.hxx> #include <docstyle.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <pagedesc.hxx> #include <shellio.hxx> #include <pview.hxx> @@ -129,7 +130,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star; using ::rtl::OUString; using namespace ::sfx2; -extern BOOL FindPhyStyle( SwDoc& , const String& , SfxStyleFamily ); +extern sal_Bool FindPhyStyle( SwDoc& , const String& , SfxStyleFamily ); /*-------------------------------------------------------------------- Description: create DocInfo (virtual) @@ -165,7 +166,7 @@ void SwDocShell::DoFlushDocInfo() bool bUnlockView(true); if ( pWrtShell ) { bUnlockView = !pWrtShell->IsViewLocked(); - pWrtShell->LockView( TRUE ); // lock visible section + pWrtShell->LockView( sal_True ); // lock visible section pWrtShell->StartAllAction(); } @@ -174,7 +175,7 @@ void SwDocShell::DoFlushDocInfo() if ( pWrtShell ) { pWrtShell->EndAllAction(); if ( bUnlockView ) { - pWrtShell->LockView( FALSE ); + pWrtShell->LockView( sal_False ); } } } @@ -185,7 +186,7 @@ void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVBAEventP if ( rHint.ISA( SfxEventHint ) ) { uno::Sequence< uno::Any > aArgs; - ULONG nEventId = ((SfxEventHint&)rHint).GetEventId(); + sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId(); switch( nEventId ) { case SFX_EVENT_CREATEDOC: @@ -213,7 +214,7 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) if( xVbaEvents.is() ) lcl_processCompatibleSfxHint( xVbaEvents, rHint ); - USHORT nAction = 0; + sal_uInt16 nAction = 0; if( rHint.ISA(SfxSimpleHint) ) { // switch for more actions @@ -234,11 +235,11 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) if( nAction ) { - BOOL bUnlockView = sal_True; //initializing prevents warning + sal_Bool bUnlockView = sal_True; //initializing prevents warning if( pWrtShell ) { bUnlockView = !pWrtShell->IsViewLocked(); - pWrtShell->LockView( TRUE ); //lock visible section + pWrtShell->LockView( sal_True ); //lock visible section pWrtShell->StartAllAction(); } switch( nAction ) @@ -255,7 +256,7 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) { const bool bResetModified = IsEnableSetModified(); if ( bResetModified ) - EnableSetModified( FALSE ); + EnableSetModified( sal_False ); // #i41679# const bool bIsDocModified = pDoc->IsModified(); @@ -265,7 +266,7 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) if ( !bIsDocModified ) pDoc->ResetModified(); if ( bResetModified ) - EnableSetModified( TRUE ); + EnableSetModified( sal_True ); } break; } @@ -274,7 +275,7 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) { pWrtShell->EndAllAction(); if( bUnlockView ) - pWrtShell->LockView( FALSE ); + pWrtShell->LockView( sal_False ); } } } @@ -283,11 +284,11 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) Description: Notification Close Doc --------------------------------------------------------------------*/ -USHORT SwDocShell::PrepareClose( BOOL bUI, BOOL bForBrowsing ) +sal_uInt16 SwDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing ) { - USHORT nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing ); + sal_uInt16 nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing ); - if( TRUE == nRet ) //has to be queried against TRUE! (RET_NEWTASK) + if( sal_True == nRet ) //has to be queried against TRUE! (RET_NEWTASK) EndListening( *this ); if( pDoc && IsInPrepareClose() ) @@ -301,28 +302,27 @@ USHORT SwDocShell::PrepareClose( BOOL bUI, BOOL bForBrowsing ) } } return nRet; -} +} /*-------------------------------------------------------------------- Description: Organizer --------------------------------------------------------------------*/ -BOOL SwDocShell::Insert( SfxObjectShell &rSource, - USHORT nSourceIdx1, // SourcePool: uppermost content level (templates/macros) - USHORT nSourceIdx2, // Index in the content - USHORT nSourceIdx3, // Index in the content level - USHORT &rIdx1, // and the same for the DestinationPool - USHORT &rIdx2, // "" - USHORT &rIdx3, // "" - USHORT &rRemovedIdx ) // if doubles are being deleted, Pos back +sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, + sal_uInt16 nSourceIdx1, // SourcePool: uppermost content level (templates/macros) + sal_uInt16 nSourceIdx2, // Index in the content + sal_uInt16 nSourceIdx3, // Index in the content level + sal_uInt16 &rIdx1, // and the same for the DestinationPool + sal_uInt16 &rIdx2, // "" + sal_uInt16 &rIdx3, // "" + sal_uInt16 &rRemovedIdx ) // if doubles are being deleted, Pos back { // #i48949# - actions aren't undoable. Thus, allow no undo // actions // Note: The undo action stack is cleared at the end of this method. - bool bDoesUndo( GetDoc()->DoesUndo() ); - GetDoc()->DoUndo( sal_False ); + ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo()); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if (INDEX_IGNORE == rIdx1 && CONTENT_STYLE == nSourceIdx1) rIdx1 = CONTENT_STYLE; @@ -335,7 +335,7 @@ BOOL SwDocShell::Insert( SfxObjectShell &rSource, // we can't move back and forth within ourselves if( pHisPool == pMyPool ) - return FALSE; + return sal_False; if( INDEX_IGNORE == rIdx2 ) rIdx2 = pMyPool->Count(); @@ -355,10 +355,10 @@ BOOL SwDocShell::Insert( SfxObjectShell &rSource, ( SFX_STYLE_FAMILY_CHAR == eOldFamily && rOldName == *SwStyleNameMapper::GetTextUINameArray()[ RES_POOLCOLL_STANDARD - RES_POOLCOLL_TEXT_BEGIN ] )) - return FALSE; + return sal_False; SfxStyleFamily eMyOldFamily( pMyPool->GetSearchFamily() ); - USHORT nMySrchMask = pMyPool->GetSearchMask(); + sal_uInt16 nMySrchMask = pMyPool->GetSearchMask(); SfxStyleSheetBase* pExist; if( ::FindPhyStyle( *pDoc, rOldName, eOldFamily ) ) @@ -367,7 +367,7 @@ BOOL SwDocShell::Insert( SfxObjectShell &rSource, if( ERRCODE_BUTTON_OK != ErrorHandler::HandleError( *new MessageInfo( ERRCODE_SFXMSG_STYLEREPLACE, rOldName )) ) { - return FALSE; + return sal_False; } // Because Replace needs the aStyleSheet-Member itself, the result @@ -381,7 +381,7 @@ BOOL SwDocShell::Insert( SfxObjectShell &rSource, GetDoc()->SetModified(); - return TRUE; + return sal_True; } pMyPool->SetSearchMask( eOldFamily, nMySrchMask ); @@ -413,7 +413,7 @@ BOOL SwDocShell::Insert( SfxObjectShell &rSource, // Used and User-defined templates are being showed. That's why // the Index of the template in the pool has to be found out. pExist = pMyPool->First(); - USHORT nIdx = 0; + sal_uInt16 nIdx = 0; while( pExist ) { if( pExist->GetName() == rOldName && @@ -435,7 +435,7 @@ BOOL SwDocShell::Insert( SfxObjectShell &rSource, // who gets the new one as parent? who uses the new one as Follow? // (always using the instanciated!!!) pMyPool->SetSearchMask( eOldFamily, nMySrchMask ); - pMyPool->SetOrganizerMode( TRUE ); + pMyPool->SetOrganizerMode( sal_True ); SfxStyleSheetBase* pTestSheet = pMyPool->First(); while (pTestSheet) { @@ -496,7 +496,7 @@ BOOL SwDocShell::Insert( SfxObjectShell &rSource, OSL_ENSURE(pDoc, "Doc missing"); GetDoc()->SetModified(); - bRet = TRUE; + bRet = sal_True; } else bRet = SfxObjectShell::Insert( rSource, @@ -510,11 +510,10 @@ BOOL SwDocShell::Insert( SfxObjectShell &rSource, // #i48949# - actions aren't undoable and could have change // the document node array. Thus, clear the undo action stack. - if ( bDoesUndo ) + if (undoGuard.UndoWasEnabled()) { - GetDoc()->DelAllUndoObj(); + GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj(); } - GetDoc()->DoUndo( bDoesUndo ); return bRet; } @@ -523,11 +522,11 @@ BOOL SwDocShell::Insert( SfxObjectShell &rSource, Description: template Remove --------------------------------------------------------------------*/ -BOOL SwDocShell::Remove(USHORT nIdx1, // see Insert - USHORT nIdx2, - USHORT nIdx3) +sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // see Insert + sal_uInt16 nIdx2, + sal_uInt16 nIdx3) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if (CONTENT_STYLE == nIdx1) { @@ -546,13 +545,13 @@ BOOL SwDocShell::Remove(USHORT nIdx1, // see Insert ( SFX_STYLE_FAMILY_CHAR == eFamily && aName == *SwStyleNameMapper::GetTextUINameArray()[ RES_POOLCOLL_STANDARD - RES_POOLCOLL_TEXT_BEGIN ] )) - return FALSE; + return sal_False; // so delete pMyPool->Remove( pMySheet ); // now correct the Parents/Follows of all instanciated - pMyPool->SetOrganizerMode( TRUE ); + pMyPool->SetOrganizerMode( sal_True ); SfxStyleSheetBase* pTestSheet = pMyPool->First(); while (pTestSheet) { @@ -574,7 +573,7 @@ BOOL SwDocShell::Remove(USHORT nIdx1, // see Insert } pMyPool->SetOrganizerMode( SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); - bRet = TRUE; + bRet = sal_True; } else bRet = SfxObjectShell::Remove( nIdx1, @@ -593,8 +592,8 @@ void SwDocShell::Execute(SfxRequest& rReq) { const SfxItemSet* pArgs = rReq.GetArgs(); const SfxPoolItem* pItem; - USHORT nWhich = rReq.GetSlot(); - BOOL bDone = FALSE; + sal_uInt16 nWhich = rReq.GetSlot(); + sal_Bool bDone = sal_False; switch ( nWhich ) { case SID_AUTO_CORRECT_DLG: @@ -613,7 +612,7 @@ void SwDocShell::Execute(SfxRequest& rReq) SfxApplication* pApp = SFX_APP(); SfxRequest aAppReq(SID_AUTO_CORRECT_DLG, SFX_CALLMODE_SYNCHRON, pApp->GetPool()); - SfxBoolItem aSwOptions( SID_AUTO_CORRECT_DLG, TRUE ); + SfxBoolItem aSwOptions( SID_AUTO_CORRECT_DLG, sal_True ); aAppReq.AppendItem(aSwOptions); // SMARTTAGS @@ -623,7 +622,7 @@ void SwDocShell::Execute(SfxRequest& rReq) aSet.Put( aSwOptions ); const SfxPoolItem* pOpenSmartTagOptionsItem = 0; - if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( SID_OPEN_SMARTTAGOPTIONS, FALSE, &pOpenSmartTagOptionsItem ) ) + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( SID_OPEN_SMARTTAGOPTIONS, sal_False, &pOpenSmartTagOptionsItem ) ) aSet.Put( *static_cast<const SfxBoolItem*>(pOpenSmartTagOptionsItem) ); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); @@ -643,7 +642,7 @@ void SwDocShell::Execute(SfxRequest& rReq) pAFlags->pAutoCmpltList = 0; } // remove all pointer we never delete the strings - aTmpLst.Remove( (USHORT)0, aTmpLst.Count() ); + aTmpLst.Remove( (sal_uInt16)0, aTmpLst.Count() ); if( !bOldAutoCmpltCollectWords && bOldAutoCmpltCollectWords != pAFlags->bAutoCmpltCollectWords ) @@ -665,20 +664,20 @@ void SwDocShell::Execute(SfxRequest& rReq) case SID_PRINTPREVIEW: { - BOOL bSet = FALSE, bFound = FALSE, bOnly = TRUE; + sal_Bool bSet = sal_False, bFound = sal_False, bOnly = sal_True; SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this); SfxViewShell* pViewShell = SfxViewShell::Current(); SwView* pCurrView = dynamic_cast< SwView *> ( pViewShell ); - BOOL bCurrent = IS_TYPE( SwPagePreView, pViewShell ); + sal_Bool bCurrent = IS_TYPE( SwPagePreView, pViewShell ); while( pTmpFrm ) // search PreView { if( IS_TYPE( SwView, pTmpFrm->GetViewShell()) ) - bOnly = FALSE; + bOnly = sal_False; else if( IS_TYPE( SwPagePreView, pTmpFrm->GetViewShell())) { pTmpFrm->GetFrame().Appear(); - bFound = TRUE; + bFound = sal_True; } if( bFound && !bOnly ) break; @@ -686,12 +685,12 @@ void SwDocShell::Execute(SfxRequest& rReq) } if( pArgs && SFX_ITEM_SET == - pArgs->GetItemState( SID_PRINTPREVIEW, FALSE, &pItem )) + pArgs->GetItemState( SID_PRINTPREVIEW, sal_False, &pItem )) bSet = ((SfxBoolItem*)pItem)->GetValue(); else bSet = !bCurrent; - USHORT nSlotId = 0; + sal_uInt16 nSlotId = 0; if( bSet && !bFound ) // Nothing found, so create new Preview { // Don't create new one for BrowseView! @@ -722,14 +721,14 @@ void SwDocShell::Execute(SfxRequest& rReq) case SID_TEMPLATE_LOAD: { String aFileName; - static BOOL bText = TRUE; - static BOOL bFrame = FALSE; - static BOOL bPage = FALSE; - static BOOL bNum = FALSE; - static BOOL bMerge = FALSE; - USHORT nRet = USHRT_MAX; - - USHORT nFlags = bFrame ? SFX_LOAD_FRAME_STYLES : 0; + static sal_Bool bText = sal_True; + static sal_Bool bFrame = sal_False; + static sal_Bool bPage = sal_False; + static sal_Bool bNum = sal_False; + static sal_Bool bMerge = sal_False; + sal_uInt16 nRet = USHRT_MAX; + + sal_uInt16 nFlags = bFrame ? SFX_LOAD_FRAME_STYLES : 0; if(bPage) nFlags|= SFX_LOAD_PAGE_STYLES; if(bNum) @@ -741,13 +740,13 @@ void SwDocShell::Execute(SfxRequest& rReq) if ( pArgs ) { - SFX_REQUEST_ARG( rReq, pTemplateItem, SfxStringItem, SID_TEMPLATE_NAME, FALSE ); + SFX_REQUEST_ARG( rReq, pTemplateItem, SfxStringItem, SID_TEMPLATE_NAME, sal_False ); if ( pTemplateItem ) { aFileName = pTemplateItem->GetValue(); - SFX_REQUEST_ARG( rReq, pFlagsItem, SfxInt32Item, SID_TEMPLATE_LOAD, FALSE ); + SFX_REQUEST_ARG( rReq, pFlagsItem, SfxInt32Item, SID_TEMPLATE_LOAD, sal_False ); if ( pFlagsItem ) - nFlags = (USHORT) pFlagsItem->GetValue(); + nFlags = (sal_uInt16) pFlagsItem->GetValue(); } } @@ -780,7 +779,7 @@ void SwDocShell::Execute(SfxRequest& rReq) } pFlt = aIter.Next(); } - BOOL bWeb = 0 != dynamic_cast< SwWebDocShell *>( this ); + sal_Bool bWeb = 0 != dynamic_cast< SwWebDocShell *>( this ); const SfxFilter *pOwnFlt = SwDocShell::Factory().GetFilterContainer()-> GetFilter4FilterName(String::CreateFromAscii("writer8")); @@ -830,7 +829,7 @@ void SwDocShell::Execute(SfxRequest& rReq) bMerge = 0 != (nFlags&SFX_MERGE_STYLES); aOpt.SetMerge( !bMerge ); - SetError( LoadStylesFromFile( aFileName, aOpt, FALSE ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) )); + SetError( LoadStylesFromFile( aFileName, aOpt, sal_False ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) )); if ( !GetError() ) rReq.Done(); } @@ -853,7 +852,7 @@ void SwDocShell::Execute(SfxRequest& rReq) SwIoSystem::GetFilterOfFormat( String::CreateFromAscii("HTML"), SwWebDocShell::Factory().GetFilterContainer() ); - BOOL bLocalHasName = HasName(); + sal_Bool bLocalHasName = HasName(); if(bLocalHasName) { //check for filter type @@ -862,7 +861,7 @@ void SwDocShell::Execute(SfxRequest& rReq) { QueryBox aQuery(&pViewFrm->GetWindow(), SW_RES(MSG_SAVEAS_HTML_QUERY)); if(RET_YES == aQuery.Execute()) - bLocalHasName = FALSE; + bLocalHasName = sal_False; else break; } @@ -888,13 +887,13 @@ void SwDocShell::Execute(SfxRequest& rReq) } #if OSL_DEBUG_LEVEL > 1 { - BOOL bWeb = 0 != dynamic_cast<SwWebDocShell*>(this); + sal_Bool bWeb = 0 != dynamic_cast<SwWebDocShell*>(this); OSL_ENSURE(bWeb == TRUE, "SourceView only in WebDocShell"); } #endif // the SourceView is not the 1 for SwWebDocShell - USHORT nSlot = SID_VIEWSHELL1; - BOOL bSetModified = FALSE; + sal_uInt16 nSlot = SID_VIEWSHELL1; + sal_Bool bSetModified = sal_False; SfxPrinter* pSavePrinter = 0; if( 0 != pSrcView) { @@ -907,13 +906,12 @@ void SwDocShell::Execute(SfxRequest& rReq) utl::TempFile aTempFile; aTempFile.EnableKillingFile(); pSrcView->SaveContent(aTempFile.GetURL()); - bDone = TRUE; - SfxEventConfiguration* pEvent = SFX_APP()->GetEventConfig(); + bDone = sal_True; SvxMacro aMac(aEmptyStr, aEmptyStr, STARBASIC); - pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_OPENDOC ), aMac, this); - pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEDOC ), aMac, this); - pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC ), aMac, this); - pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_DEACTIVATEDOC ), aMac, this); + SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_OPENDOC ), aMac, this); + SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEDOC ), aMac, this); + SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC ), aMac, this); + SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_DEACTIVATEDOC ), aMac, this); ReloadFromHtml(aTempFile.GetURL(), pSrcView); nSlot = 0; } @@ -953,13 +951,13 @@ void SwDocShell::Execute(SfxRequest& rReq) OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(RET_OK == pDlg->Execute()) { - BYTE nLevel = pDlg->GetLevel(); - BYTE nPara = pDlg->GetPara(); + sal_uInt8 nLevel = pDlg->GetLevel(); + sal_uInt8 nPara = pDlg->GetPara(); SwDoc* pSmryDoc = new SwDoc(); - SfxObjectShellRef xDocSh( new SwDocShell( pSmryDoc, SFX_CREATE_MODE_STANDARD)); + SfxObjectShellLock xDocSh( new SwDocShell( pSmryDoc, SFX_CREATE_MODE_STANDARD)); xDocSh->DoInitNew( 0 ); - BOOL bImpress = FN_ABSTRACT_STARIMPRESS == nWhich; + sal_Bool bImpress = FN_ABSTRACT_STARIMPRESS == nWhich; pDoc->Summary( pSmryDoc, nLevel, nPara, bImpress ); if( bImpress ) { @@ -987,12 +985,12 @@ void SwDocShell::Execute(SfxRequest& rReq) pStrm->Seek( STREAM_SEEK_TO_BEGIN ); // Transfer ownership of stream to a lockbytes object - SvLockBytes aLockBytes( pStrm, TRUE ); + SvLockBytes aLockBytes( pStrm, sal_True ); SvLockBytesStat aStat; if ( aLockBytes.Stat( &aStat, SVSTATFLAG_DEFAULT ) == ERRCODE_NONE ) { sal_uInt32 nLen = aStat.nSize; - ULONG nRead = 0; + sal_uLong nRead = 0; uno::Sequence< sal_Int8 > aSeq( nLen ); aLockBytes.ReadAt( 0, aSeq.getArray(), nLen, &nRead ); @@ -1058,12 +1056,12 @@ void SwDocShell::Execute(SfxRequest& rReq) pStrm->Seek( STREAM_SEEK_TO_BEGIN ); // Transfer ownership of stream to a lockbytes object - SvLockBytes aLockBytes( pStrm, TRUE ); + SvLockBytes aLockBytes( pStrm, sal_True ); SvLockBytesStat aStat; if ( aLockBytes.Stat( &aStat, SVSTATFLAG_DEFAULT ) == ERRCODE_NONE ) { sal_uInt32 nLen = aStat.nSize; - ULONG nRead = 0; + sal_uLong nRead = 0; uno::Sequence< sal_Int8 > aSeq( nLen ); aLockBytes.ReadAt( 0, aSeq.getArray(), nLen, &nRead ); @@ -1094,17 +1092,17 @@ void SwDocShell::Execute(SfxRequest& rReq) } break; case SID_SPELLCHECKER_CHANGED: - //! FALSE, TRUE, TRUE is on the save side but a probably overdone - SW_MOD()->CheckSpellChanges(FALSE, TRUE, TRUE, FALSE ); + //! sal_False, sal_True, sal_True is on the save side but a probably overdone + SW_MOD()->CheckSpellChanges(sal_False, sal_True, sal_True, sal_False ); break; case SID_BROWSER_MODE: case FN_PRINT_LAYOUT: // for Web, inverse to BrowserMode { int eState = STATE_TOGGLE; - BOOL bSet = sal_True; + sal_Bool bSet = sal_True; const SfxPoolItem* pAttr=NULL; - if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , FALSE, &pAttr )) + if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , sal_False, &pAttr )) { bSet = ((SfxBoolItem*)pAttr)->GetValue(); if ( nWhich == FN_PRINT_LAYOUT ) @@ -1118,7 +1116,7 @@ void SwDocShell::Execute(SfxRequest& rReq) ToggleBrowserMode(bSet, 0); // OS: mind the numerical order! - static USHORT const aInva[] = + static sal_uInt16 const aInva[] = { SID_NEWWINDOW,/*5620*/ SID_BROWSER_MODE, /*6313*/ @@ -1152,7 +1150,19 @@ void SwDocShell::Execute(SfxRequest& rReq) } break; - case SID_MAIL_EXPORT_FINISHED: + case SID_MAIL_PREPAREEXPORT: + { + //pWrtShell is not set in page preview + if(pWrtShell) + pWrtShell->StartAllAction(); + pDoc->UpdateFlds( NULL, false ); + pDoc->EmbedAllLinks(); + pDoc->RemoveInvisibleContent(); + if(pWrtShell) + pWrtShell->EndAllAction(); + } + break; + case SID_MAIL_EXPORT_FINISHED: { if(pWrtShell) pWrtShell->StartAllAction(); @@ -1165,14 +1175,14 @@ void SwDocShell::Execute(SfxRequest& rReq) case FN_NEW_HTML_DOC: case FN_NEW_GLOBAL_DOC: { - bDone = FALSE; - BOOL bCreateHtml = FN_NEW_HTML_DOC == nWhich; + bDone = sal_False; + sal_Bool bCreateHtml = FN_NEW_HTML_DOC == nWhich; - BOOL bCreateByOutlineLevel = false; //#outline level,add by zhaojianwei + sal_Bool bCreateByOutlineLevel = false; //#outline level,add by zhaojianwei sal_Int32 nTemplateOutlineLevel = 0 ; //#outline level,add by zhaojianwei String aFileName, aTemplateName; - if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich, FALSE, &pItem ) ) + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich, sal_False, &pItem ) ) { aFileName = ((const SfxStringItem*)pItem)->GetValue(); SFX_ITEMSET_ARG( pArgs, pTemplItem, SfxStringItem, SID_TEMPLATE_NAME, sal_False ); @@ -1183,7 +1193,7 @@ void SwDocShell::Execute(SfxRequest& rReq) if ( !aFileName.Len() ) { FileDialogHelper aDlgHelper( TemplateDescription::FILESAVE_AUTOEXTENSION_TEMPLATE, 0 ); - //set HelpIds + const sal_Int16 nControlIds[] = { CommonFilePickerElementIds::PUSHBUTTON_OK, CommonFilePickerElementIds::PUSHBUTTON_CANCEL, @@ -1194,20 +1204,37 @@ void SwDocShell::Execute(SfxRequest& rReq) ExtendedFilePickerElementIds::LISTBOX_TEMPLATE, 0 }; - sal_Int32 nHelpIds[8]; - sal_Int32 nStartHelpId = - bCreateHtml ? - HID_SEND_HTML_CTRL_PUSHBUTTON_OK : HID_SEND_MASTER_CTRL_PUSHBUTTON_OK ; - for(int nHelp = 0; nHelp < 7; nHelp++) - nHelpIds[nHelp] = nStartHelpId++; - nHelpIds[7] = 0; - aDlgHelper.SetControlHelpIds( nControlIds, nHelpIds ); + const char* aHTMLHelpIds[] = + { + HID_SEND_HTML_CTRL_PUSHBUTTON_OK, + HID_SEND_HTML_CTRL_PUSHBUTTON_CANCEL, + HID_SEND_HTML_CTRL_LISTBOX_FILTER, + HID_SEND_HTML_CTRL_CONTROL_FILEVIEW, + HID_SEND_HTML_CTRL_EDIT_FILEURL, + HID_SEND_HTML_CTRL_CHECKBOX_AUTOEXTENSION, + HID_SEND_HTML_CTRL_LISTBOX_TEMPLATE, + "" + }; + + const char* aMasterHelpIds[] = + { + HID_SEND_MASTER_CTRL_PUSHBUTTON_OK, + HID_SEND_MASTER_CTRL_PUSHBUTTON_CANCEL, + HID_SEND_MASTER_CTRL_LISTBOX_FILTER, + HID_SEND_MASTER_CTRL_CONTROL_FILEVIEW, + HID_SEND_MASTER_CTRL_EDIT_FILEURL, + HID_SEND_MASTER_CTRL_CHECKBOX_AUTOEXTENSION, + HID_SEND_MASTER_CTRL_LISTBOX_TEMPLATE, + "" + }; + const char** pHelpIds = bCreateHtml ? aHTMLHelpIds : aMasterHelpIds; + aDlgHelper.SetControlHelpIds( nControlIds, pHelpIds ); uno::Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker(); const SfxFilter* pFlt; - USHORT nStrId; + sal_uInt16 nStrId; if( bCreateHtml ) { @@ -1248,7 +1275,7 @@ void SwDocShell::Execute(SfxRequest& rReq) if( rOutlNds.Count() ) { int nLevel; - for(USHORT n = 0; n < rOutlNds.Count(); ++n ) + for(sal_uInt16 n = 0; n < rOutlNds.Count(); ++n ) if( ( nLevel = rOutlNds[n]->GetTxtNode()->GetAttrOutlineLevel()) > 0 && ! bOutline[nLevel-1] ) { @@ -1256,20 +1283,20 @@ void SwDocShell::Execute(SfxRequest& rReq) } } - const USHORT nStyleCount = pDoc->GetTxtFmtColls()->Count(); + const sal_uInt16 nStyleCount = pDoc->GetTxtFmtColls()->Count(); Sequence<OUString> aListBoxEntries( MAXLEVEL + nStyleCount); OUString* pEntries = aListBoxEntries.getArray(); sal_Int32 nIdx = 0 ; OUString sOutline( SW_RESSTR(STR_FDLG_OUTLINE_LEVEL) ); - for( USHORT i = 0; i < MAXLEVEL; ++i ) + for( sal_uInt16 i = 0; i < MAXLEVEL; ++i ) { if( bOutline[i] ) pEntries[nIdx++] = sOutline + String::CreateFromInt32( i+1 ); } OUString sStyle( SW_RESSTR(STR_FDLG_STYLE) ); - for(USHORT i = 0; i < nStyleCount; ++i) + for(sal_uInt16 i = 0; i < nStyleCount; ++i) { SwTxtFmtColl &rTxtColl = *pDoc->GetTxtFmtColls()->GetObject( i ); @@ -1335,9 +1362,9 @@ void SwDocShell::Execute(SfxRequest& rReq) if( aFileName.Len() ) { - if( PrepareClose( FALSE ) ) + if( PrepareClose( sal_False ) ) { - SwWait aWait( *this, TRUE ); + SwWait aWait( *this, sal_True ); if ( bCreateByOutlineLevel ) { @@ -1395,10 +1422,10 @@ void SwDocShell::Execute(SfxRequest& rReq) break; case SID_ATTR_YEAR2000: - if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , FALSE, &pItem )) + if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , sal_False, &pItem )) { OSL_ENSURE(pItem->ISA(SfxUInt16Item), "wrong Item"); - USHORT nYear2K = ((SfxUInt16Item*)pItem)->GetValue(); + sal_uInt16 nYear2K = ((SfxUInt16Item*)pItem)->GetValue(); // iterate over Views and put the State to FormShells SfxViewFrame* pVFrame = SfxViewFrame::GetFirst( this ); @@ -1413,7 +1440,7 @@ void SwDocShell::Execute(SfxRequest& rReq) pViewShell = pVFrame ? pVFrame->GetViewShell() : 0; pCurrView = dynamic_cast<SwView*>( pViewShell ); } - pDoc->GetNumberFormatter(TRUE)->SetYear2000(nYear2K); + pDoc->GetNumberFormatter(sal_True)->SetYear2000(nYear2K); } break; @@ -1428,7 +1455,7 @@ void lcl_processCompatibleSfxHint( const uno::Reference< document::XVbaEventsHel if ( rHint.ISA( SfxEventHint ) ) { uno::Sequence< uno::Any > aArgs; - ULONG nEventId = ((SfxEventHint&)rHint).GetEventId(); + sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId(); switch( nEventId ) { case SFX_EVENT_CREATEDOC: @@ -1505,25 +1532,27 @@ void SwDocShell::FillClass( SvGlobalName * pClassName, *pUserName = SW_RESSTR(STR_HUMAN_SWDOC_NAME); } -void SwDocShell::SetModified( BOOL bSet ) +void SwDocShell::SetModified( sal_Bool bSet ) { SfxObjectShell::SetModified( bSet ); if( IsEnableSetModified()) { if (!pDoc->IsInCallModified() ) { - EnableSetModified( FALSE ); + EnableSetModified( sal_False ); if( bSet ) { - BOOL bOld = pDoc->IsModified(); + sal_Bool bOld = pDoc->IsModified(); pDoc->SetModified(); if( !bOld ) - pDoc->SetUndoNoResetModified(); + { + pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); + } } else pDoc->ResetModified(); - EnableSetModified( TRUE ); + EnableSetModified( sal_True ); } UpdateChildWindows(); @@ -1564,7 +1593,7 @@ class SwReloadFromHtmlReader : public SwReader void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView ) { - BOOL bModified = IsModified(); + sal_Bool bModified = IsModified(); // The HTTP-Header fields have to be removed, otherwise // there are some from Meta-Tags dublicated or triplicated afterwards. @@ -1583,7 +1612,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView BasicManager *pBasicMan = GetBasicManager(); if( pBasicMan && (pBasicMan != SFX_APP()->GetBasicManager()) ) { - USHORT nLibCount = pBasicMan->GetLibCount(); + sal_uInt16 nLibCount = pBasicMan->GetLibCount(); while( nLibCount ) { StarBASIC *pBasic = pBasicMan->GetLib( --nLibCount ); @@ -1600,7 +1629,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView // Only the modules are deleted from the standard-lib if( nLibCount ) - pBasicMan->RemoveLib( nLibCount, TRUE ); + pBasicMan->RemoveLib( nLibCount, sal_True ); else pBasic->Clear(); } @@ -1637,7 +1666,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView SubInitNew(); - SfxMedium aMed( rStreamName, STREAM_READ, FALSE ); + SfxMedium aMed( rStreamName, STREAM_READ, sal_False ); // #i48748# - use class <SwReloadFromHtmlReader>, because // the base URL has to be set to the filename of the document <rMedname> // and not to the base URL of the temporary file <aMed> in order to get @@ -1653,7 +1682,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView { SwWrtShell& rWrtSh = pCurrView->GetWrtShell(); if( rWrtSh.GetLayout()) - rWrtSh.CheckBrowseView( TRUE ); + rWrtSh.CheckBrowseView( sal_True ); } @@ -1668,7 +1697,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView pDoc->ResetModified(); } -void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) +void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView ) { GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet ); UpdateFontList(); @@ -1692,15 +1721,15 @@ void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) // Currently there can be only one view (layout) if the document is viewed in Web layout // So if there are more views we are in print layout and for toggling to Web layout all other views must be closed - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); + SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, sal_False); do { if( pTmpFrm != pTempView->GetViewFrame() ) { pTmpFrm->DoClose(); - pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); + pTmpFrm = SfxViewFrame::GetFirst(this, sal_False); } else - pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, FALSE); + pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, sal_False); } while ( pTmpFrm ); @@ -1709,7 +1738,7 @@ void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) // set view columns before toggling: if ( bSet ) { - const USHORT nColumns = rViewOptions.GetViewLayoutColumns(); + const sal_uInt16 nColumns = rViewOptions.GetViewLayoutColumns(); const bool bBookMode = rViewOptions.IsViewLayoutBookMode(); if ( 1 != nColumns || bBookMode ) { @@ -1718,7 +1747,7 @@ void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) } // Triggeres a formatting: - pTempView->GetWrtShell().CheckBrowseView( TRUE ); + pTempView->GetWrtShell().CheckBrowseView( sal_True ); pTempView->CheckVisArea(); if( GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE) ) @@ -1735,10 +1764,10 @@ void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) } } -ULONG SwDocShell::LoadStylesFromFile( const String& rURL, - SwgReaderOption& rOpt, BOOL bUnoCall ) +sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, + SwgReaderOption& rOpt, sal_Bool bUnoCall ) { - ULONG nErr = 0; + sal_uLong nErr = 0; // Create a URL from filename INetURLObject aURLObj( rURL ); @@ -1753,14 +1782,14 @@ ULONG SwDocShell::LoadStylesFromFile( const String& rURL, SfxFilterMatcher aMatcher( sFactory ); // search for filter in WebDocShell, too - SfxMedium aMed( rURL, STREAM_STD_READ, FALSE ); + SfxMedium aMed( rURL, STREAM_STD_READ, sal_False ); const SfxFilter* pFlt = 0; - aMatcher.DetectFilter( aMed, &pFlt, FALSE, FALSE ); + aMatcher.DetectFilter( aMed, &pFlt, sal_False, sal_False ); if(!pFlt) { String sWebFactory(String::CreateFromAscii(SwWebDocShell::Factory().GetShortName())); SfxFilterMatcher aWebMatcher( sWebFactory ); - aWebMatcher.DetectFilter( aMed, &pFlt, FALSE, FALSE ); + aWebMatcher.DetectFilter( aMed, &pFlt, sal_False, sal_False ); } if( aMed.IsStorage() ) { diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index 06bf06adab..342d0a6a0c 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -160,30 +160,30 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) SfxPrinter* pPrt = pDoc->getPrinter( false ); String sEntry; - USHORT aFontWhich[] = + sal_uInt16 aFontWhich[] = { RES_CHRATR_FONT, RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_FONT }; - USHORT aFontHeightWhich[] = + sal_uInt16 aFontHeightWhich[] = { RES_CHRATR_FONTSIZE, RES_CHRATR_CJK_FONTSIZE, RES_CHRATR_CTL_FONTSIZE }; - USHORT aFontIds[] = + sal_uInt16 aFontIds[] = { FONT_STANDARD, FONT_STANDARD_CJK, FONT_STANDARD_CTL }; - USHORT nFontTypes[] = + sal_uInt16 nFontTypes[] = { DEFAULTFONT_LATIN_TEXT, DEFAULTFONT_CJK_TEXT, DEFAULTFONT_CTL_TEXT }; - USHORT aLangTypes[] = + sal_uInt16 aLangTypes[] = { RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, @@ -192,29 +192,23 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) for(sal_uInt8 i = 0; i < 3; i++) { - USHORT nFontWhich = aFontWhich[i]; - USHORT nFontId = aFontIds[i]; + sal_uInt16 nFontWhich = aFontWhich[i]; + sal_uInt16 nFontId = aFontIds[i]; SvxFontItem* pFontItem = 0; const SvxLanguageItem& rLang = (const SvxLanguageItem&)pDoc->GetDefault( aLangTypes[i] ); LanguageType eLanguage = rLang.GetLanguage(); if(!pStdFont->IsFontDefault(nFontId)) { sEntry = pStdFont->GetFontFor(nFontId); - sal_Bool bDelete = sal_False; - const SfxFont* pFnt = pPrt ? pPrt->GetFontByName(sEntry): 0; - if(!pFnt) + + Font aFont( sEntry, Size( 0, 10 ) ); + if( pPrt ) { - pFnt = new SfxFont( FAMILY_DONTKNOW, sEntry, PITCH_DONTKNOW, - ::gsl_getSystemTextEncoding() ); - bDelete = sal_True; - } - pFontItem = new SvxFontItem(pFnt->GetFamily(), pFnt->GetName(), - aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), nFontWhich); - if(bDelete) - { - delete (SfxFont*) pFnt; - bDelete = sal_False; + aFont = pPrt->GetFontMetric( aFont ); } + + pFontItem = new SvxFontItem(aFont.GetFamily(), aFont.GetName(), + aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich); } else { @@ -256,7 +250,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) } } - USHORT aFontIdPoolId[] = + sal_uInt16 aFontIdPoolId[] = { FONT_OUTLINE, RES_POOLCOLL_HEADLINE_BASE, FONT_LIST, RES_POOLCOLL_NUMBUL_BASE, @@ -272,8 +266,8 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) FONT_INDEX_CTL, RES_POOLCOLL_REGISTER_BASE }; - USHORT nFontWhich = RES_CHRATR_FONT; - USHORT nFontHeightWhich = RES_CHRATR_FONTSIZE; + sal_uInt16 nFontWhich = RES_CHRATR_FONT; + sal_uInt16 nFontHeightWhich = RES_CHRATR_FONTSIZE; LanguageType eLanguage = static_cast<const SvxLanguageItem&>(pDoc->GetDefault( RES_CHRATR_LANGUAGE )).GetLanguage(); for(sal_uInt8 nIdx = 0; nIdx < 24; nIdx += 2) { @@ -293,25 +287,18 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) if(!pStdFont->IsFontDefault(aFontIdPoolId[nIdx])) { sEntry = pStdFont->GetFontFor(aFontIdPoolId[nIdx]); - sal_Bool bDelete = sal_False; - const SfxFont* pFnt = pPrt ? pPrt->GetFontByName(sEntry): 0; - if(!pFnt) - { - pFnt = new SfxFont( FAMILY_DONTKNOW, sEntry, PITCH_DONTKNOW, - ::gsl_getSystemTextEncoding() ); - bDelete = sal_True; - } + + Font aFont( sEntry, Size( 0, 10 ) ); + if( pPrt ) + aFont = pPrt->GetFontMetric( aFont ); + pColl = pDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]); if( !bHTMLTemplSet || SFX_ITEM_SET != pColl->GetAttrSet().GetItemState( nFontWhich, sal_False ) ) { - pColl->SetFmtAttr(SvxFontItem(pFnt->GetFamily(), pFnt->GetName(), - aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), nFontWhich)); - } - if(bDelete) - { - delete (SfxFont*) pFnt; + pColl->SetFmtAttr(SvxFontItem(aFont.GetFamily(), aFont.GetName(), + aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich)); } } sal_Int32 nFontHeight = pStdFont->GetFontHeight( static_cast< sal_Int8 >(aFontIdPoolId[nIdx]), 0, eLanguage ); @@ -326,6 +313,12 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) pColl->SetFmtAttr( aFontHeight ); } } + + // the default for documents created via 'File/New' should be 'on' + // (old documents, where this property was not yet implemented, will get the + // value 'false' in the SwDoc c-tor) + pDoc->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, + SW_MOD()->GetUsrPref( bWeb )->IsAlignMathObjectsToBaseline() ); } /* #106748# If the default frame direction of a document is RTL @@ -335,14 +328,14 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) pDoc->SetDefault( SvxAdjustItem(SVX_ADJUST_RIGHT, RES_PARATR_ADJUST ) ); // OD 09.10.2003 #i18732# - set dynamic pool default for - // item RES_FOLLOW_TEXT_FLOW to FALSE for *new document*. + // item RES_FOLLOW_TEXT_FLOW to sal_False for *new document*. // Thus, redo this change in method <SwDoc::RemoveAllFmtLanguageDependencies()>, // which is called from <SwDocShell::ConvertFrom(..)> in order to restore // the static pool default. - pDoc->SetDefault( SwFmtFollowTextFlow( FALSE ) ); + pDoc->SetDefault( SwFmtFollowTextFlow( sal_False ) ); // --> collapsing borders FME 2005-05-27 #i29550# - pDoc->SetDefault( SfxBoolItem( RES_COLLAPSING_BORDERS, TRUE ) ); + pDoc->SetDefault( SfxBoolItem( RES_COLLAPSING_BORDERS, sal_True ) ); // <-- collapsing //#i16874# AutoKerning as default for new documents @@ -584,10 +577,10 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) { if( ReadXML ) { - ReadXML->SetOrganizerMode( TRUE ); + ReadXML->SetOrganizerMode( sal_True ); SwReader aRdr( rMedium, aEmptyStr, pDoc ); nErr = aRdr.Read( *ReadXML ); - ReadXML->SetOrganizerMode( FALSE ); + ReadXML->SetOrganizerMode( sal_False ); } } break; @@ -683,10 +676,10 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium ) mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); if( ReadXML ) { - ReadXML->SetOrganizerMode( TRUE ); + ReadXML->SetOrganizerMode( sal_True ); SwReader aRdr( rMedium, aEmptyStr, pDoc ); nErr = aRdr.Read( *ReadXML ); - ReadXML->SetOrganizerMode( FALSE ); + ReadXML->SetOrganizerMode( sal_False ); } } } @@ -748,12 +741,12 @@ void SwDocShell::SubInitNew() { SvxHyphenZoneItem aHyp( (SvxHyphenZoneItem&) pDoc->GetDefault( RES_PARATR_HYPHENZONE) ); - aHyp.GetMinLead() = static_cast< BYTE >(aLinguOpt.nHyphMinLeading); - aHyp.GetMinTrail() = static_cast< BYTE >(aLinguOpt.nHyphMinTrailing); + aHyp.GetMinLead() = static_cast< sal_uInt8 >(aLinguOpt.nHyphMinLeading); + aHyp.GetMinTrail() = static_cast< sal_uInt8 >(aLinguOpt.nHyphMinTrailing); aDfltSet.Put( aHyp ); - sal_uInt16 nNewPos = static_cast< sal_uInt16 >(SW_MOD()->GetUsrPref(FALSE)->GetDefTab()); + sal_uInt16 nNewPos = static_cast< sal_uInt16 >(SW_MOD()->GetUsrPref(sal_False)->GetDefTab()); if( nNewPos ) aDfltSet.Put( SvxTabStopItem( 1, nNewPos, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ) ); @@ -765,7 +758,7 @@ void SwDocShell::SubInitNew() //default page mode for text grid if(!bWeb) { - sal_Bool bSquaredPageMode = SW_MOD()->GetUsrPref(FALSE)->IsSquaredPageMode(); + sal_Bool bSquaredPageMode = SW_MOD()->GetUsrPref(sal_False)->IsSquaredPageMode(); pDoc->SetDefaultPageMode( bSquaredPageMode ); } @@ -779,4 +772,4 @@ IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return pDoc; } const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return pDoc; } IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return pDoc; } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx index ac9bbbbde0..f3cdb11f65 100644 --- a/sw/source/ui/app/docst.cxx +++ b/sw/source/ui/app/docst.cxx @@ -28,6 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XNameAccess.hpp> @@ -53,7 +54,8 @@ #include <fchrfmt.hxx> #include <svtools/htmlcfg.hxx> #include <SwStyleNameMapper.hxx> -#include <undobj.hxx> +#include <SwRewriter.hxx> +#include <numrule.hxx> #include <swundo.hxx> #include "view.hxx" @@ -63,7 +65,8 @@ #include "cmdid.h" #include "globals.hrc" #include "viewopt.hxx" -#include "doc.hxx" +#include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include "swstyle.h" #include "frmfmt.hxx" #include "charfmt.hxx" @@ -90,8 +93,8 @@ using namespace ::com::sun::star; void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) { SfxWhichIter aIter(rSet); - USHORT nWhich = aIter.FirstWhich(); - USHORT nActualFamily = USHRT_MAX; + sal_uInt16 nWhich = aIter.FirstWhich(); + sal_uInt16 nActualFamily = USHRT_MAX; SwWrtShell* pShell = pSh ? pSh : GetWrtShell(); if(!pShell) @@ -108,7 +111,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) SfxViewFrame* pFrame = pShell->GetView().GetViewFrame(); const ISfxTemplateCommon* pCommon = SFX_APP()->GetCurrentTemplateCommon(pFrame->GetBindings()); if( pCommon ) - nActualFamily = static_cast< USHORT >(pCommon->GetActualFamily()); + nActualFamily = static_cast< sal_uInt16 >(pCommon->GetActualFamily()); } while (nWhich) @@ -157,12 +160,12 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) SfxTemplateItem aItem(nWhich, aName); - USHORT nMask = 0; + sal_uInt16 nMask = 0; if( pDoc->get(IDocumentSettingAccess::HTML_MODE) ) nMask = SWSTYLEBIT_HTML; else { - const int nSelection = pShell->GetFrmType(0,TRUE); + const int nSelection = pShell->GetFrmType(0,sal_True); if(pShell->GetCurTOX()) nMask = SWSTYLEBIT_IDX ; else if(nSelection & FRMTYPE_HEADER || @@ -204,7 +207,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) rSet.DisableItem( nWhich ); else { - USHORT n = pShell->GetCurPageDesc( FALSE ); + sal_uInt16 n = pShell->GetCurPageDesc( sal_False ); if( n < pShell->GetPageDescCnt() ) aName = pShell->GetPageDesc( n ).GetName(); @@ -265,42 +268,42 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) { - USHORT nSlot = rReq.GetSlot(); - USHORT nRet = 0xffff; + sal_uInt16 nSlot = rReq.GetSlot(); + sal_uInt16 nRet = 0xffff; const SfxItemSet* pArgs = rReq.GetArgs(); const SfxPoolItem* pItem; SwWrtShell* pActShell = 0; - BOOL bSetReturn = TRUE; + sal_Bool bSetReturn = sal_True; switch (nSlot) { case SID_STYLE_NEW: if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( SID_STYLE_FAMILY, - FALSE, &pItem )) + sal_False, &pItem )) { - USHORT nFamily = ((const SfxUInt16Item*)pItem)->GetValue(); + sal_uInt16 nFamily = ((const SfxUInt16Item*)pItem)->GetValue(); String sName; - USHORT nMask = 0; + sal_uInt16 nMask = 0; if( SFX_ITEM_SET == pArgs->GetItemState( SID_STYLE_NEW, - FALSE, &pItem )) + sal_False, &pItem )) sName = ((const SfxStringItem*)pItem)->GetValue(); if( SFX_ITEM_SET == pArgs->GetItemState( SID_STYLE_MASK, - FALSE, &pItem )) + sal_False, &pItem )) nMask = ((const SfxUInt16Item*)pItem)->GetValue(); String sParent; if( SFX_ITEM_SET == pArgs->GetItemState( SID_STYLE_REFERENCE, - FALSE, &pItem )) + sal_False, &pItem )) sParent = ((const SfxStringItem*)pItem)->GetValue(); - nRet = Edit( sName, sParent, nFamily, nMask, TRUE, FALSE, 0, rReq.IsAPI() ); + nRet = Edit( sName, sParent, nFamily, nMask, sal_True, sal_False, 0, rReq.IsAPI() ); } break; case SID_STYLE_APPLY: if( !pArgs ) { - GetView()->GetViewFrame()->GetDispatcher()->Execute(SID_STYLE_DESIGNER, FALSE); + GetView()->GetViewFrame()->GetDispatcher()->Execute(SID_STYLE_DESIGNER, sal_False); break; } else @@ -339,8 +342,8 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) case SID_STYLE_NEW_BY_EXAMPLE: { String aParam; - USHORT nFamily = SFX_STYLE_FAMILY_PARA; - USHORT nMask = 0; + sal_uInt16 nFamily = SFX_STYLE_FAMILY_PARA; + sal_uInt16 nMask = 0; if( !pArgs ) { @@ -380,14 +383,14 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) OSL_ENSURE( pArgs->Count(), "SfxBug ItemSet is empty"); SwWrtShell* pShell = GetWrtShell(); - if( SFX_ITEM_SET == pArgs->GetItemState(nSlot, FALSE, &pItem )) + if( SFX_ITEM_SET == pArgs->GetItemState(nSlot, sal_False, &pItem )) aParam = ((const SfxStringItem*)pItem)->GetValue(); if( SFX_ITEM_SET == pArgs->GetItemState(SID_STYLE_FAMILY, - FALSE, &pItem )) + sal_False, &pItem )) nFamily = ((const SfxUInt16Item*)pItem)->GetValue(); - if( SFX_ITEM_SET == pArgs->GetItemState(SID_STYLE_FAMILYNAME, FALSE, &pItem )) + if( SFX_ITEM_SET == pArgs->GetItemState(SID_STYLE_FAMILYNAME, sal_False, &pItem )) { String aFamily = ((const SfxStringItem*)pItem)->GetValue(); if(aFamily.CompareToAscii("CharacterStyles") == COMPARE_EQUAL) @@ -407,10 +410,10 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) } if( SFX_ITEM_SET == pArgs->GetItemState(SID_STYLE_MASK, - FALSE, &pItem )) + sal_False, &pItem )) nMask = ((const SfxUInt16Item*)pItem)->GetValue(); if( SFX_ITEM_SET == pArgs->GetItemState(FN_PARAM_WRTSHELL, - FALSE, &pItem )) + sal_False, &pItem )) pActShell = pShell = (SwWrtShell*)((SwPtrItem*)pItem)->GetValue(); if( nSlot == SID_STYLE_UPDATE_BY_EXAMPLE ) @@ -439,7 +442,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) } break; case SFX_STYLE_FAMILY_PSEUDO: - if(SFX_ITEM_SET == pArgs->GetItemState(SID_STYLE_UPD_BY_EX_NAME, FALSE, &pItem)) + if(SFX_ITEM_SET == pArgs->GetItemState(SID_STYLE_UPD_BY_EX_NAME, sal_False, &pItem)) { aParam = ((const SfxStringItem*)pItem)->GetValue(); } @@ -453,7 +456,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) switch(nSlot) { case SID_STYLE_EDIT: - nRet = Edit(aParam, aEmptyStr, nFamily, nMask, FALSE, FALSE, pActShell ); + nRet = Edit(aParam, aEmptyStr, nFamily, nMask, sal_False, sal_False, pActShell ); break; case SID_STYLE_DELETE: nRet = Delete(aParam, nFamily); @@ -504,15 +507,15 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) --------------------------------------------------------------------*/ -USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFamily, USHORT nMask, - BOOL bNew, BOOL bColumn, SwWrtShell* pActShell, - BOOL bBasic ) +sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uInt16 nFamily, sal_uInt16 nMask, + sal_Bool bNew, sal_Bool bColumn, SwWrtShell* pActShell, + sal_Bool bBasic ) { OSL_ENSURE(GetWrtShell(), "No Shell, no Styles"); SfxStyleSheetBase *pStyle = 0; - USHORT nRet = nMask; - BOOL bModified = pDoc->IsModified(); + sal_uInt16 nRet = nMask; + sal_Bool bModified = pDoc->IsModified(); if( bNew ) { @@ -534,7 +537,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam SwTxtFmtColl* pColl = pWrtShell->FindTxtFmtCollByName( rParent ); if(!pColl) { - USHORT nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL); + sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL); if(USHRT_MAX != nId) pColl = pWrtShell->GetTxtCollFromPool( nId ); } @@ -571,7 +574,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam SwCharFmt* pCFmt = pWrtShell->FindCharFmtByName( rParent ); if(!pCFmt) { - USHORT nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT); + sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT); if(USHRT_MAX != nId) pCFmt = pWrtShell->GetCharFmtFromPool( nId ); } @@ -595,7 +598,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam SwFrmFmt* pFFmt = pWrtShell->GetDoc()->FindFrmFmtByName( rParent ); if(!pFFmt) { - USHORT nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT); + sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT); if(USHRT_MAX != nId) pFFmt = pWrtShell->GetFrmFmtFromPool( nId ); } @@ -613,7 +616,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam } if(!pStyle) - return FALSE; + return sal_False; // put dialogues together rtl::Reference< SwDocStyleSheet > xTmp( new SwDocStyleSheet( *(SwDocStyleSheet*)pStyle ) ); @@ -631,7 +634,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam SfxItemSet& rSet = xTmp->GetItemSet(); const SfxPoolItem *pTmpBrush; if( SFX_ITEM_SET == rSet.GetItemState( RES_CHRATR_BACKGROUND, - TRUE, &pTmpBrush ) ) + sal_True, &pTmpBrush ) ) { SvxBrushItem aTmpBrush( *((SvxBrushItem*)pTmpBrush) ); aTmpBrush.SetWhich( RES_BACKGROUND ); @@ -641,7 +644,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam if (!bBasic) { // prior to the dialog the HtmlMode at the DocShell is being sunk - USHORT nHtmlMode = ::GetHtmlMode(this); + sal_uInt16 nHtmlMode = ::GetHtmlMode(this); // In HTML mode, we do not always have a printer. In order to show // the correct page size in the Format - Page dialog, we have to @@ -653,7 +656,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam PutItem(SfxUInt16Item(SID_HTML_MODE, nHtmlMode)); FieldUnit eMetric = ::GetDfltMetric(0 != (HTMLMODE_ON&nHtmlMode)); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< UINT16 >(eMetric))); + SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateTemplateDialog( DLG_TEMPLATE_BASE, @@ -686,7 +689,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam { if(SFX_STYLE_FAMILY_PAGE == nFamily) { - static const USHORT aInval[] = { + static const sal_uInt16 aInval[] = { SID_IMAGE_ORIENTATION, SID_ATTR_CHAR_FONT, FN_INSERT_CTRL, FN_INSERT_OBJ_CTRL, 0}; @@ -697,7 +700,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam { const SfxPoolItem *pTmpBrush; if( SFX_ITEM_SET == aTmpSet.GetItemState( RES_BACKGROUND, - FALSE, &pTmpBrush ) ) + sal_False, &pTmpBrush ) ) { SvxBrushItem aTmpBrush( *((SvxBrushItem*)pTmpBrush) ); aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND ); @@ -710,7 +713,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam if( SFX_STYLE_FAMILY_PAGE == nFamily && SvtLanguageOptions().IsCTLFontEnabled() ) { const SfxPoolItem *pItem = NULL; - if( aTmpSet.GetItemState( GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION, FALSE ) , TRUE, &pItem ) == SFX_ITEM_SET ) + if( aTmpSet.GetItemState( GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION, sal_False ) , sal_True, &pItem ) == SFX_ITEM_SET ) SwChartHelper::DoUpdateAllCharts( pDoc ); } } @@ -727,7 +730,9 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam pDoc->SetModified(); if( !bModified ) // Bug 57028 - pDoc->SetUndoNoResetModified(); + { + pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); + } GetWrtShell()->EndAllAction(); } @@ -735,8 +740,8 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam { if( bNew ) { - GetWrtShell()->Undo(UNDO_EMPTY, 1); - pDoc->ClearRedo(); + GetWrtShell()->Undo(1); + pDoc->GetIDocumentUndoRedo().ClearRedo(); } if( !bModified ) @@ -770,7 +775,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam { const SfxPoolItem *pTmpBrush; if( SFX_ITEM_SET == aTmpSet.GetItemState( RES_BACKGROUND, - FALSE, &pTmpBrush ) ) + sal_False, &pTmpBrush ) ) { SvxBrushItem aTmpBrush( *((SvxBrushItem*)pTmpBrush) ); aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND ); @@ -788,7 +793,9 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam pDoc->SetModified(); if( !bModified ) // Bug 57028 - pDoc->SetUndoNoResetModified(); + { + pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); + } GetWrtShell()->EndAllAction(); } @@ -800,7 +807,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam --------------------------------------------------------------------*/ -USHORT SwDocShell::Delete(const String &rName, USHORT nFamily) +sal_uInt16 SwDocShell::Delete(const String &rName, sal_uInt16 nFamily) { SfxStyleSheetBase *pStyle = mxBasePool->Find(rName, (SfxStyleFamily)nFamily); @@ -812,9 +819,9 @@ USHORT SwDocShell::Delete(const String &rName, USHORT nFamily) mxBasePool->Remove(pStyle); GetWrtShell()->EndAllAction(); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } /*-------------------------------------------------------------------- @@ -822,8 +829,8 @@ USHORT SwDocShell::Delete(const String &rName, USHORT nFamily) --------------------------------------------------------------------*/ -USHORT SwDocShell::ApplyStyles(const String &rName, USHORT nFamily, - SwWrtShell* pShell, USHORT nMode ) +sal_uInt16 SwDocShell::ApplyStyles(const String &rName, sal_uInt16 nFamily, + SwWrtShell* pShell, sal_uInt16 nMode ) { SwDocStyleSheet* pStyle = (SwDocStyleSheet*)mxBasePool->Find(rName, (SfxStyleFamily)nFamily); @@ -831,7 +838,7 @@ USHORT SwDocShell::ApplyStyles(const String &rName, USHORT nFamily, OSL_ENSURE(pStyle, "Where's the StyleSheet"); if(!pStyle) - return FALSE; + return sal_False; SwWrtShell *pSh = pShell ? pShell : GetWrtShell(); @@ -891,16 +898,16 @@ USHORT SwDocShell::ApplyStyles(const String &rName, USHORT nFamily, -USHORT SwDocShell::DoWaterCan(const String &rName, USHORT nFamily) +sal_uInt16 SwDocShell::DoWaterCan(const String &rName, sal_uInt16 nFamily) { OSL_ENSURE(GetWrtShell(), "No Shell, no Styles"); SwEditWin& rEdtWin = pView->GetEditWin(); SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate(); - BOOL bWaterCan = !(pApply && pApply->eType != 0); + sal_Bool bWaterCan = !(pApply && pApply->eType != 0); if( !rName.Len() ) - bWaterCan = FALSE; + bWaterCan = sal_False; SwApplyTemplate aTemplate; aTemplate.eType = nFamily; @@ -949,7 +956,7 @@ USHORT SwDocShell::DoWaterCan(const String &rName, USHORT nFamily) --------------------------------------------------------------------*/ -USHORT SwDocShell::UpdateStyle(const String &rName, USHORT nFamily, SwWrtShell* pShell) +sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWrtShell* pShell) { SwWrtShell* pCurrWrtShell = pShell ? pShell : GetWrtShell(); OSL_ENSURE(GetWrtShell(), "No Shell, no Styles"); @@ -976,7 +983,7 @@ USHORT SwDocShell::UpdateStyle(const String &rName, USHORT nFamily, SwWrtShell* GetWrtShell()->FillByEx(pColl); // also apply template to remove hard set attributes GetWrtShell()->SetTxtFmtColl( pColl ); - GetWrtShell()->EndUndo(UNDO_INSFMTATTR, NULL); + GetWrtShell()->EndUndo(); GetWrtShell()->EndAllAction(); } break; @@ -998,7 +1005,7 @@ USHORT SwDocShell::UpdateStyle(const String &rName, USHORT nFamily, SwWrtShell* pFrm->SetFmtAttr( aSet ); // also apply template to remove hard set attributes - pCurrWrtShell->SetFrmFmt( pFrm, TRUE ); + pCurrWrtShell->SetFrmFmt( pFrm, sal_True ); pCurrWrtShell->EndAllAction(); } } @@ -1039,8 +1046,8 @@ USHORT SwDocShell::UpdateStyle(const String &rName, USHORT nFamily, SwWrtShell* --------------------------------------------------------------------*/ -USHORT SwDocShell::MakeByExample( const String &rName, USHORT nFamily, - USHORT nMask, SwWrtShell* pShell ) +sal_uInt16 SwDocShell::MakeByExample( const String &rName, sal_uInt16 nFamily, + sal_uInt16 nMask, SwWrtShell* pShell ) { SwWrtShell* pCurrWrtShell = pShell ? pShell : GetWrtShell(); SwDocStyleSheet* pStyle = (SwDocStyleSheet*)mxBasePool->Find( @@ -1071,7 +1078,7 @@ USHORT SwDocShell::MakeByExample( const String &rName, USHORT nFamily, pColl->SetDerivedFrom(pCurrWrtShell->GetCurTxtFmtColl()); // set the mask at the Collection: - USHORT nId = pColl->GetPoolFmtId() & 0x87ff; + sal_uInt16 nId = pColl->GetPoolFmtId() & 0x87ff; switch( nMask & 0x0fff ) { case SWSTYLEBIT_TEXT: @@ -1138,13 +1145,13 @@ USHORT SwDocShell::MakeByExample( const String &rName, USHORT nFamily, case SFX_STYLE_FAMILY_PAGE: { pCurrWrtShell->StartAllAction(); - USHORT nPgDsc = pCurrWrtShell->GetCurPageDesc(); + sal_uInt16 nPgDsc = pCurrWrtShell->GetCurPageDesc(); SwPageDesc& rSrc = (SwPageDesc&)pCurrWrtShell->GetPageDesc( nPgDsc ); SwPageDesc& rDest = *(SwPageDesc*)pStyle->GetPageDesc(); - USHORT nPoolId = rDest.GetPoolFmtId(); - USHORT nHId = rDest.GetPoolHelpId(); - BYTE nHFId = rDest.GetPoolHlpFileId(); + sal_uInt16 nPoolId = rDest.GetPoolFmtId(); + sal_uInt16 nHId = rDest.GetPoolHelpId(); + sal_uInt8 nHFId = rDest.GetPoolHlpFileId(); pCurrWrtShell->GetDoc()->CopyPageDesc( rSrc, rDest ); @@ -1154,7 +1161,7 @@ USHORT SwDocShell::MakeByExample( const String &rName, USHORT nFamily, rDest.SetPoolHlpFileId( nHFId ); // when Headers/Footers are created, there is no Undo anymore! - pCurrWrtShell->GetDoc()->DelAllUndoObj(); + pCurrWrtShell->GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj(); pCurrWrtShell->EndAllAction(); } @@ -1183,7 +1190,7 @@ USHORT SwDocShell::MakeByExample( const String &rName, USHORT nFamily, void SwDocShell::LoadStyles( SfxObjectShell& rSource ) { - _LoadStyles(rSource, FALSE); + _LoadStyles(rSource, sal_False); } /* -----------------16.05.2003 15:45----------------- bPreserveCurrentDocument determines whether SetFixFields() is called @@ -1192,7 +1199,7 @@ void SwDocShell::LoadStyles( SfxObjectShell& rSource ) Calls of ::LoadStyles() normally use files especially loaded for the purpose of importing styles. --------------------------------------------------*/ -void SwDocShell::_LoadStyles( SfxObjectShell& rSource, BOOL bPreserveCurrentDocument ) +void SwDocShell::_LoadStyles( SfxObjectShell& rSource, sal_Bool bPreserveCurrentDocument ) { /* [Description] @@ -1219,13 +1226,13 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, BOOL bPreserveCurrentDocu } else { - BOOL bModified = pDoc->IsModified(); + sal_Bool bModified = pDoc->IsModified(); pDoc->ReplaceStyles( *((SwDocShell&)rSource).pDoc ); if( !bModified && pDoc->IsModified() && !pView ) { // the View is created later, but overwrites the Modify-Flag. // Undo doesn't work anymore anyways. - pDoc->SetUndoNoResetModified(); + pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); } } } @@ -1234,9 +1241,9 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, BOOL bPreserveCurrentDocu } -void SwDocShell::FormatPage( const String& rPage, BOOL bColumn, SwWrtShell* pActShell ) +void SwDocShell::FormatPage( const String& rPage, sal_Bool bColumn, SwWrtShell* pActShell ) { - Edit( rPage, aEmptyStr, SFX_STYLE_FAMILY_PAGE, 0, FALSE, bColumn, pActShell); + Edit( rPage, aEmptyStr, SFX_STYLE_FAMILY_PAGE, 0, sal_False, bColumn, pActShell); } Bitmap SwDocShell::GetStyleFamilyBitmap( SfxStyleFamily eFamily ) diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx index 1496cd0a32..6a9b7b8fe1 100644 --- a/sw/source/ui/app/docstyle.cxx +++ b/sw/source/ui/app/docstyle.cxx @@ -52,6 +52,7 @@ #include <docary.hxx> #include <ccoll.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <cmdid.h> #include <swstyle.h> #include <app.hrc> @@ -65,7 +66,6 @@ #include <fmthdft.hxx> #include <svx/svxids.hrc> #include <SwRewriter.hxx> -#include <undobj.hxx> // The Format names in the list of all names have the // following family as their first character: @@ -125,7 +125,7 @@ SwImplShellAction::~SwImplShellAction() SwCharFmt* lcl_FindCharFmt( SwDoc& rDoc, const String& rName, SwDocStyleSheet* pStyle = 0, - BOOL bCreate = TRUE ) + sal_Bool bCreate = sal_True ) { SwCharFmt* pFmt = 0; if( rName.Len() ) @@ -140,7 +140,7 @@ SwCharFmt* lcl_FindCharFmt( SwDoc& rDoc, if( !pFmt && bCreate ) { // explore Pool - const USHORT nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT); + const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT); if(nId != USHRT_MAX) pFmt = rDoc.GetCharFmtFromPool(nId); } @@ -149,7 +149,7 @@ SwCharFmt* lcl_FindCharFmt( SwDoc& rDoc, { if(pFmt) { - pStyle->SetPhysical(TRUE); + pStyle->SetPhysical(sal_True); SwFmt* p = pFmt->DerivedFrom(); if( p && !p->IsDefault() ) pStyle->PresetParent( p->GetName() ); @@ -157,7 +157,7 @@ SwCharFmt* lcl_FindCharFmt( SwDoc& rDoc, pStyle->PresetParent( aEmptyStr ); } else - pStyle->SetPhysical(FALSE); + pStyle->SetPhysical(sal_False); } return pFmt; } @@ -171,7 +171,7 @@ SwCharFmt* lcl_FindCharFmt( SwDoc& rDoc, SwTxtFmtColl* lcl_FindParaFmt( SwDoc& rDoc, const String& rName, SwDocStyleSheet* pStyle = 0, - BOOL bCreate = TRUE ) + sal_Bool bCreate = sal_True ) { SwTxtFmtColl* pColl = 0; @@ -180,7 +180,7 @@ SwTxtFmtColl* lcl_FindParaFmt( SwDoc& rDoc, pColl = rDoc.FindTxtFmtCollByName( rName ); if( !pColl && bCreate ) { // explore Pool - const USHORT nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL); + const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL); if(nId != USHRT_MAX) pColl = rDoc.GetTxtCollFromPool(nId); } @@ -190,7 +190,7 @@ SwTxtFmtColl* lcl_FindParaFmt( SwDoc& rDoc, { if(pColl) { - pStyle->SetPhysical(TRUE); + pStyle->SetPhysical(sal_True); if( pColl->DerivedFrom() && !pColl->DerivedFrom()->IsDefault() ) pStyle->PresetParent( pColl->DerivedFrom()->GetName() ); else @@ -200,7 +200,7 @@ SwTxtFmtColl* lcl_FindParaFmt( SwDoc& rDoc, pStyle->PresetFollow(rNext.GetName()); } else - pStyle->SetPhysical(FALSE); + pStyle->SetPhysical(sal_False); } return pColl; } @@ -214,7 +214,7 @@ SwTxtFmtColl* lcl_FindParaFmt( SwDoc& rDoc, SwFrmFmt* lcl_FindFrmFmt( SwDoc& rDoc, const String& rName, SwDocStyleSheet* pStyle = 0, - BOOL bCreate = TRUE ) + sal_Bool bCreate = sal_True ) { SwFrmFmt* pFmt = 0; if( rName.Len() ) @@ -222,7 +222,7 @@ SwFrmFmt* lcl_FindFrmFmt( SwDoc& rDoc, pFmt = rDoc.FindFrmFmtByName( rName ); if( !pFmt && bCreate ) { // explore Pool - const USHORT nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT); + const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT); if(nId != USHRT_MAX) pFmt = rDoc.GetFrmFmtFromPool(nId); } @@ -232,14 +232,14 @@ SwFrmFmt* lcl_FindFrmFmt( SwDoc& rDoc, { if(pFmt) { - pStyle->SetPhysical(TRUE); + pStyle->SetPhysical(sal_True); if( pFmt->DerivedFrom() && !pFmt->DerivedFrom()->IsDefault() ) pStyle->PresetParent( pFmt->DerivedFrom()->GetName() ); else pStyle->PresetParent( aEmptyStr ); } else - pStyle->SetPhysical(FALSE); + pStyle->SetPhysical(sal_False); } return pFmt; } @@ -252,7 +252,7 @@ SwFrmFmt* lcl_FindFrmFmt( SwDoc& rDoc, const SwPageDesc* lcl_FindPageDesc( SwDoc& rDoc, const String& rName, SwDocStyleSheet* pStyle = 0, - BOOL bCreate = TRUE ) + sal_Bool bCreate = sal_True ) { const SwPageDesc* pDesc = 0; @@ -261,7 +261,7 @@ const SwPageDesc* lcl_FindPageDesc( SwDoc& rDoc, pDesc = rDoc.FindPageDescByName( rName ); if( !pDesc && bCreate ) { - USHORT nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC); + sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC); if(nId != USHRT_MAX) pDesc = rDoc.GetPageDescFromPool(nId); } @@ -271,14 +271,14 @@ const SwPageDesc* lcl_FindPageDesc( SwDoc& rDoc, { if(pDesc) { - pStyle->SetPhysical(TRUE); + pStyle->SetPhysical(sal_True); if(pDesc->GetFollow()) pStyle->PresetFollow(pDesc->GetFollow()->GetName()); else pStyle->PresetParent( aEmptyStr ); } else - pStyle->SetPhysical(FALSE); + pStyle->SetPhysical(sal_False); } return pDesc; } @@ -286,7 +286,7 @@ const SwPageDesc* lcl_FindPageDesc( SwDoc& rDoc, const SwNumRule* lcl_FindNumRule( SwDoc& rDoc, const String& rName, SwDocStyleSheet* pStyle = 0, - BOOL bCreate = TRUE ) + sal_Bool bCreate = sal_True ) { const SwNumRule* pRule = 0; @@ -295,7 +295,7 @@ const SwNumRule* lcl_FindNumRule( SwDoc& rDoc, pRule = rDoc.FindNumRulePtr( rName ); if( !pRule && bCreate ) { - USHORT nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE); + sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE); if(nId != USHRT_MAX) pRule = rDoc.GetNumRuleFromPool(nId); } @@ -305,17 +305,17 @@ const SwNumRule* lcl_FindNumRule( SwDoc& rDoc, { if(pRule) { - pStyle->SetPhysical(TRUE); + pStyle->SetPhysical(sal_True); pStyle->PresetParent( aEmptyStr ); } else - pStyle->SetPhysical(FALSE); + pStyle->SetPhysical(sal_False); } return pRule; } -USHORT lcl_FindName( const SwPoolFmtList& rLst, SfxStyleFamily eFam, +sal_uInt16 lcl_FindName( const SwPoolFmtList& rLst, SfxStyleFamily eFam, const String& rName ) { if( rLst.Count() ) @@ -331,30 +331,30 @@ USHORT lcl_FindName( const SwPoolFmtList& rLst, SfxStyleFamily eFam, default:; //prevent warning } sSrch += rName; - for( USHORT i=0; i < rLst.Count(); ++i ) + for( sal_uInt16 i=0; i < rLst.Count(); ++i ) if( *rLst[i] == sSrch ) return i; } return USHRT_MAX; } -BOOL FindPhyStyle( SwDoc& rDoc, const String& rName, SfxStyleFamily eFam ) +sal_Bool FindPhyStyle( SwDoc& rDoc, const String& rName, SfxStyleFamily eFam ) { switch( eFam ) { case SFX_STYLE_FAMILY_CHAR : - return 0 != lcl_FindCharFmt( rDoc, rName, 0, FALSE ); + return 0 != lcl_FindCharFmt( rDoc, rName, 0, sal_False ); case SFX_STYLE_FAMILY_PARA : - return 0 != lcl_FindParaFmt( rDoc, rName, 0, FALSE ); + return 0 != lcl_FindParaFmt( rDoc, rName, 0, sal_False ); case SFX_STYLE_FAMILY_FRAME: - return 0 != lcl_FindFrmFmt( rDoc, rName, 0, FALSE ); + return 0 != lcl_FindFrmFmt( rDoc, rName, 0, sal_False ); case SFX_STYLE_FAMILY_PAGE : - return 0 != lcl_FindPageDesc( rDoc, rName, 0, FALSE ); + return 0 != lcl_FindPageDesc( rDoc, rName, 0, sal_False ); case SFX_STYLE_FAMILY_PSEUDO: - return 0 != lcl_FindNumRule( rDoc, rName, 0, FALSE ); + return 0 != lcl_FindNumRule( rDoc, rName, 0, sal_False ); default:; //prevent warning } - return FALSE; + return sal_False; } @@ -367,7 +367,7 @@ void SwPoolFmtList::Append( char cChar, const String& rStr ) { String* pStr = new String( cChar ); *pStr += rStr; - for ( USHORT i=0; i < Count(); ++i ) + for ( sal_uInt16 i=0; i < Count(); ++i ) { if( *operator[](i) == *pStr ) { @@ -397,7 +397,7 @@ SwDocStyleSheet::SwDocStyleSheet( SwDoc& rDocument, const String& rName, SwDocStyleSheetPool& _rPool, SfxStyleFamily eFam, - USHORT _nMask) : + sal_uInt16 _nMask) : SfxStyleSheetBase( rName, _rPool, eFam, _nMask ), pCharFmt(0), @@ -427,7 +427,7 @@ SwDocStyleSheet::SwDocStyleSheet( SwDoc& rDocument, SID_PARA_BACKGRND_DESTINATION, SID_ATTR_BRUSH_CHAR, SID_ATTR_NUMBERING_RULE, SID_ATTR_NUMBERING_RULE, 0), - bPhysical(FALSE) + bPhysical(sal_False) { nHelpId = UCHAR_MAX; } @@ -461,7 +461,7 @@ void SwDocStyleSheet::Reset() aName.Erase(); aFollow.Erase(); aParent.Erase(); - SetPhysical(FALSE); + SetPhysical(sal_False); } /*-------------------------------------------------------------------- @@ -502,7 +502,7 @@ const String& SwDocStyleSheet::GetParent() const String sTmp; if( !pFmt ) // not yet there, so default Parent { - USHORT i = SwStyleNameMapper::GetPoolIdFromUIName( aName, eGetType ); + sal_uInt16 i = SwStyleNameMapper::GetPoolIdFromUIName( aName, eGetType ); i = ::GetPoolParent( i ); if( i && USHRT_MAX != i ) SwStyleNameMapper::FillUIName( i, sTmp ); @@ -539,19 +539,19 @@ const String& SwDocStyleSheet::GetFollow() const --------------------------------------------------------------------*/ -BOOL SwDocStyleSheet::HasFollowSupport() const +sal_Bool SwDocStyleSheet::HasFollowSupport() const { switch(nFamily) { case SFX_STYLE_FAMILY_PARA : - case SFX_STYLE_FAMILY_PAGE : return TRUE; + case SFX_STYLE_FAMILY_PAGE : return sal_True; case SFX_STYLE_FAMILY_FRAME: case SFX_STYLE_FAMILY_CHAR : - case SFX_STYLE_FAMILY_PSEUDO: return FALSE; + case SFX_STYLE_FAMILY_PSEUDO: return sal_False; default: OSL_ENSURE(!this, "unknown style family"); } - return FALSE; + return sal_False; } /*-------------------------------------------------------------------- @@ -559,28 +559,28 @@ BOOL SwDocStyleSheet::HasFollowSupport() const --------------------------------------------------------------------*/ -BOOL SwDocStyleSheet::HasParentSupport() const +sal_Bool SwDocStyleSheet::HasParentSupport() const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; switch(nFamily) { case SFX_STYLE_FAMILY_CHAR : case SFX_STYLE_FAMILY_PARA : - case SFX_STYLE_FAMILY_FRAME: bRet = TRUE; + case SFX_STYLE_FAMILY_FRAME: bRet = sal_True; default:; //prevent warning } return bRet; } -BOOL SwDocStyleSheet::HasClearParentSupport() const +sal_Bool SwDocStyleSheet::HasClearParentSupport() const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; switch(nFamily) { case SFX_STYLE_FAMILY_PARA : case SFX_STYLE_FAMILY_CHAR : - case SFX_STYLE_FAMILY_FRAME: bRet = TRUE; + case SFX_STYLE_FAMILY_FRAME: bRet = sal_True; default:; //prevent warning } return bRet; @@ -646,8 +646,8 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) const SfxPoolItem* pItem = aIter.FirstItem(); String sPageNum, sModel, sBreak; - BOOL bHasWesternFontPrefix = FALSE; - BOOL bHasCJKFontPrefix = FALSE; + sal_Bool bHasWesternFontPrefix = sal_False; + sal_Bool bHasCJKFontPrefix = sal_False; SvtCJKOptions aCJKOptions; while ( pItem ) @@ -673,7 +673,7 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) *pItem, SFX_ITEM_PRESENTATION_COMPLETE, eUnit, aItemPresentation, &aIntlWrapper ) ) { - BOOL bIsDefault = FALSE; + sal_Bool bIsDefault = sal_False; switch ( pItem->Which() ) { case SID_ATTR_PARA_PAGENUM: @@ -691,11 +691,11 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) case RES_CHRATR_CJK_POSTURE: case RES_CHRATR_CJK_WEIGHT: if(aCJKOptions.IsCJKFontEnabled()) - bIsDefault = TRUE; + bIsDefault = sal_True; if(!bHasCJKFontPrefix) { aItemPresentation.Insert(SW_RESSTR(STR_CJK_FONT), 0); - bHasCJKFontPrefix = TRUE; + bHasCJKFontPrefix = sal_True; } break; case RES_CHRATR_FONT: @@ -706,12 +706,12 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) if(!bHasWesternFontPrefix) { aItemPresentation.Insert(SW_RESSTR(STR_WESTERN_FONT), 0); - bHasWesternFontPrefix = TRUE; - bIsDefault = TRUE; + bHasWesternFontPrefix = sal_True; + bIsDefault = sal_True; } // no break; default: - bIsDefault = TRUE; + bIsDefault = sal_True; } if(bIsDefault) { @@ -766,20 +766,20 @@ String SwDocStyleSheet::GetDescription() --------------------------------------------------------------------*/ -BOOL SwDocStyleSheet::SetName( const String& rStr) +sal_Bool SwDocStyleSheet::SetName( const String& rStr) { if( !rStr.Len() ) - return FALSE; + return sal_False; if( aName != rStr ) { if( !SfxStyleSheetBase::SetName( rStr )) - return FALSE; + return sal_False; } else if(!bPhysical) FillStyleSheet( FillPhysical ); - int bChg = FALSE; + int bChg = sal_False; switch(nFamily) { case SFX_STYLE_FAMILY_CHAR : @@ -788,7 +788,7 @@ BOOL SwDocStyleSheet::SetName( const String& rStr) if( pCharFmt && pCharFmt->GetName() != rStr ) { pCharFmt->SetName( rStr ); - bChg = TRUE; + bChg = sal_True; } break; } @@ -802,7 +802,7 @@ BOOL SwDocStyleSheet::SetName( const String& rStr) else pColl->SetName(rStr); - bChg = TRUE; + bChg = sal_True; } break; } @@ -816,7 +816,7 @@ BOOL SwDocStyleSheet::SetName( const String& rStr) else pFrmFmt->SetName( rStr ); - bChg = TRUE; + bChg = sal_True; } break; } @@ -831,14 +831,14 @@ BOOL SwDocStyleSheet::SetName( const String& rStr) String aOldName(aPageDesc.GetName()); aPageDesc.SetName( rStr ); - BOOL bDoesUndo = rDoc.DoesUndo(); + bool const bDoesUndo = rDoc.GetIDocumentUndoRedo().DoesUndo(); - rDoc.DoUndo(aOldName.Len() > 0); + rDoc.GetIDocumentUndoRedo().DoUndo(aOldName.Len() > 0); rDoc.ChgPageDesc(aOldName, aPageDesc); - rDoc.DoUndo(bDoesUndo); + rDoc.GetIDocumentUndoRedo().DoUndo(bDoesUndo); rDoc.SetModified(); - bChg = TRUE; + bChg = sal_True; } break; case SFX_STYLE_FAMILY_PSEUDO: @@ -856,7 +856,7 @@ BOOL SwDocStyleSheet::SetName( const String& rStr) pNumRule = rDoc.FindNumRulePtr(rStr); rDoc.SetModified(); - bChg = TRUE; + bChg = sal_True; } } else @@ -865,7 +865,7 @@ BOOL SwDocStyleSheet::SetName( const String& rStr) ((SwNumRule*)pNumRule)->SetName( rStr, rDoc ); rDoc.SetModified(); - bChg = TRUE; + bChg = sal_True; } } @@ -883,7 +883,7 @@ BOOL SwDocStyleSheet::SetName( const String& rStr) if( pSh ) pSh->CallChgLnk(); } - return TRUE; + return sal_True; } /*-------------------------------------------------------------------- @@ -891,7 +891,7 @@ BOOL SwDocStyleSheet::SetName( const String& rStr) --------------------------------------------------------------------*/ -BOOL SwDocStyleSheet::SetParent( const String& rStr) +sal_Bool SwDocStyleSheet::SetParent( const String& rStr) { SwFmt* pFmt = 0, *pParent = 0; switch(nFamily) @@ -921,7 +921,7 @@ BOOL SwDocStyleSheet::SetParent( const String& rStr) OSL_ENSURE(!this, "unknown style family"); } - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( pFmt && pFmt->DerivedFrom() && pFmt->DerivedFrom()->GetName() != rStr ) { @@ -946,10 +946,10 @@ BOOL SwDocStyleSheet::SetParent( const String& rStr) --------------------------------------------------------------------*/ -BOOL SwDocStyleSheet::SetFollow( const String& rStr) +sal_Bool SwDocStyleSheet::SetFollow( const String& rStr) { if( rStr.Len() && !SfxStyleSheetBase::SetFollow( rStr )) - return FALSE; + return sal_False; SwImplShellAction aTmpSh( rDoc ); switch(nFamily) @@ -975,7 +975,7 @@ BOOL SwDocStyleSheet::SetFollow( const String& rStr) const SwPageDesc* pFollowDesc = rStr.Len() ? lcl_FindPageDesc(rDoc, rStr) : 0; - USHORT nId; + sal_uInt16 nId; if( pFollowDesc != pDesc->GetFollow() && rDoc.FindPageDescByName( pDesc->GetName(), &nId ) ) { @@ -995,7 +995,7 @@ BOOL SwDocStyleSheet::SetFollow( const String& rStr) OSL_ENSURE(!this, "unknwown style family"); } - return TRUE; + return sal_True; } /*-------------------------------------------------------------------- @@ -1022,12 +1022,12 @@ SfxItemSet& SwDocStyleSheet::GetItemSet() case SFX_STYLE_FAMILY_FRAME: { SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); - aBoxInfo.SetTable( FALSE ); - aBoxInfo.SetDist( TRUE); // always show gap field - aBoxInfo.SetMinDist( TRUE );// set minimum size in tables and paragraphs + aBoxInfo.SetTable( sal_False ); + aBoxInfo.SetDist( sal_True ); // always show gap field + aBoxInfo.SetMinDist( sal_True );// set minimum size in tables and paragraphs aBoxInfo.SetDefDist( MIN_BORDER_DIST );// always set Default-Gap // Single lines can only have DontCare-Status in tables - aBoxInfo.SetValid( VALID_DISABLE, TRUE ); + aBoxInfo.SetValid( VALID_DISABLE, sal_True ); if ( nFamily == SFX_STYLE_FAMILY_PARA ) { OSL_ENSURE(pColl, "Where's Collection"); @@ -1118,16 +1118,16 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, OSL_ENSURE( &rSet != &aCoreSet, "SetItemSet with own Set is not allowed" ); - if ( rDoc.DoesUndo() ) + if (rDoc.GetIDocumentUndoRedo().DoesUndo()) { SwRewriter aRewriter; aRewriter.AddRule( UNDO_ARG1, GetName() ); - rDoc.StartUndo( UNDO_INSFMTATTR, &aRewriter ); + rDoc.GetIDocumentUndoRedo().StartUndo( UNDO_INSFMTATTR, &aRewriter ); } SwFmt* pFmt = 0; SwPageDesc* pNewDsc = 0; - USHORT nPgDscPos = 0; + sal_uInt16 nPgDscPos = 0; switch(nFamily) { @@ -1142,13 +1142,13 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, { OSL_ENSURE(pColl, "Where's Collection"); const SfxPoolItem* pAutoUpdate; - if(SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE,FALSE, &pAutoUpdate )) + if(SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE,sal_False, &pAutoUpdate )) { pColl->SetAutoUpdateFmt(((const SfxBoolItem*)pAutoUpdate)->GetValue()); } const SwCondCollItem* pCondItem; - if( SFX_ITEM_SET != rSet.GetItemState( FN_COND_COLL, FALSE, + if( SFX_ITEM_SET != rSet.GetItemState( FN_COND_COLL, sal_False, (const SfxPoolItem**)&pCondItem )) pCondItem = 0; @@ -1156,13 +1156,13 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, { SwFmt* pFindFmt; const CommandStruct* pCmds = SwCondCollItem::GetCmds(); - for(USHORT i = 0; i < COND_COMMAND_COUNT; i++) + for(sal_uInt16 i = 0; i < COND_COMMAND_COUNT; i++) { SwCollCondition aCond( 0, pCmds[ i ].nCnd, pCmds[ i ].nSubCond ); ((SwConditionTxtFmtColl*)pColl)->RemoveCondition( aCond ); const String& rStyle = pCondItem->GetStyle( i ); if( rStyle.Len() && - 0 != ( pFindFmt = lcl_FindParaFmt( rDoc, rStyle, 0, TRUE ))) + 0 != ( pFindFmt = lcl_FindParaFmt( rDoc, rStyle, 0, sal_True ))) { pFindFmt->Add( &aCond ); ((SwConditionTxtFmtColl*)pColl)->InsertCondition( aCond ); @@ -1191,11 +1191,11 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, SwTxtFmtColl* pFindFmt; const CommandStruct* pCmds = SwCondCollItem::GetCmds(); - for( USHORT i = 0; i < COND_COMMAND_COUNT; ++i ) + for( sal_uInt16 i = 0; i < COND_COMMAND_COUNT; ++i ) { const String& rStyle = pCondItem->GetStyle( i ); if( rStyle.Len() && - 0 != ( pFindFmt = lcl_FindParaFmt( rDoc, rStyle, 0, TRUE ))) + 0 != ( pFindFmt = lcl_FindParaFmt( rDoc, rStyle, 0, sal_True ))) { pCColl->InsertCondition( SwCollCondition( pFindFmt, pCmds[ i ].nCnd, pCmds[ i ].nSubCond ) ); @@ -1206,9 +1206,9 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, pColl = pCColl; } if ( bResetIndentAttrsAtParagraphStyle && - rSet.GetItemState( RES_PARATR_NUMRULE, FALSE, 0 ) == SFX_ITEM_SET && - rSet.GetItemState( RES_LR_SPACE, FALSE, 0 ) != SFX_ITEM_SET && - pColl->GetItemState( RES_LR_SPACE, FALSE, 0 ) == SFX_ITEM_SET ) + rSet.GetItemState( RES_PARATR_NUMRULE, sal_False, 0 ) == SFX_ITEM_SET && + rSet.GetItemState( RES_LR_SPACE, sal_False, 0 ) != SFX_ITEM_SET && + pColl->GetItemState( RES_LR_SPACE, sal_False, 0 ) == SFX_ITEM_SET ) { rDoc.ResetAttrAtFormat( RES_LR_SPACE, *pColl ); } @@ -1218,7 +1218,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, // neither the paragraph style nor the numbering style is used in the document // the numbering style will not be saved with the document and the assignment got lost. const SfxPoolItem* pNumRuleItem = 0; - if( SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_NUMRULE, FALSE, &pNumRuleItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_NUMRULE, sal_False, &pNumRuleItem ) ) { // Setting a numbering rule? String sNumRule = ((SwNumRuleItem*)pNumRuleItem)->GetValue(); if( sNumRule.Len() ) @@ -1226,7 +1226,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, SwNumRule* pRule = rDoc.FindNumRulePtr( sNumRule ); if( !pRule ) { // Numbering rule not in use yet. - USHORT nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( sNumRule, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE ); + sal_uInt16 nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( sNumRule, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE ); if( USHRT_MAX != nPoolId ) // It's a standard numbering rule { pRule = rDoc.GetNumRuleFromPool( nPoolId ); // Create numbering rule (physical) @@ -1237,7 +1237,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, pFmt = pColl; - USHORT nId = pColl->GetPoolFmtId() & + sal_uInt16 nId = pColl->GetPoolFmtId() & ~ ( COLL_GET_RANGE_BITS | POOLGRP_NOCOLLID ); switch( GetMask() & ( 0x0fff & ~SWSTYLEBIT_CONDCOLL ) ) { @@ -1267,7 +1267,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, { OSL_ENSURE(pFrmFmt, "Where's FrmFmt"); const SfxPoolItem* pAutoUpdate; - if(SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE,FALSE, &pAutoUpdate )) + if(SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE,sal_False, &pAutoUpdate )) { pFrmFmt->SetAutoUpdateFmt(((const SfxBoolItem*)pAutoUpdate)->GetValue()); } @@ -1284,10 +1284,8 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, pNewDsc = new SwPageDesc( *pDesc ); // --> OD 2005-05-09 #i48949# - no undo actions for the // copy of the page style - const sal_Bool bDoesUndo( rDoc.DoesUndo() ); - rDoc.DoUndo( sal_False ); + ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); rDoc.CopyPageDesc(*pDesc, *pNewDsc); // #i7983# - rDoc.DoUndo( bDoesUndo ); // <-- pFmt = &pNewDsc->GetMaster(); @@ -1303,7 +1301,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, break; const SfxPoolItem* pItem; - switch( rSet.GetItemState( SID_ATTR_NUMBERING_RULE, FALSE, &pItem )) + switch( rSet.GetItemState( SID_ATTR_NUMBERING_RULE, sal_False, &pItem )) { case SFX_ITEM_SET: { @@ -1336,7 +1334,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, { SfxItemIter aIter( rSet ); const SfxPoolItem* pItem = aIter.GetCurItem(); - while( TRUE ) + while( sal_True ) { if( IsInvalidItem( pItem ) ) // Clear { @@ -1376,13 +1374,13 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, } } - if ( rDoc.DoesUndo() ) + if (rDoc.GetIDocumentUndoRedo().DoesUndo()) { - rDoc.EndUndo( UNDO_INSFMTATTR, NULL ); + rDoc.GetIDocumentUndoRedo().EndUndo(UNDO_END, 0); } } -void lcl_SaveStyles( USHORT nFamily, SvPtrarr& rArr, SwDoc& rDoc ) +void lcl_SaveStyles( sal_uInt16 nFamily, SvPtrarr& rArr, SwDoc& rDoc ) { switch( nFamily ) { @@ -1441,7 +1439,7 @@ void lcl_SaveStyles( USHORT nFamily, SvPtrarr& rArr, SwDoc& rDoc ) } } -void lcl_DeleteInfoStyles( USHORT nFamily, SvPtrarr& rArr, SwDoc& rDoc ) +void lcl_DeleteInfoStyles( sal_uInt16 nFamily, SvPtrarr& rArr, SwDoc& rDoc ) { sal_uInt16 n, nCnt; switch( nFamily ) @@ -1528,15 +1526,15 @@ void lcl_DeleteInfoStyles( USHORT nFamily, SvPtrarr& rArr, SwDoc& rDoc ) Description: determine the format --------------------------------------------------------------------*/ -BOOL SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) +sal_Bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) { - BOOL bRet = FALSE; - USHORT nPoolId = USHRT_MAX; + sal_Bool bRet = sal_False; + sal_uInt16 nPoolId = USHRT_MAX; SwFmt* pFmt = 0; - BOOL bCreate = FillPhysical == eFType; - BOOL bDeleteInfo = FALSE; - BOOL bFillOnlyInfo = FillAllInfo == eFType; + sal_Bool bCreate = FillPhysical == eFType; + sal_Bool bDeleteInfo = sal_False; + sal_Bool bFillOnlyInfo = FillAllInfo == eFType; SvPtrarr aDelArr; switch(nFamily) @@ -1546,9 +1544,9 @@ BOOL SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) bPhysical = 0 != pCharFmt; if( bFillOnlyInfo && !bPhysical ) { - bDeleteInfo = TRUE; - ::lcl_SaveStyles( static_cast< USHORT >(nFamily), aDelArr, rDoc ); - pCharFmt = lcl_FindCharFmt(rDoc, aName, this, TRUE ); + bDeleteInfo = sal_True; + ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); + pCharFmt = lcl_FindCharFmt(rDoc, aName, this, sal_True ); } pFmt = pCharFmt; @@ -1573,9 +1571,9 @@ BOOL SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) bPhysical = 0 != pColl; if( bFillOnlyInfo && !bPhysical ) { - bDeleteInfo = TRUE; - ::lcl_SaveStyles( static_cast< USHORT >(nFamily), aDelArr, rDoc ); - pColl = lcl_FindParaFmt(rDoc, aName, this, TRUE ); + bDeleteInfo = sal_True; + ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); + pColl = lcl_FindParaFmt(rDoc, aName, this, sal_True ); } pFmt = pColl; @@ -1596,9 +1594,9 @@ BOOL SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) bPhysical = 0 != pFrmFmt; if( bFillOnlyInfo && bPhysical ) { - bDeleteInfo = TRUE; - ::lcl_SaveStyles( static_cast< USHORT >(nFamily), aDelArr, rDoc ); - pFrmFmt = lcl_FindFrmFmt(rDoc, aName, this, TRUE ); + bDeleteInfo = sal_True; + ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); + pFrmFmt = lcl_FindFrmFmt(rDoc, aName, this, sal_True ); } pFmt = pFrmFmt; if( !bCreate && !pFmt ) @@ -1615,9 +1613,9 @@ BOOL SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) bPhysical = 0 != pDesc; if( bFillOnlyInfo && !pDesc ) { - bDeleteInfo = TRUE; - ::lcl_SaveStyles( static_cast< USHORT >(nFamily), aDelArr, rDoc ); - pDesc = lcl_FindPageDesc( rDoc, aName, this, TRUE ); + bDeleteInfo = sal_True; + ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); + pDesc = lcl_FindPageDesc( rDoc, aName, this, sal_True ); } if( pDesc ) @@ -1643,9 +1641,9 @@ BOOL SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) bPhysical = 0 != pNumRule; if( bFillOnlyInfo && !pNumRule ) { - bDeleteInfo = TRUE; - ::lcl_SaveStyles( static_cast< USHORT >(nFamily), aDelArr, rDoc ); - pNumRule = lcl_FindNumRule( rDoc, aName, this, TRUE ); + bDeleteInfo = sal_True; + ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); + pNumRule = lcl_FindNumRule( rDoc, aName, this, sal_True ); } if( pNumRule ) @@ -1676,7 +1674,7 @@ BOOL SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) if( pFmt ) nPoolId = pFmt->GetPoolFmtId(); - USHORT _nMask = 0; + sal_uInt16 _nMask = 0; if( pFmt == rDoc.GetDfltCharFmt() ) _nMask |= SFXSTYLEBIT_READONLY; else if( USER_FMT & nPoolId ) @@ -1709,7 +1707,7 @@ BOOL SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) SetMask( _nMask ); } if( bDeleteInfo && bFillOnlyInfo ) - ::lcl_DeleteInfoStyles( static_cast< USHORT >(nFamily), aDelArr, rDoc ); + ::lcl_DeleteInfoStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); return bRet; } @@ -1727,7 +1725,7 @@ void SwDocStyleSheet::Create() if( !pCharFmt ) pCharFmt = rDoc.MakeCharFmt(aName, rDoc.GetDfltCharFmt()); - pCharFmt->SetAuto( FALSE ); + pCharFmt->SetAuto( sal_False ); break; case SFX_STYLE_FAMILY_PARA : @@ -1745,7 +1743,7 @@ void SwDocStyleSheet::Create() case SFX_STYLE_FAMILY_FRAME: pFrmFmt = lcl_FindFrmFmt( rDoc, aName ); if( !pFrmFmt ) - pFrmFmt = rDoc.MakeFrmFmt(aName, rDoc.GetDfltFrmFmt(), FALSE, FALSE); + pFrmFmt = rDoc.MakeFrmFmt(aName, rDoc.GetDfltFrmFmt(), sal_False, sal_False); break; @@ -1753,7 +1751,7 @@ void SwDocStyleSheet::Create() pDesc = lcl_FindPageDesc( rDoc, aName ); if( !pDesc ) { - USHORT nId = rDoc.MakePageDesc(aName); + sal_uInt16 nId = rDoc.MakePageDesc(aName); pDesc = &const_cast<const SwDoc &>(rDoc).GetPageDesc(nId); } break; @@ -1767,10 +1765,10 @@ void SwDocStyleSheet::Create() sTmpNm = rDoc.GetUniqueNumRuleName(); SwNumRule* pRule = rDoc.GetNumRuleTbl()[ - rDoc.MakeNumRule( sTmpNm, 0, FALSE, + rDoc.MakeNumRule( sTmpNm, 0, sal_False, // #i89178# numfunc::GetDefaultPositionAndSpaceMode() ) ]; - pRule->SetAutoRule( FALSE ); + pRule->SetAutoRule( sal_False ); if( !aName.Len() ) { // #i91400# @@ -1781,7 +1779,7 @@ void SwDocStyleSheet::Create() break; default:; //prevent warning } - bPhysical = TRUE; + bPhysical = sal_True; aCoreSet.ClearItem(); } @@ -1841,7 +1839,7 @@ void SwDocStyleSheet::PresetNameAndFamily(const String& rName) --------------------------------------------------------------------*/ -void SwDocStyleSheet::SetPhysical(BOOL bPhys) +void SwDocStyleSheet::SetPhysical(sal_Bool bPhys) { bPhysical = bPhys; @@ -1861,7 +1859,7 @@ SwFrmFmt* SwDocStyleSheet::GetFrmFmt() return pFrmFmt; } -BOOL SwDocStyleSheet::IsUsed() const +sal_Bool SwDocStyleSheet::IsUsed() const { if( !bPhysical ) { @@ -1870,7 +1868,7 @@ BOOL SwDocStyleSheet::IsUsed() const } if( !bPhysical ) - return FALSE; + return sal_False; const SwModify* pMod; switch( nFamily ) @@ -1881,22 +1879,22 @@ BOOL SwDocStyleSheet::IsUsed() const case SFX_STYLE_FAMILY_PAGE : pMod = pDesc; break; case SFX_STYLE_FAMILY_PSEUDO: - return pNumRule ? rDoc.IsUsed( *pNumRule ) : FALSE; + return pNumRule ? rDoc.IsUsed( *pNumRule ) : sal_False; default: OSL_ENSURE(!this, "unknown style family"); - return FALSE; + return sal_False; } return rDoc.IsUsed( *pMod ); } -ULONG SwDocStyleSheet::GetHelpId( String& rFile ) +sal_uLong SwDocStyleSheet::GetHelpId( String& rFile ) { static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp"); - USHORT nId = 0; - USHORT nPoolId = 0; + sal_uInt16 nId = 0; + sal_uInt16 nPoolId = 0; unsigned char nFileId = UCHAR_MAX; rFile = sTemplateHelpFile; @@ -1906,7 +1904,7 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp"); { case SFX_STYLE_FAMILY_CHAR : if( !pCharFmt && - 0 == (pCharFmt = lcl_FindCharFmt( rDoc, aName, 0, FALSE )) ) + 0 == (pCharFmt = lcl_FindCharFmt( rDoc, aName, 0, sal_False )) ) { nId = SwStyleNameMapper::GetPoolIdFromUIName( aName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ); return USHRT_MAX == nId ? 0 : nId; @@ -1916,7 +1914,7 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp"); case SFX_STYLE_FAMILY_PARA: if( !pColl && - 0 == ( pColl = lcl_FindParaFmt( rDoc, aName, 0, FALSE )) ) + 0 == ( pColl = lcl_FindParaFmt( rDoc, aName, 0, sal_False )) ) { nId = SwStyleNameMapper::GetPoolIdFromUIName( aName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL ); return USHRT_MAX == nId ? 0 : nId; @@ -1926,7 +1924,7 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp"); case SFX_STYLE_FAMILY_FRAME: if( !pFrmFmt && - 0 == ( pFrmFmt = lcl_FindFrmFmt( rDoc, aName, 0, FALSE ) ) ) + 0 == ( pFrmFmt = lcl_FindFrmFmt( rDoc, aName, 0, sal_False ) ) ) { nId = SwStyleNameMapper::GetPoolIdFromUIName( aName, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT ); return USHRT_MAX == nId ? 0 : nId; @@ -1936,7 +1934,7 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp"); case SFX_STYLE_FAMILY_PAGE: if( !pDesc && - 0 == ( pDesc = lcl_FindPageDesc( rDoc, aName, 0, FALSE ) ) ) + 0 == ( pDesc = lcl_FindPageDesc( rDoc, aName, 0, sal_False ) ) ) { nId = SwStyleNameMapper::GetPoolIdFromUIName( aName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC ); return USHRT_MAX == nId ? 0 : nId; @@ -1949,7 +1947,7 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp"); case SFX_STYLE_FAMILY_PSEUDO: if( !pNumRule && - 0 == ( pNumRule = lcl_FindNumRule( rDoc, aName, 0, FALSE ) ) ) + 0 == ( pNumRule = lcl_FindNumRule( rDoc, aName, 0, sal_False ) ) ) { nId = SwStyleNameMapper::GetPoolIdFromUIName( aName, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE ); return USHRT_MAX == nId ? 0 : nId; @@ -1993,10 +1991,10 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp"); } -void SwDocStyleSheet::SetHelpId( const String& r, ULONG nId ) +void SwDocStyleSheet::SetHelpId( const String& r, sal_uLong nId ) { - BYTE nFileId = static_cast< BYTE >(rDoc.SetDocPattern( r )); - USHORT nHId = static_cast< USHORT >(nId); //!! SFX changed over to ULONG arbitrarily! + sal_uInt8 nFileId = static_cast< sal_uInt8 >(rDoc.SetDocPattern( r )); + sal_uInt16 nHId = static_cast< sal_uInt16 >(nId); //!! SFX changed over to ULONG arbitrarily! SwFmt* pTmpFmt = 0; switch( nFamily ) @@ -2029,7 +2027,7 @@ void SwDocStyleSheet::SetHelpId( const String& r, ULONG nId ) Description: methods for DocStyleSheetPool --------------------------------------------------------------------*/ -SwDocStyleSheetPool::SwDocStyleSheetPool( SwDoc& rDocument, BOOL bOrg ) +SwDocStyleSheetPool::SwDocStyleSheetPool( SwDoc& rDocument, sal_Bool bOrg ) : SfxStyleSheetBasePool( rDocument.GetAttrPool() ) , mxStyleSheet( new SwDocStyleSheet( rDocument, aEmptyStr, *this, SFX_STYLE_FAMILY_CHAR, 0 ) ) , rDoc( rDocument ) @@ -2054,15 +2052,15 @@ void SAL_CALL SwDocStyleSheetPool::release( ) throw () SfxStyleSheetBase& SwDocStyleSheetPool::Make( const String& rName, SfxStyleFamily eFam, - USHORT _nMask, - USHORT /*nPos*/ ) + sal_uInt16 _nMask, + sal_uInt16 /*nPos*/ ) { mxStyleSheet->PresetName(rName); mxStyleSheet->PresetParent(aEmptyStr); mxStyleSheet->PresetFollow(aEmptyStr); mxStyleSheet->SetMask(_nMask) ; mxStyleSheet->SetFamily(eFam); - mxStyleSheet->SetPhysical(TRUE); + mxStyleSheet->SetPhysical(sal_True); mxStyleSheet->Create(); return *mxStyleSheet.get(); @@ -2077,7 +2075,7 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Create( const SfxStyleSheetBase& /*rOr SfxStyleSheetBase* SwDocStyleSheetPool::Create( const String &, - SfxStyleFamily, USHORT ) + SfxStyleFamily, sal_uInt16 ) { OSL_ENSURE( !this, "Create im SW-Stylesheet-Pool geht nicht" ); return NULL; @@ -2110,7 +2108,7 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource, SwImplShellAction aTmpSh( rDoc ); - BOOL bSwSrcPool = GetAppName() == rSource.GetPool().GetAppName(); + sal_Bool bSwSrcPool = GetAppName() == rSource.GetPool().GetAppName(); if( SFX_STYLE_FAMILY_PAGE == eFamily && bSwSrcPool ) { // deal with separately! @@ -2124,7 +2122,7 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource, { const SwFmt *pSourceFmt = 0; SwFmt *pTargetFmt = 0; - USHORT nPgDscPos = USHRT_MAX; + sal_uInt16 nPgDscPos = USHRT_MAX; switch( eFamily ) { case SFX_STYLE_FAMILY_CHAR : @@ -2184,7 +2182,7 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource, } SfxStyleSheetIterator* SwDocStyleSheetPool::CreateIterator( - SfxStyleFamily eFam, USHORT _nMask ) + SfxStyleFamily eFam, sal_uInt16 _nMask ) { return new SwStyleSheetIterator( this, eFam, _nMask ); } @@ -2199,35 +2197,35 @@ void SwDocStyleSheetPool::Remove( SfxStyleSheetBase* pStyle) if( !pStyle ) return; - BOOL bBroadcast = TRUE; + sal_Bool bBroadcast = sal_True; SwImplShellAction aTmpSh( rDoc ); const String& rName = pStyle->GetName(); switch( pStyle->GetFamily() ) { case SFX_STYLE_FAMILY_CHAR: { - SwCharFmt* pFmt = lcl_FindCharFmt(rDoc, rName, 0, FALSE ); + SwCharFmt* pFmt = lcl_FindCharFmt(rDoc, rName, 0, sal_False ); if(pFmt) rDoc.DelCharFmt(pFmt); } break; case SFX_STYLE_FAMILY_PARA: { - SwTxtFmtColl* pColl = lcl_FindParaFmt(rDoc, rName, 0, FALSE ); + SwTxtFmtColl* pColl = lcl_FindParaFmt(rDoc, rName, 0, sal_False ); if(pColl) rDoc.DelTxtFmtColl(pColl); } break; case SFX_STYLE_FAMILY_FRAME: { - SwFrmFmt* pFmt = lcl_FindFrmFmt(rDoc, rName, 0, FALSE ); + SwFrmFmt* pFmt = lcl_FindFrmFmt(rDoc, rName, 0, sal_False ); if(pFmt) rDoc.DelFrmFmt(pFmt); } break; case SFX_STYLE_FAMILY_PAGE : { - USHORT nPos; + sal_uInt16 nPos; if( rDoc.FindPageDescByName( rName, &nPos )) rDoc.DelPageDesc( nPos ); } @@ -2237,13 +2235,13 @@ void SwDocStyleSheetPool::Remove( SfxStyleSheetBase* pStyle) { if( !rDoc.DelNumRule( rName ) ) // Only send Broadcast, when something was deleted - bBroadcast = FALSE; + bBroadcast = sal_False; } break; default: OSL_ENSURE(!this, "unknown style family"); - bBroadcast = FALSE; + bBroadcast = sal_False; } if( bBroadcast ) @@ -2252,7 +2250,7 @@ void SwDocStyleSheetPool::Remove( SfxStyleSheetBase* pStyle) -BOOL SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam, +sal_Bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam, const String &rStyle, const String &rParent ) { SwFmt* pFmt = 0, *pParent = 0; @@ -2281,7 +2279,7 @@ BOOL SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam, OSL_ENSURE(!this, "unknown style family"); } - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( pFmt && pFmt->DerivedFrom() && pFmt->DerivedFrom()->GetName() != rParent ) { @@ -2310,9 +2308,9 @@ BOOL SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam, } SfxStyleSheetBase* SwDocStyleSheetPool::Find( const String& rName, - SfxStyleFamily eFam, USHORT n ) + SfxStyleFamily eFam, sal_uInt16 n ) { - USHORT nSMask = n; + sal_uInt16 nSMask = n; if( SFX_STYLE_FAMILY_PARA == eFam && rDoc.get(IDocumentSettingAccess::HTML_MODE) ) { // then only HTML-Templates are of interest @@ -2325,14 +2323,14 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const String& rName, nSMask = SWSTYLEBIT_HTML; } - const BOOL bSearchUsed = ( n != SFXSTYLEBIT_ALL && - n & SFXSTYLEBIT_USED ) ? TRUE : FALSE; + const sal_Bool bSearchUsed = ( n != SFXSTYLEBIT_ALL && + n & SFXSTYLEBIT_USED ) ? sal_True : sal_False; const SwModify* pMod = 0; - mxStyleSheet->SetPhysical( FALSE ); + mxStyleSheet->SetPhysical( sal_False ); mxStyleSheet->PresetName( rName ); mxStyleSheet->SetFamily( eFam ); - BOOL bFnd = mxStyleSheet->FillStyleSheet( SwDocStyleSheet::FillOnlyName ); + sal_Bool bFnd = mxStyleSheet->FillStyleSheet( SwDocStyleSheet::FillOnlyName ); if( mxStyleSheet->IsPhysical() ) { @@ -2363,7 +2361,7 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const String& rName, ? !(pRule->GetPoolFmtId() & USER_FMT) // searched for used and found none : bSearchUsed )) - bFnd = FALSE; + bFnd = sal_False; } break; @@ -2375,7 +2373,7 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const String& rName, // then evaluate the mask: if( pMod && !(bSearchUsed && (bOrganizer || rDoc.IsUsed(*pMod)) ) ) { - const USHORT nId = SFX_STYLE_FAMILY_PAGE == eFam + const sal_uInt16 nId = SFX_STYLE_FAMILY_PAGE == eFam ? ((SwPageDesc*)pMod)->GetPoolFmtId() : ((SwFmt*)pMod)->GetPoolFmtId(); @@ -2383,18 +2381,18 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const String& rName, ? !(nId & USER_FMT) // searched for used and found none : bSearchUsed ) - bFnd = FALSE; + bFnd = sal_False; } return bFnd ? mxStyleSheet.get() : 0; } SwStyleSheetIterator::SwStyleSheetIterator( SwDocStyleSheetPool* pBase, - SfxStyleFamily eFam, USHORT n ) + SfxStyleFamily eFam, sal_uInt16 n ) : SfxStyleSheetIterator( pBase, eFam, n ), mxIterSheet( new SwDocStyleSheet( pBase->GetDoc(), aEmptyStr, *pBase, SFX_STYLE_FAMILY_CHAR, 0 ) ), mxStyleSheet( new SwDocStyleSheet( pBase->GetDoc(), aEmptyStr, *pBase, SFX_STYLE_FAMILY_CHAR, 0 ) ) { - bFirstCalled = FALSE; + bFirstCalled = sal_False; nLastPos = 0; StartListening( *pBase ); } @@ -2404,7 +2402,7 @@ SwStyleSheetIterator::SwStyleSheetIterator( SwDocStyleSheetPool* pBase, EndListening( mxIterSheet->GetPool() ); } -USHORT SwStyleSheetIterator::Count() +sal_uInt16 SwStyleSheetIterator::Count() { // let the list fill correctly!! if( !bFirstCalled ) @@ -2412,13 +2410,13 @@ USHORT SwStyleSheetIterator::Count() return aLst.Count(); } -SfxStyleSheetBase* SwStyleSheetIterator::operator[]( USHORT nIdx ) +SfxStyleSheetBase* SwStyleSheetIterator::operator[]( sal_uInt16 nIdx ) { // found if( !bFirstCalled ) First(); mxStyleSheet->PresetNameAndFamily( *aLst[ nIdx ] ); - mxStyleSheet->SetPhysical( FALSE ); + mxStyleSheet->SetPhysical( sal_False ); mxStyleSheet->FillStyleSheet( SwDocStyleSheet::FillOnlyName ); return mxStyleSheet.get(); @@ -2427,7 +2425,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::operator[]( USHORT nIdx ) SfxStyleSheetBase* SwStyleSheetIterator::First() { // Delete old list - bFirstCalled = TRUE; + bFirstCalled = sal_True; nLastPos = 0; aLst.Erase(); @@ -2435,27 +2433,27 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() mxIterSheet->Reset(); SwDoc& rDoc = ((SwDocStyleSheetPool*)pBasePool)->GetDoc(); - const USHORT nSrchMask = nMask; - const BOOL bIsSearchUsed = SearchUsed(); + const sal_uInt16 nSrchMask = nMask; + const sal_Bool bIsSearchUsed = SearchUsed(); - const BOOL bOrganizer = ((SwDocStyleSheetPool*)pBasePool)->IsOrganizerMode(); + const sal_Bool bOrganizer = ((SwDocStyleSheetPool*)pBasePool)->IsOrganizerMode(); if( nSearchFamily == SFX_STYLE_FAMILY_CHAR || nSearchFamily == SFX_STYLE_FAMILY_ALL ) { - const USHORT nArrLen = rDoc.GetCharFmts()->Count(); - for( USHORT i = 0; i < nArrLen; i++ ) + const sal_uInt16 nArrLen = rDoc.GetCharFmts()->Count(); + for( sal_uInt16 i = 0; i < nArrLen; i++ ) { SwCharFmt* pFmt = (*rDoc.GetCharFmts())[ i ]; if( pFmt->IsDefault() && pFmt != rDoc.GetDfltCharFmt() ) continue; - const BOOL bUsed = bIsSearchUsed && (bOrganizer || rDoc.IsUsed(*pFmt)); + const sal_Bool bUsed = bIsSearchUsed && (bOrganizer || rDoc.IsUsed(*pFmt)); if( !bUsed ) { // Standard is no User template - const USHORT nId = rDoc.GetDfltCharFmt() == pFmt ? - USHORT( RES_POOLCHR_INET_NORMAL ): + const sal_uInt16 nId = rDoc.GetDfltCharFmt() == pFmt ? + sal_uInt16( RES_POOLCHR_INET_NORMAL ): pFmt->GetPoolFmtId(); if( (nSrchMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF ? !(nId & USER_FMT) @@ -2505,7 +2503,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() if( nSearchFamily == SFX_STYLE_FAMILY_PARA || nSearchFamily == SFX_STYLE_FAMILY_ALL ) { - USHORT nSMask = nSrchMask; + sal_uInt16 nSMask = nSrchMask; if( rDoc.get(IDocumentSettingAccess::HTML_MODE) ) { // then only HTML-Template are of interest @@ -2519,18 +2517,18 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() nSMask = SWSTYLEBIT_HTML; } - const USHORT nArrLen = rDoc.GetTxtFmtColls()->Count(); - for( USHORT i = 0; i < nArrLen; i++ ) + const sal_uInt16 nArrLen = rDoc.GetTxtFmtColls()->Count(); + for( sal_uInt16 i = 0; i < nArrLen; i++ ) { SwTxtFmtColl* pColl = (*rDoc.GetTxtFmtColls())[ i ]; if(pColl->IsDefault()) continue; - const BOOL bUsed = bOrganizer || rDoc.IsUsed(*pColl); + const sal_Bool bUsed = bOrganizer || rDoc.IsUsed(*pColl); if( !(bIsSearchUsed && bUsed )) { - const USHORT nId = pColl->GetPoolFmtId(); + const sal_uInt16 nId = pColl->GetPoolFmtId(); switch ( (nSMask & ~SFXSTYLEBIT_USED) ) { case SFXSTYLEBIT_USERDEF: @@ -2559,7 +2557,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() if( (nId & COLL_GET_RANGE_BITS) != COLL_HTML_BITS) { // but some we also want to see in this section - BOOL bWeiter = TRUE; + sal_Bool bWeiter = sal_True; switch( nId ) { case RES_POOLCOLL_SENDADRESS: // --> ADDRESS @@ -2576,7 +2574,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() case RES_POOLCOLL_STANDARD: // --> P case RES_POOLCOLL_FOOTNOTE: case RES_POOLCOLL_ENDNOTE: - bWeiter = FALSE; + bWeiter = sal_False; break; } if( bWeiter ) @@ -2595,7 +2593,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() aLst.Append( cPARA, pColl->GetName() ); } - const BOOL bAll = nSMask == SFXSTYLEBIT_ALL; + const sal_Bool bAll = nSMask == SFXSTYLEBIT_ALL; if ( bAll || (nSMask & ~SFXSTYLEBIT_USED) == SWSTYLEBIT_TEXT ) AppendStyleList(SwStyleNameMapper::GetTextUINameArray(), bIsSearchUsed, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, cPARA ); @@ -2628,7 +2626,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() if( !bAll ) { // then also the ones, that we are mapping: - static USHORT aPoolIds[] = { + static sal_uInt16 aPoolIds[] = { RES_POOLCOLL_SENDADRESS, // --> ADDRESS RES_POOLCOLL_TABLE_HDLN, // --> TH RES_POOLCOLL_TABLE, // --> TD @@ -2646,7 +2644,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() 0 }; - USHORT* pPoolIds = aPoolIds; + sal_uInt16* pPoolIds = aPoolIds; String s; while( *pPoolIds ) { @@ -2662,8 +2660,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() if( nSearchFamily == SFX_STYLE_FAMILY_FRAME || nSearchFamily == SFX_STYLE_FAMILY_ALL ) { - const USHORT nArrLen = rDoc.GetFrmFmts()->Count(); - for( USHORT i = 0; i < nArrLen; i++ ) + const sal_uInt16 nArrLen = rDoc.GetFrmFmts()->Count(); + for( sal_uInt16 i = 0; i < nArrLen; i++ ) { SwFrmFmt* pFmt = (*rDoc.GetFrmFmts())[ i ]; @@ -2672,8 +2670,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() continue; } - const USHORT nId = pFmt->GetPoolFmtId(); - BOOL bUsed = bIsSearchUsed && ( bOrganizer || rDoc.IsUsed(*pFmt)); + const sal_uInt16 nId = pFmt->GetPoolFmtId(); + sal_Bool bUsed = bIsSearchUsed && ( bOrganizer || rDoc.IsUsed(*pFmt)); if( !bUsed ) { if( (nSrchMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF @@ -2698,13 +2696,13 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() if( nSearchFamily == SFX_STYLE_FAMILY_PAGE || nSearchFamily == SFX_STYLE_FAMILY_ALL ) { - const USHORT nCount = rDoc.GetPageDescCnt(); - for(USHORT i = 0; i < nCount; ++i) + const sal_uInt16 nCount = rDoc.GetPageDescCnt(); + for(sal_uInt16 i = 0; i < nCount; ++i) { const SwPageDesc& rDesc = const_cast<const SwDoc &>(rDoc).GetPageDesc(i); - const USHORT nId = rDesc.GetPoolFmtId(); - BOOL bUsed = bIsSearchUsed && ( bOrganizer || rDoc.IsUsed(rDesc)); + const sal_uInt16 nId = rDesc.GetPoolFmtId(); + sal_Bool bUsed = bIsSearchUsed && ( bOrganizer || rDoc.IsUsed(rDesc)); if( !bUsed ) { if( (nSrchMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF @@ -2725,12 +2723,12 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() nSearchFamily == SFX_STYLE_FAMILY_ALL ) { const SwNumRuleTbl& rNumTbl = rDoc.GetNumRuleTbl(); - for(USHORT i = 0; i < rNumTbl.Count(); ++i) + for(sal_uInt16 i = 0; i < rNumTbl.Count(); ++i) { const SwNumRule& rRule = *rNumTbl[ i ]; if( !rRule.IsAutoRule() ) { - BOOL bUsed = bIsSearchUsed && ( bOrganizer || rDoc.IsUsed(rRule) ); + sal_Bool bUsed = bIsSearchUsed && ( bOrganizer || rDoc.IsUsed(rRule) ); if( !bUsed ) { if( (nSrchMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF @@ -2762,7 +2760,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::Next() if(aLst.Count() > 0 && nLastPos < aLst.Count()) { mxIterSheet->PresetNameAndFamily(*aLst[nLastPos]); - mxIterSheet->SetPhysical( FALSE ); + mxIterSheet->SetPhysical( sal_False ); mxIterSheet->SetMask( nMask ); if(mxIterSheet->pSet) { @@ -2788,7 +2786,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::Find( const UniString& rName ) // new name is set, so determine its Data mxStyleSheet->FillStyleSheet( SwDocStyleSheet::FillOnlyName ); if( !mxStyleSheet->IsPhysical() ) - mxStyleSheet->SetPhysical( FALSE ); + mxStyleSheet->SetPhysical( sal_False ); return mxStyleSheet.get(); } @@ -2796,16 +2794,16 @@ SfxStyleSheetBase* SwStyleSheetIterator::Find( const UniString& rName ) } void SwStyleSheetIterator::AppendStyleList(const SvStringsDtor& rList, - BOOL bTestUsed, - USHORT nSection, char cType ) + sal_Bool bTestUsed, + sal_uInt16 nSection, char cType ) { if( bTestUsed ) { SwDoc& rDoc = ((SwDocStyleSheetPool*)pBasePool)->GetDoc(); - for ( USHORT i=0; i < rList.Count(); ++i ) + for ( sal_uInt16 i=0; i < rList.Count(); ++i ) { - BOOL bUsed = FALSE; - USHORT nId = SwStyleNameMapper::GetPoolIdFromUIName(*rList[i], (SwGetPoolIdFromName)nSection); + sal_Bool bUsed = sal_False; + sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(*rList[i], (SwGetPoolIdFromName)nSection); switch ( nSection ) { case nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL: @@ -2827,7 +2825,7 @@ void SwStyleSheetIterator::AppendStyleList(const SvStringsDtor& rList, } } else - for ( USHORT i=0; i < rList.Count(); ++i ) + for ( sal_uInt16 i=0; i < rList.Count(); ++i ) aLst.Append( cType, *rList[i] ); } @@ -2841,7 +2839,7 @@ void SwStyleSheetIterator::Notify( SfxBroadcaster&, const SfxHint& rHint ) if (pStyle) { - USHORT nTmpPos = lcl_FindName( aLst, pStyle->GetFamily(), + sal_uInt16 nTmpPos = lcl_FindName( aLst, pStyle->GetFamily(), pStyle->GetName() ); if( nTmpPos < aLst.Count() ) aLst.DeleteAndDestroy( nTmpPos ); diff --git a/sw/source/ui/app/mainwn.cxx b/sw/source/ui/app/mainwn.cxx index 8af33aca1c..bce152b431 100644 --- a/sw/source/ui/app/mainwn.cxx +++ b/sw/source/ui/app/mainwn.cxx @@ -55,7 +55,7 @@ static SvPtrarr *pProgressContainer = 0; static SwProgress *lcl_SwFindProgress( SwDocShell *pDocShell ) { - for ( USHORT i = 0; i < pProgressContainer->Count(); ++i ) + for ( sal_uInt16 i = 0; i < pProgressContainer->Count(); ++i ) { SwProgress *pTmp = (SwProgress*)(*pProgressContainer)[i]; if ( pTmp->pDocShell == pDocShell ) @@ -65,7 +65,7 @@ static SwProgress *lcl_SwFindProgress( SwDocShell *pDocShell ) } -void StartProgress( USHORT nMessResId, long nStartValue, long nEndValue, +void StartProgress( sal_uInt16 nMessResId, long nStartValue, long nEndValue, SwDocShell *pDocShell ) { if( !SW_MOD()->IsEmbeddedLoadSave() ) @@ -85,8 +85,8 @@ void StartProgress( USHORT nMessResId, long nStartValue, long nEndValue, pProgress->pProgress = new SfxProgress( pDocShell, SW_RESSTR(nMessResId), nEndValue - nStartValue, - FALSE, - TRUE ); + sal_False, + sal_True ); pProgress->nStartCount = 1; pProgress->pDocShell = pDocShell; pProgressContainer->Insert( (void*)pProgress, 0 ); @@ -112,7 +112,7 @@ void EndProgress( SwDocShell *pDocShell ) if( pProgressContainer && !SW_MOD()->IsEmbeddedLoadSave() ) { SwProgress *pProgress = 0; - USHORT i; + sal_uInt16 i; for ( i = 0; i < pProgressContainer->Count(); ++i ) { SwProgress *pTmp = (SwProgress*)(*pProgressContainer)[i]; @@ -138,7 +138,7 @@ void EndProgress( SwDocShell *pDocShell ) } -void SetProgressText( USHORT nId, SwDocShell *pDocShell ) +void SetProgressText( sal_uInt16 nId, SwDocShell *pDocShell ) { if( pProgressContainer && !SW_MOD()->IsEmbeddedLoadSave() ) { diff --git a/sw/source/ui/app/makefile.mk b/sw/source/ui/app/makefile.mk deleted file mode 100644 index 6048ad2ce8..0000000000 --- a/sw/source/ui/app/makefile.mk +++ /dev/null @@ -1,95 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/..$/.. - -PRJNAME=sw -TARGET=app - -LIBTARGET=NO - -# future: DEMO\... - -# --- Settings ----------------------------------------------------- - -.INCLUDE : $(PRJ)$/inc$/swpre.mk -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/inc$/sw.mk - -# --- Files -------------------------------------------------------- - -SRS1NAME=$(TARGET) -SRC1FILES =\ - app.src \ - mn.src \ - error.src - - -SLOFILES = \ - $(EXCEPTIONSFILES) - -EXCEPTIONSFILES= \ - $(SLO)$/appenv.obj \ - $(SLO)$/apphdl.obj \ - $(SLO)$/applab.obj \ - $(SLO)$/appopt.obj \ - $(SLO)$/docsh.obj \ - $(SLO)$/docsh2.obj \ - $(SLO)$/docshdrw.obj \ - $(SLO)$/docshini.obj \ - $(SLO)$/docst.obj \ - $(SLO)$/docstyle.obj \ - $(SLO)$/mainwn.obj \ - $(SLO)$/swdll.obj \ - $(SLO)$/swmodul1.obj \ - $(SLO)$/swmodule.obj \ - $(SLO)$/swwait.obj - -LIB1TARGET= $(SLB)$/app.lib - -LIB1OBJFILES= \ - $(SLO)$/appenv.obj \ - $(SLO)$/apphdl.obj \ - $(SLO)$/applab.obj \ - $(SLO)$/appopt.obj \ - $(SLO)$/docsh.obj \ - $(SLO)$/docsh2.obj \ - $(SLO)$/docshdrw.obj \ - $(SLO)$/docshini.obj \ - $(SLO)$/docst.obj \ - $(SLO)$/docstyle.obj \ - $(SLO)$/mainwn.obj \ - $(SLO)$/swmodul1.obj \ - $(SLO)$/swwait.obj - - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - -$(SRS)$/app.srs: $(SOLARINCDIR)$/svx$/globlmn.hrc - diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src index 68c8bbbb83..928304b15b 100644 --- a/sw/source/ui/app/mn.src +++ b/sw/source/ui/app/mn.src @@ -25,7 +25,349 @@ * ************************************************************************/ -#include "swmn.hrc" +#include <svx/dialogs.hrc> +#include <svx/globlmn.hrc> +#include "cmdid.h" +#include "app.hrc" +#include "globals.hrc" +#include "helpid.h" +#include "popup.hrc" + +/* --------------------- F O R M A T --------------------------------- */ +#define SEPARATOR MenuItem { Separator = TRUE; } +//define for ITEM_FORMAT_NUMBERING +#define DEFINE_SLOTID_FOR_NUMBER_BULLETS FN_NUMBER_BULLETS +#define MN_NUMBERING ITEM_FORMAT_NUMBERING + +#define MN_TXT\ + MenuItem\ + {\ + ITEM_FORMAT_CHAR_DLG\ + };\ + MenuItem\ + {\ + ITEM_FORMAT_PARA_DLG\ + };\ + MenuItem\ + {\ + Identifier = FN_FORMAT_PAGE_DLG ; \ + HelpId = CMD_FN_FORMAT_PAGE_DLG ; \ + Text [ en-US ] = "Pa~ge..." ; \ + }; + + +#define MN_TEXT_ATTR\ + MenuItem\ + {\ + ITEM_FORMAT_ATTR_CHAR_FONT\ + };\ + MenuItem\ + {\ + ITEM_FORMAT_ATTR_CHAR_FONTHEIGHT\ + };\ + MenuItem\ + {\ + Identifier = MN_FORMAT_STYLE ; \ + Command = ".uno:StyleMenu" ; \ + Text [ en-US ] = "St~yle" ; \ + SubMenu = Menu\ + {\ + ItemList = \ + {\ + MenuItem\ + {\ + ITEM_FORMAT_ATTR_CHAR_WEIGHT\ + };\ + MenuItem\ + {\ + ITEM_FORMAT_ATTR_CHAR_POSTURE\ + };\ + MenuItem\ + {\ + ITEM_FORMAT_ATTR_CHAR_OVERLINE\ + };\ + MenuItem\ + {\ + ITEM_FORMAT_ATTR_CHAR_UNDERLINE\ + };\ + MenuItem\ + {\ + ITEM_FORMAT_ATTR_CHAR_STRIKEOUT\ + };\ + MenuItem\ + {\ + ITEM_FORMAT_ATTR_CHAR_SHADOWED\ + };\ + MenuItem\ + {\ + ITEM_FORMAT_ATTR_CHAR_CONTOUR\ + };\ + SEPARATOR ; \ + MenuItem\ + {\ + Identifier = FN_SET_SUPER_SCRIPT ; \ + HelpId = CMD_FN_SET_SUPER_SCRIPT ; \ + Text [ en-US ] = "Superscript" ; \ + };\ + MenuItem\ + {\ + Identifier = FN_SET_SUB_SCRIPT ; \ + HelpId = CMD_FN_SET_SUB_SCRIPT ; \ + Text [ en-US ] = "Subscript" ; \ + };\ + };\ + };\ + };\ + MenuItem\ + {\ + Identifier = MN_FORMAT_ALGN ; \ + Command = ".uno:AlignTextMenu" ; \ + Text [ en-US ] = "A~lignment" ; \ + SubMenu = Menu\ + {\ + ItemList = \ + {\ + MenuItem\ + {\ + RadioCheck = TRUE ; \ + ITEM_FORMAT_ATTR_PARA_ADJUST_LEFT\ + };\ + MenuItem\ + {\ + RadioCheck = TRUE ; \ + ITEM_FORMAT_ATTR_PARA_ADJUST_RIGHT\ + };\ + MenuItem\ + {\ + RadioCheck = TRUE ; \ + ITEM_FORMAT_ATTR_PARA_ADJUST_CENTER\ + };\ + MenuItem\ + {\ + Identifier = SID_ATTR_PARA_ADJUST_BLOCK ; \ + HelpId = CMD_SID_ATTR_PARA_ADJUST_BLOCK ; \ + RadioCheck = TRUE ; \ + Text [ en-US ] = "Justified" ; \ + };\ + };\ + };\ + };\ + MenuItem\ + {\ + Identifier = MN_FORMAT_LINESPACE ; \ + Command = ".uno:LineSpacingMenu" ; \ + Text [ en-US ] = "Line Spacing" ; \ + _MenuItemFlags = MIB_RADIOCHECK ; \ + SubMenu = Menu\ + {\ + ItemList = \ + {\ + MenuItem\ + {\ + RadioCheck = TRUE ; \ + ITEM_FORMAT_PARA_LINESPACE_10\ + };\ + MenuItem\ + {\ + RadioCheck = TRUE ; \ + ITEM_FORMAT_PARA_LINESPACE_15\ + };\ + MenuItem\ + {\ + RadioCheck = TRUE ; \ + ITEM_FORMAT_PARA_LINESPACE_20\ + };\ + };\ + };\ + }; + +/* --------------------- M E N U --------------------------------- */ + +/* + + +The application menu bar resource has become obsolete. You can now find the menu bar at the following +location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml + + +*/ + +/* --------------------- D O C U M E N T -------------------------- */ + + +#define _MN_EDIT_FIELD \ + MenuItem \ + { \ + Identifier = FN_EDIT_FIELD ; \ + HelpId = CMD_FN_EDIT_FIELD ; \ + Text [ en-US ] = "Fields..." ; \ + }; +#define _MN_EDIT_FOOTNOTE \ + MenuItem \ + { \ + Identifier = FN_EDIT_FOOTNOTE ; \ + HelpId = CMD_FN_EDIT_FOOTNOTE ; \ + Text [ en-US ] = "Footnote/Endnote~..." ; \ + }; + #define _MN_EDIT_IDX_ENTRY_DLG \ + MenuItem \ + { \ + Identifier = FN_EDIT_IDX_ENTRY_DLG ; \ + HelpId = CMD_FN_EDIT_IDX_ENTRY_DLG ; \ + Text [ en-US ] = "Inde~x Entry..." ; \ + }; + +#define _MN_EDIT_REDLINE \ + MenuItem \ + { \ + Identifier = FN_REDLINE_ACCEPT_DIRECT; \ + HelpId = CMD_FN_REDLINE_ACCEPT_DIRECT ; \ + Text [ en-US ] = "Accept Change" ; \ + };\ + MenuItem \ + { \ + Identifier = FN_REDLINE_REJECT_DIRECT ; \ + HelpId = CMD_FN_REDLINE_REJECT_DIRECT ; \ + Text [ en-US ] = "Reject Change" ; \ + }; \ + SEPARATOR ; +#define _MN_EDIT_BIB_ENTRY_DLG \ + MenuItem \ + { \ + Identifier = FN_EDIT_AUTH_ENTRY_DLG ; \ + HelpId = CMD_FN_EDIT_AUTH_ENTRY_DLG ; \ + Text [ en-US ] = "~Bibliography Entry..."; \ + }; \ + SEPARATOR ; + +#define _MN_EDIT_OPEN_HYPERLINK \ + MenuItem \ + { \ + ITEM_OPEN_HYPERLINK \ + };\ + MenuItem \ + { \ + Identifier = FN_EDIT_HYPERLINK ; \ + HelpId = CMD_FN_EDIT_HYPERLINK ; \ + Text [ en-US ] = "Edit Hyperlink..."; \ + }; \ + MenuItem \ + { \ + Identifier = FN_COPY_HYPERLINK_LOCATION; \ + HelpId = CMD_FN_COPY_HYPERLINK_LOCATION; \ + Text [ en-US ] = "Copy Hyperlink ~Location"; \ + }; \ + MenuItem \ + { \ + Identifier = FN_REMOVE_HYPERLINK ; \ + HelpId = CMD_FN_REMOVE_HYPERLINK ; \ + Text [ en-US ] = "Remo~ve Hyperlink"; \ + }; + +#define _MN_EDIT_OPEN_SMARTTAGMENU \ + MenuItem \ + { \ + ITEM_OPEN_SMARTTAGMENU \ + }; + +#define _MN_EDIT__HYPERLINK \ + MenuItem\ + {\ + Identifier = FN_EDIT_HYPERLINK ; \ + HelpId = CMD_FN_EDIT_HYPERLINK ; \ + Text [ en-US ] = "~Edit Hyperlink" ; \ + }; + +#define _DEFAULT_TEXT_EDIT_ELEMENTS \ + _MN_EDIT_FIELD \ + _MN_EDIT_FOOTNOTE \ + _MN_EDIT_IDX_ENTRY_DLG \ + _MN_EDIT_BIB_ENTRY_DLG \ + _MN_EDIT_REDLINE \ + MenuItem \ + { \ + ITEM_POPUP_TEMPLATE_EDIT \ + }; \ + SEPARATOR ; \ + _MN_EDIT_OPEN_HYPERLINK \ + _MN_EDIT_OPEN_SMARTTAGMENU + + +#define MN_RESET\ + MenuItem\ + {\ + Identifier = FN_FORMAT_RESET ; \ + HelpId = CMD_FN_FORMAT_RESET ; \ + Text [ en-US ] = "~Default Formatting" ; \ + }; + +#define _NUMBERING_RELATED_MENU \ + SEPARATOR ; \ + MenuItem \ + { \ + Identifier = FN_NUMBER_NEWSTART; \ + HelpId = CMD_FN_NUMBER_NEWSTART; \ + Text[ en-US ] = "Restart Numbering"; \ + }; \ + MenuItem \ + { \ + Identifier = FN_NUM_CONTINUE; \ + HelpId = CMD_FN_NUM_CONTINUE; \ + Text[ en-US ] = "Continue previous numbering"; \ + }; \ + MenuItem \ + { \ + Identifier = FN_NUM_BULLET_UP; \ + HelpId = CMD_FN_NUM_BULLET_UP; \ + Text[ en-US ] = "Up One Level"; \ + }; \ + MenuItem \ + { \ + Identifier = FN_NUM_BULLET_DOWN; \ + HelpId = CMD_FN_NUM_BULLET_DOWN; \ + Text[ en-US ] = "Down One Level"; \ + }; + +#define BASE_TEXT_POPUPMENU_BEGIN \ +{ \ + ItemList = \ + { \ + MN_RESET \ + _NUMBERING_RELATED_MENU \ + SEPARATOR ; \ + MN_TEXT_ATTR \ + SEPARATOR ; \ + MN_TXT \ + MN_NUMBERING \ + ITEM_TRANSLITERATE_MENU \ + SEPARATOR ; + +// not in Writer/Web +#define BASE_TEXT_POPUPMENU_NOWEB \ + MenuItem \ + { \ + Identifier = FN_UPDATE_CUR_TOX ; \ + HelpId = CMD_FN_UPDATE_CUR_TOX ; \ + Text [ en-US ] = "~Update Index/Table"; \ + }; \ + MenuItem \ + { \ + Identifier = FN_EDIT_CURRENT_TOX; \ + HelpId = CMD_FN_EDIT_CURRENT_TOX; \ + Text [ en-US ] = "~Edit Index/Table"; \ + }; \ + MenuItem \ + { \ + Identifier = FN_REMOVE_CUR_TOX; \ + HelpId = CMD_FN_REMOVE_CUR_TOX; \ + Text [ en-US ] = "Delete Index/Table"; \ + }; \ + SEPARATOR ; + +#define BASE_TEXT_POPUPMENU_END \ + _DEFAULT_TEXT_EDIT_ELEMENTS \ + }; \ +}; /*------------------------------------------------------------------------ Description: Menu Window @@ -35,7 +377,7 @@ MenuItem\ {\ Identifier = FN_INSERT_CAPTION ;\ - HelpID = FN_INSERT_CAPTION ;\ + HelpId = CMD_FN_INSERT_CAPTION ;\ Text [ en-US ] = "~Caption..." ;\ }; @@ -43,31 +385,30 @@ MenuItem\ {\ Identifier = FN_FORMAT_TABLE_DLG ; \ - HelpID = FN_FORMAT_TABLE_DLG ; \ + HelpId = CMD_FN_FORMAT_TABLE_DLG ; \ Text [ en-US ] = "~Table..." ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_MERGE_TABLE ; \ - HelpID = FN_TABLE_MERGE_TABLE ; \ + HelpId = CMD_FN_TABLE_MERGE_TABLE ; \ Text [ en-US ] = "Merge Tables";\ };\ MenuItem\ {\ Identifier = FN_TABLE_SPLIT_TABLE ; \ - HelpID = FN_TABLE_SPLIT_TABLE ; \ + HelpId = CMD_FN_TABLE_SPLIT_TABLE ; \ Text [ en-US ] = "~Split Table" ; \ };\ MenuItem\ {\ Identifier = FN_NUM_FORMAT_TABLE_DLG ; \ - HelpID = FN_NUM_FORMAT_TABLE_DLG ; \ + HelpId = CMD_FN_NUM_FORMAT_TABLE_DLG ; \ Text [ en-US ] = "N~umber Format..." ; \ };\ MenuItem\ {\ Identifier = MN_CELL ; \ - HelpID = MN_CELL ; \ Command = ".uno:CellMenu" ; \ Text [ en-US ] = "~Cell" ; \ SubMenu = Menu\ @@ -77,45 +418,45 @@ MenuItem\ {\ Identifier = FN_TABLE_MERGE_CELLS ; \ - HelpID = FN_TABLE_MERGE_CELLS ; \ + HelpId = CMD_FN_TABLE_MERGE_CELLS ; \ Text [ en-US ] = "~Merge" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_SPLIT_CELLS ; \ - HelpID = FN_TABLE_SPLIT_CELLS ; \ + HelpId = CMD_FN_TABLE_SPLIT_CELLS ; \ Text [ en-US ] = "~Split..." ; \ };\ SEPARATOR ; \ MenuItem\ {\ Identifier = FN_TABLE_VERT_NONE ; \ - HelpID = FN_TABLE_VERT_NONE ; \ + HelpId = CMD_FN_TABLE_VERT_NONE ; \ Text [ en-US ] = "~Top" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_VERT_CENTER ; \ - HelpID = FN_TABLE_VERT_CENTER ; \ + HelpId = CMD_FN_TABLE_VERT_CENTER ; \ Text [ en-US ] = "C~enter" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_VERT_BOTTOM ; \ - HelpID = FN_TABLE_VERT_BOTTOM ; \ + HelpId = CMD_FN_TABLE_VERT_BOTTOM ; \ Text [ en-US ] = "~Bottom" ; \ };\ SEPARATOR ; \ MenuItem\ {\ Identifier = FN_TABLE_SET_READ_ONLY_CELLS ; \ - HelpID = FN_TABLE_SET_READ_ONLY_CELLS ; \ + HelpId = CMD_FN_TABLE_SET_READ_ONLY_CELLS ; \ Text [ en-US ] = "~Protect" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_UNSET_READ_ONLY_CELLS ; \ - HelpID = FN_TABLE_UNSET_READ_ONLY_CELLS ; \ + HelpId = CMD_FN_TABLE_UNSET_READ_ONLY_CELLS ; \ Text [ en-US ] = "~Unprotect" ; \ };\ };\ @@ -136,44 +477,44 @@ MenuItem\ {\ Identifier = FN_TABLE_SET_ROW_HEIGHT ; \ - HelpID = FN_TABLE_SET_ROW_HEIGHT ; \ + HelpId = CMD_FN_TABLE_SET_ROW_HEIGHT ; \ Text [ en-US ] = "~Height..." ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_ROW_SPLIT;\ - HelpID = FN_TABLE_ROW_SPLIT ; \ + HelpId = CMD_FN_TABLE_ROW_SPLIT ; \ Text [ en-US ] = "Allow Row to Break A~cross Pages and Columns" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_OPTIMAL_HEIGHT ; \ - HelpID = FN_TABLE_OPTIMAL_HEIGHT ; \ + HelpId = CMD_FN_TABLE_OPTIMAL_HEIGHT ; \ Text [ en-US ] = "~Optimal Height" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_BALANCE_ROWS ; \ - HelpID = FN_TABLE_BALANCE_ROWS ; \ + HelpId = CMD_FN_TABLE_BALANCE_ROWS ; \ Text [ en-US ] = "Space ~Equally" ; \ };\ SEPARATOR ; \ MenuItem\ {\ Identifier = FN_TABLE_SELECT_ROW ; \ - HelpID = FN_TABLE_SELECT_ROW ; \ + HelpId = CMD_FN_TABLE_SELECT_ROW ; \ Text [ en-US ] = "~Select" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_INSERT_ROW_DLG ; \ - HelpID = FN_TABLE_INSERT_ROW_DLG ; \ + HelpId = CMD_FN_TABLE_INSERT_ROW_DLG ; \ Text [ en-US ] = "~Insert..." ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_DELETE_ROW ; \ - HelpID = FN_TABLE_DELETE_ROW ; \ + HelpId = CMD_FN_TABLE_DELETE_ROW ; \ Text [ en-US ] = "~Delete" ; \ };\ };\ @@ -192,38 +533,38 @@ MenuItem\ {\ Identifier = FN_TABLE_SET_COL_WIDTH ; \ - HelpID = FN_TABLE_SET_COL_WIDTH ; \ + HelpId = CMD_FN_TABLE_SET_COL_WIDTH ; \ Text [ en-US ] = "~Width..." ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_ADJUST_CELLS ; \ - HelpID = FN_TABLE_ADJUST_CELLS ; \ + HelpId = CMD_FN_TABLE_ADJUST_CELLS ; \ Text [ en-US ] = "~Optimal Width " ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_BALANCE_CELLS ; \ - HelpID = FN_TABLE_BALANCE_CELLS ; \ + HelpId = CMD_FN_TABLE_BALANCE_CELLS ; \ Text [ en-US ] = "Space ~Equally" ; \ };\ SEPARATOR ; \ MenuItem\ {\ Identifier = FN_TABLE_SELECT_COL ; \ - HelpID = FN_TABLE_SELECT_COL ; \ + HelpId = CMD_FN_TABLE_SELECT_COL ; \ Text [ en-US ] = "~Select" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_INSERT_COL_DLG ; \ - HelpID = FN_TABLE_INSERT_COL_DLG ; \ + HelpId = CMD_FN_TABLE_INSERT_COL_DLG ; \ Text [ en-US ] = "~Insert..." ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_DELETE_COL ; \ - HelpID = FN_TABLE_DELETE_COL ; \ + HelpId = CMD_FN_TABLE_DELETE_COL ; \ Text [ en-US ] = "~Delete" ; \ };\ };\ @@ -244,7 +585,7 @@ MenuItem\ {\ Identifier = FN_DRAWTEXT_ATTR_DLG ; \ - HelpID = FN_DRAWTEXT_ATTR_DLG ; \ + HelpId = CMD_FN_DRAWTEXT_ATTR_DLG ; \ Text [ en-US ] = "Te~xt..." ; \ }; @@ -252,7 +593,7 @@ MenuItem\ {\ Identifier = FN_NAME_SHAPE ; \ - HelpID = FN_NAME_SHAPE ; \ + HelpId = CMD_FN_NAME_SHAPE ; \ Text [ en-US ] = "Name..." ; \ }; @@ -260,7 +601,7 @@ MenuItem\ {\ Identifier = FN_TITLE_DESCRIPTION_SHAPE; \ - HelpID = FN_TITLE_DESCRIPTION_SHAPE; \ + HelpId = CMD_FN_TITLE_DESCRIPTION_SHAPE; \ Text [ en-US ] = "Description..." ; \ }; @@ -268,7 +609,7 @@ MenuItem\ {\ Identifier = FN_FORMAT_FRAME_DLG ; \ - HelpID = FN_FORMAT_FRAME_DLG ; \ + HelpId = CMD_FN_FORMAT_FRAME_DLG ; \ Text [ en-US ] = "~Frame..." ; \ }; @@ -323,13 +664,13 @@ MenuItem\ {\ Identifier = FN_FRAME_UP ; \ - HelpID = FN_FRAME_UP ; \ + HelpId = CMD_FN_FRAME_UP ; \ Text [ en-US ] = "Bring ~Forward" ; \ };\ MenuItem\ {\ Identifier = FN_FRAME_DOWN ; \ - HelpID = FN_FRAME_DOWN ; \ + HelpId = CMD_FN_FRAME_DOWN ; \ Text [ en-US ] = "Send Back~ward" ; \ }; @@ -409,45 +750,45 @@ MenuItem\ {\ Identifier = FN_REPLY ;\ - HelpID = FN_DELETE_NOTE ;\ + HelpID = CMD_FN_REPLY ;\ Text [ en-US ] = "Reply" ;\ };\ SEPARATOR ; \ MenuItem\ {\ - Identifier = FN_DELETE_NOTE ;\ - HelpID = FN_DELETE_NOTE ;\ + Identifier = FN_DELETE_COMMENT ;\ + HelpID = CMD_FN_DELETE_COMMENT ;\ Text [ en-US ] = "Delete ~Comment" ;\ };\ MenuItem\ {\ Identifier = FN_DELETE_NOTE_AUTHOR ;\ - HelpID = FN_DELETE_NOTE_AUTHOR ;\ + HelpId = CMD_FN_DELETE_NOTE_AUTHOR ;\ Text [ en-US ] = "Delete ~All Comments by $1" ;\ };\ MenuItem\ {\ Identifier = FN_DELETE_ALL_NOTES ;\ - HelpID = FN_DELETE_ALL_NOTES ;\ + HelpId = CMD_FN_DELETE_ALL_NOTES ;\ Text [ en-US ] = "~Delete All Comments" ;\ };\ /* MenuItem\ {\ Identifier = FN_HIDE_NOTE ;\ - HelpID = FN_HIDE_NOTE ;\ + HelpId = CMD_FN_HIDE_NOTE ;\ Text [ en-US ] = "~Hide comment" ;\ };\ MenuItem\ {\ Identifier = FN_HIDE_NOTE_AUTHOR ;\ - HelpID = FN_HIDE_NOTE_AUTHOR ;\ + HelpId = CMD_FN_HIDE_NOTE_AUTHOR ;\ Text [ en-US ] = "Hide ~author" ;\ };\ MenuItem\ {\ Identifier = FN_HIDE_ALL_NOTES ;\ - HelpID = FN_HIDE_ALL_NOTES ;\ + HelpId = CMD_FN_HIDE_ALL_NOTES ;\ Text [ en-US ] = "Hide all ~comments" ;\ }; */ @@ -490,13 +831,13 @@ Menu MN_TAB_POPUPMENU MenuItem { Identifier = FN_VIEW_TABLEGRID ; - HelpID = FN_VIEW_TABLEGRID ; + HelpId = CMD_FN_VIEW_TABLEGRID ; Text [ en-US ] = "Table Boundaries" ; }; MenuItem { Identifier = FN_SET_MODOPT_TBLNUMFMT ; - HelpID = FN_SET_MODOPT_TBLNUMFMT ; + HelpId = CMD_FN_SET_MODOPT_TBLNUMFMT ; Text [ en-US ] = "~Number Recognition"; }; SEPARATOR ; @@ -508,7 +849,7 @@ Menu MN_TAB_POPUPMENU MenuItem\ {\ Identifier = FN_FRAME_WRAP_CONTOUR ; \ - HelpID = FN_FRAME_WRAP_CONTOUR ; \ + HelpId = CMD_FN_FRAME_WRAP_CONTOUR ; \ Text [ en-US ] = "~Contour" ; \ }; @@ -516,7 +857,7 @@ Menu MN_TAB_POPUPMENU MenuItem\ {\ Identifier = SID_CONTOUR_DLG ; \ - HelpID = SID_CONTOUR_DLG ; \ + HelpId = CMD_SID_CONTOUR_DLG ; \ Text [ en-US ] = "~Edit Contour..." ; \ }; @@ -527,7 +868,6 @@ Menu MN_TAB_POPUPMENU MenuItem\ {\ Identifier = MN_WRAP ; \ - HelpID = MN_WRAP ; \ Command = ".uno:WrapMenu" ; \ Text [ en-US ] = "~Wrap" ; \ SubMenu = Menu\ @@ -538,35 +878,35 @@ Menu MN_TAB_POPUPMENU {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_NOWRAP ; \ - HelpID = FN_FRAME_NOWRAP ; \ + HelpId = CMD_FN_FRAME_NOWRAP ; \ Text [ en-US ] = "~No Wrap" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAP ; \ - HelpID = FN_FRAME_WRAP ; \ + HelpId = CMD_FN_FRAME_WRAP ; \ Text [ en-US ] = "~Page Wrap" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAP_IDEAL ; \ - HelpID = FN_FRAME_WRAP_IDEAL ; \ + HelpId = CMD_FN_FRAME_WRAP_IDEAL ; \ Text [ en-US ] = "~Optimal Page Wrap" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAPTHRU ; \ - HelpID = FN_FRAME_WRAPTHRU ; \ + HelpId = CMD_FN_FRAME_WRAPTHRU ; \ Text [ en-US ] = "~Wrap Through" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAPTHRU_TRANSP ; \ - HelpID = FN_FRAME_WRAPTHRU_TRANSP ; \ + HelpId = CMD_FN_FRAME_WRAPTHRU_TRANSP ; \ Text [ en-US ] = "In ~Background" ; \ };\ SEPARATOR ; \ @@ -576,7 +916,7 @@ Menu MN_TAB_POPUPMENU {\ Checkable = TRUE ; \ Identifier = FN_WRAP_ANCHOR_ONLY ; \ - HelpID = FN_WRAP_ANCHOR_ONLY ; \ + HelpId = CMD_FN_WRAP_ANCHOR_ONLY ; \ Text [ en-US ] = "~First Paragraph" ; \ };\ };\ @@ -594,7 +934,6 @@ String MN_DRAW_POPUPMENU MenuItem\ {\ Identifier = MN_WRAP ; \ - HelpID = MN_WRAP ; \ Command = ".uno:WrapMenu" ; \ SubMenu = Menu\ {\ @@ -604,35 +943,35 @@ String MN_DRAW_POPUPMENU {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_NOWRAP ; \ - HelpID = FN_FRAME_NOWRAP ; \ + HelpId = CMD_FN_FRAME_NOWRAP ; \ Text [ en-US ] = "~No Wrap" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAP ; \ - HelpID = FN_FRAME_WRAP ; \ + HelpId = CMD_FN_FRAME_WRAP ; \ Text [ en-US ] = "~Page Wrap" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAP_IDEAL ; \ - HelpID = FN_FRAME_WRAP_IDEAL ; \ + HelpId = CMD_FN_FRAME_WRAP_IDEAL ; \ Text [ en-US ] = "~Optimal Page Wrap" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAPTHRU ; \ - HelpID = FN_FRAME_WRAPTHRU ; \ + HelpId = CMD_FN_FRAME_WRAPTHRU ; \ Text [ en-US ] = "~Wrap Through" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_FRAME_WRAPTHRU_TRANSP ; \ - HelpID = FN_FRAME_WRAPTHRU_TRANSP ; \ + HelpId = CMD_FN_FRAME_WRAPTHRU_TRANSP ; \ Text [ en-US ] = "In ~Background" ; \ };\ SEPARATOR ; \ @@ -641,14 +980,14 @@ String MN_DRAW_POPUPMENU {\ Checkable = TRUE ; \ Identifier = FN_WRAP_ANCHOR_ONLY ; \ - HelpID = FN_WRAP_ANCHOR_ONLY ; \ + HelpId = CMD_FN_WRAP_ANCHOR_ONLY ; \ Text [ en-US ] = "~First Paragraph" ; \ };\ SEPARATOR ; \ MenuItem\ {\ Identifier = FN_DRAW_WRAP_DLG ; \ - HelpID = FN_DRAW_WRAP_DLG ; \ + HelpId = CMD_FN_DRAW_WRAP_DLG ; \ Text [ en-US ] = "~Edit..." ; \ };\ };\ @@ -667,7 +1006,7 @@ String MN_DRAW_POPUPMENU {\ RadioCheck = TRUE ; \ Identifier = FN_TOOL_ANKER_FRAME ; \ - HelpID = FN_TOOL_ANKER_FRAME ; \ + HelpId = CMD_FN_TOOL_ANKER_FRAME ; \ Text [ en-US ] = "To ~Frame" ; \ }; @@ -675,7 +1014,7 @@ String MN_DRAW_POPUPMENU MenuItem\ {\ Identifier = FN_TOOL_ANKER ; \ - HelpID = FN_TOOL_ANKER ; \ + HelpId = CMD_FN_TOOL_ANKER ; \ Command = ".uno:AnchorMenu" ; \ Text [ en-US ] = "An~chor" ; \ SubMenu = Menu\ @@ -686,28 +1025,28 @@ String MN_DRAW_POPUPMENU {\ RadioCheck = TRUE ; \ Identifier = FN_TOOL_ANKER_PAGE ; \ - HelpID = FN_TOOL_ANKER_PAGE ; \ + HelpId = CMD_FN_TOOL_ANKER_PAGE ; \ Text [ en-US ] = "To P~age" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_TOOL_ANKER_PARAGRAPH ; \ - HelpID = FN_TOOL_ANKER_PARAGRAPH ; \ + HelpId = CMD_FN_TOOL_ANKER_PARAGRAPH ; \ Text [ en-US ] = "To ~Paragraph" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_TOOL_ANKER_AT_CHAR ; \ - HelpID = FN_TOOL_ANKER_AT_CHAR ; \ + HelpId = CMD_FN_TOOL_ANKER_AT_CHAR ; \ Text [ en-US ] = "To ~Character" ; \ };\ MenuItem\ {\ RadioCheck = TRUE ; \ Identifier = FN_TOOL_ANKER_CHAR ; \ - HelpID = FN_TOOL_ANKER_CHAR ; \ + HelpId = CMD_FN_TOOL_ANKER_CHAR ; \ Text [ en-US ] = "As C~haracter" ; \ };\ MN_AT_FRAME\ @@ -793,7 +1132,7 @@ Menu MN_DRWTXT_POPUPMENU MenuItem\ {\ Identifier = FN_DELETE_COMMENT ;\ - HelpID = FN_DELETE_COMMENT ;\ + HelpId = CMD_FN_DELETE_COMMENT ;\ Text [ en-US ] = "Delete ~Changes Note" ;\ };\ @@ -870,7 +1209,6 @@ String MN_GRF_POPUPMENU MenuItem\ {\ Identifier = MN_FORMAT_FRM_HORZ ; \ - HelpID = MN_FORMAT_FRM_HORZ ; \ Command = ".uno:AlignFrameMenu" ; \ SubMenu = Menu\ {\ @@ -879,38 +1217,38 @@ String MN_GRF_POPUPMENU MenuItem\ {\ Identifier = FN_FRAME_ALIGN_HORZ_LEFT ; \ - HelpID = FN_FRAME_ALIGN_HORZ_LEFT ; \ + HelpId = CMD_FN_FRAME_ALIGN_HORZ_LEFT ; \ Text [ en-US ] = "~Left" ; \ };\ MenuItem\ {\ Identifier = FN_FRAME_ALIGN_HORZ_CENTER ; \ - HelpID = FN_FRAME_ALIGN_HORZ_CENTER ; \ + HelpId = CMD_FN_FRAME_ALIGN_HORZ_CENTER ; \ Text [ en-US ] = "~Centered" ; \ };\ MenuItem\ {\ Identifier = FN_FRAME_ALIGN_HORZ_RIGHT ; \ - HelpID = FN_FRAME_ALIGN_HORZ_RIGHT ; \ + HelpId = CMD_FN_FRAME_ALIGN_HORZ_RIGHT ; \ Text [ en-US ] = "~Right" ; \ };\ SEPARATOR ; \ MenuItem\ {\ Identifier = FN_FRAME_ALIGN_VERT_TOP ; \ - HelpID = FN_FRAME_ALIGN_VERT_TOP ; \ + HelpId = CMD_FN_FRAME_ALIGN_VERT_TOP ; \ Text [ en-US ] = "Base at ~Top" ; \ };\ MenuItem\ {\ Identifier = FN_FRAME_ALIGN_VERT_CENTER ; \ - HelpID = FN_FRAME_ALIGN_VERT_CENTER ; \ + HelpId = CMD_FN_FRAME_ALIGN_VERT_CENTER ; \ Text [ en-US ] = "Base in ~Middle" ; \ };\ MenuItem\ {\ Identifier = FN_FRAME_ALIGN_VERT_BOTTOM ; \ - HelpID = FN_FRAME_ALIGN_VERT_BOTTOM ; \ + HelpId = CMD_FN_FRAME_ALIGN_VERT_BOTTOM ; \ Text [ en-US ] = "Base at ~Bottom" ; \ };\ };\ @@ -931,13 +1269,13 @@ Menu MN_GRF_POPUPMENU MenuItem { Identifier = FN_FORMAT_GRAFIC_DLG ; - HelpID = FN_FORMAT_GRAFIC_DLG ; + HelpId = CMD_FN_FORMAT_GRAFIC_DLG ; Text [ en-US ] = "~Picture..." ; }; MenuItem { Identifier = FN_SAVE_GRAPHIC; - HelpID = FN_SAVE_GRAPHIC; + HelpId = CMD_FN_SAVE_GRAPHIC; Text [ en-US ] = "Save Graphics..." ; }; MN_FRM_CAPTION_ITEM @@ -945,7 +1283,7 @@ Menu MN_GRF_POPUPMENU MenuItem { Identifier = FN_EXTERNAL_EDIT ; - HelpID = FN_EXTERNAL_EDIT ; + HelpID = CMD_FN_EXTERNAL_EDIT ; Text [ en-US ] = "Edit with External Tool..."; }; SEPARATOR; @@ -972,13 +1310,13 @@ String MN_OLE_POPUPMENU MenuItem\ {\ Identifier = FN_EXPORT_OLE_AS_PDF ;\ - HelpID = FN_EXPORT_OLE_AS_PDF ; \ + HelpID = CMD_FN_EXPORT_OLE_AS_PDF ; \ Text [ en-US ] = "Export as P~DF..." ; \ };\ MenuItem\ {\ Identifier = FN_EXPORT_OLE_AS_GRAPHIC ;\ - HelpID = FN_EXPORT_OLE_AS_GRAPHIC ; \ + HelpID = CMD_FN_EXPORT_OLE_AS_GRAPHIC ; \ Text [ en-US ] = "Export as JPG..." ; \ };\ };\ @@ -997,7 +1335,7 @@ Menu MN_OLE_POPUPMENU MenuItem { Identifier = FN_FORMAT_FRAME_DLG ; - HelpID = FN_FORMAT_FRAME_DLG ; + HelpId = CMD_FN_FORMAT_FRAME_DLG ; Text [ en-US ] = "Object..." ; }; SEPARATOR ; @@ -1040,13 +1378,13 @@ Menu MN_PPREVIEW_POPUPMENU MenuItem { Identifier = FN_PAGEUP ; - HelpID = FN_PAGEUP ; + HelpId = CMD_FN_PAGEUP ; Text [ en-US ] = "Previous Page" ; }; MenuItem { Identifier = FN_PAGEDOWN ; - HelpID = FN_PAGEDOWN ; + HelpId = CMD_FN_PAGEDOWN ; Text [ en-US ] = "Next Page" ; }; MenuItem @@ -1057,14 +1395,14 @@ Menu MN_PPREVIEW_POPUPMENU MenuItem { Identifier = FN_PRINT_PAGEPREVIEW ; - HelpID = FN_PRINT_PAGEPREVIEW ; + HelpId = CMD_FN_PRINT_PAGEPREVIEW ; Text [ en-US ] = "Print" ; }; SEPARATOR ; MenuItem { Identifier = SID_PRINTPREVIEW; - HelpID = SID_PRINTPREVIEW; + HelpId = CMD_SID_PRINTPREVIEW; Text [ en-US ] = "Close Preview" ; }; }; diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index d8a3ccc3cc..6b1838305a 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -145,7 +145,7 @@ SwView* SwModule::GetNextView(SwView* pView) { OSL_ENSURE(PTR_CAST(SwView, pView),"return no SwView"); const TypeId aTypeId = TYPE(SwView); - SwView* pNView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId, TRUE); + SwView* pNView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId, sal_True); return pNView; } @@ -222,7 +222,7 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView, pPref->SetIdle(sal_True); } -void SwModule::ApplyUserMetric( FieldUnit eMetric, BOOL bWeb ) +void SwModule::ApplyUserMetric( FieldUnit eMetric, sal_Bool bWeb ) { SwMasterUsrPref* pPref; if(bWeb) @@ -258,7 +258,7 @@ void SwModule::ApplyUserMetric( FieldUnit eMetric, BOOL bWeb ) } } -void SwModule::ApplyRulerMetric( FieldUnit eMetric, BOOL bHorizontal, BOOL bWeb ) +void SwModule::ApplyRulerMetric( FieldUnit eMetric, sal_Bool bHorizontal, sal_Bool bWeb ) { SwMasterUsrPref* pPref; if(bWeb) @@ -297,7 +297,7 @@ void SwModule::ApplyRulerMetric( FieldUnit eMetric, BOOL bHorizontal, BOOL bWeb set the usrpref 's char unit attribute and set ruler 's unit as char if the "apply char unit" is checked --------------------------------------------------*/ -void SwModule::ApplyUserCharUnit(BOOL bApplyChar, BOOL bWeb) +void SwModule::ApplyUserCharUnit(sal_Bool bApplyChar, sal_Bool bWeb) { SwMasterUsrPref* pPref; if(bWeb) @@ -312,12 +312,12 @@ void SwModule::ApplyUserCharUnit(BOOL bApplyChar, BOOL bWeb) GetUsrPref(sal_False); pPref = pUsrPref; } - BOOL bOldApplyCharUnit = pPref->IsApplyCharUnit(); - BOOL bHasChanged = FALSE; + sal_Bool bOldApplyCharUnit = pPref->IsApplyCharUnit(); + sal_Bool bHasChanged = sal_False; if(bOldApplyCharUnit != bApplyChar) { pPref->SetApplyCharUnit(bApplyChar); - bHasChanged = TRUE; + bHasChanged = sal_True; } if( !bHasChanged ) @@ -369,11 +369,11 @@ SwPrintOptions* SwModule::GetPrtOptions(sal_Bool bWeb) { if(bWeb && !pWebPrtOpt) { - pWebPrtOpt = new SwPrintOptions(TRUE); + pWebPrtOpt = new SwPrintOptions(sal_True); } else if(!bWeb && !pPrtOpt) { - pPrtOpt = new SwPrintOptions(FALSE); + pPrtOpt = new SwPrintOptions(sal_False); } return bWeb ? pWebPrtOpt : pPrtOpt; @@ -386,7 +386,7 @@ SwChapterNumRules* SwModule::GetChapterNumRules() return pChapterNumRules; } -void SwModule::ShowDBObj(SwView& rView, const SwDBData& rData, BOOL /*bOnlyIfAvailable*/) +void SwModule::ShowDBObj(SwView& rView, const SwDBData& rData, sal_Bool /*bOnlyIfAvailable*/) { Reference<XFrame> xFrame = rView.GetViewFrame()->GetFrame().GetFrameInterface(); Reference<XDispatchProvider> xDP(xFrame, uno::UNO_QUERY); diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx index 616ad54880..4599fabf8b 100644 --- a/sw/source/ui/app/swmodule.cxx +++ b/sw/source/ui/app/swmodule.cxx @@ -426,7 +426,7 @@ void SwDLL::RegisterControls() ::avmedia::MediaPlayer::RegisterChildWindow(0, pMod); SvxSmartTagsControl::RegisterControl(SID_OPEN_SMARTTAGMENU, pMod); - ::sfx2::TaskPaneWrapper::RegisterChildWindow( FALSE, pMod ); + ::sfx2::TaskPaneWrapper::RegisterChildWindow( sal_False, pMod ); } diff --git a/sw/source/ui/app/swwait.cxx b/sw/source/ui/app/swwait.cxx index c77ee6655a..abd1d823e7 100644 --- a/sw/source/ui/app/swwait.cxx +++ b/sw/source/ui/app/swwait.cxx @@ -37,31 +37,31 @@ #include <swwait.hxx> -void SwDocShell::EnterWait( BOOL bLockDispatcher ) +void SwDocShell::EnterWait( sal_Bool bLockDispatcher ) { - SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this, FALSE ); + SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this, sal_False ); while ( pFrame ) { pFrame->GetWindow().EnterWait(); if ( bLockDispatcher ) - pFrame->GetDispatcher()->Lock( TRUE ); - pFrame = SfxViewFrame::GetNext( *pFrame, this, FALSE ); + pFrame->GetDispatcher()->Lock( sal_True ); + pFrame = SfxViewFrame::GetNext( *pFrame, this, sal_False ); } } -void SwDocShell::LeaveWait( BOOL bLockDispatcher ) +void SwDocShell::LeaveWait( sal_Bool bLockDispatcher ) { - SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this, FALSE ); + SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this, sal_False ); while ( pFrame ) { pFrame->GetWindow().LeaveWait(); if ( bLockDispatcher ) - pFrame->GetDispatcher()->Lock( FALSE ); - pFrame = SfxViewFrame::GetNext( *pFrame, this, FALSE ); + pFrame->GetDispatcher()->Lock( sal_False ); + pFrame = SfxViewFrame::GetNext( *pFrame, this, sal_False ); } } -SwWait::SwWait( SwDocShell &rDocShell, BOOL bLockDispatcher ) : +SwWait::SwWait( SwDocShell &rDocShell, sal_Bool bLockDispatcher ) : rDoc ( rDocShell ), bLock( bLockDispatcher ) { |