diff options
Diffstat (limited to 'sw/source/ui')
765 files changed, 17749 insertions, 19382 deletions
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src index 4794e789f4..67715544bc 100644 --- a/sw/source/ui/app/app.src +++ b/sw/source/ui/app/app.src @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -25,8 +25,6 @@ * ************************************************************************/ - - #include <svl/style.hrc> #include <sfx2/sfx.hrc> #include <svx/dialogs.hrc> @@ -55,7 +53,7 @@ String STR_PAGE_COUNT_MACRO Text [ en-US ] = "Changing the page count" ; }; - // Image-Liste ---------------------------------------------------------------- + // Image-list ---------------------------------------------------------------- // Don't use this image list for normal toolbar images. We have now our commandimagelist // folder in default_images. This list is now only used for special toolboxes that are // used in floating windows. @@ -64,7 +62,7 @@ String STR_PAGE_COUNT_MACRO IdList = { \ FN_FORMULA_CALC ;\ FN_FORMULA_CANCEL ;\ - FN_FORMULA_APPLY ;\ + FN_FORMULA_APPLY ;\ }; \ IdCount = { \ 3; \ @@ -76,6 +74,7 @@ ImageList RID_DEFAULTIMAGELIST_SC MaskColor = IMAGE_MASK_COLOR ; IMAGELIST_AND_COUNT }; + ImageList RID_DEFAULTIMAGELIST_LC { Prefix = "lc"; @@ -83,20 +82,7 @@ ImageList RID_DEFAULTIMAGELIST_LC IMAGELIST_AND_COUNT }; -ImageList RID_DEFAULTIMAGELIST_SCH -{ - Prefix = "sch"; - MaskColor = IMAGE_MASK_COLOR ; - IMAGELIST_AND_COUNT -}; -ImageList RID_DEFAULTIMAGELIST_LCH -{ - Prefix = "lch"; - MaskColor = IMAGE_MASK_COLOR ; - IMAGELIST_AND_COUNT -}; - -// Vorlagen +// Templates #define STYLE_IMAGE_LISTEF \ MaskColor = IMAGE_MASK_COLOR ; \ IdList = \ @@ -113,65 +99,65 @@ SfxStyleFamilies DLG_STYLE_DESIGNER { Text [ en-US ] = "Paragraph Styles" ; StyleFamily = SFX_STYLE_FAMILY_PARA ; - FilterList [ en-US ] = - { - < "All Styles" ; SFXSTYLEBIT_ALL ; > ; - < "Applied Styles" ; SFXSTYLEBIT_USED ; > ; - < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ; - < "Automatic" ; SFXSTYLEBIT_AUTO ; > ; - < "Text Styles" ; SWSTYLEBIT_TEXT ; > ; - < "Chapter Styles" ; SWSTYLEBIT_CHAPTER ; > ; - < "List Styles" ; SWSTYLEBIT_LIST ; > ; - < "Index Styles" ; SWSTYLEBIT_IDX ; > ; - < "Special Styles" ; SWSTYLEBIT_EXTRA ; > ; - < "HTML Styles" ; SWSTYLEBIT_HTML ; > ; - < "Conditional Styles" ; SWSTYLEBIT_CONDCOLL ; > ; + FilterList [ en-US ] = + { + < "All Styles" ; SFXSTYLEBIT_ALL ; > ; + < "Applied Styles" ; SFXSTYLEBIT_USED ; > ; + < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ; + < "Automatic" ; SFXSTYLEBIT_AUTO ; > ; + < "Text Styles" ; SWSTYLEBIT_TEXT ; > ; + < "Chapter Styles" ; SWSTYLEBIT_CHAPTER ; > ; + < "List Styles" ; SWSTYLEBIT_LIST ; > ; + < "Index Styles" ; SWSTYLEBIT_IDX ; > ; + < "Special Styles" ; SWSTYLEBIT_EXTRA ; > ; + < "HTML Styles" ; SWSTYLEBIT_HTML ; > ; + < "Conditional Styles" ; SWSTYLEBIT_CONDCOLL ; > ; + }; }; - }; SfxStyleFamilyItem { Text [ en-US ] = "Character Styles" ; StyleFamily = SFX_STYLE_FAMILY_CHAR ; FilterList [ en-US ] = { - < "All" ; SFXSTYLEBIT_ALL ; > ; - < "Applied Styles" ; SFXSTYLEBIT_USED ; > ; - < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ; + < "All" ; SFXSTYLEBIT_ALL ; > ; + < "Applied Styles" ; SFXSTYLEBIT_USED ; > ; + < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ; }; - }; + }; SfxStyleFamilyItem { Text [ en-US ] = "Frame Styles" ; StyleFamily = SFX_STYLE_FAMILY_FRAME ; FilterList [ en-US ] = { - < "All" ; SFXSTYLEBIT_ALL ; > ; - < "Applied Styles" ; SFXSTYLEBIT_USED ; > ; - < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ; + < "All" ; SFXSTYLEBIT_ALL ; > ; + < "Applied Styles" ; SFXSTYLEBIT_USED ; > ; + < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ; }; - }; + }; SfxStyleFamilyItem { Text [ en-US ] = "Page Styles" ; StyleFamily = SFX_STYLE_FAMILY_PAGE ; FilterList [ en-US ] = { - < "All" ; SFXSTYLEBIT_ALL ; > ; - < "Applied Styles" ; SFXSTYLEBIT_USED ; > ; - < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ; + < "All" ; SFXSTYLEBIT_ALL ; > ; + < "Applied Styles" ; SFXSTYLEBIT_USED ; > ; + < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ; }; - }; + }; SfxStyleFamilyItem { StyleFamily = SFX_STYLE_FAMILY_PSEUDO ; FilterList [ en-US ] = { - < "All" ; SFXSTYLEBIT_ALL ; > ; - < "Applied Styles" ; SFXSTYLEBIT_USED ; > ; - < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ; + < "All" ; SFXSTYLEBIT_ALL ; > ; + < "Applied Styles" ; SFXSTYLEBIT_USED ; > ; + < "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ; }; Text [ en-US ] = "List Styles" ; - }; + }; }; ImageList 1 // == BMP_COLOR_NORMAL + 1 @@ -179,20 +165,12 @@ SfxStyleFamilies DLG_STYLE_DESIGNER Prefix = "sf"; STYLE_IMAGE_LISTEF }; - ImageList 2 // == BMP_COLOR_HIGHCONTRAST + 1 - { - Prefix = "sfh"; - STYLE_IMAGE_LISTEF - }; }; - // Default Bitmap fuer Toolbox -BITMAP BMP_FEHLT { FILE = "x.bmp" ; }; - // Bitmap fuer die NumerierungsVorlagen im Organizer +// Bitmap for the NumberingTemplates in the Organizer Bitmap BMP_STYLES_FAMILY_NUM { File = "styfamnu.bmp" ; }; -Bitmap BMP_STYLES_FAMILY_NUM_HC { File = "styfamnu_h.bmp" ; }; String STR_ENV_TITLE { @@ -225,18 +203,17 @@ String STR_CANTCREATE { Text [ en-US ] = "Can't create document."; }; + String STR_DLLNOTFOUND { Text [ en-US ] = "Filter not found." ; }; - String STR_UNBENANNT { Text [ en-US ] = "Untitled" ; }; - String STR_LOAD_GLOBAL_DOC { Text [ en-US ] = "Name and Path of Master Document" ; @@ -253,6 +230,7 @@ InfoBox MSG_ERROR_SEND_MAIL DEFBUTTON = WB_DEF_OK ; Message [ en-US ] = "Error sending mail." ; }; + InfoBox MSG_ERROR_PASSWD { BUTTONS = WB_OK ; @@ -261,8 +239,8 @@ InfoBox MSG_ERROR_PASSWD }; /* - * auskommentiert, da die Toolbox z. Zt. nicht aus der Resource - * geladen werden kann + * commented out, because the Toolbox can't be loaded from the resource + * at this time. Window WIN_TOOLBOX { "Bearbeitung von Text, Rahmen, Grafik, Tabellen oder " "Numerierungen."; @@ -286,7 +264,7 @@ String STR_DOC_STAT }; // ---------------------------- - // Statusleisten-Ueberschriften + // Statusbar-titles // ---------------------------- String STR_STATSTR_W4WREAD @@ -397,16 +375,6 @@ Bitmap RID_GRAPHIC_ERRORBMP File = "grafikde.bmp" ; }; -Bitmap RID_GRAPHIC_REPLACEBMP_HC -{ - File = "grafikei_h.bmp" ; -}; - -Bitmap RID_GRAPHIC_ERRORBMP_HC -{ - File = "grafikde_h.bmp" ; -}; - String STR_TABLE_DEFNAME { Text [ en-US ] = "Table" ; @@ -426,14 +394,17 @@ String STR_FRAME_DEFNAME { Text [ en-US ] = "Frame" ; }; + String STR_REGION_DEFNAME { Text [ en-US ] = "Section" ; }; + String STR_NUMRULE_DEFNAME { Text [ en-US ] = "Numbering" ; }; + String STR_EMPTYPAGE { Text [ en-US ] = "blank page" ; @@ -458,6 +429,7 @@ QueryBox MSG_SAVEAS_HTML_QUERY DEFBUTTON = WB_DEF_NO ; Message [ en-US ] = "The source code can only be displayed if the document is saved in HTML format.\nWould you like to save the document as HTML?"; }; + String STR_ABSTRACT_TITLE { Text [ en-US ] = "Abstract: " ; @@ -470,10 +442,9 @@ String STR_FDLG_TEMPLATE_BUTTON String STR_FDLG_TEMPLATE_NAME { - //Text [ en-US ] = "Styles: " ; //#outline level,removed by zhaojianwei - Text [ en-US ] = "separated by: " ; //<-end,add by zhaojianwei + Text [ en-US ] = "separated by: " ; }; -//#outline level,add by zhaojianwei + String STR_FDLG_OUTLINE_LEVEL { Text [ en-US ] = "Outline: Level "; @@ -481,27 +452,29 @@ String STR_FDLG_OUTLINE_LEVEL String STR_FDLG_STYLE { - Text [ en-US ] = "Style: "; + Text [ en-US ] = "Style: "; }; -//<-end - String STR_PAGEOFFSET { Text [ en-US ] = "Page number: " ; }; + String STR_PAGEBREAK { Text [ en-US ] = "Break before new page" ; }; + String STR_WESTERN_FONT { Text [ en-US ] = "Western text: "; }; + String STR_CJK_FONT { Text [ en-US ] = "Asian text: "; }; + String STR_REDLINE_UNKNOWN_AUTHOR { Text [ en-US ] = "Unknown Author"; @@ -513,14 +486,7 @@ WarningBox MSG_DISABLE_UNDO_QUESTION DEFBUTTON = WB_DEF_YES ; Message [ en-US ] = "This action deletes the list of actions that can be undone. Previous changes made to the document are still valid, but cannot be undone. Do you want to continue formatting?"; }; -/*QueryBox MSG_INS_MERGE_FIELDS -{ - HelpId = HID_MAIL_MERGE_INSERT_FIELDS; - Buttons = WB_OK_CANCEL ; - DefButton = WB_DEF_YES ; - Message [ en-US ] = "Do you want to use names and addresses from a database?"; -}; -*/ + QueryBox MSG_PRINT_AS_MERGE { HelpId = HID_PRINT_AS_MERGE; @@ -528,6 +494,7 @@ QueryBox MSG_PRINT_AS_MERGE DefButton = WB_DEF_YES ; Message [ en-US ] = "Your document contains address database fields. Do you want to print a form letter?"; }; + ModalDialog DLG_MERGE_SOURCE_UNAVAILABLE { HelpId = HID_MERGE_SOURCE_UNAVAILABLE; @@ -560,6 +527,7 @@ ModalDialog DLG_MERGE_SOURCE_UNAVAILABLE Size = MAP_APPFONT ( 50 , 14 ) ; }; }; + WarningBox MSG_DATA_SOURCES_UNAVAILABLE { HelpId = HID_DATA_SOURCES_UNAVAILABLE; @@ -571,15 +539,17 @@ String RID_MODULE_TOOLBOX { Text [ en-US ] = "Function Bar (viewing mode)" ; }; + String STR_DONT_ASK_AGAIN { Text [ en-US ] = "~Do not show warning again" ; }; -// --> OD 2008-04-14 #outlinelevel# + String STR_OUTLINE_NUMBERING { Text [ en-US ] = "Outline Numbering"; }; + ToolBox RID_MODULE_TOOLBOX { HelpID = HID_MODULE_TOOLBOX ; diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx index e850be37b3..53c7bc8b4e 100644 --- a/sw/source/ui/app/appenv.cxx +++ b/sw/source/ui/app/appenv.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,11 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -#if STLPORT_VERSION>=321 #include <cstdarg> -#endif - #include <hintids.hxx> @@ -75,15 +72,9 @@ #include <crsskip.hxx> #include <cmdid.h> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _APP_HRC #include <app.hrc> -#endif -#ifndef _POOLFMT_HRC #include <poolfmt.hrc> -#endif #include "swabstdlg.hxx" #include "envelp.hrc" #include "envimg.hxx" @@ -93,11 +84,7 @@ #define ENV_CANCEL SHRT_MAX -// -------------------------------------------------------------------------- - - -// Funktion wird fuer Etiketten und Briefumschlaege benutzt! -// im applab.cxx und appenv.cxx +// Function used for labels and envelopes in applab.cxx and appenv.cxx String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText ) { String sRet; @@ -119,7 +106,6 @@ String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText { sTmpText = aLine.Copy( 0, nPos ); aLine.Erase( 0, nPos ); -// sTmpText = aLine.Cut( 0, nPos ); } else { @@ -128,15 +114,13 @@ String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText { sTmpText = aLine; aLine.Erase(); -// sTmpText = aLine.Cut(); } else { sTmpText = aLine.Copy( 0, nPos + 1); aLine.Erase( 0, nPos + 1); -// sTmpText = aLine.Cut( 0, nPos + 1 ); - // Datenbankfelder muesen mind. 3 Punkte beinhalten! + // Database fields must contain at least 3 points! String sDBName( sTmpText.Copy( 1, sTmpText.Len() - 2)); sal_uInt16 nCnt = sDBName.GetTokenCount('.'); if (nCnt >= 3) @@ -154,14 +138,11 @@ String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText } rSh.InsertLineBreak(); } - rSh.DelLeft(); // Letzten Linebreak wieder l???schen + rSh.DelLeft(); // Again remove last linebreak return sRet; } -// ---------------------------------------------------------------------------- - - void lcl_CopyCollAttr(SwWrtShell* pOldSh, SwWrtShell* pNewSh, sal_uInt16 nCollId) { sal_uInt16 nCollCnt = pOldSh->GetTxtFmtCollCount(); @@ -171,12 +152,9 @@ void lcl_CopyCollAttr(SwWrtShell* pOldSh, SwWrtShell* pNewSh, sal_uInt16 nCollId pNewSh->GetTxtCollFromPool(nCollId)->SetFmtAttr(pColl->GetAttrSet()); } -// ---------------------------------------------------------------------------- - - void SwModule::InsertEnv( SfxRequest& rReq ) { -static sal_uInt16 nTitleNo = 0; + static sal_uInt16 nTitleNo = 0; SwDocShell *pMyDocSh; SfxViewFrame *pFrame; @@ -184,34 +162,34 @@ static sal_uInt16 nTitleNo = 0; SwWrtShell *pOldSh, *pSh; - //aktuelle Shell besorgen + // Get current shell pMyDocSh = (SwDocShell*) SfxObjectShell::Current(); pOldSh = pMyDocSh ? pMyDocSh->GetWrtShell() : 0; - // Neues Dokument erzeugen (kein Show!) + // Create new document (don't show!) SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_STANDARD ) ); xDocSh->DoInitNew( 0 ); pFrame = SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 ); pNewView = (SwView*) pFrame->GetViewShell(); - pNewView->AttrChangedNotify( &pNewView->GetWrtShell() );//Damit SelectShell gerufen wird. + pNewView->AttrChangedNotify( &pNewView->GetWrtShell() ); // so that SelectShell is being called pSh = pNewView->GetWrtShellPtr(); String aTmp( SW_RES(STR_ENV_TITLE) ); aTmp += String::CreateFromInt32( ++nTitleNo ); xDocSh->SetTitle( aTmp ); - // Ggf. alte Collections "Absender" und "Empfaenger" in neues - // Dokument kopieren + // if applicable, copy the old Collections "Sender" and "Reciever" to + // a new document if ( pOldSh ) { ::lcl_CopyCollAttr(pOldSh, pSh, RES_POOLCOLL_JAKETADRESS); ::lcl_CopyCollAttr(pOldSh, pSh, RES_POOLCOLL_SENDADRESS); } - // SwEnvItem aus Config lesen + // Read SwEnvItem from config SwEnvCfgItem aEnvCfg; - //Haben wir schon einen Briefumschlag. + // Check if there's already an envelope. sal_Bool bEnvChange = sal_False; SfxItemSet aSet(GetPool(), FN_ENVELOP, FN_ENVELOP, 0); @@ -245,10 +223,10 @@ static sal_uInt16 nTitleNo = 0; if ( !pItem ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); pDlg = pFact->CreateSwEnvDlg( pParent, aSet, pOldSh, pTempPrinter, !bEnvChange, DLG_ENV ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); nMode = pDlg->Execute(); } else @@ -262,18 +240,18 @@ static sal_uInt16 nTitleNo = 0; { SwWait aWait( (SwDocShell&)*xDocSh, sal_True ); - // Dialog auslesen, Item in Config speichern + // Read dialog and save item to config const SwEnvItem& rItem = pItem ? *pItem : (const SwEnvItem&) pDlg->GetOutputItemSet()->Get(FN_ENVELOP); aEnvCfg.GetItem() = rItem; aEnvCfg.Commit(); - //Wenn wir Drucken uebernehmen wir den eingestellten Jobsetup aus - //dem Dialog. Die Informationen muessen hier vor dem evtl. zerstoeren - //der neuen Shell gesetzt werden, weil deren Drucker an den Dialog - //gereicht wurde. + // When we print we take the Jobsetup that is set up in the dialog. + // Information has to be set here, before a possible destruction of + // the new shell because the shell's printer has been handed to the + // dialog. if ( nMode != ENV_NEWDOC ) { - ASSERT(pOldSh, "Kein Dokument - war 'Einfuegen' nicht disabled???"); + OSL_ENSURE(pOldSh, "No document - wasn't 'Insert' disabled???"); SvxPaperBinItem aItem( RES_PAPER_BIN ); aItem.SetValue((sal_uInt8)pSh->getIDocumentDeviceAccess()->getPrinter(true)->GetPaperBin()); pOldSh->GetPageDescFromPool(RES_POOLPAGE_JAKET)->GetMaster().SetFmtAttr(aItem); @@ -289,29 +267,29 @@ static sal_uInt16 nTitleNo = 0; if (nMode == ENV_INSERT) { - SetView(&pOldSh->GetView()); // Pointer auf oberste View restaurieren + SetView(&pOldSh->GetView()); // Set pointer to top view - //Neues Dok wieder loeschen + // Delete new document xDocSh->DoClose(); pSh = pOldSh; //#i4251# selected text or objects in the document should //not be deleted on inserting envelopes pSh->EnterStdMode(); - // Los geht's (Einfuegen) + // Here it goes (insert) pSh->StartUndo(UNDO_UI_INSERT_ENVELOPE, NULL); pSh->StartAllAction(); pSh->SttEndDoc(sal_True); if (bEnvChange) { - // Folgevorlage: Seite 2 + // followup template: page 2 pFollow = pSh->GetPageDesc(pSh->GetCurPageDesc()).GetFollow(); - // Text der ersten Seite loeschen + // Delete text from the first page if ( !pSh->SttNxtPg(sal_True) ) pSh->EndPg(sal_True); pSh->DelRight(); - // Rahmen der ersten Seite loeschen + // Delete frame of the first page if( pSh->GotoFly( rSendMark ) ) { pSh->EnterSelFrmMode(); @@ -325,10 +303,10 @@ static sal_uInt16 nTitleNo = 0; pSh->SttEndDoc(sal_True); } else - // Folgevorlage: Seite 1 + // Followup template: page 1 pFollow = &pSh->GetPageDesc(pSh->GetCurPageDesc()); - // Seitenumbruch einfuegen + // Insert page break if ( pSh->IsCrsrInTbl() ) { pSh->SplitNode(); @@ -344,12 +322,12 @@ static sal_uInt16 nTitleNo = 0; else { pFollow = &pSh->GetPageDesc(pSh->GetCurPageDesc()); - // Los geht's (Drucken) + // Let's go (print) pSh->StartAllAction(); pSh->DoUndo(sal_False); - // Neue Collections "Absender" und "Empfaenger" wieder in neues - // Dokument kopieren + // Again, copy the new collections "Sender" and "Reciever" to + // a new document if ( pOldSh ) { ::lcl_CopyCollAttr(pOldSh, pSh, RES_POOLCOLL_JAKETADRESS); @@ -358,21 +336,20 @@ static sal_uInt16 nTitleNo = 0; } SET_CURR_SHELL(pSh); - pSh->SetNewDoc(); // Performanceprobleme vermeiden + pSh->SetNewDoc(); // Avoid performance problems - // Flys dieser Seite merken + // Remember Flys of this site SvPtrarr aFlyArr(0, 5); if( ENV_NEWDOC != nMode && !bEnvChange ) pSh->GetPageObjs( aFlyArr ); - // Page-Desc ermitteln + // Get page description SwPageDesc* pDesc = pSh->GetPageDescFromPool(RES_POOLPAGE_JAKET); SwFrmFmt& rFmt = pDesc->GetMaster(); Printer *pPrt = pSh->getIDocumentDeviceAccess()->getPrinter( true ); - // Raender (setzen sich zusammen aus Shift-Offset und - // Ausrichtung) + // Borders (are put together by Shift-Offset and alignment) Size aPaperSize = pPrt->PixelToLogic( pPrt->GetPaperSizePixel(), MAP_TWIP); if ( !aPaperSize.Width() && !aPaperSize.Height() ) @@ -408,25 +385,25 @@ static sal_uInt16 nTitleNo = 0; rFmt.SetFmtAttr(aLRMargin); rFmt.SetFmtAttr(aULMargin); - // Kopf-, Fusszeilen + // Header and footer rFmt.SetFmtAttr(SwFmtHeader(sal_Bool(sal_False))); pDesc->ChgHeaderShare(sal_False); rFmt.SetFmtAttr(SwFmtFooter(sal_Bool(sal_False))); pDesc->ChgFooterShare(sal_False); - // Seitennumerierung + // Page numbering pDesc->SetUseOn(nsUseOnPage::PD_ALL); - // Einstellen der Seitengroesse + // Page size rFmt.SetFmtAttr(SwFmtFrmSize(ATT_FIX_SIZE, nPageW + lLeft, nPageH + lUpper)); - // Einstellen der Numerierungsart der Seite + // Set type of page numbering SvxNumberType aType; aType.SetNumberingType(SVX_NUM_NUMBER_NONE); pDesc->SetNumType(aType); - // Folgevorlage + // Followup template if (pFollow) pDesc->SetFollow(pFollow); @@ -434,7 +411,7 @@ static sal_uInt16 nTitleNo = 0; pDesc->SetLandscape( rItem.eAlign >= ENV_VER_LEFT && rItem.eAlign <= ENV_VER_RGHT); - // Page-Desc anwenden + // Apply page description sal_uInt16 nPos; pSh->FindPageDescByName( pDesc->GetName(), @@ -445,17 +422,17 @@ static sal_uInt16 nTitleNo = 0; pSh->ChgPageDesc( nPos, *pDesc); pSh->ChgCurPageDesc(*pDesc); - // Rahmen einfuegen + // Insert Frame SwFlyFrmAttrMgr aMgr(sal_False, pSh, FRMMGR_TYPE_ENVELP); SwFldMgr aFldMgr; aMgr.SetHeightSizeType(ATT_VAR_SIZE); - //Defaults ueberschreiben! + // Overwrite defaults! aMgr.GetAttrSet().Put( SvxBoxItem(RES_BOX) ); aMgr.SetULSpace( 0L, 0L ); aMgr.SetLRSpace( 0L, 0L ); - // Absender + // Sender if (rItem.bSend) { pSh->SttEndDoc(sal_True); @@ -472,7 +449,7 @@ static sal_uInt16 nTitleNo = 0; aMgr.UpdateAttrMgr(); } - // Empfaenger + // Addressee pSh->SttEndDoc(sal_True); aMgr.InsertFlyFrm(FLY_AT_PAGE, @@ -485,11 +462,11 @@ static sal_uInt16 nTitleNo = 0; pSh->SetTxtFmtColl( pAddr ); InsertLabEnvText(*pSh, aFldMgr, rItem.aAddrText); - // Flys auf die "alten" Seiten verschieben + // Move Flys to the "old" pages if (aFlyArr.Count()) pSh->SetPageObjsNewPage(aFlyArr, 1); - // Fertig + // Finished pSh->SttEndDoc(sal_True); pSh->EndAllAction(); @@ -505,7 +482,7 @@ static sal_uInt16 nTitleNo = 0; if ( rItem.aAddrText.indexOf('<') >= 0 ) { - static sal_uInt16 __READONLY_DATA aInva[] = + static sal_uInt16 const aInva[] = { SID_SBA_BRW_UPDATE, SID_SBA_BRW_INSERT, @@ -514,7 +491,7 @@ static sal_uInt16 nTitleNo = 0; }; pFrame->GetBindings().Invalidate( aInva ); - // Datenbankbeamer oeffnen + // Open database beamer ShowDBObj(*pNewView, pSh->GetDBData()); } } @@ -528,14 +505,14 @@ static sal_uInt16 nTitleNo = 0; rReq.Done(); } - else //Abbruch + else // Abort { rReq.Ignore(); xDocSh->DoClose(); --nTitleNo; - // Pointer auf oberste View restaurieren + // Set pointer to top view if (pOldSh) SetView(&pOldSh->GetView()); } @@ -543,3 +520,4 @@ static sal_uInt16 nTitleNo = 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx index 520205976e..5f5e5f1524 100644 --- a/sw/source/ui/app/apphdl.cxx +++ b/sw/source/ui/app/apphdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,7 +32,7 @@ #include <hintids.hxx> #include <tools/urlobj.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <tools/link.hxx> #define _SVSTDARR_STRINGSDTOR @@ -49,7 +50,6 @@ #include <svl/eitem.hxx> #include <svl/whiter.hxx> #include <svl/isethint.hxx> -#include <svx/hyprlink.hxx> #include <sfx2/request.hxx> #include <sfx2/fcontnr.hxx> #include <svl/stritem.hxx> @@ -72,7 +72,7 @@ #include <srcview.hxx> #include <wrtsh.hxx> #include <docsh.hxx> -#include <cmdid.h> // Funktion-Ids +#include <cmdid.h> // Function-Ids #include <initui.hxx> #include <uitool.hxx> #include <swmodule.hxx> @@ -86,7 +86,7 @@ #include <cfgitems.hxx> #include <prtopt.hxx> #include <modcfg.hxx> -#include <globals.h> // globale Konstanten z.B. +#include <globals.h> // e.g. global Constants #include <app.hrc> #include <fontcfg.hxx> #include <barcfg.hxx> @@ -119,12 +119,12 @@ using namespace ::com::sun::star; /*-------------------------------------------------------------------- - Beschreibung: Slotmaps fuer Methoden der Applikation + Description: Slotmaps for the application's methods --------------------------------------------------------------------*/ -// hier werden die SlotID's included -// siehe Idl-File +// here are the SlotID's being included +// see Idl-file // #define SwModule #define ViewSettings @@ -140,7 +140,6 @@ using namespace ::com::sun::star; SFX_IMPL_INTERFACE( SwModule, SfxModule, SW_RES(RID_SW_NAME) ) { - SFX_CHILDWINDOW_REGISTRATION(SvxHyperlinkDlgWrapper::GetChildWindowId()); SFX_STATUSBAR_REGISTRATION(SW_RES(CFG_STATUSBAR)); SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_APPLICATION | SFX_VISIBILITY_DESKTOP | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_CLIENT | SFX_VISIBILITY_VIEWER, @@ -149,7 +148,7 @@ SFX_IMPL_INTERFACE( SwModule, SfxModule, SW_RES(RID_SW_NAME) ) /*-------------------------------------------------------------------- - Beschreibung: Andere States + Description: other states --------------------------------------------------------------------*/ @@ -206,15 +205,12 @@ void SwModule::StateOther(SfxItemSet &rSet) IsInsTblFormatNum( bWebView ))); break; default: - DBG_ERROR("::StateOther: default"); + OSL_ENSURE(false, "::StateOther: default"); } nWhich = aIter.NextWhich(); } } -/*-- 06.04.2004 15:21:43--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwView* lcl_LoadDoc(SwView* pView, const String& rURL) { SwView* pNewView = 0; @@ -260,7 +256,7 @@ SwView* lcl_LoadDoc(SwView* pView, const String& rURL) return pNewView; } /*-------------------------------------------------------------------- - Beschreibung: Felddialog starten + Description: start field dialog --------------------------------------------------------------------*/ void NewXForms( SfxRequest& rReq ); // implementation: below @@ -301,20 +297,20 @@ SwMailMergeWizardExecutor::SwMailMergeWizardExecutor() SwMailMergeWizardExecutor::~SwMailMergeWizardExecutor() { - DBG_ASSERT( m_pWizard == 0, "SwMailMergeWizardExecutor: m_pWizard must be Null!" ); - DBG_ASSERT( m_pMMConfig == 0, "SwMailMergeWizardExecutor: m_pMMConfig must be Null!" ); + OSL_ENSURE( m_pWizard == 0, "SwMailMergeWizardExecutor: m_pWizard must be Null!" ); + OSL_ENSURE( m_pMMConfig == 0, "SwMailMergeWizardExecutor: m_pMMConfig must be Null!" ); } void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs ) { if ( m_pView ) { - DBG_ERROR( "SwMailMergeWizardExecutor::ExecuteMailMergeWizard: Already executing the wizard!" ); + OSL_ENSURE(false, "SwMailMergeWizardExecutor::ExecuteMailMergeWizard: Already executing the wizard!" ); return; } m_pView = ::GetActiveView(); // not owner! - DBG_ASSERT(m_pView, "no current view?"); + OSL_ENSURE(m_pView, "no current view?"); if(m_pView) { // keep self alive until done. @@ -335,7 +331,7 @@ void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs m_pView->SetMailMergeConfigItem(0, 0, sal_True); SfxViewFrame* pViewFrame = m_pView->GetViewFrame(); pViewFrame->ShowChildWindow(FN_MAILMERGE_CHILDWINDOW, sal_False); - DBG_ASSERT(m_pMMConfig, "no MailMergeConfigItem available"); + OSL_ENSURE(m_pMMConfig, "no MailMergeConfigItem available"); bRestoreWizard = true; } // to make it bullet proof ;-) @@ -431,7 +427,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM #endif { #if OSL_DEBUG_LEVEL > 1 - DBG_ASSERT( pDialog == m_pWizard, "wrong dialog passed to EndDialogHdl!" ); + OSL_ENSURE( pDialog == m_pWizard, "wrong dialog passed to EndDialogHdl!" ); (void) pDialog; #endif @@ -473,7 +469,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM uno::Reference< frame::XFrame > xFrame = m_pView->GetViewFrame()->GetFrame().GetFrameInterface(); xFrame->getContainerWindow()->setVisible(sal_False); - DBG_ASSERT(pTargetView, "No target view has been created"); + OSL_ENSURE(pTargetView, "No target view has been created"); if(pTargetView) { // destroy wizard asynchronously @@ -489,7 +485,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM } else { - //should not happen - just in case no target view has been created + // should not happen - just in case no target view has been created ExecutionFinished( true ); } break; @@ -512,7 +508,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM { SwView* pTargetView = m_pMMConfig->GetTargetView(); SwView* pSourceView = m_pMMConfig->GetSourceView(); - DBG_ASSERT(pTargetView && pSourceView, "source or target view not available" ); + OSL_ENSURE(pTargetView && pSourceView, "source or target view not available" ); if(pTargetView && pSourceView) { m_pView2Close = pTargetView; @@ -535,7 +531,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM } else { - //should not happen - just in case no target view has been created + // should not happen - just in case no target view has been created ExecutionFinished( true ); } break; @@ -547,7 +543,7 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EM LINK( this, SwMailMergeWizardExecutor, CancelHdl ), m_pWizard ); break; } - default: //finish + default: // finish { SwView* pSourceView = m_pMMConfig->GetSourceView(); if(pSourceView) @@ -682,11 +678,11 @@ void SwModule::ExecOther(SfxRequest& rReq) } /*-------------------------------------------------------------------- - Beschreibung: Notifies abfangen + Description: Catch notifications --------------------------------------------------------------------*/ - // Hint abfangen fuer DocInfo +// Catch hint for DocInfo void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { if( rHint.ISA( SfxEventHint ) ) @@ -698,16 +694,8 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) SwWrtShell* pWrtSh = pDocSh ? pDocSh->GetWrtShell() : 0; switch( rEvHint.GetEventId() ) { -/* MA 07. Mar. 96: UpdateInputFlds() nur noch bei Dokument neu. - (Und bei Einfuegen Textbaust.) - case SFX_EVENT_OPENDOC: - // dann am aktuellen Dokument die Input-Fedler updaten - if( pWrtSh ) - pWrtSh->UpdateInputFlds(); - break; -*/ case SFX_EVENT_CREATEDOC: - // alle FIX-Date/Time Felder auf akt. setzen + // Update all FIX-Date/Time fields if( pWrtSh ) { SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False); @@ -719,14 +707,14 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { pWrtSh->UpdateInputFlds(); - // Sind Datenbankfelder enthalten? - // Erstmal alle verwendeten Datenbanken holen + // Are database fields contained? + // Get all used databases for the first time SwDoc *pDoc = pDocSh->GetDoc(); SvStringsDtor aDBNameList; pDoc->GetAllUsedDB( aDBNameList ); sal_uInt16 nCount = aDBNameList.Count(); if (nCount) - { // Datenbankbeamer oeffnen + { // Open database beamer ShowDBObj(pWrtSh->GetView(), pDoc->GetDBData()); } } @@ -802,6 +790,7 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal 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 = static_cast<SwDocShell *>(SfxObjectShell::GetFirst(&aType)); @@ -865,18 +854,13 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal } -/* -----------------------------20.02.01 12:43-------------------------------- - - ---------------------------------------------------------------------------*/ SwDBConfig* SwModule::GetDBConfig() { if(!pDBConfig) pDBConfig = new SwDBConfig; return pDBConfig; } -/* -----------------------------11.04.2002 15:27------------------------------ - ---------------------------------------------------------------------------*/ svtools::ColorConfig& SwModule::GetColorConfig() { if(!pColorConfig) @@ -887,9 +871,7 @@ svtools::ColorConfig& SwModule::GetColorConfig() } return *pColorConfig; } -/* -----------------------------06.05.2002 09:42------------------------------ - ---------------------------------------------------------------------------*/ SvtAccessibilityOptions& SwModule::GetAccessibilityOptions() { if(!pAccessibilityOptions) @@ -899,9 +881,7 @@ SvtAccessibilityOptions& SwModule::GetAccessibilityOptions() } return *pAccessibilityOptions; } -/* -----------------06.05.2003 14:52----------------- - --------------------------------------------------*/ SvtCTLOptions& SwModule::GetCTLOptions() { if(!pCTLOptions) @@ -911,9 +891,7 @@ SvtCTLOptions& SwModule::GetCTLOptions() } return *pCTLOptions; } -/* -----------------07.07.2003 09:31----------------- - --------------------------------------------------*/ SvtUserOptions& SwModule::GetUserOptions() { if(!pUserOptions) @@ -923,9 +901,7 @@ SvtUserOptions& SwModule::GetUserOptions() } return *pUserOptions; } -/* -----------------18.07.2003 13:31----------------- - --------------------------------------------------*/ SvtUndoOptions& SwModule::GetUndoOptions() { if(!pUndoOptions) @@ -935,16 +911,14 @@ SvtUndoOptions& SwModule::GetUndoOptions() } return *pUndoOptions; } -/*-----------------30.01.97 08.30------------------- ---------------------------------------------------*/ const SwMasterUsrPref *SwModule::GetUsrPref(sal_Bool bWeb) const { SwModule* pNonConstModule = (SwModule*)this; if(bWeb && !pWebUsrPref) { - // im Load der SwMasterUsrPref wird der SpellChecker gebraucht, dort darf - // er aber nicht angelegt werden #58256# + // The SpellChecker is needed in SwMasterUsrPref's Load, but it must not + // be created there #58256# pNonConstModule->pWebUsrPref = new SwMasterUsrPref(sal_True); } else if(!bWeb && !pUsrPref) @@ -973,3 +947,5 @@ void NewXForms( SfxRequest& rReq ) // set return value rReq.SetReturnValue( SfxVoidItem( rReq.GetSlot() ) ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx index 46d02d702a..00809fe954 100644 --- a/sw/source/ui/app/applab.cxx +++ b/sw/source/ui/app/applab.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,11 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -#if STLPORT_VERSION>=321 #include <cstdarg> -#endif - #include <hintids.hxx> @@ -78,12 +75,8 @@ #include <pagedesc.hxx> #include <poolfmt.hxx> -#ifndef _APP_HRC #include <app.hrc> -#endif -#ifndef _POOLFMT_HRC #include <poolfmt.hrc> -#endif #include "swabstdlg.hxx" #include "envelp.hrc" #include <misc.hrc> @@ -93,12 +86,10 @@ using namespace ::com::sun::star; using ::rtl::OUString; -// steht im appenv.cxx +// is in appenv.cxx extern String InsertLabEnvText( SwWrtShell& , SwFldMgr& , const String& ); -const char __FAR_DATA MASTER_LABEL[] = "MasterLabel"; - -// -------------------------------------------------------------------------- +const char MASTER_LABEL[] = "MasterLabel"; const SwFrmFmt *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rItem, SwFrmFmt &rFmt, @@ -117,18 +108,17 @@ const SwFrmFmt *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rItem, aSet.Put(SwFmtVertOrient(rItem.lUpper + nRow * rItem.lVDist, text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME )); } - const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Fly einfuegen - ASSERT( pFmt, "Fly not inserted" ); + const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Insert Fly + OSL_ENSURE( pFmt, "Fly not inserted" ); - rSh.UnSelectFrm(); //Rahmen wurde automatisch selektiert + rSh.UnSelectFrm(); //Frame was selected automatically rSh.SetTxtFmtColl( rSh.GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) ); - // if(!rItem.bSynchron || !(nCol|nRow)) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS ); if ( fnSetActGroup ) (*fnSetActGroup)( rItem.sGlossaryGroup ); @@ -157,14 +147,14 @@ const SwFrmFmt *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& rItem, aSet.Put(SwFmtVertOrient(rItem.lUpper + nRow * rItem.lVDist, text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME )); } - const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Fly einfuegen - ASSERT( pFmt, "Fly not inserted" ); + const SwFrmFmt *pFmt = rSh.NewFlyFrm(aSet, sal_True, &rFmt ); // Insert Fly + OSL_ENSURE( pFmt, "Fly not inserted" ); - rSh.UnSelectFrm(); //Rahmen wurde automatisch selektiert + rSh.UnSelectFrm(); //Frame was selected automatically rSh.SetTxtFmtColl( rSh.GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) ); - // Ggf. "Naechster Datensatz" + // If applicable "next dataset" String sDBName; if( (!rItem.bSynchron || !(nCol|nRow)) && (sDBName = InsertLabEnvText( rSh, rFldMgr, rItem.aWriting )).Len() && !bLast ) { @@ -176,43 +166,41 @@ const SwFrmFmt *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& rItem, return pFmt; } -// ---------------------------------------------------------------------------- - void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) { -static sal_uInt16 nLabelTitleNo = 0; -static sal_uInt16 nBCTitleNo = 0; + static sal_uInt16 nLabelTitleNo = 0; + static sal_uInt16 nBCTitleNo = 0; - // DB-Manager anlegen + // Create DB-Manager SwNewDBMgr* pNewDBMgr = new SwNewDBMgr; - // SwLabItem aus Config lesen + // Read SwLabItem from Config SwLabCfgItem aLabCfg(bLabel); - // Dialog hochfahren + // Move up Dialog SfxItemSet aSet( GetPool(), FN_LABEL, FN_LABEL, 0 ); aSet.Put( aLabCfg.GetItem() ); SwAbstractDialogFactory* pDialogFactory = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pDialogFactory, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pDialogFactory, "SwAbstractDialogFactory fail!"); - AbstarctSwLabDlg* pDlg = pDialogFactory->CreateSwLabDlg( 0, aSet, pNewDBMgr, bLabel, DLG_LAB ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + AbstractSwLabDlg* pDlg = pDialogFactory->CreateSwLabDlg( 0, aSet, pNewDBMgr, bLabel, DLG_LAB ); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if ( RET_OK == pDlg->Execute() ) { - // Dialog auslesen, Item in Config speichern + // Read dialog, store item in config const SwLabItem& rItem = (const SwLabItem&) pDlg-> GetOutputItemSet()->Get(FN_LABEL); aLabCfg.GetItem() = rItem; aLabCfg.Commit(); - // Neues Dokument erzeugen. + // Create new document SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_STANDARD)); xDocSh->DoInitNew( 0 ); - // Drucker + // Printer Printer *pPrt = pDlg->GetPrt(); if (pPrt) { @@ -223,9 +211,9 @@ static sal_uInt16 nBCTitleNo = 0; SfxViewFrame* pViewFrame = SfxViewFrame::DisplayNewDocument( *xDocSh, rReq ); SwView *pNewView = (SwView*) pViewFrame->GetViewShell(); - pNewView->AttrChangedNotify( &pNewView->GetWrtShell() );//Damit SelectShell gerufen wird. + pNewView->AttrChangedNotify( &pNewView->GetWrtShell() );// So that SelectShell is being called. - // Dokumenttitel setzen + // Set document title String aTmp; if(bLabel) { @@ -241,9 +229,9 @@ static sal_uInt16 nBCTitleNo = 0; pViewFrame->GetFrame().Appear(); - // Shell ermitteln + // Determine Shell SwWrtShell *pSh = pNewView->GetWrtShellPtr(); - ASSERT( pSh, "missing WrtShell" ); + OSL_ENSURE( pSh, "missing WrtShell" ); { // block for locks the dispatcher!! @@ -254,12 +242,12 @@ static sal_uInt16 nBCTitleNo = 0; pSh->DoUndo( sal_False ); pSh->StartAllAction(); - pSh->SetNewDoc(); // Performanceprobleme vermeiden + pSh->SetNewDoc(); // Avoid performance problems SwPageDesc aDesc = pSh->GetPageDesc( 0 ); SwFrmFmt& rFmt = aDesc.GetMaster(); - // Raender + // Borders SvxLRSpaceItem aLRMargin( RES_LR_SPACE ); SvxULSpaceItem aULMargin( RES_UL_SPACE ); aLRMargin.SetLeft ((sal_uInt16) rItem.lLeft ); @@ -269,26 +257,26 @@ static sal_uInt16 nBCTitleNo = 0; rFmt.SetFmtAttr(aLRMargin); rFmt.SetFmtAttr(aULMargin); - // Kopf- und Fusszeilen + // Header and footer rFmt.SetFmtAttr(SwFmtHeader(sal_Bool(sal_False))); aDesc.ChgHeaderShare(sal_False); rFmt.SetFmtAttr(SwFmtFooter(sal_Bool(sal_False))); aDesc.ChgFooterShare(sal_False); - aDesc.SetUseOn(nsUseOnPage::PD_ALL); // Seitennumerierung + aDesc.SetUseOn(nsUseOnPage::PD_ALL); // Site numbering - // Einstellen der Seitengroesse + // Set page size rFmt.SetFmtAttr(SwFmtFrmSize(ATT_FIX_SIZE, rItem.lLeft + rItem.nCols * rItem.lHDist + MINLAY, rItem.lUpper + rItem.nRows * rItem.lVDist + MINLAY)); - // Numerierungsart + // Numbering type SvxNumberType aType; aType.SetNumberingType(SVX_NUM_NUMBER_NONE); aDesc.SetNumType( aType ); - // Folgevorlage + // Followup template const SwPageDesc &rFollow = pSh->GetPageDesc( pSh->GetCurPageDesc() ); aDesc.SetFollow( &rFollow ); @@ -297,23 +285,22 @@ static sal_uInt16 nBCTitleNo = 0; aItem.SetValue((sal_Int8)pPrt->GetPaperBin()); rFmt.SetFmtAttr(aItem); - //determine orientation by calculating the width and height of the resulting page + // Determine orientation by calculating the width and height of the resulting page const int nResultWidth = rItem.lHDist * (rItem.nCols - 1) + rItem.lWidth + rItem.lLeft; const int nResultHeight = rItem.lVDist * (rItem.nRows - 1) + rItem.lHeight + rItem.lUpper; aDesc.SetLandscape(nResultWidth > nResultHeight); pSh->ChgPageDesc( 0, aDesc ); - // Rahmen einfuegen + // Insert frame SwFldMgr* pFldMgr = new SwFldMgr; pFldMgr->SetEvalExpFlds(sal_False); - //fix(24446): Damit der Text der Ettiketten nicht im unbedruckbaren - //Bereich landet stellen wir entsprechende Raender ein. Um das Handling - //so Optimal wie moeglich zu halten stellen wir zunaechst an der - //aktuellen Absatzvorlage keinen Rand als hartes Attribut ein (Damit die - //Formatierung wg. der Zeichengeb. Rahmen passt. Dann stellen wir die - //Standarabsatzvorlage anhand des unbedruckbaren Bereiches ein. + //fix(24446): To avoid that labels end up in unprintable area, we set + //borders accordingly. To keep the handling as good as possible, we + //don't set any border as hard attribute at the current paragraph template + //(so that formating works, because of character-bound borders). Then + //we set the default paragraph template using the unprintable area. const long nMin = pPrt->GetPageOffset().X() - rItem.lLeft; if ( nMin > 0 ) { @@ -325,7 +312,7 @@ static sal_uInt16 nBCTitleNo = 0; pStandard->SetFmtAttr( aLR ); } - // Rahmenvorlage vorbereiten + // Prepare border template SwFrmFmt* pFmt = pSh->GetFrmFmtFromPool( RES_POOLFRM_LABEL ); SwFmtFrmSize aFrmSize( ATT_FIX_SIZE, rItem.lHDist - (rItem.lHDist-rItem.lWidth), @@ -392,15 +379,15 @@ static sal_uInt16 nBCTitleNo = 0; sLinkName += String::CreateFromAscii(MASTER_LABEL); aSect.SetLinkFileName(sLinkName); aSect.SetProtectFlag(true); - pSh->Insert(aDotStr); // Dummytext zum Zuweisen der Section + pSh->Insert(aDotStr); // Dummytext to allocate the Section pSh->SttDoc(); - pSh->EndDoc(sal_True); // Alles im Rahmen selektieren + pSh->EndDoc(sal_True); // Select everything in the frame pSh->InsertSection(aSect); } pSh->Pop( sal_False ); } if ( i + 1 != rItem.nRows ) - pSh->SplitNode(); // Kleine Optimierung + pSh->SplitNode(); // Small optimisation } } else @@ -418,7 +405,7 @@ static sal_uInt16 nBCTitleNo = 0; if(!bLabel) { uno::Reference< frame::XModel > xModel = pSh->GetView().GetDocShell()->GetBaseModel(); - DBG_ASSERT(pDialogFactory, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pDialogFactory, "SwAbstractDialogFactory fail!"); SwLabDlgMethod SwLabDlgUpdateFieldInformation = pDialogFactory->GetSwLabDlgStaticMethod (); SwLabDlgUpdateFieldInformation(xModel, rItem); } @@ -436,14 +423,14 @@ static sal_uInt16 nBCTitleNo = 0; if( rItem.aWriting.indexOf( '<' ) >= 0 ) { - // Datenbankbrowser mit zuletzt verwendeter Datenbank oeffnen + // Open database browser on recently used database ShowDBObj( *pNewView, pSh->GetDBData() ); } if( rItem.bSynchron ) { SfxDispatcher* pDisp = pViewFrame->GetDispatcher(); - ASSERT(pDisp, "Heute kein Dispatcher am Frame?"); + OSL_ENSURE(pDisp, "No dispatcher in frame?"); pDisp->Execute(FN_SYNC_LABELS, SFX_CALLMODE_ASYNCHRON); } rReq.SetReturnValue(SfxVoidItem(bLabel ? FN_LABEL : FN_BUSINESS_CARD)); @@ -455,3 +442,4 @@ static sal_uInt16 nBCTitleNo = 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx index 40cfb6b9e1..570f060670 100644 --- a/sw/source/ui/app/appopt.cxx +++ b/sw/source/ui/app/appopt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,6 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include <cmdid.h> // Function-Ids #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> @@ -58,8 +60,8 @@ #include <wrtsh.hxx> #include <IDocumentDeviceAccess.hxx> #include <uitool.hxx> -#include <initui.hxx> // fuer ::GetGlossaries() -#include <fldbas.hxx> //fuer UpdateFields +#include <initui.hxx> // for ::GetGlossaries() +#include <fldbas.hxx> //for UpdateFields #include <wview.hxx> #include <cfgitems.hxx> #include <prtopt.hxx> @@ -72,7 +74,7 @@ #include <unotools/lingucfg.hxx> #include <editeng/unolingu.hxx> #include <globals.hrc> -#include <globals.h> // globale Konstanten z.B. +#include <globals.h> // e.g. global Constants #include <svl/slstitm.hxx> #include "swabstdlg.hxx" #include <swwrtshitem.hxx> @@ -82,37 +84,31 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; -/* -----------------12.02.99 12:28------------------- - * - * --------------------------------------------------*/ - SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId ) { sal_Bool bTextDialog = (nId == SID_SW_EDITOPTIONS) ? sal_True : sal_False; - // hier werden die Optionen fuer die Web- und den Textdialog zusmmengesetzt + // the options for the Web- and Textdialog are put together here SwViewOption aViewOpt = *GetUsrPref(!bTextDialog); SwMasterUsrPref* pPref = bTextDialog ? pUsrPref : pWebUsrPref; - //kein MakeUsrPref, da hier nur die Optionen von Textdoks genommen werden duerfen + // no MakeUsrPref, because only options from textdoks can be used here SwView* pAppView = GetView(); if(pAppView && pAppView->GetViewFrame() != SfxViewFrame::Current()) pAppView = 0; if(pAppView) { - // wenn Text dann nicht WebView und umgekehrt + // if Text then no WebView and vice versa sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pAppView); if( (bWebView && !bTextDialog) ||(!bWebView && bTextDialog)) { aViewOpt = *pAppView->GetWrtShell().GetViewOptions(); } else - pAppView = 0; // mit View kann hier nichts gewonnen werden + pAppView = 0; // with View, there's nothing to win here } /********************************************************************/ - /* */ - /* Optionen/Bearbeiten */ - /* */ + /* Options/Edit */ /********************************************************************/ SfxItemSet* pRet = new SfxItemSet (GetPool(), FN_PARAM_DOCDISP, FN_PARAM_ELEM, SID_PRINTPREVIEW, SID_PRINTPREVIEW, @@ -121,6 +117,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId ) FN_PARAM_WRTSHELL, FN_PARAM_WRTSHELL, FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER, SID_ATTR_METRIC, SID_ATTR_METRIC, + SID_ATTR_APPLYCHARUNIT, SID_ATTR_APPLYCHARUNIT, SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP, RES_BACKGROUND, RES_BACKGROUND, SID_HTML_MODE, SID_HTML_MODE, @@ -130,7 +127,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId ) SID_ATTR_LANGUAGE, SID_ATTR_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE, -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 FN_PARAM_SWTEST, FN_PARAM_SWTEST, #endif 0); @@ -163,32 +160,23 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId ) } else { -/* Der Drucker wird jetzt von der TabPage erzeugt und auch geloescht - * SfxItemSet* pSet = new SfxItemSet( SFX_APP()->GetPool(), - SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, - SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, - 0 ); - - pPrt = new SfxPrinter(pSet); - pRet->Put(SwPtrItem(FN_PARAM_PRINTER, pPrt));*/ - SvtLinguConfig aLinguCfg; Locale aLocale; LanguageType nLang; using namespace ::com::sun::star::i18n::ScriptType; - Any aLang = aLinguCfg.GetProperty(C2U("DefaultLocale")); + Any aLang = aLinguCfg.GetProperty(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale"))); aLang >>= aLocale; nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), LATIN); pRet->Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE)); - aLang = aLinguCfg.GetProperty(C2U("DefaultLocale_CJK")); + aLang = aLinguCfg.GetProperty(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale_CJK"))); aLang >>= aLocale; nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), ASIAN); pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE)); - aLang = aLinguCfg.GetProperty(C2U("DefaultLocale_CTL")); + aLang = aLinguCfg.GetProperty(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale_CTL"))); aLang >>= aLocale; nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), COMPLEX); pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE)); @@ -211,6 +199,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId ) pAppView->GetVLinealMetric(eUnit); 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) { if(pAppView) @@ -224,10 +213,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId ) pRet->Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, (sal_uInt16)pPref->GetDefTab())); } - /*-----------------01.02.97 11.13------------------- - Optionen fuer GridTabPage - --------------------------------------------------*/ - + // Options for GridTabPage SvxGridItem aGridItem( SID_ATTR_GRID_OPTIONS); aGridItem.SetUseGridSnap( aViewOpt.IsSnap()); @@ -243,9 +229,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId ) pRet->Put(aGridItem); - /*-----------------01.02.97 13.02------------------- - Optionen fuer PrintTabPage - --------------------------------------------------*/ + // Options for PrintTabPage const SwPrintData* pOpt = pAppView ? &pAppView->GetWrtShell().getIDocumentDeviceAccess()->getPrintData() : 0; @@ -256,42 +240,17 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId ) SwAddPrinterItem aAddPrinterItem (FN_PARAM_ADDPRINTER, *pOpt ); pRet->Put(aAddPrinterItem); - /*-----------------01.02.97 13.12------------------- - Optionen fuer Web-Hintergrund - --------------------------------------------------*/ + // Options for Web background if(!bTextDialog) { pRet->Put(SvxBrushItem(aViewOpt.GetRetoucheColor(), RES_BACKGROUND)); } -#ifdef DBG_UTIL - /*-----------------01.02.97 13.02------------------- - Test-Optionen - --------------------------------------------------*/ - SwTestItem aTestItem(FN_PARAM_SWTEST); - aTestItem.bTest1 = aViewOpt.IsTest1(); - aTestItem.bTest2 = aViewOpt.IsTest2(); - aTestItem.bTest3 = aViewOpt.IsTest3(); - aTestItem.bTest4 = aViewOpt.IsTest4(); - aTestItem.bTest5 = aViewOpt.IsTest5(); - aTestItem.bTest6 = aViewOpt.IsTest6(); - aTestItem.bTest7 = aViewOpt.IsTest7(); - aTestItem.bTest8 = aViewOpt.IsTest8(); - aTestItem.bTest9 = SwViewOption::IsTest9(); - aTestItem.bTest10 = aViewOpt.IsTest10(); - pRet->Put(aTestItem); -#endif - /*-----------------01.02.97 13.04------------------- - - --------------------------------------------------*/ if(!bTextDialog) pRet->Put(SfxUInt16Item(SID_HTML_MODE, HTMLMODE_ON)); -// delete pPrt; return pRet; } -/* -----------------12.02.99 12:28------------------- - * - * --------------------------------------------------*/ + void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) { sal_Bool bTextDialog = nId == SID_SW_EDITOPTIONS; @@ -303,7 +262,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) // the text dialog mustn't apply data to the web view and vice versa sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pAppView); if( (bWebView == bTextDialog)) - pAppView = 0; // + pAppView = 0; } SwViewOption aViewOpt = *GetUsrPref(!bTextDialog); @@ -314,7 +273,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) : NULL; /*--------------------------------------------------------------------- - Seite Dokumentansicht auswerten + Interpret the page Documentview -----------------------------------------------------------------------*/ if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_DOCDISP, sal_False, &pItem )) { @@ -342,7 +301,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) } /*--------------------------------------------------------------------- - Elemente - Item auswerten + Elements - interpret Item -----------------------------------------------------------------------*/ if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ELEM, sal_False, &pItem ) ) @@ -358,6 +317,14 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem; ::SetDfltMetric((FieldUnit)pMetricItem->GetValue(), !bTextDialog); } + if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT, + 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, sal_False, &pItem ) ) { const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem; @@ -389,8 +356,8 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) } - /*-----------------01.02.97 11.36------------------- - Hintergrund nur im WebDialog + /*------------------------------------------------ + Background only in WebDialog --------------------------------------------------*/ if(SFX_ITEM_SET == rSet.GetItemState(RES_BACKGROUND)) { @@ -400,7 +367,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) } /*-------------------------------------------------------------------- - Seite Rastereinstellungen auswerten + Interpret page Grid Settings ----------------------------------------------------------------------*/ if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS, sal_False, &pItem )) @@ -429,9 +396,9 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) } } - //-------------------------------------------------------------------------- - // Writer Drucker Zusatzeinstellungen auswerten - //---------------------------------------------------------------------------- + /*-------------------------------------------------------------------- + Interpret Writer Printer Options + ----------------------------------------------------------------------*/ if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ADDPRINTER, sal_False, &pItem )) { @@ -471,33 +438,10 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) } -#ifdef DBG_UTIL - /*-------------------------------------------------------------------------- - Writer Testseite auswerten - ----------------------------------------------------------------------------*/ - - if( SFX_ITEM_SET == rSet.GetItemState( - FN_PARAM_SWTEST, sal_False, &pItem )) - { - const SwTestItem* pTestItem = (const SwTestItem*)pItem; - aViewOpt.SetTest1((sal_Bool)pTestItem->bTest1); - aViewOpt.SetTest2((sal_Bool)pTestItem->bTest2); - aViewOpt.SetTest3((sal_Bool)pTestItem->bTest3); - aViewOpt.SetTest4((sal_Bool)pTestItem->bTest4); - aViewOpt.SetTest5((sal_Bool)pTestItem->bTest5); - aViewOpt.SetTest6((sal_Bool)pTestItem->bTest6); - aViewOpt.SetTest7((sal_Bool)pTestItem->bTest7); - aViewOpt.SetTest8((sal_Bool)pTestItem->bTest8); - SwViewOption::SetTest9((sal_Bool)pTestItem->bTest9); - aViewOpt.SetTest10((sal_Bool)pTestItem->bTest10); - } -#endif - // dann an der akt. View und Shell die entsp. Elemente setzen + // set elements for the current view and shell ApplyUsrPref( aViewOpt, pAppView, bTextDialog? VIEWOPT_DEST_TEXT : VIEWOPT_DEST_WEB); } -/* -----------------12.02.99 12:28------------------- - * - * --------------------------------------------------*/ + SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxItemSet& rSet ) { SfxTabPage* pRet = NULL; @@ -566,7 +510,7 @@ SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxI SwView* pCurrView = GetView(); if(pCurrView) { - // wenn Text dann nicht WebView und umgekehrt + // if text then not WebView and vice versa 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) ) @@ -602,7 +546,7 @@ SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxI } } break; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 case RID_SW_TP_OPTTEST_PAGE: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); @@ -640,7 +584,9 @@ SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxI break; } - DBG_ASSERT( pRet, "SwModule::CreateTabPage(): Unknown tabpage id" ); + OSL_ENSURE( pRet, "SwModule::CreateTabPage(): Unknown tabpage id" ); return pRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index 794b6032b7..d350ed7a08 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,11 +68,11 @@ #include <swwait.hxx> #include <printdata.hxx> #include <frmatr.hxx> -#include <view.hxx> // fuer die aktuelle Sicht +#include <view.hxx> // for the current view #include <edtwin.hxx> #include <PostItMgr.hxx> -#include <wrtsh.hxx> // Verbindung zur Core -#include <docsh.hxx> // Dokumenterzeugung +#include <wrtsh.hxx> // connection to Core +#include <docsh.hxx> // document creation #include <basesh.hxx> #include <viewopt.hxx> #include <wdocsh.hxx> @@ -94,18 +95,16 @@ #include <txtftn.hxx> #include <ftnidx.hxx> -// --> FME 2004-08-05 #i20883# Digital Signatures and Encryption +// #i20883# Digital Signatures and Encryption #include <fldbas.hxx> #include <docary.hxx> -// <-- -#include <swerror.h> // Fehlermeldungen +#include <swerror.h> // Error messages #include <helpid.h> #include <cmdid.h> #include <globals.hrc> #include <app.hrc> #include <cfgid.h> -#include <unotools/moduleoptions.hxx> #include <unotools/fltrcfg.hxx> #include <svtools/htmlcfg.hxx> #include <sfx2/fcontnr.hxx> @@ -134,7 +133,6 @@ using namespace ::com::sun::star::container; SFX_IMPL_INTERFACE( SwDocShell, SfxObjectShell, SW_RES(0) ) { - SFX_CHILDWINDOW_REGISTRATION( SID_HYPERLINK_INSERT ); } TYPEINIT2(SwDocShell, SfxObjectShell, SfxListener); @@ -143,7 +141,7 @@ TYPEINIT2(SwDocShell, SfxObjectShell, SfxListener); SFX_IMPL_OBJECTFACTORY(SwDocShell, SvGlobalName(SO3_SW_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter" ) /*-------------------------------------------------------------------- - Beschreibung: Laden vorbereiten + Description: Prepare loading --------------------------------------------------------------------*/ @@ -184,7 +182,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr, else return 0; - // PassWord Checken + // Check password String aPasswd; if ((*ppRdr)->NeedsPasswd( *pRead )) { @@ -236,7 +234,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr, } /*-------------------------------------------------------------------- - Beschreibung: Laden + Description: Loading --------------------------------------------------------------------*/ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium ) @@ -251,7 +249,7 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium ) SwWait aWait( *this, sal_True ); - // SfxProgress unterdruecken, wenn man Embedded ist + // Suppress SfxProgress, when we are Embedded SW_MOD()->SetEmbeddedLoadSave( SFX_CREATE_MODE_EMBEDDED == GetCreateMode() ); @@ -262,7 +260,7 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium ) sal_uLong nErr = pRdr->Read( *pRead ); - // Evtl. ein altes Doc weg + // Maybe put away one old Doc if ( pDoc != pRdr->GetDoc() ) { if( pDoc ) @@ -285,16 +283,10 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium ) SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); sal_Bool bOk = !IsError( nErr ); - // --> OD 2006-11-07 #i59688# -// // StartFinishedLoading rufen. Nicht bei asynchronen Filtern! -// // Diese muessen das selbst rufen! -// if( bOk && !pDoc->IsInLoadAsynchron() ) -// StartLoadFinishedTimer(); if ( bOk && !pDoc->IsInLoadAsynchron() ) { LoadingFinished(); } - // <-- pRead->setSotStorageRef(pStg); // #i45333# save sot storage ref in case of recursive calls @@ -302,7 +294,7 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium ) } /*-------------------------------------------------------------------- - Beschreibung: Sichern des Default-Formats, Stg vorhanden + Description: Saving the Default-Format, Stg present --------------------------------------------------------------------*/ @@ -315,7 +307,7 @@ sal_Bool SwDocShell::Save() SwWait aWait( *this, sal_True ); CalcLayoutForOLEObjects(); // format for OLE objets - // --> OD 2006-03-17 #i62875# + // #i62875# // reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible if ( pWrtShell && pDoc && pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) && @@ -323,7 +315,6 @@ sal_Bool SwDocShell::Save() { pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false); } - // <-- sal_uLong nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE; if( SfxObjectShell::Save() ) @@ -346,9 +337,9 @@ sal_Bool SwDocShell::Save() break; case SFX_CREATE_MODE_EMBEDDED: - // SfxProgress unterdruecken, wenn man Embedded ist + // Suppress SfxProgress, if we are Embedded SW_MOD()->SetEmbeddedLoadSave( sal_True ); - // kein break; + // no break; case SFX_CREATE_MODE_STANDARD: case SFX_CREATE_MODE_PREVIEW: @@ -356,15 +347,12 @@ sal_Bool SwDocShell::Save() { if( pDoc->ContainsMSVBasic() ) { - //TODO/MBA: it looks as that this code can be removed! - //SvxImportMSVBasic aTmp( *this, pIo->GetStorage() ); - //aTmp.SaveOrDelMSVBAStorage( sal_False, aEmptyStr ); if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() ) nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) (*this) ); pDoc->SetContainsMSVBasic( sal_False ); } - // TabellenBox Edit beenden! + // End TableBox Edit! if( pWrtShell ) pWrtShell->EndAllTblBoxEdit(); @@ -399,7 +387,7 @@ sal_Bool SwDocShell::Save() } /*-------------------------------------------------------------------- - Beschreibung: Sichern im Defaultformat + Description: Save using the Defaultformat --------------------------------------------------------------------*/ @@ -439,14 +427,14 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) GetModel(), uno::UNO_QUERY_THROW); uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties(); - xDocProps->setTemplateName(::rtl::OUString::createFromAscii("")); - xDocProps->setTemplateURL(::rtl::OUString::createFromAscii("")); + xDocProps->setTemplateName(::rtl::OUString()); + xDocProps->setTemplateURL(::rtl::OUString()); xDocProps->setTemplateDate(::util::DateTime()); } } CalcLayoutForOLEObjects(); // format for OLE objets - // --> OD 2006-03-17 #i62875# + // #i62875# // reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible if ( pWrtShell && pDoc && pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) && @@ -454,7 +442,6 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) { pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false); } - // <-- sal_uLong nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE; uno::Reference < embed::XStorage > xStor = rMedium.GetOutputStorage(); @@ -480,26 +467,23 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) if( pDoc->ContainsMSVBasic() ) { - //TODO/MBA: it looks as that this code can be removed! - //SvxImportMSVBasic aTmp( *this, pIo->GetStorage() ); - //aTmp.SaveOrDelMSVBAStorage( sal_False, aEmptyStr ); if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() ) nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) *this ); pDoc->SetContainsMSVBasic( sal_False ); } - // TabellenBox Edit beenden! + // End TableBox Edit! if( pWrtShell ) pWrtShell->EndAllTblBoxEdit(); - // Modified-Flag merken und erhalten ohne den Link zu Callen - // (fuer OLE; nach Anweisung von MM) + // Remember and preserve Modified-Flag without calling the Link + // (for OLE; after Statement from MM) sal_Bool bIsModified = pDoc->IsModified(); pDoc->GetIDocumentUndoRedo().LockUndoNoModifiedPosition(); Link aOldOLELnk( pDoc->GetOle2Link() ); pDoc->SetOle2Link( Link() ); - // SfxProgress unterdruecken, wenn man Embedded ist + // Suppress SfxProgress when we are Embedded SW_MOD()->SetEmbeddedLoadSave( SFX_CREATE_MODE_EMBEDDED == GetCreateMode() ); @@ -534,11 +518,11 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) } /*-------------------------------------------------------------------- - Beschreibung: Sichern aller Formate + Description: Save all Formats --------------------------------------------------------------------*/ SwSrcView* lcl_GetSourceView( SwDocShell* pSh ) { - // sind wir in der SourceView? + // are we in SourceView? SfxViewFrame* pVFrame = SfxViewFrame::GetFirst( pSh ); SfxViewShell* pViewShell = pVFrame ? pVFrame->GetViewShell() : 0; return PTR_CAST( SwSrcView, pViewShell); @@ -554,7 +538,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) WriterRef xWriter; SwReaderWriter::GetWriter( pFlt->GetUserData(), rMedium.GetBaseURL( true ), xWriter ); if( !xWriter.Is() ) - { // Der Filter ist nicht vorhanden + { // Filter not available InfoBox( 0, SW_RESSTR(STR_DLLNOTFOUND) ).Execute(); return sal_False; @@ -582,7 +566,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) if ( bSave ) { SvStorageRef xStg = new SotStorage( rMedium.GetOutStream(), sal_False ); - DBG_ASSERT( !xStg->GetError(), "No storage available for storing VBA macros!" ); + OSL_ENSURE( !xStg->GetError(), "No storage available for storing VBA macros!" ); if ( !xStg->GetError() ) { nVBWarning = SaveOrDelMSVBAStorage( (SfxObjectShell&) *this, *xStg, bSave, String::CreateFromAscii("Macros") ); @@ -592,7 +576,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) } } - // TabellenBox Edit beenden! + // End TableBox Edit! if( pWrtShell ) pWrtShell->EndAllTblBoxEdit(); @@ -623,12 +607,12 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) UpdateDocInfoForSave(); } - // --> FME 2007-5-7 #i76360# Update document statistics + // #i76360# Update document statistics SwDocStat aDocStat( pDoc->GetDocStat() );; pDoc->UpdateDocStat( aDocStat ); - // <-- + CalcLayoutForOLEObjects(); // format for OLE objets - // --> OD 2006-03-17 #i62875# + // #i62875# // reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible if ( pWrtShell && pDoc && pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) && @@ -636,7 +620,6 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) { pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false); } - // <-- if( xWriter->IsStgWriter() && ( /*xWriter->IsSw3Writer() ||*/ @@ -644,14 +627,14 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) pFlt->GetUserData().EqualsAscii( FILTER_XMLV ) || pFlt->GetUserData().EqualsAscii( FILTER_XMLVW ) ) ) { - // eigenen Typ ermitteln + // determine the own Type sal_uInt8 nMyType = 0; if( ISA( SwWebDocShell) ) nMyType = 1; else if( ISA( SwGlobalDocShell) ) nMyType = 2; - // gewuenschten Typ ermitteln + // determine the desired Type sal_uInt8 nSaveType = 0; sal_uLong nSaveClipId = pFlt->GetFormat(); if( SOT_FORMATSTR_ID_STARWRITERWEB_8 == nSaveClipId || @@ -665,7 +648,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) SOT_FORMATSTR_ID_STARWRITERGLOB_40 == nSaveClipId ) nSaveType = 2; - // Flags am Dokument entsprechend umsetzen + // Change Flags of the Document accordingly 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); @@ -687,14 +670,14 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) // TODO/MBA: testing uno::Reference < beans::XPropertySet > xSet( rMedium.GetStorage(), uno::UNO_QUERY ); if ( xSet.is() ) - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("MediaType"), uno::makeAny( ::rtl::OUString( SotExchange::GetFormatMimeType( nSaveClipId ) ) ) ); + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), uno::makeAny( ::rtl::OUString( SotExchange::GetFormatMimeType( nSaveClipId ) ) ) ); } catch ( uno::Exception& ) { } } - // Jetzt das Dokument normal speichern + // Now normally save the Document sal_Bool bRet = SaveAs( rMedium ); if( nMyType != nSaveType ) @@ -726,40 +709,37 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) xWriter->SetAsciiOptions( aOpt ); } - // SfxProgress unterdruecken, wenn man Embedded ist + // Suppress SfxProgress when we are Embedded SW_MOD()->SetEmbeddedLoadSave( SFX_CREATE_MODE_EMBEDDED == GetCreateMode()); - // Kontext aufspannen, um die Anzeige der Selektion zu unterbinden + // Span Context in order to suppress the Selection's View sal_uLong nErrno; String aFileName( rMedium.GetName() ); - //Keine View also das ganze Dokument! + // No View, so the whole Document! if ( pWrtShell ) { SwWait aWait( *this, sal_True ); - // --> OD 2009-12-31 #i106906# + // #i106906# const sal_Bool bFormerLockView = pWrtShell->IsViewLocked(); pWrtShell->LockView( sal_True ); - // <-- pWrtShell->StartAllAction(); pWrtShell->Push(); SwWriter aWrt( rMedium, *pWrtShell, sal_True ); nErrno = aWrt.Write( xWriter, &aFileName ); - //JP 16.05.97: falls der SFX uns die View waehrend des speicherns - // entzieht + //JP 16.05.97: In case the SFX revokes the View while saving if( pWrtShell ) { pWrtShell->Pop(sal_False); pWrtShell->EndAllAction(); - // --> OD 2009-12-31 #i106906# + // #i106906# pWrtShell->LockView( bFormerLockView ); - // <-- } } else { - // sind wir in der SourceView? + // are we in SourceView? SwSrcView* pSrcView = ::lcl_GetSourceView( this ); if( pSrcView ) { @@ -782,12 +762,12 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) } /*-------------------------------------------------------------------- - Beschreibung: Haende weg + Description: Hands off --------------------------------------------------------------------*/ /*-------------------------------------------------------------------- - Beschreibung: ??? noch nicht zu aktivieren, muss sal_True liefern + Description: ??? do not yet activate, must deliver TRUE --------------------------------------------------------------------*/ @@ -797,7 +777,7 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS sal_Bool bRet = SfxObjectShell::SaveCompleted( xStor ); if( bRet ) { - // erst hier entscheiden, ob das Speichern geklappt hat oder nicht + // Do not decide until here, whether Saving was successful or not if( IsModified() ) pDoc->SetModified(); else @@ -815,12 +795,8 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS { if ( !pOLEChildList->MoveEmbeddedObject( aNames[n-1], GetEmbeddedObjectContainer() ) ) { - DBG_ERROR( "Copying of objects didn't work!" ); + OSL_ENSURE(false, "Copying of objects didn't work!" ); } - - //SvPersist* pPersist = this; - //SvInfoObjectRef aRef( pInfList->GetObject( --n )); - //pPersist->Move( &aRef, aRef->GetStorageName() ); } DELETEZ( pOLEChildList ); @@ -831,26 +807,26 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS } /*-------------------------------------------------------------------- - Beschreibung: Draw()-Overload fuer OLE2 (Sfx) + Description: Draw()-Overload for OLE2 (Sfx) --------------------------------------------------------------------*/ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup, sal_uInt16 nAspect ) { - //fix #25341# Draw sollte das Modified nicht beeinflussen + //fix #25341# Draw should not affect the Modified sal_Bool bResetModified; if ( sal_True == (bResetModified = IsEnableSetModified()) ) EnableSetModified( sal_False ); - //sollte am Document ein JobSetup haengen, dann kopieren wir uns diesen, - //um nach dem PrtOle2 diesen wieder am Doc zu verankern. - //Einen leeren JobSetup setzen wir nicht ein, denn der wuerde nur zu - //fragwuerdigem Ergebnis nach teurer Neuformatierung fuehren (Preview!) + // 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 + // that would only lead to questionable results after expensive + // reformatting (Preview!) JobSetup *pOrig = 0; if ( rSetup.GetPrinterName().Len() && ASPECT_THUMBNAIL != nAspect ) { pOrig = const_cast<JobSetup*>(pDoc->getJobsetup()); - if( pOrig ) // dann kopieren wir uns den + if( pOrig ) // then we copy that pOrig = new JobSetup( *pOrig ); pDoc->setJobsetup( rSetup ); } @@ -894,7 +870,7 @@ void SwDocShell::SetVisArea( const Rectangle &rRect ) nMoveY = aRect.Top() < 0 ? -aRect.Top() : 0; aRect.Move( nMoveX, nMoveY ); - //Ruft das SfxInPlaceObject::SetVisArea()! + // Calls SfxInPlaceObject::SetVisArea()! pView->SetVisArea( aRect, sal_True ); } else @@ -906,38 +882,12 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const { if ( nAspect == ASPECT_THUMBNAIL ) { - //PreView: VisArea auf die erste Seite einstellen. + // PreView: set VisArea to the first page. SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 1 ); SwCntntNode* pNd = pDoc->GetNodes().GoNext( &aIdx ); const SwRect aPageRect = pNd->FindPageFrmRect( sal_False, 0, sal_False ); return aPageRect.SVRect(); - - // Why does this have to be that complicated? I replaced this by the - // call of FindPageFrmRect(): - /* - //PageDesc besorgen, vom ersten Absatz oder den default. - const SwFmtPageDesc &rDesc = pNd->GetSwAttrSet().GetPageDesc(); - const SwPageDesc* pDesc = rDesc.GetPageDesc(); - if( !pDesc ) - pDesc = &const_cast<const SwDoc *>(pDoc)->GetPageDesc( 0 ); - - //Das Format wird evtl. von der virtuellen Seitennummer bestimmt. - const sal_uInt16 nPgNum = rDesc.GetNumOffset(); - const sal_Bool bOdd = nPgNum % 2 ? sal_True : sal_False; - const SwFrmFmt *pFmt = bOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt(); - if ( !pFmt ) //#40568# - pFmt = bOdd ? pDesc->GetLeftFmt() : pDesc->GetRightFmt(); - - if ( pFmt->GetFrmSize().GetWidth() == LONG_MAX ) - //Jetzt wird es aber Zeit fuer die Initialisierung - pDoc->getPrinter( true ); - - const SwFmtFrmSize& rFrmSz = pFmt->GetFrmSize(); - const Size aSz( rFrmSz.GetWidth(), rFrmSz.GetHeight() ); - const Point aPt( DOCUMENTBORDER, DOCUMENTBORDER ); - const Rectangle aRect( aPt, aSz ); - return aRect;*/ } return SfxObjectShell::GetVisArea( nAspect ); } @@ -965,7 +915,7 @@ sal_uLong SwDocShell::GetMiscStatus() const return SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE; } -// --> FME 2004-08-05 #i20883# Digital Signatures and Encryption +// #i20883# Digital Signatures and Encryption sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates ) { // get global state like HIDDENINFORMATION_DOCUMENTVERSIONS @@ -978,7 +928,7 @@ sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates ) } if ( nStates & HIDDENINFORMATION_NOTES ) { - ASSERT( GetWrtShell(), "No SwWrtShell, no information" ) + OSL_ENSURE( GetWrtShell(), "No SwWrtShell, no information" ); if ( GetWrtShell() ) { SwFieldType* pType = GetWrtShell()->GetFldType( RES_POSTITFLD, aEmptyStr ); @@ -999,12 +949,6 @@ sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates ) return nState; } -// <-- - - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ void SwDocShell::GetState(SfxItemSet& rSet) @@ -1016,23 +960,13 @@ void SwDocShell::GetState(SfxItemSet& rSet) { switch (nWhich) { - // MT: MakroChosser immer enablen, weil Neu moeglich - // case SID_BASICCHOOSER: - // { - // StarBASIC* pBasic = GetBasic(); - // StarBASIC* pAppBasic = SFX_APP()->GetBasic(); - // if ( !(pBasic->GetModules()->Count() || - // pAppBasic->GetModules()->Count()) ) - // rSet.DisableItem(nWhich); - // } - // break; case SID_PRINTPREVIEW: { sal_Bool bDisable = IsInPlaceActive(); if ( !bDisable ) { SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this); - while (pTmpFrm) // Preview suchen + while (pTmpFrm) // Look for Preview { if ( PTR_CAST(SwView, pTmpFrm->GetViewShell()) && ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)) @@ -1133,7 +1067,7 @@ void SwDocShell::GetState(SfxItemSet& rSet) } break; - default: DBG_ASSERT(!this,"Hier darfst Du nicht hinein!"); + default: OSL_ENSURE(!this,"You cannot get here!"); } nWhich = aIter.NextWhich(); @@ -1141,15 +1075,15 @@ void SwDocShell::GetState(SfxItemSet& rSet) } /*-------------------------------------------------------------------- - Beschreibung: OLE-Hdls + Description: OLE-Hdls --------------------------------------------------------------------*/ IMPL_LINK( SwDocShell, Ole2ModifiedHdl, void *, p ) { - // vom Doc wird der Status mitgegeben (siehe doc.cxx) - // Bit 0: -> alter Zustand - // Bit 1: -> neuer Zustand + // the Status is handed over from Doc (see doc.cxx) + // Bit 0: -> old state + // Bit 1: -> new state long nStatus = (long)p; if( IsEnableSetModified() ) SetModified( (nStatus & 2) ? sal_True : sal_False ); @@ -1157,7 +1091,7 @@ IMPL_LINK( SwDocShell, Ole2ModifiedHdl, void *, p ) } /*-------------------------------------------------------------------- - Beschreibung: Pool returnen Hier weil virtuelll + Description: return Pool here, because virtual --------------------------------------------------------------------*/ @@ -1181,13 +1115,13 @@ void SwDocShell::PrepareReload() ::DelAllGrfCacheEntries( pDoc ); } -// --> OD 2006-11-07 #i59688# +// #i59688# // linked graphics are now loaded on demand. // Thus, loading of linked graphics no longer needed and necessary for // the load of document being finished. void SwDocShell::LoadingFinished() { - // --> OD 2007-10-08 #i38810# + // #i38810# // Original fix fails after integration of cws xmlsec11: // interface <SfxObjectShell::EnableSetModified(..)> no longer works, because // <SfxObjectShell::FinishedLoading(..)> doesn't care about its status and @@ -1195,23 +1129,8 @@ void SwDocShell::LoadingFinished() // Thus, manuell modify the document, if its modified and its links are updated // before <FinishedLoading(..)> is called. const bool bHasDocToStayModified( pDoc->IsModified() && pDoc->LinksUpdated() ); -// // --> OD 2005-02-11 #i38810# - disable method <SetModified(..)>, if document -// // has stay in modified state, due to the update of its links during load. -// bool bResetEnableSetModified(false); -// if ( IsEnableSetModified() && -// pDoc->IsModified() && pDoc->LinksUpdated() ) -// { -// EnableSetModified( sal_False ); -// bResetEnableSetModified = true; -// } - // <-- + FinishedLoading( SFX_LOADED_ALL ); -// // --> OD 2005-02-11 #i38810# -// if ( bResetEnableSetModified ) -// { -// EnableSetModified( sal_True ); -// } -// // <-- SfxViewFrame* pVFrame = SfxViewFrame::GetFirst(this); if(pVFrame) { @@ -1220,18 +1139,17 @@ void SwDocShell::LoadingFinished() ((SwSrcView*)pShell)->Load(this); } - // --> OD 2007-10-08 #i38810# + // #i38810# if ( bHasDocToStayModified && !pDoc->IsModified() ) { pDoc->SetModified(); } - // <-- } -// eine Uebertragung wird abgebrochen (wird aus dem SFX gerufen) +// a Transfer is cancelled (is called from SFX) void SwDocShell::CancelTransfers() { - // alle Links vom LinkManager Canceln + // Cancel all links from LinkManager aFinishedTimer.Stop(); pDoc->GetLinkManager().CancelTransfers(); SfxObjectShell::CancelTransfers(); @@ -1287,33 +1205,28 @@ void SwDocShell::CalcLayoutForOLEObjects() } -// --> FME 2005-02-25 #i42634# Overwrites SfxObjectShell::UpdateLinks +// #i42634# Overwrites SfxObjectShell::UpdateLinks // This new function is necessary to trigger update of links in docs // read by the binary filter: void SwDocShell::UpdateLinks() { GetDoc()->UpdateLinks(sal_True); - // --> FME 2005-07-27 #i50703# Update footnote numbers + // #i50703# Update footnote numbers SwTxtFtn::SetUniqueSeqRefNo( *GetDoc() ); SwNodeIndex aTmp( GetDoc()->GetNodes() ); GetDoc()->GetFtnIdxs().UpdateFtn( aTmp ); - // <-- } uno::Reference< frame::XController > SwDocShell::GetController() { ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > aRet; - // --> FME 2007-10-15 #i82346# No view in page preview + // #i82346# No view in page preview if ( GetView() ) - // <-- aRet = GetView()->GetController(); return aRet; } -/* -----------------------------12.02.01 12:08-------------------------------- - - ---------------------------------------------------------------------------*/ static const char* pEventNames[] = { "OnPageCountChange", @@ -1429,3 +1342,5 @@ bool SwDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 1e8ffbbd38..49bdd982ff 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -60,6 +61,7 @@ #include <editeng/svxacorr.hxx> #include <editeng/langitem.hxx> #include <svx/fmshell.hxx> +#include <sfx2/linkmgr.hxx> #include <svtools/htmlcfg.hxx> #include <svx/ofaitem.hxx> @@ -72,8 +74,8 @@ #include <swunodef.hxx> #include <fmtcol.hxx> #include <swevent.hxx> -#include <view.hxx> // fuer die aktuelle Sicht -#include <docsh.hxx> // Dokumenterzeugung +#include <view.hxx> // for the current view +#include <docsh.hxx> // creation of documents #include <wrtsh.hxx> #include <fldbas.hxx> #include <viewopt.hxx> @@ -110,16 +112,13 @@ #include <com/sun/star/ui/dialogs/ListboxControlActions.hpp> #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp> #include "com/sun/star/ui/dialogs/TemplateDescription.hpp" -#ifdef FUTURE_VBA #include <com/sun/star/script/vba/XVBAEventProcessor.hpp> #include <com/sun/star/script/vba/VBAEventId.hpp> -#endif #include <editeng/acorrcfg.hxx> #include <SwStyleNameMapper.hxx> #include <sfx2/fcontnr.hxx> -#include "swabstdlg.hxx" #include "dialog.hrc" #include "swabstdlg.hxx" @@ -134,24 +133,24 @@ using namespace ::sfx2; extern sal_Bool FindPhyStyle( SwDoc& , const String& , SfxStyleFamily ); /*-------------------------------------------------------------------- - Beschreibung: DocInfo kreieren (virtuell) + Description: create DocInfo (virtual) --------------------------------------------------------------------*/ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog( Window *pParent, const SfxItemSet &rSet) { SfxDocumentInfoDialog* pDlg = new SfxDocumentInfoDialog(pParent, rSet); - //nur mit Statistik, wenn dieses Doc auch angezeigt wird, nicht - //aus dem Doc-Manager + //only with statistics, when this document is being shown, not + //from within the Doc-Manager SwDocShell* pDocSh = (SwDocShell*) SfxObjectShell::Current(); if( pDocSh == this ) { - //Nicht fuer SourceView. + //Not for SourceView. SfxViewShell *pVSh = SfxViewShell::Current(); if ( pVSh && !pVSh->ISA(SwSrcView) ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); pDlg->AddTabPage(TP_DOC_STAT, SW_RESSTR(STR_DOC_STAT),pFact->GetTabPageCreatorFunc( TP_DOC_STAT ),0); } } @@ -159,7 +158,7 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog( } -/// update text fields on document properties changes +// update text fields on document properties changes void SwDocShell::DoFlushDocInfo() { if ( !pDoc ) return; @@ -181,7 +180,6 @@ void SwDocShell::DoFlushDocInfo() } } -#ifdef FUTURE_VBA void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVBAEventProcessor >& xVbaEvents, const SfxHint& rHint ) { using namespace com::sun::star::script::vba::VBAEventId; @@ -200,31 +198,26 @@ void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVBAEventP } } } -#endif /*-------------------------------------------------------------------- - Beschreibung: Benachrichtigung bei geaenderter DocInfo + Description: Notification on DocInfo changes --------------------------------------------------------------------*/ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) { if( !pDoc ) { -//MA: Kommt bei der OLE-Registration vor! -// ASSERT( !this, "DocShell ist nicht richtig initialisiert!" ); return ; } -#ifdef FUTURE_VBA uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor(); if( xVbaEvents.is() ) lcl_processCompatibleSfxHint( xVbaEvents, rHint ); -#endif sal_uInt16 nAction = 0; if( rHint.ISA(SfxSimpleHint) ) { - // swithc for more actions + // switch for more actions switch( ((SfxSimpleHint&) rHint).GetId() ) { case SFX_HINT_TITLECHANGED: @@ -236,9 +229,8 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) else if( rHint.ISA(SfxEventHint) && ((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_LOADFINISHED ) { - // --> OD 2004-12-03 #i38126# - own action id + // #i38126# - own action id nAction = 3; - // <-- } if( nAction ) @@ -255,9 +247,9 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) case 2: pDoc->GetSysFldType( RES_FILENAMEFLD )->UpdateFlds(); break; - // --> OD 2004-12-03 #i38126# - own action for event LOADFINISHED + // #i38126# - own action for event LOADFINISHED // in order to avoid a modified document. - // --> OD 2005-02-01 #i41679# - Also for the instance of <SwDoc> + // #i41679# - Also for the instance of <SwDoc> // it has to be assured, that it's not modified. // Perform the same as for action id 1, but disable <SetModified>. case 3: @@ -265,21 +257,18 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) const bool bResetModified = IsEnableSetModified(); if ( bResetModified ) EnableSetModified( sal_False ); - // --> OD 2005-02-01 #i41679# + // #i41679# const bool bIsDocModified = pDoc->IsModified(); - // <-- pDoc->DocInfoChgd( ); - // --> OD 2005-02-01 #i41679# + // #i41679# if ( !bIsDocModified ) pDoc->ResetModified(); - // <-- if ( bResetModified ) EnableSetModified( sal_True ); } break; - // <-- } if( pWrtShell ) @@ -292,17 +281,16 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) } /*-------------------------------------------------------------------- - Beschreibung: Benachrichtigung Doc schliessen + Description: Notification Close Doc --------------------------------------------------------------------*/ sal_uInt16 SwDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing ) { sal_uInt16 nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing ); - if( sal_True == nRet ) //Unbedingt auf sal_True abfragen! (RET_NEWTASK) + if( sal_True == nRet ) //has to be queried against TRUE! (RET_NEWTASK) EndListening( *this ); -#ifdef FUTURE_VBA if( pDoc && IsInPrepareClose() ) { uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor(); @@ -311,30 +299,28 @@ sal_uInt16 SwDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing ) using namespace com::sun::star::script::vba::VBAEventId; uno::Sequence< uno::Any > aArgs; xVbaEvents->processVbaEvent( DOCUMENT_CLOSE, aArgs ); - } - } -#endif + } + } return nRet; } /*-------------------------------------------------------------------- - Beschreibung: Organizer + Description: Organizer --------------------------------------------------------------------*/ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, - sal_uInt16 nSourceIdx1, // SourcePool: oberste Inhaltsebene (Vorlagen/Makros) - sal_uInt16 nSourceIdx2, // Index in den Inhalt - sal_uInt16 nSourceIdx3, // Index in die Inhaltsebene - sal_uInt16 &rIdx1, // und das gleiche fuer den DestinationPool + 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 ) // falls doppelte geloescht werden, Pos zurueck + sal_uInt16 &rRemovedIdx ) // if doubles are being deleted, Pos back { - // --> OD 2005-05-10 #i48949# - actions aren't undoable. Thus, allow no undo + // #i48949# - actions aren't undoable. Thus, allow no undo // actions // Note: The undo action stack is cleared at the end of this method. ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo()); - // <-- sal_Bool bRet = sal_False; @@ -347,22 +333,22 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, SwDocStyleSheetPool* pMyPool = (SwDocStyleSheetPool*)GetStyleSheetPool(); - // wir koennen nicht in uns selbst hin und her moven + // we can't move back and forth within ourselves if( pHisPool == pMyPool ) return sal_False; if( INDEX_IGNORE == rIdx2 ) rIdx2 = pMyPool->Count(); - // erstmal auf die Such-Maske "positionieren" + // firstly "position" to the search-mask pHisPool->First(); SfxStyleSheetBase* pHisSheet = (*pHisPool)[nSourceIdx2]; - // wenn so eine Vorlage schon existiert: loeschen! + // when such a template already exists: delete! const String& rOldName = pHisSheet->GetName(); SfxStyleFamily eOldFamily( pHisSheet->GetFamily() ); - // dflt. PageDesc und StandardZeichenvorlage nie loeschen !!! + // never delete default PageDesc and Standard Charactertemplate !!! if( ( SFX_STYLE_FAMILY_PAGE == eOldFamily && const_cast<const SwDoc *>(pDoc)->GetPageDesc(0).GetName() == rOldName ) || @@ -377,20 +363,20 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, SfxStyleSheetBase* pExist; if( ::FindPhyStyle( *pDoc, rOldName, eOldFamily ) ) { - // Bug 20365: nur uebernehmen, wenn das gewuenscht ist! + // only take over, if desired! if( ERRCODE_BUTTON_OK != ErrorHandler::HandleError( *new MessageInfo( ERRCODE_SFXMSG_STYLEREPLACE, rOldName )) ) { return sal_False; } - // Da Replace den aStyleSheet-Member selbst benoetigt, muss - // das Ergebnis vom Find kopiert werden (s.u.)) + // Because Replace needs the aStyleSheet-Member itself, the result + // has to be copied from Find (see below)) rtl::Reference< SwDocStyleSheet > xExist( new SwDocStyleSheet( *(SwDocStyleSheet*)pMyPool->Find( rOldName, eOldFamily ) ) ); pMyPool->Replace( *pHisSheet, *xExist.get() ); - // An der Reihenfolge der Vorlagen im Pool aendert sich nichts. + // The ordering of the templates in the Pool is not changed. rIdx2 = rIdx1 = INDEX_IGNORE; GetDoc()->SetModified(); @@ -400,34 +386,32 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, pMyPool->SetSearchMask( eOldFamily, nMySrchMask ); - // MIB 18.12.98: SwDocStyleSheetPool::Make liefert einen - // Pointer auf SwDocStyleSheetPool::aStyleSheet zurueck. - // Der gleiche Member von SwDocStyleSheetPool::Find benutzt. - // Deshalb muss hier mit einer Kopie gearbeitet werden. - // Vorsicht: SfxStyleSheetBase::SetFollow ruft seinerseits - // ein SwDocStyleSheetPool::Find auf, do dass es nicht genuegt - // die Find-Aufrufe in dieser Methode zu eleminieren. + // SwDocStyleSheetPool::Make returns a pointer to + // SwDocStyleSheetPool::aStyleSheet that uses same members of + // SwDocStyleSheetPool::Find. Therefore a copy has to be used + // here. Attention: SfxStylessheetBase::SetFollow calls itself + // a SwDocStyleSheetPool::Find, so that it's not sufficiant to + // to eliminate the Find-calls in this method. rtl::Reference< SwDocStyleSheet > xNewSheet( new SwDocStyleSheet( (SwDocStyleSheet&)pMyPool ->Make(rOldName, eOldFamily, pHisSheet->GetMask() ) ) ); if( SFX_STYLE_FAMILY_PAGE == eOldFamily && rSource.ISA(SwDocShell) ) { - // gesondert behandeln!! + // to deal with separately!! SwPageDesc* pDestDsc = (SwPageDesc*)xNewSheet->GetPageDesc(); SwPageDesc* pCpyDsc = (SwPageDesc*)((SwDocStyleSheet*)pHisSheet)->GetPageDesc(); pDoc->CopyPageDesc( *pCpyDsc, *pDestDsc ); } else - // die neue Vorlage mit den Attributen fuellen + // populate the new templates with the attributes xNewSheet->SetItemSet( pHisSheet->GetItemSet() ); pMyPool->SetSearchMask( SFX_STYLE_FAMILY_ALL, nMySrchMask ); if( xNewSheet->IsUserDefined() || xNewSheet->IsUsed() ) { - // Benutzte und Benutzer-definierte Vorlagen werden angezeigt. - // Dshalb muss hier der Index der neuen Vorlage im Pool - // ermittelt werden. + // 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(); sal_uInt16 nIdx = 0; while( pExist ) @@ -444,18 +428,12 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, } else { - // Andere Vorlagen werden nicht angezeigt. + // Other templates are not being showed. rIdx1 = rIdx2 = INDEX_IGNORE; } -/* pMyPool->Count(); //interne Liste neu fuellen lassen!!!!! - - // suchen, um die richige Insert-Position returnen zu koennen - pMyPool->Find( rOldName, SFX_STYLE_FAMILY_ALL, nMySrchMask ); - rIdx2 = pMyPool->GetFindPos();*/ - - // wer bekommt den Neuen als Parent? wer benutzt den Neuen als Follow? - // (immer nur ueber die Instanziierten!!!) + // who gets the new one as parent? who uses the new one as Follow? + // (always using the instanciated!!!) pMyPool->SetSearchMask( eOldFamily, nMySrchMask ); pMyPool->SetOrganizerMode( sal_True ); SfxStyleSheetBase* pTestSheet = pMyPool->First(); @@ -465,21 +443,21 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, pTestSheet->HasParentSupport() && pTestSheet->GetParent() == rOldName) { - pTestSheet->SetParent(rOldName); // Verknuepfung neu aufbauen + pTestSheet->SetParent(rOldName); // establish the link newly } if (pTestSheet->GetFamily() == eOldFamily && pTestSheet->HasFollowSupport() && pTestSheet->GetFollow() == rOldName) { - pTestSheet->SetFollow(rOldName); // Verknuepfung neu aufbauen + pTestSheet->SetFollow(rOldName); // establish the link newly } pTestSheet = pMyPool->Next(); } pMyPool->SetOrganizerMode( SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); - // hat der Neue einen Parent? wenn ja, mit gleichem Namen bei uns suchen + // does the new one have a parent? if yes, search with the same name at our place. if (pHisSheet->HasParentSupport()) { const String& rParentName = pHisSheet->GetParent(); @@ -495,7 +473,7 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, } } - // hat der Neue einen Follow? wenn ja, mit gleichem Namen bei uns suchen + // does the new one have a Follow? if yes, search with the same name at our place. if (pHisSheet->HasFollowSupport()) { const String& rFollowName = pHisSheet->GetFollow(); @@ -511,11 +489,11 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, } } - // Bug 27347: alte Einstellung wieder setzen + // set old settings again pMyPool->SetSearchMask( eMyOldFamily, nMySrchMask ); - // Model geaendert - ASSERT(pDoc, "Doc fehlt"); + // Model changed + OSL_ENSURE(pDoc, "Doc missing"); GetDoc()->SetModified(); bRet = sal_True; @@ -530,22 +508,21 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, rIdx3, rRemovedIdx); - // --> OD 2005-05-10 #i48949# - actions aren't undoable and could have change + // #i48949# - actions aren't undoable and could have change // the document node array. Thus, clear the undo action stack. if (undoGuard.UndoWasEnabled()) { GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj(); } - // <-- return bRet; } /*-------------------------------------------------------------------- - Beschreibung: Vorlagen Remove + Description: template Remove --------------------------------------------------------------------*/ -sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert +sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // see Insert sal_uInt16 nIdx2, sal_uInt16 nIdx3) { @@ -555,13 +532,13 @@ sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert { SwDocStyleSheetPool* pMyPool = (SwDocStyleSheetPool*)GetStyleSheetPool(); - pMyPool->First(); // vorm Zugriff Pool aktualisieren!! + pMyPool->First(); // update Pool before access!! SfxStyleSheetBase* pMySheet = (*pMyPool)[nIdx2]; String aName( pMySheet->GetName() ); SfxStyleFamily eFamily( pMySheet->GetFamily() ); - // dflt. PageDesc und StandardZeichenvorlage nie loeschen !!! + // never delete default PageDesc and Standard Character template!!! if( ( SFX_STYLE_FAMILY_PAGE == eFamily && const_cast<const SwDoc *>(pDoc)->GetPageDesc(0).GetName() == aName ) || @@ -570,10 +547,10 @@ sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert RES_POOLCOLL_TEXT_BEGIN ] )) return sal_False; - // also loeschen + // so delete pMyPool->Remove( pMySheet ); - // jetzt noch die Parents/Follows aller Instanziierten korrigieren + // now correct the Parents/Follows of all instanciated pMyPool->SetOrganizerMode( sal_True ); SfxStyleSheetBase* pTestSheet = pMyPool->First(); while (pTestSheet) @@ -582,14 +559,14 @@ sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert pTestSheet->HasParentSupport() && pTestSheet->GetParent() == aName) { - pTestSheet->SetParent( aEmptyStr ); // Verknuepfung aufloesen + pTestSheet->SetParent( aEmptyStr ); // resolve link } if (pTestSheet->GetFamily() == eFamily && pTestSheet->HasFollowSupport() && pTestSheet->GetFollow() == aName) { - pTestSheet->SetFollow( aEmptyStr ); // Verknuepfung aufloesen + pTestSheet->SetFollow( aEmptyStr ); // resolve link } pTestSheet = pMyPool->Next(); @@ -604,17 +581,13 @@ sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert nIdx3 ); - // Model geaendert - ASSERT(pDoc, "Doc fehlt"); + // Model changed + OSL_ENSURE(pDoc, "Doc missing"); GetDoc()->SetModified(); return bRet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwDocShell::Execute(SfxRequest& rReq) { const SfxItemSet* pArgs = rReq.GetArgs(); @@ -628,10 +601,10 @@ void SwDocShell::Execute(SfxRequest& rReq) SvxSwAutoFmtFlags* pAFlags = &SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags(); SwAutoCompleteWord& rACW = SwDoc::GetAutoCompleteWords(); - sal_Bool bOldLocked = rACW.IsLockWordLstLocked(), + bool bOldLocked = rACW.IsLockWordLstLocked(), bOldAutoCmpltCollectWords = pAFlags->bAutoCmpltCollectWords; - rACW.SetLockWordLstLocked( sal_True ); + rACW.SetLockWordLstLocked( true ); SvStringsISortDtor aTmpLst; aTmpLst.Insert( &rACW.GetWordList() ); @@ -645,8 +618,6 @@ void SwDocShell::Execute(SfxRequest& rReq) // SMARTTAGS pAFlags->pSmartTagMgr = &SwSmartTagMgr::Get(); - //pApp->ExecuteSlot(aAppReq); - SfxItemSet aSet( pApp->GetPool(), SID_AUTO_CORRECT_DLG, SID_AUTO_CORRECT_DLG, SID_OPEN_SMARTTAGOPTIONS, SID_OPEN_SMARTTAGOPTIONS, 0 ); aSet.Put( aSwOptions ); @@ -720,9 +691,9 @@ void SwDocShell::Execute(SfxRequest& rReq) bSet = !bCurrent; sal_uInt16 nSlotId = 0; - if( bSet && !bFound ) // Keine gefunden, daher neue Preview anlegen + if( bSet && !bFound ) // Nothing found, so create new Preview { - //Keine neue anlegen fuer BrowseView! + // Don't create new one for BrowseView! if( !GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE) ) nSlotId = SID_VIEWSHELL1; } @@ -731,8 +702,8 @@ void SwDocShell::Execute(SfxRequest& rReq) if( nSlotId ) { - //JP 23.8.2001: Bug 91360 - PagePreView in the WebDocShell - // is found under Id ViewShell2. + // PagePreView in the WebDocShell + // is found under Id ViewShell2. if( ISA(SwWebDocShell) && SID_VIEWSHELL1 == nSlotId ) nSlotId = SID_VIEWSHELL2; @@ -813,7 +784,7 @@ void SwDocShell::Execute(SfxRequest& rReq) SwDocShell::Factory().GetFilterContainer()-> GetFilter4FilterName(String::CreateFromAscii("writer8")); - //#b6439685# make sure the default file format is also available + // make sure the default file format is also available if(bWeb) { const String sWild = ((WildCard&)pOwnFlt->GetWildcard()).GetWildCard(); @@ -821,7 +792,7 @@ void SwDocShell::Execute(SfxRequest& rReq) } bool bError = false; - //#b6439685# catch expception if wrong filter is selected - should not happen anymore + // catch expception if wrong filter is selected - should not happen anymore try { xFltMgr->setCurrentFilter( pOwnFlt->GetUIName() ); @@ -914,13 +885,13 @@ void SwDocShell::Execute(SfxRequest& rReq) break; } } -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 { sal_Bool bWeb = 0 != dynamic_cast<SwWebDocShell*>(this); - DBG_ASSERT(bWeb == sal_True, "SourceView nur in der WebDocShell"); + OSL_ENSURE(bWeb == TRUE, "SourceView only in WebDocShell"); } #endif - // die SourceView ist fuer die SwWebDocShell die 1 + // the SourceView is not the 1 for SwWebDocShell sal_uInt16 nSlot = SID_VIEWSHELL1; sal_Bool bSetModified = sal_False; SfxPrinter* pSavePrinter = 0; @@ -949,24 +920,6 @@ void SwDocShell::Execute(SfxRequest& rReq) nSlot = SID_VIEWSHELL0; } } -/* OS 10.04.97 14.20: Im Web-Writer gibt es keinen Unterschied zwischen - Export in den SourceMode und dem Speichern des Docs - else if(IsModified()) - { - sal_uInt16 nRet = QueryBox( SFX_APPWINDOW ,SW_RES(MSG_SAVE_HTML_QUERY)).Execute(); - if(RET_YES == nRet) - { - S F X _DISPATCHER().Execute(SID_SAVEDOC, - SFX_CALLMODE_SYNCHRON); - // der ReturnValue von SID_SAVEDOC ist etwas schwer verstaendlich - if(IsModified()) - nSlot = 0; - } - else if( RET_CANCEL == nRet ) - { - nSlot = 0; - } - }*/ if(nSlot) pViewFrm->GetDispatcher()->Execute(nSlot, SFX_CALLMODE_SYNCHRON); if(bSetModified) @@ -974,7 +927,7 @@ void SwDocShell::Execute(SfxRequest& rReq) if(pSavePrinter) { GetDoc()->setPrinter( pSavePrinter, true, true); - //pSavePrinter darf nicht wieder geloescht werden + //pSavePrinter must not be deleted again } pViewFrm->GetBindings().SetState(SfxBoolItem(SID_SOURCEVIEW, nSlot == SID_VIEWSHELL2)); pViewFrm->GetBindings().Invalidate( SID_BROWSER_MODE ); @@ -992,10 +945,10 @@ void SwDocShell::Execute(SfxRequest& rReq) case FN_ABSTRACT_NEWDOC: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSwInsertAbstractDlg* pDlg = pFact->CreateSwInsertAbstractDlg(0, DLG_INSERT_ABSTRACT ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(RET_OK == pDlg->Execute()) { sal_uInt8 nLevel = pDlg->GetLevel(); @@ -1019,12 +972,12 @@ void SwDocShell::Execute(SfxRequest& rReq) { uno::Reference< lang::XMultiServiceFactory > xORB = ::comphelper::getProcessServiceFactory(); uno::Reference< frame::XDispatchProvider > xProv( - xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.drawing.ModuleDispatcher")), UNO_QUERY ); + xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ModuleDispatcher"))), UNO_QUERY ); if ( xProv.is() ) { - ::rtl::OUString aCmd = ::rtl::OUString::createFromAscii( "SendOutlineToImpress" ); + ::rtl::OUString aCmd(RTL_CONSTASCII_USTRINGPARAM("SendOutlineToImpress")); uno::Reference< frame::XDispatchHelper > xHelper( - xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.frame.DispatchHelper")), UNO_QUERY ); + xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DispatchHelper"))), UNO_QUERY ); if ( xHelper.is() ) { pStrm->Seek( STREAM_SEEK_TO_END ); @@ -1042,7 +995,7 @@ void SwDocShell::Execute(SfxRequest& rReq) aLockBytes.ReadAt( 0, aSeq.getArray(), nLen, &nRead ); uno::Sequence< beans::PropertyValue > aArgs(1); - aArgs[0].Name = ::rtl::OUString::createFromAscii("RtfOutline"); + aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RtfOutline")); aArgs[0].Value <<= aSeq; xHelper->executeDispatch( xProv, aCmd, ::rtl::OUString(), 0, aArgs ); } @@ -1054,11 +1007,11 @@ void SwDocShell::Execute(SfxRequest& rReq) } else { - // Neues Dokument erzeugen. + // Create new document SfxViewFrame *pFrame = SfxViewFrame::LoadDocument( *xDocSh, 0 ); SwView *pCurrView = (SwView*) pFrame->GetViewShell(); - // Dokumenttitel setzen + // Set document's title String aTmp( SW_RES(STR_ABSTRACT_TITLE) ); aTmp += GetTitle(); xDocSh->SetTitle( aTmp ); @@ -1090,12 +1043,12 @@ void SwDocShell::Execute(SfxRequest& rReq) { uno::Reference< lang::XMultiServiceFactory > xORB = ::comphelper::getProcessServiceFactory(); uno::Reference< frame::XDispatchProvider > xProv( - xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.drawing.ModuleDispatcher")), UNO_QUERY ); + xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ModuleDispatcher"))), UNO_QUERY ); if ( xProv.is() ) { - ::rtl::OUString aCmd = ::rtl::OUString::createFromAscii( "SendOutlineToImpress" ); + ::rtl::OUString aCmd(RTL_CONSTASCII_USTRINGPARAM("SendOutlineToImpress")); uno::Reference< frame::XDispatchHelper > xHelper( - xORB->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.frame.DispatchHelper")), UNO_QUERY ); + xORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.DispatchHelper"))), UNO_QUERY ); if ( xHelper.is() ) { pStrm->Seek( STREAM_SEEK_TO_END ); @@ -1113,7 +1066,7 @@ void SwDocShell::Execute(SfxRequest& rReq) aLockBytes.ReadAt( 0, aSeq.getArray(), nLen, &nRead ); uno::Sequence< beans::PropertyValue > aArgs(1); - aArgs[0].Name = ::rtl::OUString::createFromAscii("RtfOutline"); + aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RtfOutline")); aArgs[0].Value <<= aSeq; xHelper->executeDispatch( xProv, aCmd, ::rtl::OUString(), 0, aArgs ); } @@ -1144,7 +1097,7 @@ void SwDocShell::Execute(SfxRequest& rReq) break; case SID_BROWSER_MODE: - case FN_PRINT_LAYOUT: //Fuer Web, genau umgekehrt zum BrowserMode + case FN_PRINT_LAYOUT: // for Web, inverse to BrowserMode { int eState = STATE_TOGGLE; sal_Bool bSet = sal_True; @@ -1162,8 +1115,8 @@ void SwDocShell::Execute(SfxRequest& rReq) ToggleBrowserMode(bSet, 0); - // OS: numerische Reihenfolge beachten! - static sal_uInt16 __READONLY_DATA aInva[] = + // OS: mind the numerical order! + static sal_uInt16 const aInva[] = { SID_NEWWINDOW,/*5620*/ SID_BROWSER_MODE, /*6313*/ @@ -1285,7 +1238,7 @@ void SwDocShell::Execute(SfxRequest& rReq) if( bCreateHtml ) { - // fuer HTML gibts es nur einen Filter!! + // for HTML there is only one filter!! pFlt = SwIoSystem::GetFilterOfFormat( String::CreateFromAscii("HTML"), SwWebDocShell::Factory().GetFilterContainer() ); @@ -1293,8 +1246,7 @@ void SwDocShell::Execute(SfxRequest& rReq) } else { - // Fuer Global-Dokumente bieten wir jetzt auch nur - // noch den aktuellen an. + // for Global-documents we now only offer the current one. pFlt = SwGlobalDocShell::Factory().GetFilterContainer()-> GetFilter4Extension( String::CreateFromAscii("odm") ); nStrId = STR_LOAD_GLOBAL_DOC; @@ -1318,44 +1270,6 @@ void SwDocShell::Execute(SfxRequest& rReq) { uno::Reference<XFilePickerControlAccess> xCtrlAcc(xFP, UNO_QUERY); - //#removed by zhaojianwei - - // const sal_uInt16 nCount = pDoc->GetTxtFmtColls()->Count(); - // Sequence<OUString> aListBoxEntries(nCount); - // OUString* pEntries = aListBoxEntries.getArray(); - // sal_Int32 nIdx = 0; - // sal_Int16 nSelect = 0; - // OUString sStartTemplate; - // SwTxtFmtColl *pFnd = 0, *pAny = 0; - // for(sal_uInt16 i = 0; i < nCount; ++i) - // { - // SwTxtFmtColl &rTxtColl = - // *pDoc->GetTxtFmtColls()->GetObject( i ); - // if( !rTxtColl.IsDefault() && rTxtColl.IsAtDocNodeSet() ) - // { - // //if( MAXLEVEL >= rTxtColl.GetOutlineLevel() && ( !pFnd || //#outline level,zhaojianwei - //if( rTxtColl.IsAssignedToListLevelOfOutlineStyle() && ( !pFnd || //<-end,zhaojianwei - // pFnd->GetAssignedOutlineStyleLevel() > rTxtColl.GetAssignedOutlineStyleLevel() )) - // { - // nSelect = (sal_Int16)nIdx; - // pFnd = &rTxtColl; - // sStartTemplate = rTxtColl.GetName(); - // } - // else if( !pAny ) - // pAny = &rTxtColl; - // //pEntries[nIdx++] = rTxtColl.GetName(); //#outline level,remove by zhaojianwei - // pEntries[nIdx++] = sStyles + rTxtColl.GetName(); //#outline level,add by zhaojianwei - // } - // } - // if(!sStartTemplate.getLength() && pAny) - // sStartTemplate = pAny->GetName(); - // aListBoxEntries.realloc(nIdx); - //<-end,zhaojianwei - - - //#outline level,add by zhaojianwei - ///////////////////////////////////////////////////////////////////// - bool bOutline[MAXLEVEL] = {false}; const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds(); if( rOutlNds.Count() ) @@ -1394,8 +1308,6 @@ void SwDocShell::Execute(SfxRequest& rReq) aListBoxEntries.realloc(nIdx); sal_Int16 nSelect = 0; - ///////////////////////////////////////////////////////////////////// - //<-end,zhaojianwei try { @@ -1411,7 +1323,7 @@ void SwDocShell::Execute(SfxRequest& rReq) } catch(Exception& ) { - DBG_ERROR("control acces failed"); + OSL_ENSURE(false, "control acces failed"); } xFP->setTitle( SW_RESSTR( nStrId )); @@ -1425,21 +1337,18 @@ void SwDocShell::Execute(SfxRequest& rReq) ListboxControlActions::GET_SELECTED_ITEM ); OUString sTmpl; aTemplateValue >>= sTmpl; - //aTemplateName = sTmpl; //#outline level,removed by zhaojianwei - //#outline level,add by zhaojianwei sal_Int32 nColonPos = sTmpl.indexOf( sal_Unicode(':') ); OUString sPrefix = sTmpl.copy( 0L, nColonPos ); - if( sPrefix.equalsAscii("Style")) + if( sPrefix.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Style"))) { aTemplateName = sTmpl.copy( 7L ); //get string behind "Style: " } - else if( sPrefix.equalsAscii("Outline")) + else if( sPrefix.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Outline"))) { nTemplateOutlineLevel = ( sTmpl.copy( 15L )).toInt32(); //get string behind "Outline: Leve "; bCreateByOutlineLevel = true; } - //<-end,zhaojianwei if ( aFileName.Len() ) { @@ -1451,22 +1360,15 @@ void SwDocShell::Execute(SfxRequest& rReq) } } - //const SwTxtFmtColl* pSplitColl = 0; //#outline level,removed by zhaojianwei - // if ( aTemplateName.Len() ) - // pSplitColl = pDoc->FindTxtFmtCollByName(aTemplateName); - //<-end,zhaojianwei if( aFileName.Len() ) { if( PrepareClose( sal_False ) ) { SwWait aWait( *this, sal_True ); - //bDone = bCreateHtml //#outline level,removed by zhaojianwei - // ? pDoc->GenerateHTMLDoc( aFileName, pSplitColl ) - // : pDoc->GenerateGlobalDoc( aFileName, pSplitColl ); - if ( bCreateByOutlineLevel ) //add by zhaojianwei + if ( bCreateByOutlineLevel ) { - bDone = bCreateHtml //#outline level,removed by zhaojianwei + bDone = bCreateHtml ? pDoc->GenerateHTMLDoc( aFileName, nTemplateOutlineLevel ) : pDoc->GenerateGlobalDoc( aFileName, nTemplateOutlineLevel ); } @@ -1475,11 +1377,10 @@ void SwDocShell::Execute(SfxRequest& rReq) const SwTxtFmtColl* pSplitColl = 0; if ( aTemplateName.Len() ) pSplitColl = pDoc->FindTxtFmtCollByName(aTemplateName); - bDone = bCreateHtml //#outline level,removed by zhaojianwei + bDone = bCreateHtml ? pDoc->GenerateHTMLDoc( aFileName, pSplitColl ) : pDoc->GenerateGlobalDoc( aFileName, pSplitColl ); } - //<-end,zhaojianwei if( bDone ) { SfxStringItem aName( SID_FILE_NAME, aFileName ); @@ -1523,9 +1424,9 @@ void SwDocShell::Execute(SfxRequest& rReq) case SID_ATTR_YEAR2000: if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , sal_False, &pItem )) { - DBG_ASSERT(pItem->ISA(SfxUInt16Item), "falsches Item"); + OSL_ENSURE(pItem->ISA(SfxUInt16Item), "wrong Item"); sal_uInt16 nYear2K = ((SfxUInt16Item*)pItem)->GetValue(); - //ueber Views iterieren und den State an den FormShells setzen + // iterate over Views and put the State to FormShells SfxViewFrame* pVFrame = SfxViewFrame::GetFirst( this ); SfxViewShell* pViewShell = pVFrame ? pVFrame->GetViewShell() : 0; @@ -1543,14 +1444,38 @@ void SwDocShell::Execute(SfxRequest& rReq) } break; - default: DBG_ERROR("falscher Dispatcher"); + default: OSL_ENSURE(false, "wrong Dispatcher"); } } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ + // #FIXME - align with NEW event stuff ( if possible ) +#if 0 +void lcl_processCompatibleSfxHint( const uno::Reference< document::XVbaEventsHelper >& xVbaEventsHelper, const SfxHint& rHint ) +{ + if ( rHint.ISA( SfxEventHint ) ) + { + uno::Sequence< uno::Any > aArgs; + sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId(); + switch( nEventId ) + { + case SFX_EVENT_CREATEDOC: + { + xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_DOCUMENT_NEW, aArgs ); + break; + } + case SFX_EVENT_OPENDOC: + { + xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_DOCUMENT_OPEN, aArgs ); + break; + } + default: + { + //do nothing + } + } + } +} +#endif long SwDocShell::DdeGetData( const String& rItem, const String& rMimeType, uno::Any & rValue ) @@ -1558,30 +1483,24 @@ long SwDocShell::DdeGetData( const String& rItem, const String& rMimeType, return pDoc->GetData( rItem, rMimeType, rValue ); } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - long SwDocShell::DdeSetData( const String& rItem, const String& rMimeType, const uno::Any & rValue ) { return pDoc->SetData( rItem, rMimeType, rValue ); } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - ::sfx2::SvLinkSource* SwDocShell::DdeCreateLinkSource( const String& rItem ) { return pDoc->CreateLinkSource( rItem ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ +void SwDocShell::ReconnectDdeLink(SfxObjectShell& rServer) +{ + if ( pDoc ) { + ::sfx2::LinkManager& rLinkManager = pDoc->GetLinkManager(); + rLinkManager.ReconnectDdeLink(rServer); + } +} void SwDocShell::FillClass( SvGlobalName * pClassName, sal_uInt32 * pClipFormat, @@ -1603,15 +1522,16 @@ void SwDocShell::FillClass( SvGlobalName * pClassName, *pClipFormat = bTemplate ? SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE : SOT_FORMATSTR_ID_STARWRITER_8; *pLongUserName = SW_RESSTR(STR_WRITER_DOCUMENT_FULLTYPE); } +// #FIXME check with new Event handling +#if 0 + uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper = pDoc->GetVbaEventsHelper(); + if( xVbaEventsHelper.is() ) + lcl_processCompatibleSfxHint( xVbaEventsHelper, rHint ); +#endif *pUserName = SW_RESSTR(STR_HUMAN_SWDOC_NAME); } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwDocShell::SetModified( sal_Bool bSet ) { SfxObjectShell::SetModified( bSet ); @@ -1640,13 +1560,9 @@ void SwDocShell::SetModified( sal_Bool bSet ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwDocShell::UpdateChildWindows() { - // Flddlg ggf neu initialisieren (z.B. fuer TYP_SETVAR) + // if necessary newly initialize Flddlg (i.e. for TYP_SETVAR) if(!GetView()) return; SfxViewFrame* pVFrame = GetView()->GetViewFrame(); @@ -1655,17 +1571,14 @@ void SwDocShell::UpdateChildWindows() if( pWrp ) pWrp->ReInitDlg( this ); - // RedlineDlg ggf neu initialisieren + // if necessary newly initialize RedlineDlg SwRedlineAcceptChild *pRed = (SwRedlineAcceptChild*)pVFrame-> GetChildWindow( SwRedlineAcceptChild::GetChildWindowId() ); if( pRed ) pRed->ReInitDlg( this ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ -// --> OD 2005-08-02 #i48748# +// #i48748# class SwReloadFromHtmlReader : public SwReader { public: @@ -1677,20 +1590,23 @@ class SwReloadFromHtmlReader : public SwReader SetBaseURL( _rFilename ); } }; -// <-- + void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView ) { sal_Bool bModified = IsModified(); - // MIB 23.6.97: Die HTTP-Header-Felder muessen geloescht werden, - // sonst gibt es welche aus Meta-Tags hinter doppelt und dreifach. + // The HTTP-Header fields have to be removed, otherwise + // there are some from Meta-Tags dublicated or triplicated afterwards. ClearHeaderAttributesForSourceViewHack(); - // MIB 24.07.97: Das Dokument-Basic muss auch noch d'ran glauben ... + // The Document-Basic also bites the dust ... + // A EnterBasicCall is not needed here, because nothing is called and + // there can't be any Dok-Basic, that has not yet been loaded inside + // of an HTML document. SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get(); - //#59620# HasBasic() zeigt an, dass es schon einen BasicManager an der DocShell - // gibt. Der wurde im HTML-Import immer angelegt, wenn Macros im Quelltext - // vorhanden sind. + //#59620# HasBasic() shows, that there already is a BasicManager at the DocShell. + // That was always generated in HTML-Import, when there are + // Macros in the source code. if( pHtmlOptions && pHtmlOptions->IsStarBasic() && HasBasic()) { BasicManager *pBasicMan = GetBasicManager(); @@ -1702,7 +1618,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView StarBASIC *pBasic = pBasicMan->GetLib( --nLibCount ); if( pBasic ) { - // Die IDE benachrichtigen + // Notify the IDE SfxUsrAnyItem aShellItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, makeAny( GetModel() ) ); String aLibName( pBasic->GetName() ); SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, aLibName ); @@ -1711,7 +1627,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView SFX_CALLMODE_SYNCHRON, &aShellItem, &aLibNameItem, 0L ); - // Aus der Standard-Lib werden nur die Module geloescht + // Only the modules are deleted from the standard-lib if( nLibCount ) pBasicMan->RemoveLib( nLibCount, sal_True ); else @@ -1719,14 +1635,14 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView } } - ASSERT( pBasicMan->GetLibCount() <= 1, - "Loschen des Basics hat nicht geklappt" ); + OSL_ENSURE( pBasicMan->GetLibCount() <= 1, + "Deleting Basics didn't work" ); } } sal_Bool bWasBrowseMode = pDoc->get(IDocumentSettingAccess::BROWSE_MODE); RemoveLink(); - //jetzt muss auch das UNO-Model ueber das neue Doc informiert werden #51535# + // now also the UNO-Model has to be informed about the new Doc #51535# uno::Reference<text::XTextDocument> xDoc(GetBaseModel(), uno::UNO_QUERY); text::XTextDocument* pxDoc = xDoc.get(); ((SwXTextDocument*)pxDoc)->InitNewDoc(); @@ -1740,8 +1656,8 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView const String& rMedname = GetMedium()->GetName(); - // fix #51032#: Die HTML-Vorlage muss noch gesetzt werden - SetHTMLTemplate( *GetDoc() ); //Styles aus HTML.vor + // The HTML template still has to be set + SetHTMLTemplate( *GetDoc() ); //Styles from HTML.vor SfxViewShell* pViewShell = GetView() ? (SfxViewShell*)GetView() : SfxViewShell::Current(); @@ -1751,12 +1667,12 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView SubInitNew(); SfxMedium aMed( rStreamName, STREAM_READ, sal_False ); - // --> OD 2005-08-01 #i48748# - use class <SwReloadFromHtmlReader>, because + // #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 // the URLs of the linked graphics correctly resolved. SwReloadFromHtmlReader aReader( aMed, rMedname, pDoc ); - // <-- + aReader.Read( *ReadHTML ); const SwView* pCurrView = GetView(); @@ -1770,9 +1686,9 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView } - // MIB 23.6.97: Die HTTP-Header-Attribute wieder in die DokInfo - // uebernehmen. Die Base-URL ist hier egal, da TLX zum absolutieren die - // vom Dokument nimmt. + // Take HTTP-Header-Attibutes over into the DokInfo again. + // The Base-URL doesn't matter here because TLX uses the one from the document + // for absolutization. SetHeaderAttributesForSourceViewHack(); if(bModified && !IsReadOnly()) @@ -1781,9 +1697,6 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView pDoc->ResetModified(); } -/* -----------------------------14.12.99 16:52-------------------------------- - - ---------------------------------------------------------------------------*/ void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView ) { GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet ); @@ -1802,10 +1715,9 @@ void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView ) SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ); } - // --> FME 2005-03-16 #i44963# Good occasion to check if page sizes in + // #i44963# Good occasion to check if page sizes in // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import) GetDoc()->CheckDefaultPageFmt(); - // <-- // 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 @@ -1865,12 +1777,11 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, SwReader* pReader = 0; SwPaM* pPam = 0; - // Filter bestimmen: -// const SfxFilter* pFlt = SwIoSystem::GetFileFilter( rURL, aEmptyStr ); + // Set filter: String sFactory(String::CreateFromAscii(SwDocShell::Factory().GetShortName())); SfxFilterMatcher aMatcher( sFactory ); - //#b6445961# search for filter in WebDocShell, too + // search for filter in WebDocShell, too SfxMedium aMed( rURL, STREAM_STD_READ, sal_False ); const SfxFilter* pFlt = 0; aMatcher.DetectFilter( aMed, &pFlt, sal_False, sal_False ); @@ -1882,7 +1793,7 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, } if( aMed.IsStorage() ) { - DBG_ASSERT((pFlt ? pFlt->GetVersion() : 0) >= SOFFICE_FILEFORMAT_60, "which file version?"); + OSL_ENSURE((pFlt ? pFlt->GetVersion() : 0) >= SOFFICE_FILEFORMAT_60, "which file version?"); pRead = ReadXML; // the SW3IO - Reader need the pam/wrtshell, because only then he // insert the styles! @@ -1897,13 +1808,10 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, } else if( pFlt ) { -// if( pFlt->GetUserData().EqualsAscii( FILTER_SWG ) || -// pFlt->GetUserData().EqualsAscii( FILTER_SWGV )) -// pRead = ReadSwg; pReader = new SwReader( aMed, rURL, pDoc ); } - ASSERT( pRead, "no reader found" ); + OSL_ENSURE( pRead, "no reader found" ); if( pRead ) { pRead->GetReaderOpt().SetTxtFmts( rOpt.IsTxtFmts() ); @@ -1947,3 +1855,4 @@ SfxInPlaceClient* SwDocShell::GetIPClient( const ::svt::EmbeddedObjectRef& xObjR return pResult; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/docshdrw.cxx b/sw/source/ui/app/docshdrw.cxx index fcca30ab44..a6beb5993e 100644 --- a/sw/source/ui/app/docshdrw.cxx +++ b/sw/source/ui/app/docshdrw.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,35 +29,21 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <hintids.hxx> - -#ifndef _SVX_SVXIDS_HRC //autogen #include <svx/svxids.hrc> -#endif - - - - - - - - #include <svl/stritem.hxx> #include <svx/drawitem.hxx> #include <svx/svdmodel.hxx> #include <svx/svdoutl.hxx> #include <svx/xtable.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <doc.hxx> using namespace ::com::sun::star; /*-------------------------------------------------------------------- - Beschreibung: Document laden + Description: Load Document --------------------------------------------------------------------*/ @@ -65,7 +52,7 @@ void SwDocShell::InitDraw() SdrModel *pDrDoc = pDoc->GetDrawModel(); if( pDrDoc ) { - // Listen, bzw. Tables im ItemSet der DocShell anlegen + // create Lists and Tables DocShell's ItemSet PutItem( SvxGradientListItem( pDrDoc->GetGradientList(), SID_GRADIENT_LIST ) ); PutItem( SvxHatchListItem( pDrDoc->GetHatchList(), SID_HATCH_LIST ) ); PutItem( SvxBitmapListItem( pDrDoc->GetBitmapList(), SID_BITMAP_LIST ) ); @@ -82,3 +69,4 @@ void SwDocShell::InitDraw() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index 130c2cf124..342d0a6a0c 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <hintids.hxx> #include <svx/dialogs.hrc> @@ -105,13 +105,10 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star; using ::rtl::OUString; -/*-----------------21.09.96 15.29------------------- - ---------------------------------------------------*/ /*-------------------------------------------------------------------- - Beschreibung: Document laden + Description: Load Document --------------------------------------------------------------------*/ @@ -120,26 +117,19 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::InitNew" ); sal_Bool bRet = SfxObjectShell::InitNew( xStor ); - ASSERT( GetMapUnit() == MAP_TWIP, "map unit is not twip!" ); + OSL_ENSURE( GetMapUnit() == MAP_TWIP, "map unit is not twip!" ); sal_Bool bHTMLTemplSet = sal_False; if( bRet ) { - AddLink(); // pDoc / pIo ggf. anlegen + AddLink(); // create pDoc / pIo if applicable sal_Bool bWeb = ISA( SwWebDocShell ); if ( bWeb ) - bHTMLTemplSet = SetHTMLTemplate( *GetDoc() );//Styles aus HTML.vor + bHTMLTemplSet = SetHTMLTemplate( *GetDoc() );// Styles from HTML.vor else if( ISA( SwGlobalDocShell ) ) GetDoc()->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true); // Globaldokument -/* - //JP 12.07.95: so einfach waere es fuer die neu Mimik - pDoc->SetDefault( SvxTabStopItem( 1, - GetStar Writer App()->GetUsrPref()->GetDefTabDist(), - SVX_TAB_ADJUST_DEFAULT, - RES_PARATR_TABSTOP)); -*/ if ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) SwTransferable::InitOle( this, *pDoc ); @@ -164,7 +154,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) SubInitNew(); - // fuer alle + // for all SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig(); SfxPrinter* pPrt = pDoc->getPrinter( false ); @@ -361,7 +351,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) } /*-------------------------------------------------------------------- - Beschreibung: Ctor mit SfxCreateMode ????? + Description: Ctor with SfxCreateMode ????? --------------------------------------------------------------------*/ @@ -380,7 +370,7 @@ SwDocShell::SwDocShell( SfxObjectCreateMode eMode ) : } /*-------------------------------------------------------------------- - Beschreibung: Ctor / Dtor + Description: Ctor / Dtor --------------------------------------------------------------------*/ @@ -399,7 +389,7 @@ SwDocShell::SwDocShell( const sal_uInt64 i_nSfxCreationFlags ) : } /*-------------------------------------------------------------------- - Beschreibung: Ctor / Dtor + Description: Ctor / Dtor --------------------------------------------------------------------*/ @@ -418,7 +408,7 @@ SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ): } /*-------------------------------------------------------------------- - Beschreibung: Dtor + Description: Dtor --------------------------------------------------------------------*/ @@ -436,30 +426,28 @@ SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ): RemoveLink(); delete pFontList; - // wir als BroadCaster werden auch unser eigener Listener - // (fuer DocInfo/FileNamen/....) + // we, as BroadCaster also become our own Listener + // (for DocInfo/FileNames/....) EndListening( *this ); SvxColorTableItem* pColItem = (SvxColorTableItem*)GetItem(SID_COLOR_TABLE); - // wird nur die DocInfo fuer den Explorer gelesen, ist das Item nicht da + // when only DocInfo is read for the Explorer, the Item is not there if(pColItem) { XColorTable* pTable = pColItem->GetColorTable(); - // wurde eine neue Table angelegt, muss sie auch geloescht werden. + // when a new Table was created, it has to be deleted as well. if((void*)pTable != (void*)(XColorTable::GetStdColorTable()) ) delete pTable; } delete pOLEChildList; } -/* -----------------------------10.09.2001 15:59------------------------------ - ---------------------------------------------------------------------------*/ void SwDocShell::Init_Impl() { SetPool(&SW_MOD()->GetPool()); SetBaseModel(new SwXTextDocument(this)); - // wir als BroadCaster werden auch unser eigener Listener - // (fuer DocInfo/FileNamen/....) + // we, as BroadCaster also become our own Listener + // (for DocInfo/FileNames/....) StartListening( *this ); //position of the "Automatic" style filter for the stylist (app.src) SetAutoStyleFilterIndex(3); @@ -468,7 +456,7 @@ void SwDocShell::Init_Impl() SetMapUnit( MAP_TWIP ); } /*-------------------------------------------------------------------- - Beschreibung: AddLink + Description: AddLink --------------------------------------------------------------------*/ @@ -483,18 +471,18 @@ void SwDocShell::AddLink() } else pDoc->acquire(); - pDoc->SetDocShell( this ); // am Doc den DocShell-Pointer setzen + pDoc->SetDocShell( this ); // set the DocShell-Pointer for Doc uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY); ((SwXTextDocument*)xDoc.get())->Reactivate(this); SetPool(&pDoc->GetAttrPool()); - // am besten erst wenn eine sdbcx::View erzeugt wird !!! + // most suitably not until a sdbcx::View is created!!! pDoc->SetOle2Link(LINK(this, SwDocShell, Ole2ModifiedHdl)); } /*-------------------------------------------------------------------- - Beschreibung: neue FontList erzeugen Aenderung Drucker + Description: create new FontList Change Printer --------------------------------------------------------------------*/ @@ -503,7 +491,7 @@ void SwDocShell::UpdateFontList() if(!bInUpdateFontList) { bInUpdateFontList = true; - ASSERT(pDoc, "Kein Doc keine FontList"); + OSL_ENSURE(pDoc, "No Doc no FontList"); if( pDoc ) { delete pFontList; @@ -515,13 +503,13 @@ void SwDocShell::UpdateFontList() } /*-------------------------------------------------------------------- - Beschreibung: RemoveLink + Description: RemoveLink --------------------------------------------------------------------*/ void SwDocShell::RemoveLink() { - // Uno-Object abklemmen + // disconnect Uno-Object uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY); ((SwXTextDocument*)xDoc.get())->Invalidate(); aFinishedTimer.Stop(); @@ -537,24 +525,24 @@ void SwDocShell::RemoveLink() pDoc->SetDocShell( 0 ); if( !nRefCt ) delete pDoc; - pDoc = 0; // wir haben das Doc nicht mehr !! + pDoc = 0; // we don't have the Doc anymore!! } } void SwDocShell::InvalidateModel() { - // Uno-Object abklemmen + // disconnect Uno-Object uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY); ((SwXTextDocument*)xDoc.get())->Invalidate(); } void SwDocShell::ReactivateModel() { - // Uno-Object abklemmen + // disconnect Uno-Object uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY); ((SwXTextDocument*)xDoc.get())->Reactivate(this); } /*-------------------------------------------------------------------- - Beschreibung: Laden, Default-Format + Description: Load, Default-Format --------------------------------------------------------------------*/ @@ -565,14 +553,14 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) if( SfxObjectShell::Load( rMedium )) { RTL_LOGFILE_CONTEXT_TRACE( aLog, "after SfxInPlaceObject::Load" ); - if( pDoc ) // fuer Letzte Version !! - RemoveLink(); // das existierende Loslassen + if( pDoc ) // for last version!! + RemoveLink(); // release the existing - AddLink(); // Link setzen und Daten updaten !! + AddLink(); // set Link and update Data!! - // Das Laden - // fuer MD - ASSERT( !mxBasePool.is(), "wer hat seinen Pool nicht zerstoert?" ); + // Loading + // for MD + OSL_ENSURE( !mxBasePool.is(), "who hasn't destroyed their Pool?" ); mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); if(GetCreateMode() != SFX_CREATE_MODE_ORGANIZER) { @@ -584,9 +572,6 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) sal_uInt32 nErr = ERR_SWG_READ_ERROR; switch( GetCreateMode() ) { -// case SFX_CREATE_MODE_INTERNAL: -// nErr = 0; -// break; case SFX_CREATE_MODE_ORGANIZER: { @@ -603,12 +588,12 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) case SFX_CREATE_MODE_INTERNAL: case SFX_CREATE_MODE_EMBEDDED: { - // fuer MWERKS (Mac-Compiler): kann nicht selbststaendig casten + // for MWERKS (Mac-Compiler): can't cast autonomously SwTransferable::InitOle( this, *pDoc ); } - // SfxProgress unterdruecken, wenn man Embedded ist + // suppress SfxProgress, when we are Embedded SW_MOD()->SetEmbeddedLoadSave( sal_True ); - // kein break; + // no break; case SFX_CREATE_MODE_STANDARD: case SFX_CREATE_MODE_PREVIEW: @@ -616,7 +601,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) Reader *pReader = ReadXML; if( pReader ) { - // die DocInfo vom Doc am DocShell-Medium setzen + // set Doc's DocInfo at DocShell-Medium RTL_LOGFILE_CONTEXT_TRACE( aLog, "before ReadDocInfo" ); SwReader aRdr( rMedium, aEmptyStr, pDoc ); RTL_LOGFILE_CONTEXT_TRACE( aLog, "before Read" ); @@ -637,15 +622,15 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) pDoc->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true); } } -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 else - ASSERT( !this, "ohne Sw3Reader geht nichts" ); + OSL_ENSURE( !this, "it won't do without Sw3Reader" ); #endif } break; default: - ASSERT( !this, "Load: new CreateMode?" ); + OSL_ENSURE( !this, "Load: new CreateMode?" ); } @@ -655,30 +640,19 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); bRet = !IsError( nErr ); - // --> OD 2006-11-07 #i59688# -// // StartFinishedLoading rufen. -// if( bRet && !pDoc->IsInLoadAsynchron() && -// GetCreateMode() == SFX_CREATE_MODE_STANDARD ) -// StartLoadFinishedTimer(); if ( bRet && !pDoc->IsInLoadAsynchron() && GetCreateMode() == SFX_CREATE_MODE_STANDARD ) { LoadingFinished(); } - // <-- - // SfxProgress unterdruecken, wenn man Embedded ist + // suppress SfxProgress, when we are Embedded SW_MOD()->SetEmbeddedLoadSave( sal_False ); } return bRet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::LoadFrom" ); @@ -686,20 +660,19 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium ) if( pDoc ) RemoveLink(); - AddLink(); // Link setzen und Daten updaten !! + AddLink(); // set Link and update Data!! do { // middle check loop sal_uInt32 nErr = ERR_SWG_READ_ERROR; - //const String& rNm = pStor->GetName(); String aStreamName; aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("styles.xml")); uno::Reference < container::XNameAccess > xAccess( rMedium.GetStorage(), uno::UNO_QUERY ); if ( xAccess->hasByName( aStreamName ) && rMedium.GetStorage()->isStreamElement( aStreamName ) ) { - // Das Laden + // Loading SwWait aWait( *this, sal_True ); { - ASSERT( !mxBasePool.is(), "wer hat seinen Pool nicht zerstoert?" ); + OSL_ENSURE( !mxBasePool.is(), "who hasn't destroyed their Pool?" ); mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); if( ReadXML ) { @@ -712,25 +685,7 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium ) } else { - DBG_ERROR("Code removed!"); - /* - //TODO/LATER: looks like some binary stuff?! - // sollte es sich um eine 2. Vrolage handeln ?? - if( SvStorage::IsStorageFile( rNm ) ) - break; - - const SfxFilter* pFltr = SwIoSystem::GetFileFilter( rNm, aEmptyStr ); - if( !pFltr || !pFltr->GetUserData().EqualsAscii( FILTER_SWG )) - break; - - SfxMedium aMed( rNm, STREAM_STD_READ, sal_False ); - if( 0 == ( nErr = aMed.GetInStream()->GetError() ) ) - { - SwWait aWait( *this, sal_True ); - SwReader aRead( aMed, rNm, pDoc ); - nErr = aRead.Read( *ReadSwg ); - } - */ + OSL_ENSURE(false, "Code removed!"); } SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); @@ -746,7 +701,7 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium ) void SwDocShell::SubInitNew() { - ASSERT( !mxBasePool.is(), "wer hat seinen Pool nicht zerstoert?" ); + OSL_ENSURE( !mxBasePool.is(), "who hasn't destroyed their Pool?" ); mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); UpdateFontList(); InitDraw(); @@ -765,8 +720,8 @@ void SwDocShell::SubInitNew() 0, 0, 0 }; if(!bWeb) { - nRange[ (sizeof(nRange)/sizeof(nRange[0])) - 3 ] = RES_PARATR_TABSTOP; - nRange[ (sizeof(nRange)/sizeof(nRange[0])) - 2 ] = RES_PARATR_HYPHENZONE; + nRange[ (SAL_N_ELEMENTS(nRange)) - 3 ] = RES_PARATR_TABSTOP; + nRange[ (SAL_N_ELEMENTS(nRange)) - 2 ] = RES_PARATR_HYPHENZONE; } SfxItemSet aDfltSet( pDoc->GetAttrPool(), nRange ); @@ -816,3 +771,5 @@ void SwDocShell::SubInitNew() IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return pDoc; } const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return pDoc; } IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return pDoc; } + +/* 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 cd2dc95ed1..f3cdb11f65 100644 --- a/sw/source/ui/app/docst.cxx +++ b/sw/source/ui/app/docst.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,19 +83,13 @@ #include "app.hrc" #include <fmtui.hrc> #include "swabstdlg.hxx" -// --> OD 2008-03-27 #refactorlists# + #include <list.hxx> -// <-- #include <paratr.hxx> //#outline level,add by zhaojianwei using namespace ::com::sun::star; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) { SfxWhichIter aIter(rSet); @@ -121,14 +116,13 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) while (nWhich) { - // aktuelle Vorlage zu jeder Familie ermitteln - // + // determine current template to every family String aName; switch (nWhich) { case SID_STYLE_APPLY: - {//hier wird die Vorlage und ihre Familie an die StyleBox - //uebergeben, damit diese Familie angezeigt wird + {// here the template and its family are passed to the StyleBox + // so that this family is being showed if(pShell->IsFrmSelected()) { SwFrmFmt* pFmt = pShell->GetCurFrmFmt(); @@ -260,7 +254,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) break; default: - DBG_ERROR( "Invalid SlotId"); + OSL_ENSURE(false, "Invalid SlotId"); } nWhich = aIter.NextWhich(); } @@ -268,7 +262,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) /*-------------------------------------------------------------------- - Beschreibung: StyleSheet-Requeste auswerten + Description: evaluate StyleSheet-Requests --------------------------------------------------------------------*/ @@ -328,7 +322,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) uno::Reference< beans::XPropertySet > xInfo; xStyles->getByName( pNameItem->GetValue() ) >>= xInfo; ::rtl::OUString aUIName; - xInfo->getPropertyValue( ::rtl::OUString::createFromAscii("DisplayName") ) >>= aUIName; + xInfo->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayName")) ) >>= aUIName; if ( aUIName.getLength() ) rReq.AppendItem( SfxStringItem( SID_STYLE_APPLY, aUIName ) ); } @@ -386,7 +380,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) } else { - ASSERT( pArgs->Count(), "SfxBug ItemSet ist leer"); + OSL_ENSURE( pArgs->Count(), "SfxBug ItemSet is empty"); SwWrtShell* pShell = GetWrtShell(); if( SFX_ITEM_SET == pArgs->GetItemState(nSlot, sal_False, &pItem )) @@ -468,7 +462,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) nRet = Delete(aParam, nFamily); break; case SID_STYLE_APPLY: - // Shellwechsel in ApplyStyles + // Shell-switch in ApplyStyles nRet = ApplyStyles(aParam, nFamily, pActShell, rReq.GetModifier() ); break; case SID_STYLE_WATERCAN: @@ -488,7 +482,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) break; default: - DBG_ERROR( "Falsche Slot-Id"); + OSL_ENSURE(false, "Invalid SlotId"); } rReq.Done(); @@ -500,7 +494,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) if(bSetReturn) { - if(rReq.IsAPI()) // Basic bekommt nur sal_True oder sal_False + if(rReq.IsAPI()) // Basic only gets TRUE or FALSE rReq.SetReturnValue(SfxUInt16Item(nSlot, nRet !=0)); else rReq.SetReturnValue(SfxUInt16Item(nSlot, nRet)); @@ -509,7 +503,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) } /*-------------------------------------------------------------------- - Beschreibung: Edit + Description: Edit --------------------------------------------------------------------*/ @@ -517,7 +511,7 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn sal_Bool bNew, sal_Bool bColumn, SwWrtShell* pActShell, sal_Bool bBasic ) { - ASSERT(GetWrtShell(), "Keine Shell, keine Styles"); + OSL_ENSURE(GetWrtShell(), "No Shell, no Styles"); SfxStyleSheetBase *pStyle = 0; sal_uInt16 nRet = nMask; @@ -532,7 +526,7 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn pStyle = &mxBasePool->Make( rName, (SfxStyleFamily)nFamily, nMask ); - // die aktuellen als Parent setzen + // set the current one as Parent SwDocStyleSheet* pDStyle = (SwDocStyleSheet*)pStyle; switch( nFamily ) { @@ -618,38 +612,23 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn else { pStyle = mxBasePool->Find( rName, (SfxStyleFamily)nFamily ); - ASSERT(pStyle, "Vorlage nicht gefunden"); + OSL_ENSURE(pStyle, "Vorlage nicht gefunden"); } if(!pStyle) return sal_False; - // Dialoge zusammenstoepseln - // + // put dialogues together rtl::Reference< SwDocStyleSheet > xTmp( new SwDocStyleSheet( *(SwDocStyleSheet*)pStyle ) ); if( SFX_STYLE_FAMILY_PARA == nFamily ) { SfxItemSet& rSet = xTmp->GetItemSet(); ::SwToSfxPageDescAttr( rSet ); - // erstmal nur eine Null + // firstly only a Zero rSet.Put(SwBackgroundDestinationItem(SID_PARA_BACKGRND_DESTINATION, 0)); - // --> OD 2008-02-13 #newlistlevelattrs# // merge list level indent attributes into the item set if needed xTmp->MergeIndentAttrsOfListStyle( rSet ); - // <-- } -/* else if( SFX_STYLE_FAMILY_FRAME == nFamily ) - { - // Auskommentiert wegen Bug #45776 (per default keine Breite&Groesse in Rahmenvorlagen) - SfxItemSet& rSet = aTmp.GetItemSet(); - if( SFX_ITEM_SET != rSet.GetItemState( RES_FRM_SIZE )) - { - // dann sollten wir spaetesten hier eines anlegen - SwFrmValid aFrmDefValues; - rSet.Put( SwFmtFrmSize( ATT_VAR_SIZE, aFrmDefValues.nWidth, - aFrmDefValues.nHeight )); - } - }*/ else if( SFX_STYLE_FAMILY_CHAR == nFamily ) { SfxItemSet& rSet = xTmp->GetItemSet(); @@ -664,7 +643,7 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn } if (!bBasic) { - // vor dem Dialog wird der HtmlMode an der DocShell versenkt + // prior to the dialog the HtmlMode at the DocShell is being sunk sal_uInt16 nHtmlMode = ::GetHtmlMode(this); // In HTML mode, we do not always have a printer. In order to show @@ -679,16 +658,16 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn FieldUnit eMetric = ::GetDfltMetric(0 != (HTMLMODE_ON&nHtmlMode)); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateTemplateDialog( DLG_TEMPLATE_BASE, 0, *(xTmp.get()), nFamily, bColumn, pActShell ? pActShell : pWrtShell, bNew); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(RET_OK == pDlg->Execute()) { GetWrtShell()->StartAllAction(); - // nur bei Absatz-Vorlagen die Maske neu setzen + // newly set the mask only with paragraph-templates if( bNew ) { nRet = SFX_STYLE_FAMILY_PARA == pStyle->GetFamily() @@ -702,11 +681,9 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn { SfxItemSet aSet( *pDlg->GetOutputItemSet() ); ::SfxToSwPageDescAttr( *GetWrtShell(), aSet ); - // --> OD 2008-02-12 #newlistlevelattrs# // reset indent attributes at paragraph style, if a list style // will be applied and no indent attributes will be applied. xTmp->SetItemSet( aSet, true ); - // <-- } else { @@ -746,10 +723,9 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn if( bNew ) mxBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xTmp.get() ) ); - // JP 19.09.97: - // Dialog vorm EndAction zerstoeren - bei Seitenvorlagen kann - // muss der ItemSet zerstoert werden, damit die Cursor aus den - // Kopf-/Fusszeilen entfernt werden. Sonst kommts zu GPFs!!! + // Destroy dialog before EndAction - with page-templates the + // ItemSet must be destroyed, so that the cursors get removed + // from Headers/Footers. Otherwise "GPF" happen!!! delete pDlg; pDoc->SetModified(); @@ -764,8 +740,6 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn { if( bNew ) { - // #116530# - //pBasePool->Erase( &aTmp ); GetWrtShell()->Undo(1); pDoc->GetIDocumentUndoRedo().ClearRedo(); } @@ -777,12 +751,12 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn } else { - // vor dem Dialog wird der HtmlMode an der DocShell versenkt + // prior to the dialog the HtmlMode at the DocShell is being sunk PutItem(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(this))); GetWrtShell()->StartAllAction(); - // nur bei Absatz-Vorlagen die Maske neu setzen + // newly set the mask only with paragraph-templates if( bNew ) { nRet = SFX_STYLE_FAMILY_PARA == pStyle->GetFamily() @@ -829,7 +803,7 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn } /*-------------------------------------------------------------------- - Beschreibung: Delete + Description: Delete --------------------------------------------------------------------*/ @@ -839,7 +813,7 @@ sal_uInt16 SwDocShell::Delete(const String &rName, sal_uInt16 nFamily) if(pStyle) { - ASSERT(GetWrtShell(), "Keine Shell, keine Styles"); + OSL_ENSURE(GetWrtShell(), "No Shell, no Styles"); GetWrtShell()->StartAllAction(); mxBasePool->Remove(pStyle); @@ -851,7 +825,7 @@ sal_uInt16 SwDocShell::Delete(const String &rName, sal_uInt16 nFamily) } /*-------------------------------------------------------------------- - Beschreibung: Vorlage anwenden + Description: apply template --------------------------------------------------------------------*/ @@ -861,13 +835,14 @@ sal_uInt16 SwDocShell::ApplyStyles(const String &rName, sal_uInt16 nFamily, SwDocStyleSheet* pStyle = (SwDocStyleSheet*)mxBasePool->Find(rName, (SfxStyleFamily)nFamily); - ASSERT(pStyle, "Wo ist der StyleSheet"); + OSL_ENSURE(pStyle, "Where's the StyleSheet"); + if(!pStyle) return sal_False; SwWrtShell *pSh = pShell ? pShell : GetWrtShell(); - ASSERT( pSh, "Keine Shell, keine Styles"); + OSL_ENSURE( pSh, "No Shell, no Styles"); pSh->StartAllAction(); @@ -902,18 +877,15 @@ sal_uInt16 SwDocShell::ApplyStyles(const String &rName, sal_uInt16 nFamily, } case SFX_STYLE_FAMILY_PSEUDO: { - // --> OD 2008-02-08 #newlistlevelattrs# // reset indent attribute on applying list style - // --> OD 2008-03-17 #refactorlists# // continue list of list style const SwNumRule* pNumRule = pStyle->GetNumRule(); const String sListIdForStyle =pNumRule->GetDefaultListId(); pSh->SetCurNumRule( *pNumRule, false, sListIdForStyle, true ); - // <-- break; } default: - DBG_ERROR("Unbekannte Familie"); + OSL_ENSURE(false, "Unknown family"); } pSh->EndAllAction(); @@ -921,20 +893,22 @@ sal_uInt16 SwDocShell::ApplyStyles(const String &rName, sal_uInt16 nFamily, } /*-------------------------------------------------------------------- - Beschreibung: Giesskanne starten + Description: start watering-can --------------------------------------------------------------------*/ sal_uInt16 SwDocShell::DoWaterCan(const String &rName, sal_uInt16 nFamily) { - ASSERT(GetWrtShell(), "Keine Shell, keine Styles"); + OSL_ENSURE(GetWrtShell(), "No Shell, no Styles"); SwEditWin& rEdtWin = pView->GetEditWin(); SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate(); sal_Bool bWaterCan = !(pApply && pApply->eType != 0); + if( !rName.Len() ) bWaterCan = sal_False; + SwApplyTemplate aTemplate; aTemplate.eType = nFamily; @@ -943,7 +917,8 @@ sal_uInt16 SwDocShell::DoWaterCan(const String &rName, sal_uInt16 nFamily) SwDocStyleSheet* pStyle = (SwDocStyleSheet*)mxBasePool->Find(rName, (SfxStyleFamily)nFamily); - ASSERT(pStyle, "Wo ist der StyleSheet"); + OSL_ENSURE (pStyle, "Where's the StyleSheet"); + if(!pStyle) return nFamily; switch(nFamily) @@ -965,27 +940,26 @@ sal_uInt16 SwDocShell::DoWaterCan(const String &rName, sal_uInt16 nFamily) break; default: - DBG_ERROR( "Unbekannte Familie"); + OSL_ENSURE(false, "Unknown family"); } } else aTemplate.eType = 0; - // Template anwenden pView->GetEditWin().SetApplyTemplate(aTemplate); return nFamily; } /*-------------------------------------------------------------------- - Beschreibung: Vorlage Updaten + Description: update template --------------------------------------------------------------------*/ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWrtShell* pShell) { SwWrtShell* pCurrWrtShell = pShell ? pShell : GetWrtShell(); - ASSERT(GetWrtShell(), "Keine Shell, keine Styles"); + OSL_ENSURE(GetWrtShell(), "No Shell, no Styles"); SwDocStyleSheet* pStyle = (SwDocStyleSheet*)mxBasePool->Find(rName, (SfxStyleFamily)nFamily); @@ -1007,8 +981,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr GetWrtShell()->StartUndo(UNDO_INSFMTATTR, &aRewriter); GetWrtShell()->FillByEx(pColl); - // Vorlage auch anwenden, um harte Attributierung - // zu entfernen + // also apply template to remove hard set attributes GetWrtShell()->SetTxtFmtColl( pColl ); GetWrtShell()->EndUndo(); GetWrtShell()->EndAllAction(); @@ -1031,8 +1004,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr pFrm->SetFmtAttr( aSet ); - // Vorlage auch anwenden, um harte Attributierung - // zu entfernen + // also apply template to remove hard set attributes pCurrWrtShell->SetFrmFmt( pFrm, sal_True ); pCurrWrtShell->EndAllAction(); } @@ -1045,8 +1017,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr { pCurrWrtShell->StartAllAction(); pCurrWrtShell->FillByEx(pChar); - // Vorlage auch anwenden, um harte Attributierung - // zu entfernen + // also apply template to remove hard set attributes pCurrWrtShell->EndAllAction(); } @@ -1059,10 +1030,9 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr 0 != ( pCurRule = pCurrWrtShell->GetCurNumRule() )) { SwNumRule aRule( *pCurRule ); - // --> OD 2008-07-08 #i91400# + // #i91400# aRule.SetName( pStyle->GetNumRule()->GetName(), *(pCurrWrtShell->GetDoc()) ); - // <-- pCurrWrtShell->ChgNumRuleFmts( aRule ); } } @@ -1072,7 +1042,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr } /*-------------------------------------------------------------------- - Beschreibung: NewByExample + Description: NewByExample --------------------------------------------------------------------*/ @@ -1084,8 +1054,8 @@ sal_uInt16 SwDocShell::MakeByExample( const String &rName, sal_uInt16 nFamily, rName, (SfxStyleFamily)nFamily ); if(!pStyle) { - // JP 07.07.95: behalte die akt. Maske vom PI bei, dadurch werden - // neue sofort in den sichtbaren Bereich einsortiert + // preserve the current mask of PI, then the new one is + // immediately merged with the viewable area if( SFXSTYLEBIT_ALL == nMask || SFXSTYLEBIT_USED == nMask ) nMask = SFXSTYLEBIT_USERDEF; else @@ -1104,11 +1074,10 @@ sal_uInt16 SwDocShell::MakeByExample( const String &rName, sal_uInt16 nFamily, { pCurrWrtShell->StartAllAction(); pCurrWrtShell->FillByEx(pColl); - // Vorlage auch anwenden, um harte Attributierung - // zu entfernen + // also apply template to remove hard set attributes pColl->SetDerivedFrom(pCurrWrtShell->GetCurTxtFmtColl()); - // setze die Maske noch an der Collection: + // set the mask at the Collection: sal_uInt16 nId = pColl->GetPoolFmtId() & 0x87ff; switch( nMask & 0x0fff ) { @@ -1151,23 +1120,8 @@ sal_uInt16 SwDocShell::MakeByExample( const String &rName, sal_uInt16 nFamily, SwFrmFmt* pFFmt = pCurrWrtShell->GetCurFrmFmt(); pFrm->SetDerivedFrom( pFFmt ); - // JP 10.06.98: nur automatische Orientierungen uebernehmen -/* #61359# jetzt auch wieder alle Orientierungen - const SfxPoolItem* pItem; - if( SFX_ITEM_SET == aSet.GetItemState( RES_VERT_ORIENT, - sal_False, &pItem ) && - text::VertOrientation::NONE == ((SwFmtVertOrient*)pItem)->GetVertOrient()) - aSet.ClearItem( RES_VERT_ORIENT ); - - if( SFX_ITEM_SET == aSet.GetItemState( RES_HORI_ORIENT, - sal_False, &pItem ) && - text::HoriOrientation::NONE == ((SwFmtHoriOrient*)pItem)->GetHoriOrient()) - aSet.ClearItem( RES_HORI_ORIENT ); - */ - pFrm->SetFmtAttr( aSet ); - // Vorlage auch anwenden, um harte Attributierung - // zu entfernen + // also apply template to remove hard set attributes pCurrWrtShell->SetFrmFmt( pFrm ); pCurrWrtShell->EndAllAction(); } @@ -1201,12 +1155,12 @@ sal_uInt16 SwDocShell::MakeByExample( const String &rName, sal_uInt16 nFamily, pCurrWrtShell->GetDoc()->CopyPageDesc( rSrc, rDest ); - // PoolId darf NIE kopiert werden! + // PoolId must NEVER be copied! rDest.SetPoolFmtId( nPoolId ); rDest.SetPoolHelpId( nHId ); rDest.SetPoolHlpFileId( nHFId ); - // werden Kopf-/Fusszeilen angelegt, so gibt es kein Undo mehr! + // when Headers/Footers are created, there is no Undo anymore! pCurrWrtShell->GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj(); pCurrWrtShell->EndAllAction(); @@ -1219,10 +1173,9 @@ sal_uInt16 SwDocShell::MakeByExample( const String &rName, sal_uInt16 nFamily, SwNumRule aRule( *pCurrWrtShell->GetCurNumRule() ); String sOrigRule( aRule.GetName() ); - // --> OD 2008-07-08 #i91400# + // #i91400# aRule.SetName( pStyle->GetNumRule()->GetName(), *(pCurrWrtShell->GetDoc()) ); - // <-- pCurrWrtShell->ChgNumRuleFmts( aRule ); pCurrWrtShell->ReplaceNumRule( sOrigRule, aRule.GetName() ); @@ -1248,23 +1201,21 @@ void SwDocShell::LoadStyles( SfxObjectShell& rSource ) --------------------------------------------------*/ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, sal_Bool bPreserveCurrentDocument ) { -/* [Beschreibung] - - Diese Methode wird vom SFx gerufen, wenn aus einer Dokument-Vorlage - Styles nachgeladen werden sollen. Bestehende Styles soll dabei - "uberschrieben werden. Das Dokument mu"s daher neu formatiert werden. - Daher werden die Applikationen in der Regel diese Methode "uberladen - und in ihrer Implementierung die Implementierung der Basisklasse - rufen. +/* [Description] + + This method is called by SFx if Styles have to be reloaded from a + document-template. Existing Styles should be overwritten by that. + That's why the document has to be reformatted. Therefore applications + will usually overload this method and call the baseclass' implementation + in their implementation. */ - // ist die Source unser Document, dann uebernehmen wir das - // abpruefen selbst (wesentlich schneller und laeuft nicht ueber - // die Kruecke SfxStylePool + // When the source is our document, we do the checking ourselves + // (much quicker and doesn't use the crutch StxStylePool). if( rSource.ISA( SwDocShell )) { - //JP 28.05.99: damit die Kopf-/Fusszeilen nicht den fixen Inhalt - // der Vorlage erhalten, einmal alle FixFelder der - // Source aktualisieren + // in order for the Headers/Footers not to get the fixed content + // of the template, update all the Source's + // FixFields once. if(!bPreserveCurrentDocument) ((SwDocShell&)rSource).pDoc->SetFixFields(false, NULL); if( pWrtShell ) @@ -1279,8 +1230,8 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, sal_Bool bPreserveCurrent pDoc->ReplaceStyles( *((SwDocShell&)rSource).pDoc ); if( !bModified && pDoc->IsModified() && !pView ) { - // die View wird spaeter angelegt, ueberschreibt aber das - // Modify-Flag. Per Undo ist sowieso nichts mehr zu machen + // the View is created later, but overwrites the Modify-Flag. + // Undo doesn't work anymore anyways. pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); } } @@ -1295,18 +1246,13 @@ void SwDocShell::FormatPage( const String& rPage, sal_Bool bColumn, SwWrtShell* Edit( rPage, aEmptyStr, SFX_STYLE_FAMILY_PAGE, 0, sal_False, bColumn, pActShell); } -Bitmap SwDocShell::GetStyleFamilyBitmap( SfxStyleFamily eFamily, BmpColorMode eColorMode ) +Bitmap SwDocShell::GetStyleFamilyBitmap( SfxStyleFamily eFamily ) { if( SFX_STYLE_FAMILY_PSEUDO == eFamily ) - { - if ( eColorMode == BMP_COLOR_NORMAL ) - return Bitmap( SW_RES( BMP_STYLES_FAMILY_NUM )); - else - return Bitmap( SW_RES( BMP_STYLES_FAMILY_NUM_HC )); - } - - return SfxObjectShell::GetStyleFamilyBitmap( eFamily, eColorMode ); + return Bitmap( SW_RES( BMP_STYLES_FAMILY_NUM )); + return SfxObjectShell::GetStyleFamilyBitmap( eFamily ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx index 15f8d5ef47..6a9b7b8fe1 100644 --- a/sw/source/ui/app/docstyle.cxx +++ b/sw/source/ui/app/docstyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,15 +38,12 @@ #include <unotools/syslocale.hxx> #include <editeng/boxitem.hxx> #include <editeng/numitem.hxx> -// --> OD 2008-02-13 #newlistlevelattrs# #include <editeng/lrspitem.hxx> -// <-- #include <fmtcol.hxx> #include <uitool.hxx> #include <swmodule.hxx> #include <wrtsh.hxx> #include <docsh.hxx> -#include <errhdl.hxx> #include <frmfmt.hxx> #include <charfmt.hxx> #include <poolfmt.hxx> @@ -67,12 +65,10 @@ #include <numrule.hxx> #include <fmthdft.hxx> #include <svx/svxids.hrc> -// --> OD 2008-02-12 #newlistlevelattrs# #include <SwRewriter.hxx> -// <-- -// MD 06.02.95: Die Formatnamen in der Liste aller Namen haben als -// erstes Zeichen die Familie: +// The Format names in the list of all names have the +// following family as their first character: #define cCHAR (sal_Unicode)'c' #define cPARA (sal_Unicode)'p' @@ -80,11 +76,11 @@ #define cPAGE (sal_Unicode)'g' #define cNUMRULE (sal_Unicode)'n' -// Dieses Zeichen wird bei der Herausgabe der Namen wieder entfernt und -// die Familie wird neu generiert. +// At the names' publication, this character is removed again and the +// family is newly generated. -// Ausserdem gibt es jetzt zusaetzlich das Bit bPhysical. Ist dieses Bit -// sal_True, werden die Pool-Formatnamen NICHT mit eingetragen. +// In addition now there is the Bit bPhysical. In case this Bit is +// TRUE, the Pool-Formatnames are not being submitted. class SwImplShellAction { @@ -122,8 +118,8 @@ SwImplShellAction::~SwImplShellAction() } /*-------------------------------------------------------------------- - Beschreibung: SwCharFormate finden/anlegen - evtl. Style fuellen + Description: find/create SwCharFormate + possibly fill Style --------------------------------------------------------------------*/ SwCharFmt* lcl_FindCharFmt( SwDoc& rDoc, @@ -138,12 +134,12 @@ SwCharFmt* lcl_FindCharFmt( SwDoc& rDoc, if( !pFmt && rName == *SwStyleNameMapper::GetTextUINameArray()[ RES_POOLCOLL_STANDARD - RES_POOLCOLL_TEXT_BEGIN ] ) { - // Standard-Zeichenvorlage + // Standard-Character template pFmt = (SwCharFmt*)rDoc.GetDfltCharFmt(); } if( !pFmt && bCreate ) - { // Pool abklappern + { // explore Pool const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT); if(nId != USHRT_MAX) pFmt = rDoc.GetCharFmtFromPool(nId); @@ -168,8 +164,8 @@ SwCharFmt* lcl_FindCharFmt( SwDoc& rDoc, /*-------------------------------------------------------------------- - Beschreibung: ParaFormate finden/erzeugen - Style fuellen + Description: find/create ParaFormats + fill Style --------------------------------------------------------------------*/ SwTxtFmtColl* lcl_FindParaFmt( SwDoc& rDoc, @@ -183,7 +179,7 @@ SwTxtFmtColl* lcl_FindParaFmt( SwDoc& rDoc, { pColl = rDoc.FindTxtFmtCollByName( rName ); if( !pColl && bCreate ) - { // Pool abklappern + { // explore Pool const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL); if(nId != USHRT_MAX) pColl = rDoc.GetTxtCollFromPool(nId); @@ -211,7 +207,7 @@ SwTxtFmtColl* lcl_FindParaFmt( SwDoc& rDoc, /*-------------------------------------------------------------------- - Beschreibung: Rahmenformate + Description: Border formats --------------------------------------------------------------------*/ @@ -225,7 +221,7 @@ SwFrmFmt* lcl_FindFrmFmt( SwDoc& rDoc, { pFmt = rDoc.FindFrmFmtByName( rName ); if( !pFmt && bCreate ) - { // Pool abklappern + { // explore Pool const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT); if(nId != USHRT_MAX) pFmt = rDoc.GetFrmFmtFromPool(nId); @@ -249,7 +245,7 @@ SwFrmFmt* lcl_FindFrmFmt( SwDoc& rDoc, } /*-------------------------------------------------------------------- - Beschreibung: Seitendescriptoren + Description: Page descriptors --------------------------------------------------------------------*/ @@ -324,7 +320,6 @@ sal_uInt16 lcl_FindName( const SwPoolFmtList& rLst, SfxStyleFamily eFam, { if( rLst.Count() ) { - // suchen String sSrch( ' ' ); switch( eFam ) { @@ -364,7 +359,7 @@ sal_Bool FindPhyStyle( SwDoc& rDoc, const String& rName, SfxStyleFamily eFam ) /*-------------------------------------------------------------------- - Beschreibung: Einfuegen von Strings in die Liste der Vorlagen + Description: Add Strings to the list of templates --------------------------------------------------------------------*/ @@ -384,7 +379,7 @@ void SwPoolFmtList::Append( char cChar, const String& rStr ) } /*-------------------------------------------------------------------- - Beschreibung: Liste kompletti loeschen + Description: Erase the list completely --------------------------------------------------------------------*/ @@ -393,11 +388,9 @@ void SwPoolFmtList::Erase() DeleteAndDestroy( 0, Count() ); } -/* */ - /*-------------------------------------------------------------------- - Beschreibung: UI-seitige implementierung von StyleSheets - greift auf die Core-Engine zu + Description: UI-sided implementation of StyleSheets + uses the Core-Engine --------------------------------------------------------------------*/ SwDocStyleSheet::SwDocStyleSheet( SwDoc& rDocument, @@ -417,9 +410,7 @@ SwDocStyleSheet::SwDocStyleSheet( SwDoc& rDocument, aCoreSet(GetPool().GetPool(), RES_CHRATR_BEGIN, RES_CHRATR_END - 1, RES_PARATR_BEGIN, RES_PARATR_END - 1, - // --> OD 2008-02-25 #refactorlists# RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1, - // <-- RES_FRMATR_BEGIN, RES_FRMATR_END - 1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, SID_ATTR_PAGE, SID_ATTR_PAGE_EXT1, @@ -461,7 +452,7 @@ SwDocStyleSheet::SwDocStyleSheet( const SwDocStyleSheet& rOrg) : } /*-------------------------------------------------------------------- - Beschreibung: Zuruecksetzen + Description: Reset --------------------------------------------------------------------*/ @@ -474,7 +465,7 @@ void SwDocStyleSheet::Reset() } /*-------------------------------------------------------------------- - Beschreibung: virtuelle Methoden + Description: virtual methods --------------------------------------------------------------------*/ @@ -482,7 +473,7 @@ const String& SwDocStyleSheet::GetParent() const { if( !bPhysical ) { - // dann pruefe, ob schon im Doc vorhanden + // check if it's already in document SwFmt* pFmt = 0; SwGetPoolIdFromName eGetType; switch(nFamily) @@ -505,11 +496,11 @@ const String& SwDocStyleSheet::GetParent() const case SFX_STYLE_FAMILY_PAGE: case SFX_STYLE_FAMILY_PSEUDO: default: - return aEmptyStr; // es gibt keinen Parent + return aEmptyStr; // there's no parent } String sTmp; - if( !pFmt ) // noch nicht vorhanden, also dflt. Parent + if( !pFmt ) // not yet there, so default Parent { sal_uInt16 i = SwStyleNameMapper::GetPoolIdFromUIName( aName, eGetType ); i = ::GetPoolParent( i ); @@ -529,7 +520,7 @@ const String& SwDocStyleSheet::GetParent() const } /*-------------------------------------------------------------------- - Beschreibung: Nachfolger + Description: Follower --------------------------------------------------------------------*/ @@ -544,7 +535,7 @@ const String& SwDocStyleSheet::GetFollow() const } /*-------------------------------------------------------------------- - Beschreibung: Welche Verkettung ist moeglich + Description: What Linkage is possible --------------------------------------------------------------------*/ @@ -558,13 +549,13 @@ sal_Bool SwDocStyleSheet::HasFollowSupport() const case SFX_STYLE_FAMILY_CHAR : case SFX_STYLE_FAMILY_PSEUDO: return sal_False; default: - ASSERT(!this, "unbekannte Style-Familie"); + OSL_ENSURE(!this, "unknown style family"); } return sal_False; } /*-------------------------------------------------------------------- - Beschreibung: Parent ? + Description: Parent ? --------------------------------------------------------------------*/ @@ -596,7 +587,7 @@ sal_Bool SwDocStyleSheet::HasClearParentSupport() const } /*-------------------------------------------------------------------- - Beschreibung: textuelle Beschreibung ermitteln + Description: determine textual description --------------------------------------------------------------------*/ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) { @@ -667,7 +658,7 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) case SID_ATTR_AUTO_STYLE_UPDATE: case SID_PARA_BACKGRND_DESTINATION: case RES_PAGEDESC: - //CTL no yet supported + //CTL not yet supported case RES_CHRATR_CTL_FONT: case RES_CHRATR_CTL_FONTSIZE: case RES_CHRATR_CTL_LANGUAGE: @@ -733,8 +724,8 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) } pItem = aIter.NextItem(); } - //Sonderbehandlung fuer Umburch, Seitenvorlage und Seitenoffset - if(sBreak.Len() && !sModel.Len()) // wemm Model. dann ist Break ungueltig + // Special treatment for Break, Page template and Site offset + if(sBreak.Len() && !sModel.Len()) // when Model, break is invalid { if(aDesc.Len()) aDesc += sPlus; @@ -758,9 +749,6 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) } else if( SFX_STYLE_FAMILY_PSEUDO == nFamily ) { -// if( pNumRule ) -// return pNumRule->GetName(); - //os: was sollte man bei Numerierungen schon anzeigen? return aEmptyStr; } @@ -774,7 +762,7 @@ String SwDocStyleSheet::GetDescription() } /*-------------------------------------------------------------------- - Beschreibung: Namen setzen + Description: Set names --------------------------------------------------------------------*/ @@ -796,7 +784,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) { case SFX_STYLE_FAMILY_CHAR : { - ASSERT(pCharFmt, "SwCharFormat fehlt!"); + OSL_ENSURE(pCharFmt, "SwCharFormat missing!"); if( pCharFmt && pCharFmt->GetName() != rStr ) { pCharFmt->SetName( rStr ); @@ -806,7 +794,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) } case SFX_STYLE_FAMILY_PARA : { - ASSERT(pColl, "Collektion fehlt!"); + OSL_ENSURE(pColl, "Collection missing!"); if( pColl && pColl->GetName() != rStr ) { if (pColl->GetName().Len() > 0) @@ -820,7 +808,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) } case SFX_STYLE_FAMILY_FRAME: { - ASSERT(pFrmFmt, "FrmFmt fehlt!"); + OSL_ENSURE(pFrmFmt, "FrmFmt missing!"); if( pFrmFmt && pFrmFmt->GetName() != rStr ) { if (pFrmFmt->GetName().Len() > 0) @@ -833,13 +821,12 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) break; } case SFX_STYLE_FAMILY_PAGE : - ASSERT(pDesc, "PageDesc fehlt!"); + OSL_ENSURE(pDesc, "PageDesc missing!"); if( pDesc && pDesc->GetName() != rStr ) { - //PageDesc setzen - mit vorherigem kopieren - ist fuer das - //setzen des Namens wohl nicht notwendig. Deshalb erlauben - //wir hier mal einen cast. - // -> #116530# + // Set PageDesc - copy with earlier one - probably not + // necessary for setting the name. So here we allow a + // cast. SwPageDesc aPageDesc(*((SwPageDesc*)pDesc)); String aOldName(aPageDesc.GetName()); @@ -849,16 +836,14 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) rDoc.GetIDocumentUndoRedo().DoUndo(aOldName.Len() > 0); rDoc.ChgPageDesc(aOldName, aPageDesc); rDoc.GetIDocumentUndoRedo().DoUndo(bDoesUndo); - // <- #116530# rDoc.SetModified(); bChg = sal_True; } break; case SFX_STYLE_FAMILY_PSEUDO: - ASSERT(pNumRule, "NumRule fehlt!"); + OSL_ENSURE(pNumRule, "NumRule missing!"); - // -> #106897# if (pNumRule) { String aOldName = pNumRule->GetName(); @@ -876,25 +861,23 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) } else { - // --> OD 2008-07-08 #i91400# + // #i91400# ((SwNumRule*)pNumRule)->SetName( rStr, rDoc ); - // <-- rDoc.SetModified(); bChg = sal_True; } } - // <- #106897# break; default: - ASSERT(!this, "unbekannte Style-Familie"); + OSL_ENSURE(!this, "unknown style family"); } if( bChg ) { - rPool.First(); // interne Liste muss geupdatet werden + rPool.First(); // internal list has to be updated rPool.Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) ); SwEditShell* pSh = rDoc.GetEditShell(); if( pSh ) @@ -904,7 +887,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) } /*-------------------------------------------------------------------- - Beschreibung: Ableitungshirachie + Description: hierarchy of deduction --------------------------------------------------------------------*/ @@ -914,19 +897,19 @@ sal_Bool SwDocStyleSheet::SetParent( const String& rStr) switch(nFamily) { case SFX_STYLE_FAMILY_CHAR : - ASSERT( pCharFmt, "SwCharFormat fehlt!" ) + OSL_ENSURE( pCharFmt, "SwCharFormat missing!" ); if( 0 != ( pFmt = pCharFmt ) && rStr.Len() ) pParent = lcl_FindCharFmt(rDoc, rStr); break; case SFX_STYLE_FAMILY_PARA : - ASSERT( pColl, "Collektion fehlt!") + OSL_ENSURE( pColl, "Collektion missing!"); if( 0 != ( pFmt = pColl ) && rStr.Len() ) pParent = lcl_FindParaFmt( rDoc, rStr ); break; case SFX_STYLE_FAMILY_FRAME: - ASSERT(pFrmFmt, "FrameFormat fehlt!"); + OSL_ENSURE(pFrmFmt, "FrameFormat missing!"); if( 0 != ( pFmt = pFrmFmt ) && rStr.Len() ) pParent = lcl_FindFrmFmt( rDoc, rStr ); break; @@ -935,7 +918,7 @@ sal_Bool SwDocStyleSheet::SetParent( const String& rStr) case SFX_STYLE_FAMILY_PSEUDO: break; default: - ASSERT(!this, "unbekannte Style-Familie"); + OSL_ENSURE(!this, "unknown style family"); } sal_Bool bRet = sal_False; @@ -959,7 +942,7 @@ sal_Bool SwDocStyleSheet::SetParent( const String& rStr) } /*-------------------------------------------------------------------- - Beschreibung: Nachfolger detzen + Description: Set Follower --------------------------------------------------------------------*/ @@ -973,7 +956,7 @@ sal_Bool SwDocStyleSheet::SetFollow( const String& rStr) { case SFX_STYLE_FAMILY_PARA : { - ASSERT(pColl, "Collection fehlt!"); + OSL_ENSURE(pColl, "Collection missing!"); if( pColl ) { SwTxtFmtColl* pFollow = pColl; @@ -986,7 +969,7 @@ sal_Bool SwDocStyleSheet::SetFollow( const String& rStr) } case SFX_STYLE_FAMILY_PAGE : { - ASSERT(pDesc, "PageDesc fehlt!"); + OSL_ENSURE(pDesc, "PageDesc missing!"); if( pDesc ) { const SwPageDesc* pFollowDesc = rStr.Len() @@ -1009,14 +992,14 @@ sal_Bool SwDocStyleSheet::SetFollow( const String& rStr) case SFX_STYLE_FAMILY_PSEUDO: break; default: - ASSERT(!this, "unbekannte Style-Familie"); + OSL_ENSURE(!this, "unknwown style family"); } return sal_True; } /*-------------------------------------------------------------------- - Beschreibung: ueber Name und Family, Mask den ItemSet rausholen + Description: extract ItemSet to Name and Family, Mask --------------------------------------------------------------------*/ SfxItemSet& SwDocStyleSheet::GetItemSet() @@ -1028,8 +1011,9 @@ SfxItemSet& SwDocStyleSheet::GetItemSet() { case SFX_STYLE_FAMILY_CHAR: { - ASSERT(pCharFmt, "Wo ist das SwCharFmt"); + OSL_ENSURE(pCharFmt, "Where's SwCharFmt"); aCoreSet.Put(pCharFmt->GetAttrSet()); + if(pCharFmt->DerivedFrom()) aCoreSet.SetParent(&pCharFmt->DerivedFrom()->GetAttrSet()); } @@ -1039,26 +1023,28 @@ SfxItemSet& SwDocStyleSheet::GetItemSet() { SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); aBoxInfo.SetTable( sal_False ); - aBoxInfo.SetDist( sal_True); // Abstandsfeld immer anzeigen - aBoxInfo.SetMinDist( sal_True );// Minimalgroesse in Tabellen und Absaetzen setzen - aBoxInfo.SetDefDist( MIN_BORDER_DIST );// Default-Abstand immer setzen - // Einzelne Linien koennen nur in Tabellen DontCare-Status haben + 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, sal_True ); if ( nFamily == SFX_STYLE_FAMILY_PARA ) { - ASSERT(pColl, "Wo ist die Collektion"); + OSL_ENSURE(pColl, "Where's Collection"); aCoreSet.Put(pColl->GetAttrSet()); aCoreSet.Put( aBoxInfo ); aCoreSet.Put(SfxBoolItem(SID_ATTR_AUTO_STYLE_UPDATE, pColl->IsAutoUpdateFmt())); + if(pColl->DerivedFrom()) aCoreSet.SetParent(&pColl->DerivedFrom()->GetAttrSet()); } else { - ASSERT(pFrmFmt, "Wo ist das FrmFmt"); + OSL_ENSURE(pFrmFmt, "Where's FrmFmt"); aCoreSet.Put(pFrmFmt->GetAttrSet()); aCoreSet.Put( aBoxInfo ); aCoreSet.Put(SfxBoolItem(SID_ATTR_AUTO_STYLE_UPDATE, pFrmFmt->IsAutoUpdateFmt())); + if(pFrmFmt->DerivedFrom()) aCoreSet.SetParent(&pFrmFmt->DerivedFrom()->GetAttrSet()); } @@ -1067,29 +1053,28 @@ SfxItemSet& SwDocStyleSheet::GetItemSet() case SFX_STYLE_FAMILY_PAGE : { - ASSERT(pDesc, "Kein PageDescriptor"); + OSL_ENSURE(pDesc, "No PageDescriptor"); ::PageDescToItemSet(*((SwPageDesc*)pDesc), aCoreSet); } break; case SFX_STYLE_FAMILY_PSEUDO: { - ASSERT(pNumRule, "Keine NumRule"); + OSL_ENSURE(pNumRule, "No NumRule"); SvxNumRule aRule = pNumRule->MakeSvxNumRule(); aCoreSet.Put(SvxNumBulletItem(aRule)); } break; default: - ASSERT(!this, "unbekannte Style-Familie"); + OSL_ENSURE(!this, "unknown style family"); } - // Member der Basisklasse + // Member of Baseclass pSet = &aCoreSet; return aCoreSet; } -// --> OD 2008-02-13 #newlistlevelattrs# void SwDocStyleSheet::MergeIndentAttrsOfListStyle( SfxItemSet& rSet ) { if ( nFamily != SFX_STYLE_FAMILY_PARA ) @@ -1097,10 +1082,10 @@ void SwDocStyleSheet::MergeIndentAttrsOfListStyle( SfxItemSet& rSet ) return; } - ASSERT( pColl, "<SwDocStyleSheet::MergeIndentAttrsOfListStyle(..)> - missing paragraph style"); + OSL_ENSURE( pColl, "<SwDocStyleSheet::MergeIndentAttrsOfListStyle(..)> - missing paragraph style"); if ( pColl->AreListLevelIndentsApplicable() ) { - ASSERT( pColl->GetItemState( RES_PARATR_NUMRULE ) == SFX_ITEM_SET, + OSL_ENSURE( pColl->GetItemState( RES_PARATR_NUMRULE ) == SFX_ITEM_SET, "<SwDocStyleSheet::MergeIndentAttrsOfListStyle(..)> - list level indents are applicable at paragraph style, but no list style found. Serious defect -> please inform OD." ); const String sNumRule = pColl->GetNumRule().GetValue(); if( sNumRule.Len() ) @@ -1120,33 +1105,25 @@ void SwDocStyleSheet::MergeIndentAttrsOfListStyle( SfxItemSet& rSet ) } } } -// <-- -/*-------------------------------------------------------------------- - Beschreibung: ItemSet setzen - --------------------------------------------------------------------*/ - -// --> OD 2008-02-12 #newlistlevelattrs# // handling of parameter <bResetIndentAttrsAtParagraphStyle> void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, const bool bResetIndentAttrsAtParagraphStyle ) { - // gegebenenfalls Format erst ermitteln + // if applicable determine format first if(!bPhysical) FillStyleSheet( FillPhysical ); SwImplShellAction aTmpSh( rDoc ); - ASSERT( &rSet != &aCoreSet, "SetItemSet mit eigenem Set ist nicht erlaubt" ); + OSL_ENSURE( &rSet != &aCoreSet, "SetItemSet with own Set is not allowed" ); - // --> OD 2008-02-12 #newlistlevelattrs# if (rDoc.GetIDocumentUndoRedo().DoesUndo()) { SwRewriter aRewriter; aRewriter.AddRule( UNDO_ARG1, GetName() ); rDoc.GetIDocumentUndoRedo().StartUndo( UNDO_INSFMTATTR, &aRewriter ); } - // <-- SwFmt* pFmt = 0; SwPageDesc* pNewDsc = 0; @@ -1156,14 +1133,14 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, { case SFX_STYLE_FAMILY_CHAR : { - ASSERT(pCharFmt, "Wo ist das CharFormat"); + OSL_ENSURE(pCharFmt, "Where's CharFormat"); pFmt = pCharFmt; } break; case SFX_STYLE_FAMILY_PARA : { - ASSERT(pColl, "Wo ist die Collection"); + OSL_ENSURE(pColl, "Where's Collection"); const SfxPoolItem* pAutoUpdate; if(SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE,sal_False, &pAutoUpdate )) { @@ -1192,24 +1169,23 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, } } - // Document auf die neue Bedingungen updaten + // Update document to new conditions SwCondCollCondChg aMsg( pColl ); pColl->Modify( &aMsg, &aMsg ); } else if( pCondItem && !pColl->GetDepends() ) { - // keine bedingte Vorlage, dann erstmal erzeugen und - // alle wichtigen Werte uebernehmen + // no conditional template, then first create and adopt + // all important values SwConditionTxtFmtColl* pCColl = rDoc.MakeCondTxtFmtColl( pColl->GetName(), (SwTxtFmtColl*)pColl->DerivedFrom() ); if( pColl != &pColl->GetNextTxtFmtColl() ) pCColl->SetNextTxtFmtColl( pColl->GetNextTxtFmtColl() ); - //pCColl->SetOutlineLevel( pColl->GetOutlineLevel() );//#outline level,zhaojianwei if( pColl->IsAssignedToListLevelOfOutlineStyle()) pCColl->AssignToListLevelOfOutlineStyle(pColl->GetAssignedOutlineStyleLevel()); else - pCColl->DeleteAssignmentToListLevelOfOutlineStyle();//<--end,zhaojianwei + pCColl->DeleteAssignmentToListLevelOfOutlineStyle(); @@ -1229,7 +1205,6 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, rDoc.DelTxtFmtColl( pColl ); pColl = pCColl; } - // --> OD 2008-02-12 #newlistlevelattrs# if ( bResetIndentAttrsAtParagraphStyle && rSet.GetItemState( RES_PARATR_NUMRULE, sal_False, 0 ) == SFX_ITEM_SET && rSet.GetItemState( RES_LR_SPACE, sal_False, 0 ) != SFX_ITEM_SET && @@ -1237,7 +1212,6 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, { rDoc.ResetAttrAtFormat( RES_LR_SPACE, *pColl ); } - // <-- // #i56252: If a standard numbering style is assigned to a standard paragraph style // we have to create a physical instance of the numbering style. If we do not and @@ -1291,7 +1265,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, } case SFX_STYLE_FAMILY_FRAME: { - ASSERT(pFrmFmt, "Wo ist das FrmFmt"); + OSL_ENSURE(pFrmFmt, "Where's FrmFmt"); const SfxPoolItem* pAutoUpdate; if(SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE,sal_False, &pAutoUpdate )) { @@ -1303,7 +1277,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, case SFX_STYLE_FAMILY_PAGE : { - ASSERT(pDesc, "Wo ist der PageDescriptor"); + OSL_ENSURE(pDesc, "Where's PageDescriptor"); if( rDoc.FindPageDescByName( pDesc->GetName(), &nPgDscPos )) { @@ -1321,7 +1295,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, case SFX_STYLE_FAMILY_PSEUDO: { - ASSERT(pNumRule, "Wo ist die NumRule"); + OSL_ENSURE(pNumRule, "Where's NumRule"); if (!pNumRule) break; @@ -1333,22 +1307,18 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, { SvxNumRule* pSetRule = ((SvxNumBulletItem*)pItem)->GetNumRule(); pSetRule->UnLinkGraphics(); - //SwNumRule aSetRule(rDoc.GetUniqueNumRuleName()); SwNumRule aSetRule(*pNumRule); aSetRule.SetSvxRule(*pSetRule, &rDoc); rDoc.ChgNumRuleFmts( aSetRule ); } break; case SFX_ITEM_DONTCARE: - // NumRule auf default Werte - // was sind die default Werte? + // set NumRule to default values + // what are the default values? { - // --> OD 2008-02-11 #newlistlevelattrs# SwNumRule aRule( pNumRule->GetName(), - // --> OD 2008-06-06 #i89178# + // #i89178# numfunc::GetDefaultPositionAndSpaceMode() ); - // <-- - // <-- rDoc.ChgNumRuleFmts( aRule ); } break; @@ -1357,7 +1327,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, break; default: - ASSERT(!this, "unbekannte Style-Familie"); + OSL_ENSURE(!this, "unknown style family"); } if( pFmt && rSet.Count()) @@ -1366,12 +1336,10 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, const SfxPoolItem* pItem = aIter.GetCurItem(); while( sal_True ) { - if( IsInvalidItem( pItem ) ) // Clearen + if( IsInvalidItem( pItem ) ) // Clear { - // --> OD 2008-02-12 #newlistlevelattrs# // use method <SwDoc::ResetAttrAtFormat(..)> in order to // create an Undo object for the attribute reset. -// pFmt->ResetAttr( rSet.GetWhichByPos(aIter.GetCurPos())); rDoc.ResetAttrAtFormat( rSet.GetWhichByPos(aIter.GetCurPos()), *pFmt ); } @@ -1394,24 +1362,22 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, delete pNewDsc; } else - rDoc.ChgFmt(*pFmt, aSet); // alles gesetzten Putten + rDoc.ChgFmt(*pFmt, aSet); // put all that is set } else { aCoreSet.ClearItem(); - if( pNewDsc ) // den muessen wir noch vernichten!! + if( pNewDsc ) // we still need to delete it { rDoc.PreDelPageDesc(pNewDsc); // #i7983# delete pNewDsc; } } - // --> OD 2008-02-12 #newlistlevelattrs# if (rDoc.GetIDocumentUndoRedo().DoesUndo()) { rDoc.GetIDocumentUndoRedo().EndUndo(UNDO_END, 0); } - // <-- } void lcl_SaveStyles( sal_uInt16 nFamily, SvPtrarr& rArr, SwDoc& rDoc ) @@ -1557,7 +1523,7 @@ void lcl_DeleteInfoStyles( sal_uInt16 nFamily, SvPtrarr& rArr, SwDoc& rDoc ) } /*-------------------------------------------------------------------- - Beschreibung: Das Format ermitteln + Description: determine the format --------------------------------------------------------------------*/ sal_Bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) @@ -1726,7 +1692,7 @@ sal_Bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) if( pFmt ) { - ASSERT( bPhysical, "Format nicht gefunden" ); + OSL_ENSURE( bPhysical, "Format not found" ); nHelpId = pFmt->GetPoolHelpId(); if( pFmt->GetPoolHlpFileId() != UCHAR_MAX ) @@ -1746,7 +1712,7 @@ sal_Bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType ) } /*-------------------------------------------------------------------- - Beschreibung: Neues Format in der Core anlegen + Description: Create new format in Core --------------------------------------------------------------------*/ @@ -1794,24 +1760,19 @@ void SwDocStyleSheet::Create() pNumRule = lcl_FindNumRule( rDoc, aName ); if( !pNumRule ) { - //JP 05.02.99: temp Namen erzeugen, damit kein ASSERT kommt String sTmpNm( aName ); if( !aName.Len() ) sTmpNm = rDoc.GetUniqueNumRuleName(); - // --> OD 2008-02-11 #newlistlevelattrs# SwNumRule* pRule = rDoc.GetNumRuleTbl()[ rDoc.MakeNumRule( sTmpNm, 0, sal_False, - // --> OD 2008-06-06 #i89178# + // #i89178# numfunc::GetDefaultPositionAndSpaceMode() ) ]; - // <-- - // <-- pRule->SetAutoRule( sal_False ); if( !aName.Len() ) { - // --> OD 2008-07-08 #i91400# + // #i91400# pRule->SetName( aName, rDoc ); - // <-- } pNumRule = pRule; } @@ -1822,12 +1783,6 @@ void SwDocStyleSheet::Create() aCoreSet.ClearItem(); } -/*-------------------------------------------------------------------- - Beschreibung: Konkrete Formate rausholen - --------------------------------------------------------------------*/ - - - SwCharFmt* SwDocStyleSheet::GetCharFmt() { if(!bPhysical) @@ -1835,7 +1790,6 @@ SwCharFmt* SwDocStyleSheet::GetCharFmt() return pCharFmt; } - SwTxtFmtColl* SwDocStyleSheet::GetCollection() { if(!bPhysical) @@ -1843,7 +1797,6 @@ SwTxtFmtColl* SwDocStyleSheet::GetCollection() return pColl; } - const SwPageDesc* SwDocStyleSheet::GetPageDesc() { if(!bPhysical) @@ -1860,12 +1813,12 @@ const SwNumRule * SwDocStyleSheet::GetNumRule() void SwDocStyleSheet::SetNumRule(const SwNumRule& rRule) { - DBG_ASSERT(pNumRule, "Wo ist die NumRule"); + OSL_ENSURE(pNumRule, "Wo ist die NumRule"); rDoc.ChgNumRuleFmts( rRule ); } -// Namen UND Familie aus String re-generieren -// First() und Next() (s.u.) fuegen einen Kennbuchstaben an Pos.1 ein +// re-generate Name AND Family from String +// First() and Next() (see below) insert an identification letter at Pos.1 void SwDocStyleSheet::PresetNameAndFamily(const String& rName) { @@ -1882,7 +1835,7 @@ void SwDocStyleSheet::PresetNameAndFamily(const String& rName) } /*-------------------------------------------------------------------- - Beschreibung: Ist das Format physikalisch schon vorhanden + Description: Is the format physically present yet --------------------------------------------------------------------*/ @@ -1906,7 +1859,6 @@ SwFrmFmt* SwDocStyleSheet::GetFrmFmt() return pFrmFmt; } - sal_Bool SwDocStyleSheet::IsUsed() const { if( !bPhysical ) @@ -1915,7 +1867,6 @@ sal_Bool SwDocStyleSheet::IsUsed() const pThis->FillStyleSheet( FillOnlyName ); } - // immer noch nicht ? if( !bPhysical ) return sal_False; @@ -1931,7 +1882,7 @@ sal_Bool SwDocStyleSheet::IsUsed() const return pNumRule ? rDoc.IsUsed( *pNumRule ) : sal_False; default: - ASSERT(!this, "unbekannte Style-Familie"); + OSL_ENSURE(!this, "unknown style family"); return sal_False; } return rDoc.IsUsed( *pMod ); @@ -2008,7 +1959,7 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp"); break; default: - ASSERT(!this, "unbekannte Style-Familie"); + OSL_ENSURE(!this, "unknown style family"); return 0; } @@ -2024,7 +1975,6 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp"); const String *pTemplate = rDoc.GetDocPattern( nFileId ); if( pTemplate ) { -// const String aHelpPath(MakeHelpPath(*pTemplate)); rFile = *pTemplate; } } @@ -2033,9 +1983,9 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp"); nId = nPoolId; } - // weil sich der SFX so anstellt mit der HilfeId: + // because SFX acts like that, with HelpId: if( USHRT_MAX == nId ) - nId = 0; // entsp. keine Hilfe anzeigen + nId = 0; // don't show Help accordingly return nId; } @@ -2044,7 +1994,7 @@ static String sTemplateHelpFile = String::CreateFromAscii("swrhlppi.hlp"); void SwDocStyleSheet::SetHelpId( const String& r, sal_uLong nId ) { sal_uInt8 nFileId = static_cast< sal_uInt8 >(rDoc.SetDocPattern( r )); - sal_uInt16 nHId = static_cast< sal_uInt16 >(nId); //!! SFX hat eigenmaechtig auf sal_uLong umgestellt! + sal_uInt16 nHId = static_cast< sal_uInt16 >(nId); //!! SFX changed over to ULONG arbitrarily! SwFmt* pTmpFmt = 0; switch( nFamily ) @@ -2063,7 +2013,7 @@ void SwDocStyleSheet::SetHelpId( const String& r, sal_uLong nId ) break; default: - ASSERT(!this, "unbekannte Style-Familie"); + OSL_ENSURE(!this, "unknown style family"); return ; } if( pTmpFmt ) @@ -2073,11 +2023,8 @@ void SwDocStyleSheet::SetHelpId( const String& r, sal_uLong nId ) } } - -/* */ - /*-------------------------------------------------------------------- - Beschreibung: Methoden fuer den DocStyleSheetPool + Description: methods for DocStyleSheetPool --------------------------------------------------------------------*/ SwDocStyleSheetPool::SwDocStyleSheetPool( SwDoc& rDocument, sal_Bool bOrg ) @@ -2122,7 +2069,7 @@ SfxStyleSheetBase& SwDocStyleSheetPool::Make( SfxStyleSheetBase* SwDocStyleSheetPool::Create( const SfxStyleSheetBase& /*rOrg*/) { - ASSERT(!this , "Create im SW-Stylesheet-Pool geht nicht" ); + OSL_ENSURE(!this , "Create im SW-Stylesheet-Pool geht nicht" ); return NULL; } @@ -2130,7 +2077,7 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Create( const SfxStyleSheetBase& /*rOr SfxStyleSheetBase* SwDocStyleSheetPool::Create( const String &, SfxStyleFamily, sal_uInt16 ) { - ASSERT( !this, "Create im SW-Stylesheet-Pool geht nicht" ); + OSL_ENSURE( !this, "Create im SW-Stylesheet-Pool geht nicht" ); return NULL; } @@ -2164,7 +2111,7 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource, sal_Bool bSwSrcPool = GetAppName() == rSource.GetPool().GetAppName(); if( SFX_STYLE_FAMILY_PAGE == eFamily && bSwSrcPool ) { - // gesondert behandeln!! + // deal with separately! SwPageDesc* pDestDsc = (SwPageDesc*)((SwDocStyleSheet&)rTarget).GetPageDesc(); SwPageDesc* pCpyDsc = @@ -2207,8 +2154,8 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource, } break; case SFX_STYLE_FAMILY_PSEUDO: - // Eine NumRule besteht nur aus einem Item, also muss man - // hier nichts loeschen. + // A NumRule only consists of one Item, so nothing has + // to be deleted here. break; default:; //prevent warning } @@ -2287,13 +2234,13 @@ void SwDocStyleSheetPool::Remove( SfxStyleSheetBase* pStyle) case SFX_STYLE_FAMILY_PSEUDO: { if( !rDoc.DelNumRule( rName ) ) - // Broadcast nur versenden, wenn etwas geloescht wurde + // Only send Broadcast, when something was deleted bBroadcast = sal_False; } break; default: - ASSERT(!this, "unbekannte Style-Familie"); + OSL_ENSURE(!this, "unknown style family"); bBroadcast = sal_False; } @@ -2329,7 +2276,7 @@ sal_Bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam, break; default: - ASSERT(!this, "unbekannte Style-Familie"); + OSL_ENSURE(!this, "unknown style family"); } sal_Bool bRet = sal_False; @@ -2343,7 +2290,7 @@ sal_Bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam, if( bRet ) { - // nur fuer das Broadcasting + // only for Broadcasting mxStyleSheet->PresetName( rStyle ); mxStyleSheet->PresetParent( rParent ); if( SFX_STYLE_FAMILY_PARA == eFam ) @@ -2366,7 +2313,7 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const String& rName, sal_uInt16 nSMask = n; if( SFX_STYLE_FAMILY_PARA == eFam && rDoc.get(IDocumentSettingAccess::HTML_MODE) ) { - // dann sind nur HTML-Vorlagen von Interesse + // then only HTML-Templates are of interest if( USHRT_MAX == nSMask ) nSMask = SWSTYLEBIT_HTML | SFXSTYLEBIT_USERDEF | SFXSTYLEBIT_USED; else @@ -2412,18 +2359,18 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const String& rName, !(bSearchUsed && (bOrganizer || rDoc.IsUsed(*pRule)) ) && (( nSMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF ? !(pRule->GetPoolFmtId() & USER_FMT) - // benutzte gesucht und keine gefunden + // searched for used and found none : bSearchUsed )) bFnd = sal_False; } break; default: - ASSERT(!this, "unbekannte Style-Familie"); + OSL_ENSURE(!this, "unknown style family"); } } - // dann noch die Maske auswerten: + // then evaluate the mask: if( pMod && !(bSearchUsed && (bOrganizer || rDoc.IsUsed(*pMod)) ) ) { const sal_uInt16 nId = SFX_STYLE_FAMILY_PAGE == eFam @@ -2432,15 +2379,13 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const String& rName, if( ( nSMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF ? !(nId & USER_FMT) - // benutzte gesucht und keine gefunden + // searched for used and found none : bSearchUsed ) bFnd = sal_False; } return bFnd ? mxStyleSheet.get() : 0; } -/* */ - SwStyleSheetIterator::SwStyleSheetIterator( SwDocStyleSheetPool* pBase, SfxStyleFamily eFam, sal_uInt16 n ) : SfxStyleSheetIterator( pBase, eFam, n ), @@ -2459,7 +2404,7 @@ SwStyleSheetIterator::SwStyleSheetIterator( SwDocStyleSheetPool* pBase, sal_uInt16 SwStyleSheetIterator::Count() { - // Liste richtig fuellen lassen !! + // let the list fill correctly!! if( !bFirstCalled ) First(); return aLst.Count(); @@ -2467,7 +2412,7 @@ sal_uInt16 SwStyleSheetIterator::Count() SfxStyleSheetBase* SwStyleSheetIterator::operator[]( sal_uInt16 nIdx ) { - // gefunden + // found if( !bFirstCalled ) First(); mxStyleSheet->PresetNameAndFamily( *aLst[ nIdx ] ); @@ -2479,12 +2424,12 @@ SfxStyleSheetBase* SwStyleSheetIterator::operator[]( sal_uInt16 nIdx ) SfxStyleSheetBase* SwStyleSheetIterator::First() { - // Alte Liste loeschen + // Delete old list bFirstCalled = sal_True; nLastPos = 0; aLst.Erase(); - // aktuellen loeschen + // Delete current mxIterSheet->Reset(); SwDoc& rDoc = ((SwDocStyleSheetPool*)pBasePool)->GetDoc(); @@ -2506,13 +2451,13 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() const sal_Bool bUsed = bIsSearchUsed && (bOrganizer || rDoc.IsUsed(*pFmt)); if( !bUsed ) { - // Standard ist keine Benutzervorlage #46181# + // Standard is no User template const sal_uInt16 nId = rDoc.GetDfltCharFmt() == pFmt ? sal_uInt16( RES_POOLCHR_INET_NORMAL ): pFmt->GetPoolFmtId(); if( (nSrchMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF ? !(nId & USER_FMT) - // benutzte gesucht und keine gefunden + // searched for used and found none : bIsSearchUsed ) continue; @@ -2561,7 +2506,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() sal_uInt16 nSMask = nSrchMask; if( rDoc.get(IDocumentSettingAccess::HTML_MODE) ) { - // dann sind nur HTML-Vorlagen von Interesse + // then only HTML-Template are of interest if( USHRT_MAX == nSMask ) nSMask = SWSTYLEBIT_HTML | SFXSTYLEBIT_USERDEF | SFXSTYLEBIT_USED; @@ -2604,15 +2549,14 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() case SWSTYLEBIT_EXTRA: if((nId & COLL_GET_RANGE_BITS) != COLL_EXTRA_BITS) continue; break; - case SWSTYLEBIT_HTML | SFXSTYLEBIT_USERDEF: if(IsPoolUserFmt(nId)) break; - // ansonten weiter + // otherwise move on case SWSTYLEBIT_HTML: if( (nId & COLL_GET_RANGE_BITS) != COLL_HTML_BITS) { - // einige wollen wir aber auch in dieser Section sehen + // but some we also want to see in this section sal_Bool bWeiter = sal_True; switch( nId ) { @@ -2641,7 +2585,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() if( RES_CONDTXTFMTCOLL != pColl->Which() ) continue; break; default: - // benutzte gesucht und keine gefunden + // searched for used and found none if( bIsSearchUsed ) continue; } @@ -2681,7 +2625,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() bIsSearchUsed, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, cPARA ) ; if( !bAll ) { - // dann auch die, die wir mappen: + // then also the ones, that we are mapping: static sal_uInt16 aPoolIds[] = { RES_POOLCOLL_SENDADRESS, // --> ADDRESS RES_POOLCOLL_TABLE_HDLN, // --> TH @@ -2732,7 +2676,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() { if( (nSrchMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF ? !(nId & USER_FMT) - // benutzte gesucht und keine gefunden + // searched for used and found none : bIsSearchUsed ) { continue; @@ -2763,7 +2707,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() { if( (nSrchMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF ? !(nId & USER_FMT) - // benutzte gesucht und keine gefunden + // searched for used and found none : bIsSearchUsed ) continue; } @@ -2789,7 +2733,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() { if( (nSrchMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF ? !(rRule.GetPoolFmtId() & USER_FMT) - // benutzte gesucht und keine gefunden + // searched for used and found none : bIsSearchUsed ) continue; } @@ -2830,16 +2774,16 @@ SfxStyleSheetBase* SwStyleSheetIterator::Next() SfxStyleSheetBase* SwStyleSheetIterator::Find( const UniString& rName ) { - // suchen + // searching if( !bFirstCalled ) First(); nLastPos = lcl_FindName( aLst, nSearchFamily, rName ); if( USHRT_MAX != nLastPos ) { - // gefunden + // found mxStyleSheet->PresetNameAndFamily(*aLst[nLastPos]); - // neuer Name gesetzt, also bestimme seine Daten + // new name is set, so determine its Data mxStyleSheet->FillStyleSheet( SwDocStyleSheet::FillOnlyName ); if( !mxStyleSheet->IsPhysical() ) mxStyleSheet->SetPhysical( sal_False ); @@ -2874,7 +2818,7 @@ void SwStyleSheetIterator::AppendStyleList(const SvStringsDtor& rList, bUsed = rDoc.IsPoolPageDescUsed( nId ); break; default: - ASSERT( !this, "unknown PoolFmt-Id" ); + OSL_ENSURE( !this, "unknown PoolFmt-Id" ); } if ( bUsed ) aLst.Append( cType, *rList[i] ); @@ -2887,7 +2831,7 @@ void SwStyleSheetIterator::AppendStyleList(const SvStringsDtor& rList, void SwStyleSheetIterator::Notify( SfxBroadcaster&, const SfxHint& rHint ) { - // suchen und aus der Anzeige-Liste entfernen !! + // search and remove from View-List!! if( rHint.ISA( SfxStyleSheetHint ) && SFX_STYLESHEET_ERASED == ((SfxStyleSheetHint&) rHint).GetHint() ) { @@ -2904,3 +2848,4 @@ void SwStyleSheetIterator::Notify( SfxBroadcaster&, const SfxHint& rHint ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/error.src b/sw/source/ui/app/error.src index fa13048357..6b4c43f5c1 100644 --- a/sw/source/ui/app/error.src +++ b/sw/source/ui/app/error.src @@ -24,18 +24,16 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#define __RSC +#define __RSC - //#include <tools/errcode.hxx> #include "globals.hrc" #include "app.hrc" #include "swerror.h" -#include "comcore.hrc" // MS: Warum gibst auf der Core-Seite - // jetzt Resourcen +#include "comcore.hrc" // MS: Why are there resources at the Core-Side now /*-------------------------------------------------------------------- - Beschreibung: Strings + Description: Strings --------------------------------------------------------------------*/ String STR_COMCORE_READERROR @@ -47,7 +45,7 @@ String STR_COMCORE_CANT_SHOW Text [ en-US ] = "Graphic cannot be displayed." ; }; /*-------------------------------------------------------------------- - Beschreibung: Boxes + Description: Boxes --------------------------------------------------------------------*/ InfoBox ERR_CLPBRD_WRITE { @@ -95,10 +93,6 @@ Resource RID_SW_ERRHDL }; String ERR_CODE ( ERRCODE_CLASS_READ , ERR_WW6_FASTSAVE_ERR ) { - /* ### ACHTUNG: Neuer Text in Resource? Diese Datei wurde mit der WinWord-Option 'Schnellspeichern' gespeichert. Bitte schalten Sie in WinWord die Option 'Schnellspeichern zulassen' aus und speichern sie die Datei erneut mit WinWord : Diese Datei wurde mit der WinWord-Option ''Schnellspeichern'' gespeichert. Bitte schalten Sie in WinWord die Option ''Schnellspeichern zulassen'' aus und speichern sie die Datei erneut mit WinWord */ - /* ### ACHTUNG: Neuer Text in Resource? Diese Datei wurde mit der WinWord-Option 'Schnellspeichern' gespeichert. Bitte schalten Sie in WinWord die Option 'Schnellspeichern zulassen' aus und speichern sie die Datei erneut mit WinWord : Diese Datei wurde mit der WinWord-Option ''Schnellspeichern'' gespeichert. Bitte schalten Sie in WinWord die Option ''Schnellspeichern zulassen'' aus und speichern sie die Datei erneut mit WinWord */ - /* ### ACHTUNG: Neuer Text in Resource? Diese Datei wurde mit der WinWord-Option 'Schnellspeichern' gespeichert. Bitte schalten Sie in WinWord die Option 'Schnellspeichern zulassen' aus und speichern sie die Datei erneut mit WinWord : Diese Datei wurde mit der WinWord-Option ''Schnellspeichern'' gespeichert. Bitte schalten Sie in WinWord die Option ''Schnellspeichern zulassen'' aus und speichern sie die Datei erneut mit WinWord */ - /* ### ACHTUNG: Neuer Text in Resource? Diese Datei wurde mit der WinWord-Option 'Schnellspeichern' gespeichert. Bitte schalten Sie in WinWord die Option 'Schnellspeichern zulassen' aus und speichern sie die Datei erneut mit WinWord : Diese Datei wurde mit der WinWord-Option ''Schnellspeichern'' gespeichert. Bitte schalten Sie in WinWord die Option ''Schnellspeichern zulassen'' aus und speichern sie die Datei erneut mit WinWord */ Text [ en-US ] = "This file was saved with WinWord in 'Fast Save' mode. Please unmark the WinWord option 'Allow Fast Saves' and save the file again." ; }; String ERR_CODE ( ERRCODE_CLASS_READ , ERR_FORMAT_ROWCOL ) @@ -149,12 +143,10 @@ Resource RID_SW_ERRHDL }; String ERR_CODE ( ERRCODE_CLASS_NONE , ERR_TBLSPLIT_ERROR ) { - /* ### ACHTUNG: Neuer Text in Resource? Zellen k�nnen nicht mehr geteilt werden : Zellen k�nnen nicht mehr geteilt werden */ Text [ en-US ] = "Cells cannot be further split." ; }; String ERR_CODE ( ERRCODE_CLASS_NONE , ERR_TBLINSCOL_ERROR ) { - /* ### ACHTUNG: Neuer Text in Resource? weitere Spalten k�nnen nicht eingef�gt werden : weitere Spalten k�nnen nicht eingef�gt werden */ Text [ en-US ] = "Additional columns cannot be inserted." ; }; String ERR_CODE ( ERRCODE_CLASS_NONE , ERR_TBLDDECHG_ERROR ) @@ -180,22 +172,18 @@ Resource RID_SW_ERRHDL }; String WARN_CODE ( ERRCODE_CLASS_READ , WARN_SWG_OLE ) { - /* ### ACHTUNG: Neuer Text in Resource? Einige OLE-Objekte konnten nur als Grafiken �bernommen werden : Einige OLE-Objekte konnten nur als Grafiken �bernommen werden */ Text [ en-US ] = "Some OLE objects could only be loaded as graphics." ; }; String WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_OLE ) { - /* ### ACHTUNG: Neuer Text in Resource? Einige OLE-Objekte konnten nur als Grafiken �bernommen werden : Einige OLE-Objekte konnten nur als Grafiken �bernommen werden */ Text [ en-US ] = "Some OLE objects could only be saved as graphics." ; }; String WARN_CODE ( ERRCODE_CLASS_READ , WARN_SWG_POOR_LOAD ) { - /* ### ACHTUNG: Neuer Text in Resource? Dokument konnte nicht vollst�ndig geladen werden : Dokument konnte nicht vollst�ndig geladen werden */ Text [ en-US ] = "Document could not be completely loaded." ; }; String WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_POOR_LOAD ) { - /* ### ACHTUNG: Neuer Text in Resource? Dokument konnte nicht vollst�ndig gespeichert werden : Dokument konnte nicht vollst�ndig gespeichert werden */ Text [ en-US ] = "Document could not be completely saved." ; }; String WARN_CODE ( ERRCODE_CLASS_WRITE , WARN_SWG_HTML_NO_MACROS) diff --git a/sw/source/ui/app/mainwn.cxx b/sw/source/ui/app/mainwn.cxx index 875d371c67..bce152b431 100644 --- a/sw/source/ui/app/mainwn.cxx +++ b/sw/source/ui/app/mainwn.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,13 +34,9 @@ #include <mdiexp.hxx> #include <tools/shl.hxx> #include <tools/string.hxx> -#ifndef _SVARRAY_HXX #include <svl/svstdarr.hxx> -#endif #include <sfx2/progress.hxx> -#ifndef _RESID_HXX //autogen #include <tools/resid.hxx> -#endif #include <docsh.hxx> #include <swmodule.hxx> #include "swtypes.hxx" @@ -163,3 +160,4 @@ void RescheduleProgress( SwDocShell *pDocShell ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src index efaf278ada..928304b15b 100644 --- a/sw/source/ui/app/mn.src +++ b/sw/source/ui/app/mn.src @@ -34,9 +34,7 @@ #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 @@ -372,7 +370,7 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml }; /*------------------------------------------------------------------------ - Beschreibung: Menu Window + Description: Menu Window ------------------------------------------------------------------------*/ #define MN_FRM_CAPTION_ITEM \ @@ -412,9 +410,7 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml {\ Identifier = MN_CELL ; \ Command = ".uno:CellMenu" ; \ - /* ### ACHTUNG: Neuer Text in Resource? Ze~lle : Zelle */\ Text [ en-US ] = "~Cell" ; \ - /* ### ACHTUNG: Neuer Text in Resource? Einstellungen f�r die Tabellenzelle : Einstellungen f�r die Tabellenzelle */\ SubMenu = Menu\ {\ ItemList = \ @@ -455,7 +451,6 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml {\ Identifier = FN_TABLE_SET_READ_ONLY_CELLS ; \ HelpId = CMD_FN_TABLE_SET_READ_ONLY_CELLS ; \ - /* ### ACHTUNG: Neuer Text in Resource? ~Sch�tzen : ~Sch�tzen */\ Text [ en-US ] = "~Protect" ; \ };\ MenuItem\ @@ -474,9 +469,7 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml Identifier = MN_SUB_TBLROW ; \ HelpID = HID_MN_SUB_TBLROW ; \ Command = ".uno:RowMenu" ; \ - /* ### ACHTUNG: Neuer Text in Resource? Ze~ile : Zeile */\ Text [ en-US ] = "~Row" ; \ - /* ### ACHTUNG: Neuer Text in Resource? Einstellungen f�r die Tabellenzeile : Einstellungen f�r die Tabellenzeile */\ SubMenu = Menu\ {\ ItemList = \ @@ -485,7 +478,6 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml {\ Identifier = FN_TABLE_SET_ROW_HEIGHT ; \ HelpId = CMD_FN_TABLE_SET_ROW_HEIGHT ; \ - /* ### ACHTUNG: Neuer Text in Resource? ~H�he... : ~H�he... */\ Text [ en-US ] = "~Height..." ; \ };\ MenuItem\ @@ -498,14 +490,12 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml {\ Identifier = FN_TABLE_OPTIMAL_HEIGHT ; \ HelpId = CMD_FN_TABLE_OPTIMAL_HEIGHT ; \ - /* ### ACHTUNG: Neuer Text in Resource? ~Optimale H�he : ~Optimale H�he */\ Text [ en-US ] = "~Optimal Height" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_BALANCE_ROWS ; \ HelpId = CMD_FN_TABLE_BALANCE_ROWS ; \ - /* ### ACHTUNG: Neuer Text in Resource? Gleichm��ig ~verteilen : Gleichm��ig ~verteilen */\ Text [ en-US ] = "Space ~Equally" ; \ };\ SEPARATOR ; \ @@ -513,22 +503,18 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml {\ Identifier = FN_TABLE_SELECT_ROW ; \ HelpId = CMD_FN_TABLE_SELECT_ROW ; \ - /* ### ACHTUNG: Neuer Text in Resource? Ausw~�hlen : Ausw�hlen */\ - /* ### ACHTUNG: Neuer Text in Resource? Ausw~�hlen : Ausw~�hlen */\ Text [ en-US ] = "~Select" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_INSERT_ROW_DLG ; \ HelpId = CMD_FN_TABLE_INSERT_ROW_DLG ; \ - /* ### ACHTUNG: Neuer Text in Resource? ~Einf�gen... : ~Einf�gen... */\ Text [ en-US ] = "~Insert..." ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_DELETE_ROW ; \ HelpId = CMD_FN_TABLE_DELETE_ROW ; \ - /* ### ACHTUNG: Neuer Text in Resource? ~L�schen : ~L�schen */\ Text [ en-US ] = "~Delete" ; \ };\ };\ @@ -540,7 +526,6 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml HelpID = HID_MN_SUB_TBLCOL ; \ Command = ".uno:ColumnMenu" ; \ Text [ en-US ] = "Colu~mn" ; \ - /* ### ACHTUNG: Neuer Text in Resource? Einstellungen f�r die Tabellenspalte : Einstellungen f�r die Tabellenspalte */\ SubMenu = Menu\ {\ ItemList = \ @@ -561,7 +546,6 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml {\ Identifier = FN_TABLE_BALANCE_CELLS ; \ HelpId = CMD_FN_TABLE_BALANCE_CELLS ; \ - /* ### ACHTUNG: Neuer Text in Resource? Gleichm��ig ~verteilen : Gleichm��ig ~verteilen */\ Text [ en-US ] = "Space ~Equally" ; \ };\ SEPARATOR ; \ @@ -569,22 +553,18 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml {\ Identifier = FN_TABLE_SELECT_COL ; \ HelpId = CMD_FN_TABLE_SELECT_COL ; \ - /* ### ACHTUNG: Neuer Text in Resource? Ausw~�hlen : Ausw�hlen */\ - /* ### ACHTUNG: Neuer Text in Resource? Ausw~�hlen : Ausw~�hlen */\ Text [ en-US ] = "~Select" ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_INSERT_COL_DLG ; \ HelpId = CMD_FN_TABLE_INSERT_COL_DLG ; \ - /* ### ACHTUNG: Neuer Text in Resource? ~Einf�gen... : ~Einf�gen... */\ Text [ en-US ] = "~Insert..." ; \ };\ MenuItem\ {\ Identifier = FN_TABLE_DELETE_COL ; \ HelpId = CMD_FN_TABLE_DELETE_COL ; \ - /* ### ACHTUNG: Neuer Text in Resource? ~L�schen : ~L�schen */\ Text [ en-US ] = "~Delete" ; \ };\ };\ @@ -617,7 +597,6 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml Text [ en-US ] = "Name..." ; \ }; -// #i68101# #define MN_TITLE_DESCRIPTION_SHAPE\ MenuItem\ {\ @@ -845,12 +824,10 @@ Menu MN_TAB_POPUPMENU ITEM_FORMAT_PARA_DLG }; ITEM_TRANSLITERATE_MENU - // MN_BB SEPARATOR ; MN_TAB1 MN_TAB2 MN_FRM_CAPTION_ITEM - // SEPARATOR; MenuItem { Identifier = FN_VIEW_TABLEGRID ; @@ -1088,11 +1065,9 @@ Menu MN_DRAW_POPUPMENU ITEM_FORMAT_ATTR_TRANSFORM }; - //-#i68101#---------------------- SEPARATOR ; MN_TITLE_DESCRIPTION_SHAPE MN_NAME_SHAPE - //-#i68101#---------------------- SEPARATOR ; MN_DRAW5 @@ -1118,11 +1093,9 @@ Menu MN_DRAWFORM_POPUPMENU ITEM_FORMAT_ATTR_TRANSFORM }; - //-#i68101#---------------------- SEPARATOR ; MN_TITLE_DESCRIPTION_SHAPE MN_NAME_SHAPE - //-#i68101#---------------------- SEPARATOR ; MN_FORM @@ -1167,9 +1140,6 @@ Menu MN_ANNOTATION_POPUPMENU { ItemList = { - //MN_RESET - //SEPARATOR ; - //MN_TEXT_ATTR MenuItem\ {\ ITEM_FORMAT_ATTR_CHAR_WEIGHT\ @@ -1187,13 +1157,8 @@ Menu MN_ANNOTATION_POPUPMENU ITEM_FORMAT_ATTR_CHAR_STRIKEOUT\ };\ SEPARATOR ; - //ITEM_TRANSLITERATE_MENU - //SEPARATOR ; - //MN_DRWTXT - //MN_FRM_CAPTION_ITEM SEPARATOR ; MN_ANNOTATIONS - //MN_REDCOMMENT }; }; @@ -1298,10 +1263,8 @@ Menu MN_GRF_POPUPMENU { MN_ALIGN_FRAME MN_MOUSE_FRAME_WITH_CONTOUR - // --> OD 2009-07-14 #i73249# SEPARATOR ; MN_TITLE_DESCRIPTION_SHAPE - // <-- SEPARATOR ; MenuItem { @@ -1316,6 +1279,14 @@ Menu MN_GRF_POPUPMENU Text [ en-US ] = "Save Graphics..." ; }; MN_FRM_CAPTION_ITEM + SEPARATOR; + MenuItem + { + Identifier = FN_EXTERNAL_EDIT ; + HelpID = CMD_FN_EXTERNAL_EDIT ; + Text [ en-US ] = "Edit with External Tool..."; + }; + SEPARATOR; MenuItem { ITEM_EDIT_IMAP @@ -1328,6 +1299,29 @@ String MN_OLE_POPUPMENU Text [ en-US ] = "Object" ; }; +#define MN_OLE_EXPORT \ + MenuItem\ + {\ + Text [ en-US ] = "Export..." ; \ + SubMenu = Menu\ + {\ + ItemList = \ + {\ + MenuItem\ + {\ + Identifier = 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 = CMD_FN_EXPORT_OLE_AS_GRAPHIC ; \ + Text [ en-US ] = "Export as JPG..." ; \ + };\ + };\ + };\ + }; Menu MN_OLE_POPUPMENU { @@ -1335,10 +1329,8 @@ Menu MN_OLE_POPUPMENU { MN_ALIGN_FRAME MN_MOUSE_FRAME_WITH_CONTOUR - // --> OD 2009-07-14 #i73249# SEPARATOR ; MN_TITLE_DESCRIPTION_SHAPE - // <-- SEPARATOR ; MenuItem { @@ -1346,6 +1338,9 @@ Menu MN_OLE_POPUPMENU HelpId = CMD_FN_FORMAT_FRAME_DLG ; Text [ en-US ] = "Object..." ; }; + SEPARATOR ; + MN_OLE_EXPORT + SEPARATOR ; MN_FRM_CAPTION_ITEM }; }; @@ -1363,10 +1358,8 @@ Menu MN_FRM_POPUPMENU { MN_ALIGN_FRAME MN_MOUSE_FRAME_WITHOUT_CONTOUR - // --> OD 2009-07-07 #i73249# SEPARATOR ; MN_TITLE_DESCRIPTION_SHAPE - // <-- SEPARATOR ; MN_FRM MN_FRM_CAPTION_ITEM @@ -1392,13 +1385,11 @@ Menu MN_PPREVIEW_POPUPMENU { Identifier = FN_PAGEDOWN ; HelpId = CMD_FN_PAGEDOWN ; - /* ### ACHTUNG: Neuer Text in Resource? N�chste Seite : N�chste Seite */ Text [ en-US ] = "Next Page" ; }; MenuItem { ITEM_VIEW_ATTR_ZOOM - /* ### ACHTUNG: Neuer Text in Resource? Schlie�t die Seitenvorschau : Schlie�t die Seitenvorschau */ }; SEPARATOR ; MenuItem @@ -1431,11 +1422,9 @@ Menu MN_MEDIA_POPUPMENU ITEM_FORMAT_ATTR_TRANSFORM }; - //-#i68101#---------------------- SEPARATOR ; MN_TITLE_DESCRIPTION_SHAPE MN_NAME_SHAPE - //-#i68101#---------------------- SEPARATOR ; MN_DRAW6 diff --git a/sw/source/ui/app/swdll.cxx b/sw/source/ui/app/swdll.cxx index c97d18514f..d3a55d9cde 100644 --- a/sw/source/ui/app/swdll.cxx +++ b/sw/source/ui/app/swdll.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,13 +33,9 @@ #include <svx/svdobj.hxx> #include <rtl/logfile.hxx> -#ifndef _GLOBDOC_HRC #include "globdoc.hrc" -#endif -#ifndef _SWDLL_HXX #include <swdll.hxx> -#endif #include <wdocsh.hxx> #include <globdoc.hxx> #include <initui.hxx> @@ -50,21 +47,12 @@ #include <unotools/moduleoptions.hxx> -#ifndef _FM_FMOBJFAC_HXX #include <svx/fmobjfac.hxx> -#endif #include <svx/svdfield.hxx> #include <svx/objfac3d.hxx> #include <unomid.h> - -/************************************************************************* -|* -|* Init -|* -\************************************************************************/ - void SwDLL::Init() { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDLL" ); @@ -96,26 +84,26 @@ void SwDLL::Init() pDocFact->SetDocumentServiceName(C2S("com.sun.star.text.TextDocument")); } - // SvDraw-Felder registrieren + // register SvDraw-Fields SdrRegisterFieldClasses(); - // 3D-Objekt-Factory eintragen + // register 3D-Objekt-Factory E3dObjFactory(); - // form::component::Form-Objekt-Factory eintragen + // register form::component::Form-Objekt-Factory FmFormObjFactory(); SdrObjFactory::InsertMakeObjectHdl( LINK( &aSwObjectFactory, SwObjectFactory, MakeObject ) ); RTL_LOGFILE_CONTEXT_TRACE( aLog, "Init Core/UI/Filter" ); - //Initialisierung der Statics + // Initialisation of Statics ::_InitCore(); ::_InitFilter(); ::_InitUI(); pModule->InitAttrPool(); - //jetzt darf das SwModule seinen Pool anlegen + // now SWModule can create its Pool // register your view-factories here RegisterFactories(); @@ -127,30 +115,23 @@ void SwDLL::Init() RegisterControls(); } - - -/************************************************************************* -|* -|* Exit -|* -\************************************************************************/ - void SwDLL::Exit() { // called directly befor unloading the DLL // do whatever you want, Sw-DLL is accessible - // der Pool muss vor den statics geloescht werden + // Pool has to be deleted before statics are SW_MOD()->RemoveAttrPool(); ::_FinitUI(); ::_FinitFilter(); ::_FinitCore(); - // Objekt-Factory austragen + // sign out Objekt-Factory SdrObjFactory::RemoveMakeObjectHdl(LINK(&aSwObjectFactory, SwObjectFactory, MakeObject )); - // the SwModule must be destroyed + // the SwModule must be destroyed SwModule** ppShlPtr = (SwModule**) GetAppData(SHL_WRITER); delete (*ppShlPtr); (*ppShlPtr) = NULL; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index 7787d3f8e3..6b1838305a 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,6 +48,7 @@ #include <editeng/colritem.hxx> #include <editeng/brshitem.hxx> #include <vcl/msgbox.hxx> +#include <svl/cjkoptions.hxx> #include <swmodule.hxx> #include <swtypes.hxx> #include <usrpref.hxx> @@ -58,7 +60,7 @@ #include <docsh.hxx> #include <dbmgr.hxx> #include <uinums.hxx> -#include <prtopt.hxx> // fuer PrintOptions +#include <prtopt.hxx> // for PrintOptions #include <navicfg.hxx> #include <doc.hxx> #include <cmdid.h> @@ -79,12 +81,9 @@ using namespace ::com::sun::star::view; using namespace ::com::sun::star::lang; -/*-----------------08/28/97 08:41pm----------------- - ---------------------------------------------------*/ void lcl_SetUIPrefs(const SwViewOption* pPref, SwView* pView, ViewShell* pSh ) { - // in FrameSets kann die tatsaechliche Sichtbarkeit von der Einstellung der ViewOptions abweichen + // in FrameSets the actual visibility can differ from the ViewOption's setting sal_Bool bVScrollChanged = pPref->IsViewVScrollBar() != pSh->GetViewOptions()->IsViewVScrollBar(); sal_Bool bHScrollChanged = pPref->IsViewHScrollBar() != pSh->GetViewOptions()->IsViewHScrollBar(); sal_Bool bVAlignChanged = pPref->IsVRulerRight() != pSh->GetViewOptions()->IsVRulerRight(); @@ -92,7 +91,7 @@ void lcl_SetUIPrefs(const SwViewOption* pPref, SwView* pView, ViewShell* pSh ) pSh->SetUIOptions(*pPref); const SwViewOption* pNewPref = pSh->GetViewOptions(); - // Scrollbars an / aus + // Scrollbars on / off if(bVScrollChanged) { pView->ShowVScrollbar(pNewPref->IsViewVScrollBar()); @@ -105,13 +104,13 @@ void lcl_SetUIPrefs(const SwViewOption* pPref, SwView* pView, ViewShell* pSh ) if(bVAlignChanged && !bHScrollChanged && !bVScrollChanged) pView->InvalidateBorder(); - // Lineale an / aus + // Rulers on / off if(pNewPref->IsViewVRuler()) pView->CreateVLineal(); else pView->KillVLineal(); - // TabWindow an/aus + // TabWindow on / off if(pNewPref->IsViewHRuler()) pView->CreateTab(); else @@ -120,11 +119,6 @@ void lcl_SetUIPrefs(const SwViewOption* pPref, SwView* pView, ViewShell* pSh ) pView->GetPostItMgr()->PrepareView(true); } -/*-------------------------------------------------------------------- - Beschreibung: Aktuelle SwWrtShell - --------------------------------------------------------------------*/ - - SwWrtShell* GetActiveWrtShell() { SwView *pActive = ::GetActiveView(); @@ -133,41 +127,31 @@ SwWrtShell* GetActiveWrtShell() return 0; } -/*-------------------------------------------------------------------- - Beschreibung: Pointer auf die aktuelle Sicht - --------------------------------------------------------------------*/ - - SwView* GetActiveView() { SfxViewShell* pView = SfxViewShell::Current(); return PTR_CAST( SwView, pView ); } -/*-------------------------------------------------------------------- - Beschreibung: Ueber Views iterieren - static - --------------------------------------------------------------------*/ SwView* SwModule::GetFirstView() { - // liefert nur sichtbare SwViews + // returns only sivible SwView const TypeId aTypeId = TYPE(SwView); SwView* pView = (SwView*)SfxViewShell::GetFirst(&aTypeId); return pView; } - SwView* SwModule::GetNextView(SwView* pView) { - DBG_ASSERT(PTR_CAST(SwView, pView),"keine SwView uebergeben"); + OSL_ENSURE(PTR_CAST(SwView, pView),"return no SwView"); const TypeId aTypeId = TYPE(SwView); SwView* pNView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId, sal_True); return pNView; } /*------------------------------------------------------------------------ - Beschreibung: Neuer Master fuer die Einstellungen wird gesetzt; - dieser wirkt sich auf die aktuelle Sicht und alle - folgenden aus. + Description: New Master for the settings is set; this affects the + current view and all following. ------------------------------------------------------------------------*/ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView, @@ -181,9 +165,9 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView, VIEWOPT_DEST_TEXT== nDest ? sal_False : pCurrView && pCurrView->ISA(SwWebView) )); - //per Uno soll nur die sdbcx::View, aber nicht das Module veraendert werden + // with Uno, only sdbcx::View, but not the Module should be changed sal_Bool bViewOnly = VIEWOPT_DEST_VIEW_ONLY == nDest; - //PreView abfruehstuecken + // fob PreView off SwPagePreView* pPPView; if( !pCurrView && 0 != (pPPView = PTR_CAST( SwPagePreView, SfxViewShell::Current())) ) { @@ -208,8 +192,13 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView, if( !pCurrView ) return; - // Weitergabe an die CORE - const sal_Bool bReadonly = pCurrView->GetDocShell()->IsReadOnly(); + // Passing on to CORE + sal_Bool bReadonly; + const SwDocShell* pDocSh = pCurrView->GetDocShell(); + if (pDocSh) + bReadonly = pDocSh->IsReadOnly(); + else //Use existing option if DocShell missing + bReadonly = pSh->GetViewOptions()->IsReadonly(); SwViewOption* pViewOpt; if(!bViewOnly) pViewOpt = new SwViewOption( *pPref ); @@ -218,7 +207,7 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView, pViewOpt->SetReadonly( bReadonly ); if( !(*pSh->GetViewOptions() == *pViewOpt) ) { - //Ist evtl. nur eine ViewShell + //is maybe only a ViewShell pSh->StartAction(); pSh->ApplyViewOptions( *pViewOpt ); ((SwWrtShell*)pSh)->SetReadOnlyAvailable(pViewOpt->IsCursorInProtectedArea()); @@ -229,13 +218,10 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView, lcl_SetUIPrefs(pViewOpt, pCurrView, pSh); - // zum Schluss wird das Idle-Flag wieder gesetzt - // #42510# + // in the end the Idle-Flag is set again pPref->SetIdle(sal_True); } -/* -----------------------------28.09.00 12:36-------------------------------- - ---------------------------------------------------------------------------*/ void SwModule::ApplyUserMetric( FieldUnit eMetric, sal_Bool bWeb ) { SwMasterUsrPref* pPref; @@ -259,7 +245,7 @@ void SwModule::ApplyUserMetric( FieldUnit eMetric, sal_Bool bWeb ) FieldUnit eVScrollMetric = pPref->IsVScrollMetric() ? pPref->GetVScrollMetric() : eMetric; SwView* pTmpView = SwModule::GetFirstView(); - // fuer alle MDI-Fenster das Lineal umschalten + // switch the ruler for all MDI-Windows while(pTmpView) { if(bWeb == (0 != PTR_CAST(SwWebView, pTmpView))) @@ -271,9 +257,7 @@ void SwModule::ApplyUserMetric( FieldUnit eMetric, sal_Bool bWeb ) pTmpView = SwModule::GetNextView(pTmpView); } } -/*-- 12.11.2008 14:47:58--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwModule::ApplyRulerMetric( FieldUnit eMetric, sal_Bool bHorizontal, sal_Bool bWeb ) { SwMasterUsrPref* pPref; @@ -308,9 +292,69 @@ void SwModule::ApplyRulerMetric( FieldUnit eMetric, sal_Bool bHorizontal, sal_Bo pTmpView = SwModule::GetNextView(pTmpView); } } -/*-----------------13.11.96 11.57------------------- +/*------------------------------------------------- +set the usrpref 's char unit attribute and set ruler +'s unit as char if the "apply char unit" is checked --------------------------------------------------*/ +void SwModule::ApplyUserCharUnit(sal_Bool bApplyChar, sal_Bool bWeb) +{ + SwMasterUsrPref* pPref; + if(bWeb) + { + if(!pWebUsrPref) + GetUsrPref(sal_True); + pPref = pWebUsrPref; + } + else + { + if(!pUsrPref) + GetUsrPref(sal_False); + pPref = pUsrPref; + } + sal_Bool bOldApplyCharUnit = pPref->IsApplyCharUnit(); + sal_Bool bHasChanged = sal_False; + if(bOldApplyCharUnit != bApplyChar) + { + pPref->SetApplyCharUnit(bApplyChar); + bHasChanged = sal_True; + } + + if( !bHasChanged ) + return; + + FieldUnit eHScrollMetric = pPref->IsHScrollMetric() ? pPref->GetHScrollMetric() : pPref->GetMetric(); + FieldUnit eVScrollMetric = pPref->IsVScrollMetric() ? pPref->GetVScrollMetric() : pPref->GetMetric(); + if(bApplyChar) + { + eHScrollMetric = FUNIT_CHAR; + eVScrollMetric = FUNIT_LINE; + } + else + { + SvtCJKOptions aCJKOptions; + if ( !aCJKOptions.IsAsianTypographyEnabled() && ( eHScrollMetric == FUNIT_CHAR )) + eHScrollMetric = FUNIT_INCH; + else if ( eHScrollMetric == FUNIT_CHAR ) + eHScrollMetric = FUNIT_CM; + if ( !aCJKOptions.IsAsianTypographyEnabled() && ( eVScrollMetric == FUNIT_LINE )) + eVScrollMetric = FUNIT_INCH; + else if ( eVScrollMetric == FUNIT_LINE ) + eVScrollMetric = FUNIT_CM; + } + SwView* pTmpView = SwModule::GetFirstView(); + // switch rulers for all MDI-Windows + while(pTmpView) + { + if(bWeb == (0 != PTR_CAST(SwWebView, pTmpView))) + { + pTmpView->ChangeVLinealMetric(eVScrollMetric); + pTmpView->ChangeTabMetric(eHScrollMetric); + } + + pTmpView = SwModule::GetNextView(pTmpView); + } +} SwNavigationConfig* SwModule::GetNavigationConfig() { @@ -321,10 +365,6 @@ SwNavigationConfig* SwModule::GetNavigationConfig() return pNavigationConfig; } -/*-----------------05.02.97 08.03------------------- - ---------------------------------------------------*/ - SwPrintOptions* SwModule::GetPrtOptions(sal_Bool bWeb) { if(bWeb && !pWebPrtOpt) @@ -339,9 +379,6 @@ SwPrintOptions* SwModule::GetPrtOptions(sal_Bool bWeb) return bWeb ? pWebPrtOpt : pPrtOpt; } -/*-----------------26.06.97 07.52------------------- - ---------------------------------------------------*/ SwChapterNumRules* SwModule::GetChapterNumRules() { if(!pChapterNumRules) @@ -349,17 +386,13 @@ SwChapterNumRules* SwModule::GetChapterNumRules() return pChapterNumRules; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - 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); uno::Reference<frame::XFrame> xBeamerFrame = xFrame->findFrame( - rtl::OUString::createFromAscii("_beamer"), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_beamer")), FrameSearchFlag::CHILDREN); if (xBeamerFrame.is()) { // the beamer has been opened by the SfxViewFrame @@ -375,13 +408,10 @@ void SwModule::ShowDBObj(SwView& rView, const SwDBData& rData, sal_Bool /*bOnlyI xControllerSelection->select(makeAny(aSelection.createPropertyValueSequence())); } else { - DBG_ERROR("no selection supplier in the beamer!"); + OSL_ENSURE(false, "no selection supplier in the beamer!"); } } } -/*-------------------------------------------------------------------- - Beschreibung: Redlining - --------------------------------------------------------------------*/ sal_uInt16 SwModule::GetRedlineAuthor() { @@ -396,13 +426,9 @@ sal_uInt16 SwModule::GetRedlineAuthor() return InsertRedlineAuthor( sActAuthor ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - const String& SwModule::GetRedlineAuthor(sal_uInt16 nPos) { - DBG_ASSERT(nPos<pAuthorNames->Count(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash + OSL_ENSURE(nPos<pAuthorNames->Count(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash while (!(nPos<pAuthorNames->Count())) { InsertRedlineAuthor(String(RTL_CONSTASCII_USTRINGPARAM("nn"))); @@ -410,10 +436,6 @@ const String& SwModule::GetRedlineAuthor(sal_uInt16 nPos) return *pAuthorNames->GetObject(nPos); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwModule::InsertRedlineAuthor(const String& rAuthor) { sal_uInt16 nPos = 0; @@ -427,10 +449,6 @@ sal_uInt16 SwModule::InsertRedlineAuthor(const String& rAuthor) return nPos; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void lcl_FillAuthorAttr( sal_uInt16 nAuthor, SfxItemSet &rSet, const AuthorCharAttr &rAttr ) { @@ -443,8 +461,7 @@ void lcl_FillAuthorAttr( sal_uInt16 nAuthor, SfxItemSet &rSet, COL_AUTHOR4_DARK, COL_AUTHOR5_DARK, COL_AUTHOR6_DARK, COL_AUTHOR7_DARK, COL_AUTHOR8_DARK, COL_AUTHOR9_DARK }; - aCol.SetColor( aColArr[ nAuthor % (sizeof( aColArr ) / - sizeof( aColArr[0] )) ] ); + aCol.SetColor( aColArr[ nAuthor % (SAL_N_ELEMENTS(aColArr)) ] ); } sal_Bool bBackGr = COL_NONE == rAttr.nColor; @@ -498,26 +515,18 @@ void lcl_FillAuthorAttr( sal_uInt16 nAuthor, SfxItemSet &rSet, rSet.Put( SvxColorItem( aCol, RES_CHRATR_COLOR ) ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwModule::GetInsertAuthorAttr(sal_uInt16 nAuthor, SfxItemSet &rSet) { lcl_FillAuthorAttr(nAuthor, rSet, pModuleConfig->GetInsertAuthorAttr()); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwModule::GetDeletedAuthorAttr(sal_uInt16 nAuthor, SfxItemSet &rSet) { lcl_FillAuthorAttr(nAuthor, rSet, pModuleConfig->GetDeletedAuthorAttr()); } /*-------------------------------------------------------------------- - Beschreibung: Fuer zukuenftige Erweiterung: + Description: For future extension: --------------------------------------------------------------------*/ void SwModule::GetFormatAuthorAttr( sal_uInt16 nAuthor, SfxItemSet &rSet ) @@ -525,19 +534,11 @@ void SwModule::GetFormatAuthorAttr( sal_uInt16 nAuthor, SfxItemSet &rSet ) lcl_FillAuthorAttr( nAuthor, rSet, pModuleConfig->GetFormatAuthorAttr() ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwModule::GetRedlineMarkPos() { return pModuleConfig->GetMarkAlignMode(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool SwModule::IsInsTblFormatNum(sal_Bool bHTML) const { return pModuleConfig->IsInsTblFormatNum(bHTML); @@ -548,41 +549,27 @@ sal_Bool SwModule::IsInsTblChangeNumFormat(sal_Bool bHTML) const return pModuleConfig->IsInsTblChangeNumFormat(bHTML); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool SwModule::IsInsTblAlignNum(sal_Bool bHTML) const { return pModuleConfig->IsInsTblAlignNum(bHTML); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - const Color &SwModule::GetRedlineMarkColor() { return pModuleConfig->GetMarkAlignColor(); } -/*-----------------03.03.98 16:47------------------- - ---------------------------------------------------*/ const SwViewOption* SwModule::GetViewOption(sal_Bool bWeb) { return GetUsrPref( bWeb ); } -// returne den definierten DocStat - WordDelimiter const String& SwModule::GetDocStatWordDelim() const { return pModuleConfig->GetWordDelimiter(); } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ -// Durchreichen der Metric von der ModuleConfig (fuer HTML-Export) +// Passing-through of the ModuleConfig's Metric (for HTML-Export) sal_uInt16 SwModule::GetMetric( sal_Bool bWeb ) const { SwMasterUsrPref* pPref; @@ -600,46 +587,36 @@ sal_uInt16 SwModule::GetMetric( sal_Bool bWeb ) const } return static_cast< sal_uInt16 >(pPref->GetMetric()); } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ -// Update-Stati durchreichen +// Pass-through Update-Stati sal_uInt16 SwModule::GetLinkUpdMode( sal_Bool ) const { if(!pUsrPref) GetUsrPref(sal_False); return (sal_uInt16)pUsrPref->GetUpdateLinkMode(); } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ SwFldUpdateFlags SwModule::GetFldUpdateFlags( sal_Bool ) const { if(!pUsrPref) GetUsrPref(sal_False); return pUsrPref->GetFldUpdateFlags(); } -/* -----------------------------28.09.00 14:18-------------------------------- - ---------------------------------------------------------------------------*/ void SwModule::ApplyFldUpdateFlags(SwFldUpdateFlags eFldFlags) { if(!pUsrPref) GetUsrPref(sal_False); pUsrPref->SetFldUpdateFlags(eFldFlags); } -/* -----------------------------28.09.00 14:18-------------------------------- - ---------------------------------------------------------------------------*/ void SwModule::ApplyLinkMode(sal_Int32 nNewLinkMode) { if(!pUsrPref) GetUsrPref(sal_False); pUsrPref->SetUpdateLinkMode(nNewLinkMode); } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ void SwModule::CheckSpellChanges( sal_Bool bOnlineSpelling, sal_Bool bIsSpellWrongAgain, sal_Bool bIsSpellAllAgain, sal_Bool bSmartTags ) { @@ -662,8 +639,6 @@ void SwModule::CheckSpellChanges( sal_Bool bOnlineSpelling, pViewShell->GetWin()->Invalidate(); } } -// pSpell->SetSpellWrongAgain( sal_False ); -// pSpell->SetSpellAllAgain( sal_False ); } } @@ -673,3 +648,5 @@ void SwModule::ApplyDefaultPageMode(sal_Bool bIsSquaredPageMode) GetUsrPref(sal_False); pUsrPref->SetDefaultPageMode(bIsSquaredPageMode); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx index 7990827782..4599fabf8b 100644 --- a/sw/source/ui/app/swmodule.cxx +++ b/sw/source/ui/app/swmodule.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <hintids.hxx> -#ifndef _SWERROR_H #include <swerror.h> -#endif #include <vcl/wrkwin.hxx> #include <vcl/graph.hxx> #include <svx/galbrws.hxx> @@ -45,7 +44,7 @@ #include <svx/insctrl.hxx> #include <svx/selctrl.hxx> #include <svx/linectrl.hxx> -#include <svx/tbxctl.hxx> //z-Zt falscher includeschutz! +#include <svx/tbxctl.hxx> // at the moment wrong include-protection! #include <svx/fillctrl.hxx> #include <svx/tbcontrl.hxx> #include <svx/verttexttbxctrl.hxx> @@ -59,34 +58,28 @@ #include <svx/tbxcolor.hxx> #include <svx/clipboardctl.hxx> #include <svx/lboxctrl.hxx> -#include <svx/hyprlink.hxx> #include <svx/tbxcustomshapes.hxx> #include <svx/imapdlg.hxx> #include <svx/srchdlg.hxx> #include <svx/hyperdlg.hxx> #include <svx/extrusioncolorcontrol.hxx> #include <svx/fontworkgallery.hxx> +#include <svx/modctrl.hxx> #include <com/sun/star/scanner/XScannerManager.hpp> #include <com/sun/star/container/XSet.hpp> #include <comphelper/processfactory.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <swmodule.hxx> #include <swevent.hxx> #include <swacorr.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <dobjfac.hxx> #include <init.hxx> #include <pview.hxx> #include <wview.hxx> #include <wdocsh.hxx> #include <globdoc.hxx> -#ifndef _SRCVIEW_HXX //autogen #include <srcview.hxx> -#endif #include <glshell.hxx> #include <tabsh.hxx> #include <listsh.hxx> @@ -99,21 +92,11 @@ #include <beziersh.hxx> #include <wtextsh.hxx> #include <wfrmsh.hxx> -#ifndef _DRFORMSH_HXX #include <drformsh.hxx> -#endif -#ifndef _WGRFSH_HXX #include <wgrfsh.hxx> -#endif -#ifndef _WOLESH_HXX #include <wolesh.hxx> -#endif -#ifndef _WLISTSH_HXX #include <wlistsh.hxx> -#endif -#ifndef _WTABSH_HXX #include <wtabsh.hxx> -#endif #include <navipi.hxx> #include <chartins.hxx> #include <inputwin.hxx> @@ -129,12 +112,8 @@ #include <workctrl.hxx> #include <tbxanchr.hxx> #include <fldwrap.hxx> -#ifndef _REDLNDLG_HXX #include <redlndlg.hxx> -#endif -#ifndef _SYNCBTN_HXX #include <syncbtn.hxx> -#endif #include <mailmergechildwindow.hxx> #include <modcfg.hxx> #include <fontcfg.hxx> @@ -144,27 +123,23 @@ #include <swatrset.hxx> #include <idxmrk.hxx> #include <dlelstnr.hxx> -#ifndef _BARCFG_HXX #include <barcfg.hxx> -#endif #include <svx/rubydialog.hxx> -// OD 14.02.2003 #107424# #include <svtools/colorcfg.hxx> #include <editeng/acorrcfg.hxx> #include <unotools/moduleoptions.hxx> -#ifndef _AVMEDIA_MEDIAPPLAYER_HXX #include <avmedia/mediaplayer.hxx> -#endif #include <avmedia/mediatoolbox.hxx> #include <annotsh.hxx> +#include <navsh.hxx> #include <app.hrc> #include <svx/xmlsecctrl.hxx> ResMgr *pSwResMgr = 0; -sal_Bool bNoInterrupt = sal_False; +sal_Bool bNoInterrupt = sal_False; #include <sfx2/app.hxx> @@ -180,8 +155,6 @@ TYPEINIT1( SwModule, SfxModule ); using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -//************************************************************************ - SwModule::SwModule( SfxObjectFactory* pWebFact, SfxObjectFactory* pFact, SfxObjectFactory* pGlobalFact ) @@ -220,16 +193,16 @@ SwModule::SwModule( SfxObjectFactory* pWebFact, pModuleConfig = new SwModuleOptions; - //Die brauchen wie sowieso + // We need them anyways pToolbarConfig = new SwToolbarConfigItem( sal_False ); pWebToolbarConfig = new SwToolbarConfigItem( sal_True ); pStdFontConfig = new SwStdFontConfig; - pAuthorNames = new SvStringsDtor(5, 1); // Alle Redlining-Autoren + pAuthorNames = new SvStringsDtor(5, 1); // All Redlining-Authors - //JP 18.10.96: SvxAutocorrect gegen die SwAutocorrect austauschen - SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get(); + // replace SvxAutocorrect with SwAutocorrect + SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get(); if( pACfg ) { const SvxAutoCorrect* pOld = pACfg->GetAutoCorrect(); @@ -243,9 +216,6 @@ SwModule::SwModule( SfxObjectFactory* pWebFact, // at the view options. GetColorConfig(); } - -//************************************************************************ - uno::Reference< scanner::XScannerManager > SwModule::GetScannerManager() { @@ -258,8 +228,8 @@ SwModule::GetScannerManager() m_xScannerManager = uno::Reference< scanner::XScannerManager >( xMgr->createInstance( - rtl::OUString::createFromAscii( - "com.sun.star.scanner.ScannerManager" ) ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.scanner.ScannerManager")) ), uno::UNO_QUERY ); } } @@ -275,15 +245,13 @@ uno::Reference< linguistic2::XLanguageGuessing > SwModule::GetLanguageGuesser() { m_xLanguageGuesser = uno::Reference< linguistic2::XLanguageGuessing >( xMgr->createInstance( - rtl::OUString::createFromAscii( "com.sun.star.linguistic2.LanguageGuessing" ) ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.LanguageGuessing"))), uno::UNO_QUERY ); } } return m_xLanguageGuesser; } -//************************************************************************ - SwModule::~SwModule() { SetPool(0); @@ -292,24 +260,20 @@ SwModule::~SwModule() EndListening( *SFX_APP() ); } -//************************************************************************ - void SwModule::CreateLngSvcEvtListener() { if (!xLngSvcEvtListener.is()) xLngSvcEvtListener = new SwLinguServiceEventListener; } -//************************************************************************ - void SwDLL::RegisterFactories() { - //Diese Id's duerfen nicht geaendert werden. Mittels der Id's wird vom - //Sfx die View (Dokumentansicht wiederherstellen) erzeugt. + // These Id's must not be changed. Through these Id's the View (resume Documentview) + // is created by Sfx. if ( SvtModuleOptions().IsWriter() ) SwView::RegisterFactory ( 2 ); - SwWebView::RegisterFactory ( 5 ); + SwWebView::RegisterFactory ( 5 ); if ( SvtModuleOptions().IsWriter() ) { @@ -318,9 +282,6 @@ void SwDLL::RegisterFactories() } } -//************************************************************************ - - void SwDLL::RegisterInterfaces() { SwModule* pMod = SW_MOD(); @@ -347,6 +308,7 @@ void SwDLL::RegisterInterfaces() SwBezierShell::RegisterInterface(pMod); SwGrfShell::RegisterInterface(pMod); SwOleShell::RegisterInterface(pMod); + SwNavigationShell::RegisterInterface(pMod); SwWebTextShell::RegisterInterface(pMod); SwWebFrameShell::RegisterInterface(pMod); SwWebGrfShell::RegisterInterface(pMod); @@ -358,8 +320,6 @@ void SwDLL::RegisterInterfaces() SwAnnotationShell::RegisterInterface(pMod); } -//************************************************************************ - void SwDLL::RegisterControls() { SwModule* pMod = SW_MOD(); @@ -393,7 +353,6 @@ void SwDLL::RegisterControls() SvxLineEndToolBoxControl::RegisterControl(SID_ATTR_LINEEND_STYLE, pMod ); SvxFontNameToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONT, pMod ); -// SvxFontHeightToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT, pMod ); SvxFontColorToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR, pMod ); SvxFontColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR2, pMod ); SvxFontColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR_BACKGROUND, pMod ); @@ -422,6 +381,7 @@ void SwDLL::RegisterControls() SwBookmarkControl::RegisterControl(FN_STAT_PAGE, pMod ); SwTemplateControl::RegisterControl(FN_STAT_TEMPLATE, pMod ); SwViewLayoutControl::RegisterControl( SID_ATTR_VIEWLAYOUT, pMod ); + SvxModifyControl::RegisterControl( SID_DOC_MODIFIED, pMod ); SvxZoomSliderControl::RegisterControl( SID_ATTR_ZOOMSLIDER, pMod ); SwTableOptimizeCtrl::RegisterControl(FN_OPTIMIZE_TABLE, pMod); @@ -429,7 +389,6 @@ void SwDLL::RegisterControls() SvxIMapDlgChildWindow::RegisterChildWindow( sal_False, pMod ); SvxSearchDialogWrapper::RegisterChildWindow( sal_False, pMod ); SvxHlinkDlgWrapper::RegisterChildWindow( sal_False, pMod ); - SvxHyperlinkDlgWrapper::RegisterChildWindow( sal_False, pMod, SFX_CHILDWIN_FORCEDOCK ); SvxFontWorkChildWindow::RegisterChildWindow( sal_False, pMod ); SwFldDlgWrapper::RegisterChildWindow( sal_False, pMod ); SwFldDataOnlyDlgWrapper::RegisterChildWindow( sal_False, pMod ); @@ -439,7 +398,6 @@ void SwDLL::RegisterControls() SwRedlineAcceptChild::RegisterChildWindow( sal_False, pMod ); SwSyncChildWin::RegisterChildWindow( sal_True, pMod ); SwMailMergeChildWindow::RegisterChildWindow( sal_False, pMod ); -// SwSendMailChildWindow::RegisterChildWindow( sal_False, pMod ); SwInsertIdxMarkWrapper::RegisterChildWindow( sal_False, pMod ); SwInsertAuthMarkWrapper::RegisterChildWindow( sal_False, pMod ); SvxRubyChildWindow::RegisterChildWindow( sal_False, pMod); @@ -475,26 +433,22 @@ void SwDLL::RegisterControls() /************************************************************************* |* -|* Modul laden (nur Attrappe fuer das Linken der DLL) +|* Load Module (only dummy for linking of the DLL) |* \************************************************************************/ -/* -----------------20.04.99 10:46------------------- - * - * --------------------------------------------------*/ -void SwModule::InitAttrPool() +void SwModule::InitAttrPool() { - DBG_ASSERT(!pAttrPool, "Pool ist schon da!"); + OSL_ENSURE(!pAttrPool, "Pool already exists!"); pAttrPool = new SwAttrPool(0); SetPool(pAttrPool); } -/* -----------------20.04.99 10:46------------------- - * - * --------------------------------------------------*/ -void SwModule::RemoveAttrPool() + +void SwModule::RemoveAttrPool() { SetPool(0); SfxItemPool::Free(pAttrPool); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/swwait.cxx b/sw/source/ui/app/swwait.cxx index e8bf2f15ad..abd1d823e7 100644 --- a/sw/source/ui/app/swwait.cxx +++ b/sw/source/ui/app/swwait.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,3 +74,4 @@ SwWait::~SwWait() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/cctrl/actctrl.cxx b/sw/source/ui/cctrl/actctrl.cxx index 2ff446673d..01b1a52f74 100644 --- a/sw/source/ui/cctrl/actctrl.cxx +++ b/sw/source/ui/cctrl/actctrl.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -28,14 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - - -#include <tools/list.hxx> #include "actctrl.hxx" - - void NumEditAction::Action() { aActionLink.Call( this ); @@ -64,10 +59,6 @@ long NumEditAction::Notify( NotifyEvent& rNEvt ) return nHandled; } -/*------------------------------------------------------------------------ - Beschreibung: KeyInput fuer ShortName - Edits ohne Spaces -------------------------------------------------------------------------*/ - NoSpaceEdit::NoSpaceEdit( Window* pParent, const ResId& rResId) : Edit(pParent, rResId), sForbiddenChars(String::CreateFromAscii(" ")) @@ -90,9 +81,7 @@ void NoSpaceEdit::KeyInput(const KeyEvent& rEvt) if(bCallParent) Edit::KeyInput(rEvt); } -/* -----------------------------11.02.00 15:28-------------------------------- - ---------------------------------------------------------------------------*/ void NoSpaceEdit::Modify() { Selection aSel = GetSelection(); @@ -112,15 +101,11 @@ void NoSpaceEdit::Modify() if(GetModifyHdl().IsSet()) GetModifyHdl().Call(this); } -/* -----------------25.06.2003 15:57----------------- - --------------------------------------------------*/ ReturnActionEdit::~ReturnActionEdit() { -} -/* -----------------25.06.2003 15:58----------------- +} - --------------------------------------------------*/ void ReturnActionEdit::KeyInput( const KeyEvent& rEvt) { const KeyCode aKeyCode = rEvt.GetKeyCode(); @@ -130,9 +115,9 @@ void ReturnActionEdit::KeyInput( const KeyEvent& rEvt) { if(aReturnActionLink.IsSet()) aReturnActionLink.Call(this); - } - else + } + else Edit::KeyInput(rEvt); -} - +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/cctrl/popbox.cxx b/sw/source/ui/cctrl/popbox.cxx index d5e3842a4f..da00b52ce8 100644 --- a/sw/source/ui/cctrl/popbox.cxx +++ b/sw/source/ui/cctrl/popbox.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,29 +31,20 @@ -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <swtypes.hxx> #include <popbox.hxx> #include <navipi.hxx> - -// --- class SwHelpToolBox --------------------------------------------- - - SwHelpToolBox::SwHelpToolBox( SwNavigationPI* pParent, const ResId& rResId ) : ToolBox( pParent, rResId ), DropTargetHelper( this ) { } - void SwHelpToolBox::MouseButtonDown(const MouseEvent &rEvt) { - // Zuerst DoubleClick-Link auswerten - // Dessen Returnwert entscheidet ueber andere Verarbeitung - // Doppelclickhandler nur, wenn nicht auf einen Button geclickt wurde + // If doubleclick is detected use doubleclick handler if(rEvt.GetButtons() == MOUSE_RIGHT && 0 == GetItemId(rEvt.GetPosPixel())) { @@ -62,20 +54,14 @@ void SwHelpToolBox::MouseButtonDown(const MouseEvent &rEvt) ToolBox::MouseButtonDown(rEvt); } - long SwHelpToolBox::DoubleClick( ToolBox* pCaller ) { - // kein Doppelklick auf einen Button + // No doubleclick on button if( 0 == pCaller->GetCurItemId() && aDoubleClickLink.Call(0) ) return sal_True; return sal_False; } -/*-----------------26.02.94 00:36------------------- - dtor ueberladen ---------------------------------------------------*/ - - SwHelpToolBox::~SwHelpToolBox() {} sal_Int8 SwHelpToolBox::AcceptDrop( const AcceptDropEvent& rEvt ) @@ -89,3 +75,4 @@ sal_Int8 SwHelpToolBox::ExecuteDrop( const ExecuteDropEvent& rEvt ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/cctrl/swlbox.cxx b/sw/source/ui/cctrl/swlbox.cxx index e732f2bf4a..22a64fd6b0 100644 --- a/sw/source/ui/cctrl/swlbox.cxx +++ b/sw/source/ui/cctrl/swlbox.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,7 +30,7 @@ #include "precompiled_sw.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <unotools/charclass.hxx> #include <swtypes.hxx> #include <swlbox.hxx> @@ -39,11 +40,7 @@ using namespace nsSwComboBoxStyle; SV_IMPL_PTRARR(SwEntryLst, SwBoxEntry*) -/*-------------------------------------------------------------------- - Beschreibung: Ein ListboxElement - --------------------------------------------------------------------*/ - - +// Description: ListboxElement SwBoxEntry::SwBoxEntry() : bModified(sal_False), bNew(sal_False), @@ -51,7 +48,6 @@ SwBoxEntry::SwBoxEntry() : { } - SwBoxEntry::SwBoxEntry(const String& aNam, sal_uInt16 nIdx) : bModified(sal_False), bNew(sal_False), @@ -60,23 +56,19 @@ SwBoxEntry::SwBoxEntry(const String& aNam, sal_uInt16 nIdx) : { } - SwBoxEntry::SwBoxEntry(const SwBoxEntry& rOld) : bModified(rOld.bModified), bNew(rOld.bNew), aName(rOld.aName), nId(rOld.nId) { - } - - SwComboBox::SwComboBox(Window* pParent, const ResId& rId, sal_uInt16 nStyleBits ): ComboBox(pParent, rId), nStyle(nStyleBits) { - // Verwaltung fuer die Stringlist aus der Resource aufbauen + // create administration for the resource's Stringlist sal_uInt16 nSize = GetEntryCount(); for( sal_uInt16 i=0; i < nSize; ++i ) { @@ -85,67 +77,39 @@ SwComboBox::SwComboBox(Window* pParent, const ResId& rId, sal_uInt16 nStyleBits } } -/*-------------------------------------------------------------------- - Beschreibung: Basisklasse Dtor - --------------------------------------------------------------------*/ - - +// Basic class Dtor SwComboBox::~SwComboBox() { -// das erledigen die Listen doch schon selbst im DTOR! -// aEntryLst.DeleteAndDestroy(0, aEntryLst.Count()); -// aDelEntryLst.DeleteAndDestroy(0, aDelEntryLst.Count()); } -/*-------------------------------------------------------------------- - Beschreibung: Eintrag in die ComboBox aufnehmen - --------------------------------------------------------------------*/ - - void SwComboBox::InsertEntry(const SwBoxEntry& rEntry) { InsertSorted(new SwBoxEntry(rEntry)); } -/*-------------------------------------------------------------------- - Beschreibung: Eintrag aus der Liste loeschen - --------------------------------------------------------------------*/ - - void SwComboBox::RemoveEntry(sal_uInt16 nPos) { if(nPos >= aEntryLst.Count()) return; - // Altes Element austragen + // Remove old element SwBoxEntry* pEntry = aEntryLst[nPos]; aEntryLst.Remove(nPos, 1); ComboBox::RemoveEntry(nPos); - // keine neuen Eintraege in die Liste mit aufnehmen + // Don't add new entries to the list if(pEntry->bNew) return; - // in DeleteListe eintragen + // add to DelEntryLst aDelEntryLst.C40_INSERT(SwBoxEntry, pEntry, aDelEntryLst.Count()); } - - -/*-------------------------------------------------------------------- - Beschreibung: Position by Name - --------------------------------------------------------------------*/ - sal_uInt16 SwComboBox::GetEntryPos(const SwBoxEntry& rEntry) const { return ComboBox::GetEntryPos(rEntry.aName); } -/*-------------------------------------------------------------------- - Beschreibung: Rund um die Entries - --------------------------------------------------------------------*/ - - const SwBoxEntry& SwComboBox::GetEntry(sal_uInt16 nPos) const { if(nPos < aEntryLst.Count()) @@ -154,17 +118,11 @@ const SwBoxEntry& SwComboBox::GetEntry(sal_uInt16 nPos) const return aDefault; } -/*-------------------------------------------------------------------- - Beschreibung: geloeschte Eintraege - --------------------------------------------------------------------*/ - - sal_uInt16 SwComboBox::GetRemovedCount() const { return aDelEntryLst.Count(); } - const SwBoxEntry& SwComboBox::GetRemovedEntry(sal_uInt16 nPos) const { if(nPos < aDelEntryLst.Count()) @@ -173,11 +131,6 @@ const SwBoxEntry& SwComboBox::GetRemovedEntry(sal_uInt16 nPos) const return aDefault; } -/*-------------------------------------------------------------------- - Beschreibung: Sortiert einfuegen - --------------------------------------------------------------------*/ - - void SwComboBox::InsertSorted(SwBoxEntry* pEntry) { ComboBox::InsertEntry(pEntry->aName); @@ -185,12 +138,6 @@ void SwComboBox::InsertSorted(SwBoxEntry* pEntry) aEntryLst.C40_INSERT(SwBoxEntry, pEntry, nPos); } - -/*-------------------------------------------------------------------- - Beschreibung: Je nach Option bestimmte Zeichen ausblenden - --------------------------------------------------------------------*/ - - void SwComboBox::KeyInput( const KeyEvent& rKEvt ) { sal_uInt16 nChar = rKEvt.GetCharCode(); @@ -208,13 +155,7 @@ void SwComboBox::KeyInput( const KeyEvent& rKEvt ) ComboBox::KeyInput(rKEvt); } - - -/*-------------------------------------------------------------------- - Beschreibung: Text nach Option konvertieren - --------------------------------------------------------------------*/ - - +// Convert text according to option String SwComboBox::GetText() const { String aTxt( ComboBox::GetText() ); @@ -229,3 +170,4 @@ String SwComboBox::GetText() const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx index 27882aee6e..b4dd39ee59 100644 --- a/sw/source/ui/chrdlg/break.cxx +++ b/sw/source/ui/chrdlg/break.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,33 +36,21 @@ #include <sfx2/request.hxx> #include <svl/stritem.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <uitool.hxx> #include <swtypes.hxx> #include <wrtsh.hxx> -#ifndef _BASESH_HXX #include <basesh.hxx> -#endif -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <viewopt.hxx> #include <break.hxx> #include <pagedesc.hxx> #include <poolfmt.hxx> -#ifndef _BREAK_HRC #include <break.hrc> -#endif -#ifndef _CHRDLG_HRC #include <chrdlg.hrc> -#endif #include <SwStyleNameMapper.hxx> void SwBreakDlg::Apply() @@ -83,7 +72,6 @@ void SwBreakDlg::Apply() } } - IMPL_LINK_INLINE_START( SwBreakDlg, ClickHdl, void *, EMPTYARG ) { CheckEnable(); @@ -92,7 +80,7 @@ IMPL_LINK_INLINE_START( SwBreakDlg, ClickHdl, void *, EMPTYARG ) IMPL_LINK_INLINE_END( SwBreakDlg, ClickHdl, void *, EMPTYARG ) /*------------------------------------------------------------------------ - Beschreibung: Handler fuer Aendern Seitenummer + Description: Handler for Change Page Number ------------------------------------------------------------------------*/ IMPL_LINK_INLINE_START( SwBreakDlg, PageNumHdl, CheckBox *, pBox ) @@ -104,7 +92,7 @@ IMPL_LINK_INLINE_START( SwBreakDlg, PageNumHdl, CheckBox *, pBox ) IMPL_LINK_INLINE_END( SwBreakDlg, PageNumHdl, CheckBox *, pBox ) /*------------------------------------------------------------------------ - Beschreibung: Durch Aendern der Seitennummer wird die Checkbox gecheckt. + Description: By changing the Page number the checkbox is checked. ------------------------------------------------------------------------*/ IMPL_LINK_INLINE_START( SwBreakDlg, PageNumModifyHdl, Edit *, EMPTYARG ) @@ -115,18 +103,18 @@ IMPL_LINK_INLINE_START( SwBreakDlg, PageNumModifyHdl, Edit *, EMPTYARG ) IMPL_LINK_INLINE_END( SwBreakDlg, PageNumModifyHdl, Edit *, EMPTYARG ) /*------------------------------------------------------------------------ - Beschreibung: Ok-Handler; - prueft, ob die Seitenummer nPage eine legale Seitennummer - ist (linke Seiten mit geraden Nummern etc. bei einer Seitenvorlage - mit wechselnden Seiten) + Description: Ok-Handler; + checks whether pagenumber nPage is a legal pagenumber + (left pages with even numbers etc. for a page template + with alternating pages) ------------------------------------------------------------------------*/ IMPL_LINK( SwBreakDlg, OkHdl, Button *, EMPTYARG ) { if(aPageNumBox.IsChecked()) { - // wenn unterschiedliche Seitenvorlagen, testen auf Gueltigkeit + // In case of differing page descriptions, test validity const sal_uInt16 nPos = aPageCollBox.GetSelectEntryPos(); - // auf Position 0 steht 'Ohne'. + // position 0 says 'Without'. const SwPageDesc *pPageDesc; if ( 0 != nPos && LISTBOX_ENTRY_NOTFOUND != nPos ) pPageDesc = rSh.FindPageDescByName( aPageCollBox.GetSelectEntry(), @@ -134,7 +122,7 @@ IMPL_LINK( SwBreakDlg, OkHdl, Button *, EMPTYARG ) else pPageDesc = &rSh.GetPageDesc(rSh.GetCurPageDesc()); - ASSERT(pPageDesc, Seitenvorlage nicht gefunden.); + OSL_ENSURE(pPageDesc, "Page description not found."); const sal_uInt16 nUserPage = sal_uInt16(aPageNumEdit.GetValue()); sal_Bool bOk = sal_True; switch(pPageDesc->GetUseOn()) @@ -192,7 +180,7 @@ SwBreakDlg::SwBreakDlg( Window *pParent, SwWrtShell &rS ) : aPageNumEdit.SetModifyHdl(LINK(this,SwBreakDlg,PageNumModifyHdl)); - // Einfuegen der vorhandenen Seitenvorlagen in die Listbox + // Insert page description to Listbox const sal_uInt16 nCount = rSh.GetPageDescCnt(); sal_uInt16 i; @@ -216,7 +204,6 @@ SwBreakDlg::SwBreakDlg( Window *pParent, SwWrtShell &rS ) : FreeResource(); } - void SwBreakDlg::CheckEnable() { sal_Bool bEnable = sal_True; @@ -241,7 +228,7 @@ void SwBreakDlg::CheckEnable() bEnable &= bPage; if ( bEnable ) { - // auf Position 0 steht 'Ohne' Seitenvorlage. + // position 0 says 'Without' page template. const sal_uInt16 nPos = aPageCollBox.GetSelectEntryPos(); if ( 0 == nPos || LISTBOX_ENTRY_NOTFOUND == nPos ) bEnable = sal_False; @@ -253,3 +240,5 @@ void SwBreakDlg::CheckEnable() SwBreakDlg::~SwBreakDlg() { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/chrdlg/ccoll.cxx b/sw/source/ui/chrdlg/ccoll.cxx index 4c8cca1a1f..80461d7d6c 100644 --- a/sw/source/ui/chrdlg/ccoll.cxx +++ b/sw/source/ui/chrdlg/ccoll.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -28,17 +29,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - #include "cmdid.h" -#include <tools/list.hxx> #include "swmodule.hxx" #include "view.hxx" #include "wrtsh.hxx" #include "globals.hrc" #include "helpid.h" - #include <sfx2/styfitem.hxx> #include "uitool.hxx" @@ -108,7 +105,7 @@ rtl::OUString GetCommandContextByIndex( sal_Int16 nIndex ) rtl::OUString aRes; if (0 <= nIndex && nIndex < COND_COMMAND_COUNT) { - aRes = C2U( aCommandContext[ nIndex ] ); + aRes = rtl::OUString::createFromAscii( aCommandContext[ nIndex ] ); } return aRes; } @@ -152,7 +149,7 @@ CommandStruct SwCondCollItem::aCmds[] = TYPEINIT1_AUTOFACTORY(SwCondCollItem, SfxPoolItem) /**************************************************************************** - Item fuer den Transport der Bedingungstabelle + Item for the transport of the condition table ****************************************************************************/ @@ -161,33 +158,19 @@ SwCondCollItem::SwCondCollItem(sal_uInt16 _nWhich ) : { } -/**************************************************************************** - -****************************************************************************/ - SwCondCollItem::~SwCondCollItem() { } -/**************************************************************************** - -****************************************************************************/ - - SfxPoolItem* SwCondCollItem::Clone( SfxItemPool * /*pPool*/ ) const { return new SwCondCollItem(*this); } -/**************************************************************************** - -****************************************************************************/ - - int SwCondCollItem::operator==( const SfxPoolItem& rItem) const { - DBG_ASSERT( SfxPoolItem::operator==(rItem), "unterschiedliche Typen" ); + OSL_ENSURE( SfxPoolItem::operator==(rItem), "different types" ); sal_Bool bReturn = sal_True; for(sal_uInt16 i = 0; i < COND_COMMAND_COUNT; i++) if(sStyles[i] != ((SwCondCollItem&)rItem).sStyles[i]) @@ -199,38 +182,20 @@ int SwCondCollItem::operator==( const SfxPoolItem& rItem) const return bReturn; } -/**************************************************************************** - -****************************************************************************/ - - const String& SwCondCollItem::GetStyle(sal_uInt16 nPos) const { return nPos < COND_COMMAND_COUNT ? sStyles[nPos] : aEmptyStr; } -/**************************************************************************** - -****************************************************************************/ - - void SwCondCollItem::SetStyle(const String* pStyle, sal_uInt16 nPos) { if( nPos < COND_COMMAND_COUNT ) sStyles[nPos] = pStyle ? *pStyle : aEmptyStr; } - -/**************************************************************************** - -****************************************************************************/ - - const CommandStruct* SwCondCollItem::GetCmds() { return aCmds; } - - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/chrdlg/ccoll.src b/sw/source/ui/chrdlg/ccoll.src index 41dcaa9852..4245782d15 100644 --- a/sw/source/ui/chrdlg/ccoll.src +++ b/sw/source/ui/chrdlg/ccoll.src @@ -26,7 +26,6 @@ ************************************************************************/ // #pragma ****************************************************************** - // #include ***************************************************************** #include "globals.hrc" #include "chrdlg.hrc" #include "ccoll.hrc" diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index 65786cea64..4d305063fc 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -35,48 +36,29 @@ #include <hintids.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <svl/urihelper.hxx> #include <svl/stritem.hxx> #include <editeng/flstitem.hxx> #include <svx/htmlmode.hxx> #include <svl/cjkoptions.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _HELPID_H #include <helpid.h> -#endif #include <swtypes.hxx> -#include <errhdl.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <uitool.hxx> #include <fmtinfmt.hxx> #include <macassgn.hxx> -#ifndef _CHRDLG_HXX -#include <chrdlg.hxx> // der Dialog -#endif +#include <chrdlg.hxx> // the dialog #include <swmodule.hxx> #include <poolfmt.hxx> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _CHRDLG_HRC #include <chrdlg.hrc> -#endif -#ifndef _CHARDLG_HRC #include <chardlg.hrc> -#endif #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/XFilePicker.hpp> #include <SwStyleNameMapper.hxx> @@ -93,11 +75,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; using namespace ::sfx2; -/*-------------------------------------------------------------------- - Beschreibung: Der Traeger des Dialoges - --------------------------------------------------------------------*/ - - SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet, const String* pStr, sal_Bool bIsDrwTxtDlg) : SfxTabDialog(pParent, SW_RES(DLG_CHAR), &rCoreSet, pStr != 0), @@ -106,8 +83,6 @@ SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet, { FreeResource(); - // bspFonr fuer beide Bsp-TabPages - if(pStr) { String aTmp( GetText() ); @@ -117,7 +92,7 @@ SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet, SetText(aTmp); } SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AddTabPage(TP_CHAR_STD, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), 0 ); AddTabPage(TP_CHAR_EXT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 0 ); AddTabPage(TP_CHAR_POS, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), 0 ); @@ -135,21 +110,15 @@ SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet, else if(!aCJKOptions.IsDoubleLinesEnabled()) RemoveTabPage( TP_CHAR_TWOLN ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwCharDlg::~SwCharDlg() { } /*-------------------------------------------------------------------- - Beschreibung: FontList setzen + Description: set FontList --------------------------------------------------------------------*/ - - void SwCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); @@ -186,10 +155,6 @@ void SwCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) } } -/*-----------------14.08.96 11.28------------------- - ---------------------------------------------------*/ - SwCharURLPage::SwCharURLPage( Window* pParent, const SfxItemSet& rCoreSet ) : SfxTabPage( pParent, SW_RES( TP_CHAR_URL ), rCoreSet ), @@ -245,38 +210,28 @@ SwCharURLPage::SwCharURLPage( Window* pParent, TargetList* pList = new TargetList; const SfxFrame& rFrame = pView->GetViewFrame()->GetTopFrame(); rFrame.GetTargetList(*pList); - sal_uInt16 nCount = (sal_uInt16)pList->Count(); - if( nCount ) + if ( !pList->empty() ) { - sal_uInt16 i; + size_t nCount = pList->size(); + size_t i; for ( i = 0; i < nCount; i++ ) { - aTargetFrmLB.InsertEntry(*pList->GetObject(i)); + aTargetFrmLB.InsertEntry( *pList->at( i ) ); } - for ( i = nCount; i; i-- ) + for ( i = nCount; i; ) { - delete pList->GetObject( i - 1 ); + delete pList->at( --i ); } } delete pList; - - } -/*-----------------15.08.96 09.04------------------- - ---------------------------------------------------*/ - SwCharURLPage::~SwCharURLPage() { delete pINetItem; } -/*-----------------14.08.96 11.31------------------- - ---------------------------------------------------*/ - void SwCharURLPage::Reset(const SfxItemSet& rSet) { const SfxPoolItem* pItem; @@ -315,17 +270,13 @@ void SwCharURLPage::Reset(const SfxItemSet& rSet) } } -/*-----------------14.08.96 11.32------------------- - ---------------------------------------------------*/ - sal_Bool SwCharURLPage::FillItemSet(SfxItemSet& rSet) { ::rtl::OUString sURL = aURLED.GetText(); if(sURL.getLength()) { sURL = URIHelper::SmartRel2Abs(INetURLObject(), sURL, Link(), false ); - // #i100683# file URLs should be normalized in the UI + // #i100683# file URLs should be normalized in the UI static const sal_Char* pFile = "file:"; sal_Int32 nLength = ((sal_Int32)sizeof(pFile)-1); if( sURL.copy(0, nLength ).equalsAsciiL( pFile, nLength )) @@ -338,7 +289,7 @@ sal_Bool SwCharURLPage::FillItemSet(SfxItemSet& rSet) bModified |= aNameED.IsModified(); bModified |= aTargetFrmLB.GetSavedValue() != aTargetFrmLB.GetText(); - //zuerst die gueltigen Einstellungen setzen + // set valid settings first String sEntry = aVisitedLB.GetSelectEntry(); sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName( sEntry, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT); aINetFmt.SetVisitedFmtId(nId); @@ -368,21 +319,12 @@ sal_Bool SwCharURLPage::FillItemSet(SfxItemSet& rSet) return bModified; } - -/*-----------------14.08.96 11.30------------------- - ---------------------------------------------------*/ - SfxTabPage* SwCharURLPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return ( new SwCharURLPage( pParent, rAttrSet ) ); } -/*-----------------14.08.96 15.00------------------- - ---------------------------------------------------*/ - IMPL_LINK( SwCharURLPage, InsertFileHdl, PushButton *, EMPTYARG ) { FileDialogHelper aDlgHelper( TemplateDescription::FILEOPEN_SIMPLE, 0 ); @@ -393,9 +335,6 @@ IMPL_LINK( SwCharURLPage, InsertFileHdl, PushButton *, EMPTYARG ) } return 0; } -/*-----------------14.08.96 15.00------------------- - ---------------------------------------------------*/ IMPL_LINK( SwCharURLPage, EventHdl, PushButton *, EMPTYARG ) { @@ -405,3 +344,4 @@ IMPL_LINK( SwCharURLPage, EventHdl, PushButton *, EMPTYARG ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/chrdlg/chrdlg.src b/sw/source/ui/chrdlg/chrdlg.src index 27e897e29e..b9ebfe1cd3 100644 --- a/sw/source/ui/chrdlg/chrdlg.src +++ b/sw/source/ui/chrdlg/chrdlg.src @@ -42,7 +42,6 @@ InfoBox MSG_ILLEGAL_PAGENUM { BUTTONS = WB_OK ; DEFBUTTON = WB_DEF_OK ; - /* ### ACHTUNG: Neuer Text in Resource? Seitennummer kann nicht gesetzt werden. Auf linken Seiten d�rfen nur gerade Seitenzahlen, auf rechten Seiten nur ungerade Seitenzahlen verwendet werden. : Seitennummer kann nicht gesetzt werden. Auf linken Seiten d�rfen nur gerade Seitenzahlen, auf rechten Seiten nur ungerade Seitenzahlen verwendet werden. */ Message [ en-US ] = "Page numbers cannot be applied to the current page. Even numbers can be used on left pages, odd numbers on right pages." ; }; diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 3ce7dfd6ab..6e1e9fce46 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,11 +32,12 @@ #undef SW_DLLIMPLEMENTATION #endif - - #include <hintids.hxx> #define _SVSTDARR_STRINGSDTOR #define _SVSTDARR_STRINGSISORTDTOR +#define _SVSTDARR_XUB_STRLEN +#define _SVSTDARR_USHORTS +#define _SVSTDARR_ULONGS #include <svl/svstdarr.hxx> #include "cmdid.h" @@ -44,10 +46,7 @@ #include "wrtsh.hxx" #include "globals.hrc" - -#ifndef _METRIC_HXX //autogen #include <vcl/metric.hxx> -#endif #include <svl/stritem.hxx> #include <editeng/fontitem.hxx> #include <svx/htmlmode.hxx> @@ -55,18 +54,11 @@ #include <editeng/svxfont.hxx> #include <vcl/print.hxx> #include <sfx2/printer.hxx> -#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include <com/sun/star/i18n/ScriptType.hdl> -#endif #include <editeng/scripttypeitem.hxx> #include <com/sun/star/i18n/XBreakIterator.hpp> #include <comphelper/processfactory.hxx> -#define _SVSTDARR_XUB_STRLEN -#define _SVSTDARR_USHORTS -#define _SVSTDARR_ULONGS -#include <svl/svstdarr.hxx> - #include "charatr.hxx" #include "viewopt.hxx" #include "drpcps.hxx" @@ -89,15 +81,11 @@ using namespace ::com::sun::star::lang; // Globals ****************************************************************** -static sal_uInt16 __FAR_DATA aPageRg[] = { +static sal_uInt16 aPageRg[] = { RES_PARATR_DROP, RES_PARATR_DROP, 0 }; - - -// class SwDropCapsPict ***************************************************** - class SwDropCapsPict : public Control { String maText; @@ -129,8 +117,14 @@ class SwDropCapsPict : public Control void GetFontSettings( const SwDropCapsPage& _rPage, Font& _rFont, sal_uInt16 _nWhich ); public: - SwDropCapsPict(Window *pParent, const ResId &rResId) : - Control(pParent, rResId), mpPrinter( NULL ), mbDelPrinter( sal_False ) {} + SwDropCapsPict(Window *pParent, const ResId &rResId) + : Control(pParent, rResId) + , mnTotLineH(0) + , mnLineH(0) + , mnTextH(0) + , mpPrinter( NULL ) + , mbDelPrinter( sal_False ) + {} ~SwDropCapsPict(); void UpdatePaintSettings( void ); // also invalidates control! @@ -177,7 +171,7 @@ inline void SwDropCapsPict::InitPrinter( void ) } /**************************************************************************** -Default-String aus Zeichenanzahl erzeugen (A, AB, ABC, ...) + Create Default-String from character-count (A, AB, ABC, ...) ****************************************************************************/ @@ -200,21 +194,12 @@ static void calcFontHeightAnyAscent( OutputDevice* _pWin, Font& _rFont, long& _n } } -/**************************************************************************** -Pict: Dtor -****************************************************************************/ - - SwDropCapsPict::~SwDropCapsPict() { if( mbDelPrinter ) delete mpPrinter; } -/**************************************************************************** -Pict: Update Font -****************************************************************************/ - #define LINES 10 #define BORDER 2 @@ -245,7 +230,7 @@ void SwDropCapsPict::UpdatePaintSettings( void ) SwDropCapsPage* pPage = ( SwDropCapsPage* ) GetParent(); if (!pPage->aTemplateBox.GetSelectEntryPos()) { - // Font an Absatzanfang erfragen + // query the Font at paragraph's beginning pPage->rSh.SttCrsrMove(); pPage->rSh.Push(); pPage->rSh.ClearMark(); @@ -266,11 +251,11 @@ void SwDropCapsPict::UpdatePaintSettings( void ) } else { - // Font an Zeichenvorlage erfragen + // query Font at character template SwCharFmt *pFmt = pPage->rSh.GetCharStyle( pPage->aTemplateBox.GetSelectEntry(), SwWrtShell::GETSTYLE_CREATEANY ); - ASSERT(pFmt, "Zeichenvorlage existiert nicht!"); + OSL_ENSURE(pFmt, "character style doesn't exist!"); const SvxFontItem &rFmtFont = pFmt->GetFont(); aFont.SetFamily (rFmtFont.GetFamily()); @@ -334,13 +319,13 @@ void SwDropCapsPict::Paint(const Rectangle &/*rRect*/) Size (aOutputSizePixel.Width () - 2 * BORDER, aOutputSizePixel.Height() - 2 * BORDER)))); - ASSERT(mnLineH > 0, "So klein lassen wir uns nicht machen"); + OSL_ENSURE(mnLineH > 0, "We cannot make it that small"); long nY0 = (aOutputSizePixel.Height() - (LINES * mnTotLineH)) / 2; SetFillColor( maTextLineColor ); for (sal_uInt16 i = 0; i < LINES; ++i) DrawRect(Rectangle(Point(BORDER, nY0 + i * mnTotLineH), Size(aOutputSizePixel.Width() - 2 * BORDER, mnLineH))); - // Texthintergrund mit Abstand (240 twips ~ 1 Zeilenhoehe) + // Text background with gap (240 twips ~ 1 line height) sal_uLong lDistance = mnDistance; sal_uInt16 nDistW = (sal_uInt16) (sal_uLong) (((lDistance * 100) / 240) * mnTotLineH) / 100; SetFillColor( maBackColor ); @@ -350,7 +335,7 @@ void SwDropCapsPict::Paint(const Rectangle &/*rRect*/) aTextSize.Width() += nDistW; DrawRect( Rectangle( Point( BORDER, nY0 ), aTextSize ) ); - // Text zeichnen + // draw Text DrawPrev( Point( BORDER, nY0 - mnLeading ) ); } @@ -418,7 +403,7 @@ void SwDropCapsPict::CheckScript( void ) { Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); xBreak = Reference< I18N::XBreakIterator >(xMSF->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) ),UNO_QUERY); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) ),UNO_QUERY); } if( xBreak.is() ) { @@ -536,11 +521,6 @@ void SwDropCapsPict::_InitPrinter() } } -/**************************************************************************** -Dlg: Ctor -****************************************************************************/ - - SwDropCapsDlg::SwDropCapsDlg(Window *pParent, const SfxItemSet &rSet ) : SfxSingleTabDialog(pParent, rSet, 0) @@ -551,20 +531,10 @@ SwDropCapsDlg::SwDropCapsDlg(Window *pParent, const SfxItemSet &rSet ) : SetTabPage(pNewPage); } -/**************************************************************************** -Dlg: Dtor -****************************************************************************/ - - SwDropCapsDlg::~SwDropCapsDlg() { } -/**************************************************************************** -Page: Ctor -****************************************************************************/ - - SwDropCapsPage::SwDropCapsPage(Window *pParent, const SfxItemSet &rSet) : SfxTabPage(pParent, SW_RES(TP_DROPCAPS), rSet), @@ -597,16 +567,16 @@ SwDropCapsPage::SwDropCapsPage(Window *pParent, const SfxItemSet &rSet) : sal_uInt16 nHtmlMode = ::GetHtmlMode((const SwDocShell*)SfxObjectShell::Current()); bHtmlMode = nHtmlMode & HTMLMODE_ON ? sal_True : sal_False; - //Im Vorlagendialog kann der Text nicht beeinflusst werden + // In the template dialog the text is not influenceable aTextText.Enable( !bFormat ); aTextEdit.Enable( !bFormat ); - // Metriken + // Metrics SetMetric( aDistanceField, GetDfltMetric(bHtmlMode) ); pPict->SetBorderStyle( WINDOW_BORDER_MONO ); - // Handler installieren + // Install handler Link aLk = LINK(this, SwDropCapsPage, ModifyHdl); aDropCapsField.SetModifyHdl( aLk ); aLinesField .SetModifyHdl( aLk ); @@ -617,17 +587,11 @@ SwDropCapsPage::SwDropCapsPage(Window *pParent, const SfxItemSet &rSet) : aWholeWordCB .SetClickHdl (LINK(this, SwDropCapsPage, WholeWordHdl )); } -/**************************************************************************** -Page: Dtor -****************************************************************************/ - - SwDropCapsPage::~SwDropCapsPage() { delete pPict; } - int SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet) { if ( _pSet ) @@ -640,7 +604,6 @@ int SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet) Page: Factory ****************************************************************************/ - SfxTabPage* SwDropCapsPage::Create(Window *pParent, const SfxItemSet &rSet) { @@ -651,7 +614,6 @@ SfxTabPage* SwDropCapsPage::Create(Window *pParent, Page: FillItemSet-Overload ****************************************************************************/ - sal_Bool SwDropCapsPage::FillItemSet(SfxItemSet &rSet) { if(bModified) @@ -663,10 +625,9 @@ sal_Bool SwDropCapsPage::FillItemSet(SfxItemSet &rSet) Page: Reset-Overload ****************************************************************************/ - void SwDropCapsPage::Reset(const SfxItemSet &rSet) { - // Zeichen, Zeilen, Abstand und Text + // Characters, lines, gap and text SwFmtDrop aFmtDrop((SwFmtDrop &) rSet.Get(RES_PARATR_DROP)); if (aFmtDrop.GetLines() > 1) { @@ -685,12 +646,13 @@ void SwDropCapsPage::Reset(const SfxItemSet &rSet) ::FillCharStyleListBox(aTemplateBox, rSh.GetView().GetDocShell(), sal_True); aTemplateBox.InsertEntry(SW_RESSTR(SW_STR_NONE), 0); - // Vorlage defaulten + + // Reset format aTemplateBox.SelectEntryPos(0); if (aFmtDrop.GetCharFmt()) aTemplateBox.SelectEntry(aFmtDrop.GetCharFmt()->GetName()); - // Controls enablen + // Enable controls aDropCapsBox.Check(aFmtDrop.GetLines() > 1); const sal_uInt16 nVal = sal_uInt16(aDropCapsField.GetValue()); if (bFormat) @@ -712,7 +674,7 @@ void SwDropCapsPage::Reset(const SfxItemSet &rSet) } /**************************************************************************** -Page: Click-Handler der CheckBox +Page: CheckBox's Click-Handler ****************************************************************************/ @@ -747,7 +709,7 @@ IMPL_LINK( SwDropCapsPage, ClickHdl, Button *, EMPTYARG ) } /**************************************************************************** -Page: Click-Handler der CheckBox +Page: CheckBox's Click-Handler ****************************************************************************/ @@ -763,7 +725,7 @@ IMPL_LINK( SwDropCapsPage, WholeWordHdl, CheckBox *, EMPTYARG ) } /**************************************************************************** -Page: Modify-Handler der SpinFields +Page: SpinFields' Modify-Handler ****************************************************************************/ @@ -771,7 +733,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit ) { String sPreview; - // Ggf. Text setzen + // set text if applicable if (pEdit == &aDropCapsField) { sal_uInt16 nVal; @@ -801,7 +763,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit ) if (bSetText) aTextEdit.SetText(sPreview); } - else if (pEdit == &aTextEdit) // Ggf. Anzahl setzen + else if (pEdit == &aTextEdit) // set quantity if applicable { sal_uInt16 nTmp = aTextEdit.GetText().Len(); aDropCapsField.SetValue(Max((sal_uInt16)1, nTmp)); @@ -809,7 +771,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit ) sPreview = aTextEdit.GetText().Copy(0, nTmp); } - // Bild anpassen + // adjust image if (pEdit == &aDropCapsField || pEdit == &aTextEdit) pPict->SetText (sPreview); else if (pEdit == &aLinesField) @@ -823,7 +785,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit ) } /**************************************************************************** -Page: Select-Handler der Template-Box. +Page: Template-Box' Select-Handler. *****************************************************************************/ @@ -835,13 +797,11 @@ IMPL_LINK_INLINE_START( SwDropCapsPage, SelectHdl, ListBox *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwDropCapsPage, SelectHdl, ListBox *, EMPTYARG ) - sal_uInt16* SwDropCapsPage::GetRanges() { return aPageRg; } - void SwDropCapsPage::FillSet( SfxItemSet &rSet ) { if(bModified) @@ -851,13 +811,13 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet ) sal_Bool bOn = aDropCapsBox.IsChecked(); if(bOn) { - // Anzahl, Zeilen, Abstand + // quantity, lines, gap aFmt.GetChars() = (sal_uInt8) aDropCapsField.GetValue(); aFmt.GetLines() = (sal_uInt8) aLinesField.GetValue(); aFmt.GetDistance() = (sal_uInt16) aDistanceField.Denormalize(aDistanceField.GetValue(FUNIT_TWIP)); aFmt.GetWholeWord() = aWholeWordCB.IsChecked(); - // Vorlage + // template if (aTemplateBox.GetSelectEntryPos()) aFmt.SetCharFmt(rSh.GetCharStyle(aTemplateBox.GetSelectEntry())); } @@ -868,14 +828,14 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet ) aFmt.GetDistance() = 0; } - // Attribute setzen + // set attributes const SfxPoolItem* pOldItem; if(0 == (pOldItem = GetOldItem( rSet, FN_FORMAT_DROPCAPS )) || aFmt != *pOldItem ) rSet.Put(aFmt); - // Harte Textformatierung - // Bug 24974: In Gestalter/Vorlagenkatoplog macht das keinen Sinn!! + // hard text formatting + // Bug 24974: in designer/template catalog this doesn't make sense!! if( !bFormat && aDropCapsBox.IsChecked() ) { String sText(aTextEdit.GetText()); @@ -892,3 +852,4 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/chrdlg/drpcps.src b/sw/source/ui/chrdlg/drpcps.src index edf373fcd3..c07085f9f9 100644 --- a/sw/source/ui/chrdlg/drpcps.src +++ b/sw/source/ui/chrdlg/drpcps.src @@ -25,7 +25,6 @@ * ************************************************************************/ - // #include ***************************************************************** #include "globals.hrc" #include "chrdlg.hrc" #include "drpcps.hrc" diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index c476de9e42..f40b27fc35 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,8 +33,6 @@ #undef SW_DLLIMPLEMENTATION #endif - - #include "cmdid.h" #include "swtypes.hxx" #include "hintids.hxx" @@ -41,28 +40,24 @@ #include "helpid.h" #include <sfx2/objsh.hxx> #include <svx/htmlmode.hxx> -#ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> -#endif #include <svl/eitem.hxx> #include <svl/stritem.hxx> #include <svl/intitem.hxx> #include <fmtline.hxx> #include <numpara.hxx> #include <numpara.hrc> -// --> OD 2008-04-14 #outlinelevel# + #include <app.hrc> -// <-- + // Globals ****************************************************************** -static sal_uInt16 __FAR_DATA aPageRg[] = { +static sal_uInt16 aPageRg[] = { FN_NUMBER_NEWSTART, FN_NUMBER_NEWSTART_AT, 0 }; -/*-----------------31.01.98 08:34------------------- ---------------------------------------------------*/ SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent, const SfxItemSet& rAttr ) : SfxTabPage(pParent, SW_RES(TP_NUMPARA), rAttr), @@ -80,9 +75,7 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent, aRestartParaCountCB ( this, SW_RES( CB_RESTART_PARACOUNT ) ), aRestartFT ( this, SW_RES( FT_RESTART_NO ) ), aRestartNF ( this, SW_RES( NF_RESTART_PARA ) ), - // --> OD 2008-04-14 #outlinelevel# msOutlineNumbering( SW_RES( STR_OUTLINE_NUMBERING ) ), - // <-- bModified(sal_False), bCurNumrule(sal_False) { @@ -114,36 +107,24 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent, aNewStartNF.SetAccessibleName(aNewStartNumberCB.GetText()); aNewStartNF.SetAccessibleRelationLabeledBy(&aNewStartNumberCB); } -/*-----------------31.01.98 08:34------------------- ---------------------------------------------------*/ SwParagraphNumTabPage::~SwParagraphNumTabPage() { } -/*-----------------31.01.98 08:38------------------- - ---------------------------------------------------*/ SfxTabPage* SwParagraphNumTabPage::Create( Window* pParent, const SfxItemSet& rSet ) { return new SwParagraphNumTabPage(pParent, rSet); } -/*-----------------31.01.98 08:38------------------- - ---------------------------------------------------*/ sal_uInt16* SwParagraphNumTabPage::GetRanges() { return aPageRg; } -/*-----------------31.01.98 08:38------------------- - ---------------------------------------------------*/ sal_Bool SwParagraphNumTabPage::FillItemSet( SfxItemSet& rSet ) { - //<-#outline level, added by zhaojianwei if( aOutlineLvLB.GetSelectEntryPos() != aOutlineLvLB.GetSavedValue()) { sal_uInt16 aOutlineLv = aOutlineLvLB.GetSelectEntryPos(); @@ -154,7 +135,7 @@ sal_Bool SwParagraphNumTabPage::FillItemSet( SfxItemSet& rSet ) delete pOutlineLv; bModified = sal_True; } - //<-end + if( aNumberStyleLB.GetSelectEntryPos() != aNumberStyleLB.GetSavedValue()) { String aStyle; @@ -193,9 +174,6 @@ sal_Bool SwParagraphNumTabPage::FillItemSet( SfxItemSet& rSet ) return bModified; } -/*-----------------31.01.98 08:38------------------- - ---------------------------------------------------*/ void SwParagraphNumTabPage::Reset( const SfxItemSet& rSet ) { sal_Bool bHasNumberStyle = sal_False; @@ -223,7 +201,7 @@ void SwParagraphNumTabPage::Reset( const SfxItemSet& rSet ) if(!aStyle.Len()) aStyle = aNumberStyleLB.GetEntry(0); - if( aStyle.EqualsAscii("Outline"))// == String::CreateFromAscii("Outline")) //maybe need modify,zhaojianwei + if( aStyle.EqualsAscii("Outline")) { aNumberStyleLB.InsertEntry( msOutlineNumbering ); aNumberStyleLB.SelectEntry( msOutlineNumbering ); @@ -297,23 +275,18 @@ void SwParagraphNumTabPage::Reset( const SfxItemSet& rSet ) bModified = sal_False; } -/*-----------------31.01.98 08:38------------------- - ---------------------------------------------------*/ void SwParagraphNumTabPage::DisableOutline() { aOutlineLvFT.Disable(); aOutlineLvLB.Disable(); } + void SwParagraphNumTabPage::DisableNumbering() { aNumberStyleFT.Disable(); aNumberStyleLB.Disable(); } -/*-----------------31.01.98 08:38------------------- - ---------------------------------------------------*/ void SwParagraphNumTabPage::EnableNewStart() { aNewStartCB.Show(); @@ -321,9 +294,6 @@ void SwParagraphNumTabPage::EnableNewStart() aNewStartNF.Show(); } -/*-----------------31.01.98 08:56------------------- - ---------------------------------------------------*/ IMPL_LINK( SwParagraphNumTabPage, NewStartHdl_Impl, CheckBox*, EMPTYARG ) { sal_Bool bEnable = aNewStartCB.IsChecked(); @@ -332,9 +302,6 @@ IMPL_LINK( SwParagraphNumTabPage, NewStartHdl_Impl, CheckBox*, EMPTYARG ) return 0; } -/*-----------------05.02.98 10:01------------------- - ---------------------------------------------------*/ IMPL_LINK( SwParagraphNumTabPage, LineCountHdl_Impl, CheckBox* , EMPTYARG) { aRestartParaCountCB.Enable(aCountParaCB.IsChecked()); @@ -347,15 +314,8 @@ IMPL_LINK( SwParagraphNumTabPage, LineCountHdl_Impl, CheckBox* , EMPTYARG) return 0; } -/*-----------------05.02.98 13:39------------------- - ---------------------------------------------------*/ IMPL_LINK( SwParagraphNumTabPage, StyleHdl_Impl, ListBox*, pBox ) { -// String dd=aNumberStyleLB.GetSavedValue(); -// if( msOutlineNumbering == dd) - { - } sal_Bool bEnable = bCurNumrule || pBox->GetSelectEntryPos() > 0; aNewStartCB.Enable(bEnable); NewStartHdl_Impl(&aNewStartCB); @@ -364,3 +324,4 @@ IMPL_LINK( SwParagraphNumTabPage, StyleHdl_Impl, ListBox*, pBox ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/chrdlg/numpara.src b/sw/source/ui/chrdlg/numpara.src index 591333766b..9d2e30a64c 100644 --- a/sw/source/ui/chrdlg/numpara.src +++ b/sw/source/ui/chrdlg/numpara.src @@ -26,7 +26,6 @@ ************************************************************************/ // #pragma ****************************************************************** - // #include ***************************************************************** #include "globals.hrc" #include "chrdlg.hrc" #include "numpara.hrc" diff --git a/sw/source/ui/chrdlg/paradlg.src b/sw/source/ui/chrdlg/paradlg.src index 636e29f967..289877feaf 100644 --- a/sw/source/ui/chrdlg/paradlg.src +++ b/sw/source/ui/chrdlg/paradlg.src @@ -44,7 +44,6 @@ TabDialog DLG_PARA PageItem { Identifier = TP_PARA_STD ; - /* ### ACHTUNG: Neuer Text in Resource? Einz�ge und Abst�nde : Einz�ge und Abst�nde */ Text [ en-US ] = "Indents & Spacing" ; PageResID = TP_PARA_STD ; }; @@ -57,7 +56,6 @@ TabDialog DLG_PARA PageItem { Identifier = TP_PARA_EXT ; - /* ### ACHTUNG: Neuer Text in Resource? Textflu?: Textflu?*/ Text [ en-US ] = "Text Flow" ; PageResID = TP_PARA_EXT ; }; @@ -112,7 +110,6 @@ TabDialog DLG_DRAWPARA PageItem { Identifier = TP_PARA_STD ; - /* ### ACHTUNG: Neuer Text in Resource? Einz�ge und Abst�nde : Einz�ge und Abst�nde */ Text [ en-US ] = "Indents & Spacing" ; PageResID = TP_PARA_STD ; }; diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx index a6b6d2e6ef..86f5f31080 100644 --- a/sw/source/ui/chrdlg/pardlg.cxx +++ b/sw/source/ui/chrdlg/pardlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -64,8 +65,6 @@ #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> #include <svx/flagsdef.hxx> -// STATIC DATA ----------------------------------------------------------- - SwParaDlg::SwParaDlg(Window *pParent, SwView& rVw, @@ -89,7 +88,7 @@ SwParaDlg::SwParaDlg(Window *pParent, sal_Bool bHtmlMode = static_cast< sal_Bool >(nHtmlMode & HTMLMODE_ON); if(pTitle) { - // Update des Titels + // Update title String aTmp( GetText() ); aTmp += SW_RESSTR(STR_TEXTCOLL_HEADER); aTmp += *pTitle; @@ -98,19 +97,19 @@ SwParaDlg::SwParaDlg(Window *pParent, } SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!"); AddTabPage( TP_PARA_STD, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!"); AddTabPage( TP_PARA_ALIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH) ); SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get(); if (!bDrawParaDlg && (!bHtmlMode || pHtmlOpt->IsPrintLayoutExtension())) { - DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!"); AddTabPage( TP_PARA_EXT, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH) ); } @@ -120,8 +119,8 @@ SwParaDlg::SwParaDlg(Window *pParent, SvtCJKOptions aCJKOptions; if(!bHtmlMode && aCJKOptions.IsAsianTypographyEnabled()) { - DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!"); AddTabPage( TP_PARA_ASIAN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN) ); } else @@ -133,8 +132,8 @@ SwParaDlg::SwParaDlg(Window *pParent, RemoveTabPage(TP_TABULATOR); else { - DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR), "GetTabPageRangesFunc fail!"); AddTabPage( TP_TABULATOR, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR) ); } @@ -154,8 +153,8 @@ SwParaDlg::SwParaDlg(Window *pParent, } if(!bHtmlMode || (nHtmlMode & (HTMLMODE_SOME_STYLES|HTMLMODE_FULL_STYLES))) { - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); } else @@ -164,8 +163,8 @@ SwParaDlg::SwParaDlg(Window *pParent, } if(!bHtmlMode || (nHtmlMode & HTMLMODE_PARA_BORDER)) { - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!"); AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) ); } else @@ -177,17 +176,17 @@ SwParaDlg::SwParaDlg(Window *pParent, } -__EXPORT SwParaDlg::~SwParaDlg() +SwParaDlg::~SwParaDlg() { } -void __EXPORT SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) +void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) { SwWrtShell& rSh = rView.GetWrtShell(); SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - // Bei Tabellenumrandung kann im Writer kein Schatten eingestellt werden + // Table borders cannot get any shade in Writer if (nId == TP_BORDER) { aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA)); @@ -216,8 +215,7 @@ void __EXPORT SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) } else if( TP_PARA_EXT == nId ) { - // Seitenumbruch nur, wenn der Cursor im Body-Bereich und nicht in - // einer Tabelle steht + // pagebreak only when the cursor is in the body-area and not in a table const sal_uInt16 eType = rSh.GetFrmType(0,sal_True); if( !(FRMTYPE_BODY & eType) || rSh.GetSelectionType() & nsSelectionType::SEL_TBL ) @@ -241,12 +239,11 @@ void __EXPORT SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) } else if( TP_NUMPARA == nId) { - //-->#outline level,added by zhaojianwei SwTxtFmtColl* pTmpColl = rSh.GetCurTxtFmtColl(); if( pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle() ) { ((SwParagraphNumTabPage&)rPage).DisableOutline() ; - }//<-end + } ((SwParagraphNumTabPage&)rPage).EnableNewStart(); ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox(); @@ -267,3 +264,4 @@ void __EXPORT SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/chrdlg/swbreak.src b/sw/source/ui/chrdlg/swbreak.src index 1ed8491a31..198c4d63e7 100644 --- a/sw/source/ui/chrdlg/swbreak.src +++ b/sw/source/ui/chrdlg/swbreak.src @@ -36,7 +36,6 @@ ModalDialog DLG_BREAK OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 161 , 114 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Umbruch einf�gen : Umbruch einf�gen */ Text [ en-US ] = "Insert Break" ; Moveable = TRUE ; OKButton BT_OK @@ -119,7 +118,6 @@ ModalDialog DLG_BREAK HelpID = "sw:CheckBox:DLG_BREAK:CB_PAGENUM"; Pos = MAP_APPFONT ( 12 , 79 ) ; Size = MAP_APPFONT ( 84 , 10 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Seitennummer ~�ndern : Seitennummer ~�ndern */ Text [ en-US ] = "Change page ~number" ; TabStop = TRUE ; }; diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx index bda5c764fe..bea4b16fd0 100644 --- a/sw/source/ui/chrdlg/swuiccoll.cxx +++ b/sw/source/ui/chrdlg/swuiccoll.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -32,17 +33,13 @@ #undef SW_DLLIMPLEMENTATION #endif - - #include "cmdid.h" -#include <tools/list.hxx> #include "swmodule.hxx" #include "view.hxx" #include "wrtsh.hxx" #include "globals.hrc" #include "helpid.h" - #include <sfx2/styfitem.hxx> #include "uitool.hxx" @@ -59,22 +56,17 @@ #include "swuiccoll.hxx" -static sal_uInt16 __FAR_DATA aPageRg[] = { +static sal_uInt16 aPageRg[] = { FN_COND_COLL, FN_COND_COLL, 0 }; -// Achtung im Code wird dieses Array direkt (0, 1, ...) indiziert +// Warning! This table is indicated directly in code (0, 1, ...) static long nTabs[] = { 2, // Number of Tabs 0, 100 }; -/**************************************************************************** -Page: Ctor -****************************************************************************/ - - SwCondCollPage::SwCondCollPage(Window *pParent, const SfxItemSet &rSet) : SfxTabPage(pParent, SW_RES(TP_CONDCOLL), rSet), @@ -103,7 +95,7 @@ SwCondCollPage::SwCondCollPage(Window *pParent, const SfxItemSet &rSet) aAssignPB.SetAccessibleRelationMemberOf(&aConditionFL); aTbLinks.SetAccessibleRelationLabeledBy(&aConditionCB); - // Handler installieren + // Install handlers aConditionCB.SetClickHdl( LINK(this, SwCondCollPage, OnOffHdl)); aTbLinks.SetDoubleClickHdl( LINK(this, SwCondCollPage, AssignRemoveHdl )); aStyleLB.SetDoubleClickHdl( LINK(this, SwCondCollPage, AssignRemoveHdl )); @@ -116,26 +108,25 @@ SwCondCollPage::SwCondCollPage(Window *pParent, const SfxItemSet &rSet) aTbLinks.SetStyle(aTbLinks.GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN); aTbLinks.SetSelectionMode( SINGLE_SELECTION ); aTbLinks.SetTabs( &nTabs[0], MAP_APPFONT ); - aTbLinks.Resize(); // OS: Hack fuer richtige Selektion + aTbLinks.Resize(); // OS: Hack for the right selection aTbLinks.SetSpaceBetweenEntries( 0 ); aTbLinks.SetHelpId(HID_COND_COLL_TABLIST); SfxStyleFamilies aFamilies(SW_RES(DLG_STYLE_DESIGNER)); const SfxStyleFamilyItem* pFamilyItem = 0; - sal_uInt16 nCount = aFamilies.Count(); - sal_uInt16 i; - for( i = 0; i < nCount; ++i) + size_t nCount = aFamilies.size(); + for( size_t i = 0; i < nCount; ++i ) { - if(SFX_STYLE_FAMILY_PARA == (sal_uInt16)(pFamilyItem = aFamilies.GetObject(i))->GetFamily()) + if(SFX_STYLE_FAMILY_PARA == (sal_uInt16)(pFamilyItem = aFamilies.at( i ))->GetFamily()) break; } const SfxStyleFilter& rFilterList = pFamilyItem->GetFilterList(); - for( i = 0; i < rFilterList.Count(); ++i) + for( size_t i = 0; i < rFilterList.size(); ++i ) { - aFilterLB.InsertEntry(rFilterList.GetObject(i)->aName); - sal_uInt16* pFilter = new sal_uInt16(rFilterList.GetObject(i)->nFlags); + aFilterLB.InsertEntry( rFilterList[ i ]->aName); + sal_uInt16* pFilter = new sal_uInt16(rFilterList[i]->nFlags); aFilterLB.SetEntryData(i, pFilter); } aFilterLB.SelectEntryPos(1); @@ -149,7 +140,7 @@ Page: Dtor ****************************************************************************/ -__EXPORT SwCondCollPage::~SwCondCollPage() +SwCondCollPage::~SwCondCollPage() { for(sal_uInt16 i = 0; i < aFilterLB.GetEntryCount(); ++i) delete (sal_uInt16*)aFilterLB.GetEntryData(i); @@ -157,7 +148,7 @@ __EXPORT SwCondCollPage::~SwCondCollPage() } -int __EXPORT SwCondCollPage::DeactivatePage(SfxItemSet * _pSet) +int SwCondCollPage::DeactivatePage(SfxItemSet * _pSet) { if( _pSet ) FillItemSet(*_pSet); @@ -170,7 +161,7 @@ Page: Factory ****************************************************************************/ -SfxTabPage* __EXPORT SwCondCollPage::Create(Window *pParent, const SfxItemSet &rSet) +SfxTabPage* SwCondCollPage::Create(Window *pParent, const SfxItemSet &rSet) { return new SwCondCollPage(pParent, rSet); } @@ -180,7 +171,7 @@ Page: FillItemSet-Overload ****************************************************************************/ -sal_Bool __EXPORT SwCondCollPage::FillItemSet(SfxItemSet &rSet) +sal_Bool SwCondCollPage::FillItemSet(SfxItemSet &rSet) { sal_Bool bModified = sal_True; SwCondCollItem aCondItem; @@ -198,7 +189,7 @@ Page: Reset-Overload ****************************************************************************/ -void __EXPORT SwCondCollPage::Reset(const SfxItemSet &/*rSet*/) +void SwCondCollPage::Reset(const SfxItemSet &/*rSet*/) { if(bNewTemplate) aConditionCB.Enable(); @@ -241,22 +232,11 @@ void __EXPORT SwCondCollPage::Reset(const SfxItemSet &/*rSet*/) } -/**************************************************************************** - -****************************************************************************/ - - -sal_uInt16* __EXPORT SwCondCollPage::GetRanges() +sal_uInt16* SwCondCollPage::GetRanges() { return aPageRg; } - -/**************************************************************************** - -****************************************************************************/ - - IMPL_LINK( SwCondCollPage, OnOffHdl, CheckBox*, pBox ) { const sal_Bool bEnable = pBox->IsChecked(); @@ -273,11 +253,6 @@ IMPL_LINK( SwCondCollPage, OnOffHdl, CheckBox*, pBox ) return 0; } -/**************************************************************************** - -****************************************************************************/ - - IMPL_LINK( SwCondCollPage, AssignRemoveHdl, PushButton*, pBtn) { SvLBoxEntry* pE = aTbLinks.FirstSelected(); @@ -285,7 +260,7 @@ IMPL_LINK( SwCondCollPage, AssignRemoveHdl, PushButton*, pBtn) if( !pE || LISTBOX_ENTRY_NOTFOUND == ( nPos = aTbLinks.GetModel()->GetAbsPos( pE ) ) ) { - ASSERT( pE, "wo kommt der leere Eintrag her?" ); + OSL_ENSURE( pE, "where's the empty entry from?" ); return 0; } @@ -307,11 +282,6 @@ IMPL_LINK( SwCondCollPage, AssignRemoveHdl, PushButton*, pBtn) return 0; } -/**************************************************************************** - -****************************************************************************/ - - IMPL_LINK( SwCondCollPage, SelectHdl, ListBox*, pBox) { if(pBox == &aFilterLB) @@ -322,6 +292,7 @@ IMPL_LINK( SwCondCollPage, SelectHdl, ListBox*, pBox) SfxStyleSheetBasePool* pPool = rSh.GetView().GetDocShell()->GetStyleSheetPool(); pPool->SetSearchMask(SFX_STYLE_FAMILY_PARA, nSearchFlags); const SfxStyleSheetBase* pBase = pPool->First(); + while( pBase ) { if(!pFmt || pBase->GetName() != pFmt->GetName()) @@ -349,13 +320,10 @@ IMPL_LINK( SwCondCollPage, SelectHdl, ListBox*, pBox) return 0; } -/**************************************************************************** - -****************************************************************************/ - - void SwCondCollPage::SetCollection( SwFmt* pFormat, sal_Bool bNew ) { pFmt = pFormat; bNewTemplate = bNew; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/chrdlg/tblnumfm.cxx b/sw/source/ui/chrdlg/tblnumfm.cxx index 96a10fd0f8..7ff91d12ab 100644 --- a/sw/source/ui/chrdlg/tblnumfm.cxx +++ b/sw/source/ui/chrdlg/tblnumfm.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,19 +33,12 @@ #undef SW_DLLIMPLEMENTATION #endif - - - -#ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> -#endif #include <svx/numinf.hxx> #include <swtypes.hxx> #include <tblnumfm.hxx> -#ifndef _CHRDLG_HRC #include <chrdlg.hrc> -#endif #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> @@ -54,10 +48,11 @@ SwNumFmtDlg::SwNumFmtDlg(Window* pParent, const SfxItemSet& rSet) : SfxSingleTabDialog( pParent, rSet, 0 ) { - // TabPage erzeugen + // Create TabPage SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ); + if ( fnCreatePage ) { SfxTabPage* pNewPage = (*fnCreatePage)( this, rSet ); @@ -68,9 +63,9 @@ SwNumFmtDlg::SwNumFmtDlg(Window* pParent, const SfxItemSet& rSet) } } - SwNumFmtDlg::~SwNumFmtDlg() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/barcfg.cxx b/sw/source/ui/config/barcfg.cxx index a22695cafa..5a3d85a4d0 100644 --- a/sw/source/ui/config/barcfg.cxx +++ b/sw/source/ui/config/barcfg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,7 +30,7 @@ #include "precompiled_sw.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <wrtsh.hxx> @@ -47,9 +48,6 @@ using namespace com::sun::star::uno; #define SEL_TYPE_BEZIER 3 #define SEL_TYPE_GRAPHIC 4 -/* --------------------------------------------------------------------------- - - ---------------------------------------------------------------------------*/ SwToolbarConfigItem::SwToolbarConfigItem( sal_Bool bWeb ) : ConfigItem(bWeb ? C2U("Office.WriterWeb/ObjectBar") : C2U("Office.Writer/ObjectBar"), CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE) @@ -60,7 +58,7 @@ SwToolbarConfigItem::SwToolbarConfigItem( sal_Bool bWeb ) : Sequence<OUString> aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) @@ -74,15 +72,11 @@ SwToolbarConfigItem::SwToolbarConfigItem( sal_Bool bWeb ) : } } } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ SwToolbarConfigItem::~SwToolbarConfigItem() { } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ sal_Int32 lcl_getArrayIndex(int nSelType) { sal_Int32 nRet = -1; @@ -101,9 +95,7 @@ sal_Int32 lcl_getArrayIndex(int nSelType) nRet = SEL_TYPE_GRAPHIC; return nRet; } -/* -----------------------------10.10.00 14:38-------------------------------- - ---------------------------------------------------------------------------*/ void SwToolbarConfigItem::SetTopToolbar( sal_Int32 nSelType, sal_Int32 nBarId ) { sal_Int32 nProp = lcl_getArrayIndex(nSelType); @@ -113,9 +105,7 @@ void SwToolbarConfigItem::SetTopToolbar( sal_Int32 nSelType, sal_Int32 nBarId ) SetModified(); } } -/* -----------------------------10.10.00 13:33-------------------------------- - ---------------------------------------------------------------------------*/ Sequence<OUString> SwToolbarConfigItem::GetPropertyNames() { static const char* aPropNames[] = @@ -133,9 +123,7 @@ Sequence<OUString> SwToolbarConfigItem::GetPropertyNames() pNames[i] = OUString::createFromAscii(aPropNames[i]); return aNames; } -/* -----------------------------10.10.00 13:36-------------------------------- - ---------------------------------------------------------------------------*/ void SwToolbarConfigItem::Commit() { Sequence<OUString> aNames = GetPropertyNames(); @@ -150,3 +138,4 @@ void SwToolbarConfigItem::Commit() void SwToolbarConfigItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/caption.cxx b/sw/source/ui/config/caption.cxx index dfb258ef96..8a8489b7ff 100644 --- a/sw/source/ui/config/caption.cxx +++ b/sw/source/ui/config/caption.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,7 +30,7 @@ #include "precompiled_sw.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "numrule.hxx" #include "caption.hxx" @@ -37,15 +38,11 @@ #define VERSION_01 1 #define CAPTION_VERSION VERSION_01 -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - InsCaptionOpt::InsCaptionOpt(const SwCapObjType eType, const SvGlobalName* pOleId) : bUseCaption(sal_False), eObjType(eType), nNumType(SVX_NUM_ARABIC), - sNumberSeparator( ::rtl::OUString::createFromAscii(". ") ), + sNumberSeparator(RTL_CONSTASCII_USTRINGPARAM((". "))), nPos(1), nLevel(0), sSeparator( String::CreateFromAscii( ": " ) ), @@ -56,27 +53,15 @@ InsCaptionOpt::InsCaptionOpt(const SwCapObjType eType, const SvGlobalName* pOleI aOleId = *pOleId; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - InsCaptionOpt::InsCaptionOpt(const InsCaptionOpt& rOpt) { *this = rOpt; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - InsCaptionOpt::~InsCaptionOpt() { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - InsCaptionOpt& InsCaptionOpt::operator=( const InsCaptionOpt& rOpt ) { bUseCaption = rOpt.bUseCaption; @@ -96,87 +81,14 @@ InsCaptionOpt& InsCaptionOpt::operator=( const InsCaptionOpt& rOpt ) return *this; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool InsCaptionOpt::operator==( const InsCaptionOpt& rOpt ) const { return (eObjType == rOpt.eObjType && - aOleId == rOpt.aOleId); // Damit gleiche Ole-IDs nicht mehrfach eingefuegt - // werden koennen, auf nichts weiteres vergleichen - - -/* && - sCategory == rOpt.sCategory && - nNumType == rOpt.nNumType && - sCaption == rOpt.sCaption && - nPos == rOpt.nPos && - nLevel == rOpt.nLevel && - cSeparator == rOpt.cSeparator);*/ -} - -/************************************************************************* -|* -|* InsCaptionOpt::operator>>() -|* -|* Beschreibung Stream-Leseoperator -|* -*************************************************************************/ - -/*SvStream& operator>>( SvStream& rIStream, InsCaptionOpt& rCapOpt ) -{ - rtl_TextEncoding eEncoding = gsl_getSystemTextEncoding(); - sal_uInt16 nVal; - sal_uInt8 cVal; - sal_uInt8 nVersion; - - rIStream >> nVersion; - rIStream >> cVal; rCapOpt.UseCaption() = cVal != 0; - rIStream >> nVal; rCapOpt.eObjType = (SwCapObjType)nVal; - rIStream >> rCapOpt.aOleId; - - rIStream.ReadByteString( rCapOpt.sCategory, eEncoding ); - rIStream >> nVal; rCapOpt.nNumType = nVal; - rIStream.ReadByteString( rCapOpt.sCaption, eEncoding ); - rIStream >> nVal; rCapOpt.nPos = nVal; - rIStream >> nVal; rCapOpt.nLevel = nVal; + aOleId == rOpt.aOleId); // So that identical Ole-IDs can't be added multiple + // times, don't compare against anything else. - rIStream >> cVal; - rCapOpt.sSeparator = UniString( - ByteString(static_cast< char >(cVal)) , eEncoding).GetChar(0); - return rIStream; } -*/ -/************************************************************************* -|* -|* InsCaptionOpt::operator<<() -|* -|* Beschreibung Stream-Schreiboperator -|* -*************************************************************************/ - -/*SvStream& operator<<( SvStream& rOStream, const InsCaptionOpt& rCapOpt ) -{ - rtl_TextEncoding eEncoding = gsl_getSystemTextEncoding(); - rOStream << (sal_uInt8)CAPTION_VERSION - << (sal_uInt8)rCapOpt.UseCaption() - << (sal_uInt16)rCapOpt.eObjType - << rCapOpt.aOleId; - rOStream.WriteByteString( rCapOpt.sCategory, eEncoding ); - - rOStream << (sal_uInt16)rCapOpt.nNumType; - - rOStream.WriteByteString( rCapOpt.sCaption, eEncoding ); - - sal_uInt8 cSep = ByteString(rCapOpt.sSeparator, eEncoding).GetChar(0); - rOStream << (sal_uInt16)rCapOpt.nPos - << (sal_uInt16)rCapOpt.nLevel - << cSep; - - return rOStream; -} -*/ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/cfgitems.cxx b/sw/source/ui/config/cfgitems.cxx index ecf6769733..abf7bba55e 100644 --- a/sw/source/ui/config/cfgitems.cxx +++ b/sw/source/ui/config/cfgitems.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,13 +30,9 @@ #include "precompiled_sw.hxx" -#ifndef __SBX_SBXVARIABLE_HXX //autogen #include <basic/sbxvar.hxx> -#endif -#ifndef _SVX_SVXIDS_HRC //autogen #include <svx/svxids.hrc> -#endif #include <editeng/svxenum.hxx> @@ -46,14 +43,11 @@ #include "cfgitems.hxx" #include "crstate.hxx" - - TYPEINIT1_AUTOFACTORY(SwDocDisplayItem, SfxPoolItem) TYPEINIT1_AUTOFACTORY(SwElemItem, SfxPoolItem) TYPEINIT1_AUTOFACTORY(SwAddPrinterItem, SfxPoolItem) TYPEINIT1_AUTOFACTORY(SwShadowCursorItem, SfxPoolItem) - SwDocDisplayItem::SwDocDisplayItem( sal_uInt16 _nWhich ) : SfxPoolItem(_nWhich), aIndexBackgrndCol(COL_GRAY) @@ -70,20 +64,15 @@ SwDocDisplayItem::SwDocDisplayItem( sal_uInt16 _nWhich ) : }; -/*------------OS 12.01.95 ------------------------------------------- - Item fuer Einstellungsdialog, Seite Dokumentansicht +/*------------------------------------------------------------------- + Item for the Settings dialog, page document view --------------------------------------------------------------------*/ - SwDocDisplayItem::SwDocDisplayItem( const SwDocDisplayItem& rDocDisplayItem ): SfxPoolItem(rDocDisplayItem) { *this = rDocDisplayItem; }; -/*----------------------- ------------------------------------------- - ---------------------------------------------------------------------*/ - SwDocDisplayItem::SwDocDisplayItem(const SwViewOption& rVOpt, sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich ) { @@ -96,24 +85,16 @@ SwDocDisplayItem::SwDocDisplayItem(const SwViewOption& rVOpt, sal_uInt16 _nWhich bFldHiddenText = rVOpt.IsShowHiddenField(); bManualBreak = rVOpt.IsLineBreak(sal_True); bShowHiddenPara = rVOpt.IsShowHiddenPara(); - } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ SfxPoolItem* SwDocDisplayItem::Clone( SfxItemPool* ) const { return new SwDocDisplayItem( *this ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - int SwDocDisplayItem::operator==( const SfxPoolItem& rAttr ) const { - DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unterschiedliche Typen" ); + OSL_ENSURE( SfxPoolItem::operator==(rAttr), "different types" ); const SwDocDisplayItem& rItem = (SwDocDisplayItem&)rAttr; @@ -128,12 +109,6 @@ int SwDocDisplayItem::operator==( const SfxPoolItem& rAttr ) const bShowHiddenPara == rItem.bShowHiddenPara ); } - -/*-----------------31.08.96 14.14------------------- - ---------------------------------------------------*/ - - void SwDocDisplayItem::operator=( const SwDocDisplayItem& rDocDisplayItem) { bParagraphEnd = rDocDisplayItem.bParagraphEnd ; @@ -147,9 +122,6 @@ void SwDocDisplayItem::operator=( const SwDocDisplayItem& rDocDisplayItem) bShowHiddenPara = rDocDisplayItem.bShowHiddenPara ; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ void SwDocDisplayItem::FillViewOptions( SwViewOption& rVOpt) const { rVOpt.SetParagraph (bParagraphEnd ); @@ -163,10 +135,6 @@ void SwDocDisplayItem::FillViewOptions( SwViewOption& rVOpt) const rVOpt.SetShowHiddenPara(bShowHiddenPara ); } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ SwElemItem::SwElemItem( sal_uInt16 _nWhich ) : SfxPoolItem(_nWhich) { @@ -186,18 +154,12 @@ SwElemItem::SwElemItem( sal_uInt16 _nWhich ) : bFieldName = bNotes = sal_False; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ SwElemItem::SwElemItem( const SwElemItem& rElemItem ): SfxPoolItem(rElemItem) { *this = rElemItem; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ SwElemItem::SwElemItem(const SwViewOption& rVOpt, sal_uInt16 _nWhich) : SfxPoolItem( _nWhich ) @@ -220,22 +182,14 @@ SwElemItem::SwElemItem(const SwViewOption& rVOpt, sal_uInt16 _nWhich) : } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SfxPoolItem* SwElemItem::Clone( SfxItemPool* ) const { return new SwElemItem( *this ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - int SwElemItem::operator==( const SfxPoolItem& rAttr ) const { - DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unterschiedliche Typen" ); + OSL_ENSURE( SfxPoolItem::operator==(rAttr), "different types" ); const SwElemItem& rItem = (SwElemItem&)rAttr; @@ -256,11 +210,6 @@ int SwElemItem::operator==( const SfxPoolItem& rAttr ) const bNotes == rItem.bNotes ); } -/*-----------------31.08.96 14.13------------------- - ---------------------------------------------------*/ - - void SwElemItem::operator=( const SwElemItem& rElemItem) { bHorzScrollbar = rElemItem. bHorzScrollbar ; @@ -280,10 +229,6 @@ void SwElemItem::operator=( const SwElemItem& rElemItem) bNotes = rElemItem.bNotes ; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwElemItem::FillViewOptions( SwViewOption& rVOpt) const { rVOpt.SetViewHScrollBar(bHorzScrollbar ); @@ -304,11 +249,9 @@ void SwElemItem::FillViewOptions( SwViewOption& rVOpt) const rVOpt.SetPostIts (bNotes ); } - /*-------------------------------------------------------------------- - Beschreibung: CopyCTOR + Description: CopyCTOR --------------------------------------------------------------------*/ - SwAddPrinterItem::SwAddPrinterItem( const SwAddPrinterItem& rAddPrinterItem ): SfxPoolItem(rAddPrinterItem), SwPrintData( rAddPrinterItem ) @@ -316,47 +259,39 @@ SwAddPrinterItem::SwAddPrinterItem( const SwAddPrinterItem& rAddPrinterItem ): } /*-------------------------------------------------------------------- - Beschreibung: CTOR fuer leeres Item + Description: CTOR for empty Item --------------------------------------------------------------------*/ - SwAddPrinterItem::SwAddPrinterItem( sal_uInt16 _nWhich): SfxPoolItem(_nWhich) { } + /*-------------------------------------------------------------------- - Beschreibung: CTOR aus SwPrintOptions + Description: CTOR from SwPrintOptions --------------------------------------------------------------------*/ - SwAddPrinterItem::SwAddPrinterItem( sal_uInt16 _nWhich, const SwPrintData& rPrtData ) : SfxPoolItem(_nWhich) { SwPrintData::operator=(rPrtData); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ SfxPoolItem* SwAddPrinterItem::Clone( SfxItemPool* ) const { return new SwAddPrinterItem( *this ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - int SwAddPrinterItem::operator==( const SfxPoolItem& rAttr ) const { - DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unterschiedliche Typen" ); + OSL_ENSURE( SfxPoolItem::operator==(rAttr), "different types" ); const SwAddPrinterItem& rItem = (SwAddPrinterItem&)rAttr; return SwPrintData::operator==(rItem); } -/*-----------------03.11.97 10:00------------------- - Item fuer Einstellungsdialog, ShadowCursorSeite ---------------------------------------------------*/ +/*-------------------------------------------------- + Item for Settings dialog, ShadowCursorPage +--------------------------------------------------*/ SwShadowCursorItem::SwShadowCursorItem( sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich ), eMode( FILL_TAB ) @@ -404,11 +339,7 @@ void SwShadowCursorItem::FillViewOptions( SwViewOption& rVOpt ) const rVOpt.SetShdwCrsrFillMode( eMode ); } -#ifdef DBG_UTIL -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - +#if OSL_DEBUG_LEVEL > 1 SwTestItem::SwTestItem( const SwTestItem& rTestItem ): SfxPoolItem(rTestItem) { @@ -424,22 +355,14 @@ SwTestItem::SwTestItem( const SwTestItem& rTestItem ): bTest10=rTestItem.bTest10; }; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SfxPoolItem* SwTestItem::Clone( SfxItemPool* ) const { return new SwTestItem( *this ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - int SwTestItem::operator==( const SfxPoolItem& rAttr ) const { - DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unterschiedliche Typen" ); + OSL_ENSURE( SfxPoolItem::operator==(rAttr), "different types" ); const SwTestItem& rItem = (const SwTestItem&) rAttr; @@ -458,3 +381,5 @@ int SwTestItem::operator==( const SfxPoolItem& rAttr ) const #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/sw/source/ui/config/config.hrc b/sw/source/ui/config/config.hrc index e5a6ef2f9a..72514999b4 100644 --- a/sw/source/ui/config/config.hrc +++ b/sw/source/ui/config/config.hrc @@ -29,9 +29,9 @@ #include "rcid.hrc" -// Dialoge fuer die Konfiguration +// dialogs for configuration -// Strings fuer die Konfiguration +// strings for configuration #define STR_CFG_SIGNATUR (RC_CONFIG_BEGIN + 0) #define DLG_CONFIG_VIEW (RC_CONFIG_BEGIN + 1) #define DLG_CONFIG_MISC (RC_CONFIG_BEGIN + 2) diff --git a/sw/source/ui/config/dbconfig.cxx b/sw/source/ui/config/dbconfig.cxx index e189fe7d38..cdcfbbc8d0 100644 --- a/sw/source/ui/config/dbconfig.cxx +++ b/sw/source/ui/config/dbconfig.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,7 +31,7 @@ #include <dbconfig.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <swdbdata.hxx> @@ -42,7 +43,7 @@ using rtl::OUString; using namespace com::sun::star::uno; /*-------------------------------------------------------------------- - Beschreibung: Ctor + Description: Ctor --------------------------------------------------------------------*/ const Sequence<OUString>& SwDBConfig::GetPropertyNames() @@ -67,9 +68,7 @@ const Sequence<OUString>& SwDBConfig::GetPropertyNames() } return aNames; } -/* -----------------------------06.09.00 16:44-------------------------------- - ---------------------------------------------------------------------------*/ SwDBConfig::SwDBConfig() : ConfigItem(C2U("Office.DataAccess"), CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE), @@ -77,17 +76,13 @@ SwDBConfig::SwDBConfig() : pBibImpl(0) { }; -/* -----------------------------06.09.00 16:50-------------------------------- - ---------------------------------------------------------------------------*/ SwDBConfig::~SwDBConfig() { delete pAdrImpl; delete pBibImpl; } -/* -----------------------------20.02.01 12:32-------------------------------- - ---------------------------------------------------------------------------*/ void SwDBConfig::Load() { const Sequence<OUString>& rNames = GetPropertyNames(); @@ -101,7 +96,7 @@ void SwDBConfig::Load() } Sequence<Any> aValues = GetProperties(rNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == rNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == rNames.getLength(), "GetProperties failed"); if(aValues.getLength() == rNames.getLength()) { for(int nProp = 0; nProp < rNames.getLength(); nProp++) @@ -118,18 +113,14 @@ void SwDBConfig::Load() } } } -/* -----------------------------20.02.01 12:36-------------------------------- - ---------------------------------------------------------------------------*/ const SwDBData& SwDBConfig::GetAddressSource() { if(!pAdrImpl) Load(); return *pAdrImpl; } -/* -----------------29.11.2002 11:43----------------- - * - * --------------------------------------------------*/ + const SwDBData& SwDBConfig::GetBibliographySource() { if(!pBibImpl) @@ -141,3 +132,4 @@ void SwDBConfig::Commit() {} void SwDBConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/fontcfg.cxx b/sw/source/ui/config/fontcfg.cxx index 4d4ee89d37..0efa9a5995 100644 --- a/sw/source/ui/config/fontcfg.cxx +++ b/sw/source/ui/config/fontcfg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <fontcfg.hxx> #include <i18npool/mslangid.hxx> #include <vcl/outdev.hxx> @@ -44,18 +44,13 @@ using namespace utl; using rtl::OUString; using namespace com::sun::star::uno; -/* -----------------07.10.2002 12:15----------------- - * - * --------------------------------------------------*/ inline LanguageType lcl_LanguageOfType(sal_Int16 nType, sal_Int16 eWestern, sal_Int16 eCJK, sal_Int16 eCTL) { return LanguageType( nType < FONT_STANDARD_CJK ? eWestern : nType >= FONT_STANDARD_CTL ? eCTL : eCJK); } -/* -----------------------------08.09.00 15:52-------------------------------- - ---------------------------------------------------------------------------*/ Sequence<OUString> SwStdFontConfig::GetPropertyNames() { Sequence<OUString> aNames; @@ -104,9 +99,6 @@ Sequence<OUString> SwStdFontConfig::GetPropertyNames() } return aNames; } -/*-----------------03.09.96 15.00------------------- - ---------------------------------------------------*/ SwStdFontConfig::SwStdFontConfig() : utl::ConfigItem(C2U("Office.Writer")) @@ -129,7 +121,7 @@ SwStdFontConfig::SwStdFontConfig() : Sequence<OUString> aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) @@ -151,9 +143,7 @@ SwStdFontConfig::SwStdFontConfig() : } } } -/* -----------------------------08.09.00 15:58-------------------------------- - ---------------------------------------------------------------------------*/ void SwStdFontConfig::Commit() { Sequence<OUString> aNames = GetPropertyNames(); @@ -184,14 +174,11 @@ void SwStdFontConfig::Commit() } PutProperties(aNames, aValues); } -/* -----------------------------08.09.00 15:56-------------------------------- - ---------------------------------------------------------------------------*/ SwStdFontConfig::~SwStdFontConfig() -{} -/*-----------------18.01.97 10.05------------------- +{ +} ---------------------------------------------------*/ sal_Bool SwStdFontConfig::IsFontDefault(sal_uInt16 nFontType) const { sal_Bool bSame = sal_False; @@ -250,9 +237,6 @@ sal_Bool SwStdFontConfig::IsFontDefault(sal_uInt16 nFontType) const return bSame; } -/* -----------------11.01.99 13:16------------------- - * Standards auslesen - * --------------------------------------------------*/ String SwStdFontConfig::GetDefaultFor(sal_uInt16 nFontType, LanguageType eLang) { String sRet; @@ -280,10 +264,6 @@ String SwStdFontConfig::GetDefaultFor(sal_uInt16 nFontType, LanguageType eLang) case FONT_INDEX_CTL : nFontId = DEFAULTFONT_CTL_TEXT; break; -// case FONT_STANDARD: -// case FONT_LIST : -// case FONT_CAPTION : -// case FONT_INDEX : default: nFontId = DEFAULTFONT_LATIN_TEXT; } @@ -291,9 +271,6 @@ String SwStdFontConfig::GetDefaultFor(sal_uInt16 nFontType, LanguageType eLang) return aFont.GetName(); } -/*-- 11.10.2005 10:43:43--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_Int32 SwStdFontConfig::GetDefaultHeightFor(sal_uInt16 nFontType, LanguageType eLang) { sal_Int32 nRet = FONTSIZE_DEFAULT; @@ -303,7 +280,10 @@ sal_Int32 SwStdFontConfig::GetDefaultHeightFor(sal_uInt16 nFontType, LanguageTyp case FONT_OUTLINE_CJK: case FONT_OUTLINE_CTL: nRet = FONTSIZE_OUTLINE; - break; + break; + case FONT_STANDARD_CJK: + nRet = FONTSIZE_CJK_DEFAULT; + break; } if( eLang == LANGUAGE_THAI && nFontType >= FONT_STANDARD_CTL ) { @@ -312,12 +292,9 @@ sal_Int32 SwStdFontConfig::GetDefaultHeightFor(sal_uInt16 nFontType, LanguageTyp return nRet; } -/*-- 11.10.2005 10:50:06--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwStdFontConfig::ChangeInt( sal_uInt16 nFontType, sal_Int32 nHeight ) { - DBG_ASSERT( nFontType < DEF_FONT_COUNT, "invalid index in SwStdFontConfig::ChangInt()"); + OSL_ENSURE( nFontType < DEF_FONT_COUNT, "invalid index in SwStdFontConfig::ChangInt()"); if( nFontType < DEF_FONT_COUNT && nDefaultFontHeight[nFontType] != nHeight) { SvtLinguOptions aLinguOpt; @@ -343,12 +320,9 @@ void SwStdFontConfig::ChangeInt( sal_uInt16 nFontType, sal_Int32 nHeight ) } } -/*-- 08.11.2005 14:18:26--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_Int32 SwStdFontConfig::GetFontHeight( sal_uInt8 nFont, sal_uInt8 nScriptType, LanguageType eLang ) { - DBG_ASSERT(nFont + FONT_PER_GROUP * nScriptType < DEF_FONT_COUNT, "wrong index in SwStdFontConfig::GetFontHeight()"); + OSL_ENSURE(nFont + FONT_PER_GROUP * nScriptType < DEF_FONT_COUNT, "wrong index in SwStdFontConfig::GetFontHeight()"); sal_Int32 nRet = nDefaultFontHeight[nFont + FONT_PER_GROUP * nScriptType]; if(nRet <= 0) return GetDefaultHeightFor(nFont + FONT_PER_GROUP * nScriptType, eLang); @@ -357,3 +331,4 @@ sal_Int32 SwStdFontConfig::GetFontHeight( sal_uInt8 nFont, sal_uInt8 nScriptType void SwStdFontConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx index e7d3a0c233..37a96b6faf 100644 --- a/sw/source/ui/config/mailconfigpage.cxx +++ b/sw/source/ui/config/mailconfigpage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,9 +41,7 @@ #include <svtools/headbar.hxx> #include <mmconfigitem.hxx> #include <mailmergehelper.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <vcl/svapp.hxx> #include <comphelper/processfactory.hxx> #include "com/sun/star/mail/MailServiceType.hpp" @@ -59,9 +58,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::mail; using namespace ::com::sun::star::beans; using ::rtl::OUString; -/*-- 06.05.2004 12:04:11--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwTestAccountSettingsDialog : public SfxModalDialog { FixedInfo m_aInfoFI; @@ -99,9 +96,7 @@ public: SwTestAccountSettingsDialog(SwMailConfigPage* pParent); ~SwTestAccountSettingsDialog(); }; -/*-- 19.08.2004 14:27:33--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwAuthenticationSettingsDialog : public SfxModalDialog { CheckBox m_aAuthenticationCB; @@ -146,9 +141,6 @@ public: ~SwAuthenticationSettingsDialog(); }; -/*-- 06.05.2004 10:59:40--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwMailConfigPage::SwMailConfigPage( Window* pParent, const SfxItemSet& rSet ) : SfxTabPage(pParent, SW_RES(TP_MAILCONFIG), rSet), #ifdef MSC @@ -181,23 +173,17 @@ SwMailConfigPage::SwMailConfigPage( Window* pParent, const SfxItemSet& rSet ) : m_aServerAuthenticationPB.SetClickHdl(LINK(this, SwMailConfigPage, AuthenticationHdl)); m_aTestPB.SetClickHdl(LINK(this, SwMailConfigPage, TestHdl)); } -/*-- 06.05.2004 10:59:40--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailConfigPage::~SwMailConfigPage() { delete m_pConfigItem; } -/*-- 06.05.2004 10:59:40--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxTabPage* SwMailConfigPage::Create( Window* pParent, const SfxItemSet& rAttrSet) { return new SwMailConfigPage(pParent, rAttrSet); } -/*-- 06.05.2004 10:59:41--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailConfigPage::FillItemSet( SfxItemSet& /*rSet*/ ) { if(m_aDisplayNameED.GetText() != m_aDisplayNameED.GetSavedValue()) @@ -220,9 +206,7 @@ sal_Bool SwMailConfigPage::FillItemSet( SfxItemSet& /*rSet*/ ) m_pConfigItem->Commit(); return sal_True; } -/*-- 06.05.2004 10:59:41--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailConfigPage::Reset( const SfxItemSet& /*rSet*/ ) { m_aDisplayNameED.SetText(m_pConfigItem->GetMailDisplayName()); @@ -245,9 +229,7 @@ void SwMailConfigPage::Reset( const SfxItemSet& /*rSet*/ ) m_aPortNF .SaveValue(); m_aSecureCB .SaveValue(); } -/*-- 06.05.2004 10:59:41--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailConfigPage, ReplyToHdl, CheckBox*, pBox) { sal_Bool bEnable = pBox->IsChecked(); @@ -255,26 +237,20 @@ IMPL_LINK(SwMailConfigPage, ReplyToHdl, CheckBox*, pBox) m_aReplyToED.Enable(bEnable); return 0; } -/*-- 06.05.2004 10:59:41--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailConfigPage, AuthenticationHdl, PushButton*, EMPTYARG) { SwAuthenticationSettingsDialog aDlg(this, *m_pConfigItem); aDlg.Execute(); return 0; } -/*-- 06.05.2004 10:59:42--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailConfigPage, TestHdl, PushButton*, EMPTYARG) { SwTestAccountSettingsDialog(this).Execute(); return 0; } -/*-- 06.05.2004 12:11:13--------------------------------------------------- - -----------------------------------------------------------------------*/ SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pParent) : SfxModalDialog(pParent, SW_RES(DLG_MM_TESTACCOUNTSETTINGS)), #ifdef MSC @@ -292,7 +268,7 @@ SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pPare #ifdef MSC #pragma warning (default : 4355) #endif - m_aImageList( SW_RES( GetSettings().GetStyleSettings().GetHighContrastMode() ? ILIST_HC : ILIST) ), + m_aImageList( SW_RES(ILIST) ), m_sTask( SW_RES( ST_TASK )), m_sStatus( SW_RES( ST_STATUS )), m_sEstablish( SW_RES( ST_ESTABLISH )), @@ -338,23 +314,17 @@ SwTestAccountSettingsDialog::SwTestAccountSettingsDialog(SwMailConfigPage* pPare Application::PostUserEvent( STATIC_LINK( this, SwTestAccountSettingsDialog, TestHdl ), this ); } -/*-- 06.05.2004 12:11:13--------------------------------------------------- - -----------------------------------------------------------------------*/ SwTestAccountSettingsDialog::~SwTestAccountSettingsDialog() { } -/*-- 06.05.2004 12:15:43--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwTestAccountSettingsDialog, StopHdl, PushButton*, EMPTYARG) { m_bStop = true; return 0; } -/*-- 07.06.2004 12:44:50--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_STATIC_LINK(SwTestAccountSettingsDialog, TestHdl, void*, EMPTYARG) { pThis->EnterWait(); @@ -362,9 +332,7 @@ IMPL_STATIC_LINK(SwTestAccountSettingsDialog, TestHdl, void*, EMPTYARG) pThis->LeaveWait(); return 0; } -/*-- 07.06.2004 12:45:45--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwTestAccountSettingsDialog::Test() { uno::Reference<XMultiServiceFactory> rMgr = ::comphelper::getProcessServiceFactory(); @@ -406,7 +374,7 @@ void SwTestAccountSettingsDialog::Test() new SwConnectionContext( m_pParent->m_pConfigItem->GetInServerName(), m_pParent->m_pConfigItem->GetInServerPort(), - ::rtl::OUString::createFromAscii( "Insecure" )); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Insecure"))); xInMailService->connect(xConnectionContext, xAuthenticator); } if(m_bStop) @@ -436,8 +404,7 @@ void SwTestAccountSettingsDialog::Test() new SwConnectionContext( m_pParent->m_aServerED.GetText(), sal::static_int_cast< sal_Int16, sal_Int64 >(m_pParent->m_aPortNF.GetValue()), - ::rtl::OUString::createFromAscii( - m_pParent->m_aSecureCB.IsChecked() ? "Ssl" : "Insecure")); + m_pParent->m_aSecureCB.IsChecked() ? OUString(RTL_CONSTASCII_USTRINGPARAM("Ssl")) : OUString(RTL_CONSTASCII_USTRINGPARAM("Insecure"))); xMailService->connect(xConnectionContext, xAuthenticator); bIsLoggedIn = xMailService->isConnected(); if( xInMailService.is() ) @@ -447,7 +414,7 @@ void SwTestAccountSettingsDialog::Test() } catch(uno::Exception&) { - DBG_ERROR("exception caught"); + OSL_ENSURE(false, "exception caught"); } } @@ -473,24 +440,18 @@ void SwTestAccountSettingsDialog::Test() m_eErrorsED.SetText( m_sErrorServer ); } } -/*-- 18.08.2004 12:18:38--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailConfigDlg::SwMailConfigDlg(Window* pParent, SfxItemSet& rSet ) : SfxSingleTabDialog(pParent, rSet, 0) { - // TabPage erzeugen + // create TabPage SetTabPage(SwMailConfigPage::Create( this, rSet )); } -/*-- 18.08.2004 12:18:38--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailConfigDlg::~SwMailConfigDlg() { } -/*-- 19.08.2004 14:33:58--------------------------------------------------- - -----------------------------------------------------------------------*/ SwAuthenticationSettingsDialog::SwAuthenticationSettingsDialog( SwMailConfigPage* pParent, SwMailMergeConfigItem& rItem) : SfxModalDialog(pParent, SW_RES(DLG_MM_SERVERAUTHENTICATION)), @@ -553,15 +514,11 @@ SwAuthenticationSettingsDialog::SwAuthenticationSettingsDialog( CheckBoxHdl_Impl( &m_aAuthenticationCB ); } -/*-- 19.08.2004 14:33:58--------------------------------------------------- - -----------------------------------------------------------------------*/ SwAuthenticationSettingsDialog::~SwAuthenticationSettingsDialog() { } -/*-- 19.08.2004 14:33:59--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwAuthenticationSettingsDialog, OKHdl_Impl, OKButton*, EMPTYARG) { rConfigItem.SetAuthentication( m_aAuthenticationCB.IsChecked() ); @@ -577,9 +534,7 @@ IMPL_LINK( SwAuthenticationSettingsDialog, OKHdl_Impl, OKButton*, EMPTYARG) EndDialog(RET_OK); return 0; } -/*-- 19.08.2004 14:33:59--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwAuthenticationSettingsDialog, CheckBoxHdl_Impl, CheckBox*, pBox) { sal_Bool bChecked = pBox->IsChecked(); @@ -589,9 +544,7 @@ IMPL_LINK( SwAuthenticationSettingsDialog, CheckBoxHdl_Impl, CheckBox*, pBox) return 0; } -/*-- 19.08.2004 14:33:59--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwAuthenticationSettingsDialog, RadioButtonHdl_Impl, RadioButton*, EMPTYARG) { sal_Bool bSeparate = m_aSeparateAuthenticationRB.IsChecked(); @@ -620,3 +573,5 @@ IMPL_LINK( SwAuthenticationSettingsDialog, RadioButtonHdl_Impl, RadioButton*, EM return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/mailconfigpage.hrc b/sw/source/ui/config/mailconfigpage.hrc index 0a52c94287..7b4aa97f32 100644 --- a/sw/source/ui/config/mailconfigpage.hrc +++ b/sw/source/ui/config/mailconfigpage.hrc @@ -61,7 +61,6 @@ #define ST_FAILED 44 #define ST_ERROR_SERVER 46 #define ILIST 47 -#define ILIST_HC 48 #define CB_AUTHENTICATION 50 #define RB_SEP_AUTHENTICATION 51 diff --git a/sw/source/ui/config/mailconfigpage.src b/sw/source/ui/config/mailconfigpage.src index 1673f1952e..e5ffb3f73d 100644 --- a/sw/source/ui/config/mailconfigpage.src +++ b/sw/source/ui/config/mailconfigpage.src @@ -230,13 +230,6 @@ ModalDialog DLG_MM_TESTACCOUNTSETTINGS MaskColor = IMAGE_MASK_COLOR; IMGLIST_IDS; }; - - ImageList ILIST_HC - { - Prefix = "sch"; - MaskColor = IMAGE_MASK_COLOR ; - IMGLIST_IDS; - }; String ST_TASK { Text[ en-US ] = "Task"; diff --git a/sw/source/ui/config/modcfg.cxx b/sw/source/ui/config/modcfg.cxx index b0e2b25058..b9f3c1f0a5 100644 --- a/sw/source/ui/config/modcfg.cxx +++ b/sw/source/ui/config/modcfg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,18 +35,14 @@ #include <tools/stream.hxx> #include <vcl/svapp.hxx> #include <svl/mailenum.hxx> -#ifndef _SVX_SVXIDS_HRC //autogen #include <svx/svxids.hrc> -#endif #include <editeng/svxenum.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <tools/globname.hxx> #include <swtypes.hxx> #include <itabenum.hxx> -#ifndef _MODCFG_HXX #include <modcfg.hxx> -#endif #include <fldupde.hxx> #include <unotools/syslocaleoptions.hxx> #include <caption.hxx> @@ -64,9 +61,7 @@ using namespace com::sun::star::uno; #define GLOB_NAME_CHART 4 SV_IMPL_PTRARR_SORT(InsCapOptArr, InsCaptionOptPtr) -/* -----------------03.11.98 13:46------------------- - * - * --------------------------------------------------*/ + InsCaptionOpt* InsCaptionOptArr::Find(const SwCapObjType eType, const SvGlobalName *pOleId) const { for (sal_uInt16 i = 0; i < Count(); i++ ) @@ -82,16 +77,12 @@ InsCaptionOpt* InsCaptionOptArr::Find(const SwCapObjType eType, const SvGlobalNa return 0; } -/* -----------------03.11.98 15:05------------------- - * - * --------------------------------------------------*/ - const InsCaptionOpt* SwModuleOptions::GetCapOption( sal_Bool bHTML, const SwCapObjType eType, const SvGlobalName *pOleId) { if(bHTML) { - DBG_ERROR("no caption option in sw/web!"); + OSL_ENSURE(false, "no caption option in sw/web!"); return 0; } else @@ -108,17 +99,13 @@ const InsCaptionOpt* SwModuleOptions::GetCapOption( } } -/* -----------------03.11.98 15:05------------------- - * - * --------------------------------------------------*/ - sal_Bool SwModuleOptions::SetCapOption(sal_Bool bHTML, const InsCaptionOpt* pOpt) { sal_Bool bRet = sal_False; if(bHTML) { - DBG_ERROR("no caption option in sw/web!"); + OSL_ENSURE(false, "no caption option in sw/web!"); } else if (pOpt) { @@ -152,9 +139,7 @@ sal_Bool SwModuleOptions::SetCapOption(sal_Bool bHTML, const InsCaptionOpt* pOpt return bRet; } -/*-----------------13.01.97 12.44------------------- ---------------------------------------------------*/ SwModuleOptions::SwModuleOptions() : aInsertConfig(sal_False), aWebInsertConfig(sal_True), @@ -163,9 +148,7 @@ SwModuleOptions::SwModuleOptions() : bHideFieldTips(sal_False) { } -/* -----------------------------19.01.01 12:26-------------------------------- - ---------------------------------------------------------------------------*/ String SwModuleOptions::ConvertWordDelimiter(const String& rDelim, sal_Bool bFromUI) { String sReturn; @@ -205,7 +188,7 @@ String SwModuleOptions::ConvertWordDelimiter(const String& rDelim, sal_Bool bFro nVal -= 'a' - 10; else { - DBG_ERROR( "ungueltiger Hex-Wert" ); + OSL_ENSURE(false, "wrong hex value" ); bValidData = sal_False; break; } @@ -218,7 +201,7 @@ String SwModuleOptions::ConvertWordDelimiter(const String& rDelim, sal_Bool bFro break; } - default: // Unbekannt, daher nur Backslash einfuegen + default: // Unknown, so insert backslash sReturn += '\\'; i--; break; @@ -253,9 +236,7 @@ String SwModuleOptions::ConvertWordDelimiter(const String& rDelim, sal_Bool bFro } return sReturn; } -/* -----------------------------10.10.00 16:22-------------------------------- - ---------------------------------------------------------------------------*/ const Sequence<OUString>& SwRevisionConfig::GetPropertyNames() { static Sequence<OUString> aNames; @@ -280,9 +261,7 @@ const Sequence<OUString>& SwRevisionConfig::GetPropertyNames() } return aNames; } -/*-- 10.10.00 16:22:22--------------------------------------------------- - -----------------------------------------------------------------------*/ SwRevisionConfig::SwRevisionConfig() : ConfigItem(C2U("Office.Writer/Revision"), CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE) @@ -299,15 +278,11 @@ SwRevisionConfig::SwRevisionConfig() : Load(); } -/*-- 10.10.00 16:22:23--------------------------------------------------- - -----------------------------------------------------------------------*/ SwRevisionConfig::~SwRevisionConfig() { } -/*-- 10.10.00 16:22:56--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 lcl_ConvertAttrToCfg(const AuthorCharAttr& rAttr) { sal_Int32 nRet = 0; @@ -332,7 +307,7 @@ sal_Int32 lcl_ConvertAttrToCfg(const AuthorCharAttr& rAttr) } return nRet; } -//----------------------------------------------------------------------------- + void SwRevisionConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} void SwRevisionConfig::Commit() @@ -359,9 +334,7 @@ void SwRevisionConfig::Commit() } PutProperties(aNames, aValues); } -/*-- 10.10.00 16:22:56--------------------------------------------------- - -----------------------------------------------------------------------*/ void lcl_ConvertCfgToAttr(sal_Int32 nVal, AuthorCharAttr& rAttr, sal_Bool bDelete = sal_False) { rAttr.nItemId = rAttr.nAttr = 0; @@ -393,7 +366,7 @@ void SwRevisionConfig::Load() const Sequence<OUString>& aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) @@ -417,9 +390,7 @@ void SwRevisionConfig::Load() } } } -/* -----------------------------10.10.00 16:22-------------------------------- - ---------------------------------------------------------------------------*/ enum InsertConfigProp { INS_PROP_TABLE_HEADER = 0, @@ -628,15 +599,13 @@ const Sequence<OUString>& SwInsertConfig::GetPropertyNames() OUString* pWebNames = aWebNames.getArray(); int i; for(i = 0; i < nCount; i++) - pNames[i] = C2U(aPropNames[i]); + pNames[i] = rtl::OUString::createFromAscii(aPropNames[i]); for(i = 0; i < nWebCount; i++) - pWebNames[i] = C2U(aPropNames[i]); + pWebNames[i] = rtl::OUString::createFromAscii(aPropNames[i]); } return bIsWeb ? aWebNames : aNames; } -/*-- 10.10.00 16:22:22--------------------------------------------------- - -----------------------------------------------------------------------*/ SwInsertConfig::SwInsertConfig(sal_Bool bWeb) : ConfigItem(bWeb ? C2U("Office.WriterWeb/Insert") : C2U("Office.Writer/Insert"), CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE), @@ -657,17 +626,13 @@ SwInsertConfig::SwInsertConfig(sal_Bool bWeb) : Load(); } -/*-- 10.10.00 16:22:23--------------------------------------------------- - -----------------------------------------------------------------------*/ SwInsertConfig::~SwInsertConfig() { delete pCapOptions; delete pOLEMiscOpt; } -/*-- 10.10.00 16:22:56--------------------------------------------------- - -----------------------------------------------------------------------*/ void lcl_WriteOpt(const InsCaptionOpt& rOpt, Any* pValues, sal_Int32 nProp, sal_Int32 nOffset) { switch(nOffset) @@ -689,7 +654,7 @@ void lcl_WriteOpt(const InsCaptionOpt& rOpt, Any* pValues, sal_Int32 nProp, sal_ case 9: pValues[nProp] <<= rOpt.CopyAttributes(); break; //ApplyAttributes } } -//----------------------------------------------------------------------------- + void SwInsertConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} void SwInsertConfig::Commit() @@ -867,9 +832,7 @@ void SwInsertConfig::Commit() } PutProperties(aNames, aValues); } -/*-- 10.10.00 16:22:56--------------------------------------------------- - -----------------------------------------------------------------------*/ void lcl_ReadOpt(InsCaptionOpt& rOpt, const Any* pValues, sal_Int32 nProp, sal_Int32 nOffset) { switch(nOffset) @@ -936,13 +899,13 @@ void lcl_ReadOpt(InsCaptionOpt& rOpt, const Any* pValues, sal_Int32 nProp, sal_I break; } } -//----------------------------------------------------------------------------- + void SwInsertConfig::Load() { const Sequence<OUString>& aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { InsCaptionOpt* pWriterTableOpt = 0; @@ -1167,9 +1130,7 @@ void SwInsertConfig::Load() aInsTblOpts.mnInsMode = nInsTblFlags; } } -/* -----------------------------10.10.00 16:22-------------------------------- - ---------------------------------------------------------------------------*/ const Sequence<OUString>& SwTableConfig::GetPropertyNames() { const int nCount = 8; @@ -1190,24 +1151,18 @@ const Sequence<OUString>& SwTableConfig::GetPropertyNames() pNames[i] = OUString::createFromAscii(aPropNames[i]); return aNames; } -/*-- 10.10.00 16:22:22--------------------------------------------------- - -----------------------------------------------------------------------*/ SwTableConfig::SwTableConfig(sal_Bool bWeb) : ConfigItem(bWeb ? C2U("Office.WriterWeb/Table") : C2U("Office.Writer/Table"), CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE) { Load(); } -/*-- 10.10.00 16:22:23--------------------------------------------------- - -----------------------------------------------------------------------*/ SwTableConfig::~SwTableConfig() { } -/*-- 10.10.00 16:22:56--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwTableConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} void SwTableConfig::Commit() @@ -1233,15 +1188,13 @@ void SwTableConfig::Commit() } PutProperties(aNames, aValues); } -/*-- 10.10.00 16:22:56--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwTableConfig::Load() { const Sequence<OUString>& aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) @@ -1264,9 +1217,7 @@ void SwTableConfig::Load() } } } -/*-- 18.01.01 17:02:47--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMiscConfig::SwMiscConfig() : ConfigItem(C2U("Office.Writer"), CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE), @@ -1281,15 +1232,11 @@ SwMiscConfig::SwMiscConfig() : { Load(); } -/*-- 18.01.01 17:02:47--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMiscConfig::~SwMiscConfig() { } -/*-- 18.01.01 17:02:47--------------------------------------------------- - -----------------------------------------------------------------------*/ const Sequence<OUString>& SwMiscConfig::GetPropertyNames() { static Sequence<OUString> aNames; @@ -1314,13 +1261,11 @@ const Sequence<OUString>& SwMiscConfig::GetPropertyNames() }; OUString* pNames = aNames.getArray(); for(int i = 0; i < nCount; i++) - pNames[i] = C2U(aPropNames[i]); + pNames[i] = rtl::OUString::createFromAscii(aPropNames[i]); } return aNames; } -/*-- 18.01.01 17:02:47--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMiscConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} void SwMiscConfig::Commit() @@ -1353,15 +1298,13 @@ void SwMiscConfig::Commit() } PutProperties(aNames, aValues); } -/*-- 18.01.01 17:02:48--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMiscConfig::Load() { const Sequence<OUString>& aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { OUString sTmp; @@ -1390,3 +1333,5 @@ void SwMiscConfig::Load() } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index 6e982f62b7..c9c4a2844b 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,9 +44,7 @@ #include "optcomp.hrc" #include "globals.hrc" #include <tools/urlobj.hxx> -#ifndef _UTL__HXX_ #include <unotools/configmgr.hxx> -#endif #include <vcl/msgbox.hxx> #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> @@ -182,15 +181,11 @@ SwCompatibilityOptPage::SwCompatibilityOptPage( Window* pParent, const SfxItemSe m_aOptionsLB.SetSizePixel( aNewSz ); } -// ----------------------------------------------------------------------- - SwCompatibilityOptPage::~SwCompatibilityOptPage() { delete m_pImpl; } -// ----------------------------------------------------------------------- - void SwCompatibilityOptPage::ReplaceFormatName( String& rEntry ) { static const String sOpenOfficeName = String::CreateFromAscii("OpenOffice.org"); @@ -216,8 +211,6 @@ void SwCompatibilityOptPage::ReplaceFormatName( String& rEntry ) } } -// ----------------------------------------------------------------------- - sal_uLong convertBools2Ulong_Impl ( bool _bUsePrtMetrics, @@ -272,8 +265,6 @@ sal_uLong convertBools2Ulong_Impl return nRet; } -// ----------------------------------------------------------------------- - void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) { // init objectshell and detect document name @@ -406,8 +397,6 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) } } -// ----------------------------------------------------------------------- - IMPL_LINK( SwCompatibilityOptPage, SelectHdl, ListBox*, EMPTYARG ) { sal_uInt16 nPos = m_aFormattingLB.GetSelectEntryPos(); @@ -417,8 +406,6 @@ IMPL_LINK( SwCompatibilityOptPage, SelectHdl, ListBox*, EMPTYARG ) return 0; } -// ----------------------------------------------------------------------- - IMPL_LINK( SwCompatibilityOptPage, UseAsDefaultHdl, PushButton*, EMPTYARG ) { QueryBox aBox( this, WinBits( WB_YES_NO | WB_DEF_YES ), m_sUseAsDefaultQuery ); @@ -449,7 +436,7 @@ IMPL_LINK( SwCompatibilityOptPage, UseAsDefaultHdl, PushButton*, EMPTYARG ) case COPT_EXPAND_WORDSPACE: pItem->m_bExpandWordSpace = bChecked; break; default: { - DBG_ERRORFILE( "SwCompatibilityOptPage::UseAsDefaultHdl(): wrong option" ); + OSL_ENSURE(false, "SwCompatibilityOptPage::UseAsDefaultHdl(): wrong option" ); } } } @@ -463,12 +450,10 @@ IMPL_LINK( SwCompatibilityOptPage, UseAsDefaultHdl, PushButton*, EMPTYARG ) return 0; } -// ----------------------------------------------------------------------- - void SwCompatibilityOptPage::SetCurrentOptions( sal_uLong nOptions ) { sal_uLong nCount = m_aOptionsLB.GetEntryCount(); - DBG_ASSERT( nCount <= 32, "SwCompatibilityOptPage::Reset(): entry overflow" ); + OSL_ENSURE( nCount <= 32, "SwCompatibilityOptPage::Reset(): entry overflow" ); for ( sal_uInt16 i = 0; i < nCount; ++i ) { sal_Bool bChecked = ( ( nOptions & 0x00000001 ) == 0x00000001 ); @@ -477,8 +462,6 @@ void SwCompatibilityOptPage::SetCurrentOptions( sal_uLong nOptions ) } } -// ----------------------------------------------------------------------- - sal_uLong SwCompatibilityOptPage::GetDocumentOptions() const { sal_uLong nRet = 0; @@ -501,8 +484,6 @@ sal_uLong SwCompatibilityOptPage::GetDocumentOptions() const return nRet; } -// ----------------------------------------------------------------------- - void SwCompatibilityOptPage::WriteOptions() { m_aConfigItem.Clear(); @@ -517,15 +498,11 @@ void SwCompatibilityOptPage::WriteOptions() pItem->m_bExpandWordSpace ); } -// ----------------------------------------------------------------------- - SfxTabPage* SwCompatibilityOptPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return new SwCompatibilityOptPage( pParent, rAttrSet ); } -// ----------------------------------------------------------------------- - sal_Bool SwCompatibilityOptPage::FillItemSet( SfxItemSet& ) { sal_Bool bModified = sal_False; @@ -533,7 +510,7 @@ sal_Bool SwCompatibilityOptPage::FillItemSet( SfxItemSet& ) { sal_uLong nSavedOptions = m_nSavedOptions; sal_uLong nCount = m_aOptionsLB.GetEntryCount(); - DBG_ASSERT( nCount <= 32, "SwCompatibilityOptPage::Reset(): entry overflow" ); + OSL_ENSURE( nCount <= 32, "SwCompatibilityOptPage::Reset(): entry overflow" ); bool bSetParaSpaceMax = false; @@ -615,8 +592,6 @@ sal_Bool SwCompatibilityOptPage::FillItemSet( SfxItemSet& ) return bModified; } -// ----------------------------------------------------------------------- - void SwCompatibilityOptPage::Reset( const SfxItemSet& ) { m_aOptionsLB.SelectEntryPos( 0 ); @@ -626,3 +601,4 @@ void SwCompatibilityOptPage::Reset( const SfxItemSet& ) m_nSavedOptions = nOptions; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/optdlg.hrc b/sw/source/ui/config/optdlg.hrc index d58d1b6ac4..76054aea6a 100644 --- a/sw/source/ui/config/optdlg.hrc +++ b/sw/source/ui/config/optdlg.hrc @@ -25,7 +25,7 @@ * ************************************************************************/ -/* TabPage Ansicht*/ +/* TabPage View */ #define FL_DISP 1 #define FL_NOPRINT 2 #define FL_WINDOW 3 @@ -69,7 +69,7 @@ #define CB_TEST10 34 #define FL_TEST 35 -#define CB_FLD_HIDDEN_PARA 36 //Mittendrin, damit die HelpIds zum FPII kompatibel bleiben +#define CB_FLD_HIDDEN_PARA 36 // right in the middle of it, so that HelpIds stay compatible to FPII #define CB_SMOOTH_SCROLL 37 #define BT_OK 38 @@ -125,7 +125,7 @@ #define CB_TEXT_PLACEHOLDER 94 -// Tabpage Grundschriften +// Tabpage Basic Fonts #define FT_STANDARD 90 #define LB_STANDARD 91 #define FT_TITLE 92 @@ -150,7 +150,7 @@ #define LB_LABEL_SIZE 111 #define LB_INDEX_SIZE 112 -//Tabpage Tabelle +//Tabpage Table #define CB_HEADER 101 #define CB_REPEAT_HEADER 102 #define CB_DONT_SPLIT 103 diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src index 8514146cc2..bd9566494e 100644 --- a/sw/source/ui/config/optdlg.src +++ b/sw/source/ui/config/optdlg.src @@ -38,7 +38,7 @@ /**************************************************************************/ /* */ -/* TabPage Ansicht/Inhalt */ +/* TabPage View/Content */ /* */ /**************************************************************************/ TabPage TP_CONTENT_OPT diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 7853676af6..6b8672356b 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -71,9 +72,8 @@ using namespace ::com::sun::star; -/* -----------------22.10.98 15:12------------------- - * - * --------------------------------------------------*/ +#include <svl/eitem.hxx> + SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) : SfxTabPage( pParent, SW_RES( TP_OPTLOAD_PAGE ), rSet ), @@ -94,6 +94,7 @@ SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) : aTabFT ( this, SW_RES( FT_TAB ) ), aTabMF ( this, SW_RES( MF_TAB ) ), aUseSquaredPageMode ( this, SW_RES( CB_USE_SQUARE_PAGE_MODE ) ), + aUseCharUnit ( this , SW_RES( CB_USE_CHAR_UNIT ) ), pWrtShell ( NULL ), bHTMLMode ( sal_False ), @@ -117,7 +118,7 @@ SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) : case FUNIT_PICA: case FUNIT_INCH: { - // nur diese Metriken benutzen + // use only these metrics sal_uInt16 nPos = aMetricLB.InsertEntry( sMetric ); aMetricLB.SetEntryData( nPos, (void*)(long)eFUnit ); } @@ -136,32 +137,23 @@ SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) : SvtCJKOptions aCJKOptions; if(!aCJKOptions.IsAsianTypographyEnabled()) + { aUseSquaredPageMode.Hide(); + aUseCharUnit.Hide(); + } } -/*-----------------18.01.97 12.43------------------- - ---------------------------------------------------*/ - SwLoadOptPage::~SwLoadOptPage() { } -/*-----------------18.01.97 12.43------------------- - ---------------------------------------------------*/ - -SfxTabPage* __EXPORT SwLoadOptPage::Create( Window* pParent, +SfxTabPage* SwLoadOptPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return new SwLoadOptPage(pParent, rAttrSet ); } -/*-----------------18.01.97 12.42------------------- - ---------------------------------------------------*/ - -sal_Bool __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) +sal_Bool SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) { sal_Bool bRet = sal_False; SwModule* pMod = SW_MOD(); @@ -201,7 +193,7 @@ sal_Bool __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) const sal_uInt16 nMPos = aMetricLB.GetSelectEntryPos(); if ( nMPos != aMetricLB.GetSavedValue() ) { - // Doppel-Cast fuer VA3.0 + // Double-Cast for VA3.0 sal_uInt16 nFieldUnit = (sal_uInt16)(long)aMetricLB.GetEntryData( nMPos ); rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, (sal_uInt16)nFieldUnit ) ); bRet = sal_True; @@ -213,6 +205,15 @@ sal_Bool __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) (sal_uInt16)aTabMF.Denormalize(aTabMF.GetValue(FUNIT_TWIP)))); bRet = sal_True; } + + sal_Bool bIsUseCharUnitFlag = aUseCharUnit.IsChecked(); + SvtCJKOptions aCJKOptions; + bIsUseCharUnitFlag = bIsUseCharUnitFlag && aCJKOptions.IsAsianTypographyEnabled(); + if( bIsUseCharUnitFlag != aUseCharUnit.GetSavedValue()) + { + rSet.Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bIsUseCharUnitFlag )); + bRet = sal_True; + } sal_Bool bIsSquaredPageModeFlag = aUseSquaredPageMode.IsChecked(); if ( bIsSquaredPageModeFlag != aUseSquaredPageMode.GetSavedValue() ) @@ -229,10 +230,8 @@ sal_Bool __EXPORT SwLoadOptPage::FillItemSet( SfxItemSet& rSet ) return bRet; } -/*-----------------18.01.97 12.42------------------- ---------------------------------------------------*/ -void __EXPORT SwLoadOptPage::Reset( const SfxItemSet& rSet) +void SwLoadOptPage::Reset( const SfxItemSet& rSet) { const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref(sal_False); const SfxPoolItem* pItem; @@ -300,17 +299,28 @@ void __EXPORT SwLoadOptPage::Reset( const SfxItemSet& rSet) aUseSquaredPageMode.Check( bSquaredPageMode ); aUseSquaredPageMode.SaveValue(); } + + if(SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT, sal_False, &pItem)) + { + sal_Bool bUseCharUnit = ((const SfxBoolItem*)pItem)->GetValue(); + aUseCharUnit.Check(bUseCharUnit); + } + else + { + aUseCharUnit.Check(pUsrPref->IsApplyCharUnit()); + } + aUseCharUnit.SaveValue(); } + /*-----------------13.01.97 14.44------------------- - Metric des Deftabstops umschalten + Switch Deftabstops' metric --------------------------------------------------*/ - IMPL_LINK(SwLoadOptPage, MetricHdl, ListBox*, EMPTYARG) { const sal_uInt16 nMPos = aMetricLB.GetSelectEntryPos(); if(nMPos != USHRT_MAX) { - // Doppel-Cast fuer VA3.0 + // Double-Cast for VA3.0 FieldUnit eFieldUnit = (FieldUnit)(long)aMetricLB.GetEntryData( nMPos ); sal_Bool bModified = aTabMF.IsModified(); long nVal = bModified ? @@ -324,9 +334,6 @@ IMPL_LINK(SwLoadOptPage, MetricHdl, ListBox*, EMPTYARG) return 0; } -/*********************************************************************/ -/* */ -/*********************************************************************/ IMPL_LINK(SwLoadOptPage, CaptionHdl, PushButton*, EMPTYARG) { @@ -336,29 +343,17 @@ IMPL_LINK(SwLoadOptPage, CaptionHdl, PushButton*, EMPTYARG) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwCaptionOptDlg::SwCaptionOptDlg(Window* pParent, const SfxItemSet& rSet) : SfxSingleTabDialog(pParent, rSet, 0) { - // TabPage erzeugen + // create TabPage SetTabPage((SwCaptionOptPage*) SwCaptionOptPage::Create(this, rSet)); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwCaptionOptDlg::~SwCaptionOptDlg() { } -/* -----------------22.10.98 15:12------------------- - * - * --------------------------------------------------*/ - SwCaptionPreview::SwCaptionPreview( Window* pParent, const ResId& rResId ) : Window( pParent, rResId ) { @@ -391,7 +386,6 @@ void SwCaptionPreview::Paint( const Rectangle& rRect ) DrawText( Point( 4, 6 ), maText ); } - SwCaptionOptPage::SwCaptionOptPage( Window* pParent, const SfxItemSet& rSet ) : SfxTabPage(pParent, SW_RES(TP_OPTCAPTION_PAGE), rSet), aCheckFT (this, SW_RES(FT_OBJECTS )), @@ -513,36 +507,24 @@ SwCaptionOptPage::SwCaptionOptPage( Window* pParent, const SfxItemSet& rSet ) aCheckLB.SetDeselectHdl( LINK(this, SwCaptionOptPage, SaveEntryHdl) ); } -/*-----------------18.01.97 12.43------------------- - ---------------------------------------------------*/ - SwCaptionOptPage::~SwCaptionOptPage() { DelUserData(); delete pMgr; } -/*-----------------18.01.97 12.43------------------- - ---------------------------------------------------*/ - SfxTabPage* SwCaptionOptPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return new SwCaptionOptPage(pParent, rAttrSet ); } -/*-----------------18.01.97 12.42------------------- - ---------------------------------------------------*/ - sal_Bool SwCaptionOptPage::FillItemSet( SfxItemSet& ) { sal_Bool bRet = sal_False; SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); - SaveEntry(aCheckLB.FirstSelected()); // Aktuellen Eintrag uebernehmen + SaveEntry(aCheckLB.FirstSelected()); // apply current entry SvLBoxEntry* pEntry = aCheckLB.First(); @@ -562,10 +544,6 @@ sal_Bool SwCaptionOptPage::FillItemSet( SfxItemSet& ) return bRet; } -/*-----------------18.01.97 12.42------------------- - ---------------------------------------------------*/ - void SwCaptionOptPage::Reset( const SfxItemSet& rSet) { const SfxPoolItem* pItem; @@ -598,7 +576,7 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet) aAny = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION ); if ( !( aAny >>= sTemp ) ) { - DBG_ERRORFILE( "Couldn't get PRODUCTVERSION variable" ); + OSL_ENSURE(false, "Couldn't get PRODUCTVERSION variable" ); } else { @@ -608,7 +586,7 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet) } else { - DBG_ERRORFILE( "Couldn't get PRODUCTNAME variable" ); + OSL_ENSURE(false, "Couldn't get PRODUCTNAME variable" ); } SvObjectServerList aObjS; @@ -632,10 +610,6 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet) ModifyHdl(); } -/*-----------------18.01.97 12.42------------------- - ---------------------------------------------------*/ - void SwCaptionOptPage::SetOptions(const sal_uInt16 nPos, const SwCapObjType eObjType, const SvGlobalName *pOleId) { @@ -651,10 +625,6 @@ void SwCaptionOptPage::SetOptions(const sal_uInt16 nPos, aCheckLB.SetEntryData(nPos, new InsCaptionOpt(eObjType, pOleId)); } -/*-----------------18.01.97 12.42------------------- - ---------------------------------------------------*/ - void SwCaptionOptPage::DelUserData() { SvLBoxEntry* pEntry = aCheckLB.First(); @@ -667,10 +637,6 @@ void SwCaptionOptPage::DelUserData() } } -/* -----------------26.10.98 11:06------------------- - * - * --------------------------------------------------*/ - IMPL_LINK( SwCaptionOptPage, ShowEntryHdl, SvxCheckListBox *, EMPTYARG ) { SvLBoxEntry* pSelEntry = aCheckLB.FirstSelected(); @@ -796,24 +762,16 @@ IMPL_LINK( SwCaptionOptPage, ShowEntryHdl, SvxCheckListBox *, EMPTYARG ) return 0; } -/* -----------------26.10.98 11:06------------------- - * - * --------------------------------------------------*/ - IMPL_LINK( SwCaptionOptPage, SaveEntryHdl, SvxCheckListBox *, EMPTYARG ) { SvLBoxEntry* pEntry = aCheckLB.GetHdlEntry(); - if (pEntry) // Alles speichern + if (pEntry) // save all SaveEntry(pEntry); return 0; } -/* -----------------05.11.98 16:23------------------- - * - * --------------------------------------------------*/ - void SwCaptionOptPage::SaveEntry(SvLBoxEntry* pEntry) { if (pEntry) @@ -846,19 +804,10 @@ void SwCaptionOptPage::SaveEntry(SvLBoxEntry* pEntry) } } -/* -----------------26.10.98 11:06------------------- - * - * --------------------------------------------------*/ - IMPL_LINK( SwCaptionOptPage, ModifyHdl, Edit *, EMPTYARG ) { String sFldTypeName = aCategoryBox.GetText(); -/* - SwFieldType* pType = sFldTypeName.Len() ? pMgr->GetFldType(RES_SETEXPFLD, sFldTypeName) : 0; - ((SfxSingleTabDialog*)GetParent())->GetOKButton()->Enable( (!pType || ((SwSetExpFieldType*)pType)->GetType() == GSE_SEQ) - && sFldTypeName.Len() != 0 ); -*/ SfxSingleTabDialog *pDlg = (SfxSingleTabDialog *)GetParent(); PushButton *pBtn = pDlg->GetOKButton(); if (pBtn) @@ -874,19 +823,13 @@ IMPL_LINK( SwCaptionOptPage, ModifyHdl, Edit *, EMPTYARG ) return 0; } -/* -----------------26.10.98 10:58------------------- - * - * --------------------------------------------------*/ - IMPL_LINK_INLINE_START( SwCaptionOptPage, SelectHdl, ListBox *, EMPTYARG ) { DrawSample(); return 0; } IMPL_LINK_INLINE_END( SwCaptionOptPage, SelectHdl, ListBox *, EMPTYARG ) -/*-- 02.11.2007 10:00:36--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwCaptionOptPage, OrderHdl, ListBox*, pBox ) { DrawSample(); @@ -895,9 +838,6 @@ IMPL_LINK( SwCaptionOptPage, OrderHdl, ListBox*, pBox ) aNumberingSeparatorED.Enable( nPos == 1 ); return 0; } -/* -----------------26.10.98 10:58------------------- - * - * --------------------------------------------------*/ void SwCaptionOptPage::DrawSample() { @@ -907,7 +847,7 @@ void SwCaptionOptPage::DrawSample() { //#i61007# order of captions bool bOrderNumberingFirst = aLbCaptionOrder.GetSelectEntryPos() == 1; - // Nummer + // number sal_uInt16 nNumFmt = (sal_uInt16)(sal_uLong)aFormatBox.GetEntryData( aFormatBox.GetSelectEntryPos() ); if( SVX_NUM_NUMBER_NONE != nNumFmt ) @@ -915,7 +855,7 @@ void SwCaptionOptPage::DrawSample() //#i61007# order of captions if( !bOrderNumberingFirst ) { - // Kategorie + // category aStr += aCategoryBox.GetText(); aStr += ' '; } @@ -963,10 +903,7 @@ void SwCaptionOptPage::DrawSample() aPreview.SetPreviewText( aStr ); } -/*------------------------------------------------------------------------ - Beschreibung: ComboBox ohne Spaces -------------------------------------------------------------------------*/ - +// Description: ComboBox without Spaces void CaptionComboBox::KeyInput(const KeyEvent& rEvt) { if( rEvt.GetKeyCode().GetCode() != KEY_SPACE ) @@ -975,3 +912,4 @@ void CaptionComboBox::KeyInput(const KeyEvent& rEvt) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/optload.hrc b/sw/source/ui/config/optload.hrc index 89aff7204c..12b7a3c3f6 100644 --- a/sw/source/ui/config/optload.hrc +++ b/sw/source/ui/config/optload.hrc @@ -41,6 +41,7 @@ #define FT_TAB 21 #define MF_TAB 22 #define CB_USE_SQUARE_PAGE_MODE 23 +#define CB_USE_CHAR_UNIT 24 // SwCaptionOptPage ----------------------------- diff --git a/sw/source/ui/config/optload.src b/sw/source/ui/config/optload.src index 9fad441773..aa8b311db0 100644 --- a/sw/source/ui/config/optload.src +++ b/sw/source/ui/config/optload.src @@ -147,6 +147,15 @@ TabPage TP_OPTLOAD_PAGE Text [ en-US ] = "Use square page mode for text grid"; Text [ zh-CN ] = "使用稿纸模式"; }; + + CheckBox CB_USE_CHAR_UNIT + { + Pos = MAP_APPFONT ( 12 , 130) ; + Size = MAP_APPFONT ( 109 , 10 ) ; + Text [ en-US ] = "Enable char unit"; + Text [ x-comment ] = " "; + }; + }; /**************************************************************************/ /* */ @@ -412,6 +421,8 @@ StringArray STR_ARR_METRIC < "Miles" ; FUNIT_MILE ; > ; < "Pica" ; FUNIT_PICA ; > ; < "Point" ; FUNIT_POINT ; > ; + < "Char" ; FUNIT_CHAR ; >; + < "Line" ; FUNIT_LINE ; >; }; }; diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 85141566e8..4602efe874 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,7 +51,7 @@ #include <swmodule.hxx> #include <wrtsh.hxx> #include <uitool.hxx> -#include <cfgitems.hxx> +#include <cfgitems.hxx> //Items for Sw-pages #include <poolfmt.hxx> #include <uiitems.hxx> #include <initui.hxx> @@ -84,17 +85,8 @@ #include <vcl/svapp.hxx> - using namespace ::com::sun::star; - -/******************************************************* - ******************************************************/ - -/*-----------------31.08.96 10.16------------------- - TabPage Anzeige/Inhalt ---------------------------------------------------*/ - SwContentOptPage::SwContentOptPage( Window* pParent, const SfxItemSet& rCoreSet ) : SfxTabPage( pParent, SW_RES( TP_CONTENT_OPT ), rCoreSet ), @@ -159,38 +151,41 @@ SwContentOptPage::SwContentOptPage( Window* pParent, case FUNIT_POINT: case FUNIT_PICA: case FUNIT_INCH: + case FUNIT_CHAR: // add two units , 'character' and 'line' , their ticks are not fixed + case FUNIT_LINE: { - // nur diese Metriken benutzen - sal_uInt16 nPos = aMetricLB.InsertEntry( sMetric ); - aMetricLB.SetEntryData( nPos, (void*)(long)eFUnit ); - aVMetric.InsertEntry( sMetric ); - aVMetric.SetEntryData( nPos, (void*)(long)eFUnit ); - aHMetric.InsertEntry( sMetric ); - aHMetric.SetEntryData( nPos, (void*)(long)eFUnit ); + // only use these metrics + // a horizontal ruler has not the 'line' unit + // there isn't 'line' unit in HTML format + if ( eFUnit != FUNIT_LINE ) + { + sal_uInt16 nPos = aMetricLB.InsertEntry( sMetric ); + aMetricLB.SetEntryData( nPos, (void*)(long)eFUnit ); + aHMetric.InsertEntry( sMetric ); + aHMetric.SetEntryData( nPos, (void*)(long)eFUnit ); + } + // a vertical ruler has not the 'character' unit + if ( eFUnit != FUNIT_CHAR ) + { + sal_uInt16 nPos = aVMetric.InsertEntry( sMetric ); + aVMetric.SetEntryData( nPos, (void*)(long)eFUnit ); + } } default:;//prevent warning } } } -/*-----------------31.08.96 13.58------------------- - ---------------------------------------------------*/ SwContentOptPage::~SwContentOptPage() { } -/*-----------------31.08.96 13.58------------------- - ---------------------------------------------------*/ SfxTabPage* SwContentOptPage::Create( Window* pParent, const SfxItemSet& rAttrSet) { return new SwContentOptPage(pParent, rAttrSet); } -/* -----------------------------07.04.01 16:57-------------------------------- - ---------------------------------------------------------------------------*/ static void lcl_SelectMetricLB(ListBox& rMetric, sal_uInt16 nSID, const SfxItemSet& rSet) { const SfxPoolItem* pItem; @@ -208,9 +203,7 @@ static void lcl_SelectMetricLB(ListBox& rMetric, sal_uInt16 nSID, const SfxItemS } rMetric.SaveValue(); } -/*-----------------31.08.96 13.58------------------- ---------------------------------------------------*/ void SwContentOptPage::Reset(const SfxItemSet& rSet) { const SwElemItem* pElemAttr = 0; @@ -242,9 +235,6 @@ void SwContentOptPage::Reset(const SfxItemSet& rSet) AnyRulerHdl(&aAnyRulerCB); } -/*-----------------31.08.96 13.58------------------- - ---------------------------------------------------*/ sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet) { const SwElemItem* pOldAttr = (const SwElemItem*) @@ -277,7 +267,7 @@ sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet) sal_uInt16 nGlobalMetricPos = nMPos; if ( nMPos != aMetricLB.GetSavedValue() ) { - // Doppel-Cast fuer VA3.0 + // Double-Cast for VA3.0 sal_uInt16 nFieldUnit = (sal_uInt16)(long)aMetricLB.GetEntryData( nMPos ); rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, (sal_uInt16)nFieldUnit ) ); bRet = sal_True; @@ -286,7 +276,7 @@ sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet) nMPos = aHMetric.GetSelectEntryPos(); if ( nMPos != aHMetric.GetSavedValue() || nMPos != nGlobalMetricPos ) { - // Doppel-Cast fuer VA3.0 + // Double-Cast for VA3.0 sal_uInt16 nFieldUnit = (sal_uInt16)(long)aHMetric.GetEntryData( nMPos ); rSet.Put( SfxUInt16Item( FN_HSCROLL_METRIC, (sal_uInt16)nFieldUnit ) ); bRet = sal_True; @@ -294,24 +284,20 @@ sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet) nMPos = aVMetric.GetSelectEntryPos(); if ( nMPos != aVMetric.GetSavedValue() || nMPos != nGlobalMetricPos ) { - // Doppel-Cast fuer VA3.0 + // Double-Cast for VA3.0 sal_uInt16 nFieldUnit = (sal_uInt16)(long)aVMetric.GetEntryData( nMPos ); rSet.Put( SfxUInt16Item( FN_VSCROLL_METRIC, (sal_uInt16)nFieldUnit ) ); bRet = sal_True; } return bRet; } -/* -----------------------------05.03.2002 15:07------------------------------ - ---------------------------------------------------------------------------*/ IMPL_LINK(SwContentOptPage, VertRulerHdl, CheckBox*, pBox) { aVRulerRightCBox.Enable(pBox->IsEnabled() && pBox->IsChecked()); return 0; } -/* -----------------20.09.2002 11:30----------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwContentOptPage, AnyRulerHdl, CheckBox*, pBox) { sal_Bool bChecked = pBox->IsChecked(); @@ -322,16 +308,14 @@ IMPL_LINK( SwContentOptPage, AnyRulerHdl, CheckBox*, pBox) VertRulerHdl(&aVRulerCBox); return 0; } -/*----------------- OS 27.01.95 ----------------------- - TabPage Drucker Zusatzeinstellungen +/*------------------------------------------------------ + TabPage Printer additional settings -------------------------------------------------------*/ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent, const SfxItemSet& rCoreSet) : SfxTabPage( pParent, SW_RES( TP_OPTPRINT_PAGE ), rCoreSet), aFL1 (this, SW_RES(FL_1)), aGrfCB (this, SW_RES(CB_PGRF)), -// aTabCB (this, SW_RES(CB_PTAB)), -// aDrawCB (this, SW_RES(CB_PDRAW)), aCtrlFldCB (this, SW_RES(CB_CTRLFLD)), aBackgroundCB (this, SW_RES(CB_BACKGROUND)), aBlackFontCB (this, SW_RES(CB_BLACK_FONT)), @@ -341,7 +325,6 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent, aFL2 (this, SW_RES(FL_2)), aLeftPageCB (this, SW_RES(CB_LEFTP)), aRightPageCB (this, SW_RES(CB_RIGHTP)), -// aReverseCB (this, SW_RES(CB_REVERSE)), aProspectCB (this, SW_RES(CB_PROSPECT)), aProspectCB_RTL (this, SW_RES(CB_PROSPECT_RTL)), aSeparatorRFL (this, SW_RES(FL_SEP_PRT_RIGHT)), @@ -352,7 +335,6 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent, aEndPageRB (this, SW_RES(RB_PAGEEND)), aFL4 (this, SW_RES(FL_4)), aPrintEmptyPagesCB(this, SW_RES(CB_PRINTEMPTYPAGES)), -// aSingleJobsCB (this, SW_RES(CB_SINGLEJOBS)), aPaperFromSetupCB(this, SW_RES(CB_PAPERFROMSETUP)), aFaxFT (this, SW_RES(FT_FAX)), aFaxLB (this, SW_RES(LB_FAX)), @@ -366,14 +348,11 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent, aGrfCB.SetClickHdl( aLk ); aRightPageCB.SetClickHdl( aLk ); aLeftPageCB.SetClickHdl( aLk ); -// aTabCB.SetClickHdl( aLk ); -// aDrawCB.SetClickHdl( aLk ); aCtrlFldCB.SetClickHdl( aLk ); aBackgroundCB.SetClickHdl( aLk ); aBlackFontCB.SetClickHdl( aLk ); aPrintHiddenTextCB.SetClickHdl( aLk ); aPrintTextPlaceholderCB.SetClickHdl( aLk ); -// aReverseCB.SetClickHdl( aLk ); aProspectCB.SetClickHdl( aLk ); aProspectCB_RTL.SetClickHdl( aLk ); aPaperFromSetupCB.SetClickHdl( aLk ); @@ -382,27 +361,20 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent, aEndRB.SetClickHdl( aLk ); aOnlyRB.SetClickHdl( aLk ); aNoRB.SetClickHdl( aLk ); -// aSingleJobsCB.SetClickHdl( aLk ); aFaxLB.SetSelectHdl( LINK( this, SwAddPrinterTabPage, SelectHdl ) ); const SfxPoolItem* pItem; if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_HTML_MODE, sal_False, &pItem ) && ((SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON) { -// aDrawCB .Hide(); aLeftPageCB .Hide(); aRightPageCB .Hide(); aPrintHiddenTextCB.Hide(); aPrintTextPlaceholderCB.Hide(); -// aReverseCB.SetPosPixel(aLeftPageCB.GetPosPixel()); aProspectCB.SetPosPixel(aLeftPageCB.GetPosPixel()); Point aPt( aRightPageCB.GetPosPixel() ); aPt.setX(aPt.getX() + 15); // indent aProspectCB_RTL.SetPosPixel(aPt); -// aBlackFontCB.SetPosPixel(aBackgroundCB.GetPosPixel()); -// aPrintHiddenTextCB.SetPosPixel(aBlackFontCB.GetPosPixel()); -// aBackgroundCB.SetPosPixel(aCtrlFldCB.GetPosPixel()); -// aCtrlFldCB.SetPosPixel(aDrawCB.GetPosPixel()); // hide aPrintEmptyPagesCB and move everything below up accordingly long nDeltaY = aPaperFromSetupCB.GetPosPixel().getY() - aPrintEmptyPagesCB.GetPosPixel().getY(); @@ -422,8 +394,6 @@ SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent, aProspectCB_RTL.Show(aCTLOptions.IsCTLFontEnabled()); } -//------------------------------------------------------------------------ - void SwAddPrinterTabPage::SetPreview(sal_Bool bPrev) { bPreview = bPrev; @@ -442,15 +412,11 @@ void SwAddPrinterTabPage::SetPreview(sal_Bool bPrev) } } -//------------------------------------------------------------------------ - SfxTabPage* SwAddPrinterTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return ( new SwAddPrinterTabPage( pParent, rAttrSet ) ); } -//------------------------------------------------------------------------ - sal_Bool SwAddPrinterTabPage::FillItemSet( SfxItemSet& rCoreSet ) { @@ -490,8 +456,6 @@ sal_Bool SwAddPrinterTabPage::FillItemSet( SfxItemSet& rCoreSet ) } return bAttrModified; } -//------------------------------------------------------------------------ - void SwAddPrinterTabPage::Reset( const SfxItemSet& ) { @@ -502,8 +466,6 @@ void SwAddPrinterTabPage::Reset( const SfxItemSet& ) (const SfxPoolItem**)&pAddPrinterAttr )) { aGrfCB.Check( pAddPrinterAttr->bPrintGraphic || pAddPrinterAttr->bPrintDraw ); -// aTabCB.Check( pAddPrinterAttr->bPrintTable); -// aDrawCB.Check( pAddPrinterAttr->bPrintDraw); aCtrlFldCB.Check( pAddPrinterAttr->bPrintControl); aBackgroundCB.Check( pAddPrinterAttr->bPrintPageBackground); aBlackFontCB.Check( pAddPrinterAttr->bPrintBlackFont); @@ -511,12 +473,10 @@ void SwAddPrinterTabPage::Reset( const SfxItemSet& ) aPrintTextPlaceholderCB.Check(pAddPrinterAttr->bPrintTextPlaceholder); aLeftPageCB.Check( pAddPrinterAttr->bPrintLeftPages); aRightPageCB.Check( pAddPrinterAttr->bPrintRightPages); -// aReverseCB.Check( pAddPrinterAttr->bPrintReverse); aPaperFromSetupCB.Check(pAddPrinterAttr->bPaperFromSetup); aPrintEmptyPagesCB.Check(pAddPrinterAttr->bPrintEmptyPages); aProspectCB.Check( pAddPrinterAttr->bPrintProspect); aProspectCB_RTL.Check( pAddPrinterAttr->bPrintProspectRTL); -// aSingleJobsCB.Check( pAddPrinterAttr->bPrintSingleJobs); aNoRB.Check (pAddPrinterAttr->nPrintPostIts== POSTITS_NONE ) ; aOnlyRB.Check (pAddPrinterAttr->nPrintPostIts== POSTITS_ONLY ) ; @@ -535,15 +495,11 @@ void SwAddPrinterTabPage::Reset( const SfxItemSet& ) else aProspectCB_RTL.Enable( sal_False ); } -//----------------------------------------------------------------------- - void SwAddPrinterTabPage::Init() { } -//------------------------------------------------------------------------ - IMPL_LINK_INLINE_START( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG ) { @@ -560,9 +516,6 @@ IMPL_LINK_INLINE_START( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG } IMPL_LINK_INLINE_END( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG ) -//------------------------------------------------------------------------ - - void SwAddPrinterTabPage::SetFax( const SvStringsDtor& rFaxLst ) { aFaxLB.InsertEntry(sNone); @@ -571,9 +524,6 @@ void SwAddPrinterTabPage::SetFax( const SvStringsDtor& rFaxLst ) aFaxLB.SelectEntryPos(0); } -//------------------------------------------------------------------------ - - IMPL_LINK_INLINE_START( SwAddPrinterTabPage, SelectHdl, ListBox *, EMPTYARG ) { bAttrModified=sal_True; @@ -583,7 +533,6 @@ IMPL_LINK_INLINE_END( SwAddPrinterTabPage, SelectHdl, ListBox *, EMPTYARG ) void SwAddPrinterTabPage::PageCreated (SfxAllItemSet aSet) { - //SFX_ITEMSET_ARG (&aSet,pListItem,SfxStringListItem,SID_FAX_LIST,sal_False); SFX_ITEMSET_ARG (&aSet,pListItem,SfxBoolItem,SID_FAX_LIST,sal_False); SFX_ITEMSET_ARG (&aSet,pPreviewItem,SfxBoolItem,SID_PREVIEWFLAG_TYPE,sal_False); if (pPreviewItem) @@ -602,24 +551,12 @@ void SwAddPrinterTabPage::PageCreated (SfxAllItemSet aSet) aFaxList.Insert(rpString, 0); } SetFax( aFaxList ); -/* SvStringsDtor aFaxList; - const List *pList = (pListItem)->GetList(); - sal_uInt32 nCount = pList->Count(); - for(sal_uInt32 i = 0; i < nCount ; i++) - { - String* pString = (String*)(pList->GetObject(i)); - String* &rpString = pString; - aFaxList.Insert(rpString, 0 ); - } - SetFax(aFaxList); -*/ } } -/*-----------------03.09.96 11.53------------------- + +/*-------------------------------------------------- Tabpage Standardfonts --------------------------------------------------*/ - - SwStdFontTabPage::SwStdFontTabPage( Window* pParent, const SfxItemSet& rSet ) : SfxTabPage( pParent, SW_RES( TP_STD_FONT ), rSet), @@ -700,28 +637,18 @@ SwStdFontTabPage::SwStdFontTabPage( Window* pParent, aDocOnlyCB.Check(SW_MOD()->GetModuleConfig()->IsDefaultFontInCurrDocOnly()); } -/*-----------------03.09.96 11.53------------------- - ---------------------------------------------------*/ - SwStdFontTabPage::~SwStdFontTabPage() { if(bDeletePrinter) delete pPrt; } -/*-----------------03.09.96 11.53------------------- - ---------------------------------------------------*/ SfxTabPage* SwStdFontTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return new SwStdFontTabPage(pParent, rAttrSet); } -/*-----------------03.09.96 11.53------------------- - ---------------------------------------------------*/ void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType, SfxPrinter* pPrt, const String& rStyle, sal_uInt16 nFontWhich) @@ -733,9 +660,7 @@ void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType, pColl->SetFmtAttr(SvxFontItem(aFont.GetFamily(), aFont.GetName(), aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich)); } -/*-- 11.10.2005 15:47:52--------------------------------------------------- - -----------------------------------------------------------------------*/ void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType, sal_Int32 nHeight, sal_uInt16 nFontHeightWhich) { @@ -744,9 +669,7 @@ void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType, SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(nType); pColl->SetFmtAttr(SvxFontHeightItem(nHeight, 100, nFontHeightWhich)); } -/*-----------------03.09.96 11.53------------------- ---------------------------------------------------*/ sal_Bool SwStdFontTabPage::FillItemSet( SfxItemSet& ) { sal_Bool bNotDocOnly = !aDocOnlyCB.IsChecked(); @@ -821,7 +744,6 @@ sal_Bool SwStdFontTabPage::FillItemSet( SfxItemSet& ) aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich)); SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_STANDARD); pColl->ResetFmtAttr(nFontWhich); -// lcl_SetColl(pWrtShell, RES_POOLCOLL_STANDARD, pPrinter, sStandard); bMod = sal_True; } if(bStandardHeightChanged) @@ -885,9 +807,6 @@ sal_Bool SwStdFontTabPage::FillItemSet( SfxItemSet& ) return sal_False; } -/*-----------------03.09.96 11.53------------------- - ---------------------------------------------------*/ void SwStdFontTabPage::Reset( const SfxItemSet& rSet) { const SfxPoolItem* pLang; @@ -1080,11 +999,6 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet) aIndexHeightLB. SaveValue(); } -/*-----------------07.09.96 12.28------------------- - ---------------------------------------------------*/ - - IMPL_LINK( SwStdFontTabPage, StandardHdl, PushButton *, EMPTYARG ) { sal_uInt8 nFontOffset = nFontGroup * FONT_PER_GROUP; @@ -1118,9 +1032,6 @@ IMPL_LINK( SwStdFontTabPage, StandardHdl, PushButton *, EMPTYARG ) return 0; } -/*-----------------17.01.97 15.43------------------- - ---------------------------------------------------*/ IMPL_LINK( SwStdFontTabPage, ModifyHdl, ComboBox*, pBox ) { @@ -1149,9 +1060,6 @@ IMPL_LINK( SwStdFontTabPage, ModifyHdl, ComboBox*, pBox ) return 0; } -/*-- 11.10.2005 15:11:23--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK( SwStdFontTabPage, ModifyHeightHdl, FontSizeBox*, pBox ) { if(pBox == &aStandardHeightLB) @@ -1179,9 +1087,6 @@ IMPL_LINK( SwStdFontTabPage, ModifyHeightHdl, FontSizeBox*, pBox ) return 0; } -/*-- 28.09.2005 13:22:36--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, ComboBox*, pBox ) { FontSizeBox* pHeightLB = 0; @@ -1219,9 +1124,6 @@ void SwStdFontTabPage::PageCreated (SfxAllItemSet aSet) if (pFlagItem) SetFontMode(sal::static_int_cast< sal_uInt8, sal_uInt16>( pFlagItem->GetValue())); } -/*-----------------18.01.97 12.14------------------- - Optionen Tabelle ---------------------------------------------------*/ SwTableOptionsTabPage::SwTableOptionsTabPage( Window* pParent, const SfxItemSet& rSet ) : SfxTabPage(pParent, SW_RES(TP_OPTTABLE_PAGE), rSet), @@ -1269,28 +1171,16 @@ SwTableOptionsTabPage::SwTableOptionsTabPage( Window* pParent, const SfxItemSet& aHeaderCB.SetClickHdl(aLnk); } -/*-----------------18.01.97 12.43------------------- - ---------------------------------------------------*/ - SwTableOptionsTabPage::~SwTableOptionsTabPage() { } -/*-----------------18.01.97 12.43------------------- - ---------------------------------------------------*/ - SfxTabPage* SwTableOptionsTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return new SwTableOptionsTabPage(pParent, rAttrSet ); } -/*-----------------18.01.97 12.42------------------- - ---------------------------------------------------*/ - sal_Bool SwTableOptionsTabPage::FillItemSet( SfxItemSet& ) { sal_Bool bRet = sal_False; @@ -1318,12 +1208,12 @@ sal_Bool SwTableOptionsTabPage::FillItemSet( SfxItemSet& ) if(eMode != pModOpt->GetTblMode()) { pModOpt->SetTblMode(eMode); - // der Tabellen-Tastatur-Modus hat sich geaendert, das soll - // jetzt auch die aktuelle Tabelle erfahren + // the table-keyboard-mode has changed, now the current + // table should know about that too. if(pWrtShell && nsSelectionType::SEL_TBL & pWrtShell->GetSelectionType()) { pWrtShell->SetTblChgMode(eMode); - static sal_uInt16 __READONLY_DATA aInva[] = + static sal_uInt16 aInva[] = { FN_TABLE_MODE_FIX, FN_TABLE_MODE_FIX_PROP, FN_TABLE_MODE_VARIABLE, @@ -1377,9 +1267,7 @@ sal_Bool SwTableOptionsTabPage::FillItemSet( SfxItemSet& ) return bRet; } -/*-----------------18.01.97 12.42------------------- ---------------------------------------------------*/ void SwTableOptionsTabPage::Reset( const SfxItemSet& rSet) { const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); @@ -1410,46 +1298,10 @@ void SwTableOptionsTabPage::Reset( const SfxItemSet& rSet) bHTMLMode = 0 != (((const SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON); } - //bestimmte Controls fuer HTML verstecken + // hide certain controls for html if(bHTMLMode) { -/* Point aPos(aCaptionFL.GetPosPixel()); - long nYDiff = aTableFL.GetPosPixel().Y() - aPos.Y(); - aTableFL.SetPosPixel(aPos); - - aPos = aHeaderCB.GetPosPixel(); - aPos.Y() -= nYDiff; - aHeaderCB.SetPosPixel(aPos); - - aPos = aRepeatHeaderCB.GetPosPixel(); - aPos.Y() -= nYDiff; - aRepeatHeaderCB.SetPosPixel(aPos); - - aPos = aDontSplitCB.GetPosPixel(); // hier muss eine Luecke geschlossen werden - aPos.Y() -= nYDiff; - aBorderCB.SetPosPixel(aPos); - aPos = aTableInsertFL.GetPosPixel(); - aPos.Y() -= nYDiff; - aTableInsertFL.SetPosPixel(aPos); - - aPos = aNumFormattingCB.GetPosPixel(); - aPos.Y() -= nYDiff; - aNumFormattingCB.SetPosPixel(aPos); - - aPos = aNumFmtFormattingCB.GetPosPixel(); - aPos.Y() -= nYDiff; - aNumFmtFormattingCB.SetPosPixel(aPos); - - aPos = aNumAlignmentCB.GetPosPixel(); - aPos.Y() -= nYDiff; - aNumAlignmentCB.SetPosPixel(aPos); - - aCaptionFL.Hide(); - aCaptionCB.Hide(); - aCaptionFT.Hide(); - aCaptionPB.Hide(); -*/ aDontSplitCB.Hide(); } @@ -1475,9 +1327,7 @@ void SwTableOptionsTabPage::Reset( const SfxItemSet& rSet) CheckBoxHdl(0); } -/*-----------------18.01.97 12.42------------------- ---------------------------------------------------*/ IMPL_LINK(SwTableOptionsTabPage, CheckBoxHdl, CheckBox*, EMPTYARG) { aNumFmtFormattingCB.Enable(aNumFormattingCB.IsChecked()); @@ -1492,11 +1342,6 @@ void SwTableOptionsTabPage::PageCreated (SfxAllItemSet aSet) if (pWrtSh) SetWrtShell(pWrtSh->GetValue()); } -/* */ - -/*-----------------31.10.97 17:55------------------- - TabPage fuer ShadowCrsr ---------------------------------------------------*/ SwShdwCrsrOptionsTabPage::SwShdwCrsrOptionsTabPage( Window* pParent, const SfxItemSet& rSet ) @@ -1572,7 +1417,6 @@ SwShdwCrsrOptionsTabPage::~SwShdwCrsrOptionsTabPage() { } - SfxTabPage* SwShdwCrsrOptionsTabPage::Create( Window* pParent, const SfxItemSet& rSet ) { return new SwShdwCrsrOptionsTabPage( pParent, rSet ); @@ -1628,7 +1472,7 @@ sal_Bool SwShdwCrsrOptionsTabPage::FillItemSet( SfxItemSet& rSet ) SwDocDisplayItem aDisp; if(pOldAttr) aDisp = *pOldAttr; - // + aDisp.bParagraphEnd = aParaCB .IsChecked(); aDisp.bTab = aTabCB .IsChecked(); aDisp.bSpace = aSpacesCB .IsChecked(); @@ -1686,18 +1530,17 @@ void SwShdwCrsrOptionsTabPage::Reset( const SfxItemSet& rSet ) } } -/*-----------------31.10.97 17:55------------------- - TabPage fuer Redlining +/*-------------------------------------------------- + TabPage for Redlining --------------------------------------------------*/ - struct CharAttr { sal_uInt16 nItemId; sal_uInt16 nAttr; }; -// Editieren entspricht Einfuegen-Attributen -static CharAttr __FAR_DATA aRedlineAttr[] = +// Edit corresponds to Paste-attributes +static CharAttr aRedlineAttr[] = { { SID_ATTR_CHAR_CASEMAP, SVX_CASEMAP_NOT_MAPPED }, { SID_ATTR_CHAR_WEIGHT, WEIGHT_BOLD }, @@ -1724,9 +1567,8 @@ static sal_uInt16 aDeletedAttrMap[] = { 0, 1, 2, 5, 6, 7, 8, 9, 10 }; static sal_uInt16 aChangedAttrMap[] = { 0, 1, 2, 3, 4, 6, 7, 8, 9, 10 }; /*----------------------------------------------------------------------- - Beschreibung: Markierungsvorschau + Description: Preview of selection -----------------------------------------------------------------------*/ - SwMarkPreview::SwMarkPreview( Window *pParent, const ResId& rResID ) : Window(pParent, rResID), @@ -1740,7 +1582,7 @@ SwMarkPreview::SwMarkPreview( Window *pParent, const ResId& rResID ) : const Size aSz(GetOutputSizePixel()); - // Seite + // Page aPage.SetSize(Size(aSz.Width() - 3, aSz.Height() - 3)); sal_uLong nOutWPix = aPage.GetWidth(); @@ -1789,15 +1631,15 @@ void SwMarkPreview::DataChanged( const DataChangedEvent& rDCEvt ) void SwMarkPreview::Paint(const Rectangle &/*rRect*/) { - // Schatten zeichnen + // draw shadow Rectangle aShadow(aPage); aShadow += Point(3, 3); DrawRect( aShadow, m_aShadowCol, m_aTransCol ); - // Seite zeichnen + // draw page DrawRect( aPage, m_aBgCol, m_aLineCol ); - // Separator zeichnen + // draw separator Rectangle aPageSeparator(aPage); aPageSeparator.SetSize(Size(2, aPageSeparator.GetHeight())); aPageSeparator.Move(aPage.GetWidth() / 2 - 1, 0); @@ -1811,23 +1653,23 @@ void SwMarkPreview::Paint(const Rectangle &/*rRect*/) switch (nMarkPos) { - case 1: // Links + case 1: // left aRightMark.SetPos(Point(aRightPagePrtArea.Left() - 2 - aRightMark.GetWidth(), aRightMark.Top())); break; - case 2: // Rechts + case 2: // right aLeftMark.SetPos(Point(aLeftPagePrtArea.Right() + 2, aLeftMark.Top())); break; - case 3: // Aussen + case 3: // outside break; - case 4: // Innen + case 4: // inside aLeftMark.SetPos(Point(aLeftPagePrtArea.Right() + 2, aLeftMark.Top())); aRightMark.SetPos(Point(aRightPagePrtArea.Left() - 2 - aRightMark.GetWidth(), aRightMark.Top())); break; - case 0: // Keine + case 0: // none default: return; } @@ -1837,10 +1679,10 @@ void SwMarkPreview::Paint(const Rectangle &/*rRect*/) void SwMarkPreview::PaintPage(const Rectangle &rRect) { - // PrintArea zeichnen + // draw PrintArea DrawRect(rRect, m_aTransCol, m_aPrintAreaCol ); - // Testabsatz zeichnen + // draw Testparagraph sal_uLong nLTxtBorder = 4; sal_uLong nRTxtBorder = 4; sal_uLong nTTxtBorder = 4; @@ -1857,8 +1699,7 @@ void SwMarkPreview::PaintPage(const Rectangle &rRect) nStep = aTextLine.GetHeight() + 2; nLines = (sal_uInt16)(rRect.GetHeight() / (aTextLine.GetHeight() + 2)) - 1; - // Text simulieren - // + // simulate text for (sal_uInt16 i = 0; i < nLines; ++i) { if (i == (nLines - 1)) @@ -2095,7 +1936,7 @@ sal_Bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet& ) nOldMarkColor != pOpt->GetMarkAlignColor().GetColor() || nOldMarkMode != pOpt->GetMarkAlignMode()) { - // Alle Dokumente aktualisieren + // update all documents TypeId aType(TYPE(SwDocShell)); SwDocShell* pDocShell = (SwDocShell*)SfxObjectShell::GetFirst(&aType); @@ -2117,12 +1958,12 @@ void SwRedlineOptionsTabPage::Reset( const SfxItemSet& ) const AuthorCharAttr &rDeletedAttr = pOpt->GetDeletedAuthorAttr(); const AuthorCharAttr &rChangedAttr = pOpt->GetFormatAuthorAttr(); - // Preview initialisieren + // initialise preview InitFontStyle(aInsertedPreviewWN); InitFontStyle(aDeletedPreviewWN); InitFontStyle(aChangedPreviewWN); - // Farblistboxen initialisieren + // initialise colour list box String sColor; aInsertColorLB.SetUpdateMode(sal_False); aDeletedColorLB.SetUpdateMode(sal_False); @@ -2221,7 +2062,7 @@ void SwRedlineOptionsTabPage::Reset( const SfxItemSet& ) } aMarkPosLB.SelectEntryPos(nPos); - // Einstellungen in Preview anzeigen + // show settings in preview AttribHdl(&aInsertLB); ColorHdl(&aInsertColorLB); AttribHdl(&aDeletedLB); @@ -2461,12 +2302,7 @@ void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin) } -#ifdef DBG_UTIL -/******************************************************* - ******************************************************/ -/*----------------- OS 11.01.95 ----------------------- - TabPage Testeinstellungen --------------------------------------------------------*/ +#if OSL_DEBUG_LEVEL > 1 void lcl_SetPosSize(Window& rWin, Point aPos, Size aSize) { @@ -2530,17 +2366,11 @@ SwTestTabPage::SwTestTabPage( Window* pParent, } - -//------------------------------------------------------------------------ - - SfxTabPage* SwTestTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return ( new SwTestTabPage( pParent, rAttrSet ) ); } -//------------------------------------------------------------------------ - sal_Bool SwTestTabPage::FillItemSet( SfxItemSet& rCoreSet ) { @@ -2562,8 +2392,6 @@ sal_Bool SwTestTabPage::FillItemSet( SfxItemSet& rCoreSet ) } return bAttrModified; } -//------------------------------------------------------------------------ - void SwTestTabPage::Reset( const SfxItemSet& ) { @@ -2585,8 +2413,6 @@ void SwTestTabPage::Reset( const SfxItemSet& ) aTest10CBox.Check(pTestAttr->bTest10); } } -//------------------------------------------------------------------------ - void SwTestTabPage::Init() { @@ -2603,8 +2429,6 @@ void SwTestTabPage::Init() aTest9CBox.SetClickHdl( aLk ); aTest10CBox.SetClickHdl( aLk ); } -//------------------------------------------------------------------------ - IMPL_LINK_INLINE_START( SwTestTabPage, AutoClickHdl, CheckBox *, EMPTYARG ) { @@ -2615,3 +2439,5 @@ IMPL_LINK_INLINE_END( SwTestTabPage, AutoClickHdl, CheckBox *, EMPTYARG ) #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/prtopt.cxx b/sw/source/ui/config/prtopt.cxx index 8b7f3af37f..1ee9e7e853 100644 --- a/sw/source/ui/config/prtopt.cxx +++ b/sw/source/ui/config/prtopt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,7 +31,7 @@ #include <unotools/configmgr.hxx> #include <prtopt.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> @@ -42,7 +43,7 @@ using rtl::OUString; using namespace com::sun::star::uno; /*-------------------------------------------------------------------- - Beschreibung: Ctor + Description: Ctor --------------------------------------------------------------------*/ Sequence<OUString> SwPrintOptions::GetPropertyNames() @@ -77,9 +78,7 @@ Sequence<OUString> SwPrintOptions::GetPropertyNames() } return aNames; } -/* -----------------------------06.09.00 16:44-------------------------------- - ---------------------------------------------------------------------------*/ SwPrintOptions::SwPrintOptions(sal_Bool bWeb) : ConfigItem(bWeb ? C2U("Office.WriterWeb/Print") : C2U("Office.Writer/Print"), CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE), @@ -94,7 +93,7 @@ SwPrintOptions::SwPrintOptions(sal_Bool bWeb) : Sequence<OUString> aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) @@ -138,15 +137,11 @@ SwPrintOptions::SwPrintOptions(sal_Bool bWeb) : bPrintDraw = bPrintGraphic; } -/* -----------------------------06.09.00 16:50-------------------------------- - ---------------------------------------------------------------------------*/ SwPrintOptions::~SwPrintOptions() { } -/* -----------------------------06.09.00 16:43-------------------------------- - ---------------------------------------------------------------------------*/ void SwPrintOptions::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} @@ -195,3 +190,4 @@ void SwPrintOptions::Commit() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/uinums.cxx b/sw/source/ui/config/uinums.cxx index 39f09c2e9b..c72ea4680d 100644 --- a/sw/source/ui/config/uinums.cxx +++ b/sw/source/ui/config/uinums.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,23 +29,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - - #include <hintids.hxx> #include <svl/urihelper.hxx> #include <unotools/pathoptions.hxx> #include <tools/stream.hxx> -#ifndef _SFX_INIMGR_HXX -#endif #include <sfx2/docfile.hxx> #include <svl/itemiter.hxx> #include <editeng/brshitem.hxx> - #include <tools/resid.hxx> #include <fmtornt.hxx> -#include <swtypes.hxx> // Leerstring +#include <swtypes.hxx> // empty string #include <wrtsh.hxx> #include <uinums.hxx> #include <poolfmt.hxx> @@ -66,21 +61,16 @@ using namespace ::com::sun::star; #define NUMRULE_FILENAME "numrule.cfg" #define CHAPTER_FILENAME "chapter.cfg" -/*------------------------------------------------------------------------ - Beschreibung: Ops. zum Laden / Speichern -------------------------------------------------------------------------*/ - - SV_IMPL_PTRARR( _SwNumFmtsAttrs, SfxPoolItem* ) // SwNumRulesWithName ---------------------------------------------------- // PUBLIC METHODES ------------------------------------------------------- /*------------------------------------------------------------------------ - Beschreibung: Speichern einer Regel - Parameter: rCopy -- die zu speichernde Regel - nIdx -- Position, an der die Regel zu speichern ist. - Eine alte Regel an dieser Position wird ueberschrieben. + Description: Saving a rule + Parameter: rCopy -- the rule to save + nIdx -- position, where the rule is to be saved. + An old rule at that position will be overwritten. ------------------------------------------------------------------------*/ SwBaseNumRules::SwBaseNumRules( const String& rFileName ) @@ -92,9 +82,6 @@ SwBaseNumRules::SwBaseNumRules( const String& rFileName ) Init(); } -/*-----------------26.06.97 08.30------------------- - ---------------------------------------------------*/ SwBaseNumRules::~SwBaseNumRules() { if( bModified ) @@ -114,9 +101,6 @@ SwBaseNumRules::~SwBaseNumRules() delete pNumRules[i]; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ void SwBaseNumRules::Init() { for(sal_uInt16 i = 0; i < nMaxRules; ++i ) @@ -131,29 +115,21 @@ void SwBaseNumRules::Init() } } -/*-----------------26.06.97 08.30------------------- - ---------------------------------------------------*/ - void SwBaseNumRules::ApplyNumRules(const SwNumRulesWithName &rCopy, sal_uInt16 nIdx) { - ASSERT(nIdx < nMaxRules, Array der NumRules ueberindiziert.); + OSL_ENSURE(nIdx < nMaxRules, "Array der NumRules ueberindiziert."); if( !pNumRules[nIdx] ) pNumRules[nIdx] = new SwNumRulesWithName( rCopy ); else *pNumRules[nIdx] = rCopy; } -// PROTECTED METHODES ---------------------------------------------------- -/*------------------------------------------------------------------------ - Beschreibung: Speichern -------------------------------------------------------------------------*/ - -sal_Bool /**/ SwBaseNumRules::Store(SvStream &rStream) +// PROTECTED METHODS ---------------------------------------------------- +sal_Bool SwBaseNumRules::Store(SvStream &rStream) { rStream << ACT_NUM_VERSION; - // Schreiben, welche Positionen durch eine Regel belegt sind - // Anschliessend Schreiben der einzelnen Rules + // Write, what positions are occupied by a rule + // Then write each of the rules for(sal_uInt16 i = 0; i < nMaxRules; ++i) { if(pNumRules[i]) @@ -167,24 +143,17 @@ sal_Bool /**/ SwBaseNumRules::Store(SvStream &rStream) return sal_True; } - - -/*------------------------------------------------------------------------ - Beschreibung: Speichern / Laden -------------------------------------------------------------------------*/ - - int SwBaseNumRules::Load(SvStream &rStream) { int rc = 0; rStream >> nVersion; - // wegen eines kleinen aber schweren Fehlers schreibt die PreFinal die - // gleiche VERSION_40A wie das SP2 #55402# + // due to a small but serious mistake, PreFinal writes the same VERION_40A as SP2 + // #55402# if(VERSION_40A == nVersion) { - DBG_ERROR("Version 364 ist nicht eindeutig #55402#"); + OSL_ENSURE(false, "Version 364 is not clear #55402#"); } else if( VERSION_30B == nVersion || VERSION_31B == nVersion || ACT_NUM_VERSION >= nVersion ) @@ -205,35 +174,21 @@ int SwBaseNumRules::Load(SvStream &rStream) return rc; } -/*-----------------26.06.97 08.34------------------- - ---------------------------------------------------*/ - -/*------------------------------------------------------------------------*/ - - SwChapterNumRules::SwChapterNumRules() : SwBaseNumRules(C2S(CHAPTER_FILENAME)) { } -/*------------------------------------------------------------------------*/ - SwChapterNumRules::~SwChapterNumRules() { } -/*-----------------26.06.97 08.23------------------- - ---------------------------------------------------*/ void SwChapterNumRules::ApplyNumRules(const SwNumRulesWithName &rCopy, sal_uInt16 nIdx) { bModified = sal_True; SwBaseNumRules::ApplyNumRules(rCopy, nIdx); } -/*------------------------------------------------------------------------*/ - SwNumRulesWithName::SwNumRulesWithName( const SwNumRule &rCopy, const String &rName ) : aName(rName) @@ -248,28 +203,18 @@ SwNumRulesWithName::SwNumRulesWithName( const SwNumRule &rCopy, } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ SwNumRulesWithName::SwNumRulesWithName( const SwNumRulesWithName& rCopy ) { memset( aFmts, 0, sizeof( aFmts )); *this = rCopy; } - -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ SwNumRulesWithName::~SwNumRulesWithName() { for( int n = 0; n < MAXLEVEL; ++n ) delete aFmts[ n ]; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ const SwNumRulesWithName& SwNumRulesWithName::operator=(const SwNumRulesWithName &rCopy) { if( this != &rCopy ) @@ -289,9 +234,6 @@ const SwNumRulesWithName& SwNumRulesWithName::operator=(const SwNumRulesWithName return *this; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ SwNumRulesWithName::SwNumRulesWithName( SvStream &rStream, sal_uInt16 nVersion ) { CharSet eEncoding = gsl_getSystemTextEncoding(); @@ -302,10 +244,9 @@ SwNumRulesWithName::SwNumRulesWithName( SvStream &rStream, sal_uInt16 nVersion ) { if( VERSION_30B == nVersion ) c = 1; - // wegen eines kleinen aber schweren Fehlers schreibt die PreFinal die - // gleiche VERSION_40A wie das SP2 #55402# + // due to a small but serious mistake, PreFinal writes the same VERION_40A as SP2 + // #55402# else if(nVersion < VERSION_40A && n > 5) -// else if(nVersion < VERSION_50A && n > 5) c = 0; else rStream >> c; @@ -317,16 +258,10 @@ SwNumRulesWithName::SwNumRulesWithName( SvStream &rStream, sal_uInt16 nVersion ) } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwNumRulesWithName::MakeNumRule( SwWrtShell& rSh, SwNumRule& rChg ) const { - // --> OD 2008-02-11 #newlistlevelattrs# - // --> OD 2008-06-06 #i89178# + // #i89178# rChg = SwNumRule( aName, numfunc::GetDefaultPositionAndSpaceMode() ); - // <-- rChg.SetAutoRule( sal_False ); _SwNumFmtGlobal* pFmt; for( sal_uInt16 n = 0; n < MAXLEVEL; ++n ) @@ -338,9 +273,6 @@ void SwNumRulesWithName::MakeNumRule( SwWrtShell& rSh, SwNumRule& rChg ) const } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ void SwNumRulesWithName::Store( SvStream &rStream ) { CharSet eEncoding = gsl_getSystemTextEncoding(); @@ -358,15 +290,11 @@ void SwNumRulesWithName::Store( SvStream &rStream ) rStream << (char)0; } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( const SwNumFmt& rFmt ) : aFmt( rFmt ), nCharPoolId( USHRT_MAX ) { - // relative Abstaende ????? + // relative gaps????? SwCharFmt* pFmt = rFmt.GetCharFmt(); if( pFmt ) @@ -390,10 +318,6 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( const SwNumFmt& rFmt ) } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( const _SwNumFmtGlobal& rFmt ) : aFmt( rFmt.aFmt ), @@ -404,10 +328,6 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( const _SwNumFmtGlobal& rFm aItems.Insert( rFmt.aItems[ --n ]->Clone(), aItems.Count() ); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream, sal_uInt16 nVersion ) : nCharPoolId( USHRT_MAX ) @@ -416,7 +336,6 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream, { sal_uInt16 nUS; sal_Char cChar; - short nShort; sal_Bool bFlag; String sStr; @@ -445,8 +364,9 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream, rStream >> nL; aFmt.SetLSpace( lNumIndent ); rStream >> nL; aFmt.SetFirstLineOffset( (short)nL ); } - else // alter StartWert war ein Byte + else // old start-value was a Byte { + short nShort; rStream >> nUS; aFmt.SetStart( nUS ); rStream.ReadByteString(sStr, eEncoding); aFmt.SetPrefix( sStr ); @@ -538,18 +458,9 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream, } } - -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwNumRulesWithName::_SwNumFmtGlobal::~_SwNumFmtGlobal() { } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwNumRulesWithName::_SwNumFmtGlobal::Store( SvStream& rStream ) { @@ -597,14 +508,14 @@ void SwNumRulesWithName::_SwNumFmtGlobal::Store( SvStream& rStream ) { SfxPoolItem* pItem = aItems[ --n ]; sal_uInt16 nIVers = pItem->GetVersion( SOFFICE_FILEFORMAT_50 ); - ASSERT( nIVers != USHRT_MAX, + OSL_ENSURE( nIVers != USHRT_MAX, "Was'n das: Item-Version USHRT_MAX in der aktuellen Version" ); rStream << pItem->Which() << nIVers; pItem->Store( rStream, nIVers ); } - // Erweiterungen fuer Version 40A + // Extensions for 40A if( SVX_NUM_BITMAP == aFmt.GetNumberingType() ) { @@ -629,23 +540,19 @@ void SwNumRulesWithName::_SwNumFmtGlobal::Store( SvStream& rStream ) } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwNumRulesWithName::_SwNumFmtGlobal::ChgNumFmt( SwWrtShell& rSh, SwNumFmt& rNew ) const { SwCharFmt* pFmt = 0; if( sCharFmtName.Len() ) { - // suche erstmal ueber den Namen + // at first, look for the name sal_uInt16 nArrLen = rSh.GetCharFmtCount(); for( sal_uInt16 i = 1; i < nArrLen; ++i ) { pFmt = &rSh.GetCharFmt( i ); if( COMPARE_EQUAL == pFmt->GetName().CompareTo( sCharFmtName )) - // ist vorhanden, also belasse die Attribute wie sie sind! + // exists, so leave attributes as they are! break; pFmt = 0; } @@ -660,7 +567,7 @@ void SwNumRulesWithName::_SwNumFmtGlobal::ChgNumFmt( SwWrtShell& rSh, else pFmt = rSh.GetCharFmtFromPool( nCharPoolId ); - if( !pFmt->GetDepends() ) // Attribute setzen + if( !pFmt->GetDepends() ) // set attributes for( sal_uInt16 n = aItems.Count(); n; ) pFmt->SetFmtAttr( *aItems[ --n ] ); } @@ -671,3 +578,4 @@ void SwNumRulesWithName::_SwNumFmtGlobal::ChgNumFmt( SwWrtShell& rSh, ((SwNumFmt&)aFmt).SetCharFmt( 0 ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/usrpref.cxx b/sw/source/ui/config/usrpref.cxx index e97c1adace..7c1eec9e89 100644 --- a/sw/source/ui/config/usrpref.cxx +++ b/sw/source/ui/config/usrpref.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,6 +32,7 @@ #include <tools/stream.hxx> #include <unotools/syslocale.hxx> +#include <svl/cjkoptions.hxx> #include "swtypes.hxx" #include "hintids.hxx" @@ -46,10 +48,11 @@ #include <unomid.h> using namespace utl; -using namespace rtl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; +using ::rtl::OUString; + void SwMasterUsrPref::SetUsrPref(const SwViewOption &rCopy) { @@ -67,12 +70,20 @@ SwMasterUsrPref::SwMasterUsrPref(sal_Bool bWeb) : aLayoutConfig(bWeb, *this), aGridConfig(bWeb, *this), aCursorConfig(*this), - pWebColorConfig(bWeb ? new SwWebColorConfig(*this) : 0) + pWebColorConfig(bWeb ? new SwWebColorConfig(*this) : 0), + bApplyCharUnit(sal_False) { MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); + SvtCJKOptions aCJKOptions; eUserMetric = MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH; - eHScrollMetric = eUserMetric; - eVScrollMetric = eUserMetric; + + sal_Bool bCJKEnabled = aCJKOptions.IsAsianTypographyEnabled(); + bApplyCharUnit = bCJKEnabled; + eHScrollMetric = bApplyCharUnit ? FUNIT_CHAR : eUserMetric; + eVScrollMetric = bApplyCharUnit ? FUNIT_LINE : eUserMetric; + + bIsHScrollMetricSet = bApplyCharUnit; + bIsVScrollMetricSet = bApplyCharUnit; aContentConfig.Load(); aLayoutConfig.Load(); @@ -81,16 +92,12 @@ SwMasterUsrPref::SwMasterUsrPref(sal_Bool bWeb) : if(pWebColorConfig) pWebColorConfig->Load(); } -/* -----------------------------13.02.01 09:48-------------------------------- - ---------------------------------------------------------------------------*/ SwMasterUsrPref::~SwMasterUsrPref() { delete pWebColorConfig; } -/*-- 28.09.00 09:55:32--------------------------------------------------- - -----------------------------------------------------------------------*/ Sequence<OUString> SwContentViewConfig::GetPropertyNames() { static const char* aPropNames[] = @@ -107,13 +114,13 @@ Sequence<OUString> SwContentViewConfig::GetPropertyNames() "NonprintingCharacter/Space", // 9 "NonprintingCharacter/Break", // 10 "NonprintingCharacter/ProtectedSpace", // 11 - "NonprintingCharacter/Tab", // 12 //not in Writer/Web - "NonprintingCharacter/HiddenText", // 13 - "NonprintingCharacter/HiddenParagraph", // 14 - "NonprintingCharacter/HiddenCharacter", // 15 - "Update/Link", // 16 - "Update/Field", // 17 - "Update/Chart" // 18 + "NonprintingCharacter/Tab", // 12 //not in Writer/Web + "NonprintingCharacter/HiddenText", // 13 + "NonprintingCharacter/HiddenParagraph", // 14 + "NonprintingCharacter/HiddenCharacter", // 15 + "Update/Link", // 16 + "Update/Field", // 17 + "Update/Chart" // 18 }; @@ -126,9 +133,7 @@ Sequence<OUString> SwContentViewConfig::GetPropertyNames() } return aNames; } -/*-- 28.09.00 09:55:33--------------------------------------------------- - -----------------------------------------------------------------------*/ SwContentViewConfig::SwContentViewConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) : ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Content") : C2U("Office.Writer/Content")), rParent(rPar), @@ -137,22 +142,16 @@ SwContentViewConfig::SwContentViewConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) Load(); EnableNotification( GetPropertyNames() ); } -/*-- 28.09.00 09:55:33--------------------------------------------------- - -----------------------------------------------------------------------*/ SwContentViewConfig::~SwContentViewConfig() { } -/*-- 09.02.07 09:55:33--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwContentViewConfig::Notify( const Sequence< OUString > & /*rPropertyNames*/ ) { Load(); } -/*-- 28.09.00 09:55:33--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwContentViewConfig::Commit() { Sequence<OUString> aNames = GetPropertyNames(); @@ -190,15 +189,13 @@ void SwContentViewConfig::Commit() } PutProperties(aNames, aValues); } -/*-- 28.09.00 09:55:34--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwContentViewConfig::Load() { Sequence<OUString> aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) @@ -238,9 +235,7 @@ void SwContentViewConfig::Load() } } } -/*-- 28.09.00 09:55:34--------------------------------------------------- - -----------------------------------------------------------------------*/ Sequence<OUString> SwLayoutViewConfig::GetPropertyNames() { static const char* aPropNames[] = @@ -266,8 +261,9 @@ Sequence<OUString> SwLayoutViewConfig::GetPropertyNames() "ViewLayout/Columns", //17 "ViewLayout/BookMode", //18 "Other/IsSquaredPageMode" //19 + "Other/ApplyCharUnit" //20 }; - const int nCount = bWeb ? 15 : 20; + const int nCount = bWeb ? 15 : 21; Sequence<OUString> aNames(nCount); OUString* pNames = aNames.getArray(); for(int i = 0; i < nCount; i++) @@ -276,9 +272,7 @@ Sequence<OUString> SwLayoutViewConfig::GetPropertyNames() } return aNames; } -/*-- 28.09.00 09:55:34--------------------------------------------------- - -----------------------------------------------------------------------*/ SwLayoutViewConfig::SwLayoutViewConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) : ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Layout") : C2U("Office.Writer/Layout"), CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE), @@ -286,15 +280,11 @@ SwLayoutViewConfig::SwLayoutViewConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) : bWeb(bIsWeb) { } -/*-- 28.09.00 09:55:35--------------------------------------------------- - -----------------------------------------------------------------------*/ SwLayoutViewConfig::~SwLayoutViewConfig() { } -/*-- 28.09.00 09:55:36--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwLayoutViewConfig::Commit() { Sequence<OUString> aNames = GetPropertyNames(); @@ -335,19 +325,18 @@ void SwLayoutViewConfig::Commit() case 17: rVal <<= (sal_Int32)rParent.GetViewLayoutColumns(); break; // "ViewLayout/Columns", case 18: rVal <<= (sal_Bool) rParent.IsViewLayoutBookMode(); break; // "ViewLayout/BookMode", case 19: rVal <<= (sal_Bool) rParent.IsSquaredPageMode(); break; // "Other/IsSquaredPageMode", + case 20: rVal <<= (sal_Bool) rParent.IsApplyCharUnit(); break; // "Other/IsSquaredPageMode", } } PutProperties(aNames, aValues); } -/*-- 28.09.00 09:55:36--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwLayoutViewConfig::Load() { Sequence<OUString> aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) @@ -391,6 +380,7 @@ void SwLayoutViewConfig::Load() case 17: rParent.SetViewLayoutColumns( static_cast<sal_uInt16>(nInt32Val) ); break;// "ViewLayout/Columns", case 18: rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode", case 19: rParent.SetDefaultPageMode(bSet,sal_True); break;// "Other/IsSquaredPageMode", + case 20: rParent.SetApplyCharUnit(bSet); break;// "Other/ApplyUserChar" } } } @@ -399,9 +389,6 @@ void SwLayoutViewConfig::Load() void SwLayoutViewConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} -/* -----------------------------19.01.01 13:07-------------------------------- - - ---------------------------------------------------------------------------*/ Sequence<OUString> SwGridConfig::GetPropertyNames() { static const char* aPropNames[] = @@ -423,9 +410,7 @@ Sequence<OUString> SwGridConfig::GetPropertyNames() } return aNames; } -/* -----------------------------19.01.01 13:07-------------------------------- - ---------------------------------------------------------------------------*/ SwGridConfig::SwGridConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) : ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Grid") : C2U("Office.Writer/Grid"), CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE), @@ -433,15 +418,11 @@ SwGridConfig::SwGridConfig(sal_Bool bIsWeb, SwMasterUsrPref& rPar) : bWeb(bIsWeb) { } -/* -----------------------------19.01.01 13:07-------------------------------- - ---------------------------------------------------------------------------*/ SwGridConfig::~SwGridConfig() { } -/* -----------------------------19.01.01 13:07-------------------------------- - ---------------------------------------------------------------------------*/ void SwGridConfig::Commit() { Sequence<OUString> aNames = GetPropertyNames(); @@ -467,15 +448,13 @@ void SwGridConfig::Commit() } PutProperties(aNames, aValues); } -/* -----------------------------19.01.01 13:07-------------------------------- - ---------------------------------------------------------------------------*/ void SwGridConfig::Load() { Sequence<OUString> aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { Size aSnap(rParent.GetSnapSize()); @@ -505,9 +484,6 @@ void SwGridConfig::Load() void SwGridConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} -/* -----------------------------19.01.01 13:07-------------------------------- - - ---------------------------------------------------------------------------*/ Sequence<OUString> SwCursorConfig::GetPropertyNames() { static const char* aPropNames[] = @@ -520,27 +496,21 @@ Sequence<OUString> SwCursorConfig::GetPropertyNames() Sequence<OUString> aNames(nCount); OUString* pNames = aNames.getArray(); for(int i = 0; i < nCount; i++) - pNames[i] = C2U(aPropNames[i]); + pNames[i] = rtl::OUString::createFromAscii(aPropNames[i]); return aNames; } -/* -----------------------------19.01.01 13:07-------------------------------- - ---------------------------------------------------------------------------*/ SwCursorConfig::SwCursorConfig(SwMasterUsrPref& rPar) : ConfigItem(C2U("Office.Writer/Cursor"), CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE), rParent(rPar) { } -/* -----------------------------19.01.01 13:07-------------------------------- - ---------------------------------------------------------------------------*/ SwCursorConfig::~SwCursorConfig() { } -/* -----------------------------19.01.01 13:07-------------------------------- - ---------------------------------------------------------------------------*/ void SwCursorConfig::Commit() { Sequence<OUString> aNames = GetPropertyNames(); @@ -562,15 +532,13 @@ void SwCursorConfig::Commit() } PutProperties(aNames, aValues); } -/* -----------------------------19.01.01 13:07-------------------------------- - ---------------------------------------------------------------------------*/ void SwCursorConfig::Load() { Sequence<OUString> aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { @@ -598,9 +566,6 @@ void SwCursorConfig::Load() void SwCursorConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} -/*-- 28.09.00 09:55:33--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwWebColorConfig::SwWebColorConfig(SwMasterUsrPref& rPar) : ConfigItem(C2U("Office.WriterWeb/Background"), CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE), @@ -609,15 +574,11 @@ SwWebColorConfig::SwWebColorConfig(SwMasterUsrPref& rPar) : { aPropNames.getArray()[0] = C2U("Color"); } -/*-- 28.09.00 09:55:33--------------------------------------------------- - -----------------------------------------------------------------------*/ SwWebColorConfig::~SwWebColorConfig() { } -/*-- 28.09.00 09:55:33--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwWebColorConfig::Commit() { Sequence<Any> aValues(aPropNames.getLength()); @@ -634,14 +595,11 @@ void SwWebColorConfig::Commit() void SwWebColorConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} -/*-- 28.09.00 09:55:34--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwWebColorConfig::Load() { Sequence<Any> aValues = GetProperties(aPropNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aPropNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aPropNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aPropNames.getLength()) { for(int nProp = 0; nProp < aPropNames.getLength(); nProp++) @@ -661,3 +619,4 @@ void SwWebColorConfig::Load() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx index ffcbc7de29..2f36dc8618 100644 --- a/sw/source/ui/config/viewopt.cxx +++ b/sw/source/ui/config/viewopt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,25 +33,17 @@ #include <svx/htmlmode.hxx> #include <svtools/htmlcfg.hxx> -#ifndef _SVX_SVXIDS_HRC //autogen #include <svx/svxids.hrc> -#endif #include <editeng/svxenum.hxx> #include <editeng/svxacorr.hxx> #include <unotools/localedatawrapper.hxx> -#ifndef _REGION_HXX //autogen #include <vcl/region.hxx> -#endif -#ifndef _OUTDEV_HXX //autogen #include <vcl/outdev.hxx> -#endif #include <vcl/window.hxx> #include <swmodule.hxx> #include <swtypes.hxx> #include <viewopt.hxx> -#ifndef _WDOCSH_HXX #include <wdocsh.hxx> -#endif #include <swrect.hxx> #include <crstate.hxx> #include <svtools/colorcfg.hxx> @@ -59,7 +52,7 @@ #include <editeng/acorrcfg.hxx> -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 sal_Bool SwViewOption::bTest9 = sal_False; //DrawingLayerNotLoading #endif Color SwViewOption::aDocBoundColor(COL_LIGHTGRAY); @@ -79,9 +72,10 @@ Color SwViewOption::aFieldShadingsColor(COL_LIGHTGRAY); Color SwViewOption::aSectionBoundColor(COL_LIGHTGRAY); Color SwViewOption::aPageBreakColor(COL_BLUE); Color SwViewOption::aScriptIndicatorColor(COL_GREEN); +Color SwViewOption::aShadowColor(COL_GRAY); sal_Int32 SwViewOption::nAppearanceFlags = VIEWOPT_DOC_BOUNDARIES|VIEWOPT_OBJECT_BOUNDARIES; -sal_uInt16 SwViewOption::nPixelTwips = 0; //ein Pixel auf dem Bildschirm +sal_uInt16 SwViewOption::nPixelTwips = 0; // one pixel on the screen #define LINEBREAK_SIZE 12, 8 @@ -92,11 +86,7 @@ sal_uInt16 SwViewOption::nPixelTwips = 0; //ein Pixel auf dem Bildschirm #define MIN_TABWIDTH 120 #define MIN_TABHEIGHT 200 -static const char __FAR_DATA aPostItStr[] = " "; - -/************************************************************************* - * SwViewOption::IsEqualFlags() - *************************************************************************/ +static const char aPostItStr[] = " "; sal_Bool SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const { @@ -113,8 +103,8 @@ sal_Bool SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const && mbViewLayoutBookMode == rOpt.mbViewLayoutBookMode && bShowPlaceHolderFields == rOpt.bShowPlaceHolderFields && bIdle == rOpt.bIdle -#ifdef DBG_UTIL - // korrespondieren zu den Angaben in ui/config/cfgvw.src +#if OSL_DEBUG_LEVEL > 1 + // correspond to the statements in ui/config/cfgvw.src && bTest1 == rOpt.IsTest1() && bTest2 == rOpt.IsTest2() && bTest3 == rOpt.IsTest3() @@ -128,10 +118,6 @@ sal_Bool SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const ; } -/************************************************************************* - * SwViewOption::DrawRect() - *************************************************************************/ - void SwViewOption::DrawRect( OutputDevice *pOut, const SwRect &rRect, long nCol ) const { @@ -147,10 +133,6 @@ void SwViewOption::DrawRect( OutputDevice *pOut, DrawRectPrinter( pOut, rRect ); } -/************************************************************************* - * SwViewOption::DrawRectPrinter() - *************************************************************************/ - void SwViewOption::DrawRectPrinter( OutputDevice *pOut, const SwRect &rRect ) const { @@ -163,27 +145,19 @@ void SwViewOption::DrawRectPrinter( OutputDevice *pOut, pOut->SetLineColor( aOldColor ); } -/************************************************************************* - * SwViewOption::GetPostItsWidth() - *************************************************************************/ - sal_uInt16 SwViewOption::GetPostItsWidth( const OutputDevice *pOut ) const { - ASSERT( pOut, "no Outdev" ); + OSL_ENSURE( pOut, "no Outdev" ); return sal_uInt16(pOut->GetTextWidth( String::CreateFromAscii(aPostItStr ))); } -/************************************************************************* - * SwViewOption::PaintPostIts() - *************************************************************************/ - void SwViewOption::PaintPostIts( OutputDevice *pOut, const SwRect &rRect, sal_Bool bIsScript ) const { if( pOut && bIsScript ) { Color aOldLineColor( pOut->GetLineColor() ); pOut->SetLineColor( Color(COL_GRAY ) ); - // Wir ziehen ueberall zwei Pixel ab, damit es schick aussieht + // to make it look nice, we subtract two pixels everywhere sal_uInt16 nPix = GetPixelTwips() * 2; if( rRect.Width() <= 2 * nPix || rRect.Height() <= 2 * nPix ) nPix = 0; @@ -195,16 +169,8 @@ void SwViewOption::PaintPostIts( OutputDevice *pOut, const SwRect &rRect, sal_Bo } } - -/************************************************************************* -|* -|* ViewOption::ViewOption() -|* -|* Letzte Aenderung MA 04. Aug. 93 -|* -|*************************************************************************/ - SwViewOption::SwViewOption() : + sSymbolFont( RTL_CONSTASCII_USTRINGPARAM( "symbol" ) ), aRetoucheColor( COL_TRANSPARENT ), mnViewLayoutColumns( 0 ), nPagePrevRow( 1 ), @@ -214,19 +180,17 @@ SwViewOption::SwViewOption() : bStarOneSetting(sal_False), bIsPagePreview(sal_False), bSelectionInReadonly(sal_False), - // --> FME 2004-06-29 #114856# Formular view + // #114856# Formular view bFormView(sal_False), - // <-- bBookview(sal_False), mbViewLayoutBookMode(sal_False), bShowPlaceHolderFields( sal_True ), - nZoom( 100 ), eZoom( SVX_ZOOM_PERCENT ), nTblDest(TBL_DEST_CELL) { - // Initialisierung ist jetzt etwas einfacher - // alle Bits auf 0 + // Initialisation is a little simpler now + // all Bits to 0 nCoreOptions = VIEWOPT_1_HARDBLANK | VIEWOPT_1_SOFTHYPH | VIEWOPT_1_REF | VIEWOPT_1_GRAPHIC | @@ -246,8 +210,8 @@ SwViewOption::SwViewOption() : bIdle = true; -#ifdef DBG_UTIL - // korrespondieren zu den Angaben in ui/config/cfgvw.src +#if OSL_DEBUG_LEVEL > 1 + // correspond to the statements in ui/config/cfgvw.src bTest1 = bTest2 = bTest3 = bTest4 = bTest5 = bTest6 = bTest7 = bTest8 = bTest10 = sal_False; #endif @@ -257,9 +221,8 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt) { bReadonly = sal_False; bSelectionInReadonly = sal_False; - // --> FME 2004-06-29 #114856# Formular view + // #114856# Formular view bFormView = rVOpt.bFormView; - // <-- nZoom = rVOpt.nZoom ; aSnapSize = rVOpt.aSnapSize ; mnViewLayoutColumns = rVOpt.mnViewLayoutColumns ; @@ -282,7 +245,7 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt) bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields; bIdle = rVOpt.bIdle; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 bTest1 = rVOpt.bTest1 ; bTest2 = rVOpt.bTest2 ; bTest3 = rVOpt.bTest3 ; @@ -298,9 +261,8 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt) SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt ) { - // --> DVO FME 2004-06-29 #114856# Formular view + // #114856# Formular view bFormView = rVOpt.bFormView ; - // <-- nZoom = rVOpt.nZoom ; aSnapSize = rVOpt.aSnapSize ; mnViewLayoutColumns = rVOpt.mnViewLayoutColumns ; @@ -323,7 +285,7 @@ SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt ) bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields; bIdle = rVOpt.bIdle; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 bTest1 = rVOpt.bTest1 ; bTest2 = rVOpt.bTest2 ; bTest3 = rVOpt.bTest3 ; @@ -342,14 +304,6 @@ SwViewOption::~SwViewOption() { } -/************************************************************************* -|* -|* ViewOption::Init() -|* -|* Letzte Aenderung MA 04. Aug. 93 -|* -|*************************************************************************/ - void SwViewOption::Init( Window *pWin ) { if( !nPixelTwips && pWin ) @@ -361,13 +315,9 @@ void SwViewOption::Init( Window *pWin ) sal_Bool SwViewOption::IsAutoCompleteWords() const { const SvxSwAutoFmtFlags& rFlags = SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags(); - return /*rFlags.bAutoCompleteWords &&*/ rFlags.bAutoCmpltCollectWords; + return rFlags.bAutoCmpltCollectWords; } -/*************************************************************************/ -/* */ -/*************************************************************************/ - AuthorCharAttr::AuthorCharAttr() : nItemId (SID_ATTR_CHAR_UNDERLINE), nAttr (UNDERLINE_SINGLE), @@ -375,10 +325,6 @@ AuthorCharAttr::AuthorCharAttr() : { } -/*-----------------07.01.97 13.50------------------- - ---------------------------------------------------*/ - sal_uInt16 GetHtmlMode(const SwDocShell* pShell) { sal_uInt16 nRet = 0; @@ -412,122 +358,92 @@ sal_uInt16 GetHtmlMode(const SwDocShell* pShell) } return nRet; } -/* -----------------------------24.04.2002 10:20------------------------------ - ---------------------------------------------------------------------------*/ Color& SwViewOption::GetDocColor() { return aDocColor; } -/* -----------------------------23.04.2002 17:18------------------------------ - ---------------------------------------------------------------------------*/ Color& SwViewOption::GetDocBoundariesColor() { return aDocBoundColor; } -/* -----------------------------23.04.2002 17:53------------------------------ - ---------------------------------------------------------------------------*/ Color& SwViewOption::GetObjectBoundariesColor() { return aObjectBoundColor; } -/* -----------------------------24.04.2002 10:41------------------------------ - ---------------------------------------------------------------------------*/ Color& SwViewOption::GetAppBackgroundColor() { return aAppBackgroundColor; } -/*-- 24.04.2002 10:50:11--------------------------------------------------- - -----------------------------------------------------------------------*/ Color& SwViewOption::GetTableBoundariesColor() { return aTableBoundColor; } -/*-- 24.04.2002 10:50:12--------------------------------------------------- - -----------------------------------------------------------------------*/ Color& SwViewOption::GetIndexShadingsColor() { return aIndexShadingsColor; } -/*-- 24.04.2002 10:50:12--------------------------------------------------- - -----------------------------------------------------------------------*/ Color& SwViewOption::GetLinksColor() { return aLinksColor; } -/*-- 24.04.2002 10:50:13--------------------------------------------------- - -----------------------------------------------------------------------*/ Color& SwViewOption::GetVisitedLinksColor() { return aVisitedLinksColor; } -/*-- 24.04.2002 10:50:13--------------------------------------------------- - -----------------------------------------------------------------------*/ Color& SwViewOption::GetDirectCursorColor() { return aDirectCursorColor; } -/*-- 24.04.2002 10:50:14--------------------------------------------------- - -----------------------------------------------------------------------*/ Color& SwViewOption::GetTextGridColor() { return aTextGridColor; } -/*-- 24.04.2002 10:50:14--------------------------------------------------- - -----------------------------------------------------------------------*/ Color& SwViewOption::GetSpellColor() { return aSpellColor; } -/*-- 24.04.2007 10:50:14--------------------------------------------------- - -----------------------------------------------------------------------*/ Color& SwViewOption::GetSmarttagColor() { return aSmarttagColor; } -/*-- 06.12.2002 10:50:11--------------------------------------------------- - -----------------------------------------------------------------------*/ +Color& SwViewOption::GetShadowColor() +{ + return aShadowColor; +} + Color& SwViewOption::GetFontColor() { return aFontColor; } -/*-- 24.04.2002 10:50:15--------------------------------------------------- - -----------------------------------------------------------------------*/ Color& SwViewOption::GetFieldShadingsColor() { return aFieldShadingsColor; } -/*-- 24.04.2002 10:50:15--------------------------------------------------- - -----------------------------------------------------------------------*/ Color& SwViewOption::GetSectionBoundColor() { return aSectionBoundColor; } -/* -----------------------------2002/07/31 14:00------------------------------ - ---------------------------------------------------------------------------*/ Color& SwViewOption::GetPageBreakColor() { return aPageBreakColor; } -/* -----------------------------23.04.2002 17:41------------------------------ - - ---------------------------------------------------------------------------*/ void SwViewOption::ApplyColorConfigValues(const svtools::ColorConfig& rConfig ) { aDocColor.SetColor(rConfig.GetColorValue(svtools::DOCCOLOR).nColor); @@ -565,6 +481,11 @@ void SwViewOption::ApplyColorConfigValues(const svtools::ColorConfig& rConfig ) if(aValue.bIsVisible) nAppearanceFlags |= VIEWOPT_VISITED_LINKS; + aValue = rConfig.GetColorValue(svtools::SHADOWCOLOR); + aShadowColor.SetColor(aValue.nColor); + if(aValue.bIsVisible) + nAppearanceFlags |= VIEWOPT_SHADOW; + aDirectCursorColor.SetColor(rConfig.GetColorValue(svtools::WRITERDIRECTCURSOR).nColor); aTextGridColor.SetColor(rConfig.GetColorValue(svtools::WRITERTEXTGRID).nColor); @@ -590,9 +511,7 @@ void SwViewOption::ApplyColorConfigValues(const svtools::ColorConfig& rConfig ) aScriptIndicatorColor.SetColor(rConfig.GetColorValue(svtools::WRITERSCRIPTINDICATOR).nColor); } -/* -----------------------------23.04.2002 17:48------------------------------ - ---------------------------------------------------------------------------*/ void SwViewOption::SetAppearanceFlag(sal_Int32 nFlag, sal_Bool bSet, sal_Bool bSaveInConfig ) { if(bSet) @@ -618,6 +537,7 @@ void SwViewOption::SetAppearanceFlag(sal_Int32 nFlag, sal_Bool bSet, sal_Bool bS { VIEWOPT_VISITED_LINKS , svtools::LINKSVISITED }, { VIEWOPT_FIELD_SHADINGS , svtools::WRITERFIELDSHADINGS }, { VIEWOPT_SECTION_BOUNDARIES , svtools::WRITERSECTIONBOUNDARIES }, + { VIEWOPT_SHADOW , svtools::SHADOWCOLOR }, { 0 , svtools::ColorConfigEntryCount } }; sal_uInt16 nPos = 0; @@ -633,11 +553,10 @@ void SwViewOption::SetAppearanceFlag(sal_Int32 nFlag, sal_Bool bSet, sal_Bool bS } } } -/* -----------------------------24.04.2002 10:42------------------------------ - ---------------------------------------------------------------------------*/ sal_Bool SwViewOption::IsAppearanceFlag(sal_Int32 nFlag) { return 0 != (nAppearanceFlags & nFlag); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 96a75cfb38..2fec46bf76 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,9 +38,7 @@ #include <mailmergewizard.hxx> #include <mmconfigitem.hxx> #include <mmaddressblockpage.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <dbconfig.hxx> #include <unotools/tempfile.hxx> #include <vcl/msgbox.hxx> @@ -55,9 +54,7 @@ #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdb/XDocumentDataSource.hpp> #include <com/sun/star/sdbc/XRowSet.hpp> -#ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSERFACTORY_HPP_ #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> -#endif #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/sdb/XQueriesSupplier.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> @@ -88,12 +85,8 @@ using namespace ::rtl; #define ITEMID_NAME 1 #define ITEMID_TABLE 2 -//typedef SharedUNOComponent< XConnection > SharedConnection; - static const char* cUTF8 = "UTF-8"; -/*-- 07.05.2004 14:11:34--------------------------------------------------- - -----------------------------------------------------------------------*/ struct AddressUserData_Impl { uno::Reference<XDataSource> xSource; @@ -109,6 +102,7 @@ struct AddressUserData_Impl nTableAndQueryCount(-1) {} }; + ::rtl::OUString lcl_getFlatURL( uno::Reference<beans::XPropertySet>& xSourceProperties ) { ::rtl::OUString sURL; @@ -154,9 +148,7 @@ struct AddressUserData_Impl } return sURL; } -/*-- 07.04.2004 16:35:43--------------------------------------------------- - -----------------------------------------------------------------------*/ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) : SfxModalDialog(pParent, SW_RES(DLG_MM_ADDRESSLISTDIALOG)), #ifdef MSC @@ -233,7 +225,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) : SwMailMergeConfigItem& rConfigItem = m_pAddressPage->GetWizard()->GetConfigItem(); const SwDBData& rCurrentData = rConfigItem.GetCurrentDBData(); - DBG_ASSERT(m_xDBContext.is(), "service 'com.sun.star.sdb.DatabaseContext' not found!"); + OSL_ENSURE(m_xDBContext.is(), "service 'com.sun.star.sdb.DatabaseContext' not found!"); sal_Bool bEnableEdit = sal_False; sal_Bool bEnableOK = sal_True; m_aListLB.SelectAll( sal_False ); @@ -284,9 +276,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) : m_aListLB.SetSelectHdl(LINK(this, SwAddressListDialog, ListBoxSelectHdl_Impl)); TableSelectHdl_Impl(NULL); } -/*-- 07.04.2004 16:35:43--------------------------------------------------- - -----------------------------------------------------------------------*/ SwAddressListDialog::~SwAddressListDialog() { SvLBoxEntry* pEntry = m_aListLB.First(); @@ -297,9 +287,7 @@ SwAddressListDialog::~SwAddressListDialog() pEntry = m_aListLB.Next( pEntry ); } } -/*-- 07.04.2004 16:35:44--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwAddressListDialog, FilterHdl_Impl, PushButton*, EMPTYARG) { SvLBoxEntry* pSelect = m_aListLB.FirstSelected(); @@ -359,15 +347,13 @@ IMPL_LINK(SwAddressListDialog, FilterHdl_Impl, PushButton*, EMPTYARG) } catch(Exception& ) { - DBG_ERROR("exception caught in SwAddressListDialog::FilterHdl_Impl"); + OSL_ENSURE(false, "exception caught in SwAddressListDialog::FilterHdl_Impl"); } } } return 0; } -/*-- 07.04.2004 16:35:44--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwAddressListDialog, LoadHdl_Impl, PushButton*, EMPTYARG) { String sNewSource = SwNewDBMgr::LoadAndRegisterDataSource(); @@ -379,9 +365,7 @@ IMPL_LINK(SwAddressListDialog, LoadHdl_Impl, PushButton*, EMPTYARG) } return 0; } -/*-- 07.04.2004 16:35:44--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton) { String sInputURL; @@ -433,7 +417,7 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton) pInfo[2].Name = C2U("Extension"); pInfo[2].Value <<= ::rtl::OUString(aURL.getExtension());//C2U("csv"); pInfo[3].Name = C2U("CharSet"); - pInfo[3].Value <<= C2U(cUTF8); + pInfo[3].Value <<= rtl::OUString::createFromAscii(cUTF8); aAny <<= aInfo; xDataProperties->setPropertyValue(C2U("Info"), aAny); @@ -471,9 +455,7 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton) delete pDlg; return 0; } -/*-- 22.04.2004 10:30:40--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwAddressListDialog, EditHdl_Impl, PushButton*, pButton) { SvLBoxEntry* pEntry = m_aListLB.FirstSelected(); @@ -505,9 +487,7 @@ IMPL_LINK(SwAddressListDialog, EditHdl_Impl, PushButton*, pButton) } return 0; }; -/*-- 19.04.2004 09:41:05--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwAddressListDialog, ListBoxSelectHdl_Impl, SvTabListBox*, EMPTYARG) { SvLBoxEntry* pSelect = m_aListLB.FirstSelected(); @@ -515,6 +495,7 @@ IMPL_LINK(SwAddressListDialog, ListBoxSelectHdl_Impl, SvTabListBox*, EMPTYARG) StaticListBoxSelectHdl_Impl ), pSelect ); return 0; } + IMPL_STATIC_LINK(SwAddressListDialog, StaticListBoxSelectHdl_Impl, SvLBoxEntry*, pSelect) { //prevent nested calls of the select handler @@ -538,6 +519,18 @@ IMPL_STATIC_LINK(SwAddressListDialog, StaticListBoxSelectHdl_Impl, SvLBoxEntry*, pUserData = static_cast<AddressUserData_Impl*>(pSelect->GetUserData()); if(pUserData->nTableAndQueryCount > 1 || pUserData->nTableAndQueryCount == -1) { + /* + * We're a callback from a selection from a list box, which takes + * place on mouse down before mouse up. The next dialog also has a + * list box. Spawning it means this list box doesn't get the mouse + * down event. So it sticks on "making selection" mode. So if you + * cancel the next dialog and just move the mouse out of this entry + * and back then the dialog pops up again, without requiring a click + * + * Most expedient thing to do is to manually end the parent selection + * here. + */ + pThis->m_aListLB.EndSelection(); pThis->DetectTablesAndQueries(pSelect, !sTable.Len()); } else @@ -560,10 +553,8 @@ IMPL_STATIC_LINK(SwAddressListDialog, StaticListBoxSelectHdl_Impl, SvLBoxEntry*, return 0; } -/*-- 13.05.2004 14:59:25--------------------------------------------------- - detect the number of tables for a data source - if only one is available then set it at the entry - -----------------------------------------------------------------------*/ +// detect the number of tables for a data source +// if only one is available then set it at the entry void SwAddressListDialog::DetectTablesAndQueries( SvLBoxEntry* pSelect, bool bWidthDialog) @@ -656,14 +647,11 @@ void SwAddressListDialog::DetectTablesAndQueries( } catch(Exception& ) { - DBG_ERROR("exception caught in SwAddressListDialog::DetectTablesAndQueries"); + OSL_ENSURE(false, "exception caught in SwAddressListDialog::DetectTablesAndQueries"); m_aOK.Enable( sal_False ); } } -/*-- 13.05.2004 12:55:40--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK(SwAddressListDialog, TableSelectHdl_Impl, PushButton*, pButton) { EnterWait(); @@ -684,18 +672,12 @@ IMPL_LINK(SwAddressListDialog, TableSelectHdl_Impl, PushButton*, pButton) return 0; } -/*-- 08.04.2004 14:52:11--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK(SwAddressListDialog, OKHdl_Impl, PushButton*, EMPTYARG) { EndDialog(sal_True); return 0; } -/*-- 07.05.2004 14:17:47--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Reference< XDataSource> SwAddressListDialog::GetSource() { uno::Reference< XDataSource> xRet; @@ -708,9 +690,7 @@ uno::Reference< XDataSource> SwAddressListDialog::GetSource() return xRet; } -/*-- 07.05.2004 14:17:48--------------------------------------------------- - -----------------------------------------------------------------------*/ SharedConnection SwAddressListDialog::GetConnection() { SharedConnection xRet; @@ -722,9 +702,7 @@ SharedConnection SwAddressListDialog::GetConnection() } return xRet; } -/*-- 07.05.2004 14:17:48--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< XColumnsSupplier> SwAddressListDialog::GetColumnsSupplier() { uno::Reference< XColumnsSupplier> xRet; @@ -736,9 +714,7 @@ uno::Reference< XColumnsSupplier> SwAddressListDialog::GetColumnsSupplier() } return xRet; } -/*-- 14.05.2004 15:04:09--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwAddressListDialog::GetFilter() { ::rtl::OUString sRet; @@ -750,3 +726,5 @@ uno::Reference< XColumnsSupplier> SwAddressListDialog::GetColumnsSupplier() } return sRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/addresslistdialog.hxx b/sw/source/ui/dbui/addresslistdialog.hxx index 30f0e26ab5..ab7e993975 100644 --- a/sw/source/ui/dbui/addresslistdialog.hxx +++ b/sw/source/ui/dbui/addresslistdialog.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #include <sfx2/basedlgs.hxx> #include <svtools/stdctrl.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <svtools/svtabbx.hxx> #include <svtools/headbar.hxx> #include <swdbdata.hxx> @@ -51,9 +50,7 @@ namespace com{namespace sun{namespace star{ } }}} class SwMailMergeAddressBlockPage; -/*-- 08.04.2004 14:04:29--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwAddressListDialog : public SfxModalDialog { FixedInfo m_aDescriptionFI; @@ -86,9 +83,7 @@ class SwAddressListDialog : public SfxModalDialog SwMailMergeAddressBlockPage* m_pAddressPage; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xDBContext; -// ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> m_xSource; -// ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection; -// ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier> m_xColumnsSupplier; + SwDBData m_aDBData; void DetectTablesAndQueries(SvLBoxEntry* pSelect, bool bWidthDialog); @@ -120,3 +115,4 @@ public: }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index f1f995cfa1..85b5151649 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,9 +37,7 @@ #include <mmconfigitem.hxx> #include <vcl/scrbar.hxx> #include <vcl/msgbox.hxx> -#ifndef _SVT_CONTROLDIMS_HRC_ #include <svtools/controldims.hrc> -#endif #include <unotools/pathoptions.hxx> #include <sfx2/filedlghelper.hxx> #include <sfx2/docfilt.hxx> @@ -60,9 +59,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::ui::dialogs; using ::rtl::OUString; -/*-- 19.04.2004 12:19:50--------------------------------------------------- - - -----------------------------------------------------------------------*/ class SwAddressControl_Impl : public Control { ScrollBar m_aScrollBar; @@ -100,9 +96,6 @@ public: void SetCursorTo(sal_uInt32 nElement); }; -/*-- 13.04.2004 10:09:42--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwAddressControl_Impl::SwAddressControl_Impl(Window* pParent, const ResId& rResId ) : Control(pParent, rResId), #ifdef MSC @@ -126,9 +119,7 @@ SwAddressControl_Impl::SwAddressControl_Impl(Window* pParent, const ResId& rResI m_aScrollBar.EnableDrag(); } -/*-- 13.04.2004 10:09:43--------------------------------------------------- - -----------------------------------------------------------------------*/ SwAddressControl_Impl::~SwAddressControl_Impl() { ::std::vector<FixedText*>::iterator aTextIter; @@ -138,9 +129,7 @@ SwAddressControl_Impl::~SwAddressControl_Impl() for(aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter) delete *aEditIter; } -/*-- 19.04.2004 12:22:41--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressControl_Impl::SetData(SwCSVData& rDBData) { m_pData = &rDBData; @@ -189,7 +178,7 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData) Link aEditModifyLink = LINK(this, SwAddressControl_Impl, EditModifyHdl_Impl); Edit* pLastEdit = 0; sal_Int32 nVisibleLines = 0; - sal_Int32 nLines = 0; + sal_uIntPtr nLines = 0; for(aHeaderIter = m_pData->aDBColumnHeaders.begin(); aHeaderIter != m_pData->aDBColumnHeaders.end(); ++aHeaderIter, nEDYPos += m_nLineHeight, nFTYPos += m_nLineHeight, nLines++) @@ -238,23 +227,21 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData) } } -/*-- 21.04.2004 11:37:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressControl_Impl::SetCurrentDataSet(sal_uInt32 nSet) { if(m_bNoDataSet || m_nCurrentDataSet != nSet) { m_bNoDataSet = false; m_nCurrentDataSet = nSet; - DBG_ASSERT(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index"); + OSL_ENSURE(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index"); if(m_pData->aDBData.size() > m_nCurrentDataSet) { ::std::vector<Edit*>::iterator aEditIter; sal_uInt32 nIndex = 0; for(aEditIter = m_aEdits.begin(); aEditIter != m_aEdits.end(); ++aEditIter, ++nIndex) { - DBG_ASSERT(nIndex < m_pData->aDBData[m_nCurrentDataSet].size(), + OSL_ENSURE(nIndex < m_pData->aDBData[m_nCurrentDataSet].size(), "number of colums doesn't match number of Edits"); (*aEditIter)->SetText(m_pData->aDBData[m_nCurrentDataSet][nIndex]); } @@ -262,9 +249,6 @@ void SwAddressControl_Impl::SetCurrentDataSet(sal_uInt32 nSet) } } -/*-- 19.04.2004 14:17:50--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK(SwAddressControl_Impl, ScrollHdl_Impl, ScrollBar*, pScroll) { long nThumb = pScroll->GetThumbPos(); @@ -272,9 +256,7 @@ IMPL_LINK(SwAddressControl_Impl, ScrollHdl_Impl, ScrollBar*, pScroll) return 0; } -/*-- 19.04.2004 16:16:25--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwAddressControl_Impl, GotFocusHdl_Impl, Edit*, pEdit) { if(0 != (GETFOCUS_TAB & pEdit->GetGetFocusFlags())) @@ -284,9 +266,7 @@ IMPL_LINK(SwAddressControl_Impl, GotFocusHdl_Impl, Edit*, pEdit) } return 0; } -/*-- 21.04.2004 14:56:54--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressControl_Impl::MakeVisible(const Rectangle & rRect) { long nThumb = m_aScrollBar.GetThumbPos(); @@ -307,24 +287,21 @@ void SwAddressControl_Impl::MakeVisible(const Rectangle & rRect) ScrollHdl_Impl(&m_aScrollBar); } } -/*-- 19.04.2004 16:16:25--------------------------------------------------- - copy data changes into database - -----------------------------------------------------------------------*/ + +// copy data changes into database IMPL_LINK(SwAddressControl_Impl, EditModifyHdl_Impl, Edit*, pEdit) { //get the data element number of the current set sal_Int32 nIndex = (sal_Int32)(sal_IntPtr)pEdit->GetData(); //get the index of the set - DBG_ASSERT(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index" ); + OSL_ENSURE(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index" ); if(m_pData->aDBData.size() > m_nCurrentDataSet) { m_pData->aDBData[m_nCurrentDataSet][nIndex] = pEdit->GetText(); } return 0; } -/*-- 21.04.2004 14:51:54--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressControl_Impl::SetCursorTo(sal_uInt32 nElement) { if(nElement < m_aEdits.size()) @@ -336,9 +313,7 @@ void SwAddressControl_Impl::SetCursorTo(sal_uInt32 nElement) } } -/*-- 19.04.2004 16:16:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressControl_Impl::Command( const CommandEvent& rCEvt ) { switch ( rCEvt.GetCommand() ) @@ -358,9 +333,7 @@ void SwAddressControl_Impl::Command( const CommandEvent& rCEvt ) Control::Command(rCEvt); } } -/*-- 19.04.2004 16:16:25--------------------------------------------------- - -----------------------------------------------------------------------*/ long SwAddressControl_Impl::PreNotify( NotifyEvent& rNEvt ) { if(rNEvt.GetType() == EVENT_COMMAND) @@ -375,9 +348,7 @@ long SwAddressControl_Impl::PreNotify( NotifyEvent& rNEvt ) } return Control::PreNotify(rNEvt); } -/*-- 13.04.2004 10:08:59--------------------------------------------------- - -----------------------------------------------------------------------*/ SwCreateAddressListDialog::SwCreateAddressListDialog( Window* pParent, const String& rURL, SwMailMergeConfigItem& rConfig) : SfxModalDialog(pParent, SW_RES(DLG_MM_CREATEADDRESSLIST)), @@ -452,7 +423,7 @@ SwCreateAddressListDialog::SwCreateAddressListDialog( for( xub_StrLen nToken = 0; nToken < nHeaders; ++nToken) { String sHeader = sLine.GetToken( 0, '\t', nIndex ); - DBG_ASSERT(sHeader.Len() > 2 && + OSL_ENSURE(sHeader.Len() > 2 && sHeader.GetChar(0) == '\"' && sHeader.GetChar(sHeader.Len() - 1) == '\"', "Wrong format of header"); if(sHeader.Len() > 2) @@ -470,7 +441,7 @@ SwCreateAddressListDialog::SwCreateAddressListDialog( for( xub_StrLen nToken = 0; nToken < nDataCount; ++nToken) { String sData = sLine.GetToken( 0, '\t', nIndex ); - DBG_ASSERT(sData.Len() >= 2 && + OSL_ENSURE(sData.Len() >= 2 && sData.GetChar(0) == '\"' && sData.GetChar(sData.Len() - 1) == '\"', "Wrong format of line"); if(sData.Len() >= 2) @@ -500,19 +471,14 @@ SwCreateAddressListDialog::SwCreateAddressListDialog( m_aSetNoNF.SetMax(m_pCSVData->aDBData.size()); UpdateButtons(); } -/*-- 13.04.2004 10:08:59--------------------------------------------------- - -----------------------------------------------------------------------*/ SwCreateAddressListDialog::~SwCreateAddressListDialog() { delete m_pAddressControl; delete m_pCSVData; delete m_pFindDlg; } -/*-- 13.04.2004 10:08:59--------------------------------------------------- - add a new data set of empty strings and set the address input control - to that new set - -----------------------------------------------------------------------*/ + IMPL_LINK(SwCreateAddressListDialog, NewHdl_Impl, PushButton*, EMPTYARG) { sal_uInt32 nCurrent = m_pAddressControl->GetCurrentDataSet(); @@ -528,9 +494,7 @@ IMPL_LINK(SwCreateAddressListDialog, NewHdl_Impl, PushButton*, EMPTYARG) UpdateButtons(); return 0; } -/*-- 13.04.2004 10:09:00--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCreateAddressListDialog, DeleteHdl_Impl, PushButton*, EMPTYARG) { sal_uInt32 nCurrent = m_pAddressControl->GetCurrentDataSet(); @@ -552,9 +516,7 @@ IMPL_LINK(SwCreateAddressListDialog, DeleteHdl_Impl, PushButton*, EMPTYARG) UpdateButtons(); return 0; } -/*-- 13.04.2004 10:09:00--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCreateAddressListDialog, FindHdl_Impl, PushButton*, EMPTYARG) { if(!m_pFindDlg) @@ -572,9 +534,7 @@ IMPL_LINK(SwCreateAddressListDialog, FindHdl_Impl, PushButton*, EMPTYARG) m_pFindDlg->Show(!m_pFindDlg->IsVisible()); return 0; } -/*-- 13.04.2004 10:09:00--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCreateAddressListDialog, CustomizeHdl_Impl, PushButton*, pButton) { SwCustomizeAddressListDialog* pDlg = new SwCustomizeAddressListDialog(pButton, *m_pCSVData); @@ -600,10 +560,7 @@ IMPL_LINK(SwCreateAddressListDialog, CustomizeHdl_Impl, PushButton*, pButton) } return 0; } -/*-- 23.04.2004 09:02:51--------------------------------------------------- - writes the data into a .csv file - encoding is UTF8, separator is tab, strings are enclosed into " - -----------------------------------------------------------------------*/ + IMPL_LINK(SwCreateAddressListDialog, OkHdl_Impl, PushButton*, EMPTYARG) { if(!m_sURL.Len()) @@ -677,9 +634,7 @@ IMPL_LINK(SwCreateAddressListDialog, OkHdl_Impl, PushButton*, EMPTYARG) return 0; } -/*-- 13.04.2004 10:09:01--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCreateAddressListDialog, DBCursorHdl_Impl, PushButton*, pButton) { sal_uInt32 nValue = static_cast< sal_uInt32 >(m_aSetNoNF.GetValue()); @@ -705,18 +660,14 @@ IMPL_LINK(SwCreateAddressListDialog, DBCursorHdl_Impl, PushButton*, pButton) } return 0; } -/*-- 21.04.2004 12:06:47--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCreateAddressListDialog, DBNumCursorHdl_Impl, NumericField*, EMPTYARG) { m_pAddressControl->SetCurrentDataSet( static_cast< sal_uInt32 >(m_aSetNoNF.GetValue() - 1) ); UpdateButtons(); return 0; } -/*-- 21.04.2004 13:22:27--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwCreateAddressListDialog::UpdateButtons() { sal_uInt32 nCurrent = static_cast< sal_uInt32 >(m_aSetNoNF.GetValue() ); @@ -727,9 +678,7 @@ void SwCreateAddressListDialog::UpdateButtons() m_aEndPB.Enable(nCurrent != nSize); m_aDeletePB.Enable(nSize > 0); } -/*-- 21.04.2004 13:22:27--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwCreateAddressListDialog::Find(const String& rSearch, sal_Int32 nColumn) { OUString sSearch = rSearch; @@ -774,9 +723,7 @@ void SwCreateAddressListDialog::Find(const String& rSearch, sal_Int32 nColumn) m_pAddressControl->SetCursorTo(nElement); } } -/*-- 13.04.2004 13:48:38--------------------------------------------------- - -----------------------------------------------------------------------*/ SwFindEntryDialog::SwFindEntryDialog(SwCreateAddressListDialog* pParent) : ModelessDialog(pParent, SW_RES(DLG_MM_FIND_ENTRY)), #ifdef MSC @@ -799,15 +746,11 @@ SwFindEntryDialog::SwFindEntryDialog(SwCreateAddressListDialog* pParent) : m_aFindED.SetModifyHdl(LINK(this, SwFindEntryDialog, FindEnableHdl_Impl)); m_aCancel.SetClickHdl(LINK(this, SwFindEntryDialog, CloseHdl_Impl)); } -/*-- 13.04.2004 13:48:38--------------------------------------------------- - -----------------------------------------------------------------------*/ SwFindEntryDialog::~SwFindEntryDialog() { } -/*-- 21.04.2004 13:37:46--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwFindEntryDialog, FindHdl_Impl, PushButton*, EMPTYARG) { sal_Int32 nColumn = -1; @@ -817,19 +760,17 @@ IMPL_LINK(SwFindEntryDialog, FindHdl_Impl, PushButton*, EMPTYARG) m_pParent->Find(m_aFindED.GetText(), nColumn); return 0; } -/*-- 21.04.2004 13:37:46--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwFindEntryDialog, FindEnableHdl_Impl, Edit*, EMPTYARG) { m_aFindPB.Enable(m_aFindED.GetText().Len() > 0); return 0; } -/*-- 21.04.2004 15:36:36--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwFindEntryDialog, CloseHdl_Impl, PushButton*, EMPTYARG) { Show(sal_False); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/createaddresslistdialog.hxx b/sw/source/ui/dbui/createaddresslistdialog.hxx index 39cd1bc33a..caf1baf445 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.hxx +++ b/sw/source/ui/dbui/createaddresslistdialog.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #include <sfx2/basedlgs.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <svtools/stdctrl.hxx> #include <vcl/field.hxx> #include <vcl/lstbox.hxx> @@ -39,17 +38,14 @@ class SwAddressControl_Impl; class SwMailMergeConfigItem; -/*-- 19.04.2004 12:09:46--------------------------------------------------- - container of the created database - -----------------------------------------------------------------------*/ + +// container of the created database struct SwCSVData { ::std::vector< ::rtl::OUString > aDBColumnHeaders; ::std::vector< ::std::vector< ::rtl::OUString> > aDBData; }; -/*-- 08.04.2004 14:04:39--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwFindEntryDialog; class SwCreateAddressListDialog : public SfxModalDialog { @@ -98,9 +94,7 @@ public: const String& GetURL() const { return m_sURL; } void Find( const String& rSearch, sal_Int32 nColumn); }; -/*-- 13.04.2004 13:30:21--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwFindEntryDialog : public ModelessDialog { FixedText m_aFindFT; @@ -128,3 +122,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/createaddresslistdialog.src b/sw/source/ui/dbui/createaddresslistdialog.src index dabce5ecc9..1679aa18f2 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.src +++ b/sw/source/ui/dbui/createaddresslistdialog.src @@ -29,9 +29,6 @@ #include <dbui.hrc> #include <helpid.h> -/*-- 13.04.2004 13:58:13--------------------------------------------------- - - -----------------------------------------------------------------------*/ ModalDialog DLG_MM_CREATEADDRESSLIST { OutputSize = TRUE ; @@ -173,9 +170,6 @@ ModalDialog DLG_MM_CREATEADDRESSLIST }; }; -/*-- 13.04.2004 13:58:13--------------------------------------------------- - - -----------------------------------------------------------------------*/ ModelessDialog DLG_MM_FIND_ENTRY { OutputSize = TRUE ; diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.cxx b/sw/source/ui/dbui/customizeaddresslistdialog.cxx index adc71a69f7..46dd609f3e 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.cxx +++ b/sw/source/ui/dbui/customizeaddresslistdialog.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,11 +41,6 @@ #include <dbui.hrc> #include <helpid.h> - - -/*-- 13.04.2004 14:27:21--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwCustomizeAddressListDialog::SwCustomizeAddressListDialog( Window* pParent, const SwCSVData& rOldData) : SfxModalDialog(pParent, SW_RES(DLG_MM_CUSTOMIZE_ADDRESS_LIST)), @@ -86,24 +82,17 @@ SwCustomizeAddressListDialog::SwCustomizeAddressListDialog( m_aFieldsLB.SelectEntryPos(0); UpdateButtons(); } -/*-- 13.04.2004 14:34:07--------------------------------------------------- - -----------------------------------------------------------------------*/ SwCustomizeAddressListDialog::~SwCustomizeAddressListDialog() { } -/*-- 12.08.2004 12:58:00--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK(SwCustomizeAddressListDialog, ListBoxSelectHdl_Impl, ListBox*, EMPTYARG) { UpdateButtons(); return 0; } -/*-- 13.04.2004 15:02:14--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton) { bool bRename = pButton == &m_aRenamePB; @@ -147,9 +136,7 @@ IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton) UpdateButtons(); return 0; } -/*-- 13.04.2004 15:02:14--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCustomizeAddressListDialog, DeleteHdl_Impl, PushButton*, EMPTYARG) { sal_uInt16 nPos = m_aFieldsLB.GetSelectEntryPos(); @@ -166,9 +153,7 @@ IMPL_LINK(SwCustomizeAddressListDialog, DeleteHdl_Impl, PushButton*, EMPTYARG) UpdateButtons(); return 0; } -/*-- 13.04.2004 15:02:15--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCustomizeAddressListDialog, UpDownHdl_Impl, PushButton*, pButton) { sal_uInt16 nPos; @@ -196,9 +181,7 @@ IMPL_LINK(SwCustomizeAddressListDialog, UpDownHdl_Impl, PushButton*, pButton) UpdateButtons(); return 0; } -/*-- 19.04.2004 14:51:49--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwCustomizeAddressListDialog::UpdateButtons() { sal_uInt16 nPos = m_aFieldsLB.GetSelectEntryPos(); @@ -208,17 +191,12 @@ void SwCustomizeAddressListDialog::UpdateButtons() m_aDeletePB.Enable(nEntries > 0); m_aRenamePB.Enable(nEntries > 0); } -/*-- 19.04.2004 14:51:49--------------------------------------------------- - -----------------------------------------------------------------------*/ SwCSVData* SwCustomizeAddressListDialog::GetNewData() { return m_pNewData; } -/*-- 13.04.2004 13:48:41--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwAddRenameEntryDialog::SwAddRenameEntryDialog( Window* pParent, bool bRename, const ::std::vector< ::rtl::OUString >& rCSVHeader) : SfxModalDialog(pParent, SW_RES(DLG_MM_ADD_RENAME_ENTRY)), @@ -243,15 +221,11 @@ SwAddRenameEntryDialog::SwAddRenameEntryDialog( m_aFieldNameED.SetModifyHdl(LINK(this, SwAddRenameEntryDialog, ModifyHdl_Impl)); ModifyHdl_Impl( &m_aFieldNameED ); } -/*-- 13.04.2004 13:48:41--------------------------------------------------- - -----------------------------------------------------------------------*/ SwAddRenameEntryDialog::~SwAddRenameEntryDialog() { } -/*-- 19.04.2004 15:31:34--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit*, pEdit) { ::rtl::OUString sEntry = pEdit->GetText(); @@ -272,3 +246,5 @@ IMPL_LINK(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit*, pEdit) m_aOK.Enable(!bFound); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.hxx b/sw/source/ui/dbui/customizeaddresslistdialog.hxx index 68139828a1..8d5fdb4f4a 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.hxx +++ b/sw/source/ui/dbui/customizeaddresslistdialog.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,17 +29,13 @@ #define _CUSTOMIZEADDRESSLISTDIALOG_HXX #include <sfx2/basedlgs.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <svtools/stdctrl.hxx> #include <vcl/field.hxx> #include <vcl/lstbox.hxx> struct SwCSVData; -/*-- 08.04.2004 14:04:39--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwCustomizeAddressListDialog : public SfxModalDialog { FixedText m_aFieldsFT; @@ -71,9 +68,7 @@ public: SwCSVData* GetNewData(); }; -/*-- 13.04.2004 13:30:21--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwAddRenameEntryDialog : public SfxModalDialog { FixedText m_aFieldNameFT; @@ -97,3 +92,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.src b/sw/source/ui/dbui/customizeaddresslistdialog.src index b5a6881970..d95be1128a 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.src +++ b/sw/source/ui/dbui/customizeaddresslistdialog.src @@ -29,9 +29,6 @@ #include <dbui.hrc> #include <helpid.h> -/*-- 13.04.2004 13:58:13--------------------------------------------------- - - -----------------------------------------------------------------------*/ ModalDialog DLG_MM_CUSTOMIZE_ADDRESS_LIST { OutputSize = TRUE ; @@ -114,9 +111,7 @@ ModalDialog DLG_MM_CUSTOMIZE_ADDRESS_LIST Size = MAP_APPFONT ( 50 , 14 ) ; }; }; -/*-- 13.04.2004 13:58:13--------------------------------------------------- - - -----------------------------------------------------------------------*/ + ModalDialog DLG_MM_ADD_RENAME_ENTRY { OutputSize = TRUE ; diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index a70d8b5226..ffa822ec7f 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -107,7 +108,6 @@ #include <unomid.h> #include <IDocumentMarkAccess.hxx> - namespace swui { SwAbstractDialogFactory * GetFactory(); @@ -128,7 +128,7 @@ SV_IMPL_PTRARR( _SwTableAutoFmtTbl, SwTableAutoFmt* ) const char cDBFldStart = '<'; const char cDBFldEnd = '>'; -// Hilfsstruktur fuers einfuegen von Datenbankspalten als Felder oder Text +// Helper structure for adding database rows as fields or text struct _DB_Column { enum ColType { DB_FILLTEXT, DB_COL_FIELD, DB_COL_TEXT, DB_SPLITPARA } eColType; @@ -210,15 +210,11 @@ private: _DB_ColumnConfigData& operator =( const _DB_ColumnConfigData& ); }; -/* */ - int SwInsDBColumn::operator<( const SwInsDBColumn& rCmp ) const { return 0 > GetAppCollator().compareString( sColumn, rCmp.sColumn ); } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, Reference<XDataSource> xDataSource, Reference<sdbcx::XColumnsSupplier> xColSupp, @@ -358,7 +354,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, } catch(const Exception& ) { - DBG_ERROR("illegal number format key"); + OSL_ENSURE(false, "illegal number format key"); } } } @@ -373,13 +369,13 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, } if( !aDBColumns.Insert( pNew )) { - ASSERT( !this, "Spaltenname mehrfach vergeben?" ); + OSL_ENSURE( !this, "Spaltenname mehrfach vergeben?" ); delete pNew; } } } - // Absatzvorlagen-ListBox fuellen + // fill paragraph templates-ListBox { SfxStyleSheetBasePool* pPool = pView->GetDocShell()->GetStyleSheetPool(); pPool->SetSearchMask( SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL ); @@ -394,7 +390,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, aLbDbParaColl.SelectEntryPos( 0 ); } - // steht der Cursor in einer Tabelle, darf NIE Tabelle auswaehlbar sein + // when the cursor is inside of a table, table must NEVER be selectable if( pView->GetWrtShell().GetTableFmt() ) { aRbAsTable.Enable( sal_False ); @@ -450,23 +446,18 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, // read configuration Load(); - // Controls initialisieren: + // initialise Controls: PageHdl( aRbAsTable.IsChecked() ? &aRbAsTable : &aRbAsField ); } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ SwInsertDBColAutoPilot::~SwInsertDBColAutoPilot() { delete pTblSet; delete pRep; -// delete pConfig; delete pTAutoFmt; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK( SwInsertDBColAutoPilot, PageHdl, Button*, pButton ) { sal_Bool bShowTbl = pButton == &aRbAsTable; @@ -500,9 +491,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, PageHdl, Button*, pButton ) return 0; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK( SwInsertDBColAutoPilot, DBFormatHdl, Button*, pButton ) { sal_uInt16 nFndPos; @@ -521,9 +510,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, DBFormatHdl, Button*, pButton ) return 0; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton ) { sal_Bool bChgEnable = sal_True, bEnableTo = sal_True, bEnableFrom = sal_True; @@ -572,7 +559,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton ) nDelPos = aLbTableCol.GetSelectEntryPos(), nTopPos = aLbTableCol.GetTopEntry(); - // die richtige InsertPos suchen!! + // look for the right InsertPos!! SwInsDBColumn aSrch( aLbTableCol.GetEntry( nDelPos ), 0 ); aDBColumns.Seek_Entry( &aSrch, &nFndPos ); if( !nFndPos || nFndPos == aDBColumns.Count()-1 ) @@ -616,7 +603,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton ) else if( pButton == &aIbDbcolToEdit ) { bChgEnable = sal_False; - // Daten ins Edit moven: + // move data to Edit: String aFld( aLbTxtDbColumn.GetSelectEntry() ); if( aFld.Len() ) { @@ -624,20 +611,20 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton ) sal_uInt16 nPos = (sal_uInt16)aEdDbText.GetSelection().Min(); sal_uInt16 nSel = sal_uInt16(aEdDbText.GetSelection().Max()) - nPos; if( nSel ) - // dann loesche erstmal die bestehende Selektion + // first delete the existing selection aStr.Erase( nPos, nSel ); aFld.Insert( cDBFldStart, 0 ); aFld += cDBFldEnd; if( aStr.Len() ) { - if( nPos ) // ein Space davor + if( nPos ) // one blank in front { sal_Unicode c = aStr.GetChar( nPos-1 ); if( '\n' != c && '\r' != c ) aFld.Insert( ' ', 0 ); } - if( nPos < aStr.Len() ) // ein Space dahinter + if( nPos < aStr.Len() ) // one blank behind { sal_Unicode c = aStr.GetChar( nPos ); if( '\n' != c && '\r' != c ) @@ -670,9 +657,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblToFromHdl, Button*, pButton ) return 0; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK( SwInsertDBColAutoPilot, DblClickHdl, ListBox*, pBox ) { Button* pButton = 0; @@ -688,9 +673,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, DblClickHdl, ListBox*, pBox ) return 0; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton ) { SwWrtShell& rSh = pView->GetWrtShell(); @@ -700,7 +683,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton ) bNewSet = sal_True; pTblSet = new SfxItemSet( rSh.GetAttrPool(), SwuiGetUITableAttrRange() ); - //Ersteinmal die einfachen Attribute besorgen. + // At first acquire the simple attributes pTblSet->Put( SfxStringItem( FN_PARAM_TABLE_NAME, rSh.GetUniqueTblName() )); pTblSet->Put( SfxUInt16Item( FN_PARAM_TABLE_HEADLINE, 1 ) ); @@ -713,15 +696,15 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton ) pTblSet->Put( aBrush, SID_ATTR_BRUSH_TABLE ); SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); - // Tabellenvariante, wenn mehrere Tabellenzellen selektiert + // table variant, when multiple table cells are selected aBoxInfo.SetTable( sal_True ); - // Abstandsfeld immer anzeigen + // always show gap field aBoxInfo.SetDist( sal_True); - // Minimalgroesse in Tabellen und Absaetzen setzen + // set minimum size in tables and paragraphs aBoxInfo.SetMinDist( sal_False ); - // Default-Abstand immer setzen + // always set default-gap aBoxInfo.SetDefDist( MIN_BORDER_DIST ); - // Einzelne Linien koennen nur in Tabellen DontCare-Status haben + // Single lines can have DontCare-status only in tables aBoxInfo.SetValid( VALID_DISABLE, sal_True ); pTblSet->Put( aBoxInfo ); @@ -735,7 +718,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton ) const SwFmtCol& rCol = aPara.pFrmFmt->GetCol(); const SwColumns& rCols = rCol.GetColumns(); - //nStart und nEnd initialisieren fuer nNum == 0 + // initialise nStart und nEnd for nNum == 0 long nWidth1 = 0, nStart1 = 0, nEnd1 = nWidth; @@ -771,8 +754,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton ) if( aLbTableCol.GetEntryCount() != pRep->GetAllColCount() ) { - // Anzahl der Spalten hat sich geaendert: dann muessen die - // TabCols angepasst werden + // Number of columns has changed: then the TabCols have to be adjusted long nWidth = pRep->GetWidth(); sal_uInt16 nCols = aLbTableCol.GetEntryCount() - 1; SwTabCols aTabCols( nCols ); @@ -794,10 +776,10 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton ) } SwAbstractDialogFactory* pFact = swui::GetFactory(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateSwTableTabDlg( pButton, rSh.GetAttrPool(),pTblSet, &rSh, DLG_FORMAT_TABLE ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if( RET_OK == pDlg->Execute() ) pTblSet->Put( *pDlg->GetOutputItemSet() ); else if( bNewSet ) @@ -809,24 +791,20 @@ IMPL_LINK( SwInsertDBColAutoPilot, TblFmtHdl, PushButton*, pButton ) return 0; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK( SwInsertDBColAutoPilot, AutoFmtHdl, PushButton*, pButton ) { SwAbstractDialogFactory* pFact = swui::GetFactory(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton, pView->GetWrtShellPtr(),DLG_AUTOFMT_TABLE, sal_False, pTAutoFmt); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if( RET_OK == pDlg->Execute()) pDlg->FillAutoFmtOfIndex( pTAutoFmt ); delete pDlg; return 0; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox ) { ListBox* pGetBox = pBox == &aLbDbFmtFromUsr @@ -851,8 +829,8 @@ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox ) } else { - // an der FormatGroupBox den ausgewaehlten FeldNamen setzen, damit - // klar ist, welches Feld ueber das Format eingestellt wird! + // set the selected FieldName at the FormatGroupBox, so that + // it's clear what field is configured by the format! String sTxt( aFlFormat.GetText().Copy( 0, nGBFmtLen )); if( !aSrch.sColumn.getLength() ) { @@ -881,16 +859,14 @@ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox ) aFlFormat.SetText( sTxt ); - // um spaeter zu wissen, welche ListBox die "aktive" war, wird sich - // im 1. Eintrag ein Flag gemerkt, + // to know later on, what ListBox was the "active", a Flag + // is remembered in the 1st entry void* pPtr = pBox == &aLbTableCol ? &aLbTableCol : 0; aLbTableCol.SetEntryData( 0, pPtr ); } return 0; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK( SwInsertDBColAutoPilot, HeaderHdl, Button*, pButton ) { if( pButton == &aCbTableHeadon ) @@ -902,9 +878,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, HeaderHdl, Button*, pButton ) } return 0; } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ static void lcl_InsTextInArr( const String& rTxt, _DB_Columns& rColArr ) { _DB_Column* pNew; @@ -926,17 +900,14 @@ static void lcl_InsTextInArr( const String& rTxt, _DB_Columns& rColArr ) rColArr.Insert( pNew, rColArr.Count() ); } } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwInsertDBColAutoPilot::SplitTextToColArr( const String& rTxt, _DB_Columns& rColArr, sal_Bool bInsField ) { - // aus dem Text wieder die einzelnen Datenbank - Spalten erzeugen - // und dann in einem Array speichern - // Die Datenbankspalten stehen in <> und muessen im Array der Spalten - // vorhanden sein: + // create each of the database columns from the text again + // and then save in an array + // database columns are in <> and must be present in the columns' array: String sTxt( rTxt ); sal_uInt16 nFndPos, nEndPos, nSttPos = 0; @@ -945,12 +916,12 @@ sal_Bool SwInsertDBColAutoPilot::SplitTextToColArr( const String& rTxt, nSttPos = nFndPos + 1; if( STRING_NOTFOUND != ( nEndPos = sTxt.Search( cDBFldEnd, nSttPos+1 ))) { - // Text in <> geklammert gefunden: was ist es denn: + // Text in <> brackets found: what is it: SwInsDBColumn aSrch( sTxt.Copy( nSttPos, nEndPos - nSttPos ), 0); if( aDBColumns.Seek_Entry( &aSrch, &nFndPos ) ) { - // das ist ein gueltiges Feld - // also sicher den Text "davor": + // that is a valid field + // so surely the text "before": const SwInsDBColumn& rFndCol = *aDBColumns[ nFndPos ]; _DB_Column* pNew; @@ -998,15 +969,13 @@ sal_Bool SwInsertDBColAutoPilot::SplitTextToColArr( const String& rTxt, } } - // den letzten Text nicht vergessen + // don't forget the last text if( sTxt.Len() ) ::lcl_InsTextInArr( sTxt, rColArr ); return 0 != rColArr.Count(); } -/* --------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, Reference< XDataSource> xSource, Reference< XConnection> xConnection, @@ -1058,7 +1027,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, else ++nRows; - // bereite das Array fuer die ausgewaehlten Spalten auf + // prepare the array for the selected columns SwInsDBColumns_SAR aColFlds( 255 >= nCols ? (sal_uInt8)nCols : 255, 5 ); for( n = 0; n < nCols; ++n ) { @@ -1067,19 +1036,19 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, if( aDBColumns.Seek_Entry( &aSrch, &nFndPos ) ) aColFlds.Insert( aDBColumns[ nFndPos ], n ); else { - ASSERT( !this, "Datenbankspalte nicht mehr gefunden" ); + OSL_ENSURE( !this, "database column not found" ); } } if( nCols != aColFlds.Count() ) { - ASSERT( !this, "nicht alle Datenbankspalten gefunden" ); + OSL_ENSURE( !this, "not all database columns found" ); nCols = aColFlds.Count(); } if(!nRows || !nCols) { - ASSERT( !this, "wrong parameters" ); + OSL_ENSURE( !this, "wrong parameters" ); break; } @@ -1137,9 +1106,9 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, for( n = 0; n < nCols; ++n ) { - // beim aller erstenmal KEIN GoNextCell, weil wir schon - // drin stehen. Auch nicht nach dem Insert das GoNextCell, - // weil am Ende eine leere Zeile einfuegt wird. + // at the very first time, NO GoNextCell, because we're + // already in it. Also no GoNextCell after the Insert, + // because an empty line is added at the end. if( i || n ) rSh.GoNextCell(); @@ -1209,12 +1178,14 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, } } catch(Exception& -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 aExcept #endif ) { - DBG_ERROR(ByteString(String(aExcept.Message), gsl_getSystemTextEncoding()).GetBuffer()); +#if OSL_DEBUG_LEVEL > 1 + OSL_ENSURE(false, ByteString(String(aExcept.Message), gsl_getSystemTextEncoding()).GetBuffer()); +#endif } } @@ -1241,13 +1212,13 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, } rSh.SetAutoUpdateCells( bIsAutoUpdateCells ); } - else // Daten als Felder/Text einfuegen + else // add data as fields/text { _DB_Columns aColArr; if( SplitTextToColArr( aEdDbText.GetText(), aColArr, aRbAsField.IsChecked() ) ) { - // jetzt kann bei jedem Datensatz einfach ueber das Array iteriert - // und die Daten eingefuegt werden + // now for each data set, we can iterate over the array + // and add the data if( !rSh.IsSttPara() ) rSh.SwEditShell::SplitNode(); @@ -1277,8 +1248,8 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, } } - // fuers Einfuegen als Felder -> nach jedem Datensatz ein - // "NextField" einfuegen + // for adding as fields -> insert a "NextField" after + // every data set SwDBFormatData aDBFormatData; Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); if( xMgr.is() ) @@ -1349,8 +1320,8 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, case _DB_Column::DB_SPLITPARA: rSh.SplitNode(); - // wenn nicht die gleiche Vorlage die Follow Vorlage - // ist, dann muss die ausgewaehlte neu gesetzt werden + // when the template is not the same as the follow template, + // the selected has to be set newly if( pColl && &pColl->GetNextTxtFmtColl() != pColl ) rSh.SetTxtFmtColl( pColl ); break; @@ -1425,18 +1396,16 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, if( bSetCrsr && sIns.Len() ) { - // zum Anfang und eine Mark setzen, damit der - // Cursor am Ende wieder auf Anfangsposition - // gesetzt werden kann. + // to the beginning and set a mark, so that + // the cursor can be set to the initial position + // at the end. - // rSh.SwCrsrShell::MovePara( fnParaCurr, fnParaStart ); rSh.SwCrsrShell::MovePara( GetfnParaCurr(), GetfnParaStart() ); pMark = rSh.SetBookmark( KeyCode(), ::rtl::OUString(), ::rtl::OUString(), IDocumentMarkAccess::UNO_BOOKMARK ); - // rSh.SwCrsrShell::MovePara( fnParaCurr, fnParaEnd ); rSh.SwCrsrShell::MovePara( GetfnParaCurr(), GetfnParaEnd() ); bSetCrsr = sal_False; @@ -1487,6 +1456,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, if ( bDisposeResultSet ) ::comphelper::disposeComponent(xResultSet); } + void SwInsertDBColAutoPilot::SetTabSet() { SwWrtShell& rSh = pView->GetWrtShell(); @@ -1496,7 +1466,7 @@ void SwInsertDBColAutoPilot::SetTabSet() { if( pTAutoFmt->IsFrame() ) { - // Umrandung kommt vom AutoFormat + // border is from AutoFormat pTblSet->ClearItem( RES_BOX ); pTblSet->ClearItem( SID_ATTR_BORDER_INNER ); } @@ -1509,9 +1479,9 @@ void SwInsertDBColAutoPilot::SetTabSet() } else { - // die Defaults wieder entfernen, es macht keinen Sinn sie zu setzen + // remove the defaults again, it makes no sense to set them SvxBrushItem aBrush( RES_BACKGROUND ); - static sal_uInt16 __READONLY_DATA aIds[3] = + static sal_uInt16 aIds[3] = { RES_BACKGROUND, SID_ATTR_BRUSH_ROW, SID_ATTR_BRUSH_TABLE }; for( int i = 0; i < 3; ++i ) if( SFX_ITEM_SET == pTblSet->GetItemState( aIds[ i ], @@ -1534,14 +1504,8 @@ void SwInsertDBColAutoPilot::SetTabSet() rSh.MoveTable( GetfnTableCurr(), GetfnTableStart() ); } -/* */ - - _DB_ColumnConfigData::~_DB_ColumnConfigData() {} -/* -----------------------------05.12.00 16:15-------------------------------- - - ---------------------------------------------------------------------------*/ static Sequence<rtl::OUString> lcl_createSourceNames(const String& rNodeName) { Sequence<rtl::OUString> aSourceNames(11); @@ -1573,9 +1537,7 @@ static Sequence<rtl::OUString> lcl_createSourceNames(const String& rNodeName) RTL_CONSTASCII_STRINGPARAM( "/IsEmptyHeadline" )); return aSourceNames; } -/* -----------------------------05.12.00 16:25-------------------------------- - ---------------------------------------------------------------------------*/ static Sequence<rtl::OUString> lcl_CreateSubNames( const String& rSubNodeName ) { Sequence<rtl::OUString> aSubSourceNames(6); @@ -1596,9 +1558,7 @@ static Sequence<rtl::OUString> lcl_CreateSubNames( const String& rSubNodeName ) RTL_CONSTASCII_STRINGPARAM( "/NumberFormatLocale" )); return aSubSourceNames; } -/* -----------------------------06.12.00 13:03-------------------------------- - ---------------------------------------------------------------------------*/ static rtl::OUString lcl_CreateUniqueName(const Sequence<rtl::OUString>& aNames) { sal_Int32 nIdx = aNames.getLength(); @@ -1622,9 +1582,7 @@ static rtl::OUString lcl_CreateUniqueName(const Sequence<rtl::OUString>& aNames) } return sRet; } -/* -----------------------------05.12.00 15:00-------------------------------- - ---------------------------------------------------------------------------*/ void SwInsertDBColAutoPilot::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} void SwInsertDBColAutoPilot::Commit() @@ -1760,9 +1718,7 @@ void SwInsertDBColAutoPilot::Commit() SetSetProperties(sColumnNode, aSubValues); } } -/* -----------------------------05.12.00 15:00-------------------------------- - ---------------------------------------------------------------------------*/ void SwInsertDBColAutoPilot::Load() { Sequence <rtl::OUString> aNames = GetNodeNames(rtl::OUString()); @@ -1845,7 +1801,6 @@ void SwInsertDBColAutoPilot::Load() pInsDBColumn->nUsrNumFmt = rNFmtr.GetEntryKey( pInsDBColumn->sUsrNumFmt, pInsDBColumn->eUsrNumFmtLng ); -// pInsDBColumn->nDBNumFmt pNewData->aDBColumns.Insert(pInsDBColumn); } @@ -1884,7 +1839,7 @@ void SwInsertDBColAutoPilot::Load() sTmp = pNewData->sTAutoFmtNm; if( sTmp.Len() ) { - // dann erstmal die AutoFmt-Datei laden und das Autoformat suchen + // then load the AutoFmt file and look for Autoformat first SwTableAutoFmtTbl aAutoFmtTbl; aAutoFmtTbl.Load(); for( sal_uInt16 nAutoFmt = aAutoFmtTbl.Count(); nAutoFmt; ) @@ -1904,8 +1859,8 @@ void SwInsertDBColAutoPilot::Load() aRbHeadlEmpty.Check( pNewData->bIsEmptyHeadln ); HeaderHdl(&aCbTableHeadon); - // jetzt noch die benutzerdefinierten Numberformat Strings in die - // Shell kopieren. Nur diese sind dann als ID verfuegbar + // now copy the user defined Numberformat strings to the + // Shell. Then only these are available as ID for( n = 0; n < aDBColumns.Count() ; ++n ) { SwInsDBColumn& rSet = *aDBColumns[ n ]; @@ -1934,7 +1889,7 @@ void SwInsertDBColAutoPilot::Load() } } - // steht der Cursor in einer Tabelle, darf NIE Tabelle auswaehlbar sein + // when the cursor is inside of a table, table must NEVER be selectable if( !aRbAsTable.IsEnabled() && aRbAsTable.IsChecked() ) aRbAsField.Check( sal_True ); delete pNewData; @@ -1943,3 +1898,4 @@ void SwInsertDBColAutoPilot::Load() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index 7b303d4850..60a7aad83e 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,9 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#if STLPORT_VERSION>=321 #include <cstdarg> -#endif #include <stdio.h> #include <unotxdoc.hxx> @@ -120,7 +119,7 @@ #include <sfx2/event.hxx> #include <vcl/msgbox.hxx> #include <svx/dataaccessdescriptor.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <rtl/textenc.h> #include <ndindex.hxx> #include <pam.hxx> @@ -129,7 +128,6 @@ #include <osl/file.hxx> #include <swabstdlg.hxx> #include <fmthdft.hxx> -#include <dbui.hrc> #include <envelp.hrc> #include <memory> #include <vector> @@ -196,7 +194,7 @@ bool lcl_getCountFromResultSet( sal_Int32& rCount, const uno::Reference<XResultS } return false; } -// #122799# copy compatibility options +// copy compatibility options void lcl_CopyCompatibilityOptions( SwWrtShell& rSourceShell, SwWrtShell& rTargetShell) { IDocumentSettingAccess* pIDsa = rSourceShell.getIDocumentSettingAccess(); @@ -213,9 +211,6 @@ void lcl_CopyCompatibilityOptions( SwWrtShell& rSourceShell, SwWrtShell& rTarget rTargetShell.SetUseFormerTextWrapping( pIDsa->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING)); } } -/* -----------------09.12.2002 12:35----------------- - * - * --------------------------------------------------*/ class SwConnectionDisposedListener_Impl : public cppu::WeakImplHelper1 < lang::XEventListener > @@ -228,7 +223,7 @@ public: ~SwConnectionDisposedListener_Impl(); }; -// ----------------------------------------------------------------------------- + struct SwNewDBMgr_Impl { SwDSParam* pMergeData; @@ -241,9 +236,7 @@ struct SwNewDBMgr_Impl ,xDisposeListener(new SwConnectionDisposedListener_Impl(rDBMgr)) {} }; -/*-- 24.10.2003 15:54:18--------------------------------------------------- - -----------------------------------------------------------------------*/ void lcl_InitNumberFormatter(SwDSParam& rParam, uno::Reference<XDataSource> xSource) { uno::Reference<XMultiServiceFactory> xMgr = ::comphelper::getProcessServiceFactory(); @@ -274,9 +267,7 @@ void lcl_InitNumberFormatter(SwDSParam& rParam, uno::Reference<XDataSource> xSou } } } -/* -----------------------------17.07.00 17:04-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos) { sal_Bool bRet = sal_False; @@ -288,7 +279,7 @@ sal_Bool lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos) } else { - DBG_ERROR("no absolute positioning available"); + OSL_ENSURE(false, "no absolute positioning available"); } } catch(Exception aExcept) @@ -296,9 +287,7 @@ sal_Bool lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos) } return bRet; } -/* -----------------------------17.07.00 17:23-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool lcl_GetColumnCnt(SwDSParam* pParam, const String& rColumnName, long nLanguage, String& rResult, double* pNumber) { @@ -332,14 +321,15 @@ sal_Bool lcl_GetColumnCnt(SwDSParam* pParam, rResult = SwNewDBMgr::GetDBField( xColumnProps, aFormatData, pNumber); return sal_True; }; + /*-------------------------------------------------------------------- - Beschreibung: Daten importieren + Description: import data --------------------------------------------------------------------*/ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc ) { SetMergeType( rMergeDesc.nMergeType ); - DBG_ASSERT(!bInMerge && !pImpl->pMergeData, "merge already activated!"); + OSL_ENSURE(!bInMerge && !pImpl->pMergeData, "merge already activated!"); SwDBData aData; aData.nCommandType = CommandType::TABLE; @@ -369,7 +359,7 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc ) *pTemp = *pImpl->pMergeData; else { - //#94779# calls from the calculator may have added a connection with an invalid commandtype + // calls from the calculator may have added a connection with an invalid commandtype //"real" data base connections added here have to re-use the already available //DSData and set the correct CommandType SwDBData aTempData(aData); @@ -417,7 +407,7 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc ) { pImpl->pMergeData->bEndOfDB = sal_True; pImpl->pMergeData->CheckEndOfDB(); - DBG_ERROR("exception in MergeNew()"); + OSL_ENSURE(false, "exception in MergeNew()"); } uno::Reference<XDataSource> xSource = SwNewDBMgr::getDataSourceAsParent(xConnection,aData.sDataSource); @@ -429,7 +419,7 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc ) if (IsInitDBFields()) { - // Bei Datenbankfeldern ohne DB-Name DB-Name von Dok einsetzen + // with database fields without DB-Name, use DB-Name from Doc SvStringsDtor aDBNames(1, 1); aDBNames.Insert( new String(), 0); SwDBData aInsertData = rMergeDesc.rSh.GetDBData(); @@ -446,7 +436,7 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc ) switch(rMergeDesc.nMergeType) { case DBMGR_MERGE: - bRet = Merge(&rMergeDesc.rSh); // Mischen + bRet = Merge(&rMergeDesc.rSh); break; case DBMGR_MERGE_MAILMERGE: // printing merge from 'old' merge dialog or from UNO-component @@ -458,8 +448,9 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc ) rMergeDesc); break; - default: // Einfuegen der selektierten Eintraege - // (war: InsertRecord) + default: + // insert selected entries + // (was: InsertRecord) ImportFromConnection(&rMergeDesc.rSh); break; } @@ -469,10 +460,8 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc ) } /*-------------------------------------------------------------------- - Beschreibung: Daten importieren + Description: import data --------------------------------------------------------------------*/ - - sal_Bool SwNewDBMgr::Merge(SwWrtShell* pSh) { pSh->StartAllAction(); @@ -485,9 +474,6 @@ sal_Bool SwNewDBMgr::Merge(SwWrtShell* pSh) return sal_True; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ void SwNewDBMgr::ImportFromConnection( SwWrtShell* pSh ) { if(pImpl->pMergeData && !pImpl->pMergeData->bEndOfDB) @@ -521,9 +507,6 @@ void SwNewDBMgr::ImportFromConnection( SwWrtShell* pSh ) } } } -/*-----------------24.02.97 10.30------------------- - ---------------------------------------------------*/ String lcl_FindColumn(const String& sFormatStr,sal_uInt16 &nUsedPos, sal_uInt8 &nSeparator) { @@ -556,9 +539,6 @@ String lcl_FindColumn(const String& sFormatStr,sal_uInt16 &nUsedPos, sal_uInt8 return sReturn; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ void SwNewDBMgr::ImportDBEntry(SwWrtShell* pSh) { if(pImpl->pMergeData && !pImpl->pMergeData->bEndOfDB) @@ -597,7 +577,7 @@ void SwNewDBMgr::ImportDBEntry(SwWrtShell* pSh) } else { - // Spalte nicht gefunden -> Fehler anzeigen + // column not found -> show error String sInsert = '?'; sInsert += sColumn; sInsert += '?'; @@ -624,12 +604,13 @@ void SwNewDBMgr::ImportDBEntry(SwWrtShell* pSh) sStr += '\t'; } pSh->SwEditShell::Insert2(sStr); - pSh->SwFEShell::SplitNode(); // Zeilenvorschub + pSh->SwFEShell::SplitNode(); // line feed } } } + /*-------------------------------------------------------------------- - Beschreibung: Listbox mit Tabellenliste fuellen + Description: fill Listbox with tablelist --------------------------------------------------------------------*/ sal_Bool SwNewDBMgr::GetTableNames(ListBox* pListBox, const String& rDBName) { @@ -680,7 +661,7 @@ sal_Bool SwNewDBMgr::GetTableNames(ListBox* pListBox, const String& rDBName) } /*-------------------------------------------------------------------- - Beschreibung: Listbox mit Spaltennamen einer Datenbank fuellen + Description: fill Listbox with column names of a database --------------------------------------------------------------------*/ sal_Bool SwNewDBMgr::GetColumnNames(ListBox* pListBox, const String& rDBName, const String& rTableName, sal_Bool bAppend) @@ -714,9 +695,7 @@ sal_Bool SwNewDBMgr::GetColumnNames(ListBox* pListBox, } return(sal_True); } -/* -----------------------------08.06.01 15:11-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwNewDBMgr::GetColumnNames(ListBox* pListBox, uno::Reference< XConnection> xConnection, const String& rTableName, sal_Bool bAppend) @@ -739,9 +718,8 @@ sal_Bool SwNewDBMgr::GetColumnNames(ListBox* pListBox, } /*-------------------------------------------------------------------- - Beschreibung: CTOR + Description: CTOR --------------------------------------------------------------------*/ - SwNewDBMgr::SwNewDBMgr() : nMergeType(DBMGR_INSERT), bInitDBFields(sal_False), @@ -752,9 +730,7 @@ SwNewDBMgr::SwNewDBMgr() : pMergeEvtSrc(NULL) { } -/* -----------------------------18.07.00 08:56-------------------------------- - ---------------------------------------------------------------------------*/ SwNewDBMgr::~SwNewDBMgr() { for(sal_uInt16 nPos = 0; nPos < aDataSourceParams.Count(); nPos++) @@ -778,7 +754,7 @@ SwNewDBMgr::~SwNewDBMgr() } /*-------------------------------------------------------------------- - Beschreibung: Serienbriefe als einzelne Dokumente speichern + Description: save bulk letters as single documents --------------------------------------------------------------------*/ String lcl_FindUniqueName(SwWrtShell* pTargetShell, const String& rStartingPageDesc, sal_uLong nDocNo ) { @@ -791,15 +767,14 @@ String lcl_FindUniqueName(SwWrtShell* pTargetShell, const String& rStartingPageD ++nDocNo; }while(true); } + void lcl_CopyDynamicDefaults( const SwDoc& rSource, SwDoc& rTarget ) { - sal_uInt16 __FAR_DATA aRangeOfDefaults[] = { + sal_uInt16 aRangeOfDefaults[] = { RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, - // --> OD 2008-02-25 #refactorlists## RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1, - // <-- RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, 0 }; @@ -821,6 +796,7 @@ void lcl_CopyDynamicDefaults( const SwDoc& rSource, SwDoc& rTarget ) if( aNewDefaults.Count() ) rTarget.SetDefault( aNewDefaults ); } + void lcl_CopyFollowPageDesc( SwWrtShell& rTargetShell, const SwPageDesc& rSourcePageDesc, @@ -879,7 +855,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, xMailDispatcher.set( new MailDispatcher(rMergeDescriptor.xSmtpServer)); if(!rMergeDescriptor.bSendAsAttachment && rMergeDescriptor.bSendAsHTML) { - sBodyMimeType = ::rtl::OUString::createFromAscii("text/html; charset="); + sBodyMimeType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/html; charset=")); sBodyMimeType += ::rtl::OUString::createFromAscii( rtl_getBestMimeCharsetFromTextEncoding( eEncoding )); SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get(); @@ -887,7 +863,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, } else sBodyMimeType = - ::rtl::OUString::createFromAscii("text/plain; charset=UTF-8; format=flowed"); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/plain; charset=UTF-8; format=flowed")); } uno::Reference< XPropertySet > xColumnProp; @@ -976,7 +952,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, nStartingPageNo = pSourceShell->GetVirtPageNum(); sStartingPageDesc = sModifiedStartingPageDesc = pSourceShell->GetPageDesc( pSourceShell->GetCurPageDesc()).GetName(); - // #122799# copy compatibility options + // copy compatibility options lcl_CopyCompatibilityOptions( *pSourceShell, *pTargetShell); // #72821# copy dynamic defaults lcl_CopyDynamicDefaults( *pSourceShell->GetDoc(), *pTargetShell->GetDoc() ); @@ -995,10 +971,10 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, if (!IsMergeSilent()) aPrtMonDlg.Show(); - // Progress, um KeyInputs zu unterbinden + // Progress, to prohibit KeyInputs SfxProgress aProgress(pSourrceDocSh, ::aEmptyStr, 1); - // Alle Dispatcher sperren + // lock all dispatchers SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst(pSourrceDocSh); while (pViewFrm) { @@ -1063,7 +1039,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, sStat += String::CreateFromInt32( nDocNo ); aPrtMonDlg.aPrintInfo.SetText(sStat); - // Rechenzeit fuer Save-Monitor: + // computation time for Save-Monitor: for (sal_uInt16 i = 0; i < 10; i++) Application::Reschedule(); @@ -1088,7 +1064,6 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, pWorkDoc->UpdateFlds(NULL, false); SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE_FINISHED), xWorkDocSh)); - // alle versteckten Felder/Bereiche entfernen pWorkDoc->RemoveInvisibleContent(); // launch MailMergeEvent if required @@ -1102,7 +1077,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, if(rMergeDescriptor.bCreateSingleFile || bAsSingleFile ) { - DBG_ASSERT( pTargetShell, "no target shell available!" ); + OSL_ENSURE( pTargetShell, "no target shell available!" ); // copy created file into the target document rWorkShell.ConvertFieldsToText(); rWorkShell.SetNumberingRestart(); @@ -1143,7 +1118,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, pTargetShell->InsertPageBreak( &sModifiedStartingPageDesc, nStartingPageNo ); else pTargetShell->SetPageStyle(sModifiedStartingPageDesc); - DBG_ASSERT(!pTargetShell->GetTableFmt(),"target document ends with a table - paragraph should be appended"); + OSL_ENSURE(!pTargetShell->GetTableFmt(),"target document ends with a table - paragraph should be appended"); //#i51359# add a second paragraph in case there's only one { SwNodeIndex aIdx( pWorkDoc->GetNodes().GetEndOfExtras(), 2 ); @@ -1200,13 +1175,12 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, String sMailAddress = GetDBField( xColumnProp, aDBFormat); if(!SwMailMergeHelper::CheckMailAddress( sMailAddress )) { - DBG_ERROR("invalid e-Mail address in database column"); + OSL_ENSURE(false, "invalid e-Mail address in database column"); } else { - SwMailMessage* pMessage = 0; - uno::Reference< mail::XMailMessage > xMessage = - pMessage = new SwMailMessage; + SwMailMessage* pMessage = new SwMailMessage; + uno::Reference< mail::XMailMessage > xMessage = pMessage; if(rMergeDescriptor.pMailMergeConfigItem->IsMailReplyTo()) pMessage->setReplyToAddress(rMergeDescriptor.pMailMergeConfigItem->GetMailReplyTo()); pMessage->addRecipient( sMailAddress ); @@ -1229,7 +1203,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, //read in the temporary file and use it as mail body SfxMedium aMedium( sFileURL, STREAM_READ, sal_True); SvStream* pInStream = aMedium.GetInStream(); - DBG_ASSERT(pInStream, "no output file created?"); + OSL_ENSURE(pInStream, "no output file created?"); if(pInStream) { pInStream->SetStreamCharSet( eEncoding ); @@ -1288,7 +1262,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, { if( rMergeDescriptor.nMergeType != DBMGR_MERGE_MAILMERGE ) { - DBG_ASSERT( aTempFile.get(), "Temporary file not available" ); + OSL_ENSURE( aTempFile.get(), "Temporary file not available" ); INetURLObject aTempFileURL(bAsSingleFile ? sSubject : aTempFile->GetURL()); SfxMedium* pDstMed = new SfxMedium( aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ), @@ -1333,21 +1307,17 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, uno::Sequence< beans::PropertyValue > aOptions( rMergeDescriptor.aPrintOptions ); const sal_Int32 nOpts = aOptions.getLength(); aOptions.realloc( nOpts + 1 ); - aOptions[ nOpts ].Name = rtl::OUString::createFromAscii( "Wait" ); + aOptions[ nOpts ].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Wait")); aOptions[ nOpts ].Value <<= sal_True ; -// aPrintArgs.Put(SfxBoolItem(FN_QRY_MERGE, sal_True) ); -// // #i52629# aynchronous printing should only be done in silent mode - otherwise -// // the printer dialog does not come up -// aPrintArgs.Put( SfxBoolItem( SID_ASYNCHRON, rMergeDescriptor.bPrintAsync )); // move print options const beans::PropertyValue* pPrintOptions = rMergeDescriptor.aPrintOptions.getConstArray(); for( sal_Int32 nOption = 0; nOption < rMergeDescriptor.aPrintOptions.getLength(); ++nOption) { - if( pPrintOptions[nOption].Name.equalsAscii( "CopyCount" ) - ||( pPrintOptions[nOption].Name.equalsAscii( "FileName" )) - ||( pPrintOptions[nOption].Name.equalsAscii( "Collate" )) - ||( pPrintOptions[nOption].Name.equalsAscii( "Pages" )) - ||( pPrintOptions[nOption].Name.equalsAscii( "Wait" ))) + if( pPrintOptions[nOption].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CopyCount")) + ||( pPrintOptions[nOption].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FileName"))) + ||( pPrintOptions[nOption].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Collate" ))) + ||( pPrintOptions[nOption].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Pages"))) + ||( pPrintOptions[nOption].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Wait")))) { aOptions.realloc( nOpts + 1 ); aOptions[ nOpts ].Name = pPrintOptions[nOption].Name; @@ -1355,14 +1325,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, } } -// const SwModuleOptions * pModOpt = SW_MOD()->GetModuleConfig(); -// if (pModOpt->IsSinglePrintJob()) -// { -// } -// else -// { pTargetView->ExecPrint( aOptions, IsMergeSilent(), rMergeDescriptor.bPrintAsync ); -// } } xTargetDocShell->DoClose(); } @@ -1373,7 +1336,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, aFileIter != aFilesToRemove.end(); aFileIter++) SWUnoHelper::UCB_DeleteFile( *aFileIter ); - // Alle Dispatcher freigeben + // unlock all dispatchers pViewFrm = SfxViewFrame::GetFirst(pSourrceDocSh); while (pViewFrm) { @@ -1397,10 +1360,6 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, return bLoop; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK_INLINE_START( SwNewDBMgr, PrtCancelHdl, Button *, pButton ) { pButton->GetParent()->Hide(); @@ -1409,12 +1368,10 @@ IMPL_LINK_INLINE_START( SwNewDBMgr, PrtCancelHdl, Button *, pButton ) } IMPL_LINK_INLINE_END( SwNewDBMgr, PrtCancelHdl, Button *, pButton ) - /*-------------------------------------------------------------------- - Beschreibung: Numberformat der Spalte ermitteln und ggfs. in - den uebergebenen Formatter uebertragen + Description: determine the column's Numberformat and transfer + to the forwarded Formatter, if applicable. --------------------------------------------------------------------*/ - sal_uLong SwNewDBMgr::GetColumnFmt( const String& rDBName, const String& rTableName, const String& rColNm, @@ -1472,7 +1429,7 @@ sal_uLong SwNewDBMgr::GetColumnFmt( const String& rDBName, } catch(Exception&) { - DBG_ERROR("Exception in getColumns()"); + OSL_ENSURE(false, "Exception in getColumns()"); } if(!xCols.is() || !xCols->hasByName(rColNm)) return nRet; @@ -1494,16 +1451,14 @@ sal_uLong SwNewDBMgr::GetColumnFmt( const String& rDBName, } return nRet; } -/* -----------------------------07.06.01 15:43-------------------------------- - ---------------------------------------------------------------------------*/ sal_uLong SwNewDBMgr::GetColumnFmt( uno::Reference< XDataSource> xSource, uno::Reference< XConnection> xConnection, uno::Reference< XPropertySet> xColumn, SvNumberFormatter* pNFmtr, long nLanguage ) { - //JP 12.01.99: ggfs. das NumberFormat im Doc setzen + // set the NumberFormat in the doc if applicable sal_uLong nRet = 0; if(!xSource.is()) @@ -1564,14 +1519,14 @@ sal_uLong SwNewDBMgr::GetColumnFmt( uno::Reference< XDataSource> xSource, } catch(const Exception&) { - DBG_ERROR("illegal number format key"); + OSL_ENSURE(false, "illegal number format key"); } } } } catch( const Exception& ) { - DBG_ERROR("no FormatKey property found"); + OSL_ENSURE(false, "no FormatKey property found"); } if(bUseDefault) nRet = SwNewDBMgr::GetDbtoolsClient().getDefaultNumberFormat(xColumn, xDocNumberFormatTypes, aLocale); @@ -1579,9 +1534,6 @@ sal_uLong SwNewDBMgr::GetColumnFmt( uno::Reference< XDataSource> xSource, return nRet; } -/* -----------------------------17.07.00 09:47-------------------------------- - - ---------------------------------------------------------------------------*/ sal_Int32 SwNewDBMgr::GetColumnType( const String& rDBName, const String& rTableName, const String& rColNm ) @@ -1627,9 +1579,6 @@ sal_Int32 SwNewDBMgr::GetColumnType( const String& rDBName, return nRet; } -/* -----------------------------03.07.00 17:12-------------------------------- - - ---------------------------------------------------------------------------*/ uno::Reference< sdbc::XConnection> SwNewDBMgr::GetConnection(const String& rDataSource, uno::Reference<XDataSource>& rxSource) { @@ -1650,9 +1599,7 @@ uno::Reference< sdbc::XConnection> SwNewDBMgr::GetConnection(const String& rData return xConnection; } -/* -----------------------------03.07.00 17:12-------------------------------- - ---------------------------------------------------------------------------*/ uno::Reference< sdbcx::XColumnsSupplier> SwNewDBMgr::GetColumnSupplier(uno::Reference<sdbc::XConnection> xConnection, const String& rTableOrQuery, sal_uInt8 eTableOrQuery) @@ -1696,21 +1643,19 @@ uno::Reference< sdbcx::XColumnsSupplier> SwNewDBMgr::GetColumnSupplier(uno::Refe } catch( const uno::Exception& ) { - DBG_ERROR("Exception in SwDBMgr::GetColumnSupplier"); + OSL_ENSURE(false, "Exception in SwDBMgr::GetColumnSupplier"); } return xRet; } -/* -----------------------------05.07.00 13:44-------------------------------- - ---------------------------------------------------------------------------*/ String SwNewDBMgr::GetDBField(uno::Reference<XPropertySet> xColumnProps, const SwDBFormatData& rDBFormatData, double* pNumber) { uno::Reference< XColumn > xColumn(xColumnProps, UNO_QUERY); String sRet; - DBG_ASSERT(xColumn.is(), "SwNewDBMgr::::ImportDBField: illegal arguments"); + OSL_ENSURE(xColumn.is(), "SwNewDBMgr::::ImportDBField: illegal arguments"); if(!xColumn.is()) return sRet; @@ -1745,8 +1690,6 @@ String SwNewDBMgr::GetDBField(uno::Reference<XPropertySet> xColumnProps, case DataType::TIME: case DataType::TIMESTAMP: { -// ::Date aTempDate(rDBFormatData.aNullDate.Day, -// rDBFormatData.aNullDate.Month, rDBFormatData.aNullDate.Year); try { @@ -1767,47 +1710,26 @@ String SwNewDBMgr::GetDBField(uno::Reference<XPropertySet> xColumnProps, } catch(Exception& ) { - DBG_ERROR("exception caught"); + OSL_ENSURE(false, "exception caught"); } } break; - -// case DataType::BINARY: -// case DataType::VARBINARY: -// case DataType::LONGVARBINARY: -// case DataType::SQLNULL: -// case DataType::OTHER: -// case DataType::OBJECT: -// case DataType::DISTINCT: -// case DataType::STRUCT: -// case DataType::ARRAY: -// case DataType::BLOB: -// case DataType::CLOB: -// case DataType::REF: -// default: - } -// if (pFormat) -// { -// SFX_ITEMSET_GET(*pCol, pFormatItem, SfxUInt32Item, SBA_DEF_FMTVALUE, sal_True); -// *pFormat = pFormatItem->GetValue(); -// } + } return sRet; } -/* -----------------------------06.07.00 14:28-------------------------------- - releases the merge data source table or query after merge is completed - ---------------------------------------------------------------------------*/ + +// releases the merge data source table or query after merge is completed void SwNewDBMgr::EndMerge() { - DBG_ASSERT(bInMerge, "merge is not active"); + OSL_ENSURE(bInMerge, "merge is not active"); bInMerge = sal_False; delete pImpl->pMergeData; pImpl->pMergeData = 0; } -/* -----------------------------06.07.00 14:28-------------------------------- - checks if a desired data source table or query is open - ---------------------------------------------------------------------------*/ + +// checks if a desired data source table or query is open sal_Bool SwNewDBMgr::IsDataSourceOpen(const String& rDataSource, const String& rTableOrQuery, sal_Bool bMergeOnly) { @@ -1831,9 +1753,8 @@ sal_Bool SwNewDBMgr::IsDataSourceOpen(const String& rDataSource, } return sal_False; } -/* -----------------------------17.07.00 16:44-------------------------------- - read column data a a specified position - ---------------------------------------------------------------------------*/ + +// read column data at a specified position sal_Bool SwNewDBMgr::GetColumnCnt(const String& rSourceName, const String& rTableName, const String& rColumnName, sal_uInt32 nAbsRecordId, long nLanguage, @@ -1896,9 +1817,9 @@ sal_Bool SwNewDBMgr::GetColumnCnt(const String& rSourceName, const String& rTabl } return bRet; } -/* -----------------------------06.07.00 16:47-------------------------------- - reads the column data at the current position - ---------------------------------------------------------------------------*/ + + +// reads the column data at the current position sal_Bool SwNewDBMgr::GetMergeColumnCnt(const String& rColumnName, sal_uInt16 nLanguage, String &rResult, double *pNumber, sal_uInt32 * /*pFormat*/) { @@ -1911,17 +1832,13 @@ sal_Bool SwNewDBMgr::GetMergeColumnCnt(const String& rColumnName, sal_uInt16 nLa sal_Bool bRet = lcl_GetColumnCnt(pImpl->pMergeData, rColumnName, nLanguage, rResult, pNumber); return bRet; } -/* -----------------------------07.07.00 14:28-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwNewDBMgr::ToNextMergeRecord() { - DBG_ASSERT(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge"); + OSL_ENSURE(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge"); return ToNextRecord(pImpl->pMergeData); } -/* -----------------------------10.07.01 14:28-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwNewDBMgr::ToNextRecord( const String& rDataSource, const String& rCommand, sal_Int32 /*nCommandType*/) { @@ -1940,9 +1857,7 @@ sal_Bool SwNewDBMgr::ToNextRecord( } return ToNextRecord(pFound); } -/* -----------------------------10.07.01 14:38-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwNewDBMgr::ToNextRecord(SwDSParam* pParam) { sal_Bool bRet = sal_True; @@ -1986,7 +1901,7 @@ sal_Bool SwNewDBMgr::ToNextRecord(SwDSParam* pParam) return bRet; } -/* -----------------------------13.07.00 17:23-------------------------------- +/* ------------------------------------------------------------------------ synchronized labels contain a next record field at their end to assure that the next page can be created in mail merge the cursor position must be validated @@ -1995,13 +1910,11 @@ sal_Bool SwNewDBMgr::ExistsNextRecord() const { return pImpl->pMergeData && !pImpl->pMergeData->bEndOfDB; } -/* -----------------------------13.07.00 10:41-------------------------------- - ---------------------------------------------------------------------------*/ sal_uInt32 SwNewDBMgr::GetSelectedRecordId() { sal_uInt32 nRet = 0; - DBG_ASSERT(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge"); + OSL_ENSURE(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge"); if(!pImpl->pMergeData || !pImpl->pMergeData->xResultSet.is()) return sal_False; try @@ -2013,12 +1926,10 @@ sal_uInt32 SwNewDBMgr::GetSelectedRecordId() } return nRet; } -/* -----------------------------13.07.00 10:58-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwNewDBMgr::ToRecordId(sal_Int32 nSet) { - DBG_ASSERT(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge"); + OSL_ENSURE(pImpl->pMergeData && pImpl->pMergeData->xResultSet.is(), "no data source in merge"); if(!pImpl->pMergeData || !pImpl->pMergeData->xResultSet.is()|| nSet < 0) return sal_False; sal_Bool bRet = sal_False; @@ -2033,9 +1944,6 @@ sal_Bool SwNewDBMgr::ToRecordId(sal_Int32 nSet) return bRet; } -/* -----------------------------17.07.00 14:17-------------------------------- - - ---------------------------------------------------------------------------*/ sal_Bool SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTableOrQuery, sal_Int32 nCommandType, bool bCreate) { @@ -2069,7 +1977,7 @@ sal_Bool SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTa } catch(Exception&) { - //#98373# DB driver may not be ODBC 3.0 compliant + // DB driver may not be ODBC 3.0 compliant pFound->bScrollable = sal_True; } pFound->xStatement = pFound->xConnection->createStatement(); @@ -2096,9 +2004,7 @@ sal_Bool SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTa } return pFound->xResultSet.is(); } -/* -----------------------------14.08.2001 10:26------------------------------ - ---------------------------------------------------------------------------*/ uno::Reference< XConnection> SwNewDBMgr::RegisterConnection(rtl::OUString& rDataSource) { SwDSParam* pFound = SwNewDBMgr::FindDSConnection(rDataSource, sal_True); @@ -2118,9 +2024,7 @@ uno::Reference< XConnection> SwNewDBMgr::RegisterConnection(rtl::OUString& rData } return pFound->xConnection; } -/* -----------------------------17.07.00 15:55-------------------------------- - ---------------------------------------------------------------------------*/ sal_uInt32 SwNewDBMgr::GetSelectedRecordId( const String& rDataSource, const String& rTableOrQuery, sal_Int32 nCommandType) { @@ -2159,9 +2063,8 @@ sal_uInt32 SwNewDBMgr::GetSelectedRecordId( return nRet; } -/* -----------------------------17.07.00 14:18-------------------------------- - close all data sources - after fields were updated - ---------------------------------------------------------------------------*/ + +// close all data sources - after fields were updated void SwNewDBMgr::CloseAll(sal_Bool bIncludingMerge) { //the only thing done here is to reset the selection index @@ -2184,9 +2087,7 @@ void SwNewDBMgr::CloseAll(sal_Bool bIncludingMerge) } } } -/* -----------------------------17.07.00 14:54-------------------------------- - ---------------------------------------------------------------------------*/ SwDSParam* SwNewDBMgr::FindDSData(const SwDBData& rData, sal_Bool bCreate) { //prefer merge data if available @@ -2207,7 +2108,7 @@ SwDSParam* SwNewDBMgr::FindDSData(const SwDBData& rData, sal_Bool bCreate) (rData.nCommandType == -1 || rData.nCommandType == pParam->nCommandType || (bCreate && pParam->nCommandType == -1))) { - //#94779# calls from the calculator may add a connection with an invalid commandtype + // calls from the calculator may add a connection with an invalid commandtype //later added "real" data base connections have to re-use the already available //DSData and set the correct CommandType if(bCreate && pParam->nCommandType == -1) @@ -2235,9 +2136,6 @@ SwDSParam* SwNewDBMgr::FindDSData(const SwDBData& rData, sal_Bool bCreate) } return pFound; } -/* -----------------------------14.08.2001 10:27------------------------------ - - ---------------------------------------------------------------------------*/ SwDSParam* SwNewDBMgr::FindDSConnection(const rtl::OUString& rDataSource, sal_Bool bCreate) { @@ -2275,16 +2173,11 @@ SwDSParam* SwNewDBMgr::FindDSConnection(const rtl::OUString& rDataSource, sal_B return pFound; } -/* -----------------------------17.07.00 14:34-------------------------------- - - ---------------------------------------------------------------------------*/ const SwDBData& SwNewDBMgr::GetAddressDBName() { return SW_MOD()->GetDBConfig()->GetAddressSource(); } -/* -----------------------------18.07.00 13:13-------------------------------- - ---------------------------------------------------------------------------*/ Sequence<rtl::OUString> SwNewDBMgr::GetExistingDatabaseNames() { uno::Reference<XNameAccess> xDBContext; @@ -2300,9 +2193,7 @@ Sequence<rtl::OUString> SwNewDBMgr::GetExistingDatabaseNames() } return Sequence<rtl::OUString>(); } -/*-- 26.05.2004 14:33:13--------------------------------------------------- - -----------------------------------------------------------------------*/ String SwNewDBMgr::LoadAndRegisterDataSource() { sfx2::FileDialogHelper aDlgHelper( TemplateDescription::FILEOPEN_SIMPLE, 0 ); @@ -2493,9 +2384,7 @@ String SwNewDBMgr::LoadAndRegisterDataSource() return sFind; } -/* -----------------------------10.11.00 17:10-------------------------------- - ---------------------------------------------------------------------------*/ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, const Sequence<PropertyValue>& rProperties, sal_Bool bWithDataSourceBrowser) @@ -2521,7 +2410,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, if(!sDataSource.getLength() || !sDataTableOrQuery.getLength()) { - DBG_ERROR("PropertyValues missing or unset"); + OSL_ENSURE(false, "PropertyValues missing or unset"); return; } @@ -2533,7 +2422,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, pFound = FindDSConnection(sDataSource, sal_True); } SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); pImpl->pMergeDialog = pFact->CreateMailMergeDlg( DLG_MAILMERGE, &rSh.GetView().GetViewFrame()->GetWindow(), rSh, sDataSource, @@ -2541,7 +2430,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, nCmdType, xConnection, bWithDataSourceBrowser ? 0 : &aSelection); - DBG_ASSERT(pImpl->pMergeDialog, "Dialogdiet fail!"); + OSL_ENSURE(pImpl->pMergeDialog, "Dialogdiet fail!"); if(pImpl->pMergeDialog->Execute() == RET_OK) { aDescriptor[daSelection] <<= pImpl->pMergeDialog->GetSelection(); @@ -2590,7 +2479,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, { SfxViewFrame *pFrame = SfxViewFrame::LoadHiddenDocument( *xWorkDocSh, 0 ); SwView *pView = (SwView*) pFrame->GetViewShell(); - pView->AttrChangedNotify( &pView->GetWrtShell() );//Damit SelectShell gerufen wird. + pView->AttrChangedNotify( &pView->GetWrtShell() );// in order for SelectShell to be called //set the current DBMgr SwDoc* pWorkDoc = pView->GetWrtShell().GetDoc(); SwNewDBMgr* pWorkDBMgr = pWorkDoc->GetNewDBMgr(); @@ -2652,17 +2541,13 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, } DELETEZ(pImpl->pMergeDialog); } -/* -----------------------------13.11.00 08:20-------------------------------- - ---------------------------------------------------------------------------*/ void SwNewDBMgr::InsertText(SwWrtShell& rSh, const Sequence< PropertyValue>& rProperties) { rtl::OUString sDataSource, sDataTableOrQuery; uno::Reference<XResultSet> xResSet; Sequence<Any> aSelection; - sal_Bool bHasSelectionProperty = sal_False; - sal_Int32 nSelectionPos = 0; sal_Int16 nCmdType = CommandType::TABLE; const PropertyValue* pValues = rProperties.getConstArray(); uno::Reference< XConnection> xConnection; @@ -2675,11 +2560,7 @@ void SwNewDBMgr::InsertText(SwWrtShell& rSh, else if(pValues[nPos].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cCursor))) pValues[nPos].Value >>= xResSet; else if(pValues[nPos].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cSelection))) - { - bHasSelectionProperty = sal_True; - nSelectionPos = nPos; pValues[nPos].Value >>= aSelection; - } else if(pValues[nPos].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cCommandType))) pValues[nPos].Value >>= nCmdType; else if(pValues[nPos].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cActiveConnection))) @@ -2687,7 +2568,7 @@ void SwNewDBMgr::InsertText(SwWrtShell& rSh, } if(!sDataSource.getLength() || !sDataTableOrQuery.getLength() || !xResSet.is()) { - DBG_ERROR("PropertyValues missing or unset"); + OSL_ENSURE(false, "PropertyValues missing or unset"); return; } uno::Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); @@ -2704,14 +2585,14 @@ void SwNewDBMgr::InsertText(SwWrtShell& rSh, aDBData.nCommandType = nCmdType; SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSwInsertDBColAutoPilot* pDlg = pFact->CreateSwInsertDBColAutoPilot( rSh.GetView(), xSource, xColSupp, aDBData, DLG_AP_INSERT_DB_SEL ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if( RET_OK == pDlg->Execute() ) { rtl::OUString sDummy; @@ -2723,15 +2604,13 @@ void SwNewDBMgr::InsertText(SwWrtShell& rSh, } catch(Exception& ) { - DBG_ERROR("exception caught"); + OSL_ENSURE(false, "exception caught"); } } delete pDlg; } -/* -----------------------------30.08.2001 12:00------------------------------ - ---------------------------------------------------------------------------*/ SwDbtoolsClient* SwNewDBMgr::pDbtoolsClient = NULL; SwDbtoolsClient& SwNewDBMgr::GetDbtoolsClient() @@ -2740,17 +2619,13 @@ SwDbtoolsClient& SwNewDBMgr::GetDbtoolsClient() pDbtoolsClient = new SwDbtoolsClient; return *pDbtoolsClient; } -/* -----------------13.05.2003 15:34----------------- - --------------------------------------------------*/ void SwNewDBMgr::RemoveDbtoolsClient() { delete pDbtoolsClient; pDbtoolsClient = 0; } -/* -----------------------------20.08.2002 12:00------------------------------ - ---------------------------------------------------------------------------*/ uno::Reference<XDataSource> SwNewDBMgr::getDataSourceAsParent(const uno::Reference< XConnection>& _xConnection,const ::rtl::OUString& _sDataSourceName) { uno::Reference<XDataSource> xSource; @@ -2764,13 +2639,11 @@ uno::Reference<XDataSource> SwNewDBMgr::getDataSourceAsParent(const uno::Referen } catch(const Exception&) { - DBG_ERROR("exception in getDataSourceAsParent caught"); + OSL_ENSURE(false, "exception in getDataSourceAsParent caught"); } return xSource; } -/* -----------------------------20.08.2002 12:00------------------------------ - ---------------------------------------------------------------------------*/ uno::Reference<XResultSet> SwNewDBMgr::createCursor(const ::rtl::OUString& _sDataSourceName, const ::rtl::OUString& _sCommand, sal_Int32 _nCommandType, @@ -2806,15 +2679,13 @@ uno::Reference<XResultSet> SwNewDBMgr::createCursor(const ::rtl::OUString& _sDat } catch(const Exception&) { - DBG_ASSERT(0,"Caught exception while creating a new RowSet!"); + OSL_ENSURE(false,"Caught exception while creating a new RowSet!"); } return xResultSet; } -/*-- 13.05.2004 16:14:15--------------------------------------------------- - merge all data into one resulting document and return the number of - merged documents - -----------------------------------------------------------------------*/ + +// merge all data into one resulting document and return the number of merged documents sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, SwView& rSourceView ) { @@ -2848,7 +2719,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, { pImpl->pMergeData->bEndOfDB = sal_True; pImpl->pMergeData->CheckEndOfDB(); - DBG_ERROR("exception in MergeNew()"); + OSL_ENSURE(false, "exception in MergeNew()"); } //bCancel is set from the PrintMonitor @@ -2887,7 +2758,6 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, Window& rSourceWindow = rSourceView.GetViewFrame()->GetFrame().GetWindow(); rTargetWindow.SetPosPixel(rSourceWindow.GetPosPixel()); -// pTargetFrame->GetFrame().Appear(); SwView* pTargetView = static_cast<SwView*>( pTargetFrame->GetViewShell() ); rMMConfig.SetTargetView(pTargetView); //initiate SelectShell() to create sub shells @@ -2900,7 +2770,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, rMaster.GetFooter().IsActive(); - // #122799# copy compatibility options + // copy compatibility options lcl_CopyCompatibilityOptions( rSourceShell, *pTargetShell); // #72821# copy dynamic defaults lcl_CopyDynamicDefaults( *rSourceShell.GetDoc(), *pTargetShell->GetDoc() ); @@ -2942,7 +2812,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, //create a ViewFrame SwView* pWorkView = static_cast< SwView* >( SfxViewFrame::LoadHiddenDocument( *xWorkDocSh, 0 )->GetViewShell() ); SwWrtShell& rWorkShell = pWorkView->GetWrtShell(); - pWorkView->AttrChangedNotify( &rWorkShell );//Damit SelectShell gerufen wird. + pWorkView->AttrChangedNotify( &rWorkShell );// in order for SelectShell to be called // merge the data SwDoc* pWorkDoc = rWorkShell.GetDoc(); @@ -3014,7 +2884,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, pTargetShell->SetPageStyle(sModifiedStartingPageDesc); } sal_uInt16 nPageCountBefore = pTargetShell->GetPageCnt(); - DBG_ASSERT(!pTargetShell->GetTableFmt(),"target document ends with a table - paragraph should be appended"); + OSL_ENSURE(!pTargetShell->GetTableFmt(),"target document ends with a table - paragraph should be appended"); //#i51359# add a second paragraph in case there's only one { SwNodeIndex aIdx( pWorkDoc->GetNodes().GetEndOfExtras(), 2 ); @@ -3067,35 +2937,31 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, } pTargetShell->EnterStdMode(); pTargetShell->SttDoc(); - // + } catch( Exception& rEx) { (void)rEx; - DBG_ERROR("exception caught in SwNewDBMgr::MergeDocuments"); + OSL_ENSURE(false, "exception caught in SwNewDBMgr::MergeDocuments"); } DELETEZ(pImpl->pMergeData); bInMerge = sal_False; return nRet; } -/* -----------------09.12.2002 12:38----------------- - * - * --------------------------------------------------*/ + SwConnectionDisposedListener_Impl::SwConnectionDisposedListener_Impl(SwNewDBMgr& rMgr) : rDBMgr(rMgr) -{}; -/* -----------------09.12.2002 12:39----------------- - * - * --------------------------------------------------*/ +{ +}; + SwConnectionDisposedListener_Impl::~SwConnectionDisposedListener_Impl() -{}; -/* -----------------09.12.2002 12:39----------------- - * - * --------------------------------------------------*/ +{ +}; + void SwConnectionDisposedListener_Impl::disposing( const EventObject& rSource ) throw (RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + ::SolarMutexGuard aGuard; uno::Reference<XConnection> xSource(rSource.Source, UNO_QUERY); for(sal_uInt16 nPos = rDBMgr.aDataSourceParams.Count(); nPos; nPos--) { @@ -3107,3 +2973,5 @@ void SwConnectionDisposedListener_Impl::disposing( const EventObject& rSource ) } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.cxx b/sw/source/ui/dbui/dbtablepreviewdialog.cxx index 53b55be334..21e55ed51e 100644 --- a/sw/source/ui/dbui/dbtablepreviewdialog.cxx +++ b/sw/source/ui/dbui/dbtablepreviewdialog.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,9 +40,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/frame/XFrame.hpp> -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/unohlp.hxx> -#endif #include <dbui.hrc> #include <dbtablepreviewdialog.hrc> @@ -55,9 +54,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::util; using namespace ::rtl; -/*-- 08.04.2004 15:12:24--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwDBTablePreviewDialog::SwDBTablePreviewDialog(Window* pParent, uno::Sequence< beans::PropertyValue>& rValues ) : SfxModalDialog(pParent, SW_RES(DLG_MM_DBTABLEPREVIEWDIALOG)), #ifdef MSC @@ -74,7 +70,7 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(Window* pParent, uno::Sequence< b const beans::PropertyValue* pValues = rValues.getConstArray(); for(sal_Int32 nValue = 0; nValue < rValues.getLength(); ++nValue ) { - if(pValues[nValue].Name.equalsAscii("Command")) + if(pValues[nValue].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Command"))) { String sDescription = m_aDescriptionFI.GetText(); OUString sTemp; @@ -113,25 +109,9 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(Window* pParent, uno::Sequence< b xD->dispatch(aURL, rValues); m_pBeamerWIN->Show(); } -/* uno::Reference<???::XController> xController = m_xFrame->getController(); - pImpl->xFController = uno::Reference<???::XFormController>(xController, uno::UNO_QUERY); - if(pImpl->xFController.is()) - { - uno::Reference< awt::XControl > xCtrl = pImpl->xFController->getCurrentControl( ); - pImpl->xSelSupp = uno::Reference<???::XSelectionSupplier>(xCtrl, uno::UNO_QUERY); - if(pImpl->xSelSupp.is()) - { - pImpl->xChgLstnr = new SwXSelChgLstnr_Impl(*this); - pImpl->xSelSupp->addSelectionChangeListener( pImpl->xChgLstnr ); - } - } -*/ } - - + } } -/*-- 08.04.2004 15:12:24--------------------------------------------------- - -----------------------------------------------------------------------*/ SwDBTablePreviewDialog::~SwDBTablePreviewDialog() { if(m_xFrame.is()) @@ -142,3 +122,5 @@ SwDBTablePreviewDialog::~SwDBTablePreviewDialog() else delete m_pBeamerWIN; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.hxx b/sw/source/ui/dbui/dbtablepreviewdialog.hxx index e121c3f893..c100e377e3 100644 --- a/sw/source/ui/dbui/dbtablepreviewdialog.hxx +++ b/sw/source/ui/dbui/dbtablepreviewdialog.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #include <sfx2/basedlgs.hxx> #include <svtools/stdctrl.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <com/sun/star/uno/Sequence.h> namespace com{ namespace sun{ namespace star{ @@ -39,10 +38,6 @@ namespace com{ namespace sun{ namespace star{ namespace frame{ class XFrame; } }}} - -/*-- 08.04.2004 14:04:29--------------------------------------------------- - - -----------------------------------------------------------------------*/ class SwDBTablePreviewDialog : public SfxModalDialog { FixedInfo m_aDescriptionFI; @@ -58,3 +53,4 @@ public: }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx index 8e786e460c..3595e44fc5 100644 --- a/sw/source/ui/dbui/dbtree.cxx +++ b/sw/source/ui/dbui/dbtree.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -28,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -// INCLUDE --------------------------------------------------------------- - - #include <sot/formats.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/container/XNameAccess.hpp> @@ -48,24 +46,16 @@ #include <cppuhelper/implbase1.hxx> #include <svx/dbaexchange.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <swmodule.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> #include <dbtree.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _UTLUI_HRC #include <utlui.hrc> -#endif #include <unomid.h> @@ -79,9 +69,6 @@ using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::task; using namespace ::com::sun::star::beans; -/* -----------------------------17.07.01 13:10-------------------------------- - - ---------------------------------------------------------------------------*/ struct SwConnectionData { ::rtl::OUString sSourceName; @@ -91,9 +78,7 @@ struct SwConnectionData typedef SwConnectionData* SwConnectionDataPtr; SV_DECL_PTRARR_DEL( SwConnectionArr, SwConnectionDataPtr, 32, 32 ) SV_IMPL_PTRARR( SwConnectionArr, SwConnectionDataPtr ) -/* -----------------------------17.07.01 13:24-------------------------------- - ---------------------------------------------------------------------------*/ class SwDBTreeList_Impl : public cppu::WeakImplHelper1 < XContainerListener > { Reference< XNameAccess > xDBContext; @@ -113,12 +98,10 @@ class SwDBTreeList_Impl : public cppu::WeakImplHelper1 < XContainerListener > sal_Bool HasContext(); SwWrtShell* GetWrtShell() { return pWrtSh;} void SetWrtShell(SwWrtShell& rSh) { pWrtSh = &rSh;} - Reference< XNameAccess > GetContext() {return xDBContext;} + Reference< XNameAccess > GetContext() const {return xDBContext;} Reference<XConnection> GetConnection(const rtl::OUString& rSourceName); }; -/* -----------------------------17.07.01 13:24-------------------------------- - ---------------------------------------------------------------------------*/ SwDBTreeList_Impl::~SwDBTreeList_Impl() { Reference<XContainer> xContainer(xDBContext, UNO_QUERY); @@ -133,19 +116,15 @@ SwDBTreeList_Impl::~SwDBTreeList_Impl() m_refCount--; } } -/* -----------------------------17.07.01 13:24-------------------------------- - ---------------------------------------------------------------------------*/ void SwDBTreeList_Impl::elementInserted( const ContainerEvent& ) throw (RuntimeException) { // information not needed } -/* -----------------------------17.07.01 13:24-------------------------------- - ---------------------------------------------------------------------------*/ void SwDBTreeList_Impl::elementRemoved( const ContainerEvent& rEvent ) throw (RuntimeException) { - vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; ::rtl::OUString sSource; rEvent.Accessor >>= sSource; for(sal_uInt16 i = 0; i < aConnections.Count(); i++) @@ -153,32 +132,22 @@ void SwDBTreeList_Impl::elementRemoved( const ContainerEvent& rEvent ) throw (Ru SwConnectionDataPtr pPtr = aConnections[i]; if(pPtr->sSourceName == sSource) { -// SwConnectionDataPtr pPtr = aConnections[i]; -// Reference<XComponent> xComp(pPtr->xConnection, UNO_QUERY); -// if(xComp.is()) -// xComp->dispose(); aConnections.DeleteAndDestroy(i); break; } } } -/* -----------------------------17.07.01 13:24-------------------------------- - ---------------------------------------------------------------------------*/ void SwDBTreeList_Impl::disposing( const EventObject& ) throw (RuntimeException) { xDBContext = 0; } -/* -----------------------------17.07.01 13:24-------------------------------- - ---------------------------------------------------------------------------*/ void SwDBTreeList_Impl::elementReplaced( const ContainerEvent& rEvent ) throw (RuntimeException) { elementRemoved(rEvent); } -/* -----------------------------17.07.01 13:24-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwDBTreeList_Impl::HasContext() { if(!xDBContext.is()) @@ -193,13 +162,11 @@ sal_Bool SwDBTreeList_Impl::HasContext() if(xContainer.is()) xContainer->addContainerListener( this ); } - DBG_ASSERT(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available"); + OSL_ENSURE(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available"); } return xDBContext.is(); } -/* -----------------------------17.07.01 13:24-------------------------------- - ---------------------------------------------------------------------------*/ Reference<XConnection> SwDBTreeList_Impl::GetConnection(const rtl::OUString& rSourceName) { Reference<XConnection> xRet; @@ -221,16 +188,13 @@ Reference<XConnection> SwDBTreeList_Impl::GetConnection(const rtl::OUString& rS } return xRet; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ + SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId, SwWrtShell* pSh, const String& rDefDBName, const sal_Bool bShowCol): SvTreeListBox (pParent, rResId), aImageList (SW_RES(ILIST_DB_DLG )), - aImageListHC (SW_RES(ILIST_DB_DLG_HC )), sDefDBName (rDefDBName), bInitialized (sal_False), bShowColumns (bShowCol), @@ -242,31 +206,21 @@ SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId, InitTreeList(); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ SwDBTreeList::~SwDBTreeList() { delete pImpl; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - void SwDBTreeList::InitTreeList() { if(!pImpl->HasContext() && pImpl->GetWrtShell()) return; SetSelectionMode(SINGLE_SELECTION); SetStyle(GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); - // Font nicht setzen, damit der Font des Controls uebernommen wird! + // don't set font, so that the Control's font is being applied! SetSpaceBetweenEntries(0); SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE), - aImageList.GetImage(IMG_EXPAND ), BMP_COLOR_NORMAL ); - SetNodeBitmaps( aImageListHC.GetImage(IMG_COLLAPSE), - aImageListHC.GetImage(IMG_EXPAND ), BMP_COLOR_HIGHCONTRAST ); + aImageList.GetImage(IMG_EXPAND ) ); SetDragDropMode(SV_DRAGDROP_APP_COPY); @@ -277,37 +231,25 @@ void SwDBTreeList::InitTreeList() long nCount = aDBNames.getLength(); Image aImg = aImageList.GetImage(IMG_DB); - Image aHCImg = aImageListHC.GetImage(IMG_DB); for(long i = 0; i < nCount; i++) { String sDBName(pDBNames[i]); - SvLBoxEntry* pEntry = InsertEntry(sDBName, aImg, aImg, NULL, sal_True); - SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); - SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); + InsertEntry(sDBName, aImg, aImg, NULL, sal_True); } String sDBName(sDefDBName.GetToken(0, DB_DELIM)); String sTableName(sDefDBName.GetToken(1, DB_DELIM)); String sColumnName(sDefDBName.GetToken(2, DB_DELIM)); Select(sDBName, sTableName, sColumnName); - bInitialized = sal_True; } -/*-- 27.05.2004 09:19:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwDBTreeList::AddDataSource(const String& rSource) { Image aImg = aImageList.GetImage(IMG_DB); - Image aHCImg = aImageListHC.GetImage(IMG_DB); SvLBoxEntry* pEntry = InsertEntry(rSource, aImg, aImg, NULL, sal_True); - SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); - SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); SvTreeListBox::Select(pEntry); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ void SwDBTreeList::ShowColumns(sal_Bool bShowCol) { @@ -341,10 +283,6 @@ void SwDBTreeList::ShowColumns(sal_Bool bShowCol) } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent) { if (!pParent->HasChilds()) @@ -368,7 +306,7 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent) if(xTSupplier.is()) { Reference<XNameAccess> xTbls = xTSupplier->getTables(); - DBG_ASSERT(xTbls->hasByName(sTableName), "table not available anymore?"); + OSL_ENSURE(xTbls->hasByName(sTableName), "table not available anymore?"); try { Any aTable = xTbls->getByName(sTableName); @@ -386,7 +324,7 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent) if(xQSupplier.is()) { Reference<XNameAccess> xQueries = xQSupplier->getQueries(); - DBG_ASSERT(xQueries->hasByName(sTableName), "table not available anymore?"); + OSL_ENSURE(xQueries->hasByName(sTableName), "table not available anymore?"); try { Any aQuery = xQueries->getByName(sTableName); @@ -419,7 +357,7 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent) { } } - else // Tabellennamen + else // table names { try { @@ -438,15 +376,12 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent) long nCount = aTblNames.getLength(); const ::rtl::OUString* pTblNames = aTblNames.getConstArray(); Image aImg = aImageList.GetImage(IMG_DBTABLE); - Image aHCImg = aImageListHC.GetImage(IMG_DBTABLE); for (long i = 0; i < nCount; i++) { sTableName = pTblNames[i]; SvLBoxEntry* pTableEntry = InsertEntry(sTableName, aImg, aImg, pParent, bShowColumns); //to discriminate between queries and tables the user data of table entries is set pTableEntry->SetUserData((void*)0); - SetExpandedEntryBmp(pTableEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); - SetCollapsedEntryBmp(pTableEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); } } @@ -459,14 +394,11 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent) long nCount = aQueryNames.getLength(); const ::rtl::OUString* pQueryNames = aQueryNames.getConstArray(); Image aImg = aImageList.GetImage(IMG_DBQUERY); - Image aHCImg = aImageListHC.GetImage(IMG_DBQUERY); for (long i = 0; i < nCount; i++) { sQueryName = pQueryNames[i]; SvLBoxEntry* pQueryEntry = InsertEntry(sQueryName, aImg, aImg, pParent, bShowColumns); pQueryEntry->SetUserData((void*)1); - SetExpandedEntryBmp(pQueryEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); - SetCollapsedEntryBmp( pQueryEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); } } } @@ -478,24 +410,16 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent) } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK( SwDBTreeList, DBCompare, SvSortData*, pData ) { SvLBoxEntry* pRight = (SvLBoxEntry*)(pData->pRight ); if (GetParent(pRight) && GetParent(GetParent(pRight))) - return COMPARE_GREATER; // Spaltennamen nicht sortieren + return COMPARE_GREATER; // don't sort column names - return DefaultCompare(pData); // Sonst Basisklasse rufen + return DefaultCompare(pData); // otherwise call base class } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - String SwDBTreeList::GetDBName(String& rTableName, String& rColumnName, sal_Bool* pbIsTable) { String sDBName; @@ -506,7 +430,7 @@ String SwDBTreeList::GetDBName(String& rTableName, String& rColumnName, sal_Boo if (GetParent(GetParent(pEntry))) { rColumnName = GetEntryText(pEntry); - pEntry = GetParent(pEntry); // Spaltenname war selektiert + pEntry = GetParent(pEntry); // column name was selected } sDBName = GetEntryText(GetParent(pEntry)); if(pbIsTable) @@ -519,10 +443,8 @@ String SwDBTreeList::GetDBName(String& rTableName, String& rColumnName, sal_Boo } /*------------------------------------------------------------------------ - Beschreibung: Format: Datenbank.Tabelle + Description: Format: database.table ------------------------------------------------------------------------*/ - - void SwDBTreeList::Select(const String& rDBName, const String& rTableName, const String& rColumnName) { SvLBoxEntry* pParent; @@ -565,10 +487,6 @@ void SwDBTreeList::Select(const String& rDBName, const String& rTableName, const } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwDBTreeList::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ ) { String sTableName, sColumnName; @@ -579,7 +497,7 @@ void SwDBTreeList::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ ) STAR_REFERENCE( datatransfer::XTransferable ) xRef( pContainer ); if( sColumnName.Len() ) { - // Datenbankfeld draggen + // drag database field svx::OColumnTransferable aColTransfer( sDBName ,::rtl::OUString() @@ -604,19 +522,16 @@ void SwDBTreeList::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ ) } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ sal_Int8 SwDBTreeList::AcceptDrop( const AcceptDropEvent& /*rEvt*/ ) { return DND_ACTION_NONE; } -/*-- 07.10.2003 13:28:22--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwDBTreeList::SetWrtShell(SwWrtShell& rSh) +void SwDBTreeList::SetWrtShell(SwWrtShell& rSh) { pImpl->SetWrtShell(rSh); if (IsVisible() && !bInitialized) InitTreeList(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/dbui.cxx b/sw/source/ui/dbui/dbui.cxx index 79f3b62297..7c93fa1fd9 100644 --- a/sw/source/ui/dbui/dbui.cxx +++ b/sw/source/ui/dbui/dbui.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -28,25 +29,16 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -// INCLUDE --------------------------------------------------------------- - - -#include <tools/list.hxx> #include "wrtsh.hxx" - #include "dbui.hrc" #include "dbui.hxx" -/*--------------------------------------------------------------------- - Beschreibung: ----------------------------------------------------------------------*/ - PrintMonitor::PrintMonitor( Window *pParent, PrintMonitorType eType ) : ModelessDialog( pParent, SW_RES(DLG_PRINTMONITOR) ), aDocName (this, SW_RES( FT_DOCNAME )), - aPrinting (this, SW_RES( - eType == MONITOR_TYPE_MAIL ? + aPrinting (this, SW_RES( + eType == MONITOR_TYPE_MAIL ? FT_SENDING : eType == MONITOR_TYPE_SAVE ? FT_SAVING : FT_PRINTING )), aPrinter (this, SW_RES( FT_PRINTER )), aPrintInfo (this, SW_RES( FT_PRINTINFO )), @@ -60,21 +52,19 @@ PrintMonitor::PrintMonitor( Window *pParent, PrintMonitorType eType ) } FreeResource(); } -/*--------------------------------------------------------------------- - ----------------------------------------------------------------------*/ + void lcl_ResizeControl( Window* pWin, long nDiff ) { Size aSize( pWin->GetSizePixel() ); - aSize.Width() += nDiff; - pWin->SetSizePixel( aSize ); -} + aSize.Width() += nDiff; + pWin->SetSizePixel( aSize ); +} void lcl_RePosControl( Window* pWin, long nDiff ) { Point aPos( pWin->GetPosPixel() ); - aPos.X() += nDiff; - pWin->SetPosPixel( aPos ); -} + aPos.X() += nDiff; + pWin->SetPosPixel( aPos ); +} void PrintMonitor::ResizeControls() { @@ -88,24 +78,22 @@ void PrintMonitor::ResizeControls() long nDiff = nPrinterTextWidth - aPrinterSize.Width(); if( nDiff > 2 * aDlgSize.Width() ) { - aPrinter.SetStyle( WB_RIGHT | aPrinter.GetStyle() ); + aPrinter.SetStyle( WB_RIGHT | aPrinter.GetStyle() ); nDiff = 2 * aDlgSize.Width(); } aDlgSize.Width() += nDiff; SetSizePixel(aDlgSize); - lcl_ResizeControl( &aPrinter, nDiff ); + lcl_ResizeControl( &aPrinter, nDiff ); nDiff /= 2; - lcl_RePosControl( &aDocName, nDiff ); - lcl_RePosControl( &aPrinting, nDiff ); + lcl_RePosControl( &aDocName, nDiff ); + lcl_RePosControl( &aPrinting, nDiff ); lcl_RePosControl( &aPrintInfo, nDiff ); - lcl_RePosControl( &aCancel, nDiff ); + lcl_RePosControl( &aCancel, nDiff ); } } -/*--------------------------------------------------------------------- - Progress Indicator for Creation of personalized Mail Merge documents: ----------------------------------------------------------------------*/ +// Progress Indicator for Creation of personalized Mail Merge documents: CreateMonitor::CreateMonitor( Window *pParent ) : ModelessDialog( pParent, SW_RES(DLG_MM_CREATIONMONITOR) ), m_aStatus (this, SW_RES( FT_STATUS )), @@ -127,7 +115,7 @@ CreateMonitor::CreateMonitor( Window *pParent ) void CreateMonitor::UpdateCountingText() { - String sText(m_sCountingPattern); + String sText(m_sCountingPattern); sText.SearchAndReplaceAll( m_sVariable_Total, String::CreateFromInt32( m_nTotalCount ) ); sText.SearchAndReplaceAll( m_sVariable_Position, String::CreateFromInt32( m_nCurrentPosition ) ); m_aCounting.SetText(sText); @@ -149,3 +137,5 @@ void CreateMonitor::SetCancelHdl( const Link& rLink ) { m_aCancelButton.SetClickHdl( rLink ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/dbui.src b/sw/source/ui/dbui/dbui.src index 49ddd67948..b13e870604 100644 --- a/sw/source/ui/dbui/dbui.src +++ b/sw/source/ui/dbui/dbui.src @@ -26,9 +26,9 @@ ************************************************************************/ // #pragma ****************************************************************** - // #include ***************************************************************** #include "dbui.hrc" #include "helpid.h" + ModalDialog DLG_DBSELECTION { HelpID = "sw:ModalDialog:DLG_DBSELECTION"; diff --git a/sw/source/ui/dbui/maildispatcher.cxx b/sw/source/ui/dbui/maildispatcher.cxx index 354541e744..d2c9e28fbf 100644 --- a/sw/source/ui/dbui/maildispatcher.cxx +++ b/sw/source/ui/dbui/maildispatcher.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -102,7 +103,6 @@ namespace /* private */ }; } // namespace private - MailDispatcher::MailDispatcher(uno::Reference<mail::XSmtpService> mailserver) : mailserver_ (mailserver), @@ -285,12 +285,12 @@ void MailDispatcher::run() } } // end for SSH ALI } -/*-- 27.08.2004 12:04:46--------------------------------------------------- - -----------------------------------------------------------------------*/ void MailDispatcher::onTerminated() { //keep the reference until the end of onTerminated() because of the call order in the //_threadFunc() from osl/thread.hxx m_xSelfReference = 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mailmergechildwindow.cxx b/sw/source/ui/dbui/mailmergechildwindow.cxx index 6d110e1fe8..441373b525 100644 --- a/sw/source/ui/dbui/mailmergechildwindow.cxx +++ b/sw/source/ui/dbui/mailmergechildwindow.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,11 +58,6 @@ using namespace ::com::sun::star; SFX_IMPL_FLOATINGWINDOW( SwMailMergeChildWindow, FN_MAILMERGE_CHILDWINDOW ) -//SFX_IMPL_FLOATINGWINDOW( SwSendMailChildWindow, FN_MAILMERGE_SENDMAIL_CHILDWINDOW ) - -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ SwMailMergeChildWindow::SwMailMergeChildWindow( Window* _pParent, sal_uInt16 nId, @@ -89,10 +85,6 @@ SwMailMergeChildWindow::SwMailMergeChildWindow( Window* _pParent, pWindow->Show(); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwMailMergeChildWin::SwMailMergeChildWin( SfxBindings* _pBindings, SfxChildWindow* pChild, Window *pParent) : @@ -100,8 +92,7 @@ SwMailMergeChildWin::SwMailMergeChildWin( SfxBindings* _pBindings, m_aBackTB(this, SW_RES( TB_BACK )) { m_aBackTB.SetSelectHdl(LINK(this, SwMailMergeChildWin, BackHdl)); - sal_uInt16 nIResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? - ILIST_TBX_HC : ILIST_TBX; + sal_uInt16 nIResId = ILIST_TBX; ResId aResId( nIResId, *pSwResMgr ); ImageList aIList(aResId); FreeResource(); @@ -114,36 +105,23 @@ SwMailMergeChildWin::SwMailMergeChildWin( SfxBindings* _pBindings, m_aBackTB.Show(); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwMailMergeChildWin::~SwMailMergeChildWin() { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwMailMergeChildWin, BackHdl, ToolBox *, EMPTYARG ) { GetBindings().GetDispatcher()->Execute(FN_MAILMERGE_WIZARD, SFX_CALLMODE_ASYNCHRON); return 0; } -/*-- 26.05.2004 10:12:44--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwMailMergeChildWin::FillInfo(SfxChildWinInfo& rInfo) const { SfxFloatingWindow::FillInfo(rInfo); rInfo.aWinState.Erase(); rInfo.bVisible = sal_False; } -/*-- 21.05.2004 14:07:37--------------------------------------------------- - -----------------------------------------------------------------------*/ struct SwSendMailDialog_Impl { friend class SwSendMailDialog; @@ -190,9 +168,6 @@ const SwMailDescriptor* SwSendMailDialog_Impl::GetNextDescriptor() return 0; } -/*-- 23.06.2004 10:19:55--------------------------------------------------- - - -----------------------------------------------------------------------*/ class SwMailDispatcherListener_Impl : public IMailDispatcherListener { SwSendMailDialog* m_pSendMailDialog; @@ -212,66 +187,49 @@ public: static void DeleteAttachments( uno::Reference< mail::XMailMessage >& xMessage ); }; -/*-- 23.06.2004 10:04:48--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwMailDispatcherListener_Impl::SwMailDispatcherListener_Impl(SwSendMailDialog& rParentDlg) : m_pSendMailDialog(&rParentDlg) { } -/*-- 23.06.2004 10:04:48--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailDispatcherListener_Impl::~SwMailDispatcherListener_Impl() { } -/*-- 23.06.2004 10:04:49--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailDispatcherListener_Impl::started(::rtl::Reference<MailDispatcher> /*xMailDispatcher*/) { } -/*-- 23.06.2004 10:04:49--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailDispatcherListener_Impl::stopped( ::rtl::Reference<MailDispatcher> /*xMailDispatcher*/) { } -/*-- 23.06.2004 10:04:49--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailDispatcherListener_Impl::idle(::rtl::Reference<MailDispatcher> /*xMailDispatcher*/) { - vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; m_pSendMailDialog->AllMailsSent(); } -/*-- 23.06.2004 10:04:50--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailDispatcherListener_Impl::mailDelivered( ::rtl::Reference<MailDispatcher> /*xMailDispatcher*/, uno::Reference< mail::XMailMessage> xMailMessage) { - vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; m_pSendMailDialog->DocumentSent( xMailMessage, true, 0 ); DeleteAttachments( xMailMessage ); } -/*-- 23.06.2004 10:04:51--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailDispatcherListener_Impl::mailDeliveryError( ::rtl::Reference<MailDispatcher> /*xMailDispatcher*/, uno::Reference< mail::XMailMessage> xMailMessage, const rtl::OUString& sErrorMessage) { - vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; m_pSendMailDialog->DocumentSent( xMailMessage, false, &sErrorMessage ); DeleteAttachments( xMailMessage ); } -/*-- 23.06.2004 12:30:39--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMailMessage >& xMessage ) { uno::Sequence< mail::MailAttachment > aAttachments = xMessage->getAttachments(); @@ -284,7 +242,7 @@ void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMa if( xTransferableProperties.is() ) { ::rtl::OUString sURL; - xTransferableProperties->getPropertyValue( ::rtl::OUString::createFromAscii("URL") ) >>= sURL; + xTransferableProperties->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")) ) >>= sURL; if(sURL.getLength()) SWUnoHelper::UCB_DeleteFile( sURL ); } @@ -295,9 +253,7 @@ void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMa } } } -/*-- 07.07.2004 13:45:51--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwSendWarningBox_Impl : public ModalDialog { FixedImage aWarningImageIM; @@ -311,9 +267,7 @@ public: SwSendWarningBox_Impl(Window* pParent, const String& rDetails); ~SwSendWarningBox_Impl(); }; -/*-- 07.07.2004 13:52:41--------------------------------------------------- - -----------------------------------------------------------------------*/ SwSendWarningBox_Impl::SwSendWarningBox_Impl(Window* pParent, const String& rDetails) : ModalDialog(pParent, SW_RES( DLG_MM_SENDWARNING )), aWarningImageIM(this, SW_RES( IM_WARNING )), @@ -327,16 +281,11 @@ SwSendWarningBox_Impl::SwSendWarningBox_Impl(Window* pParent, const String& rDet aWarningImageIM.SetImage(WarningBox::GetStandardImage()); aDetailED.SetText(rDetails); } -/*-- 07.07.2004 13:52:41--------------------------------------------------- - -----------------------------------------------------------------------*/ SwSendWarningBox_Impl::~SwSendWarningBox_Impl() { } -/*-- 21.05.2004 14:10:39--------------------------------------------------- - - -----------------------------------------------------------------------*/ #define ITEMID_TASK 1 #define ITEMID_STATUS 2 @@ -375,7 +324,6 @@ SwSendMailDialog::SwSendMailDialog(Window *pParent, SwMailMergeConfigItem& rConf m_bCancel(false), m_bDesctructionEnabled(false), m_aImageList( SW_RES( ILIST ) ), - m_aImageListHC( SW_RES( ILIST_HC ) ), m_pImpl(new SwSendMailDialog_Impl), m_pConfigItem(&rConfigItem), m_nSendCount(0), @@ -426,9 +374,7 @@ SwSendMailDialog::SwSendMailDialog(Window *pParent, SwMailMergeConfigItem& rConf DetailsHdl_Impl( &m_aDetailsPB ); UpdateTransferStatus(); } -/*-- 21.05.2004 14:10:39--------------------------------------------------- - -----------------------------------------------------------------------*/ SwSendMailDialog::~SwSendMailDialog() { if(m_pImpl->xMailDispatcher.is()) @@ -456,9 +402,7 @@ SwSendMailDialog::~SwSendMailDialog() } delete m_pImpl; } -/*-- 21.05.2004 14:10:40--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSendMailDialog::AddDocument( SwMailDescriptor& rDesc ) { ::osl::MutexGuard aGuard(m_pImpl->aDescriptorMutex); @@ -470,26 +414,20 @@ void SwSendMailDialog::AddDocument( SwMailDescriptor& rDesc ) } } -/*-- 31.01.2005 08:59:35--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSendMailDialog::SetDocumentCount( sal_Int32 nAllDocuments ) { m_pImpl->nDocumentCount = nAllDocuments; UpdateTransferStatus(); } -/*-- 21.05.2004 14:10:40--------------------------------------------------- - -----------------------------------------------------------------------*/ void lcl_Move(Control& rCtrl, long nYOffset) { Point aPos(rCtrl.GetPosPixel()); aPos.Y() += nYOffset; rCtrl.SetPosPixel(aPos); } -/*-- 21.05.2004 14:10:40--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwSendMailDialog, DetailsHdl_Impl, PushButton*, EMPTYARG ) { long nMove = 0; @@ -514,9 +452,7 @@ IMPL_LINK( SwSendMailDialog, DetailsHdl_Impl, PushButton*, EMPTYARG ) return 0; } -/*-- 21.05.2004 14:10:40--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwSendMailDialog, StopHdl_Impl, PushButton*, pButton ) { m_bCancel = true; @@ -537,25 +473,19 @@ IMPL_LINK( SwSendMailDialog, StopHdl_Impl, PushButton*, pButton ) } return 0; } -/*-- 21.05.2004 14:10:40--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwSendMailDialog, CloseHdl_Impl, PushButton*, EMPTYARG ) { ModelessDialog::Show( sal_False ); return 0; } -/*-- 14.06.2004 09:48:30--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_STATIC_LINK_NOINSTANCE( SwSendMailDialog, StartSendMails, SwSendMailDialog*, pDialog ) { pDialog->SendMails(); return 0; } -/*-- 14.06.2004 09:48:30--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_STATIC_LINK( SwSendMailDialog, RemoveThis, Timer*, pTimer ) { if( pThis->m_pImpl->xMailDispatcher.is() ) @@ -578,9 +508,7 @@ IMPL_STATIC_LINK( SwSendMailDialog, RemoveThis, Timer*, pTimer ) } return 0; } -/*-- 07.07.2004 14:34:05--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_STATIC_LINK_NOINSTANCE( SwSendMailDialog, StopSendMails, SwSendMailDialog*, pDialog ) { if(pDialog->m_pImpl->xMailDispatcher.is() && @@ -592,14 +520,12 @@ IMPL_STATIC_LINK_NOINSTANCE( SwSendMailDialog, StopSendMails, SwSendMailDialog*, } return 0; } -/*-- 14.06.2004 10:38:04--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSendMailDialog::SendMails() { if(!m_pConfigItem) { - DBG_ERROR("config item not set"); + OSL_ENSURE(false, "config item not set"); return; } String sErrorMessage; @@ -614,7 +540,7 @@ void SwSendMailDialog::SendMails() LeaveWait(); if(!bIsLoggedIn) { - DBG_ERROR("create error message"); + OSL_ENSURE(false, "create error message"); return; } m_pImpl->xMailDispatcher.set( new MailDispatcher(xSmtpServer)); @@ -626,9 +552,7 @@ void SwSendMailDialog::SendMails() m_pImpl->xMailDispatcher->start(); } } -/* -----------------28.01.2005 10:17----------------- - --------------------------------------------------*/ void SwSendMailDialog::IterateMails() { const SwMailDescriptor* pCurrentMailDescriptor = m_pImpl->GetNextDescriptor(); @@ -636,9 +560,7 @@ void SwSendMailDialog::IterateMails() { if(!SwMailMergeHelper::CheckMailAddress( pCurrentMailDescriptor->sEMail )) { - ImageList& rImgLst = GetSettings().GetStyleSettings().GetHighContrastMode() ? - m_aImageListHC : m_aImageList; - Image aInsertImg = rImgLst.GetImage( FN_FORMULA_CANCEL ); + Image aInsertImg = m_aImageList.GetImage( FN_FORMULA_CANCEL ); String sMessage = m_sSendingTo; String sTmp(pCurrentMailDescriptor->sEMail); @@ -652,8 +574,8 @@ void SwSendMailDialog::IterateMails() pCurrentMailDescriptor = m_pImpl->GetNextDescriptor(); continue; } - SwMailMessage* pMessage = 0; - uno::Reference< mail::XMailMessage > xMessage = pMessage = new SwMailMessage; + SwMailMessage* pMessage = new SwMailMessage; + uno::Reference< mail::XMailMessage > xMessage = pMessage; if(m_pConfigItem->IsMailReplyTo()) pMessage->setReplyToAddress(m_pConfigItem->GetMailReplyTo()); pMessage->addRecipient( pCurrentMailDescriptor->sEMail ); @@ -707,18 +629,14 @@ void SwSendMailDialog::IterateMails() } UpdateTransferStatus(); } -/*-- 27.08.2004 10:50:17--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSendMailDialog::ShowDialog() { Application::PostUserEvent( STATIC_LINK( this, SwSendMailDialog, StartSendMails ), this ); ModelessDialog::Show(); } -/*-- 27.08.2004 10:50:17--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSendMailDialog::StateChanged( StateChangedType nStateChange ) { ModelessDialog::StateChanged( nStateChange ); @@ -730,9 +648,6 @@ void SwSendMailDialog::StateChanged( StateChangedType nStateChange ) } } -/*-- 23.06.2004 10:14:22--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> xMessage, bool bResult, const ::rtl::OUString* pError ) @@ -744,9 +659,7 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> xMessag Application::PostUserEvent( STATIC_LINK( this, SwSendMailDialog, StopSendMails ), this ); } - ImageList& rImgLst = GetSettings().GetStyleSettings().GetHighContrastMode() ? - m_aImageListHC : m_aImageList; - Image aInsertImg = rImgLst.GetImage( bResult ? FN_FORMULA_APPLY : FN_FORMULA_CANCEL ); + Image aInsertImg = m_aImageList.GetImage( bResult ? FN_FORMULA_APPLY : FN_FORMULA_CANCEL ); String sMessage = m_sSendingTo; String sTmp(xMessage->getRecipients()[0]); @@ -766,9 +679,7 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> xMessag delete pDlg; } } -/*-- 23.06.2004 11:25:31--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSendMailDialog::UpdateTransferStatus() { String sStatus( m_sTransferStatus ); @@ -785,12 +696,11 @@ void SwSendMailDialog::UpdateTransferStatus() else m_aProgressBar.SetValue(0); } -/*-- 23.06.2004 11:18:50--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSendMailDialog::AllMailsSent() { m_aStopPB.Enable(sal_False); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mailmergechildwindow.hrc b/sw/source/ui/dbui/mailmergechildwindow.hrc index edba002b0d..63adcc65b1 100644 --- a/sw/source/ui/dbui/mailmergechildwindow.hrc +++ b/sw/source/ui/dbui/mailmergechildwindow.hrc @@ -27,7 +27,6 @@ #define TB_BACK 1 #define ILIST_TBX 90 -#define ILIST_TBX_HC 91 #define FL_SEPARATOR 7 @@ -47,7 +46,6 @@ #define ST_TASK 73 #define ST_STATUS 74 #define ILIST 75 -#define ILIST_HC 76 #define ST_SEND 77 #define ST_SENDINGTO 78 #define ST_COMPLETED 79 diff --git a/sw/source/ui/dbui/mailmergechildwindow.src b/sw/source/ui/dbui/mailmergechildwindow.src index 9e8253c917..0ca098fad1 100644 --- a/sw/source/ui/dbui/mailmergechildwindow.src +++ b/sw/source/ui/dbui/mailmergechildwindow.src @@ -76,13 +76,6 @@ FloatingWindow DLG_MAILMERGECHILD\ MaskColor = IMAGE_MASK_COLOR; IMGLIST1_IDS; }; - - ImageList ILIST_TBX_HC - { - Prefix = "sch"; - MaskColor = IMAGE_MASK_COLOR ; - IMGLIST1_IDS; - }; }; //FloatingWindow DLG_MM_SENDMAILS @@ -196,13 +189,6 @@ ModelessDialog /*ModalDialog*/ DLG_MM_SENDMAILS MaskColor = IMAGE_MASK_COLOR; IMGLIST2_IDS; }; - - ImageList ILIST_HC - { - Prefix = "sch"; - MaskColor = IMAGE_MASK_COLOR ; - IMGLIST2_IDS; - }; String ST_TASK { Text[ en-US ] = "Task"; diff --git a/sw/source/ui/dbui/mailmergehelper.cxx b/sw/source/ui/dbui/mailmergehelper.cxx index cb779e85d2..b2b75f3331 100644 --- a/sw/source/ui/dbui/mailmergehelper.cxx +++ b/sw/source/ui/dbui/mailmergehelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include <mailmergehelper.hxx> #include <svtools/stdctrl.hxx> #include <mmconfigitem.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <sfx2/filedlghelper.hxx> #include <sfx2/docfile.hxx> #include <sfx2/app.hxx> @@ -47,9 +46,7 @@ #include "com/sun/star/mail/XSmtpService.hpp" #include <comphelper/processfactory.hxx> #include <vcl/msgbox.hxx> -#ifndef _PASSWD_HXX #include <sfx2/passwd.hxx> -#endif #include <dbui.hrc> @@ -62,14 +59,9 @@ using namespace ::com::sun::star::sdbcx; using rtl::OUString; -//using ::rtl::OUString; - namespace SwMailMergeHelper { -/*-- 14.06.2004 12:29:19--------------------------------------------------- - - -----------------------------------------------------------------------*/ String CallSaveAsDialog(String& rFilter) { ErrCode nRet; @@ -88,11 +80,12 @@ String CallSaveAsDialog(String& rFilter) } return sRet; } -/*-- 20.08.2004 09:39:18--------------------------------------------------- + +/* simple address check: check for '@' for at least one '.' after the '@' and for at least to characters before and after the dot - -----------------------------------------------------------------------*/ +*/ bool CheckMailAddress( const ::rtl::OUString& rMailAddress ) { String sAddress(rMailAddress); @@ -106,9 +99,6 @@ bool CheckMailAddress( const ::rtl::OUString& rMailAddress ) return true; } -/*-- 28.12.2004 10:16:02--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Reference< mail::XSmtpService > ConnectToSmtpServer( SwMailMergeConfigItem& rConfigItem, uno::Reference< mail::XMailService >& rxInMailService, @@ -152,7 +142,7 @@ uno::Reference< mail::XSmtpService > ConnectToSmtpServer( new SwConnectionContext( rConfigItem.GetInServerName(), rConfigItem.GetInServerPort(), - ::rtl::OUString::createFromAscii( "Insecure" )); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Insecure"))); xInMailService->connect(xConnectionContext, xAuthenticator); rxInMailService = xInMailService; } @@ -179,13 +169,13 @@ uno::Reference< mail::XSmtpService > ConnectToSmtpServer( new SwConnectionContext( rConfigItem.GetMailServer(), rConfigItem.GetMailPort(), - ::rtl::OUString::createFromAscii( rConfigItem.IsSecureConnection() ? "Ssl" : "Insecure")); + rConfigItem.IsSecureConnection() ? OUString(RTL_CONSTASCII_USTRINGPARAM("Ssl")) : OUString(RTL_CONSTASCII_USTRINGPARAM("Insecure")) ); xSmtpServer->connect(xConnectionContext, xAuthenticator); rxInMailService = uno::Reference< mail::XMailService >( xSmtpServer, uno::UNO_QUERY ); } catch(uno::Exception& ) { - DBG_ERROR("exception caught"); + OSL_ENSURE(false, "exception caught"); } return xSmtpServer; } @@ -193,9 +183,6 @@ uno::Reference< mail::XSmtpService > ConnectToSmtpServer( } //namespace -/*-- 06.04.2004 10:31:27--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwBoldFixedInfo::SwBoldFixedInfo(Window* pParent, const ResId& rResId) : FixedInfo(pParent, rResId) { @@ -203,12 +190,11 @@ SwBoldFixedInfo::SwBoldFixedInfo(Window* pParent, const ResId& rResId) : aFont.SetWeight( WEIGHT_BOLD ); SetFont( aFont ); } -/*-- 06.04.2004 10:31:27--------------------------------------------------- - -----------------------------------------------------------------------*/ SwBoldFixedInfo::~SwBoldFixedInfo() { } + struct SwAddressPreview_Impl { ::std::vector< ::rtl::OUString > aAdresses; @@ -225,9 +211,7 @@ struct SwAddressPreview_Impl { } }; -/*-- 27.04.2004 14:01:22--------------------------------------------------- - -----------------------------------------------------------------------*/ SwAddressPreview::SwAddressPreview(Window* pParent, const ResId rResId) : Window( pParent, rResId ), aVScrollBar(this, WB_VSCROLL), @@ -242,31 +226,23 @@ SwAddressPreview::SwAddressPreview(Window* pParent, const ResId rResId) : aVScrollBar.SetPosPixel(aSrollPos); Show(); } -/*-- 27.04.2004 14:01:22--------------------------------------------------- - -----------------------------------------------------------------------*/ SwAddressPreview::~SwAddressPreview() { } -/*-- 25.06.2004 11:50:55--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwAddressPreview, ScrollHdl, ScrollBar*, EMPTYARG) { Invalidate(); return 0; } -/*-- 27.04.2004 14:01:22--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressPreview::AddAddress(const ::rtl::OUString& rAddress) { pImpl->aAdresses.push_back(rAddress); UpdateScrollBar(); } -/*-- 27.04.2004 14:01:23--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressPreview::SetAddress(const ::rtl::OUString& rAddress) { pImpl->aAdresses.clear(); @@ -274,20 +250,16 @@ void SwAddressPreview::SetAddress(const ::rtl::OUString& rAddress) aVScrollBar.Show(sal_False); Invalidate(); } -/*-- 27.04.2004 14:01:23--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_uInt16 SwAddressPreview::GetSelectedAddress()const { - DBG_ASSERT(pImpl->nSelectedAddress < pImpl->aAdresses.size(), "selection invalid"); + OSL_ENSURE(pImpl->nSelectedAddress < pImpl->aAdresses.size(), "selection invalid"); return pImpl->nSelectedAddress; } -/*-- 25.06.2004 10:32:48--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressPreview::SelectAddress(sal_uInt16 nSelect) { - DBG_ASSERT(pImpl->nSelectedAddress < pImpl->aAdresses.size(), "selection invalid"); + OSL_ENSURE(pImpl->nSelectedAddress < pImpl->aAdresses.size(), "selection invalid"); pImpl->nSelectedAddress = nSelect; // now make it visible.. sal_uInt16 nSelectRow = nSelect / pImpl->nColumns; @@ -295,26 +267,20 @@ void SwAddressPreview::SelectAddress(sal_uInt16 nSelect) if( (nSelectRow < nStartRow) || (nSelectRow >= (nStartRow + pImpl->nRows) )) aVScrollBar.SetThumbPos( nSelectRow ); } -/*-- 25.06.2004 11:00:40--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressPreview::Clear() { pImpl->aAdresses.clear(); pImpl->nSelectedAddress = 0; UpdateScrollBar(); } -/*-- 28.04.2004 12:05:50--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressPreview::ReplaceSelectedAddress(const ::rtl::OUString& rNew) { pImpl->aAdresses[pImpl->nSelectedAddress] = rNew; Invalidate(); } -/*-- 25.06.2004 11:30:41--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressPreview::RemoveSelectedAddress() { pImpl->aAdresses.erase(pImpl->aAdresses.begin() + pImpl->nSelectedAddress); @@ -323,25 +289,19 @@ void SwAddressPreview::RemoveSelectedAddress() UpdateScrollBar(); Invalidate(); } -/*-- 27.04.2004 14:01:23--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressPreview::SetLayout(sal_uInt16 nRows, sal_uInt16 nColumns) { pImpl->nRows = nRows; pImpl->nColumns = nColumns; UpdateScrollBar(); } -/*-- 25.06.2004 13:54:03--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressPreview::EnableScrollBar(bool bEnable) { pImpl->bEnableScrollBar = bEnable; } -/*-- 25.06.2004 11:55:52--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressPreview::UpdateScrollBar() { if(pImpl->nColumns) @@ -355,9 +315,7 @@ void SwAddressPreview::UpdateScrollBar() aVScrollBar.SetThumbPos(nResultingRows); } } -/*-- 27.04.2004 14:01:23--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressPreview::Paint(const Rectangle&) { const StyleSettings& rSettings = GetSettings().GetStyleSettings(); @@ -402,9 +360,6 @@ void SwAddressPreview::Paint(const Rectangle&) SetClipRegion(); } -/*-- 07.06.2004 15:44:15--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwAddressPreview::MouseButtonDown( const MouseEvent& rMEvt ) { Window::MouseButtonDown(rMEvt); @@ -431,9 +386,7 @@ void SwAddressPreview::MouseButtonDown( const MouseEvent& rMEvt ) Invalidate(); } } -/*-- 01.07.2004 12:33:59--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressPreview::KeyInput( const KeyEvent& rKEvt ) { sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode(); @@ -473,18 +426,14 @@ void SwAddressPreview::KeyInput( const KeyEvent& rKEvt ) else Window::KeyInput(rKEvt); } -/*-- 05.07.2004 12:02:28--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressPreview::StateChanged( StateChangedType nStateChange ) { if(nStateChange == STATE_CHANGE_ENABLE) Invalidate(); Window::StateChanged(nStateChange); } -/*-- 27.04.2004 14:01:23--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAddressPreview::DrawText_Impl( const ::rtl::OUString& rAddress, const Point& rTopLeft, const Size& rSize, bool bIsSelected) { @@ -507,9 +456,7 @@ void SwAddressPreview::DrawText_Impl( aStart.Y() += nHeight; } } -/*-- 29.04.2004 11:24:47--------------------------------------------------- - -----------------------------------------------------------------------*/ String SwAddressPreview::FillData( const ::rtl::OUString& rAddress, SwMailMergeConfigItem& rConfigItem, @@ -594,7 +541,7 @@ String SwAddressPreview::FillData( } catch( sdbc::SQLException& ) { - DBG_ERROR("SQLException caught"); + OSL_ENSURE(false, "SQLException caught"); } } } @@ -609,9 +556,6 @@ String SwAddressPreview::FillData( return sAddress; } -/*-- 11.05.2004 15:42:08--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwMergeAddressItem SwAddressIterator::Next() { //currently the string may either start with a '<' then it's a column @@ -623,7 +567,7 @@ SwMergeAddressItem SwAddressIterator::Next() { aRet.bIsColumn = true; xub_StrLen nClose = sAddress.Search('>'); - DBG_ASSERT(nClose != STRING_NOTFOUND, "closing '>' not found"); + OSL_ENSURE(nClose != STRING_NOTFOUND, "closing '>' not found"); if( nClose != STRING_NOTFOUND ) { aRet.sText = sAddress.Copy(1, nClose - 1); @@ -662,22 +606,16 @@ SwMergeAddressItem SwAddressIterator::Next() return aRet; } -/*-- 21.05.2004 10:36:20--------------------------------------------------- - -----------------------------------------------------------------------*/ SwAuthenticator::~SwAuthenticator() { } -/*-- 21.05.2004 10:36:20--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString SwAuthenticator::getUserName( ) throw (RuntimeException) { return m_aUserName; } -/*-- 21.05.2004 10:36:20--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString SwAuthenticator::getPassword( ) throw (RuntimeException) { if(m_aUserName.getLength() && !m_aPassword.getLength() && m_pParentWindow) @@ -690,9 +628,7 @@ OUString SwAuthenticator::getPassword( ) throw (RuntimeException) } return m_aPassword; } -/*-- 25.08.2004 12:53:03--------------------------------------------------- - -----------------------------------------------------------------------*/ SwConnectionContext::SwConnectionContext( const ::rtl::OUString& rMailServer, sal_Int16 nPort, const ::rtl::OUString& rConnectionType) : @@ -701,15 +637,11 @@ SwConnectionContext::SwConnectionContext( m_sConnectionType(rConnectionType) { } -/*-- 25.08.2004 12:53:03--------------------------------------------------- - -----------------------------------------------------------------------*/ SwConnectionContext::~SwConnectionContext() { } -/*-- 25.08.2004 12:53:03--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwConnectionContext::getValueByName( const ::rtl::OUString& rName ) throw (uno::RuntimeException) { @@ -722,51 +654,37 @@ uno::Any SwConnectionContext::getValueByName( const ::rtl::OUString& rName ) aRet <<= m_sConnectionType; return aRet; } -/*-- 21.05.2004 10:45:33--------------------------------------------------- - -----------------------------------------------------------------------*/ SwConnectionListener::~SwConnectionListener() { } -/*-- 21.05.2004 10:45:33--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwConnectionListener::connected(const lang::EventObject& /*aEvent*/) throw (uno::RuntimeException) { - //OSL_ENSURE(false, "Connection opened"); } -/*-- 21.05.2004 10:45:33--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwConnectionListener::disconnected(const lang::EventObject& /*aEvent*/) throw (uno::RuntimeException) { - //OSL_ENSURE(false, "Connection closed"); } -/*-- 21.05.2004 10:45:33--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwConnectionListener::disposing(const lang::EventObject& /*aEvent*/) throw(uno::RuntimeException) { } -/*-- 21.05.2004 10:17:22--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< uno::XComponentContext> getCurrentCmpCtx( uno::Reference<lang::XMultiServiceFactory> rSrvMgr) { uno::Reference< beans::XPropertySet > xPropSet = uno::Reference< beans::XPropertySet>(rSrvMgr, uno::UNO_QUERY); - Any aAny = xPropSet->getPropertyValue( ::rtl::OUString::createFromAscii("DefaultContext")); + Any aAny = xPropSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext"))); uno::Reference< uno::XComponentContext> rCmpCtx; aAny >>= rCmpCtx; return rCmpCtx; } -/*-- 13.07.2004 09:07:01--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailTransferable::SwMailTransferable(const rtl::OUString& rBody, const rtl::OUString& rMimeType) : cppu::WeakComponentImplHelper2< datatransfer::XTransferable, beans::XPropertySet >(m_aMutex), m_aMimeType( rMimeType ), @@ -774,9 +692,7 @@ SwMailTransferable::SwMailTransferable(const rtl::OUString& rBody, const rtl::OU m_bIsBody( true ) { } -/*-- 13.07.2004 09:07:01--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailTransferable::SwMailTransferable(const rtl::OUString& rURL, const rtl::OUString& rName, const rtl::OUString& rMimeType) : cppu::WeakComponentImplHelper2< datatransfer::XTransferable, beans::XPropertySet >(m_aMutex), @@ -786,15 +702,11 @@ SwMailTransferable::SwMailTransferable(const rtl::OUString& rURL, m_bIsBody( false ) { } -/*-- 13.07.2004 09:07:08--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailTransferable::~SwMailTransferable() { } -/*-- 13.07.2004 09:07:08--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwMailTransferable::getTransferData( const datatransfer::DataFlavor& /*aFlavor*/ ) throw (datatransfer::UnsupportedFlavorException, io::IOException, uno::RuntimeException) @@ -819,9 +731,7 @@ uno::Any SwMailTransferable::getTransferData( const datatransfer::DataFlavor& /* } return aRet; } -/*-- 13.07.2004 09:07:08--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< datatransfer::DataFlavor > SwMailTransferable::getTransferDataFlavors( ) throw (uno::RuntimeException) { @@ -838,70 +748,54 @@ uno::Sequence< datatransfer::DataFlavor > SwMailTransferable::getTransferDataFla } return aRet; } -/*-- 13.07.2004 09:07:08--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailTransferable::isDataFlavorSupported( const datatransfer::DataFlavor& aFlavor ) throw (uno::RuntimeException) { return (aFlavor.MimeType == ::rtl::OUString(m_aMimeType)); } -/*-- 28.04.2004 09:52:05--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwMailTransferable::getPropertySetInfo( ) throw(uno::RuntimeException) { return uno::Reference< beans::XPropertySetInfo >(); } -/*-- 28.04.2004 09:52:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailTransferable::setPropertyValue( const ::rtl::OUString& , const uno::Any& ) throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) { } -/*-- 28.04.2004 09:52:05--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwMailTransferable::getPropertyValue( const ::rtl::OUString& rPropertyName ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { uno::Any aRet; - if( rPropertyName.equalsAscii( "URL" ) ) + if( rPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URL"))) aRet <<= m_aURL; return aRet; } -/*-- 28.04.2004 09:52:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailTransferable::addPropertyChangeListener( const ::rtl::OUString&, const uno::Reference< beans::XPropertyChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { } -/*-- 28.04.2004 09:52:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailTransferable::removePropertyChangeListener( const ::rtl::OUString&, const uno::Reference< beans::XPropertyChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { } -/*-- 28.04.2004 09:52:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailTransferable::addVetoableChangeListener( const ::rtl::OUString&, const uno::Reference< beans::XVetoableChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { } -/*-- 28.04.2004 09:52:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailTransferable::removeVetoableChangeListener( const ::rtl::OUString& , const uno::Reference< beans::XVetoableChangeListener >& ) @@ -909,89 +803,64 @@ void SwMailTransferable::removeVetoableChangeListener( { } -/*-- 22.06.2004 16:46:05--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwMailMessage::SwMailMessage() : cppu::WeakComponentImplHelper1< mail::XMailMessage>(m_aMutex) { } -/*-- 22.06.2004 16:46:06--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMessage::~SwMailMessage() { } -/*-- 02.07.2007 16:00:07--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwMailMessage::getSenderName() throw (uno::RuntimeException) { return m_sSenderName; } -/*-- 22.06.2004 16:46:06--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwMailMessage::getSenderAddress() throw (uno::RuntimeException) { return m_sSenderAddress; } -/*-- 22.06.2004 16:46:06--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwMailMessage::getReplyToAddress() throw (uno::RuntimeException) { return m_sReplyToAddress; } -/*-- 22.06.2004 16:46:07--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMessage::setReplyToAddress( const ::rtl::OUString& _replytoaddress ) throw (uno::RuntimeException) { m_sReplyToAddress = _replytoaddress; } -/*-- 22.06.2004 16:46:07--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwMailMessage::getSubject() throw (uno::RuntimeException) { return m_sSubject; } -/*-- 22.06.2004 16:46:07--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMessage::setSubject( const ::rtl::OUString& _subject ) throw (uno::RuntimeException) { m_sSubject = _subject; } -/*-- 13.07.2004 09:57:18--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< datatransfer::XTransferable > SwMailMessage::getBody() throw (uno::RuntimeException) { return m_xBody; } -/*-- 13.07.2004 09:57:18--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMessage::setBody( const uno::Reference< datatransfer::XTransferable >& rBody ) throw (uno::RuntimeException) { m_xBody = rBody; } -/*-- 22.06.2004 16:46:08--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMessage::addRecipient( const ::rtl::OUString& rRecipientAddress ) throw (uno::RuntimeException) { m_aRecipients.realloc(m_aRecipients.getLength() + 1); m_aRecipients[m_aRecipients.getLength() - 1] = rRecipientAddress; } -/*-- 22.06.2004 16:46:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMessage::addCcRecipient( const ::rtl::OUString& rRecipientAddress ) throw (uno::RuntimeException) { @@ -999,49 +868,39 @@ void SwMailMessage::addCcRecipient( const ::rtl::OUString& rRecipientAddress ) m_aCcRecipients[m_aCcRecipients.getLength() - 1] = rRecipientAddress; } -/*-- 22.06.2004 16:46:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMessage::addBccRecipient( const ::rtl::OUString& rRecipientAddress ) throw (uno::RuntimeException) { m_aBccRecipients.realloc(m_aBccRecipients.getLength() + 1); m_aBccRecipients[m_aBccRecipients.getLength() - 1] = rRecipientAddress; } -/*-- 22.06.2004 16:46:09--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< ::rtl::OUString > SwMailMessage::getRecipients( ) throw (uno::RuntimeException) { return m_aRecipients; } -/*-- 22.06.2004 16:46:10--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< ::rtl::OUString > SwMailMessage::getCcRecipients( ) throw (uno::RuntimeException) { return m_aCcRecipients; } -/*-- 22.06.2004 16:46:10--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< ::rtl::OUString > SwMailMessage::getBccRecipients( ) throw (uno::RuntimeException) { return m_aBccRecipients; } -/*-- 13.07.2004 09:59:48--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMessage::addAttachment( const mail::MailAttachment& rMailAttachment ) throw (uno::RuntimeException) { m_aAttachments.realloc(m_aAttachments.getLength() + 1); m_aAttachments[m_aAttachments.getLength() - 1] = rMailAttachment; } -/*-- 13.07.2004 09:59:48--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< mail::MailAttachment > SwMailMessage::getAttachments( ) throw (uno::RuntimeException) { return m_aAttachments; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index 4a412991e0..816b66eca7 100644 --- a/sw/source/ui/dbui/mailmergewizard.cxx +++ b/sw/source/ui/dbui/mailmergewizard.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,27 +44,19 @@ #include <mmlayoutpage.hxx> #include <mmconfigitem.hxx> #include <swabstdlg.hxx> -#ifndef _DBUI_HRC #include <dbui.hrc> -#endif #include <view.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <sfx2/viewfrm.hxx> #include <wrtsh.hxx> -#include <sfx2/viewfrm.hxx> #include "vcl/msgbox.hxx" // RET_CANCEL #include <helpid.h> -#include <dbui.hrc> #include <mailmergewizard.hrc> using namespace svt; using namespace ::com::sun::star; -/*-- 01.04.2004 16:52:49--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem) : RoadmapWizard(&rView.GetViewFrame()->GetWindow(), SW_RES(DLG_MAILMERGEWIZARD), @@ -122,15 +115,11 @@ SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem ActivatePage(); UpdateRoadmap(); } -/*-- 01.04.2004 16:52:53--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeWizard::~SwMailMergeWizard() { } -/*-- 01.04.2004 16:52:53--------------------------------------------------- - -----------------------------------------------------------------------*/ OWizardPage* SwMailMergeWizard::createPage(WizardState _nState) { OWizardPage* pRet = 0; @@ -145,16 +134,15 @@ OWizardPage* SwMailMergeWizard::createPage(WizardState _nState) case MM_MERGEPAGE : pRet = new SwMailMergeMergePage(this); break; case MM_OUTPUTPAGE : pRet = new SwMailMergeOutputPage(this); break; } - DBG_ASSERT(pRet, "no page created in ::createPage"); + OSL_ENSURE(pRet, "no page created in ::createPage"); return pRet; } -/*-- 04.06.2004 13:18:47--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeWizard::enterState( WizardState _nState ) { ::svt::RoadmapWizard::enterState( _nState ); /* + entering a page after the layoutpage requires the insertion of greeting and address block - if not yet done entering the merge or output page requires to create the output document @@ -201,9 +189,7 @@ void SwMailMergeWizard::enterState( WizardState _nState ) UpdateRoadmap(); } -/*-- 04.06.2004 12:54:13--------------------------------------------------- - -----------------------------------------------------------------------*/ String SwMailMergeWizard::getStateDisplayName( WizardState _nState ) const { String sRet; @@ -224,7 +210,7 @@ String SwMailMergeWizard::getStateDisplayName( WizardState _nState ) const } return sRet; } -/*-- 24.06.2004 09:24:45--------------------------------------------------- +/*---------------------------------------------------------------------- enables/disables pages in the roadmap depending on the current page and state -----------------------------------------------------------------------*/ @@ -297,7 +283,7 @@ void SwMailMergeWizard::UpdateRoadmap() enableState( nPage, bEnable ); } } -/*-- 24.06.2004 09:24:45--------------------------------------------------- +/*-- -------------------------------------------------------------------- enables/disables pages in the roadmap depending on the current page and state -----------------------------------------------------------------------*/ @@ -309,28 +295,24 @@ void SwMailMergeWizard::CreateTargetDocument() if( m_rConfigItem.GetTargetView() ) m_rConfigItem.GetTargetView()->GetViewFrame()->GetFrame().Appear(); } -/*-- 23.08.2004 08:51:36--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeWizard::updateRoadmapItemLabel( WizardState _nState ) { svt::RoadmapWizard::updateRoadmapItemLabel( _nState ); } -// ------------------------------------------------------------------------ - short SwMailMergeWizard::Execute() { - DBG_ERROR( "SwMailMergeWizard cannot be executed via Dialog::Execute!\n" + OSL_ENSURE(false, "SwMailMergeWizard cannot be executed via Dialog::Execute!\n" "It creates a thread (MailDispatcher instance) that will call" "back to VCL apartment => deadlock!\n" "Use Dialog::StartExecuteModal to execute the dialog!" ); return RET_CANCEL; } -// ------------------------------------------------------------------------ - void SwMailMergeWizard::StartExecuteModal( const Link& rEndDialogHdl ) { ::svt::RoadmapWizard::StartExecuteModal( rEndDialogHdl ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index 617ad65ccb..c651d291e8 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,16 +55,13 @@ using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; -//------------------------------------------------------------------------- void lcl_Move(Control* pCtrl, long nYOffset) { Point aPos(pCtrl->GetPosPixel()); aPos.Y() += nYOffset; pCtrl->SetPosPixel(aPos); } -/*-- 02.04.2004 12:46:40--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeAddressBlockPage::SwMailMergeAddressBlockPage( SwMailMergeWizard* _pParent) : svt::OWizardPage(_pParent, SW_RES(DLG_MM_ADDRESSBLOCK_PAGE)), #ifdef MSC @@ -112,22 +110,16 @@ SwMailMergeAddressBlockPage::SwMailMergeAddressBlockPage( SwMailMergeWizard* _pP m_aPrevSetIB.SetClickHdl(aLink); m_aNextSetIB.SetClickHdl(aLink); } -/*-- 02.04.2004 12:46:40--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeAddressBlockPage::~SwMailMergeAddressBlockPage() { } -/*-- 05.07.2004 13:55:15--------------------------------------------------- - -----------------------------------------------------------------------*/ bool SwMailMergeAddressBlockPage::canAdvance() const { return m_pWizard->GetConfigItem().GetResultSet().is(); } -/*-- 16.06.2004 12:34:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeAddressBlockPage::ActivatePage() { SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); @@ -172,18 +164,14 @@ void SwMailMergeAddressBlockPage::ActivatePage() InsertDataHdl_Impl(0); } } -/*-- 27.05.2004 13:59:15--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeAddressBlockPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { if ( ::svt::WizardTypes::eTravelForward == _eReason && !m_pWizard->GetConfigItem().GetResultSet().is() ) return sal_False; return sal_True; } -/*-- 07.04.2004 16:19:30--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeAddressBlockPage, AddressListHdl_Impl, PushButton*, EMPTYARG) { SwAddressListDialog* pAddrDialog = new SwAddressListDialog(this); @@ -204,9 +192,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, AddressListHdl_Impl, PushButton*, EMPTYAR delete pAddrDialog; return 0; } -/*-- 07.04.2004 16:19:30--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeAddressBlockPage, SettingsHdl_Impl, PushButton*, pButton) { SwSelectAddressBlockDialog* pDlg = @@ -233,9 +219,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, SettingsHdl_Impl, PushButton*, pButton) GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); return 0; } -/*-- 07.04.2004 16:19:31--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeAddressBlockPage, AssignHdl_Impl, PushButton*, pButton) { SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); @@ -253,9 +237,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, AssignHdl_Impl, PushButton*, pButton) delete pDlg; return 0; } -/*-- 11.06.2004 13:37:22--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeAddressBlockPage::EnableAddressBlock(sal_Bool bAll, sal_Bool bSelective) { m_aSettingsFI.Enable(bAll); @@ -273,9 +255,7 @@ void SwMailMergeAddressBlockPage::EnableAddressBlock(sal_Bool bAll, sal_Bool bSe m_aPrevSetIB.Enable(bSelective); m_aNextSetIB.Enable(bSelective); } -/*-- 28.04.2004 12:45:58--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeAddressBlockPage, AddressBlockHdl_Impl, CheckBox*, pBox) { EnableAddressBlock(pBox->IsEnabled(), pBox->IsChecked()); @@ -284,9 +264,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, AddressBlockHdl_Impl, CheckBox*, pBox) m_pWizard->UpdateRoadmap(); return 0; } -/*-- 08.06.2004 13:00:29--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeAddressBlockPage, AddressBlockSelectHdl_Impl, SwAddressPreview*, EMPTYARG) { sal_uInt16 nSel = m_aSettingsWIN.GetSelectedAddress(); @@ -299,9 +277,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, AddressBlockSelectHdl_Impl, SwAddressPrev GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); return 0; } -/*-- 31.08.2005 15:34:55--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeAddressBlockPage, HideParagraphsHdl_Impl, CheckBox*, pBox) { SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); @@ -309,7 +285,6 @@ IMPL_LINK(SwMailMergeAddressBlockPage, HideParagraphsHdl_Impl, CheckBox*, pBox) return 0; } -// ------------------------------------------------------------------------------ IMPL_LINK(SwMailMergeAddressBlockPage, InsertDataHdl_Impl, ImageButton*, pButton) { //if no pButton is given, the first set has to be pre-set @@ -347,8 +322,6 @@ IMPL_LINK(SwMailMergeAddressBlockPage, InsertDataHdl_Impl, ImageButton*, pButton } } m_aPrevSetIB.Enable(bEnable); - //m_aNextSetIB.Enable(bEnable); - //m_aDocumentIndexFI.Enable(bEnable); String sTemp(m_sDocument); sTemp.SearchAndReplaceAscii("%1", String::CreateFromInt32(nPos)); m_aDocumentIndexFI.SetText(sTemp); @@ -366,9 +339,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, InsertDataHdl_Impl, ImageButton*, pButton EnableAddressBlock(bHasResultSet, m_aAddressCB.IsChecked()); return 0; } -/*-- 13.04.2004 16:01:26--------------------------------------------------- - -----------------------------------------------------------------------*/ SwSelectAddressBlockDialog::SwSelectAddressBlockDialog( Window* pParent, SwMailMergeConfigItem& rConfig) : SfxModalDialog(pParent, SW_RES(DLG_MM_SELECTADDRESSBLOCK)), @@ -409,15 +380,11 @@ SwSelectAddressBlockDialog::SwSelectAddressBlockDialog( m_aPreview.SetLayout(2, 2); m_aPreview.EnableScrollBar(); } -/*-- 13.04.2004 16:01:27--------------------------------------------------- - -----------------------------------------------------------------------*/ SwSelectAddressBlockDialog::~SwSelectAddressBlockDialog() { } -/*-- 28.04.2004 11:48:11--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSelectAddressBlockDialog::SetAddressBlocks(const uno::Sequence< ::rtl::OUString>& rBlocks, sal_uInt16 nSelectedAddress) { @@ -426,9 +393,8 @@ void SwSelectAddressBlockDialog::SetAddressBlocks(const uno::Sequence< ::rtl::OU m_aPreview.AddAddress(m_aAddressBlocks[nAddress]); m_aPreview.SelectAddress(nSelectedAddress); } -/*-- 25.06.2004 10:51:36--------------------------------------------------- - return the address blocks and put the selected one to the first position - -----------------------------------------------------------------------*/ + +// return the address blocks and put the selected one to the first position const uno::Sequence< ::rtl::OUString >& SwSelectAddressBlockDialog::GetAddressBlocks() { //put the selected block to the first position @@ -451,9 +417,7 @@ const uno::Sequence< ::rtl::OUString >& SwSelectAddressBlockDialog::GetAddres } return m_aAddressBlocks; } -/*-- 28.04.2004 11:48:11--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSelectAddressBlockDialog::SetSettings( sal_Bool bIsCountry, ::rtl::OUString rCountry) { @@ -466,9 +430,7 @@ void SwSelectAddressBlockDialog::SetSettings( m_aNeverRB.Check(); m_aDeletePB.Enable(m_aAddressBlocks.getLength() > 1); } -/*-- 10.05.2004 11:17:06--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwSelectAddressBlockDialog::GetCountry() const { ::rtl::OUString sRet; @@ -477,9 +439,6 @@ void SwSelectAddressBlockDialog::SetSettings( return sRet; } -/*-- 13.04.2004 16:02:32--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK(SwSelectAddressBlockDialog, DeleteHdl_Impl, PushButton*, pButton) { if(m_aAddressBlocks.getLength()) @@ -500,9 +459,7 @@ IMPL_LINK(SwSelectAddressBlockDialog, DeleteHdl_Impl, PushButton*, pButton) } return 0; } -/*-- 13.04.2004 16:02:32--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwSelectAddressBlockDialog, NewCustomizeHdl_Impl, PushButton*, pButton) { bool bCustomize = pButton == &m_aCustomizePB; @@ -537,24 +494,17 @@ IMPL_LINK(SwSelectAddressBlockDialog, NewCustomizeHdl_Impl, PushButton*, pButton delete pDlg; return 0; } -/*-- 13.04.2004 16:02:33--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwSelectAddressBlockDialog, IncludeHdl_Impl, RadioButton*, pButton) { m_aCountryED.Enable(&m_aDependentRB == pButton); return 0; } -/* -----------------------------28.02.05 09:00-------------------------------- - - ---------------------------------------------------------------------------*/ SwRestrictedComboBox::~SwRestrictedComboBox() { } -/* -----------------------------28.02.05 09:00-------------------------------- - ---------------------------------------------------------------------------*/ void SwRestrictedComboBox::KeyInput(const KeyEvent& rEvt) { sal_Bool bCallParent = sal_True; @@ -567,9 +517,7 @@ void SwRestrictedComboBox::KeyInput(const KeyEvent& rEvt) if(bCallParent) ComboBox::KeyInput(rEvt); } -/* -----------------------------28.02.05 09:00-------------------------------- - ---------------------------------------------------------------------------*/ void SwRestrictedComboBox::Modify() { Selection aSel = GetSelection(); @@ -590,9 +538,6 @@ void SwRestrictedComboBox::Modify() GetModifyHdl().Call(this); } -/*-- 13.04.2004 16:01:08--------------------------------------------------- - - -----------------------------------------------------------------------*/ #define USER_DATA_SALUTATION -1 #define USER_DATA_PUNCTUATION -2 #define USER_DATA_TEXT -3 @@ -676,7 +621,7 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog( { const XubString& rHeader = rHeaders.GetString( i ); SvLBoxEntry* pEntry = m_aAddressElementsLB.InsertEntry(rHeader); - pEntry->SetUserData((void*)(sal_Int32)i); + pEntry->SetUserData((void*)(sal_IntPtr)i); } m_aOK.SetClickHdl(LINK(this, SwCustomizeAddressBlockDialog, OKHdl_Impl)); m_aAddressElementsLB.SetSelectHdl(LINK(this, SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl )); @@ -694,23 +639,17 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog( m_aDownIB.SetClickHdl(aImgButtonHdl); UpdateImageButtons_Impl(); } -/*-- 13.04.2004 16:01:08--------------------------------------------------- - -----------------------------------------------------------------------*/ SwCustomizeAddressBlockDialog::~SwCustomizeAddressBlockDialog() { } -/*-- 07.06.2004 13:51:11--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCustomizeAddressBlockDialog, OKHdl_Impl, OKButton*, EMPTYARG) { EndDialog(RET_OK); return 0; } -/*-- 24.06.2004 11:36:05--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl, DDListBox*, pBox) { sal_Int32 nUserData = (sal_Int32)(sal_IntPtr)pBox->FirstSelected()->GetUserData(); @@ -718,9 +657,7 @@ IMPL_LINK(SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl, DDListBox*, pBox m_aInsertFieldIB.Enable(nUserData >= 0 || !HasItem_Impl(nUserData)); return 0; } -/*-- 25.06.2004 11:21:24--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCustomizeAddressBlockDialog, EditModifyHdl_Impl, AddressMultiLineEdit*, EMPTYARG) { String sAddress = SwAddressPreview::FillData( @@ -730,9 +667,7 @@ IMPL_LINK(SwCustomizeAddressBlockDialog, EditModifyHdl_Impl, AddressMultiLineEdi UpdateImageButtons_Impl(); return 0; } -/*-- 25.06.2004 12:14:11--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCustomizeAddressBlockDialog, ImageButtonHdl_Impl, ImageButton*, pButton) { if(&m_aInsertFieldIB == pButton) @@ -764,9 +699,7 @@ IMPL_LINK(SwCustomizeAddressBlockDialog, ImageButtonHdl_Impl, ImageButton*, pBut UpdateImageButtons_Impl(); return 0; } -/*-- 01.07.2004 09:27:02--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwCustomizeAddressBlockDialog::GetSelectedItem_Impl() { sal_Int32 nRet = USER_DATA_NONE; @@ -784,9 +717,7 @@ sal_Int32 SwCustomizeAddressBlockDialog::GetSelectedItem_Impl() } return nRet; } -/*-- 01.07.2004 10:01:19--------------------------------------------------- - -----------------------------------------------------------------------*/ bool SwCustomizeAddressBlockDialog::HasItem_Impl(sal_Int32 nUserData) { //get the entry from the ListBox @@ -808,9 +739,7 @@ bool SwCustomizeAddressBlockDialog::HasItem_Impl(sal_Int32 nUserData) bool bRet = sText.Search(sEntry) != STRING_NOTFOUND; return bRet; } -/*-- 25.06.2004 13:10:16--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCustomizeAddressBlockDialog, SelectionChangedHdl_Impl, AddressMultiLineEdit*, pEdit) { // called in case the selection of the edit field changes. @@ -863,9 +792,7 @@ IMPL_LINK(SwCustomizeAddressBlockDialog, SelectionChangedHdl_Impl, AddressMultiL bOnEntry = false; return 0; } -/*-- 25.06.2004 13:36:29--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwCustomizeAddressBlockDialog, FieldChangeHdl_Impl, ComboBox*, EMPTYARG) { //changing the field content changes the related members, too @@ -888,9 +815,6 @@ IMPL_LINK(SwCustomizeAddressBlockDialog, FieldChangeHdl_Impl, ComboBox*, EMPTYAR return 0; } -/*-- 25.06.2004 12:35:51--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwCustomizeAddressBlockDialog::UpdateImageButtons_Impl() { sal_uInt16 nMove = m_aDragED.IsCurrentItemMoveable(); @@ -903,18 +827,14 @@ void SwCustomizeAddressBlockDialog::UpdateImageButtons_Impl() m_aInsertFieldIB.Enable( pEntry && (0 < (sal_Int32)(sal_IntPtr)pEntry->GetUserData() || m_aFieldCB.GetText().Len())); } -/*-- 28.04.2004 12:04:14--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwCustomizeAddressBlockDialog::SetAddress(const ::rtl::OUString& rAddress) { m_aDragED.SetText( rAddress ); UpdateImageButtons_Impl(); m_aDragED.Modify(); } -/*-- 28.04.2004 12:04:14--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwCustomizeAddressBlockDialog::GetAddress() { String sAddress(m_aDragED.GetAddress()); @@ -938,9 +858,7 @@ void SwCustomizeAddressBlockDialog::SetAddress(const ::rtl::OUString& rAddress) } return sAddress; } -/*-- 28.02.2005 11:03:35--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwCustomizeAddressBlockDialog::MoveFocus( Window* pMember, bool bNext ) { ::std::vector< Window* > aControls; @@ -966,7 +884,7 @@ void SwCustomizeAddressBlockDialog::MoveFocus( Window* pMember, bool bNext ) } if( aMemberIter == aControls.end() ) { - DBG_ERROR( "Window not found?" ); + OSL_ENSURE(false, "Window not found?" ); return; } @@ -1007,9 +925,7 @@ void SwCustomizeAddressBlockDialog::MoveFocus( Window* pMember, bool bNext ) } } -/*-- 13.04.2004 17:49:45--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwAssignFieldsControl : public Control { friend class SwAssignFieldsDialog; @@ -1048,10 +964,7 @@ public: m_aModifyHdl.Call(this); } }; -/*-- 13.04.2004 17:51:27--------------------------------------------------- - -----------------------------------------------------------------------*/ -//------------------------------------------------------------------------- SwAssignFieldsControl::SwAssignFieldsControl( Window* pParent, const ResId& rResId, SwMailMergeConfigItem& rConfigItem) : Control(pParent, rResId), @@ -1172,9 +1085,6 @@ SwAssignFieldsControl::SwAssignFieldsControl( m_aMatches.push_back(pNewLB); m_aPreviews.push_back(pNewPreview); } - ListBox* pBottomBox = m_aMatches[rHeaders.Count() -1]; - long nYBottom = pBottomBox->GetPosPixel().Y(); - nYBottom += pBottomBox->GetDropDownPosSizePixel().GetHeight(); m_aVScroll.SetRange(Range(0, rHeaders.Count())); m_aVScroll.SetPageSize((aOutputSize.Height() - nHBHeight - m_nLBStartTopPos)/ m_nYOffset); m_aVScroll.EnableDrag(); @@ -1186,9 +1096,7 @@ SwAssignFieldsControl::SwAssignFieldsControl( m_aVScroll.SetSizePixel(Size(m_aVScroll.GetSizePixel().Width(), aOutputSize.Height() - nHBHeight)); } -/*-- 13.04.2004 17:51:28--------------------------------------------------- - -----------------------------------------------------------------------*/ SwAssignFieldsControl::~SwAssignFieldsControl() { ::std::vector<FixedInfo*>::iterator aFIIter; @@ -1201,9 +1109,6 @@ SwAssignFieldsControl::~SwAssignFieldsControl() delete *aFIIter; } -/*-- 07.05.2004 13:11:26--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwAssignFieldsControl::Command( const CommandEvent& rCEvt ) { switch ( rCEvt.GetCommand() ) @@ -1223,9 +1128,7 @@ void SwAssignFieldsControl::Command( const CommandEvent& rCEvt ) Control::Command(rCEvt); } } -/*-- 07.05.2004 13:11:21--------------------------------------------------- - -----------------------------------------------------------------------*/ long SwAssignFieldsControl::PreNotify( NotifyEvent& rNEvt ) { if(rNEvt.GetType() == EVENT_COMMAND) @@ -1240,9 +1143,7 @@ long SwAssignFieldsControl::PreNotify( NotifyEvent& rNEvt ) } return Control::PreNotify(rNEvt); } -/*-- 03.09.2004 13:19:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAssignFieldsControl::MakeVisible( sal_Int32 nIndex ) { long nThumb = m_aVScroll.GetThumbPos(); @@ -1255,9 +1156,7 @@ void SwAssignFieldsControl::MakeVisible( sal_Int32 nIndex ) return; ScrollHdl_Impl( &m_aVScroll ); } -/*-- 30.04.2004 16:10:58--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwAssignFieldsControl, ScrollHdl_Impl, ScrollBar*, pScroll) { long nThumb = pScroll->GetThumbPos(); @@ -1282,9 +1181,6 @@ IMPL_LINK(SwAssignFieldsControl, ScrollHdl_Impl, ScrollBar*, pScroll) return 0; } -/*-- 03.05.2004 15:37:52--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox) { String sColumn = pBox->GetSelectEntry(); @@ -1320,9 +1216,7 @@ IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox) m_aModifyHdl.Call(0); return 0; } -/*-- 03.09.2004 13:16:04--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwAssignFieldsControl, GotFocusHdl_Impl, ListBox*, pBox) { if(0 != (GETFOCUS_TAB & pBox->GetGetFocusFlags())) @@ -1340,9 +1234,7 @@ IMPL_LINK(SwAssignFieldsControl, GotFocusHdl_Impl, ListBox*, pBox) } return 0; } -/*-- 13.04.2004 17:44:01--------------------------------------------------- - -----------------------------------------------------------------------*/ SwAssignFieldsDialog::SwAssignFieldsDialog( Window* pParent, SwMailMergeConfigItem& rConfigItem, const ::rtl::OUString& rPreview, @@ -1394,16 +1286,12 @@ SwAssignFieldsDialog::SwAssignFieldsDialog( m_aOK.SetClickHdl(LINK(this, SwAssignFieldsDialog, OkHdl_Impl)); } -/*-- 13.04.2004 17:44:02--------------------------------------------------- - -----------------------------------------------------------------------*/ SwAssignFieldsDialog::~SwAssignFieldsDialog() { delete m_pFieldsControl; } -/*-- 05.05.2004 14:39:13--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< ::rtl::OUString > SwAssignFieldsDialog::CreateAssignments() { uno::Sequence< ::rtl::OUString > aAssignments( @@ -1423,9 +1311,7 @@ uno::Sequence< ::rtl::OUString > SwAssignFieldsDialog::CreateAssignments() } return aAssignments; } -/*-- 03.05.2004 18:04:00--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwAssignFieldsDialog, OkHdl_Impl, PushButton*, EMPTYARG) { m_rConfigItem.SetColumnAssignment( @@ -1434,9 +1320,7 @@ IMPL_LINK(SwAssignFieldsDialog, OkHdl_Impl, PushButton*, EMPTYARG) EndDialog(RET_OK); return 0; } -/*-- 05.05.2004 14:37:19--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwAssignFieldsDialog, AssignmentModifyHdl_Impl, void*, EMPTYARG) { uno::Sequence< ::rtl::OUString > aAssignments = CreateAssignments(); @@ -1446,16 +1330,12 @@ IMPL_LINK(SwAssignFieldsDialog, AssignmentModifyHdl_Impl, void*, EMPTYARG) return 0; } -/*-- 26.05.2004 11:20:11--------------------------------------------------- - - -----------------------------------------------------------------------*/ DDListBox::DDListBox(SwCustomizeAddressBlockDialog* pParent, const ResId rResId) : SvTreeListBox(pParent, rResId), m_pParentDialog(pParent) { SetStyle( GetStyle() | /*WB_HASBUTTONS|WB_HASBUTTONSATROOT|*/ WB_CLIPCHILDREN ); -// SetSpaceBetweenEntries(3); SetSelectionMode( SINGLE_SELECTION ); SetDragDropMode( SV_DRAGDROP_CTRL_COPY ); EnableAsyncDrag(sal_True); @@ -1465,15 +1345,11 @@ DDListBox::DDListBox(SwCustomizeAddressBlockDialog* pParent, const ResId rResId) Show(); } -/*-- 26.05.2004 11:20:15--------------------------------------------------- - -----------------------------------------------------------------------*/ DDListBox::~DDListBox() { } -/*-- 26.05.2004 11:20:16--------------------------------------------------- - -----------------------------------------------------------------------*/ void DDListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ ) { SvLBoxEntry* pEntry = GetCurEntry(); @@ -1501,9 +1377,7 @@ void DDListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ ) } } } -/*-- 26.05.2004 13:14:53--------------------------------------------------- - -----------------------------------------------------------------------*/ AddressMultiLineEdit::AddressMultiLineEdit(SwCustomizeAddressBlockDialog* pParent, const ResId& rResId) : MultiLineEdit(pParent, rResId), m_pParentDialog(pParent) @@ -1511,19 +1385,14 @@ AddressMultiLineEdit::AddressMultiLineEdit(SwCustomizeAddressBlockDialog* pParen { GetTextView()->SupportProtectAttribute(sal_True); StartListening(*GetTextEngine()); - //DisableSelectionOnFocus(); EnableFocusSelectionHide(sal_False); } -/*-- 26.05.2004 13:14:53--------------------------------------------------- - -----------------------------------------------------------------------*/ AddressMultiLineEdit::~AddressMultiLineEdit() { EndListening(*GetTextEngine()); } -/*-- 25.06.2004 13:02:49--------------------------------------------------- - -----------------------------------------------------------------------*/ void AddressMultiLineEdit::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { if(rHint.ISA(TextHint) && @@ -1533,9 +1402,7 @@ void AddressMultiLineEdit::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rH m_aSelectionLink.Call(this); } } -/*-- 26.05.2004 13:45:46--------------------------------------------------- - -----------------------------------------------------------------------*/ long AddressMultiLineEdit::PreNotify( NotifyEvent& rNEvt ) { long nHandled = 0; @@ -1560,9 +1427,7 @@ long AddressMultiLineEdit::PreNotify( NotifyEvent& rNEvt ) return nHandled; } -/*-- 25.06.2004 08:20:54--------------------------------------------------- - -----------------------------------------------------------------------*/ void AddressMultiLineEdit::SetText( const String& rStr ) { MultiLineEdit::SetText(rStr); @@ -1605,10 +1470,8 @@ void AddressMultiLineEdit::SetText( const String& rStr ) } } -/*-- 25.06.2004 12:32:41--------------------------------------------------- - Insert the new entry in front of the entry at the beginning of the selection - -----------------------------------------------------------------------*/ +// Insert the new entry in front of the entry at the beginning of the selection void AddressMultiLineEdit::InsertNewEntry( const String& rStr ) { // insert new entry after current selected one. @@ -1645,16 +1508,13 @@ void AddressMultiLineEdit::InsertNewEntryAtPosition( const String& rStr, sal_uLo pTextView->SetSelection(aEntrySel); m_aSelectionLink.Call(this); } -/*-- 25.06.2004 12:32:41--------------------------------------------------- - -----------------------------------------------------------------------*/ void AddressMultiLineEdit::RemoveCurrentEntry() { ExtTextEngine* pTextEngine = GetTextEngine(); ExtTextView* pTextView = GetTextView(); const TextSelection& rSelection = pTextView->GetSelection(); const TextCharAttrib* pBeginAttrib = pTextEngine->FindCharAttrib( rSelection.GetStart(), TEXTATTR_PROTECTED ); -// const TextCharAttrib* pEndAttrib = pTextEngine->FindCharAttrib( rSelection.GetEnd(), TEXTATTR_PROTECTED ); if(pBeginAttrib && (pBeginAttrib->GetStart() <= rSelection.GetStart().GetIndex() && pBeginAttrib->GetEnd() >= rSelection.GetEnd().GetIndex())) @@ -1667,9 +1527,7 @@ void AddressMultiLineEdit::RemoveCurrentEntry() Modify(); } } -/*-- 25.06.2004 12:32:41--------------------------------------------------- - -----------------------------------------------------------------------*/ void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove) { ExtTextEngine* pTextEngine = GetTextEngine(); @@ -1742,9 +1600,7 @@ void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove) Modify(); } } -/*-- 25.06.2004 12:32:41--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_uInt16 AddressMultiLineEdit::IsCurrentItemMoveable() { sal_uInt16 nRet = 0; @@ -1752,7 +1608,6 @@ sal_uInt16 AddressMultiLineEdit::IsCurrentItemMoveable() ExtTextView* pTextView = GetTextView(); const TextSelection& rSelection = pTextView->GetSelection(); const TextCharAttrib* pBeginAttrib = pTextEngine->FindCharAttrib( rSelection.GetStart(), TEXTATTR_PROTECTED ); -// const TextCharAttrib* pEndAttrib = pTextEngine->FindCharAttrib( rSelection.GetEnd(), TEXTATTR_PROTECTED ); if(pBeginAttrib && (pBeginAttrib->GetStart() <= rSelection.GetStart().GetIndex() && pBeginAttrib->GetEnd() >= rSelection.GetEnd().GetIndex())) @@ -1766,9 +1621,7 @@ sal_uInt16 AddressMultiLineEdit::IsCurrentItemMoveable() } return nRet; } -/*-- 25.06.2004 12:32:42--------------------------------------------------- - -----------------------------------------------------------------------*/ bool AddressMultiLineEdit::HasCurrentItem() { ExtTextEngine* pTextEngine = GetTextEngine(); @@ -1779,9 +1632,7 @@ bool AddressMultiLineEdit::HasCurrentItem() (pBeginAttrib->GetStart() <= rSelection.GetStart().GetIndex() && pBeginAttrib->GetEnd() >= rSelection.GetEnd().GetIndex())); } -/*-- 01.07.2004 09:07:44--------------------------------------------------- - -----------------------------------------------------------------------*/ String AddressMultiLineEdit::GetCurrentItem() { String sRet; @@ -1799,9 +1650,7 @@ String AddressMultiLineEdit::GetCurrentItem() } return sRet; } -/*-- 05.07.2004 14:29:02--------------------------------------------------- - -----------------------------------------------------------------------*/ void AddressMultiLineEdit::SelectCurrentItem() { ExtTextEngine* pTextEngine = GetTextEngine(); @@ -1818,11 +1667,7 @@ void AddressMultiLineEdit::SelectCurrentItem() Invalidate(); } } -/*-- 25.06.2004 09:10:43--------------------------------------------------- - returns the address - remove trailing spaces - and trailing empty paragraphs - -----------------------------------------------------------------------*/ + String AddressMultiLineEdit::GetAddress() { String sRet; @@ -1844,3 +1689,4 @@ String AddressMultiLineEdit::GetAddress() return sRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx index 085cd67bc5..e4a2f2fe31 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.hxx +++ b/sw/source/ui/dbui/mmaddressblockpage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #define _MAILMERGEADDRESSBLOCKPAGE_HXX #include <svtools/wizardmachine.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <svtools/stdctrl.hxx> #include <mailmergehelper.hxx> #include <sfx2/basedlgs.hxx> @@ -43,9 +42,7 @@ #include <svl/lstner.hxx> class SwMailMergeWizard; class SwMailMergeConfigItem; -/*-- 13.04.2004 15:50:37--------------------------------------------------- - - -----------------------------------------------------------------------*/ + class SwMailMergeAddressBlockPage : public svt::OWizardPage { SwBoldFixedInfo m_aHeaderFI; @@ -107,9 +104,7 @@ public: SwMailMergeWizard* GetWizard() { return m_pWizard;} }; -/*-- 13.04.2004 15:45:31--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwSelectAddressBlockDialog : public SfxModalDialog { FixedText m_aSelectFT; @@ -152,10 +147,6 @@ public: ::rtl::OUString GetCountry() const; }; - -/*-- 26.05.2004 11:16:25--------------------------------------------------- - - -----------------------------------------------------------------------*/ class SwCustomizeAddressBlockDialog; class DDListBox : public SvTreeListBox { @@ -166,9 +157,7 @@ public: virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); }; -/*-- 26.05.2004 11:16:25--------------------------------------------------- - -----------------------------------------------------------------------*/ #define MOVE_ITEM_LEFT 1 #define MOVE_ITEM_RIGHT 2 #define MOVE_ITEM_UP 4 @@ -206,10 +195,8 @@ public: String GetCurrentItem(); void SelectCurrentItem(); }; -/*-- 13.04.2004 15:45:31--------------------------------------------------- - Dialog is used to create custom address blocks as well as - custom greeting lines - -----------------------------------------------------------------------*/ + +// Dialog is used to create custom address blocks as well as custom greeting lines class SwRestrictedComboBox : public ComboBox { String sForbiddenChars; @@ -223,7 +210,7 @@ public: ~SwRestrictedComboBox(); - void SetForbiddenChars(const String& rSet){sForbiddenChars = rSet;} + void SetForbiddenChars(const String& rSet){sForbiddenChars = rSet;} }; class SwCustomizeAddressBlockDialog : public SfxModalDialog @@ -293,9 +280,7 @@ public: void SetAddress(const ::rtl::OUString& rAddress); ::rtl::OUString GetAddress(); }; -/*-- 13.04.2004 17:41:11--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwAssignFieldsControl; class SwAssignFieldsDialog : public SfxModalDialog { @@ -330,3 +315,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmaddressblockpage.src b/sw/source/ui/dbui/mmaddressblockpage.src index d06ced7e29..3f8756f03c 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.src +++ b/sw/source/ui/dbui/mmaddressblockpage.src @@ -194,9 +194,6 @@ TabPage DLG_MM_ADDRESSBLOCK_PAGE }; }; -/*-- 13.04.2004 16:07:28--------------------------------------------------- - - -----------------------------------------------------------------------*/ ModalDialog DLG_MM_SELECTADDRESSBLOCK { OutputSize = TRUE ; @@ -301,10 +298,6 @@ ModalDialog DLG_MM_SELECTADDRESSBLOCK }; }; -/*-- 13.04.2004 16:07:28--------------------------------------------------- - - -----------------------------------------------------------------------*/ - #define WORKAROUND\ Text [ en-US ] = "New Address Block"; @@ -534,9 +527,7 @@ ModalDialog DLG_MM_CUSTOMIZEADDRESSBLOCK }; }; }; -/*-- 13.04.2004 17:45:24--------------------------------------------------- - -----------------------------------------------------------------------*/ ModalDialog DLG_MM_ASSIGNFIELDS { OutputSize = TRUE ; diff --git a/sw/source/ui/dbui/mmconfigitem.cxx b/sw/source/ui/dbui/mmconfigitem.cxx index db8db04543..9dd2379093 100644 --- a/sw/source/ui/dbui/mmconfigitem.cxx +++ b/sw/source/ui/dbui/mmconfigitem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,7 +30,7 @@ #include "precompiled_sw.hxx" #include <mmconfigitem.hxx> #include <swtypes.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/sdb/XCompletedConnection.hpp> @@ -47,12 +48,8 @@ #include <unotools/configitem.hxx> #include <mailmergehelper.hxx> #include <swunohelper.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> #include <dbui.hrc> #include <vector> @@ -82,9 +79,6 @@ const char* cDataCommandType = "DataSource/DataCommandType"; #define DEFAULT_PORT 25 #define POP_PORT 110 -/*-- 16.04.2004 09:41:36--------------------------------------------------- - - -----------------------------------------------------------------------*/ struct DBAddressDataAssignment { SwDBData aDBData; @@ -99,9 +93,6 @@ struct DBAddressDataAssignment {} }; -/*-- 16.04.2004 09:43:29--------------------------------------------------- - - -----------------------------------------------------------------------*/ class SwMailMergeConfigItem_Impl : public utl::ConfigItem { friend class SwMailMergeConfigItem; @@ -202,9 +193,6 @@ public: }; -/*-- 06.05.2004 12:51:54--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() : ConfigItem(C2U("Office.Writer/MailMergeWizard"), 0), nResultSetCursorPos(-1), @@ -237,7 +225,7 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() : const Sequence<OUString>& rNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(rNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == rNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == rNames.getLength(), "GetProperties failed"); if(aValues.getLength() == rNames.getLength()) { for(int nProp = 0; nProp < rNames.getLength(); nProp++) @@ -314,7 +302,7 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() : } } //read the list of data base assignments - Sequence<OUString> aAssignments = GetNodeNames(C2U(cAddressDataAssignments)); + Sequence<OUString> aAssignments = GetNodeNames(rtl::OUString::createFromAscii(cAddressDataAssignments)); if(aAssignments.getLength()) { //create a list of property names to load the URLs of all data bases @@ -325,18 +313,18 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() : OUString sSlash = C2U("/"); for(nAssign = 0; nAssign < aAssignProperties.getLength(); nAssign += 4) { - String sAssignPath = C2U(cAddressDataAssignments); + String sAssignPath = rtl::OUString::createFromAscii(cAddressDataAssignments); sAssignPath += '/'; sAssignPath += String(pAssignments[nAssign / 4]); sAssignPath += '/'; pAssignProperties[nAssign] = sAssignPath; - pAssignProperties[nAssign] += C2U(cDataSourceName); + pAssignProperties[nAssign] += rtl::OUString::createFromAscii(cDataSourceName); pAssignProperties[nAssign + 1] = sAssignPath; - pAssignProperties[nAssign + 1] += C2U(cDataTableName); + pAssignProperties[nAssign + 1] += rtl::OUString::createFromAscii(cDataTableName); pAssignProperties[nAssign + 2] = sAssignPath; - pAssignProperties[nAssign + 2] += C2U(cDataCommandType); + pAssignProperties[nAssign + 2] += rtl::OUString::createFromAscii(cDataCommandType); pAssignProperties[nAssign + 3] = sAssignPath; - pAssignProperties[nAssign + 3] += C2U(cDBColumnAssignments); + pAssignProperties[nAssign + 3] += rtl::OUString::createFromAscii(cDBColumnAssignments); } Sequence<Any> aAssignValues = GetProperties(aAssignProperties); const Any* pAssignValues = aAssignValues.getConstArray(); @@ -372,15 +360,11 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() : } } -/*-- 06.05.2004 12:51:54--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeConfigItem_Impl::~SwMailMergeConfigItem_Impl() { } -/*-- 13.03.2006 12:12:59--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem_Impl::SetCurrentAddressBlockIndex( sal_Int32 nSet ) { if(aAddressBlocks.size() >= sal::static_int_cast<sal_uInt32, sal_Int32>(nSet)) @@ -389,9 +373,7 @@ void SwMailMergeConfigItem_Impl::SetCurrentAddressBlockIndex( sal_Int32 nSet ) SetModified(); } } -/*-- 16.04.2004 13:06:07--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString lcl_CreateNodeName(Sequence<OUString>& rAssignments ) { const OUString* pNames = rAssignments.getConstArray(); @@ -420,7 +402,7 @@ OUString lcl_CreateNodeName(Sequence<OUString>& rAssignments ) rAssignments.getArray()[rAssignments.getLength() - 1] = sNewName; return sNewName; } -// -------------------------------------------------------------------------------- + void lcl_ConvertToNumbers(OUString& rBlock, const ResStringArray& rHeaders ) { //convert the strings used for UI to numbers used for the configuration @@ -437,7 +419,7 @@ void lcl_ConvertToNumbers(OUString& rBlock, const ResStringArray& rHeaders ) } rBlock = sBlock; } -// -------------------------------------------------------------------------------- + void lcl_ConvertFromNumbers(OUString& rBlock, const ResStringArray& rHeaders) { //convert the numbers used for the configuration to strings used for UI to numbers @@ -463,7 +445,7 @@ void lcl_ConvertFromNumbers(OUString& rBlock, const ResStringArray& rHeaders) } else { - DBG_ERROR("parse error in address block or greeting line"); + OSL_ENSURE(false, "parse error in address block or greeting line"); } } else @@ -472,9 +454,6 @@ void lcl_ConvertFromNumbers(OUString& rBlock, const ResStringArray& rHeaders) rBlock = sBlock; } -/*-------------------------------------------------------------------- - - --------------------------------------------------------------------*/ const Sequence<OUString>& SwMailMergeConfigItem_Impl::GetPropertyNames() { static Sequence<OUString> aNames; @@ -532,9 +511,7 @@ const Sequence<OUString>& SwMailMergeConfigItem_Impl::GetPropertyNames() } return aNames; } -/*-- 15.04.2004 08:48:39--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem_Impl::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} void SwMailMergeConfigItem_Impl::Commit() @@ -620,7 +597,7 @@ void SwMailMergeConfigItem_Impl::Commit() //store the changed / new assignments //load the existing node names to find new names - Sequence<OUString> aAssignments = GetNodeNames(C2U(cAddressDataAssignments)); + Sequence<OUString> aAssignments = GetNodeNames(rtl::OUString::createFromAscii(cAddressDataAssignments)); ::std::vector<DBAddressDataAssignment>::iterator aAssignIter; for(aAssignIter = aAddressDataAssignments.begin(); @@ -633,7 +610,7 @@ void SwMailMergeConfigItem_Impl::Commit() aAssignIter->sConfigNodeName : lcl_CreateNodeName(aAssignments); OUString sSlash = C2U("/"); - OUString sNodePath = C2U(cAddressDataAssignments); + OUString sNodePath = rtl::OUString::createFromAscii(cAddressDataAssignments); sNodePath += sSlash; sNodePath += sNewNode; sNodePath += sSlash; @@ -641,27 +618,25 @@ void SwMailMergeConfigItem_Impl::Commit() Sequence< PropertyValue > aNewValues(4); PropertyValue* pNewValues = aNewValues.getArray(); pNewValues[0].Name = sNodePath; - pNewValues[0].Name += C2U(cDataSourceName); + pNewValues[0].Name += rtl::OUString::createFromAscii(cDataSourceName); pNewValues[0].Value <<= aAssignIter->aDBData.sDataSource; pNewValues[1].Name = sNodePath; - pNewValues[1].Name += C2U(cDataTableName); + pNewValues[1].Name += rtl::OUString::createFromAscii(cDataTableName); pNewValues[1].Value <<= aAssignIter->aDBData.sCommand; pNewValues[2].Name = sNodePath; - pNewValues[2].Name += C2U(cDataCommandType); + pNewValues[2].Name += rtl::OUString::createFromAscii(cDataCommandType); pNewValues[2].Value <<= aAssignIter->aDBData.nCommandType; pNewValues[3].Name = sNodePath; - pNewValues[3].Name += C2U(cDBColumnAssignments); + pNewValues[3].Name += rtl::OUString::createFromAscii(cDBColumnAssignments); pNewValues[3].Value <<= aAssignIter->aDBColumnAssignments; - SetSetProperties(C2U(cAddressDataAssignments), aNewValues); + SetSetProperties(rtl::OUString::createFromAscii(cAddressDataAssignments), aNewValues); } } bUserSettingWereOverwritten = sal_False; } -/*-- 06.05.2004 13:04:36--------------------------------------------------- - -----------------------------------------------------------------------*/ const Sequence< ::rtl::OUString> SwMailMergeConfigItem_Impl::GetAddressBlocks( sal_Bool bConvertToConfig) const { @@ -675,9 +650,7 @@ const Sequence< ::rtl::OUString> SwMailMergeConfigItem_Impl::GetAddressBlocks( } return aRet; } -/*-- 06.05.2004 13:04:36--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem_Impl::SetAddressBlocks( const Sequence< ::rtl::OUString>& rBlocks, sal_Bool bConvertFromConfig) @@ -693,9 +666,7 @@ void SwMailMergeConfigItem_Impl::SetAddressBlocks( nCurrentAddressBlock = 0; SetModified(); } -/*-- 30.04.2004 11:04:52--------------------------------------------------- - -----------------------------------------------------------------------*/ const Sequence< ::rtl::OUString> SwMailMergeConfigItem_Impl::GetGreetings( SwMailMergeConfigItem::Gender eType, sal_Bool bConvertToConfig) const { @@ -713,9 +684,7 @@ const Sequence< ::rtl::OUString> SwMailMergeConfigItem_Impl::GetGreetings( } return aRet; } -/*-- 30.04.2004 11:04:52--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem_Impl::SetGreetings( SwMailMergeConfigItem::Gender eType, const Sequence< ::rtl::OUString>& rSetGreetings, @@ -736,9 +705,7 @@ void SwMailMergeConfigItem_Impl::SetGreetings( } SetModified(); } -/*-- 11.05.2004 13:13:54--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwMailMergeConfigItem_Impl::GetCurrentGreeting( SwMailMergeConfigItem::Gender eType) const { @@ -751,9 +718,7 @@ sal_Int32 SwMailMergeConfigItem_Impl::GetCurrentGreeting( } return nRet; } -/*-- 11.05.2004 13:13:54--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem_Impl::SetCurrentGreeting( SwMailMergeConfigItem::Gender eType, sal_Int32 nIndex) { @@ -779,9 +744,7 @@ void SwMailMergeConfigItem_Impl::SetCurrentGreeting( static SwMailMergeConfigItem_Impl* pOptions = NULL; static sal_Int32 nRefCount = 0; static ::osl::Mutex aMutex; -/*-- 15.04.2004 08:42:43--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeConfigItem::SwMailMergeConfigItem() : m_bAddressInserted(false), m_bMergeDone(false), @@ -799,9 +762,7 @@ SwMailMergeConfigItem::SwMailMergeConfigItem() : ++nRefCount; m_pImpl = pOptions; } -/*-- 15.04.2004 08:43:36--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeConfigItem::~SwMailMergeConfigItem() { // Global access, must be guarded (multithreading) @@ -811,46 +772,34 @@ SwMailMergeConfigItem::~SwMailMergeConfigItem() DELETEZ( pOptions ); } } -/*-- 06.05.2004 14:18:10--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::Commit() { if(m_pImpl->IsModified()) m_pImpl->Commit(); } -/*-- 06.05.2004 12:59:50--------------------------------------------------- - -----------------------------------------------------------------------*/ const ResStringArray& SwMailMergeConfigItem::GetDefaultAddressHeaders() const { return m_pImpl->m_AddressHeaderSA; } -/*-- 27.04.2004 14:34:16--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetAddressBlocks( const Sequence< ::rtl::OUString>& rBlocks) { m_pImpl->SetAddressBlocks(rBlocks); } -/*-- 27.04.2004 14:34:16--------------------------------------------------- - -----------------------------------------------------------------------*/ const Sequence< ::rtl::OUString> SwMailMergeConfigItem::GetAddressBlocks() const { return m_pImpl->GetAddressBlocks(); } -/*-- 11.05.2004 17:08:45--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeConfigItem::IsAddressBlock()const { return m_pImpl->bIsAddressBlock && IsOutputToLetter(); } -/*-- 11.05.2004 17:08:46--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetAddressBlock(sal_Bool bSet) { m_pImpl->bUserSettingWereOverwritten = sal_False; @@ -861,16 +810,11 @@ void SwMailMergeConfigItem::SetAddressBlock(sal_Bool bSet) } } -/*-- 30.08.2005 15:09:46--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeConfigItem::IsHideEmptyParagraphs() const { return m_pImpl->bIsHideEmptyParagraphs; } -/*-- 30.08.2005 15:09:47--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetHideEmptyParagraphs(sal_Bool bSet) { if(m_pImpl->bIsHideEmptyParagraphs != bSet) @@ -879,23 +823,17 @@ void SwMailMergeConfigItem::SetHideEmptyParagraphs(sal_Bool bSet) m_pImpl->SetModified(); } } -/*-- 28.04.2004 13:00:02--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeConfigItem::IsIncludeCountry() const { return m_pImpl->bIncludeCountry; } -/*-- 28.04.2004 13:00:02--------------------------------------------------- - -----------------------------------------------------------------------*/ rtl::OUString& SwMailMergeConfigItem::GetExcludeCountry() const { return m_pImpl->sExcludeCountry; } -/*-- 28.04.2004 13:00:02--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetCountrySettings(sal_Bool bSet, const rtl::OUString& rCountry) { if(m_pImpl->sExcludeCountry != rCountry || @@ -907,9 +845,6 @@ void SwMailMergeConfigItem::SetCountrySettings(sal_Bool bSet, const rtl::OUStrin } } -/*-- 28.04.2004 15:35:16--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetCurrentConnection( Reference< XDataSource> xSource, SharedConnection xConnection, @@ -924,23 +859,17 @@ void SwMailMergeConfigItem::SetCurrentConnection( m_pImpl->nResultSetCursorPos = 0; m_pImpl->SetModified(); } -/*-- 28.04.2004 15:38:11--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XDataSource> SwMailMergeConfigItem::GetSource() { return m_pImpl->xSource; } -/*-- 28.04.2004 15:38:11--------------------------------------------------- - -----------------------------------------------------------------------*/ SharedConnection SwMailMergeConfigItem::GetConnection() { return m_pImpl->xConnection; } -/*-- 28.04.2004 15:38:11--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XColumnsSupplier> SwMailMergeConfigItem::GetColumnsSupplier() { if(!m_pImpl->xColumnsSupplier.is() && m_pImpl->xConnection.is()) @@ -952,17 +881,12 @@ Reference< XColumnsSupplier> SwMailMergeConfigItem::GetColumnsSupplier() } return m_pImpl->xColumnsSupplier; } -/*-- 30.04.2004 14:30:55--------------------------------------------------- - -----------------------------------------------------------------------*/ const SwDBData& SwMailMergeConfigItem::GetCurrentDBData() const { return m_pImpl->aDBData; } -/*-- 17.06.2004 13:18:47--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetCurrentDBData( const SwDBData& rDBData) { if(m_pImpl->aDBData != rDBData) @@ -974,9 +898,7 @@ void SwMailMergeConfigItem::SetCurrentDBData( const SwDBData& rDBData) m_pImpl->SetModified(); } } -/*-- 29.04.2004 11:34:36--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XResultSet> SwMailMergeConfigItem::GetResultSet() const { if(!m_pImpl->xConnection.is() && m_pImpl->aDBData.sDataSource.getLength()) @@ -1008,7 +930,7 @@ Reference< XResultSet> SwMailMergeConfigItem::GetResultSet() const } catch(Exception&) { - DBG_ERROR("exception caught in xResultSet->SetFilter()"); + OSL_ENSURE(false, "exception caught in xResultSet->SetFilter()"); } xRowSet->execute(); m_pImpl->xResultSet = xRowSet.get(); @@ -1018,14 +940,12 @@ Reference< XResultSet> SwMailMergeConfigItem::GetResultSet() const } catch(Exception& ) { - DBG_ERROR("exception caught in: SwMailMergeConfigItem::GetResultSet() "); + OSL_ENSURE(false, "exception caught in: SwMailMergeConfigItem::GetResultSet() "); } } return m_pImpl->xResultSet; } -/*-- 13.08.2004 11:49:46--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::DisposeResultSet() { m_pImpl->xConnection.clear(); @@ -1034,16 +954,12 @@ void SwMailMergeConfigItem::DisposeResultSet() ::comphelper::disposeComponent( m_pImpl->xResultSet ); } } -/*-- 14.05.2004 15:07:55--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString& SwMailMergeConfigItem::GetFilter() const { return m_pImpl->sFilter; } -/*-- 14.05.2004 15:07:55--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetFilter(::rtl::OUString& rFilter) { if(m_pImpl->sFilter != rFilter) @@ -1062,14 +978,12 @@ void SwMailMergeConfigItem::SetFilter(::rtl::OUString& rFilter) } catch(Exception&) { - DBG_ERROR("exception caught in SwMailMergeConfigItem::SetFilter()"); + OSL_ENSURE(false, "exception caught in SwMailMergeConfigItem::SetFilter()"); } } } } -/*-- 29.04.2004 11:55:38--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwMailMergeConfigItem::MoveResultSet(sal_Int32 nTarget) { if(!m_pImpl->xResultSet.is()) @@ -1104,9 +1018,6 @@ sal_Int32 SwMailMergeConfigItem::MoveResultSet(sal_Int32 nTarget) return m_pImpl->nResultSetCursorPos; } -/*-- 27.05.2004 13:56:18--------------------------------------------------- - - -----------------------------------------------------------------------*/ bool SwMailMergeConfigItem::IsResultSetFirstLast(bool& bIsFirst, bool& bIsLast) { bool bRet = false; @@ -1126,16 +1037,12 @@ bool SwMailMergeConfigItem::IsResultSetFirstLast(bool& bIsFirst, bool& bIsLast) } return bRet; } -/*-- 29.04.2004 11:55:38--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwMailMergeConfigItem::GetResultSetPosition() const { return m_pImpl->nResultSetCursorPos; } -/*-- 27.05.2004 14:49:53--------------------------------------------------- - -----------------------------------------------------------------------*/ bool SwMailMergeConfigItem::IsRecordExcluded(sal_Int32 nRecord) { bool bRet = false; @@ -1147,9 +1054,7 @@ bool SwMailMergeConfigItem::IsRecordExcluded(sal_Int32 nRecord) } return bRet; } -/*-- 27.05.2004 14:49:53--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::ExcludeRecord(sal_Int32 nRecord, bool bExclude) { //nRecord is based on 1 @@ -1188,9 +1093,7 @@ void SwMailMergeConfigItem::ExcludeRecord(sal_Int32 nRecord, bool bExclude) } } } -/*-- 27.05.2004 15:08:35--------------------------------------------------- - -----------------------------------------------------------------------*/ Sequence< Any > SwMailMergeConfigItem::GetSelection() const { Sequence< Any > aRet(m_aSelection.getLength()); @@ -1208,17 +1111,13 @@ Sequence< Any > SwMailMergeConfigItem::GetSelection() const aRet.realloc(nRetIndex); return aRet; } -/*-- 16.06.2004 15:15:56--------------------------------------------------- - -----------------------------------------------------------------------*/ const uno::Sequence< ::rtl::OUString>& SwMailMergeConfigItem::GetSavedDocuments() const { return m_pImpl->aSavedDocuments; } -/*-- 16.06.2004 15:15:56--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::AddSavedDocument(::rtl::OUString rName) { const ::rtl::OUString* pDocs = m_pImpl->aSavedDocuments.getConstArray(); @@ -1237,16 +1136,12 @@ void SwMailMergeConfigItem::AddSavedDocument(::rtl::OUString rName) m_pImpl->aSavedDocuments[m_pImpl->aSavedDocuments.getLength() - 1] = rName; } } -/*-- 28.04.2004 16:15:16--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeConfigItem::IsOutputToLetter()const { return m_pImpl->bIsOutputToLetter || !IsMailAvailable(); } -/*-- 28.04.2004 16:15:16--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetOutputToLetter(sal_Bool bSet) { if(m_pImpl->bIsOutputToLetter != bSet) @@ -1255,18 +1150,14 @@ void SwMailMergeConfigItem::SetOutputToLetter(sal_Bool bSet) m_pImpl->SetModified(); } } -/*-- 30.04.2004 10:51:10--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeConfigItem::IsIndividualGreeting(sal_Bool bInEMail) const { return bInEMail ? m_pImpl->bIsIndividualGreetingLineInMail : m_pImpl->bIsIndividualGreetingLine; } -/*-- 30.04.2004 10:51:10--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetIndividualGreeting( sal_Bool bSet, sal_Bool bInEMail) { @@ -1287,16 +1178,12 @@ void SwMailMergeConfigItem::SetIndividualGreeting( } } } -/*-- 30.04.2004 10:51:10--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeConfigItem::IsGreetingLine(sal_Bool bInEMail) const { return bInEMail ? m_pImpl->bIsGreetingLineInMail : m_pImpl->bIsGreetingLine; } -/*-- 30.04.2004 10:51:10--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetGreetingLine(sal_Bool bSet, sal_Bool bInEMail) { m_pImpl->bUserSettingWereOverwritten = sal_False; @@ -1317,48 +1204,35 @@ void SwMailMergeConfigItem::SetGreetingLine(sal_Bool bSet, sal_Bool bInEMail } } } -/*-- 30.04.2004 11:04:52--------------------------------------------------- - -----------------------------------------------------------------------*/ const Sequence< ::rtl::OUString> SwMailMergeConfigItem::GetGreetings( Gender eType ) const { return m_pImpl->GetGreetings(eType); } -/*-- 30.04.2004 11:04:52--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetGreetings( Gender eType, const Sequence< ::rtl::OUString>& rSetGreetings) { m_pImpl->SetGreetings( eType, rSetGreetings); } -/*-- 11.05.2004 13:10:54--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_Int32 SwMailMergeConfigItem::GetCurrentGreeting( SwMailMergeConfigItem::Gender eType) const { return m_pImpl->GetCurrentGreeting(eType); } -/*-- 11.05.2004 13:10:55--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetCurrentGreeting(Gender eType, sal_Int32 nIndex) { m_pImpl->SetCurrentGreeting(eType, nIndex); } -/*-- 12.05.2004 12:29:59--------------------------------------------------- - -----------------------------------------------------------------------*/ const ::rtl::OUString& SwMailMergeConfigItem::GetFemaleGenderValue() const { return m_pImpl->sFemaleGenderValue; } -/*-- 12.05.2004 12:29:59--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetFemaleGenderValue(const ::rtl::OUString rValue) { if( m_pImpl->sFemaleGenderValue != rValue ) @@ -1368,9 +1242,6 @@ void SwMailMergeConfigItem::SetFemaleGenderValue(const ::rtl::OUString rValue) } } -/*-- 30.04.2004 13:25:41--------------------------------------------------- - - -----------------------------------------------------------------------*/ Sequence< ::rtl::OUString> SwMailMergeConfigItem::GetColumnAssignment( const SwDBData& rDBData ) const { @@ -1387,9 +1258,9 @@ Sequence< ::rtl::OUString> SwMailMergeConfigItem::GetColumnAssignment( } return aRet; } -/*-- 21.05.2004 12:31:31--------------------------------------------------- - returns the name that is assigned as e-mail column of the current data base - -----------------------------------------------------------------------*/ + + +// returns the name that is assigned as e-mail column of the current data base ::rtl::OUString SwMailMergeConfigItem::GetAssignedColumn(sal_uInt32 nColumn) const { ::rtl::OUString sRet; @@ -1400,9 +1271,7 @@ Sequence< ::rtl::OUString> SwMailMergeConfigItem::GetColumnAssignment( sRet = m_pImpl->m_AddressHeaderSA.GetString(nColumn); return sRet; } -/*-- 30.04.2004 13:25:41--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetColumnAssignment( const SwDBData& rDBData, const Sequence< ::rtl::OUString>& rList) { @@ -1433,9 +1302,6 @@ void SwMailMergeConfigItem::SetColumnAssignment( const SwDBData& rDBData, m_pImpl->SetModified(); } -/*-- 07.09.2005 11:50:27--------------------------------------------------- - - -----------------------------------------------------------------------*/ bool SwMailMergeConfigItem::IsAddressFieldsAssigned() const { bool bResult = true; @@ -1481,9 +1347,7 @@ bool SwMailMergeConfigItem::IsAddressFieldsAssigned() const } return bResult; } -/*-- 07.09.2005 11:50:27--------------------------------------------------- - -----------------------------------------------------------------------*/ bool SwMailMergeConfigItem::IsGreetingFieldsAssigned() const { bool bResult = true; @@ -1542,16 +1406,12 @@ bool SwMailMergeConfigItem::IsGreetingFieldsAssigned() const } return bResult; } -/*-- 05.05.2004 16:10:07--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwMailMergeConfigItem::GetMailDisplayName() const { return m_pImpl->sMailDisplayName; } -/*-- 05.05.2004 16:10:08--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetMailDisplayName(const ::rtl::OUString& rName) { if(m_pImpl->sMailDisplayName != rName) @@ -1560,16 +1420,12 @@ void SwMailMergeConfigItem::SetMailDisplayName(const ::rtl::OUString& rName) m_pImpl->SetModified(); } } -/*-- 05.05.2004 16:10:09--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwMailMergeConfigItem::GetMailAddress() const { return m_pImpl->sMailAddress; } -/*-- 05.05.2004 16:10:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetMailAddress(const ::rtl::OUString& rAddress) { if(m_pImpl->sMailAddress != rAddress ) @@ -1579,16 +1435,11 @@ void SwMailMergeConfigItem::SetMailAddress(const ::rtl::OUString& rAddress) } } -/*-- 07.05.2004 12:40:59--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeConfigItem::IsMailReplyTo() const { return m_pImpl->bIsMailReplyTo; } -/*-- 07.05.2004 12:40:59--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetMailReplyTo(sal_Bool bSet) { if(m_pImpl->bIsMailReplyTo != bSet) @@ -1597,16 +1448,12 @@ void SwMailMergeConfigItem::SetMailReplyTo(sal_Bool bSet) m_pImpl->SetModified(); } } -/*-- 05.05.2004 16:10:09--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwMailMergeConfigItem::GetMailReplyTo() const { return m_pImpl->sMailReplyTo; } -/*-- 05.05.2004 16:10:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetMailReplyTo(const ::rtl::OUString& rReplyTo) { if(m_pImpl->sMailReplyTo != rReplyTo) @@ -1615,16 +1462,12 @@ void SwMailMergeConfigItem::SetMailReplyTo(const ::rtl::OUString& rReplyTo) m_pImpl->SetModified(); } } -/*-- 05.05.2004 16:10:09--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwMailMergeConfigItem::GetMailServer() const { return m_pImpl->sMailServer; } -/*-- 05.05.2004 16:10:10--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetMailServer(const ::rtl::OUString& rAddress) { if(m_pImpl->sMailServer != rAddress) @@ -1633,18 +1476,14 @@ void SwMailMergeConfigItem::SetMailServer(const ::rtl::OUString& rAddress) m_pImpl->SetModified(); } } -/*-- 05.05.2004 16:10:10--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int16 SwMailMergeConfigItem::GetMailPort() const { return m_pImpl->bIsDefaultPort ? (m_pImpl->bIsSecureConnection ? SECURE_PORT : DEFAULT_PORT) : m_pImpl->nMailPort; } -/*-- 05.05.2004 16:10:10--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetMailPort(sal_Int16 nSet) { if(m_pImpl->nMailPort != nSet || m_pImpl->bIsDefaultPort) @@ -1654,16 +1493,12 @@ void SwMailMergeConfigItem::SetMailPort(sal_Int16 nSet) m_pImpl->SetModified(); } } -/*-- 05.05.2004 16:10:11--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeConfigItem::IsSecureConnection() const { return m_pImpl->bIsSecureConnection; } -/*-- 05.05.2004 16:10:12--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetSecureConnection(sal_Bool bSet) { if(m_pImpl->bIsSecureConnection != bSet) @@ -1672,16 +1507,12 @@ void SwMailMergeConfigItem::SetSecureConnection(sal_Bool bSet) m_pImpl->SetModified(); } } -/*-- 05.05.2004 16:10:12--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeConfigItem::IsAuthentication() const { return m_pImpl->bIsAuthentication; } -/*-- 05.05.2004 16:10:13--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetAuthentication(sal_Bool bSet) { if(m_pImpl->bIsAuthentication != bSet) @@ -1690,16 +1521,12 @@ void SwMailMergeConfigItem::SetAuthentication(sal_Bool bSet) m_pImpl->SetModified(); } } -/*-- 05.05.2004 16:10:13--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwMailMergeConfigItem::GetMailUserName() const { return m_pImpl->sMailUserName; } -/*-- 05.05.2004 16:10:13--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetMailUserName(const ::rtl::OUString& rName) { if(m_pImpl->sMailUserName != rName) @@ -1708,16 +1535,12 @@ void SwMailMergeConfigItem::SetMailUserName(const ::rtl::OUString& rName) m_pImpl->SetModified(); } } -/*-- 05.05.2004 16:10:14--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwMailMergeConfigItem::GetMailPassword() const { return m_pImpl->sMailPassword; } -/*-- 05.05.2004 16:10:14--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetMailPassword(const ::rtl::OUString& rPassword) { if(m_pImpl->sMailPassword != rPassword) @@ -1726,16 +1549,12 @@ void SwMailMergeConfigItem::SetMailPassword(const ::rtl::OUString& rPassword) m_pImpl->SetModified(); } } -/*-- 19.08.2004 14:44:57--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeConfigItem::IsSMTPAfterPOP() const { return m_pImpl->bIsSMPTAfterPOP; } -/*-- 19.08.2004 14:44:57--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetSMTPAfterPOP(sal_Bool bSet) { if( m_pImpl->bIsSMPTAfterPOP != bSet) @@ -1744,16 +1563,12 @@ void SwMailMergeConfigItem::SetSMTPAfterPOP(sal_Bool bSet) m_pImpl->SetModified(); } } -/*-- 19.08.2004 14:44:57--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwMailMergeConfigItem::GetInServerName() const { return m_pImpl->sInServerName; } -/*-- 19.08.2004 14:44:57--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetInServerName(const ::rtl::OUString& rServer) { if(m_pImpl->sInServerName != rServer) @@ -1762,16 +1577,12 @@ void SwMailMergeConfigItem::SetInServerName(const ::rtl::OUString& rServer) m_pImpl->SetModified(); } } -/*-- 19.08.2004 14:44:58--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int16 SwMailMergeConfigItem::GetInServerPort() const { return m_pImpl->nInServerPort; } -/*-- 19.08.2004 14:44:58--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetInServerPort(sal_Int16 nSet) { if( m_pImpl->nInServerPort != nSet) @@ -1780,16 +1591,12 @@ void SwMailMergeConfigItem::SetInServerPort(sal_Int16 nSet) m_pImpl->SetModified(); } } -/*-- 20.08.2004 08:52:48--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeConfigItem::IsInServerPOP() const { return m_pImpl->bInServerPOP; } -/*-- 20.08.2004 08:52:49--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetInServerPOP(sal_Bool bSet) { if( m_pImpl->bInServerPOP != bSet) @@ -1798,16 +1605,12 @@ void SwMailMergeConfigItem::SetInServerPOP(sal_Bool bSet) m_pImpl->SetModified(); } } -/*-- 19.08.2004 14:44:58--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwMailMergeConfigItem::GetInServerUserName() const { return m_pImpl->sInServerUserName; } -/*-- 19.08.2004 14:44:58--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetInServerUserName(const ::rtl::OUString& rName) { if( m_pImpl->sInServerUserName != rName) @@ -1816,16 +1619,12 @@ void SwMailMergeConfigItem::SetInServerUserName(const ::rtl::OUString& rName) m_pImpl->SetModified(); } } -/*-- 19.08.2004 14:44:59--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwMailMergeConfigItem::GetInServerPassword() const { return m_pImpl->sInServerPassword; } -/*-- 19.08.2004 14:45:00--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetInServerPassword(const ::rtl::OUString& rPassword) { if(m_pImpl->sInServerPassword != rPassword) @@ -1835,9 +1634,6 @@ void SwMailMergeConfigItem::SetInServerPassword(const ::rtl::OUString& rPassword } } -/*-- 02.09.2004 14:43:27--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::DocumentReloaded() { m_bMergeDone = false; @@ -1845,38 +1641,28 @@ void SwMailMergeConfigItem::DocumentReloaded() m_bAddressInserted = false; m_rAddressBlockFrame = ::rtl::OUString(); } -/*-- 16.06.2004 12:24:18--------------------------------------------------- - -----------------------------------------------------------------------*/ bool SwMailMergeConfigItem::IsMailAvailable() const { return m_pImpl->bIsEMailSupported; } -/*-- 21.05.2004 12:20:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::AddMergedDocument(SwDocMergeInfo& rInfo) { m_pImpl->aMergeInfos.push_back(rInfo); } -/*-- 21.05.2004 12:20:05--------------------------------------------------- - -----------------------------------------------------------------------*/ SwDocMergeInfo& SwMailMergeConfigItem::GetDocumentMergeInfo(sal_uInt32 nDocument) { - DBG_ASSERT(m_pImpl->aMergeInfos.size() > nDocument,"invalid document index"); + OSL_ENSURE(m_pImpl->aMergeInfos.size() > nDocument,"invalid document index"); return m_pImpl->aMergeInfos[nDocument]; } -/*-- 14.06.2004 11:46:26--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_uInt32 SwMailMergeConfigItem::GetMergedDocumentCount() const { return m_pImpl->aMergeInfos.size(); } -/*-- 11.06.2004 10:38:39--------------------------------------------------- - -----------------------------------------------------------------------*/ SwView* lcl_ExistsView(SwView* pView) { const TypeId aType(TYPE(SwView)); @@ -1890,9 +1676,7 @@ SwView* lcl_ExistsView(SwView* pView) } return 0; } -/*-- 16.06.2004 15:02:35--------------------------------------------------- - -----------------------------------------------------------------------*/ SwView* SwMailMergeConfigItem::GetTargetView() { //make sure that the pointer is really valid - the document may have been closed manually @@ -1902,9 +1686,7 @@ SwView* SwMailMergeConfigItem::GetTargetView() } return m_pTargetView; } -/*-- 02.09.2004 17:04:11--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetTargetView(SwView* pView) { m_pTargetView = pView; @@ -1914,17 +1696,13 @@ void SwMailMergeConfigItem::SetTargetView(SwView* pView) m_pImpl->aMergeInfos.clear(); } } -/*-- 16.06.2004 15:02:35--------------------------------------------------- - -----------------------------------------------------------------------*/ SwView* SwMailMergeConfigItem::GetSourceView() { m_pSourceView = lcl_ExistsView(m_pSourceView); return m_pSourceView; } -/*-- 04.11.2004 19:53 --------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetSourceView(SwView* pView) { m_pSourceView = pView; @@ -1970,17 +1748,14 @@ void SwMailMergeConfigItem::SetSourceView(SwView* pView) } } -/*-- 13.03.2006 12:15:06--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwMailMergeConfigItem::SetCurrentAddressBlockIndex( sal_Int32 nSet ) { m_pImpl->SetCurrentAddressBlockIndex( nSet ); } -/*-- 13.03.2006 12:15:07--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwMailMergeConfigItem::GetCurrentAddressBlockIndex() const { return m_pImpl->GetCurrentAddressBlockIndex(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx index db618364f7..10fb6251ba 100644 --- a/sw/source/ui/dbui/mmdocselectpage.cxx +++ b/sw/source/ui/dbui/mmdocselectpage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,9 +41,7 @@ #include <sfx2/docfac.hxx> #include <vcl/msgbox.hxx> #include <view.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <mmdocselectpage.hxx> #include <mailmergewizard.hxx> #include <shellio.hxx> @@ -61,9 +60,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace svt; -/*-- 02.04.2004 09:40:14--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwMailMergeDocSelectPage::SwMailMergeDocSelectPage( SwMailMergeWizard* _pParent ) : svt::OWizardPage(_pParent, SW_RES(DLG_MM_DOCSELECT_PAGE)), #ifdef MSC @@ -114,16 +110,10 @@ SwMailMergeDocSelectPage::SwMailMergeDocSelectPage( SwMailMergeWizard* _pParent } } -/*-- 02.04.2004 09:40:14--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwMailMergeDocSelectPage::~SwMailMergeDocSelectPage() { } -/*-- 05.04.2004 14:21:48--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeDocSelectPage, DocSelectHdl, RadioButton*, pButton) { m_aRecentDocLB.Enable(&m_aRecentDocRB == pButton); @@ -133,9 +123,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, DocSelectHdl, RadioButton*, pButton) return 0; } -/*-- 05.04.2004 14:25:12--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton) { bool bTemplate = &m_aBrowseTemplatePB == pButton; @@ -144,7 +132,6 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton) { m_aLoadTemplateRB.Check(); SfxNewFileDialog* pNewFileDlg = new SfxNewFileDialog(this, 0); - //pNewFileDlg->SetTemplateFlags(nFlags); sal_uInt16 nRet = pNewFileDlg->Execute(); if(RET_TEMPLATE_LOAD == nRet) bTemplate = false; @@ -194,9 +181,6 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton) return 0; } -/*-- 06.04.2004 12:52:24--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeDocSelectPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { sal_Bool bReturn = sal_False; @@ -222,3 +206,5 @@ sal_Bool SwMailMergeDocSelectPage::commitPage( ::svt::WizardTypes::CommitPageRea } return bReturn; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmdocselectpage.hxx b/sw/source/ui/dbui/mmdocselectpage.hxx index 363aecdddc..a24df21519 100644 --- a/sw/source/ui/dbui/mmdocselectpage.hxx +++ b/sw/source/ui/dbui/mmdocselectpage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,14 +31,10 @@ #include <svtools/wizardmachine.hxx> #include <mailmergehelper.hxx> #include <vcl/lstbox.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <svtools/stdctrl.hxx> class SwMailMergeWizard; -/*-- 02.04.2004 09:21:06--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwMailMergeDocSelectPage : public svt::OWizardPage { SwBoldFixedInfo m_aHeaderFI; @@ -72,3 +69,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx index c17c1ec8ee..b9803d0615 100644 --- a/sw/source/ui/dbui/mmgreetingspage.cxx +++ b/sw/source/ui/dbui/mmgreetingspage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,7 +48,7 @@ using namespace svt; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -// ----------------------------------------------------------------------- + void lcl_FillGreetingsBox(ListBox& rBox, SwMailMergeConfigItem& rConfig, SwMailMergeConfigItem::Gender eType) @@ -57,7 +58,7 @@ void lcl_FillGreetingsBox(ListBox& rBox, rBox.InsertEntry(rEntries[nEntry]); rBox.SelectEntryPos((sal_uInt16)rConfig.GetCurrentGreeting(eType)); } -// ----------------------------------------------------------------------- + void lcl_FillGreetingsBox(ComboBox& rBox, SwMailMergeConfigItem& rConfig, SwMailMergeConfigItem::Gender eType) @@ -67,7 +68,7 @@ void lcl_FillGreetingsBox(ComboBox& rBox, rBox.InsertEntry(rEntries[nEntry]); rBox.SelectEntryPos((sal_uInt16)rConfig.GetCurrentGreeting(eType)); } -// ----------------------------------------------------------------------- + void lcl_StoreGreetingsBox(ListBox& rBox, SwMailMergeConfigItem& rConfig, SwMailMergeConfigItem::Gender eType) @@ -79,7 +80,7 @@ void lcl_StoreGreetingsBox(ListBox& rBox, rConfig.SetGreetings(eType, aEntries); rConfig.SetCurrentGreeting(eType, rBox.GetSelectEntryPos()); } -// ----------------------------------------------------------------------- + void lcl_StoreGreetingsBox(ComboBox& rBox, SwMailMergeConfigItem& rConfig, SwMailMergeConfigItem::Gender eType) @@ -91,9 +92,7 @@ void lcl_StoreGreetingsBox(ComboBox& rBox, rConfig.SetGreetings(eType, aEntries); rConfig.SetCurrentGreeting(eType, rBox.GetSelectEntryPos()); } -/*-- 30.04.2004 10:42:57--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwGreetingsHandler, IndividualHdl_Impl, CheckBox*, EMPTYARG) { sal_Bool bIndividual = m_pPersonalizedCB->IsEnabled() && m_pPersonalizedCB->IsChecked(); @@ -118,9 +117,7 @@ IMPL_LINK(SwGreetingsHandler, IndividualHdl_Impl, CheckBox*, EMPTYARG) UpdatePreview(); return 0; } -/*-- 30.04.2004 10:42:57--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwGreetingsHandler, GreetingHdl_Impl, PushButton*, pButton) { SwCustomizeAddressBlockDialog* pDlg = @@ -142,16 +139,12 @@ IMPL_LINK(SwGreetingsHandler, GreetingHdl_Impl, PushButton*, pButton) delete pDlg; return 0; } -/*-- 16.06.2004 10:56:21--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwGreetingsHandler::UpdatePreview() { //the base class does nothing } -/*-- 30.04.2004 10:42:59--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeGreetingsPage, AssignHdl_Impl, PushButton*, pButton) { String sPreview = m_aFemaleLB.GetSelectEntry(); @@ -168,17 +161,13 @@ IMPL_LINK(SwMailMergeGreetingsPage, AssignHdl_Impl, PushButton*, pButton) delete pDlg; return 0; } -/*-- 05.05.2004 15:25:56--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeGreetingsPage, GreetingSelectHdl_Impl, ListBox*, EMPTYARG) { UpdatePreview(); return 0; } -/*-- 05.05.2004 15:23:43--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeGreetingsPage::UpdatePreview() { //find out which type of greeting should be selected: @@ -221,7 +210,7 @@ void SwMailMergeGreetingsPage::UpdatePreview() } catch( sdbc::SQLException& ) { - DBG_ERROR("SQLException caught"); + OSL_ENSURE(false, "SQLException caught"); } } } @@ -233,9 +222,7 @@ void SwMailMergeGreetingsPage::UpdatePreview() sPreview = SwAddressPreview::FillData(sPreview, m_pWizard->GetConfigItem()); m_aPreviewWIN.SetAddress(sPreview); } -/*-- 17.05.2004 15:44:53--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwGreetingsHandler::Contains(sal_Bool bContainsGreeting) { m_pPersonalizedCB->Enable(bContainsGreeting); @@ -255,9 +242,7 @@ void SwGreetingsHandler::Contains(sal_Bool bContainsGreeting) m_pNeutralFT->Enable(bContainsGreeting); m_pNeutralCB->Enable(bContainsGreeting); } -/*-- 02.04.2004 14:17:52--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage( SwMailMergeWizard* _pParent) : svt::OWizardPage(_pParent, SW_RES(DLG_MM_GREETINGS_PAGE)), #ifdef MSC @@ -353,15 +338,11 @@ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage( SwMailMergeWizard* _pParent) sTemp.SearchAndReplaceAscii("%1", String::CreateFromInt32(1)); m_aDocumentIndexFI.SetText(sTemp); } -/*-- 02.04.2004 14:17:52--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeGreetingsPage::~SwMailMergeGreetingsPage() { } -/*-- 18.06.2004 12:13:53--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeGreetingsPage::ActivatePage() { SwMailMergeConfigItem& rConfig = m_pWizard->GetConfigItem(); @@ -387,9 +368,7 @@ void SwMailMergeGreetingsPage::ActivatePage() UpdatePreview(); m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE)); } -/*-- 11.05.2004 14:47:10--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeGreetingsPage::commitPage( ::svt::WizardTypes::CommitPageReason ) { SwMailMergeConfigItem& rConfig = m_pWizard->GetConfigItem(); @@ -421,9 +400,7 @@ sal_Bool SwMailMergeGreetingsPage::commitPage( ::svt::WizardTypes::CommitPage rConfig.SetIndividualGreeting(m_aPersonalizedCB.IsChecked(), sal_False); return sal_True; } -/*-- 30.04.2004 10:42:57--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeGreetingsPage, ContainsHdl_Impl, CheckBox*, pBox) { sal_Bool bContainsGreeting = pBox->IsChecked(); @@ -439,9 +416,7 @@ IMPL_LINK(SwMailMergeGreetingsPage, ContainsHdl_Impl, CheckBox*, pBox) m_pWizard->UpdateRoadmap(); return 0; } -/*-- 07.05.2004 12:56:42--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeGreetingsPage, InsertDataHdl_Impl, ImageButton*, pButton) { //if no pButton is given, the first set has to be pre-set @@ -473,9 +448,7 @@ IMPL_LINK(SwMailMergeGreetingsPage, InsertDataHdl_Impl, ImageButton*, pButton) m_aDocumentIndexFI.SetText(sTemp); return 0; } -/*-- 17.05.2004 15:11:19--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailBodyDialog::SwMailBodyDialog(Window* pParent, SwMailMergeWizard* _pWizard) : SfxModalDialog(pParent, SW_RES(DLG_MM_MAILBODY)), #ifdef MSC @@ -570,25 +543,18 @@ SwMailBodyDialog::SwMailBodyDialog(Window* pParent, SwMailMergeWizard* _pWizard) m_aFemaleFieldCB.SetText(rConfig.GetFemaleGenderValue()); m_aFemaleFieldCB.SaveValue(); } -/*-- 17.05.2004 15:13:07--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailBodyDialog::~SwMailBodyDialog() { } -/*-- 30.04.2004 10:42:57--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailBodyDialog, ContainsHdl_Impl, CheckBox*, pBox) { SwGreetingsHandler::Contains(pBox->IsChecked()); m_pWizard->GetConfigItem().SetGreetingLine(pBox->IsChecked(), sal_True); return 0; } -/*-- 28.06.2004 11:22:42--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailBodyDialog, OKHdl, PushButton*, EMPTYARG) { SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); @@ -617,3 +583,4 @@ IMPL_LINK(SwMailBodyDialog, OKHdl, PushButton*, EMPTYARG) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx b/sw/source/ui/dbui/mmgreetingspage.hxx index 230beab4c3..687f4afdf2 100644 --- a/sw/source/ui/dbui/mmgreetingspage.hxx +++ b/sw/source/ui/dbui/mmgreetingspage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #include <svtools/wizardmachine.hxx> #include <sfx2/basedlgs.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <vcl/lstbox.hxx> #include <vcl/combobox.hxx> #include <svtools/stdctrl.hxx> @@ -39,9 +38,7 @@ #include <svtools/svmedit.hxx> class SwMailMergeWizard; -/*-- 17.05.2004 14:51:45--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwGreetingsHandler { friend class SwMailBodyDialog; @@ -77,9 +74,7 @@ class SwGreetingsHandler void Contains(sal_Bool bContainsGreeting); virtual void UpdatePreview(); }; -/*-- 02.04.2004 09:21:06--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwMailMergeGreetingsPage : public svt::OWizardPage, public SwGreetingsHandler { @@ -128,9 +123,7 @@ public: ~SwMailMergeGreetingsPage(); }; -/*-- 17.05.2004 14:45:43--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwMailBodyDialog : public SfxModalDialog, public SwGreetingsHandler { CheckBox m_aGreetingLineCB; @@ -174,3 +167,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index 97d923f495..2e772aea98 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -84,9 +85,6 @@ using namespace ::com::sun::star::view; #define DEFAULT_ADDRESS_WIDTH (MM50*15)// 7,5 cm #define DEFAULT_ADDRESS_HEIGHT (MM50*7) // 3,5cm -/*-- 15.04.2004 08:16:35--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) : svt::OWizardPage( _pParent, SW_RES(DLG_MM_LAYOUT_PAGE)), #ifdef MSC @@ -179,18 +177,14 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) : m_aAlignToBodyCB.SetClickHdl(LINK(this, SwMailMergeLayoutPage, AlignToTextHdl_Impl)); m_aAlignToBodyCB.Check(); } -/*-- 15.04.2004 08:17:11--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeLayoutPage::~SwMailMergeLayoutPage() { delete m_pExampleFrame; File::remove( m_sExampleURL ); } -/*-- 27.05.2004 13:41:04--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeLayoutPage::ActivatePage() { SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); @@ -251,9 +245,7 @@ void SwMailMergeLayoutPage::ActivatePage() } } -/*-- 11.05.2004 10:41:26--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwMailMergeLayoutPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { //now insert the frame and the greeting @@ -270,9 +262,7 @@ sal_Bool SwMailMergeLayoutPage::commitPage( ::svt::WizardTypes::CommitPageReason } return sal_True; } -/*-- 24.06.2004 09:50:26--------------------------------------------------- - -----------------------------------------------------------------------*/ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressAndGreeting(SwView* pView, SwMailMergeConfigItem& rConfigItem, const Point& rAddressPosition, @@ -300,9 +290,7 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressAndGreeting(SwView* pView, pView->GetWrtShell().EndUndo(UNDO_INSERT); return pAddressBlockFormat; } -/*-- 11.05.2004 12:49:04--------------------------------------------------- - -----------------------------------------------------------------------*/ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame( SwWrtShell& rShell, SwMailMergeConfigItem& rConfigItem, @@ -332,7 +320,7 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame( rShell.NewFlyFrm(aSet, sal_True ); SwFrmFmt* pRet = rShell.GetFlyFrmFmt(); - ASSERT( pRet, "Fly not inserted" ); + OSL_ENSURE( pRet, "Fly not inserted" ); rShell.UnSelectFrm(); const Sequence< ::rtl::OUString> aBlocks = rConfigItem.GetAddressBlocks(); @@ -458,9 +446,6 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame( return pRet; } -/*-- 12.05.2004 12:20:19--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfigItem& rConfigItem, bool bExample) { //set the cursor to the desired position - if no text content is here then @@ -497,7 +482,6 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig rShell.MovePara(GetfnParaCurr(), GetfnParaStart()); } bool bSplitNode = rShell.GetText().Len() > 0; -// rShell.SetTxtFmtColl( rShell.GetTxtCollFromPool( RES_POOLCOLL_GREETING ) ); sal_Int32 nMoves = rConfigItem.GetGreetingMoves(); if( !bExample && 0 != nMoves ) { @@ -578,7 +562,7 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig // Female: [database.sGenderColumn] != "rFemaleGenderValue" && [database.NameColumn] // Male: [database.sGenderColumn] == "rFemaleGenderValue" && [database.rGenderColumn] // Neutral: [database.sNameColumn] - DBG_ASSERT(sGenderColumn.Len() && rFemaleGenderValue.getLength(), + OSL_ENSURE(sGenderColumn.Len() && rFemaleGenderValue.getLength(), "gender settings not available - how to form the condition?"); //column used as lastname for(sal_Int8 eGender = SwMailMergeConfigItem::FEMALE; @@ -687,11 +671,9 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig //put the cursor to the start of the paragraph rShell.SttPara(); - DBG_ASSERT(0 == rShell.GetTableFmt(), "What to do with a table here?"); + OSL_ENSURE(0 == rShell.GetTableFmt(), "What to do with a table here?"); } -/*-- 10.05.2004 09:34:25--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, void*, EMPTYARG) { m_aExampleWIN.Show( sal_True ); @@ -705,7 +687,7 @@ IMPL_LINK(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, void*, EMPTYARG) SwXTextDocument* pXDoc = reinterpret_cast<SwXTextDocument*>(xDocTunnel->getSomething(SwXTextDocument::getUnoTunnelId())); SwDocShell* pDocShell = pXDoc->GetDocShell(); m_pExampleWrtShell = pDocShell->GetWrtShell(); - DBG_ASSERT(m_pExampleWrtShell, "No SwWrtShell found!"); + OSL_ENSURE(m_pExampleWrtShell, "No SwWrtShell found!"); if(!m_pExampleWrtShell) return 0; @@ -725,19 +707,15 @@ IMPL_LINK(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, void*, EMPTYARG) Any aZoom; aZoom <<= (sal_Int16)DocumentZoomType::ENTIRE_PAGE; - m_xViewProperties->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom); + m_xViewProperties->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom); - -// m_pExampleWrtShell->SetTxtFmtColl( rSh.GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) ); const SwFmtFrmSize& rPageSize = m_pExampleWrtShell->GetPageDesc( m_pExampleWrtShell->GetCurPageDesc()).GetMaster().GetFrmSize(); m_aLeftMF.SetMax(rPageSize.GetWidth() - DEFAULT_LEFT_DISTANCE); m_aTopMF.SetMax(rPageSize.GetHeight() - DEFAULT_TOP_DISTANCE); return 0; } -/*-- 10.05.2004 14:05:24--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeLayoutPage, ZoomHdl_Impl, ListBox*, pBox) { if(m_pExampleWrtShell) @@ -753,18 +731,14 @@ IMPL_LINK(SwMailMergeLayoutPage, ZoomHdl_Impl, ListBox*, pBox) } Any aZoom; aZoom <<= eType; - m_xViewProperties->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom); + m_xViewProperties->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom); aZoom <<= nZoom; - m_xViewProperties->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom); + m_xViewProperties->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom); } return 0; } - -/*-- 10.05.2004 15:56:51--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeLayoutPage, ChangeAddressHdl_Impl, MetricField*, EMPTYARG) { if(m_pExampleWrtShell && m_pAddressBlockFormat) @@ -786,9 +760,6 @@ IMPL_LINK(SwMailMergeLayoutPage, ChangeAddressHdl_Impl, MetricField*, EMPTYARG) return 0; } -/*-- 10.05.2004 16:13:36--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeLayoutPage, GreetingsHdl_Impl, PushButton*, pButton) { bool bDown = pButton == &m_aDownPB; @@ -803,9 +774,7 @@ IMPL_LINK(SwMailMergeLayoutPage, GreetingsHdl_Impl, PushButton*, pButton) return 0; } -/*-- 15.07.2004 16:05:30--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeLayoutPage, AlignToTextHdl_Impl, CheckBox*, pBox) { sal_Bool bCheck = pBox->IsChecked() && pBox->IsEnabled(); @@ -814,3 +783,5 @@ IMPL_LINK(SwMailMergeLayoutPage, AlignToTextHdl_Impl, CheckBox*, pBox) ChangeAddressHdl_Impl( 0 ); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmlayoutpage.hxx b/sw/source/ui/dbui/mmlayoutpage.hxx index 137eb7bf04..c9e24cd128 100644 --- a/sw/source/ui/dbui/mmlayoutpage.hxx +++ b/sw/source/ui/dbui/mmlayoutpage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #include <svtools/wizardmachine.hxx> #include <mailmergehelper.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <svtools/stdctrl.hxx> #include <vcl/field.hxx> #include <vcl/lstbox.hxx> @@ -44,9 +43,7 @@ class SwWrtShell; class SwView; namespace com{ namespace sun{ namespace star{ namespace beans{ class XPropertySet;}}}} -/*-- 02.04.2004 09:21:06--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwMailMergeLayoutPage : public svt::OWizardPage { SwBoldFixedInfo m_aHeaderFI; @@ -112,3 +109,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmmergepage.cxx b/sw/source/ui/dbui/mmmergepage.cxx index a73a93114d..ed4d2585b0 100644 --- a/sw/source/ui/dbui/mmmergepage.cxx +++ b/sw/source/ui/dbui/mmmergepage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,9 +35,7 @@ #include <mailmergewizard.hxx> #include <mmconfigitem.hxx> #include <swtypes.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <dbui.hrc> #include <mmmergepage.hrc> #include <svl/srchitem.hxx> @@ -44,9 +43,6 @@ #include <svl/eitem.hxx> #include <swabstdlg.hxx> -/*-- 02.04.2004 16:38:45--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwMailMergeMergePage::SwMailMergeMergePage( SwMailMergeWizard* _pParent) : svt::OWizardPage(_pParent, SW_RES(DLG_MM_MERGE_PAGE)), #ifdef MSC @@ -77,24 +73,18 @@ SwMailMergeMergePage::SwMailMergeMergePage( SwMailMergeWizard* _pParent) : m_aFindED.SetReturnActionLink( LINK(this, SwMailMergeMergePage, EnteredFindStringHdl_Impl )); } -/*-- 02.04.2004 16:38:45--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeMergePage::~SwMailMergeMergePage() { } -/*-- 25.05.2004 16:14:49--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwMailMergeMergePage, EditDocumentHdl_Impl, PushButton*, EMPTYARG) { m_pWizard->SetRestartPage(MM_MERGEPAGE); m_pWizard->EndDialog(RET_EDIT_RESULT_DOC); return 0; } -/*-- 25.05.2004 16:14:49--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwMailMergeMergePage, FindHdl_Impl, PushButton*, EMPTYARG) { SvxSearchItem aSearchItem( SID_SEARCH_ITEM ); @@ -107,7 +97,7 @@ IMPL_LINK( SwMailMergeMergePage, FindHdl_Impl, PushButton*, EMPTYARG) aSearchItem.SetBackward(m_aBackwardsCB.IsChecked()); SwView* pTargetView = m_pWizard->GetConfigItem().GetTargetView(); - DBG_ASSERT(pTargetView, "no target view exists"); + OSL_ENSURE(pTargetView, "no target view exists"); if(pTargetView) { pTargetView->GetViewFrame()->GetDispatcher()->Execute( @@ -116,8 +106,11 @@ IMPL_LINK( SwMailMergeMergePage, FindHdl_Impl, PushButton*, EMPTYARG) return 0; } + IMPL_LINK( SwMailMergeMergePage, EnteredFindStringHdl_Impl, void*, EMPTYARG ) { m_aFindPB.GetClickHdl().Call( &m_aFindPB ); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmmergepage.hxx b/sw/source/ui/dbui/mmmergepage.hxx index 2b8ade72dc..6f512c77ce 100644 --- a/sw/source/ui/dbui/mmmergepage.hxx +++ b/sw/source/ui/dbui/mmmergepage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,17 +29,13 @@ #define _MAILMERGEMERGEPAGE_HXX #include <svtools/wizardmachine.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <vcl/edit.hxx> #include <svtools/stdctrl.hxx> #include <mailmergehelper.hxx> #include <actctrl.hxx> class SwMailMergeWizard; -/*-- 02.04.2004 09:21:06--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwMailMergeMergePage : public svt::OWizardPage { SwBoldFixedInfo m_aHeaderFI; @@ -71,3 +68,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index 66e8b5496e..4189a4e467 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,16 +38,10 @@ #include <mailconfigpage.hxx> #include <cmdid.h> #include <swtypes.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif -#ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED #include <IDocumentDeviceAccess.hxx> -#endif #include <hintids.hxx> #include <editeng/scripttypeitem.hxx> #include <editeng/langitem.hxx> @@ -61,31 +56,18 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/docfile.hxx> -//#ifndef _SFX_DOCFILT_HACK_HXX -//#include <sfx2/docfilt.hxx> -//#endif #include <tools/urlobj.hxx> #include <svl/urihelper.hxx> -#ifndef _VCL_PRINT_HXX #include <vcl/print.hxx> -#endif #include <unotools/tempfile.hxx> #include <osl/file.hxx> #include <mmgreetingspage.hxx> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/sdb/XColumn.hpp> -//#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ -//#include <com/sun/star/beans/PropertyValue.hpp> -//#endif -//#ifndef _BASEDLGS_HXX -//#include <sfx2/basedlgs.hxx> -//#endif -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <swunohelper.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <shellio.hxx> #include <svtools/htmlcfg.hxx> #include <sfx2/event.hxx> @@ -102,9 +84,6 @@ using namespace svt; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -/*-- 01.07.2004 16:47:49--------------------------------------------------- - - -----------------------------------------------------------------------*/ String lcl_GetExtensionForDocType(sal_uLong nDocType) { String sExtension; @@ -118,9 +97,7 @@ String lcl_GetExtensionForDocType(sal_uLong nDocType) } return sExtension; } -/*-- 28.06.2004 11:49:21--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString lcl_GetColumnValueOf(const ::rtl::OUString& rColumn, Reference < container::XNameAccess>& rxColAccess ) { ::rtl::OUString sRet; @@ -134,9 +111,7 @@ String lcl_GetExtensionForDocType(sal_uLong nDocType) } return sRet; } -/*-- 21.06.2004 14:01:13--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwSaveWarningBox_Impl : public ModalDialog { FixedImage aWarningImageIM; @@ -156,9 +131,7 @@ public: String GetFileName() const {return aFileNameED.GetText();} }; -/*-- 02.07.2004 08:54:42--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwSendQueryBox_Impl : public ModalDialog { FixedImage aQueryImageIM; @@ -190,9 +163,6 @@ public: } }; -/*-- 21.06.2004 14:11:58--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwSaveWarningBox_Impl::SwSaveWarningBox_Impl(Window* pParent, const String& rFileName) : ModalDialog(pParent, SW_RES( DLG_MM_SAVEWARNING )), aWarningImageIM(this, SW_RES( IM_WARNING )), @@ -209,23 +179,17 @@ SwSaveWarningBox_Impl::SwSaveWarningBox_Impl(Window* pParent, const String& rFil aFileNameED.SetModifyHdl(LINK(this, SwSaveWarningBox_Impl, ModifyHdl)); ModifyHdl( &aFileNameED ); } -/*-- 21.06.2004 14:11:58--------------------------------------------------- - -----------------------------------------------------------------------*/ SwSaveWarningBox_Impl::~SwSaveWarningBox_Impl() { } -/*-- 21.06.2004 14:11:58--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwSaveWarningBox_Impl, ModifyHdl, Edit*, pEdit) { aOKPB.Enable(pEdit->GetText().Len() > 0); return 0; } -/*-- 02.07.2004 09:02:53--------------------------------------------------- - -----------------------------------------------------------------------*/ SwSendQueryBox_Impl::SwSendQueryBox_Impl(Window* pParent, const String& rText) : ModalDialog(pParent, SW_RES( DLG_MM_QUERY )), aQueryImageIM( this, SW_RES( IM_QUERY )), @@ -242,24 +206,17 @@ SwSendQueryBox_Impl::SwSendQueryBox_Impl(Window* pParent, const String& rText) : aTextED.SetModifyHdl(LINK(this, SwSendQueryBox_Impl, ModifyHdl)); ModifyHdl( &aTextED ); } -/*-- 02.07.2004 08:58:45--------------------------------------------------- - -----------------------------------------------------------------------*/ SwSendQueryBox_Impl::~SwSendQueryBox_Impl() { } -/*-- 02.07.2004 08:58:25--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwSendQueryBox_Impl, ModifyHdl, Edit*, pEdit) { aOKPB.Enable(bIsEmptyAllowed || (pEdit->GetText().Len() > 0)); return 0; } -/*-- 16.04.2004 16:34:48--------------------------------------------------- - - -----------------------------------------------------------------------*/ class SwCopyToDialog : public SfxModalDialog { FixedInfo m_aDescriptionFI; @@ -286,9 +243,6 @@ public: void SetBCC(const String& rSet) {m_aBCCED.SetText(rSet);} }; -/*-- 16.04.2004 16:43:18--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwCopyToDialog::SwCopyToDialog(Window* pParent) : SfxModalDialog(pParent, SW_RES(DLG_MM_COPYTO)), #ifdef MSC @@ -310,16 +264,11 @@ SwCopyToDialog::SwCopyToDialog(Window* pParent) : { FreeResource(); } -/*-- 16.04.2004 16:43:10--------------------------------------------------- - -----------------------------------------------------------------------*/ SwCopyToDialog::~SwCopyToDialog() { } -/*-- 02.04.2004 13:15:54--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwMailMergeOutputPage::SwMailMergeOutputPage( SwMailMergeWizard* _pParent) : svt::OWizardPage( _pParent, SW_RES(DLG_MM_OUTPUT_PAGE)), #ifdef MSC @@ -429,17 +378,12 @@ SwMailMergeOutputPage::SwMailMergeOutputPage( SwMailMergeWizard* _pParent) : m_aPrintRB.Enable(!Application::GetSettings().GetMiscSettings().GetDisablePrinting()); } -/*-- 02.04.2004 13:15:44--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwMailMergeOutputPage::~SwMailMergeOutputPage() { delete m_pTempPrinter; delete m_pDocumentPrinterCopy; } -/*-- 31.01.2005 08:38:14--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergeOutputPage::ActivatePage() { //fill printer ListBox @@ -456,7 +400,7 @@ void SwMailMergeOutputPage::ActivatePage() SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); SwView* pTargetView = rConfigItem.GetTargetView(); - DBG_ASSERT(pTargetView, "no target view exists"); + OSL_ENSURE(pTargetView, "no target view exists"); if(pTargetView) { SfxPrinter* pPrinter = pTargetView->GetWrtShell().getIDocumentDeviceAccess()->getPrinter( true ); @@ -468,7 +412,7 @@ void SwMailMergeOutputPage::ActivatePage() m_aPrinterLB.SelectEntry( rConfigItem.GetSelectedPrinter() ); SwView* pSourceView = rConfigItem.GetSourceView(); - DBG_ASSERT(pSourceView, "no source view exists"); + OSL_ENSURE(pSourceView, "no source view exists"); if(pSourceView) { SwDocShell* pDocShell = pSourceView->GetDocShell(); @@ -480,16 +424,12 @@ void SwMailMergeOutputPage::ActivatePage() } } } -/*-- 05.07.2004 13:54:11--------------------------------------------------- - -----------------------------------------------------------------------*/ bool SwMailMergeOutputPage::canAdvance() const { return false; } -/*-- 02.04.2004 13:15:44--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeOutputPage, OutputTypeHdl_Impl, RadioButton*, pButton) { Control* aControls[] = @@ -578,7 +518,7 @@ IMPL_LINK(SwMailMergeOutputPage, OutputTypeHdl_Impl, RadioButton*, pButton) aPos = m_aFromNF.GetPosPixel(); aPos.Y() = nNewRBXPos + nRB_FT_Offset; m_aFromNF.SetPosPixel(aPos); aPos = m_aToNF.GetPosPixel(); aPos.Y() = nNewRBXPos + nRB_FT_Offset; m_aToNF.SetPosPixel(aPos); } - else /*if(&m_aSendMailRB == pButton)*/ + else { Control* aMailControls[] = { @@ -652,9 +592,7 @@ IMPL_LINK(SwMailMergeOutputPage, OutputTypeHdl_Impl, RadioButton*, pButton) SetUpdateMode(sal_False); return 0; } -/*-- 22.08.2005 12:15:10--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeOutputPage, DocumentSelectionHdl_Impl, RadioButton*, pButton) { sal_Bool bEnableFromTo = pButton == &m_aFromRB; @@ -664,9 +602,6 @@ IMPL_LINK(SwMailMergeOutputPage, DocumentSelectionHdl_Impl, RadioButton*, pButto return 0; } -/*-- 16.04.2004 16:45:10--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeOutputPage, CopyToHdl_Impl, PushButton*, pButton) { SwCopyToDialog* pDlg = new SwCopyToDialog(pButton); @@ -680,14 +615,12 @@ IMPL_LINK(SwMailMergeOutputPage, CopyToHdl_Impl, PushButton*, pButton) delete pDlg; return 0; } -/*-- 17.05.2004 13:51:02--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeOutputPage, SaveStartHdl_Impl, PushButton*, pButton) { SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); SwView* pSourceView = rConfigItem.GetSourceView(); - DBG_ASSERT( pSourceView, "source view missing"); + OSL_ENSURE( pSourceView, "source view missing"); if(pSourceView) { SfxViewFrame* pSourceViewFrm = pSourceView->GetViewFrame(); @@ -722,22 +655,18 @@ IMPL_LINK(SwMailMergeOutputPage, SaveStartHdl_Impl, PushButton*, pButton) } return 0; } -/*-- 17.07.2008 08:09:06--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeOutputPage, SaveCancelHdl_Impl, Button*, EMPTYARG ) { m_bCancelSaving = true; return 0; } -/*-- 17.05.2004 13:51:02--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) { SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); SwView* pTargetView = rConfigItem.GetTargetView(); - DBG_ASSERT(pTargetView, "no target view exists"); + OSL_ENSURE(pTargetView, "no target view exists"); if(!pTargetView) return 0; @@ -857,7 +786,6 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) SfxObjectShellLock xTempDocShell( new SwDocShell( SFX_CREATE_MODE_STANDARD ) ); xTempDocShell->DoInitNew( 0 ); SfxViewFrame* pTempFrame = SfxViewFrame::LoadHiddenDocument( *xTempDocShell, 0 ); -// pTempFrame->GetFrame().Appear(); SwView* pTempView = static_cast<SwView*>( pTempFrame->GetViewShell() ); pTargetView->GetWrtShell().StartAction(); SwgReaderOption aOpt; @@ -877,8 +805,6 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) String sCounter('_'); sCounter += String::CreateFromInt32(nDoc); sOutPath.Insert(sCounter, sOutPath.Len() - sExtension.Len() - 1); - //SfxStringItem aName(SID_FILE_NAME, sOutPath); - //SfxStringItem aFilter(SID_FILTER_NAME, sFilter); while(true) { @@ -921,9 +847,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) m_pWizard->enableButtons(WZB_FINISH, sal_True); return 0; } -/*-- 22.06.2004 11:51:30--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeOutputPage, PrinterChangeHdl_Impl, ListBox*, pBox) { if( m_pDocumentPrinterCopy && pBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ) @@ -959,17 +883,13 @@ IMPL_LINK(SwMailMergeOutputPage, PrinterChangeHdl_Impl, ListBox*, pBox) m_aPrinterSettingsPB.Disable(); m_pWizard->GetConfigItem().SetSelectedPrinter( pBox->GetSelectEntry() ); -// return m_pTempPrinter; return 0; } -/*-- 17.05.2004 13:51:02--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG) { SwView* pTargetView = m_pWizard->GetConfigItem().GetTargetView(); - DBG_ASSERT(pTargetView, "no target view exists"); + OSL_ENSURE(pTargetView, "no target view exists"); if(!pTargetView) return 0; @@ -993,7 +913,7 @@ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG) SwDocMergeInfo& rEndInfo = rConfigItem.GetDocumentMergeInfo(nEnd - 1); rtl::OUString sPages(rtl::OUString::valueOf( rStartInfo.nStartPageInTarget )); - sPages += rtl::OUString::createFromAscii( " - "); + sPages += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - ")); sPages += rtl::OUString::valueOf( rEndInfo.nEndPageInTarget ); SwWrtShell& rSh = pTargetView->GetWrtShell(); @@ -1007,14 +927,13 @@ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG) SfxObjectShell* pObjSh = pTargetView->GetViewFrame()->GetObjectShell(); SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), pObjSh)); rSh.GetNewDBMgr()->SetMergeType( DBMGR_MERGE_DOCUMENTS ); - //SfxDispatcher *pDis = pTargetView->GetViewFrame()->GetDispatcher(); SfxBoolItem aMergeSilent(SID_SILENT, sal_False); m_pWizard->enableButtons(WZB_CANCEL, sal_False); uno::Sequence < beans::PropertyValue > aProps( 2 ); - aProps[0]. Name = rtl::OUString::createFromAscii("MonitorVisible"); + aProps[0]. Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MonitorVisible")); aProps[0].Value <<= sal_True; - aProps[1]. Name = rtl::OUString::createFromAscii("Pages"); + aProps[1]. Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Pages")); aProps[1]. Value <<= sPages; pTargetView->ExecPrint( aProps, false, true ); @@ -1025,9 +944,7 @@ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG) m_pWizard->enableButtons(WZB_FINISH, sal_True); return 0; } -/*-- 17.05.2004 13:51:02--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeOutputPage, PrinterSetupHdl_Impl, PushButton*, pButton) { if( !m_pTempPrinter ) @@ -1036,9 +953,7 @@ IMPL_LINK(SwMailMergeOutputPage, PrinterSetupHdl_Impl, PushButton*, pButton) m_pTempPrinter->Setup(pButton); return 0; } -/*-- 14.06.2004 09:34:01--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeOutputPage, SendTypeHdl_Impl, ListBox*, pBox) { sal_uLong nDocType = (sal_uLong)pBox->GetEntryData(pBox->GetSelectEntryPos()); @@ -1065,9 +980,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendTypeHdl_Impl, ListBox*, pBox) } return 0; } -/*-- 17.05.2004 13:51:02--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwMailMergeOutputPage, SendAsHdl_Impl, PushButton*, pButton) { SwMailBodyDialog* pDlg = new SwMailBodyDialog(pButton, m_pWizard); @@ -1078,6 +991,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendAsHdl_Impl, PushButton*, pButton) } return 0; } + /*-- 21.05.2004 12:03:25--------------------------------------------------- Send documents as e-mail -----------------------------------------------------------------------*/ @@ -1087,7 +1001,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) //get the composed document SwView* pTargetView = rConfigItem.GetTargetView(); - DBG_ASSERT(pTargetView, "no target view exists"); + OSL_ENSURE(pTargetView, "no target view exists"); if(!pTargetView) return 0; @@ -1123,7 +1037,6 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) nEnd = rConfigItem.GetMergedDocumentCount(); } bool bAsBody = false; - bool bIsPDF = false; rtl_TextEncoding eEncoding = ::gsl_getSystemTextEncoding(); SfxFilterContainer* pFilterContainer = SwDocShell::Factory().GetFilterContainer(); const SfxFilter *pSfxFlt = 0; @@ -1132,7 +1045,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) switch( nDocType ) { case MM_DOCTYPE_OOO : break; - case MM_DOCTYPE_PDF : bIsPDF = true; + case MM_DOCTYPE_PDF : { //the method SwIOSystemGetFilterOfFormat( ) returns the template filter //because it uses the same user data :-( @@ -1225,7 +1138,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) } SfxStringItem aFilterName( SID_FILTER_NAME, pSfxFlt->GetFilterName() ); String sEMailColumn = m_aMailToLB.GetSelectEntry(); - DBG_ASSERT( sEMailColumn.Len(), "No email column selected"); + OSL_ENSURE( sEMailColumn.Len(), "No email column selected"); Reference< sdbcx::XColumnsSupplier > xColsSupp( rConfigItem.GetResultSet(), UNO_QUERY); Reference < container::XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : 0; if(!sEMailColumn.Len() || !xColAccess.is() || !xColAccess->hasByName(sEMailColumn)) @@ -1263,7 +1176,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) pDlg->ShowDialog(); //help to force painting the dialog //TODO/CLEANUP - //Sollbruchstelle + //predetermined breaking point for ( sal_Int16 i = 0; i < 25; i++) Application::Reschedule(); for(sal_uInt32 nDoc = nBegin; nDoc < nEnd; ++nDoc) @@ -1276,7 +1189,6 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) SfxObjectShellLock xTempDocShell( new SwDocShell( SFX_CREATE_MODE_STANDARD ) ); xTempDocShell->DoInitNew( 0 ); SfxViewFrame* pTempFrame = SfxViewFrame::LoadHiddenDocument( *xTempDocShell, 0 ); -// pTempFrame->GetFrame().Appear(); SwView* pTempView = static_cast<SwView*>( pTempFrame->GetViewShell() ); pTargetView->GetWrtShell().StartAction(); SwgReaderOption aOpt; @@ -1297,14 +1209,6 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) INetURLObject(), utl::TempFile::CreateTempName(0), URIHelper::GetMaybeFileHdl()) ); -/* if(bIsPDF) - { - SfxDispatcher* pSfxDispatcher = pTempView->GetViewFrame()->GetDispatcher(); - pSfxDispatcher->Execute( - SID_DIRECTEXPORTDOCASPDF, - SFX_CALLMODE_SYNCHRON, &aName, &aFilterName, 0L ); - } - else*/ { uno::Sequence< beans::PropertyValue > aFilterValues(MM_DOCTYPE_TEXT == nDocType ? 2 : 1); beans::PropertyValue* pFilterValues = aFilterValues.getArray(); @@ -1321,12 +1225,10 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) } xTempDocShell->DoClose(); -#ifdef DBG_UTIL - sal_Int32 nTarget = -#endif - rConfigItem.MoveResultSet(rInfo.nDBRow); - DBG_ASSERT( nTarget == rInfo.nDBRow, "row of current document could not be selected"); - DBG_ASSERT( sEMailColumn.Len(), "No email column selected"); + sal_Int32 nTarget = rConfigItem.MoveResultSet(rInfo.nDBRow); + OSL_ENSURE( nTarget == rInfo.nDBRow, "row of current document could not be selected"); + (void)nTarget; + OSL_ENSURE( sEMailColumn.Len(), "No email column selected"); ::rtl::OUString sEMail = lcl_GetColumnValueOf(sEMailColumn, xColAccess); SwMailDescriptor aDesc; aDesc.sEMail = sEMail; @@ -1341,7 +1243,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) pInStream->SetStreamCharSet( eEncoding ); else { - DBG_ERROR("no output file created?"); + OSL_ENSURE(false, "no output file created?"); continue; } ByteString sLine; @@ -1407,13 +1309,13 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) aDesc.sBodyContent = sBody; if(MM_DOCTYPE_HTML == nDocType) { - aDesc.sBodyMimeType = ::rtl::OUString::createFromAscii("text/html; charset="); + aDesc.sBodyMimeType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/html; charset=")); aDesc.sBodyMimeType += ::rtl::OUString::createFromAscii( rtl_getBestMimeCharsetFromTextEncoding( eEncoding )); } else aDesc.sBodyMimeType = - ::rtl::OUString::createFromAscii("text/plain; charset=UTF-8; format=flowed"); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/plain; charset=UTF-8; format=flowed")); aDesc.sSubject = m_aSubjectED.GetText(); aDesc.sCC = m_sCC; @@ -1438,3 +1340,5 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) //delete pDlg; return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmoutputpage.hxx b/sw/source/ui/dbui/mmoutputpage.hxx index f6e3987d1e..3ac11c0f4f 100644 --- a/sw/source/ui/dbui/mmoutputpage.hxx +++ b/sw/source/ui/dbui/mmoutputpage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,9 +28,7 @@ #ifndef _MAILMERGEOUTPUTPAGE_HXX #define _MAILMERGEOUTPUTPAGE_HXX #include <svtools/wizardmachine.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <svtools/stdctrl.hxx> #include <vcl/combobox.hxx> #include <vcl/field.hxx> @@ -51,9 +50,7 @@ namespace com{ namespace sun{ namespace star{ class XMailMessage; } }}} -/*-- 02.04.2004 09:21:06--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwMailMergeOutputPage : public svt::OWizardPage { SwBoldFixedInfo m_aHeaderFI; @@ -146,9 +143,7 @@ public: ~SwMailMergeOutputPage(); }; -/*-- 21.05.2004 12:48:50--------------------------------------------------- - -----------------------------------------------------------------------*/ struct SwMailDescriptor { ::rtl::OUString sEMail; @@ -201,7 +196,6 @@ class SW_DLLPUBLIC SwSendMailDialog : public ModelessDialog //SfxModalDialog bool m_bDesctructionEnabled; ImageList m_aImageList; - ImageList m_aImageListHC; SwSendMailDialog_Impl* m_pImpl; SwMailMergeConfigItem* m_pConfigItem; @@ -240,3 +234,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index 3885286239..da8312b53b 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,16 +38,10 @@ #include <mailmergewizard.hxx> #include <mmconfigitem.hxx> #include <vcl/msgbox.hxx> -#ifndef _DBUI_HRC #include <dbui.hrc> -#endif #include <swtypes.hxx> #include <mmoutputtypepage.hrc> -#include <dbui.hrc> - -/*-- 02.04.2004 11:06:55--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeOutputTypePage::SwMailMergeOutputTypePage( SwMailMergeWizard* _pParent) : svt::OWizardPage( _pParent, SW_RES(DLG_MM_OUTPUTTYPE_PAGE)), #ifdef MSC @@ -90,15 +85,11 @@ SwMailMergeOutputTypePage::SwMailMergeOutputTypePage( SwMailMergeWizard* _pParen TypeHdl_Impl(&m_aLetterRB); } -/*-- 02.04.2004 11:06:55--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeOutputTypePage::~SwMailMergeOutputTypePage() { } -/*-- 14.04.2004 14:44:07--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwMailMergeOutputTypePage, TypeHdl_Impl, RadioButton*, EMPTYARG ) { bool bLetter = m_aLetterRB.IsChecked(); @@ -111,3 +102,4 @@ IMPL_LINK( SwMailMergeOutputTypePage, TypeHdl_Impl, RadioButton*, EMPTYARG ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmoutputtypepage.hxx b/sw/source/ui/dbui/mmoutputtypepage.hxx index 9486b057d1..d79aad5eff 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.hxx +++ b/sw/source/ui/dbui/mmoutputtypepage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,15 +29,11 @@ #define _MAILMERGEOUTPUTTYPEPAGE_HXX #include <svtools/wizardmachine.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <svtools/stdctrl.hxx> #include <mailmergehelper.hxx> class SwMailMergeWizard; -/*-- 02.04.2004 09:21:06--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwMailMergeOutputTypePage : public svt::OWizardPage { SwBoldFixedInfo m_aHeaderFI; @@ -65,3 +62,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmpreparemergepage.cxx b/sw/source/ui/dbui/mmpreparemergepage.cxx index 5fe51c094e..63d27a9c85 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.cxx +++ b/sw/source/ui/dbui/mmpreparemergepage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,16 +35,10 @@ #include <mmpreparemergepage.hxx> #include <mailmergewizard.hxx> #include <mmconfigitem.hxx> -#ifndef _DBUI_HRC #include <dbui.hrc> -#endif #include <swtypes.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <wrtsh.hxx> #include <svx/dataaccessdescriptor.hxx> #include <com/sun/star/sdbc/XConnection.hpp> @@ -51,7 +46,6 @@ #include <mmpreparemergepage.hrc> -#include <dbui.hrc> #include <unomid.h> @@ -60,9 +54,6 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; using ::rtl::OUString; -/*-- 02.04.2004 16:42:49--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwMailMergePrepareMergePage::SwMailMergePrepareMergePage( SwMailMergeWizard* _pParent) : svt::OWizardPage( _pParent, SW_RES(DLG_MM_PREPAREMERGE_PAGE)), #ifdef MSC @@ -96,24 +87,18 @@ SwMailMergePrepareMergePage::SwMailMergePrepareMergePage( SwMailMergeWizard* _pP m_ExcludeCB.SetClickHdl(LINK(this, SwMailMergePrepareMergePage, ExcludeHdl_Impl)); aMoveLink.Call(&m_aRecordED); } -/*-- 02.04.2004 16:42:49--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergePrepareMergePage::~SwMailMergePrepareMergePage() { } -/*-- 13.05.2004 15:36:48--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwMailMergePrepareMergePage, EditDocumentHdl_Impl, PushButton*, EMPTYARG) { m_pWizard->SetRestartPage(MM_PREPAREMERGEPAGE); m_pWizard->EndDialog(RET_EDIT_DOC); return 0; } -/*-- 27.05.2004 14:16:37--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwMailMergePrepareMergePage, MoveHdl_Impl, void*, pCtrl) { SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); @@ -172,22 +157,19 @@ IMPL_LINK( SwMailMergePrepareMergePage, MoveHdl_Impl, void*, pCtrl) rSh.GetNewDBMgr()->MergeNew(aMergeDesc); return 0; } -/*-- 27.05.2004 14:46:28--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwMailMergePrepareMergePage, ExcludeHdl_Impl, CheckBox*, pBox) { SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); rConfigItem.ExcludeRecord( rConfigItem.GetResultSetPosition(), pBox->IsChecked()); return 0; }; -/*-- 18.08.2004 10:36:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMailMergePrepareMergePage::ActivatePage() { MoveHdl_Impl(&m_aRecordED); } + /*-- 13.05.2004 15:38:32--------------------------------------------------- merge the data into a new file -----------------------------------------------------------------------*/ @@ -202,3 +184,5 @@ sal_Bool SwMailMergePrepareMergePage::commitPage( ::svt::WizardTypes::CommitPag } return sal_True; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmpreparemergepage.hxx b/sw/source/ui/dbui/mmpreparemergepage.hxx index 53494b36d5..18f8f20d7a 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.hxx +++ b/sw/source/ui/dbui/mmpreparemergepage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,18 +29,14 @@ #define _MAILMERGEPREPAREMERGEPAGE_HXX #include <svtools/wizardmachine.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <vcl/field.hxx> #include <svtools/stdctrl.hxx> #include <mailmergehelper.hxx> #include "actctrl.hxx" class SwMailMergeWizard; -/*-- 02.04.2004 09:21:06--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwMailMergePrepareMergePage : public svt::OWizardPage { SwBoldFixedInfo m_aHeaderFI; @@ -75,3 +72,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx index a4e26be870..1eed784443 100644 --- a/sw/source/ui/dbui/selectdbtabledialog.cxx +++ b/sw/source/ui/dbui/selectdbtabledialog.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,9 +58,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; -/*-- 08.04.2004 14:33:56--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwSelectDBTableDialog::SwSelectDBTableDialog(Window* pParent, const uno::Reference< sdbc::XConnection>& rConnection) : SfxModalDialog(pParent, SW_RES(DLG_MM_SELECTDBTABLEDDIALOG)), @@ -148,15 +146,11 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(Window* pParent, } } } -/*-- 08.04.2004 14:33:57--------------------------------------------------- - -----------------------------------------------------------------------*/ SwSelectDBTableDialog::~SwSelectDBTableDialog() { } -/*-- 08.04.2004 14:33:57--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwSelectDBTableDialog, PreviewHdl, PushButton*, pButton) { SvLBoxEntry* pEntry = m_aTableLB.FirstSelected(); @@ -173,7 +167,7 @@ IMPL_LINK(SwSelectDBTableDialog, PreviewHdl, PushButton*, pButton) Reference<XPropertySet> xPrSet(xSource, UNO_QUERY); xPrSet->getPropertyValue(C2U("Name")) >>= sDataSourceName; } - DBG_ASSERT(sDataSourceName.getLength(), "no data source found"); + OSL_ENSURE(sDataSourceName.getLength(), "no data source found"); Sequence<PropertyValue> aProperties(5); PropertyValue* pProperties = aProperties.getArray(); pProperties[0].Name = C2U("DataSourceName"); @@ -195,18 +189,14 @@ IMPL_LINK(SwSelectDBTableDialog, PreviewHdl, PushButton*, pButton) return 0; } -/*-- 19.04.2004 10:03:26--------------------------------------------------- - -----------------------------------------------------------------------*/ String SwSelectDBTableDialog::GetSelectedTable(bool& bIsTable) { SvLBoxEntry* pEntry = m_aTableLB.FirstSelected(); bIsTable = pEntry->GetUserData() ? false : true; return pEntry ? m_aTableLB.GetEntryText(pEntry, 0) : String(); } -/*-- 13.05.2004 12:58:26--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSelectDBTableDialog::SetSelectedTable(const String& rTable, bool bIsTable) { SvLBoxEntry* pEntry = m_aTableLB.First(); @@ -221,3 +211,5 @@ void SwSelectDBTableDialog::SetSelectedTable(const String& rTable, bool bIsTab pEntry = m_aTableLB.Next( pEntry ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/selectdbtabledialog.hxx b/sw/source/ui/dbui/selectdbtabledialog.hxx index fe3721c482..a3398936f2 100644 --- a/sw/source/ui/dbui/selectdbtabledialog.hxx +++ b/sw/source/ui/dbui/selectdbtabledialog.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #include <sfx2/basedlgs.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <vcl/fixed.hxx> #include <svtools/svtabbx.hxx> #include <svtools/headbar.hxx> @@ -41,9 +40,6 @@ namespace com{namespace sun{namespace star{ } }}} -/*-- 08.04.2004 14:04:39--------------------------------------------------- - - -----------------------------------------------------------------------*/ class SwSelectDBTableDialog : public SfxModalDialog { FixedText m_aSelectFI; @@ -77,3 +73,4 @@ public: }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/swdbtoolsclient.cxx b/sw/source/ui/dbui/swdbtoolsclient.cxx index e45e2c5ae6..657935b6a0 100644 --- a/sw/source/ui/dbui/swdbtoolsclient.cxx +++ b/sw/source/ui/dbui/swdbtoolsclient.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,8 +36,6 @@ #include <osl/diagnose.h> #include <tools/solar.h> -//........................................................................ - using namespace ::connectivity::simple; using namespace ::com::sun::star; using namespace ::com::sun::star::sdbc; @@ -80,12 +79,11 @@ namespace } // ----------------------------------------------------------------------------- } -// ----------------------------------------------------------------------------- + SwDbtoolsClient::SwDbtoolsClient() { } -//-------------------------------------------------------------------- SwDbtoolsClient::~SwDbtoolsClient() { if(m_xDataAccessFactory.is()) @@ -98,7 +96,6 @@ SwDbtoolsClient::~SwDbtoolsClient() } } -//-------------------------------------------------------------------- extern "C" { static void SAL_CALL thisModule() {} } void SwDbtoolsClient::registerClient() @@ -109,9 +106,7 @@ void SwDbtoolsClient::registerClient() OSL_ENSURE(NULL == getDbToolsClientModule(), "SwDbtoolsClient::registerClient: inconsistence: already have a module!"); OSL_ENSURE(NULL == getDbToolsClientFactoryFunction(), "SwDbtoolsClient::registerClient: inconsistence: already have a factory function!"); - const ::rtl::OUString sModuleName = ::rtl::OUString::createFromAscii( - SVLIBRARY( "dbtools" ) - ); + const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM(SVLIBRARY("dbtools"))); // load the dbtools library getDbToolsClientModule() = osl_loadModuleRelative( @@ -120,7 +115,7 @@ void SwDbtoolsClient::registerClient() if (NULL != getDbToolsClientModule()) { // get the symbol for the method creating the factory - const ::rtl::OUString sFactoryCreationFunc = ::rtl::OUString::createFromAscii("createDataAccessToolsFactory"); + const ::rtl::OUString sFactoryCreationFunc(RTL_CONSTASCII_USTRINGPARAM("createDataAccessToolsFactory")); // reinterpret_cast<createDataAccessToolsFactoryFunction> removed for gcc permissive getDbToolsClientFactoryFunction() = reinterpret_cast< createDataAccessToolsFactoryFunction >( osl_getFunctionSymbol(getDbToolsClientModule(), sFactoryCreationFunc.pData)); @@ -135,7 +130,6 @@ void SwDbtoolsClient::registerClient() } } -//-------------------------------------------------------------------- void SwDbtoolsClient::revokeClient() { ::osl::MutexGuard aGuard(getDbtoolsClientMutex()); @@ -147,9 +141,7 @@ void SwDbtoolsClient::revokeClient() getDbToolsClientModule() = NULL; } } -/* -----------------------------30.08.2001 14:58------------------------------ - ---------------------------------------------------------------------------*/ void SwDbtoolsClient::getFactory() { if(!m_xDataAccessFactory.is()) @@ -169,9 +161,7 @@ void SwDbtoolsClient::getFactory() } } } -/* -----------------------------30.08.2001 11:32------------------------------ - ---------------------------------------------------------------------------*/ ::rtl::Reference< ::connectivity::simple::IDataAccessTools > SwDbtoolsClient::getDataAccessTools() { @@ -183,9 +173,7 @@ void SwDbtoolsClient::getFactory() } return m_xDataAccessTools; } -/* -----------------------------30.08.2001 12:40------------------------------ - ---------------------------------------------------------------------------*/ ::rtl::Reference< ::connectivity::simple::IDataAccessTypeConversion > SwDbtoolsClient::getAccessTypeConversion() { @@ -198,9 +186,6 @@ void SwDbtoolsClient::getFactory() return m_xAccessTypeConversion; } -/* -----------------------------30.08.2001 11:37------------------------------ - - ---------------------------------------------------------------------------*/ Reference< XDataSource > SwDbtoolsClient::getDataSource( const ::rtl::OUString& rRegisteredName, const Reference< XMultiServiceFactory>& xFactory @@ -212,9 +197,7 @@ Reference< XDataSource > SwDbtoolsClient::getDataSource( xRet = xAccess->getDataSource(rRegisteredName, xFactory); return xRet; } -/* -----------------------------30.08.2001 12:06------------------------------ - ---------------------------------------------------------------------------*/ sal_Int32 SwDbtoolsClient::getDefaultNumberFormat( const Reference< XPropertySet >& rxColumn, const Reference< XNumberFormatTypes >& rxTypes, @@ -227,9 +210,7 @@ sal_Int32 SwDbtoolsClient::getDefaultNumberFormat( nRet = xAccess->getDefaultNumberFormat( rxColumn, rxTypes, rLocale); return nRet; } -/* -----------------------------30.08.2001 12:38------------------------------ - ---------------------------------------------------------------------------*/ ::rtl::OUString SwDbtoolsClient::getFormattedValue( const uno::Reference< beans::XPropertySet>& _rxColumn, const uno::Reference< util::XNumberFormatter>& _rxFormatter, @@ -246,3 +227,4 @@ sal_Int32 SwDbtoolsClient::getDefaultNumberFormat( return sRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx index a05b114987..e0dbe64e3c 100644 --- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -144,9 +145,7 @@ struct SpellState pOtherCursor = 0; } }; -/*-- 30.10.2003 14:33:26--------------------------------------------------- - -----------------------------------------------------------------------*/ void lcl_LeaveDrawText(SwWrtShell& rSh) { if(rSh.GetDrawView()) @@ -159,9 +158,7 @@ void lcl_LeaveDrawText(SwWrtShell& rSh) rSh.GetView().AttrChangedNotify(&rSh); } } -/*-- 09.09.2003 10:39:22--------------------------------------------------- - -----------------------------------------------------------------------*/ SwSpellDialogChildWindow::SwSpellDialogChildWindow ( Window* _pParent, sal_uInt16 nId, @@ -175,9 +172,7 @@ SwSpellDialogChildWindow::SwSpellDialogChildWindow ( String aPropName( String::CreateFromAscii(UPN_IS_GRAMMAR_INTERACTIVE ) ); SvtLinguConfig().GetProperty( aPropName ) >>= m_bIsGrammarCheckingOn; } -/*-- 09.09.2003 10:39:22--------------------------------------------------- - -----------------------------------------------------------------------*/ SwSpellDialogChildWindow::~SwSpellDialogChildWindow () { SwWrtShell* pWrtShell = GetWrtShell_Impl(); @@ -186,9 +181,7 @@ SwSpellDialogChildWindow::~SwSpellDialogChildWindow () delete m_pSpellState; } -/*-- 09.09.2003 12:40:07--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxChildWinInfo SwSpellDialogChildWindow::GetInfo (void) const { SfxChildWinInfo aInfo = svx::SpellDialogChildWindow::GetInfo(); @@ -196,10 +189,7 @@ SfxChildWinInfo SwSpellDialogChildWindow::GetInfo (void) const return aInfo; } -/*-- 09.09.2003 10:39:40--------------------------------------------------- - - -----------------------------------------------------------------------*/ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence(bool bRecheck) { svx::SpellPortions aRet; @@ -409,7 +399,7 @@ The code below would only be part of the solution. bool bCloseMessage = true; if(!aRet.size() && !m_pSpellState->m_bStartedInSelection) { - DBG_ASSERT(m_pSpellState->m_bDrawingsSpelled && + OSL_ENSURE(m_pSpellState->m_bDrawingsSpelled && m_pSpellState->m_bOtherSpelled && m_pSpellState->m_bBodySpelled, "not all parts of the document are already spelled"); if(m_pSpellState->m_xStartRange.is()) @@ -457,13 +447,11 @@ The code below would only be part of the solution. return aRet; } -/*-- 09.09.2003 10:39:40--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rChanged, bool bRecheck) { SwWrtShell* pWrtShell = GetWrtShell_Impl(); - DBG_ASSERT(!m_pSpellState->m_bInitialCall, "ApplyChangedSentence in initial call or after resume"); + OSL_ENSURE(!m_pSpellState->m_bInitialCall, "ApplyChangedSentence in initial call or after resume"); if(pWrtShell && !m_pSpellState->m_bInitialCall) { ShellModes eSelMode = pWrtShell->GetView().GetShellMode(); @@ -489,39 +477,29 @@ void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rC } } } -/*-- 21.10.2003 09:33:57--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSpellDialogChildWindow::AddAutoCorrection( const String& rOld, const String& rNew, LanguageType eLanguage) { SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect(); pACorr->PutText( rOld, rNew, eLanguage ); } -/*-- 21.10.2003 09:33:59--------------------------------------------------- - -----------------------------------------------------------------------*/ bool SwSpellDialogChildWindow::HasAutoCorrection() { return true; } -/*-- 16.06.2008 11:59:17--------------------------------------------------- - -----------------------------------------------------------------------*/ bool SwSpellDialogChildWindow::HasGrammarChecking() { return SvtLinguConfig().HasGrammarChecker(); } -/*-- 18.06.2008 12:27:11--------------------------------------------------- - -----------------------------------------------------------------------*/ bool SwSpellDialogChildWindow::IsGrammarChecking() { return m_bIsGrammarCheckingOn; } -/*-- 18.06.2008 12:27:11--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSpellDialogChildWindow::SetGrammarChecking(bool bOn) { uno::Any aVal; @@ -547,7 +525,7 @@ void SwSpellDialogChildWindow::SetGrammarChecking(bool bOn) { SdrView* pSdrView = pWrtShell->GetDrawView(); SdrOutliner* pOutliner = pSdrView ? pSdrView->GetTextEditOutliner() : 0; - DBG_ASSERT(pOutliner, "No Outliner in SwSpellDialogChildWindow::SetGrammarChecking"); + OSL_ENSURE(pOutliner, "No Outliner in SwSpellDialogChildWindow::SetGrammarChecking"); if(pOutliner) { pOutliner->PutSpellingToSentenceStart( pSdrView->GetTextEditOutlinerView()->GetEditView() ); @@ -555,9 +533,7 @@ void SwSpellDialogChildWindow::SetGrammarChecking(bool bOn) } } } -/*-- 28.10.2003 08:41:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSpellDialogChildWindow::GetFocus() { if(m_pSpellState->m_bLockFocus) @@ -599,7 +575,7 @@ void SwSpellDialogChildWindow::GetFocus() else { OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); - DBG_ASSERT(pOLV, "no OutlinerView in SwSpellDialogChildWindow::GetFocus()"); + OSL_ENSURE(pOLV, "no OutlinerView in SwSpellDialogChildWindow::GetFocus()"); if(!pOLV || !m_pSpellState->m_aESelection.IsEqual(pOLV->GetSelection())) bInvalidate = true; } @@ -616,9 +592,7 @@ void SwSpellDialogChildWindow::GetFocus() if(bInvalidate) InvalidateSpellDialog(); } -/*-- 28.10.2003 08:41:09--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSpellDialogChildWindow::LoseFocus() { //prevent initial invalidation @@ -655,7 +629,7 @@ void SwSpellDialogChildWindow::LoseFocus() SdrOutliner* pOutliner = pSdrView->GetTextEditOutliner(); m_pSpellState->m_pOutliner = pOutliner; OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); - DBG_ASSERT(pOutliner && pOLV, "no Outliner/OutlinerView in SwSpellDialogChildWindow::LoseFocus()"); + OSL_ENSURE(pOutliner && pOLV, "no Outliner/OutlinerView in SwSpellDialogChildWindow::LoseFocus()"); if(pOLV) { m_pSpellState->m_aESelection = pOLV->GetSelection(); @@ -668,9 +642,7 @@ void SwSpellDialogChildWindow::LoseFocus() else m_pSpellState->m_eSelMode = SHELL_MODE_OBJECT; } -/*-- 18.09.2003 12:50:18--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSpellDialogChildWindow::InvalidateSpellDialog() { SwWrtShell* pWrtShell = GetWrtShell_Impl(); @@ -680,9 +652,6 @@ void SwSpellDialogChildWindow::InvalidateSpellDialog() svx::SpellDialogChildWindow::InvalidateSpellDialog(); } -/*-- 18.09.2003 12:54:59--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwWrtShell* SwSpellDialogChildWindow::GetWrtShell_Impl() { SfxDispatcher* pDispatch = GetBindings().GetDispatcher(); @@ -701,7 +670,7 @@ SwWrtShell* SwSpellDialogChildWindow::GetWrtShell_Impl() return pView ? pView->GetWrtShellPtr(): 0; } -/*-- 13.10.2003 15:19:04--------------------------------------------------- +/*------------------------------------------------------------------------- set the cursor into the body text - necessary if any object is selected on start of the spelling dialog -----------------------------------------------------------------------*/ @@ -715,7 +684,7 @@ bool SwSpellDialogChildWindow::MakeTextSelection_Impl(SwWrtShell& rShell, ShellM case SHELL_MODE_TABLE_TEXT: case SHELL_MODE_TABLE_LIST_TEXT: case SHELL_MODE_DRAWTEXT: - DBG_ERROR("text already active in SwSpellDialogChildWindow::MakeTextSelection_Impl()"); + OSL_ENSURE(false, "text already active in SwSpellDialogChildWindow::MakeTextSelection_Impl()"); break; case SHELL_MODE_FRAME: @@ -770,7 +739,7 @@ bool SwSpellDialogChildWindow::MakeTextSelection_Impl(SwWrtShell& rShell, ShellM } return true; } -/*-- 13.10.2003 15:20:09--------------------------------------------------- +/*------------------------------------------------------------------------- select the next draw text object that has a spelling error -----------------------------------------------------------------------*/ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh) @@ -893,15 +862,13 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh) return bNextDoc; } -/*-- 13.10.2003 15:24:27--------------------------------------------------- - -----------------------------------------------------------------------*/ bool SwSpellDialogChildWindow::SpellDrawText_Impl(SwWrtShell& rSh, ::svx::SpellPortions& rPortions) { bool bRet = false; SdrView* pSdrView = rSh.GetDrawView(); SdrOutliner* pOutliner = pSdrView ? pSdrView->GetTextEditOutliner() : 0; - DBG_ASSERT(pOutliner, "No Outliner in SwSpellDialogChildWindow::SpellDrawText_Impl"); + OSL_ENSURE(pOutliner, "No Outliner in SwSpellDialogChildWindow::SpellDrawText_Impl"); if(pOutliner) { bRet = pOutliner->SpellSentence(pSdrView->GetTextEditOutlinerView()->GetEditView(), rPortions, m_bIsGrammarCheckingOn); @@ -922,13 +889,12 @@ bool SwSpellDialogChildWindow::SpellDrawText_Impl(SwWrtShell& rSh, ::svx::SpellP } return bRet; } -/*-- 30.10.2003 14:54:59--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSpellDialogChildWindow::LockFocusNotification(bool bLock) { - DBG_ASSERT(m_pSpellState->m_bLockFocus != bLock, "invalid locking - no change of state"); + OSL_ENSURE(m_pSpellState->m_bLockFocus != bLock, "invalid locking - no change of state"); m_pSpellState->m_bLockFocus = bLock; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/abstract.cxx b/sw/source/ui/dialog/abstract.cxx index 53af6b6625..056c06c7a3 100644 --- a/sw/source/ui/dialog/abstract.cxx +++ b/sw/source/ui/dialog/abstract.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,10 +42,6 @@ #include "abstract.hrc" -/*-----------------22.02.97 15.32------------------- - ---------------------------------------------------*/ - SwInsertAbstractDlg::SwInsertAbstractDlg( Window* pParent ) : SfxModalDialog(pParent, SW_RES(DLG_INSERT_ABSTRACT)), aFL (this, SW_RES(FL_1 )), @@ -60,25 +57,14 @@ SwInsertAbstractDlg::SwInsertAbstractDlg( Window* pParent ) : FreeResource(); } -/*-----------------22.02.97 15.32------------------- - ---------------------------------------------------*/ - SwInsertAbstractDlg::~SwInsertAbstractDlg() { } -/*-----------------22.02.97 15.34------------------- - ---------------------------------------------------*/ - sal_uInt8 SwInsertAbstractDlg::GetLevel() const { return static_cast< sal_uInt8 >(aLevelNF.GetValue() - 1); } -/*-----------------22.02.97 15.34------------------- - ---------------------------------------------------*/ sal_uInt8 SwInsertAbstractDlg::GetPara() const { @@ -90,3 +76,4 @@ sal_uInt8 SwInsertAbstractDlg::GetPara() const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/abstract.src b/sw/source/ui/dialog/abstract.src index a29b7e6339..5abdc5aff0 100644 --- a/sw/source/ui/dialog/abstract.src +++ b/sw/source/ui/dialog/abstract.src @@ -34,9 +34,6 @@ ModalDialog DLG_INSERT_ABSTRACT OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 239 , 68 ) ; - /* ### ACHTUNG: Neuer Text in Resource? AutoAbstract erzeugen : AutoAbstrakt erzeugen */ - /* ### ACHTUNG: Neuer Text in Resource? AutoAbstract erzeugen : AutoAbstrakt erzeugen */ - /* ### ACHTUNG: Neuer Text in Resource? AutoAbstract erzeugen : AutoAbstrakt erzeugen */ Moveable = TRUE ; FixedLine FL_1 { @@ -71,7 +68,6 @@ ModalDialog DLG_INSERT_ABSTRACT { Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 120 , 8 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Abs�tze je Kapitel : Abs�tze je Kapitel */ Text [ en-US ] = "Subpoints per level" ; }; NumericField NF_PARA @@ -94,7 +90,6 @@ ModalDialog DLG_INSERT_ABSTRACT { Pos = MAP_APPFONT ( 12 , 43 ) ; Size = MAP_APPFONT ( 165 , 16 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Im Abstrakt erscheint die ausgew�hlte Anzahl von Abs�tzen aus den einbezogenen Kapitelebenen. : Im Abstrakt erscheint die ausgew�hlte Anzahl von Abs�tzen aus den einbezogenen Kapitelebenen. */ WordBreak = TRUE ; Text [ en-US ] = "The abstract contains the selected number of paragraphs from the included outline levels." ; }; diff --git a/sw/source/ui/dialog/addrdlg.cxx b/sw/source/ui/dialog/addrdlg.cxx index 4fe00e88cd..dc3c36811b 100644 --- a/sw/source/ui/dialog/addrdlg.cxx +++ b/sw/source/ui/dialog/addrdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,19 +37,13 @@ #include <svx/svxdlg.hxx> #include <sfx2/sfx.hrc> -/**************************************************************************** -Ctor -****************************************************************************/ - - SwAddrDlg::SwAddrDlg(Window* pParent, const SfxItemSet& rSet ) : SfxSingleTabDialog(pParent, rSet, 0) { - // TabPage erzeugen SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SFXPAGE_GENERAL ); if ( fnCreatePage ) { @@ -57,13 +52,9 @@ SwAddrDlg::SwAddrDlg(Window* pParent, const SfxItemSet& rSet ) : } } -/**************************************************************************** -Dtor -****************************************************************************/ - - -__EXPORT SwAddrDlg::~SwAddrDlg() +SwAddrDlg::~SwAddrDlg() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx index 5be1d1978d..11fa3926ed 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,14 +50,9 @@ #include <shellio.hxx> #include <docsh.hxx> #include <doc.hxx> -#include <errhdl.hxx> -#ifndef _DIALOG_HRC #include <dialog.hrc> -#endif -#ifndef _ASCFLDLG_HRC #include <ascfldlg.hrc> -#endif #include "vcl/metric.hxx" @@ -64,8 +60,8 @@ using namespace ::com::sun::star; const sal_Unicode cDialogExtraDataClose = '}'; -const char __FAR_DATA sDialogImpExtraData[] = "EncImpDlg:{"; -const char __FAR_DATA sDialogExpExtraData[] = "EncExpDlg:{"; +const char sDialogImpExtraData[] = "EncImpDlg:{"; +const char sDialogExpExtraData[] = "EncExpDlg:{"; const sal_uInt16 nDialogExtraDataLen = 11; // 12345678901 SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh, @@ -125,8 +121,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh, aBuffer[ nBytesRead + 2 ] = '0'; } - sal_Bool bCR = sal_False, bLF = sal_False, bNoNormalChar = sal_False, - bNullChar = sal_False; + sal_Bool bCR = sal_False, bLF = sal_False, bNullChar = sal_False; for( sal_uInt16 nCnt = 0; nCnt < nBytesRead; ++nCnt ) switch( aBuffer[ nCnt ] ) { @@ -136,9 +131,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh, case 0xC: case 0x1A: case 0x9: break; - default: - if( 0x20 > aBuffer[ nCnt ] ) - bNoNormalChar = sal_True; + default: break; } if( !bNullChar ) @@ -148,21 +141,15 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh, if( bLF ) { aOpt.SetParaFlags( LINEEND_CRLF ); -// have to check if of CharSet is type of ANSI -// aOpt.SetCharSet( CHARSET_ANSI ); } else { aOpt.SetParaFlags( LINEEND_CR ); -// have to check if CharSet is type of MAC -// aOpt.SetCharSet( CHARSET_MAC ); } } else if( bLF ) { aOpt.SetParaFlags( LINEEND_LF ); -// have to check if of CharSet is type of ANSI -// aOpt.SetCharSet( CHARSET_ANSI ); } } @@ -228,7 +215,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh, delete pPrt; } - // initialisiere Sprache + // initialise language { if( !aOpt.GetLanguage() ) { @@ -291,7 +278,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh, SetSizePixel( aSize ); } - // initialisiere Zeichensatz + // initialise character set aCharSetLB.FillFromTextEncodingTable( pStream != NULL ); aCharSetLB.SelectTextEncoding( aOpt.GetCharSet() ); @@ -329,7 +316,7 @@ void SwAsciiFilterDlg::FillOptions( SwAsciiOptions& rOptions ) rOptions.SetLanguage( sal_uInt16( nLng ) ); rOptions.SetParaFlags( GetCRLF() ); - // JP: Task #71802# save the user settings + // save the user settings String sData; rOptions.WriteUserData( sData ); if( sData.Len() ) @@ -460,3 +447,4 @@ IMPL_LINK( SwAsciiFilterDlg, LineEndHdl, RadioButton*, pBtn ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/dialog.src b/sw/source/ui/dialog/dialog.src index f3df744189..599594ea38 100644 --- a/sw/source/ui/dialog/dialog.src +++ b/sw/source/ui/dialog/dialog.src @@ -28,7 +28,6 @@ CheckBox CB_USE_PASSWD { - /* ### ACHTUNG: Neuer Text in Resource? ~Pa�wort : ~Pa�wort */ Text [ en-US ] = "~Password" ; }; CheckBox CB_READ_ONLY @@ -37,7 +36,6 @@ CheckBox CB_READ_ONLY }; String STR_LINKEDIT_TEXT { - /* ### ACHTUNG: Neuer Text in Resource? Verkn�pfungen bearbeiten : Verkn�pfungen bearbeiten */ Text [ en-US ] = "Edit links" ; }; String STR_PATH_NOT_FOUND diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx index 39fa7edafa..12b5738520 100644 --- a/sw/source/ui/dialog/docstdlg.cxx +++ b/sw/source/ui/dialog/docstdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,37 +37,20 @@ #include <ctype.h> #include <swwait.hxx> #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <swmodule.hxx> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif -#ifndef _PVIEW_HXX #include <pview.hxx> -#endif #include <doc.hxx> #include <docstdlg.hxx> -#ifndef _MODCFG_HXX #include <modcfg.hxx> -#endif -// fuer Statistikfelder +// for statistics fields #include <fldmgr.hxx> #include <fldbas.hxx> -#ifndef _DOCSTDLG_HRC #include <docstdlg.hrc> -#endif - - -/*-------------------------------------------------------------------- - Beschreibung: Create - --------------------------------------------------------------------*/ SfxTabPage * SwDocStatPage::Create(Window *pParent, const SfxItemSet &rSet) @@ -74,11 +58,6 @@ SfxTabPage * SwDocStatPage::Create(Window *pParent, const SfxItemSet &rSet) return new SwDocStatPage(pParent, rSet); } -/*-------------------------------------------------------------------- - Beschreibung: Ctor - --------------------------------------------------------------------*/ - - SwDocStatPage::SwDocStatPage(Window *pParent, const SfxItemSet &rSet) : SfxTabPage (pParent, SW_RES(TP_DOC_STAT), rSet), @@ -121,7 +100,7 @@ SwDocStatPage::SwDocStatPage(Window *pParent, const SfxItemSet &rSet) : } /*-------------------------------------------------------------------- - Beschreibung: ItemSet fuellen bei Aenderung + Description: fill ItemSet when changed --------------------------------------------------------------------*/ @@ -130,16 +109,11 @@ sal_Bool SwDocStatPage::FillItemSet(SfxItemSet & /*rSet*/) return sal_False; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwDocStatPage::Reset(const SfxItemSet &/*rSet*/) { } /*------------------------------------------------------------------------ - Beschreibung: Aktualisieren / Setzen der Daten + Description: update / set data ------------------------------------------------------------------------*/ @@ -155,7 +129,7 @@ void SwDocStatPage::SetData(const SwDocStat &rStat) } /*------------------------------------------------------------------------ - Beschreibung: Aktualisieren der Statistik + Description: update statistics ------------------------------------------------------------------------*/ @@ -168,7 +142,7 @@ void SwDocStatPage::Update() else if ( pVSh->ISA(SwPagePreView) ) pSh = ((SwPagePreView*)pVSh)->GetViewShell(); - ASSERT( pSh, "Shell not found" ); + OSL_ENSURE( pSh, "Shell not found" ); SwWait aWait( *pSh->GetDoc()->GetDocShell(), sal_True ); pSh->StartAction(); @@ -180,7 +154,7 @@ void SwDocStatPage::Update() } /*-----------------19.06.97 16.37------------------- - Zeilennummer aktualisieren + upate line number --------------------------------------------------*/ IMPL_LINK( SwDocStatPage, UpdateHdl, PushButton*, EMPTYARG) { @@ -193,3 +167,4 @@ IMPL_LINK( SwDocStatPage, UpdateHdl, PushButton*, EMPTYARG) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx index 2e7bb7e52b..69b8d43773 100644 --- a/sw/source/ui/dialog/macassgn.cxx +++ b/sw/source/ui/dialog/macassgn.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,9 +39,7 @@ #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> #include <svx/htmlmode.hxx> -#ifndef _SVX_SVXIDS_HRC //autogen #include <svx/svxids.hrc> -#endif #include <sfx2/app.hxx> #include <vcl/msgbox.hxx> @@ -63,7 +62,6 @@ using ::com::sun::star::frame::XFrame; SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType ) { - // const SfxItemSet& rSet = rPg.GetItemSet(); SfxEventNamesItem aItem(SID_EVENTCONFIG); sal_Bool bHtmlMode = sal_False; @@ -72,17 +70,15 @@ SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType ) switch( eType ) { - case MACASSGN_TEXTBAUST: // Textbausteine - // rPg.SetGetRangeLink( &_GetRangeHdl ); + case MACASSGN_AUTOTEXT: aItem.AddEvent( String( SW_RES(STR_EVENT_START_INS_GLOSSARY) ), String(), SW_EVENT_START_INS_GLOSSARY ); aItem.AddEvent( String( SW_RES(STR_EVENT_END_INS_GLOSSARY) ), String(), SW_EVENT_END_INS_GLOSSARY); - // damit der neue Handler aktiv wird! - // rPg.Reset( rSet ); + // in order for the new handler to become active! break; case MACASSGN_ALLFRM: - case MACASSGN_GRAPHIC: // Grafiken + case MACASSGN_GRAPHIC: // graphics { aItem.AddEvent( String( SW_RES(STR_EVENT_IMAGE_ERROR) ), String(), SVX_EVENT_IMAGE_ERROR); @@ -91,8 +87,8 @@ SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType ) aItem.AddEvent( String( SW_RES(STR_EVENT_IMAGE_LOAD) ), String(), SVX_EVENT_IMAGE_LOAD); } - // kein break; - case MACASSGN_FRMURL: // Frm - URL-Attribute + // no break; + case MACASSGN_FRMURL: // Frm - URL-Attributes { if( !bHtmlMode && (MACASSGN_FRMURL == eType || MACASSGN_ALLFRM == eType)) @@ -107,15 +103,15 @@ SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType ) SW_EVENT_FRM_MOVE ); } } - // kein break; + // no break; case MACASSGN_OLE: // OLE { if( !bHtmlMode ) aItem.AddEvent( String( SW_RES(STR_EVENT_OBJECT_SELECT) ), String(), SW_EVENT_OBJECT_SELECT ); } - // kein break; - case MACASSGN_INETFMT: // INetFmt-Attribute + // no break; + case MACASSGN_INETFMT: // INetFmt-Attributes { aItem.AddEvent( String( SW_RES(STR_EVENT_MOUSEOVER_OBJECT) ), String(), SFX_EVENT_MOUSEOVER_OBJECT ); @@ -161,3 +157,5 @@ sal_Bool SwMacroAssignDlg::INetFmtDlg( Window* pParent, SwWrtShell& rSh, } return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/sw/source/ui/dialog/regionsw.cxx b/sw/source/ui/dialog/regionsw.cxx index e1c8f636d8..fe6d9132de 100644 --- a/sw/source/ui/dialog/regionsw.cxx +++ b/sw/source/ui/dialog/regionsw.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,7 +53,7 @@ #include <view.hxx> #include <swmodule.hxx> #include <wrtsh.hxx> -#include <swundo.hxx> // fuer Undo-Ids +#include <swundo.hxx> // for Undo-Ids #include <column.hxx> #include <fmtfsize.hxx> #include <swunodef.hxx> @@ -67,11 +68,6 @@ #include <svx/dlgutil.hxx> #include "swabstdlg.hxx" -/*-------------------------------------------------------------------- - Beschreibung: Bereiche einfuegen - --------------------------------------------------------------------*/ - - void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) { SwWrtShell& rSh = GetShell(); @@ -95,13 +91,13 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) long nWidth = aRect.Width(); aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth)); - // Hoehe=Breite fuer konsistentere Vorschau (analog zu Bereich bearbeiten) + // height=width for more consistent preview (analog to edit region) aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog( DLG_INSERT_SECTION, &GetView().GetViewFrame()->GetWindow(), aSet , rSh); - DBG_ASSERT(aTabDlg, "Dialogdiet fail!"); + OSL_ENSURE(aTabDlg, "Dialogdiet fail!"); aTabDlg->Execute(); rReq.Ignore(); delete aTabDlg; @@ -147,17 +143,15 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) const sal_Bool bProtect = SFX_ITEM_SET == pSet->GetItemState(FN_PARAM_REGION_PROTECT, sal_True, &pItem)? (sal_Bool)((const SfxBoolItem *)pItem)->GetValue():sal_False; - // --> FME 2004-06-22 #114856# edit in readonly sections + // #114856# edit in readonly sections const sal_Bool bEditInReadonly = SFX_ITEM_SET == pSet->GetItemState(FN_PARAM_REGION_EDIT_IN_READONLY, sal_True, &pItem)? (sal_Bool)((const SfxBoolItem *)pItem)->GetValue():sal_False; - // <-- aSection.SetProtectFlag(bProtect); aSection.SetHidden(bHidden); - // --> FME 2004-06-22 #114856# edit in readonly sections + // #114856# edit in readonly sections aSection.SetEditInReadonlyFlag(bEditInReadonly); - // <-- if(SFX_ITEM_SET == pSet->GetItemState(FN_PARAM_REGION_CONDITION, sal_True, &pItem)) @@ -208,13 +202,13 @@ IMPL_STATIC_LINK( SwWrtShell, InsertRegionDialog, SwSectionData*, pSect ) pThis->CalcBoundRect(aRect, FLY_AS_CHAR); long nWidth = aRect.Width(); aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth)); - // Hoehe=Breite fuer konsistentere Vorschau (analog zu Bereich bearbeiten) + // height=width for more consistent preview (analog to edit region) aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog( DLG_INSERT_SECTION, &pThis->GetView().GetViewFrame()->GetWindow(),aSet , *pThis); - DBG_ASSERT(aTabDlg, "Dialogdiet fail!"); + OSL_ENSURE(aTabDlg, "Dialogdiet fail!"); aTabDlg->SetSectionData(*pSectionData); aTabDlg->Execute(); @@ -223,10 +217,6 @@ IMPL_STATIC_LINK( SwWrtShell, InsertRegionDialog, SwSectionData*, pSect ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: Bereich bearbeiten - --------------------------------------------------------------------*/ - void SwBaseShell::EditRegionDialog(SfxRequest& rReq) { const SfxItemSet* pArgs = rReq.GetArgs(); @@ -245,10 +235,10 @@ void SwBaseShell::EditRegionDialog(SfxRequest& rReq) if(bStart) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractEditRegionDlg* pEditRegionDlg = pFact->CreateEditRegionDlg( MD_EDIT_REGION, pParentWin, rWrtShell); - DBG_ASSERT(pEditRegionDlg, "Dialogdiet fail!"); + OSL_ENSURE(pEditRegionDlg, "Dialogdiet fail!"); if(pItem && pItem->ISA(SfxStringItem)) { pEditRegionDlg->SelectSection(((const SfxStringItem*)pItem)->GetValue()); @@ -262,3 +252,5 @@ void SwBaseShell::EditRegionDialog(SfxRequest& rReq) break; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/regionsw.hrc b/sw/source/ui/dialog/regionsw.hrc index d396053ab2..c5a76caf6f 100644 --- a/sw/source/ui/dialog/regionsw.hrc +++ b/sw/source/ui/dialog/regionsw.hrc @@ -83,13 +83,11 @@ #define FL_END 52 #define FL_FTN 53 #define IL_BITMAPS 54 -#define ILH_BITMAPS 55 -// --> FME 2004-06-22 #114856# edit in readonly sections +// #114856# edit in readonly sections #define FL_PROPERTIES 56 #define CB_EDIT_IN_READONLY 57 -// <-- -/* Globale Resourcen */ +/* global resources */ #define STR_REG_DUPLICATE (RC_REGIONSW_BEGIN+6) #define STR_INFO_DUPLICATE (RC_REGIONSW_BEGIN+7) diff --git a/sw/source/ui/dialog/regionsw.src b/sw/source/ui/dialog/regionsw.src index 833426fd8a..8f249a890f 100644 --- a/sw/source/ui/dialog/regionsw.src +++ b/sw/source/ui/dialog/regionsw.src @@ -31,7 +31,7 @@ #include "helpid.h" /************************************************************************* - Dialog "Bereich einfuegen" + Dialog "paste region" *************************************************************************/ #define FT_SUBREG_TEXT \ @@ -82,7 +82,7 @@ /************************************************************************* - Dialog "Bereiche bearbeiten" + Dialog "edit region" *************************************************************************/ ModalDialog MD_EDIT_REGION @@ -326,12 +326,6 @@ ModalDialog MD_EDIT_REGION MaskColor = IMAGE_MASK_COLOR ; DLG_IMAGE_IDLIST }; - ImageList ILH_BITMAPS - { - Prefix = "reh"; - MaskColor = IMAGE_MASK_COLOR ; - DLG_IMAGE_IDLIST - }; }; String STR_REG_DUPLICATE { diff --git a/sw/source/ui/dialog/swabstdlg.cxx b/sw/source/ui/dialog/swabstdlg.cxx index 1cf7463d85..4b8de38dee 100644 --- a/sw/source/ui/dialog/swabstdlg.cxx +++ b/sw/source/ui/dialog/swabstdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,8 +46,10 @@ SwAbstractDialogFactory* SwAbstractDialogFactory::Create() static const ::rtl::OUString sLibName(::vcl::unohelper::CreateLibraryName("swui", sal_True)); if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( sLibName ) ) ) fp = ( SwAbstractDialogFactory* (__LOADONCALLAPI*)() ) - aDialogLibrary.getFunctionSymbol( ::rtl::OUString::createFromAscii("CreateDialogFactory") ); + aDialogLibrary.getFunctionSymbol( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CreateDialogFactory"))); if ( fp ) return fp(); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/swdialmgr.cxx b/sw/source/ui/dialog/swdialmgr.cxx index 37d6762d35..7ff123857d 100644 --- a/sw/source/ui/dialog/swdialmgr.cxx +++ b/sw/source/ui/dialog/swdialmgr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,7 +40,7 @@ #include <sfx2/app.hxx> //copy from core\bastyp\swtypes.cxx -String aEmptyStr; // Konstante Strings +String aEmptyStr; // constant strings ResMgr* pSwResMgr=0; @@ -52,3 +53,5 @@ ResMgr* SwDialogsResMgr::GetResMgr() return pSwResMgr; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index fa885838d2..96cd7eae99 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,13 +35,10 @@ #include "swdlgfact.hxx" #include <svl/style.hxx> -#ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> -#endif #include "dialog.hrc" #include "misc.hrc" #include "chrdlg.hrc" -#include "fldui.hrc" #include "table.hrc" #include "frmui.hrc" #include "dbui.hrc" @@ -94,6 +92,7 @@ #include <instable.hxx> //add for SwInsTableDlg #include <javaedit.hxx> //add for SwJavaEditDialog #include <linenum.hxx> //add for SwLineNumberingDlg +#include <titlepage.hxx> //add for SwTitlePageDlg #include <mailmrge.hxx> //add for SwMailMergeDlg, SwMailMergeCreateFromDlg, SwMailMergeFieldConnectionsDlg #include <mergetbl.hxx> //add for SwMergeTblDlg #include <multmrk.hxx> //add for SwMultiTOXMarkDlg @@ -124,8 +123,8 @@ IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); //add for SwCharDlg, SwFootNoteOption IMPL_ABSTDLG_BASE(AbstractSwConvertTableDlg_Impl); //add for SwConvertTableDlg IMPL_ABSTDLG_BASE(AbstractSwInsertDBColAutoPilot_Impl); //add for SwInsertDBColAutoPilot IMPL_ABSTDLG_BASE(AbstractDropDownFieldDialog_Impl); //add for DropDownFieldDialog -IMPL_ABSTDLG_BASE(AbstarctSwLabDlg_Impl);//add for SwLabDlg -IMPL_ABSTDLG_BASE(AbstarctSwSelGlossaryDlg_Impl);//add for SwSelGlossaryDlg +IMPL_ABSTDLG_BASE(AbstractSwLabDlg_Impl);//add for SwLabDlg +IMPL_ABSTDLG_BASE(AbstractSwSelGlossaryDlg_Impl);//add for SwSelGlossaryDlg IMPL_ABSTDLG_BASE(AbstractSwAutoFormatDlg_Impl); //add for SwAutoFormatDlg IMPL_ABSTDLG_BASE(AbstractSwFldDlg_Impl); //add for SwFldDlg IMPL_ABSTDLG_BASE(AbstractSwRenameXNamedDlg_Impl); //add for SwRenameXNamedDlg @@ -145,7 +144,6 @@ IMPL_ABSTDLG_BASE(AbstractInsertSectionTabDialog_Impl); IMPL_ABSTDLG_BASE(AbstractIndexMarkFloatDlg_Impl); IMPL_ABSTDLG_BASE(AbstractAuthMarkFloatDlg_Impl); -// AbstractTabDialog_Impl begin void AbstractTabDialog_Impl::SetCurPageId( sal_uInt16 nId ) { pDlg->SetCurPageId( nId ); @@ -165,24 +163,23 @@ void AbstractTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet ) { pDlg->SetInputSet( pInSet ); } + //From class Window. void AbstractTabDialog_Impl::SetText( const XubString& rStr ) { pDlg->SetText( rStr ); } + String AbstractTabDialog_Impl::GetText() const { return pDlg->GetText(); } -//add for AbstractTabDialog_Impl end - void AbstractSwWordCountDialog_Impl::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc) { pDlg->SetValues(rCurrent, rDoc); } -//add for SwInsertAbstractDlg begin sal_uInt8 AbstractSwInsertAbstractDlg_Impl::GetLevel() const { return pDlg->GetLevel(); @@ -191,7 +188,6 @@ sal_uInt8 AbstractSwInsertAbstractDlg_Impl::GetPara() const { return pDlg->GetPara(); } -//add for SwInsertAbstractDlg end //add for SwAddrDlg, SwDropCapsDlg ,SwBackgroundDlg, SwNumFmtDlg SwBorderDlg SwWrapDlg SwFldEditDlg begin const SfxItemSet* AbstractSfxDialog_Impl::GetOutputItemSet() const @@ -203,26 +199,22 @@ void AbstractSfxDialog_Impl::SetText( const XubString& rStr ) { pDlg->SetText( rStr ); } + String AbstractSfxDialog_Impl::GetText() const { return pDlg->GetText(); } -//add for SwAddrDlg, SwDropCapsDlg ,SwBackgroundDlg, SwNumFmtDlg SwBorderDlg SwWrapDlg SwFldEditDlg end - -//add for SwAsciiFilterDlg begin void AbstractSwAsciiFilterDlg_Impl::FillOptions( SwAsciiOptions& rOptions ) { pDlg->FillOptions(rOptions); } -//add for SwAsciiFilterDlg end -//add for SwSplitTblDlg sal_uInt16 AbstractSplitTableDialog_Impl::GetSplitMode() { return pDlg->GetSplitMode(); } -//add for SwBreakDlg begin + String AbstractSwBreakDlg_Impl::GetTemplateName() { return pDlg->GetTemplateName(); @@ -237,17 +229,13 @@ sal_uInt16 AbstractSwBreakDlg_Impl:: GetPageNumber() { return pDlg->GetPageNumber(); } -//add for SwBreakDlg end -//add for SwConvertTableDlg begin void AbstractSwConvertTableDlg_Impl::GetValues( sal_Unicode& rDelim,SwInsertTableOptions& rInsTblFlags, SwTableAutoFmt *& prTAFmt ) { pDlg->GetValues(rDelim,rInsTblFlags, prTAFmt); } -//add for SwConvertTableDlg end -//add for SwInsertDBColAutoPilot begin void AbstractSwInsertDBColAutoPilot_Impl::DataToDoc( const uno::Sequence< uno::Any >& rSelection, uno::Reference< sdbc::XDataSource> rxSource, uno::Reference< sdbc::XConnection> xConnection, @@ -255,86 +243,77 @@ void AbstractSwInsertDBColAutoPilot_Impl::DataToDoc( const uno::Sequence< uno::A { pDlg->DataToDoc(rSelection, rxSource, xConnection, xResultSet); } -//add for SwInsertDBColAutoPilot end -// add for DropDownFieldDialog begin ByteString AbstractDropDownFieldDialog_Impl::GetWindowState( sal_uLong nMask ) const { return pDlg->GetWindowState(nMask); } + void AbstractDropDownFieldDialog_Impl::SetWindowState( const ByteString& rStr ) { pDlg->SetWindowState(rStr); } -//add for DropDownFieldDialog end -//add for SwLabDlg begin - -void AbstarctSwLabDlg_Impl::SetCurPageId( sal_uInt16 nId ) +void AbstractSwLabDlg_Impl::SetCurPageId( sal_uInt16 nId ) { pDlg->SetCurPageId( nId ); } -const SfxItemSet* AbstarctSwLabDlg_Impl::GetOutputItemSet() const +const SfxItemSet* AbstractSwLabDlg_Impl::GetOutputItemSet() const { return pDlg->GetOutputItemSet(); } -const sal_uInt16* AbstarctSwLabDlg_Impl::GetInputRanges(const SfxItemPool& pItem ) +const sal_uInt16* AbstractSwLabDlg_Impl::GetInputRanges(const SfxItemPool& pItem ) { return pDlg->GetInputRanges( pItem ); } -void AbstarctSwLabDlg_Impl::SetInputSet( const SfxItemSet* pInSet ) +void AbstractSwLabDlg_Impl::SetInputSet( const SfxItemSet* pInSet ) { pDlg->SetInputSet( pInSet ); } -void AbstarctSwLabDlg_Impl::SetText( const XubString& rStr ) +void AbstractSwLabDlg_Impl::SetText( const XubString& rStr ) { pDlg->SetText( rStr ); } -String AbstarctSwLabDlg_Impl::GetText() const + +String AbstractSwLabDlg_Impl::GetText() const { return pDlg->GetText(); } -const String& AbstarctSwLabDlg_Impl::GetBusinessCardStr() const + +const String& AbstractSwLabDlg_Impl::GetBusinessCardStr() const { return pDlg->GetBusinessCardStr(); } -Printer * AbstarctSwLabDlg_Impl::GetPrt() + +Printer * AbstractSwLabDlg_Impl::GetPrt() { return pDlg->GetPrt(); } -//add for SwLabDlg end - -//add for SwSelGlossaryDlg begin - -void AbstarctSwSelGlossaryDlg_Impl::InsertGlos(const String &rRegion, const String &rGlosName) +void AbstractSwSelGlossaryDlg_Impl::InsertGlos(const String &rRegion, const String &rGlosName) { pDlg->InsertGlos( rRegion, rGlosName ); } -sal_uInt16 AbstarctSwSelGlossaryDlg_Impl::GetSelectedIdx() const + +sal_uInt16 AbstractSwSelGlossaryDlg_Impl::GetSelectedIdx() const { return pDlg->GetSelectedIdx(); } -void AbstarctSwSelGlossaryDlg_Impl::SelectEntryPos(sal_uInt16 nIdx) + +void AbstractSwSelGlossaryDlg_Impl::SelectEntryPos(sal_uInt16 nIdx) { pDlg->SelectEntryPos( nIdx ); } -//add for SwSelGlossaryDlg end - -//add for SwAutoFormatDlg begin - void AbstractSwAutoFormatDlg_Impl::FillAutoFmtOfIndex( SwTableAutoFmt*& rToFill ) const { pDlg->FillAutoFmtOfIndex(rToFill); } -//add for SwAutoFormatDlg end -//add for SwFldDlg begin void AbstractSwFldDlg_Impl::SetCurPageId( sal_uInt16 nId ) { pDlg->SetCurPageId( nId ); @@ -359,10 +338,12 @@ void AbstractSwFldDlg_Impl::SetText( const XubString& rStr ) { pDlg->SetText( rStr ); } + String AbstractSwFldDlg_Impl::GetText() const { return pDlg->GetText(); } + void AbstractSwFldDlg_Impl::Start( sal_Bool bShowl ) { pDlg->Start( bShowl ); @@ -377,10 +358,12 @@ void AbstractSwFldDlg_Impl::ReInitDlg() { pDlg->ReInitDlg(); } + void AbstractSwFldDlg_Impl::ActivateDatabasePage() { pDlg->ActivateDatabasePage(); } + Window* AbstractSwFldDlg_Impl::GetWindow() { return (Window*)pDlg; @@ -389,9 +372,6 @@ void AbstractSwFldDlg_Impl::ShowPage( sal_uInt16 nId ) { pDlg->ShowPage(nId); } -//add for SwFldD end - -//add for SwRenameXNamedDlg begin void AbstractSwRenameXNamedDlg_Impl::SetForbiddenChars( const String& rSet ) { @@ -404,17 +384,12 @@ void AbstractSwRenameXNamedDlg_Impl::SetAlternativeAccess( { pDlg->SetAlternativeAccess( xSecond, xThird); } -//add for SwRenameXNamedDlg end - -//add for SwModalRedlineAcceptDlg begin void AbstractSwModalRedlineAcceptDlg_Impl::AcceptAll( sal_Bool bAccept ) { pDlg->AcceptAll( bAccept); } -//add for SwModalRedlineAcceptDlg end -// AbstractGlossaryDlg_Impl begin String AbstractGlossaryDlg_Impl::GetCurrGrpName() const { return pDlg->GetCurrGrpName(); @@ -424,9 +399,7 @@ String AbstractGlossaryDlg_Impl::GetCurrShortName() const { return pDlg->GetCurrShortName(); } -// AbstractGlossaryDlg_Impl end -// AbstractFldInputDlg_Impl begin void AbstractFldInputDlg_Impl::SetWindowState( const ByteString& rStr ) { pDlg->SetWindowState( rStr ); @@ -436,9 +409,7 @@ ByteString AbstractFldInputDlg_Impl::GetWindowState( sal_uLong nMask ) const { return pDlg->GetWindowState( nMask ); } -// AbstractFldInputDlg_Impl end -// AbstractInsFootNoteDlg_Impl begin String AbstractInsFootNoteDlg_Impl::GetFontName() { return pDlg->GetFontName(); @@ -447,6 +418,7 @@ sal_Bool AbstractInsFootNoteDlg_Impl::IsEndNote() { return pDlg->IsEndNote(); } + String AbstractInsFootNoteDlg_Impl::GetStr() { return pDlg->GetStr(); @@ -455,13 +427,12 @@ void AbstractInsFootNoteDlg_Impl::SetHelpId( const rtl::OString& sHelpId ) { pDlg->SetHelpId( sHelpId ); } + void AbstractInsFootNoteDlg_Impl::SetText( const XubString& rStr ) { pDlg->SetText( rStr ); } -// AbstractInsFootNoteDlg_Impl end -// AbstractInsertGrfRulerDlg_Impl begin String AbstractInsertGrfRulerDlg_Impl::GetGraphicName() { return pDlg->GetGraphicName(); @@ -474,22 +445,19 @@ sal_Bool AbstractInsertGrfRulerDlg_Impl::HasImages() const { return pDlg->HasImages(); } -// AbstractInsertGrfRulerDlg_Impl end -// AbstractInsTableDlg_Impl begin void AbstractInsTableDlg_Impl::GetValues( String& rName, sal_uInt16& rRow, sal_uInt16& rCol, SwInsertTableOptions& rInsTblFlags, String& rTableAutoFmtName, SwTableAutoFmt *& prTAFmt ) { pDlg->GetValues( rName, rRow, rCol, rInsTblFlags, rTableAutoFmtName, prTAFmt); } -// AbstractInsTableDlg_Impl end -// AbstractJavaEditDialog_Impl begin String AbstractJavaEditDialog_Impl::GetText() { return pDlg->GetText(); } + String AbstractJavaEditDialog_Impl::GetType() { return pDlg->GetType(); @@ -506,13 +474,12 @@ sal_Bool AbstractJavaEditDialog_Impl::IsUpdate() { return pDlg->IsUpdate(); } -// AbstractJavaEditDialog_Impl end -// AbstractMailMergeDlg_Impl begin sal_uInt16 AbstractMailMergeDlg_Impl::GetMergeType() { return pDlg->GetMergeType(); } + const ::rtl::OUString& AbstractMailMergeDlg_Impl::GetSaveFilter() const { return pDlg->GetSaveFilter(); @@ -522,78 +489,72 @@ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > AbstractMail { return pDlg->GetSelection(); } + uno::Reference< sdbc::XResultSet> AbstractMailMergeDlg_Impl::GetResultSet() const { return pDlg->GetResultSet(); } -// AbstractMailMergeDlg_Impl end -// AbstractMailMergeCreateFromDlg_Impl begin + sal_Bool AbstractMailMergeCreateFromDlg_Impl::IsThisDocument() const { return pDlg->IsThisDocument(); } -// AbstractMailMergeCreateFromDlg_Impl end -//AbstractMailMergeFieldConnectionsDlg_Impl begin + sal_Bool AbstractMailMergeFieldConnectionsDlg_Impl::IsUseExistingConnections() const { return pDlg->IsUseExistingConnections(); } -// AbstractMailMergeFieldConnectionsDlg_Impl end -// AbstractMultiTOXTabDialog_Impl begin SwForm* AbstractMultiTOXTabDialog_Impl::GetForm(CurTOXType eType) { return pDlg->GetForm(eType); } + CurTOXType AbstractMultiTOXTabDialog_Impl::GetCurrentTOXType() const { return pDlg->GetCurrentTOXType(); } + SwTOXDescription& AbstractMultiTOXTabDialog_Impl::GetTOXDescription(CurTOXType eTOXTypes) { return pDlg->GetTOXDescription(eTOXTypes); } + const SfxItemSet* AbstractMultiTOXTabDialog_Impl::GetOutputItemSet() const { return pDlg->GetOutputItemSet(); } -// AbstractMultiTOXTabDialog_Impl end -// AbstractEditRegionDlg_Impl begin void AbstractEditRegionDlg_Impl::SelectSection(const String& rSectionName) { pDlg->SelectSection(rSectionName); } -// AbstractEditRegionDlg_Impl end -//AbstractInsertSectionTabDialog_Impl begin + void AbstractInsertSectionTabDialog_Impl::SetSectionData(SwSectionData const& rSect) { pDlg->SetSectionData(rSect); } -// AbstractInsertSectionTabDialog_Impl end -//AbstractIndexMarkFloatDlg_Impl begin void AbstractIndexMarkFloatDlg_Impl::ReInitDlg(SwWrtShell& rWrtShell) { pDlg->ReInitDlg( rWrtShell); } + Window* AbstractIndexMarkFloatDlg_Impl::GetWindow() { return (Window*)pDlg; } -// AbstractIndexMarkFloatDlg_Impl end -//AbstractAuthMarkFloatDlg_Impl begin void AbstractAuthMarkFloatDlg_Impl::ReInitDlg(SwWrtShell& rWrtShell) { pDlg->ReInitDlg( rWrtShell); } + Window* AbstractAuthMarkFloatDlg_Impl::GetWindow() { return (Window*)pDlg; } -// AbstractAuthMarkFloatDlg_Impl end AbstractMailMergeWizard_Impl::~AbstractMailMergeWizard_Impl() { @@ -612,13 +573,15 @@ long AbstractMailMergeWizard_Impl::GetResult() return pDlg->GetResult(); } -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, pDialog ) #else IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, EMPTYARG ) #endif { - DBG_ASSERT( pDialog == pDlg, "wrong dialog passed to EndDialogHdl!" ); +#if OSL_DEBUG_LEVEL > 1 + OSL_ENSURE( pDialog == pDlg, "wrong dialog passed to EndDialogHdl!" ); +#endif aEndDlgHdl.Call( this ); aEndDlgHdl = Link(); @@ -630,6 +593,7 @@ void AbstractMailMergeWizard_Impl::SetReloadDocument(const String& rURL) { pDlg->SetReloadDocument(rURL); } + const String& AbstractMailMergeWizard_Impl::GetReloadDocument() const { return pDlg->GetReloadDocument(); @@ -638,20 +602,18 @@ sal_Bool AbstractMailMergeWizard_Impl::ShowPage( sal_uInt16 nLevel ) { return pDlg->skipUntil(nLevel); } + sal_uInt16 AbstractMailMergeWizard_Impl::GetRestartPage() const { return pDlg->GetRestartPage(); } -//-------------- SwAbstractDialogFactory implementation-------------- - AbstractSwWordCountDialog* SwAbstractDialogFactory_Impl::CreateSwWordCountDialog(Window* pParent) { SwWordCountDialog* pDlg = new SwWordCountDialog( pParent ); return new AbstractSwWordCountDialog_Impl( pDlg ); } -//add for SwInsertAbstractDlg begin AbstractSwInsertAbstractDlg * SwAbstractDialogFactory_Impl::CreateSwInsertAbstractDlg( Window* pParent, int nResId ) { @@ -669,7 +631,6 @@ AbstractSwInsertAbstractDlg * SwAbstractDialogFactory_Impl::CreateSwInsertAbstra return new AbstractSwInsertAbstractDlg_Impl( pDlg ); return 0; } -//add for SwInsertAbstractDlg end SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSfxDialog( Window* pParent, const SfxItemSet& rSet, @@ -701,7 +662,6 @@ SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSfxDialog( Window* pParen return 0; } -// add for SwAsciiFilterDlg begin AbstractSwAsciiFilterDlg* SwAbstractDialogFactory_Impl::CreateSwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh, SvStream* pStream, @@ -723,9 +683,6 @@ AbstractSwAsciiFilterDlg* SwAbstractDialogFactory_Impl::CreateSwAsciiFilterDlg( return 0; } -//add for SwAsciiFilterDlg end - -// add for SwInsertBookmarkDlg begin VclAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg( Window *pParent, SwWrtShell &rSh, SfxRequest& rReq, @@ -747,10 +704,6 @@ VclAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg( Wind return 0; } -//add for SwInsertBookmarkDlg end - -//add for SwBreakDlg begin - AbstractSwBreakDlg * SwAbstractDialogFactory_Impl::CreateSwBreakDlg ( Window *pParent, SwWrtShell &rSh, int nResId ) @@ -770,9 +723,7 @@ AbstractSwBreakDlg * SwAbstractDialogFactory_Impl::CreateSwBreakDlg ( Window *pP return new AbstractSwBreakDlg_Impl( pDlg ); return 0; } -//add for SwBreakDlg end -// add for SwChangeDBDlg begin VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg( SwView& rVw, int nResId ) { Dialog* pDlg=NULL; @@ -791,9 +742,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg( SwView& r return 0; } -// add for SwChangeDBDlg end -// add for SwCharDlg begin SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwCharDlg(Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, int nResId, // add for SwCharDlg const String* pFmtStr , sal_Bool bIsDrwTxtDlg ) { @@ -813,9 +762,7 @@ SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwCharDlg(Window* pP return 0; } -// add for SwCharDlg end -//add for SwConvertTableDlg begin AbstractSwConvertTableDlg* SwAbstractDialogFactory_Impl::CreateSwConvertTableDlg ( SwView& rView,int nResId, bool bToTable ) { @@ -834,9 +781,6 @@ AbstractSwConvertTableDlg* SwAbstractDialogFactory_Impl::CreateSwConvertTableDlg return 0; } -//add for SwConvertTableDlg end - -//add for SwCaptionDialog begin VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwCaptionDialog ( Window *pParent, SwView &rV,int nResId) { Dialog* pDlg=NULL; @@ -854,9 +798,6 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwCaptionDialog ( Window return new VclAbstractDialog_Impl( pDlg ); return 0; } -//add for SwCaptionDialog end - -//add for SwInsertDBColAutoPilot begin AbstractSwInsertDBColAutoPilot* SwAbstractDialogFactory_Impl::CreateSwInsertDBColAutoPilot( SwView& rView, // add for SwInsertDBColAutoPilot uno::Reference< sdbc::XDataSource> rxSource, @@ -878,8 +819,7 @@ AbstractSwInsertDBColAutoPilot* SwAbstractDialogFactory_Impl::CreateSwInsertDBCo return new AbstractSwInsertDBColAutoPilot_Impl( pDlg ); return 0; } -//add for SwInsertDBColAutoPilot end -//add for SwFootNoteOptionDlg begin + SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwFootNoteOptionDlg( Window *pParent, SwWrtShell &rSh,int nResId) { SfxTabDialog* pDlg=NULL; @@ -897,10 +837,6 @@ SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwFootNoteOptionDlg( return new AbstractTabDialog_Impl( pDlg ); return 0; } -//add for SwFootNoteOptionDlg begin - - -//add for DropDownFieldDialog begin AbstractDropDownFieldDialog * SwAbstractDialogFactory_Impl::CreateDropDownFieldDialog ( Window *pParent, SwWrtShell &rSh, //add for DropDownFieldDialog SwField* pField,int nResId, sal_Bool bNextButton ) @@ -920,9 +856,7 @@ AbstractDropDownFieldDialog * SwAbstractDialogFactory_Impl::CreateDropDownField return new AbstractDropDownFieldDialog_Impl( pDlg ); return 0; } -//add for DropDownFieldDialog end -//add for SwEnvDlg begin SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwEnvDlg ( Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, sal_Bool bInsert,int nResId ) //add for SwEnvDlg @@ -942,11 +876,8 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwEnvDlg ( Window* pPa return new AbstractTabDialog_Impl( pDlg ); return 0; } -//add for SwEnvDlg end -//add for SwLabDlg begin - -AbstarctSwLabDlg* SwAbstractDialogFactory_Impl::CreateSwLabDlg ( Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg +AbstractSwLabDlg* SwAbstractDialogFactory_Impl::CreateSwLabDlg ( Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg SwNewDBMgr* pNewDBMgr, sal_Bool bLabel,int nResId ) { SwLabDlg* pDlg=NULL; @@ -961,7 +892,7 @@ AbstarctSwLabDlg* SwAbstractDialogFactory_Impl::CreateSwLabDlg ( Window* pParent } if ( pDlg ) - return new AbstarctSwLabDlg_Impl( pDlg ); + return new AbstractSwLabDlg_Impl( pDlg ); return 0; } @@ -970,9 +901,7 @@ SwLabDlgMethod SwAbstractDialogFactory_Impl::GetSwLabDlgStaticMethod () return SwLabDlg::UpdateFieldInformation; } -//add for SwLabDlg end -//add for SwParaDlg begin SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwParaDlg ( Window *pParent, SwView& rVw, const SfxItemSet& rCoreSet , sal_uInt8 nDialogMode, @@ -996,9 +925,7 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwParaDlg ( Window *pP return new AbstractTabDialog_Impl( pDlg ); return 0; } -//add for SwParaDlg end -//add for SwTableHeightDlg SwSortDlg begin VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclAbstractDialog ( Window *pParent, SwWrtShell &rSh, int nResId ) { Dialog* pDlg=NULL; @@ -1025,16 +952,13 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclAbstractDialog ( Wind return new VclAbstractDialog_Impl( pDlg ); return 0; } -//add for SwTableHeightDlg SwSortDlg ,end -//add for SwSplitTblDlg begin + AbstractSplitTableDialog * SwAbstractDialogFactory_Impl::CreateSplitTblDialog ( Window *pParent, SwWrtShell &rSh ) { return new AbstractSplitTableDialog_Impl( new SwSplitTblDlg( pParent, rSh) ); } -//add SwSplitTblDlg end -//add for SwSelGlossaryDlg begin -AbstarctSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ) +AbstractSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ) { SwSelGlossaryDlg* pDlg=NULL; switch ( nResId ) @@ -1048,13 +972,10 @@ AbstarctSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg } if ( pDlg ) - return new AbstarctSwSelGlossaryDlg_Impl( pDlg ); + return new AbstractSwSelGlossaryDlg_Impl( pDlg ); return 0; } -//add for SwSelGlossaryDlg end - -//add for SwAutoFormatDlg begin AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg( Window* pParent, SwWrtShell* pShell, int nResId, sal_Bool bSetAutoFmt, @@ -1075,9 +996,7 @@ AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg( W return new AbstractSwAutoFormatDlg_Impl( pDlg ); return 0; } -//add for SwAutoFormatDlg end -//add for SwBorderDlg begin SfxAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwBorderDlg (Window* pParent, SfxItemSet& rSet, sal_uInt16 nType,int nResId ) { SfxModalDialog* pDlg=NULL; @@ -1094,9 +1013,7 @@ SfxAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwBorderDlg (Window* pPa return new AbstractSfxDialog_Impl( pDlg ); return 0; } -//add for SwBorderDlg end -//add for SwWrapDlg begin SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwWrapDlg ( Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode, int nResId ) { SfxModalDialog* pDlg=NULL; @@ -1113,9 +1030,7 @@ SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwWrapDlg ( Window* pPare return new AbstractSfxDialog_Impl( pDlg ); return 0; } -//add for SwWrapDlg end -//add for SwTableWidthDlg begin VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwTableWidthDlg ( Window *pParent, SwTableFUNC &rFnc , int nResId ) { Dialog* pDlg=NULL; @@ -1133,9 +1048,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwTableWidthDlg ( Window return new VclAbstractDialog_Impl( pDlg ); return 0; } -//add for SwTableWidthDlg end - //add for SwTableTabDlg begin SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTableTabDlg( Window* pParent, SfxItemPool& Pool, const SfxItemSet* pItemSet, SwWrtShell* pSh,int nResId ) { @@ -1154,9 +1067,7 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTableTabDlg( Window* return new AbstractTabDialog_Impl( pDlg ); return 0; } - //add for SwTableTabDlg end -//add for SwFldDlg begin AbstractSwFldDlg * SwAbstractDialogFactory_Impl::CreateSwFldDlg ( SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent, int nResId ) { SwFldDlg* pDlg=NULL; @@ -1174,9 +1085,7 @@ AbstractSwFldDlg * SwAbstractDialogFactory_Impl::CreateSwFldDlg ( SfxBindings* p return new AbstractSwFldDlg_Impl( pDlg ); return 0; } -//add for SwFldDlg end -//add for SwFldEditDlg begin SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwFldEditDlg ( SwView& rVw, int nResId ) { SfxModalDialog* pDlg=NULL; @@ -1193,9 +1102,7 @@ SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwFldEditDlg ( SwView& r return new AbstractSfxDialog_Impl( pDlg ); return 0; } -//add for SwFldEditDlg -//add for SwRenameXNamedDlg begin AbstractSwRenameXNamedDlg * SwAbstractDialogFactory_Impl::CreateSwRenameXNamedDlg( Window* pParent, STAR_REFERENCE( container::XNamed ) & xNamed, STAR_REFERENCE( container::XNameAccess ) & xNameAccess,int nResId ) @@ -1215,9 +1122,6 @@ AbstractSwRenameXNamedDlg * SwAbstractDialogFactory_Impl::CreateSwRenameXNamedDl return 0; } -//add for SwRenameXNamedDlg end - -//add for SwModalRedlineAcceptDlg begin AbstractSwModalRedlineAcceptDlg * SwAbstractDialogFactory_Impl::CreateSwModalRedlineAcceptDlg ( Window *pParent, int nResId ) { SwModalRedlineAcceptDlg* pDlg=NULL; @@ -1234,7 +1138,6 @@ AbstractSwModalRedlineAcceptDlg * SwAbstractDialogFactory_Impl::CreateSwModalRed return new AbstractSwModalRedlineAcceptDlg_Impl( pDlg ); return 0; } -//add for SwModalRedlineAcceptDlg end VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwVclDialog( int nResId, Window* pParent, sal_Bool& rWithPrev ) //add for SwMergeTblDlg @@ -1252,6 +1155,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwVclDialog( int nResId, return new VclAbstractDialog_Impl( pDlg ); return 0; } + SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateFrmTabDialog( int nResId, SfxViewFrame *pFrame, Window *pParent, const SfxItemSet& rCoreSet, @@ -1355,6 +1259,14 @@ AbstractInsFootNoteDlg* SwAbstractDialogFactory_Impl::CreateInsFootNoteDlg( int return 0; } +VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateTitlePageDlg ( Window *pParent ) +{ + Dialog* pDlg = new SwTitlePageDlg( pParent ); + if ( pDlg ) + return new VclAbstractDialog_Impl( pDlg ); + return 0; +} + VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclSwViewDialog( int nResId, SwView& rView, sal_Bool /*bCol*/ ) //add for SwInsRowColDlg, SwLineNumberingDlg { @@ -1446,6 +1358,7 @@ AbstractMailMergeDlg * SwAbstractDialogFactory_Impl::CreateMailMergeDlg( int nRe return new AbstractMailMergeDlg_Impl( pDlg ); return 0; } + AbstractMailMergeCreateFromDlg * SwAbstractDialogFactory_Impl::CreateMailMergeCreateFromDlg( int nResId, Window* pParent ) //add for SwMailMergeCreateFromDlg { @@ -1462,6 +1375,7 @@ AbstractMailMergeCreateFromDlg * SwAbstractDialogFactory_Impl::CreateMailMergeCr return new AbstractMailMergeCreateFromDlg_Impl( pDlg ); return 0; } + AbstractMailMergeFieldConnectionsDlg * SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg( int nResId, Window* pParent ) //add for SwMailMergeFieldConnectionsDlg { @@ -1495,6 +1409,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg( int nRe return new VclAbstractDialog_Impl( pDlg ); return 0; } + SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTabDialog( int nResId, Window* pParent, const SfxItemSet* pSwItemSet, @@ -1517,6 +1432,7 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTabDialog( int nResI return new AbstractTabDialog_Impl( pDlg ); return 0; } + AbstractMultiTOXTabDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXTabDialog( int nResId, Window* pParent, const SfxItemSet& rSet, SwWrtShell &rShell, @@ -1536,6 +1452,7 @@ AbstractMultiTOXTabDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXTabDialo return new AbstractMultiTOXTabDialog_Impl( pDlg ); return 0; } + AbstractEditRegionDlg * SwAbstractDialogFactory_Impl::CreateEditRegionDlg( int nResId, Window* pParent, SwWrtShell& rWrtSh ) //add for SwEditRegionDlg { @@ -1552,6 +1469,7 @@ AbstractEditRegionDlg * SwAbstractDialogFactory_Impl::CreateEditRegionDlg( int n return new AbstractEditRegionDlg_Impl( pDlg ); return 0; } + AbstractInsertSectionTabDialog * SwAbstractDialogFactory_Impl::CreateInsertSectionTabDialog( int nResId, Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) //add for SwInsertSectionTabDialog { @@ -1632,6 +1550,7 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg( int n return new VclAbstractDialog_Impl( pDlg ); return 0; } + //add for SwIndexMarkModalDlg end AbstractMailMergeWizard* SwAbstractDialogFactory_Impl::CreateMailMergeWizard( SwView& rView, SwMailMergeConfigItem& rConfigItem) @@ -1696,7 +1615,7 @@ CreateTabPage SwAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nI break; case RID_SW_TP_OPTTEST_PAGE : case TP_OPTTEST_PAGE : -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 pRet = SwTestTabPage::Create; #endif break; @@ -1740,3 +1659,5 @@ GetTabPageRanges SwAbstractDialogFactory_Impl::GetTabPageRangesFunc( sal_uInt16 return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index e2fe53ae36..1f18e01eae 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,7 +28,6 @@ #ifndef _SW_DLGFACT_HXX #define _SW_DLGFACT_HXX -// include --------------------------------------------------------------- #include "swabstdlg.hxx" class SwSaveLabelDlg; @@ -181,9 +181,9 @@ class AbstractDropDownFieldDialog_Impl : public AbstractDropDownFieldDialog //ad //add for DropDownFieldDialog end -class AbstarctSwLabDlg_Impl : public AbstarctSwLabDlg +class AbstractSwLabDlg_Impl : public AbstractSwLabDlg { - DECL_ABSTDLG_BASE(AbstarctSwLabDlg_Impl,SwLabDlg) + DECL_ABSTDLG_BASE(AbstractSwLabDlg_Impl,SwLabDlg) virtual void SetCurPageId( sal_uInt16 nId ); virtual const SfxItemSet* GetOutputItemSet() const; virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ); @@ -197,9 +197,9 @@ class AbstarctSwLabDlg_Impl : public AbstarctSwLabDlg //add for SwLabDlg end //add for SwSelGlossaryDlg begin -class AbstarctSwSelGlossaryDlg_Impl : public AbstarctSwSelGlossaryDlg +class AbstractSwSelGlossaryDlg_Impl : public AbstractSwSelGlossaryDlg { - DECL_ABSTDLG_BASE(AbstarctSwSelGlossaryDlg_Impl,SwSelGlossaryDlg) + DECL_ABSTDLG_BASE(AbstractSwSelGlossaryDlg_Impl,SwSelGlossaryDlg) virtual void InsertGlos(const String &rRegion, const String &rGlosName); // inline virtual sal_uInt16 GetSelectedIdx() const; // inline virtual void SelectEntryPos(sal_uInt16 nIdx); // inline @@ -454,7 +454,7 @@ public: virtual AbstractDropDownFieldDialog * CreateDropDownFieldDialog ( Window *pParent, SwWrtShell &rSh, //add for DropDownFieldDialog SwField* pField,int nResId, sal_Bool bNextButton = sal_False ); virtual SfxAbstractTabDialog* CreateSwEnvDlg ( Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, sal_Bool bInsert,int nResId ); //add for SwEnvDlg - virtual AbstarctSwLabDlg* CreateSwLabDlg ( Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg + virtual AbstractSwLabDlg* CreateSwLabDlg ( Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg SwNewDBMgr* pNewDBMgr, sal_Bool bLabel,int nResId ); virtual SwLabDlgMethod GetSwLabDlgStaticMethod (); //add for SwLabDlg @@ -467,7 +467,7 @@ public: sal_Bool bDraw = sal_False, sal_uInt16 nDefPage = 0); - virtual AbstarctSwSelGlossaryDlg * CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ); //add for SwSelGlossaryDlg + virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ); //add for SwSelGlossaryDlg virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ); //add for SwTableHeightDlg SwSortDlg virtual AbstractSplitTableDialog * CreateSplitTblDialog ( Window * pParent, SwWrtShell &rSh ); //add for SwSplitTblDlg @@ -514,6 +514,7 @@ public: SwField* pField, sal_Bool bNextButton = sal_False ); //add for SwFldInputDlg virtual AbstractInsFootNoteDlg* CreateInsFootNoteDlg( int nResId, Window * pParent, SwWrtShell &rSh, sal_Bool bEd = sal_False); //add for SwInsFootNoteDlg + virtual VclAbstractDialog * CreateTitlePageDlg ( Window * pParent ); virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId, SwView& rView, sal_Bool bCol = sal_False ); //add for SwInsRowColDlg, SwLineNumberingDlg virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg( int nResId, @@ -582,3 +583,5 @@ struct SwDialogsResMgr }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/sw/source/ui/dialog/swuiexp.cxx b/sw/source/ui/dialog/swuiexp.cxx index 5a2f03205e..a60e1f7dfc 100644 --- a/sw/source/ui/dialog/swuiexp.cxx +++ b/sw/source/ui/dialog/swuiexp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,3 +54,5 @@ extern "C" return ::swui::GetFactory(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/swwrtshitem.cxx b/sw/source/ui/dialog/swwrtshitem.cxx index 6a890ce3b6..6bfcd3d8da 100644 --- a/sw/source/ui/dialog/swwrtshitem.cxx +++ b/sw/source/ui/dialog/swwrtshitem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,3 +50,5 @@ SfxPoolItem* SwWrtShellItem::Clone( SfxItemPool * /*pPool*/ ) const { return new SwWrtShellItem( *this ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 796df3f2d6..74a1dbe86f 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -54,13 +55,13 @@ #include <IMark.hxx> #include <section.hxx> #include <docary.hxx> -#include <doc.hxx> // fuers SwSectionFmt-Array +#include <doc.hxx> // for the SwSectionFmt-Array #include <basesh.hxx> #include <wdocsh.hxx> #include <view.hxx> #include <swmodule.hxx> #include <wrtsh.hxx> -#include <swundo.hxx> // fuer Undo-Ids +#include <swundo.hxx> // for Undo-Ids #include <column.hxx> #include <fmtfsize.hxx> #include <swunodef.hxx> @@ -142,15 +143,12 @@ void lcl_FillSubRegionList( SwWrtShell& rSh, ComboBox& rSubRegions, ComboBox* pA ppMark != pMarkAccess->getMarksEnd(); ppMark++) { - const ::sw::mark::IMark* pBkmk = ppMark->get(); + const ::sw::mark::IMark* pBkmk = ppMark->get(); if( pBkmk->IsExpanded() ) rSubRegions.InsertEntry( pBkmk->GetName() ); } } -/* -----------------25.06.99 15:38------------------- - - --------------------------------------------------*/ class SwTestPasswdDlg : public SfxPasswordDialog { public: @@ -162,7 +160,7 @@ public: }; /*---------------------------------------------------------------------------- - Beschreibung: User Data Klasse fuer Bereichsinformationen + Description: user data class for region information ----------------------------------------------------------------------------*/ class SectRepr @@ -177,9 +175,9 @@ private: SvxFrameDirectionItem m_FrmDirItem; SvxLRSpaceItem m_LRSpaceItem; sal_uInt16 m_nArrPos; - // zeigt an, ob evtl. Textinhalt im Bereich ist + // shows, if maybe textcontent is in the region bool m_bContent : 1; - // fuer Multiselektion erst markieren, dann mit der TreeListBox arbeiten! + // for multiselection, mark at first, then work with TreeListBox! bool m_bSelected : 1; uno::Sequence<sal_Int8> m_TempPasswd; @@ -255,7 +253,7 @@ void SectRepr::SetFile( const String& rFile ) if( rFile.Len() || sSub.Len() ) { sNewFile += sfx2::cTokenSeperator; - if( rFile.Len() ) // Filter nur mit FileName + if( rFile.Len() ) // Filter only with FileName sNewFile += sOldFileName.GetToken( 1, sfx2::cTokenSeperator ); sNewFile += sfx2::cTokenSeperator; @@ -349,14 +347,9 @@ String SectRepr::GetSubRegion() const return sLinkFile; } - - /*---------------------------------------------------------------------------- - Beschreibung: Dialog Bearbeiten Bereiche + Description: dialog edit regions ----------------------------------------------------------------------------*/ - -//--------------------------------------------------------------------- - SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh ) : SfxModalDialog( pParent, SW_RES(MD_EDIT_REGION) ), aNameFL ( this, SW_RES( FL_NAME ) ), @@ -383,10 +376,9 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh ) aConditionFT ( this, SW_RES( FT_CONDITION ) ), aConditionED ( this, SW_RES( ED_CONDITION ) ), - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections aPropertiesFL ( this, SW_RES( FL_PROPERTIES ) ), aEditInReadonlyCB ( this, SW_RES( CB_EDIT_IN_READONLY ) ), - // <-- aOK ( this, SW_RES( PB_OK ) ), aCancel ( this, SW_RES( PB_CANCEL ) ), @@ -395,7 +387,6 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh ) aHelp ( this, SW_RES( PB_HELP ) ), aImageIL ( SW_RES(IL_BITMAPS)), - aImageILH ( SW_RES(ILH_BITMAPS)), rSh( rWrtSh ), pAktEntry( 0 ), @@ -415,9 +406,8 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh ) aPasswdCB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangePasswdHdl)); aPasswdPB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangePasswdHdl)); aHideCB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangeHideHdl)); - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections aEditInReadonlyCB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangeEditInReadonlyHdl)); - // <-- aOptionsPB.Show(); aOptionsPB.SetClickHdl ( LINK( this, SwEditRegionDlg, OptionsHdl)); @@ -448,11 +438,10 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh ) aDDECB.SetClickHdl ( LINK( this, SwEditRegionDlg, DDEHdl )); - //Ermitteln der vorhandenen Bereiche pCurrSect = rSh.GetCurrSection(); RecurseList( 0, 0 ); - //falls der Cursor nicht in einem Bereich steht, - //wird immer der erste selektiert + // if the cursor is not in a region + // the first one will always be selected if( !aTree.FirstSelected() && aTree.First() ) aTree.Select( aTree.First() ); aTree.Show(); @@ -462,9 +451,7 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh ) aPasswdPB.SetAccessibleRelationLabeledBy(&aPasswdCB); aSubRegionED.SetAccessibleName(aSubRegionFT.GetText()); } -/* -----------------------------26.04.01 14:56-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox) { if(bDontCheckPasswd) @@ -509,10 +496,10 @@ sal_Bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox) return bRet; } + /*--------------------------------------------------------------------- - Beschreibung: Durchsuchen nach Child-Sections, rekursiv + Description: recursively look for child-sections ---------------------------------------------------------------------*/ - void SwEditRegionDlg::RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry ) { SwSection* pSect = 0; @@ -531,11 +518,8 @@ void SwEditRegionDlg::RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry { SectRepr* pSectRepr = new SectRepr( n, *(pSect=pFmt->GetSection()) ); - Image aImg = BuildBitmap( pSect->IsProtect(),pSect->IsHidden(), sal_False); + Image aImg = BuildBitmap( pSect->IsProtect(),pSect->IsHidden()); pEntry = aTree.InsertEntry(pSect->GetSectionName(), aImg, aImg); - Image aHCImg = BuildBitmap( pSect->IsProtect(),pSect->IsHidden(), sal_True); - aTree.SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); - aTree.SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); pEntry->SetUserData(pSectRepr); RecurseList( pFmt, pEntry ); if (pEntry->HasChilds()) @@ -564,12 +548,9 @@ void SwEditRegionDlg::RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry SectRepr* pSectRepr=new SectRepr( FindArrPos( pSect->GetFmt() ), *pSect ); Image aImage = BuildBitmap( pSect->IsProtect(), - pSect->IsHidden(), sal_False); + pSect->IsHidden()); pNEntry = aTree.InsertEntry( pSect->GetSectionName(), aImage, aImage, pEntry); - Image aHCImg = BuildBitmap( pSect->IsProtect(),pSect->IsHidden(), sal_True); - aTree.SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); - aTree.SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); pNEntry->SetUserData(pSectRepr); RecurseList( aTmpArr[n]->GetFmt(), pNEntry ); if( pNEntry->HasChilds()) @@ -586,9 +567,6 @@ void SwEditRegionDlg::RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry aTree.Select(pSelEntry); } } -/*--------------------------------------------------------------------- - ----------------------------------------------------------------------*/ sal_uInt16 SwEditRegionDlg::FindArrPos(const SwSectionFmt* pFmt ) { @@ -597,12 +575,9 @@ sal_uInt16 SwEditRegionDlg::FindArrPos(const SwSectionFmt* pFmt ) if (pFmt==&rSh.GetSectionFmt(i)) return i; - DBG_ERROR( "SectionFormat nicht in der Liste" ); + OSL_ENSURE(false, "SectionFormat not on the list" ); return USHRT_MAX; } -/*--------------------------------------------------------------------- - Beschreibung: ----------------------------------------------------------------------*/ SwEditRegionDlg::~SwEditRegionDlg( ) { @@ -616,9 +591,7 @@ SwEditRegionDlg::~SwEditRegionDlg( ) aSectReprArr.DeleteAndDestroy( 0, aSectReprArr.Count() ); delete m_pDocInserter; } -/* -----------------------------09.10.2001 15:41------------------------------ - ---------------------------------------------------------------------------*/ void SwEditRegionDlg::SelectSection(const String& rSectionName) { SvLBoxEntry* pEntry = aTree.First(); @@ -636,20 +609,20 @@ void SwEditRegionDlg::SelectSection(const String& rSectionName) aTree.MakeVisible(pEntry); } } + /*--------------------------------------------------------------------- - Beschreibung: Selektierte Eintrag in der TreeListBox wird im - Edit-Fenster angezeigt - Bei Multiselektion werden einige Controls disabled + Description: selected entry in TreeListBox is showed in + Edit window + in case of multiselection some controls are disabled ---------------------------------------------------------------------*/ - IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox ) { bDontCheckPasswd = sal_True; SvLBoxEntry* pEntry=pBox->FirstSelected(); aHideCB .Enable(sal_True); - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections aEditInReadonlyCB.Enable(sal_True); - // <-- + aProtectCB .Enable(sal_True); aFileCB .Enable(sal_True); UNO_NMSPC::Sequence <sal_Int8> aCurPasswd; @@ -657,18 +630,18 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox ) { aHideCB.EnableTriState( sal_True ); aProtectCB.EnableTriState( sal_True ); - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections aEditInReadonlyCB.EnableTriState ( sal_True ); - // <-- + aFileCB.EnableTriState( sal_True ); bool bHiddenValid = true; bool bProtectValid = true; bool bConditionValid = true; - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections bool bEditInReadonlyValid = true; bool bEditInReadonly = true; - // <-- + bool bHidden = true; bool bProtect = true; String sCondition; @@ -686,9 +659,9 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox ) sCondition = rData.GetCondition(); bHidden = rData.IsHidden(); bProtect = rData.IsProtectFlag(); - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections bEditInReadonly = rData.IsEditInReadonlyFlag(); - // <-- + bFile = (rData.GetType() != CONTENT_SECTION); aCurPasswd = rData.GetPassword(); } @@ -699,10 +672,10 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox ) bConditionValid = sal_False; bHiddenValid = (bHidden == rData.IsHidden()); bProtectValid = (bProtect == rData.IsProtectFlag()); - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections bEditInReadonlyValid = (bEditInReadonly == rData.IsEditInReadonlyFlag()); - // <-- + bFileValid = (bFile == (rData.GetType() != CONTENT_SECTION)); bPasswdValid = (aCurPasswd == rData.GetPassword()); @@ -715,10 +688,10 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox ) bHidden ? STATE_CHECK : STATE_NOCHECK); aProtectCB.SetState( !bProtectValid ? STATE_DONTKNOW : bProtect ? STATE_CHECK : STATE_NOCHECK); - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections aEditInReadonlyCB.SetState( !bEditInReadonlyValid ? STATE_DONTKNOW : bEditInReadonly ? STATE_CHECK : STATE_NOCHECK); - // <-- + aFileCB.SetState(!bFileValid ? STATE_DONTKNOW : bFile ? STATE_CHECK : STATE_NOCHECK); @@ -726,7 +699,6 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox ) aConditionED.SetText(sCondition); else { -// aConditionED.SetText(aEmptyStr); aConditionFT.Enable(sal_False); aConditionED.Enable(sal_False); } @@ -736,7 +708,6 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox ) aFileNameED .Enable(sal_False); aSubRegionFT.Enable(sal_False); aSubRegionED.Enable(sal_False); -// aNameFT .Enable(sal_False); aCurName .Enable(sal_False); aOptionsPB .Enable(sal_False); aDDECB .Enable(sal_False); @@ -757,7 +728,6 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox ) } else if (pEntry ) { -// aNameFT .Enable(sal_True); aCurName .Enable(sal_True); aOptionsPB .Enable(sal_True); SectRepr* pRepr=(SectRepr*) pEntry->GetUserData(); @@ -799,11 +769,10 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox ) ? STATE_CHECK : STATE_NOCHECK); aProtectCB.Enable(); - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections aEditInReadonlyCB.SetState((rData.IsEditInReadonlyFlag()) ? STATE_CHECK : STATE_NOCHECK); aEditInReadonlyCB.Enable(); - // <-- sal_Bool bPasswdEnabled = aProtectCB.IsChecked(); aPasswdCB.Enable(bPasswdEnabled); @@ -812,18 +781,16 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox ) bDontCheckPasswd = sal_False; return 0; } -/*-----------------28.06.97 09:19------------------- ---------------------------------------------------*/ IMPL_LINK( SwEditRegionDlg, DeselectHdl, SvTreeListBox *, pBox ) { if( !pBox->GetSelectionCount() ) { aHideCB .Enable(sal_False); aProtectCB .Enable(sal_False); - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections aEditInReadonlyCB.Enable(sal_False); - // <-- + aPasswdCB .Enable(sal_False); aPasswdCB .Enable(sal_False); aConditionFT .Enable(sal_False); @@ -834,7 +801,6 @@ IMPL_LINK( SwEditRegionDlg, DeselectHdl, SvTreeListBox *, pBox ) aFileNameED .Enable(sal_False); aSubRegionFT .Enable(sal_False); aSubRegionED .Enable(sal_False); -// aNameFT .Enable(sal_False); aCurName .Enable(sal_False); aDDECB .Enable(sal_False); aDDECommandFT .Enable(sal_False); @@ -846,19 +812,17 @@ IMPL_LINK( SwEditRegionDlg, DeselectHdl, SvTreeListBox *, pBox ) } /*--------------------------------------------------------------------- - Beschreibung: Im OkHdl werden die veraenderten Einstellungen - uebernommen und aufgehobene Bereiche geloescht + Description: in OkHdl the modified settings are being applied + and reversed regions are deleted ---------------------------------------------------------------------*/ - IMPL_LINK( SwEditRegionDlg, OkHdl, CheckBox *, EMPTYARG ) { - // JP 13.03.96: - // temp. Array weil sich waehrend des aendern eines Bereiches die - // Position innerhalb des "Core-Arrays" verschieben kann: - // - bei gelinkten Bereichen, wenn sie weitere SubBereiche haben oder - // neu erhalten. - // JP 30.05.97: StartUndo darf natuerlich auch erst nach dem Kopieren - // der Formate erfolgen (ClearRedo!) + // temp. Array because during changing of a region the position + // inside of the "Core-Arrays" can be shifted: + // - at linked regions, when they have more SubRegions or get + // new ones. + // StartUndo must certainly also happen not before the formats + // are copied (ClearRedo!) const SwSectionFmts& rDocFmts = rSh.GetDoc()->GetSections(); SwSectionFmts aOrigArray( 0, 5 ); @@ -916,12 +880,11 @@ IMPL_LINK( SwEditRegionDlg, OkHdl, CheckBox *, EMPTYARG ) if( USHRT_MAX != nNewPos ) rSh.DelSectionFmt( nNewPos ); } -// rSh.ChgSectionPasswd(aNewPasswd); aOrigArray.Remove( 0, aOrigArray.Count() ); - //JP 21.05.97: EndDialog muss vor Ende der EndAction gerufen werden, - // sonst kann es ScrollFehler geben. + // EndDialog must be called ahead of EndAction's end, + // otherwise ScrollError can occur. EndDialog(RET_OK); rSh.EndUndo(); @@ -929,58 +892,52 @@ IMPL_LINK( SwEditRegionDlg, OkHdl, CheckBox *, EMPTYARG ) return 0; } + /*--------------------------------------------------------------------- - Beschreibung: Toggle protect + Description: Toggle protect ---------------------------------------------------------------------*/ - IMPL_LINK( SwEditRegionDlg, ChangeProtectHdl, TriStateBox *, pBox ) { if(!CheckPasswd(pBox)) return 0; pBox->EnableTriState( sal_False ); SvLBoxEntry* pEntry=aTree.FirstSelected(); - DBG_ASSERT(pEntry,"kein Entry gefunden"); + OSL_ENSURE(pEntry,"no entry found"); sal_Bool bCheck = STATE_CHECK == pBox->GetState(); while( pEntry ) { SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData(); pRepr->GetSectionData().SetProtectFlag(bCheck); Image aImage = BuildBitmap( bCheck, - STATE_CHECK == aHideCB.GetState(), sal_False); - aTree.SetExpandedEntryBmp(pEntry, aImage, BMP_COLOR_NORMAL); - aTree.SetCollapsedEntryBmp(pEntry, aImage, BMP_COLOR_NORMAL); - Image aHCImg = BuildBitmap( bCheck, STATE_CHECK == aHideCB.GetState(), sal_True); - aTree.SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); - aTree.SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); + STATE_CHECK == aHideCB.GetState()); + aTree.SetExpandedEntryBmp( pEntry, aImage ); + aTree.SetCollapsedEntryBmp( pEntry, aImage ); pEntry = aTree.NextSelected(pEntry); } aPasswdCB.Enable(bCheck); aPasswdPB.Enable(bCheck); return 0; } + /*--------------------------------------------------------------------- - Beschreibung: Toggle hide + Description: Toggle hide ---------------------------------------------------------------------*/ - IMPL_LINK( SwEditRegionDlg, ChangeHideHdl, TriStateBox *, pBox ) { if(!CheckPasswd(pBox)) return 0; pBox->EnableTriState( sal_False ); SvLBoxEntry* pEntry=aTree.FirstSelected(); - DBG_ASSERT(pEntry,"kein Entry gefunden"); + OSL_ENSURE(pEntry,"no entry found"); while( pEntry ) { SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData(); pRepr->GetSectionData().SetHidden(STATE_CHECK == pBox->GetState()); + Image aImage = BuildBitmap(STATE_CHECK == aProtectCB.GetState(), - STATE_CHECK == pBox->GetState(), sal_False); - aTree.SetExpandedEntryBmp(pEntry, aImage, BMP_COLOR_NORMAL); - aTree.SetCollapsedEntryBmp(pEntry, aImage, BMP_COLOR_NORMAL); - Image aHCImg = BuildBitmap( STATE_CHECK == aProtectCB.GetState(), - STATE_CHECK == pBox->GetState(), sal_True); - aTree.SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); - aTree.SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST); + STATE_CHECK == pBox->GetState()); + aTree.SetExpandedEntryBmp( pEntry, aImage ); + aTree.SetCollapsedEntryBmp( pEntry, aImage ); pEntry = aTree.NextSelected(pEntry); } @@ -992,16 +949,15 @@ IMPL_LINK( SwEditRegionDlg, ChangeHideHdl, TriStateBox *, pBox ) } /*--------------------------------------------------------------------- - Beschreibung: Toggle edit in readonly + Description: Toggle edit in readonly ---------------------------------------------------------------------*/ - IMPL_LINK( SwEditRegionDlg, ChangeEditInReadonlyHdl, TriStateBox *, pBox ) { if(!CheckPasswd(pBox)) return 0; pBox->EnableTriState( sal_False ); SvLBoxEntry* pEntry=aTree.FirstSelected(); - DBG_ASSERT(pEntry,"kein Entry gefunden"); + OSL_ENSURE(pEntry,"no entry found"); while( pEntry ) { SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData(); @@ -1014,9 +970,8 @@ IMPL_LINK( SwEditRegionDlg, ChangeEditInReadonlyHdl, TriStateBox *, pBox ) } /*--------------------------------------------------------------------- - Beschreibung: selektierten Bereich aufheben + Description: clear selected region ---------------------------------------------------------------------*/ - IMPL_LINK( SwEditRegionDlg, ChangeDismissHdl, CheckBox *, EMPTYARG ) { if(!CheckPasswd()) @@ -1024,7 +979,7 @@ IMPL_LINK( SwEditRegionDlg, ChangeDismissHdl, CheckBox *, EMPTYARG ) SvLBoxEntry* pEntry = aTree.FirstSelected(); SvLBoxEntry* pChild; SvLBoxEntry* pParent; - //zuerst alle selektierten markieren + // at first mark all selected while(pEntry) { const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); @@ -1032,7 +987,7 @@ IMPL_LINK( SwEditRegionDlg, ChangeDismissHdl, CheckBox *, EMPTYARG ) pEntry = aTree.NextSelected(pEntry); } pEntry = aTree.FirstSelected(); - // dann loeschen + // then delete while(pEntry) { const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); @@ -1043,7 +998,7 @@ IMPL_LINK( SwEditRegionDlg, ChangeDismissHdl, CheckBox *, EMPTYARG ) aSectReprArr.Insert( pSectRepr ); while( (pChild = aTree.FirstChild(pEntry) )!= 0 ) { - //durch das Umhaengen muss wieder am Anfang aufgesetzt werden + // because of the repositioning we have to start at the beginning again bRestart = sal_True; pParent=aTree.GetParent(pEntry); aTree.GetModel()->Move(pChild, pParent, aTree.GetModel()->GetRelPos(pEntry)); @@ -1067,24 +1022,23 @@ IMPL_LINK( SwEditRegionDlg, ChangeDismissHdl, CheckBox *, EMPTYARG ) aProtectCB. Enable(sal_False); aPasswdCB. Enable(sal_False); aHideCB. Enable(sal_False); - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections aEditInReadonlyCB.Enable(sal_False); aEditInReadonlyCB.SetState(STATE_NOCHECK); - // <-- aProtectCB. SetState(STATE_NOCHECK); aPasswdCB. Check(sal_False); aHideCB. SetState(STATE_NOCHECK); aFileCB. Check(sal_False); - //sonst liegt der Focus auf dem HelpButton + // otherwise the focus would be on HelpButton aOK.GrabFocus(); UseFileHdl(&aFileCB); } return 0; } + /*--------------------------------------------------------------------- - Beschreibung: CheckBox mit Datei verknuepfen? + Description: link CheckBox to file? ---------------------------------------------------------------------*/ - IMPL_LINK( SwEditRegionDlg, UseFileHdl, CheckBox *, pBox ) { if(!CheckPasswd(pBox)) @@ -1132,7 +1086,6 @@ IMPL_LINK( SwEditRegionDlg, UseFileHdl, CheckBox *, pBox ) { aDDECB.Check(sal_False); DDEHdl(&aDDECB); -// aFileNameED.SetText(aEmptyStr); aSubRegionED.SetText(aEmptyStr); } } @@ -1153,9 +1106,8 @@ IMPL_LINK( SwEditRegionDlg, UseFileHdl, CheckBox *, pBox ) } /*--------------------------------------------------------------------- - Beschreibung: Dialog Datei einfuegen rufen + Description: call dialog paste file ---------------------------------------------------------------------*/ - IMPL_LINK( SwEditRegionDlg, FileSearchHdl, PushButton *, EMPTYARG ) { if(!CheckPasswd(0)) @@ -1170,10 +1122,6 @@ IMPL_LINK( SwEditRegionDlg, FileSearchHdl, PushButton *, EMPTYARG ) return 0; } -/*--------------------------------------------------------------------- - Beschreibung: ----------------------------------------------------------------------*/ - IMPL_LINK( SwEditRegionDlg, OptionsHdl, PushButton *, EMPTYARG ) { if(!CheckPasswd()) @@ -1276,10 +1224,9 @@ IMPL_LINK( SwEditRegionDlg, OptionsHdl, PushButton *, EMPTYARG ) } /*--------------------------------------------------------------------- - Beschreibung: Uebernahme des Dateinamen oder - des verknuepften Bereichs + Description: Applying of the filename or the + linked region ---------------------------------------------------------------------*/ - IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit ) { Selection aSelect = pEdit->GetSelection(); @@ -1287,7 +1234,7 @@ IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit ) return 0; pEdit->SetSelection(aSelect); SvLBoxEntry* pEntry=aTree.FirstSelected(); - DBG_ASSERT(pEntry,"kein Entry gefunden"); + OSL_ENSURE(pEntry,"no entry found"); SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); if(pEdit == &aFileNameED) { @@ -1328,9 +1275,6 @@ IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit ) } return 0; } -/*--------------------------------------------------------------------- - Beschreibung: ----------------------------------------------------------------------*/ IMPL_LINK( SwEditRegionDlg, DDEHdl, CheckBox*, pBox ) { @@ -1382,9 +1326,6 @@ IMPL_LINK( SwEditRegionDlg, DDEHdl, CheckBox*, pBox ) } return 0; } -/*--------------------------------------------------------------------- - ----------------------------------------------------------------------*/ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox ) { @@ -1397,7 +1338,7 @@ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox ) } SvLBoxEntry* pEntry=aTree.FirstSelected(); sal_Bool bSet = bChange ? bChange : aPasswdCB.IsChecked(); - DBG_ASSERT(pEntry,"kein Entry gefunden"); + OSL_ENSURE(pEntry,"no entry found"); while( pEntry ) { SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData(); @@ -1438,18 +1379,18 @@ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox ) } return 0; } + /*--------------------------------------------------------------------- - Beschreibung: Aktueller Bereichsname wird sofort beim editieren - in die TreeListBox eingetragen, mit leerem String - kein Ok() + Description: the current region name is being added to the + TreeListBox immediately during editing, with empty + string no Ok() ---------------------------------------------------------------------*/ - IMPL_LINK( SwEditRegionDlg, NameEditHdl, Edit *, EMPTYARG ) { if(!CheckPasswd(0)) return 0; SvLBoxEntry* pEntry=aTree.FirstSelected(); - DBG_ASSERT(pEntry,"kein Entry gefunden"); + OSL_ENSURE(pEntry,"no entry found"); if (pEntry) { String aName = aCurName.GetText(); @@ -1461,9 +1402,6 @@ IMPL_LINK( SwEditRegionDlg, NameEditHdl, Edit *, EMPTYARG ) } return 0; } -/*--------------------------------------------------------------------- - ----------------------------------------------------------------------*/ IMPL_LINK( SwEditRegionDlg, ConditionEditHdl, Edit *, pEdit ) { @@ -1472,7 +1410,7 @@ IMPL_LINK( SwEditRegionDlg, ConditionEditHdl, Edit *, pEdit ) return 0; pEdit->SetSelection(aSelect); SvLBoxEntry* pEntry = aTree.FirstSelected(); - DBG_ASSERT(pEntry,"kein Entry gefunden"); + OSL_ENSURE(pEntry,"no entry found"); while( pEntry ) { SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData(); @@ -1501,7 +1439,7 @@ IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg ) } SvLBoxEntry* pEntry = aTree.FirstSelected(); - DBG_ASSERT( pEntry, "no entry found" ); + OSL_ENSURE( pEntry, "no entry found" ); if ( pEntry ) { SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); @@ -1514,15 +1452,13 @@ IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg ) Application::SetDefDialogParent( m_pOldDefDlgParent ); return 0; } -/*-- 03.09.2009 16:24:18--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwEditRegionDlg, SubRegionEventHdl, VclWindowEvent *, pEvent ) { if( !bSubRegionsFilled && pEvent && pEvent->GetId() == VCLEVENT_DROPDOWN_PRE_OPEN ) { - //if necessary fill the names bookmarks/sections/tables now - + //if necessary fill the names bookmarks/sections/tables now + rtl::OUString sFileName = aFileNameED.GetText(); if(sFileName.getLength()) { @@ -1537,27 +1473,23 @@ IMPL_LINK( SwEditRegionDlg, SubRegionEventHdl, VclWindowEvent *, pEvent ) SfxMedium aMedium( sFileName, STREAM_STD_READ ); sFileName = aMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); ::lcl_ReadSections( aMedium, aSubRegionED ); - } + } else lcl_FillSubRegionList( rSh, aSubRegionED, 0 ); bSubRegionsFilled = true; - } + } return 0; } -/* -----------------------------08.05.2002 15:00------------------------------ - - ---------------------------------------------------------------------------*/ -Image SwEditRegionDlg::BuildBitmap(sal_Bool bProtect,sal_Bool bHidden, sal_Bool bHighContrast) +Image SwEditRegionDlg::BuildBitmap( sal_Bool bProtect, sal_Bool bHidden ) { - ImageList& rImgLst = bHighContrast ? aImageILH : aImageIL; + ImageList& rImgLst = aImageIL; return rImgLst.GetImage((!bHidden+(bProtect<<1)) + 1); } /*-------------------------------------------------------------------- - Beschreibung: Hilfsfunktion - Bereichsnamen aus dem Medium lesen + Description: helper function - read region names from medium --------------------------------------------------------------------*/ - static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox ) { rBox.Clear(); @@ -1576,9 +1508,7 @@ static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox ) aArr.DeleteAndDestroy(0, aArr.Count()); } } -/* -----------------21.05.99 10:16------------------- - * - * --------------------------------------------------*/ + SwInsertSectionTabDialog::SwInsertSectionTabDialog( Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) : SfxTabDialog( pParent, SW_RES(DLG_INSERT_SECTION), &rSet ), @@ -1589,7 +1519,7 @@ SwInsertSectionTabDialog::SwInsertSectionTabDialog( GetOKButton().SetText(sInsert); FreeResource(); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AddTabPage(TP_INSERT_SECTION, SwInsertSectionTabPage::Create, 0); AddTabPage(TP_COLUMN, SwColumnPage::Create, 0); AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0); @@ -1609,15 +1539,11 @@ SwInsertSectionTabDialog::SwInsertSectionTabDialog( } SetCurPageId(TP_INSERT_SECTION); } -/* -----------------21.05.99 10:17------------------- - * - * --------------------------------------------------*/ + SwInsertSectionTabDialog::~SwInsertSectionTabDialog() { } -/* -----------------21.05.99 10:23------------------- - * - * --------------------------------------------------*/ + void SwInsertSectionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { if(TP_INSERT_SECTION == nId) @@ -1638,21 +1564,16 @@ void SwInsertSectionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) else if(TP_SECTION_INDENTS == nId) ((SwSectionIndentTabPage&)rPage).SetWrtShell(rWrtSh); } -/* -----------------21.05.99 13:08------------------- - * - * --------------------------------------------------*/ void SwInsertSectionTabDialog::SetSectionData(SwSectionData const& rSect) { m_pSectionData.reset( new SwSectionData(rSect) ); } -/* -----------------21.05.99 13:10------------------- - * - * --------------------------------------------------*/ + short SwInsertSectionTabDialog::Ok() { short nRet = SfxTabDialog::Ok(); - DBG_ASSERT(m_pSectionData.get(), + OSL_ENSURE(m_pSectionData.get(), "SwInsertSectionTabDialog: no SectionData?"); const SfxItemSet* pOutputItemSet = GetOutputItemSet(); rWrtSh.InsertSection(*m_pSectionData, pOutputItemSet); @@ -1676,10 +1597,9 @@ short SwInsertSectionTabDialog::Ok() m_pSectionData->IsHidden())); aRequest.AppendItem(SfxBoolItem( FN_PARAM_REGION_PROTECT, m_pSectionData->IsProtectFlag())); - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections aRequest.AppendItem(SfxBoolItem( FN_PARAM_REGION_EDIT_IN_READONLY, m_pSectionData->IsEditInReadonlyFlag())); - // <-- String sLinkFileName( m_pSectionData->GetLinkFileName() ); aRequest.AppendItem(SfxStringItem( FN_PARAM_1, sLinkFileName.GetToken( 0, sfx2::cTokenSeperator ))); @@ -1690,9 +1610,6 @@ short SwInsertSectionTabDialog::Ok() return nRet; } -/* -----------------21.05.99 10:31------------------- - * - * --------------------------------------------------*/ SwInsertSectionTabPage::SwInsertSectionTabPage( Window *pParent, const SfxItemSet &rAttrSet) : SfxTabPage( pParent, SW_RES(TP_INSERT_SECTION), rAttrSet ), @@ -1717,10 +1634,9 @@ SwInsertSectionTabPage::SwInsertSectionTabPage( aHideCB ( this, SW_RES( CB_HIDE ) ), aConditionFT ( this, SW_RES( FT_CONDITION ) ), aConditionED ( this, SW_RES( ED_CONDITION ) ), - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections aPropertiesFL ( this, SW_RES( FL_PROPERTIES ) ), aEditInReadonlyCB ( this, SW_RES( CB_EDIT_IN_READONLY ) ), - // <-- m_pWrtSh(0), m_pDocInserter(NULL), @@ -1732,9 +1648,8 @@ SwInsertSectionTabPage::SwInsertSectionTabPage( aPasswdCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangePasswdHdl)); aPasswdPB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangePasswdHdl)); aHideCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangeHideHdl)); - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections aEditInReadonlyCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangeEditInReadonlyHdl)); - // <-- aFileCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, UseFileHdl )); aFilePB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, FileSearchHdl )); aCurName.SetModifyHdl ( LINK( this, SwInsertSectionTabPage, NameEditHdl)); @@ -1743,9 +1658,7 @@ SwInsertSectionTabPage::SwInsertSectionTabPage( aPasswdPB.SetAccessibleRelationMemberOf(&aProtectFL); aSubRegionED.EnableAutocomplete( sal_True, sal_True ); } -/* -----------------21.05.99 10:31------------------- - * - * --------------------------------------------------*/ + SwInsertSectionTabPage::~SwInsertSectionTabPage() { delete m_pDocInserter; @@ -1786,9 +1699,7 @@ void SwInsertSectionTabPage::SetWrtShell(SwWrtShell& rSh) aCurName.SetText( rSh.GetUniqueSectionName() ); } } -/* -----------------21.05.99 10:32------------------- - * - * --------------------------------------------------*/ + sal_Bool SwInsertSectionTabPage::FillItemSet( SfxItemSet& ) { SwSectionData aSection(CONTENT_SECTION, aCurName.GetText()); @@ -1796,9 +1707,9 @@ sal_Bool SwInsertSectionTabPage::FillItemSet( SfxItemSet& ) sal_Bool bProtected = aProtectCB.IsChecked(); aSection.SetProtectFlag(bProtected); aSection.SetHidden(aHideCB.IsChecked()); - // --> FME 2004-06-22 #114856# edit in readonly sections + // edit in readonly sections aSection.SetEditInReadonlyFlag(aEditInReadonlyCB.IsChecked()); - // <-- + if(bProtected) { aSection.SetPassword(m_aNewPasswd); @@ -1850,23 +1761,16 @@ sal_Bool SwInsertSectionTabPage::FillItemSet( SfxItemSet& ) ((SwInsertSectionTabDialog*)GetTabDialog())->SetSectionData(aSection); return sal_True; } -/* -----------------21.05.99 10:32------------------- - * - * --------------------------------------------------*/ + void SwInsertSectionTabPage::Reset( const SfxItemSet& ) { } -/* -----------------21.05.99 11:22------------------- - * - * --------------------------------------------------*/ + SfxTabPage* SwInsertSectionTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet) { return new SwInsertSectionTabPage(pParent, rAttrSet); } -/*--------------------------------------------------------------------- - ----------------------------------------------------------------------*/ IMPL_LINK( SwInsertSectionTabPage, ChangeHideHdl, CheckBox *, pBox ) { @@ -1875,17 +1779,11 @@ IMPL_LINK( SwInsertSectionTabPage, ChangeHideHdl, CheckBox *, pBox ) aConditionFT.Enable(bHide); return 0; } -/*--------------------------------------------------------------------- - ----------------------------------------------------------------------*/ IMPL_LINK( SwInsertSectionTabPage, ChangeEditInReadonlyHdl, CheckBox *, EMPTYARG ) { return 0; } -/*--------------------------------------------------------------------- - ----------------------------------------------------------------------*/ IMPL_LINK( SwInsertSectionTabPage, ChangeProtectHdl, CheckBox *, pBox ) { @@ -1894,9 +1792,7 @@ IMPL_LINK( SwInsertSectionTabPage, ChangeProtectHdl, CheckBox *, pBox ) aPasswdPB.Enable(bCheck); return 0; } -/* -----------------------------26.04.01 14:50-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton ) { sal_Bool bChange = pButton == &aPasswdPB; @@ -1927,9 +1823,6 @@ IMPL_LINK( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton ) m_aNewPasswd.realloc(0); return 0; } -/*--------------------------------------------------------------------- - ----------------------------------------------------------------------*/ IMPL_LINK_INLINE_START( SwInsertSectionTabPage, NameEditHdl, Edit *, EMPTYARG ) { @@ -1939,10 +1832,6 @@ IMPL_LINK_INLINE_START( SwInsertSectionTabPage, NameEditHdl, Edit *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwInsertSectionTabPage, NameEditHdl, Edit *, EMPTYARG ) -/*--------------------------------------------------------------------- - ----------------------------------------------------------------------*/ - IMPL_LINK( SwInsertSectionTabPage, UseFileHdl, CheckBox *, pBox ) { if( pBox->IsChecked() ) @@ -1962,7 +1851,6 @@ IMPL_LINK( SwInsertSectionTabPage, UseFileHdl, CheckBox *, pBox ) aDDECB.Enable(bFile); if( bFile ) { -// aFileNameED.SetText( aFileName ); aFileNameED.GrabFocus(); aProtectCB.Check( sal_True ); } @@ -1970,15 +1858,10 @@ IMPL_LINK( SwInsertSectionTabPage, UseFileHdl, CheckBox *, pBox ) { aDDECB.Check(sal_False); DDEHdl(&aDDECB); -// aFileNameED.SetText(aEmptyStr); } return 0; } -/*--------------------------------------------------------------------- - ----------------------------------------------------------------------*/ - IMPL_LINK( SwInsertSectionTabPage, FileSearchHdl, PushButton *, EMPTYARG ) { m_pOldDefDlgParent = Application::GetDefDialogParent(); @@ -1990,10 +1873,6 @@ IMPL_LINK( SwInsertSectionTabPage, FileSearchHdl, PushButton *, EMPTYARG ) return 0; } -/*--------------------------------------------------------------------- - ----------------------------------------------------------------------*/ - IMPL_LINK( SwInsertSectionTabPage, DDEHdl, CheckBox*, pBox ) { sal_Bool bDDE = pBox->IsChecked(); @@ -2048,8 +1927,8 @@ IMPL_LINK( SwInsertSectionTabPage, DlgClosedHdl, sfx2::FileDialogHelper *, _pFil // -------------------------------------------------------------- -// Numerierungsformat Umsetzung: -// ListBox - Format - Enum-Wert +// numbering format conversion: +// ListBox - format - enum-value // 0 - A, B, C, ... - 0 // 1 - a, b, c, ... - 1 // 2 - I, II, III, ... - 2 @@ -2204,7 +2083,6 @@ void SwSectionFtnEndTabPage::ResetState( sal_Bool bFtn, sal_uInt16 eState = rAttr.GetValue(); switch( eState ) { - // case FTNEND_ATPGORDOCEND: case FTNEND_ATTXTEND_OWNNUMANDFMT: pNtNumFmtCB->SetState( STATE_CHECK ); // no break; @@ -2261,7 +2139,6 @@ SfxTabPage* SwSectionFtnEndTabPage::Create( Window* pParent, IMPL_LINK( SwSectionFtnEndTabPage, FootEndHdl, CheckBox *, pBox ) { -// pBox->EnableTriState( sal_False ); sal_Bool bFoot = &aFtnNtAtTextEndCB == pBox || &aFtnNtNumCB == pBox || &aFtnNtNumFmtCB == pBox ; @@ -2316,9 +2193,6 @@ IMPL_LINK( SwSectionFtnEndTabPage, FootEndHdl, CheckBox *, pBox ) return 0; } -/* -----------------21.05.99 13:59------------------- - * - * --------------------------------------------------*/ SwSectionPropertyTabDialog::SwSectionPropertyTabDialog( Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) : SfxTabDialog(pParent, SW_RES(DLG_SECTION_PROPERTIES), &rSet), @@ -2326,7 +2200,7 @@ SwSectionPropertyTabDialog::SwSectionPropertyTabDialog( { FreeResource(); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AddTabPage(TP_COLUMN, SwColumnPage::Create, 0); AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 ); AddTabPage(TP_SECTION_FTNENDNOTES, SwSectionFtnEndTabPage::Create, 0); @@ -2343,15 +2217,11 @@ SwSectionPropertyTabDialog::SwSectionPropertyTabDialog( RemoveTabPage(TP_COLUMN); } } -/* -----------------21.05.99 13:59------------------- - * - * --------------------------------------------------*/ + SwSectionPropertyTabDialog::~SwSectionPropertyTabDialog() { } -/* -----------------21.05.99 13:59------------------- - * - * --------------------------------------------------*/ + void SwSectionPropertyTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { if( TP_BACKGROUND == nId ) @@ -2368,9 +2238,7 @@ void SwSectionPropertyTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage else if(TP_SECTION_INDENTS == nId) ((SwSectionIndentTabPage&)rPage).SetWrtShell(rWrtSh); } -/*-- 13.06.2003 09:59:08--------------------------------------------------- - -----------------------------------------------------------------------*/ SwSectionIndentTabPage::SwSectionIndentTabPage( Window *pParent, const SfxItemSet &rAttrSet ) : SfxTabPage(pParent, SW_RES(TP_SECTION_INDENTS), rAttrSet), aIndentFL(this, SW_RES(FL_INDENT )), @@ -2386,15 +2254,11 @@ SwSectionIndentTabPage::SwSectionIndentTabPage( Window *pParent, const SfxItemSe aAfterMF.SetModifyHdl(aLk); aPreviewWin.SetAccessibleName(aIndentFL.GetText()); } -/*-- 13.06.2003 09:59:23--------------------------------------------------- - -----------------------------------------------------------------------*/ SwSectionIndentTabPage::~SwSectionIndentTabPage() { } -/*-- 13.06.2003 09:59:23--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwSectionIndentTabPage::FillItemSet( SfxItemSet& rSet) { if(aBeforeMF.IsValueModified() || @@ -2407,9 +2271,7 @@ sal_Bool SwSectionIndentTabPage::FillItemSet( SfxItemSet& rSet) } return sal_True; } -/*-- 13.06.2003 09:59:24--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSectionIndentTabPage::Reset( const SfxItemSet& rSet) { //this page doesn't show up in HTML mode @@ -2435,16 +2297,12 @@ void SwSectionIndentTabPage::Reset( const SfxItemSet& rSet) aAfterMF.SaveValue(); IndentModifyHdl(0); } -/*-- 13.06.2003 09:59:24--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxTabPage* SwSectionIndentTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet) { return new SwSectionIndentTabPage(pParent, rAttrSet); } -/* -----------------13.06.2003 13:57----------------- - --------------------------------------------------*/ void SwSectionIndentTabPage::SetWrtShell(SwWrtShell& rSh) { //set sensible values at the preview @@ -2454,9 +2312,7 @@ void SwSectionIndentTabPage::SetWrtShell(SwWrtShell& rSh) Size aPageSize(rPageRect.Width(), rPageRect.Height()); aPreviewWin.SetSize(aPageSize); } -/* -----------------13.06.2003 14:02----------------- - --------------------------------------------------*/ IMPL_LINK(SwSectionIndentTabPage, IndentModifyHdl, MetricField*, EMPTYARG) { aPreviewWin.SetLeftMargin( static_cast< long >(aBeforeMF.Denormalize(aBeforeMF.GetValue(FUNIT_TWIP))) ); @@ -2465,3 +2321,4 @@ IMPL_LINK(SwSectionIndentTabPage, IndentModifyHdl, MetricField*, EMPTYARG) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx index 51e928eff7..808e169859 100644 --- a/sw/source/ui/dialog/wordcountdialog.cxx +++ b/sw/source/ui/dialog/wordcountdialog.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,9 +48,6 @@ #include <helpid.h> #endif /* ENABLE_LAYOUT */ -/*-- 06.04.2004 16:05:55--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwWordCountDialog::SwWordCountDialog(Window* pParent) : SfxModalDialog(pParent, SW_RES(DLG_WORDCOUNT)), #if defined _MSC_VER @@ -60,12 +58,16 @@ SwWordCountDialog::SwWordCountDialog(Window* pParent) : aCurrentWordFI( this, SW_RES( FI_CURRENTWORD )), aCurrentCharacterFT( this, SW_RES( FT_CURRENTCHARACTER )), aCurrentCharacterFI( this, SW_RES( FI_CURRENTCHARACTER )), + aCurrentCharacterExcludingSpacesFT( this, SW_RES( FT_CURRENTCHARACTEREXCLUDINGSPACES )), + aCurrentCharacterExcludingSpacesFI( this, SW_RES( FI_CURRENTCHARACTEREXCLUDINGSPACES )), aDocFL( this, SW_RES( FL_DOC )), aDocWordFT( this, SW_RES( FT_DOCWORD )), aDocWordFI( this, SW_RES( FI_DOCWORD )), aDocCharacterFT( this, SW_RES( FT_DOCCHARACTER )), aDocCharacterFI( this, SW_RES( FI_DOCCHARACTER )), + aDocCharacterExcludingSpacesFT( this, SW_RES( FT_DOCCHARACTEREXCLUDINGSPACES )), + aDocCharacterExcludingSpacesFI( this, SW_RES( FI_DOCCHARACTEREXCLUDINGSPACES )), aBottomFL(this, SW_RES( FL_BOTTOM )), aOK( this, SW_RES( PB_OK )), aHelp( this, SW_RES( PB_HELP )) @@ -78,22 +80,19 @@ SwWordCountDialog::SwWordCountDialog(Window* pParent) : #endif /* ENABLE_LAYOUT */ FreeResource(); } -/*-- 06.04.2004 16:05:56--------------------------------------------------- - -----------------------------------------------------------------------*/ SwWordCountDialog::~SwWordCountDialog() { } -/*-- 06.04.2004 16:05:57--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwWordCountDialog::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc) { aCurrentWordFI.SetText( String::CreateFromInt32(rCurrent.nWord )); aCurrentCharacterFI.SetText(String::CreateFromInt32(rCurrent.nChar )); + aCurrentCharacterExcludingSpacesFI.SetText(String::CreateFromInt32(rCurrent.nCharExcludingSpaces )); aDocWordFI.SetText( String::CreateFromInt32(rDoc.nWord )); aDocCharacterFI.SetText( String::CreateFromInt32(rDoc.nChar )); + aDocCharacterExcludingSpacesFI.SetText( String::CreateFromInt32(rDoc.nCharExcludingSpaces )); } - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/wordcountdialog.hrc b/sw/source/ui/dialog/wordcountdialog.hrc index ccb6391cf9..f8b64c86a0 100644 --- a/sw/source/ui/dialog/wordcountdialog.hrc +++ b/sw/source/ui/dialog/wordcountdialog.hrc @@ -26,18 +26,22 @@ ************************************************************************/ #ifndef SW_WORDCOUNTDIALOG_HRC #define SW_WORDCOUNTDIALOG_HRC -#define FL_CURRENT 1 -#define FT_CURRENTWORD 2 -#define FI_CURRENTWORD 3 -#define FT_CURRENTCHARACTER 4 -#define FI_CURRENTCHARACTER 5 -#define FL_DOC 6 -#define FT_DOCWORD 7 -#define FI_DOCWORD 8 -#define FT_DOCCHARACTER 9 -#define FI_DOCCHARACTER 10 -#define FL_BOTTOM 11 -#define PB_OK 12 -#define PB_HELP 13 +#define FL_CURRENT 1 +#define FT_CURRENTWORD 2 +#define FI_CURRENTWORD 3 +#define FT_CURRENTCHARACTER 4 +#define FI_CURRENTCHARACTER 5 +#define FT_CURRENTCHARACTEREXCLUDINGSPACES 6 +#define FI_CURRENTCHARACTEREXCLUDINGSPACES 7 +#define FL_DOC 8 +#define FT_DOCWORD 9 +#define FI_DOCWORD 10 +#define FT_DOCCHARACTER 11 +#define FI_DOCCHARACTER 12 +#define FT_DOCCHARACTEREXCLUDINGSPACES 13 +#define FI_DOCCHARACTEREXCLUDINGSPACES 14 +#define FL_BOTTOM 15 +#define PB_OK 16 +#define PB_HELP 17 #endif diff --git a/sw/source/ui/dialog/wordcountdialog.src b/sw/source/ui/dialog/wordcountdialog.src index d2d4676b35..f73cac2406 100644 --- a/sw/source/ui/dialog/wordcountdialog.src +++ b/sw/source/ui/dialog/wordcountdialog.src @@ -32,7 +32,7 @@ ModalDialog DLG_WORDCOUNT HelpID = HID_DLG_WORDCOUNT ; OutputSize = TRUE ; SVLook = TRUE ; - Size = MAP_APPFONT ( 170 , 108 ) ; + Size = MAP_APPFONT ( 170 , 132 ) ; Text [ en-US ] = "Word Count" ; Moveable = TRUE ; @@ -66,50 +66,74 @@ ModalDialog DLG_WORDCOUNT Size = MAP_APPFONT ( 50 , 8 ) ; Right = TRUE; }; + FixedText FT_CURRENTCHARACTEREXCLUDINGSPACES + { + Pos = MAP_APPFONT ( 12 , 38 ) ; + Size = MAP_APPFONT ( 98 , 8 ) ; + Text [ en-US ] = "Characters excluding spaces:"; + }; + FixedText FI_CURRENTCHARACTEREXCLUDINGSPACES + { + Pos = MAP_APPFONT ( 111 , 38 ) ; + Size = MAP_APPFONT ( 50 , 8 ) ; + Right = TRUE; + }; FixedLine FL_DOC { - Pos = MAP_APPFONT ( 6, 40 ) ; + Pos = MAP_APPFONT ( 6, 52 ) ; Size = MAP_APPFONT ( 158 , 8 ) ; Text [ en-US ] = "Whole document"; }; FixedText FT_DOCWORD { - Pos = MAP_APPFONT ( 12, 51 ) ; + Pos = MAP_APPFONT ( 12, 63 ) ; Size = MAP_APPFONT ( 80 , 8 ) ; Text [ en-US ] = "Words:"; }; FixedText FI_DOCWORD { - Pos = MAP_APPFONT ( 111 , 51 ) ; + Pos = MAP_APPFONT ( 111 , 63 ) ; Size = MAP_APPFONT ( 50 , 8 ) ; Right = TRUE; }; FixedText FT_DOCCHARACTER { - Pos = MAP_APPFONT ( 12 , 63 ) ; + Pos = MAP_APPFONT ( 12 , 75 ) ; Size = MAP_APPFONT ( 80 , 8 ) ; Text [ en-US ] = "Characters:"; }; FixedText FI_DOCCHARACTER { - Pos = MAP_APPFONT ( 111, 63 ) ; + Pos = MAP_APPFONT ( 111, 75 ) ; + Size = MAP_APPFONT ( 50, 8 ) ; + Right = TRUE; + }; + FixedText FT_DOCCHARACTEREXCLUDINGSPACES + { + Pos = MAP_APPFONT ( 12 , 87 ) ; + Size = MAP_APPFONT ( 98 , 8 ) ; + Text [ en-US ] = "Characters excluding spaces:"; + }; + FixedText FI_DOCCHARACTEREXCLUDINGSPACES + { + Pos = MAP_APPFONT ( 111, 87 ) ; Size = MAP_APPFONT ( 50, 8 ) ; Right = TRUE; }; FixedLine FL_BOTTOM { - Pos = MAP_APPFONT ( 6 , 77 ) ; + Pos = MAP_APPFONT ( 6 , 101 ) ; Size = MAP_APPFONT ( 158 , 8 ) ; }; OKButton PB_OK { - Pos = MAP_APPFONT ( 61 , 88 ) ; + Pos = MAP_APPFONT ( 61 , 112 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; DefButton = TRUE ; }; HelpButton PB_HELP { - Pos = MAP_APPFONT ( 114 , 88 ) ; + Pos = MAP_APPFONT ( 114 , 112 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; }; }; diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx index 8e75f16fec..ba831d380b 100755..100644 --- a/sw/source/ui/dochdl/gloshdl.cxx +++ b/sw/source/ui/dochdl/gloshdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,12 +36,7 @@ #ifndef __RSC //autogen #include <tools/errinf.hxx> #endif -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif -#ifndef _MSGBOX_HXX //autogen -#include <vcl/msgbox.hxx> -#endif #include <svl/macitem.hxx> #include <sfx2/fcontnr.hxx> #include <sfx2/docfile.hxx> @@ -52,32 +48,24 @@ #include <fmtcol.hxx> #include <docary.hxx> #include <wrtsh.hxx> -#include <uitool.hxx> // Fehlermeldungen +#include <uitool.hxx> // error messages #include <view.hxx> #include <swevent.hxx> #include <gloshdl.hxx> #include <glosdoc.hxx> #include <shellio.hxx> -#include <swundo.hxx> // fuer Undo-Ids +#include <swundo.hxx> // for Undo-Ids #include <expfld.hxx> -#include <initui.hxx> // fuer ::GetGlossaries() +#include <initui.hxx> // for ::GetGlossaries() #include <gloslst.hxx> #include <swdtflvr.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <crsskip.hxx> -#ifndef _DOCHDL_HRC #include <dochdl.hrc> -#endif -#ifndef _SWERROR_H #include <swerror.h> -#endif #include <frmmgr.hxx> -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif #include <editeng/acorrcfg.hxx> #include "swabstdlg.hxx" @@ -90,7 +78,7 @@ using namespace ::com::sun::star; const short RET_EDIT = 100; -// PUBLIC METHODES ------------------------------------------------------- +// PUBLIC METHODS ------------------------------------------------------- struct TextBlockInfo_Impl { String sTitle; @@ -101,18 +89,17 @@ typedef TextBlockInfo_Impl* TextBlockInfo_ImplPtr; SV_DECL_PTRARR_DEL( TextBlockInfoArr, TextBlockInfo_ImplPtr, 0, 4 ) SV_IMPL_PTRARR( TextBlockInfoArr, TextBlockInfo_ImplPtr ) SV_IMPL_REF( SwDocShell ) + /*------------------------------------------------------------------------ - Beschreibung: Dialog fuer Bearbeiten Vorlagen + Description: Dialog for edit templates ------------------------------------------------------------------------*/ - - void SwGlossaryHdl::GlossaryDlg() { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractGlossaryDlg* pDlg = pFact->CreateGlossaryDlg( DLG_RENAME_GLOS, pViewFrame, this, pWrtShell); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); String sName, sShortName; if( RET_EDIT == pDlg->Execute() ) @@ -133,12 +120,9 @@ void SwGlossaryHdl::GlossaryDlg() } /*------------------------------------------------------------------------ - Beschreibung: Setzen der aktuellen Gruppe; falls aus dem Dialog - gerufen, wird die Gruppe temp. erzeugt fuer einen - schnelleren Zugriff + Description: set the default group; if called from the dialog + the group is created temporarily for faster access ------------------------------------------------------------------------*/ - - void SwGlossaryHdl::SetCurGroup(const String &rGrp, sal_Bool bApi, sal_Bool bAlwaysCreateNew ) { String sGroup(rGrp); @@ -172,12 +156,9 @@ void SwGlossaryHdl::SetCurGroup(const String &rGrp, sal_Bool bApi, sal_Bool bAlw sGroup.GetToken(0, GLOS_DELIM) == sCurBase) bPathEqual = sal_True; } -// const String aMac_Tmp(pCurGrp->GetName()); - // Beim Pfadwechsel kann man sich auf den Namen nicht verlassen - if(!bAlwaysCreateNew && - bPathEqual -// aMac_Tmp == sGroup - ) + + // When path changed, the name is not reliable + if(!bAlwaysCreateNew && bPathEqual) return; } aCurGrp = sGroup; @@ -192,21 +173,11 @@ void SwGlossaryHdl::SetCurGroup(const String &rGrp, sal_Bool bApi, sal_Bool bAlw } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - sal_uInt16 SwGlossaryHdl::GetGroupCnt() const { return rStatGlossaries.GetGroupCnt(); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - String SwGlossaryHdl::GetGroupName( sal_uInt16 nId, String* pTitle ) { String sRet = rStatGlossaries.GetGroupName(nId); @@ -228,10 +199,6 @@ String SwGlossaryHdl::GetGroupName( sal_uInt16 nId, String* pTitle ) } return sRet; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - sal_Bool SwGlossaryHdl::NewGroup(String &rGrpName, const String& rTitle) { @@ -239,9 +206,7 @@ sal_Bool SwGlossaryHdl::NewGroup(String &rGrpName, const String& rTitle) FindGroupName(rGrpName); return rStatGlossaries.NewGroupDoc(rGrpName, rTitle); } -/* -----------------23.11.98 13:10------------------- - * Umbenennen eines Textbausteins - * --------------------------------------------------*/ + sal_Bool SwGlossaryHdl::RenameGroup(const String & rOld, String& rNew, const String& rNewTitle) { sal_Bool bRet = sal_False; @@ -271,9 +236,7 @@ sal_Bool SwGlossaryHdl::RenameGroup(const String & rOld, String& rNew, const Str } return bRet; } -/* -----------------27.11.98 13:49------------------- - * - * --------------------------------------------------*/ + sal_Bool SwGlossaryHdl::CopyOrMove( const String& rSourceGroupName, String& rSourceShortName, const String& rDestGroupName, const String& rLongName, sal_Bool bMove ) { @@ -282,18 +245,14 @@ sal_Bool SwGlossaryHdl::CopyOrMove( const String& rSourceGroupName, String& rSo SwTextBlocks* pDestGroup = rStatGlossaries.GetGroupDoc(rDestGroupName, sal_False); if(pDestGroup->IsReadOnly() || (bMove && pSourceGroup->IsReadOnly()) ) return sal_False; - /*if(pDestGroup->IsOld()&& 0!= pDestGroup->ConvertToNew()) - return sal_False; - if(bMove && pSourceGroup->IsOld() && 0 != pSourceGroup->ConvertToNew()) - return sal_False;*/ - //Der Index muss hier ermittelt werden, weil rSourceShortName in CopyBlock evtl veraendert wird + //The index must be determined here because rSourceShortName maybe changed in CopyBlock sal_uInt16 nDeleteIdx = pSourceGroup->GetIndex( rSourceShortName ); - DBG_ASSERT(USHRT_MAX != nDeleteIdx, "Eintrag nicht gefunden"); + OSL_ENSURE(USHRT_MAX != nDeleteIdx, "entry not found"); sal_uLong nRet = pSourceGroup->CopyBlock( *pDestGroup, rSourceShortName, rLongName ); if(!nRet && bMove) { - // der Index muss existieren + // the index must be existing nRet = pSourceGroup->Delete( nDeleteIdx ) ? 0 : 1; } rStatGlossaries.PutGroupDoc( pSourceGroup ); @@ -302,10 +261,8 @@ sal_Bool SwGlossaryHdl::CopyOrMove( const String& rSourceGroupName, String& rSo } /*------------------------------------------------------------------------ - Beschreibung: Loeschen einer Textbausteindatei-Gruppe + Description: delete a autotext-file-group ------------------------------------------------------------------------*/ - - sal_Bool SwGlossaryHdl::DelGroup(const String &rGrpName) { String sGroup(rGrpName); @@ -325,40 +282,28 @@ sal_Bool SwGlossaryHdl::DelGroup(const String &rGrpName) } /*------------------------------------------------------------------------ - Beschreibung: Anzahl Textbausteine erfragen + Description: ask for number of autotexts ------------------------------------------------------------------------*/ - - sal_uInt16 SwGlossaryHdl::GetGlossaryCnt() { return pCurGrp ? pCurGrp->GetCount() : 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - String SwGlossaryHdl::GetGlossaryName( sal_uInt16 nId ) { - ASSERT(nId < GetGlossaryCnt(), Textbausteinarray ueberindiziert.); + OSL_ENSURE(nId < GetGlossaryCnt(), "Textbausteinarray ueberindiziert."); return pCurGrp->GetLongName( nId ); } -/* -----------------30.11.98 13:18------------------- - * - * --------------------------------------------------*/ + String SwGlossaryHdl::GetGlossaryShortName(sal_uInt16 nId) { - ASSERT(nId < GetGlossaryCnt(), Textbausteinarray ueberindiziert.); + OSL_ENSURE(nId < GetGlossaryCnt(), "Textbausteinarray ueberindiziert."); return pCurGrp->GetShortName( nId ); } - /*------------------------------------------------------------------------ - Beschreibung: Kurzname erfragen + Description: ask for short name ------------------------------------------------------------------------*/ - - String SwGlossaryHdl::GetGlossaryShortName(const String &rName) { String sReturn; @@ -376,10 +321,8 @@ String SwGlossaryHdl::GetGlossaryShortName(const String &rName) } /*------------------------------------------------------------------------ - Beschreibung: Kuerzel fuer Textbaustein bereits verwendet? + Description: short name for autotext already used? ------------------------------------------------------------------------*/ - - sal_Bool SwGlossaryHdl::HasShortName(const String& rShortName) const { SwTextBlocks *pBlock = pCurGrp ? pCurGrp @@ -390,32 +333,14 @@ sal_Bool SwGlossaryHdl::HasShortName(const String& rShortName) const return bRet; } -/* -----------------------------20.03.01 10:52-------------------------------- - - ---------------------------------------------------------------------------*/ sal_Bool SwGlossaryHdl::ConvertToNew(SwTextBlocks& /*rOld*/) { - /*if( rOld.IsOld() ) - { - QueryBox aAsk( pWrtShell->GetView().GetWindow(), SW_RES( MSG_UPDATE_NEW_GLOS_FMT ) ); - if( aAsk.Execute() == RET_YES ) - { - if( rOld.ConvertToNew() ) - { - InfoBox(pWrtShell->GetView().GetWindow(), SW_RES(MSG_ERR_INSERT_GLOS)).Execute(); - return sal_False; - } - } - else - return sal_False; - }*/ return sal_True; } /*------------------------------------------------------------------------ - Beschreibung: Erzeugen eines Textbausteines + Desription: Create autotext ------------------------------------------------------------------------*/ - sal_Bool SwGlossaryHdl::NewGlossary(const String& rName, const String& rShortName, sal_Bool bCreateGroup, sal_Bool bNoAttr) { @@ -449,10 +374,8 @@ sal_Bool SwGlossaryHdl::NewGlossary(const String& rName, const String& rShortNam return sal_Bool( nSuccess != (sal_uInt16) -1 ); } /*------------------------------------------------------------------------ - Beschreibung: Loeschen eines Textbausteines + Description: Delete a autotext ------------------------------------------------------------------------*/ - - sal_Bool SwGlossaryHdl::DelGlossary(const String &rShortName) { SwTextBlocks *pGlossary = pCurGrp ? pCurGrp @@ -470,18 +393,16 @@ sal_Bool SwGlossaryHdl::DelGlossary(const String &rShortName) } /*------------------------------------------------------------------------ - Beschreibung: Kurzform expandieren + Description: expand short name ------------------------------------------------------------------------*/ - - sal_Bool SwGlossaryHdl::ExpandGlossary() { - ASSERT(pWrtShell->CanInsert(), illegal); + OSL_ENSURE(pWrtShell->CanInsert(), "illegal"); SwTextBlocks *pGlossary; SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); ::GlossaryGetCurrGroup fnGetCurrGroup = pFact->GetGlossaryCurrGroupFunc( DLG_RENAME_GLOS ); - DBG_ASSERT(fnGetCurrGroup, "Dialogdiet fail!"); + OSL_ENSURE(fnGetCurrGroup, "Dialogdiet fail!"); String sGroupName( (*fnGetCurrGroup)() ); if(STRING_NOTFOUND == sGroupName.Search(GLOS_DELIM)) FindGroupName(sGroupName); @@ -489,7 +410,7 @@ sal_Bool SwGlossaryHdl::ExpandGlossary() String aShortName; - // bei Textselektion diese verwenden + // use this at text selection if(pWrtShell->SwCrsrShell::HasSelection() && !pWrtShell->IsBlockMode()) { aShortName = pWrtShell->GetSelTxt(); @@ -502,9 +423,9 @@ sal_Bool SwGlossaryHdl::ExpandGlossary() pWrtShell->LeaveBlockMode(); else if(pWrtShell->IsExtMode()) pWrtShell->LeaveExtMode(); - // Wort selektieren + // select word pWrtShell->SelNearestWrd(); - // Wort erfragen + // ask for word if(pWrtShell->IsSelection()) aShortName = pWrtShell->GetSelTxt(); } @@ -530,7 +451,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, sal_uInt16 nGroupCount = pGlossaryList->GetGroupCount(); for(sal_uInt16 i = 1; i <= nGroupCount; i++) { - // Gruppenname mit Pfad-Extension besorgen + // get group name with path-extension String sTitle; String sGroupName = pGlossaryList->GetGroupName(i - 1, sal_False, &sTitle); if(sGroupName == pGlossary->GetName()) @@ -553,7 +474,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, } } } - if( aFoundArr.Count() ) // einer wurde gefunden + if( aFoundArr.Count() ) // one was found { pGlossaries->PutGroupDoc(pGlossary); if(1 == aFoundArr.Count()) @@ -565,10 +486,10 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, else { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - AbstarctSwSelGlossaryDlg* pDlg = pFact->CreateSwSelGlossaryDlg( 0, aShortName, DLG_SEL_GLOS ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + AbstractSwSelGlossaryDlg* pDlg = pFact->CreateSwSelGlossaryDlg( 0, aShortName, DLG_SEL_GLOS ); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); for(sal_uInt16 i = 0; i < aFoundArr.Count(); ++i) { TextBlockInfo_Impl* pData = aFoundArr.GetObject(i); @@ -594,7 +515,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, } } - // nicht gefunden + // not found if( nFound == (sal_uInt16) -1 ) { if( !bCancel ) @@ -621,10 +542,10 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, SvxMacro aEndMacro(aEmptyStr, aEmptyStr, STARBASIC); GetMacros( aShortName, aStartMacro, aEndMacro, pGlossary ); - // StartAction darf nich vor HasSelection und DelRight stehen, - // sonst wird der moeglich Shellwechsel verzoegert und - // API-Programme wuerden dann haengenbleiben - // ausserdem darf das Ereignismacro ebenfalls nicht in einer Action gerufen werden + // StartAction must not be before HasSelection and DelRight, + // otherwise the possible Shell change gets delayed and + // API-programs would hang. + // Moreover the event macro must also not be called in an action pWrtShell->StartUndo(UNDO_INSGLOSSARY); if( aStartMacro.GetMacName().Len() ) pWrtShell->ExecMacro( aStartMacro ); @@ -632,7 +553,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, pWrtShell->DelLeft(); pWrtShell->StartAllAction(); - // alle InputFelder zwischenspeichern + // cache all InputFields SwInputFieldList aFldLst( pWrtShell, sal_True ); pWrtShell->InsertGlossary(*pGlossary, aShortName); @@ -643,7 +564,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, } pWrtShell->EndUndo(UNDO_INSGLOSSARY); - // fuer alle neuen InputFelder die Eingaben abfordern + // demand input for all new InputFields if( aFldLst.BuildSortLst() ) pWrtShell->UpdateInputFlds( &aFldLst ); } @@ -652,13 +573,11 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, } /*------------------------------------------------------------------------ - Beschreibung: Textbaustein einfuegen + Description: add autotext ------------------------------------------------------------------------*/ - - sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName) { - ASSERT(pWrtShell->CanInsert(), illegal); + OSL_ENSURE(pWrtShell->CanInsert(), "illegal"); SwTextBlocks *pGlos = pCurGrp? pCurGrp: rStatGlossaries.GetGroupDoc(aCurGrp); @@ -670,17 +589,17 @@ sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName) SvxMacro aEndMacro(aEmptyStr, aEmptyStr, STARBASIC); GetMacros( rName, aStartMacro, aEndMacro, pGlos ); - // StartAction darf nich vor HasSelection und DelRight stehen, - // sonst wird der moeglich Shellwechsel verzoegert und - // API-Programme wuerden dann haengenbleiben - // ausserdem darf das Ereignismacro ebenfalls nicht in einer Action gerufen werden + // StartAction must not be before HasSelection and DelRight, + // otherwise the possible Shell change gets delayed and + // API-programs would hang. + // Moreover the event macro must also not be called in an action if( aStartMacro.GetMacName().Len() ) pWrtShell->ExecMacro( aStartMacro ); if( pWrtShell->HasSelection() ) pWrtShell->DelRight(); pWrtShell->StartAllAction(); - // alle InputFelder zwischenspeichern + // cache all InputFields SwInputFieldList aFldLst( pWrtShell, sal_True ); pWrtShell->InsertGlossary(*pGlos, rName); @@ -690,7 +609,7 @@ sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName) pWrtShell->ExecMacro( aEndMacro ); } - // fuer alle neuen InputFelder die Eingaben abfordern + // demand input for all new InputFields if( aFldLst.BuildSortLst() ) pWrtShell->UpdateInputFlds( &aFldLst ); @@ -700,10 +619,8 @@ sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName) } /*------------------------------------------------------------------------ - Beschreibung: Macro setzen / erfragen + Description: set / ask for macro ------------------------------------------------------------------------*/ - - void SwGlossaryHdl::SetMacros(const String& rShortName, const SvxMacro* pStart, const SvxMacro* pEnd, @@ -755,10 +672,8 @@ void SwGlossaryHdl::GetMacros( const String &rShortName, /*------------------------------------------------------------------------ - Beschreibung: ctor, dtor + Description: ctor, dtor ------------------------------------------------------------------------*/ - - SwGlossaryHdl::SwGlossaryHdl(SfxViewFrame* pVwFrm, SwWrtShell *pSh) : rStatGlossaries( *::GetGlossaries() ), aCurGrp( rStatGlossaries.GetDefName() ), @@ -768,7 +683,6 @@ SwGlossaryHdl::SwGlossaryHdl(SfxViewFrame* pVwFrm, SwWrtShell *pSh) { } - SwGlossaryHdl::~SwGlossaryHdl() { if( pCurGrp ) @@ -776,10 +690,8 @@ SwGlossaryHdl::~SwGlossaryHdl() } /*------------------------------------------------------------------------ - Beschreibung: Umbenennen eines Textbausteines + Description: rename an autotext ------------------------------------------------------------------------*/ - - sal_Bool SwGlossaryHdl::Rename(const String& rOldShort, const String& rNewShortName, const String& rNewName ) { @@ -839,17 +751,14 @@ sal_Bool SwGlossaryHdl::IsOld() const return bRet; } -/*-----------------09.06.97 16:15------------------- - Gruppe ohne Pfadindex finden +/*-------------------------------------------------- + find group without path index --------------------------------------------------*/ sal_Bool SwGlossaryHdl::FindGroupName(String & rGroup) { return rStatGlossaries.FindGroupName(rGroup); } -/* -----------------29.07.99 08:34------------------- - - --------------------------------------------------*/ sal_Bool SwGlossaryHdl::CopyToClipboard(SwWrtShell& rSh, const String& rShortName) { SwTextBlocks *pGlossary = pCurGrp ? pCurGrp @@ -896,3 +805,4 @@ sal_Bool SwGlossaryHdl::ImportGlossaries( const String& rName ) return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dochdl/selglos.cxx b/sw/source/ui/dochdl/selglos.cxx index 1c05981991..e93cc55dd5 100644 --- a/sw/source/ui/dochdl/selglos.cxx +++ b/sw/source/ui/dochdl/selglos.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,15 +64,15 @@ SwSelGlossaryDlg::SwSelGlossaryDlg(Window * pParent, const String &rShortName) aGlosBox.SetDoubleClickHdl(LINK(this, SwSelGlossaryDlg, DoubleClickHdl)); } -/*-----------------25.02.94 20:50------------------- - dtor ueberladen +/*-------------------------------------------------- + overload dtor --------------------------------------------------*/ SwSelGlossaryDlg::~SwSelGlossaryDlg() {} -/* -----------------25.10.99 08:33------------------- - --------------------------------------------------*/ IMPL_LINK(SwSelGlossaryDlg, DoubleClickHdl, ListBox*, /*pBox*/) { EndDialog(RET_OK); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dochdl/selglos.src b/sw/source/ui/dochdl/selglos.src index 5a79079fe7..134edfd3f7 100644 --- a/sw/source/ui/dochdl/selglos.src +++ b/sw/source/ui/dochdl/selglos.src @@ -37,7 +37,6 @@ ModalDialog DLG_SEL_GLOS OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 220 , 100 ) ; - /* ### ACHTUNG: Neuer Text in Resource? AutoText einf�gen : AutoText einf�gen */ Text [ en-US ] = "Insert AutoText" ; Moveable = TRUE ; OKButton BT_OK @@ -63,7 +62,6 @@ ModalDialog DLG_SEL_GLOS { Pos = MAP_APPFONT ( 6 , 3 ) ; Size = MAP_APPFONT ( 152 , 8 ) ; - /* ### ACHTUNG: Neuer Text in Resource? AutoTexte zum K�rzel : AutoTexte zum K�rzel */ Text [ en-US ] = "AutoTexts for shortcut " ; }; ListBox LB_GLOS diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index 9ce88fffaf..4732b8e51b 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -103,7 +104,7 @@ #include <docsh.hxx> #include <wdocsh.hxx> #include <fldbas.hxx> //DDE -#include <swundo.hxx> // fuer Undo-Ids +#include <swundo.hxx> // for Undo-Ids #include <pam.hxx> #include <ndole.hxx> #include <swwait.hxx> @@ -134,7 +135,7 @@ #include <swcrsr.hxx> #include <SwRewriter.hxx> #include <globals.hrc> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <swserv.hxx> @@ -233,9 +234,6 @@ public: } }; - -// ----------------------------------------------------------------------- - SwTransferable::SwTransferable( SwWrtShell& rSh ) : pWrtShell( &rSh ), pCreatorView( 0 ), @@ -266,13 +264,11 @@ SwTransferable::SwTransferable( SwWrtShell& rSh ) } } -// ----------------------------------------------------------------------- - SwTransferable::~SwTransferable() { Application::GetSolarMutex().acquire(); - // der DDELink braucht noch die WrtShell! + // the DDELink still needs the WrtShell! if( refDdeLink.Is() ) { ((SwTrnsfrDdeLink*)&refDdeLink)->Disconnect( sal_True ); @@ -281,14 +277,13 @@ SwTransferable::~SwTransferable() pWrtShell = 0; - // dvo 2002-05-30, #99239#: release reference to the document so that - // aDocShellRef will delete it (if aDocShellRef is set). Otherwise, the OLE - // nodes keep references to their sub-storage when the storage is already - // dead. + // release reference to the document so that aDocShellRef will delete + // it (if aDocShellRef is set). Otherwise, the OLE nodes keep references + // to their sub-storage when the storage is already dead. delete pClpDocFac; - //JP 22.04.95: erst schliessen, dann kann die Ref. auch gecleared werden, - // so das die DocShell auch tatsaechlich geloescht wird! + // first close, then the Ref. can be cleared as well, so that + // the DocShell really gets deleted! if( aDocShellRef.Is() ) { SfxObjectShell * pObj = aDocShellRef; @@ -318,12 +313,10 @@ SwTransferable::~SwTransferable() Application::GetSolarMutex().release(); } -// ----------------------------------------------------------------------- - static SwDoc * lcl_GetDoc(SwDocFac & rDocFac) { SwDoc *const pDoc = rDocFac.GetDoc(); - ASSERT( pDoc, "Document not found" ); + OSL_ENSURE( pDoc, "Document not found" ); if (pDoc) { pDoc->SetClipBoard( true ); @@ -331,8 +324,6 @@ static SwDoc * lcl_GetDoc(SwDocFac & rDocFac) return pDoc; } -// ----------------------------------------------------------------------- - void SwTransferable::ObjectReleased() { SwModule *pMod = SW_MOD(); @@ -342,8 +333,6 @@ void SwTransferable::ObjectReleased() pMod->pXSelection = 0; } -// ----------------------------------------------------------------------- - void SwTransferable::AddSupportedFormats() { // only need if we are the current XSelection Object @@ -354,20 +343,16 @@ void SwTransferable::AddSupportedFormats() } } -// ----------------------------------------------------------------------- - void SwTransferable::InitOle( SfxObjectShell* pDoc, SwDoc& rDoc ) { - //OleVisArea einstellen. Linke obere Ecke der Seite und Groesse - //der RealSize in Twips. + //set OleVisArea. Upper left corner of the page and size of + //RealSize in Twips. const Size aSz( OLESIZE ); SwRect aVis( Point( DOCUMENTBORDER, DOCUMENTBORDER ), aSz ); pDoc->SetVisArea( aVis.SVRect() ); rDoc.set(IDocumentSettingAccess::BROWSE_MODE, true ); } -// ----------------------------------------------------------------------- - uno::Reference < embed::XEmbeddedObject > SwTransferable::FindOLEObj( sal_Int64& nAspect ) const { uno::Reference < embed::XEmbeddedObject > xObj; @@ -387,8 +372,6 @@ uno::Reference < embed::XEmbeddedObject > SwTransferable::FindOLEObj( sal_Int64& return xObj; } -// ----------------------------------------------------------------------- - Graphic* SwTransferable::FindOLEReplacementGraphic() const { if( pClpDocFac ) @@ -406,17 +389,12 @@ Graphic* SwTransferable::FindOLEReplacementGraphic() const return NULL; } - -// ----------------------------------------------------------------------- - void SwTransferable::RemoveDDELinkFormat( const Window& rWin ) { RemoveFormat( SOT_FORMATSTR_ID_LINK ); CopyToClipboard( (Window*)&rWin ); } -// ----------------------------------------------------------------------- - sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor ) { sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor ); @@ -432,7 +410,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor ) { SelectionType nSelectionType = pWrtShell->GetSelectionType(); -// SEL_GRF kommt vom ContentType der editsh +// SEL_GRF comes from ContentType of editsh if( (nsSelectionType::SEL_GRF | nsSelectionType::SEL_DRW_FORM) & nSelectionType ) { pClpGraphic = new Graphic; @@ -442,7 +420,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor ) if( !pWrtShell->GetDrawObjGraphic( FORMAT_BITMAP, *pClpBitmap )) pOrigGrf = pClpBitmap; - // ist es ein URL-Button ? + // is it an URL-Button ? String sURL, sDesc; if( pWrtShell->GetURLFromButton( sURL, sDesc ) ) { @@ -454,10 +432,10 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor ) pClpDocFac = new SwDocFac; SwDoc *const pTmpDoc = lcl_GetDoc(*pClpDocFac); - pTmpDoc->LockExpFlds(); // nie die Felder updaten - Text so belassen + pTmpDoc->LockExpFlds(); // never update fields - leave text as it is pWrtShell->Copy( pTmpDoc ); - // es wurde in der CORE eine neu angelegt (OLE-Objekte kopiert!) + // in CORE a new one was created (OLE-Objekte copied!) aDocShellRef = pTmpDoc->GetTmpDocShell(); if( aDocShellRef.Is() ) SwTransferable::InitOle( aDocShellRef, *pTmpDoc ); @@ -500,8 +478,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor ) if( TRNSFR_OLE == eBufferType ) { //TODO/MBA: testing - is this the "single OLE object" case?! - // aus dem ClipDoc das OLE-Object besorgen und von dem die Daten - // besorgen. + // get OLE-Object from ClipDoc and get the data from that. sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT; // will be set in the next statement uno::Reference < embed::XEmbeddedObject > xObj = FindOLEObj( nAspect ); Graphic* pOLEGraph = FindOLEReplacementGraphic(); @@ -575,7 +552,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor ) bOK = SetGDIMetaFile( pClpGraphic->GetGDIMetaFile(), rFlavor ); break; case SOT_FORMAT_BITMAP: - // #126398# Neither pClpBitmap nor pClpGraphic are necessarily set + // Neither pClpBitmap nor pClpGraphic are necessarily set if( (eBufferType & TRNSFR_GRAPHIC) && (pClpBitmap != 0 || pClpGraphic != 0)) bOK = SetBitmap( (pClpBitmap ? pClpBitmap : pClpGraphic)->GetBitmap(), @@ -603,7 +580,6 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor ) break; case SOT_FORMATSTR_ID_EMBED_SOURCE: -// default: if( !aDocShellRef.Is() ) { SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac); @@ -621,8 +597,6 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor ) return bOK; } -// ----------------------------------------------------------------------- - sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream, void* pObject, sal_uInt32 nObjectType, const DATA_FLAVOR& /*rFlavor*/ ) @@ -634,18 +608,17 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream, { case SWTRANSFER_OBJECTTYPE_DRAWMODEL: { - //JP 28.02.2001: dont change the sequence of commands - Bug 8 + // dont change the sequence of commands SdrModel *pModel = (SdrModel*)pObject; xStream->SetBufferSize( 16348 ); - // #108584# // for the changed pool defaults from drawing layer pool set those // attributes as hard attributes to preserve them for saving const SfxItemPool& rItemPool = pModel->GetItemPool(); const SvxFontHeightItem& rDefaultFontHeight = (const SvxFontHeightItem&)rItemPool.GetDefaultItem(EE_CHAR_FONTHEIGHT); // SW should have no MasterPages - DBG_ASSERT(0L == pModel->GetMasterPageCount(), "SW with MasterPages (!)"); + OSL_ENSURE(0L == pModel->GetMasterPageCount(), "SW with MasterPages (!)"); for(sal_uInt16 a(0); a < pModel->GetPageCount(); a++) { @@ -745,7 +718,7 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream, aAOpt.SetCharSet( RTL_TEXTENCODING_UTF8 ); xWrt->SetAsciiOptions( aAOpt ); - // #102841# no start char for clipboard + // no start char for clipboard xWrt->bUCS2_WithStartChar = sal_False; } break; @@ -769,8 +742,6 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream, return bRet; } -// ----------------------------------------------------------------------- - int SwTransferable::Cut() { int nRet = Copy( sal_True ); @@ -779,13 +750,11 @@ int SwTransferable::Cut() return nRet; } -// ----------------------------------------------------------------------- - void SwTransferable::DeleteSelection() { if(!pWrtShell) return; - // Selektionsart vor Action-Klammerung erfragen + // ask for type of selection before action-bracketing const int nSelection = pWrtShell->GetSelectionType(); pWrtShell->StartUndo( UNDO_DELETE ); if( ( nsSelectionType::SEL_TXT | nsSelectionType::SEL_TBL ) & nSelection ) @@ -794,8 +763,6 @@ void SwTransferable::DeleteSelection() pWrtShell->EndUndo( UNDO_DELETE ); } -// ----------------------------------------------------------------------- - int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) { int nRet = 1; @@ -823,10 +790,8 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) PrepareOLE( aObjDesc ); AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ); - // --> OD 2005-02-09 #119353# - robust const Graphic* pGrf = pWrtShell->GetGraphic(); if( pGrf && pGrf->IsSupportedGraphic() ) - // <-- { AddFormat( FORMAT_GDIMETAFILE ); AddFormat( FORMAT_BITMAP ); @@ -850,7 +815,7 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) AddFormat( FORMAT_GDIMETAFILE ); eBufferType = TRNSFR_OLE; } - //Gibt es ueberhaupt etwas zum bereitstellen? + // Is there anything to provide anyway? else if ( pWrtShell->IsSelection() || pWrtShell->IsFrmSelected() || pWrtShell->IsObjSelected() ) { @@ -860,10 +825,10 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) pClpDocFac = new SwDocFac; - // zusaetzlichen Cursor erzeugen, damit eine Gleichbehandlung - // von Tastatur- und Mausselektion moeglich ist. - // Im AddMode wird bei Tastaturselektion der neue Cursor erst - // beim Bewegen des Cursors nach Selektionsende erzeugt. + // create additional cursor so that equal treatment of keyboard + // and mouse selection is possible. + // In AddMode with keyboard selection, the new cursor is not created + // before the cursor is moved after end of selection. if( pWrtShell->IsAddMode() && pWrtShell->SwCrsrShell::HasSelection() ) pWrtShell->CreateCrsr(); @@ -890,7 +855,7 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) pMarkAccess->deleteMark(*ppMark); } - // es wurde in der CORE eine neu angelegt (OLE-Objekte kopiert!) + // a new one was created in CORE (OLE-Objekte copied!) aDocShellRef = pTmpDoc->GetTmpDocShell(); if( aDocShellRef.Is() ) SwTransferable::InitOle( aDocShellRef, *pTmpDoc ); @@ -912,11 +877,10 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) bDDELink = pWrtShell->HasWholeTabSelection(); } - //Wenn's einer braucht OLE'n wir ihm was. + //When someone needs it, we 'OLE' him something AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); - //RTF vor das Metafile von OLE stellen, weil mit weniger verlusten - //behaftet. + //put RTF ahead of the OLE's Metafile to have less loss if( !pWrtShell->IsObjSelected() ) { AddFormat( FORMAT_RTF ); @@ -942,7 +906,7 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) if( !pWrtShell->GetDrawObjGraphic( FORMAT_BITMAP, *pClpBitmap )) pOrigGrf = pClpBitmap; - // ist es ein URL-Button ? + // is it an URL-Button ? String sURL, sDesc; if( pWrtShell->GetURLFromButton( sURL, sDesc ) ) { @@ -957,7 +921,7 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) } } - // beim Cut hat DDE-Link keinen Sinn!! + // at Cut, DDE-Link doesn't make sense!! SwDocShell* pDShell; if( !bIsCut && bDDELink && 0 != ( pDShell = pWrtShell->GetDoc()->GetDocShell()) && @@ -967,9 +931,9 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) refDdeLink = new SwTrnsfrDdeLink( *this, *pWrtShell ); } - //ObjectDescriptor wurde bereits aus der alten DocShell gefuellt. - //Jetzt noch anpassen. Dadurch kann im GetData die erste Anfrage - //auch noch mit delayed rendering beantwortet werden. + //ObjectDescriptor was already filly from the old DocShell. + //Now adjust it. Thus in GetData the first query can still + //be answered with delayed rendering. aObjDesc.mbCanLink = sal_False; Size aSz( OLESIZE ); aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MAP_TWIP, MAP_100TH_MM ); @@ -1014,8 +978,6 @@ int SwTransferable::Copy( sal_Bool bIsCut ) return nRet; } -// ----------------------------------------------------------------------- - int SwTransferable::CalculateAndCopy() { if(!pWrtShell) @@ -1035,8 +997,6 @@ int SwTransferable::CalculateAndCopy() return 1; } -// ----------------------------------------------------------------------- - int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary, const String& rStr ) { @@ -1049,14 +1009,14 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary, SwNodes& rNds = pCDoc->GetNodes(); SwNodeIndex aNodeIdx( *rNds.GetEndOfContent().StartOfSectionNode() ); - SwCntntNode* pCNd = rNds.GoNext( &aNodeIdx ); // gehe zum 1. ContentNode + SwCntntNode* pCNd = rNds.GoNext( &aNodeIdx ); // go to 1st ContentNode SwPaM aPam( *pCNd ); - pCDoc->LockExpFlds(); // nie die Felder updaten - Text so belassen + pCDoc->LockExpFlds(); // never update fields - leave text as it is pCDoc->InsertGlossary( rGlossary, rStr, aPam, 0 ); - // es wurde in der CORE eine neu angelegt (OLE-Objekte kopiert!) + // a new one was created in CORE (OLE-Objects copied!) aDocShellRef = pCDoc->GetTmpDocShell(); if( aDocShellRef.Is() ) SwTransferable::InitOle( aDocShellRef, *pCDoc ); @@ -1064,15 +1024,15 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary, eBufferType = TRNSFR_DOCUMENT; - //Wenn's einer braucht OLE'n wir ihm was. + //When someone needs it, we 'OLE' her something. AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); AddFormat( FORMAT_RTF ); AddFormat( SOT_FORMATSTR_ID_HTML ); AddFormat( FORMAT_STRING ); - //ObjectDescriptor wurde bereits aus der alten DocShell gefuellt. - //Jetzt noch anpassen. Dadurch kann im GetData die erste Anfrage - //auch noch mit delayed rendering beantwortet werden. + //ObjectDescriptor was already filled from the old DocShell. + //Now adjust it. Thus in GetData the first query can still + //be answered with delayed rendering. aObjDesc.mbCanLink = sal_False; Size aSz( OLESIZE ); aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MAP_TWIP, MAP_100TH_MM ); @@ -1089,13 +1049,12 @@ static inline uno::Reference < XTransferable > * lcl_getTransferPointer ( uno::R { return &xRef; } -// ----------------------------------------------------------------------- sal_Bool SwTransferable::IsPaste( const SwWrtShell& rSh, const TransferableDataHelper& rData ) { // Check the common case first: We can always paste our own data! - // #106503#: If _only_ the internal format can be pasted, this check will + // If _only_ the internal format can be pasted, this check will // yield 'true', while the one below would give a (wrong) result 'false'. bool bIsPaste = ( GetSwTransferable( rData ) != NULL ); @@ -1132,8 +1091,6 @@ sal_Bool SwTransferable::IsPaste( const SwWrtShell& rSh, return bIsPaste; } -// ----------------------------------------------------------------------- - int SwTransferable::Paste( SwWrtShell& rSh, TransferableDataHelper& rData ) { sal_uInt16 nEventAction, nAction=0, @@ -1178,8 +1135,6 @@ int SwTransferable::Paste( SwWrtShell& rSh, TransferableDataHelper& rData ) nDestination, sal_False, sal_False ); } -// ----------------------------------------------------------------------- - int SwTransferable::PasteData( TransferableDataHelper& rData, SwWrtShell& rSh, sal_uInt16 nAction, sal_uLong nFormat, sal_uInt16 nDestination, sal_Bool bIsPasteFmt, @@ -1210,13 +1165,10 @@ int SwTransferable::PasteData( TransferableDataHelper& rData, case EXCHG_DEST_DOC_DRAWOBJ: case EXCHG_DEST_DOC_URLBUTTON: case EXCHG_DEST_DOC_GROUPOBJ: - // Rahmen/Objecte selektieren + // select frames/objects SwTransferable::SetSelInShell( rSh, sal_True, pPt ); break; - // case EXCHG_DEST_DOC_TEXTFRAME: - // case EXCHG_DEST_SWDOC_FREE_AREA: - // case EXCHG_DEST_DOC_URLFIELD: default: SwTransferable::SetSelInShell( rSh, sal_False, pPt ); break; @@ -1226,13 +1178,13 @@ int SwTransferable::PasteData( TransferableDataHelper& rData, else if( ( !GetSwTransferable( rData ) || bIsPasteFmt ) && !rSh.IsTableMode() && rSh.HasSelection() ) { - // dann die Selektionen loeschen + // then delete the selections - //Selektierten Inhalt loeschen, - // - nicht bei Tabellen-Selektion - // - nicht bei ReRead einer Grafik/DDEDaten - // - nicht bei D&D, fuer die richtige Selektion wurde im - // Drop-Handler gesorgt + //don't delete selected content + // - at table-selection + // - at ReRead of a graphic/DDEData + // - at D&D, for the right selection was taken care of + // in Drop-Handler sal_Bool bDelSel = sal_False; switch( nDestination ) { @@ -1245,20 +1197,12 @@ int SwTransferable::PasteData( TransferableDataHelper& rData, } if( bDelSel ) - // --> FME 2004-10-19 #i34830# + // #i34830# pAction = new SwTrnsfrActionAndUndo( &rSh, UNDO_PASTE_CLIPBOARD, NULL, sal_True ); - // <-- } SwTransferable *pTrans=0, *pTunneledTrans=GetSwTransferable( rData ); -// uno::Reference<XUnoTunnel> xTunnel( rData.GetTransferable(), UNO_QUERY ); -// if ( xTunnel.is() ) -// { -// sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() ); -// if ( nHandle ) -// pTunneledTrans = (SwTransferable*) (sal_IntPtr) nHandle; -// } if( pPt && ( bPasteSelection ? 0 != ( pTrans = pMod->pXSelection ) : 0 != ( pTrans = pMod->pDragDrop) )) @@ -1277,25 +1221,24 @@ int SwTransferable::PasteData( TransferableDataHelper& rData, { if( !pAction ) { - // #111827# pAction = new SwTrnsfrActionAndUndo( &rSh, UNDO_PASTE_CLIPBOARD); } - // im Drag&Drop duerfen keine MessageBoxen angezeigt werden + // in Drag&Drop MessageBoxes must not be showed sal_Bool bMsg = 0 == pPt; sal_uInt8 nActionFlags = static_cast< sal_uInt8 >(( nAction >> 8 ) & 0xFF); sal_uInt16 nClearedAction = ( nAction & EXCHG_ACTION_MASK ); - // Selektionen loeschen + // delete selections switch( nClearedAction ) { case EXCHG_OUT_ACTION_INSERT_PRIVATE: -ASSERT( pPt, "EXCHG_OUT_ACTION_INSERT_PRIVATE: was soll hier passieren?" ); + OSL_ENSURE( pPt, "EXCHG_OUT_ACTION_INSERT_PRIVATE: what should happen here?" ); break; case EXCHG_OUT_ACTION_MOVE_PRIVATE: -ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" ); + OSL_ENSURE( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: what should happen here?" ); break; @@ -1307,7 +1250,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" ); case EXCHG_OUT_ACTION_INSERT_IMAGEMAP: case EXCHG_OUT_ACTION_REPLACE_IMAGEMAP: - // dann muss ueber das Format gegangen werden + // then we have to use the format switch( nFormat ) { case SOT_FORMATSTR_ID_DRAWING: @@ -1374,7 +1317,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" ); break; case SOT_FORMAT_FILE_LIST: - // dann nur als Grafiken einfuegen + // then insert as graphics only nRet = SwTransferable::_PasteFileList( rData, rSh, EXCHG_IN_ACTION_LINK == nClearedAction, pPt, bMsg ); @@ -1409,7 +1352,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" ); break; default: - ASSERT( pPt, "unbekanntes Format" ); + OSL_ENSURE( pPt, "unknown format" ); } break; @@ -1485,7 +1428,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" ); nActionFlags, bMsg ); break; default: - ASSERT( sal_False, "unbekanntes Format" ); + OSL_ENSURE( false, "unknown format" ); } break; @@ -1524,7 +1467,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" ); break; default: - ASSERT( sal_False, "unbekannte Action" ); + OSL_ENSURE(false, "unknown action" ); } } @@ -1543,8 +1486,6 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" ); return nRet; } -// ----------------------------------------------------------------------- - sal_uInt16 SwTransferable::GetSotDestination( const SwWrtShell& rSh, const Point* pPt ) { @@ -1602,22 +1543,9 @@ sal_uInt16 SwTransferable::GetSotDestination( const SwWrtShell& rSh, case OBJCNT_URLBUTTON: nRet = EXCHG_DEST_DOC_URLBUTTON; break; case OBJCNT_GROUPOBJ: nRet = EXCHG_DEST_DOC_GROUPOBJ; break; -// was mmchen wir bei Mehrfachselektion??? -// case OBJCNT_DONTCARE: +// what do we do at multiple selections??? default: { -/* -JP 13.07.98: Bug 52637: es wird ein URL-Feld erkannt also werden nur die - Inhalte zugelassen. Das ist aber bestimmt nicht das - gewollte. - SwContentAtPos aCntntAtPos( SwContentAtPos::SW_INETATTR ); - SfxItemSet aSet( (SfxItemPool&)rSh.GetAttrPool(), - RES_TXTATR_INETFMT, RES_TXTATR_INETFMT ); - if( pPt ? ((SwWrtShell&)rSh).GetContentAtPos( *pPt, aCntntAtPos, sal_False ) - : (rSh.GetAttr( aSet ) && aSet.Count()) ) - nRet = EXCHG_DEST_DOC_URLFIELD; - else -*/ if( rSh.GetView().GetDocShell()->ISA(SwWebDocShell) ) nRet = EXCHG_DEST_SWDOC_FREE_AREA_WEB; else @@ -1628,8 +1556,6 @@ JP 13.07.98: Bug 52637: es wird ein URL-Feld erkannt also werden nur die return nRet; } -// ----------------------------------------------------------------------- - int SwTransferable::_PasteFileContent( TransferableDataHelper& rData, SwWrtShell& rSh, sal_uLong nFmt, sal_Bool bMsg ) { @@ -1675,7 +1601,6 @@ int SwTransferable::_PasteFileContent( TransferableDataHelper& rData, pStream = aMSE40ClpObj.IsValid( *xStrm ); pRead = ReadHTML; pRead->SetReadUTF8( sal_True ); - //pRead->SetBaseURL( aMSE40ClpObj.GetBaseURL() ); sal_Bool bNoComments = ( nFmt == SOT_FORMATSTR_ID_HTML_NO_COMMENT ); @@ -1725,8 +1650,6 @@ int SwTransferable::_PasteFileContent( TransferableDataHelper& rData, return nRet; } -// ----------------------------------------------------------------------- - int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh, sal_uLong nFmt, sal_uInt8 nActionFlags, sal_Bool bMsg ) { @@ -1806,7 +1729,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh, { if ( !rData.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc ) ) { - DBG_ASSERT( !xStrm.is(), "An object without descriptor in clipboard!"); + OSL_ENSURE( !xStrm.is(), "An object without descriptor in clipboard!"); } } else @@ -1853,18 +1776,6 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh, Graphic aGraphic; sal_uLong nGrFormat = 0; -// (wg. Selection Manager bei Trustet Solaris) -#ifndef SOLARIS -/* - if( rData.GetGraphic( SOT_FORMATSTR_ID_SVXB, aGraphic ) ) - nGrFormat = SOT_FORMATSTR_ID_SVXB; - else if( rData.GetGraphic( FORMAT_GDIMETAFILE, aGraphic ) ) - nGrFormat = SOT_FORMAT_GDIMETAFILE; - else if( rData.GetGraphic( FORMAT_BITMAP, aGraphic ) ) - nGrFormat = SOT_FORMAT_BITMAP; -*/ -#endif - // insert replacement image ( if there is one ) into the object helper if ( nGrFormat ) { @@ -1884,8 +1795,8 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh, xObjRef.SetGraphic( aGraphic, aMimeType ); } - //Size einstellen. Ist ein Hack wg. Auslieferung, die Size sollte - //an das InsertOle uebergeben werden!!!!!!!!!! + //set size. This is a hack because of handing over, size should be + //passed to the InsertOle!!!!!!!!!! Size aSize; if ( aObjDesc.mnViewAspect == embed::Aspects::MSOLE_ICON ) { @@ -1899,7 +1810,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh, } else if( aObjDesc.maSize.Width() && aObjDesc.maSize.Height() ) { - aSize = Size( aObjDesc.maSize ); //immer 100TH_MM + aSize = Size( aObjDesc.maSize ); //always 100TH_MM MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( aObjDesc.mnViewAspect ) ); aSize = OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, aUnit ); awt::Size aSz; @@ -1932,7 +1843,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh, { } } - //Ende mit Hack! + //End of Hack! rSh.InsertOleObject( xObjRef ); nRet = 1; @@ -1948,11 +1859,6 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh, return nRet; } -// ----------------------------------------------------------------------- - - -// ----------------------------------------------------------------------- - int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData, SwWrtShell& rSh, sal_uInt16 nAction, const Point* pPt, sal_Bool bInsertGRF ) @@ -1969,8 +1875,7 @@ int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData, String sURL( aINetImg.GetImageURL() ); SwTransferable::_CheckForURLOrLNKFile( rData, sURL ); - //!!! auf FileSystem abpruefen - nur dann ist es sinnvoll die - // Grafiken zu testen !!!! + //!!! check at FileSystem - only then it make sense to test graphics !!! Graphic aGrf; GraphicFilter *pFlt = GraphicFilter::GetGraphicFilter(); nRet = GRFILTER_OK == GraphicFilter::LoadGraphic( sURL, aEmptyStr, aGrf, pFlt ); @@ -2032,15 +1937,12 @@ int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData, return nRet; } - -// ----------------------------------------------------------------------- - void SwTransferable::SetSelInShell( SwWrtShell& rSh, sal_Bool bSelectFrm, const Point* pPt ) { if( bSelectFrm ) { - // Rahmen/Objecte selektieren + // select frames/objects if( pPt && !rSh.GetView().GetViewFrame()->GetDispatcher()->IsLocked() ) { rSh.GetView().NoRotate(); @@ -2070,22 +1972,20 @@ void SwTransferable::SetSelInShell( SwWrtShell& rSh, sal_Bool bSelectFrm, } } -// ----------------------------------------------------------------------- - int SwTransferable::_PasteDDE( TransferableDataHelper& rData, SwWrtShell& rWrtShell, sal_Bool bReReadGrf, sal_Bool bMsg ) { - // Daten aus dem Clipboardformat + // data from Clipboardformat String aApp, aTopic, aItem; { SotStorageStreamRef xStrm; if( !rData.GetSotStorageStream( SOT_FORMATSTR_ID_LINK, xStrm )) { - ASSERT( !&rWrtShell, "DDE Data not found." ); + OSL_ENSURE( !&rWrtShell, "DDE Data not found." ); return 0; - } //sinnvollen Fehler melden!! + } // report useful error!! rtl_TextEncoding eEncoding = DDE_TXT_ENCODING; xStrm->ReadCString( aApp, eEncoding ); @@ -2096,7 +1996,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, String aCmd; sfx2::MakeLnkName( aCmd, &aApp, aTopic, aItem ); - // wollen wir jetzt eine Grafik einlesen ? + // do we want to read in a graphic now? sal_uLong nFormat; if( !rData.HasFormat( FORMAT_RTF ) && !rData.HasFormat( SOT_FORMATSTR_ID_HTML ) && @@ -2169,8 +2069,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, { do { // middle checked loop - // Wenn die Daten von einer Tabellenkalkulation kommen - // fuegen wir eine DDE-Tabelle ein + // When data comes from a spreadsheet, we add a DDE-table if( ( rData.HasFormat( SOT_FORMATSTR_ID_SYLK ) || rData.HasFormat( SOT_FORMATSTR_ID_SYLK_BIGCAPS ) ) && aExpand.Len() && @@ -2184,7 +2083,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, sTmp = sTmp.GetToken( 0, '\n' ); xub_StrLen nCols = sTmp.GetTokenCount( '\t' ); - // mindestens eine Spalte & Zeile muss vorhanden sein + // at least one column & row must be there if( !nRows || !nCols ) { if( bMsg ) @@ -2194,12 +2093,12 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, } rWrtShell.InsertDDETable( - SwInsertTableOptions( tabopts::HEADLINE_NO_BORDER, 1 ), // TODO MULTIHEADER + SwInsertTableOptions( tabopts::SPLIT_LAYOUT, 1 ), // TODO MULTIHEADER pDDETyp, nRows, nCols ); } else if( 1 < aExpand.GetTokenCount( '\n' ) ) { - // mehrere Absaetze -> eine geschuetzte Section einfuegen + // multiple paragraphs -> insert a protected section if( rWrtShell.HasSelection() ) rWrtShell.DelRight(); @@ -2208,7 +2107,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, aSect.SetProtectFlag(true); rWrtShell.InsertSection( aSect ); - pDDETyp = 0; // FeldTypen wieder entfernen + pDDETyp = 0; // remove FieldTypes again } else { @@ -2220,11 +2119,11 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, } while( sal_False ); } else - pDDETyp = 0; // FeldTypen wieder entfernen + pDDETyp = 0; // remove FieldTypes again if( !pDDETyp && !bDoublePaste ) { - // FeldTyp wieder entfernen - Fehler aufgetreten! + // remove FieldType again - error occured! for( j = nSize; j >= INIT_FLDTYPES; --j ) if( pTyp == rWrtShell.GetFldType( j ) ) { @@ -2236,8 +2135,6 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData, return 1; } -// ----------------------------------------------------------------------- - int SwTransferable::_PasteSdrFormat( TransferableDataHelper& rData, SwWrtShell& rSh, sal_uInt16 nAction, const Point* pPt, sal_uInt8 nActionFlags ) @@ -2257,8 +2154,6 @@ int SwTransferable::_PasteSdrFormat( TransferableDataHelper& rData, return nRet; } -// ----------------------------------------------------------------------- - int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, sal_uLong nFmt, sal_uInt16 nAction, const Point* pPt, sal_uInt8 nActionFlags, sal_Bool /*bMsg*/ ) @@ -2281,13 +2176,6 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, case SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR: if( 0 != ( nRet = rData.GetINetBookmark( nFmt, aBkmk ) )) { -/* if( SW_PASTESDR_SETATTR != nAction ) - { - INetURLObject aURL( aBkmk.GetURL() ); - bCheckForGrf = INET_PROT_FILE == aURL.GetProtocol(); - nRet = 0 != bCheckForGrf; - } -*/ if( SW_PASTESDR_SETATTR == nAction ) nFmt = SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK; else @@ -2319,17 +2207,16 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, if( bCheckForGrf ) { - //!!! auf FileSystem abpruefen - nur dann ist es sinnvoll die - // Grafiken zu testen !!!! + //!!! check at FileSystem - only then it makes sense to test the graphics !!! GraphicFilter *pFlt = GraphicFilter::GetGraphicFilter(); nRet = GRFILTER_OK == GraphicFilter::LoadGraphic( aBkmk.GetURL(), aEmptyStr, aGrf, pFlt ); if( !nRet && SW_PASTESDR_SETATTR == nAction && SOT_FORMAT_FILE == nFmt && - // Bug 63031 - nur bei Rahmenselektion + // only at frame selection rSh.IsFrmSelected() ) { - // dann als Hyperlink hinter die Grafik setzen + // then set as hyperlink after the graphic nFmt = SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK; nRet = sal_True; } @@ -2401,7 +2288,7 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, } else if( bCheckForImageMap ) { - // oder sollte das File ein ImageMap-File sein? + // or should the file be an ImageMap-File? ImageMap aMap; SfxMedium aMed( INetURLObject(aBkmk.GetURL()).GetFull(), STREAM_STD_READ, sal_False ); @@ -2425,8 +2312,6 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, return nRet; } -// ----------------------------------------------------------------------- - int SwTransferable::_PasteImageMap( TransferableDataHelper& rData, SwWrtShell& rSh ) { @@ -2438,7 +2323,7 @@ int SwTransferable::_PasteImageMap( TransferableDataHelper& rData, SwFmtURL aURL( (SwFmtURL&)aSet.Get( RES_URL ) ); const ImageMap* pOld = aURL.GetMap(); - // setzen oder ersetzen ist hier die Frage + // set or replace, that is the question ImageMap aImageMap; if( rData.GetImageMap( SOT_FORMATSTR_ID_SVIM, aImageMap ) && ( !pOld || aImageMap != *pOld )) @@ -2452,8 +2337,6 @@ int SwTransferable::_PasteImageMap( TransferableDataHelper& rData, return nRet; } -// ----------------------------------------------------------------------- - int SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData, SwWrtShell& rSh, sal_uLong nFmt ) { @@ -2464,7 +2347,7 @@ int SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData, String sDesc; SwTransferable::_CheckForURLOrLNKFile( rData, sFile, &sDesc ); - //#41801# ersteinmal die URL absolut machen + // first, make the URL absolute INetURLObject aURL; aURL.SetSmartProtocol( INET_PROT_FILE ); aURL.SetSmartURL( sFile ); @@ -2498,8 +2381,6 @@ int SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData, return nRet; } -// ----------------------------------------------------------------------- - int SwTransferable::_PasteFileName( TransferableDataHelper& rData, SwWrtShell& rSh, sal_uLong nFmt, sal_uInt16 nAction, const Point* pPt, @@ -2530,22 +2411,14 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData, { sal_Bool bIsURLFile = SwTransferable::_CheckForURLOrLNKFile( rData, sFile, &sDesc ); - //Eigenes FileFormat? -->Einfuegen, nicht fuer StarWriter/Web + //Own FileFormat? --> insert, not for StarWriter/Web String sFileURL = URIHelper::SmartRel2Abs(INetURLObject(), sFile, Link(), false ); const SfxFilter* pFlt = SW_PASTESDR_SETATTR == nAction ? 0 : SwIoSystem::GetFileFilter( sFileURL, aEmptyStr ); - if( pFlt && !rSh.GetView().GetDocShell()->ISA(SwWebDocShell) - /* - JP 02.07.98: warum nur fuer die Formate ?? - && ( pFlt->GetUserData() == FILTER_SW5 || - pFlt->GetUserData() == FILTER_SW4 || - pFlt->GetUserData() == FILTER_SW3 || - pFlt->GetUserData() == FILTER_SWG ) - */ - ) + if( pFlt && !rSh.GetView().GetDocShell()->ISA(SwWebDocShell) ) { - // und dann per PostUser Event den Bereich-Einfuegen-Dialog hochreissen + // and then pull up the insert-region-dialog by PostUser event SwSectionData * pSect = new SwSectionData( FILE_LINK_SECTION, rSh.GetDoc()->GetUniqueSectionName() ); @@ -2559,10 +2432,9 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData, else if( SW_PASTESDR_SETATTR == nAction || ( bIsURLFile && SW_PASTESDR_INSERT == nAction )) { - //Fremde Files koennen wir immerhin noch als Links - //Einfuegen. + //we can insert foreign files as links after all - //#41801# ersteinmal die URL absolut machen + // first, make the URL absolute INetURLObject aURL; aURL.SetSmartProtocol( INET_PROT_FILE ); aURL.SetSmartURL( sFile ); @@ -2599,8 +2471,6 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData, return nRet; } -// ----------------------------------------------------------------------- - int SwTransferable::_PasteDBData( TransferableDataHelper& rData, SwWrtShell& rSh, sal_uLong nFmt, sal_Bool bLink, const Point* pDragPt, sal_Bool bMsg ) @@ -2703,8 +2573,6 @@ int SwTransferable::_PasteDBData( TransferableDataHelper& rData, return nRet; } -// ----------------------------------------------------------------------- - int SwTransferable::_PasteFileList( TransferableDataHelper& rData, SwWrtShell& rSh, sal_Bool bLink, const Point* pPt, sal_Bool bMsg ) @@ -2744,8 +2612,6 @@ int SwTransferable::_PasteFileList( TransferableDataHelper& rData, return nRet; } -// ----------------------------------------------------------------------- - sal_Bool SwTransferable::_CheckForURLOrLNKFile( TransferableDataHelper& rData, String& rFileName, String* pTitle ) { @@ -2766,15 +2632,13 @@ sal_Bool SwTransferable::_CheckForURLOrLNKFile( TransferableDataHelper& rData, String sExt( rFileName.Copy( nLen - 3 )); if( sExt.EqualsIgnoreCaseAscii( "url" )) { -ASSERT( !&rFileName, "how do we read today .URL - Files?" ); + OSL_ENSURE( !&rFileName, "how do we read today .URL - Files?" ); } } } return bIsURLFile; } -// ----------------------------------------------------------------------- - sal_Bool SwTransferable::IsPasteSpecial( const SwWrtShell& rWrtShell, const TransferableDataHelper& rData ) { @@ -2784,8 +2648,6 @@ sal_Bool SwTransferable::IsPasteSpecial( const SwWrtShell& rWrtShell, return aClipboardFmtItem.Count() > 0; } -// ----------------------------------------------------------------------- - int SwTransferable::PasteFormat( SwWrtShell& rSh, TransferableDataHelper& rData, sal_uLong nFormat ) @@ -2828,8 +2690,6 @@ int SwTransferable::PasteFormat( SwWrtShell& rSh, return nRet; } -// ----------------------------------------------------------------------- - int SwTransferable::_TestAllowedFormat( const TransferableDataHelper& rData, sal_uLong nFormat, sal_uInt16 nDestination ) { @@ -2846,8 +2706,6 @@ int SwTransferable::_TestAllowedFormat( const TransferableDataHelper& rData, return EXCHG_INOUT_ACTION_NONE != nAction; } -// ----------------------------------------------------------------------- - /** * the list of formats which will be offered to the user in the 'Paste * Special...' dialog and the paste button menu @@ -2870,15 +2728,12 @@ static sal_uInt16 aPasteSpecialIds[] = 0 }; - int SwTransferable::PasteUnformatted( SwWrtShell& rSh, TransferableDataHelper& rData ) { // Plain text == unformatted return SwTransferable::PasteFormat( rSh, rData, SOT_FORMAT_STRING ); } -// ----------------------------------------------------------------------- - int SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rData, sal_uLong& rFormatUsed ) { int nRet = 0; @@ -2950,7 +2805,6 @@ int SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rData return nRet; } - void SwTransferable::FillClipFmtItem( const SwWrtShell& rSh, const TransferableDataHelper& rData, SvxClipboardFmtItem & rToFill ) @@ -3013,10 +2867,8 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos ) if( nsSelectionType::SEL_GRF == nSelection) { AddFormat( SOT_FORMATSTR_ID_SVXB ); - // --> OD 2005-02-09 #119353# - robust const Graphic* pGrf = pWrtShell->GetGraphic(); if ( pGrf && pGrf->IsSupportedGraphic() ) - // <-- { AddFormat( FORMAT_GDIMETAFILE ); AddFormat( FORMAT_BITMAP ); @@ -3032,7 +2884,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos ) AddFormat( FORMAT_GDIMETAFILE ); eBufferType = TRNSFR_OLE; } - //Gibt es ueberhaupt etwas zum bereitstellen? + //Is there anything to provide anyway? else if ( pWrtShell->IsSelection() || pWrtShell->IsFrmSelected() || pWrtShell->IsObjSelected() ) { @@ -3052,8 +2904,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos ) AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ); - //RTF vor das Metafile von OLE stellen, weil mit weniger verlusten - //behaftet. + //put RTF ahead of the OLE's Metafile for less loss if( !pWrtShell->IsObjSelected() ) { AddFormat( FORMAT_RTF ); @@ -3079,7 +2930,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos ) if( !pWrtShell->GetDrawObjGraphic( FORMAT_BITMAP, *pClpBitmap )) pOrigGrf = pClpBitmap; - // ist es ein URL-Button ? + // is it an URL-Button ? String sURL, sDesc; if( pWrtShell->GetURLFromButton( sURL, sDesc ) ) { @@ -3093,9 +2944,9 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos ) } } - //ObjectDescriptor wurde bereits aus der alten DocShell gefuellt. - //Jetzt noch anpassen. Dadurch kann im GetData die erste Anfrage - //auch noch mit delayed rendering beantwortet werden. + //ObjectDescriptor was already filled from the old DocShell. + //Now adjust it. Thus in GetData the first query can still + //be answered with delayed rendering. aObjDesc.mbCanLink = sal_False; aObjDesc.maDragStartPos = rSttPos; aObjDesc.maSize = OutputDevice::LogicToLogic( Size( OLESIZE ), @@ -3105,7 +2956,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos ) } else if( nSelection & nsSelectionType::SEL_TXT && !pWrtShell->HasMark() ) { - // ist nur ein Feld - Selektiert? + // is only one field - selected? SwContentAtPos aCntntAtPos( SwContentAtPos::SW_INETATTR ); Point aPos( SwEditWin::GetDDStartPosX(), SwEditWin::GetDDStartPosY()); @@ -3167,13 +3018,13 @@ void SwTransferable::StartDrag( Window* pWin, const Point& rPos ) void SwTransferable::DragFinished( sal_Int8 nAction ) { - //Und noch die letzten Nacharbeiten damit alle Stati stimmen. + //And the last finishing work so that all statuses are right if( DND_ACTION_MOVE == nAction ) { if( bCleanUp ) { - //Es wurde auserhalb des Writers gedroped. Wir muessen noch - //loeschen. + //It was dropped outside of Writer. We still have to + //delete. pWrtShell->StartAllAction(); pWrtShell->StartUndo( UNDO_UI_DRAG_AND_MOVE ); @@ -3182,7 +3033,7 @@ void SwTransferable::DragFinished( sal_Int8 nAction ) else { if ( !(pWrtShell->IsSelFrmMode() || pWrtShell->IsObjSelected()) ) - //SmartCut, eines der Blanks mitnehmen. + //SmartCut, take one of the blanks along pWrtShell->IntelligentCut( pWrtShell->GetSelectionType(), sal_True ); pWrtShell->DelRight(); } @@ -3205,52 +3056,39 @@ void SwTransferable::DragFinished( sal_Int8 nAction ) pWrtShell->HideCrsr(); else pWrtShell->ShowCrsr(); -//!! else if( DND_ACTION_NONE != nAction ) -//!! pWrtShell->ShowCrsr(); -//!! else -//!! { -//!! //Muss wohl sein weil gescrollt wurde und ?...? -//!! pWrtShell->StartAction(); -//!! pWrtShell->EndAction(); -//!! } ((SwViewOption *)pWrtShell->GetViewOptions())->SetIdle( bOldIdle ); } - -/* */ - int SwTransferable::PrivatePaste( SwWrtShell& rShell ) { - // erst den SelectionType erfragen, dann Action-Klammerung !!!! - // (sonst wird nicht in eine TabellenSelektion gepastet!!!) - ASSERT( !rShell.ActionPend(), "Paste darf nie eine Actionklammerung haben" ); + // first, ask for the SelectionType, then action-bracketing !!!! + // (otherwise it's not pasted into a TableSelection!!!) + OSL_ENSURE( !rShell.ActionPend(), "Paste darf nie eine Actionklammerung haben" ); if ( !pClpDocFac ) return sal_False; // the return value of the SwFEShell::Paste also is sal_Bool! const int nSelection = rShell.GetSelectionType(); - // #111827# SwRewriter aRewriter; SwTrnsfrActionAndUndo aAction( &rShell, UNDO_PASTE_CLIPBOARD); bool bKillPaMs = false; - //Selektierten Inhalt loeschen, nicht bei Tabellen-Selektion und - //Tabelle im Clipboard + //Delete selected content, not at table-selection and table in Clipboard if( rShell.HasSelection() && !( nSelection & nsSelectionType::SEL_TBL_CELLS)) { bKillPaMs = true; rShell.SetRetainSelection( true ); rShell.DelRight(); - // war ein Fly selektiert, so muss jetzt fuer eine gueltige - // Cursor-Position gesorgt werden! (geparkter Cursor!) + // when a Fly was selected, a valid cursor position has to be found now + // (parked Cursor!) if( ( nsSelectionType::SEL_FRM | nsSelectionType::SEL_GRF | nsSelectionType::SEL_OLE | nsSelectionType::SEL_DRW | nsSelectionType::SEL_DRW_FORM ) & nSelection ) { - // den Cursor wieder positionieren + // position the cursor again Point aPt( rShell.GetCharRect().Pos() ); rShell.SwCrsrShell::SetCrsr( aPt, sal_True ); } @@ -3261,14 +3099,9 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell ) bSmart = 0 != (TRNSFR_DOCUMENT_WORD & eBufferType); if( bSmart ) { -// #108491# Why not for other Scripts? If TRNSFR_DOCUMENT_WORD is set, we have -// a word in the buffer, word in this context means 'something with spaces at -// beginning and end'. In this case we definitely want these spaces to be inserted -// here. -// if( SCRIPTTYPE_LATIN != rShell.GetScriptType() ) -// bSmart = sal_False; -// else -// { +// Why not for other Scripts? If TRNSFR_DOCUMENT_WORD is set, we have a word +// in the buffer, word in this context means 'something with spaces at beginning +// and end'. In this case we definitely want these spaces to be inserted here. bInWrd = rShell.IsInWrd(); bEndWrd = rShell.IsEndWrd(); bSmart = bInWrd || bEndWrd; @@ -3278,7 +3111,6 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell ) if( bSmart && !bSttWrd && (bInWrd || bEndWrd) ) rShell.SwEditShell::Insert(' '); } -// } } int nRet = rShell.Paste( pClpDocFac->GetDoc() ); @@ -3286,7 +3118,7 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell ) if( bKillPaMs ) rShell.KillPams(); - // Wenn Smart Paste dann Leerzeichen einfuegen + // If Smart Paste then insert blank if( nRet && bSmart && ((bInWrd && !bEndWrd )|| bSttWrd) ) rShell.SwEditShell::Insert(' '); @@ -3316,7 +3148,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, if( (TRNSFR_INETFLD & eBufferType) && pBkmk ) aTmp = *pBkmk; - // Zielgrafik selektieren + // select target graphic if( rSh.SelectObj( rDragPt ) ) { rSh.HideCrsr(); @@ -3326,7 +3158,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, const int nSelection = rSh.GetSelectionType(); - // Draw-Objekte erstmal noch nicht beruecksichtigen + // not yet consider Draw objects if( nsSelectionType::SEL_GRF & nSelection ) { SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); @@ -3351,14 +3183,14 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, if( &rSh != &rSrcSh && (nsSelectionType::SEL_GRF & rSh.GetSelectionType()) && TRNSFR_GRAPHIC == eBufferType ) { - // ReRead auf die Grafik + // ReRead the graphic String sGrfNm, sFltNm; rSrcSh.GetGrfNms( &sGrfNm, &sFltNm ); rSh.ReRead( sGrfNm, sFltNm, rSrcSh.GetGraphic() ); return 1; } - //Nicht in Selektionen oder selektierten Rahmen + //not in selections or selected frames if( rSh.ChgCurrPam( rDragPt ) || ( rSh.IsSelFrmMode() && rSh.IsInsideSelectedObj( rDragPt )) ) return 0; @@ -3367,7 +3199,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, bTblSel = sal_True; else if( rSrcSh.IsSelFrmMode() || rSrcSh.IsObjSelected() ) { - // keine positionsgeschuetzten Objecte verschieben! + // don't move position-protected objects! if( bMove && rSrcSh.IsSelObjProtected( FLYPROTECT_POS ) ) return 0; @@ -3378,7 +3210,6 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, SwUndoId eUndoId = bMove ? UNDO_UI_DRAG_AND_MOVE : UNDO_UI_DRAG_AND_COPY; - // #111827# SwRewriter aRewriter; aRewriter.AddRule(UNDO_ARG1, rSrcSh.GetSelDescr()); @@ -3400,13 +3231,13 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, { if( !rSh.IsAddMode() ) { - // --> OD 2008-03-19 #i87233# + // #i87233# if ( rSh.IsBlockMode() ) { // preserve order of cursors for block mode rSh.GoPrevCrsr(); } - // <-- + rSh.SwCrsrShell::CreateCrsr(); } rSh.SwCrsrShell::SetCrsr( rDragPt, sal_True, false ); @@ -3422,7 +3253,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, Point aSttPt( SwEditWin::GetDDStartPosX(), SwEditWin::GetDDStartPosY() ); - //JP 05.03.96: INetFelder erstmal selektieren ! + // at first, select INetFelder! if( TRNSFR_INETFLD == eBufferType ) { if( &rSrcSh == &rSh ) @@ -3432,7 +3263,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, rSh.SelectTxtAttr( RES_TXTATR_INETFMT ); if( rSh.ChgCurrPam( rDragPt ) ) { - // nicht in sich selbst kopieren/verschieben + // don't copy/move inside of yourself rSh.DestroyCrsr(); rSh.EndUndo(); rSh.EndAction(); @@ -3447,15 +3278,15 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, rSrcSh.SelectTxtAttr( RES_TXTATR_INETFMT ); } - // ist am Einfuege Punkt ein URL-Attribut? Dann das ersetzen, - // also einfach eine Selektion aufspannen? + // is there an URL attribute at the insert point? Then replace that, + // so simply put up a selection? rSh.DelINetAttrWithText(); bDDINetAttr = sal_True; } if ( rSrcSh.IsSelFrmMode() ) { - //Hack: Spezialbehandlung austricksen + //Hack: fool the special treatment aSttPt -= aSttPt - rSrcSh.GetObjRect().Pos(); } @@ -3469,12 +3300,12 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, { if ( bTblSel ) { - /* #109590# delete table contents not cells */ + /* delete table contents not cells */ rSrcSh.Delete(); } else { - //SmartCut, eines der Blank mitnehmen. + //SmartCut, take one of the blanks along. rSh.SwCrsrShell::DestroyCrsr(); if ( cWord == SwWrtShell::WORD_SPACE_BEFORE ) rSh.ExtendSelection( sal_False ); @@ -3486,7 +3317,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, rSrcSh.KillPams(); rSrcSh.Pop( sal_False ); - /* #109590# after dragging a table selection inside one shell + /* after dragging a table selection inside one shell set cursor to the drop position. */ if( &rSh == &rSrcSh && ( bTblSel || rSh.IsBlockMode() ) ) { @@ -3531,7 +3362,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, rSh.SwCrsrShell::CreateCrsr(); else { - // Selektionsmodus einschalten + // turn on selection mode rSh.SttSelect(); rSh.EndSelect(); } @@ -3545,7 +3376,7 @@ int SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, rSrcSh.EndUndo(); rSh.EndUndo(); - // Shell in den richtigen Status versetzen + // put the shell in the right state if( &rSrcSh != &rSh && ( rSh.IsFrmSelected() || rSh.IsObjSelected() )) rSh.EnterSelFrmMode(); @@ -3561,7 +3392,6 @@ void SwTransferable::CreateSelection( SwWrtShell& rSh, SwModule *pMod = SW_MOD(); SwTransferable* pNew = new SwTransferable( rSh ); - /* #96392#*/ pNew->pCreatorView = _pCreatorView; uno::Reference< @@ -3576,15 +3406,12 @@ void SwTransferable::ClearSelection( SwWrtShell& rSh, SwModule *pMod = SW_MOD(); if( pMod->pXSelection && ((!pMod->pXSelection->pWrtShell) || (pMod->pXSelection->pWrtShell == &rSh)) && - /* #96392# */ (!_pCreatorView || (pMod->pXSelection->pCreatorView == _pCreatorView)) ) { TransferableHelper::ClearSelection( rSh.GetWin() ); } } -/* -----------------3/31/2003 11:46AM---------------- - --------------------------------------------------*/ const Sequence< sal_Int8 >& SwTransferable::getUnoTunnelId() { static Sequence< sal_Int8 > aSeq; @@ -3597,9 +3424,7 @@ const Sequence< sal_Int8 >& SwTransferable::getUnoTunnelId() } return aSeq; } -/* -----------------3/31/2003 11:46AM---------------- - --------------------------------------------------*/ sal_Int64 SwTransferable::getSomething( const Sequence< sal_Int8 >& rId ) throw( RuntimeException ) { sal_Int64 nRet; @@ -3629,15 +3454,11 @@ SwTransferable* SwTransferable::GetSwTransferable( const TransferableDataHelper& } -/* */ - -// ----------------------------------------------------------------------- - SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh ) : rTrnsfr( rTrans ), pDocShell( 0 ), bDelBookmrk( sal_False ), bInDisconnect( sal_False ) { - // hier kommen wir nur bei Tabellen- oder Text-Selection an + // we only end up here with table- or text selection const int nSelection = rSh.GetSelectionType(); if( nsSelectionType::SEL_TBL_CELLS & nSelection ) { @@ -3672,14 +3493,12 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh ) if( sName.Len() && 0 != ( pDocShell = rSh.GetDoc()->GetDocShell() ) ) { - // dann erzeugen wir uns mal unseren "Server" und connecten uns - // zu diesem + // then we create our "server" and connect to it refObj = pDocShell->DdeCreateLinkSource( sName ); if( refObj.Is() ) { refObj->AddConnectAdvise( this ); refObj->AddDataAdvise( this, -// SotExchange::GetFormatMimeType( FORMAT_RTF ), aEmptyStr, ADVISEMODE_NODATA | ADVISEMODE_ONLYONCE ); nOldTimeOut = refObj->GetUpdateTimeout(); @@ -3688,20 +3507,16 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh ) } } -// ----------------------------------------------------------------------- - SwTrnsfrDdeLink::~SwTrnsfrDdeLink() { if( refObj.Is() ) Disconnect( sal_True ); } -// ----------------------------------------------------------------------- - void SwTrnsfrDdeLink::DataChanged( const String& , const uno::Any& ) { - // tja das wars dann mit dem Link + // well, that's it with the link if( !bInDisconnect ) { if( FindDocShell() && pDocShell->GetView() ) @@ -3710,8 +3525,6 @@ void SwTrnsfrDdeLink::DataChanged( const String& , } } -// ----------------------------------------------------------------------- - sal_Bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) { if( !refObj.Is() || !FindDocShell() ) @@ -3739,12 +3552,6 @@ sal_Bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) rStrm.Write( pMem, nLen ); delete[] pMem; - //if( bDelBookmrk ) - //{ - // // er wird das erstemal abgeholt, also ins Undo mitaufnehmen - // // aber wie?? - //} - IDocumentMarkAccess* const pMarkAccess = pDocShell->GetDoc()->getIDocumentMarkAccess(); IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->findMark(sName); if(ppMark != pMarkAccess->getMarksEnd() @@ -3782,27 +3589,23 @@ sal_Bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) return true; } -// ----------------------------------------------------------------------- - void SwTrnsfrDdeLink::Disconnect( sal_Bool bRemoveDataAdvise ) { - //JP 29.01.96 Bug 24432: - // kein DataChanged mehr entgegen nehmen, wenn man - // sich schon im Disconnet befindet! - // (DTOR vom Bookmark verschickt einen DataChanged!) + // don't accept DataChanged anymore, when already in Disconnect! + // (DTOR from Bookmark sends a DataChanged!) sal_Bool bOldDisconnect = bInDisconnect; bInDisconnect = sal_True; - // den nicht verwendeten Bookmark wieder zerstoeren (ohne Undo!)? + // destroy the unused bookmark again (without Undo!)? if( bDelBookmrk && refObj.Is() && FindDocShell() ) { SwDoc* pDoc = pDocShell->GetDoc(); ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); - // --> OD, CD, OS 2005-11-25 #i58448# + // #i58448# Link aSavedOle2Link( pDoc->GetOle2Link() ); pDoc->SetOle2Link( Link() ); - // <-- + sal_Bool bIsModified = pDoc->IsModified(); IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); @@ -3810,9 +3613,8 @@ void SwTrnsfrDdeLink::Disconnect( sal_Bool bRemoveDataAdvise ) if( !bIsModified ) pDoc->ResetModified(); - // --> OD, CD, OS 2005-11-25 #i58448# + // #i58448# pDoc->SetOle2Link( aSavedOle2Link ); - // <-- bDelBookmrk = sal_False; } @@ -3822,29 +3624,27 @@ void SwTrnsfrDdeLink::Disconnect( sal_Bool bRemoveDataAdvise ) refObj->SetUpdateTimeout( nOldTimeOut ); refObj->RemoveConnectAdvise( this ); if( bRemoveDataAdvise ) - // in einem DataChanged darf das SelectionObject NIE geloescht - // werden; wird schon von der Basisklasse erledigt + // in a DataChanged the SelectionObject must NEVER be deleted + // is already handled by the base class // (ADVISEMODE_ONLYONCE!!!!) - // Im normalen Disconnet aber schon! + // but always in normal Disconnect! refObj->RemoveAllDataAdvise( this ); refObj.Clear(); } bInDisconnect = bOldDisconnect; } -// ----------------------------------------------------------------------- - sal_Bool SwTrnsfrDdeLink::FindDocShell() { TypeId aType( TYPE( SwDocShell ) ); SfxObjectShell* pTmpSh = SfxObjectShell::GetFirst( &aType ); while( pTmpSh ) { - if( pTmpSh == pDocShell ) // die wollen wir haben + if( pTmpSh == pDocShell ) // that's what we want to have { if( pDocShell->GetDoc() ) return sal_True; - break; // das Doc ist nicht mehr vorhanden, also raus! + break; // the Doc is not there anymore, so leave! } pTmpSh = SfxObjectShell::GetNext( *pTmpSh, &aType ); } @@ -3853,8 +3653,6 @@ sal_Bool SwTrnsfrDdeLink::FindDocShell() return sal_False; } -// ----------------------------------------------------------------------- - void SwTrnsfrDdeLink::Closed() { if( !bInDisconnect && refObj.Is() ) @@ -3864,3 +3662,5 @@ void SwTrnsfrDdeLink::Closed() refObj.Clear(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/AnchorOverlayObject.cxx b/sw/source/ui/docvw/AnchorOverlayObject.cxx index 5ed5b076a9..3e38eb97fb 100644 --- a/sw/source/ui/docvw/AnchorOverlayObject.cxx +++ b/sw/source/ui/docvw/AnchorOverlayObject.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: postit.cxx,v $ - * $Revision: 1.8.42.11 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -465,3 +463,4 @@ void AnchorOverlayObject::SetAnchorState( const AnchorState aState) } } // end of namespace sw::annotation +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/AnchorOverlayObject.hxx b/sw/source/ui/docvw/AnchorOverlayObject.hxx index cea567f229..6cc02cf37a 100644 --- a/sw/source/ui/docvw/AnchorOverlayObject.hxx +++ b/sw/source/ui/docvw/AnchorOverlayObject.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,10 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -141,3 +138,5 @@ class AnchorOverlayObject: public sdr::overlay::OverlayObjectWithBasePosition } } // end of namespace sw::annotation #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/AnnotationMenuButton.cxx b/sw/source/ui/docvw/AnnotationMenuButton.cxx index 8cef565545..4407e1c6fd 100644 --- a/sw/source/ui/docvw/AnnotationMenuButton.cxx +++ b/sw/source/ui/docvw/AnnotationMenuButton.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -171,7 +169,7 @@ void AnnotationMenuButton::Paint( const Rectangle& /*rRect*/ ) aFont.SetWeight(WEIGHT_MEDIUM); SetFont( aFont ); DrawText( aRect , - rtl::OUString::createFromAscii("Edit Note"), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Edit Note")), TEXT_DRAW_CENTER ); SetFont( aOldFont ); } @@ -213,3 +211,4 @@ void AnnotationMenuButton::KeyInput( const KeyEvent& rKeyEvt ) } } // end of namespace sw::annotation +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/AnnotationMenuButton.hxx b/sw/source/ui/docvw/AnnotationMenuButton.hxx index c74719f1ca..a20eb86b0e 100644 --- a/sw/source/ui/docvw/AnnotationMenuButton.hxx +++ b/sw/source/ui/docvw/AnnotationMenuButton.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,10 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -61,3 +58,5 @@ class AnnotationMenuButton : public MenuButton } } // end of namespace sw::annotation #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/AnnotationWin.cxx b/sw/source/ui/docvw/AnnotationWin.cxx index 4675805e52..9cf7dd76d0 100644 --- a/sw/source/ui/docvw/AnnotationWin.cxx +++ b/sw/source/ui/docvw/AnnotationWin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -216,18 +214,18 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText) SwRewriter aRewriter; aRewriter.AddRule(UNDO_ARG1, pWin->GetAuthor()); aText = aRewriter.Apply(aText); - aText.Append(String(rtl::OUString::createFromAscii(" (") + - String(rLocalData.getDate( pWin->GetDate())) + rtl::OUString::createFromAscii(", ") + - String(rLocalData.getTime( pWin->GetTime(),false)) + rtl::OUString::createFromAscii("): \""))); + aText.Append(String(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (")) + + String(rLocalData.getDate( pWin->GetDate())) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(", ")) + + String(rLocalData.getTime( pWin->GetTime(),false)) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("): \"")))); GetOutlinerView()->InsertText(aText,false); // insert old, selected text or "..." // TOOD: iterate over all paragraphs, not only first one to find out if it is empty - if (pText->GetTextObject().GetText(0) != String(rtl::OUString::createFromAscii(""))) + if (pText->GetTextObject().GetText(0).Len()) GetOutlinerView()->GetEditView().InsertText(pText->GetTextObject()); else - GetOutlinerView()->InsertText(rtl::OUString::createFromAscii("..."),false); - GetOutlinerView()->InsertText(rtl::OUString::createFromAscii("\"\n"),false); + GetOutlinerView()->InsertText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("...")),false); + GetOutlinerView()->InsertText(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"\n")),false); GetOutlinerView()->SetSelection(ESelection(0x0,0x0,0xFFFF,0xFFFF)); SfxItemSet aAnswerSet( DocView().GetDocShell()->GetPool() ); @@ -266,7 +264,7 @@ SvxLanguageItem SwAnnotationWin::GetLanguage(void) case SCRIPTTYPE_LATIN : nLangWhichId = EE_CHAR_LANGUAGE ; break; case SCRIPTTYPE_ASIAN : nLangWhichId = EE_CHAR_LANGUAGE_CJK; break; case SCRIPTTYPE_COMPLEX : nLangWhichId = EE_CHAR_LANGUAGE_CTL; break; - default: DBG_ERROR("GetLanguage: wrong script tye"); + default: OSL_ENSURE(false, "GetLanguage: wrong script type"); } return SvxLanguageItem(mpFld->GetLanguage(),nLangWhichId); } @@ -294,3 +292,5 @@ Time SwAnnotationWin::GetTime() } } } // end of namespace sw::annotation + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index f2a2afce41..9363fd1328 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -96,34 +97,10 @@ using namespace sw::sidebarwindows; -/* -bool comp_author( const SwPostItItem* a, const SwPostItItem* b) -{ - return a->pFmtFld->GetFld()->GetPar1() < b->pFmtFld->GetFld()->GetPar1(); -} - -bool comp_date( const SwPostItItem* a, const SwPostItItem* b) -{ - return static_cast<SwPostItField*>(a->pFmtFld->GetFld())->GetDate() < static_cast<SwPostItField*>(b->pFmtFld->GetFld())->GetDate(); -} -*/ - -// bool comp_pos(const SwSidebarItem* a, const SwSidebarItem* b) { - // --> OD 2010-01-19 #i88070# // sort by anchor position -//// if position is on the same line, sort by x (Left) position, otherwise by y(Bottom) position -//// if two notes are at the same position, sort by logical node position -// return (a->maLayoutInfo.mPosition.Bottom() == b->maLayoutInfo.mPosition.Bottom()) -// ? ( ( (a->maLayoutInfo.mPosition.Left() == b->maLayoutInfo.mPosition.Left()) && -// (a->GetBroadCaster()->ISA(SwFmtFld) && b->GetBroadCaster()->ISA(SwFmtFld)) ) -// ? *(static_cast<SwFmtFld*>(a->GetBroadCaster())->GetTxtFld()->GetStart()) < -// *(static_cast<SwFmtFld*>(b->GetBroadCaster())->GetTxtFld()->GetStart()) -// : a->maLayoutInfo.mPosition.Left() < b->maLayoutInfo.mPosition.Left() ) -// : a->maLayoutInfo.mPosition.Bottom() < b->maLayoutInfo.mPosition.Bottom(); return a->GetAnchorPosition() < b->GetAnchorPosition(); - // <-- } SwPostItMgr::SwPostItMgr(SwView* pView) @@ -174,7 +151,7 @@ SwPostItMgr::~SwPostItMgr() RemoveSidebarWin(); EndListening( *mpView->GetDocShell() ); - for(std::vector<SwPostItPageItem*>::iterator i = mPages.begin(); i!= mPages.end() ; i++) + for(std::vector<SwPostItPageItem*>::iterator i = mPages.begin(); i!= mPages.end() ; ++i) delete (*i); mPages.clear(); @@ -221,7 +198,7 @@ void SwPostItMgr::InsertItem(SfxBroadcaster* pItem, bool bCheckExistance, bool b { if (bCheckExistance) { - for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { if ( (*i)->GetBroadCaster() == pItem ) return; @@ -230,19 +207,14 @@ void SwPostItMgr::InsertItem(SfxBroadcaster* pItem, bool bCheckExistance, bool b mbLayout = bFocus; if (pItem->ISA(SwFmtFld)) mvPostItFlds.push_back(new SwAnnotationItem(static_cast<SwFmtFld*>(pItem), true, bFocus) ); - /* - else - if (pItem->ISA(SwRedline)) - mvPostItFlds.push_back(new SwRedCommentItem( static_cast<SwRedline*>(pItem), true, bFocus)) ; - */ - DBG_ASSERT(pItem->ISA(SwFmtFld) /*|| pItem->ISA(SwRedline)*/,"Mgr::InsertItem: seems like new stuff was added"); + OSL_ENSURE(pItem->ISA(SwFmtFld),"Mgr::InsertItem: seems like new stuff was added"); StartListening(*pItem); } void SwPostItMgr::RemoveItem( SfxBroadcaster* pBroadcast ) { EndListening(*pBroadcast); - for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { if ( (*i)->GetBroadCaster() == pBroadcast ) { @@ -311,42 +283,13 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) if ( mpView->GetDocShell() != &rBC ) { // field to be removed is the broadcaster - DBG_ERROR("Notification for removed SwFmtFld was not sent!"); + OSL_ENSURE(false, "Notification for removed SwFmtFld was not sent!"); RemoveItem(&rBC); } break; } } } - /* - else if ( rHint.IsA(TYPE(SwRedlineHint) ) ) - { - const SwRedlineHint rRedlineHint = static_cast<const SwRedlineHint&>(rHint); - SwRedline* pRedline = const_cast<SwRedline*>(rRedlineHint.GetRedline()); - switch ( rRedlineHint.Which() ) - { - case SWREDLINE_INSERTED : - { - bool bEmpty = !HasNotes(); - InsertItem( pRedline, true, false ); - if (bEmpty && !mvPostItFlds.empty()) - PrepareView(true); - break; - } - case SWREDLINE_REMOVED: - { - RemoveItem(pRedline); - break; - } - case SWREDLINE_FOCUS: - { - if (rRedlineHint.GetView()== mpView) - Focus(rBC); - break; - } - } - } - */ else if ( rHint.IsA(TYPE(SwFmtFldHint) ) ) { const SwFmtFldHint& rFmtHint = static_cast<const SwFmtFldHint&>(rHint); @@ -370,7 +313,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } else { - DBG_ERROR( "Inserted field not in document!" ); + OSL_ENSURE(false, "Inserted field not in document!" ); } break; } @@ -396,7 +339,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) case SWFMTFLD_CHANGED: { SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC); - for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { if ( pFmtFld == (*i)->GetBroadCaster() ) { @@ -413,7 +356,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) case SWFMTFLD_LANGUAGE: { SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC); - for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { if ( pFmtFld == (*i)->GetBroadCaster() ) { @@ -447,7 +390,7 @@ void SwPostItMgr::Focus(SfxBroadcaster& rBC) mpView->ExecViewOptions(aRequest); } - for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { // field to get the focus is the broadcaster if ( &rBC == (*i)->GetBroadCaster() ) @@ -481,12 +424,12 @@ bool SwPostItMgr::CalcRects() PreparePageContainer(); if ( !mvPostItFlds.empty() ) { - for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { SwSidebarItem* pItem = (*i); if ( !pItem->UseElement() ) { - DBG_ERROR("PostIt is not in doc or other wrong use"); + OSL_ENSURE(false, "PostIt is not in doc or other wrong use"); bRepair = true; continue; } @@ -513,7 +456,7 @@ bool SwPostItMgr::CalcRects() Sort(SORT_POS); // sort the items into the right page vector, so layout can be done by page - for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { SwSidebarItem* pItem = (*i); if( SwPostItHelper::INVISIBLE == pItem->mLayoutStatus ) @@ -571,7 +514,7 @@ bool SwPostItMgr::CalcRects() bool SwPostItMgr::HasScrollbars() const { - for(std::list<SwSidebarItem*>::const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(std::list<SwSidebarItem*>::const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { if ((*i)->bShow && (*i)->pPostIt && (*i)->pPostIt->HasScrollbar()) return true; @@ -600,7 +543,7 @@ void SwPostItMgr::PreparePageContainer() } } // only clear the list, DO NOT delete the objects itself - for(std::vector<SwPostItPageItem*>::iterator i = mPages.begin(); i!= mPages.end() ; i++) + for(std::vector<SwPostItPageItem*>::iterator i = mPages.begin(); i!= mPages.end() ; ++i) { (*i)->mList->clear(); if (mvPostItFlds.empty()) @@ -769,17 +712,7 @@ void SwPostItMgr::LayoutPostIts() (*i)->ShowAnchorOnly(Point(mPages[n]->mPageRect.Right(), mPages[n]->mPageRect.Bottom())); } - DBG_ASSERT(mPages[n]->bScrollbar,"SwPostItMgr::LayoutByPage(): note overlaps, but bScrollbar is not true"); - } - } - - // do some magic so we really see the focused note - for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++) - { - if ((*i)->HasChildPathFocus()) - { - MakeVisible((*i),n+1); - break; + OSL_ENSURE(mPages[n]->bScrollbar,"SwPostItMgr::LayoutByPage(): note overlaps, but bScrollbar is not true"); } } } @@ -809,7 +742,7 @@ void SwPostItMgr::LayoutPostIts() SwSidebarItem* pItem = (*i); if ( !pItem->UseElement() ) { - DBG_ERROR("PostIt is not in doc!"); + OSL_ENSURE(false, "PostIt is not in doc!"); bRepair = true; continue; } @@ -842,13 +775,13 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const { if ( mPages[aPage-1]->mList->empty() ) { - DBG_ERROR("Notes SidePane painted but no rects and page lists calculated!"); + OSL_ENSURE(false, "Notes SidePane painted but no rects and page lists calculated!"); return false; } SwSidebarItem_iterator aItem = mPages[aPage-1]->mList->end(); --aItem; - DBG_ASSERT ((*aItem)->pPostIt,"BorderOverPageBorder: NULL postIt, should never happen"); + OSL_ENSURE ((*aItem)->pPostIt,"BorderOverPageBorder: NULL postIt, should never happen"); if ((*aItem)->pPostIt) { const long aSidebarheight = mPages[aPage-1]->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0; @@ -861,7 +794,7 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage) { - DBG_ASSERT((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value"); + OSL_ENSURE((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value"); // do not scroll more than neccessary up or down if ( ((mPages[aPage-1]->lOffset == 0) && (lScroll>0)) || ( BorderOverPageBorder(aPage) && (lScroll<0)) ) return; @@ -1003,9 +936,7 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons long lTopBorder = rBorder.Top() + 5; long lBottomBorder = rBorder.Bottom() - 5; const long lVisibleHeight = lBottomBorder - lTopBorder; //rBorder.GetHeight() ; - long lSpaceUsed = 0; long lTranslatePos = 0; - int loop = 0; bool bDone = false; bool bScrollbars = false; @@ -1035,6 +966,8 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons //start the real layout so nothing overlaps anymore if (aVisiblePostItList.size()>1) { + long lSpaceUsed = 0; + int loop = 0; // if no window is moved anymore we are finished while (!bDone) { @@ -1108,7 +1041,6 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons //(*i) is the last visible item SwSidebarWin_iterator aPrevPostIt = i; --aPrevPostIt; - //lTranslatePos = ( (*aPrevPostIt)->VirtualPos().Y() + (*aPrevPostIt)->VirtualSize().Height() + GetSpaceBetween() ) - (*i)->VirtualPos().Y(); lTranslatePos = ( (*aPrevPostIt)->VirtualPos().Y() + (*aPrevPostIt)->VirtualSize().Height() ) - (*i)->VirtualPos().Y(); if (lTranslatePos > 0) { @@ -1140,7 +1072,7 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons // security check so we don't loop forever if (loop>MAX_LOOP_COUNT) { - DBG_ERROR("PostItMgr::Layout(): We are looping forever"); + OSL_ENSURE(false, "PostItMgr::Layout(): We are looping forever"); break; } } @@ -1163,22 +1095,6 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons return bScrollbars; } -/* -void SwPostItMgr::AddRedlineComments(bool bCheckExistance, bool bFocus) -{ - bool bEmpty = mvPostItFlds.empty(); - const SwRedlineTbl& aTable = mpView->GetDocShell()->GetDoc()->GetRedlineTbl(); - for( sal_uInt16 i = 0; i < aTable.Count(); ++i ) - { - SwRedline* pRedline = const_cast<SwRedline*>((aTable)[i]); - if ( pRedline->GetComment() != String(rtl::OUString::createFromAscii("")) ) - InsertItem(pRedline, bCheckExistance, bFocus); - } - if (bEmpty && !mvPostItFlds.empty()) - PrepareView(true); - } - */ - void SwPostItMgr::AddPostIts(bool bCheckExistance, bool bFocus) { bool bEmpty = mvPostItFlds.empty(); @@ -1205,7 +1121,7 @@ void SwPostItMgr::RemoveSidebarWin() { if (!mvPostItFlds.empty()) { - for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { EndListening( *((*i)->GetBroadCaster()) ); if ((*i)->pPostIt) @@ -1237,12 +1153,12 @@ void SwPostItMgr::Delete(String aAuthor) std::vector<SwFmtFld*> aTmp; aTmp.reserve( mvPostItFlds.size() ); - for(std::list<SwSidebarItem*>::iterator pPostIt = mvPostItFlds.begin(); pPostIt!= mvPostItFlds.end() ; pPostIt++) + for(std::list<SwSidebarItem*>::iterator pPostIt = mvPostItFlds.begin(); pPostIt!= mvPostItFlds.end() ; ++pPostIt) { if ((*pPostIt)->GetFmtFld() && ((*pPostIt)->pPostIt->GetAuthor() == aAuthor) ) aTmp.push_back( (*pPostIt)->GetFmtFld() ); } - for(std::vector<SwFmtFld*>::iterator i = aTmp.begin(); i!= aTmp.end() ; i++) + for(std::vector<SwFmtFld*>::iterator i = aTmp.begin(); i!= aTmp.end() ; ++i) { mpWrtShell->GotoField( *(*i) ); mpWrtShell->DelRight(); @@ -1265,34 +1181,17 @@ void SwPostItMgr::Delete() std::vector<SwFmtFld*> aTmp; aTmp.reserve( mvPostItFlds.size() ); - for(std::list<SwSidebarItem*>::iterator pPostIt = mvPostItFlds.begin(); pPostIt!= mvPostItFlds.end() ; pPostIt++) + for(std::list<SwSidebarItem*>::iterator pPostIt = mvPostItFlds.begin(); pPostIt!= mvPostItFlds.end() ; ++pPostIt) { if ((*pPostIt)->GetFmtFld()) aTmp.push_back( (*pPostIt)->GetFmtFld() ); } - for(std::vector<SwFmtFld*>::iterator i = aTmp.begin(); i!= aTmp.end() ; i++) + for(std::vector<SwFmtFld*>::iterator i = aTmp.begin(); i!= aTmp.end() ; ++i) { mpWrtShell->GotoField( *(*i) ); mpWrtShell->DelRight(); } -/* - for(std::list<SwPostItItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) - { - SwPostItItem* pItem = (*i); - // stop listening, we delete ourselves - EndListening( *(pItem->pFmtFld) ); - // delete the actual SwPostItField - mpWrtShell->GotoField(*pItem->pFmtFld); - mpWrtShell->DelRight(); - // delete visual representation - delete pItem->pPostIt; - // delete struct saving the pointers - delete pItem; - } - mvPostItFlds.clear(); -*/ - mpWrtShell->EndUndo(); PrepareView(); mpWrtShell->EndAllAction(); @@ -1300,26 +1199,6 @@ void SwPostItMgr::Delete() CalcRects(); LayoutPostIts(); } -#if 0 -void SwPostItMgr::Hide(SwPostItField* pPostItField ) -{ - for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) - { - if ((*i)->GetFmtFld()) - { - SwPostItField* pField = static_cast<SwPostItField*>((*i)->GetFmtFld()->GetFld()); - if (pPostItField==pField) - { - (*i)->bShow = false; - (*i)->pPostIt->HideNote(); - break; - } - } - } - - LayoutPostIts(); -} -#endif void SwPostItMgr::Hide( const String& rAuthor ) { for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) @@ -1362,21 +1241,13 @@ void SwPostItMgr::Sort(const short aType) case SORT_POS: mvPostItFlds.sort(comp_pos); break; - /* - case SORT_AUTHOR: - mvPostItFlds.sort(comp_author); - break; - case SORT_DATE: - mvPostItFlds.sort(comp_date); - break; - */ } } } SwSidebarWin* SwPostItMgr::GetSidebarWin( const SfxBroadcaster* pBroadcaster) const { - for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { if ( (*i)->GetBroadCaster() == pBroadcaster) return (*i)->pPostIt; @@ -1386,7 +1257,7 @@ SwSidebarWin* SwPostItMgr::GetSidebarWin( const SfxBroadcaster* pBroadcaster) co sw::annotation::SwAnnotationWin* SwPostItMgr::GetAnnotationWin(const SwPostItField* pFld) const { - for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(const_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { if ( (*i)->GetFmtFld() && ((*i)->GetFmtFld()->GetFld() == pFld)) return dynamic_cast<sw::annotation::SwAnnotationWin*>((*i)->pPostIt); @@ -1459,7 +1330,7 @@ long SwPostItMgr::GetNextBorder() } } - DBG_ERROR("SwPostItMgr::GetNextBorder(): We have to find a next border here"); + OSL_ENSURE(false, "SwPostItMgr::GetNextBorder(): We have to find a next border here"); return -1; } @@ -1521,7 +1392,6 @@ void SwPostItMgr::PrepareView(bool bIgnoreCount) if (!HasNotes() || bIgnoreCount) { mpWrtShell->StartAllAction(); - //mpEditWin->Invalidate(); // really not needed anymore?? SwRootFrm* pLayout = mpWrtShell->GetLayout(); if ( pLayout ) SwPostItHelper::setSidebarChanged( pLayout, @@ -1549,7 +1419,7 @@ bool SwPostItMgr::IsHit(const Point &aPointPixel) if( nPageNum ) { Rectangle aRect; - DBG_ASSERT(mPages.size()>nPageNum-1,"SwPostitMgr:: page container size wrong"); + OSL_ENSURE(mPages.size()>nPageNum-1,"SwPostitMgr:: page container size wrong"); aRect = mPages[nPageNum-1]->eSidebarPosition == sw::sidebarwindows::SIDEBAR_LEFT ? Rectangle(Point(aPageFrm.Left()-GetSidebarWidth()-GetSidebarBorderWidth(),aPageFrm.Top()),Size(GetSidebarWidth(),aPageFrm.Height())) : Rectangle( Point(aPageFrm.Right()+GetSidebarBorderWidth(),aPageFrm.Top()) , Size(GetSidebarWidth(),aPageFrm.Height())); @@ -1642,14 +1512,13 @@ void SwPostItMgr::CorrectPositions() return; // yeah, I know, if this is a left page it could be wrong, but finding the page and the note is probably not even faster than just doing it - // --> OD 2010-06-03 #i111964# - check, if anchor overlay object exists. + // check, if anchor overlay object exists. const long aAnchorX = pFirstPostIt->Anchor() ? mpEditWin->LogicToPixel( Point((long)(pFirstPostIt->Anchor()->GetSixthPosition().getX()),0)).X() : 0; const long aAnchorY = pFirstPostIt->Anchor() ? mpEditWin->LogicToPixel( Point(0,(long)(pFirstPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1 : 0; - // <-- if (Point(aAnchorX,aAnchorY) != pFirstPostIt->GetPosPixel()) { long aAnchorPosX = 0; @@ -1658,9 +1527,8 @@ void SwPostItMgr::CorrectPositions() { for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); i++) { - // --> OD 2010-06-03 #i111964# - check, if anchor overlay object exists. + // check, if anchor overlay object exists. if ( (*i)->bShow && (*i)->pPostIt && (*i)->pPostIt->Anchor() ) - // <-- { aAnchorPosX = mPages[n]->eSidebarPosition == sw::sidebarwindows::SIDEBAR_LEFT ? mpEditWin->LogicToPixel( Point((long)((*i)->pPostIt->Anchor()->GetSeventhPosition().getX()),0)).X() @@ -1716,7 +1584,7 @@ Color SwPostItMgr::GetColorDark(sal_uInt16 aAuthorIndex) COL_AUTHOR4_NORMAL, COL_AUTHOR5_NORMAL, COL_AUTHOR6_NORMAL, COL_AUTHOR7_NORMAL, COL_AUTHOR8_NORMAL, COL_AUTHOR9_NORMAL }; - return Color( aArrayNormal[ aAuthorIndex % (sizeof( aArrayNormal )/ sizeof( aArrayNormal[0] ))]); + return Color( aArrayNormal[ aAuthorIndex % (SAL_N_ELEMENTS(aArrayNormal))]); } else return Color(COL_WHITE); @@ -1731,7 +1599,7 @@ Color SwPostItMgr::GetColorLight(sal_uInt16 aAuthorIndex) COL_AUTHOR4_LIGHT, COL_AUTHOR5_LIGHT, COL_AUTHOR6_LIGHT, COL_AUTHOR7_LIGHT, COL_AUTHOR8_LIGHT, COL_AUTHOR9_LIGHT }; - return Color( aArrayLight[ aAuthorIndex % (sizeof( aArrayLight )/ sizeof( aArrayLight[0] ))]); + return Color( aArrayLight[ aAuthorIndex % (SAL_N_ELEMENTS(aArrayLight))]); } else return Color(COL_WHITE); @@ -1746,7 +1614,7 @@ Color SwPostItMgr::GetColorAnchor(sal_uInt16 aAuthorIndex) COL_AUTHOR4_DARK, COL_AUTHOR5_DARK, COL_AUTHOR6_DARK, COL_AUTHOR7_DARK, COL_AUTHOR8_DARK, COL_AUTHOR9_DARK }; - return Color( aArrayAnchor[ aAuthorIndex % (sizeof( aArrayAnchor ) / sizeof( aArrayAnchor[0] ))]); + return Color( aArrayAnchor[ aAuthorIndex % (SAL_N_ELEMENTS(aArrayAnchor))]); } else return Color(COL_WHITE); @@ -1780,7 +1648,7 @@ IMPL_LINK( SwPostItMgr, CalcHdl, void*, /* pVoid*/ ) mnEventId = 0; if ( mbLayouting ) { - DBG_ERROR("Reentrance problem in Layout Manager!"); + OSL_ENSURE(false, "Reentrance problem in Layout Manager!"); mbWaitingForCalcRects = false; return 0; } @@ -1796,7 +1664,7 @@ IMPL_LINK( SwPostItMgr, CalcHdl, void*, /* pVoid*/ ) void SwPostItMgr::Rescale() { - for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) if ( (*i)->pPostIt ) (*i)->pPostIt->Rescale(); } @@ -1833,21 +1701,21 @@ sal_Int32 SwPostItMgr::GetSidebarScrollerHeight() const void SwPostItMgr::SetSpellChecking() { - for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) if ( (*i)->pPostIt ) (*i)->pPostIt->SetSpellChecking(); } void SwPostItMgr::SetReadOnlyState() { - for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) if ( (*i)->pPostIt ) (*i)->pPostIt->SetReadonly( mbReadOnly ); } void SwPostItMgr::CheckMetaText() { - for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) if ( (*i)->pPostIt ) (*i)->pPostIt->CheckMetaText(); @@ -1902,7 +1770,6 @@ sal_uInt16 SwPostItMgr::SearchReplace(const SwFmtFld &pFld, const ::com::sun::st void SwPostItMgr::AssureStdModeAtShell() { - //#i103373# #i103645# // deselect any drawing or frame and leave editing mode SdrView* pSdrView = mpWrtShell->GetDrawView(); if ( pSdrView && pSdrView->IsTextEdit() ) @@ -2043,3 +1910,5 @@ void SwPostItMgr::GetAllSidebarWinForFrm( const SwFrm& rFrm, void SwNoteProps::Commit() {} void SwNoteProps::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/ShadowOverlayObject.cxx b/sw/source/ui/docvw/ShadowOverlayObject.cxx index b11fc914b5..0c60340e65 100644 --- a/sw/source/ui/docvw/ShadowOverlayObject.cxx +++ b/sw/source/ui/docvw/ShadowOverlayObject.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: postit.cxx,v $ - * $Revision: 1.8.42.11 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -266,3 +264,4 @@ void ShadowOverlayObject::SetPosition( const basegfx::B2DPoint& rPoint1, } } // end of namespace sw::sidebarwindows +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/ShadowOverlayObject.hxx b/sw/source/ui/docvw/ShadowOverlayObject.hxx index a00aea380f..d33f0c69d6 100644 --- a/sw/source/ui/docvw/ShadowOverlayObject.hxx +++ b/sw/source/ui/docvw/ShadowOverlayObject.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,10 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -78,3 +75,5 @@ class ShadowOverlayObject: public sdr::overlay::OverlayObjectWithBasePosition } } // end of namespace sw::sidebarwindows #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/SidebarTxtControl.cxx b/sw/source/ui/docvw/SidebarTxtControl.cxx index 3dd1417840..8d5b369933 100644 --- a/sw/source/ui/docvw/SidebarTxtControl.cxx +++ b/sw/source/ui/docvw/SidebarTxtControl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -362,7 +360,6 @@ void SidebarTxtControl::Command( const CommandEvent& rCEvt ) //!! call different Execute function to get rid of the new thesaurus sub menu //!! pointer created in the call to Popup. //!! Otherwise we would have a memory leak (see also #i107205#) - //((PopupMenu*)pMgr->GetSVMenu())->Execute( this, aPos ); pMgr->Execute( aPos, this ); delete pMgr; } @@ -425,3 +422,4 @@ css::uno::Reference< css::accessibility::XAccessible > SidebarTxtControl::Create } } // end of namespace sw::sidebarwindows +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/SidebarTxtControl.hxx b/sw/source/ui/docvw/SidebarTxtControl.hxx index ba517fff6b..47efe4c1d3 100644 --- a/sw/source/ui/docvw/SidebarTxtControl.hxx +++ b/sw/source/ui/docvw/SidebarTxtControl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,10 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -85,3 +82,5 @@ class SidebarTxtControl : public Control } } // end of namespace sw::sidebarwindows #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/SidebarTxtControlAcc.cxx b/sw/source/ui/docvw/SidebarTxtControlAcc.cxx index 66b0bc8833..52ddacabb3 100644 --- a/sw/source/ui/docvw/SidebarTxtControlAcc.cxx +++ b/sw/source/ui/docvw/SidebarTxtControlAcc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -180,7 +178,7 @@ class SidebarTxtControlAccessibleContext : public VCLXAccessibleComponent SidebarTxtControl& mrSidebarTxtControl; ::accessibility::AccessibleTextHelper* mpAccessibleTextHelper; - ::vos::OMutex maMutex; + ::osl::Mutex maMutex; void defunc(); }; @@ -211,7 +209,7 @@ void SidebarTxtControlAccessibleContext::defunc() sal_Int32 SAL_CALL SidebarTxtControlAccessibleContext::getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException) { - vos::OGuard aGuard( maMutex ); + osl::MutexGuard aGuard( maMutex ); sal_Int32 nChildCount( 0 ); @@ -226,7 +224,7 @@ sal_Int32 SAL_CALL SidebarTxtControlAccessibleContext::getAccessibleChildCount() css::uno::Reference< css::accessibility::XAccessible > SAL_CALL SidebarTxtControlAccessibleContext::getAccessibleChild( sal_Int32 i ) throw ( css::lang::IndexOutOfBoundsException, css::uno::RuntimeException ) { - vos::OGuard aGuard( maMutex ); + osl::MutexGuard aGuard( maMutex ); css::uno::Reference< css::accessibility::XAccessible > xChild; @@ -242,7 +240,7 @@ void SAL_CALL SidebarTxtControlAccessibleContext::addEventListener ( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener) throw (css::uno::RuntimeException) { - vos::OGuard aGuard( maMutex ); + osl::MutexGuard aGuard( maMutex ); if ( mpAccessibleTextHelper ) { @@ -254,7 +252,7 @@ void SAL_CALL SidebarTxtControlAccessibleContext::removeEventListener ( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener) throw (css::uno::RuntimeException) { - vos::OGuard aGuard( maMutex ); + osl::MutexGuard aGuard( maMutex ); if ( mpAccessibleTextHelper ) { @@ -315,3 +313,4 @@ css::uno::Reference< css::accessibility::XAccessibleContext > SidebarTxtControlA } } // end of namespace sw::sidebarwindows +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/SidebarTxtControlAcc.hxx b/sw/source/ui/docvw/SidebarTxtControlAcc.hxx index 57edc50512..d711c2dd6b 100644 --- a/sw/source/ui/docvw/SidebarTxtControlAcc.hxx +++ b/sw/source/ui/docvw/SidebarTxtControlAcc.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,10 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -54,3 +51,5 @@ class SidebarTxtControlAccessible : public VCLXWindow } } // end of namespace sw::sidebarwindows #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx index 24bae48eee..d521b651a0 100644 --- a/sw/source/ui/docvw/SidebarWin.cxx +++ b/sw/source/ui/docvw/SidebarWin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -92,7 +93,7 @@ namespace sw { namespace sidebarwindows { #define POSTIT_SHADOW_BRIGHT Color(180,180,180) #define POSTIT_SHADOW_DARK Color(83,83,83) -#define EMPTYSTRING rtl::OUString::createFromAscii("") +#define EMPTYSTRING rtl::OUString() /************** SwSidebarWin************************************/ SwSidebarWin::SwSidebarWin( SwEditWin& rEditWin, @@ -399,7 +400,7 @@ void SwSidebarWin::CheckMetaText() else if (sMeta.Len() > 22) { sMeta.Erase(20); - sMeta = sMeta + rtl::OUString::createFromAscii("..."); + sMeta = sMeta + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("...")); } if ( mpMetadataAuthor->GetText() != sMeta ) { @@ -425,7 +426,7 @@ void SwSidebarWin::CheckMetaText() } if (GetTime()!=0) { - sMeta = sMeta + rtl::OUString::createFromAscii(" ") + rLocalData.getTime( GetTime(),false ); + sMeta = sMeta + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) + rLocalData.getTime( GetTime(),false ); } if ( mpMetadataDate->GetText() != sMeta ) { @@ -492,7 +493,7 @@ void SwSidebarWin::SetPosAndSize() } break; default: - ASSERT( false, + OSL_ENSURE( false, "<SwSidebarWin::SetPosAndSize()> - unexpected position of sidebar" ); break; } @@ -757,7 +758,7 @@ void SwSidebarWin::SetColor(Color aColorDark,Color aColorLight, Color aColorAnch AllSettings aSettings2 = mpVScrollbar->GetSettings(); StyleSettings aStyleSettings2 = aSettings2.GetStyleSettings(); aStyleSettings2.SetButtonTextColor(Color(0,0,0)); - aStyleSettings2.SetCheckedColor(mColorLight); //hintergund + aStyleSettings2.SetCheckedColor(mColorLight); // backgound aStyleSettings2.SetShadowColor(mColorAnchor); aStyleSettings2.SetFaceColor(mColorDark); aSettings2.SetStyleSettings(aStyleSettings2); @@ -996,11 +997,7 @@ IMPL_LINK( SwSidebarWin, WindowEventListener, VclSimpleEvent*, pEvent ) } else if ( pMouseEvt->IsLeaveWindow()) { - if (IsPreview()) - { - //doLazyDelete(); - } - else + if (!IsPreview()) { mbMouseOver = false; if ( !HasFocus() ) @@ -1055,18 +1052,14 @@ IMPL_LINK(SwSidebarWin, ScrollHdl, ScrollBar*, pScroll) return 0; } -IMPL_LINK(SwSidebarWin, ModifyHdl, void*, pVoid) +IMPL_LINK(SwSidebarWin, ModifyHdl, void*, EMPTYARG) { - // no warnings, please - pVoid=0; mrView.GetDocShell()->SetModified(sal_True); return 0; } -IMPL_LINK(SwSidebarWin, DeleteHdl, void*, pVoid) +IMPL_LINK(SwSidebarWin, DeleteHdl, void*, EMPTYARG) { - // no warnings, please - pVoid=0; mnEventId = 0; Delete(); return 0; @@ -1256,7 +1249,7 @@ void SwSidebarWin::ChangeSidebarItem( SwSidebarItem& rSidebarItem ) { SidebarWinAccessible* pAcc = static_cast<SidebarWinAccessible*>( GetWindowPeer() ); - ASSERT( dynamic_cast<SidebarWinAccessible*>( GetWindowPeer() ), + OSL_ENSURE( dynamic_cast<SidebarWinAccessible*>( GetWindowPeer() ), "<SwSidebarWin::ChangeSidebarItem(..)> - unexpected type of window peer -> crash possible!" ); pAcc->ChangeSidebarItem( mrSidebarItem ); } @@ -1283,110 +1276,4 @@ css::uno::Reference< css::accessibility::XAccessible > SwSidebarWin::CreateAcces } } // eof of namespace sw::sidebarwindows -/********** SwRedComment**************/ -/* -SwRedComment::SwRedComment( Window* pParent, WinBits nBits,SwPostItMgr* aMgr,SwPostItBits aBits,SwRedline* pRed) - : SwSidebarWin(pParent,nBits,aMgr,aBits), - pRedline(pRed) -{ -} - -void SwRedComment::SetPopup() -{ - mpButtonPopup = new PopupMenu(SW_RES(MN_REDCOMMENT_BUTTON)); - //mpButtonPopup->SetMenuFlags(MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES); -} - -void SwRedComment::UpdateData() -{ - if ( Engine()->IsModified() ) - { - // so we get a new layout of notes (Anchor position is still the same and we would otherwise not get one) - Mgr()->SetLayout(); - // SetRedline is calling SetModified already - DocView()->GetWrtShell().SetRedlineComment(Engine()->GetEditEngine().GetText()); - } - Engine()->ClearModifyFlag(); - Engine()->GetUndoManager().Clear(); -} - -void SwRedComment::SetPostItText() -{ - Engine()->SetModifyHdl( Link() ); - Engine()->EnableUndo( sal_False ); - - Engine()->Clear(); - View()->SetAttribs(DefaultItem()); - View()->InsertText(pRedline->GetComment(),false); - - Engine()->ClearModifyFlag(); - Engine()->GetUndoManager().Clear(); - Engine()->EnableUndo( sal_True ); - Engine()->SetModifyHdl( LINK( this, SwSidebarWin, ModifyHdl ) ); - Invalidate(); -} - -void SwRedComment::DeactivatePostIt() -{ - SwSidebarWin::DeactivatePostIt(); - // current Redline is still selected - DocView()->GetWrtShellPtr()->ClearMark(); -} - -void SwRedComment::ActivatePostIt() -{ - SwSidebarWin::ActivatePostIt(); - - // do we want the redline selected? - // otherwise, SwRedComment::ActivatePostIt() as well as SwRedComment::DeactivatePostIt() - // can be thrown out completly - DocView()->GetDocShell()->GetWrtShell()->GotoRedline( - DocView()->GetDocShell()->GetWrtShell()->FindRedlineOfData(pRedline->GetRedlineData()),true); -} - -void SwRedComment::MouseButtonDown( const MouseEvent& rMEvt ) -{ - if (mRectMetaButton.IsInside(PixelToLogic(rMEvt.GetPosPixel())) && rMEvt.IsLeft()) - { - ExecuteCommand( mpButtonPopup->Execute( this,Rectangle(LogicToPixel(mRectMetaButton.BottomLeft()),LogicToPixel(mRectMetaButton.BottomLeft())),POPUPMENU_EXECUTE_DOWN | POPUPMENU_NOMOUSEUPCLOSE) ); - } -} - -void SwRedComment::Delete() -{ - SwSidebarWin::Delete(); - // we are not neccessarily on our redline, so let's move there - GotoPos(); - DocView()->GetWrtShell().SetRedlineComment(EMPTYSTRING); - DocView()->GetWrtShell().ClearMark(); - // so we get a new layout of notes (Anchor position is still the same and we would otherwise not get one) - Mgr()->SetLayout(); - Mgr()->RemoveItem(pRedline); -} - -void SwRedComment::GotoPos() -{ - DocView()->GetDocShell()->GetWrtShell()->GotoRedline( - DocView()->GetDocShell()->GetWrtShell()->FindRedlineOfData(pRedline->GetRedlineData())); -} - -String SwRedComment::GetAuthor() -{ - return pRedline->GetAuthorString(); -} - -Date SwRedComment::GetDate() -{ - return pRedline->GetTimeStamp().GetDate(); -} - -Time SwRedComment::GetTime() -{ - return pRedline->GetTimeStamp().GetTime(); -} - -bool SwRedComment::IsProtected() -{ - return SwSidebarWin::IsProtected() || pRedline->Start()->nNode.GetNode().GetTxtNode()->IsInProtectSect(); -} -*/ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/SidebarWinAcc.cxx b/sw/source/ui/docvw/SidebarWinAcc.cxx index 214913963d..1702a3e6f4 100644 --- a/sw/source/ui/docvw/SidebarWinAcc.cxx +++ b/sw/source/ui/docvw/SidebarWinAcc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -66,7 +64,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent void ChangeAnchor( const SwFrm* pAnchorFrm ) { - vos::OGuard aGuard(maMutex); + osl::MutexGuard aGuard(maMutex); mpAnchorFrm = pAnchorFrm; } @@ -74,7 +72,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() throw (css::uno::RuntimeException) { - vos::OGuard aGuard(maMutex); + osl::MutexGuard aGuard(maMutex); css::uno::Reference< css::accessibility::XAccessible > xAccParent; @@ -89,7 +87,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw (css::uno::RuntimeException) { - vos::OGuard aGuard(maMutex); + osl::MutexGuard aGuard(maMutex); sal_Int32 nIndex( -1 ); @@ -107,7 +105,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent ViewShell& mrViewShell; const SwFrm* mpAnchorFrm; - ::vos::OMutex maMutex; + ::osl::Mutex maMutex; }; // ============================================================================= @@ -160,3 +158,4 @@ css::uno::Reference< css::accessibility::XAccessibleContext > SidebarWinAccessib } } // end of namespace sw::sidebarwindows +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/SidebarWinAcc.hxx b/sw/source/ui/docvw/SidebarWinAcc.hxx index 0abe1acbfa..e99b212c24 100644 --- a/sw/source/ui/docvw/SidebarWinAcc.hxx +++ b/sw/source/ui/docvw/SidebarWinAcc.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,10 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -65,3 +62,5 @@ class SidebarWinAccessible : public VCLXWindow } } // end of namespace sw::sidebarwindows #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/annotation.hrc b/sw/source/ui/docvw/annotation.hrc index e43a903424..f844b28296 100644 --- a/sw/source/ui/docvw/annotation.hrc +++ b/sw/source/ui/docvw/annotation.hrc @@ -6,9 +6,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sw/source/ui/docvw/annotation.src b/sw/source/ui/docvw/annotation.src index 8dcda9c25b..a727eae66d 100644 --- a/sw/source/ui/docvw/annotation.src +++ b/sw/source/ui/docvw/annotation.src @@ -6,9 +6,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/sw/source/ui/docvw/docvw.hrc b/sw/source/ui/docvw/docvw.hrc index c0f1529179..9a8987c3f0 100644 --- a/sw/source/ui/docvw/docvw.hrc +++ b/sw/source/ui/docvw/docvw.hrc @@ -52,7 +52,7 @@ #define MN_READONLY_RELOAD (RC_DOCVW_BEGIN + 22) #define MN_READONLY_COPY (RC_DOCVW_BEGIN + 23) -//Bei den folgenden brauchen wir Luft fuer die Gallery-Themen +//For the following we need space for the gallery-themes #define MN_READONLY_GRAPHICTOGALLERY (RC_DOCVW_BEGIN + 24) #define MN_READONLY_BACKGROUNDTOGALLERY (RC_DOCVW_BEGIN + 60) diff --git a/sw/source/ui/docvw/docvw.src b/sw/source/ui/docvw/docvw.src index 459b673cb1..b4f57bbcc2 100644 --- a/sw/source/ui/docvw/docvw.src +++ b/sw/source/ui/docvw/docvw.src @@ -162,9 +162,6 @@ Menu MN_READONLY_POPUP { Identifier = MN_READONLY_COPYGRAPHIC ; HelpID = HID_MN_READONLY_COPYGRAPHIC ; - /* ### ACHTUNG: Neuer Text in Resource? Grafik ~kopieren : ~Grafik kopieren */ - /* ### ACHTUNG: Neuer Text in Resource? Grafik ~kopieren : ~Grafik kopieren */ - /* ### ACHTUNG: Neuer Text in Resource? Grafik ~kopieren : ~Grafik kopieren */ Text [ en-US ] = "Copy ~Graphics" ; }; SEPARATOR diff --git a/sw/source/ui/docvw/edtdd.cxx b/sw/source/ui/docvw/edtdd.cxx index 001940b542..a9bde42a20 100644 --- a/sw/source/ui/docvw/edtdd.cxx +++ b/sw/source/ui/docvw/edtdd.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,9 +35,6 @@ #include <svx/svdview.hxx> #include <editeng/outliner.hxx> -//#ifndef _SVDVMARK_HXX //autogen -//#include <svx/svdvmark.hxx> -//#endif #include <svx/svdobj.hxx> #include <sot/exchange.hxx> #include <sot/formats.hxx> @@ -47,15 +45,11 @@ #include <frmfmt.hxx> #include <wrtsh.hxx> #include <edtwin.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <viewopt.hxx> #include <swdtflvr.hxx> #include <swmodule.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <wdocsh.hxx> #include <swundo.hxx> @@ -106,14 +100,13 @@ void SwEditWin::StartDrag( sal_Int8 /*nAction*/, const Point& rPosPixel ) SdrObject *pObj = NULL; Point aDocPos( PixelToLogic( rPosPixel ) ); if ( !rSh.IsInSelect() && rSh.ChgCurrPam( aDocPos, sal_True, sal_True)) - //Wir sind nicht beim Selektieren und stehen auf einer - //Selektion + //We are not selecting and aren't at a selection bStart = sal_True; else if ( !bFrmDrag && rSh.IsSelFrmMode() && rSh.IsInsideSelectedObj( aDocPos ) ) { - //Wir sind nicht am internen Draggen und stehen auf - //einem Objekt (Rahmen, Zeichenobjekt) + //We are not dragging internally and are not at an + //object (frame, draw object) bStart = sal_True; } @@ -179,7 +172,7 @@ void SwEditWin::DropCleanup() { SwWrtShell &rSh = rView.GetWrtShell(); - // Stati zuruecksetzen + // reset statuses bNoInterrupt = sal_False; if ( bOldIdleSet ) { @@ -204,7 +197,7 @@ void SwEditWin::CleanupDropUserMarker() } -//Messehack (MA,MBA) +//exhibition hack (MA,MBA) void lcl_SelectShellForDrop( SwView &rView ) { if ( !rView.GetCurShell() ) @@ -217,7 +210,7 @@ sal_Int8 SwEditWin::ExecuteDrop( const ExecuteDropEvent& rEvt ) DropCleanup(); sal_Int8 nRet = DND_ACTION_NONE; - //Ein Drop auf eine offene OutlinerView geht uns nichts an (siehe auch QueryDrop) + //A Drop to an open OutlinerView doesn't concern us (also see QueryDrop) SwWrtShell &rSh = rView.GetWrtShell(); const Point aDocPt( PixelToLogic( rEvt.maPosPixel )); SdrObject *pObj = 0; @@ -232,14 +225,13 @@ sal_Int8 SwEditWin::ExecuteDrop( const ExecuteDropEvent& rEvt ) if ( aRect.IsInside(aPos) ) { rSh.StartAllAction(); -//!! sal_Int8 nRet = DND_ACTION_NONE/*pOLV->ExecuteDrop( rEvt )*/; rSh.EndAllAction(); return nRet; } } - // dvo 2002-05-27, #99027#: There's a special treatment for file lists with a single + // There's a special treatment for file lists with a single // element, that depends on the actual content of the // Transferable to be accessible. Since the transferable // may only be accessed after the drop has been accepted @@ -253,7 +245,6 @@ sal_Int8 SwEditWin::ExecuteDrop( const ExecuteDropEvent& rEvt ) GetDataFlavorExVector(), m_nDropDestination, rEvt.mnAction, -//!! rEvt.GetSourceOptions(), nUserOpt, m_nDropFormat, nEventAction, 0, &rEvt.maDropEvent.Transferable ); @@ -262,10 +253,9 @@ sal_Int8 SwEditWin::ExecuteDrop( const ExecuteDropEvent& rEvt ) nRet = rEvt.mnAction; if( !SwTransferable::PasteData( aData, rSh, m_nDropAction, m_nDropFormat, m_nDropDestination, sal_False, rEvt.mbDefault, &aDocPt, nRet)) -//!! nRet = SFX_APP()->ExecuteDrop( rEvt ); nRet = DND_ACTION_NONE; else if ( SW_MOD()->pDragDrop ) - //Bei internem D&D nicht mehr aufraeumen! + //Don't clean up anymore at internal D&D! SW_MOD()->pDragDrop->SetCleanUp( sal_False ); return nRet; @@ -282,7 +272,7 @@ sal_uInt16 SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppO SdrObject *pObj = NULL; const ObjCntType eType = rSh.GetObjCntType( aDocPt, pObj ); - //Drop auf OutlinerView (TextEdit im Drawing) soll diese selbst entscheiden! + //Drop to OutlinerView (TextEdit in Drawing) should decide it on its own! if( pObj ) { OutlinerView* pOLV = rSh.GetDrawView()->GetTextEditOutlinerView(); @@ -296,10 +286,10 @@ sal_uInt16 SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppO } } - //Auf was wollen wir denn gerade droppen? + //What do we want to drop on now? sal_uInt16 nDropDestination = 0; - //Sonst etwas aus der DrawingEngine getroffen? + //Did anything else arrive from the DrawingEngine? if( OBJCNT_NONE != eType ) { switch ( eType ) @@ -332,7 +322,7 @@ sal_uInt16 SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppO case OBJCNT_URLBUTTON: nDropDestination = EXCHG_DEST_DOC_URLBUTTON; break; case OBJCNT_GROUPOBJ: nDropDestination = EXCHG_DEST_DOC_GROUPOBJ; break; - default: ASSERT( !this, "new ObjectType?" ); + default: OSL_ENSURE( !this, "new ObjectType?" ); } } if ( !nDropDestination ) @@ -410,19 +400,18 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) GetDataFlavorExVector(), m_nDropDestination, rEvt.mnAction, -//!! rEvt.GetSourceOptions(), nUserOpt, m_nDropFormat, nEventAction ); if( EXCHG_INOUT_ACTION_NONE != m_nDropAction ) { const Point aDocPt( PixelToLogic( aPixPt ) ); - //Bei den default Aktionen wollen wir noch ein bischen mitreden. + //With the default action we still want to have a say. SwModule *pMod = SW_MOD(); if( pMod->pDragDrop ) { sal_Bool bCleanup = sal_False; - //Zeichenobjekte in Kopf-/Fusszeilen sind nicht erlaubt + //Drawing objects in Headers/Footers are not allowed SwWrtShell *pSrcSh = pMod->pDragDrop->GetShell(); if( (pSrcSh->GetSelFrmType() == FRMTYPE_DRAWOBJ) && @@ -431,7 +420,7 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) { bCleanup = sal_True; } - // keine positionsgeschuetzten Objecte verschieben! + // don't more position protected objects! else if( DND_ACTION_MOVE == rEvt.mnAction && pSrcSh->IsSelObjProtected( FLYPROTECT_POS ) ) { @@ -439,8 +428,8 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) } else if( rEvt.mbDefault ) { - // JP 13.08.98: internes Drag&Drop: bei gleichem Doc ein Move - // ansonten ein Copy - Task 54974 + // internal Drag&Drop: within same Doc a Move + // otherwise a Copy - Task 54974 nEventAction = pSrcSh->GetDoc() == rSh.GetDoc() ? DND_ACTION_MOVE : DND_ACTION_COPY; @@ -454,7 +443,7 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) } else { - //D&D von ausserhalb des SW soll per default ein Copy sein. + //D&D from outside of SW should be a Copy per default. if( EXCHG_IN_ACTION_DEFAULT == nEventAction && DND_ACTION_MOVE == rEvt.mnAction ) nEventAction = DND_ACTION_COPY; @@ -501,7 +490,6 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) CleanupDropUserMarker(); rSh.UnSetVisCrsr(); -//!! return SFX_APP()->AcceptDrop( rEvt ); return DND_ACTION_NONE; } @@ -525,3 +513,4 @@ IMPL_LINK( SwEditWin, DDHandler, Timer *, EMPTYARG ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index fa16f089f5..5e1565169d 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -#include <tools/list.hxx> #include <swtypes.hxx> #include <hintids.hxx> #include <com/sun/star/accessibility/XAccessible.hpp> @@ -120,19 +119,16 @@ #include <helpid.h> #include <cmdid.h> -#ifndef _DOCVW_HRC #include <docvw.hrc> -#endif #include <uitool.hxx> -// OD 18.09.2003 #i18732# #include <fmtfollowtextflow.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <charfmt.hxx> #include <numrule.hxx> #include <pagedesc.hxx> -#include <svtools/ruler.hxx> // #i23726# +#include <svtools/ruler.hxx> #include "formatclipboard.hxx" -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <IMark.hxx> @@ -141,27 +137,23 @@ #include <PostItMgr.hxx> -//JP 11.10.2001: enable test code for bug fix 91313 -#if defined(DBG_UTIL) && (OSL_DEBUG_LEVEL > 1) -//#define TEST_FOR_BUG91313 -#endif +#include "../../core/inc/rootfrm.hxx" using namespace sw::mark; using namespace ::com::sun::star; /*-------------------------------------------------------------------- - Beschreibung: Globals + Description: Globals --------------------------------------------------------------------*/ static bool bInputLanguageSwitched = false; extern sal_Bool bNoInterrupt; // in mainwn.cxx -//Normalerweise wird im MouseButtonUp eine Selektion aufgehoben wenn die -//Selektion nicht gerade aufgezogen wird. Leider wird im MouseButtonDown -//bei doppel-/dreifach-Klick Selektiert, diese Selektion wird in dem Handler -//komplett abgeschlossen und kann deshalb im Up nicht mehr unterschieden -//werden. Um dies Aufzuloese wird bHoldSelection im Down gesetzt und im -//Up ausgewertet. +// Usually in MouseButtonUp a selection is revoked when the selection is +// not currently being pulled open. Unfortunately in MouseButtonDown there +// is being selected at double/triple click. That selection is completely +// finished in the Handler and thus can't be distinguished in the Up. +// To resolve this bHoldSelection is set in Down at evaluated in Up. static sal_Bool bHoldSelection = sal_False; sal_Bool bFrmDrag = sal_False; @@ -179,8 +171,7 @@ long SwEditWin::nDDStartPosY = 0; long SwEditWin::nDDStartPosX = 0; Color SwEditWin::aTextBackColor(COL_YELLOW); Color SwEditWin::aTextColor(COL_RED); -sal_Bool SwEditWin::bTransparentBackColor = sal_False; // Hintergrund nicht transparent - +sal_Bool SwEditWin::bTransparentBackColor = sal_False; // background not transparent extern sal_Bool bExecuteDrag; @@ -193,34 +184,27 @@ class SwAnchorMarker SdrHdl* pHdl; Point aHdlPos; Point aLastPos; - // --> OD 2010-09-16 #i114522# bool bTopRightHandle; - // <-- public: - SwAnchorMarker( SdrHdl* pH ) + SwAnchorMarker( SdrHdl* pH ) : pHdl( pH ) , aHdlPos( pH->GetPos() ) - , aLastPos( pH->GetPos() ) - // --> OD 2010-09-16 #i114522# + , aLastPos( pH->GetPos() ) , bTopRightHandle( pH->GetKind() == HDL_ANCHOR_TR ) - // <-- {} const Point& GetLastPos() const { return aLastPos; } void SetLastPos( const Point& rNew ) { aLastPos = rNew; } void SetPos( const Point& rNew ) { pHdl->SetPos( rNew ); } const Point& GetPos() { return pHdl->GetPos(); } const Point& GetHdlPos() { return aHdlPos; } - void ChgHdl( SdrHdl* pNew ) - { + void ChgHdl( SdrHdl* pNew ) + { pHdl = pNew; - // --> OD 2010-09-16 #i114522# if ( pHdl ) { bTopRightHandle = (pHdl->GetKind() == HDL_ANCHOR_TR); } - // <-- } - // --> OD 2010-09-16 #i114522# const Point GetPosForHitTest( const OutputDevice& rOut ) { Point aHitTestPos( GetPos() ); @@ -232,12 +216,11 @@ public: else { aHitTestPos += Point( 1, 1 ); - } + } aHitTestPos = rOut.PixelToLogic( aHitTestPos ); - + return aHitTestPos; } - // <-- }; struct QuickHelpData @@ -271,12 +254,11 @@ struct QuickHelpData void FillStrArr( SwWrtShell& rSh, const String& rWord ); }; - /*-------------------------------------------------------------------- - Beschreibung: Minimale Bewegung Zittern vermeiden + Description: avoid minimal movement shiver --------------------------------------------------------------------*/ -#define HIT_PIX 2 /* Hit-Toleranz in Pixel */ +#define HIT_PIX 2 /* hit tolerance in pixel */ #define MIN_MOVE 4 inline sal_Bool IsMinMove(const Point &rStartPos, const Point &rLPt) @@ -286,10 +268,10 @@ inline sal_Bool IsMinMove(const Point &rStartPos, const Point &rLPt) } /*-------------------------------------------------------------------- - JP 30.07.98: fuer MouseButtonDown - feststellen, ob ein DrawObject - und KEIN SwgFrame getroffen wurde! Shift/Ctrl sollen - nur bei DrawObjecte zum Selektieren fuehren, bei SwgFlys - ggfs zum ausloesen von Hyperlinks (DownLoad/NewWindow!) + for MouseButtonDown - determine whether a DrawObject + an NO SwgFrame was hit! Shift/Ctrl should only result + in selecting, with DrawObjects; at SwgFlys to trigger + hyperlinks if applicable (DownLoad/NewWindow!) --------------------------------------------------------------------*/ inline sal_Bool IsDrawObjSelectable( const SwWrtShell& rSh, const Point& rPt ) { @@ -309,10 +291,9 @@ inline sal_Bool IsDrawObjSelectable( const SwWrtShell& rSh, const Point& rPt ) } /*-------------------------------------------------------------------- - Beschreibung: Pointer umschalten + Description: switch pointer --------------------------------------------------------------------*/ - void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) { SwWrtShell &rSh = rView.GetWrtShell(); @@ -326,7 +307,6 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) delete pUserMarker; pUserMarker = 0L; } -// rSh.SwCrsrShell::UnSetVisCrsr( rLPt ); eStyle = POINTER_NOTALLOWED; } else @@ -345,7 +325,7 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) 0 !=(pFmt = rSh.GetFmtFromObj( rLPt, &pRect )) && PTR_CAST(SwFlyFrmFmt, pFmt)) { - //Highlight fuer Rahmen anwerfen + //turn on highlight for frame Rectangle aTmp( pRect->SVRect() ); if ( !pUserMarker ) @@ -397,9 +377,6 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) return; } - // Removed ExecHyperlink option. - //sal_Bool bExecHyperlinks = rSh.GetViewOptions()->IsExecHyperlinks() ^ - // (nModifier == KEY_MOD2 ? sal_True : sal_False); sal_Bool bExecHyperlinks = rView.GetDocShell()->IsReadOnly(); if ( !bExecHyperlinks ) { @@ -565,10 +542,9 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) } /*-------------------------------------------------------------------- - Beschreibung: Timer fuer Selektion vergroessern + Description: increase timer for selection --------------------------------------------------------------------*/ - IMPL_LINK( SwEditWin, TimerHandler, Timer *, EMPTYARG ) { DBG_PROFSTART(edithdl); @@ -604,14 +580,13 @@ IMPL_LINK( SwEditWin, TimerHandler, Timer *, EMPTYARG ) else (rSh.*rSh.fnSetCrsr)( &aModPt, sal_False ); - //fix(24138): Es kann sein, dass der "Sprung" ueber eine Tabelle so - //nicht geschafft wird. Deshalb wir hier eben per Up/Down ueber die - //Tabelle gesprungen. + // It can be that a "jump" over a table cannot be accomplished like + // that. So we jump over the table by Up/Down here. const SwRect& rVisArea = rSh.VisArea(); if( aOldVis == rVisArea && !rSh.IsStartOfDoc() && !rSh.IsEndOfDoc() ) { - //JP 11.10.2001 Bug 72294 - take the center point of VisArea to - // decide in which direction the user want. + // take the center point of VisArea to + // decide in which direction the user want. if( aModPt.Y() < ( rVisArea.Top() + rVisArea.Height() / 2 ) ) rSh.Up( sal_True, 1 ); else @@ -625,11 +600,6 @@ IMPL_LINK( SwEditWin, TimerHandler, Timer *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwEditWin::JustifyAreaTimer() { const Rectangle &rVisArea = GetView().GetVisArea(); @@ -642,11 +612,7 @@ void SwEditWin::JustifyAreaTimer() nDiff = Max( Max( aMovePos.Y() - rVisArea.Bottom(), rVisArea.Top() - aMovePos.Y() ), Max( aMovePos.X() - rVisArea.Right(), rVisArea.Left() - aMovePos.X())); -#ifdef TEST_FOR_BUG91313 - aTimer.SetTimeout( Max( coMinLen, nTimeout - nDiff) ); -#else aTimer.SetTimeout( Max( coMinLen, nTimeout - nDiff*2L) ); -#endif } void SwEditWin::LeaveArea(const Point &rPos) @@ -665,10 +631,9 @@ inline void SwEditWin::EnterArea() } /*------------------------------------------------------------------------ - Beschreibung: Modus fuer Rahmen einfuegen + Description: insert mode for frames ------------------------------------------------------------------------*/ - void SwEditWin::InsFrm(sal_uInt16 nCols) { StdDrawMode( OBJ_NONE, sal_False ); @@ -676,15 +641,10 @@ void SwEditWin::InsFrm(sal_uInt16 nCols) nInsFrmColCount = nCols; } - - void SwEditWin::StdDrawMode( SdrObjKind eSdrObjectKind, sal_Bool bObjSelect ) { SetSdrDrawMode( eSdrObjectKind ); -/* if (GetDrawFuncPtr()) - GetDrawFuncPtr()->Deactivate();*/ - if (bObjSelect) rView.SetDrawFuncPtr(new DrawSelection( &rView.GetWrtShell(), this, &rView )); else @@ -695,13 +655,11 @@ void SwEditWin::StdDrawMode( SdrObjKind eSdrObjectKind, sal_Bool bObjSelect ) if (bObjSelect) rView.GetDrawFuncPtr()->Activate( SID_OBJECT_SELECT ); else - rView.GetDrawFuncPtr()->Activate( sal::static_int_cast< sal_uInt16 >(eSdrObjectKind) ); // don't know if this is useful at all; but it keeps functionality as it was... + rView.GetDrawFuncPtr()->Activate( sal::static_int_cast< sal_uInt16 >(eSdrObjectKind) ); bInsFrm = sal_False; nInsFrmColCount = 1; } - - void SwEditWin::StopInsFrm() { if (rView.GetDrawFuncPtr()) @@ -709,7 +667,7 @@ void SwEditWin::StopInsFrm() rView.GetDrawFuncPtr()->Deactivate(); rView.SetDrawFuncPtr(NULL); } - rView.LeaveDrawCreate(); // Konstruktionsmode verlassen + rView.LeaveDrawCreate(); // leave construction mode bInsFrm = sal_False; nInsFrmColCount = 1; } @@ -717,7 +675,6 @@ void SwEditWin::StopInsFrm() /*-------------------------------------------------------------------- --------------------------------------------------------------------*/ - sal_Bool SwEditWin::IsInputSequenceCheckingRequired( const String &rText, const SwPaM& rCrsr ) const { const SvtCTLOptions& rCTLOptions = SW_MOD()->GetCTLOptions(); @@ -744,12 +701,10 @@ sal_Bool SwEditWin::IsInputSequenceCheckingRequired( const String &rText, const return (0 <= nCTLScriptPos && nCTLScriptPos <= rText.Len()); } - /*-------------------------------------------------------------------- - Beschreibung: Der Character Buffer wird in das Dokument eingefuegt + Description: character buffer is inserted into the document --------------------------------------------------------------------*/ - void SwEditWin::FlushInBuffer() { if ( aInBuffer.Len() ) @@ -850,7 +805,7 @@ void SwEditWin::FlushInBuffer() // as well, we now expand the selection accordingly. SwPaM &rCrsr = *rSh.GetCrsr(); xub_StrLen nCrsrStartPos = rCrsr.Start()->nContent.GetIndex(); - DBG_ASSERT( nCrsrStartPos >= nExpandSelection, "cannot expand selection as specified!!" ); + OSL_ENSURE( nCrsrStartPos >= nExpandSelection, "cannot expand selection as specified!!" ); if (nExpandSelection && nCrsrStartPos >= nExpandSelection) { if (!rCrsr.HasMark()) @@ -863,9 +818,9 @@ void SwEditWin::FlushInBuffer() rView.GetViewFrame()->GetBindings().GetRecorder(); if ( xRecorder.is() ) { - //Shell ermitteln + // determine shell SfxShell *pSfxShell = lcl_GetShellFromDispatcher( rView, TYPE(SwTextShell) ); - // Request generieren und recorden + // generate request and record if (pSfxShell) { SfxRequest aReq( rView.GetViewFrame(), FN_INSERT_STRING ); @@ -873,7 +828,6 @@ void SwEditWin::FlushInBuffer() aReq.Done(); } } - //#21019# apply CTL and CJK language to the text input sal_Bool bLang = true; if(eBufferLanguage != LANGUAGE_DONTKNOW) { @@ -895,7 +849,7 @@ void SwEditWin::FlushInBuffer() if ( eLang == eBufferLanguage ) // current language attribute equal to language reported from system bLang = sal_False; - else if ( !bInputLanguageSwitched && RES_CHRATR_LANGUAGE == nWhich /* && (eLang&LANGUAGE_MASK_PRIMARY) == LANGUAGE_ENGLISH */ ) + else if ( !bInputLanguageSwitched && RES_CHRATR_LANGUAGE == nWhich ) { // special case: switching between two "LATIN" languages // In case the current keyboard setting might be suitable for both languages we can't safely assume that the user @@ -974,14 +928,11 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb ) SwWrtShell &rSh = rView.GetWrtShell(); SwRect aTmp = rSh.GetFlyRect(); if( aTmp.HasArea() && - // --> FME 2005-01-13 #i40348# // IsSelObjProtected() seems to be the correct condition, not // !HasReadonlySel(), otherwise frame is not moveable if content is // protected. !rSh.IsSelObjProtected( FLYPROTECT_POS|FLYPROTECT_SIZE ) ) - // <-- { - // OD 18.09.2003 #i18732# - add item <RES_FOLLOW_TEXT_FLOW> SfxItemSet aSet(rSh.GetAttrPool(), RES_FRM_SIZE, RES_FRM_SIZE, RES_VERT_ORIENT, RES_ANCHOR, @@ -1009,13 +960,12 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb ) SwRect aBoundRect; Point aRefPoint; - // OD 18.09.2003 #i18732# - adjustment for allowing vertical position - // aligned to page for fly frame anchored to paragraph or to character. + // adjustment for allowing vertical position + // aligned to page for fly frame anchored to paragraph or to character. { SwFmtVertOrient aVert( (SwFmtVertOrient&)aSet.Get(RES_VERT_ORIENT) ); const bool bFollowTextFlow = static_cast<const SwFmtFollowTextFlow&>(aSet.Get(RES_FOLLOW_TEXT_FLOW)).GetValue(); - // OD 12.11.2003 #i22341# - additional provide content position const SwPosition* pToCharCntntPos = ((SwFmtAnchor&)aSet.Get(RES_ANCHOR)).GetCntntAnchor(); rSh.CalcBoundRect( aBoundRect, eAnchorId, text::RelOrientation::FRAME, aVert.GetRelationOrient(), @@ -1034,12 +984,12 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb ) case MOVE_UP_BIG: case MOVE_UP_SMALL: aTmp.Top( aTmp.Top() - nUp ); break; case MOVE_RIGHT_SMALL: if( aTmp.Width() < aSnap.Width() + MINFLY ) break; - nRight = aSnap.Width(); // kein break + nRight = aSnap.Width(); // no break case MOVE_RIGHT_BIG: aTmp.Left( aTmp.Left() + nRight ); break; case MOVE_DOWN_SMALL: if( aTmp.Height() < aSnap.Height() + MINFLY ) break; - nDown = aSnap.Height(); // kein break + nDown = aSnap.Height(); // no break case MOVE_DOWN_BIG: aTmp.Top( aTmp.Top() + nDown ); break; - default: ASSERT( sal_True, "ChangeFly: Unknown direction." ); + default: OSL_ENSURE(true, "ChangeFly: Unknown direction." ); } sal_Bool bSet = sal_False; if ((FLY_AS_CHAR == eAnchorId) && ( nDir % 2 )) @@ -1133,16 +1083,13 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb ) rSh.EndAllAction(); } } -/* -----------------------------23.05.2002 11:35------------------------------ - ---------------------------------------------------------------------------*/ void SwEditWin::ChangeDrawing( sal_uInt8 nDir ) { - // --> OD 2005-01-31 #i40845# - start undo action in order to get only one + // start undo action in order to get only one // undo action for this change. SwWrtShell &rSh = rView.GetWrtShell(); rSh.StartUndo(); - // <-- long nX = 0; long nY = 0; @@ -1206,16 +1153,14 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir ) // if the object's position is not protected if(0 == (nProtect&FLYPROTECT_POS)) { - // --> FME 2005-04-26 #i47138# // Check if object is anchored as character and move direction sal_Bool bDummy1, bDummy2; const bool bVertAnchor = rSh.IsFrmVertical( sal_True, bDummy1, bDummy2 ); - const bool bHoriMove = !bVertAnchor == !( nDir % 2 ); - const bool bMoveAllowed = + bool bHoriMove = !bVertAnchor == !( nDir % 2 ); + bool bMoveAllowed = !bHoriMove || (rSh.GetAnchorId() != FLY_AS_CHAR); if ( bMoveAllowed ) { - // <-- pSdrView->MoveAllMarked(Size(nX, nY)); rSh.SetModified(); } @@ -1271,17 +1216,13 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir ) rSh.EndAllAction(); } - // --> OD 2005-01-31 #i40845# - end undo action rSh.EndUndo(); - // <-- } /*-------------------------------------------------------------------- - Beschreibung: KeyEvents + Description: KeyEvents --------------------------------------------------------------------*/ - - void SwEditWin::KeyInput(const KeyEvent &rKEvt) { if( rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE && @@ -1294,9 +1235,8 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) SfxObjectShell *pObjSh = (SfxObjectShell*)rView.GetViewFrame()->GetObjectShell(); if ( bLockInput || (pObjSh && pObjSh->GetProgress()) ) - // Wenn die Rechenleiste aktiv ist oder - // auf dem Document ein Progress laeuft wird keine - // Bestellungen angenommen. + // When the progress bar is active or a progress is + // running on a document, no order is being taken return; if( pShadCrsr ) @@ -1322,12 +1262,12 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) pQuickHlpData->Stop( rSh ); } - // OS:auch die DrawView braucht noch ein readonly-Flag + // OS:the DrawView also needs a readonly-Flag as well if ( !bIsDocReadOnly && rSh.GetDrawView() && rSh.GetDrawView()->KeyInput( rKEvt, this ) ) { rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll( sal_False ); rSh.SetModified(); - return; // Event von der SdrView ausgewertet + return; // Event evaluated by SdrView } if ( rView.GetDrawFuncPtr() && bInsFrm ) @@ -1341,11 +1281,28 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) sal_Bool bChkInsBlank = pQuickHlpData->bChkInsBlank; pQuickHlpData->bChkInsBlank = sal_False; +#if OSL_DEBUG_LEVEL > 1 + if (rKEvt.GetKeyCode().GetCode() == KEY_F12) + { + SwRootFrm* pLayout = GetView().GetDocShell()->GetWrtShell()->GetLayout(); + xmlTextWriterPtr writer = xmlNewTextWriterFilename("layout.xml", 0); + if (writer!=NULL) + { + printf("dumping layout in \"layout.xml\"\n"); + xmlTextWriterStartDocument(writer, NULL, NULL, NULL); + pLayout->dumpAsXml(writer); + xmlTextWriterEndDocument(writer); + xmlFreeTextWriter(writer); + } + return; + } +#endif + KeyEvent aKeyEvent( rKEvt ); // look for vertical mappings if( !bIsDocReadOnly && !rSh.IsSelFrmMode() && !rSh.IsObjSelected() ) { - //JP 21.2.2002: must changed from switch to if, because the Linux + // must changed from switch to if, because the Linux // compiler has problem with the code. Has to remove if the new general // handler exist. sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode(); @@ -1469,9 +1426,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) enum SW_KeyState { KS_Start, KS_CheckKey, KS_InsChar, KS_InsTab, KS_NoNum, KS_NumOff, KS_NumOrNoNum, KS_NumDown, KS_NumUp, - // -> #i23725# KS_NumIndentInc, KS_NumIndentDec, - // <- #i23725# KS_OutlineLvOff, KS_NextCell, KS_PrevCell, KS_OutlineUp, KS_OutlineDown, @@ -1509,20 +1464,16 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) KS_GotoPrevFieldMark, KS_Ende }; - - SW_KeyState eKeyState = bIsDocReadOnly ? KS_CheckDocReadOnlyKeys : KS_CheckKey, eNextKeyState = KS_Ende; sal_uInt8 nDir = 0; - // -> #i23725# if (nKS_NUMDOWN_Count > 0) nKS_NUMDOWN_Count--; if (nKS_NUMINDENTINC_Count > 0) nKS_NUMINDENTINC_Count--; - // <- #i23725# while( KS_Ende != eKeyState ) { @@ -1531,12 +1482,11 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) switch( eKeyState ) { case KS_CheckKey: - eKeyState = KS_KeyToView; // default weiter zur View + eKeyState = KS_KeyToView; // default forward to View -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // JP 19.01.99: zum Umschalten des Cursor Verhaltens in ReadOnly - // Bereichen + // for switching curor behaviour in ReadOnly regions if( 0x7210 == rKeyCode.GetFullCode() ) rSh.SetReadOnlyAvailable( !rSh.IsReadOnlyAvailable() ); else @@ -1545,16 +1495,16 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) if( !rKeyCode.IsMod2() && '=' == aCh && !rSh.IsTableMode() && rSh.GetTableFmt() && - rSh.IsSttPara() /*&& rSh.IsEndPara()*/ && + rSh.IsSttPara() && !rSh.HasReadonlySel() ) { - // in der Tabelle am Anfang der Zelle ein '=' -> - // EditZeile aufrufen (F2-Funktionalitaet) + // at the beginning of the table's cell a '=' -> + // call EditRow (F2-functionality) rSh.Push(); if( !rSh.MoveSection( fnSectionCurr, fnSectionStart) && !rSh.IsTableBoxTextFormat() ) { - // steht also am Anfang der Box + // is at the beginning of the box eKeyState = KS_EditFormula; if( rSh.HasMark() ) rSh.SwapPam(); @@ -1622,12 +1572,6 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) eFlyState = KS_Fly_Change; nDir = MOVE_DOWN_SMALL; goto KEYINPUT_CHECKTABLE; -// case KEY_UP | KEY_MOD2 | KEY_SHIFT: -// eKeyState = KS_ColTopBig; -// goto KEYINPUT_CHECKTABLE; -// case KEY_DOWN | KEY_MOD2 | KEY_SHIFT: -// eKeyState = KS_ColTopSmall; -// goto KEYINPUT_CHECKTABLE; case KEY_UP | KEY_MOD2 | KEY_MOD1: eKeyState = KS_CellBottomSmall; @@ -1678,7 +1622,6 @@ KEYINPUT_CHECKTABLE: nTblChgSize = pModOpt->GetTblVInsert(); } goto KEYINPUT_CHECKTABLE_INSDEL; -// case KEY_RIGHT: case KEY_RIGHT | KEY_MOD1: { eTblChgMode = nsTblChgWidthHeightType::WH_FLAG_INSDEL | nsTblChgWidthHeightType::WH_CELL_RIGHT; @@ -1721,7 +1664,7 @@ KEYINPUT_CHECKTABLE: KEYINPUT_CHECKTABLE_INSDEL: if( rSh.IsTableMode() || !rSh.GetTableFmt() || !bTblInsDelMode || - sal_False /* Tabelle geschuetzt */ + sal_False /* table protected */ ) { const int nSelectionType = rSh.GetSelectionType(); @@ -1745,9 +1688,17 @@ KEYINPUT_CHECKTABLE_INSDEL: break; case KEY_DELETE: - if (rSh.IsInFrontOfLabel() && - rSh.NumOrNoNum(sal_False)) - eKeyState = KS_NumOrNoNum; + if ( !rSh.HasReadonlySel() ) + { + if (rSh.IsInFrontOfLabel() && + rSh.NumOrNoNum(sal_False)) + eKeyState = KS_NumOrNoNum; + } + else + { + InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute(); + eKeyState = KS_Ende; + } break; case KEY_DELETE | KEY_MOD2: @@ -1789,7 +1740,7 @@ KEYINPUT_CHECKTABLE_INSDEL: aTmpQHD.bIsAutoText ) eKeyState = KS_GlossaryExpand; - //RETURN und leerer Absatz in Numerierung -> Num. beenden + //RETURN and empty paragraph in numbering -> end numbering else if( !aInBuffer.Len() && rSh.GetCurNumRule() && !rSh.GetCurNumRule()->IsOutlineRule() && @@ -1797,7 +1748,7 @@ KEYINPUT_CHECKTABLE_INSDEL: rSh.IsSttPara() && rSh.IsEndPara() ) eKeyState = KS_NumOff, eNextKeyState = KS_OutlineLvOff; - //RETURN fuer neuen Absatz mit AutoFormatierung + //RETURN for new paragraph with AutoFormating else if( pACfg && pACfg->IsAutoFmtByInput() && !(nSelectionType & (nsSelectionType::SEL_GRF | nsSelectionType::SEL_OLE | nsSelectionType::SEL_FRM | @@ -1820,28 +1771,24 @@ KEYINPUT_CHECKTABLE_INSDEL: case KEY_BACKSPACE | KEY_SHIFT: if( !rSh.HasReadonlySel() ) { - // #i23725# sal_Bool bDone = sal_False; - // --> OD 2006-01-31 - try to add comment for code snip: + // try to add comment for code snip: // Remove the paragraph indent, if the cursor is at the // beginning of a paragraph, there is no selection // and no numbering rule found at the current paragraph - // --> OD 2006-01-31 #b6341339#, #i58776# // Also try to remove indent, if current paragraph // has numbering rule, but isn't counted and only // key <backspace> is hit. const bool bOnlyBackspaceKey( KEY_BACKSPACE == rKeyCode.GetFullCode() ); if ( rSh.IsSttPara() && - !rSh.HasSelection() && // i40834 + !rSh.HasSelection() && ( NULL == rSh.GetCurNumRule() || ( rSh.IsNoNum() && bOnlyBackspaceKey ) ) ) { bDone = rSh.TryRemoveIndent(); } - // <-- - // -> #i23725# if (bDone) eKeyState = KS_Ende; else @@ -1863,10 +1810,7 @@ KEYINPUT_CHECKTABLE_INSDEL: bDone = sal_True; } } - // <- #i23725# - // --> OD 2006-01-31 #b6341339#, #i58776# - // --> OD 2006-04-21 #i63540# - // revise fix for issues b6341339 and i58776: + // If the cursor is in an empty paragraph, which has // a numbering, but not the oultine numbering, and // there is no selection, the numbering has to be @@ -1908,9 +1852,13 @@ KEYINPUT_CHECKTABLE_INSDEL: { eKeyState = KS_NumOrNoNum; } - // <-- } } + else + { + InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute(); + eKeyState = KS_Ende; + } break; case KEY_RIGHT: @@ -1935,11 +1883,8 @@ KEYINPUT_CHECKTABLE_INSDEL: if( rSh.GetCurNumRule() && rSh.IsSttOfPara() && !rSh.HasReadonlySel() ) { - // --> OD 2007-10-02 #b660435# -// if (rSh.IsFirstOfNumRule()) // #i23725# if ( rSh.IsFirstOfNumRule() && numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() ) - // <-- eKeyState = KS_NumIndentInc; else eKeyState = KS_NumDown; @@ -1966,10 +1911,9 @@ KEYINPUT_CHECKTABLE_INSDEL: { SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl(); if( pColl && - //0 <= pColl->GetOutlineLevel() && #i24560# - //MAXLEVEL - 1 > pColl->GetOutlineLevel() )//#outline level,zhaojianwei + pColl->IsAssignedToListLevelOfOutlineStyle() - && MAXLEVEL-1 > pColl->GetAssignedOutlineStyleLevel() )//<-end,zhaojianwei + && MAXLEVEL-1 > pColl->GetAssignedOutlineStyleLevel() ) eKeyState = KS_OutlineDown; } } @@ -1990,11 +1934,9 @@ KEYINPUT_CHECKTABLE_INSDEL: else if( rSh.GetCurNumRule() && rSh.IsSttOfPara() && !rSh.HasReadonlySel() ) { - // --> OD 2007-10-02 #b660435# -// if (rSh.IsFirstOfNumRule()) // #i23725# + if ( rSh.IsFirstOfNumRule() && numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() ) - // <-- eKeyState = KS_NumIndentDec; else eKeyState = KS_NumUp; @@ -2020,8 +1962,6 @@ KEYINPUT_CHECKTABLE_INSDEL: if( rSh.IsSttOfPara() && !rSh.HasReadonlySel() ) { SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl(); - //if( pColl && 0 < pColl->GetOutlineLevel() && //#outline level,zhaojianwei - // MAXLEVEL - 1 >= pColl->GetOutlineLevel() ) if( pColl && pColl->IsAssignedToListLevelOfOutlineStyle() && 0 < pColl->GetAssignedOutlineStyleLevel()) @@ -2039,7 +1979,7 @@ KEYINPUT_CHECKTABLE_INSDEL: { if( aTmpQHD.HasCntnt() && !rSh.HasSelection() ) { - // zum naechsten Tip + // to the next Tip aTmpQHD.Inc( pACorr && pACorr->GetSwFlags(). bAutoCmpltEndless ); eKeyState = KS_NextPrevGlossary; @@ -2062,7 +2002,7 @@ KEYINPUT_CHECKTABLE_INSDEL: if( aTmpQHD.HasCntnt() && !rSh.HasSelection() && !rSh.HasReadonlySel() ) { - // zum vorherigen Tip + // to the previous Tip aTmpQHD.Dec( pACorr && pACorr->GetSwFlags(). bAutoCmpltEndless ); eKeyState = KS_NextPrevGlossary; @@ -2172,13 +2112,12 @@ KEYINPUT_CHECKTABLE_INSDEL: bFlushBuffer = sal_True, bNormalChar = sal_False; else { -// OS 22.09.95: Da der Sfx Acceleratoren nur aufruft, wenn sie beim letzten -// Statusupdate enabled wurden, muss copy ggf. von uns -// 'gewaltsam' gerufen werden. + // Because Sfx accelerators are only called when they were + // enabled at the last status update, copy has to called + // 'forcefully' by us if necessary. if( rKeyCode.GetFunction() == KEYFUNC_COPY ) GetView().GetViewFrame()->GetBindings().Execute(SID_COPY); - if( !bIsDocReadOnly && bNormalChar ) { const int nSelectionType = rSh.GetSelectionType(); @@ -2245,15 +2184,15 @@ KEYINPUT_CHECKTABLE_INSDEL: } break; case KS_InsTab: - if( rView.ISA( SwWebView )) //Kein Tabulator fuer Web! + if( rView.ISA( SwWebView )) // no Tab for WebView { - // Bug 56196 - dann sollte der weiter gereicht werden. + // then it should be passed along Window::KeyInput( aKeyEvent ); eKeyState = KS_Ende; break; } aCh = '\t'; - // kein break! + // no break! case KS_InsChar: if (rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT) { @@ -2293,13 +2232,11 @@ KEYINPUT_CHECKTABLE_INSDEL: if( bChkInsBlank && bIsNormalChar && (aInBuffer.Len() || !rSh.IsSttPara() || !rSh.IsEndPara() )) { - // vor dem Zeichen noch ein Blank einfuegen. Dieses - // kommt zwischen den Expandierten Text und dem neuen - // "nicht Worttrenner". + // insert a blank ahead of the character. this ends up + // between the expanded text and the new "non-word-seperator". aInBuffer.Expand( aInBuffer.Len() + 1, ' ' ); } - sal_Bool bIsAutoCorrectChar = SvxAutoCorrect::IsAutoCorrectChar( aCh ); sal_Bool bRunNext = pACorr && pACorr->HasRunNext(); if( !aKeyEvent.GetRepeat() && pACorr && ( bIsAutoCorrectChar || bRunNext ) && @@ -2311,7 +2248,7 @@ KEYINPUT_CHECKTABLE_INSDEL: { FlushInBuffer(); rSh.AutoCorrect( *pACorr, aCh ); - if( '\"' != aCh && '\'' != aCh ) // nur bei "*_" rufen! + if( '\"' != aCh && '\'' != aCh ) // only call when "*_"! rSh.UpdateAttr(); } else if( !aKeyEvent.GetRepeat() && pACorr && ( bIsAutoCorrectChar || bRunNext ) && @@ -2339,7 +2276,6 @@ KEYINPUT_CHECKTABLE_INSDEL: else { InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute(); - // ??? Window::KeyInput( aKeyEvent ); eKeyState = KS_Ende; } break; @@ -2352,12 +2288,6 @@ KEYINPUT_CHECKTABLE_INSDEL: ChgToEnEmDash | SetINetAttr | Autocorrect ) && !rSh.HasReadonlySel() ) - /* { - pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd | - ChgFractionSymbol | ChgOrdinalNumber | - ChgToEnEmDash | SetINetAttr | - Autocorrect ) && - !rSh.HasReadonlySel() ) */ { FlushInBuffer(); rSh.AutoCorrect( *pACorr, static_cast< sal_Unicode >('\0') ); @@ -2370,8 +2300,6 @@ KEYINPUT_CHECKTABLE_INSDEL: { sal_uInt16 nSlotId = 0; FlushInBuffer(); -//??? if( bFlushCharBuffer ) -//??? FlushInBuffer( &rSh ); switch( eKeyState ) { case KS_SpecialInsert: @@ -2383,7 +2311,7 @@ KEYINPUT_CHECKTABLE_INSDEL: break; case KS_NumOff: - // Shellwechsel - also vorher aufzeichnen + // shell change - so record in advance rSh.DelNumRules(); eKeyState = eNextKeyState; break; @@ -2392,17 +2320,14 @@ KEYINPUT_CHECKTABLE_INSDEL: case KS_NumDown: rSh.NumUpDown( sal_True ); - nKS_NUMDOWN_Count = 2; // #i23725# + nKS_NUMDOWN_Count = 2; break; case KS_NumUp: rSh.NumUpDown( sal_False ); break; - // -> #i23726# case KS_NumIndentInc: - // --> OD 2008-06-16 #i90078# rSh.ChangeIndentOfAllListLevels(360); - // <-- nKS_NUMINDENTINC_Count = 2; break; @@ -2421,11 +2346,8 @@ KEYINPUT_CHECKTABLE_INSDEL: break; case KS_NumIndentDec: - // --> OD 2008-06-16 #i90078# rSh.ChangeIndentOfAllListLevels(-360); - // <-- break; - // <- #i23726# case KS_OutlineDown: rSh.OutlineUpDown( 1 ); @@ -2435,7 +2357,7 @@ KEYINPUT_CHECKTABLE_INSDEL: break; case KS_NextCell: - //In Tabelle immer 'flushen' + // always 'flush' in tables rSh.GoNextCell(); nSlotId = FN_GOTO_NEXT_CELL; break; @@ -2447,8 +2369,6 @@ KEYINPUT_CHECKTABLE_INSDEL: rSh.SplitNode( sal_True ); break; -// case KS_NumOrNoNum: -// break; case KS_NextObject: case KS_PrevObject: if(rSh.GotoObj( KS_NextObject == eKeyState, GOTOOBJ_GOTO_ANY)) @@ -2467,7 +2387,7 @@ KEYINPUT_CHECKTABLE_INSDEL: break; case KS_GlossaryExpand: { - // ersetze das Wort oder Kuerzel durch den den Textbaustein + // replace the word or abbreviation with the auto text rSh.StartUndo( UNDO_START ); String sFnd( *aTmpQHD.aArr[ aTmpQHD.nCurArrPos ] ); @@ -2518,9 +2438,7 @@ KEYINPUT_CHECKTABLE_INSDEL: case KS_ColRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break; case KS_ColLeftSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_LEFT, pModOpt->GetTblHMove() ); break; case KS_ColRightSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_RIGHT, pModOpt->GetTblHMove() ); break; -// case KS_ColTopBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_TOP|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break; case KS_ColBottomBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_BOTTOM|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break; -// case KS_ColTopSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_TOP, pModOpt->GetTblVMove() ); break; case KS_ColBottomSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_BOTTOM, pModOpt->GetTblVMove() ); break; case KS_CellLeftBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_LEFT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break; case KS_CellRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break; @@ -2583,16 +2501,16 @@ KEYINPUT_CHECKTABLE_INSDEL: bTblInsDelMode = sal_False; } - // falls die gepufferten Zeichen eingefuegt werden sollen + // in case the buffered characters are inserted if( bFlushBuffer && aInBuffer.Len() ) { - //OS 16.02.96 11.04: bFlushCharBuffer wurde hier nicht zurueckgesetzt - // warum nicht? + // bFlushCharBuffer was not resetted here + // why not? sal_Bool bSave = bFlushCharBuffer; FlushInBuffer(); bFlushCharBuffer = bSave; - // evt. Tip-Hilfe anzeigen + // maybe show Tip-Help String sWord; if( bNormalChar && pACfg && pACorr && ( pACfg->IsAutoTextTip() || @@ -2605,23 +2523,20 @@ KEYINPUT_CHECKTABLE_INSDEL: } /*-------------------------------------------------------------------- - Beschreibung: MouseEvents + Description: MouseEvents --------------------------------------------------------------------*/ - void SwEditWin::RstMBDownFlags() { - //Nicht auf allen Systemen kommt vor dem modalen - //Dialog noch ein MouseButton Up (wie unter WINDOWS). - //Daher hier die Stati zuruecksetzen und die Maus - //fuer den Dialog freigeben. + // Not on all systems a MouseButtonUp is used ahead + // of the modal dialog (like on WINDOWS). + // So reset the statuses here and release the mouse + // for the dialog. bMBPressed = bNoInterrupt = sal_False; EnterArea(); ReleaseMouse(); } - - void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) { SwWrtShell &rSh = rView.GetWrtShell(); @@ -2632,7 +2547,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) // opened by inplace client and we would deactivate the inplace client, // the contex menu is closed by VCL asynchronously which in the end // would work on deleted objects or the context menu has no parent anymore) - // See #126086# and #128122# SfxInPlaceClient* pIPClient = rSh.GetSfxViewShell()->GetIPClient(); sal_Bool bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() ); @@ -2674,8 +2588,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) return; } - //Nach GrabFocus sollte eine Shell gepusht sein. Das muss eigentlich - //klappen aber in der Praxis ... + // After GrabFocus a shell should be pushed. That should actually + // work but in practice ... lcl_SelectShellForDrop( rView ); sal_Bool bIsDocReadOnly = rView.GetDocShell()->IsReadOnly(); @@ -2686,7 +2600,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) pQuickHlpData->bChkInsBlank = sal_False; if( rSh.FinishOLEObj() ) - return; //InPlace beenden und der Klick zaehlt nicht mehr + return; // end InPlace and the click doesn't count anymore SET_CURR_SHELL( &rSh ); @@ -2696,11 +2610,10 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if (pSdrView->MouseButtonDown( rMEvt, this ) ) { rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False); - return; // Event von der SdrView ausgewertet + return; // SdrView's event evaluated } } - bIsInMove = sal_False; aStartPos = rMEvt.GetPosPixel(); aRszMvHdlPt.X() = 0, aRszMvHdlPt.Y() = 0; @@ -2712,7 +2625,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) 0 != (nMouseTabCol = rSh.WhichMouseTabCol( aDocPos ) ) && !rSh.IsObjSelectable( aDocPos ) ) { - // --> FME 2004-07-30 #i32329# Enhanced table selection if ( SW_TABSEL_HORI <= nMouseTabCol && SW_TABCOLSEL_VERT >= nMouseTabCol ) { rSh.EnterStdMode(); @@ -2728,11 +2640,10 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } return; } - // <-- if ( !rSh.IsTableMode() ) { - //Zuppeln von Tabellenspalten aus dem Dokument heraus. + // comes from table columns out of the document. if(SW_TABCOL_VERT == nMouseTabCol || SW_TABCOL_HORI == nMouseTabCol) rView.SetTabColFromDoc( sal_True ); else @@ -2757,7 +2668,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } } } - // #i23726# else if (bTmp && rSh.IsNumLabel(aDocPos)) { @@ -2767,10 +2677,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) SfxBindings& rBind = rView.GetViewFrame()->GetBindings(); rBind.Update(); - // --> OD 2005-02-21 #i42921# if ( RulerMarginDrag( rMEvt, rSh.IsVerticalModeAtNdAndPos( *pNodeAtPos, aDocPos ) ) ) - // <-- { rView.SetNumRuleNodeFromDoc( NULL ); rView.InvalidateRulerPos(); @@ -2779,35 +2687,33 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } else { - // --> FME 2005-11-03 #125036# Make sure the pointer is set to 0, + // Make sure the pointer is set to 0, // otherwise it may point to nowhere after deleting the corresponding // text node. rView.SetNumRuleNodeFromDoc( NULL ); - // <-- return; } } - //Man kann sich in einem Selektionszustand befinden, wenn zuletzt - //mit dem Keyboard selektiert wurde, aber noch kein CURSOR_KEY - //anschliessend bewegt worden ist. In diesem Fall muss die vorher- - //gehende Selektion zuerst beendet werden. - //MA 07. Oct. 95: Und zwar nicht nur bei Linker Maustaste sondern immer. - //siehe auch Bug: 19263 + // One can be in a selection state when recently the keyboard was + // used to select but no CURSOR_KEY was moved yet after that. In + // that case the previous selction has to be finished first. + // MA 07. Oct. 95: Not only with left mouse button but always. + // also see Bug: 19263 if ( rSh.IsInSelect() ) rSh.EndSelect(); - //Abfrage auf LEFT, da sonst auch bei einem Click mit der rechten Taste - //beispielsweise die Selektion aufgehoben wird. + // query against LEFT because otherwise for example also a right + // click releases the selection. if ( MOUSE_LEFT == rMEvt.GetButtons() ) { sal_Bool bOnlyText = sal_False; bMBPressed = bNoInterrupt = sal_True; - nKS_NUMDOWN_Count = 0; // #i23725# + nKS_NUMDOWN_Count = 0; CaptureMouse(); - //ggf. Cursorpositionen zuruecksetzen + // reset curor position if applicable rSh.ResetCursorStack(); switch ( rMEvt.GetModifier() + rMEvt.GetButtons() ) @@ -2840,7 +2746,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rSh.Edit(); } - // Ohne SHIFT, da sonst Toggle bei Selektion nicht funktioniert + // Without SHIFT because otherwise Toggle doesn't work at selection if (rMEvt.GetClicks() == 1) { if ( rSh.IsSelFrmMode()) @@ -2855,7 +2761,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rSh.EnterSelFrmMode( &aDocPos ); if ( !pApplyTempl ) { - //nur, wenn keine Position zum Sizen getroffen ist. + // only if no position to size was hit. if (!bHitHandle) { StartDDTimer(); @@ -2881,11 +2787,9 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) bExecHyperlinks = sal_True; } - // --> FME 2004-07-30 #i32329# Enhanced selection sal_uInt8 nNumberOfClicks = static_cast< sal_uInt8 >(rMEvt.GetClicks() % 4); if ( 0 == nNumberOfClicks && 0 < rMEvt.GetClicks() ) nNumberOfClicks = 4; - // <-- sal_Bool bExecDrawTextLink = sal_False; @@ -2902,7 +2806,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) SwEditWin::nDDStartPosY = aDocPos.Y(); SwEditWin::nDDStartPosX = aDocPos.X(); - // URL in DrawText-Objekt getroffen? + // hit an URL in DrawText object? if (bExecHyperlinks && pSdrView) { SdrViewEvent aVEvt; @@ -2912,13 +2816,12 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) bExecDrawTextLink = sal_True; } - //Rahmen nur zu selektieren versuchen, wenn - //der Pointer bereits entsprechend geschaltet wurde + // only try to select frame, if pointer already was + // switched accordingly if ( aActHitType != SDRHIT_NONE && !rSh.IsSelFrmMode() && !GetView().GetViewFrame()->GetDispatcher()->IsLocked() && !bExecDrawTextLink) { - // #107513# // Test if there is a draw object at that position and if it should be selected. sal_Bool bShould = rSh.ShouldObjectBeSelected(aDocPos); @@ -2936,9 +2839,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if( bSelObj ) { - // falls im Macro der Rahmen deselektiert - // wurde, muss nur noch der Cursor - // wieder angezeigt werden. + // if the frame was deselected in the macro + // the cursor just has to be displayed again if( FRMTYPE_NONE == rSh.GetSelFrmType() ) rSh.ShowCrsr(); else @@ -3002,9 +2904,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if( !bSelObj ) { - // Cursor hier umsetzen, damit er nicht zuerst - // im Rahmen gezeichnet wird; ShowCrsr() geschieht - // in LeaveSelFrmMode() + // move cursor here so that it is not drawn in the + // frame first; ShowCrsr() happens in LeaveSelFrmMode() bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False)); rSh.LeaveSelFrmMode(); rView.AttrChangedNotify( &rSh ); @@ -3039,7 +2940,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if ( !bIsDocReadOnly && rSh.IsInsideSelectedObj(aDocPos) && 0 == rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) ) -/* SJ: 01.03.2005: this is no good, on the one hand GetSelectionType is used as flag field (take a look into the GetSelectionType method) +/* this is no good, on the one hand GetSelectionType is used as flag field (take a look into the GetSelectionType method) on the other hand the return value is used in a switch without proper masking (very nice), this must lead to trouble */ switch ( rSh.GetSelectionType() &~ ( nsSelectionType::SEL_FONTWORK | nsSelectionType::SEL_EXTRUDED_CUSTOMSHAPE ) ) @@ -3051,7 +2952,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) SFX_CALLMODE_RECORD|SFX_CALLMODE_SLOT); return; - // Doppelklick auf OLE-Objekt --> OLE-InPlace + // double click on OLE object --> OLE-InPlace case nsSelectionType::SEL_OLE: if (!rSh.IsSelObjProtected(FLYPROTECT_CONTENT)) { @@ -3074,9 +2975,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) return; } - //falls die Cursorposition korrigiert wurde oder - // ein Fly im ReadOnlyModus selektiert ist, - //keine Wortselektion. + // if the cursor position was corrected or if a Fly + // was selected in ReadOnlyMode, no word selection. if ( !bValidCrsrPos || (rSh.IsFrmSelected() && rSh.IsFrmSelected() )) return; @@ -3100,8 +3000,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) case TYP_POSTITFLD: case TYP_SCRIPTFLD: { - //falls es ein Readonly-Bereich ist, dann muss der Status - //enabled werden + // if it's a Readonly region, status has to be enabled sal_uInt16 nSlot = TYP_POSTITFLD == nTypeId ? FN_POSTIT : FN_JAVAEDIT; SfxBoolItem aItem(nSlot, sal_True); pVFrame->GetBindings().SetState(aItem); @@ -3117,12 +3016,12 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } return; } - //im Extended Mode hat Doppel- und - //Dreifachklick keine Auswirkungen. + // in extended mode double and triple + // click has no effect. if ( rSh.IsExtMode() || rSh.IsBlockMode() ) return; - //Wort selektieren, gfs. Additional Mode + // select work, AdditionalMode if applicable if ( KEY_MOD1 == rMEvt.GetModifier() && !rSh.IsAddMode() ) { rSh.EnterAddMode(); @@ -3138,30 +3037,27 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) case 4: { bFrmDrag = sal_False; - //im Extended Mode hat Doppel- und - //Dreifachklick keine Auswirkungen. + // in extended mode double and triple + // click has no effect. if ( rSh.IsExtMode() ) return; - //falls die Cursorposition korrigiert wurde oder - // ein Fly im ReadOnlyModus selektiert ist, - //keine Wortselektion. + // if the cursor position was corrected or if a Fly + // was selected in ReadOnlyMode, no word selection. if ( !bValidCrsrPos || rSh.IsFrmSelected() ) return; - //Zeile selektieren, gfs. Additional Mode + // select line, AdditionalMode if applicable const bool bMod = KEY_MOD1 == rMEvt.GetModifier() && !rSh.IsAddMode(); if ( bMod ) rSh.EnterAddMode(); - // --> FME 2004-07-30 #i32329# Enhanced selection if ( 3 == nNumberOfClicks ) rSh.SelSentence( &aDocPos ); else rSh.SelPara( &aDocPos ); - // <-- if ( bMod ) rSh.LeaveAddMode(); @@ -3317,8 +3213,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } if ( !rSh.IsExtMode() ) { - // keine Selection anfangen, wenn in ein URL- - // Feld oder eine -Grafik geklickt wird + // don't start a selection when an + // URL field or a graphic is clicked sal_Bool bSttSelect = rSh.HasSelection() || Pointer(POINTER_REFHAND) != GetPointer(); @@ -3386,15 +3282,15 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) int nTmpSetCrsr = 0; - { // nur temp. Move-Kontext aufspannen, da sonst die - // Abfrage auf die Inhaltsform nicht funktioniert!!! + { // only temporary generate Move-Kontext because otherwise + // the query to the content form doesn't work!!! MV_KONTEXT( &rSh ); nTmpSetCrsr = (rSh.*rSh.fnSetCrsr)(&aDocPos,bOnlyText); bValidCrsrPos = !(CRSR_POSCHG & nTmpSetCrsr); bCallBase = sal_False; } - //#i42732# - notify the edit window that from now on we do not use the input language + // notify the edit window that from now on we do not use the input language if ( !(CRSR_POSOLD & nTmpSetCrsr) ) SetUseInputLanguage( sal_False ); @@ -3406,13 +3302,11 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if ( !bOverURLGrf && !bOnlyText ) { const int nSelType = rSh.GetSelectionType(); - // --> OD 2009-12-30 #i89920# // Check in general, if an object is selectable at given position. // Thus, also text fly frames in background become selectable via Ctrl-Click. if ( nSelType & nsSelectionType::SEL_OLE || nSelType & nsSelectionType::SEL_GRF || rSh.IsObjSelectable( aDocPos ) ) - // <-- { MV_KONTEXT( &rSh ); if( !rSh.IsFrmSelected() ) @@ -3421,11 +3315,9 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) bCallBase = sal_False; } } - // nicht mehr hier zuruecksetzen, damit -- falls durch MouseMove - // bei gedrueckter Ctrl-Taste eine Mehrfachselektion erfolgen soll, - // im Drag nicht die vorherige Selektion aufgehoben wird. -// if(bModePushed) -// rSh.PopMode(sal_False); + // don't reset here any longer so that, in case through MouseMove + // with pressed Ctrl key a multiple-selection should happen, + // the previous selection is not released in Drag. break; } } @@ -3435,10 +3327,9 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } /*-------------------------------------------------------------------- - Beschreibung: MouseMove + Description: MouseMove --------------------------------------------------------------------*/ - void SwEditWin::MouseMove(const MouseEvent& _rMEvt) { MouseEvent rMEvt(_rMEvt); @@ -3452,8 +3343,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) _rMEvt.GetMode(), _rMEvt.GetButtons() ); } - // solange eine Action laeuft sollte das MouseMove abgeklemmt sein - // Ansonsten gibt es den Bug 40102 + // as long as an action is running the MouseMove should be disconnected + // otherwise bug 40102 occurs SwWrtShell &rSh = rView.GetWrtShell(); if( rSh.ActionPend() ) return ; @@ -3465,8 +3356,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) SET_CURR_SHELL( &rSh ); - //aPixPt == Point in Pixel, rel. zu ChildWin - //aDocPt == Point in Twips, Dokumentkoordinaten + //aPixPt == Point in Pixel, relative to ChildWin + //aDocPt == Point in Twips, document coordinates const Point aPixPt( rMEvt.GetPosPixel() ); const Point aDocPt( PixelToLogic( aPixPt ) ); @@ -3486,24 +3377,11 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if ( !bIsDocReadOnly && pSdrView && pSdrView->MouseMove(rMEvt,this) ) { SetPointer( POINTER_TEXT ); - return; // Event von der SdrView ausgewertet + return; // evaluate SdrView's event } const Point aOldPt( rSh.VisArea().Pos() ); -#ifdef TEST_FOR_BUG91313 - // n Pixel as FUZZY border - SwRect aVis( rSh.VisArea() ); - Size aFuzzySz( 2, 2 ); - aFuzzySz = PixelToLogic( aFuzzySz ); - - aVis.Top( aVis.Top() + aFuzzySz.Height() ); - aVis.Bottom( aVis.Bottom() - aFuzzySz.Height() ); - aVis.Left( aVis.Left() + aFuzzySz.Width() ); - aVis.Right( aVis.Right() - aFuzzySz.Width() ); - const sal_Bool bInsWin = aVis.IsInside( aDocPt ); -#else const sal_Bool bInsWin = rSh.VisArea().IsInside( aDocPt ); -#endif if( pShadCrsr && !bInsWin ) delete pShadCrsr, pShadCrsr = 0; @@ -3516,14 +3394,14 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) return; } - // Position ist noetig fuer OS/2, da dort nach einem MB-Down - // offensichtlich sofort ein MB-Move gerufen wird. + // position is necessary for OS/2 because obviously after a MB-Down + // a MB-Move is called immediately. if( bDDTimerStarted ) { Point aDD( SwEditWin::nDDStartPosX, SwEditWin::nDDStartPosY ); aDD = LogicToPixel( aDD ); Rectangle aRect( aDD.X()-3, aDD.Y()-3, aDD.X()+3, aDD.Y()+3 ); - if ( !aRect.IsInside( aPixPt ) ) // MA 23. May. 95: Tatterschutz. + if ( !aRect.IsInside( aPixPt ) ) StopDDTimer( &rSh, aDocPt ); } @@ -3584,7 +3462,6 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) nPointer = POINTER_HSIZEBAR; bChkTblSel = true; break; - // --> FME 2004-07-30 #i20126# Enhanced table selection case SW_TABSEL_HORI : nPointer = POINTER_TAB_SELECT_SE; break; @@ -3603,31 +3480,26 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) case SW_TABCOLSEL_VERT : nPointer = POINTER_TAB_SELECT_W; break; - // <-- } if ( USHRT_MAX != nPointer && - // --> FME 2004-10-20 #i35543# - // Enhanced table selection is explicitely allowed in table mode + // i#35543 - Enhanced table selection is explicitely allowed in table mode ( !bChkTblSel || !rSh.IsTableMode() ) ) - // <-- { SetPointer( nPointer ); } return; } - // #i23726# else if (rSh.IsNumLabel(aDocPt, RULER_MOUSE_MARGINWIDTH)) { - // --> OD 2005-02-21 #i42921# - consider vertical mode + // i#42921 - consider vertical mode SwTxtNode* pNodeAtPos = rSh.GetNumRuleNodeAtPos( aDocPt ); const sal_uInt16 nPointer = rSh.IsVerticalModeAtNdAndPos( *pNodeAtPos, aDocPt ) ? POINTER_VSIZEBAR : POINTER_HSIZEBAR; SetPointer( nPointer ); - // <-- return; } @@ -3649,10 +3521,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) // So the pAnchorMarker has to find the right SdrHdl, if it's // the old one, it will find it with position aOld, if this one // is destroyed, it will find a new one at position GetHdlPos(). - // --> OD 2010-09-16 #i114522# -// const Point aOld = pAnchorMarker->GetPos(); + const Point aOld = pAnchorMarker->GetPosForHitTest( *(rSh.GetOut()) ); - // <-- Point aNew = rSh.FindAnchorPos( aDocPt ); SdrHdl* pHdl; if( (0!=( pHdl = pSdrView->PickHandle( aOld ) )|| @@ -3665,7 +3535,6 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) { pAnchorMarker->SetPos( aNew ); pAnchorMarker->SetLastPos( aDocPt ); - //OLMpSdrView->RefreshAllIAOManagers(); } } else @@ -3705,7 +3574,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if ( bIsInMove || IsMinMove( aStartPos, aPixPt ) ) { - // Event-Verarbeitung fuers Resizen + // event processing for resizing if( pSdrView->AreObjectsMarked() ) { const SwFrmFmt* pFlyFmt; @@ -3713,7 +3582,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) const Point aSttPt( PixelToLogic( aStartPos ) ); - // geht es los? + // can we start? if( HDL_USER == eSdrMoveHdl ) { SdrHdl* pHdl = pSdrView->PickHandle( aSttPt ); @@ -3727,9 +3596,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if( 0 != ( pFlyFmt = rSh.GetFlyFrmFmt() ) && 0 != ( pMacro = pFlyFmt->GetMacro().GetMacroTable(). Get( nEvent )) && -// oder nur z.B. alle 20 Twip bescheid sagen? -// ( 20 > Abs( aRszMvHdlPt.X() - aDocPt.X() ) || -// 20 > Abs( aRszMvHdlPt.Y() - aDocPt.Y() ) ) +// or notify only e.g. every 20 Twip? aRszMvHdlPt != aDocPt ) { aRszMvHdlPt = aDocPt; @@ -3764,7 +3631,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) return ; } } - // Event-Verarbeitung fuers Resizen + // event processing for resizing if( bIsDocReadOnly ) break; @@ -3815,9 +3682,6 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) } else { - //JP 24.09.98: Fix fuer die Bugs 55592 / 55931 - //JP 23.04.99: Fix fuer den Bugs 65289 - //JP 06.07.99: Fix fuer den Bugs 67360 if( !rMEvt.IsSynthetic() && !(( MOUSE_LEFT + KEY_MOD1 == rMEvt.GetModifier() + rMEvt.GetButtons() ) && @@ -3836,10 +3700,10 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) { if ( pApplyTempl ) { - UpdatePointer(aDocPt, 0); // evtl. muss hier ein Rahmen markiert werden + UpdatePointer(aDocPt, 0); // maybe a frame has to be marked here break; } - //#i6193#, change ui if mouse is over SwPostItField + // change ui if mouse is over SwPostItField // TODO: do the same thing for redlines SW_REDLINE SwRect aFldRect; SwContentAtPos aCntntAtPos( SwContentAtPos::SW_FIELD); @@ -3889,14 +3753,14 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) aSaveCallEvent.Set( EVENT_OBJECT_URLITEM, pFmt ); } - // sollte wir ueber einem InternetFeld mit einem - // gebundenen Macro stehen? + // should be be over a InternetField with an + // embedded macro? if( aSaveCallEvent != aLastCallEvent ) { if( aLastCallEvent.HasEvent() ) rSh.CallEvent( SFX_EVENT_MOUSEOUT_OBJECT, aLastCallEvent, sal_True ); - // 0 besagt, das das Object gar keine Tabelle hat + // 0 says that the object doesn't have any table if( !rSh.CallEvent( SFX_EVENT_MOUSEOVER_OBJECT, aSaveCallEvent )) aSaveCallEvent.Clear(); @@ -3904,7 +3768,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) } else if( aLastCallEvent.HasEvent() ) { - // Cursor stand auf einem Object + // cursor was on an object rSh.CallEvent( SFX_EVENT_MOUSEOUT_OBJECT, aLastCallEvent, sal_True ); } @@ -3948,10 +3812,9 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) } /*-------------------------------------------------------------------- - Beschreibung: Button Up + Description: Button Up --------------------------------------------------------------------*/ - void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) { sal_Bool bCallBase = sal_True; @@ -3965,9 +3828,9 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) DELETEZ( pRowColumnSelectionStart ); SdrHdlKind eOldSdrMoveHdl = eSdrMoveHdl; - eSdrMoveHdl = HDL_USER; // fuer die MoveEvents - wieder zuruecksetzen + eSdrMoveHdl = HDL_USER; // for MoveEvents - reset again - // sicherheitshalber zuruecksetzen Bug 27900 + // preventively reset rView.SetTabColFromDoc( sal_False ); rView.SetNumRuleNodeFromDoc(NULL); @@ -3981,16 +3844,15 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if ( pSdrView->MouseButtonUp( rMEvt,this ) ) { rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False); - return; // Event von der SdrView ausgewertet + return; // SdrView's event evaluated } } - //MouseButtonUp nur bearbeiten, wenn auch das Down an dieses Fenster ging. + // only process MouseButtonUp when the Down went to that windows as well. if ( !bMBPressed ) { -// OS 25.02.97 Undo fuer die Giesskann ist bereits im CommandHdl -//JP 29.09.95: so sollte es sein!!! if(pApplyTempl->bUndo) -// if( pApplyTempl && MOUSE_RIGHT == rMEvt.GetModifier() + rMEvt.GetButtons() ) -// rSh.Do( SwWrtShell::UNDO ); +// Undo for the watering can is already in CommandHdl +// that's the way it should be! + return; } @@ -4013,7 +3875,6 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if( pAnchorMarker ) { Point aPnt( pAnchorMarker->GetLastPos() ); - //OLMpSdrView->RefreshAllIAOManagers(); DELETEZ( pAnchorMarker ); if( aPnt.X() || aPnt.Y() ) rSh.FindAnchorPos( aPnt, sal_True ); @@ -4022,7 +3883,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) { if ( rView.GetDrawFuncPtr()->MouseButtonUp( rMEvt ) ) { - if (rView.GetDrawFuncPtr()) // Koennte im MouseButtonUp zerstoert worden sein + if (rView.GetDrawFuncPtr()) // could have been destroyed in MouseButtonUp { rView.GetDrawFuncPtr()->Deactivate(); @@ -4056,7 +3917,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) rView.AttrChangedNotify( &rSh ); } else if (rMEvt.GetButtons() == MOUSE_RIGHT && rSh.IsDrawCreate()) - rView.GetDrawFuncPtr()->BreakCreate(); // Zeichnen abbrechen + rView.GetDrawFuncPtr()->BreakCreate(); // abort drawing bNoInterrupt = sal_False; ReleaseMouse(); @@ -4085,9 +3946,9 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) case MOUSE_LEFT + KEY_SHIFT + KEY_MOD1: if ( bFrmDrag && rSh.IsSelFrmMode() ) { - if ( rMEvt.IsMod1() ) //Kopieren und nicht moven. + if ( rMEvt.IsMod1() ) // copy and don't move. { - //Drag abbrechen, statt dessen internes Copy verwenden + // abort drag, use internal Copy instead Rectangle aRect; rSh.GetDrawView()->TakeActionRect( aRect ); if (!aRect.IsEmpty()) @@ -4181,8 +4042,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if( bHoldSelection ) { - //JP 27.04.99: Bug 65389 - das EndDrag sollte auf jedenfall - // gerufen werden. + // the EndDrag should be called in any case bHoldSelection = sal_False; (rSh.*rSh.fnEndDrag)( &aDocPt, sal_False ); } @@ -4192,8 +4052,8 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) { const sal_Bool bTmpNoInterrupt = bNoInterrupt; bNoInterrupt = sal_False; - { // nur temp. Move-Kontext aufspannen, da sonst die - // Abfrage auf die Inhaltsform nicht funktioniert!!! + { // create only temporary move context because otherwise + // the query to the content form doesn't work!!! MV_KONTEXT( &rSh ); const Point aDocPos( PixelToLogic( aStartPos ) ); bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False)); @@ -4206,9 +4066,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) sal_Bool bInSel = rSh.IsInSelect(); (rSh.*rSh.fnEndDrag)( &aDocPt, sal_False ); - // Internetfield? --> Link-Callen (DocLaden!!) -//JP 18.10.96: Bug 32437 - -// if( !rSh.HasSelection() ) + // Internetfield? --> call link (load doc!!) if( !bInSel ) { sal_uInt16 nFilter = URLLOAD_NOFILTER; @@ -4255,19 +4113,17 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) } else if ( SwContentAtPos::SW_FORMCTRL == aCntntAtPos.eCntntAtPos ) { - ASSERT( aCntntAtPos.aFnd.pFldmark != NULL, "where is my field ptr???"); + OSL_ENSURE( aCntntAtPos.aFnd.pFldmark != NULL, "where is my field ptr???"); if ( aCntntAtPos.aFnd.pFldmark != NULL) { IFieldmark *fieldBM = const_cast< IFieldmark* > ( aCntntAtPos.aFnd.pFldmark ); - //SwDocShell* pDocSh = rView.GetDocShell(); - //SwDoc *pDoc=pDocSh->GetDoc(); - if (fieldBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) ) + if (fieldBM->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) { ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(fieldBM); pCheckboxFm->SetChecked(!pCheckboxFm->IsChecked()); pCheckboxFm->Invalidate(); rSh.InvalidateWindows( rView.GetVisArea() ); - } else if (fieldBM->GetFieldname().equalsAscii( ODF_FORMDROPDOWN) ) { + } else if (fieldBM->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) { rView.ExecFieldPopup( aDocPt, fieldBM ); fieldBM->Invalidate(); rSh.InvalidateWindows( rView.GetVisArea() ); @@ -4276,7 +4132,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) } } } - else // if ( SwContentAtPos::SW_INETATTR == aCntntAtPos.eCntntAtPos ) + else { if ( bExecHyperlinks ) rSh.ClickToINetAttr( *(SwFmtINetFmt*)aCntntAtPos.aFnd.pAttr, nFilter ); @@ -4297,7 +4153,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if (pSdrView && aVEvt.eEvent == SDREVENT_EXECUTEURL) { - // URL-Feld getroffen + // hit URL field const SvxURLField *pField = aVEvt.pURLField; if (pField) { @@ -4309,7 +4165,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) } else { - // Grafik getroffen + // hit graphic ReleaseMouse(); if( rSh.ClickToINetGrf( aDocPt, nFilter )) bCallShadowCrsr = sal_False; @@ -4341,7 +4197,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) } - // gfs. im Down gepushten Mode wieder zuruecksetzen + // reset pushed mode in Down again if applicable if ( bPopMode && bModePushed ) { rSh.PopMode(); @@ -4417,7 +4273,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) } else if(rMEvt.GetClicks() == 1) { - // keine Selektion -> also Giesskanne abschalten + // no selection -> so turn off watering can aTemplateTimer.Start(); } } @@ -4466,7 +4322,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) break; } case SFX_STYLE_FAMILY_PAGE: - // Kein Undo bei Seitenvorlagen + // no Undo with page templates rSh.ChgCurPageDesc( *pApplyTempl->aColl.pPageDesc ); if ( pApplyTempl->aColl.pPageDesc ) aStyleName = pApplyTempl->aColl.pPageDesc->GetName(); @@ -4475,11 +4331,9 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) case SFX_STYLE_FAMILY_PSEUDO: if( !rSh.HasReadonlySel() ) { - // --> OD 2008-03-17 #refactorlists# rSh.SetCurNumRule( *pApplyTempl->aColl.pNumRule, false, pApplyTempl->aColl.pNumRule->GetDefaultListId() ); - // <-- bCallBase = sal_False; pApplyTempl->bUndo = sal_True; if( pApplyTempl->aColl.pNumRule ) @@ -4505,8 +4359,8 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) } ReleaseMouse(); - // Hier kommen nur verarbeitete MouseEvents an; nur bei diesen duerfen - // die Modi zurueckgesetzt werden. + // Only processed MouseEvents arrive here; only at these the moduses can + // be resetted. bMBPressed = sal_False; //sicherheitshalber aufrufen, da jetzt das Selektieren bestimmt zu Ende ist. @@ -4518,12 +4372,10 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) Window::MouseButtonUp(rMEvt); } - /*-------------------------------------------------------------------- - Beschreibung: Vorlage anwenden + Description: apply template --------------------------------------------------------------------*/ - void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl) { static sal_Bool bIdle = sal_False; @@ -4564,7 +4416,7 @@ void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl) rSh.Edit(); } - static sal_uInt16 __READONLY_DATA aInva[] = + static sal_uInt16 aInva[] = { SID_STYLE_WATERCAN, SID_ATTR_CHAR_COLOR_EXT, @@ -4575,10 +4427,9 @@ void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl) } /*-------------------------------------------------------------------- - Beschreibung: ctor + Description: ctor --------------------------------------------------------------------*/ - SwEditWin::SwEditWin(Window *pParent, SwView &rMyView): Window(pParent, WinBits(WB_CLIPCHILDREN | WB_DIALOGCONTROL)), DropTargetHelper( this ), @@ -4604,8 +4455,8 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView): bLockInput(sal_False), bObjectSelect( sal_False ), - nKS_NUMDOWN_Count(0), // #i23725# - nKS_NUMINDENTINC_Count(0) // #i23725# + nKS_NUMDOWN_Count(0), + nKS_NUMINDENTINC_Count(0) { SetHelpId(HID_EDIT_WIN); EnableChildTransparentMode(); @@ -4613,7 +4464,7 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView): bLinkRemoved = bMBPressed = bInsDraw = bInsFrm = bIsInDrag = bOldIdle = bOldIdleSet = bChainMode = bWasShdwCrsr = sal_False; - //#i42732# initially use the input language + // initially use the input language bUseInputLanguage = sal_True; SetMapMode(MapMode(MAP_TWIP)); @@ -4628,13 +4479,13 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView): aKeyInputFlushTimer.SetTimeout( 200 ); aKeyInputFlushTimer.SetTimeoutHdl(LINK(this, SwEditWin, KeyInputFlushHandler)); - // TemplatePointer fuer Farben soll nach Einfachclick - // ohne Selektion zurueckgesetzt werden + // TemplatePointer for colors should be resetted without + // selection after single click aTemplateTimer.SetTimeout(400); aTemplateTimer.SetTimeoutHdl(LINK(this, SwEditWin, TemplateTimerHdl)); - //JP 16.12.98: temporaere Loesung!!! Sollte bei jeder Cursorbewegung - // den Font von der akt. einfuege Position setzen! + // temporary solution!!! Should set the font of the current + // insert position at every curor movement! if( !rMyView.GetDocShell()->IsReadOnly() ) { Font aFont; @@ -4643,8 +4494,6 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView): } } - - SwEditWin::~SwEditWin() { aKeyInputTimer.Stop(); @@ -4664,12 +4513,10 @@ SwEditWin::~SwEditWin() delete pAnchorMarker; } - /****************************************************************************** - * Beschreibung: DrawTextEditMode einschalten + * Description: turn on DrawTextEditMode ******************************************************************************/ - void SwEditWin::EnterDrawTextMode( const Point& aDocPos ) { if ( rView.EnterDrawTextMode(aDocPos) == sal_True ) @@ -4686,17 +4533,14 @@ void SwEditWin::EnterDrawTextMode( const Point& aDocPos ) } /****************************************************************************** - * Beschreibung: DrawMode einschalten + * Description: turn on DrawMode ******************************************************************************/ - - sal_Bool SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos) { SwWrtShell &rSh = rView.GetWrtShell(); SdrView *pSdrView = rSh.GetDrawView(); -// if ( GetDrawFuncPtr() && (aActHitType == SDRHIT_NONE || rSh.IsDrawCreate()) ) if ( rView.GetDrawFuncPtr() ) { if (rSh.IsDrawCreate()) @@ -4712,7 +4556,7 @@ sal_Bool SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos) sal_Bool bUnLockView = !rSh.IsViewLocked(); rSh.LockView( sal_True ); - rSh.EndTextEdit(); // Danebengeklickt, Ende mit Edit + rSh.EndTextEdit(); // clicked aside, end Edit rSh.SelectObj( aDocPos ); if ( !rSh.IsObjSelected() && !rSh.IsFrmSelected() ) rSh.LeaveSelFrmMode(); @@ -4730,23 +4574,11 @@ sal_Bool SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos) return sal_False; } -/****************************************************************************** - * Beschreibung: - ******************************************************************************/ - - - sal_Bool SwEditWin::IsDrawSelMode() { -// return (IsFrmAction() == sal_False && GetSdrDrawMode() == OBJ_NONE); return IsObjectSelect(); } -/****************************************************************************** - * Beschreibung: - ******************************************************************************/ - - void SwEditWin::GetFocus() { if ( rView.GetPostItMgr()->HasActiveSidebarWin() ) @@ -4761,12 +4593,6 @@ void SwEditWin::GetFocus() } } -/****************************************************************************** - * Beschreibung: - ******************************************************************************/ - - - void SwEditWin::LoseFocus() { rView.GetWrtShell().InvalidateAccessibleFocus(); @@ -4776,19 +4602,13 @@ void SwEditWin::LoseFocus() rView.LostFocus(); } -/****************************************************************************** - * Beschreibung: - ******************************************************************************/ - - - void SwEditWin::Command( const CommandEvent& rCEvt ) { SwWrtShell &rSh = rView.GetWrtShell(); if ( !rView.GetViewFrame() ) { - //Wenn der ViewFrame in Kuerze stirbt kein Popup mehr! + // If ViewFrame dies shortly, no popup anymore! Window::Command(rCEvt); return; } @@ -4797,7 +4617,6 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) // menu from an inplace client has been closed. Now we have the chance // to deactivate the inplace client without any problem regarding parent // windows and code on the stack. - // For more information, see #126086# and #128122# SfxInPlaceClient* pIPClient = rSh.GetSfxViewShell()->GetIPClient(); sal_Bool bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() ); if ( bIsOleActive && ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )) @@ -4851,8 +4670,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) aEvent.ExecutePosition.X = aPixPos.X(); aEvent.ExecutePosition.Y = aPixPos.Y(); Menu* pMenu = 0; - ::rtl::OUString sMenuName = - ::rtl::OUString::createFromAscii( "private:resource/ReadonlyContextMenu"); + ::rtl::OUString sMenuName(RTL_CONSTASCII_USTRINGPARAM("private:resource/ReadonlyContextMenu")); if( GetView().TryContextMenuInterception( *pROPopup, sMenuName, pMenu, aEvent ) ) { if ( pMenu ) @@ -4886,7 +4704,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) case COMMAND_VOICE: { - //ggf. an Outliner weiterleiten + // forward to Outliner if applicable if ( rSh.HasDrawView() && rSh.GetDrawView()->IsTextEdit() ) { bCallBase = sal_False; @@ -4898,7 +4716,6 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) if ( VOICECOMMANDTYPE_CONTROL == pCData->GetType() ) break; - sal_uInt16 nSlotId = 0; SfxPoolItem *pItem = 0; @@ -4951,9 +4768,9 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) } break; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 default: - ASSERT( !this, "unknown speech command." ); + OSL_ENSURE( !this, "unknown speech command." ); #endif } if ( nSlotId ) @@ -5017,7 +4834,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) if ( sRecord.Len() ) { - // #102812# convert quotes in IME text + // convert quotes in IME text // works on the last input character, this is escpecially in Korean text often done // quotes that are inside of the string are not replaced! const sal_Unicode aCh = sRecord.GetChar(sRecord.Len() - 1); @@ -5033,9 +4850,9 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) if ( xRecorder.is() ) { - //Shell ermitteln + // determine Shell SfxShell *pSfxShell = lcl_GetShellFromDispatcher( rView, TYPE(SwTextShell) ); - // Request generieren und recorden + // generate request and record if (pSfxShell) { SfxRequest aReq( rView.GetViewFrame(), FN_INSERT_STRING ); @@ -5145,7 +4962,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) GetView().GetViewFrame()->GetDispatcher()->Execute(SID_HANGUL_HANJA_CONVERSION); break; case COMMAND_INPUTLANGUAGECHANGE : - //#i42732# update state of fontname if input language changes + // i#42732 - update state of fontname if input language changes bInputLanguageSwitched = true; SetUseInputLanguage( sal_True ); break; @@ -5219,35 +5036,30 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) } } break; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 default: - ASSERT( !this, "unknown command." ); + OSL_ENSURE( !this, "unknown command." ); #endif } if (bCallBase) Window::Command(rCEvt); } -/* -----------------25.08.2003 10:12----------------- - #i18686#: select the object/cursor at the mouse - position of the context menu request - --------------------------------------------------*/ +/* i#18686 select the object/cursor at the mouse + position of the context menu request */ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) { sal_Bool bRet = sal_False; const Point aDocPos( PixelToLogic( rMousePos ) ); - // --> OD 2005-02-17 #i42258# const bool bIsInsideSelectedObj( rSh.IsInsideSelectedObj( aDocPos ) ); - // <-- //create a synthetic mouse event out of the coordinates MouseEvent aMEvt(rMousePos); SdrView *pSdrView = rSh.GetDrawView(); if ( pSdrView ) { - // --> OD 2005-02-17 #i42258# - no close of insert_draw and reset of + // no close of insert_draw and reset of // draw mode, if context menu position is inside a selected object. if ( !bIsInsideSelectedObj && rView.GetDrawFuncPtr() ) - // <-- { rView.GetDrawFuncPtr()->Deactivate(); @@ -5319,7 +5131,6 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) if( !rSh.IsSelFrmMode() && !GetView().GetViewFrame()->GetDispatcher()->IsLocked() ) { - // #107513# // Test if there is a draw object at that position and if it should be selected. sal_Bool bShould = rSh.ShouldObjectBeSelected(aDocPos); @@ -5337,9 +5148,8 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) if( bSelObj ) { bRet = sal_True; - // falls im Macro der Rahmen deselektiert - // wurde, muss nur noch der Cursor - // wieder angezeigt werden. + // in case the frame was deselected in the macro + // just the cursor has to be displayed again. if( FRMTYPE_NONE == rSh.GetSelFrmType() ) rSh.ShowCrsr(); else @@ -5386,9 +5196,8 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) if( !bSelObj ) { - // Cursor hier umsetzen, damit er nicht zuerst - // im Rahmen gezeichnet wird; ShowCrsr() geschieht - // in LeaveSelFrmMode() + // move cursor here so that it is not drawn in the + // frame at first; ShowCrsr() happens in LeaveSelFrmMode() bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False)); rSh.LeaveSelFrmMode(); rView.LeaveDrawCreate(); @@ -5432,8 +5241,8 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) if ( !bOverSelect ) { - { // nur temp. Move-Kontext aufspannen, da sonst die - // Abfrage auf die Inhaltsform nicht funktioniert!!! + { // create only temporary move context because otherwise + // the query against the content form doesn't work!!! MV_KONTEXT( &rSh ); (rSh.*rSh.fnSetCrsr)(&aDocPos, sal_False); bRet = sal_True; @@ -5457,7 +5266,7 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) SfxShell* lcl_GetShellFromDispatcher( SwView& rView, TypeId nType ) { - //Shell ermitteln + // determine Shell SfxShell* pShell; SfxDispatcher* pDispatcher = rView.GetViewFrame()->GetDispatcher(); for(sal_uInt16 i = 0; sal_True; ++i ) @@ -5469,8 +5278,6 @@ SfxShell* lcl_GetShellFromDispatcher( SwView& rView, TypeId nType ) return pShell; } - - void SwEditWin::ClearTip() { } @@ -5481,7 +5288,6 @@ IMPL_LINK( SwEditWin, KeyInputFlushHandler, Timer *, EMPTYARG ) return 0; } - IMPL_LINK( SwEditWin, KeyInputTimerHandler, Timer *, EMPTYARG ) { bTblInsDelMode = sal_False; @@ -5497,28 +5303,20 @@ void SwEditWin::_FinitStaticData() { delete pQuickHlpData; } -/* -----------------23.01.2003 12:15----------------- - * #i3370# remove quick help to prevent saving - * of autocorrection suggestions - * --------------------------------------------------*/ +/* i#3370 - remove quick help to prevent saving + * of autocorrection suggestions */ void SwEditWin::StopQuickHelp() { if( HasFocus() && pQuickHlpData && pQuickHlpData->bClear ) pQuickHlpData->Stop( rView.GetWrtShell() ); } -/*-----------------23.02.97 18:39------------------- - ---------------------------------------------------*/ - - IMPL_LINK(SwEditWin, TemplateTimerHdl, Timer*, EMPTYARG) { SetApplyTemplate(SwApplyTemplate()); return 0; } - void SwEditWin::SetChainMode( sal_Bool bOn ) { if ( !bChainMode ) @@ -5534,7 +5332,7 @@ void SwEditWin::SetChainMode( sal_Bool bOn ) if ( !bChainMode ) rView.GetViewFrame()->HideStatusText(); - static sal_uInt16 __READONLY_DATA aInva[] = + static sal_uInt16 aInva[] = { FN_FRAME_CHAIN, FN_FRAME_UNCHAIN, 0 }; @@ -5543,10 +5341,9 @@ void SwEditWin::SetChainMode( sal_Bool bOn ) uno::Reference< ::com::sun::star::accessibility::XAccessible > SwEditWin::CreateAccessible() { - vos::OGuard aGuard(Application::GetSolarMutex()); // this should have - // happend already!!! + SolarMutexGuard aGuard; // this should have happend already!!! SwWrtShell *pSh = rView.GetWrtShellPtr(); - ASSERT( pSh, "no writer shell, no accessible object" ); + OSL_ENSURE( pSh, "no writer shell, no accessible object" ); uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc; if( pSh ) @@ -5559,10 +5356,9 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible > SwEditWin::Create void QuickHelpData::Move( QuickHelpData& rCpy ) { - // Pointer verschieben + // move pointer aArr.Insert( &rCpy.aArr ); rCpy.aArr.Remove( (sal_uInt16)0, rCpy.aArr.Count() ); -// nTipId = rCpy.nTipId; bClear = rCpy.bClear; nLen = rCpy.nLen; nCurArrPos = rCpy.nCurArrPos; @@ -5592,7 +5388,6 @@ void QuickHelpData::ClearCntnt() delete[] pAttrs, pAttrs = 0; } - void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen ) { if( pCETID ) delete pCETID, pCETID = 0; @@ -5640,8 +5435,6 @@ void QuickHelpData::Stop( SwWrtShell& rSh ) ClearCntnt(); } - - void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord ) { salhelper::SingletonRef<SwCalendarWrapper>* pCalendar = s_getCalendarWrapper(); @@ -5657,9 +5450,7 @@ void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord ) String sStr( aNames[ nPos ].FullName ); if( rWord.Len() + 1 < sStr.Len() && -//!!! UNICODE: fehlendes interface -// pIntl->CompareEqual( rWord, sStr.Copy( 0, rWord.Len() ), -// INTN_COMPARE_IGNORECASE ) ) +//!!! UNICODE: missing interface COMPARE_EQUAL == rWord.CompareIgnoreCaseToAscii( sStr, rWord.Len() )) { @@ -5681,22 +5472,40 @@ void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord ) while( nStt < nEnd ) { const String& rS = rACLst[ nStt ]; - //JP 16.06.99: Bug 66927 - only if the count of chars - // from the suggest greater as the - // actual word + // only if the count of chars + // from the suggest greater as the + // actual word if( rS.Len() > rWord.Len() ) { - String* pNew = new String( rS ); - if( !aArr.Insert( pNew ) ) + CharClass &rCC = GetAppCharClass(); + String aMatch; + int upper = 0, lower = 0, letters = 0; + for( xub_StrLen i = 0; i < rWord.Len(); i++ ) { + sal_Int32 nCharType = rCC.getCharacterType( rWord, i ); + if( !CharClass::isLetterType( nCharType ) ) + continue; + letters++; + if( i18n::KCharacterType::LOWER & nCharType ) + lower++; + if( i18n::KCharacterType::UPPER & nCharType ) + upper++; + } + if (lower == letters) + aMatch = rCC.lower( rS ); + else if (upper == letters) + aMatch = rCC.upper( rS ); + else // mixed case - use what we have + aMatch = rS; + + String *pNew = new String( aMatch ); + if (!aArr.Insert( pNew )) delete pNew; } ++nStt; } } } -/* -----------------06.11.2002 12:01----------------- - * - * --------------------------------------------------*/ + void SwEditWin::ShowAutoTextCorrectQuickHelp( const String& rWord, SvxAutoCorrCfg* pACfg, SvxAutoCorrect* pACorr, sal_Bool bFromIME ) @@ -5728,10 +5537,6 @@ void SwEditWin::ShowAutoTextCorrectQuickHelp( pQuickHlpData->Start( rSh, rWord.Len() ); } -/* -----------------29.03.2006 11:01----------------- - * - * --------------------------------------------------*/ - void SwEditWin::SetUseInputLanguage( sal_Bool bNew ) { if ( bNew || bUseInputLanguage ) @@ -5743,9 +5548,6 @@ void SwEditWin::SetUseInputLanguage( sal_Bool bNew ) bUseInputLanguage = bNew; } -/*-- 13.11.2008 10:18:17--------------------------------------------------- - - -----------------------------------------------------------------------*/ XubString SwEditWin::GetSurroundingText() const { String sReturn; @@ -5771,9 +5573,7 @@ XubString SwEditWin::GetSurroundingText() const return sReturn; } -/*-- 13.11.2008 10:18:17--------------------------------------------------- - -----------------------------------------------------------------------*/ Selection SwEditWin::GetSurroundingTextSelection() const { SwWrtShell& rSh = rView.GetWrtShell(); @@ -5801,3 +5601,5 @@ Selection SwEditWin::GetSurroundingTextSelection() const return Selection( nPos - nStartPos, nPos - nStartPos ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx index 68a0e23ad6..83d9e7eea6 100644 --- a/sw/source/ui/docvw/edtwin2.cxx +++ b/sw/source/ui/docvw/edtwin2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,7 +32,7 @@ #include <hintids.hxx> #include <doc.hxx> -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 #include <stdio.h> #endif @@ -81,7 +82,7 @@ // <-- /*-------------------------------------------------------------------- - Beschreibung: KeyEvents + Description: KeyEvents --------------------------------------------------------------------*/ static void lcl_GetRedlineHelp( const SwRedline& rRedl, String& rTxt, sal_Bool bBalloon ) { @@ -135,7 +136,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) if( bWeiter && bQuickBalloon) { SwRect aFldRect; - sal_uInt16 nStyle = 0; // style of quick help SwContentAtPos aCntntAtPos( SwContentAtPos::SW_FIELD | SwContentAtPos::SW_INETATTR | SwContentAtPos::SW_FTN | @@ -143,7 +143,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) SwContentAtPos::SW_TOXMARK | SwContentAtPos::SW_REFMARK | SwContentAtPos::SW_SMARTTAG | -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 SwContentAtPos::SW_TABLEBOXVALUE | ( bBalloon ? SwContentAtPos::SW_CURR_ATTRS : 0) | #endif @@ -151,13 +151,14 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) if( rSh.GetContentAtPos( aPos, aCntntAtPos, sal_False, &aFldRect ) ) { + sal_uInt16 nStyle = 0; // style of quick help switch( aCntntAtPos.eCntntAtPos ) { case SwContentAtPos::SW_TABLEBOXFML: sTxt.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "= " )); sTxt += ((SwTblBoxFormula*)aCntntAtPos.aFnd.pAttr)->GetFormula(); break; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 case SwContentAtPos::SW_TABLEBOXVALUE: { sTxt = UniString( @@ -191,7 +192,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) sSuffix.EqualsAscii( pMarkToOLE )) sTxt = sTxt.Copy( 0, nFound - 1); } - // --> OD 2009-08-18 #i104300# + // #i104300# // special handling if target is a cross-reference bookmark { String sTmpSearchStr = sTxt.Copy( 1, sTxt.Len() ); @@ -222,8 +223,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) } } } - // <-- - // --> OD 2007-07-26 #i80029# + // #i80029# sal_Bool bExecHyperlinks = rView.GetDocShell()->IsReadOnly(); if ( !bExecHyperlinks ) { @@ -236,7 +236,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) sTxt.Insert( ViewShell::GetShellRes()->aHyperlinkClick, 0 ); } } - // <-- break; } case SwContentAtPos::SW_SMARTTAG: @@ -311,27 +310,9 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) case RES_POSTITFLD: { - /* - SwPostItMgr* pMgr = rView.GetPostItMgr(); - if (pMgr->ShowNotes()) - { - SwFmtFld* pSwFmtFld = 0; - if (pMgr->ShowPreview(pFld,pSwFmtFld)) - { - SwPostIt* pPostIt = new SwPostIt(static_cast<Window*>(this),0,pSwFmtFld,pMgr,PB_Preview); - pPostIt->InitControls(); - pPostIt->SetReadonly(true); - pMgr->SetColors(pPostIt,static_cast<SwPostItField*>(pSwFmtFld->GetFld())); - pPostIt->SetVirtualPosSize(rEvt.GetMousePosPixel(),Size(180,70)); - pPostIt->ShowNote(); - SetPointerPosPixel(pPostIt->GetPosPixel() + Point(20,20)); - } - return; - } - */ break; } - case RES_INPUTFLD: // BubbleHelp, da der Hinweis ggf ziemlich lang sein kann + case RES_INPUTFLD: // BubbleHelp, because the suggestion could be quite long bBalloon = sal_True; /* no break */ case RES_JUMPEDITFLD: @@ -356,9 +337,9 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) case RES_GETREFFLD: { - // --> OD 2008-01-09 #i85090# + // #i85090# const SwGetRefField* pRefFld( dynamic_cast<const SwGetRefField*>(pFld) ); - ASSERT( pRefFld, + OSL_ENSURE( pRefFld, "<SwEditWin::RequestHelp(..)> - unexpected type of <pFld>" ); if ( pRefFld ) { @@ -379,7 +360,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) sTxt = ((SwGetRefField*)pFld)->GetSetRefName(); } } - // <-- } break; } @@ -400,7 +380,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) Help::ShowBalloon( this, rEvt.GetMousePosPixel(), sTxt ); else { - // dann zeige die Hilfe mal an: + // the show the help Rectangle aRect( aFldRect.SVRect() ); Point aPt( OutputToScreenPixel( LogicToPixel( aRect.TopLeft() ))); aRect.Left() = aPt.X(); @@ -428,7 +408,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) case SW_TABROW_VERT: nTabRes = STR_TABLE_ROW_ADJUST; break; - // --> FME 2004-07-30 #i32329# Enhanced table selection + // #i32329# Enhanced table selection case SW_TABSEL_HORI: case SW_TABSEL_HORI_RTL: case SW_TABSEL_VERT: @@ -443,7 +423,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) case SW_TABCOLSEL_VERT: nTabRes = STR_TABLE_SELECT_COL; break; - // <-- } if(nTabRes) { @@ -456,14 +435,6 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) } } -/* -aktuelle Zeichenvorlage anzeigen? - if( bWeiter && rEvt.GetMode() & ( HELPMODE_QUICK | HELPMODE_BALLOON )) - { - SwCharFmt* pChrFmt = rSh.GetCurCharFmt(); - - } -*/ if( bWeiter && pSdrView && bQuickBalloon) { SdrViewEvent aVEvt; @@ -473,7 +444,7 @@ aktuelle Zeichenvorlage anzeigen? if ((pField = aVEvt.pURLField) != 0) { - // URL-Feld getroffen + // hit an URL field if (pField) { pObj = aVEvt.pObj; @@ -484,7 +455,7 @@ aktuelle Zeichenvorlage anzeigen? } if (bWeiter && eHit == SDRHIT_TEXTEDIT) { - // URL-Feld in zum Editieren ge?ffneten DrawText-Objekt suchen + // look for URL field in DrawText object that is opened for editing OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); const SvxFieldItem* pFieldItem; @@ -540,16 +511,6 @@ void SwEditWin::PrePaint() void SwEditWin::Paint(const Rectangle& rRect) { -#if defined(MYDEBUG) - // StartUp-Statistik - if ( pTickList ) - { - SYSTICK( "Start SwEditWin::Paint" ); - READ_FIRST_TICKS() - FLUSH_TICKS() - } -#endif - SwWrtShell* pWrtShell = GetView().GetWrtShellPtr(); if(!pWrtShell) return; @@ -557,28 +518,19 @@ void SwEditWin::Paint(const Rectangle& rRect) if( pShadCrsr ) { Rectangle aRect( pShadCrsr->GetRect()); - // liegt vollstaendig drin? + // fully resides inside? if( rRect.IsInside( aRect ) ) // dann aufheben delete pShadCrsr, pShadCrsr = 0; else if( rRect.IsOver( aRect )) { - // liegt irgendwie drueber, dann ist alles ausserhalb geclippt - // und wir muessen den "inneren Teil" am Ende vom Paint - // wieder sichtbar machen. Sonst kommt es zu Paintfehlern! + // resides somewhat above, then everything is clipped outside + // and we have to make the "inner part" at the end of the + // Paint visible again. Otherwise Paint errors occur! bPaintShadowCrsr = sal_True; } } -/* - //TODO/LATER: what's the replacement for this? Do we need it? - SwDocShell* pDocShell = GetView().GetDocShell(); - - SvInPlaceEnvironment *pIpEnv = pDocShell ? - pDocShell->GetIPEnv() : 0; - if ( pIpEnv && pIpEnv->GetRectsChangedLockCount() ) - //Wir stehen in Groessenverhandlungen (MM), Paint verzoegern - Invalidate( rRect ); - else */ + if ( GetView().GetVisArea().GetWidth() <= 0 || GetView().GetVisArea().GetHeight() <= 0 ) Invalidate( rRect ); @@ -590,3 +542,4 @@ void SwEditWin::Paint(const Rectangle& rRect) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/edtwin3.cxx b/sw/source/ui/docvw/edtwin3.cxx index 4e12917a2c..ccac547822 100644 --- a/sw/source/ui/docvw/edtwin3.cxx +++ b/sw/source/ui/docvw/edtwin3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,7 +51,7 @@ /*-------------------------------------------------------------------- - Beschreibung: Core-Notify + Description: Core-Notify --------------------------------------------------------------------*/ @@ -64,7 +65,7 @@ void ScrollMDI( ViewShell* pVwSh, const SwRect &rRect, } /*-------------------------------------------------------------------- - Beschreibung: Docmdi - verschiebbar + Description: Docmdi - movable --------------------------------------------------------------------*/ @@ -78,7 +79,7 @@ sal_Bool IsScrollMDI( ViewShell* pVwSh, const SwRect &rRect ) } /*-------------------------------------------------------------------- - Beschreibung: Notify fuer Groessen-Aenderung + Description: Notify for size change --------------------------------------------------------------------*/ @@ -96,7 +97,7 @@ void SizeNotify(ViewShell* pVwSh, const Size &rSize) } /*-------------------------------------------------------------------- - Beschreibung: Notify fuer Seitenzahl-Update + Description: Notify for page number update --------------------------------------------------------------------*/ @@ -111,10 +112,8 @@ void PageNumNotify( ViewShell* pVwSh, sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, } /****************************************************************************** - * Methode : void FrameNotify( DocMDIBase *pWin, FlyMode eMode ) - * Beschreibung: - * Erstellt : OK 08.02.94 13:49 - * Aenderung : + * Method : void FrameNotify( DocMDIBase *pWin, FlyMode eMode ) + * Description: ******************************************************************************/ @@ -126,7 +125,7 @@ void FrameNotify( ViewShell* pVwSh, FlyMode eMode ) } /*-------------------------------------------------------------------- - Beschreibung: Notify fuer Seitenzahl-Update + Description: Notify for page number update --------------------------------------------------------------------*/ sal_Bool SwEditWin::RulerColumnDrag( const MouseEvent& rMEvt, sal_Bool bVerticalMode) { @@ -137,7 +136,7 @@ sal_Bool SwEditWin::RulerColumnDrag( const MouseEvent& rMEvt, sal_Bool bVertical } // #i23726# -// --> OD 2005-02-18 #i42921# - add 3rd parameter <bVerticalMode> in order +// #i42921# - add 3rd parameter <bVerticalMode> in order // to consider vertical layout sal_Bool SwEditWin::RulerMarginDrag( const MouseEvent& rMEvt, const bool bVerticalMode ) @@ -145,7 +144,6 @@ sal_Bool SwEditWin::RulerMarginDrag( const MouseEvent& rMEvt, SvxRuler& rRuler = bVerticalMode ? rView.GetVLineal() : rView.GetHLineal(); return !rRuler.StartDocDrag( rMEvt, RULER_TYPE_INDENT); } -// <-- LAYOUT_NS Dialog* GetSearchDialog() { @@ -178,8 +176,8 @@ void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt ) Window::DataChanged( rDCEvt ); SwWrtShell* pSh = GetView().GetWrtShellPtr(); - //#99906# DataChanged() is sometimes called prior to creating - // the SwWrtShell + // DataChanged() is sometimes called prior to creating + // the SwWrtShell if(!pSh) return; sal_Bool bViewWasLocked = pSh->IsViewLocked(), bUnlockPaint = sal_False; @@ -187,16 +185,16 @@ void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt ) switch( rDCEvt.GetType() ) { case DATACHANGED_SETTINGS: - // ScrollBars neu anordnen bzw. Resize ausloesen, da sich - // ScrollBar-Groesse geaendert haben kann. Dazu muss dann im - // Resize-Handler aber auch die Groesse der ScrollBars aus - // den Settings abgefragt werden. + // rearrange ScrollBars, respectively trigger resize, because + // the ScrollBar size can have change. For that, in the reset + // handler, the size of the ScrollBars also has to be queried + // from the settings. if( rDCEvt.GetFlags() & SETTINGS_STYLE ) { pSh->LockPaint(); bUnlockPaint = sal_True; ViewShell::DeleteReplacementBitmaps(); - GetView().InvalidateBorder(); //Scrollbarbreiten + GetView().InvalidateBorder(); //Scrollbar work } break; @@ -206,7 +204,7 @@ void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt ) case DATACHANGED_FONTSUBSTITUTION: pSh->LockPaint(); bUnlockPaint = sal_True; - GetView().GetDocShell()->UpdateFontList(); //z.B. Druckerwechsel + GetView().GetDocShell()->UpdateFontList(); //e.g. printer change break; } pSh->LockView( bViewWasLocked ); @@ -214,3 +212,4 @@ void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt ) pSh->UnlockPaint(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/extedit.cxx b/sw/source/ui/docvw/extedit.cxx new file mode 100644 index 0000000000..bf39575bbf --- /dev/null +++ b/sw/source/ui/docvw/extedit.cxx @@ -0,0 +1,150 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * [ Surendran Mahendran <surenspost@gmail.com>] + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "precompiled_sw.hxx" +#include <extedit.hxx> +#include <view.hxx> +#include <sfx2/viewfrm.hxx> +#include <sfx2/bindings.hxx> +#include <wrtsh.hxx> +#include <osl/file.hxx> +#include <osl/thread.hxx> +#include <osl/process.h> +#include <osl/time.h> +#include <svtools/filter.hxx> +#include <svtools/filechangedchecker.hxx> +#include <svx/xoutbmp.hxx> +#include <unotools/ucbstreamhelper.hxx> +#include <vcl/svapp.hxx> +#include <vcl/graph.hxx> +#include <vcl/cvtgrf.hxx> +#include <basesh.hxx> +#include "romenu.hxx" +#include "com/sun/star/system/XSystemShellExecute.hpp" +#include "com/sun/star/system/SystemShellExecuteFlags.hpp" +#include <comphelper/processfactory.hxx> + +#include <boost/bind.hpp> + +using namespace ::com::sun::star; + +void HandleCloseEvent(const String& rURL, SwWrtShell *rSh) +{ + //create a new Graphic + Graphic newGraphic; + + //import the temp file image stream into the newGraphic + SvStream* pStream = utl::UcbStreamHelper::CreateStream(rURL, STREAM_READ); + if(pStream) + { + GraphicConverter::Import(*pStream, newGraphic); + + // Now update the Graphic in the shell by re-reading from the newGraphic + // TODO: Make this action Undoable ! + rSh->ReRead(aEmptyStr, aEmptyStr, (const Graphic*) &newGraphic); + + delete(pStream); + } +} + +IMPL_LINK (ExternalProcessClass_Impl, StartListeningEvent, void*, pEvent) +{ + //Start an event listener implemented via VCL timeout + Data *pData = ( Data* )pEvent; + String aURL( pData->fileName ); + + new FileChangedChecker( + pData->fileName, + ::boost::bind(&HandleCloseEvent,aURL,pData->rSh)); + + return 0; +} + +void pWorker(void *pThreadData) +{ + Data *pData = (Data*)(pThreadData); + rtl_uString *aFileName = new rtl_uString(); + rtl_uString_newFromAscii ( + &aFileName, rtl::OUStringToOString( + pData->fileName, RTL_TEXTENCODING_UTF8).getStr()); + + // Make an asynchronous call to listen to the event of temporary image file + // getting changed + Application::PostUserEvent( + LINK(NULL, ExternalProcessClass_Impl, StartListeningEvent), pThreadData); + + uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( + ::comphelper::getProcessServiceFactory()->createInstance( + DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute") ), uno::UNO_QUERY_THROW ); + xSystemShellExecute->execute( pData->fileName, rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS ); +} + +void EditWithExternalTool(GraphicObject *pGraphicObject, SwWrtShell *rSh) +{ + //Get the graphic from the GraphicObject + const Graphic pGraphic = pGraphicObject->GetGraphic(); + + //get the Preferred File Extension for this graphic + String fExt; + GetPreferedExtension(fExt, pGraphic); + + //Create the temp File + rtl::OUString tempFileBase, tempFileName; + oslFileHandle pHandle; + osl::FileBase::createTempFile(0, &pHandle, &tempFileBase); + + // Move it to a file name with image extension properly set + tempFileName = tempFileBase + rtl::OUString(String('.')) + + rtl::OUString(fExt); + osl::File::move(tempFileBase, tempFileName); + + //Write Graphic to the Temp File + GraphicFilter& rGF = *GraphicFilter::GetGraphicFilter(); + sal_uInt16 nFilter(rGF.GetExportFormatNumber(fExt)); + String aFilter(rGF.GetExportFormatShortName(nFilter)); + String sPath(tempFileName.getStr()); + + // Write the Graphic to the file now + XOutBitmap::WriteGraphic(pGraphic, sPath, aFilter, + XOUTBMP_USE_NATIVE_IF_POSSIBLE|XOUTBMP_DONT_EXPAND_FILENAME); + + // There is a possiblity that sPath extnesion might have been changed if the + // provided extension is not writable + tempFileName = rtl::OUString(sPath); + + //Create a thread + rtl_uString *fileName = new rtl_uString(); + rtl_uString_newFromAscii( + &fileName, rtl::OUStringToOString(tempFileName, + RTL_TEXTENCODING_UTF8).getStr()); + + // Create the data that is needed by the thread later + Data *pThreadData = new Data(); + pThreadData->pGraphicObject = pGraphicObject; + pThreadData->fileName = fileName; + pThreadData->rSh = rSh ; + + osl_createThread(pWorker, pThreadData); + +} diff --git a/sw/source/ui/docvw/frmsidebarwincontainer.cxx b/sw/source/ui/docvw/frmsidebarwincontainer.cxx index b5e406dcf6..29a4d4012b 100644 --- a/sw/source/ui/docvw/frmsidebarwincontainer.cxx +++ b/sw/source/ui/docvw/frmsidebarwincontainer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -214,3 +212,5 @@ void SwFrmSidebarWinContainer::getAll( const SwFrm& rFrm, } } } // eof of namespace sw::sidebarwindows:: + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/frmsidebarwincontainer.hxx b/sw/source/ui/docvw/frmsidebarwincontainer.hxx index 1583f36a0b..4df59c86d1 100644 --- a/sw/source/ui/docvw/frmsidebarwincontainer.hxx +++ b/sw/source/ui/docvw/frmsidebarwincontainer.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -71,3 +69,4 @@ class SwFrmSidebarWinContainer #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx index a9c6c29c6b..29656e4d35 100644 --- a/sw/source/ui/docvw/romenu.cxx +++ b/sw/source/ui/docvw/romenu.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -64,7 +65,6 @@ #include <cmdid.h> #include <helpid.h> #include <docvw.hrc> -#include <docvw.hrc> #include <com/sun/star/ui/dialogs/XFilePicker.hpp> #include <com/sun/star/ui/dialogs/XFilterManager.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> @@ -76,20 +76,29 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::ui::dialogs; using namespace ::sfx2; -SwReadOnlyPopup::~SwReadOnlyPopup() +void GetPreferedExtension( String &rExt, const Graphic &rGrf ) { - String *pDel = (String*)aThemeList.First(); - while ( pDel ) + // then propose the "best" filter using the native-info, if applicable + const sal_Char* pExt = "png"; + switch( const_cast<Graphic&>(rGrf).GetLink().GetType() ) { - delete pDel; - pDel = (String*)aThemeList.Next(); + case GFX_LINK_TYPE_NATIVE_GIF: pExt = "gif"; break; + case GFX_LINK_TYPE_NATIVE_TIF: pExt = "tif"; break; + case GFX_LINK_TYPE_NATIVE_WMF: pExt = "wmf"; break; + case GFX_LINK_TYPE_NATIVE_MET: pExt = "met"; break; + case GFX_LINK_TYPE_NATIVE_PCT: pExt = "pct"; break; + case GFX_LINK_TYPE_NATIVE_JPG: pExt = "jpg"; break; + default:; //prevent warning } + rExt.AssignAscii( pExt ); +} + +SwReadOnlyPopup::~SwReadOnlyPopup() +{ delete pImageMap; delete pTargetURL; } - - void SwReadOnlyPopup::Check( sal_uInt16 nMID, sal_uInt16 nSID, SfxDispatcher &rDis ) { SfxPoolItem *_pItem = 0; @@ -162,22 +171,22 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : } } - sal_Bool bEnableGraphicToGallery; - if ( sal_True == (bEnableGraphicToGallery = bLink) ) + bool bEnableGraphicToGallery = bLink; + if ( bEnableGraphicToGallery ) { - GalleryExplorer::FillThemeList( aThemeList ); - if ( aThemeList.Count() ) + if (GalleryExplorer::FillThemeList( aThemeList )) { PopupMenu *pMenu = GetPopupMenu(MN_READONLY_GRAPHICTOGALLERY); pMenu->CheckItem( MN_READONLY_TOGALLERYLINK, bGrfToGalleryAsLnk ); pMenu->CheckItem( MN_READONLY_TOGALLERYCOPY, !bGrfToGalleryAsLnk ); - for ( sal_uInt16 i=0; i < aThemeList.Count(); ++i ) - pMenu->InsertItem( MN_READONLY_GRAPHICTOGALLERY+i + 3, - *(String*)aThemeList.GetObject( i ) ); + + for ( sal_uInt16 i=0; i < aThemeList.size(); ++i ) + pMenu->InsertItem( MN_READONLY_GRAPHICTOGALLERY+i + 3, aThemeList[ i ] ); } else - bEnableGraphicToGallery = sal_False; + bEnableGraphicToGallery = false; } + EnableItem( MN_READONLY_GRAPHICTOGALLERY, bEnableGraphicToGallery ); SfxViewFrame * pVFrame = rV.GetViewFrame(); @@ -192,17 +201,18 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : bEnableBack = sal_True; if ( pItem->GetGraphicLink() ) { - if ( !aThemeList.Count() ) + if ( aThemeList.empty() ) GalleryExplorer::FillThemeList( aThemeList ); - if ( aThemeList.Count() ) + + if ( !aThemeList.empty() ) { PopupMenu *pMenu = GetPopupMenu(MN_READONLY_BACKGROUNDTOGALLERY); pMenu->CheckItem( MN_READONLY_TOGALLERYLINK, bGrfToGalleryAsLnk ); pMenu->CheckItem( MN_READONLY_TOGALLERYCOPY, !bGrfToGalleryAsLnk ); bEnableBackGallery = sal_True; - for ( sal_uInt16 i=0; i < aThemeList.Count(); ++i ) - pMenu->InsertItem( MN_READONLY_BACKGROUNDTOGALLERY+i + 3, - *(String*)aThemeList.GetObject( i ) ); + + for ( sal_uInt16 i=0; i < aThemeList.size(); ++i ) + pMenu->InsertItem( MN_READONLY_GRAPHICTOGALLERY+i + 3, aThemeList[ i ] ); } } } @@ -292,10 +302,8 @@ void SwReadOnlyPopup::Execute( Window* pWin, sal_uInt16 nId ) sTmp = SaveGraphic( nSaveId ); if ( sTmp.Len() ) - { - String sThemeName( *(String*)aThemeList.GetObject( nId )); - GalleryExplorer::InsertURL( sThemeName, sTmp ); - } + GalleryExplorer::InsertURL( aThemeList[nId], sTmp ); + return; } @@ -377,29 +385,11 @@ void SwReadOnlyPopup::Execute( Window* pWin, sal_uInt16 nId ) pClipCntnr->CopyToClipboard( pWin ); } } -static void lcl_GetPreferedExtension( String &rExt, const Graphic &rGrf ) -{ - // dann ggfs. ueber die native-Info der Grafik den "besten" - // Filter vorschlagen - const sal_Char* pExt = "png"; - switch( const_cast<Graphic&>(rGrf).GetLink().GetType() ) - { - case GFX_LINK_TYPE_NATIVE_GIF: pExt = "gif"; break; - case GFX_LINK_TYPE_NATIVE_TIF: pExt = "tif"; break; - case GFX_LINK_TYPE_NATIVE_WMF: pExt = "wmf"; break; - case GFX_LINK_TYPE_NATIVE_MET: pExt = "met"; break; - case GFX_LINK_TYPE_NATIVE_PCT: pExt = "pct"; break; - case GFX_LINK_TYPE_NATIVE_JPG: pExt = "jpg"; break; - default:; //prevent warning - } - rExt.AssignAscii( pExt ); -} - String SwReadOnlyPopup::SaveGraphic( sal_uInt16 nId ) { - //Namen der Grafik herausfischen. + // fish out the graphic's name String aName; if ( MN_READONLY_SAVEBACKGROUND == nId ) { @@ -427,11 +417,10 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName ) FileDialogHelper aDlgHelper( TemplateDescription::FILESAVE_SIMPLE, 0 ); Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker(); -// aExpDlg.SetHelpId(HID_FILEDLG_ROMENU); INetURLObject aPath; aPath.SetSmartURL( sGrfPath ); - //Namen der Grafik herausfischen. + // fish out the graphic's name String aName = rGrfName; aDlgHelper.SetTitle( SW_RESSTR(STR_EXPORT_GRAFIK_TITLE)); @@ -445,7 +434,7 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName ) String aExt( aURL.GetExtension() ); if( !aExt.Len() ) - lcl_GetPreferedExtension( aExt, rGraphic ); + GetPreferedExtension( aExt, rGraphic ); aExt.ToLowerAscii(); sal_uInt16 nDfltFilter = USHRT_MAX; @@ -460,8 +449,8 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName ) } if ( USHRT_MAX == nDfltFilter ) { - //"falsche" Extension? - lcl_GetPreferedExtension( aExt, rGraphic ); + // "wrong" extension? + GetPreferedExtension( aExt, rGraphic ); for ( sal_uInt16 i = 0; i < nCount; ++i ) if ( aExt == rGF.GetExportFormatShortName( i ).ToLowerAscii() ) { @@ -477,14 +466,14 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName ) if( aDlgHelper.Execute() == ERRCODE_NONE ) { String sPath( xFP->getFiles().getConstArray()[0] ); - //verwendeten Pfad merken - bitte nicht wieder wegoptimieren! + // remember used path - please don't optimize away! aPath.SetSmartURL( sPath); sGrfPath = aPath.GetPath(); if( rGrfName.Len() && nDfltFilter == rGF.GetExportFormatNumber( xFltMgr->getCurrentFilter())) { - //Versuchen die Originalgrafik zu speichern. + // try to save the original graphic SfxMedium aIn( rGrfName, STREAM_READ | STREAM_NOCREATE, sal_True ); if( aIn.GetInStream() && !aIn.GetInStream()->GetError() ) @@ -521,3 +510,4 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/romenu.hxx b/sw/source/ui/docvw/romenu.hxx index f90d9cee7b..f138d841fd 100644 --- a/sw/source/ui/docvw/romenu.hxx +++ b/sw/source/ui/docvw/romenu.hxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -27,14 +28,9 @@ #ifndef _ROMENU_HXX #define _ROMENU_HXX - -#ifndef _GRAPH_HXX //autogen #include <vcl/graph.hxx> -#endif -#include <tools/list.hxx> -#ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> -#endif +#include <svl/stritem.hxx> class SwView; class SfxDispatcher; @@ -52,7 +48,7 @@ class SwReadOnlyPopup : public PopupMenu sTargetFrameName, sDescription, sGrfName; - List aThemeList; + std::vector<String> aThemeList; sal_Bool bGrfToGalleryAsLnk; ImageMap* pImageMap; INetImage* pTargetURL; @@ -65,11 +61,13 @@ class SwReadOnlyPopup : public PopupMenu public: SwReadOnlyPopup( const Point &rDPos, SwView &rV ); ~SwReadOnlyPopup(); - + void Execute( Window* pWin, const Point &rPPos ); void Execute( Window* pWin, sal_uInt16 nId ); }; +void GetPreferedExtension( String &rExt, const Graphic &rGrf ); #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx index 029e640080..d15150c1b6 100644 --- a/sw/source/ui/docvw/srcedtw.cxx +++ b/sw/source/ui/docvw/srcedtw.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,18 +31,12 @@ #include <hintids.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <svtools/textview.hxx> -#ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> -#endif -#ifndef _SCRBAR_HXX //autogen #include <vcl/scrbar.hxx> -#endif #include <sfx2/dispatch.hxx> #include <sfx2/app.hxx> #include <svtools/htmltokn.h> @@ -53,15 +48,9 @@ #include <svtools/ctrltool.hxx> #include <tools/time.hxx> #include <swmodule.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif -#ifndef _SRCVIEW_HXX #include <srcview.hxx> -#endif -#ifndef _HELPID_H #include <helpid.h> -#endif #include <deque> @@ -79,7 +68,6 @@ struct SwTextPortion typedef std::deque<SwTextPortion> SwTextPortions; - static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) { const sal_Unicode cOpenBracket = '<'; @@ -94,10 +82,10 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) const sal_uInt16 nStrLen = rSource.Len(); - sal_uInt16 nInsert = 0; // Number of inserted Portions - sal_uInt16 nActPos = 0; // Position, at the '<' was found - sal_uInt16 nOffset = 0; // Offset of nActPos for '<' - sal_uInt16 nPortStart = USHRT_MAX; // For the TextPortion + sal_uInt16 nInsert = 0; // number of inserted portions + sal_uInt16 nActPos = 0; // position, where '<' was found + sal_uInt16 nOffset = 0; // Offset of nActPos to '<' + sal_uInt16 nPortStart = USHRT_MAX; // for the TextPortion sal_uInt16 nPortEnd = 0; // SwTextPortion aText; while(nActPos < nStrLen) @@ -105,11 +93,11 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) svtools::ColorConfigEntry eFoundType = svtools::HTMLUNKNOWN; if(rSource.GetChar(nActPos) == cOpenBracket && nActPos < nStrLen - 2 ) { - // 'leere' Portion einfuegen + // insert 'empty' portion if(nPortEnd < nActPos - 1 ) { aText.nLine = 0; - // am Anfang nicht verschieben + // don't move at the beginning aText.nStart = nPortEnd; if(nInsert) aText.nStart += 1; @@ -122,7 +110,7 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) sal_Unicode cFollowNext = rSource.GetChar((xub_StrLen)(nActPos + 2)); if(cExclamation == cFollowFirst) { - // "<!" SGML oder Kommentar + // "<!" SGML or comment if(cMinus == cFollowNext && nActPos < nStrLen - 3 && cMinus == rSource.GetChar((xub_StrLen)(nActPos + 3))) { @@ -135,14 +123,14 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) } else if(cSlash == cFollowFirst) { - // "</" Slash ignorieren + // "</" ignore slash nPortStart = nActPos; nActPos++; nOffset++; } if(svtools::HTMLUNKNOWN == eFoundType) { - //jetzt koennte hier ein keyword folgen + // now here a keyword could follow sal_uInt16 nSrchPos = nActPos; while(++nSrchPos < nStrLen - 1) { @@ -159,29 +147,29 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) } if(nSrchPos > nActPos + 1) { - //irgend ein String wurde gefunden + // some string was found String sToken = rSource.Copy(nActPos + 1, nSrchPos - nActPos - 1 ); sToken.ToUpperAscii(); int nToken = ::GetHTMLToken(sToken); if(nToken) { - //Token gefunden + // Token was found eFoundType = svtools::HTMLKEYWORD; nPortEnd = nSrchPos; nPortStart = nActPos; } else { - //was war das denn? + // what was that? #if OSL_DEBUG_LEVEL > 1 - DBG_ERROR("Token nicht erkannt!"); - DBG_ERROR(ByteString(sToken, gsl_getSystemTextEncoding()).GetBuffer()); + OSL_ENSURE(false, "Token not recognised!"); + OSL_ENSURE(false, ByteString(sToken, gsl_getSystemTextEncoding()).GetBuffer()); #endif } } } - // jetzt muss noch '>' gesucht werden + // now we still have to look for '>' if(svtools::HTMLUNKNOWN != eFoundType) { sal_Bool bFound = sal_False; @@ -194,7 +182,7 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) } if(!bFound && (eFoundType == svtools::HTMLCOMMENT)) { - // Kommentar ohne Ende in dieser Zeile + // comment without ending in this line bFound = sal_True; nPortEnd = nStrLen - 1; } @@ -226,11 +214,6 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwSrcEditWindow::SwSrcEditWindow( Window* pParent, SwSrcView* pParentView ) : Window( pParent, WB_BORDER|WB_CLIPCHILDREN ), @@ -253,9 +236,7 @@ SwSrcEditWindow::SwSrcEditWindow( Window* pParent, SwSrcView* pParentView ) : CreateTextEngine(); pSourceViewConfig->AddListener(this); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ + SwSrcEditWindow::~SwSrcEditWindow() { pSourceViewConfig->RemoveListener(this); @@ -275,10 +256,6 @@ SwSrcEditWindow::SwSrcEditWindow( Window* pParent, SwSrcView* pParentView ) : delete pOutWin; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwSrcEditWindow::DataChanged( const DataChangedEvent& rDCEvt ) { Window::DataChanged( rDCEvt ); @@ -286,10 +263,10 @@ void SwSrcEditWindow::DataChanged( const DataChangedEvent& rDCEvt ) switch ( rDCEvt.GetType() ) { case DATACHANGED_SETTINGS: - // ScrollBars neu anordnen bzw. Resize ausloesen, da sich - // ScrollBar-Groesse geaendert haben kann. Dazu muss dann im - // Resize-Handler aber auch die Groesse der ScrollBars aus - // den Settings abgefragt werden. + // newly rearrange ScrollBars or trigger Resize, because + // ScrollBar size could have changed. For this, in the + // Resize handler the size of ScrollBars has to be queried + // from the settings as well. if( rDCEvt.GetFlags() & SETTINGS_STYLE ) Resize(); break; @@ -298,7 +275,7 @@ void SwSrcEditWindow::DataChanged( const DataChangedEvent& rDCEvt ) void SwSrcEditWindow::Resize() { - // ScrollBars, etc. passiert in Adjust... + // ScrollBars, etc. happens in Adjust... if ( pTextView ) { long nVisY = pTextView->GetStartDocPos().Y(); @@ -330,7 +307,7 @@ void SwSrcEditWindow::Resize() pOutWin->SetOutputSizePixel(aOutSz); InitScrollBars(); - // Zeile im ersten Resize setzen + // set line in first Resize if(USHRT_MAX != nStartLine) { if(nStartLine < pTextEngine->GetParagraphCount()) @@ -348,10 +325,6 @@ void SwSrcEditWindow::Resize() } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void TextViewOutWin::DataChanged( const DataChangedEvent& rDCEvt ) { Window::DataChanged( rDCEvt ); @@ -359,7 +332,7 @@ void TextViewOutWin::DataChanged( const DataChangedEvent& rDCEvt ) switch( rDCEvt.GetType() ) { case DATACHANGED_SETTINGS: - // den Settings abgefragt werden. + // query settings if( rDCEvt.GetFlags() & SETTINGS_STYLE ) { const Color &rCol = GetSettings().GetStyleSettings().GetWindowColor(); @@ -378,11 +351,6 @@ void TextViewOutWin::MouseMove( const MouseEvent &rEvt ) pTextView->MouseMove( rEvt ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void TextViewOutWin::MouseButtonUp( const MouseEvent &rEvt ) { if ( pTextView ) @@ -395,11 +363,6 @@ void TextViewOutWin::MouseButtonUp( const MouseEvent &rEvt ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void TextViewOutWin::MouseButtonDown( const MouseEvent &rEvt ) { GrabFocus(); @@ -407,11 +370,6 @@ void TextViewOutWin::MouseButtonDown( const MouseEvent &rEvt ) pTextView->MouseButtonDown( rEvt ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void TextViewOutWin::Command( const CommandEvent& rCEvt ) { switch(rCEvt.GetCommand()) @@ -440,12 +398,6 @@ void TextViewOutWin::Command( const CommandEvent& rCEvt ) } } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void TextViewOutWin::KeyInput( const KeyEvent& rKEvt ) { sal_Bool bDone = sal_False; @@ -484,21 +436,11 @@ void TextViewOutWin::KeyInput( const KeyEvent& rKEvt ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void TextViewOutWin::Paint( const Rectangle& rRect ) { pTextView->Paint( rRect ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwSrcEditWindow::CreateTextEngine() { const Color &rCol = GetSettings().GetStyleSettings().GetWindowColor(); @@ -507,14 +449,14 @@ void SwSrcEditWindow::CreateTextEngine() pOutWin->SetPointer(Pointer(POINTER_TEXT)); pOutWin->Show(); - //Scrollbars anlegen + // create Scrollbars pHScrollbar = new ScrollBar(this, WB_3DLOOK |WB_HSCROLL|WB_DRAG); - pHScrollbar->EnableRTL( false ); // #107300# --- RTL --- no mirroring for scrollbars + pHScrollbar->EnableRTL( false ); // --- RTL --- no mirroring for scrollbars pHScrollbar->SetScrollHdl(LINK(this, SwSrcEditWindow, ScrollHdl)); pHScrollbar->Show(); pVScrollbar = new ScrollBar(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG); - pVScrollbar->EnableRTL( false ); // #107300# --- RTL --- no mirroring for scrollbars + pVScrollbar->EnableRTL( false ); // --- RTL --- no mirroring for scrollbars pVScrollbar->SetScrollHdl(LINK(this, SwSrcEditWindow, ScrollHdl)); pHScrollbar->EnableDrag(); pVScrollbar->Show(); @@ -548,31 +490,16 @@ void SwSrcEditWindow::CreateTextEngine() SfxBindings& rBind = GetSrcView()->GetViewFrame()->GetBindings(); rBind.Invalidate( SID_TABLE_CELL ); -// rBind.Invalidate( SID_ATTR_CHAR_FONTHEIGHT ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwSrcEditWindow::SetScrollBarRanges() { - // Extra-Methode, nicht InitScrollBars, da auch fuer TextEngine-Events. + // Extra method, not InitScrollBars, because also for TextEngine events. pHScrollbar->SetRange( Range( 0, nCurTextWidth-1 ) ); pVScrollbar->SetRange( Range(0, pTextEngine->GetTextHeight()-1) ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwSrcEditWindow::InitScrollBars() { SetScrollBarRanges(); @@ -589,11 +516,6 @@ void SwSrcEditWindow::InitScrollBars() } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll) { if(pScroll == pVScrollbar) @@ -614,20 +536,15 @@ IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll) return 0; } -/*-----------------15.01.97 09.22------------------- - ---------------------------------------------------*/ - IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) { Time aSyntaxCheckStart; - DBG_ASSERT( pTextView, "Noch keine View, aber Syntax-Highlight ?!" ); - // pTextEngine->SetUpdateMode( sal_False ); + OSL_ENSURE( pTextView, "Noch keine View, aber Syntax-Highlight ?!" ); bHighlighting = sal_True; sal_uInt16 nLine; sal_uInt16 nCount = 0; - // zuerst wird der Bereich um dem Cursor bearbeitet + // at first the region around the cursor is processed TextSelection aSel = pTextView->GetSelection(); sal_uInt16 nCur = (sal_uInt16)aSel.GetStart().GetPara(); if(nCur > 40) @@ -653,7 +570,7 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) } } - // wenn dann noch etwas frei ist, wird von Beginn an weitergearbeitet + // when there is still anything left by then, go on from the beginning void* p = aSyntaxLineTable.First(); while ( p && nCount < MAX_SYNTAX_HIGHLIGHT) { @@ -669,21 +586,11 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) break; } } - // os: #43050# hier wird ein TextView-Problem umpopelt: - // waehrend des Highlightings funktionierte das Scrolling nicht - /* MT: Shouldn't be a oproblem any more, using IdeFormatter in Insert/RemoveAttrib now. - - TextView* pTmp = pTextEngine->GetActiveView(); - pTextEngine->SetActiveView(0); - // pTextEngine->SetUpdateMode( sal_True ); - pTextEngine->SetActiveView(pTmp); - pTextView->ShowCursor(sal_False, sal_False); - */ if(aSyntaxLineTable.Count() && !pTimer->IsActive()) pTimer->Start(); - // SyntaxTimerHdl wird gerufen, wenn Text-Aenderung - // => gute Gelegenheit, Textbreite zu ermitteln! + // SyntaxTimerHdl is called when text changed + // => good opportunity to determine text width! long nPrevTextWidth = nCurTextWidth; nCurTextWidth = pTextEngine->CalcTextWidth() + 25; // kleine Toleranz if ( nCurTextWidth != nPrevTextWidth ) @@ -692,14 +599,11 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) return 0; } -/*-----------------15.01.97 10.01------------------- - ---------------------------------------------------*/ void SwSrcEditWindow::DoSyntaxHighlight( sal_uInt16 nPara ) { - // Durch das DelayedSyntaxHighlight kann es passieren, - // dass die Zeile nicht mehr existiert! + // Because of DelayedSyntaxHighlight it could happen, + // that the line doesn't exist anymore! if ( nPara < pTextEngine->GetParagraphCount() ) { sal_Bool bTempModified = IsModified(); @@ -707,14 +611,11 @@ void SwSrcEditWindow::DoSyntaxHighlight( sal_uInt16 nPara ) String aSource( pTextEngine->GetText( nPara ) ); pTextEngine->SetUpdateMode( sal_False ); ImpDoHighlight( aSource, nPara ); - // os: #43050# hier wird ein TextView-Problem umpopelt: - // waehrend des Highlightings funktionierte das Scrolling nicht TextView* pTmp = pTextEngine->GetActiveView(); pTmp->SetAutoScroll(sal_False); pTextEngine->SetActiveView(0); pTextEngine->SetUpdateMode( sal_True ); pTextEngine->SetActiveView(pTmp); - // Bug 72887 show the cursor pTmp->SetAutoScroll(sal_True); pTmp->ShowCursor( sal_False/*pTmp->IsAutoScroll()*/ ); @@ -723,10 +624,6 @@ void SwSrcEditWindow::DoSyntaxHighlight( sal_uInt16 nPara ) } } -/*-----------------15.01.97 09.49------------------- - ---------------------------------------------------*/ - void SwSrcEditWindow::DoDelayedSyntaxHighlight( sal_uInt16 nPara ) { if ( !bHighlighting && bDoSyntaxHighlight ) @@ -736,10 +633,6 @@ void SwSrcEditWindow::DoDelayedSyntaxHighlight( sal_uInt16 nPara ) } } -/*-----------------15.01.97 11.32------------------- - ---------------------------------------------------*/ - void SwSrcEditWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff ) { SwTextPortions aPortionList; @@ -750,7 +643,7 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff return; SwTextPortion& rLast = aPortionList[nCount-1]; - if ( rLast.nStart > rLast.nEnd ) // Nur bis Bug von MD behoeben + if ( rLast.nStart > rLast.nEnd ) // Only until Bug from MD is resolved { nCount--; aPortionList.pop_back(); @@ -758,32 +651,31 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff return; } - // Evtl. Optimieren: - // Wenn haufig gleiche Farbe, dazwischen Blank ohne Farbe, - // ggf. zusammenfassen, oder zumindest das Blank, - // damit weniger Attribute + // maybe optimize: + // If frequently the same color, blank without color in between, + // maybe summarize or at least the blank; for less attributes sal_Bool bOptimizeHighlight = sal_True; // war in der BasicIDE static if ( bOptimizeHighlight ) { - // Es muessen nur die Blanks und Tabs mit attributiert werden. - // Wenn zwei gleiche Attribute hintereinander eingestellt werden, - // optimiert das die TextEngine. + // Only blanks and tabs have to be attributed along. + // When two identical attributes are placed consecutively, + // it optimises the TextEngine. sal_uInt16 nLastEnd = 0; -#ifdef DBG_UTIL - sal_uInt16 nLine = aPortionList[0].nLine; -#endif for ( size_t i = 0; i < nCount; i++ ) { SwTextPortion& r = aPortionList[i]; - DBG_ASSERT( r.nLine == nLine, "doch mehrere Zeilen ?" ); - if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoeben +#if OSL_DEBUG_LEVEL > 1 + sal_uInt16 nLine = aPortionList[0].nLine; + OSL_ENSURE( r.nLine == nLine, "doch mehrere Zeilen ?" ); +#endif + if ( r.nStart > r.nEnd ) // only until Bug from MD is resolved continue; if ( r.nStart > nLastEnd ) { - // Kann ich mich drauf verlassen, dass alle ausser - // Blank und Tab gehighlightet wird ?! + // Can I rely on the fact that all except blank and tab + // are being highlighted?! r.nStart = nLastEnd; } nLastEnd = r.nEnd+1; @@ -795,7 +687,7 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff for ( size_t i = 0; i < aPortionList.size(); i++ ) { SwTextPortion& r = aPortionList[i]; - if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoeben + if ( r.nStart > r.nEnd ) // only until Bug from MD is resolved continue; if(r.eType != svtools::HTMLSGML && r.eType != svtools::HTMLCOMMENT && @@ -808,10 +700,6 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff } } -/*-----------------30.06.97 09:12------------------- - ---------------------------------------------------*/ - void SwSrcEditWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { if ( rHint.ISA( TextHint ) ) @@ -843,10 +731,6 @@ void SwSrcEditWindow::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdC SetFont(); } -/*-----------------30.06.97 13:22------------------- - ---------------------------------------------------*/ - void SwSrcEditWindow::Invalidate(sal_uInt16 ) { pOutWin->Invalidate(); @@ -883,15 +767,6 @@ void SwSrcEditWindow::GetFocus() pOutWin->GrabFocus(); } -/*void SwSrcEditWindow::LoseFocus() -{ - Window::LoseFocus(); -// pOutWin->LoseFocus(); -// rView.LostFocus(); -} */ -/* -----------------------------29.08.2002 13:21------------------------------ - - ---------------------------------------------------------------------------*/ sal_Bool lcl_GetLanguagesForEncoding(rtl_TextEncoding eEnc, LanguageType aLanguages[]) { switch(eEnc) @@ -1048,8 +923,6 @@ sal_Bool lcl_GetLanguagesForEncoding(rtl_TextEncoding eEnc, LanguageType aLangu case RTL_TEXTENCODING_TIS_620 : aLanguages[0] = LANGUAGE_THAI; break; -// case RTL_TEXTENCODING_SYMBOL : -// case RTL_TEXTENCODING_DONTKNOW: : default: aLanguages[0] = Application::GetSettings().GetUILanguage(); } return aLanguages[0] != LANGUAGE_SYSTEM; @@ -1088,12 +961,11 @@ void SwSrcEditWindow::SetFont() GetTextEngine()->SetFont( aFont ); pOutWin->SetFont(aFont); } -/* -----------------------------29.08.2002 13:47------------------------------ - ---------------------------------------------------------------------------*/ void SwSrcEditWindow::SetTextEncoding(rtl_TextEncoding eEncoding) { eSourceEncoding = eEncoding; SetFont(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/envelp.src b/sw/source/ui/envelp/envelp.src index 285f488709..94cc2d40e6 100644 --- a/sw/source/ui/envelp/envelp.src +++ b/sw/source/ui/envelp/envelp.src @@ -26,7 +26,6 @@ ************************************************************************/ // #pragma ****************************************************************** - // #include ***************************************************************** #include "envelp.hrc" #include "globals.hrc" // Strings ****************************************************************** diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index 525085f51e..381ec6cd1e 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,9 +33,6 @@ #undef SW_DLLIMPLEMENTATION #endif - - - #include <hintids.hxx> #include <tools/pstm.hxx> @@ -43,44 +41,30 @@ #define _SVSTDARR_LONGS #include <svl/svstdarr.hxx> #include <editeng/paperinf.hxx> -#ifndef _SVX_TSTPITEM_HXX //autogen #include <editeng/tstpitem.hxx> -#endif #include <editeng/lrspitem.hxx> #include <editeng/brshitem.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif -#ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <frmatr.hxx> #include <swtypes.hxx> #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif -#ifndef _BASESH_HXX #include <basesh.hxx> -#endif #include <drpcps.hxx> #include <envfmt.hxx> #include <fmtcol.hxx> -#ifndef _PARDLG_HXX #include "swuipardlg.hxx" -#endif #include <pattern.hxx> #include <poolfmt.hxx> #include <uiborder.hxx> #include <uitool.hxx> -#ifndef _ENVFMT_HRC #include <envfmt.hrc> -#endif + +#include <vector> #include "swabstdlg.hxx" #include "chrdlg.hrc" @@ -94,9 +78,6 @@ static PopupMenu *pMenu; static long lUserW = 5669; // 10 cm static long lUserH = 5669; // 10 cm -// -------------------------------------------------------------------------- - - SwEnvFmtPage::SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet) : SfxTabPage(pParent, SW_RES(TP_ENV_FMT), rSet), @@ -130,7 +111,7 @@ SwEnvFmtPage::SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet) : FreeResource(); SetExchangeSupport(); - // Metriken + // Metrics FieldUnit aMetric = ::GetDfltMetric(sal_False); SetMetric(aAddrLeftField, aMetric); SetMetric(aAddrTopField, aMetric); @@ -139,12 +120,12 @@ SwEnvFmtPage::SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet) : SetMetric(aSizeWidthField, aMetric); SetMetric(aSizeHeightField, aMetric); - // Menues einhaengen + // Hook in Menues ::pMenu = new PopupMenu(SW_RES(MNU_EDIT)); aAddrEditButton.SetPopupMenu(::pMenu); aSendEditButton.SetPopupMenu(::pMenu); - // Handler installieren + // Install handlers Link aLk = LINK(this, SwEnvFmtPage, ModifyHdl); aAddrLeftField .SetUpHdl( aLk ); aAddrTopField .SetUpHdl( aLk ); @@ -202,19 +183,13 @@ SwEnvFmtPage::SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet) : } -// -------------------------------------------------------------------------- - - -__EXPORT SwEnvFmtPage::~SwEnvFmtPage() +SwEnvFmtPage::~SwEnvFmtPage() { aAddrEditButton.SetPopupMenu(0); aSendEditButton.SetPopupMenu(0); delete ::pMenu; } -// -------------------------------------------------------------------------- - - IMPL_LINK_INLINE_START( SwEnvFmtPage, ModifyHdl, Edit *, pEdit ) { long lWVal = static_cast< long >(GetFldVal(aSizeWidthField )); @@ -231,7 +206,7 @@ IMPL_LINK_INLINE_START( SwEnvFmtPage, ModifyHdl, Edit *, pEdit ) if (aIDs[i] == (sal_uInt16)ePaper) aSizeFormatBox.SelectEntryPos(i); - // Benutzergroesse merken + // remember user size if (aIDs[aSizeFormatBox.GetSelectEntryPos()] == (sal_uInt16)PAPER_USER) { lUserW = lWidth ; @@ -250,20 +225,17 @@ IMPL_LINK_INLINE_START( SwEnvFmtPage, ModifyHdl, Edit *, pEdit ) } IMPL_LINK_INLINE_END( SwEnvFmtPage, ModifyHdl, Edit *, pEdit ) -// -------------------------------------------------------------------------- - - IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton ) { SwWrtShell* pSh = GetParent()->pSh; - ASSERT(pSh, "Shell fehlt"); + OSL_ENSURE(pSh, "Shell missing"); - // Collection-Ptr ermitteln + // determine collection-ptr sal_Bool bSender = pButton != &aAddrEditButton; SwTxtFmtColl* pColl = pSh->GetTxtCollFromPool( static_cast< sal_uInt16 >( bSender ? RES_POOLCOLL_SENDADRESS : RES_POOLCOLL_JAKETADRESS)); - ASSERT(pColl, "Text-Collection fehlt"); + OSL_ENSURE(pColl, "Text collection missing"); switch (pButton->GetCurItemId()) { @@ -271,11 +243,11 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton ) { SfxItemSet *pCollSet = GetCollItemSet(pColl, bSender); - // Damit die Hintergrundfarbe nicht uebergebuegelt wird: + // In order for the background color not to get ironed over: SfxAllItemSet aTmpSet(*pCollSet); - // Das CHRATR_BACKGROUND-Attribut wird fuer den Dialog in - // ein RES_BACKGROUND verwandelt und wieder zurueck ... + // The CHRATR_BACKGROUND attribute gets transformed into a + // RES_BACKGROUND for the dialog and back again ... const SfxPoolItem *pTmpBrush; if( SFX_ITEM_SET == aTmpSet.GetItemState( RES_CHRATR_BACKGROUND, @@ -289,10 +261,10 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton ) aTmpSet.ClearItem( RES_BACKGROUND ); SwAbstractDialogFactory* pFact = swui::GetFactory(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( GetParent(), pSh->GetView(), aTmpSet, DLG_CHAR ,&pColl->GetName() ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if (pDlg->Execute() == RET_OK) { SfxItemSet aOutputSet( *pDlg->GetOutputItemSet() ); @@ -315,10 +287,10 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton ) { SfxItemSet *pCollSet = GetCollItemSet(pColl, bSender); - // Damit die Tabulatoren nicht uebergebuegelt werden: + // In order for the tabulators not to get ironed over: SfxAllItemSet aTmpSet(*pCollSet); - // Tabulatoren, DefaultTabs ins ItemSet Stecken + // Insert tabs, default tabs into ItemSet const SvxTabStopItem& rDefTabs = (const SvxTabStopItem&) pSh->GetView().GetCurShell()->GetPool().GetDefaultItem(RES_PARATR_TABSTOP); @@ -326,27 +298,28 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton ) SfxUInt16Item aDefDistItem( SID_ATTR_TABSTOP_DEFAULTS, nDefDist ); aTmpSet.Put( aDefDistItem ); - // Aktueller Tab + // Current tab SfxUInt16Item aTabPos( SID_ATTR_TABSTOP_POS, 0 ); aTmpSet.Put( aTabPos ); - // linker Rand als Offset + // left border as offset const long nOff = ((SvxLRSpaceItem&)aTmpSet.Get( RES_LR_SPACE )). GetTxtLeft(); SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff ); aTmpSet.Put( aOff ); - // BoxInfo setzen + // set BoxInfo ::PrepareBoxInfo( aTmpSet, *pSh ); SwParaDlg *pDlg = new SwParaDlg(GetParent(), pSh->GetView(), aTmpSet, DLG_ENVELOP, &pColl->GetName()); if ( pDlg->Execute() == RET_OK ) { - // Defaults evtl umsetzen + // maybe relocate defaults const SfxPoolItem* pItem = 0; SfxItemSet* pOutputSet = (SfxItemSet*)pDlg->GetOutputItemSet(); sal_uInt16 nNewDist; + if( SFX_ITEM_SET == pOutputSet->GetItemState( SID_ATTR_TABSTOP_DEFAULTS, sal_False, &pItem ) && nDefDist != (nNewDist = ((SfxUInt16Item*)pItem)->GetValue()) ) @@ -358,7 +331,6 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton ) } if( pOutputSet->Count() ) { - //pColl->SetAttr( *pOutputSet ); pCollSet->Put(*pOutputSet); } } @@ -370,7 +342,7 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton ) } /*------------------------------------------------------------------------ - Beschreibung: Ein temporaeres Itemset, das bei Abbruch verworfen wird + Description: A temporary Itemset that gets discarded at abort ------------------------------------------------------------------------*/ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, sal_Bool bSender) @@ -379,10 +351,10 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, sal_Bool bSender) if (!pAddrSet) { - // Range ermitteln (Ranges beider Itemsets mergen) + // determine range (merge both Itemsets' ranges) const sal_uInt16 *pRanges = pColl->GetAttrSet().GetRanges(); - static sal_uInt16 __READONLY_DATA aRanges[] = + static sal_uInt16 const aRanges[] = { RES_PARATR_BEGIN, RES_PARATR_ADJUST, RES_PARATR_TABSTOP, RES_PARATR_END-1, @@ -395,7 +367,7 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, sal_Bool bSender) 0, 0 }; - // BruteForce-Merge, weil MergeRange in SvTools buggy ist: + // BruteForce merge because MergeRange in SvTools is buggy: sal_uInt16 i = 0; SvLongsSort aMergedRanges( 0, 10 ); @@ -415,32 +387,30 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, sal_Bool bSender) i += 2; } - // Ranges kompaktieren - SvLongs aCompactedRanges( 0, 10 ); + // compact ranges + std::vector<sal_uInt16> aCompactedRanges; - aCompactedRanges.Insert(aMergedRanges[0], aCompactedRanges.Count()); + aCompactedRanges.push_back(aMergedRanges[0]); - for (i = 0; i < aMergedRanges.Count(); i++) + for (i = 0; i < aMergedRanges.Count(); ++i) { while (i + 1 < aMergedRanges.Count() && aMergedRanges[i+1] - aMergedRanges[i] == 1) { i++; } - long nEnd = aMergedRanges[i]; - aCompactedRanges.Insert(nEnd, aCompactedRanges.Count()); + aCompactedRanges.push_back( aMergedRanges[i] ); if (i + 1 < aMergedRanges.Count()) { - long nStart = aMergedRanges[i+1]; - aCompactedRanges.Insert(nStart, aCompactedRanges.Count()); + aCompactedRanges.push_back( aMergedRanges[i+1] ); } } - // Neue Ranges erzeugen - sal_uInt16 *pNewRanges = new sal_uInt16[aCompactedRanges.Count() + 1]; - for (i = 0; i < aCompactedRanges.Count(); i++) - pNewRanges[i] = (sal_uInt16)aCompactedRanges[i]; + // create new ranges + sal_uInt16 *pNewRanges = new sal_uInt16[aCompactedRanges.size() + 1]; + for (i = 0; i < aCompactedRanges.size(); ++i) + pNewRanges[i] = aCompactedRanges[i]; pNewRanges[i] = 0; @@ -454,9 +424,6 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, sal_Bool bSender) return pAddrSet; } -// -------------------------------------------------------------------------- - - IMPL_LINK( SwEnvFmtPage, FormatHdl, ListBox *, EMPTYARG ) { long lWidth; @@ -499,9 +466,6 @@ IMPL_LINK( SwEnvFmtPage, FormatHdl, ListBox *, EMPTYARG ) return 0; } -// -------------------------------------------------------------------------- - - void SwEnvFmtPage::SetMinMax() { long lWVal = static_cast< long >(GetFldVal(aSizeWidthField )); @@ -510,7 +474,7 @@ void SwEnvFmtPage::SetMinMax() long lWidth = Max(lWVal, lHVal), lHeight = Min(lWVal, lHVal); - // Min und Max + // Min and Max aAddrLeftField.SetMin((long) 100 * (GetFldVal(aSendLeftField) + 566), FUNIT_TWIP); aAddrLeftField.SetMax((long) 100 * (lWidth - 2 * 566), FUNIT_TWIP); aAddrTopField .SetMin((long) 100 * (GetFldVal(aSendTopField ) + 2 * 566), FUNIT_TWIP); @@ -520,7 +484,7 @@ void SwEnvFmtPage::SetMinMax() aSendTopField .SetMin((long) 100 * (566), FUNIT_TWIP); aSendTopField .SetMax((long) 100 * (GetFldVal(aAddrTopField ) - 2 * 566), FUNIT_TWIP); - // First und Last + // First and last aAddrLeftField.SetFirst(aAddrLeftField.GetMin()); aAddrLeftField.SetLast (aAddrLeftField.GetMax()); aAddrTopField .SetFirst(aAddrTopField .GetMin()); @@ -530,7 +494,7 @@ void SwEnvFmtPage::SetMinMax() aSendTopField .SetFirst(aSendTopField .GetMin()); aSendTopField .SetLast (aSendTopField .GetMax()); - // Fields neu formatieren + // Reformat fields aAddrLeftField .Reformat(); aAddrTopField .Reformat(); aSendLeftField .Reformat(); @@ -539,37 +503,25 @@ void SwEnvFmtPage::SetMinMax() aSizeHeightField.Reformat(); } -// -------------------------------------------------------------------------- - - -SfxTabPage* __EXPORT SwEnvFmtPage::Create(Window* pParent, const SfxItemSet& rSet) +SfxTabPage* SwEnvFmtPage::Create(Window* pParent, const SfxItemSet& rSet) { return new SwEnvFmtPage(pParent, rSet); } -// ---------------------------------------------------------------------------- - - -void __EXPORT SwEnvFmtPage::ActivatePage(const SfxItemSet& rSet) +void SwEnvFmtPage::ActivatePage(const SfxItemSet& rSet) { SfxItemSet aSet(rSet); aSet.Put(GetParent()->aEnvItem); Reset(aSet); } -// ---------------------------------------------------------------------------- - - -int __EXPORT SwEnvFmtPage::DeactivatePage(SfxItemSet* _pSet) +int SwEnvFmtPage::DeactivatePage(SfxItemSet* _pSet) { if( _pSet ) FillItemSet(*_pSet); return SfxTabPage::LEAVE_PAGE; } -// -------------------------------------------------------------------------- - - void SwEnvFmtPage::FillItem(SwEnvItem& rItem) { rItem.lAddrFromLeft = static_cast< sal_Int32 >(GetFldVal(aAddrLeftField)); @@ -594,20 +546,14 @@ void SwEnvFmtPage::FillItem(SwEnvItem& rItem) } } -// -------------------------------------------------------------------------- - - -sal_Bool __EXPORT SwEnvFmtPage::FillItemSet(SfxItemSet& rSet) +sal_Bool SwEnvFmtPage::FillItemSet(SfxItemSet& rSet) { FillItem(GetParent()->aEnvItem); rSet.Put(GetParent()->aEnvItem); return sal_True; } -// -------------------------------------------------------------------------- - - -void __EXPORT SwEnvFmtPage::Reset(const SfxItemSet& rSet) +void SwEnvFmtPage::Reset(const SfxItemSet& rSet) { const SwEnvItem& rItem = (const SwEnvItem&) rSet.Get(FN_ENVELOP); @@ -618,7 +564,7 @@ void __EXPORT SwEnvFmtPage::Reset(const SfxItemSet& rSet) if (aIDs[i] == (sal_uInt16)ePaper) aSizeFormatBox.SelectEntryPos(i); - // Die MetricFields + // Metric fields SetFldVal(aAddrLeftField, rItem.lAddrFromLeft); SetFldVal(aAddrTopField , rItem.lAddrFromTop ); SetFldVal(aSendLeftField, rItem.lSendFromLeft); @@ -633,3 +579,4 @@ void __EXPORT SwEnvFmtPage::Reset(const SfxItemSet& rSet) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/envfmt.hrc b/sw/source/ui/envelp/envfmt.hrc index df10c15a12..17cd764a9d 100644 --- a/sw/source/ui/envelp/envfmt.hrc +++ b/sw/source/ui/envelp/envfmt.hrc @@ -28,11 +28,9 @@ #ifndef _ENVFMT_HRC #define _ENVFMT_HRC -// #include ***************************************************************** - #include "envelp.hrc" -// Lokale Resourcen ********************************************************* +// local resources ********************************************************* #define FL_ADDRESSEE 11 #define TXT_ADDR_POS 12 @@ -66,11 +64,11 @@ #define MID_CHAR 1 #define MID_PARA 2 -// Globale Resourcen ******************************************************** +// global resources ******************************************************** #define MNU_EDIT (RC_ENVFMT_BEGIN ) -// Ueberlaufpruefung ******************************************************** +// overflow check ******************************************************** #define ENVFMT_ACT_END MNU_EDIT diff --git a/sw/source/ui/envelp/envfmt.hxx b/sw/source/ui/envelp/envfmt.hxx index 9691c9bfae..de5845d007 100644 --- a/sw/source/ui/envelp/envfmt.hxx +++ b/sw/source/ui/envelp/envfmt.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,15 +34,9 @@ #include <svl/svstdarr.hxx> #endif #include <svtools/stdctrl.hxx> -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif -#ifndef _MENUBTN_HXX //autogen #include <vcl/menubtn.hxx> -#endif -#ifndef _GROUP_HXX //autogen #include <vcl/group.hxx> -#endif #include "envlop.hxx" @@ -110,3 +105,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/envfmt.src b/sw/source/ui/envelp/envfmt.src index ccca0c6b44..fbba44527b 100644 --- a/sw/source/ui/envelp/envfmt.src +++ b/sw/source/ui/envelp/envfmt.src @@ -26,7 +26,6 @@ ************************************************************************/ // #pragma ****************************************************************** - // #include ***************************************************************** #include "envfmt.hrc" #include "helpid.h" // TP_ENV_FMT --------------------------------------------------------------- diff --git a/sw/source/ui/envelp/envimg.cxx b/sw/source/ui/envelp/envimg.cxx index 7cc04560dc..ff9e07ee5f 100644 --- a/sw/source/ui/envelp/envimg.cxx +++ b/sw/source/ui/envelp/envimg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,16 +39,11 @@ #include <unotools/useroptions.hxx> #include <tools/shl.hxx> #include <swmodule.hxx> -#include <errhdl.hxx> #include <swtypes.hxx> #include <envimg.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _ENVELP_HRC #include <envelp.hrc> -#endif #include <unomid.h> @@ -58,13 +54,13 @@ #endif using namespace utl; -using namespace rtl; using namespace ::com::sun::star::uno; +using ::rtl::OUString; + TYPEINIT1_AUTOFACTORY( SwEnvItem, SfxPoolItem ); -// -------------------------------------------------------------------------- SW_DLLPUBLIC String MakeSender() { SvtUserOptions& rUserOpt = SW_MOD()->GetUserOptions(); @@ -107,7 +103,7 @@ SW_DLLPUBLIC String MakeSender() } return sRet; } -// -------------------------------------------------------------------------- + SwEnvItem::SwEnvItem() : SfxPoolItem(FN_ENVELOP) { @@ -127,7 +123,7 @@ SwEnvItem::SwEnvItem() : lAddrFromLeft = Max(lWidth, lHeight) / 2; lAddrFromTop = Min(lWidth, lHeight) / 2; } -// -------------------------------------------------------------------------- + SwEnvItem::SwEnvItem(const SwEnvItem& rItem) : SfxPoolItem(FN_ENVELOP), aAddrText (rItem.aAddrText), @@ -146,7 +142,6 @@ SwEnvItem::SwEnvItem(const SwEnvItem& rItem) : { } -// -------------------------------------------------------------------------- SwEnvItem& SwEnvItem::operator =(const SwEnvItem& rItem) { aAddrText = rItem.aAddrText; @@ -164,7 +159,7 @@ SwEnvItem& SwEnvItem::operator =(const SwEnvItem& rItem) lShiftDown = rItem.lShiftDown; return *this; } -// -------------------------------------------------------------------------- + int SwEnvItem::operator ==(const SfxPoolItem& rItem) const { const SwEnvItem& rEnv = (const SwEnvItem&) rItem; @@ -184,13 +179,11 @@ int SwEnvItem::operator ==(const SfxPoolItem& rItem) const lShiftDown == rEnv.lShiftDown; } -// -------------------------------------------------------------------------- SfxPoolItem* SwEnvItem::Clone(SfxItemPool*) const { return new SwEnvItem(*this); } -// -------------------------------------------------------------------------- -// -------------------------------------------------------------------------- + SwEnvCfgItem::SwEnvCfgItem() : ConfigItem(C2U("Office.Writer/Envelope")) { @@ -198,7 +191,7 @@ SwEnvCfgItem::SwEnvCfgItem() : Sequence<Any> aValues = GetProperties(aNames); EnableNotification(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) @@ -253,15 +246,11 @@ SwEnvCfgItem::SwEnvCfgItem() : } } } -/* -----------------------------26.09.00 14:04-------------------------------- - ---------------------------------------------------------------------------*/ SwEnvCfgItem::~SwEnvCfgItem() { } -/* -----------------------------26.09.00 14:05-------------------------------- - ---------------------------------------------------------------------------*/ void SwEnvCfgItem::Commit() { Sequence<OUString> aNames = GetPropertyNames(); @@ -293,9 +282,6 @@ void SwEnvCfgItem::Commit() void SwEnvCfgItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} -/* -----------------------------26.09.00 14:04-------------------------------- - - ---------------------------------------------------------------------------*/ Sequence<rtl::OUString> SwEnvCfgItem::GetPropertyNames() { static const char* aPropNames[] = @@ -317,14 +303,16 @@ Sequence<rtl::OUString> SwEnvCfgItem::GetPropertyNames() const int nCount = 13; Sequence<OUString> aNames(nCount); OUString* pNames = aNames.getArray(); + for(int i = 0; i < nCount; i++) pNames[i] = OUString::createFromAscii(aPropNames[i]); + return aNames; } -sal_Bool SwEnvItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const +bool SwEnvItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const { - sal_Bool bRet = sal_True; + sal_Bool bRet = true; switch(nMemberId & ~CONVERT_TWIPS) { case MID_ENV_ADDR_TEXT : rVal <<= aAddrText; break; @@ -341,17 +329,15 @@ sal_Bool SwEnvItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const case MID_ENV_SHIFT_RIGHT : rVal <<= lShiftRight; break; case MID_ENV_SHIFT_DOWN : rVal <<= lShiftDown; break; default: - DBG_ERROR("Wrong memberId"); - bRet = sal_False; + OSL_ENSURE(false, "Wrong memberId"); + bRet = false; } return bRet; } -/* -----------------------------26.04.01 12:26-------------------------------- - ---------------------------------------------------------------------------*/ -sal_Bool SwEnvItem::PutValue(const Any& rVal, sal_uInt8 nMemberId) +bool SwEnvItem::PutValue(const Any& rVal, sal_uInt8 nMemberId) { - sal_Bool bRet = sal_False; + bool bRet = false; switch(nMemberId & ~CONVERT_TWIPS) { case MID_ENV_ADDR_TEXT : bRet = (rVal >>= aAddrText); break; @@ -375,7 +361,9 @@ sal_Bool SwEnvItem::PutValue(const Any& rVal, sal_uInt8 nMemberId) case MID_ENV_SHIFT_RIGHT : bRet = (rVal >>= lShiftRight); break; case MID_ENV_SHIFT_DOWN : bRet = (rVal >>= lShiftDown); break; default: - DBG_ERROR("Wrong memberId"); + OSL_ENSURE(false,"Wrong memberId"); } return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/envlop.hrc b/sw/source/ui/envelp/envlop.hrc index 359b9f2419..5c03de172f 100644 --- a/sw/source/ui/envelp/envlop.hrc +++ b/sw/source/ui/envelp/envlop.hrc @@ -28,11 +28,9 @@ #ifndef _ENVLOP_HRC #define _ENVLOP_HRC -// #include ***************************************************************** - #include "envelp.hrc" -// Lokale Resourcen ********************************************************* +// local resources ********************************************************* #define TXT_ADDR 1 #define EDT_ADDR 2 @@ -48,11 +46,11 @@ #define WIN_PREVIEW 12 #define ST_INSERT 13 #define ST_CHANGE 14 -// Globale Resourcen ******************************************************** +// global resources ******************************************************** #define STR_DOC_TITLE (RC_ENVLOP_BEGIN) -// Ueberlaufpruefung ******************************************************** +// overflow check ******************************************************** #define ENVLOP_ACT_END STR_DOC_TITLE diff --git a/sw/source/ui/envelp/envlop.src b/sw/source/ui/envelp/envlop.src index 8f27ff976d..8ef8a8ad89 100644 --- a/sw/source/ui/envelp/envlop.src +++ b/sw/source/ui/envelp/envlop.src @@ -26,7 +26,6 @@ ************************************************************************/ // #pragma ****************************************************************** - // #include ***************************************************************** #include "envlop.hrc" #include "helpid.h" // DLG_ENV ------------------------------------------------------------------ diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index 4bd38b8f25..cda3fded49 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,8 +32,6 @@ #undef SW_DLLIMPLEMENTATION #endif - - #include "dbmgr.hxx" #include <sfx2/app.hxx> #include <vcl/msgbox.hxx> @@ -40,7 +39,6 @@ #include <viewopt.hxx> #include "wrtsh.hxx" -#include "errhdl.hxx" #include "cmdid.h" #include "helpid.h" #include "envfmt.hxx" @@ -65,8 +63,6 @@ using namespace ::rtl; //impl in envimg.cxx extern SW_DLLPUBLIC String MakeSender(); -// -------------------------------------------------------------------------- - SwEnvPreview::SwEnvPreview(SfxTabPage* pParent, const ResId& rResID) : Window(pParent, rResID) @@ -75,15 +71,10 @@ SwEnvPreview::SwEnvPreview(SfxTabPage* pParent, const ResId& rResID) : SetMapMode(MapMode(MAP_PIXEL)); } -// -------------------------------------------------------------------------- - - - SwEnvPreview::~SwEnvPreview() { } -// ---------------------------------------------------------------------------- void SwEnvPreview::DataChanged( const DataChangedEvent& rDCEvt ) { Window::DataChanged( rDCEvt ); @@ -91,8 +82,6 @@ void SwEnvPreview::DataChanged( const DataChangedEvent& rDCEvt ) SetBackground( GetSettings().GetStyleSettings().GetDialogColor() ); } -// ---------------------------------------------------------------------------- - void SwEnvPreview::Paint(const Rectangle &) { const StyleSettings& rSettings = GetSettings().GetStyleSettings(); @@ -116,7 +105,7 @@ void SwEnvPreview::Paint(const Rectangle &) SetLineColor( aFront ); - // Umschlag + // Envelope long nW = (sal_uInt16) (f * nPageW), nH = (sal_uInt16) (f * nPageH), nX = (GetOutputSizePixel().Width () - nW) / 2, @@ -124,7 +113,7 @@ void SwEnvPreview::Paint(const Rectangle &) SetFillColor( aBack ); DrawRect(Rectangle(Point(nX, nY), Size(nW, nH))); - // Absender + // Sender if (rItem.bSend) { long nSendX = nX + (sal_uInt16) (f * rItem.lSendFromLeft), @@ -136,7 +125,7 @@ void SwEnvPreview::Paint(const Rectangle &) DrawRect(Rectangle(Point(nSendX, nSendY), Size(nSendW, nSendH))); } - // Empfaenger + // Addressee long nAddrX = nX + (sal_uInt16) (f * rItem.lAddrFromLeft), nAddrY = nY + (sal_uInt16) (f * rItem.lAddrFromTop ), nAddrW = (sal_uInt16) (f * (nPageW - rItem.lAddrFromLeft - 566)), @@ -144,7 +133,7 @@ void SwEnvPreview::Paint(const Rectangle &) SetFillColor( aMedium ); DrawRect(Rectangle(Point(nAddrX, nAddrY), Size(nAddrW, nAddrH))); - // Briefmarke + // Stamp long nStmpW = (sal_uInt16) (f * 1417 /* 2,5 cm */), nStmpH = (sal_uInt16) (f * 1701 /* 3,0 cm */), nStmpX = nX + nW - (sal_uInt16) (f * 566) - nStmpW, @@ -154,10 +143,6 @@ void SwEnvPreview::Paint(const Rectangle &) DrawRect(Rectangle(Point(nStmpX, nStmpY), Size(nStmpW, nStmpH))); } -// -------------------------------------------------------------------------- - - - SwEnvDlg::SwEnvDlg(Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, sal_Bool bInsert) : @@ -174,7 +159,7 @@ SwEnvDlg::SwEnvDlg(Window* pParent, const SfxItemSet& rSet, GetOKButton().SetText(String(SW_RES(STR_BTN_NEWDOC))); GetOKButton().SetHelpId(HID_ENVELOP_PRINT); - GetOKButton().SetHelpText(aEmptyStr); // Damit generierter Hilfetext verwendet wird + GetOKButton().SetHelpText(aEmptyStr); // in order for generated help text to get used if (GetUserButton()) { GetUserButton()->SetText(bInsert ? sInsert : sChange); @@ -186,20 +171,12 @@ SwEnvDlg::SwEnvDlg(Window* pParent, const SfxItemSet& rSet, AddTabPage(TP_ENV_PRT, SwEnvPrtPage::Create, 0); } -// -------------------------------------------------------------------------- - - - SwEnvDlg::~SwEnvDlg() { delete pAddresseeSet; delete pSenderSet; } -// -------------------------------------------------------------------------- - - - void SwEnvDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage) { if (nId == TP_ENV_PRT) @@ -208,8 +185,6 @@ void SwEnvDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage) } } -// -------------------------------------------------------------------------- - short SwEnvDlg::Ok() { short nRet = SfxTabDialog::Ok(); @@ -231,10 +206,6 @@ short SwEnvDlg::Ok() return nRet; } -// -------------------------------------------------------------------------- - - - SwEnvPage::SwEnvPage(Window* pParent, const SfxItemSet& rSet) : SfxTabPage(pParent, SW_RES(TP_ENV_ENV), rSet), @@ -257,7 +228,7 @@ SwEnvPage::SwEnvPage(Window* pParent, const SfxItemSet& rSet) : SetExchangeSupport(); pSh = GetParent()->pSh; - // Handler installieren + // Install handlers aDatabaseLB .SetSelectHdl(LINK(this, SwEnvPage, DatabaseHdl )); aTableLB .SetSelectHdl(LINK(this, SwEnvPage, DatabaseHdl )); aInsertBT .SetClickHdl (LINK(this, SwEnvPage, FieldHdl )); @@ -271,18 +242,10 @@ SwEnvPage::SwEnvPage(Window* pParent, const SfxItemSet& rSet) : InitDatabaseBox(); } -// -------------------------------------------------------------------------- - - - SwEnvPage::~SwEnvPage() { } -// -------------------------------------------------------------------------- - - - IMPL_LINK( SwEnvPage, DatabaseHdl, ListBox *, pListBox ) { SwWait aWait( *pSh->GetView().GetDocShell(), sal_True ); @@ -295,26 +258,20 @@ IMPL_LINK( SwEnvPage, DatabaseHdl, ListBox *, pListBox ) } else sActDBName.SetToken(1, DB_DELIM, aTableLB.GetSelectEntry()); - pSh->GetNewDBMgr()->GetColumnNames( - &aDBFieldLB, aDatabaseLB.GetSelectEntry(), aTableLB.GetSelectEntry()); + pSh->GetNewDBMgr()->GetColumnNames(&aDBFieldLB, aDatabaseLB.GetSelectEntry(), + aTableLB.GetSelectEntry()); return 0; } -// -------------------------------------------------------------------------- - - - IMPL_LINK( SwEnvPage, FieldHdl, Button *, EMPTYARG ) { String aStr ( '<' ); aStr += aDatabaseLB.GetSelectEntry(); aStr += '.'; -// aStr += DB_DELIM; aStr += aTableLB.GetSelectEntry(); aStr += '.'; aStr += aTableLB.GetEntryData(aTableLB.GetSelectEntryPos()) == 0 ? '0' : '1'; aStr += '.'; -// aStr += DB_DELIM; aStr += aDBFieldLB.GetSelectEntry(); aStr += '>'; aAddrEdit.ReplaceSelected(aStr); @@ -324,10 +281,6 @@ IMPL_LINK( SwEnvPage, FieldHdl, Button *, EMPTYARG ) return 0; } -// -------------------------------------------------------------------------- - - - IMPL_LINK( SwEnvPage, SenderHdl, Button *, EMPTYARG ) { const sal_Bool bEnable = aSenderBox.IsChecked(); @@ -343,10 +296,6 @@ IMPL_LINK( SwEnvPage, SenderHdl, Button *, EMPTYARG ) return 0; } -// -------------------------------------------------------------------------- - - - void SwEnvPage::InitDatabaseBox() { if (pSh->GetNewDBMgr()) @@ -354,6 +303,7 @@ void SwEnvPage::InitDatabaseBox() aDatabaseLB.Clear(); Sequence<OUString> aDataNames = SwNewDBMgr::GetExistingDatabaseNames(); const OUString* pDataNames = aDataNames.getConstArray(); + for (long i = 0; i < aDataNames.getLength(); i++) aDatabaseLB.InsertEntry(pDataNames[i]); @@ -371,19 +321,11 @@ void SwEnvPage::InitDatabaseBox() } } -// -------------------------------------------------------------------------- - - - SfxTabPage* SwEnvPage::Create(Window* pParent, const SfxItemSet& rSet) { return new SwEnvPage(pParent, rSet); } -// -------------------------------------------------------------------------- - - - void SwEnvPage::ActivatePage(const SfxItemSet& rSet) { SfxItemSet aSet(rSet); @@ -391,10 +333,6 @@ void SwEnvPage::ActivatePage(const SfxItemSet& rSet) Reset(aSet); } -// -------------------------------------------------------------------------- - - - int SwEnvPage::DeactivatePage(SfxItemSet* _pSet) { FillItem(GetParent()->aEnvItem); @@ -403,10 +341,6 @@ int SwEnvPage::DeactivatePage(SfxItemSet* _pSet) return SfxTabPage::LEAVE_PAGE; } -// -------------------------------------------------------------------------- - - - void SwEnvPage::FillItem(SwEnvItem& rItem) { rItem.aAddrText = aAddrEdit .GetText(); @@ -414,10 +348,6 @@ void SwEnvPage::FillItem(SwEnvItem& rItem) rItem.aSendText = aSenderEdit.GetText(); } -// -------------------------------------------------------------------------- - - - sal_Bool SwEnvPage::FillItemSet(SfxItemSet& rSet) { FillItem(GetParent()->aEnvItem); @@ -425,10 +355,6 @@ sal_Bool SwEnvPage::FillItemSet(SfxItemSet& rSet) return sal_True; } -// ---------------------------------------------------------------------------- - - - void SwEnvPage::Reset(const SfxItemSet& rSet) { SwEnvItem aItem = (const SwEnvItem&) rSet.Get(FN_ENVELOP); @@ -439,3 +365,4 @@ void SwEnvPage::Reset(const SfxItemSet& rSet) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx index 03bbb199c3..1534294ee9 100644 --- a/sw/source/ui/envelp/envprt.cxx +++ b/sw/source/ui/envelp/envprt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,10 +45,6 @@ #include "envprt.hrc" - - - - SwEnvPrtPage::SwEnvPrtPage(Window* pParent, const SfxItemSet& rSet) : SfxTabPage(pParent, SW_RES(TP_ENV_PRT), rSet), @@ -68,12 +65,12 @@ SwEnvPrtPage::SwEnvPrtPage(Window* pParent, const SfxItemSet& rSet) : FreeResource(); SetExchangeSupport(); - // Metriken + // Metrics FieldUnit eUnit = ::GetDfltMetric(sal_False); SetMetric(aRightField, eUnit); SetMetric(aDownField , eUnit); - // Handler installieren + // Install handlers aTopButton .SetClickHdl(LINK(this, SwEnvPrtPage, ClickHdl)); aBottomButton.SetClickHdl(LINK(this, SwEnvPrtPage, ClickHdl)); @@ -85,58 +82,43 @@ SwEnvPrtPage::SwEnvPrtPage(Window* pParent, const SfxItemSet& rSet) : // ToolBox Size aSz = aAlignBox.CalcWindowSizePixel(); aAlignBox.SetSizePixel(aSz); -// aAlignBox.SetPosPixel(Point(aNoNameFL.GetPosPixel().X() + (aNoNameFL.GetSizePixel().Width() - aSz.Width()) / 2, aAlignBox.GetPosPixel().Y())); aAlignBox.SetClickHdl(LINK(this, SwEnvPrtPage, AlignHdl)); - } -// -------------------------------------------------------------------------- - - - SwEnvPrtPage::~SwEnvPrtPage() { } -// -------------------------------------------------------------------------- - - - IMPL_LINK( SwEnvPrtPage, ClickHdl, Button *, EMPTYARG ) { - sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); if (aBottomButton.IsChecked()) { - // Briefumschlaege von unten - aAlignBox.SetItemImage(ITM_HOR_LEFT, Bitmap(SW_RES(bHC ? BMP_HOR_LEFT_LOWER_H : BMP_HOR_LEFT_LOWER))); - aAlignBox.SetItemImage(ITM_HOR_CNTR, Bitmap(SW_RES(bHC ? BMP_HOR_CNTR_LOWER_H : BMP_HOR_CNTR_LOWER))); - aAlignBox.SetItemImage(ITM_HOR_RGHT, Bitmap(SW_RES(bHC ? BMP_HOR_RGHT_LOWER_H : BMP_HOR_RGHT_LOWER))); - aAlignBox.SetItemImage(ITM_VER_LEFT, Bitmap(SW_RES(bHC ? BMP_VER_LEFT_LOWER_H : BMP_VER_LEFT_LOWER))); - aAlignBox.SetItemImage(ITM_VER_CNTR, Bitmap(SW_RES(bHC ? BMP_VER_CNTR_LOWER_H : BMP_VER_CNTR_LOWER))); - aAlignBox.SetItemImage(ITM_VER_RGHT, Bitmap(SW_RES(bHC ? BMP_VER_RGHT_LOWER_H : BMP_VER_RGHT_LOWER))); + // Envelope from botton + aAlignBox.SetItemImage(ITM_HOR_LEFT, Bitmap(SW_RES(BMP_HOR_LEFT_LOWER))); + aAlignBox.SetItemImage(ITM_HOR_CNTR, Bitmap(SW_RES(BMP_HOR_CNTR_LOWER))); + aAlignBox.SetItemImage(ITM_HOR_RGHT, Bitmap(SW_RES(BMP_HOR_RGHT_LOWER))); + aAlignBox.SetItemImage(ITM_VER_LEFT, Bitmap(SW_RES(BMP_VER_LEFT_LOWER))); + aAlignBox.SetItemImage(ITM_VER_CNTR, Bitmap(SW_RES(BMP_VER_CNTR_LOWER))); + aAlignBox.SetItemImage(ITM_VER_RGHT, Bitmap(SW_RES(BMP_VER_RGHT_LOWER))); } else { - // Briefumschlaege von oben - aAlignBox.SetItemImage(ITM_HOR_LEFT, Bitmap(SW_RES(bHC ? BMP_HOR_LEFT_UPPER_H : BMP_HOR_LEFT_UPPER))); - aAlignBox.SetItemImage(ITM_HOR_CNTR, Bitmap(SW_RES(bHC ? BMP_HOR_CNTR_UPPER_H : BMP_HOR_CNTR_UPPER))); - aAlignBox.SetItemImage(ITM_HOR_RGHT, Bitmap(SW_RES(bHC ? BMP_HOR_RGHT_UPPER_H : BMP_HOR_RGHT_UPPER))); - aAlignBox.SetItemImage(ITM_VER_LEFT, Bitmap(SW_RES(bHC ? BMP_VER_LEFT_UPPER_H : BMP_VER_LEFT_UPPER))); - aAlignBox.SetItemImage(ITM_VER_CNTR, Bitmap(SW_RES(bHC ? BMP_VER_CNTR_UPPER_H : BMP_VER_CNTR_UPPER))); - aAlignBox.SetItemImage(ITM_VER_RGHT, Bitmap(SW_RES(bHC ? BMP_VER_RGHT_UPPER_H : BMP_VER_RGHT_UPPER))); + // Envelope from top + aAlignBox.SetItemImage(ITM_HOR_LEFT, Bitmap(SW_RES(BMP_HOR_LEFT_UPPER))); + aAlignBox.SetItemImage(ITM_HOR_CNTR, Bitmap(SW_RES(BMP_HOR_CNTR_UPPER))); + aAlignBox.SetItemImage(ITM_HOR_RGHT, Bitmap(SW_RES(BMP_HOR_RGHT_UPPER))); + aAlignBox.SetItemImage(ITM_VER_LEFT, Bitmap(SW_RES(BMP_VER_LEFT_UPPER))); + aAlignBox.SetItemImage(ITM_VER_CNTR, Bitmap(SW_RES(BMP_VER_CNTR_UPPER))); + aAlignBox.SetItemImage(ITM_VER_RGHT, Bitmap(SW_RES(BMP_VER_RGHT_UPPER))); } return 0; } -// -------------------------------------------------------------------------- - - - IMPL_LINK( SwEnvPrtPage, ButtonHdl, Button *, pBtn ) { if (pBtn == &aPrtSetup) { - // Druck-Setup aufrufen + // Call printer setup if (pPrt) { PrinterSetupDialog* pDlg = new PrinterSetupDialog(this ); @@ -150,10 +132,6 @@ IMPL_LINK( SwEnvPrtPage, ButtonHdl, Button *, pBtn ) return 0; } -// -------------------------------------------------------------------------- - - - IMPL_LINK( SwEnvPrtPage, AlignHdl, ToolBox *, EMPTYARG ) { if (aAlignBox.GetCurItemId()) @@ -164,36 +142,24 @@ IMPL_LINK( SwEnvPrtPage, AlignHdl, ToolBox *, EMPTYARG ) } else { - // GetCurItemId() == 0 ist moeglich! + // GetCurItemId() == 0 is possible! const SwEnvItem& rItem = (const SwEnvItem&) GetItemSet().Get(FN_ENVELOP); aAlignBox.CheckItem((sal_uInt16) rItem.eAlign + ITM_HOR_LEFT, sal_True); } return 0; } -// -------------------------------------------------------------------------- - - - SfxTabPage* SwEnvPrtPage::Create(Window* pParent, const SfxItemSet& rSet) { return new SwEnvPrtPage(pParent, rSet); } -// -------------------------------------------------------------------------- - - - void SwEnvPrtPage::ActivatePage(const SfxItemSet&) { if (pPrt) aPrinterInfo.SetText(pPrt->GetName()); } -// -------------------------------------------------------------------------- - - - int SwEnvPrtPage::DeactivatePage(SfxItemSet* _pSet) { if( _pSet ) @@ -201,10 +167,6 @@ int SwEnvPrtPage::DeactivatePage(SfxItemSet* _pSet) return SfxTabPage::LEAVE_PAGE; } -// -------------------------------------------------------------------------- - - - void SwEnvPrtPage::FillItem(SwEnvItem& rItem) { sal_uInt16 nID = 0; @@ -218,10 +180,6 @@ void SwEnvPrtPage::FillItem(SwEnvItem& rItem) rItem.lShiftDown = static_cast< sal_Int32 >(GetFldVal(aDownField )); } -// -------------------------------------------------------------------------- - - - sal_Bool SwEnvPrtPage::FillItemSet(SfxItemSet& rSet) { FillItem(GetParent()->aEnvItem); @@ -229,16 +187,9 @@ sal_Bool SwEnvPrtPage::FillItemSet(SfxItemSet& rSet) return sal_True; } -// ---------------------------------------------------------------------------- - - - void SwEnvPrtPage::Reset(const SfxItemSet& rSet) { -// SfxItemSet aSet(rSet); -// aSet.Put(GetParent()->aEnvItem); - - // Item auslesen + // Read item const SwEnvItem& rItem = (const SwEnvItem&) rSet.Get(FN_ENVELOP); aAlignBox.CheckItem((sal_uInt16) rItem.eAlign + ITM_HOR_LEFT); @@ -257,3 +208,4 @@ void SwEnvPrtPage::Reset(const SfxItemSet& rSet) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/envprt.hrc b/sw/source/ui/envelp/envprt.hrc index b5a8a034c1..3ee2c105ed 100644 --- a/sw/source/ui/envelp/envprt.hrc +++ b/sw/source/ui/envelp/envprt.hrc @@ -28,11 +28,9 @@ #ifndef _ENVPRT_HRC #define _ENVPRT_HRC -// #include ***************************************************************** - #include "envelp.hrc" -// Lokale Resourcen ********************************************************* +// local resources ********************************************************* #define BOX_ALIGN 1 #define BTN_TOP 7 @@ -46,7 +44,7 @@ #define BTN_PRTSETUP 15 #define FL_PRINTER 16 -// Globale Resourcen ******************************************************** +// global resources ******************************************************** #define BMP_HOR_LEFT_LOWER (RC_ENVPRT_BEGIN ) #define BMP_HOR_LEFT_UPPER (RC_ENVPRT_BEGIN + 1) @@ -69,26 +67,11 @@ #define ITM_VER_CNTR (RC_ENVPRT_BEGIN + 16) #define ITM_VER_RGHT (RC_ENVPRT_BEGIN + 17) -#define BMP_HOR_LEFT_LOWER_H (RC_ENVPRT_HC_BEGIN ) -#define BMP_HOR_LEFT_UPPER_H (RC_ENVPRT_HC_BEGIN + 1) -#define BMP_HOR_CNTR_LOWER_H (RC_ENVPRT_HC_BEGIN + 2) -#define BMP_HOR_CNTR_UPPER_H (RC_ENVPRT_HC_BEGIN + 3) -#define BMP_HOR_RGHT_LOWER_H (RC_ENVPRT_HC_BEGIN + 4) -#define BMP_HOR_RGHT_UPPER_H (RC_ENVPRT_HC_BEGIN + 5) - -#define BMP_VER_LEFT_LOWER_H (RC_ENVPRT_HC_BEGIN + 6) -#define BMP_VER_LEFT_UPPER_H (RC_ENVPRT_HC_BEGIN + 7) -#define BMP_VER_CNTR_LOWER_H (RC_ENVPRT_HC_BEGIN + 8) -#define BMP_VER_CNTR_UPPER_H (RC_ENVPRT_HC_BEGIN + 9) -#define BMP_VER_RGHT_LOWER_H (RC_ENVPRT_HC_BEGIN + 10) -#define BMP_VER_RGHT_UPPER_H (RC_ENVPRT_HC_BEGIN + 11) - - -// Ueberlaufpruefung ******************************************************** +// overflow check ******************************************************** -#define ENVPRT_ACT_END BMP_VER_RGHT_UPPER_H +#define ENVPRT_ACT_END ITM_VER_RGHT -#if ENVPRT_ACT_END > RC_ENVPRT_HC_END +#if ENVPRT_ACT_END > ITM_VER_RGHT #error Resource-Ueberlauf in #file, #line #endif diff --git a/sw/source/ui/envelp/envprt.hxx b/sw/source/ui/envelp/envprt.hxx index e0c021708f..b48182827b 100644 --- a/sw/source/ui/envelp/envprt.hxx +++ b/sw/source/ui/envelp/envprt.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,9 +35,7 @@ #include <vcl/field.hxx> #include <vcl/fixed.hxx> #include <vcl/group.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <svtools/stdctrl.hxx> @@ -91,3 +90,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/envprt.src b/sw/source/ui/envelp/envprt.src index 6b5801b0cf..c8425ef5ae 100644 --- a/sw/source/ui/envelp/envprt.src +++ b/sw/source/ui/envelp/envprt.src @@ -26,7 +26,6 @@ ************************************************************************/ // #pragma ***************************************************************** - // #include **************************************************************** #include "envprt.hrc" #include "helpid.h" // TP_ENV_PRT --------------------------------------------------------------- @@ -217,81 +216,3 @@ Bitmap BMP_VER_RGHT_UPPER { File = "envvr_u.bmp" ; }; -// HighContrast Bitmaps -Bitmap BMP_HOR_LEFT_LOWER_H -{ - File = "envhl_l_h.bmp" ; -}; -Bitmap BMP_HOR_LEFT_UPPER_H -{ - File = "envhl_u_h.bmp" ; -}; -Bitmap BMP_HOR_CNTR_LOWER_H -{ - File = "envhc_l_h.bmp" ; -}; -Bitmap BMP_HOR_CNTR_UPPER_H -{ - File = "envhc_u_h.bmp" ; -}; -Bitmap BMP_HOR_RGHT_LOWER_H -{ - File = "envhr_l_h.bmp" ; -}; -Bitmap BMP_HOR_RGHT_UPPER_H -{ - File = "envhr_u_h.bmp" ; -}; -Bitmap BMP_VER_LEFT_LOWER_H -{ - File = "envvl_l_h.bmp" ; -}; -Bitmap BMP_VER_LEFT_UPPER_H -{ - File = "envvl_u_h.bmp" ; -}; -Bitmap BMP_VER_CNTR_LOWER_H -{ - File = "envvc_l_h.bmp" ; -}; -Bitmap BMP_VER_CNTR_UPPER_H -{ - File = "envvc_u_h.bmp" ; -}; -Bitmap BMP_VER_RGHT_LOWER_H -{ - File = "envvr_l_h.bmp" ; -}; -Bitmap BMP_VER_RGHT_UPPER_H -{ - File = "envvr_u_h.bmp" ; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sw/source/ui/envelp/label.hrc b/sw/source/ui/envelp/label.hrc index 9457fff866..02b25f34ef 100644 --- a/sw/source/ui/envelp/label.hrc +++ b/sw/source/ui/envelp/label.hrc @@ -28,11 +28,9 @@ #ifndef _LABEL_HRC #define _LABEL_HRC -// #include ***************************************************************** - #include "envelp.hrc" -// Lokale Resourcen ********************************************************* +// local resources ********************************************************* #define TXT_WRITING 1 #define BOX_ADDR 2 @@ -112,11 +110,11 @@ //#define FT_MOBILE 72 #define FT_FAX 73 -// Globale Resourcen ******************************************************** +// global resources ******************************************************** #define STR_DOC_TITLE (RC_LABEL_BEGIN) #define STR_CUSTOM (RC_LABEL_BEGIN + 1) -// Ueberlaufpruefung ******************************************************** +// overflow check ******************************************************** #define LABEL_ACT_END STR_CUSTOM diff --git a/sw/source/ui/envelp/label.src b/sw/source/ui/envelp/label.src index dbcea27b94..944362d40e 100644 --- a/sw/source/ui/envelp/label.src +++ b/sw/source/ui/envelp/label.src @@ -26,7 +26,6 @@ ************************************************************************/ // #pragma ****************************************************************** - // #include ***************************************************************** #include "label.hrc" #include "globals.hrc" #include "helpid.h" diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index 66dff1c03a..ad5ea2ac44 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,22 +43,12 @@ #include <labfmt.hxx> #include <labprt.hxx> #include <unotools.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include "uitool.hxx" -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _LABEL_HRC #include <label.hrc> -#endif //impl in envimg.cxx extern SW_DLLPUBLIC String MakeSender(); @@ -90,19 +81,14 @@ void SwLabRec::FillItem( SwLabItem& rItem ) const rItem.nRows = nRows; } -// -------------------------------------------------------------------------- void SwLabDlg::_ReplaceGroup( const String &rMake ) { - //Die alten Eintraege vernichten. + // Remove old entries pRecs->Remove( 1, pRecs->Count() - 1 ); aLabelsCfg.FillLabels(rtl::OUString(rMake), *pRecs); aLstGroup = rMake; } -// -------------------------------------------------------------------------- - - - void SwLabDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage) { if (nId == TP_LAB_LAB) @@ -119,10 +105,6 @@ void SwLabDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage) pPrtPage = (SwLabPrtPage*)&rPage; } -// -------------------------------------------------------------------------- - - - SwLabDlg::SwLabDlg(Window* pParent, const SfxItemSet& rSet, SwNewDBMgr* pDBMgr, sal_Bool bLabel) : SfxTabDialog( pParent, SW_RES(DLG_LAB), &rSet, sal_False ), @@ -144,7 +126,7 @@ SwLabDlg::SwLabDlg(Window* pParent, const SfxItemSet& rSet, GetOKButton().SetText(String(SW_RES(STR_BTN_NEW_DOC))); GetOKButton().SetHelpId(HID_LABEL_INSERT); - GetOKButton().SetHelpText(aEmptyStr); // Damit generierter Hilfetext verwendet wird + GetOKButton().SetHelpText(aEmptyStr); // in order for generated help text to get used AddTabPage(TP_LAB_LAB, m_bLabel ? sFormat : sMedium ,SwLabPage ::Create, 0, sal_False, 0); AddTabPage(TP_VISITING_CARDS, SwVisitingCardPage::Create, 0); @@ -164,7 +146,7 @@ SwLabDlg::SwLabDlg(Window* pParent, const SfxItemSet& rSet, { SetText(sBusinessCardDlg); } - // Benutzer-Etikette aus writer.cfg lesen + // Read user label from writer.cfg SwLabItem aItem((const SwLabItem&)rSet.Get( FN_LABEL )); SwLabRec* pRec = new SwLabRec; const String aTmp( SW_RES( STR_CUSTOM ) ); @@ -198,17 +180,15 @@ SwLabDlg::SwLabDlg(Window* pParent, const SfxItemSet& rSet, if ( aMakes.Count() ) _ReplaceGroup( *aMakes[nLstGroup] ); + if (pExampleSet) pExampleSet->Put(aItem); } -// -------------------------------------------------------------------------- - SwLabDlg::~SwLabDlg() { delete pRecs; } -// -------------------------------------------------------------------------- void SwLabDlg::GetLabItem(SwLabItem &rItem) { @@ -216,23 +196,21 @@ void SwLabDlg::GetLabItem(SwLabItem &rItem) const SwLabItem& rOldItem = (const SwLabItem&)GetInputSetImpl()->Get(FN_LABEL); if (rActItem != rOldItem) - { // Wurde schon mal mit (hoffentlich) korrektem Inhalt "geputtet" + { + // Was already "put" with (hopefully) correct content rItem = rActItem; } else { rItem = rOldItem; - // Im rItem stehen (vom Namen mal abgesehen) immer nur die - // benutzerdefinierbaren Einstellungen. Daher richtige Werte - // direkt aus dem Record besorgen: + // In rItem there are only settings defined by users. + // Therefore get the real settings directly from Record SwLabRec* pRec = GetRecord(rItem.aType, rItem.bCont); pRec->FillItem( rItem ); } } -// -------------------------------------------------------------------------- - SwLabRec* SwLabDlg::GetRecord(const String &rRecName, sal_Bool bCont) { SwLabRec* pRec = NULL; @@ -250,14 +228,12 @@ SwLabRec* SwLabDlg::GetRecord(const String &rRecName, sal_Bool bCont) break; } } - if (!bFound) // Benutzerdefiniert + if (!bFound) // User defined pRec = Recs()[0]; return(pRec); } -// -------------------------------------------------------------------------- - Printer *SwLabDlg::GetPrt() { if (pPrtPage) @@ -266,15 +242,14 @@ Printer *SwLabDlg::GetPrt() return (NULL); } -// -------------------------------------------------------------------------- SwLabPage::SwLabPage(Window* pParent, const SfxItemSet& rSet) : SfxTabPage(pParent, SW_RES(TP_LAB_LAB), rSet), pNewDBMgr(NULL), - aItem ((const SwLabItem&) rSet.Get(FN_LABEL)), + aItem ((const SwLabItem&) rSet.Get(FN_LABEL)), aWritingFL (this, SW_RES(FL_WRITING)), aWritingText (this, SW_RES(TXT_WRITING)), - aAddrBox (this, SW_RES(BOX_ADDR )), + aAddrBox (this, SW_RES(BOX_ADDR )), aWritingEdit (this, SW_RES(EDT_WRITING)), aDatabaseFT (this, SW_RES(FT_DATABASE)), aDatabaseLB (this, SW_RES(LB_DATABASE)), @@ -286,10 +261,10 @@ SwLabPage::SwLabPage(Window* pParent, const SfxItemSet& rSet) : aFormatFL (this, SW_RES(FL_FORMAT )), aContButton (this, SW_RES(BTN_CONT )), aSheetButton (this, SW_RES(BTN_SHEET )), - aMakeText (this, SW_RES(TXT_MAKE )), - aMakeBox (this, SW_RES(BOX_MAKE )), - aTypeText (this, SW_RES(TXT_TYPE )), - aTypeBox (this, SW_RES(BOX_TYPE )), + aMakeText (this, SW_RES(TXT_MAKE )), + aMakeBox (this, SW_RES(BOX_MAKE )), + aTypeText (this, SW_RES(TXT_TYPE )), + aTypeBox (this, SW_RES(BOX_TYPE )), aHiddenSortTypeBox(this, WB_SORT|WB_HIDE), aFormatInfo (this, SW_RES(INF_FORMAT )) { @@ -299,15 +274,15 @@ SwLabPage::SwLabPage(Window* pParent, const SfxItemSet& rSet) : SetExchangeSupport(); - // Handler installieren - aAddrBox .SetClickHdl (LINK(this, SwLabPage, AddrHdl )); - aDatabaseLB .SetSelectHdl(LINK(this, SwLabPage, DatabaseHdl )); - aTableLB .SetSelectHdl(LINK(this, SwLabPage, DatabaseHdl )); - aInsertBT .SetClickHdl (LINK(this, SwLabPage, FieldHdl )); - aContButton .SetClickHdl (LINK(this, SwLabPage, PageHdl )); - aSheetButton .SetClickHdl (LINK(this, SwLabPage, PageHdl )); - aMakeBox .SetSelectHdl(LINK(this, SwLabPage, MakeHdl )); - aTypeBox .SetSelectHdl(LINK(this, SwLabPage, TypeHdl )); + // Install handlers + aAddrBox .SetClickHdl (LINK(this, SwLabPage, AddrHdl )); + aDatabaseLB .SetSelectHdl(LINK(this, SwLabPage, DatabaseHdl )); + aTableLB .SetSelectHdl(LINK(this, SwLabPage, DatabaseHdl )); + aInsertBT .SetClickHdl (LINK(this, SwLabPage, FieldHdl )); + aContButton .SetClickHdl (LINK(this, SwLabPage, PageHdl )); + aSheetButton .SetClickHdl (LINK(this, SwLabPage, PageHdl )); + aMakeBox .SetSelectHdl(LINK(this, SwLabPage, MakeHdl )); + aTypeBox .SetSelectHdl(LINK(this, SwLabPage, TypeHdl )); InitDatabaseBox(); @@ -318,24 +293,19 @@ SwLabPage::SwLabPage(Window* pParent, const SfxItemSet& rSet) : { String &rStr = *GetParent()->Makes()[i]; aMakeBox.InsertEntry( rStr ); + if ( rStr == String(aItem.aLstMake) ) nLstGroup = i; } -// Reset(rSet); + aMakeBox.SelectEntryPos( nLstGroup ); aMakeBox.GetSelectHdl().Call( &aMakeBox ); } -// -------------------------------------------------------------------------- - - - SwLabPage::~SwLabPage() { } -/* -----------------29.09.99 09:08------------------- - --------------------------------------------------*/ void lcl_ChgYPos(Window& rWin, long nDiff) { Point aTempPos(rWin.GetPosPixel()); @@ -367,7 +337,6 @@ void SwLabPage::SetToBusinessCard() Point aFLPos(aWritingFL.GetPosPixel()); long nDiffPos = aFormatFL.GetPosPixel().Y() - aFLPos.Y(); Size aFLSz(aFormatFL.GetSizePixel()); -// aFLSz.Height() += nDiffPos; aFormatFL.SetPosSizePixel(aFLPos, aFLSz); // move all controls up @@ -387,23 +356,18 @@ void SwLabPage::SetToBusinessCard() aTypeBox.SetPosPixel(aLBPos); }; -// -------------------------------------------------------------------------- - - IMPL_LINK( SwLabPage, AddrHdl, Button *, EMPTYARG ) { String aWriting; + if ( aAddrBox.IsChecked() ) aWriting = MakeSender(); + aWritingEdit.SetText( aWriting.ConvertLineEnd() ); aWritingEdit.GrabFocus(); return 0; } -// -------------------------------------------------------------------------- - - - IMPL_LINK( SwLabPage, DatabaseHdl, ListBox *, pListBox ) { sActDBName = aDatabaseLB.GetSelectEntry(); @@ -412,12 +376,11 @@ IMPL_LINK( SwLabPage, DatabaseHdl, ListBox *, pListBox ) if (pListBox == &aDatabaseLB) GetNewDBMgr()->GetTableNames(&aTableLB, sActDBName); + GetNewDBMgr()->GetColumnNames(&aDBFieldLB, sActDBName, aTableLB.GetSelectEntry()); return 0; } - - IMPL_LINK( SwLabPage, FieldHdl, Button *, EMPTYARG ) { String aStr ( '<' ); @@ -436,10 +399,6 @@ IMPL_LINK( SwLabPage, FieldHdl, Button *, EMPTYARG ) return 0; } -// -------------------------------------------------------------------------- - - - IMPL_LINK_INLINE_START( SwLabPage, PageHdl, Button *, EMPTYARG ) { aMakeBox.GetSelectHdl().Call( &aMakeBox ); @@ -447,10 +406,6 @@ IMPL_LINK_INLINE_START( SwLabPage, PageHdl, Button *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwLabPage, PageHdl, Button *, EMPTYARG ) -// -------------------------------------------------------------------------- - - - IMPL_LINK( SwLabPage, MakeHdl, ListBox *, EMPTYARG ) { WaitObject aWait( GetParent() ); @@ -505,10 +460,6 @@ IMPL_LINK( SwLabPage, MakeHdl, ListBox *, EMPTYARG ) return 0; } -// -------------------------------------------------------------------------- - - - IMPL_LINK_INLINE_START( SwLabPage, TypeHdl, ListBox *, EMPTYARG ) { DisplayFormat(); @@ -517,10 +468,6 @@ IMPL_LINK_INLINE_START( SwLabPage, TypeHdl, ListBox *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwLabPage, TypeHdl, ListBox *, EMPTYARG ) -// -------------------------------------------------------------------------- - - - void SwLabPage::DisplayFormat() { MetricField aField(this, WinBits(0)); @@ -552,8 +499,6 @@ void SwLabPage::DisplayFormat() aFormatInfo.SetText(aText); } -// -------------------------------------------------------------------------- - SwLabRec* SwLabPage::GetSelectedEntryPos() { String sSelEntry(aTypeBox.GetSelectEntry()); @@ -561,10 +506,6 @@ SwLabRec* SwLabPage::GetSelectedEntryPos() return GetParent()->GetRecord(sSelEntry, aContButton.IsChecked()); } -// -------------------------------------------------------------------------- - - - void SwLabPage::InitDatabaseBox() { if( GetNewDBMgr() ) @@ -587,18 +528,16 @@ void SwLabPage::InitDatabaseBox() } } -// -------------------------------------------------------------------------- SfxTabPage* SwLabPage::Create(Window* pParent, const SfxItemSet& rSet) { return new SwLabPage(pParent, rSet); } -// -------------------------------------------------------------------------- void SwLabPage::ActivatePage(const SfxItemSet& rSet) { Reset( rSet ); } -// -------------------------------------------------------------------------- + int SwLabPage::DeactivatePage(SfxItemSet* _pSet) { if (_pSet) @@ -607,10 +546,6 @@ int SwLabPage::DeactivatePage(SfxItemSet* _pSet) return sal_True; } -// -------------------------------------------------------------------------- - - - void SwLabPage::FillItem(SwLabItem& rItem) { rItem.bAddr = aAddrBox.IsChecked(); @@ -627,10 +562,6 @@ void SwLabPage::FillItem(SwLabItem& rItem) rItem.aLstType = aTypeBox.GetSelectEntry(); } -// -------------------------------------------------------------------------- - - - sal_Bool SwLabPage::FillItemSet(SfxItemSet& rSet) { FillItem( aItem ); @@ -639,8 +570,6 @@ sal_Bool SwLabPage::FillItemSet(SfxItemSet& rSet) return sal_True; } -// -------------------------------------------------------------------------- - void SwLabPage::Reset(const SfxItemSet& rSet) { aItem = (const SwLabItem&) rSet.Get(FN_LABEL); @@ -685,10 +614,6 @@ void SwLabPage::Reset(const SfxItemSet& rSet) aSheetButton.Check(); } -/*-- 08.07.99 14:00:02--------------------------------------------------- - - -----------------------------------------------------------------------*/ -//----------------------------------------------------------------------------- void SwVisitingCardPage::ClearUserData() { SvLBoxEntry* pEntry = aAutoTextLB.First(); @@ -699,8 +624,6 @@ void SwVisitingCardPage::ClearUserData() } } -//----------------------------------------------------------------------------- - void SwVisitingCardPage::SetUserData( sal_uInt32 nCnt, const rtl::OUString* pNames, const rtl::OUString* pValues ) { @@ -711,8 +634,6 @@ void SwVisitingCardPage::SetUserData( sal_uInt32 nCnt, } } -//----------------------------------------------------------------------------- - SwVisitingCardPage::SwVisitingCardPage(Window* pParent, const SfxItemSet& rSet) : SfxTabPage(pParent, SW_RES(TP_VISITING_CARDS), rSet), aContentFL(this, SW_RES( FL_CONTENT )), @@ -740,9 +661,7 @@ SwVisitingCardPage::SwVisitingCardPage(Window* pParent, const SfxItemSet& rSet) aAutoTextGroupLB.Show(); InitFrameControl(); } -/*-- 08.07.99 14:00:03--------------------------------------------------- - -----------------------------------------------------------------------*/ SwVisitingCardPage::~SwVisitingCardPage() { for(sal_uInt16 i = 0; i < aAutoTextGroupLB.GetEntryCount(); i++) @@ -752,38 +671,31 @@ SwVisitingCardPage::~SwVisitingCardPage() ClearUserData(); delete pExampleFrame; } -/*-- 08.07.99 14:00:03--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxTabPage* SwVisitingCardPage::Create(Window* pParent, const SfxItemSet& rSet) { return new SwVisitingCardPage(pParent, rSet); } -/*-- 08.07.99 14:00:03--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwVisitingCardPage::ActivatePage(const SfxItemSet& rSet) { Reset( rSet ); UpdateFields(); } -/*-- 08.07.99 14:00:04--------------------------------------------------- - -----------------------------------------------------------------------*/ int SwVisitingCardPage::DeactivatePage(SfxItemSet* _pSet) { if (_pSet) FillItemSet(*_pSet); return LEAVE_PAGE; } -/*-- 08.07.99 14:00:04--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwVisitingCardPage::FillItemSet(SfxItemSet& rSet) { String* pGroup = (String*)aAutoTextGroupLB.GetEntryData( aAutoTextGroupLB.GetSelectEntryPos()); - DBG_ASSERT(pGroup, "no group selected?"); + OSL_ENSURE(pGroup, "no group selected?"); + if(pGroup) aLabItem.sGlossaryGroup = *pGroup; @@ -793,9 +705,7 @@ sal_Bool SwVisitingCardPage::FillItemSet(SfxItemSet& rSet) rSet.Put(aLabItem); return sal_True; } -/*-- 08.07.99 14:00:05--------------------------------------------------- - -----------------------------------------------------------------------*/ void lcl_SelectBlock(SvTreeListBox& rAutoTextLB, const String& rBlockName) { SvLBoxEntry* pEntry = rAutoTextLB.First(); @@ -810,7 +720,7 @@ void lcl_SelectBlock(SvTreeListBox& rAutoTextLB, const String& rBlockName) pEntry = rAutoTextLB.Next(pEntry); } } -//----------------------------------------------------------------------------- + sal_Bool lcl_FindBlock(SvTreeListBox& rAutoTextLB, const String& rBlockName) { SvLBoxEntry* pEntry = rAutoTextLB.First(); @@ -826,7 +736,6 @@ sal_Bool lcl_FindBlock(SvTreeListBox& rAutoTextLB, const String& rBlockName) return sal_False; } -//----------------------------------------------------------------------------- void SwVisitingCardPage::Reset(const SfxItemSet& rSet) { aLabItem = (const SwLabItem&) rSet.Get(FN_LABEL); @@ -872,9 +781,6 @@ void SwVisitingCardPage::Reset(const SfxItemSet& rSet) } } -/* -----------------29.09.99 08:55------------------- - - --------------------------------------------------*/ SwPrivateDataPage::SwPrivateDataPage(Window* pParent, const SfxItemSet& rSet) : SfxTabPage(pParent, SW_RES(TP_PRIVATE_DATA), rSet), aDataFL (this, SW_RES( FL_DATA )), @@ -913,38 +819,27 @@ SwPrivateDataPage::SwPrivateDataPage(Window* pParent, const SfxItemSet& rSet) : SetExchangeSupport(); } -/*-- 29.09.99 08:55:57--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwPrivateDataPage::~SwPrivateDataPage() { } -/*-- 29.09.99 08:55:57--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxTabPage* SwPrivateDataPage::Create(Window* pParent, const SfxItemSet& rSet) { return new SwPrivateDataPage(pParent, rSet); } -/*-- 29.09.99 08:55:57--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwPrivateDataPage::ActivatePage(const SfxItemSet& rSet) { Reset(rSet); } -/*-- 29.09.99 08:55:58--------------------------------------------------- - -----------------------------------------------------------------------*/ int SwPrivateDataPage::DeactivatePage(SfxItemSet* _pSet) { if (_pSet) FillItemSet(*_pSet); return LEAVE_PAGE; } -/*-- 29.09.99 08:55:58--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwPrivateDataPage::FillItemSet(SfxItemSet& rSet) { @@ -971,9 +866,7 @@ sal_Bool SwPrivateDataPage::FillItemSet(SfxItemSet& rSet) rSet.Put(aItem); return sal_True; } -/*-- 29.09.99 08:55:59--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwPrivateDataPage::Reset(const SfxItemSet& rSet) { const SwLabItem& aItem = (const SwLabItem&) rSet.Get(FN_LABEL); @@ -996,9 +889,7 @@ void SwPrivateDataPage::Reset(const SfxItemSet& rSet) aHomePageED .SetText(aItem.aPrivWWW); aMailED .SetText(aItem.aPrivMail); } -/* -----------------29.09.99 08:56------------------- - --------------------------------------------------*/ SwBusinessDataPage::SwBusinessDataPage(Window* pParent, const SfxItemSet& rSet) : SfxTabPage(pParent, SW_RES(TP_BUSINESS_DATA), rSet), aDataFL (this, SW_RES( FL_DATA )), @@ -1031,38 +922,28 @@ SwBusinessDataPage::SwBusinessDataPage(Window* pParent, const SfxItemSet& rSet) SetExchangeSupport(); } -/*-- 29.09.99 08:56:06--------------------------------------------------- - -----------------------------------------------------------------------*/ SwBusinessDataPage::~SwBusinessDataPage() { } -/*-- 29.09.99 08:56:06--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxTabPage* SwBusinessDataPage::Create(Window* pParent, const SfxItemSet& rSet) { return new SwBusinessDataPage(pParent, rSet); } -/*-- 29.09.99 08:56:06--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwBusinessDataPage::ActivatePage(const SfxItemSet& rSet) { Reset(rSet); } -/*-- 29.09.99 08:56:06--------------------------------------------------- - -----------------------------------------------------------------------*/ int SwBusinessDataPage::DeactivatePage(SfxItemSet* _pSet) { if (_pSet) FillItemSet(*_pSet); return LEAVE_PAGE; } -/*-- 29.09.99 08:56:06--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwBusinessDataPage::FillItemSet(SfxItemSet& rSet) { SwLabItem aItem = (const SwLabItem&) GetTabDialog()->GetExampleSet()->Get(FN_LABEL); @@ -1085,9 +966,7 @@ sal_Bool SwBusinessDataPage::FillItemSet(SfxItemSet& rSet) rSet.Put(aItem); return sal_True; } -/*-- 29.09.99 08:56:07--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwBusinessDataPage::Reset(const SfxItemSet& rSet) { const SwLabItem& aItem = (const SwLabItem&) rSet.Get(FN_LABEL); @@ -1109,3 +988,4 @@ void SwBusinessDataPage::Reset(const SfxItemSet& rSet) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/labelcfg.cxx b/sw/source/ui/envelp/labelcfg.cxx index db5db74e5f..0727275944 100644 --- a/sw/source/ui/envelp/labelcfg.cxx +++ b/sw/source/ui/envelp/labelcfg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,27 +38,21 @@ #include <unomid.h> using namespace utl; -using namespace rtl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; -/* -----------------------------15.01.01 11:17-------------------------------- +using ::rtl::OUString; - ---------------------------------------------------------------------------*/ SwLabelConfig::SwLabelConfig() : ConfigItem(C2U("Office.Labels/Manufacturer")) { aNodeNames = GetNodeNames(OUString()); } -/* -----------------------------06.09.00 16:50-------------------------------- - ---------------------------------------------------------------------------*/ SwLabelConfig::~SwLabelConfig() { } -/* -----------------------------06.09.00 16:43-------------------------------- - ---------------------------------------------------------------------------*/ void SwLabelConfig::Commit() { // the config item is not writable yet @@ -65,9 +60,6 @@ void SwLabelConfig::Commit() void SwLabelConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} -/* -----------------------------15.01.01 11:42-------------------------------- - - ---------------------------------------------------------------------------*/ Sequence<OUString> lcl_CreatePropertyNames(const OUString& rPrefix) { Sequence<OUString> aProperties(2); @@ -79,7 +71,7 @@ Sequence<OUString> lcl_CreatePropertyNames(const OUString& rPrefix) pProperties[ 1] += C2U("Measure"); return aProperties; } -//----------------------------------------------------------------------------- + SwLabRec* lcl_CreateSwLabRec(Sequence<Any>& rValues, const OUString& rManufacturer) { SwLabRec* pNewRec = new SwLabRec; @@ -95,8 +87,8 @@ SwLabRec* lcl_CreateSwLabRec(Sequence<Any>& rValues, const OUString& rManufactur case 0: pValues[nProp] >>= sTmp; pNewRec->aType = sTmp; break; case 1: { -//all values are contained as colon-separated 1/100 mm values except for the -//continuous flag ('C'/'S') + //all values are contained as colon-separated 1/100 mm values + //except for the continuous flag ('C'/'S') pValues[nProp] >>= sTmp; String sMeasure(sTmp); sal_uInt16 nTokenCount = sMeasure.GetTokenCount(';'); @@ -124,7 +116,7 @@ SwLabRec* lcl_CreateSwLabRec(Sequence<Any>& rValues, const OUString& rManufactur } return pNewRec; } -//----------------------------------------------------------------------------- + Sequence<PropertyValue> lcl_CreateProperties( Sequence<OUString>& rPropNames, const SwLabRec& rRec) { @@ -158,7 +150,7 @@ Sequence<PropertyValue> lcl_CreateProperties( } return aRet; } -//----------------------------------------------------------------------------- + void SwLabelConfig::FillLabels(const OUString& rManufacturer, SwLabRecs& rLabArr) { OUString sManufacturer(wrapConfigurationElementName(rManufacturer)); @@ -176,9 +168,7 @@ void SwLabelConfig::FillLabels(const OUString& rManufacturer, SwLabRecs& rLabArr rLabArr.C40_INSERT( SwLabRec, pNewRec, rLabArr.Count() ); } } -/* -----------------------------23.01.01 11:36-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwLabelConfig::HasLabel(const rtl::OUString& rManufacturer, const rtl::OUString& rType) { const OUString* pNode = aNodeNames.getConstArray(); @@ -215,9 +205,7 @@ sal_Bool SwLabelConfig::HasLabel(const rtl::OUString& rManufacturer, const rtl:: } return sal_False; } -/* -----------------------------23.01.01 11:36-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool lcl_Exists(const OUString& rNode, const Sequence<OUString>& rLabels) { const OUString* pLabels = rLabels.getConstArray(); @@ -226,7 +214,7 @@ sal_Bool lcl_Exists(const OUString& rNode, const Sequence<OUString>& rLabels) return sal_True; return sal_False; } -//----------------------------------------------------------------------------- + void SwLabelConfig::SaveLabel( const rtl::OUString& rManufacturer, const rtl::OUString& rType, const SwLabRec& rRec) { @@ -241,7 +229,7 @@ void SwLabelConfig::SaveLabel( const rtl::OUString& rManufacturer, { if(!AddNode(OUString(), rManufacturer)) { - DBG_ERROR("New configuration node could not be created"); + OSL_ENSURE(false, "New configuration node could not be created"); return ; } else @@ -300,3 +288,4 @@ void SwLabelConfig::SaveLabel( const rtl::OUString& rManufacturer, } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/labelexp.cxx b/sw/source/ui/envelp/labelexp.cxx index c2d6596f20..43e510c26b 100644 --- a/sw/source/ui/envelp/labelexp.cxx +++ b/sw/source/ui/envelp/labelexp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,9 +57,6 @@ using ::rtl::OUString; #endif #define SW_PROP_NAME_STR(nId) SwGetPropName((nId)).pName -/* -----------------08.07.99 15:15------------------- - - --------------------------------------------------*/ void SwVisitingCardPage::InitFrameControl() { Link aLink(LINK(this, SwVisitingCardPage, FrameControlInitializedHdl)); @@ -75,7 +73,7 @@ void SwVisitingCardPage::InitFrameControl() uno::Sequence<OUString> aNames = _xAutoText->getElementNames(); const OUString* pGroups = aNames.getConstArray(); - OUString uTitleName( C2U(SW_PROP_NAME_STR(UNO_NAME_TITLE)) ); + OUString uTitleName( rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_TITLE)) ); for(sal_uInt16 i = 0; i < aNames.getLength(); i++) { @@ -126,9 +124,7 @@ void SwVisitingCardPage::InitFrameControl() } } } -/* -----------------01.10.99 13:19------------------- - --------------------------------------------------*/ IMPL_LINK( SwVisitingCardPage, FrameControlInitializedHdl, void*, EMPTYARG ) { SvLBoxEntry* pSel = aAutoTextLB.FirstSelected(); @@ -161,9 +157,7 @@ IMPL_LINK( SwVisitingCardPage, FrameControlInitializedHdl, void*, EMPTYARG ) } return 0; } -/* -----------------22.07.99 11:06------------------- - --------------------------------------------------*/ IMPL_LINK( SwVisitingCardPage, AutoTextSelectHdl, void*, pBox ) { if(_xAutoText.is()) @@ -190,9 +184,6 @@ IMPL_LINK( SwVisitingCardPage, AutoTextSelectHdl, void*, pBox ) return 0; } -/* -----------------01.10.99 11:59------------------- - - --------------------------------------------------*/ void SwVisitingCardPage::UpdateFields() { uno::Reference< frame::XModel > xModel; @@ -201,9 +192,7 @@ void SwVisitingCardPage::UpdateFields() SwLabDlg::UpdateFieldInformation(xModel, aLabItem); } } -/* -----------------01.10.99 15:16------------------- - --------------------------------------------------*/ void SwLabDlg::UpdateFieldInformation(uno::Reference< frame::XModel > & xModel, const SwLabItem& rItem) { uno::Reference< text::XTextFieldsSupplier > xFlds(xModel, uno::UNO_QUERY); @@ -252,7 +241,7 @@ void SwLabDlg::UpdateFieldInformation(uno::Reference< frame::XModel > & xModel, { String sFldName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.FieldMaster.User." ))); - OUString uCntName( C2U( SW_PROP_NAME_STR(UNO_NAME_CONTENT ))); + OUString uCntName( rtl::OUString::createFromAscii( SW_PROP_NAME_STR(UNO_NAME_CONTENT ))); for( const _SwLabItemMap* p = aArr; p->pName; ++p ) { String sCurFldName( sFldName ); @@ -279,3 +268,4 @@ void SwLabDlg::UpdateFieldInformation(uno::Reference< frame::XModel > & xModel, xRefresh->refresh(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index 4d1adfa200..a670927baf 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,15 +49,13 @@ #include <unomid.h> using namespace utl; -using namespace rtl; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; -// #define ------------------------------------------------------------------ +using ::rtl::OUString; #define ROUND(x) ((sal_uInt16) ((x) + .5)) -// -------------------------------------------------------------------------- SwLabPreview::SwLabPreview( const SwLabFmtPage* pParent, const ResId& rResID ) : Window((Window*) pParent, rResID), @@ -99,18 +98,17 @@ SwLabPreview::SwLabPreview( const SwLabFmtPage* pParent, const ResId& rResID ) : lXHeight = GetTextHeight(); lXWidth = GetTextWidth('X'); - // Skalierungsfaktor + // Scale factor float fx = (float)(lOutWPix - (2 * (lLeftWidth + 15))) / (float)lOutWPix; lOutWPix23 = (long)((float)lOutWPix * fx); lOutHPix23 = (long)((float)lOutHPix * fx); } -// -------------------------------------------------------------------------- SwLabPreview::~SwLabPreview() { } -// -------------------------------------------------------------------------- + void SwLabPreview::Paint(const Rectangle &) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -130,7 +128,7 @@ void SwLabPreview::Paint(const Rectangle &) aPaintFont.SetTransparent(sal_False); SetFont(aPaintFont); - // Groesse des darzustellenden Bereichs + // size of region to be displayed long lDispW = ROUND(aItem.lLeft + aItem.lHDist); long lDispH = ROUND(aItem.lUpper + aItem.lVDist); if (aItem.nCols == 1) @@ -142,12 +140,12 @@ void SwLabPreview::Paint(const Rectangle &) else lDispH += ROUND(aItem.lVDist / 10); - // Skalierungsfaktor + // Scale factor float fx = (float) lOutWPix23 / Max(1L, lDispW), fy = (float) lOutHPix23 / Max(1L, lDispH), f = fx < fy ? fx : fy; - // Nullpunkt + // zero point long lOutlineW = ROUND(f * lDispW); long lOutlineH = ROUND(f * lDispH); @@ -160,19 +158,19 @@ void SwLabPreview::Paint(const Rectangle &) long lX3 = ROUND(lX0 + f * (aItem.lLeft + aItem.lHDist )); long lY3 = ROUND(lY0 + f * (aItem.lUpper + aItem.lVDist )); - // Umriss zeichnen (Flaeche) + // draw outline (area) DrawRect(Rectangle(Point(lX0, lY0), Size(lOutlineW, lOutlineH))); - // Umriss zeichnen (Umrandung) + // draw outline (border) SetLineColor(rFieldTextColor); - DrawLine(Point(lX0, lY0), Point(lX0 + lOutlineW - 1, lY0)); // Oben - DrawLine(Point(lX0, lY0), Point(lX0, lY0 + lOutlineH - 1)); // Links + DrawLine(Point(lX0, lY0), Point(lX0 + lOutlineW - 1, lY0)); // Up + DrawLine(Point(lX0, lY0), Point(lX0, lY0 + lOutlineH - 1)); // Left if (aItem.nCols == 1) - DrawLine(Point(lX0 + lOutlineW - 1, lY0), Point(lX0 + lOutlineW - 1, lY0 + lOutlineH - 1)); // Rechts + DrawLine(Point(lX0 + lOutlineW - 1, lY0), Point(lX0 + lOutlineW - 1, lY0 + lOutlineH - 1)); // Right if (aItem.nRows == 1) - DrawLine(Point(lX0, lY0 + lOutlineH - 1), Point(lX0 + lOutlineW - 1, lY0 + lOutlineH - 1)); // Unten + DrawLine(Point(lX0, lY0 + lOutlineH - 1), Point(lX0 + lOutlineW - 1, lY0 + lOutlineH - 1)); // Down - // Etiketten + // Labels SetClipRegion (Rectangle(Point(lX0, lY0), Size(lOutlineW, lOutlineH))); SetFillColor(rWinColor); for (sal_uInt16 nRow = 0; nRow < Min((sal_uInt16) 2, (sal_uInt16) aItem.nRows); nRow++) @@ -184,7 +182,7 @@ void SwLabPreview::Paint(const Rectangle &) ROUND(f * aItem.lHeight)))); SetClipRegion(); - // Beschritung: Rand links + // annotation: left border if (aItem.lLeft) { long lX = (lX0 + lX1) / 2; @@ -193,14 +191,14 @@ void SwLabPreview::Paint(const Rectangle &) DrawText(Point(lX1 - lLeftWidth, lY0 - 10 - lXHeight), aLeftStr); } - // Beschriftung: Rand oben + // annotation: upper border if (aItem.lUpper) { DrawArrow(Point(lX0 - 5, lY0), Point(lX0 - 5, lY1), sal_False); DrawText(Point(lX0 - 10 - lUpperWidth, ROUND(lY0 + f * aItem.lUpper / 2 - lXHeight / 2)), aUpperStr); } - // Beschriftung: Breite und Hoehe + // annotation: width and height { long lX = lX2 - lXWidth / 2 - lHeightWidth / 2; long lY = lY1 + lXHeight; @@ -212,7 +210,7 @@ void SwLabPreview::Paint(const Rectangle &) DrawText(Point(lX - lHeightWidth / 2, lY2 - lXHeight - lXHeight / 2), aHeightStr); } - // Beschriftung: Horz. Abstand + // annotation: horizontal gap if (aItem.nCols > 1) { long lX = (lX1 + lX3) / 2; @@ -221,21 +219,21 @@ void SwLabPreview::Paint(const Rectangle &) DrawText(Point(lX - lHDistWidth / 2, lY0 - 10 - lXHeight), aHDistStr); } - // Beschriftung: Vertikaler Abstand + // annotation: vertical gap if (aItem.nRows > 1) { DrawArrow(Point(lX0 - 5, lY1), Point(lX0 - 5, lY3), sal_False); DrawText(Point(lX0 - 10 - lVDistWidth, ROUND(lY1 + f * aItem.lVDist / 2 - lXHeight / 2)), aVDistStr); } - // Beschriftung: Spalten + // annotation: columns { long lY = lY0 + lOutlineH + 4; DrawArrow(Point(lX0, lY), Point(lX0 + lOutlineW - 1, lY), sal_True); DrawText(Point((lX0 + lX0 + lOutlineW - 1) / 2 - lColsWidth / 2, lY + 5), aColsStr); } - // Beschriftung: Zeilen + // annotation: lines { long lX = lX0 + lOutlineW + 4; DrawArrow(Point(lX, lY0), Point(lX, lY0 + lOutlineH - 1), sal_True); @@ -243,9 +241,7 @@ void SwLabPreview::Paint(const Rectangle &) } } -// Pfeil bzw. Intervall zeichnen -------------------------------------------- - - +// Arror or interval character -------------------------------------------- void SwLabPreview::DrawArrow(const Point &rP1, const Point &rP2, sal_Bool bArrow) { @@ -255,10 +251,10 @@ void SwLabPreview::DrawArrow(const Point &rP1, const Point &rP2, sal_Bool bArrow { Point aArr[3]; - // Pfeil zeichnen + // Arrow character if (rP1.Y() == rP2.Y()) { - // Waagerecht + // Horizontal aArr[0].X() = rP2.X() - 5; aArr[0].Y() = rP2.Y() - 2; aArr[1].X() = rP2.X(); @@ -268,7 +264,7 @@ void SwLabPreview::DrawArrow(const Point &rP1, const Point &rP2, sal_Bool bArrow } else { - // Senkrecht + // Vertical aArr[0].X() = rP2.X() - 2; aArr[0].Y() = rP2.Y() - 5; aArr[1].X() = rP2.X() + 2; @@ -283,34 +279,28 @@ void SwLabPreview::DrawArrow(const Point &rP1, const Point &rP2, sal_Bool bArrow } else { - // Intervall zeichnen + // Interval symbol if (rP1.Y() == rP2.Y()) { - // Waagerecht + // Horizontal DrawLine(Point(rP1.X(), rP1.Y() - 2), Point(rP1.X(), rP1.Y() + 2)); DrawLine(Point(rP2.X(), rP2.Y() - 2), Point(rP2.X(), rP2.Y() + 2)); } else { - // Senkrecht + // Vertical DrawLine(Point(rP1.X() - 2, rP1.Y()), Point(rP1.X() + 2, rP1.Y())); DrawLine(Point(rP2.X() - 2, rP2.Y()), Point(rP2.X() + 2, rP2.Y())); } } } -// -------------------------------------------------------------------------- - void SwLabPreview::Update(const SwLabItem& rItem) { aItem = rItem; Invalidate(); } -// -------------------------------------------------------------------------- - - - SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) : SfxTabPage(pParent, SW_RES(TP_LAB_FMT), rSet), @@ -340,7 +330,7 @@ SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) : FreeResource(); SetExchangeSupport(); - // Metriken + // Metrics FieldUnit aMetric = ::GetDfltMetric(sal_False); SetMetric(aHDistField , aMetric); SetMetric(aVDistField , aMetric); @@ -349,7 +339,7 @@ SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) : SetMetric(aLeftField , aMetric); SetMetric(aUpperField , aMetric); - // Handler installieren + // Install handlers Link aLk = LINK(this, SwLabFmtPage, ModifyHdl); aHDistField .SetModifyHdl( aLk ); aVDistField .SetModifyHdl( aLk ); @@ -371,23 +361,16 @@ SwLabFmtPage::SwLabFmtPage(Window* pParent, const SfxItemSet& rSet) : aRowsField .SetLoseFocusHdl( aLk ); aSavePB.SetClickHdl( LINK (this, SwLabFmtPage, SaveHdl)); - // Timer einstellen + // Set timer aPreviewTimer.SetTimeout(1000); aPreviewTimer.SetTimeoutHdl(LINK(this, SwLabFmtPage, PreviewHdl)); } -// -------------------------------------------------------------------------- - - - SwLabFmtPage::~SwLabFmtPage() { } -// Modify-Handler der MetricFields. Preview-Timer starten ------------------- - - - +// Modify-handler of MetricFields. start preview timer IMPL_LINK_INLINE_START( SwLabFmtPage, ModifyHdl, Edit *, EMPTYARG ) { bModified = sal_True; @@ -396,10 +379,7 @@ IMPL_LINK_INLINE_START( SwLabFmtPage, ModifyHdl, Edit *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwLabFmtPage, ModifyHdl, Edit *, EMPTYARG ) -// Preview invalidaten ------------------------------------------------------ - - - +// Invalidate preview IMPL_LINK_INLINE_START( SwLabFmtPage, PreviewHdl, Timer *, EMPTYARG ) { aPreviewTimer.Stop(); @@ -411,10 +391,7 @@ IMPL_LINK_INLINE_START( SwLabFmtPage, PreviewHdl, Timer *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwLabFmtPage, PreviewHdl, Timer *, EMPTYARG ) -// LoseFocus-Handler: Bei Aenderung sofort updaten -------------------------- - - - +// LoseFocus-Handler: Update on change -------------------------- IMPL_LINK_INLINE_START( SwLabFmtPage, LoseFocusHdl, Control *, pControl ) { if (((Edit*) pControl)->IsModified()) @@ -423,14 +400,11 @@ IMPL_LINK_INLINE_START( SwLabFmtPage, LoseFocusHdl, Control *, pControl ) } IMPL_LINK_INLINE_END( SwLabFmtPage, LoseFocusHdl, Control *, pControl ) -// Minima und Maxima fuer Fields festlegen ---------------------------------- - - void SwLabFmtPage::ChangeMinMax() { long lMax = 31748; // 56 cm - // Min und Max + // Min and Max long lLeft = static_cast< long >(GETFLDVAL(aLeftField )), lUpper = static_cast< long >(GETFLDVAL(aUpperField)), @@ -457,7 +431,7 @@ void SwLabFmtPage::ChangeMinMax() aColsField .SetMax((lMax - lLeft ) / Max(1L, lHDist)); aRowsField .SetMax((lMax - lUpper) / Max(1L, lVDist)); - // First und Last + // First and Last aHDistField .SetFirst(aHDistField .GetMin()); aVDistField .SetFirst(aVDistField .GetMin()); @@ -487,29 +461,17 @@ void SwLabFmtPage::ChangeMinMax() aRowsField .Reformat(); } -// -------------------------------------------------------------------------- - - - SfxTabPage* SwLabFmtPage::Create(Window* pParent, const SfxItemSet& rSet) { return new SwLabFmtPage(pParent, rSet); } -// ---------------------------------------------------------------------------- - - - void SwLabFmtPage::ActivatePage(const SfxItemSet& rSet) { SfxItemSet aSet(rSet); Reset(aSet); } -// ---------------------------------------------------------------------------- - - - int SwLabFmtPage::DeactivatePage(SfxItemSet* _pSet) { if (_pSet) @@ -518,10 +480,6 @@ int SwLabFmtPage::DeactivatePage(SfxItemSet* _pSet) return sal_True; } -// -------------------------------------------------------------------------- - - - void SwLabFmtPage::FillItem(SwLabItem& rItem) { if (bModified) @@ -540,10 +498,6 @@ void SwLabFmtPage::FillItem(SwLabItem& rItem) } } -// -------------------------------------------------------------------------- - - - sal_Bool SwLabFmtPage::FillItemSet(SfxItemSet& rSet) { FillItem(aItem); @@ -552,10 +506,9 @@ sal_Bool SwLabFmtPage::FillItemSet(SfxItemSet& rSet) return sal_True; } -// -------------------------------------------------------------------------- void SwLabFmtPage::Reset(const SfxItemSet& ) { - // Fields initialisieren + // Initialise fields GetParent()->GetLabItem(aItem); aHDistField .SetMax(100 * aItem.lHDist , FUNIT_TWIP); @@ -581,9 +534,6 @@ void SwLabFmtPage::Reset(const SfxItemSet& ) aTypeFI.SetText(aItem.aType); PreviewHdl(0); } -/* -----------------------------22.01.01 15:11-------------------------------- - - ---------------------------------------------------------------------------*/ IMPL_LINK( SwLabFmtPage, SaveHdl, PushButton *, EMPTYARG ) { @@ -620,9 +570,7 @@ IMPL_LINK( SwLabFmtPage, SaveHdl, PushButton *, EMPTYARG ) delete pSaveDlg; return 0; } -/* -----------------------------23.01.01 10:41-------------------------------- - ---------------------------------------------------------------------------*/ SwSaveLabelDlg::SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec) : ModalDialog(pParent, SW_RES(DLG_SAVE_LABEL)), aOptionsFL(this,SW_RES(FL_OPTIONS )), @@ -654,9 +602,7 @@ SwSaveLabelDlg::SwSaveLabelDlg(SwLabFmtPage* pParent, SwLabRec& rRec) : for(sal_Int32 i = 0; i < rMan.getLength(); i++) aMakeCB.InsertEntry(pMan[i]); } -/* -----------------------------23.01.01 10:40-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK(SwSaveLabelDlg, OkHdl, OKButton*, EMPTYARG) { SwLabelConfig& rCfg = pLabPage->GetParent()->GetLabelsConfig(); @@ -681,17 +627,13 @@ IMPL_LINK(SwSaveLabelDlg, OkHdl, OKButton*, EMPTYARG) EndDialog(RET_OK); return 0; } -/* -----------------------------23.01.01 11:22-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK(SwSaveLabelDlg, ModifyHdl, Edit*, EMPTYARG) { aOKPB.Enable(aMakeCB.GetText().Len() && aTypeED.GetText().Len()); return 0; } -/* -----------------------------23.01.01 16:06-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwSaveLabelDlg::GetLabel(SwLabItem& rItem) { if(bSuccess) @@ -710,3 +652,4 @@ sal_Bool SwSaveLabelDlg::GetLabel(SwLabItem& rItem) return bSuccess; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/labfmt.hrc b/sw/source/ui/envelp/labfmt.hrc index 96e511038f..96aafaa044 100644 --- a/sw/source/ui/envelp/labfmt.hrc +++ b/sw/source/ui/envelp/labfmt.hrc @@ -28,11 +28,9 @@ #ifndef _LABFMT_HRC #define _LABFMT_HRC -// #include ***************************************************************** - #include "envelp.hrc" -// Lokale Resourcen ********************************************************* +// local resources ********************************************************* #define WIN_PREVIEW 1 #define TXT_HDIST 2 @@ -66,7 +64,7 @@ #define PB_HELP 8 #define MB_QUERY 9 -// Globale Resourcen ******************************************************** +// global resources ******************************************************** #define STR_HDIST (RC_LABFMT_BEGIN + 1) #define STR_VDIST (RC_LABFMT_BEGIN + 2) @@ -77,7 +75,7 @@ #define STR_COLS (RC_LABFMT_BEGIN + 7) #define STR_ROWS (RC_LABFMT_BEGIN + 8) -// Ueberlaufpruefung ******************************************************** +// overflow check ******************************************************** #define LABFMT_ACT_END STR_ROWS diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx index 6922951b29..f986acf4ba 100644 --- a/sw/source/ui/envelp/labfmt.hxx +++ b/sw/source/ui/envelp/labfmt.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -137,9 +138,7 @@ public: SwLabDlg* GetParent() {return (SwLabDlg*) SfxTabPage::GetParent()->GetParent();} }; -/* -----------------------------23.01.01 10:26-------------------------------- - ---------------------------------------------------------------------------*/ class SwSaveLabelDlg : public ModalDialog { FixedLine aOptionsFL; @@ -173,3 +172,4 @@ public: }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/labfmt.src b/sw/source/ui/envelp/labfmt.src index 107791b2e8..903a88823c 100644 --- a/sw/source/ui/envelp/labfmt.src +++ b/sw/source/ui/envelp/labfmt.src @@ -26,7 +26,6 @@ ************************************************************************/ // #pragma ****************************************************************** - // #include ***************************************************************** #include "labfmt.hrc" #include "helpid.h" // TP_LAB_FMT --------------------------------------------------------------- diff --git a/sw/source/ui/envelp/labimg.cxx b/sw/source/ui/envelp/labimg.cxx index a65f3cfd60..dc5af4924f 100644 --- a/sw/source/ui/envelp/labimg.cxx +++ b/sw/source/ui/envelp/labimg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <tools/stream.hxx> -#ifndef _RESID_HXX //autogen #include <tools/resid.hxx> -#endif #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <unotools/useroptions.hxx> @@ -44,11 +43,10 @@ #include <unomid.h> using namespace utl; -using namespace rtl; using namespace ::com::sun::star::uno; +using ::rtl::OUString; -// ---------------------------------------------------------------------------- SwLabItem::SwLabItem() : SfxPoolItem(FN_LABEL), @@ -67,13 +65,12 @@ SwLabItem::SwLabItem() : lHeight = 5669; // 10 cm } -// ---------------------------------------------------------------------------- SwLabItem::SwLabItem(const SwLabItem& rItem) : SfxPoolItem(FN_LABEL) { *this = rItem; } -// ---------------------------------------------------------------------------- + SwLabItem& SwLabItem::operator =(const SwLabItem& rItem) { bAddr = rItem.bAddr; @@ -134,10 +131,6 @@ SwLabItem& SwLabItem::operator =(const SwLabItem& rItem) return *this; } -// -------------------------------------------------------------------------- - - - int SwLabItem::operator ==(const SfxPoolItem& rItem) const { const SwLabItem& rLab = (const SwLabItem&) rItem; @@ -163,7 +156,7 @@ int SwLabItem::operator ==(const SfxPoolItem& rItem) const aLstMake == rLab.aLstMake&& aLstType == rLab.aLstType&& sDBName == rLab.sDBName && - aPrivFirstName == rLab.aPrivFirstName&& + aPrivFirstName == rLab.aPrivFirstName&& aPrivName == rLab.aPrivName&& aPrivShortCut == rLab.aPrivShortCut&& aPrivFirstName2 == rLab.aPrivFirstName2&& @@ -199,15 +192,11 @@ int SwLabItem::operator ==(const SfxPoolItem& rItem) const sGlossaryBlockName == rLab.sGlossaryBlockName; } -// -------------------------------------------------------------------------- SfxPoolItem* SwLabItem::Clone(SfxItemPool*) const { return new SwLabItem(*this); } -/* -----------------------------25.09.00 16:25-------------------------------- - - ---------------------------------------------------------------------------*/ Sequence<rtl::OUString> SwLabCfgItem::GetPropertyNames() { static const char* aLabelPropNames[] = @@ -279,9 +268,7 @@ Sequence<rtl::OUString> SwLabCfgItem::GetPropertyNames() pNames[nIndex++] = OUString::createFromAscii(aBusinessPropNames[nBusiness]); return aNames; } -/* ---------------------------------------------------------------------------- - ---------------------------------------------------------------------------*/ SwLabCfgItem::SwLabCfgItem(sal_Bool bLabel) : ConfigItem(bLabel ? C2U("Office.Writer/Label") : C2U("Office.Writer/BusinessCard")), bIsLabel(bLabel) @@ -290,7 +277,7 @@ SwLabCfgItem::SwLabCfgItem(sal_Bool bLabel) : Sequence<Any> aValues = GetProperties(aNames); EnableNotification(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); sal_Bool bNoConfigValues = sal_True; if(aValues.getLength() == aNames.getLength()) { @@ -404,9 +391,7 @@ SwLabCfgItem::SwLabCfgItem(sal_Bool bLabel) : SetModified(); } } -/* -----------------------------25.09.00 16:26-------------------------------- - ---------------------------------------------------------------------------*/ void SwLabCfgItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} void SwLabCfgItem::Commit() @@ -480,3 +465,4 @@ void SwLabCfgItem::Commit() PutProperties(aNames, aValues); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/labimp.hxx b/sw/source/ui/envelp/labimp.hxx index be3fa2c537..f0a2b6b425 100644 --- a/sw/source/ui/envelp/labimp.hxx +++ b/sw/source/ui/envelp/labimp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -116,3 +117,4 @@ SV_DECL_PTRARR_DEL( SwLabRecs, SwLabRec*, 110, 10 ) #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx index 868fd0539b..a3797761cd 100644 --- a/sw/source/ui/envelp/labprt.cxx +++ b/sw/source/ui/envelp/labprt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,21 +41,10 @@ #include <label.hxx> #include <labprt.hxx> #include <labimg.hxx> -#ifndef _LABIMP_HXX #include "swuilabimp.hxx" -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _LABPRT_HRC #include <labprt.hrc> -#endif - - -// -------------------------------------------------------------------------- - - SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet) : @@ -77,7 +67,7 @@ SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet) : FreeResource(); SetExchangeSupport(); - // Handler installieren + // Install handlers Link aLk = LINK(this, SwLabPrtPage, CountHdl); aPageButton .SetClickHdl( aLk ); aSingleButton.SetClickHdl( aLk ); @@ -95,25 +85,17 @@ SwLabPrtPage::SwLabPrtPage(Window* pParent, const SfxItemSet& rSet) : } } -// -------------------------------------------------------------------------- - - - SwLabPrtPage::~SwLabPrtPage() { if (pPrinter) delete pPrinter; } -// -------------------------------------------------------------------------- - - - IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton ) { if (pButton == &aPrtSetup) { - // Druck-Setup aufrufen + // Call printer setup if (!pPrinter) pPrinter = new Printer; @@ -134,35 +116,23 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton ) if ( bEnable ) aColField.GrabFocus(); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 else - ASSERT( pButton == &aPageButton, "NewButton?" ); + OSL_ENSURE( pButton == &aPageButton, "NewButton?" ); #endif return 0; } -// -------------------------------------------------------------------------- - - - SfxTabPage* SwLabPrtPage::Create(Window* pParent, const SfxItemSet& rSet) { return new SwLabPrtPage( pParent, rSet ); } -// -------------------------------------------------------------------------- - - - void SwLabPrtPage::ActivatePage( const SfxItemSet& rSet ) { Reset(rSet); } -// -------------------------------------------------------------------------- - - - int SwLabPrtPage::DeactivatePage(SfxItemSet* _pSet) { if ( _pSet ) @@ -171,10 +141,6 @@ int SwLabPrtPage::DeactivatePage(SfxItemSet* _pSet) return sal_True; } -// -------------------------------------------------------------------------- - - - void SwLabPrtPage::FillItem(SwLabItem& rItem) { rItem.bPage = aPageButton.IsChecked(); @@ -183,10 +149,6 @@ void SwLabPrtPage::FillItem(SwLabItem& rItem) rItem.bSynchron = aSynchronCB.IsChecked() && aSynchronCB.IsEnabled(); } -// -------------------------------------------------------------------------- - - - sal_Bool SwLabPrtPage::FillItemSet(SfxItemSet& rSet) { SwLabItem aItem; @@ -197,10 +159,6 @@ sal_Bool SwLabPrtPage::FillItemSet(SfxItemSet& rSet) return sal_True; } -// -------------------------------------------------------------------------- - - - void SwLabPrtPage::Reset(const SfxItemSet& ) { SwLabItem aItem; @@ -222,7 +180,7 @@ void SwLabPrtPage::Reset(const SfxItemSet& ) if (pPrinter) { - // Drucker anzeigen + // show printer aPrinterInfo.SetText(pPrinter->GetName()); } else @@ -240,3 +198,4 @@ void SwLabPrtPage::Reset(const SfxItemSet& ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/labprt.hrc b/sw/source/ui/envelp/labprt.hrc index 56cc1e09cd..3f7d8790f1 100644 --- a/sw/source/ui/envelp/labprt.hrc +++ b/sw/source/ui/envelp/labprt.hrc @@ -28,11 +28,9 @@ #ifndef _LABPRT_HRC #define _LABPRT_HRC -// #include ***************************************************************** - #include "envelp.hrc" -// Lokale Resourcen ********************************************************* +// local resources ********************************************************* #define BTN_PAGE 1 #define BTN_SINGLE 2 @@ -46,7 +44,7 @@ #define FL_DONTKNOW 10 #define CB_SYNCHRON 11 -// Ueberlaufpruefung ******************************************************** +// overflow check ******************************************************** #define LABPRT_ACT_END 0 diff --git a/sw/source/ui/envelp/labprt.hxx b/sw/source/ui/envelp/labprt.hxx index 5bddd0ecf6..4ccc5911cb 100644 --- a/sw/source/ui/envelp/labprt.hxx +++ b/sw/source/ui/envelp/labprt.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <vcl/group.hxx> #include <vcl/field.hxx> #include <svtools/stdctrl.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <sfx2/tabdlg.hxx> @@ -43,7 +42,7 @@ class SwLabItem; class SwLabPrtPage : public SfxTabPage { - Printer* pPrinter; //Fuer die Schachteinstellug - leider. + Printer* pPrinter; // for the shaft setting - unfortunately FixedLine aFLDontKnow; RadioButton aPageButton; @@ -84,3 +83,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/labprt.src b/sw/source/ui/envelp/labprt.src index 7e1b5c4c58..c160feae1d 100644 --- a/sw/source/ui/envelp/labprt.src +++ b/sw/source/ui/envelp/labprt.src @@ -26,7 +26,6 @@ ************************************************************************/ // #pragma ****************************************************************** - // #include ***************************************************************** #include "labprt.hrc" #include "helpid.h" // TP_LAB_PRT --------------------------------------------------------------- diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index f25789b734..ab880af40b 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -75,7 +76,6 @@ #include <algorithm> -using namespace rtl; using namespace ::com::sun::star; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; @@ -90,19 +90,18 @@ using namespace ::com::sun::star::form; using namespace ::com::sun::star::view; using namespace ::com::sun::star::ui::dialogs; +using ::rtl::OUString; -/* -----------------------------05.06.01 13:54-------------------------------- - - ---------------------------------------------------------------------------*/ struct SwMailMergeDlg_Impl { uno::Reference<runtime::XFormController> xFController; uno::Reference<XSelectionChangeListener> xChgLstnr; uno::Reference<XSelectionSupplier> xSelSupp; }; -/* -----------------------------05.06.01 13:47-------------------------------- + +/* -------------------------------------------------------------------------- helper classes - ---------------------------------------------------------------------------*/ +----------------------------------------------------------------------------*/ class SwXSelChgLstnr_Impl : public cppu::WeakImplHelper1 < view::XSelectionChangeListener @@ -116,20 +115,14 @@ public: virtual void SAL_CALL selectionChanged( const EventObject& aEvent ) throw (RuntimeException); virtual void SAL_CALL disposing( const EventObject& Source ) throw (RuntimeException); }; -/* -----------------------------05.06.01 13:51-------------------------------- - ---------------------------------------------------------------------------*/ SwXSelChgLstnr_Impl::SwXSelChgLstnr_Impl(SwMailMergeDlg& rParentDlg) : rParent(rParentDlg) {} -/* -----------------------------05.06.01 14:06-------------------------------- - ---------------------------------------------------------------------------*/ SwXSelChgLstnr_Impl::~SwXSelChgLstnr_Impl() {} -/* -----------------------------05.06.01 14:06-------------------------------- - ---------------------------------------------------------------------------*/ void SwXSelChgLstnr_Impl::selectionChanged( const EventObject& ) throw (RuntimeException) { //call the parent to enable selection mode @@ -147,16 +140,12 @@ void SwXSelChgLstnr_Impl::selectionChanged( const EventObject& ) throw (Runtime rParent.m_aSelection.realloc(0); } } -/* -----------------------------05.06.01 14:06-------------------------------- - ---------------------------------------------------------------------------*/ void SwXSelChgLstnr_Impl::disposing( const EventObject& ) throw (RuntimeException) { - DBG_ERROR("disposing"); + OSL_ENSURE(false, "disposing"); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ + SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, const String& rSourceName, const String& rTblName, @@ -345,8 +334,6 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, pModOpt = SW_MOD()->GetModuleConfig(); - //aSingleJobsCB.Check(pModOpt->IsSinglePrintJob());// not supported in since cws printerpullpages anymore - sal_Int16 nMailingMode(pModOpt->GetMailingFormats()); aFormatSwCB.Check((nMailingMode & TXTFORMAT_OFFICE) != 0); aFormatHtmlCB.Check((nMailingMode & TXTFORMAT_HTML) != 0); @@ -354,7 +341,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, aAllRB.Check(sal_True); - // Handler installieren + // Install handlers Link aLk = LINK(this, SwMailMergeDlg, ButtonHdl); aOkBTN.SetClickHdl(aLk); @@ -445,9 +432,9 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, sCommand += String::CreateFromInt32(SFX_FILTER_NOTINFILEDLG); sCommand += C2U(":default_first"); uno::Reference< container::XEnumeration > xList = xQuery->createSubSetEnumerationByQuery(sCommand); - const ::rtl::OUString sName = OUString::createFromAscii("Name"); - const ::rtl::OUString sFlags = OUString::createFromAscii("Flags"); - const ::rtl::OUString sUIName = OUString::createFromAscii("UIName"); + const ::rtl::OUString sName(RTL_CONSTASCII_USTRINGPARAM("Name")); + const ::rtl::OUString sFlags(RTL_CONSTASCII_USTRINGPARAM("Flags")); + const ::rtl::OUString sUIName(RTL_CONSTASCII_USTRINGPARAM("UIName")); sal_uInt16 nODT = USHRT_MAX; while(xList->hasMoreElements()) { @@ -482,10 +469,6 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwMailMergeDlg::~SwMailMergeDlg() { if(xFrame.is()) @@ -504,34 +487,31 @@ SwMailMergeDlg::~SwMailMergeDlg() delete pImpl; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwMailMergeDlg::Apply() { } -/*-- 01.06.2007 13:06:50--------------------------------------------------- - -----------------------------------------------------------------------*/ void lcl_MoveControlY( Window* ppW, long nDiffSize ) { Point aPos( ppW->GetPosPixel()); aPos.Y() += nDiffSize; ppW->SetPosPixel( aPos ); } + void lcl_MoveControlX( Window* ppW, long nDiffSize ) { Point aPos( ppW->GetPosPixel()); aPos.X() += nDiffSize; ppW->SetPosPixel( aPos ); } + void lcl_ChangeWidth( Window* ppW, long nDiffSize ) { Size aSize( ppW->GetSizePixel()); aSize.Width() += nDiffSize; ppW->SetSizePixel( aSize ); } + void SwMailMergeDlg::Resize() { //the only controls that profit from the resize is pBeamerWin @@ -609,10 +589,6 @@ void SwMailMergeDlg::Resize() } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK( SwMailMergeDlg, ButtonHdl, Button *, pBtn ) { if (pBtn == &aOkBTN) @@ -623,10 +599,6 @@ IMPL_LINK( SwMailMergeDlg, ButtonHdl, Button *, pBtn ) return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK( SwMailMergeDlg, OutputTypeHdl, RadioButton *, pBtn ) { sal_Bool bPrint = pBtn == &aPrinterRB; @@ -654,9 +626,7 @@ IMPL_LINK( SwMailMergeDlg, OutputTypeHdl, RadioButton *, pBtn ) return 0; } -/*-- 01.06.2007 12:36:43--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwMailMergeDlg, SaveTypeHdl, RadioButton*, pBtn ) { bool bIndividual = pBtn == &aSaveIndividualRB; @@ -678,9 +648,6 @@ IMPL_LINK( SwMailMergeDlg, SaveTypeHdl, RadioButton*, pBtn ) } return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ IMPL_LINK( SwMailMergeDlg, FilenameHdl, CheckBox*, pBox ) { @@ -695,20 +662,12 @@ IMPL_LINK( SwMailMergeDlg, FilenameHdl, CheckBox*, pBox ) return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK( SwMailMergeDlg, ModifyHdl, NumericField *, EMPTYARG ) { aFromRB.Check(); return (0); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - bool SwMailMergeDlg::ExecQryShell() { if(pImpl->xSelSupp.is()) @@ -768,7 +727,7 @@ bool SwMailMergeDlg::ExecQryShell() pMgr->SetSubject(sPath); } - if (aFromRB.IsChecked()) // Liste Einfuegen + if (aFromRB.IsChecked()) // Insert list { // Safe: the maximal value of the fields is limited sal_Int32 nStart = sal::static_int_cast<sal_Int32>(aFromNF.GetValue()); @@ -783,7 +742,7 @@ bool SwMailMergeDlg::ExecQryShell() *pSelection <<= i; } else if (aAllRB.IsChecked() ) - m_aSelection.realloc(0); // Leere Selektion = Alles einfuegen + m_aSelection.realloc(0); // Empty selection = insert all else { if(pImpl->xSelSupp.is()) @@ -823,10 +782,6 @@ bool SwMailMergeDlg::ExecQryShell() return true; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK( SwMailMergeDlg, InsertPathHdl, PushButton *, EMPTYARG ) { String sPath( aPathED.GetText() ); @@ -845,7 +800,6 @@ IMPL_LINK( SwMailMergeDlg, InsertPathHdl, PushButton *, EMPTYARG ) C2U( "com.sun.star.ui.dialogs.FolderPicker" ) ), UNO_QUERY ); } -// pFileDlg->SetHelpId(HID_FILEDLG_MAILMRGE1); xFP->setDisplayDirectory(sPath); if( xFP->execute() == RET_OK ) { @@ -858,17 +812,13 @@ IMPL_LINK( SwMailMergeDlg, InsertPathHdl, PushButton *, EMPTYARG ) return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK( SwMailMergeDlg, AttachFileHdl, PushButton *, EMPTYARG ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { AbstractSvxMultiFileDialog* pFileDlg = pFact->CreateSvxMultiFileDialog( this ); - DBG_ASSERT(pFileDlg, "Dialogdiet fail!"); + OSL_ENSURE(pFileDlg, "Dialogdiet fail!"); pFileDlg->SetFiles(aAttachED.GetText()); pFileDlg->SetHelpId(HID_FILEDLG_MAILMRGE2); @@ -879,9 +829,7 @@ IMPL_LINK( SwMailMergeDlg, AttachFileHdl, PushButton *, EMPTYARG ) } return 0; } -/* -----------------------------05.06.01 14:56-------------------------------- - ---------------------------------------------------------------------------*/ uno::Reference<XResultSet> SwMailMergeDlg::GetResultSet() const { uno::Reference< XResultSet > xResSetClone; @@ -894,9 +842,7 @@ uno::Reference<XResultSet> SwMailMergeDlg::GetResultSet() const } return xResSetClone; } -/*-- 27.11.2002 12:27:33--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeCreateFromDlg::SwMailMergeCreateFromDlg(Window* pParent) : ModalDialog(pParent, SW_RES(DLG_MERGE_CREATE)), aCreateFromFL( this, SW_RES( FL_CREATEFROM )), @@ -908,15 +854,11 @@ SwMailMergeCreateFromDlg::SwMailMergeCreateFromDlg(Window* pParent) : { FreeResource(); } -/*-- 27.11.2002 12:27:33--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeCreateFromDlg::~SwMailMergeCreateFromDlg() { } -/* -----------------04.02.2003 13:45----------------- - * - * --------------------------------------------------*/ + SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(Window* pParent) : ModalDialog(pParent, SW_RES(DLG_MERGE_FIELD_CONNECTIONS)), aConnectionsFL( this, SW_RES( FL_CONNECTIONS )), @@ -929,10 +871,9 @@ SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(Window* pParent) { FreeResource(); } -/* -----------------04.02.2003 13:45----------------- - * - * --------------------------------------------------*/ + SwMailMergeFieldConnectionsDlg::~SwMailMergeFieldConnectionsDlg() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/mailmrge.hrc b/sw/source/ui/envelp/mailmrge.hrc index f98c69c75b..c9a1c2d203 100644 --- a/sw/source/ui/envelp/mailmrge.hrc +++ b/sw/source/ui/envelp/mailmrge.hrc @@ -28,11 +28,9 @@ #ifndef _MAILMRGE_HRC #define _MAILMRGE_HRC -// #include ----------------------------------------------------------------- - #include "envelp.hrc" -// Elemente ----------------------------------------------------------------- +// elements ----------------------------------------------------------------- #define FL_RECORD 1 #define RB_ALL 2 diff --git a/sw/source/ui/envelp/mailmrge.src b/sw/source/ui/envelp/mailmrge.src index 48eedbf3ce..a97ac9a737 100644 --- a/sw/source/ui/envelp/mailmrge.src +++ b/sw/source/ui/envelp/mailmrge.src @@ -25,7 +25,6 @@ * ************************************************************************/ - // #include ***************************************************************** #include "mailmrge.hrc" #include "cmdid.h" #include "helpid.h" @@ -290,7 +289,6 @@ ModalDialog DLG_MAILMERGE Pos = MAP_APPFONT ( 220 , 156 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; Disable = TRUE ; - /* ### ACHTUNG: Neuer Text in Resource? HTM~L : HTML */ TabStop = TRUE ; Text [ en-US ] = "HTM~L" ; }; diff --git a/sw/source/ui/envelp/swuilabimp.hxx b/sw/source/ui/envelp/swuilabimp.hxx index 27df317d00..7aa74be107 100644 --- a/sw/source/ui/envelp/swuilabimp.hxx +++ b/sw/source/ui/envelp/swuilabimp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -96,9 +97,6 @@ public: inline SwNewDBMgr* GetNewDBMgr() const { return pNewDBMgr; } }; -/* -----------------08.07.99 13:48------------------- - - --------------------------------------------------*/ class SwOneExampleFrame; class SwVisitingCardPage : public SfxTabPage { @@ -146,9 +144,7 @@ public: virtual sal_Bool FillItemSet(SfxItemSet& rSet); virtual void Reset(const SfxItemSet& rSet); }; -/* -----------------29.09.99 08:51------------------- - --------------------------------------------------*/ class SwPrivateDataPage : public SfxTabPage { FixedLine aDataFL; @@ -198,9 +194,7 @@ public: virtual sal_Bool FillItemSet(SfxItemSet& rSet); virtual void Reset(const SfxItemSet& rSet); }; -/* -----------------29.09.99 08:51------------------- - --------------------------------------------------*/ class SwBusinessDataPage : public SfxTabPage { FixedLine aDataFL; @@ -251,3 +245,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/syncbtn.cxx b/sw/source/ui/envelp/syncbtn.cxx index 97cffa7b73..937df47b3a 100644 --- a/sw/source/ui/envelp/syncbtn.cxx +++ b/sw/source/ui/envelp/syncbtn.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,10 +47,6 @@ SFX_IMPL_FLOATINGWINDOW( SwSyncChildWin, FN_SYNC_LABELS ) -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwSyncChildWin::SwSyncChildWin( Window* _pParent, sal_uInt16 nId, SfxBindings* pBindings, @@ -77,10 +74,6 @@ SwSyncChildWin::SwSyncChildWin( Window* _pParent, pWindow->Show(); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwSyncBtnDlg::SwSyncBtnDlg( SfxBindings* _pBindings, SfxChildWindow* pChild, Window *pParent) : @@ -91,18 +84,10 @@ SwSyncBtnDlg::SwSyncBtnDlg( SfxBindings* _pBindings, aSyncBtn.SetClickHdl(LINK(this, SwSyncBtnDlg, BtnHdl)); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - -__EXPORT SwSyncBtnDlg::~SwSyncBtnDlg() +SwSyncBtnDlg::~SwSyncBtnDlg() { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwSyncBtnDlg, BtnHdl, PushButton *, EMPTYARG ) { SfxViewFrame::Current()->GetDispatcher()->Execute(FN_UPDATE_ALL_LINKS, SFX_CALLMODE_ASYNCHRON); @@ -110,3 +95,4 @@ IMPL_LINK( SwSyncBtnDlg, BtnHdl, PushButton *, EMPTYARG ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/DropDownFieldDialog.cxx b/sw/source/ui/fldui/DropDownFieldDialog.cxx index fda9c75fc8..7af3b57dc2 100644 --- a/sw/source/ui/fldui/DropDownFieldDialog.cxx +++ b/sw/source/ui/fldui/DropDownFieldDialog.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,7 +48,6 @@ using namespace ::com::sun::star; /*-------------------------------------------------------------------- Beschreibung: Feldeinfuegen bearbeiten --------------------------------------------------------------------*/ - sw::DropDownFieldDialog::DropDownFieldDialog( Window *pParent, SwWrtShell &rS, SwField* pField, sal_Bool bNextButton ) : @@ -104,10 +104,6 @@ sw::DropDownFieldDialog::~DropDownFieldDialog() { } -/*-------------------------------------------------------------------- - - --------------------------------------------------------------------*/ - void sw::DropDownFieldDialog::Apply() { if(pDropField) @@ -128,12 +124,11 @@ void sw::DropDownFieldDialog::Apply() } } } -/* -----------------17.06.2003 10:50----------------- - --------------------------------------------------*/ IMPL_LINK(sw::DropDownFieldDialog, ButtonHdl, PushButton*, pButton) { EndDialog(&aNextPB == pButton ? RET_OK : RET_YES ); return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/FldRefTreeListBox.cxx b/sw/source/ui/fldui/FldRefTreeListBox.cxx index 3d81ea70b3..ee96c1e6c1 100644 --- a/sw/source/ui/fldui/FldRefTreeListBox.cxx +++ b/sw/source/ui/fldui/FldRefTreeListBox.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,3 +80,5 @@ void SwFldRefTreeListBox::RequestHelp( const HelpEvent& rHEvt ) Window::RequestHelp( rHEvt ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/FldRefTreeListBox.hxx b/sw/source/ui/fldui/FldRefTreeListBox.hxx index 93867695be..94c6288034 100644 --- a/sw/source/ui/fldui/FldRefTreeListBox.hxx +++ b/sw/source/ui/fldui/FldRefTreeListBox.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,3 +43,4 @@ public: }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx index baf5d88e04..143e16a6a1 100644 --- a/sw/source/ui/fldui/changedb.cxx +++ b/sw/source/ui/fldui/changedb.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -37,22 +38,16 @@ #define _CHANGEDB_CXX #include <svtools/stdctrl.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/sdb/XDatabaseAccess.hpp> #include <comphelper/processfactory.hxx> #include <sfx2/viewfrm.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <fldmgr.hxx> #include <expfld.hxx> #include <txtatr.hxx> @@ -61,15 +56,9 @@ #include <dbfld.hxx> #include <changedb.hxx> -#ifndef _FLDUI_HRC #include <fldui.hrc> -#endif -#ifndef _UTLUI_HRC #include <utlui.hrc> -#endif -#ifndef _CHANGEDB_HRC #include <changedb.hrc> -#endif #include <unomid.h> @@ -81,8 +70,6 @@ using namespace ::com::sun::star::lang; /*-------------------------------------------------------------------- Beschreibung: Feldeinfuegen bearbeiten --------------------------------------------------------------------*/ - - SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) : SvxStandardDialog(&rVw.GetViewFrame()->GetWindow(), SW_RES(DLG_CHANGE_DB)), @@ -98,10 +85,7 @@ SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) : aOKBT (this, SW_RES(BT_OK )), aCancelBT (this, SW_RES(BT_CANCEL )), aHelpBT (this, SW_RES(BT_HELP )), -// aChangeBT (this, SW_RES(BT_CHANGEDB )), aImageList (SW_RES(ILIST_DB_DLG )), - aImageListHC (SW_RES(ILIST_DB_DLG_HC )), - pSh(rVw.GetWrtShellPtr()), pMgr( new SwFldMgr() ) { @@ -117,11 +101,7 @@ SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) : aUsedDBTLB.SetSelectionMode(MULTIPLE_SELECTION); aUsedDBTLB.SetStyle(aUsedDBTLB.GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); aUsedDBTLB.SetSpaceBetweenEntries(0); - - aUsedDBTLB.SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE), - aImageList.GetImage(IMG_EXPAND ), BMP_COLOR_NORMAL ); - aUsedDBTLB.SetNodeBitmaps( aImageListHC.GetImage(IMG_COLLAPSE), - aImageListHC.GetImage(IMG_EXPAND ), BMP_COLOR_HIGHCONTRAST ); + aUsedDBTLB.SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE), aImageList.GetImage(IMG_EXPAND)); Link aLink = LINK(this, SwChangeDBDlg, TreeSelectHdl); @@ -135,8 +115,6 @@ SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) : /*-------------------------------------------------------------------- Beschreibung: Datenbank-Listboxen initialisieren --------------------------------------------------------------------*/ - - void SwChangeDBDlg::FillDBPopup() { Reference<XNameAccess> xDBContext; @@ -146,7 +124,7 @@ void SwChangeDBDlg::FillDBPopup() Reference<XInterface> xInstance = xMgr->createInstance( C2U( "com.sun.star.sdb.DatabaseContext" )); xDBContext = Reference<XNameAccess>(xInstance, UNO_QUERY) ; } - DBG_ASSERT(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available"); + OSL_ENSURE(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available"); const SwDBData& rDBData = pSh->GetDBData(); String sDBName(rDBData.sDataSource); @@ -188,16 +166,11 @@ void SwChangeDBDlg::FillDBPopup() } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName) { String sDBName(rDBName.GetToken(0, DB_DELIM)); String sTableName(rDBName.GetToken(1, DB_DELIM)); - int nCommandType = rDBName.GetToken(2, DB_DELIM).ToInt32(); + sal_IntPtr nCommandType = rDBName.GetToken(2, DB_DELIM).ToInt32(); SvLBoxEntry* pParent; SvLBoxEntry* pChild; @@ -207,11 +180,7 @@ SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName) Image aTableImg = aImageList.GetImage(IMG_DBTABLE); Image aDBImg = aImageList.GetImage(IMG_DB); Image aQueryImg = aImageList.GetImage(IMG_DBQUERY); - Image aHCTableImg = aImageListHC.GetImage(IMG_DBTABLE); - Image aHCDBImg = aImageListHC.GetImage(IMG_DB); - Image aHCQueryImg = aImageListHC.GetImage(IMG_DBQUERY); Image& rToInsert = nCommandType ? aQueryImg : aTableImg; - Image& rHCToInsert = nCommandType ? aHCQueryImg : aHCTableImg; while ((pParent = aUsedDBTLB.GetEntry(nParent++)) != NULL) { if (sDBName == aUsedDBTLB.GetEntryText(pParent)) @@ -222,19 +191,13 @@ SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName) return pChild; } SvLBoxEntry* pRet = aUsedDBTLB.InsertEntry(sTableName, rToInsert, rToInsert, pParent); - aUsedDBTLB.SetExpandedEntryBmp(pRet, rHCToInsert, BMP_COLOR_HIGHCONTRAST); - aUsedDBTLB.SetCollapsedEntryBmp(pRet, rHCToInsert, BMP_COLOR_HIGHCONTRAST); pRet->SetUserData((void*)nCommandType); return pRet; } } pParent = aUsedDBTLB.InsertEntry(sDBName, aDBImg, aDBImg); - aUsedDBTLB.SetExpandedEntryBmp(pParent, aHCDBImg, BMP_COLOR_HIGHCONTRAST); - aUsedDBTLB.SetCollapsedEntryBmp(pParent, aHCDBImg, BMP_COLOR_HIGHCONTRAST); SvLBoxEntry* pRet = aUsedDBTLB.InsertEntry(sTableName, rToInsert, rToInsert, pParent); - aUsedDBTLB.SetExpandedEntryBmp(pRet, rHCToInsert, BMP_COLOR_HIGHCONTRAST); - aUsedDBTLB.SetCollapsedEntryBmp(pRet, rHCToInsert, BMP_COLOR_HIGHCONTRAST); pRet->SetUserData((void*)nCommandType); return pRet; } @@ -242,7 +205,7 @@ SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName) /*-------------------------------------------------------------------- Beschreibung: Dialog zerstoeren --------------------------------------------------------------------*/ -__EXPORT SwChangeDBDlg::~SwChangeDBDlg() +SwChangeDBDlg::~SwChangeDBDlg() { delete pMgr; } @@ -250,13 +213,11 @@ __EXPORT SwChangeDBDlg::~SwChangeDBDlg() /*-------------------------------------------------------------------- Beschreibung: Schliessen --------------------------------------------------------------------*/ -void __EXPORT SwChangeDBDlg::Apply() +void SwChangeDBDlg::Apply() { UpdateFlds(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ + void SwChangeDBDlg::UpdateFlds() { SvStringsDtor aDBNames( (sal_uInt8)aUsedDBTLB.GetSelectionCount(), 1 ); @@ -290,11 +251,6 @@ void SwChangeDBDlg::UpdateFlds() pSh->EndAllAction(); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - IMPL_LINK( SwChangeDBDlg, ButtonHdl, Button *, EMPTYARG ) { String sTableName, sColumnName; @@ -310,11 +266,6 @@ IMPL_LINK( SwChangeDBDlg, ButtonHdl, Button *, EMPTYARG ) return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - IMPL_LINK( SwChangeDBDlg, TreeSelectHdl, SvTreeListBox *, EMPTYARG ) { sal_Bool bEnable = sal_False; @@ -333,7 +284,6 @@ IMPL_LINK( SwChangeDBDlg, TreeSelectHdl, SvTreeListBox *, EMPTYARG ) /*-------------------------------------------------------------------- Beschreibung: Datenbankname fuer Anzeige wandeln --------------------------------------------------------------------*/ - void SwChangeDBDlg::ShowDBName(const SwDBData& rDBData) { String sTmp(rDBData.sDataSource); @@ -350,9 +300,7 @@ void SwChangeDBDlg::ShowDBName(const SwDBData& rDBData) aDocDBNameFT.SetText(sName); } -/*-- 27.05.2004 09:14:01--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwChangeDBDlg, AddDBHdl, PushButton *, EMPTYARG ) { String sNewDB = SwNewDBMgr::LoadAndRegisterDataSource(); @@ -361,3 +309,4 @@ IMPL_LINK( SwChangeDBDlg, AddDBHdl, PushButton *, EMPTYARG ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/changedb.hrc b/sw/source/ui/fldui/changedb.hrc index 7ab2765eab..e121a97fcb 100644 --- a/sw/source/ui/fldui/changedb.hrc +++ b/sw/source/ui/fldui/changedb.hrc @@ -28,8 +28,6 @@ #ifndef _CHANGEDB_HRC #define _CHANGEDB_HRC -// #include ----------------------------------------------------------------- - // Elemente ----------------------------------------------------------------- #define FT_DESC 1 diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index f9e99f5516..f88e2999a6 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,38 +34,21 @@ #include <swmodule.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <dbfld.hxx> -#ifndef _FLDTDLG_HXX #include <fldtdlg.hxx> -#endif #include <numrule.hxx> -#ifndef _FLDTDLG_HRC #include <fldtdlg.hrc> -#endif -#ifndef _FLDUI_HRC #include <fldui.hrc> -#endif -#ifndef _FLDDB_HXX #include <flddb.hxx> -#endif #include <dbconfig.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #define USER_DATA_VERSION_1 "1" #define USER_DATA_VERSION USER_DATA_VERSION_1 -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ SwFldDBPage::SwFldDBPage(Window* pParent, const SfxItemSet& rCoreSet ) : SwFldPage( pParent, SW_RES( TP_FLD_DB ), rCoreSet ), @@ -97,19 +81,14 @@ SwFldDBPage::SwFldDBPage(Window* pParent, const SfxItemSet& rCoreSet ) : aAddDBPB.SetClickHdl(LINK(this, SwFldDBPage, AddDBHdl)); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -__EXPORT SwFldDBPage::~SwFldDBPage() +SwFldDBPage::~SwFldDBPage() { } /*-------------------------------------------------------------------- Beschreibung: TabPage initialisieren --------------------------------------------------------------------*/ - -void __EXPORT SwFldDBPage::Reset(const SfxItemSet&) +void SwFldDBPage::Reset(const SfxItemSet&) { Init(); // Allgemeine initialisierung @@ -212,11 +191,7 @@ void __EXPORT SwFldDBPage::Reset(const SfxItemSet&) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -sal_Bool __EXPORT SwFldDBPage::FillItemSet(SfxItemSet& ) +sal_Bool SwFldDBPage::FillItemSet(SfxItemSet& ) { String sTableName, sColumnName; SwDBData aData; @@ -285,29 +260,17 @@ sal_Bool __EXPORT SwFldDBPage::FillItemSet(SfxItemSet& ) return sal_False; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -SfxTabPage* __EXPORT SwFldDBPage::Create( Window* pParent, +SfxTabPage* SwFldDBPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return ( new SwFldDBPage( pParent, rAttrSet ) ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwFldDBPage::GetGroup() { return GRP_DB; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldDBPage, TypeHdl, ListBox *, pBox ) { // Alte ListBoxPos sichern @@ -433,10 +396,6 @@ IMPL_LINK( SwFldDBPage, TypeHdl, ListBox *, pBox ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldDBPage, NumSelectHdl, NumFormatListBox *, pLB ) { aNewFormatRB.Check(); @@ -445,10 +404,6 @@ IMPL_LINK( SwFldDBPage, NumSelectHdl, NumFormatListBox *, pLB ) return 0; } -/*--------------------------------------------------------------------- - Beschreibung: ----------------------------------------------------------------------*/ - void SwFldDBPage::CheckInsert() { sal_Bool bInsert = sal_True; @@ -478,10 +433,6 @@ void SwFldDBPage::CheckInsert() EnableInsert(bInsert); } -/*--------------------------------------------------------------------- - Beschreibung: ----------------------------------------------------------------------*/ - IMPL_LINK( SwFldDBPage, TreeSelectHdl, SvTreeListBox *, pBox ) { SvLBoxEntry* pColEntry; @@ -523,9 +474,7 @@ IMPL_LINK( SwFldDBPage, TreeSelectHdl, SvTreeListBox *, pBox ) } return 0; } -/*-- 27.05.2004 09:14:01--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK( SwFldDBPage, AddDBHdl, PushButton *, EMPTYARG ) { String sNewDB = SwNewDBMgr::LoadAndRegisterDataSource(); @@ -539,16 +488,12 @@ IMPL_LINK( SwFldDBPage, AddDBHdl, PushButton *, EMPTYARG ) /*-------------------------------------------------------------------- Beschreibung: Modify --------------------------------------------------------------------*/ - IMPL_LINK( SwFldDBPage, ModifyHdl, Edit *, EMPTYARG ) { CheckInsert(); return 0; } -/* -----------------12.01.99 11:21------------------- - * - * --------------------------------------------------*/ void SwFldDBPage::FillUserData() { String sData( String::CreateFromAscii( @@ -563,9 +508,7 @@ void SwFldDBPage::FillUserData() sData += String::CreateFromInt32( nTypeSel ); SetUserData(sData); } -/* -----------------12.12.2002 11:33----------------- - * - * --------------------------------------------------*/ + void SwFldDBPage::ActivateMailMergeAddress() { sal_uLong nData = TYP_DBFLD; @@ -574,10 +517,10 @@ void SwFldDBPage::ActivateMailMergeAddress() const SwDBData& rData = SW_MOD()->GetDBConfig()->GetAddressSource(); aDatabaseTLB.Select(rData.sDataSource, rData.sCommand, aEmptyStr); } -/*-- 07.10.2003 13:59:04--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwFldDBPage::SetWrtShell(SwWrtShell& rSh) { aDatabaseTLB.SetWrtShell(rSh); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx index a2a91692fd..89716b0e93 100644 --- a/sw/source/ui/fldui/flddb.hxx +++ b/sw/source/ui/fldui/flddb.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #include <vcl/fixed.hxx> #include <vcl/lstbox.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <vcl/group.hxx> #include "condedit.hxx" @@ -40,10 +39,6 @@ #include "fldpage.hxx" -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - class SwFldDBPage : public SwFldPage { FixedText aTypeFT; @@ -104,3 +99,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index b4924cffaa..722bf9cf39 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,16 +48,10 @@ #include <fldui.hrc> -#ifndef _FLDTDLG_HRC #include <fldtdlg.hrc> -#endif -#ifndef _FLDDINF_HXX #include <flddinf.hxx> -#endif #include <swmodule.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/util/Time.hpp> #include <com/sun/star/util/DateTime.hpp> @@ -67,9 +62,6 @@ using namespace nsSwDocInfoSubType; using namespace com::sun::star; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ SwFldDokInfPage::SwFldDokInfPage(Window* pWindow, const SfxItemSet& rCoreSet ) : SwFldPage( pWindow, SW_RES( TP_FLD_DOKINF ), rCoreSet ), @@ -103,19 +95,11 @@ SwFldDokInfPage::SwFldDokInfPage(Window* pWindow, const SfxItemSet& rCoreSet ) : pItem->GetValue() >>= xCustomPropertySet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -__EXPORT SwFldDokInfPage::~SwFldDokInfPage() +SwFldDokInfPage::~SwFldDokInfPage() { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -void __EXPORT SwFldDokInfPage::Reset(const SfxItemSet& ) +void SwFldDokInfPage::Reset(const SfxItemSet& ) { Init(); // Allgemeine initialisierung @@ -169,11 +153,7 @@ void __EXPORT SwFldDokInfPage::Reset(const SfxItemSet& ) { uno::Reference< beans::XPropertySetInfo > xSetInfo = xCustomPropertySet->getPropertySetInfo(); const uno::Sequence< beans::Property > rProperties = xSetInfo->getProperties(); -// uno::Sequence< ::rtl::OUString > aPropertyNames(rProperties.getLength()); -// for (sal_Int32 i = 0; i < rProperties.getLength(); ++i) { -// aPropertyNames[i] = rProperties[i].Name; -// } - //if ( !IsFldEdit() ) + if( rProperties.getLength() ) { pInfo = aTypeTLB.InsertEntry( String(SW_RES( STR_CUSTOM )) ); @@ -237,10 +217,6 @@ void __EXPORT SwFldDokInfPage::Reset(const SfxItemSet& ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldDokInfPage, TypeHdl, ListBox *, EMPTYARG ) { // Alte ListBoxPos sichern @@ -264,9 +240,6 @@ IMPL_LINK( SwFldDokInfPage, TypeHdl, ListBox *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG ) { sal_uInt16 nSubType = (sal_uInt16)(sal_uLong)pSelEntry->GetUserData(); @@ -402,10 +375,6 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType) { // Format-Listbox fuellen @@ -460,11 +429,7 @@ sal_uInt16 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType) return nSize; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -sal_Bool __EXPORT SwFldDokInfPage::FillItemSet(SfxItemSet& ) +sal_Bool SwFldDokInfPage::FillItemSet(SfxItemSet& ) { if (!pSelEntry || (sal_uInt16)(sal_uLong)pSelEntry->GetUserData() == USHRT_MAX) return sal_False; @@ -501,27 +466,17 @@ sal_Bool __EXPORT SwFldDokInfPage::FillItemSet(SfxItemSet& ) return sal_False; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -SfxTabPage* __EXPORT SwFldDokInfPage::Create( Window* pParent, +SfxTabPage* SwFldDokInfPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return ( new SwFldDokInfPage( pParent, rAttrSet ) ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwFldDokInfPage::GetGroup() { return GRP_REG; } -/* -----------------12.01.99 11:21------------------- - * - * --------------------------------------------------*/ + void SwFldDokInfPage::FillUserData() { String sData( String::CreateFromAscii( @@ -535,3 +490,4 @@ void SwFldDokInfPage::FillUserData() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/flddinf.hxx b/sw/source/ui/fldui/flddinf.hxx index f0dd59fe66..79687adeaa 100644 --- a/sw/source/ui/fldui/flddinf.hxx +++ b/sw/source/ui/fldui/flddinf.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,9 +41,6 @@ namespace com{namespace sun{ namespace star{ namespace beans{ class XPropertySet; }}}} -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ class SwFldDokInfPage : public SwFldPage { @@ -87,3 +85,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index 1973bab36b..4b1261ad45 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,23 +36,13 @@ #include <vcl/svapp.hxx> #include <flddat.hxx> #include <docufld.hxx> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <chpfld.hxx> -#ifndef _FLDTDLG_HRC #include <fldtdlg.hrc> -#endif -#ifndef _FLDUI_HRC #include <fldui.hrc> -#endif -#ifndef _FLDDOK_HXX #include <flddok.hxx> -#endif #include <swmodule.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> #include <svl/zformat.hxx> @@ -60,10 +51,6 @@ #define USER_DATA_VERSION_1 "1" #define USER_DATA_VERSION USER_DATA_VERSION_1 -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwFldDokPage::SwFldDokPage(Window* pWindow, const SfxItemSet& rCoreSet ) : SwFldPage( pWindow, SW_RES( TP_FLD_DOK ), rCoreSet ), @@ -99,19 +86,11 @@ SwFldDokPage::SwFldDokPage(Window* pWindow, const SfxItemSet& rCoreSet ) : aNumFormatLB.SetShowLanguageControl(sal_True); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -__EXPORT SwFldDokPage::~SwFldDokPage() +SwFldDokPage::~SwFldDokPage() { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -void __EXPORT SwFldDokPage::Reset(const SfxItemSet& ) +void SwFldDokPage::Reset(const SfxItemSet& ) { SavePos(&aTypeLB); Init(); // Allgemeine initialisierung @@ -213,10 +192,6 @@ void __EXPORT SwFldDokPage::Reset(const SfxItemSet& ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldDokPage, TypeHdl, ListBox *, EMPTYARG ) { // Alte ListBoxPos sichern @@ -471,20 +446,12 @@ IMPL_LINK( SwFldDokPage, TypeHdl, ListBox *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwFldDokPage::AddSubType(sal_uInt16 nTypeId) { sal_uInt16 nPos = aSelectionLB.InsertEntry(SwFieldType::GetTypeStr(nTypeId)); aSelectionLB.SetEntryData(nPos, reinterpret_cast<void*>(nTypeId)); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldDokPage, SubTypeHdl, ListBox *, EMPTYARG ) { sal_uInt16 nPos = aSelectionLB.GetSelectEntryPos(); @@ -519,10 +486,6 @@ IMPL_LINK( SwFldDokPage, SubTypeHdl, ListBox *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwFldDokPage::FillFormatLB(sal_uInt16 nTypeId) { // Format-Listbox fuellen @@ -558,10 +521,6 @@ sal_uInt16 SwFldDokPage::FillFormatLB(sal_uInt16 nTypeId) return nSize; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldDokPage, FormatHdl, ListBox *, EMPTYARG ) { sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); @@ -594,13 +553,8 @@ IMPL_LINK( SwFldDokPage, FormatHdl, ListBox *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -sal_Bool __EXPORT SwFldDokPage::FillItemSet(SfxItemSet& ) +sal_Bool SwFldDokPage::FillItemSet(SfxItemSet& ) { - sal_Bool bPage = sal_False; sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); if (nTypeId == USHRT_MAX) @@ -609,7 +563,6 @@ sal_Bool __EXPORT SwFldDokPage::FillItemSet(SfxItemSet& ) if(nPos == LISTBOX_ENTRY_NOTFOUND) nPos = 0; nTypeId = (sal_uInt16)(sal_uLong)aSelectionLB.GetEntryData(nPos); - bPage = sal_True; } String aVal(aValueED.GetText()); @@ -692,28 +645,17 @@ sal_Bool __EXPORT SwFldDokPage::FillItemSet(SfxItemSet& ) return sal_False; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -SfxTabPage* __EXPORT SwFldDokPage::Create( Window* pParent, +SfxTabPage* SwFldDokPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return ( new SwFldDokPage( pParent, rAttrSet ) ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwFldDokPage::GetGroup() { return GRP_DOC; } -/* -----------------12.01.99 10:09------------------- - * - * --------------------------------------------------*/ void SwFldDokPage::FillUserData() { String sData( String::CreateFromAscii( @@ -728,4 +670,4 @@ void SwFldDokPage::FillUserData() SetUserData(sData); } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/flddok.hxx b/sw/source/ui/fldui/flddok.hxx index 89611dd937..51c24c49bd 100644 --- a/sw/source/ui/fldui/flddok.hxx +++ b/sw/source/ui/fldui/flddok.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <sfx2/tabdlg.hxx> #include <vcl/fixed.hxx> #include <vcl/lstbox.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <vcl/group.hxx> #include <vcl/edit.hxx> #include <vcl/field.hxx> @@ -40,10 +39,6 @@ #include "numfmtlb.hxx" #include "fldpage.hxx" -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - class SwFldDokPage : public SwFldPage { FixedText aTypeFT; @@ -93,3 +88,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index 782261c7e1..a348226d54 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,61 +38,34 @@ #include <sfx2/app.hxx> #include <svx/optgenrl.hxx> #include <docufld.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <dbfld.hxx> #include <wrtsh.hxx> -#ifndef _FLDDB_HXX #include <flddb.hxx> -#endif -#ifndef _FLDDINF_HXX #include <flddinf.hxx> -#endif -#ifndef _FLDVAR_HXX #include <fldvar.hxx> -#endif -#ifndef _FLDDOK_HXX #include <flddok.hxx> -#endif -#ifndef _FLDFUNC_HXX #include <fldfunc.hxx> -#endif -#ifndef _FLDREF_HXX #include <fldref.hxx> -#endif #include <fldedt.hxx> #include <crsskip.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _FLDUI_HRC #include <fldui.hrc> -#endif #include "swabstdlg.hxx" #include "dialog.hrc" #include <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> - namespace swui { SwAbstractDialogFactory * GetFactory(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwFldEditDlg::SwFldEditDlg(SwView& rVw) : SfxSingleTabDialog(&rVw.GetViewFrame()->GetWindow(), 0, 0), pSh (rVw.GetWrtShellPtr()), @@ -149,7 +123,6 @@ SwFldEditDlg::SwFldEditDlg(SwView& rVw) : /*-------------------------------------------------------------------- Beschreibung: Controlls initialisieren --------------------------------------------------------------------*/ - void SwFldEditDlg::Init() { SwFldPage* pTabPage = (SwFldPage*)GetTabPage(); @@ -187,10 +160,6 @@ void SwFldEditDlg::Init() !pSh->HasReadonlySel() ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SfxTabPage* SwFldEditDlg::CreatePage(sal_uInt16 nGroup) { // TabPage erzeugen @@ -223,14 +192,6 @@ SfxTabPage* SwFldEditDlg::CreatePage(sal_uInt16 nGroup) uno::Reference< beans::XPropertySet > xUDProps( xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW); -// uno::Reference< beans::XPropertySetInfo > xSetInfo -// = xUDProps->getPropertySetInfo(); -// const uno::Sequence< beans::Property > props -// = xSetInfo->getProperties(); -// uno::Sequence< ::rtl::OUString > names(props.getLength()); -// for (sal_Int32 i = 0; i < props.getLength(); ++i) { -// names[i] = props[i].Name; -// } pSet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(xUDProps) ) ); pTabPage = SwFldDokInfPage::Create(this, *pSet); pHelpId = HID_EDIT_FLD_DOKINF; @@ -261,20 +222,12 @@ SfxTabPage* SwFldEditDlg::CreatePage(sal_uInt16 nGroup) return pTabPage; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwFldEditDlg::~SwFldEditDlg() { pSh->SetCareWin(NULL); pSh->EnterStdMode(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwFldEditDlg::EnableInsert(sal_Bool bEnable) { if( bEnable && pSh->IsReadOnlyAvailable() && pSh->HasReadonlySel() ) @@ -282,10 +235,6 @@ void SwFldEditDlg::EnableInsert(sal_Bool bEnable) GetOKButton()->Enable( bEnable ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwFldEditDlg::InsertHdl() { GetOKButton()->Click(); @@ -294,7 +243,6 @@ void SwFldEditDlg::InsertHdl() /*-------------------------------------------------------------------- Beschreibung: Aendern des Feldes anstossen --------------------------------------------------------------------*/ - IMPL_LINK( SwFldEditDlg, OKHdl, Button *, EMPTYARG ) { if (GetOKButton()->IsEnabled()) @@ -311,10 +259,6 @@ IMPL_LINK( SwFldEditDlg, OKHdl, Button *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - short SwFldEditDlg::Execute() { // Ohne TabPage kein Dialog @@ -324,7 +268,6 @@ short SwFldEditDlg::Execute() /*-------------------------------------------------------------------- Beschreibung: Traveling zwishen Feldern gleichen Typs --------------------------------------------------------------------*/ - IMPL_LINK( SwFldEditDlg, NextPrevHdl, Button *, pButton ) { sal_Bool bNext = pButton == &aNextBT; @@ -366,10 +309,6 @@ IMPL_LINK( SwFldEditDlg, NextPrevHdl, Button *, pButton ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldEditDlg, AddressHdl, PushButton *, EMPTYARG ) { SwFldPage* pTabPage = (SwFldPage*)GetTabPage(); @@ -405,12 +344,12 @@ IMPL_LINK( SwFldEditDlg, AddressHdl, PushButton *, EMPTYARG ) } aSet.Put(SfxUInt16Item(SID_FIELD_GRABFOCUS, nEditPos)); SwAbstractDialogFactory* pFact = swui::GetFactory(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( this, aSet, pSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RC_DLG_ADDR ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(RET_OK == pDlg->Execute()) { pSh->UpdateFlds( *pCurFld ); @@ -419,4 +358,4 @@ IMPL_LINK( SwFldEditDlg, AddressHdl, PushButton *, EMPTYARG ) return 0; } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index 04a6f56b3c..6b830c3317 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,26 +38,16 @@ #include <basic/sbmod.hxx> #include <docsh.hxx> #include <swtypes.hxx> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <fldbas.hxx> #include <docufld.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> #include <swmodule.hxx> -#ifndef _FLDFUNC_HXX #include <fldfunc.hxx> -#endif #include <flddropdown.hxx> -#ifndef _FLDUI_HRC #include <fldui.hrc> -#endif -#ifndef _FLDTDLG_HRC #include <fldtdlg.hrc> -#endif #define USER_DATA_VERSION_1 "1" #define USER_DATA_VERSION USER_DATA_VERSION_1 @@ -65,10 +56,6 @@ using namespace ::com::sun::star; using rtl::OUString; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwFldFuncPage::SwFldFuncPage(Window* pParent, const SfxItemSet& rCoreSet ) : SwFldPage( pParent, SW_RES( TP_FLD_FUNC ), rCoreSet ), @@ -111,21 +98,12 @@ SwFldFuncPage::SwFldFuncPage(Window* pParent, const SfxItemSet& rCoreSet ) : aCond1ED.ShowBrackets(sal_False); aCond2ED.ShowBrackets(sal_False); -// SwWrtShell* pSh = (SwWrtShell*)ViewShell::GetCurrShell(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwFldFuncPage::~SwFldFuncPage() { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwFldFuncPage::Reset(const SfxItemSet& ) { SavePos(&aTypeLB); @@ -213,10 +191,6 @@ void SwFldFuncPage::Reset(const SfxItemSet& ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG ) { // Alte ListBoxPos sichern @@ -386,7 +360,6 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG ) case TYP_INPUTFLD: aValueFT.SetText(SW_RESSTR(STR_PROMPT)); bValue = sal_True; - // bShowSelection = TRUE; aNameED.SetAccessibleName(aNameFT.GetText()); aValueED.SetAccessibleName(aValueFT.GetText()); break; @@ -439,10 +412,6 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldFuncPage, SelectHdl, ListBox *, EMPTYARG ) { sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); @@ -453,10 +422,6 @@ IMPL_LINK( SwFldFuncPage, SelectHdl, ListBox *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldFuncPage, InsertMacroHdl, ListBox *, EMPTYARG ) { SelectHdl(); @@ -464,9 +429,7 @@ IMPL_LINK( SwFldFuncPage, InsertMacroHdl, ListBox *, EMPTYARG ) return 0; } -/* -----------------16.06.2003 16:24----------------- - --------------------------------------------------*/ IMPL_LINK( SwFldFuncPage, ListModifyHdl, Control*, pControl) { aListItemsLB.SetUpdateMode(sal_False); @@ -513,9 +476,7 @@ IMPL_LINK( SwFldFuncPage, ListModifyHdl, Control*, pControl) ListEnableHdl(0); return 0; } -/* -----------------17.06.2003 08:36----------------- - --------------------------------------------------*/ IMPL_LINK( SwFldFuncPage, ListEnableHdl, void*, EMPTYARG) { //enable "Add" button when text is in the Edit that's not already member of the box @@ -533,8 +494,6 @@ IMPL_LINK( SwFldFuncPage, ListEnableHdl, void*, EMPTYARG) /*-------------------------------------------------------------------- Beschreibung: Typen in der SelectionBox erneuern --------------------------------------------------------------------*/ - - void SwFldFuncPage::UpdateSubType() { sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); @@ -582,7 +541,6 @@ void SwFldFuncPage::UpdateSubType() /*-------------------------------------------------------------------- Beschreibung: MacroBrowser aufrufen, Listbox mit Macros fuellen --------------------------------------------------------------------*/ - IMPL_LINK( SwFldFuncPage, MacroHdl, Button *, pBtn ) { Window* pDefModalDlgParent = Application::GetDefDialogParent(); @@ -599,10 +557,6 @@ IMPL_LINK( SwFldFuncPage, MacroHdl, Button *, pBtn ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool SwFldFuncPage::FillItemSet(SfxItemSet& ) { sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); @@ -671,10 +625,6 @@ sal_Bool SwFldFuncPage::FillItemSet(SfxItemSet& ) return sal_False; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - String SwFldFuncPage::TurnMacroString(const String &rMacro) { if (rMacro.Len()) @@ -700,28 +650,17 @@ String SwFldFuncPage::TurnMacroString(const String &rMacro) return rMacro; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SfxTabPage* SwFldFuncPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return ( new SwFldFuncPage( pParent, rAttrSet ) ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwFldFuncPage::GetGroup() { return GRP_FKT; } -/* -----------------12.01.99 10:09------------------- - * - * --------------------------------------------------*/ void SwFldFuncPage::FillUserData() { String sData( String::CreateFromAscii( @@ -753,6 +692,4 @@ IMPL_LINK( SwFldFuncPage, ModifyHdl, Edit *, EMPTYARG ) return 0; } - - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldfunc.hxx b/sw/source/ui/fldui/fldfunc.hxx index dd70a0d3a8..1f21f55f9f 100644 --- a/sw/source/ui/fldui/fldfunc.hxx +++ b/sw/source/ui/fldui/fldfunc.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,18 +31,13 @@ #include <sfx2/tabdlg.hxx> #include <vcl/fixed.hxx> #include <vcl/lstbox.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <vcl/group.hxx> #include <vcl/edit.hxx> #include "condedit.hxx" #include "fldpage.hxx" #include <actctrl.hxx> -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ class SwFldFuncPage : public SwFldPage { @@ -111,3 +107,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index 72bfc42ac5..c4bd74b334 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -143,7 +144,7 @@ enum /*-------------------------------------------------------------------- Beschreibung: Formate in der richtigen Reihenfolge --------------------------------------------------------------------*/ -static const sal_uInt16 __FAR_DATA aSetFmt[] = +static const sal_uInt16 aSetFmt[] = { // die Reihenfolge muss zu Beginn mit den ResourceIds fuer FMT_SETVAR_??? // uebereinstimmen @@ -151,14 +152,14 @@ static const sal_uInt16 __FAR_DATA aSetFmt[] = 0 }; -static const sal_uInt16 __FAR_DATA aGetFmt[] = +static const sal_uInt16 aGetFmt[] = { // die Reihenfolge muss zu Beginn mit den ResourceIds fuer FMT_GETVAR_??? // uebereinstimmen 0 }; -static const sal_uInt16 __FAR_DATA aUsrFmt[] = +static const sal_uInt16 aUsrFmt[] = { // die Reihenfolge muss zu Beginn mit den ResourceIds fuer FMT_SETVAR_??? // uebereinstimmen @@ -166,7 +167,7 @@ static const sal_uInt16 __FAR_DATA aUsrFmt[] = nsSwExtendedSubType::SUB_CMD }; -static const sal_uInt16 __FAR_DATA aDBFmt[] = +static const sal_uInt16 aDBFmt[] = { // die Reihenfolge muss zu Beginn mit den ResourceIds fuer FMT_DBFLD_??? // uebereinstimmen @@ -194,9 +195,9 @@ struct SwFldPack /*-------------------------------------------------------------------- Beschreibung: Strings und Formate --------------------------------------------------------------------*/ -static const SwFldPack __FAR_DATA aSwFlds[] = +static const SwFldPack aSwFlds[] = { - // Dokument + // Document { TYP_EXTUSERFLD, FLD_EU_BEGIN, FLD_EU_END, 0, 0 }, { TYP_AUTHORFLD, 0, 0, FMT_AUTHOR_BEGIN, FMT_AUTHOR_END }, { TYP_DATEFLD, FLD_DATE_BEGIN, FLD_DATE_END, 0, 0 }, @@ -210,7 +211,7 @@ static const SwFldPack __FAR_DATA aSwFlds[] = { TYP_CHAPTERFLD, 0, 0, FMT_CHAPTER_BEGIN, FMT_CHAPTER_END }, { TYP_TEMPLNAMEFLD, 0, 0, FMT_FF_BEGIN, FMT_FF_END }, - // Funktion + // Functions { TYP_CONDTXTFLD, 0, 0, 0, 0 }, { TYP_DROPDOWN, 0, 0, 0, 0 }, { TYP_INPUTFLD, FLD_INPUT_BEGIN, FLD_INPUT_END, 0, 0 }, @@ -220,21 +221,21 @@ static const SwFldPack __FAR_DATA aSwFlds[] = { TYP_HIDDENTXTFLD, 0, 0, 0, 0 }, { TYP_HIDDENPARAFLD, 0, 0, 0, 0 }, - // Referenzen + // Cross-References { TYP_SETREFFLD, 0, 0, 0, 0 }, { TYP_GETREFFLD, 0, 0, FMT_REF_BEGIN, FMT_REF_END }, - // Ablage + // DocInformation { TYP_DOCINFOFLD, 0, 0, FMT_REG_BEGIN, FMT_REG_END }, - // Datenbank + // Database { TYP_DBFLD, 0, 0, FMT_DBFLD_BEGIN, FMT_DBFLD_END }, { TYP_DBNEXTSETFLD, 0, 0, 0, 0 }, { TYP_DBNUMSETFLD, 0, 0, 0, 0 }, { TYP_DBSETNUMBERFLD, 0, 0, FMT_NUM_BEGIN, FMT_NUM_END-2 }, { TYP_DBNAMEFLD, 0, 0, 0, 0 }, - // Variablen + // Variables { TYP_SETFLD, 0, 0, FMT_SETVAR_BEGIN, FMT_SETVAR_END }, { TYP_GETFLD, 0, 0, FMT_GETVAR_BEGIN, FMT_GETVAR_END }, @@ -256,7 +257,7 @@ static SwWrtShell* lcl_GetShell() SwView* pView; if ( 0 != (pView = ::GetActiveView()) ) return pView->GetWrtShellPtr(); - DBG_ERROR("no current shell found!"); + OSL_ENSURE(false, "no current shell found!"); return 0; } @@ -290,7 +291,7 @@ sal_Bool SwFldMgr::CanInsertRefMark( const String& rStr ) { sal_Bool bRet = sal_False; SwWrtShell *pSh = pWrtShell ? pWrtShell : lcl_GetShell(); - DBG_ASSERT(pSh, "no SwWrtShell found"); + OSL_ENSURE(pSh, "no SwWrtShell found"); if(pSh) { sal_uInt16 nCnt = pSh->GetCrsrCnt(); @@ -311,7 +312,7 @@ sal_Bool SwFldMgr::CanInsertRefMark( const String& rStr ) void SwFldMgr::RemoveFldType(sal_uInt16 nResId, const String& rName ) { SwWrtShell * pSh = pWrtShell ? pWrtShell : lcl_GetShell(); - DBG_ASSERT(pSh, "no SwWrtShell found"); + OSL_ENSURE(pSh, "no SwWrtShell found"); if( pSh ) pSh->RemoveFldType(nResId, rName); } @@ -319,7 +320,7 @@ void SwFldMgr::RemoveFldType(sal_uInt16 nResId, const String& rName ) sal_uInt16 SwFldMgr::GetFldTypeCount(sal_uInt16 nResId) const { SwWrtShell * pSh = pWrtShell ? pWrtShell : lcl_GetShell(); - DBG_ASSERT(pSh, "no SwWrtShell found"); + OSL_ENSURE(pSh, "no SwWrtShell found"); return pSh ? pSh->GetFldTypeCount(nResId) : 0; } @@ -327,7 +328,7 @@ sal_uInt16 SwFldMgr::GetFldTypeCount(sal_uInt16 nResId) const SwFieldType* SwFldMgr::GetFldType(sal_uInt16 nResId, sal_uInt16 nId) const { SwWrtShell * pSh = pWrtShell ? pWrtShell : lcl_GetShell(); - DBG_ASSERT(pSh, "no SwWrtShell found"); + OSL_ENSURE(pSh, "no SwWrtShell found"); return pSh ? pSh->GetFldType(nId, nResId) : 0; } @@ -335,7 +336,7 @@ SwFieldType* SwFldMgr::GetFldType(sal_uInt16 nResId, sal_uInt16 nId) const SwFieldType* SwFldMgr::GetFldType(sal_uInt16 nResId, const String& rName) const { SwWrtShell * pSh = pWrtShell ? pWrtShell : lcl_GetShell(); - DBG_ASSERT(pSh, "no SwWrtShell found"); + OSL_ENSURE(pSh, "no SwWrtShell found"); return pSh ? pSh->GetFldType(nResId, rName) : 0; } @@ -390,23 +391,23 @@ SwField* SwFldMgr::GetCurFld() const SwFldGroupRgn& SwFldMgr::GetGroupRange(sal_Bool bHtmlMode, sal_uInt16 nGrpId) const { -static SwFldGroupRgn __READONLY_DATA aRanges[] = +static SwFldGroupRgn const aRanges[] = { - { /* Dokument */ GRP_DOC_BEGIN, GRP_DOC_END }, - { /* Funktionen */ GRP_FKT_BEGIN, GRP_FKT_END }, - { /* Referenzen */ GRP_REF_BEGIN, GRP_REF_END }, - { /* Ablage */ GRP_REG_BEGIN, GRP_REG_END }, - { /* DB */ GRP_DB_BEGIN, GRP_DB_END }, - { /* User */ GRP_VAR_BEGIN, GRP_VAR_END } + { /* Document */ GRP_DOC_BEGIN, GRP_DOC_END }, + { /* Functions */ GRP_FKT_BEGIN, GRP_FKT_END }, + { /* Cross-Refs */ GRP_REF_BEGIN, GRP_REF_END }, + { /* DocInfos */ GRP_REG_BEGIN, GRP_REG_END }, + { /* Database */ GRP_DB_BEGIN, GRP_DB_END }, + { /* User */ GRP_VAR_BEGIN, GRP_VAR_END } }; -static SwFldGroupRgn __READONLY_DATA aWebRanges[] = +static SwFldGroupRgn const aWebRanges[] = { - { /* Dokument */ GRP_WEB_DOC_BEGIN, GRP_WEB_DOC_END }, - { /* Funktionen */ GRP_WEB_FKT_BEGIN, GRP_WEB_FKT_END }, - { /* Referenzen */ GRP_WEB_REF_BEGIN, GRP_WEB_REF_END }, - { /* Ablage */ GRP_WEB_REG_BEGIN, GRP_WEB_REG_END }, - { /* DB */ GRP_WEB_DB_BEGIN, GRP_WEB_DB_END }, - { /* User */ GRP_WEB_VAR_BEGIN, GRP_WEB_VAR_END } + { /* Document */ GRP_WEB_DOC_BEGIN, GRP_WEB_DOC_END }, + { /* Functions */ GRP_WEB_FKT_BEGIN, GRP_WEB_FKT_END }, + { /* Cross-Refs */ GRP_WEB_REF_BEGIN, GRP_WEB_REF_END }, + { /* DocInfos */ GRP_WEB_REG_BEGIN, GRP_WEB_REG_END }, + { /* Database */ GRP_WEB_DB_BEGIN, GRP_WEB_DB_END }, + { /* User */ GRP_WEB_VAR_BEGIN, GRP_WEB_VAR_END } }; if (bHtmlMode) @@ -453,14 +454,14 @@ sal_uInt16 SwFldMgr::GetGroup(sal_Bool bHtmlMode, sal_uInt16 nTypeId, sal_uInt16 sal_uInt16 SwFldMgr::GetTypeId(sal_uInt16 nPos) { - ASSERT(nPos < ::GetPackCount(), "unzulaessige Pos"); + OSL_ENSURE(nPos < ::GetPackCount(), "forbidden Pos"); return aSwFlds[ nPos ].nTypeId; } const String& SwFldMgr::GetTypeStr(sal_uInt16 nPos) { - ASSERT(nPos < ::GetPackCount(), "unzulaessige TypeId"); + OSL_ENSURE(nPos < ::GetPackCount(), "forbidden TypeId"); sal_uInt16 nFldWh = aSwFlds[ nPos ].nTypeId; @@ -509,7 +510,7 @@ sal_Bool SwFldMgr::GetSubTypes(sal_uInt16 nTypeId, SvStringsDtor& rToFill) { sal_Bool bRet = sal_False; SwWrtShell *pSh = pWrtShell ? pWrtShell : lcl_GetShell(); - DBG_ASSERT(pSh, "no SwWrtShell found"); + OSL_ENSURE(pSh, "no SwWrtShell found"); if(pSh) { const sal_uInt16 nPos = GetPos(nTypeId); @@ -618,7 +619,7 @@ sal_Bool SwFldMgr::GetSubTypes(sal_uInt16 nTypeId, SvStringsDtor& rToFill) sal_uInt16 SwFldMgr::GetFormatCount(sal_uInt16 nTypeId, sal_Bool bIsText, sal_Bool bHtmlMode) const { - ASSERT(nTypeId < TYP_END, "unzulaessige TypeId"); + OSL_ENSURE(nTypeId < TYP_END, "forbidden TypeId"); { const sal_uInt16 nPos = GetPos(nTypeId); @@ -676,7 +677,7 @@ sal_uInt16 SwFldMgr::GetFormatCount(sal_uInt16 nTypeId, sal_Bool bIsText, sal_Bo String SwFldMgr::GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const { String aRet; - ASSERT(nTypeId < TYP_END, "unzulaessige TypeId"); + OSL_ENSURE(nTypeId < TYP_END, "forbidden TypeId"); const sal_uInt16 nPos = GetPos(nTypeId); @@ -836,7 +837,7 @@ sal_Bool SwFldMgr::GoNextPrev( sal_Bool bNext, SwFieldType* pTyp ) void SwFldMgr::InsertFldType(SwFieldType& rType) { SwWrtShell* pSh = pWrtShell ? pWrtShell : ::lcl_GetShell(); - DBG_ASSERT(pSh, "no SwWrtShell found"); + OSL_ENSURE(pSh, "no SwWrtShell found"); if(pSh) pSh->InsertFldType(rType); } @@ -868,7 +869,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData ) SwWrtShell* pCurShell = rData.pSh; if(!pCurShell) pCurShell = pWrtShell ? pWrtShell : ::lcl_GetShell(); - DBG_ASSERT(pCurShell, "no SwWrtShell found"); + OSL_ENSURE(pCurShell, "no SwWrtShell found"); if(!pCurShell) return sal_False; @@ -1335,11 +1336,6 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData ) pCurShell->EndAllAction(); return sal_True; -/* // In der Tabelle Tabellenformeln einfuegen - SwTblFieldType* pTyp = (SwTblFieldType*)pCurShell->GetFldType( - 0, RES_TABLEFLD); - pFld = new SwTblField(pTyp, rData.sPar2, nsSwGetSetExpType::GSE_EXPR, nFormatId); - bTbl = sal_True;*/ } else { @@ -1376,11 +1372,11 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData ) } break; default: - { ASSERT(!this, "Falscher Feldtyp"); + { OSL_ENSURE(!this, "wrong field type"); return sal_False; } } - ASSERT(pFld, "Feld nicht vorhanden"); + OSL_ENSURE(pFld, "field not available"); //the auto language flag has to be set prior to the language! @@ -1425,7 +1421,7 @@ void SwFldMgr::UpdateCurFld(sal_uLong nFormat, SwField * _pTmpFld) // #111840# { // Format aendern - ASSERT(pCurFld, "kein Feld an der CursorPos"); + OSL_ENSURE(pCurFld, "no field at CursorPos"); bool bDelete = false; SwField *pTmpFld; // mb: fixed memory leak @@ -1443,7 +1439,7 @@ void SwFldMgr::UpdateCurFld(sal_uLong nFormat, const sal_uInt16 nTypeId = pTmpFld->GetTypeId(); SwWrtShell* pSh = pWrtShell ? pWrtShell : ::lcl_GetShell(); - DBG_ASSERT(pSh, "no SwWrtShell found"); + OSL_ENSURE(pSh, "no SwWrtShell found"); if(!pSh) return; pSh->StartAllAction(); @@ -1619,7 +1615,7 @@ void SwFieldType::_GetFldName() { static const sal_uInt16 coFldCnt = STR_TYPE_END - STR_TYPE_BEGIN; - static sal_uInt16 __READONLY_DATA coFldNms[ coFldCnt ] = { + static sal_uInt16 coFldNms[ coFldCnt ] = { FLD_DATE_STD, FLD_TIME_STD, STR_FILENAMEFLD, @@ -1675,10 +1671,6 @@ void SwFieldType::_GetFldName() } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool SwFldMgr::ChooseMacro(const String&) { sal_Bool bRet = sal_False; @@ -1709,8 +1701,8 @@ void SwFldMgr::SetMacroPath(const String& rPath) Reference< uri::XUriReferenceFactory > xFactory( xSMgr->createInstance( - ::rtl::OUString::createFromAscii( - "com.sun.star.uri.UriReferenceFactory" ) ), UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.uri.UriReferenceFactory" )) ), UNO_QUERY ); if ( xFactory.is() ) { @@ -1724,10 +1716,6 @@ void SwFldMgr::SetMacroPath(const String& rPath) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uLong SwFldMgr::GetDefaultFormat(sal_uInt16 nTypeId, sal_Bool bIsText, SvNumberFormatter* pFormatter, double* pVal) { double fValue; @@ -1774,20 +1762,19 @@ sal_uLong SwFldMgr::GetDefaultFormat(sal_uInt16 nTypeId, sal_Bool bIsText, SvNum return pFormatter->GetStandardFormat(nDefFormat, GetCurrLanguage()); } -/* -----------------------------01.03.01 16:46-------------------------------- - - ---------------------------------------------------------------------------*/ Reference<XNumberingTypeInfo> SwFldMgr::GetNumberingInfo() const { if(!xNumberingInfo.is()) { Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); Reference < XInterface > xI = xMSF->createInstance( - ::rtl::OUString::createFromAscii( - "com.sun.star.text.DefaultNumberingProvider" )); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.text.DefaultNumberingProvider" ))); Reference<XDefaultNumberingProvider> xDefNum(xI, UNO_QUERY); - DBG_ASSERT(xDefNum.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\""); + OSL_ENSURE(xDefNum.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\""); ((SwFldMgr*)this)->xNumberingInfo = Reference<XNumberingTypeInfo>(xDefNum, UNO_QUERY); } return xNumberingInfo; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index b359de9d4b..85be6af5f6 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,10 +57,6 @@ using namespace ::com::sun::star; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwFldPage::SwFldPage( Window *pParent, const ResId &rId, const SfxItemSet &rAttrSet ) :SfxTabPage (pParent, rId, rAttrSet), @@ -74,12 +71,8 @@ SwFldPage::SwFldPage( Window *pParent, const ResId &rId, m_bRefresh (sal_False), m_bFirstHTMLInit (sal_True) { -// FreeResource(); -} -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ +} SwFldPage::~SwFldPage() { @@ -210,7 +203,6 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str String sPar1(rPar1); String sPar2(rPar2); - sal_Bool bDBChanged = sal_False; switch( nTypeId ) { case TYP_DATEFLD: @@ -233,7 +225,6 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str sPar1 = rPar1.Copy(nPos); ((SwDBNameInfField*)pTmpFld)->SetDBData(aData); - bDBChanged = sal_True; } break; @@ -261,7 +252,6 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str break; } } - bDBChanged = sal_True; } break; @@ -322,10 +312,6 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str return bRet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwFldPage::SavePos( const ListBox* pLst1, const ListBox* pLst2, const ListBox* pLst3 ) { @@ -339,10 +325,6 @@ void SwFldPage::SavePos( const ListBox* pLst1, const ListBox* pLst2, m_aLstStrArr[ i ].Erase(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwFldPage::RestorePos(ListBox* pLst1, ListBox* pLst2, ListBox* pLst3) { sal_uInt16 nPos = 0; @@ -401,21 +383,17 @@ void SwFldPage::EnableInsert(sal_Bool bEnable) m_bInsert = bEnable; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldPage, NumFormatHdl, ListBox *, EMPTYARG ) { InsertHdl(); return 0; } -/*-- 19.12.2005 14:05:47--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwFldPage::SetWrtShell( SwWrtShell* pShell ) { m_pWrtShell = pShell; m_aMgr.SetWrtShell( pShell ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldpage.hxx b/sw/source/ui/fldui/fldpage.hxx index ae476a5acd..8d682564de 100644 --- a/sw/source/ui/fldui/fldpage.hxx +++ b/sw/source/ui/fldui/fldpage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,10 +33,6 @@ class ListBox; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - const int coLBCount = 3; class SwFldPage : public SfxTabPage @@ -105,3 +102,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index fea6f54438..3f48b3e20e 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,21 +40,13 @@ #include <IMark.hxx> #include <expfld.hxx> #include <swmodule.hxx> -#ifndef _FLDREF_HXX #include <fldref.hxx> -#endif #include <reffld.hxx> #include <wrtsh.hxx> -#ifndef _FLDUI_HRC #include <fldui.hrc> -#endif -#ifndef _FLDTDLG_HRC #include <fldtdlg.hrc> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif // --> OD 2007-11-14 #i83479# #include <SwNodeNum.hxx> #include <IDocumentMarkAccess.hxx> @@ -77,11 +70,6 @@ sal_uInt16 nFldDlgFmtSel = 0; #define USER_DATA_VERSION_1 "1" #define USER_DATA_VERSION USER_DATA_VERSION_1 - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet ) : SwFldPage( pParent, SW_RES( TP_FLD_REF ), rCoreSet ), @@ -130,10 +118,6 @@ SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet ) : // <-- } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwFldRefPage::~SwFldRefPage() { } @@ -186,10 +170,6 @@ sal_uInt16 SwFldRefPage::GetSavedSelectedPos() const // <-- -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwFldRefPage::Reset(const SfxItemSet& ) { if (!IsFldEdit()) @@ -246,7 +226,7 @@ void SwFldRefPage::Reset(const SfxItemSet& ) if ((nsSwGetSetExpType::GSE_SEQ & pType->GetType()) && pType->GetDepends() && pSh->IsUsed(*pType)) { nPos = aTypeLB.InsertEntry(pType->GetName()); - aTypeLB.SetEntryData(nPos, (void*)(REFFLDFLAG | n)); + aTypeLB.SetEntryData(nPos, (void*)(sal_uIntPtr)(REFFLDFLAG | n)); } } @@ -307,10 +287,6 @@ void SwFldRefPage::Reset(const SfxItemSet& ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG ) { // Alte ListBoxPos sichern @@ -332,8 +308,6 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG ) case REF_BOOKMARK: { // --> OD 2007-11-14 #i83479# -// sName = sBookmarkTxt; -// nFlag = REFFLDFLAG_BOOKMARK; SwGetRefField* pRefFld = dynamic_cast<SwGetRefField*>(GetCurField()); if ( pRefFld && pRefFld->IsRefToHeadingCrossRefBookmark() ) @@ -452,10 +426,6 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldRefPage, SubTypeHdl, ListBox *, EMPTYARG ) { sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); @@ -726,10 +696,6 @@ void SwFldRefPage::UpdateSubType() // <-- } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId) { String sOldSel; @@ -762,9 +728,7 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId) default: // --> OD 2007-11-16 #i83479# -// nSize = GetFldMgr().GetFormatCount( (REFFLDFLAG & nTypeId) -// ? (sal_uInt16)TYP_GETREFFLD : nTypeId, -// sal_False, IsFldDlgHtmlMode() ); + if ( REFFLDFLAG & nTypeId ) { nSize = FMT_REF_ONLYSEQNO - FMT_REF_BEGIN + 1; @@ -843,10 +807,6 @@ IMPL_LINK( SwFldRefPage, ModifyHdl, Edit *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) { sal_Bool bModified = sal_False; @@ -868,7 +828,6 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) switch(nTypeId) { case TYP_GETREFFLD: - // aName = aSelectionLB.GetSelectEntry(); nSubType = REF_SETREFATTR; break; @@ -947,7 +906,7 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) else if ( nTypeId == REFFLDFLAG_HEADING ) { SvLBoxEntry* pEntry = aSelectionToolTipLB.GetCurEntry(); - ASSERT( pEntry, + OSL_ENSURE( pEntry, "<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip listbox!" ); if ( pEntry ) { @@ -967,7 +926,7 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) else if ( nTypeId == REFFLDFLAG_NUMITEM ) { SvLBoxEntry* pEntry = aSelectionToolTipLB.GetCurEntry(); - ASSERT( pEntry, + OSL_ENSURE( pEntry, "<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip listbox!" ); if ( pEntry ) { @@ -1035,28 +994,17 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) return sal_False; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SfxTabPage* SwFldRefPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return ( new SwFldRefPage( pParent, rAttrSet ) ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwFldRefPage::GetGroup() { return GRP_REF; } -/* -----------------12.01.99 10:09------------------- - * - * --------------------------------------------------*/ void SwFldRefPage::FillUserData() { String sData( String::CreateFromAscii( @@ -1071,3 +1019,4 @@ void SwFldRefPage::FillUserData() SetUserData(sData); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldref.hxx b/sw/source/ui/fldui/fldref.hxx index ddf10e6924..cbb67fd9de 100644 --- a/sw/source/ui/fldui/fldref.hxx +++ b/sw/source/ui/fldui/fldref.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <sfx2/tabdlg.hxx> #include <vcl/fixed.hxx> #include <vcl/lstbox.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <vcl/group.hxx> #include <vcl/edit.hxx> @@ -44,10 +43,6 @@ class SwTxtNode; // <-- -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - class SwFldRefPage : public SwFldPage { FixedText aTypeFT; @@ -112,3 +107,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx index bc52230dc1..f7d95cebf6 100644 --- a/sw/source/ui/fldui/fldtdlg.cxx +++ b/sw/source/ui/fldui/fldtdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,9 +35,7 @@ -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <swtypes.hxx> #include <unotools/confignode.hxx> #include <comphelper/processfactory.hxx> @@ -130,18 +129,10 @@ SwFldDlg::SwFldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwFldDlg::~SwFldDlg() { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool SwFldDlg::Close() { m_pBindings->GetDispatcher()-> @@ -150,10 +141,6 @@ sal_Bool SwFldDlg::Close() return sal_True; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwFldDlg::Initialize(SfxChildWinInfo *pInfo) { Point aPos; @@ -200,10 +187,6 @@ void SwFldDlg::Initialize(SfxChildWinInfo *pInfo) SetPosPixel( aPos ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SfxItemSet* SwFldDlg::CreateInputItemSet( sal_uInt16 nID ) { if ( nID == TP_FLD_DOKINF ) @@ -315,16 +298,12 @@ void SwFldDlg::Activate() } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwFldDlg::EnableInsert(sal_Bool bEnable) { if( bEnable ) { SwView* pView = ::GetActiveView(); - DBG_ASSERT(pView, "no view found"); + OSL_ENSURE(pView, "no view found"); if( !pView || (pView->GetWrtShell().IsReadOnlyAvailable() && pView->GetWrtShell().HasReadonlySel()) ) @@ -333,17 +312,11 @@ void SwFldDlg::EnableInsert(sal_Bool bEnable) GetOKButton().Enable(bEnable); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwFldDlg::InsertHdl() { GetOKButton().Click(); } -/* -----------------27.11.2002 15:24----------------- - * - * --------------------------------------------------*/ + void SwFldDlg::ActivateDatabasePage() { m_bDataBaseMode = sal_True; @@ -360,9 +333,7 @@ void SwFldDlg::ActivateDatabasePage() RemoveTabPage(TP_FLD_REF); RemoveTabPage(TP_FLD_FUNC); } -/*-- 07.10.2003 14:01:44--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwFldDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) { if( TP_FLD_DB == nId) @@ -384,3 +355,4 @@ void SwFldDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldtdlg.hrc b/sw/source/ui/fldui/fldtdlg.hrc index eaa88e5d1d..dcec8a7512 100644 --- a/sw/source/ui/fldui/fldtdlg.hrc +++ b/sw/source/ui/fldui/fldtdlg.hrc @@ -28,10 +28,6 @@ #ifndef _FLDTDLG_HRC #define _FLDTDLG_HRC -// #include ----------------------------------------------------------------- - -// #define ------------------------------------------------------------------ - #define RC_FLDTDLG_BEGIN 0 // Datenbankfeld-TabPage: diff --git a/sw/source/ui/fldui/fldui.src b/sw/source/ui/fldui/fldui.src index 142e450773..809ad7722d 100644 --- a/sw/source/ui/fldui/fldui.src +++ b/sw/source/ui/fldui/fldui.src @@ -103,11 +103,6 @@ String STR_INPUTFLD }; String STR_SETINPUTFLD { - /* ### ACHTUNG: Neuer Text in Resource? Eingabefeld (Variable) : Eingabefeld (Varibale) */ - /* ### ACHTUNG: Neuer Text in Resource? Eingabefeld (Variable) : Eingabefeld (Varibale) */ - /* ### ACHTUNG: Neuer Text in Resource? Eingabefeld (Variable) : Eingabefeld (Varibale) */ - /* ### ACHTUNG: Neuer Text in Resource? Eingabefeld (Variable) : Eingabefeld (Varibale) */ - /* ### ACHTUNG: Neuer Text in Resource? Eingabefeld (Variable) : Eingabefeld (Varibale) */ Text [ en-US ] = "Input field (variable)" ; }; String STR_USRINPUTFLD @@ -406,7 +401,6 @@ String FMT_CHAPTER_NO_NOSEPARATOR }; String FMT_CHAPTER_NAMENO { - /* ### ACHTUNG: Neuer Text in Resource? Kapitelnummer und Name : Nummer und Name */ Text [ en-US ] = "Chapter number and name" ; }; /*-------------------------------------------------------------------- diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index d7e2c0d433..ac957ec218 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,33 +39,20 @@ #include <docufld.hxx> #include <expfld.hxx> #include <ddefld.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> #include <doc.hxx> #include <docary.hxx> #include <swmodule.hxx> -#ifndef _FLDVAR_HXX #include <fldvar.hxx> -#endif #include <calc.hxx> #include <svl/zformat.hxx> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _FLDUI_HRC #include <fldui.hrc> -#endif -#ifndef _FLDTDLG_HRC #include <fldtdlg.hrc> -#endif #define USER_DATA_VERSION_1 "1" #define USER_DATA_VERSION USER_DATA_VERSION_1 -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ SwFldVarPage::SwFldVarPage(Window* pParent, const SfxItemSet& rCoreSet ) : SwFldPage ( pParent, SW_RES( TP_FLD_VAR ), rCoreSet ), @@ -109,18 +97,10 @@ SwFldVarPage::SwFldVarPage(Window* pParent, const SfxItemSet& rCoreSet ) : aNumFormatLB.SetShowLanguageControl(sal_True); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwFldVarPage::~SwFldVarPage() { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwFldVarPage::Reset(const SfxItemSet& ) { SavePos(&aTypeLB); @@ -214,10 +194,6 @@ void SwFldVarPage::Reset(const SfxItemSet& ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldVarPage, TypeHdl, ListBox *, EMPTYARG ) { // Alte ListBoxPos sichern @@ -250,10 +226,6 @@ IMPL_LINK( SwFldVarPage, TypeHdl, ListBox *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) { sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); @@ -308,7 +280,6 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) } else aValueED.SetText(pType->GetContent()); -// aValueED.SetText(pType->GetContent(aNumFormatLB.GetFormat())); } } else @@ -497,7 +468,6 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) case TYP_SEQFLD: { - // aNumRB.Check(sal_True); bName = bValue = bSeparator = bChapterLevel = sal_True; SwFieldType* pFldTyp; @@ -621,7 +591,6 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) /*-------------------------------------------------------------------- Beschreibung: Typen in der SelectionBox erneuern --------------------------------------------------------------------*/ - void SwFldVarPage::UpdateSubType() { String sOldSel; @@ -725,10 +694,6 @@ void SwFldVarPage::UpdateSubType() aSelectionLB.SetUpdateMode(sal_True); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId) { String sOldSel, sOldNumSel; @@ -861,7 +826,6 @@ sal_uInt16 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId) /*-------------------------------------------------------------------- Beschreibung: Modify --------------------------------------------------------------------*/ - IMPL_LINK( SwFldVarPage, ModifyHdl, Edit *, EMPTYARG ) { String sValue(aValueED.GetText()); @@ -988,10 +952,6 @@ IMPL_LINK( SwFldVarPage, ModifyHdl, Edit *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox ) { sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); @@ -1140,10 +1100,6 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox ) return sal_True; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldVarPage, ChapterHdl, ListBox *, EMPTYARG ) { sal_Bool bEnable = aChapterLevelLB.GetSelectEntryPos() != 0; @@ -1155,10 +1111,6 @@ IMPL_LINK( SwFldVarPage, ChapterHdl, ListBox *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFldVarPage, SeparatorHdl, Edit *, EMPTYARG ) { sal_Bool bEnable = aSeparatorED.GetText().Len() != 0 || @@ -1168,10 +1120,6 @@ IMPL_LINK( SwFldVarPage, SeparatorHdl, Edit *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& ) { sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); @@ -1265,7 +1213,6 @@ sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& ) } case TYP_SEQFLD: { - // nSubType = nsSwGetSetExpType::GSE_SEQ; // nsSwGetSetExpType::GSE_SEQ wird im Fldmgr fest gesetzt, kann also entfallen nSubType = aChapterLevelLB.GetSelectEntryPos(); if (nSubType == 0) nSubType = 0x7f; @@ -1274,7 +1221,6 @@ sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& ) nSubType--; String sSeparator(aSeparatorED.GetText().GetChar(0)); cSeparator = sSeparator.Len() ? sSeparator.GetChar(0) : ' '; - //nSubType |= (sal_uInt16)(((sal_uInt8)) << 8); } break; } @@ -1303,30 +1249,17 @@ sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& ) return sal_False; } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SfxTabPage* SwFldVarPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return ( new SwFldVarPage( pParent, rAttrSet ) ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwFldVarPage::GetGroup() { return GRP_VAR; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SelectionListBox::SelectionListBox( SwFldVarPage* pDialog, const ResId& rResId ) : ListBox (pDialog, rResId), pDlg (pDialog), @@ -1334,21 +1267,15 @@ SelectionListBox::SelectionListBox( SwFldVarPage* pDialog, const ResId& rResId ) { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - long SelectionListBox::PreNotify( NotifyEvent& rNEvt ) { long nHandled = ListBox::PreNotify( rNEvt ); - //sal_Bool bAddSel = sal_False; if ( rNEvt.GetType() == EVENT_KEYUP ) { const KeyEvent* pKEvt = rNEvt.GetKeyEvent(); const KeyCode aKeyCode = pKEvt->GetKeyCode(); const sal_uInt16 nModifier = aKeyCode.GetModifier(); if( aKeyCode.GetCode() == KEY_SPACE && !nModifier) -// bAddSel = sal_True; bCallAddSelection = sal_True; } if ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN ) @@ -1356,18 +1283,12 @@ long SelectionListBox::PreNotify( NotifyEvent& rNEvt ) const MouseEvent* pMEvt = rNEvt.GetMouseEvent(); if (pMEvt && (pMEvt->IsMod1() || pMEvt->IsMod2())) // Alt oder Ctrl - //bAddSel = sal_True; bCallAddSelection = sal_True; } -// if (bAddSel) -// pDlg->AddSelection(this); - return nHandled; } -/* -----------------12.01.99 11:14------------------- - * - * --------------------------------------------------*/ + void SwFldVarPage::FillUserData() { String sData(String::CreateFromAscii(USER_DATA_VERSION)); @@ -1381,3 +1302,4 @@ void SwFldVarPage::FillUserData() SetUserData(sData); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldvar.hxx b/sw/source/ui/fldui/fldvar.hxx index feac765b24..c1cab2ea8e 100644 --- a/sw/source/ui/fldui/fldvar.hxx +++ b/sw/source/ui/fldui/fldvar.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <sfx2/tabdlg.hxx> #include <vcl/fixed.hxx> #include <vcl/lstbox.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <vcl/group.hxx> #include <vcl/toolbox.hxx> #include <vcl/edit.hxx> @@ -43,10 +42,6 @@ class SwFldVarPage; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - class SelectionListBox : public ListBox { SwFldVarPage* pDlg; @@ -62,10 +57,6 @@ public: void ResetCallAddSelection() {bCallAddSelection = sal_False;} }; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - class SwFldVarPage : public SwFldPage { friend class SelectionListBox; @@ -124,3 +115,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldwrap.cxx b/sw/source/ui/fldui/fldwrap.cxx index 334a86b6f9..e81b7605d3 100644 --- a/sw/source/ui/fldui/fldwrap.cxx +++ b/sw/source/ui/fldui/fldwrap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,43 +31,27 @@ -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <swtypes.hxx> #include <sfx2/basedlgs.hxx> #include <sfx2/dispatch.hxx> #include <vcl/msgbox.hxx> #include <svx/htmlmode.hxx> #include <viewopt.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <fldwrap.hxx> #include <wrtsh.hxx> #include <view.hxx> #include <swmodule.hxx> -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _FLDUI_HRC #include <fldui.hrc> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _FLDTDLG_HRC #include <fldtdlg.hrc> -#endif #include "swabstdlg.hxx" SFX_IMPL_CHILDWINDOW(SwFldDlgWrapper, FN_INSERT_FIELD) -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwChildWinWrapper::SwChildWinWrapper(Window *pParentWindow, sal_uInt16 nId) : SfxChildWindow(pParentWindow, nId), m_pDocSh(0) @@ -76,10 +61,6 @@ SwChildWinWrapper::SwChildWinWrapper(Window *pParentWindow, sal_uInt16 nId) : m_aUpdateTimer.SetTimeoutHdl(LINK(this, SwChildWinWrapper, UpdateHdl)); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwChildWinWrapper, UpdateHdl, void*, EMPTYARG ) { GetWindow()->Activate(); // Dialog aktualisieren @@ -90,7 +71,6 @@ IMPL_LINK( SwChildWinWrapper, UpdateHdl, void*, EMPTYARG ) /*-------------------------------------------------------------------- Beschreibung: Nach Dok-Wechsel Dialog neu initialisieren --------------------------------------------------------------------*/ - sal_Bool SwChildWinWrapper::ReInitDlg(SwDocShell *) { sal_Bool bRet = sal_False; @@ -106,10 +86,6 @@ sal_Bool SwChildWinWrapper::ReInitDlg(SwDocShell *) return bRet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SfxChildWinInfo SwFldDlgWrapper::GetInfo() const { SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); @@ -117,21 +93,16 @@ SfxChildWinInfo SwFldDlgWrapper::GetInfo() const return aInfo; } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwFldDlgWrapper::SwFldDlgWrapper( Window* _pParent, sal_uInt16 nId, SfxBindings* pB, SfxChildWinInfo* ) : SwChildWinWrapper( _pParent, nId ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSwFldDlg* pDlg = pFact->CreateSwFldDlg(pB, this, _pParent, DLG_FLD_INSERT ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlgInterface = pDlg; pWindow = pDlg->GetWindow(); pDlg->Start(); @@ -141,7 +112,6 @@ SwFldDlgWrapper::SwFldDlgWrapper( Window* _pParent, sal_uInt16 nId, /*-------------------------------------------------------------------- Beschreibung: Nach Dok-Wechsel Dialog neu initialisieren --------------------------------------------------------------------*/ - sal_Bool SwFldDlgWrapper::ReInitDlg(SwDocShell *pDocSh) { sal_Bool bRet; @@ -154,10 +124,6 @@ sal_Bool SwFldDlgWrapper::ReInitDlg(SwDocShell *pDocSh) return bRet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwFldDlgWrapper::ShowPage(sal_uInt16 nPage) { pDlgInterface->ShowPage(nPage ? nPage : TP_FLD_REF); @@ -165,9 +131,6 @@ void SwFldDlgWrapper::ShowPage(sal_uInt16 nPage) SFX_IMPL_CHILDWINDOW(SwFldDataOnlyDlgWrapper, FN_INSERT_FIELD_DATA_ONLY) -/* -----------------04.02.2003 14:17----------------- - * - * --------------------------------------------------*/ SfxChildWinInfo SwFldDataOnlyDlgWrapper::GetInfo() const { SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); @@ -176,19 +139,17 @@ SfxChildWinInfo SwFldDataOnlyDlgWrapper::GetInfo() const aInfo.bVisible = sal_False; return aInfo; } -/* -----------------04.02.2003 14:17----------------- - * - * --------------------------------------------------*/ + SwFldDataOnlyDlgWrapper::SwFldDataOnlyDlgWrapper( Window* _pParent, sal_uInt16 nId, SfxBindings* pB, SfxChildWinInfo* pInfo ) : SwChildWinWrapper( _pParent, nId ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSwFldDlg* pDlg = pFact->CreateSwFldDlg(pB, this, _pParent, DLG_FLD_INSERT ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlgInterface = pDlg; pWindow = pDlg->GetWindow(); @@ -197,6 +158,7 @@ SwFldDataOnlyDlgWrapper::SwFldDataOnlyDlgWrapper( Window* _pParent, sal_uInt16 n pDlg->Initialize( pInfo ); eChildAlignment = SFX_ALIGN_NOALIGNMENT; } + /* -----------------04.02.2003 14:17----------------- * re-init after doc activation * --------------------------------------------------*/ @@ -210,3 +172,5 @@ sal_Bool SwFldDataOnlyDlgWrapper::ReInitDlg(SwDocShell *pDocSh) return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx index 3b190060cc..b020f559fe 100644 --- a/sw/source/ui/fldui/inpdlg.cxx +++ b/sw/source/ui/fldui/inpdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -129,7 +130,7 @@ SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS, // JP 31.3.00: Inputfields in readonly regions must be allowed to // input any content. - 74639 sal_Bool bEnable = !rSh.IsCrsrReadonly(); - /*!rSh.IsReadOnlyAvailable() || !rSh.HasReadonlySel()*/; + aOKBT.Enable( bEnable ); aEditED.SetReadOnly( !bEnable ); @@ -199,3 +200,4 @@ IMPL_LINK(SwFldInputDlg, NextHdl, PushButton*, EMPTYARG) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx index 271d5375de..525051ff29 100644 --- a/sw/source/ui/fldui/javaedit.cxx +++ b/sw/source/ui/fldui/javaedit.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,14 +40,10 @@ #define _JAVAEDIT_CXX #include <hintids.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <vcl/svapp.hxx> #include <svl/urihelper.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <sfx2/docfile.hxx> #include <sfx2/filedlghelper.hxx> #include <docsh.hxx> @@ -55,16 +52,10 @@ #include <fldmgr.hxx> #include <docufld.hxx> #include <uitool.hxx> -#ifndef _JAVAEDIT_HXX #include <javaedit.hxx> -#endif -#ifndef _FLDUI_HRC #include <fldui.hrc> -#endif -#ifndef _JAVAEDIT_HRC #include <javaedit.hrc> -#endif // static ---------------------------------------------------------------- @@ -130,12 +121,6 @@ SwJavaEditDialog::SwJavaEditDialog(Window* pParent, SwWrtShell* pWrtSh) : RadioButtonHdl(NULL); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - - SwJavaEditDialog::~SwJavaEditDialog() { delete pMgr; @@ -143,12 +128,6 @@ SwJavaEditDialog::~SwJavaEditDialog() Application::SetDefDialogParent( pOldDefDlgParent ); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - - IMPL_LINK_INLINE_START( SwJavaEditDialog, PrevHdl, Button *, EMPTYARG ) { SetFld(); @@ -161,12 +140,6 @@ IMPL_LINK_INLINE_START( SwJavaEditDialog, PrevHdl, Button *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwJavaEditDialog, PrevHdl, Button *, EMPTYARG ) -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - - IMPL_LINK_INLINE_START( SwJavaEditDialog, NextHdl, Button *, EMPTYARG ) { SetFld(); @@ -179,12 +152,6 @@ IMPL_LINK_INLINE_START( SwJavaEditDialog, NextHdl, Button *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwJavaEditDialog, NextHdl, Button *, EMPTYARG ) -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - - IMPL_LINK( SwJavaEditDialog, OKHdl, Button *, EMPTYARG ) { SetFld(); @@ -192,22 +159,10 @@ IMPL_LINK( SwJavaEditDialog, OKHdl, Button *, EMPTYARG ) return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - - void SwJavaEditDialog::Apply() { } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - - void SwJavaEditDialog::CheckTravel() { sal_Bool bTravel = sal_False; @@ -264,12 +219,6 @@ void SwJavaEditDialog::CheckTravel() } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - - void SwJavaEditDialog::SetFld() { if( !aOKBtn.IsEnabled() ) @@ -304,10 +253,6 @@ sal_Bool SwJavaEditDialog::IsUpdate() return pFld && ( bIsUrl != pFld->GetFormat() || pFld->GetPar2() != aType || pFld->GetPar1() != aText ); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK( SwJavaEditDialog, RadioButtonHdl, RadioButton *, EMPTYARG ) { sal_Bool bEnable = aUrlRB.IsChecked(); @@ -328,10 +273,6 @@ IMPL_LINK( SwJavaEditDialog, RadioButtonHdl, RadioButton *, EMPTYARG ) return 0; } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - IMPL_LINK( SwJavaEditDialog, InsertFileHdl, PushButton *, pBtn ) { if ( !pFileDlg ) @@ -364,3 +305,4 @@ IMPL_LINK( SwJavaEditDialog, DlgClosedHdl, sfx2::FileDialogHelper *, EMPTYARG ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/javaedit.src b/sw/source/ui/fldui/javaedit.src index cbcc83f055..bf1407e48e 100644 --- a/sw/source/ui/fldui/javaedit.src +++ b/sw/source/ui/fldui/javaedit.src @@ -142,7 +142,6 @@ ModalDialog DLG_JAVAEDIT }; String STR_JAVA_INSERT { - /* ### ACHTUNG: Neuer Text in Resource? Script einf�gen : Script einf�gen */ Text [ en-US ] = "Insert Script" ; }; Text [ en-US ] = "Edit Script" ; diff --git a/sw/source/ui/fldui/xfldui.cxx b/sw/source/ui/fldui/xfldui.cxx index 518c32b6e9..e1f4dbe6a6 100644 --- a/sw/source/ui/fldui/xfldui.cxx +++ b/sw/source/ui/fldui/xfldui.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,7 +30,7 @@ #include "precompiled_sw.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/sdbc/XDataSource.hpp> @@ -40,13 +41,9 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <comphelper/processfactory.hxx> #include <fldmgr.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <wrtsh.hxx> // Actives Fenster -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <swmodule.hxx> @@ -92,7 +89,7 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName if(xTSupplier.is()) { Reference<XNameAccess> xTbls = xTSupplier->getTables(); - DBG_ASSERT(xTbls->hasByName(rTblQryName), "table not available anymore?"); + OSL_ENSURE(xTbls->hasByName(rTblQryName), "table not available anymore?"); try { Any aTable = xTbls->getByName(rTblQryName); @@ -109,7 +106,7 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName if(xQSupplier.is()) { Reference<XNameAccess> xQueries = xQSupplier->getQueries(); - DBG_ASSERT(xQueries->hasByName(rTblQryName), "table not available anymore?"); + OSL_ENSURE(xQueries->hasByName(rTblQryName), "table not available anymore?"); try { Any aQuery = xQueries->getByName(rTblQryName); @@ -130,7 +127,7 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName } catch(Exception& ) { - DBG_ERROR("Exception in getColumns()"); + OSL_ENSURE(false, "Exception in getColumns()"); } if(xCols.is() && xCols->hasByName(rFldName)) { @@ -182,3 +179,4 @@ sal_Bool SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx index 501bc85170..223def1d61 100644 --- a/sw/source/ui/fmtui/tmpdlg.cxx +++ b/sw/source/ui/fmtui/tmpdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,20 +51,13 @@ #include <fmtclds.hxx> #include <swtypes.hxx> #include <swmodule.hxx> -#include <errhdl.hxx> // fuer Create-Methoden #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wdocsh.hxx> #include <viewopt.hxx> #include <pgfnote.hxx> -#ifndef _PGFGRID_HXX #include <pggrid.hxx> -#endif -#ifndef _TMPDLG_HXX #include <tmpdlg.hxx> // der Dialog -#endif #include <column.hxx> // Spalten #include <drpcps.hxx> // Initialen #include <frmpage.hxx> // Rahmen @@ -78,18 +72,10 @@ #include <uitool.hxx> #include <shellres.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _FMTUI_HRC #include <fmtui.hrc> -#endif #include <SwStyleNameMapper.hxx> #include <svx/svxids.hrc> #include <svl/stritem.hxx> @@ -126,31 +112,31 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent, nHtmlMode = ::GetHtmlMode(pWrtShell->GetView().GetDocShell()); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); // TabPages zusammenfieseln switch( nRegion ) { // Zeichenvorlagen case SFX_STYLE_FAMILY_CHAR: { - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) , "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) , "GetTabPageRangesFunc fail!"); AddTabPage(TP_CHAR_STD, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) , "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) , "GetTabPageRangesFunc fail!"); AddTabPage(TP_CHAR_EXT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) , "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) , "GetTabPageRangesFunc fail!"); AddTabPage(TP_CHAR_POS, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , "GetTabPageRangesFunc fail!"); AddTabPage(TP_CHAR_TWOLN, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) , "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) , "GetTabPageRangesFunc fail!"); AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); SvtCJKOptions aCJKOptions; @@ -161,41 +147,41 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent, // Absatzvorlagen case SFX_STYLE_FAMILY_PARA: { - DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!"); AddTabPage( TP_PARA_STD, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!"); AddTabPage( TP_PARA_ALIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!"); AddTabPage( TP_PARA_EXT, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!"); AddTabPage( TP_PARA_ASIAN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageRangesFunc fail!"); AddTabPage(TP_CHAR_STD, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageRangesFunc fail!"); AddTabPage(TP_CHAR_EXT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) , "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) , "GetTabPageRangesFunc fail!"); AddTabPage(TP_CHAR_POS, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , "GetTabPageRangesFunc fail!"); AddTabPage(TP_CHAR_TWOLN, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR), "GetTabPageRangesFunc fail!"); AddTabPage( TP_TABULATOR, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR) ); @@ -203,11 +189,11 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent, SwParagraphNumTabPage::GetRanges); AddTabPage(TP_DROPCAPS, SwDropCapsPage::Create, SwDropCapsPage::GetRanges ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!"); AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) ); AddTabPage( TP_CONDCOLL, SwCondCollPage::Create, @@ -252,11 +238,11 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent, SwFrmAddPage::GetRanges ); AddTabPage(TP_FRM_WRAP, SwWrapTabPage::Create, SwWrapTabPage::GetRanges ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!"); AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) ); AddTabPage(TP_COLUMN, SwColumnPage::Create, @@ -264,22 +250,13 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent, AddTabPage( TP_MACRO_ASSIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_MACROASSIGN), 0); - // Auskommentiert wegen Bug #45776 (per default keine Breite&Groesse in Rahmenvorlagen) -/* SwFmtFrmSize aSize( (const SwFmtFrmSize&)rBase. - GetItemSet().Get(RES_FRM_SIZE)); - if( !aSize.GetWidth() ) - { - aSize.SetWidth( DFLT_WIDTH ); - aSize.SetHeight( DFLT_HEIGHT ); - rBase.GetItemSet().Put( aSize ); - }*/ break; } // Seitenvorlagen case SFX_STYLE_FAMILY_PAGE: { - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); AddTabPage(TP_HEADER_PAGE, String(SW_RES(STR_PAGE_HEADER)), SvxHeaderPage::Create, @@ -290,8 +267,8 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent, if(bColumn) SetCurPageId(TP_COLUMN); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ), "GetTabPageRangesFunc fail!"); AddTabPage(TP_PAGE_STD, String(SW_RES(STR_PAGE_STD)), pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ), @@ -299,8 +276,8 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent, 1 ); // nach der Verwalten-Page if(!pActShell || 0 == ::GetHtmlMode(pWrtShell->GetView().GetDocShell())) { - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!"); + OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!"); + OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!"); AddTabPage(TP_BORDER, String(SW_RES(STR_PAGE_BORDER)), pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) ); AddTabPage(TP_COLUMN, String(SW_RES(STR_PAGE_COLUMN)), @@ -330,35 +307,19 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent, AddTabPage( RID_SVXPAGE_NUM_OPTIONS ); AddTabPage( RID_SVXPAGE_NUM_POSITION ); - -/* const SfxPoolItem* pItem; - if(SFX_ITEM_SET == rBase.GetItemSet().GetItemState( - FN_PARAM_ACT_NUMBER, sal_False, &pItem )) - { -// pActNum = (ActNumberFormat*)((const SwPtrItem*)pItem)->GetValue(); - } -*/ } break; default: - ASSERT(!this, "Falsche Familie"); + OSL_ENSURE(!this, "wrong family"); } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwTemplateDlg::~SwTemplateDlg() { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - short SwTemplateDlg::Ok() { short nRet = SfxTabDialog::Ok(); @@ -385,10 +346,6 @@ short SwTemplateDlg::Ok() return nRet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - const SfxItemSet* SwTemplateDlg::GetRefreshedSet() { SfxItemSet* pInSet = GetInputSetImpl(); @@ -397,10 +354,6 @@ const SfxItemSet* SwTemplateDlg::GetRefreshedSet() return pInSet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { //Namen der Vorlagen und Metric setzen @@ -413,7 +366,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { case TP_CHAR_STD: { - ASSERT(::GetActiveView(), "keine View aktiv"); + OSL_ENSURE(::GetActiveView(), "no active view"); SvxFontListItem aFontListItem( *( (SvxFontListItem*)::GetActiveView()-> GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) ); @@ -645,3 +598,4 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fmtui/tmpdlg.src b/sw/source/ui/fmtui/tmpdlg.src index 3d9e8df617..844e113409 100644 --- a/sw/source/ui/fmtui/tmpdlg.src +++ b/sw/source/ui/fmtui/tmpdlg.src @@ -89,7 +89,6 @@ TabDialog DLG_TEMPLATE_2 PageItem { Identifier = TP_PARA_STD ; - /* ### ACHTUNG: Neuer Text in Resource? Einz�ge und Abst�nde : Einz�ge und Abst�nde */ Text [ en-US ] = "Indents & Spacing" ; PageResID = TP_PARA_STD ; }; @@ -102,7 +101,6 @@ TabDialog DLG_TEMPLATE_2 PageItem { Identifier = TP_PARA_EXT ; - /* ### ACHTUNG: Neuer Text in Resource? Textflu?: Textflu?*/ Text [ en-US ] = "Text Flow" ; PageResID = TP_PARA_EXT ; }; @@ -253,7 +251,6 @@ String STR_PAGE_HEADER }; String STR_PAGE_FOOTER { - /* ### ACHTUNG: Neuer Text in Resource? Fu�zeile : Fu�zeile */ Text [ en-US ] = "Footer" ; }; String STR_PAGE_TEXTGRID @@ -266,7 +263,6 @@ String STR_PAGE_COLUMN }; String STR_PAGE_FOOTNOTE { - /* ### ACHTUNG: Neuer Text in Resource? Fu�note : Fu�note */ Text [ en-US ] = "Footnote" ; }; TabDialog DLG_TEMPLATE_3 @@ -300,7 +296,6 @@ TabDialog DLG_TEMPLATE_3 { Identifier = TP_FRM_ADD ; PageResID = TP_FRM_ADD ; - /* ### ACHTUNG: Neuer Text in Resource? Zus�tze : Zus�tze */ Text [ en-US ] = "Options" ; }; PageItem diff --git a/sw/source/ui/frmdlg/colex.cxx b/sw/source/ui/frmdlg/colex.cxx index 375a864153..25b95d2b57 100644 --- a/sw/source/ui/frmdlg/colex.cxx +++ b/sw/source/ui/frmdlg/colex.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -204,10 +205,6 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) Invalidate(); } -/*----------------------------------------------------------------------- - Beschreibung: - -----------------------------------------------------------------------*/ - void SwColExample::DrawPage( const Point& rOrg, const sal_Bool bSecond, @@ -307,11 +304,6 @@ void SwColExample::DrawPage( const Point& rOrg, } } -/*-----------------25.10.96 09.15------------------- - ---------------------------------------------------*/ - - SwColumnOnlyExample::SwColumnOnlyExample( Window* pParent, const ResId& rResId) : Window(pParent, rResId), m_aFrmSize(1,1) @@ -336,11 +328,6 @@ SwColumnOnlyExample::SwColumnOnlyExample( Window* pParent, const ResId& rResId) SetMapMode( aMapMode ); } -/*-----------------25.10.96 09.16------------------- - ---------------------------------------------------*/ - - void SwColumnOnlyExample::Paint( const Rectangle& /*rRect*/ ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -429,11 +416,6 @@ void SwColumnOnlyExample::Paint( const Rectangle& /*rRect*/ ) } } -/*-----------------25.10.96 12.05------------------- - ---------------------------------------------------*/ - - void SwColumnOnlyExample::SetColumns(const SwFmtCol& rCol) { m_aCols = rCol; @@ -477,16 +459,12 @@ void SwColumnOnlyExample::SetColumns(const SwFmtCol& rCol) } } } -/* -----------------------------08.02.2002 11:44------------------------------ - ---------------------------------------------------------------------------*/ SwPageGridExample::~SwPageGridExample() { delete pGridItem; } -/* -----------------------------08.02.2002 11:48------------------------------ - ---------------------------------------------------------------------------*/ #define MAX_ROWS 10 #define MAX_LINES 15 void SwPageGridExample::DrawPage( const Point& rOrg, @@ -589,9 +567,7 @@ void SwPageGridExample::DrawPage( const Point& rOrg, } } } -/* -----------------------------08.02.2002 11:48------------------------------ - ---------------------------------------------------------------------------*/ void SwPageGridExample::UpdateExample( const SfxItemSet& rSet ) { DELETEZ(pGridItem); @@ -608,3 +584,4 @@ void SwPageGridExample::UpdateExample( const SfxItemSet& rSet ) SwPageExample::UpdateExample(rSet); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/frmdlg/colmgr.cxx b/sw/source/ui/frmdlg/colmgr.cxx index cd561861b4..503a7f6840 100644 --- a/sw/source/ui/frmdlg/colmgr.cxx +++ b/sw/source/ui/frmdlg/colmgr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,9 +43,6 @@ /*------------------------------------------------------------------------ Beschreibung: Spaltenbreite auf aktuelle Breite einstellen ------------------------------------------------------------------------*/ - - - void FitToActualSize(SwFmtCol& rCol, sal_uInt16 nWidth) { const sal_uInt16 nCount = rCol.GetColumns().Count(); @@ -56,14 +54,10 @@ void FitToActualSize(SwFmtCol& rCol, sal_uInt16 nWidth) rCol.SetWishWidth(nWidth); } - // PUBLIC METHODES ------------------------------------------------------- /*------------------------------------------------------------------------ Beschreibung: Setzen Spaltenanzahl und Gutterwidth ------------------------------------------------------------------------*/ - - - void SwColMgr::SetCount(sal_uInt16 nCount, sal_uInt16 nGutterWidth) { aFmtCol.Init(nCount, nGutterWidth, nWidth); @@ -71,8 +65,6 @@ void SwColMgr::SetCount(sal_uInt16 nCount, sal_uInt16 nGutterWidth) aFmtCol.SetGutterWidth(nGutterWidth, nWidth); } - - sal_uInt16 SwColMgr::GetGutterWidth( sal_uInt16 nPos ) const { sal_uInt16 nRet; @@ -80,25 +72,20 @@ sal_uInt16 SwColMgr::GetGutterWidth( sal_uInt16 nPos ) const nRet = GetCount() > 1 ? aFmtCol.GetGutterWidth() : DEF_GUTTER_WIDTH; else { - DBG_ASSERT(nPos < GetCount() - 1, "Spalte ueberindiziert" ); + OSL_ENSURE(nPos < GetCount() - 1, "Spalte ueberindiziert" ); const SwColumns& rCols = aFmtCol.GetColumns(); nRet = rCols.GetObject(nPos)->GetRight() + rCols.GetObject(nPos + 1)->GetLeft(); } return nRet; } -/*-----------------22.10.96 14.28------------------- - ---------------------------------------------------*/ - - void SwColMgr::SetGutterWidth(sal_uInt16 nGutterWidth, sal_uInt16 nPos ) { if(nPos == USHRT_MAX) aFmtCol.SetGutterWidth(nGutterWidth, nWidth); else { - DBG_ASSERT(nPos < GetCount() - 1, "Spalte ueberindiziert" ); + OSL_ENSURE(nPos < GetCount() - 1, "Spalte ueberindiziert" ); SwColumns& rCols = aFmtCol.GetColumns(); sal_uInt16 nGutterWidth2 = nGutterWidth / 2; rCols.GetObject(nPos)->SetRight(nGutterWidth2); @@ -109,38 +96,29 @@ void SwColMgr::SetGutterWidth(sal_uInt16 nGutterWidth, sal_uInt16 nPos ) /*------------------------------------------------------------------------ Beschreibung: Hoehe Trennlinie ------------------------------------------------------------------------*/ - - - short SwColMgr::GetLineHeightPercent() const { return (short)aFmtCol.GetLineHeight(); } - - void SwColMgr::SetLineHeightPercent(short nPercent) { - ASSERT(nPercent <= 100, LineHeight darf nur bis 100 % gross sein); + OSL_ENSURE(nPercent <= 100, "line height may only be 100 \%"); aFmtCol.SetLineHeight((sal_uInt8)nPercent); } + /*------------------------------------------------------------------------ Beschreibung: Spaltenbreite ------------------------------------------------------------------------*/ - - - sal_uInt16 SwColMgr::GetColWidth(sal_uInt16 nIdx) const { - ASSERT(nIdx < GetCount(), Spaltenarray ueberindiziert.); + OSL_ENSURE(nIdx < GetCount(), "Spaltenarray ueberindiziert."); return aFmtCol.CalcPrtColWidth(nIdx, nWidth); } - - void SwColMgr::SetColWidth(sal_uInt16 nIdx, sal_uInt16 nWd) { - ASSERT(nIdx < GetCount(), Spaltenarray ueberindiziert.); + OSL_ENSURE(nIdx < GetCount(), "Spaltenarray ueberindiziert."); aFmtCol.GetColumns()[nIdx]->SetWishWidth(nWd); } @@ -148,9 +126,6 @@ void SwColMgr::SetColWidth(sal_uInt16 nIdx, sal_uInt16 nWd) /*-------------------------------------------------------------------- Beschreibung: Groesse neu setzen --------------------------------------------------------------------*/ - - - void SwColMgr::SetActualWidth(sal_uInt16 nW) { nWidth = nW; @@ -160,9 +135,6 @@ void SwColMgr::SetActualWidth(sal_uInt16 nW) /*-------------------------------------------------------------------- Beschreibung: ctor --------------------------------------------------------------------*/ - - - SwColMgr::SwColMgr(const SfxItemSet& rSet, sal_uInt16 nActWidth) : aFmtCol((const SwFmtCol&)rSet.Get(RES_COL)), nWidth(nActWidth) @@ -179,13 +151,8 @@ SwColMgr::SwColMgr(const SfxItemSet& rSet, sal_uInt16 nActWidth) : ::FitToActualSize(aFmtCol, nWidth); } +SwColMgr::~SwColMgr() +{ +} - - -SwColMgr::~SwColMgr() {} - - - - - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 01637c5d07..861a9ab31b 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,6 +46,7 @@ #include <sfx2/dispatch.hxx> #include <vcl/msgbox.hxx> #include <swmodule.hxx> +#include <sal/macros.h> #include <helpid.h> #include "globals.hrc" @@ -78,8 +80,7 @@ SV_IMPL_PTRARR( SwColumns, SwColumnPtr ) /*-------------------------------------------------------------------- Beschreibung: Statische Daten --------------------------------------------------------------------*/ - -static const sal_uInt16 __FAR_DATA nLines[] = { +static const sal_uInt16 nLines[] = { DEF_LINE_WIDTH_0, DEF_LINE_WIDTH_1, DEF_LINE_WIDTH_2, @@ -87,7 +88,7 @@ static const sal_uInt16 __FAR_DATA nLines[] = { DEF_LINE_WIDTH_4 }; -static const sal_uInt16 nLineCount = sizeof(nLines) / sizeof(nLines[0]); +static const sal_uInt16 nLineCount = SAL_N_ELEMENTS(nLines); static const sal_uInt16 nVisCols = 3; inline sal_Bool IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect ) @@ -98,10 +99,6 @@ inline sal_Bool IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect return bRet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) : SfxModalDialog(pParent, SW_RES(DLG_COLUMN)), aOK(this, SW_RES(PB_OK)), @@ -129,7 +126,7 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) : nSelectionWidth = aRect.Width(); SfxItemSet* pColPgSet = 0; - static sal_uInt16 __READONLY_DATA aSectIds[] = { RES_COL, RES_COL, + static sal_uInt16 const aSectIds[] = { RES_COL, RES_COL, RES_FRM_SIZE, RES_FRM_SIZE, RES_COLUMNBALANCE, RES_FRAMEDIR, 0 }; @@ -145,14 +142,14 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) : pSectionSet->Put( pCurrSection->GetFmt()->GetAttrSet() ); pColPgSet = pSectionSet; aApplyToLB.RemoveEntry( aApplyToLB.GetEntryPos( - (void*)( 1 >= nFullSectCnt + (void*)(sal_IntPtr)( 1 >= nFullSectCnt ? LISTBOX_SECTIONS : LISTBOX_SECTION ))); } else { - aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*) LISTBOX_SECTION )); - aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*) LISTBOX_SECTIONS )); + aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*)(sal_IntPtr)LISTBOX_SECTION )); + aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*)(sal_IntPtr)LISTBOX_SECTIONS )); } if( rWrtShell.HasSelection() && rWrtShell.IsInsRegionAvailable() && @@ -163,7 +160,7 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) : pColPgSet = pSelectionSet; } else - aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*) LISTBOX_SELECTION )); + aApplyToLB.RemoveEntry(aApplyToLB.GetEntryPos( (void*)(sal_IntPtr)LISTBOX_SELECTION )); if( rWrtShell.GetFlyFrmFmt() ) { @@ -207,8 +204,7 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) : else aApplyToLB.RemoveEntry( nPagePos ); - - ASSERT( pColPgSet, "" ); + OSL_ENSURE( pColPgSet, "" ); // TabPage erzeugen SwColumnPage* pPage = (SwColumnPage*) SwColumnPage::Create( this, *pColPgSet ); @@ -233,10 +229,6 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) : pTabPage->ActivateColumnControl(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwColumnDlg::~SwColumnDlg() { delete pTabPage; @@ -245,9 +237,6 @@ SwColumnDlg::~SwColumnDlg() delete pSelectionSet; } -/* -----------------26.05.99 11:40------------------- - * - * --------------------------------------------------*/ IMPL_LINK(SwColumnDlg, ObjectHdl, ListBox*, pBox) { SfxItemSet* pSet = 0; @@ -310,9 +299,7 @@ IMPL_LINK(SwColumnDlg, ObjectHdl, ListBox*, pBox) pTabPage->Reset(*pSet); return 0; } -/* -----------------26.05.99 12:32------------------- - * - * --------------------------------------------------*/ + IMPL_LINK(SwColumnDlg, OkHdl, OKButton*, EMPTYARG) { //aktuelle Selektion auswerten @@ -394,10 +381,6 @@ IMPL_LINK(SwColumnDlg, OkHdl, OKButton*, EMPTYARG) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - #if OSL_DEBUG_LEVEL < 2 inline #endif @@ -409,16 +392,13 @@ sal_uInt16 GetMaxWidth( SwColMgr* pColMgr, sal_uInt16 nCols ) return nMax; } -static sal_uInt16 __FAR_DATA aPageRg[] = { +static sal_uInt16 aPageRg[] = { RES_COL, RES_COL, 0 }; - DBG_NAME(columnhdl) - - sal_uInt16 lcl_LineWidthToPos(sal_uLong nWidth) { const sal_uInt16 nUShortWidth = (sal_uInt16)nWidth; @@ -428,8 +408,6 @@ sal_uInt16 lcl_LineWidthToPos(sal_uLong nWidth) return 0; } - - void SwColumnPage::ResetColWidth() { if( nCols ) @@ -446,9 +424,6 @@ void SwColumnPage::ResetColWidth() /*-------------------------------------------------------------------- Beschreibung: Jetzt als TabPage --------------------------------------------------------------------*/ - - - SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet) : SfxTabPage(pParent, SW_RES(TP_COLUMN), rSet), @@ -569,18 +544,11 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet) aLineTypeDLB.InsertEntry( 100 * nLines[ i ] ); } - - SwColumnPage::~SwColumnPage() { delete pColMgr; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwColumnPage::SetPageWidth(long nPageWidth) { long nNewMaxWidth = static_cast< long >(aEd1.NormalizePercent(nPageWidth)); @@ -592,12 +560,6 @@ void SwColumnPage::SetPageWidth(long nPageWidth) aEd3.SetMax(nNewMaxWidth, FUNIT_TWIP); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - void SwColumnPage::Reset(const SfxItemSet &rSet) { sal_uInt16 nHtmlMode = ::GetHtmlMode((const SwDocShell*)SfxObjectShell::Current()); @@ -643,7 +605,7 @@ void SwColumnPage::Reset(const SfxItemSet &rSet) if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( RES_FRAMEDIR ) ) { const SvxFrameDirectionItem& rItem = (const SvxFrameDirectionItem&)rSet.Get(RES_FRAMEDIR); - sal_uInt32 nVal = rItem.GetValue(); + sal_uIntPtr nVal = rItem.GetValue(); sal_uInt16 nPos = aTextDirectionLB.GetEntryPos( (void*) nVal ); aTextDirectionLB.SelectEntryPos( nPos ); aTextDirectionLB.SaveValue(); @@ -656,9 +618,6 @@ void SwColumnPage::Reset(const SfxItemSet &rSet) /*-------------------------------------------------------------------- Beschreibung: TabPage erzeugen --------------------------------------------------------------------*/ - - - SfxTabPage* SwColumnPage::Create(Window *pParent, const SfxItemSet &rSet) { return new SwColumnPage(pParent, rSet); @@ -667,9 +626,6 @@ SfxTabPage* SwColumnPage::Create(Window *pParent, const SfxItemSet &rSet) /*-------------------------------------------------------------------- Beschreibung: Attribute in den Set stopfen bei OK --------------------------------------------------------------------*/ - - - sal_Bool SwColumnPage::FillItemSet(SfxItemSet &rSet) { if(aCLNrEdt.HasChildPathFocus()) @@ -702,9 +658,6 @@ sal_Bool SwColumnPage::FillItemSet(SfxItemSet &rSet) /*-------------------------------------------------------------------- Beschreibung: ColumnManager updaten --------------------------------------------------------------------*/ - - - IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ ) { long nGutterWidth = pColMgr->GetGutterWidth(); @@ -795,9 +748,6 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ ) /*------------------------------------------------------------------------ Beschreibung: Initialisierung ------------------------------------------------------------------------*/ - - - void SwColumnPage::Init() { aCLNrEdt.SetValue(nCols); @@ -866,9 +816,6 @@ void SwColumnPage::Init() Andernfalls werden die Edits jeweils fuer die entsprechenden Spaltenzahl enabled; eine Spalte kann nicht bearbeitet werden. ------------------------------------------------------------------------*/ - - - void SwColumnPage::UpdateCols() { sal_Bool bEnableBtns= sal_False; @@ -963,7 +910,6 @@ void SwColumnPage::SetLabels( sal_uInt16 nVis ) Breiteneinstellungen des Benutzers; alle Spalten sind gleich breit. ------------------------------------------------------------------------*/ - IMPL_LINK( SwColumnPage, ColModify, NumericField *, pNF ) { nCols = (sal_uInt16)aCLNrEdt.GetValue(); @@ -999,9 +945,6 @@ IMPL_LINK( SwColumnPage, ColModify, NumericField *, pNF ) eine Aenderung der Spaltenzahl kehrt wieder zu diesem Default zurueck. ------------------------------------------------------------------------*/ - - - IMPL_LINK( SwColumnPage, GapModify, PercentField *, pFld ) { long nActValue = static_cast< long >(pFld->DenormalizePercent(pFld->GetValue(FUNIT_TWIP))); @@ -1010,7 +953,7 @@ IMPL_LINK( SwColumnPage, GapModify, PercentField *, pFld ) if(aAutoWidthBox.IsChecked()) { sal_uInt16 nMaxGap = pColMgr->GetActualSize() - nCols * MINLAY; - DBG_ASSERT(nCols, "Abstand kann nicht ohne Spalten eingestellt werden"); + OSL_ENSURE(nCols, "Abstand kann nicht ohne Spalten eingestellt werden"); nMaxGap /= nCols - 1; if(nActValue > nMaxGap) { @@ -1073,26 +1016,18 @@ IMPL_LINK( SwColumnPage, GapModify, PercentField *, pFld ) return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - - IMPL_LINK( SwColumnPage, EdModify, PercentField *, pField ) { pModifiedField = pField; Timeout(0); return 0; } + /*------------------------------------------------------------------------ Beschreibung: Handler hinter der Checkbox fuer automatische Breite. Ist die Box gecheckt, koennen keine expliziten Werte fuer die Spaltenbreite eingegeben werden. ------------------------------------------------------------------------*/ - - - IMPL_LINK( SwColumnPage, AutoWidthHdl, CheckBox *, pBox ) { long nDist = static_cast< long >(aDistEd1.DenormalizePercent(aDistEd1.GetValue(FUNIT_TWIP))); @@ -1113,7 +1048,6 @@ IMPL_LINK( SwColumnPage, AutoWidthHdl, CheckBox *, pBox ) /*------------------------------------------------------------------------ Beschreibung: Raufscrollen der Inhalte der Edits. ------------------------------------------------------------------------*/ - IMPL_LINK( SwColumnPage, Up, Button *, EMPTYARG ) { if( nFirstVis ) @@ -1124,10 +1058,10 @@ IMPL_LINK( SwColumnPage, Up, Button *, EMPTYARG ) } return 0; } + /*------------------------------------------------------------------------ Beschreibung: Runterscrollen der Inhalte der Edits. ------------------------------------------------------------------------*/ - IMPL_LINK( SwColumnPage, Down, Button *, EMPTYARG ) { if( nFirstVis + nVisCols < nCols ) @@ -1138,12 +1072,12 @@ IMPL_LINK( SwColumnPage, Down, Button *, EMPTYARG ) } return 0; } + /*------------------------------------------------------------------------ Beschreibung: Relikt aus alten Zeiten - jetzt direkt ohne time * Timer- Handler; angetriggert durch eine Aenderung der Spaltenbreite oder des Spaltenabstandes. ------------------------------------------------------------------------*/ - IMPL_LINK( SwColumnPage, Timeout, Timer *, EMPTYARG ) { DBG_PROFSTART(columnhdl) ; @@ -1155,8 +1089,6 @@ IMPL_LINK( SwColumnPage, Timeout, Timer *, EMPTYARG ) ++nChanged; else if(pModifiedField == &aEd3) nChanged += 2; - /*else if(pModifiedField == &aEd4) - nChanged += 3;*/ long nNewWidth = (sal_uInt16) pModifiedField->DenormalizePercent(pModifiedField->GetValue(FUNIT_TWIP)); @@ -1189,12 +1121,10 @@ IMPL_LINK( SwColumnPage, Timeout, Timer *, EMPTYARG ) DBG_PROFSTOP(columnhdl) ; return 0; } + /*------------------------------------------------------------------------ Beschreibung: Aktualisierung der Anzeige ------------------------------------------------------------------------*/ - - - void SwColumnPage::Update() { aBalanceColsCB.Enable(nCols > 1); @@ -1228,9 +1158,6 @@ void SwColumnPage::Update() /*-------------------------------------------------------------------- Beschreibung: Update Bsp --------------------------------------------------------------------*/ - - - void SwColumnPage::ActivatePage(const SfxItemSet& rSet) { if(!bFrm) @@ -1305,12 +1232,6 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet) Update(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - int SwColumnPage::DeactivatePage(SfxItemSet *_pSet) { if(_pSet) @@ -1319,19 +1240,11 @@ int SwColumnPage::DeactivatePage(SfxItemSet *_pSet) return sal_True; } - - sal_uInt16* SwColumnPage::GetRanges() { return aPageRg; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - IMPL_LINK( SwColumnPage, SetDefaultsHdl, ValueSet *, pVS ) { sal_uInt16 nItem = pVS->GetSelectItemId(); @@ -1368,18 +1281,11 @@ IMPL_LINK( SwColumnPage, SetDefaultsHdl, ValueSet *, pVS ) return 0; } -/*-----------------25.10.96 11.41------------------- - ---------------------------------------------------*/ - - void SwColumnPage::SetFrmMode(sal_Bool bMod) { bFrm = bMod; } -/* -----------------------------2002/06/19 13:08------------------------------ - ---------------------------------------------------------------------------*/ void SwColumnPage::SetInSection(sal_Bool bSet) { if(!SW_MOD()->GetCTLOptions().IsCTLFontEnabled()) @@ -1406,11 +1312,6 @@ void SwColumnPage::SetInSection(sal_Bool bSet) } } -/*-----------------07.03.97 08.33------------------- - ---------------------------------------------------*/ - - void ColumnValueSet::UserDraw( const UserDrawEvent& rUDEvt ) { OutputDevice* pDev = rUDEvt.GetDevice(); @@ -1476,16 +1377,10 @@ void ColumnValueSet::UserDraw( const UserDrawEvent& rUDEvt ) pDev->SetLineColor(aLineColor); } -/*-----------------07.03.97 08.48------------------- - ---------------------------------------------------*/ - ColumnValueSet::~ColumnValueSet() { } -/* -----------------------------02.04.2002 16:01------------------------------ - ---------------------------------------------------------------------------*/ void ColumnValueSet::DataChanged( const DataChangedEvent& rDCEvt ) { if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && @@ -1496,3 +1391,4 @@ void ColumnValueSet::DataChanged( const DataChangedEvent& rDCEvt ) ValueSet::DataChanged( rDCEvt ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx index e08a7ae0c6..5450908cea 100644 --- a/sw/source/ui/frmdlg/cption.cxx +++ b/sw/source/ui/frmdlg/cption.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,9 +34,7 @@ -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> #include <cption.hxx> #include <fldmgr.hxx> @@ -61,12 +60,8 @@ #include <com/sun/star/text/XTextFramesSupplier.hpp> #include <com/sun/star/text/XTextFrame.hpp> -#ifndef _FRMUI_HRC #include <frmui.hrc> -#endif -#ifndef _CPTION_HRC #include <cption.hrc> -#endif #include <SwStyleNameMapper.hxx> using namespace ::com::sun::star; @@ -346,8 +341,6 @@ IMPL_LINK_INLINE_START( SwCaptionDialog, SelectHdl, ListBox *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwCaptionDialog, SelectHdl, ListBox *, EMPTYARG ) - - IMPL_LINK( SwCaptionDialog, ModifyHdl, Edit *, EMPTYARG ) { SwWrtShell &rSh = rView.GetWrtShell(); @@ -426,7 +419,6 @@ void SwCaptionDialog::DrawSample() case SVX_NUM_CHARS_LOWER_LETTER_N: aStr += 'a'; break; case SVX_NUM_ROMAN_UPPER: aStr += 'I'; break; case SVX_NUM_ROMAN_LOWER: aStr += 'i'; break; - //case ARABIC: default: aStr += '1'; break; } //#i61007# order of captions @@ -438,7 +430,7 @@ void SwCaptionDialog::DrawSample() } if( sCaption.Len() > 0 ) - { + { aStr += aSepEdit.GetText(); } } @@ -466,7 +458,7 @@ void SwCaptionDialog::CheckButtonWidth() &aOKButton, &aCancelButton, &aHelpButton, &aAutoCaptionButton, &aOptionButton }; Button** pCurrent = pBtns; - for ( sal_uInt32 i = 0; i < sizeof( pBtns ) / sizeof( pBtns[ 0 ] ); ++i, ++pCurrent ) + for ( sal_uInt32 i = 0; i < SAL_N_ELEMENTS(pBtns); ++i, ++pCurrent ) { aNewSize = (*pCurrent)->GetSizePixel(); aNewSize.Width() += nDelta; @@ -483,8 +475,6 @@ SwCaptionDialog::~SwCaptionDialog() { delete pMgr; } -/* */ - SwSequenceOptionDialog::SwSequenceOptionDialog( Window *pParent, SwView &rV, const String& rSeqFldType ) @@ -566,9 +556,6 @@ void SwSequenceOptionDialog::Apply() rSh.UpdateExpFlds(); } -/*-- 24.08.2004 16:13:53--------------------------------------------------- - - -----------------------------------------------------------------------*/ String SwSequenceOptionDialog::GetCharacterStyle() const { String sRet; @@ -577,9 +564,6 @@ String SwSequenceOptionDialog::GetCharacterStyle() const return sRet; } -/*-- 24.08.2004 16:14:00--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwSequenceOptionDialog::SetCharacterStyle(const String& rStyle) { aLbCharStyle.SelectEntryPos(0); @@ -613,6 +597,7 @@ long SwCaptionDialog::CategoryBox::PreNotify( NotifyEvent& rNEvt ) nHandled = ComboBox::PreNotify( rNEvt ); return nHandled; } + /*-- 01.11.2007 10:45:51--------------------------------------------------- //#i61007# order of captions -----------------------------------------------------------------------*/ @@ -622,6 +607,7 @@ void lcl_MoveH( Window& rWin, sal_Int32 nMove ) aPos.Y() += nMove; rWin.SetPosPixel(aPos); } + void SwCaptionDialog::ApplyCaptionOrder() { //have the settings changed? @@ -650,3 +636,5 @@ void SwCaptionDialog::ApplyCaptionOrder() SetSizePixel( aDlgSize ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/frmdlg/cption.src b/sw/source/ui/frmdlg/cption.src index 30be09080a..0a3876c421 100644 --- a/sw/source/ui/frmdlg/cption.src +++ b/sw/source/ui/frmdlg/cption.src @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - // #include ***************************************************************** + #include "helpid.h" #include "frmui.hrc" #include "cption.hrc" diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx index f9f64d131c..230dcf9baf 100644 --- a/sw/source/ui/frmdlg/frmdlg.cxx +++ b/sw/source/ui/frmdlg/frmdlg.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -34,14 +35,11 @@ #include <svx/dialogs.hrc> #include <hintids.hxx> -#include <tools/list.hxx> #include <sfx2/viewfrm.hxx> #include <svx/htmlmode.hxx> #include <fmtfsize.hxx> #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <docsh.hxx> #include <viewopt.hxx> #include <frmdlg.hxx> @@ -50,12 +48,8 @@ #include <column.hxx> #include <macassgn.hxx> -#ifndef _FRMUI_HRC #include <frmui.hrc> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <svx/svxids.hrc> #include <svx/flagsdef.hxx> #include <svx/svxdlg.hxx> @@ -63,7 +57,6 @@ /*-------------------------------------------------------------------- Beschreibung: Der Traeger des Dialoges --------------------------------------------------------------------*/ - SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame, Window* pParent, const SfxItemSet& rCoreSet, @@ -108,7 +101,7 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame, AddTabPage(TP_COLUMN, SwColumnPage::Create, 0); } SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 ); AddTabPage( TP_MACRO_ASSIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_MACROASSIGN), 0); AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 0 ); @@ -142,17 +135,10 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame, SetCurPageId(nDefPage); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwFrmDlg::~SwFrmDlg() { } - - - void SwFrmDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); @@ -191,7 +177,7 @@ void SwFrmDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) case TP_MACRO_ASSIGN: { SfxAllItemSet aNewSet(*aSet.GetPool()); - aNewSet.Put( SwMacroAssignDlg::AddEvents( + aNewSet.Put( SwMacroAssignDlg::AddEvents( DLG_FRM_GRF == m_nDlgType ? MACASSGN_GRAPHIC : DLG_FRM_OLE == m_nDlgType ? MACASSGN_OLE : MACASSGN_FRMURL ) ); if ( m_pWrtShell ) rPage.SetFrame( m_pWrtShell->GetView().GetViewFrame()->GetFrame().GetFrameInterface() ); @@ -219,3 +205,4 @@ void SwFrmDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx index 6070a5a25e..d2c3a41a1c 100644 --- a/sw/source/ui/frmdlg/frmmgr.cxx +++ b/sw/source/ui/frmdlg/frmmgr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,9 +55,8 @@ #include <com/sun/star/text/RelOrientation.hpp> using namespace ::com::sun::star; -//using namespace text; -static sal_uInt16 __FAR_DATA aFrmMgrRange[] = { +static sal_uInt16 aFrmMgrRange[] = { RES_FRMATR_BEGIN, RES_FRMATR_END-1, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, FN_SET_FRM_NAME, FN_SET_FRM_NAME, @@ -65,7 +65,6 @@ static sal_uInt16 __FAR_DATA aFrmMgrRange[] = { /*-------------------------------------------------------------------- Beschreibung: Rahmen-Attribute ueber Shell ermitteln --------------------------------------------------------------------*/ - SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, sal_uInt8 nType ) : aSet( (SwAttrPool&)pSh->GetAttrPool(), aFrmMgrRange ), pOwnSh( pSh ), @@ -113,11 +112,9 @@ SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, const SfxItemS } } - /*-------------------------------------------------------------------- Beschreibung: Initialisieren --------------------------------------------------------------------*/ - void SwFlyFrmAttrMgr::UpdateAttrMgr() { if ( !bNewFrm && pOwnSh->IsFrmSelected() ) @@ -144,11 +141,10 @@ void SwFlyFrmAttrMgr::_UpdateFlyFrm() /*-------------------------------------------------------------------- Beschreibung: Bestehenden Fly-Frame aendern --------------------------------------------------------------------*/ - void SwFlyFrmAttrMgr::UpdateFlyFrm() { - ASSERT( pOwnSh->IsFrmSelected(), - "Kein Rahmen selektiert oder keine Shell, Update nicht moeglich"); + OSL_ENSURE( pOwnSh->IsFrmSelected(), + "no frame selected or no shell, update not possible"); if( pOwnSh->IsFrmSelected() ) { @@ -178,7 +174,6 @@ void SwFlyFrmAttrMgr::UpdateFlyFrm() /*-------------------------------------------------------------------- Beschreibung: Rahmen einfuegen --------------------------------------------------------------------*/ - sal_Bool SwFlyFrmAttrMgr::InsertFlyFrm() { pOwnSh->StartAllAction(); @@ -202,13 +197,12 @@ sal_Bool SwFlyFrmAttrMgr::InsertFlyFrm() Nicht erlaubte Werte des Aufzaehlungstypes werden korrigiert. ------------------------------------------------------------------------*/ - void SwFlyFrmAttrMgr::InsertFlyFrm(RndStdIds eAnchorType, const Point &rPos, const Size &rSize, sal_Bool bAbs ) { - ASSERT( eAnchorType == FLY_AT_PAGE || + OSL_ENSURE( eAnchorType == FLY_AT_PAGE || eAnchorType == FLY_AT_PARA || eAnchorType == FLY_AT_CHAR || eAnchorType == FLY_AT_FLY || @@ -227,7 +221,6 @@ void SwFlyFrmAttrMgr::InsertFlyFrm(RndStdIds eAnchorType, /*-------------------------------------------------------------------- Beschreibung: Anker setzen --------------------------------------------------------------------*/ - void SwFlyFrmAttrMgr::SetAnchor( RndStdIds eId ) { sal_uInt16 nPhyPageNum, nVirtPageNum; @@ -249,15 +242,14 @@ void SwFlyFrmAttrMgr::SetAnchor( RndStdIds eId ) /*------------------------------------------------------------------------ Beschreibung: Setzen des Attributs fuer Spalten ------------------------------------------------------------------------*/ - void SwFlyFrmAttrMgr::SetCol( const SwFmtCol &rCol ) { aSet.Put( rCol ); } + /*-------------------------------------------------------------------- Beschreibung: Absolute Position setzen --------------------------------------------------------------------*/ - void SwFlyFrmAttrMgr::SetAbsPos( const Point& rPoint ) { bAbsPos = sal_True; @@ -517,7 +509,6 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, /*-------------------------------------------------------------------- Beschreibung: Korrektur fuer Umrandung --------------------------------------------------------------------*/ - SwTwips SwFlyFrmAttrMgr::CalcTopSpace() { const SvxShadowItem& rShadow = GetShadow(); @@ -546,7 +537,6 @@ SwTwips SwFlyFrmAttrMgr::CalcRightSpace() return rShadow.CalcShadowSpace(SHADOW_RIGHT) + rBox.CalcLineSpace(BOX_LINE_RIGHT); } - /*-------------------------------------------------------------------- Beschreibung: Attribut aus dem Set loeschen --------------------------------------------------------------------*/ @@ -557,7 +547,7 @@ void SwFlyFrmAttrMgr::DelAttr( sal_uInt16 nId ) void SwFlyFrmAttrMgr::SetLRSpace( long nLeft, long nRight ) { - ASSERT( LONG_MAX != nLeft && LONG_MAX != nRight, "Welchen Raend setzen?" ); + OSL_ENSURE( LONG_MAX != nLeft && LONG_MAX != nRight, "Welchen Raend setzen?" ); SvxLRSpaceItem aTmp( (SvxLRSpaceItem&)aSet.Get( RES_LR_SPACE ) ); if( LONG_MAX != nLeft ) @@ -569,7 +559,7 @@ void SwFlyFrmAttrMgr::SetLRSpace( long nLeft, long nRight ) void SwFlyFrmAttrMgr::SetULSpace( long nTop, long nBottom ) { - ASSERT(LONG_MAX != nTop && LONG_MAX != nBottom, "Welchen Raend setzen?" ); + OSL_ENSURE(LONG_MAX != nTop && LONG_MAX != nBottom, "Welchen Raend setzen?" ); SvxULSpaceItem aTmp( (SvxULSpaceItem&)aSet.Get( RES_UL_SPACE ) ); if( LONG_MAX != nTop ) @@ -627,3 +617,5 @@ void SwFlyFrmAttrMgr::SetAttrSet(const SfxItemSet& rSet) aSet.ClearItem(); aSet.Put( rSet ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 398788df79..eab008feed 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -70,7 +71,6 @@ #include <colmgr.hxx> #include <grfatr.hxx> #include <uiitems.hxx> -// OD 19.09.2003 #i18732# #include <fmtfollowtextflow.hxx> #include <frmui.hrc> @@ -113,7 +113,6 @@ struct StringIdPair_Impl #define MAX_PERCENT_WIDTH 254L #define MAX_PERCENT_HEIGHT 254L -// OD 19.09.2003 #i18732# - change order of alignments #define LB_FRAME 0x00000001L // Textbereich des Absatzes #define LB_PRTAREA 0x00000002L // Textbereich des Absatzes + Einzuege #define LB_VERT_FRAME 0x00000004L // Vertikaler Textbereich des Absatzes @@ -135,14 +134,12 @@ struct StringIdPair_Impl #define LB_REL_CHAR 0x00020000L // Zeichenausrichtung Zeichen #define LB_REL_ROW 0x00040000L // Zeichenausrichtung Zeile -// OD 10.11.2003 #i22305# #define LB_FLY_VERT_FRAME 0x00100000L // vertical entire frame #define LB_FLY_VERT_PRTAREA 0x00200000L // vertical frame text area -// OD 11.11.2003 #i22341# #define LB_VERT_LINE 0x00400000L // vertical text line -static RelationMap __FAR_DATA aRelationMap[] = +static RelationMap aRelationMap[] = { {SwFPos::FRAME, SwFPos::FRAME, LB_FRAME, text::RelOrientation::FRAME}, {SwFPos::PRTAREA, SwFPos::PRTAREA, LB_PRTAREA, text::RelOrientation::PRINT_AREA}, @@ -162,15 +159,13 @@ static RelationMap __FAR_DATA aRelationMap[] = {SwFPos::REL_BORDER, SwFPos::REL_BORDER, LB_VERT_FRAME, text::RelOrientation::FRAME}, {SwFPos::REL_PRTAREA, SwFPos::REL_PRTAREA, LB_VERT_PRTAREA, text::RelOrientation::PRINT_AREA}, - // OD 10.11.2003 #i22305# {SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB_FLY_VERT_FRAME, text::RelOrientation::FRAME}, {SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB_FLY_VERT_PRTAREA, text::RelOrientation::PRINT_AREA}, - // OD 11.11.2003 #i22341# {SwFPos::REL_LINE, SwFPos::REL_LINE, LB_VERT_LINE, text::RelOrientation::TEXT_LINE} }; -static RelationMap __FAR_DATA aAsCharRelationMap[] = +static RelationMap aAsCharRelationMap[] = { {SwFPos::REL_BASE, SwFPos::REL_BASE, LB_REL_BASE, text::RelOrientation::FRAME}, {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB_REL_CHAR, text::RelOrientation::FRAME}, @@ -180,11 +175,10 @@ static RelationMap __FAR_DATA aAsCharRelationMap[] = /*-------------------------------------------------------------------- Beschreibung: Seite verankert --------------------------------------------------------------------*/ - #define HORI_PAGE_REL (LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_PG_LEFT| \ LB_REL_PG_RIGHT) -static FrmMap __FAR_DATA aHPageMap[] = +static FrmMap aHPageMap[] = { {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HORI_PAGE_REL}, {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HORI_PAGE_REL}, @@ -192,14 +186,14 @@ static FrmMap __FAR_DATA aHPageMap[] = {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, HORI_PAGE_REL} }; -static FrmMap __FAR_DATA aHPageHtmlMap[] = +static FrmMap aHPageHtmlMap[] = { {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB_REL_PG_FRAME} }; #define VERT_PAGE_REL (LB_REL_PG_FRAME|LB_REL_PG_PRTAREA) -static FrmMap __FAR_DATA aVPageMap[] = +static FrmMap aVPageMap[] = { {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, VERT_PAGE_REL}, {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, VERT_PAGE_REL}, @@ -207,7 +201,7 @@ static FrmMap __FAR_DATA aVPageMap[] = {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, VERT_PAGE_REL} }; -static FrmMap __FAR_DATA aVPageHtmlMap[] = +static FrmMap aVPageHtmlMap[] = { {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, LB_REL_PG_FRAME} }; @@ -215,11 +209,10 @@ static FrmMap __FAR_DATA aVPageHtmlMap[] = /*-------------------------------------------------------------------- Beschreibung: Rahmen verankert --------------------------------------------------------------------*/ - #define HORI_FRAME_REL (LB_FLY_REL_PG_FRAME|LB_FLY_REL_PG_PRTAREA| \ LB_FLY_REL_PG_LEFT|LB_FLY_REL_PG_RIGHT) -static FrmMap __FAR_DATA aHFrameMap[] = +static FrmMap aHFrameMap[] = { {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HORI_FRAME_REL}, {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HORI_FRAME_REL}, @@ -227,17 +220,16 @@ static FrmMap __FAR_DATA aHFrameMap[] = {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, HORI_FRAME_REL} }; -static FrmMap __FAR_DATA aHFlyHtmlMap[] = +static FrmMap aHFlyHtmlMap[] = { {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, LB_FLY_REL_PG_FRAME}, {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB_FLY_REL_PG_FRAME} }; -// OD 19.09.2003 #i18732# - own vertical alignment map for to frame anchored objects -// OD 10.11.2003 #i22305# +// own vertical alignment map for to frame anchored objects #define VERT_FRAME_REL (LB_FLY_VERT_FRAME|LB_FLY_VERT_PRTAREA) -static FrmMap __FAR_DATA aVFrameMap[] = +static FrmMap aVFrameMap[] = { {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, VERT_FRAME_REL}, {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, VERT_FRAME_REL}, @@ -245,9 +237,8 @@ static FrmMap __FAR_DATA aVFrameMap[] = {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, VERT_FRAME_REL} }; -static FrmMap __FAR_DATA aVFlyHtmlMap[] = +static FrmMap aVFlyHtmlMap[] = { - // OD 10.11.2003 #i22305# {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_FLY_VERT_FRAME}, {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, LB_FLY_VERT_FRAME} }; @@ -255,12 +246,11 @@ static FrmMap __FAR_DATA aVFlyHtmlMap[] = /*-------------------------------------------------------------------- Beschreibung: Absatz verankert --------------------------------------------------------------------*/ - #define HORI_PARA_REL (LB_FRAME|LB_PRTAREA|LB_REL_PG_LEFT|LB_REL_PG_RIGHT| \ LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_FRM_LEFT| \ LB_REL_FRM_RIGHT) -static FrmMap __FAR_DATA aHParaMap[] = +static FrmMap aHParaMap[] = { {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HORI_PARA_REL}, {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HORI_PARA_REL}, @@ -270,23 +260,23 @@ static FrmMap __FAR_DATA aHParaMap[] = #define HTML_HORI_PARA_REL (LB_FRAME|LB_PRTAREA) -static FrmMap __FAR_DATA aHParaHtmlMap[] = +static FrmMap aHParaHtmlMap[] = { {SwFPos::LEFT, SwFPos::LEFT, text::HoriOrientation::LEFT, HTML_HORI_PARA_REL}, {SwFPos::RIGHT, SwFPos::RIGHT, text::HoriOrientation::RIGHT, HTML_HORI_PARA_REL} }; -static FrmMap __FAR_DATA aHParaHtmlAbsMap[] = +static FrmMap aHParaHtmlAbsMap[] = { {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HTML_HORI_PARA_REL}, {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HTML_HORI_PARA_REL} }; -// OD 19.09.2003 #i18732# - allow vertical alignment at page areas +// allow vertical alignment at page areas #define VERT_PARA_REL (LB_VERT_FRAME|LB_VERT_PRTAREA| \ LB_REL_PG_FRAME|LB_REL_PG_PRTAREA) -static FrmMap __FAR_DATA aVParaMap[] = +static FrmMap aVParaMap[] = { {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, VERT_PARA_REL}, {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, VERT_PARA_REL}, @@ -294,7 +284,7 @@ static FrmMap __FAR_DATA aVParaMap[] = {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, VERT_PARA_REL} }; -static FrmMap __FAR_DATA aVParaHtmlMap[] = +static FrmMap aVParaHtmlMap[] = { {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_VERT_PRTAREA} }; @@ -302,12 +292,11 @@ static FrmMap __FAR_DATA aVParaHtmlMap[] = /*-------------------------------------------------------------------- Beschreibung: Relativ zum Zeichen verankert --------------------------------------------------------------------*/ - #define HORI_CHAR_REL (LB_FRAME|LB_PRTAREA|LB_REL_PG_LEFT|LB_REL_PG_RIGHT| \ LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_FRM_LEFT| \ LB_REL_FRM_RIGHT|LB_REL_CHAR) -static FrmMap __FAR_DATA aHCharMap[] = +static FrmMap aHCharMap[] = { {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, HORI_CHAR_REL}, {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, HORI_CHAR_REL}, @@ -317,27 +306,25 @@ static FrmMap __FAR_DATA aHCharMap[] = #define HTML_HORI_CHAR_REL (LB_FRAME|LB_PRTAREA|LB_REL_CHAR) -static FrmMap __FAR_DATA aHCharHtmlMap[] = +static FrmMap aHCharHtmlMap[] = { {SwFPos::LEFT, SwFPos::LEFT, text::HoriOrientation::LEFT, HTML_HORI_CHAR_REL}, {SwFPos::RIGHT, SwFPos::RIGHT, text::HoriOrientation::RIGHT, HTML_HORI_CHAR_REL} }; -static FrmMap __FAR_DATA aHCharHtmlAbsMap[] = +static FrmMap aHCharHtmlAbsMap[] = { {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, LB_PRTAREA|LB_REL_CHAR}, {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, LB_PRTAREA}, {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB_REL_PG_FRAME} }; -// OD 19.09.2003 #i18732# - allow vertical alignment at page areas -// OD 12.11.2003 #i22341# - handle <LB_REL_CHAR> on its own +// allow vertical alignment at page areas #define VERT_CHAR_REL (LB_VERT_FRAME|LB_VERT_PRTAREA| \ LB_REL_PG_FRAME|LB_REL_PG_PRTAREA) -static FrmMap __FAR_DATA aVCharMap[] = +static FrmMap aVCharMap[] = { - // OD 11.11.2003 #i22341# // introduce mappings for new vertical alignment at top of line <LB_VERT_LINE> // and correct mapping for vertical alignment at character for position <FROM_BOTTOM> // Note: Because of these adjustments the map becomes ambigous in its values @@ -355,22 +342,21 @@ static FrmMap __FAR_DATA aVCharMap[] = {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::LINE_CENTER, LB_VERT_LINE} }; - -static FrmMap __FAR_DATA aVCharHtmlMap[] = +static FrmMap aVCharHtmlMap[] = { {SwFPos::BELOW, SwFPos::BELOW, text::VertOrientation::CHAR_BOTTOM, LB_REL_CHAR} }; -static FrmMap __FAR_DATA aVCharHtmlAbsMap[] = +static FrmMap aVCharHtmlAbsMap[] = { {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_REL_CHAR}, {SwFPos::BELOW, SwFPos::BELOW, text::VertOrientation::CHAR_BOTTOM, LB_REL_CHAR} }; + /*-------------------------------------------------------------------- Beschreibung: Als Zeichen verankert --------------------------------------------------------------------*/ - -static FrmMap __FAR_DATA aVAsCharMap[] = +static FrmMap aVAsCharMap[] = { {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_REL_BASE}, {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, LB_REL_BASE}, @@ -387,7 +373,7 @@ static FrmMap __FAR_DATA aVAsCharMap[] = {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, text::VertOrientation::NONE, LB_REL_BASE} }; -static FrmMap __FAR_DATA aVAsCharHtmlMap[] = +static FrmMap aVAsCharHtmlMap[] = { {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_REL_BASE}, {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, LB_REL_BASE}, @@ -399,14 +385,14 @@ static FrmMap __FAR_DATA aVAsCharHtmlMap[] = {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::LINE_CENTER, LB_REL_ROW} }; -static sal_uInt16 __FAR_DATA aPageRg[] = { +static sal_uInt16 aPageRg[] = { RES_FRM_SIZE, RES_FRM_SIZE, RES_VERT_ORIENT, RES_ANCHOR, RES_COL, RES_COL, RES_FOLLOW_TEXT_FLOW, RES_FOLLOW_TEXT_FLOW, 0 }; -static sal_uInt16 __FAR_DATA aAddPgRg[] = { +static sal_uInt16 aAddPgRg[] = { RES_PROTECT, RES_PROTECT, RES_PRINT, RES_PRINT, FN_SET_FRM_NAME, FN_SET_FRM_NAME, @@ -414,10 +400,6 @@ static sal_uInt16 __FAR_DATA aAddPgRg[] = { 0 }; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - size_t lcl_GetFrmMapCount( const FrmMap* pMap) { if ( pMap ) @@ -443,7 +425,6 @@ size_t lcl_GetFrmMapCount( const FrmMap* pMap) return sizeof(aHParaMap) / aSizeOf; if ( pMap == aHFrameMap ) return sizeof(aHFrameMap) / aSizeOf; - // OD 19.09.2003 #i18732# - own vertical alignment map for to frame anchored objects if ( pMap == aVFrameMap ) return sizeof(aVFrameMap) / aSizeOf; if ( pMap == aHCharMap ) @@ -468,9 +449,7 @@ size_t lcl_GetFrmMapCount( const FrmMap* pMap) } return 0; } -/* -----------------------------08.08.2002 14:45------------------------------ - ---------------------------------------------------------------------------*/ void lcl_InsertVectors(ListBox& rBox, const ::std::vector< String >& rPrev, const ::std::vector< String >& rThis, const ::std::vector< String >& rNext, const ::std::vector< String >& rRemain) @@ -497,9 +476,6 @@ void lcl_InsertVectors(ListBox& rBox, ::InsertStringSorted(*aIt, rBox, nStartPos ); } -/* -----------------------------20.08.2002 16:12------------------------------ - - ---------------------------------------------------------------------------*/ // --> OD 2009-08-31 #mongolianlayout# // add input parameter SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString::StringId eStringId, sal_Bool bVertical, sal_Bool bVerticalL2R, sal_Bool bRTL) @@ -598,7 +574,7 @@ SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString return eStringId; } -// OD 12.11.2003 #i22341# - helper method in order to determine all possible +// helper method in order to determine all possible // listbox relations in a relation map for a given relation sal_uLong lcl_GetLBRelationsForRelations( const sal_uInt16 _nRel ) { @@ -616,7 +592,7 @@ sal_uLong lcl_GetLBRelationsForRelations( const sal_uInt16 _nRel ) return nLBRelations; } -// OD 14.11.2003 #i22341# - helper method on order to determine all possible +// helper method on order to determine all possible // listbox relations in a relation map for a given string ID sal_uLong lcl_GetLBRelationsForStrID( const FrmMap* _pMap, const SvxSwFramePosString::StringId _eStrId, @@ -640,7 +616,6 @@ sal_uLong lcl_GetLBRelationsForStrID( const FrmMap* _pMap, /*-------------------------------------------------------------------- Beschreibung: StandardRahmenTabPage --------------------------------------------------------------------*/ - namespace { void HandleAutoCB( sal_Bool _bChecked, FixedText& _rFT_man, FixedText& _rFT_auto ) @@ -650,7 +625,6 @@ namespace } } - SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) : SfxTabPage (pParent, SW_RES(TP_FRM_STD), rSet), @@ -690,7 +664,6 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) : aAtVertPosED (this, SW_RES(ED_AT_VERT_POS)), aVertRelationFT (this, SW_RES(FT_VERT_RELATION)), aVertRelationLB (this, SW_RES(LB_VERT_RELATION)), - // OD 19.09.2003 #i18732# - new checkbox aFollowTextFlowCB(this, SW_RES(CB_FOLLOWTEXTFLOW)), aExampleWN (this, SW_RES(WN_BSP)), @@ -701,12 +674,10 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) : bNew(sal_True), bNoModifyHdl(sal_True), // --> OD 2009-08-31 #mongolianlayout# - no used -// bVerticalChanged(FALSE), +// bVerticalChanged(sal_False), // <-- bIsVerticalFrame(sal_False), - // --> OD 2009-08-31 #mongolianlayou# bIsVerticalL2R(sal_False), - // <-- bIsInRightToLeft(sal_False), bHtmlMode(sal_False), nHtmlMode(0), @@ -714,7 +685,6 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) : nUpperBorder(0), nLowerBorder(0), fWidthHeightRatio(1.0), - // OD 12.11.2003 #i22341# mpToCharCntntPos( NULL ), nOldH(text::HoriOrientation::CENTER), @@ -737,7 +707,6 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) : aHeightED. SetLoseFocusHdl( aLk ); aAtHorzPosED.SetLoseFocusHdl( aLk ); aAtVertPosED.SetLoseFocusHdl( aLk ); - // OD 25.09.2003 #i18732# - click handler for new checkbox aFollowTextFlowCB.SetClickHdl( aLk ); aLk = LINK(this, SwFrmPage, ModifyHdl); @@ -772,7 +741,6 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) : /*-------------------------------------------------------------------- Beschreibung: Dtor --------------------------------------------------------------------*/ - SwFrmPage::~SwFrmPage() { } @@ -794,7 +762,7 @@ namespace void SwFrmPage::EnableGraficMode( void ) { - // #i39692# mustn't be called more than once + // i#39692 - mustn't be called more than once if(!aRealSizeBT.IsVisible()) { long nOffset1 = aRelWidthCB.GetPosPixel().Y() - aAutoWidthCB.GetPosPixel().Y(); @@ -833,7 +801,6 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) SetMetric( aAtVertPosED, aMetric ); const SfxPoolItem* pItem = NULL; - const SwFmtAnchor& rAnchor = (const SwFmtAnchor&)rSet.Get(RES_ANCHOR); if (SFX_ITEM_SET == rSet.GetItemState(FN_OLE_IS_MATH, sal_False, &pItem)) @@ -872,7 +839,7 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) if ( nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE ) { - ASSERT(pSh , "shell not found"); + OSL_ENSURE(pSh , "shell not found"); //OS: nur fuer die Variante Einfuegen/Grafik/Eigenschaften if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_GRF_REALSIZE, sal_False, &pItem)) aGrfSize = ((const SvxSizeItem*)pItem)->GetSize(); @@ -884,8 +851,6 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) aRealSizeBT.SetClickHdl(LINK(this, SwFrmPage, RealSizeHdl)); EnableGraficMode(); } -// else -// aTypeFL.SetSizePixel(Size(aTypeFL.GetSizePixel().Width(), aSizeFL.GetSizePixel().Height())); if ( nDlgType == DLG_FRM_GRF ) aFixedRatioCB.Check( sal_False ); @@ -899,11 +864,10 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) } else { -// aTypeFL.SetSizePixel(Size(aTypeFL.GetSizePixel().Width(), aSizeFL.GetSizePixel().Height())); aGrfSize = ((const SwFmtFrmSize&)rSet.Get(RES_FRM_SIZE)).GetSize(); } - //Prozenteingabe ermoeglichen. + // entering procent value made possible aWidthED. SetBaseValue( aWidthED.Normalize(aGrfSize.Width()), FUNIT_TWIP ); aHeightED.SetBaseValue( aHeightED.Normalize(aGrfSize.Height()), FUNIT_TWIP ); //the available space is not yet known so the RefValue has to be calculated from size and relative size values @@ -936,11 +900,11 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) default:; //prevent warning } - // OD 12.11.2003 #i22341# - determine content position of character + // i#22341 - determine content position of character // Note: content position can be NULL mpToCharCntntPos = rAnchor.GetCntntAnchor(); - // OD 19.09.2003 #i18732# - init checkbox value + // i#18732 - init checkbox value { const bool bFollowTextFlow = static_cast<const SwFmtFollowTextFlow&>(rSet.Get(RES_FOLLOW_TEXT_FLOW)).GetValue(); @@ -969,16 +933,16 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) aMirrorPagesCB.Show(sal_False); if(nDlgType == DLG_FRM_STD) aFixedRatioCB.Enable(sal_False); - // OD 19.09.2003 #i18732# - hide checkbox in HTML mode + // i#18732 hide checkbox in HTML mode aFollowTextFlowCB.Show(sal_False); } else { - // OD 06.11.2003 #i18732# correct enable/disable of check box 'Mirror on..' + // enable/disable of check box 'Mirror on..' aMirrorPagesCB.Enable(!aAnchorAsCharRB.IsChecked()); - // OD 06.11.2003 #i18732# - enable/disable check box 'Follow text flow'. - // OD 10.11.2003 #i22305# - enable check box 'Follow text + // enable/disable check box 'Follow text flow'. + // enable check box 'Follow text // flow' also for anchor type to-frame. aFollowTextFlowCB.Enable( aAnchorAtParaRB.IsChecked() || aAnchorAtCharRB.IsChecked() || @@ -988,7 +952,6 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) Init( rSet, sal_True ); aAtVertPosED.SaveValue(); aAtHorzPosED.SaveValue(); - // OD 19.09.2003 #i18732# aFollowTextFlowCB.SaveValue(); bNoModifyHdl = sal_False; @@ -1007,17 +970,15 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0; } - /*-------------------------------------------------------------------- Beschreibung: Attribute in den Set stopfen bei OK --------------------------------------------------------------------*/ - sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet) { sal_Bool bRet = sal_False; SwWrtShell* pSh = bFormat ? ::GetActiveWrtShell() : ((SwFrmDlg*)GetParent()->GetParent())->GetWrtShell(); - ASSERT( pSh , "shell not found"); + OSL_ENSURE( pSh , "shell not found"); const SfxItemSet& rOldSet = GetItemSet(); const SfxPoolItem* pOldItem = 0; @@ -1126,12 +1087,6 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet) const SwFmtFrmSize& rOldSize = (const SwFmtFrmSize& )rOldSet.Get(RES_FRM_SIZE); SwFmtFrmSize aSz( rOldSize ); -/* // Folgende Zeilen nur zum debuggen: - sal_Bool bModified = aWidthED.IsValueModified(); - sal_uInt16 nOldWidth = rOldSize.GetWidth (); - sal_uInt16 nWidth = aWidthED .GetValue(); - sal_uInt16 nMinWidth = aWidthED .GetMin();*/ - sal_Bool bValueModified = (aWidthED.IsValueModified() || aHeightED.IsValueModified()); sal_Bool bCheckChanged = (aRelWidthCB.GetSavedValue() != aRelWidthCB.IsChecked() || aRelHeightCB.GetSavedValue() != aRelHeightCB.IsChecked()); @@ -1192,11 +1147,10 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet) (aSz.GetHeight() > 0 || aSz.GetHeightPercent() > 0))) { if (aSz.GetHeightSizeType() == ATT_VAR_SIZE) // VAR_SIZE gibts nicht bei Rahmen - aSz.SetHeightSizeType(ATT_MIN_SIZE); // Bug #45776 (Vorlagen ohne Breite/Hoehe) + aSz.SetHeightSizeType(ATT_MIN_SIZE); bRet |= 0 != rSet.Put( aSz ); } - // OD 19.09.2003 #i18732# if(aFollowTextFlowCB.IsChecked() != aFollowTextFlowCB.GetSavedValue()) { bRet |= 0 != rSet.Put(SwFmtFollowTextFlow(aFollowTextFlowCB.IsChecked())); @@ -1207,7 +1161,6 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet) /*-------------------------------------------------------------------- Beschreibung: Horizontale und vertikale Pos initialisieren --------------------------------------------------------------------*/ - void SwFrmPage::InitPos(RndStdIds eId, sal_uInt16 nH, sal_uInt16 nHRel, @@ -1244,7 +1197,7 @@ void SwFrmPage::InitPos(RndStdIds eId, } else if ( eId == FLY_AT_FLY ) { - // OD 19.09.2003 #i18732# - own vertical alignment map for to frame + // own vertical alignment map for to frame // anchored objects. pVMap = bHtmlMode ? aVFlyHtmlMap : aVFrameMap; pHMap = bHtmlMode ? aHFlyHtmlMap : aHFrameMap; @@ -1291,7 +1244,6 @@ void SwFrmPage::InitPos(RndStdIds eId, nH = nOldH; nHRel = nOldHRel; } - // OD 12.11.2003 #i22341# - pass <nHRel> as 3rd parameter to method <FillPosLB> sal_uInt16 nMapPos = FillPosLB(pHMap, nH, nHRel, aHorizontalDLB); FillRelLB(pHMap, nMapPos, nH, nHRel, aHoriRelationLB, aHoriRelationFT); @@ -1301,11 +1253,9 @@ void SwFrmPage::InitPos(RndStdIds eId, nV = nOldV; nVRel = nOldVRel; } - // OD 12.11.2003 #i22341# - pass <nVRel> as 3rd parameter to method <FillPosLB> nMapPos = FillPosLB(pVMap, nV, nVRel, aVerticalDLB); FillRelLB(pVMap, nMapPos, nV, nVRel, aVertRelationLB, aVertRelationFT); - // Edits init bEnable = nH == text::HoriOrientation::NONE && eId != FLY_AS_CHAR; if (!bEnable) { @@ -1345,10 +1295,6 @@ void SwFrmPage::InitPos(RndStdIds eId, UpdateExample(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap, const sal_uInt16 _nAlign, const sal_uInt16 _nRel, @@ -1359,7 +1305,7 @@ sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap, _rLB.Clear(); - // OD 12.11.2003 #i22341# - determine all possible listbox relations for + // i#22341 determine all possible listbox relations for // given relation for map <aVCharMap> const sal_uLong nLBRelations = (_pMap != aVCharMap) ? 0L @@ -1369,8 +1315,7 @@ sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap, size_t nCount = ::lcl_GetFrmMapCount(_pMap); for (size_t i = 0; _pMap && i < nCount; ++i) { -// #61359# Warum nicht von links/von innen bzw. von oben? -// if (!bFormat || (pMap[i].eStrId != SwFPos::FROMLEFT && pMap[i].eStrId != SwFPos::FROMTOP)) +// Warum nicht von links/von innen bzw. von oben? { SvxSwFramePosString::StringId eStrId = aMirrorPagesCB.IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId; // --> OD 2009-08-31 #mongolianlayout# @@ -1385,7 +1330,7 @@ sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap, // bei zeichengebundenen Rahmen keine doppelten Eintraege einfuegen _rLB.InsertEntry(sEntry); } - // OD 12.11.2003 #i22341# - add condition to handle map <aVCharMap> + // i#22341 - add condition to handle map <aVCharMap> // that is ambigous in the alignment. if ( _pMap[i].nAlign == _nAlign && ( !(_pMap == aVCharMap) || _pMap[i].nLBRelations & nLBRelations ) ) @@ -1407,9 +1352,6 @@ sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap, return GetMapPos(_pMap, _rLB); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap, const sal_uInt16 _nLBSelPos, const sal_uInt16 _nAlign, @@ -1483,7 +1425,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap, { sal_uInt16 nRelCount = sizeof(aRelationMap) / sizeof(RelationMap); - // OD 14.11.2003 #i22341# - special handling for map <aVCharMap>, + // special handling for map <aVCharMap>, // because its ambigous in its <eStrId>/<eMirrorStrId>. if ( _pMap == aVCharMap ) { @@ -1575,10 +1517,6 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap, return nLBRelations; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - short SwFrmPage::GetRelation(FrmMap * /*pMap*/, ListBox &rRelationLB) { short nRel = 0; @@ -1593,16 +1531,12 @@ short SwFrmPage::GetRelation(FrmMap * /*pMap*/, ListBox &rRelationLB) return nRel; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - short SwFrmPage::GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, ListBox &/*rAlignLB*/, ListBox &rRelationLB) { short nAlign = 0; - // OD 14.11.2003 #i22341# - special handling also for map <aVCharMap>, + // i#22341 special handling also for map <aVCharMap>, // because it contains ambigous items for alignment if ( pMap == aVAsCharHtmlMap || pMap == aVAsCharMap || pMap == aVCharMap ) @@ -1633,10 +1567,6 @@ short SwFrmPage::GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, return nAlign; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwFrmPage::GetMapPos( const FrmMap *pMap, ListBox &rAlignLB ) { sal_uInt16 nMapPos = 0; @@ -1670,10 +1600,6 @@ sal_uInt16 SwFrmPage::GetMapPos( const FrmMap *pMap, ListBox &rAlignLB ) return nMapPos; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - RndStdIds SwFrmPage::GetAnchor() { RndStdIds nRet = FLY_AT_PAGE; @@ -1699,7 +1625,6 @@ RndStdIds SwFrmPage::GetAnchor() /*-------------------------------------------------------------------- Beschreibung: Bsp - Update --------------------------------------------------------------------*/ - void SwFrmPage::ActivatePage(const SfxItemSet& rSet) { bNoModifyHdl = sal_True; @@ -1736,7 +1661,6 @@ int SwFrmPage::DeactivatePage(SfxItemSet * _pSet) /*-------------------------------------------------------------------- Beschreibung: Links/rechts mit Innen/aussen tauschen --------------------------------------------------------------------*/ - IMPL_LINK( SwFrmPage, MirrorHdl, CheckBox *, EMPTYARG ) { RndStdIds eId = GetAnchor(); @@ -1745,10 +1669,6 @@ IMPL_LINK( SwFrmPage, MirrorHdl, CheckBox *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFrmPage, RelSizeClickHdl, CheckBox *, pBtn ) { if (pBtn == &aRelWidthCB) @@ -1778,7 +1698,6 @@ IMPL_LINK( SwFrmPage, RelSizeClickHdl, CheckBox *, pBtn ) /*-------------------------------------------------------------------- Beschreibung: Bereichspruefung --------------------------------------------------------------------*/ - IMPL_LINK( SwFrmPage, RangeModifyHdl, Edit *, EMPTYARG ) { if (bNoModifyHdl) @@ -1786,7 +1705,7 @@ IMPL_LINK( SwFrmPage, RangeModifyHdl, Edit *, EMPTYARG ) SwWrtShell* pSh = bFormat ? ::GetActiveWrtShell() :((SwFrmDlg*)GetParent()->GetParent())->GetWrtShell(); - ASSERT(pSh , "shell not found"); + OSL_ENSURE(pSh , "shell not found"); SwFlyFrmAttrMgr aMgr( bNew, pSh, (const SwAttrSet&)GetItemSet() ); SvxSwFrameValidation aVal; @@ -1794,7 +1713,6 @@ IMPL_LINK( SwFrmPage, RangeModifyHdl, Edit *, EMPTYARG ) aVal.bAutoHeight = aAutoHeightCB.IsChecked(); aVal.bAutoWidth = aAutoWidthCB.IsChecked(); aVal.bMirror = aMirrorPagesCB.IsChecked(); - // OD 18.09.2003 #i18732# aVal.bFollowTextFlow = aFollowTextFlowCB.IsChecked(); if ( pHMap ) @@ -1911,9 +1829,9 @@ IMPL_LINK( SwFrmPage, AnchorTypeHdl, RadioButton *, EMPTYARG ) { aMirrorPagesCB.Enable(!aAnchorAsCharRB.IsChecked()); - // OD 06.11.2003 #i18732# - enable check box 'Follow text flow' for anchor + // i#18732 - enable check box 'Follow text flow' for anchor // type to-paragraph' and to-character - // OD 10.11.2003 #i22305# - enable check box 'Follow text + // i#22305 - enable check box 'Follow text // flow' also for anchor type to-frame. aFollowTextFlowCB.Enable( aAnchorAtParaRB.IsChecked() || aAnchorAtCharRB.IsChecked() || @@ -1936,10 +1854,6 @@ IMPL_LINK( SwFrmPage, AnchorTypeHdl, RadioButton *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) { sal_Bool bHori = pLB == &aHorizontalDLB; @@ -2047,7 +1961,6 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) /*-------------------------------------------------------------------- Beschreibung: Horizontale Pos --------------------------------------------------------------------*/ - IMPL_LINK( SwFrmPage, RelHdl, ListBox *, pLB ) { sal_Bool bHori = pLB == &aHoriRelationLB; @@ -2080,7 +1993,6 @@ IMPL_LINK( SwFrmPage, RelHdl, ListBox *, pLB ) return 0; } - IMPL_LINK_INLINE_START( SwFrmPage, RealSizeHdl, Button *, EMPTYARG ) { aWidthED.SetUserValue( aWidthED. NormalizePercent(aGrfSize.Width() ), FUNIT_TWIP); @@ -2091,7 +2003,6 @@ IMPL_LINK_INLINE_START( SwFrmPage, RealSizeHdl, Button *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwFrmPage, RealSizeHdl, Button *, EMPTYARG ) - IMPL_LINK( SwFrmPage, AutoWidthClickHdl, void*, EMPTYARG ) { if( !IsInGraficMode() ) @@ -2128,10 +2039,6 @@ IMPL_LINK( SwFrmPage, ModifyHdl, Edit *, pEdit ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwFrmPage::UpdateExample() { sal_uInt16 nPos = aHorizontalDLB.GetSelectEntryPos(); @@ -2363,9 +2270,7 @@ sal_uInt16* SwFrmPage::GetRanges() { return aPageRg; } -/* -----------------------------03.11.00 10:52-------------------------------- - ---------------------------------------------------------------------------*/ void SwFrmPage::SetFormatUsed(sal_Bool bFmt) { bFormat = bFmt; @@ -2378,12 +2283,6 @@ void SwFrmPage::SetFormatUsed(sal_Bool bFmt) aAnchorAtFrameRB.Hide(); aTypeFL.Hide(); aTypeSepFL.Hide(); - -// Point aSizePos = aSizeFL.GetPosPixel(); -// Size aSizeSize = aSizeFL.GetSizePixel(); -// aSizeSize.Width() = aTypeFL.GetPosPixel().X() + -// aTypeFL.GetSizePixel().Width() - aSizePos.X(); -// aSizeFL.SetSizePixel(aSizeSize); } } @@ -2400,10 +2299,6 @@ void SwFrmPage::EnableVerticalPositioning( bool bEnable ) } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwGrfExtPage::SwGrfExtPage(Window *pParent, const SfxItemSet &rSet) : SfxTabPage( pParent, SW_RES(TP_GRF_EXT), rSet ), aMirrorFL (this, SW_RES( FL_MIRROR )), @@ -2412,7 +2307,7 @@ SwGrfExtPage::SwGrfExtPage(Window *pParent, const SfxItemSet &rSet) : aAllPagesRB (this, SW_RES( RB_MIRROR_ALL_PAGES )), aLeftPagesRB (this, SW_RES( RB_MIRROR_LEFT_PAGES )), aRightPagesRB (this, SW_RES( RB_MIRROR_RIGHT_PAGES )), - aBmpWin (this, WN_BMP, Graphic(), BitmapEx(SW_RES(BMP_EXAMPLE)), BitmapEx(SW_RES(BMP_EXAMPLE_HC)) ), + aBmpWin (this, WN_BMP, Graphic(), BitmapEx(SW_RES(BMP_EXAMPLE))), aConnectFL (this, SW_RES( FL_CONNECT )), aConnectFT (this, SW_RES( FT_CONNECT )), aConnectED (this, SW_RES( ED_CONNECT )), @@ -2429,28 +2324,16 @@ SwGrfExtPage::SwGrfExtPage(Window *pParent, const SfxItemSet &rSet) : aBrowseBT.SetClickHdl ( LINK(this, SwGrfExtPage, BrowseHdl)); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwGrfExtPage::~SwGrfExtPage() { delete pGrfDlg; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SfxTabPage* SwGrfExtPage::Create( Window *pParent, const SfxItemSet &rSet ) { return new SwGrfExtPage( pParent, rSet ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwGrfExtPage::Reset(const SfxItemSet &rSet) { const SfxPoolItem* pItem; @@ -2467,10 +2350,6 @@ void SwGrfExtPage::Reset(const SfxItemSet &rSet) ActivatePage(rSet); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwGrfExtPage::ActivatePage(const SfxItemSet& rSet) { const SvxProtectItem& rProt = (const SvxProtectItem& )rSet.Get(RES_PROTECT); @@ -2556,10 +2435,6 @@ void SwGrfExtPage::ActivatePage(const SfxItemSet& rSet) aBmpWin.Invalidate(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool SwGrfExtPage::FillItemSet( SfxItemSet &rSet ) { sal_Bool bModified = sal_False; @@ -2598,9 +2473,6 @@ sal_Bool SwGrfExtPage::FillItemSet( SfxItemSet &rSet ) } return bModified; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ int SwGrfExtPage::DeactivatePage(SfxItemSet *_pSet) { @@ -2609,10 +2481,6 @@ int SwGrfExtPage::DeactivatePage(SfxItemSet *_pSet) return sal_True; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwGrfExtPage, BrowseHdl, Button *, EMPTYARG ) { if(!pGrfDlg) @@ -2661,9 +2529,6 @@ IMPL_LINK( SwGrfExtPage, BrowseHdl, Button *, EMPTYARG ) } return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ IMPL_LINK( SwGrfExtPage, MirrorHdl, CheckBox *, EMPTYARG ) { @@ -2685,13 +2550,11 @@ IMPL_LINK( SwGrfExtPage, MirrorHdl, CheckBox *, EMPTYARG ) /*-------------------------------------------------------------------- Beschreibung: BeispielWindow --------------------------------------------------------------------*/ - BmpWindow::BmpWindow( Window* pPar, sal_uInt16 nId, - const Graphic& rGraphic, const BitmapEx& rBmp, const BitmapEx& rBmpHC ) : + const Graphic& rGraphic, const BitmapEx& rBmp ) : Window(pPar, SW_RES(nId)), aGraphic(rGraphic), aBmp(rBmp), - aBmpHC(rBmpHC), bHorz(sal_False), bVert(sal_False), bGraphic(sal_False), @@ -2738,8 +2601,7 @@ void BmpWindow::Paint( const Rectangle& ) aGraphic.Draw( this, aPntPos, aPntSz ); else { - bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); - DrawBitmapEx( aPntPos, aPntSz, bHC ? aBmpHC : aBmp ); + DrawBitmapEx( aPntPos, aPntSz, aBmp ); } } @@ -2758,8 +2620,6 @@ void BmpWindow::SetGraphic(const Graphic& rGrf) /*************************************************************************** Beschreibung: URL und ImageMap an Rahmen einstellen ***************************************************************************/ - - SwFrmURLPage::SwFrmURLPage( Window *pParent, const SfxItemSet &rSet ) : SfxTabPage(pParent, SW_RES(TP_FRM_URL), rSet), aHyperLinkFL (this, SW_RES( FL_HYPERLINK )), @@ -2779,18 +2639,10 @@ SwFrmURLPage::SwFrmURLPage( Window *pParent, const SfxItemSet &rSet ) : aSearchPB.SetClickHdl(LINK(this, SwFrmURLPage, InsertFileHdl)); } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - SwFrmURLPage::~SwFrmURLPage() { } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - void SwFrmURLPage::Reset( const SfxItemSet &rSet ) { const SfxPoolItem* pItem; @@ -2798,17 +2650,16 @@ void SwFrmURLPage::Reset( const SfxItemSet &rSet ) { TargetList* pList = new TargetList; ((const SfxFrameItem*)pItem)->GetFrame()->GetTargetList(*pList); - sal_uInt16 nCount = (sal_uInt16)pList->Count(); - if( nCount ) + if( !pList->empty() ) { - sal_uInt16 i; - for ( i = 0; i < nCount; i++ ) + size_t nCount = pList->size(); + for ( size_t i = 0; i < nCount; i++ ) { - aFrameCB.InsertEntry(*pList->GetObject(i)); + aFrameCB.InsertEntry( *pList->at( i ) ); } - for ( i = nCount; i; i-- ) + for ( size_t i = nCount; i; ) { - delete pList->GetObject( i - 1 ); + delete pList->at( --i ); } } delete pList; @@ -2837,12 +2688,6 @@ void SwFrmURLPage::Reset( const SfxItemSet &rSet ) aClientCB.SaveValue(); } - - -/*************************************************************************** - Beschreibung: -***************************************************************************/ - sal_Bool SwFrmURLPage::FillItemSet(SfxItemSet &rSet) { sal_Bool bModified = sal_False; @@ -2882,19 +2727,11 @@ sal_Bool SwFrmURLPage::FillItemSet(SfxItemSet &rSet) return bModified; } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - SfxTabPage* SwFrmURLPage::Create(Window *pParent, const SfxItemSet &rSet) { return new SwFrmURLPage( pParent, rSet ); } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - IMPL_LINK( SwFrmURLPage, InsertFileHdl, PushButton *, EMPTYARG ) { FileDialogHelper aDlgHelper( ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); @@ -2918,9 +2755,6 @@ IMPL_LINK( SwFrmURLPage, InsertFileHdl, PushButton *, EMPTYARG ) return 0; } -/* -----------------------------03.11.00 10:56-------------------------------- - - ---------------------------------------------------------------------------*/ void lcl_Move(Window& rWin, sal_Int32 nDiff) { Point aPos(rWin.GetPosPixel()); @@ -2928,10 +2762,6 @@ void lcl_Move(Window& rWin, sal_Int32 nDiff) rWin.SetPosPixel(aPos); } -/*-----------------13.11.96 13.15------------------- - ---------------------------------------------------*/ - SwFrmAddPage::SwFrmAddPage(Window *pParent, const SfxItemSet &rSet ) : SfxTabPage(pParent, SW_RES(TP_FRM_ADD), rSet), @@ -2967,27 +2797,15 @@ SwFrmAddPage::SwFrmAddPage(Window *pParent, const SfxItemSet &rSet ) : } -/*-----------------13.11.96 13.15------------------- - ---------------------------------------------------*/ - SwFrmAddPage::~SwFrmAddPage() { } -/*-----------------13.11.96 13.15------------------- - ---------------------------------------------------*/ - SfxTabPage* SwFrmAddPage::Create(Window *pParent, const SfxItemSet &rSet) { return new SwFrmAddPage(pParent, rSet); } -/*-----------------13.11.96 13.14------------------- - ---------------------------------------------------*/ - void SwFrmAddPage::Reset(const SfxItemSet &rSet ) { const SfxPoolItem* pItem; @@ -3025,7 +2843,7 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet ) aTmpName1 = ((const SfxStringItem*)pItem)->GetValue(); } - DBG_ASSERT(pWrtSh, "keine Shell?"); + OSL_ENSURE(pWrtSh, "keine Shell?"); if( bNew || !aTmpName1.Len() ) switch( nDlgType ) @@ -3126,7 +2944,6 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet ) aThisPageFrames.erase(aThisPageFrames.begin(), aThisPageFrames.end()); aRemainFrames.erase(aRemainFrames.begin(), aRemainFrames.end()); - pWrtSh->GetConnectableFrmFmts(*pFmt, sPrevChain, sal_True, aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames ); lcl_InsertVectors(aNextLB, aPrevPageFrames, aThisPageFrames, aNextPageFrames, aRemainFrames); @@ -3152,7 +2969,7 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet ) const SwFmtEditInReadonly& rEdit = (const SwFmtEditInReadonly& )rSet.Get(RES_EDIT_IN_READONLY); aEditInReadonlyCB.Check(rEdit.GetValue()); aEditInReadonlyCB.SaveValue(); - // drucken + // print const SvxPrintItem& rPrt = (const SvxPrintItem&)rSet.Get(RES_PRINT); aPrintFrameCB.Check(rPrt.GetValue()); aPrintFrameCB.SaveValue(); @@ -3186,10 +3003,6 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet ) } } -/*-----------------13.11.96 13.20------------------- - ---------------------------------------------------*/ - sal_Bool SwFrmAddPage::FillItemSet(SfxItemSet &rSet) { sal_Bool bRet = sal_False; @@ -3252,19 +3065,11 @@ sal_Bool SwFrmAddPage::FillItemSet(SfxItemSet &rSet) return bRet; } -/*-----------------13.11.96 15.05------------------- - ---------------------------------------------------*/ - sal_uInt16* SwFrmAddPage::GetRanges() { return aAddPgRg; } -/*-----------------13.11.96 16.12------------------- - ---------------------------------------------------*/ - IMPL_LINK(SwFrmAddPage, EditModifyHdl, Edit*, EMPTYARG) { sal_Bool bEnable = 0 != aNameED.GetText().Len(); @@ -3273,7 +3078,7 @@ IMPL_LINK(SwFrmAddPage, EditModifyHdl, Edit*, EMPTYARG) return 0; } -//----------------------------------------------------------------------------- + void SwFrmAddPage::SetFormatUsed(sal_Bool bFmt) { bFormat = bFmt; @@ -3308,9 +3113,7 @@ void SwFrmAddPage::SetFormatUsed(sal_Bool bFmt) lcl_Move(*aWindows[nIdx++], nDiff); } } -/* -----------------------------08.08.2002 16:24------------------------------ - ---------------------------------------------------------------------------*/ IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox) { String sCurrentPrevChain, sCurrentNextChain; @@ -3343,3 +3146,5 @@ IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox) } return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/frmdlg/frmpage.hrc b/sw/source/ui/frmdlg/frmpage.hrc index a1f213ee6b..faa0e63f8e 100644 --- a/sw/source/ui/frmdlg/frmpage.hrc +++ b/sw/source/ui/frmdlg/frmpage.hrc @@ -105,7 +105,6 @@ #define ED_URL 59 #define BMP_EXAMPLE 62 -#define BMP_EXAMPLE_HC 63 #define RB_MIRROR_ALL_PAGES 64 #define RB_MIRROR_LEFT_PAGES 65 #define RB_MIRROR_RIGHT_PAGES 66 diff --git a/sw/source/ui/frmdlg/frmpage.src b/sw/source/ui/frmdlg/frmpage.src index f832061dc7..faadabe67c 100644 --- a/sw/source/ui/frmdlg/frmpage.src +++ b/sw/source/ui/frmdlg/frmpage.src @@ -543,10 +543,6 @@ TabPage TP_GRF_EXT { File = "dog.bmp" ; }; - Bitmap BMP_EXAMPLE_HC - { - File = "dog_h.bmp" ; - }; FixedLine FL_CONNECT { Pos = MAP_APPFONT ( 6 , 87 ) ; diff --git a/sw/source/ui/frmdlg/frmui.src b/sw/source/ui/frmdlg/frmui.src index 2b58742fc0..b420a6541c 100644 --- a/sw/source/ui/frmdlg/frmui.src +++ b/sw/source/ui/frmdlg/frmui.src @@ -100,7 +100,6 @@ String STR_CHAR_CENTER }; String STR_OLE_INSERT { - /* ### ACHTUNG: Neuer Text in Resource? Objekt einf�gen : Objekt einf�gen */ Text [ en-US ] = "Insert object" ; }; String STR_OLE_EDIT @@ -127,7 +126,6 @@ InfoBox MSG_COLUMN_ERR_BOUNDWIDTH { BUTTONS = WB_OK ; DEFBUTTON = WB_DEF_OK ; - /* ### ACHTUNG: Neuer Text in Resource? Der Spaltenabstand ist zu gro� f�r die Spaltenbreite. : Der Spaltenabstand ist zu gro� f�r die Spaltenbreite. */ Message [ en-US ] = "Column spacing exceeds the column width." ; }; diff --git a/sw/source/ui/frmdlg/pattern.cxx b/sw/source/ui/frmdlg/pattern.cxx index e8b0ac664d..b9ca694a3b 100644 --- a/sw/source/ui/frmdlg/pattern.cxx +++ b/sw/source/ui/frmdlg/pattern.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,7 +55,7 @@ SwBackgroundDlg::SwBackgroundDlg(Window* pParent, const SfxItemSet& rSet) : { SetText(SW_RESSTR(STR_FRMUI_PATTERN)); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ); if ( fnCreatePage ) { @@ -73,3 +74,4 @@ SwBackgroundDlg::~SwBackgroundDlg() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/frmdlg/uiborder.cxx b/sw/source/ui/frmdlg/uiborder.cxx index af4399679f..9a60449868 100644 --- a/sw/source/ui/frmdlg/uiborder.cxx +++ b/sw/source/ui/frmdlg/uiborder.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,7 +57,7 @@ SwBorderDlg::SwBorderDlg(Window* pParent, SfxItemSet& rSet, sal_uInt16 nType) : // TabPage erzeugen SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ); if ( fnCreatePage ) { @@ -77,3 +78,4 @@ SwBorderDlg::~SwBorderDlg() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index 65bba74b04..8980b27e18 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -41,7 +42,7 @@ #include <editeng/opaqitem.hxx> #include <editeng/ulspitem.hxx> #include <editeng/lrspitem.hxx> -// OD 18.09.2003 #i18732# +// #i18732# #include <fmtfollowtextflow.hxx> #include <svx/swframevalidation.hxx> @@ -60,25 +61,13 @@ using namespace ::com::sun::star; - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -static sal_uInt16 __FAR_DATA aWrapPageRg[] = { +static sal_uInt16 aWrapPageRg[] = { RES_LR_SPACE, RES_UL_SPACE, RES_PROTECT, RES_SURROUND, RES_PRINT, RES_PRINT, 0 }; - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - SwWrapDlg::SwWrapDlg(Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode) : SfxSingleTabDialog(pParent, rSet, 0), pWrtShell(pSh) @@ -94,18 +83,10 @@ SwWrapDlg::SwWrapDlg(Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Boo SetText(sTitle); } - - SwWrapDlg::~SwWrapDlg() { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - SwWrapTabPage::SwWrapTabPage(Window *pParent, const SfxItemSet &rSet) : SfxTabPage(pParent, SW_RES(TP_FRM_WRAP), rSet), @@ -135,7 +116,6 @@ SwWrapTabPage::SwWrapTabPage(Window *pParent, const SfxItemSet &rSet) : aWrapOutsideCB (this, SW_RES(CB_ONLYOUTSIDE)), aWrapIL (SW_RES(IL_WRAP)), - aWrapILH (SW_RES(ILH_WRAP)), nAnchorId(FLY_AT_PARA), nHtmlMode(0), @@ -187,23 +167,14 @@ SwWrapTabPage::SwWrapTabPage(Window *pParent, const SfxItemSet &rSet) : aWrapOutlineCB.SetClickHdl(LINK(this, SwWrapTabPage, ContourHdl)); } - - SwWrapTabPage::~SwWrapTabPage() { } - - SfxTabPage* SwWrapTabPage::Create(Window *pParent, const SfxItemSet &rSet) { return new SwWrapTabPage(pParent, rSet); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwWrapTabPage::Reset(const SfxItemSet &rSet) { @@ -337,9 +308,6 @@ void SwWrapTabPage::Reset(const SfxItemSet &rSet) /*-------------------------------------------------------------------- Beschreibung: Attribute in den Set stopfen bei OK --------------------------------------------------------------------*/ - - - sal_Bool SwWrapTabPage::FillItemSet(SfxItemSet &rSet) { sal_Bool bModified = sal_False; @@ -445,9 +413,6 @@ sal_Bool SwWrapTabPage::FillItemSet(SfxItemSet &rSet) /*-------------------------------------------------------------------- Beschreibung: Bsp - Update --------------------------------------------------------------------*/ - - - void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) { // Anchor @@ -481,7 +446,7 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) aVal.bAutoHeight = rFrmSize.GetHeightSizeType() == ATT_MIN_SIZE; aVal.bAutoWidth = rFrmSize.GetWidthSizeType() == ATT_MIN_SIZE; aVal.bMirror = rHori.IsPosToggle(); - // OD 18.09.2003 #i18732# + // #i18732# aVal.bFollowTextFlow = static_cast<const SwFmtFollowTextFlow&>(rSet.Get(RES_FOLLOW_TEXT_FLOW)).GetValue(); @@ -642,8 +607,6 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) ContourHdl(0); } - - int SwWrapTabPage::DeactivatePage(SfxItemSet* _pSet) { if(_pSet) @@ -655,9 +618,6 @@ int SwWrapTabPage::DeactivatePage(SfxItemSet* _pSet) /*-------------------------------------------------------------------- Beschreibung: Bereichspruefung --------------------------------------------------------------------*/ - - - IMPL_LINK( SwWrapTabPage, RangeModifyHdl, MetricField *, pEdit ) { if(bHtmlMode && 0 == (nHtmlMode & HTMLMODE_FULL_ABS_POS)) @@ -686,21 +646,20 @@ IMPL_LINK( SwWrapTabPage, RangeModifyHdl, MetricField *, pEdit ) else if (pEdit == &aBottomMarginED) pOpposite = &aTopMarginED; - sal_Int64 nOpposite = pOpposite->GetValue(); + OSL_ASSERT(pOpposite); - if (nValue + nOpposite > Max(pEdit->GetMax(), pOpposite->GetMax())) - pOpposite->SetValue(pOpposite->GetMax() - nValue); + if (pOpposite) + { + sal_Int64 nOpposite = pOpposite->GetValue(); + + if (nValue + nOpposite > Max(pEdit->GetMax(), pOpposite->GetMax())) + pOpposite->SetValue(pOpposite->GetMax() - nValue); + } } return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - IMPL_LINK( SwWrapTabPage, WrapTypeHdl, ImageRadioButton *, pBtn ) { sal_Bool bWrapThrough = (pBtn == &aWrapThroughRB); @@ -716,12 +675,6 @@ IMPL_LINK( SwWrapTabPage, WrapTypeHdl, ImageRadioButton *, pBtn ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - IMPL_LINK( SwWrapTabPage, ContourHdl, CheckBox *, EMPTYARG ) { sal_Bool bEnable = !(aWrapOutlineCB.IsChecked() && aWrapOutlineCB.IsEnabled()); @@ -738,16 +691,11 @@ IMPL_LINK( SwWrapTabPage, ContourHdl, CheckBox *, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ sal_uInt16* SwWrapTabPage::GetRanges() { return aWrapPageRg; } -/* -----------------------------08.05.2002 14:28------------------------------ - ---------------------------------------------------------------------------*/ void SwWrapTabPage::DataChanged( const DataChangedEvent& rDCEvt ) { if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && @@ -756,30 +704,29 @@ void SwWrapTabPage::DataChanged( const DataChangedEvent& rDCEvt ) SfxTabPage::DataChanged( rDCEvt ); } -/* -----------------------------08.05.2002 14:28------------------------------ - ---------------------------------------------------------------------------*/ void SwWrapTabPage::ApplyImageList() { - ImageList& rImgLst = GetSettings().GetStyleSettings().GetHighContrastMode() ? - aWrapILH : aWrapIL; + ImageList& rImgLst = aWrapIL; aWrapThroughRB.SetModeRadioImage(rImgLst.GetImage(IMG_THROUGH)); sal_Bool bWrapOutline = !aWrapOutlineCB.IsChecked(); if(bWrapOutline) { - aNoWrapRB.SetModeRadioImage(rImgLst.GetImage(IMG_NONE)); - aWrapLeftRB.SetModeRadioImage(rImgLst.GetImage(IMG_LEFT)); - aWrapRightRB.SetModeRadioImage(rImgLst.GetImage(IMG_RIGHT)); - aWrapParallelRB.SetModeRadioImage(rImgLst.GetImage(IMG_PARALLEL)); - aIdealWrapRB.SetModeRadioImage(rImgLst.GetImage(IMG_IDEAL)); + aNoWrapRB.SetModeRadioImage( rImgLst.GetImage( IMG_NONE )); + aWrapLeftRB.SetModeRadioImage( rImgLst.GetImage( IMG_LEFT )); + aWrapRightRB.SetModeRadioImage( rImgLst.GetImage( IMG_RIGHT )); + aWrapParallelRB.SetModeRadioImage( rImgLst.GetImage( IMG_PARALLEL )); + aIdealWrapRB.SetModeRadioImage( rImgLst.GetImage( IMG_IDEAL )); } else { - aNoWrapRB.SetModeRadioImage(rImgLst.GetImage( IMG_KON_NONE )); - aWrapLeftRB.SetModeRadioImage(rImgLst.GetImage( IMG_KON_LEFT )); - aWrapRightRB.SetModeRadioImage(rImgLst.GetImage( IMG_KON_RIGHT )); - aWrapParallelRB.SetModeRadioImage(rImgLst.GetImage(IMG_KON_PARALLEL )); - aIdealWrapRB.SetModeRadioImage(rImgLst.GetImage( IMG_KON_IDEAL )); + aNoWrapRB.SetModeRadioImage( rImgLst.GetImage( IMG_KON_NONE )); + aWrapLeftRB.SetModeRadioImage( rImgLst.GetImage( IMG_KON_LEFT )); + aWrapRightRB.SetModeRadioImage( rImgLst.GetImage( IMG_KON_RIGHT )); + aWrapParallelRB.SetModeRadioImage( rImgLst.GetImage( IMG_KON_PARALLEL )); + aIdealWrapRB.SetModeRadioImage( rImgLst.GetImage( IMG_KON_IDEAL )); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/frmdlg/wrap.hrc b/sw/source/ui/frmdlg/wrap.hrc index 077d8af659..9cfb25441e 100644 --- a/sw/source/ui/frmdlg/wrap.hrc +++ b/sw/source/ui/frmdlg/wrap.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -24,43 +24,40 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#define RB_NO_WRAP 2 -#define RB_WRAP_LEFT 3 -#define RB_WRAP_RIGHT 4 -#define RB_WRAP_PARALLEL 5 -#define RB_WRAP_THROUGH 6 -#define RB_WRAP_IDEAL 7 -#define CB_ANCHOR_ONLY 8 -#define FT_LEFT_MARGIN 13 -#define ED_LEFT_MARGIN 14 -#define FT_RIGHT_MARGIN 15 -#define ED_RIGHT_MARGIN 16 -#define FT_TOP_MARGIN 17 -#define ED_TOP_MARGIN 18 -#define ED_BOTTOM_MARGIN 19 -#define FT_BOTTOM_MARGIN 20 -#define FL_MARGIN 21 -#define CB_TRANSPARENT 22 -#define CB_OUTLINE 23 -#define FL_OPTION 24 -#define CB_ONLYOUTSIDE 25 -#define FL_OPTION_SEP 26 -#define C_WRAP_FL 31 +#define RB_NO_WRAP 2 +#define RB_WRAP_LEFT 3 +#define RB_WRAP_RIGHT 4 +#define RB_WRAP_PARALLEL 5 +#define RB_WRAP_THROUGH 6 +#define RB_WRAP_IDEAL 7 +#define CB_ANCHOR_ONLY 8 +#define FT_LEFT_MARGIN 13 +#define ED_LEFT_MARGIN 14 +#define FT_RIGHT_MARGIN 15 +#define ED_RIGHT_MARGIN 16 +#define FT_TOP_MARGIN 17 +#define ED_TOP_MARGIN 18 +#define ED_BOTTOM_MARGIN 19 +#define FT_BOTTOM_MARGIN 20 +#define FL_MARGIN 21 +#define CB_TRANSPARENT 22 +#define CB_OUTLINE 23 +#define FL_OPTION 24 +#define CB_ONLYOUTSIDE 25 +#define FL_OPTION_SEP 26 +#define C_WRAP_FL 31 #define IL_WRAP 32 -#define ILH_WRAP 33 // nur fuer die ImageList -#define IMG_BEGIN 1 -#define IMG_NONE (IMG_BEGIN) -#define IMG_LEFT (IMG_BEGIN + 1) -#define IMG_RIGHT (IMG_BEGIN + 2) -#define IMG_PARALLEL (IMG_BEGIN + 3) -#define IMG_THROUGH (IMG_BEGIN + 4) -#define IMG_IDEAL (IMG_BEGIN + 5) -#define IMG_KON_NONE (IMG_BEGIN + 6) -#define IMG_KON_LEFT (IMG_BEGIN + 7) -#define IMG_KON_RIGHT (IMG_BEGIN + 8) -#define IMG_KON_PARALLEL (IMG_BEGIN + 9) -#define IMG_KON_IDEAL (IMG_BEGIN + 10) - - +#define IMG_BEGIN 1 +#define IMG_NONE (IMG_BEGIN) +#define IMG_LEFT (IMG_BEGIN + 1) +#define IMG_RIGHT (IMG_BEGIN + 2) +#define IMG_PARALLEL (IMG_BEGIN + 3) +#define IMG_THROUGH (IMG_BEGIN + 4) +#define IMG_IDEAL (IMG_BEGIN + 5) +#define IMG_KON_NONE (IMG_BEGIN + 6) +#define IMG_KON_LEFT (IMG_BEGIN + 7) +#define IMG_KON_RIGHT (IMG_BEGIN + 8) +#define IMG_KON_PARALLEL (IMG_BEGIN + 9) +#define IMG_KON_IDEAL (IMG_BEGIN + 10) diff --git a/sw/source/ui/frmdlg/wrap.src b/sw/source/ui/frmdlg/wrap.src index 1680f3d93b..3c8bc04d88 100644 --- a/sw/source/ui/frmdlg/wrap.src +++ b/sw/source/ui/frmdlg/wrap.src @@ -260,12 +260,4 @@ TabPage TP_FRM_WRAP MaskColor = IMAGE_MASK_COLOR ; WRAP_IDLIST }; - ImageList ILH_WRAP - { - Prefix = "wrh"; - MaskColor = IMAGE_MASK_COLOR ; - WRAP_IDLIST - }; - }; - diff --git a/sw/source/ui/globdoc/globdoc.cxx b/sw/source/ui/globdoc/globdoc.cxx index 8bcc5d8553..a4aedcb1ec 100644 --- a/sw/source/ui/globdoc/globdoc.cxx +++ b/sw/source/ui/globdoc/globdoc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,13 +43,11 @@ #include "cfgid.h" -/*-------------------------------------------------------------------- - Beschreibung: Alle Filter registrieren - --------------------------------------------------------------------*/ + +// Description: Register all filters TYPEINIT1(SwGlobalDocShell, SwDocShell); -//------------------------------------------------------------------------- SFX_IMPL_OBJECTFACTORY( SwGlobalDocShell, SvGlobalName(SO3_SWGLOB_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter/GlobalDocument" ) SwGlobalDocShell::SwGlobalDocShell(SfxObjectCreateMode eMode ) : @@ -69,7 +68,7 @@ void SwGlobalDocShell::FillClass( SvGlobalName * pClassName, sal_Bool bTemplate /* = sal_False */) const { (void)bTemplate; - DBG_ASSERT( bTemplate == sal_False, "No template for Writer Global" ); + OSL_ENSURE( bTemplate == sal_False, "No template for Writer Global" ); if (nVersion == SOFFICE_FILEFORMAT_60) { @@ -89,3 +88,4 @@ void SwGlobalDocShell::FillClass( SvGlobalName * pClassName, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/DropDownFieldDialog.hxx b/sw/source/ui/inc/DropDownFieldDialog.hxx index a9b7091303..490339f4e9 100644 --- a/sw/source/ui/inc/DropDownFieldDialog.hxx +++ b/sw/source/ui/inc/DropDownFieldDialog.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <svx/stddlg.hxx> #include <vcl/fixed.hxx> #include <vcl/lstbox.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif class SwDropDownField; class SwField; @@ -67,5 +66,6 @@ public: }; } //namespace sw - #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/SidebarWindowsConsts.hxx b/sw/source/ui/inc/SidebarWindowsConsts.hxx index 378b2be079..5df62bdee1 100644 --- a/sw/source/ui/inc/SidebarWindowsConsts.hxx +++ b/sw/source/ui/inc/SidebarWindowsConsts.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -6,10 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: $ - * - * $Revision: $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -39,3 +36,5 @@ const sal_Int8 ANCHORLINE_WIDTH = 1; } } // end of namespace sw::sidebarwindows #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/SwSpellDialogChildWindow.hxx b/sw/source/ui/inc/SwSpellDialogChildWindow.hxx index bed586c26d..cdca54a93c 100644 --- a/sw/source/ui/inc/SwSpellDialogChildWindow.hxx +++ b/sw/source/ui/inc/SwSpellDialogChildWindow.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #define SW_SPELL_DIALOG_CHILD_WINDOW_HXX #include <svx/SpellDialogChildWindow.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif class SwWrtShell; struct SpellState; @@ -74,3 +73,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/SwXFilterOptions.hxx b/sw/source/ui/inc/SwXFilterOptions.hxx index 383d6f992f..64f67a3f9a 100644 --- a/sw/source/ui/inc/SwXFilterOptions.hxx +++ b/sw/source/ui/inc/SwXFilterOptions.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,10 +39,6 @@ namespace com { namespace sun { namespace star { namespace io { class XInputStream; } } } } - -/* -----------------------------2002/06/21 12:07------------------------------ - - ---------------------------------------------------------------------------*/ class SwXFilterOptions : public ::cppu::WeakImplHelper5< ::com::sun::star::beans::XPropertyAccess, ::com::sun::star::ui::dialogs::XExecutableDialog, @@ -111,3 +108,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/abstract.hxx b/sw/source/ui/inc/abstract.hxx index 6904795be6..10fb9aa14c 100644 --- a/sw/source/ui/inc/abstract.hxx +++ b/sw/source/ui/inc/abstract.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,22 +30,12 @@ #include <sfx2/basedlgs.hxx> -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif - - -/*-----------------22.02.97 15.06------------------- ---------------------------------------------------*/ class SwInsertAbstractDlg : public SfxModalDialog { FixedLine aFL; @@ -71,3 +62,4 @@ public: +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/actctrl.hxx b/sw/source/ui/inc/actctrl.hxx index 3015667304..a778a2f366 100644 --- a/sw/source/ui/inc/actctrl.hxx +++ b/sw/source/ui/inc/actctrl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,15 +28,12 @@ #ifndef _ACTCTRL_HXX #define _ACTCTRL_HXX -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif #include "swdllapi.h" /*-------------------------------------------------------------------- Beschreibung: numerische Eingabe --------------------------------------------------------------------*/ - class SW_DLLPUBLIC NumEditAction: public NumericField { Link aActionLink; @@ -52,7 +50,7 @@ public: }; -/* -----------------21.04.98 08:11------------------- +/* -------------------------------------------------- * Edit, dass keine Spaces akzeptiert * --------------------------------------------------*/ class SW_DLLPUBLIC NoSpaceEdit : public Edit @@ -69,7 +67,7 @@ public: const String& GetForbiddenChars(){return sForbiddenChars;} }; -/* -----------------21.04.98 08:33------------------- +/* -------------------------------------------------- * Kein Space und kein Punkt * --------------------------------------------------*/ class TableNameEdit : public NoSpaceEdit @@ -79,7 +77,8 @@ public: NoSpaceEdit(pWin, rResId) {SetForbiddenChars(String::CreateFromAscii(" .<>"));} }; -/* -----------------25.06.2003 15:55----------------- + +/* -------------------------------------------------- call a link when KEY_RETURN is pressed --------------------------------------------------*/ class SW_DLLPUBLIC ReturnActionEdit : public Edit @@ -96,3 +95,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/addrdlg.hxx b/sw/source/ui/inc/addrdlg.hxx index 7bc6d9b759..bfb98b0707 100644 --- a/sw/source/ui/inc/addrdlg.hxx +++ b/sw/source/ui/inc/addrdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,3 +43,4 @@ public: +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/annotsh.hxx b/sw/source/ui/inc/annotsh.hxx index 8937c64b60..9ad2a595e0 100755..100644 --- a/sw/source/ui/inc/annotsh.hxx +++ b/sw/source/ui/inc/annotsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -76,3 +77,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/app.hrc b/sw/source/ui/inc/app.hrc index 0ecc117ba9..9d017f5ed6 100644 --- a/sw/source/ui/inc/app.hrc +++ b/sw/source/ui/inc/app.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -30,138 +30,90 @@ #include "rcid.hrc" -// Default Bitmap fuer ToolBox -#define BMP_FEHLT (RC_APP_BEGIN + 1) - // Document-Icon -#define RC_DOC_ICON (RC_APP_BEGIN + 2) +#define RC_DOC_ICON (RC_APP_BEGIN + 2) //Soll das Clipboard fuer andere Applikationen... -#define MSG_CLPBRD_CLEAR (RC_APP_BEGIN + 3) +#define MSG_CLPBRD_CLEAR (RC_APP_BEGIN + 3) -#define STR_CANTCREATE (RC_APP_BEGIN + 4) -#define STR_CANTOPEN (RC_APP_BEGIN + 5) +#define STR_CANTCREATE (RC_APP_BEGIN + 4) +#define STR_CANTOPEN (RC_APP_BEGIN + 5) // Messages -#define MSG_ERROR_SEND_MAIL ( RC_APP_BEGIN + 6) -#define MSG_SAVE_HTML_QUERY ( RC_APP_BEGIN + 7) +#define MSG_ERROR_SEND_MAIL ( RC_APP_BEGIN + 6) +#define MSG_SAVE_HTML_QUERY ( RC_APP_BEGIN + 7) //Fuer das Interface, weil der RID_APP_BEGIN jetzt Desktop ist. -#define RID_SW_NAME ( RC_APP_BEGIN + 8) -#define MSG_SAVEAS_HTML_QUERY ( RC_APP_BEGIN + 9) +#define RID_SW_NAME ( RC_APP_BEGIN + 8) +#define MSG_SAVEAS_HTML_QUERY ( RC_APP_BEGIN + 9) -#define STR_UNBENANNT (RC_APP_BEGIN + 13) -#define STR_VERSION (RC_APP_BEGIN + 14) -#define STR_PRINT_MERGE_MACRO (RC_APP_BEGIN + 15) -#define STR_PAGE_COUNT_MACRO (RC_APP_BEGIN + 16) +#define STR_UNBENANNT (RC_APP_BEGIN + 13) +#define STR_VERSION (RC_APP_BEGIN + 14) +#define STR_PRINT_MERGE_MACRO (RC_APP_BEGIN + 15) +#define STR_PAGE_COUNT_MACRO (RC_APP_BEGIN + 16) // Bitmap fuer die NumerierungsVorlagen im Organizer -#define BMP_STYLES_FAMILY_NUM (RC_APP_BEGIN + 17) -#define BMP_STYLES_FAMILY_NUM_HC (RC_APP_BEGIN + 18) +#define BMP_STYLES_FAMILY_NUM (RC_APP_BEGIN + 17) // Strings fuer Bereiche in der Konfiguration -#define STR_GRP_FILE (RC_APP_BEGIN + 56) -#define STR_GRP_EDIT (RC_APP_BEGIN + 57) -#define STR_GRP_TRAVELLING (RC_APP_BEGIN + 58) -#define STR_GRP_VIEW (RC_APP_BEGIN + 59) -#define STR_GRP_INSERT (RC_APP_BEGIN + 60) -#define STR_GRP_FORMAT (RC_APP_BEGIN + 61) -#define STR_GRP_STYLE (RC_APP_BEGIN + 62) -#define STR_GRP_TEXT (RC_APP_BEGIN + 63) -#define STR_GRP_FRAME (RC_APP_BEGIN + 64) -#define STR_GRP_GRAPHIC (RC_APP_BEGIN + 65) -#define STR_GRP_TABLE (RC_APP_BEGIN + 66) -#define STR_GRP_TOOLS (RC_APP_BEGIN + 67) -#define STR_GRP_NUMBERING (RC_APP_BEGIN + 68) -#define STR_GRP_WINDOW (RC_APP_BEGIN + 69) -#define STR_GRP_MISC (RC_APP_BEGIN + 70) -#define STR_GRP_MACRO (RC_APP_BEGIN + 71) -#define RES_EXT_HELP_STRING (RC_APP_BEGIN + 72) -#define RES_STD_HELP_STRING (RC_APP_BEGIN + 73) -#define STR_PAGEOFFSET (RC_APP_BEGIN + 74) -#define STR_PAGEBREAK (RC_APP_BEGIN + 75) -#define STR_REDLINE_UNKNOWN_AUTHOR (RC_APP_BEGIN + 76) -#define STR_WESTERN_FONT (RC_APP_BEGIN + 77) -#define STR_CJK_FONT (RC_APP_BEGIN + 78) -//#define MSG_INS_MERGE_FIELDS (RC_APP_BEGIN + 79) -#define MSG_PRINT_AS_MERGE (RC_APP_BEGIN + 80) -#define MSG_DATA_SOURCES_UNAVAILABLE (RC_APP_BEGIN + 82) -#define DLG_MERGE_SOURCE_UNAVAILABLE (RC_APP_BEGIN + 83) -#define ST_MERGE_SOURCE_UNAVAILABLE 1 -#define PB_MERGE_OK 2 -#define PB_MERGE_CANCEL 3 -#define IMG_MERGE 4 -#define SID_TOGGLETOOLBOX (RC_APP_BEGIN + 89) - -#define STR_ENV_TITLE (RC_APP_BEGIN + 91) -#define STR_LAB_TITLE (RC_APP_BEGIN + 92) - -#define STR_HUMAN_SWDOC_NAME (RC_APP_BEGIN + 93) - -#define RID_SW_ERRHDL (RC_APP_BEGIN + 95) - -#define STR_FDLG_TEMPLATE_BUTTON (RC_APP_BEGIN + 1) -#define STR_FDLG_TEMPLATE_NAME (RC_APP_BEGIN + 2) +#define STR_GRP_FILE (RC_APP_BEGIN + 56) +#define STR_GRP_EDIT (RC_APP_BEGIN + 57) +#define STR_GRP_TRAVELLING (RC_APP_BEGIN + 58) +#define STR_GRP_VIEW (RC_APP_BEGIN + 59) +#define STR_GRP_INSERT (RC_APP_BEGIN + 60) +#define STR_GRP_FORMAT (RC_APP_BEGIN + 61) +#define STR_GRP_STYLE (RC_APP_BEGIN + 62) +#define STR_GRP_TEXT (RC_APP_BEGIN + 63) +#define STR_GRP_FRAME (RC_APP_BEGIN + 64) +#define STR_GRP_GRAPHIC (RC_APP_BEGIN + 65) +#define STR_GRP_TABLE (RC_APP_BEGIN + 66) +#define STR_GRP_TOOLS (RC_APP_BEGIN + 67) +#define STR_GRP_NUMBERING (RC_APP_BEGIN + 68) +#define STR_GRP_WINDOW (RC_APP_BEGIN + 69) +#define STR_GRP_MISC (RC_APP_BEGIN + 70) +#define STR_GRP_MACRO (RC_APP_BEGIN + 71) +#define RES_EXT_HELP_STRING (RC_APP_BEGIN + 72) +#define RES_STD_HELP_STRING (RC_APP_BEGIN + 73) +#define STR_PAGEOFFSET (RC_APP_BEGIN + 74) +#define STR_PAGEBREAK (RC_APP_BEGIN + 75) +#define STR_REDLINE_UNKNOWN_AUTHOR (RC_APP_BEGIN + 76) +#define STR_WESTERN_FONT (RC_APP_BEGIN + 77) +#define STR_CJK_FONT (RC_APP_BEGIN + 78) +#define MSG_PRINT_AS_MERGE (RC_APP_BEGIN + 80) +#define MSG_DATA_SOURCES_UNAVAILABLE (RC_APP_BEGIN + 82) +#define DLG_MERGE_SOURCE_UNAVAILABLE (RC_APP_BEGIN + 83) + +#define ST_MERGE_SOURCE_UNAVAILABLE 1 +#define PB_MERGE_OK 2 +#define PB_MERGE_CANCEL 3 +#define IMG_MERGE 4 + +#define SID_TOGGLETOOLBOX (RC_APP_BEGIN + 89) + +#define STR_ENV_TITLE (RC_APP_BEGIN + 91) +#define STR_LAB_TITLE (RC_APP_BEGIN + 92) + +#define STR_HUMAN_SWDOC_NAME (RC_APP_BEGIN + 93) + +#define RID_SW_ERRHDL (RC_APP_BEGIN + 95) + +#define STR_FDLG_TEMPLATE_BUTTON (RC_APP_BEGIN + 1) +#define STR_FDLG_TEMPLATE_NAME (RC_APP_BEGIN + 2) // Ids fuer die einzelnen PopUpMenues -//#define MN_WIZARD (RC_APP_BEGIN + 9) -//#define MN_INDEX (RC_APP_BEGIN + 10) -//#define MN_FILE (RC_APP_BEGIN + 11) -//#define MN_EDIT (RC_APP_BEGIN + 12) -//#define MN_VIEW (RC_APP_BEGIN + 13) -//#define MN_INS (RC_APP_BEGIN + 14) -//#define MN_TEXT (RC_APP_BEGIN + 15) -//#define MN_FORMAT (RC_APP_BEGIN + 16) -#define MN_FORMAT_STYLE (RC_APP_BEGIN + 17) -#define MN_FORMAT_ALGN (RC_APP_BEGIN + 18) -#define MN_FORMAT_LINESPACE (RC_APP_BEGIN + 19) -//#define MN_EXTRA (RC_APP_BEGIN + 20) -//#define MN_WIN (RC_APP_BEGIN + 21) -//#define MN_HELP (RC_APP_BEGIN + 22) -#define MN_FORMAT_FRM_HORZ (RC_APP_BEGIN + 23) -//#define MN_FORMAT_FRM_VERT (RC_APP_BEGIN + 24) -//#define MN_PICKLIST (RC_APP_BEGIN + 25) -//#define MN_WINLIST (RC_APP_BEGIN + 26) -//#define MN_MACRO (RC_APP_BEGIN + 27) -//#define MN_FORMAT_HIERARCHY (RC_APP_BEGIN + 28) -#define MN_CELL (RC_APP_BEGIN + 29) -//#define MN_HELP_TIP (RC_APP_BEGIN + 30) -//#define MN_HELP_SEARCH (RC_APP_BEGIN + 31) -//#define MN_HELP_ACTIVE (RC_APP_BEGIN + 32) -//#define MN_HELP_INDEX (RC_APP_BEGIN + 33) -//#define MN_OBJECT (RC_APP_BEGIN + 34) -//#define MN_DATABASE (RC_APP_BEGIN + 35) -//#define MN_DIRSUBMENU (RC_APP_BEGIN + 36) -//#define MN_MAIL (RC_APP_BEGIN + 37) -#define MN_WRAP (RC_APP_BEGIN + 38) -#define MN_SUB_TBLROW (RC_APP_BEGIN + 39) -#define MN_SUB_TBLCOL (RC_APP_BEGIN + 40) -//#define MN_SUB_AUTOFORMAT (RC_APP_BEGIN + 41) -//#define MN_SUB_TOOLBAR (RC_APP_BEGIN + 42) -//#define MN_SUB_FIELD (RC_APP_BEGIN + 43) -//#define MN_SUB_GRAPHIC (RC_APP_BEGIN + 44) -//#define MN_SUB_TEMPLATES (RC_APP_BEGIN + 45) -#define MN_SUB_ARRANGE (RC_APP_BEGIN + 46) - -//#define MN_SUB_UPDATE (RC_APP_BEGIN + 48) -//#define MN_SUB_MIRROR (RC_APP_BEGIN + 49) -#define MN_SUB_ALIGN (RC_APP_BEGIN + 50) -//#define MN_SUB_OPTIONS (RC_APP_BEGIN + 51) -//#define MN_SUB_SENDTO (RC_APP_BEGIN + 52) -//#define MN_SUB_REVISE (RC_APP_BEGIN + 53) -//#define MN_TEMPLATES (RC_APP_BEGIN + 54) -//#define MN_FILE_PORT (RC_APP_BEGIN + 55) -//#define MN_EDIT_PORT (RC_APP_BEGIN + 56) -//#define MN_VIEW_PORT (RC_APP_BEGIN + 57) -//#define MN_INS_PORT (RC_APP_BEGIN + 58) -//#define MN_FORMAT_PORT (RC_APP_BEGIN + 59) -//#define MN_EXTRA_PORT (RC_APP_BEGIN + 60) -//#define MN_WIN_PORT (RC_APP_BEGIN + 61) -//#define MN_HELP_PORT (RC_APP_BEGIN + 62) -//#define MN_SUB_TRANSLITERATE (RC_APP_BEGIN + 63) -//#define MN_SUB_MACRO (RC_APP_BEGIN + 64) +#define MN_FORMAT_STYLE (RC_APP_BEGIN + 17) +#define MN_FORMAT_ALGN (RC_APP_BEGIN + 18) +#define MN_FORMAT_LINESPACE (RC_APP_BEGIN + 19) +#define MN_FORMAT_FRM_HORZ (RC_APP_BEGIN + 23) +#define MN_CELL (RC_APP_BEGIN + 29) +#define MN_WRAP (RC_APP_BEGIN + 38) +#define MN_SUB_TBLROW (RC_APP_BEGIN + 39) +#define MN_SUB_TBLCOL (RC_APP_BEGIN + 40) +#define MN_SUB_ARRANGE (RC_APP_BEGIN + 46) + +#define MN_SUB_ALIGN (RC_APP_BEGIN + 50) #define STR_WRITER_DOCUMENT_FULLTYPE (RC_APP_BEGIN + 100) #define STR_ABSTRACT_TITLE (RC_APP_BEGIN + 102) @@ -170,8 +122,8 @@ #define STR_OUTLINE_NUMBERING (RC_APP_BEGIN + 104) // <-- //#outline level,zhaojianwei -#define STR_FDLG_OUTLINE_LEVEL (RC_APP_BEGIN + 105) -#define STR_FDLG_STYLE (RC_APP_BEGIN + 106) +#define STR_FDLG_OUTLINE_LEVEL (RC_APP_BEGIN + 105) +#define STR_FDLG_STYLE (RC_APP_BEGIN + 106) //<-end,zhaojianwei #define APP_ACT_END STR_FDLG_STYLE diff --git a/sw/source/ui/inc/ascfldlg.hxx b/sw/source/ui/inc/ascfldlg.hxx index 0c75b2cedf..fe3793a110 100644 --- a/sw/source/ui/inc/ascfldlg.hxx +++ b/sw/source/ui/inc/ascfldlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #define _ASCFLDLG_HXX #include <vcl/fixed.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <vcl/lstbox.hxx> #include <sfx2/basedlgs.hxx> #include <svx/txencbox.hxx> @@ -76,3 +75,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/autoedit.hxx b/sw/source/ui/inc/autoedit.hxx index ab9a16fb6b..c3221a76ee 100644 --- a/sw/source/ui/inc/autoedit.hxx +++ b/sw/source/ui/inc/autoedit.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,9 +28,7 @@ #ifndef _AUTOEDIT_HXX #define _AUTOEDIT_HXX -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif class AutoEdit : public Edit @@ -48,3 +47,4 @@ protected: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/barcfg.hxx b/sw/source/ui/inc/barcfg.hxx index 1e55db4027..bedf9c5d90 100644 --- a/sw/source/ui/inc/barcfg.hxx +++ b/sw/source/ui/inc/barcfg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,3 +46,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/basesh.hxx b/sw/source/ui/inc/basesh.hxx index 422957924e..76d32e6af6 100644 --- a/sw/source/ui/inc/basesh.hxx +++ b/sw/source/ui/inc/basesh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -125,3 +126,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/beziersh.hxx b/sw/source/ui/inc/beziersh.hxx index e2f5dd5957..2e821feee3 100644 --- a/sw/source/ui/inc/beziersh.hxx +++ b/sw/source/ui/inc/beziersh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,3 +43,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/bmpwin.hxx b/sw/source/ui/inc/bmpwin.hxx index 4170c956ff..baefb78de3 100644 --- a/sw/source/ui/inc/bmpwin.hxx +++ b/sw/source/ui/inc/bmpwin.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,24 +29,18 @@ #ifndef _BMPWIN_HXX #define _BMPWIN_HXX -#ifndef _GRAPH_HXX //autogen #include <vcl/graph.hxx> -#endif -#ifndef _BITMAPEX_HXX #include <vcl/bitmapex.hxx> -#endif #include <vcl/window.hxx> /*-------------------------------------------------------------------- Beschreibung: Extended Page fuer Grafiken --------------------------------------------------------------------*/ - class BmpWindow : public Window { private: Graphic aGraphic; BitmapEx aBmp; - BitmapEx aBmpHC; sal_Bool bHorz : 1; sal_Bool bVert : 1; @@ -56,7 +51,7 @@ private: public: BmpWindow(Window* pPar, sal_uInt16 nId, - const Graphic& rGraphic, const BitmapEx& rBmp, const BitmapEx& rBmpHC); + const Graphic& rGraphic, const BitmapEx& rBmp); BmpWindow(Window* pParent, const ResId rResId) : Window(pParent, rResId), bHorz(sal_False), bVert(sal_False),bGraphic(sal_False), bLeftAlign(sal_True) {} @@ -67,3 +62,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/bookctrl.hxx b/sw/source/ui/inc/bookctrl.hxx index 9c4cbbe8f6..d1e21b3dc3 100644 --- a/sw/source/ui/inc/bookctrl.hxx +++ b/sw/source/ui/inc/bookctrl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,4 @@ private: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/bookmark.hxx b/sw/source/ui/inc/bookmark.hxx index 28257380a6..b2dcc87d1b 100644 --- a/sw/source/ui/inc/bookmark.hxx +++ b/sw/source/ui/inc/bookmark.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,19 +31,13 @@ #include <svx/stddlg.hxx> #include <vcl/fixed.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include "swlbox.hxx" // SwComboBox class SwWrtShell; class SfxRequest; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - class BookmarkCombo : public SwComboBox { sal_uInt16 GetFirstSelEntryPos() const; @@ -59,10 +54,6 @@ public: static const String aForbiddenChars; }; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - class SwInsertBookmarkDlg: public SvxStandardDialog { FixedLine aBookmarkFl; @@ -86,3 +77,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/break.hxx b/sw/source/ui/inc/break.hxx index ad20c90e05..71d191d144 100644 --- a/sw/source/ui/inc/break.hxx +++ b/sw/source/ui/inc/break.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,21 +30,13 @@ #include <svx/stddlg.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif class SwWrtShell; @@ -90,3 +83,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/caption.hxx b/sw/source/ui/inc/caption.hxx index b27dfd1208..16e0a2c772 100644 --- a/sw/source/ui/inc/caption.hxx +++ b/sw/source/ui/inc/caption.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,17 +29,10 @@ #define _CAPTION_HXX #include <tools/string.hxx> -//#ifndef _STREAM_HXX //autogen -//#include <tools/stream.hxx> -//#endif #include <tools/globname.hxx> #include <SwCapObjType.hxx> #include "swdllapi.h" -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - class SW_DLLPUBLIC InsCaptionOpt { private: @@ -116,3 +110,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/cfgdesc.hxx b/sw/source/ui/inc/cfgdesc.hxx index 994b6d1245..e93d5135fd 100644 --- a/sw/source/ui/inc/cfgdesc.hxx +++ b/sw/source/ui/inc/cfgdesc.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -65,5 +66,6 @@ inline String SwCfgDesc::GetFuncText() const { return aFuncText; } inline String SwCfgDesc::GetMacro() const { return aFuncText; } inline String SwCfgDesc::GetLib() const { return aLibName; } - #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/cfgid.h b/sw/source/ui/inc/cfgid.h index 9496aa6373..b8b794b7b7 100644 --- a/sw/source/ui/inc/cfgid.h +++ b/sw/source/ui/inc/cfgid.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,3 +39,5 @@ #define CFG_SWGLOBAL_MENU (SFX_ITEMTYPE_SW_BEGIN +29) #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/cfgitems.hxx b/sw/source/ui/inc/cfgitems.hxx index 8e58540f62..25aa2962da 100644 --- a/sw/source/ui/inc/cfgitems.hxx +++ b/sw/source/ui/inc/cfgitems.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,7 +37,7 @@ class SwWriterApp; class SwModule; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 class SwTestTabPage; #endif class SwAddPrinterTabPage; @@ -50,7 +51,6 @@ class SwDocEditDialog; SfxPrinter* GetPrt( ViewShell* ); void SetPrt( SfxPrinter* ); - /*--------OS 12.01.95 ----------------------------------- Item fuer Einstellungsdialog - Dokumentanzeige --------------------------------------------------------- */ @@ -87,6 +87,7 @@ public: void operator=( const SwDocDisplayItem& ); void FillViewOptions( SwViewOption& rVOpt) const; }; + /*--------OS 12.01.95 ----------------------------------- Item fuer Einstellungsdialog, Elementeseite --------------------------------------------------------- */ @@ -127,10 +128,10 @@ public: void FillViewOptions( SwViewOption& rVOpt) const; }; + /*--------OS 12.01.95 ----------------------------------- Item fuer Einstellungsdialog - Drucker/Zusaetze --------------------------------------------------------- */ - class SW_DLLPUBLIC SwAddPrinterItem : public SfxPoolItem, public SwPrintData { friend class SwAddPrinterTabPage; @@ -175,11 +176,9 @@ public: }; - /*--------OS 12.01.95 ----------------------------------- Item fuer Einstellungsdialog, ShadowCursorSeite --------------------------------------------------------- */ - class SW_DLLPUBLIC SwShadowCursorItem : public SfxPoolItem { sal_uInt8 eMode; @@ -204,7 +203,8 @@ public: void SetOn( sal_Bool bFlag ) { bOn = bFlag; } }; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 + /*--------OS 12.01.95 ----------------------------------- Item fuer Einstellungsdialog - Testeinstellungen --------------------------------------------------------- */ @@ -239,4 +239,4 @@ public: #endif - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/changedb.hxx b/sw/source/ui/inc/changedb.hxx index 7720f6e817..de7a678dbc 100644 --- a/sw/source/ui/inc/changedb.hxx +++ b/sw/source/ui/inc/changedb.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,20 +29,13 @@ #define _CHANGEDB_HXX -#ifndef _BITMAP_HXX //autogen #include <vcl/bitmap.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif #include <svtools/stdctrl.hxx> #include <svtools/svtreebx.hxx> #include <svx/stddlg.hxx> #include "dbtree.hxx" -#include <vcl/fixed.hxx> class SwFldMgr; class SwView; @@ -51,7 +45,6 @@ struct SwDBData; /*-------------------------------------------------------------------- Beschreibung: Datenbank an Feldern austauschen --------------------------------------------------------------------*/ - class SwChangeDBDlg: public SvxStandardDialog { FixedLine aDBListFL; @@ -66,10 +59,8 @@ class SwChangeDBDlg: public SvxStandardDialog OKButton aOKBT; CancelButton aCancelBT; HelpButton aHelpBT; -// PushButton aChangeBT; ImageList aImageList; - ImageList aImageListHC; SwWrtShell *pSh; SwFldMgr *pMgr; @@ -90,3 +81,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/chartins.hxx b/sw/source/ui/inc/chartins.hxx index db4abe27a7..668f587e60 100644 --- a/sw/source/ui/inc/chartins.hxx +++ b/sw/source/ui/inc/chartins.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,3 +34,4 @@ void SwInsertChart( Window *pParent, SfxBindings *pBindings ); #endif /*_CHARTINS_HXX*/ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/chldwrap.hxx b/sw/source/ui/inc/chldwrap.hxx index b6c274c917..a7ff87fc54 100644 --- a/sw/source/ui/inc/chldwrap.hxx +++ b/sw/source/ui/inc/chldwrap.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,3 +54,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/chrdlg.hxx b/sw/source/ui/inc/chrdlg.hxx index 242c91f6d4..55b853047b 100644 --- a/sw/source/ui/inc/chrdlg.hxx +++ b/sw/source/ui/inc/chrdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,29 +29,17 @@ #define _SWCHARDLG_HXX #include <sfx2/tabdlg.hxx> -#ifndef _GROUP_HXX //autogen #include <vcl/group.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif -#ifndef _COMBOBOX_HXX //autogen #include <vcl/combobox.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif class SwView; class SvxMacroItem; @@ -117,3 +106,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/cnttab.hxx b/sw/source/ui/inc/cnttab.hxx index f6c9e4c19a..4343efd2f3 100644 --- a/sw/source/ui/inc/cnttab.hxx +++ b/sw/source/ui/inc/cnttab.hxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -29,32 +30,24 @@ #include <svx/stddlg.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif #include <vcl/lstbox.hxx> #include <sfx2/tabdlg.hxx> #include "tox.hxx" -#include <tools/list.hxx> #include <toxmgr.hxx> #include <svx/checklbx.hxx> #include <tools/resary.hxx> #include <svtools/svtreebx.hxx> #include <vcl/menubtn.hxx> #include <svx/langbox.hxx> + #define TOX_PAGE_SELECT 1 #define TOX_PAGE_ENTRY 2 #define TOX_PAGE_STYLES 3 @@ -88,3 +81,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/colex.hxx b/sw/source/ui/inc/colex.hxx index e57b62f489..2e95573372 100644 --- a/sw/source/ui/inc/colex.hxx +++ b/sw/source/ui/inc/colex.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,9 +37,6 @@ class SwColMgr; class SfxItemSet; -/* -----------------------------08.02.2002 11:32------------------------------ - - ---------------------------------------------------------------------------*/ class SW_DLLPUBLIC SwPageExample : public SvxPageWindow { public: @@ -48,10 +46,9 @@ public: void UpdateExample( const SfxItemSet& rSet ); }; -/* -----------------------------08.02.2002 11:34------------------------------ - ---------------------------------------------------------------------------*/ class SwTextGridItem; + class SW_DLLPUBLIC SwPageGridExample : public SwPageExample { SwTextGridItem* pGridItem; @@ -68,9 +65,6 @@ public: ~SwPageGridExample(); void UpdateExample( const SfxItemSet& rSet ); }; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ class SW_DLLPUBLIC SwColExample : public SwPageExample { @@ -94,9 +88,6 @@ public: } }; -/*-----------------25.10.96 08.23------------------- - ---------------------------------------------------*/ class SW_DLLPUBLIC SwColumnOnlyExample : public Window { private: @@ -116,3 +107,5 @@ public: }; #endif // _COLEX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/colmgr.hxx b/sw/source/ui/inc/colmgr.hxx index 72a3b3a45b..2488d270e2 100644 --- a/sw/source/ui/inc/colmgr.hxx +++ b/sw/source/ui/inc/colmgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -81,11 +82,11 @@ private: }; // INLINE METHODE -------------------------------------------------------- - inline sal_uInt16 SwColMgr::GetCount() const { return aFmtCol.GetNumCols(); } + inline void SwColMgr::SetLineWidthAndColor(sal_uLong nLWidth, const Color& rCol) { aFmtCol.SetLineWidth(nLWidth); @@ -95,14 +96,17 @@ inline sal_uLong SwColMgr::GetLineWidth() const { return aFmtCol.GetLineWidth(); } + inline const Color& SwColMgr::GetLineColor() const { return aFmtCol.GetLineColor(); } + inline SwColLineAdj SwColMgr::GetAdjust() const { return aFmtCol.GetLineAdj(); } + inline void SwColMgr::SetAdjust(SwColLineAdj eAdj) { aFmtCol.SetLineAdj(eAdj); @@ -115,6 +119,7 @@ inline void SwColMgr::SetAutoWidth(sal_Bool bOn, sal_uInt16 nGutterWidth) { aFmtCol.SetOrtho(bOn, nGutterWidth, nWidth); } + inline void SwColMgr::NoCols() { aFmtCol.GetColumns().DeleteAndDestroy(0, aFmtCol.GetColumns().Count()); @@ -123,9 +128,12 @@ inline sal_Bool SwColMgr::HasLine() const { return GetAdjust() != COLADJ_NONE; } + inline void SwColMgr::SetNoLine() { SetAdjust(COLADJ_NONE); } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/column.hxx b/sw/source/ui/inc/column.hxx index 193bfe0ef7..436fad884e 100644 --- a/sw/source/ui/inc/column.hxx +++ b/sw/source/ui/inc/column.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,28 +30,14 @@ #define _COLUMN_HXX -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif -#ifndef _IMAGE_HXX //autogen #include <vcl/image.hxx> -#endif -#ifndef _GROUP_HXX //autogen #include <vcl/group.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <vcl/timer.hxx> -#ifndef _IMAGEBTN_HXX //autogen #include <vcl/button.hxx> -#endif #include <svtools/ctrlbox.hxx> #include <svtools/valueset.hxx> #include <sfx2/basedlgs.hxx> @@ -63,9 +50,6 @@ const int nMaxCols = 99; class SwColMgr; class SwWrtShell; class SwColumnPage; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ class SwColumnDlg : public SfxModalDialog { @@ -103,9 +87,6 @@ public: SwWrtShell& GetWrtShell() { return rWrtShell; } }; -/*-----------------07.03.97 08.26------------------- - ---------------------------------------------------*/ class ColumnValueSet : public ValueSet { public: @@ -225,3 +206,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/conarc.hxx b/sw/source/ui/inc/conarc.hxx index ec9d403afd..56204a2a41 100644 --- a/sw/source/ui/inc/conarc.hxx +++ b/sw/source/ui/inc/conarc.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,4 @@ public: #endif // _CONARC_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/concustomshape.hxx b/sw/source/ui/inc/concustomshape.hxx index 2a753fd957..e2dd43bb46 100644 --- a/sw/source/ui/inc/concustomshape.hxx +++ b/sw/source/ui/inc/concustomshape.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,3 +71,4 @@ class ConstCustomShape : public SwDrawBase #endif // _SW_CONRECT_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/condedit.hxx b/sw/source/ui/inc/condedit.hxx index b7d31c312d..aa4014f025 100644 --- a/sw/source/ui/inc/condedit.hxx +++ b/sw/source/ui/inc/condedit.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,16 +28,10 @@ #ifndef _CONDEDTI_HXX #define _CONDEDTI_HXX -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif #include <svtools/transfer.hxx> #include "swdllapi.h" -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - class SW_DLLPUBLIC ConditionEdit : public Edit, public DropTargetHelper { sal_Bool bBrackets, bEnableDrop; @@ -55,18 +50,4 @@ public: #endif - - - - - - - - - - - - - - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/conform.hxx b/sw/source/ui/inc/conform.hxx index a2160ec90c..28914d60eb 100644 --- a/sw/source/ui/inc/conform.hxx +++ b/sw/source/ui/inc/conform.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,3 +46,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/conpoly.hxx b/sw/source/ui/inc/conpoly.hxx index e1b58069b4..bcfb77e31f 100644 --- a/sw/source/ui/inc/conpoly.hxx +++ b/sw/source/ui/inc/conpoly.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,3 +54,4 @@ public: #endif // _CONPOLY_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/conrect.hxx b/sw/source/ui/inc/conrect.hxx index 2d4600b6cf..a5ef397315 100644 --- a/sw/source/ui/inc/conrect.hxx +++ b/sw/source/ui/inc/conrect.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -58,3 +59,4 @@ class ConstRectangle : public SwDrawBase #endif // _SW_CONRECT_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/content.hxx b/sw/source/ui/inc/content.hxx index 570dc8fbfd..5c75666565 100644 --- a/sw/source/ui/inc/content.hxx +++ b/sw/source/ui/inc/content.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #include <limits.h> // USHRT_MAX #include "swcont.hxx" -#ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> -#endif class SwWrtShell; class SwContentArr; @@ -223,3 +222,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/conttree.hxx b/sw/source/ui/inc/conttree.hxx index 74fa11e069..f6e8468d4a 100644 --- a/sw/source/ui/inc/conttree.hxx +++ b/sw/source/ui/inc/conttree.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,6 +31,8 @@ #include <svtools/svtreebx.hxx> #include "swcont.hxx" +#include <map> + class SwWrtShell; class SwContentType; class SwNavigationPI; @@ -74,6 +77,8 @@ class SwContentTree : public SvTreeListBox SwWrtShell* pActiveShell; // die aktive oder eine konst. offene View SwNavigationConfig* pConfig; + std::map< void*, sal_Bool > mOutLineNodeMap; + sal_Int32 nActiveBlock; sal_uInt16 nHiddenBlock; sal_uInt16 nRootType; @@ -103,7 +108,6 @@ class SwContentTree : public SvTreeListBox using SvListView::Select; protected: -// virtual void Command( const CommandEvent& rCEvt ); virtual void RequestHelp( const HelpEvent& rHEvt ); virtual void InitEntry(SvLBoxEntry*,const XubString&,const Image&,const Image&,SvLBoxButtonKind); virtual void DataChanged( const DataChangedEvent& rDCEvt ); @@ -191,7 +195,6 @@ public: SwWrtShell* GetHiddenWrtShell() {return pHiddenShell;} DECL_LINK( ContentDoubleClickHdl, SwContentTree * ); -// DECL_LINK( PopupHdl, Menu* ); DECL_LINK( TimerUpdate, Timer * ); virtual long GetTabPos( SvLBoxEntry*, SvLBoxTab* ); @@ -332,3 +335,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/convert.hxx b/sw/source/ui/inc/convert.hxx index 5b80bdc2b7..b6b3ff07d7 100644 --- a/sw/source/ui/inc/convert.hxx +++ b/sw/source/ui/inc/convert.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #define _SW_CONVERT_HXX #include <vcl/fixed.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <vcl/edit.hxx> #include <sfx2/basedlgs.hxx> #include <textcontrolcombo.hxx> @@ -89,3 +88,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/cption.hxx b/sw/source/ui/inc/cption.hxx index 96b0bd0911..b6fe3e7ef9 100644 --- a/sw/source/ui/inc/cption.hxx +++ b/sw/source/ui/inc/cption.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,25 +30,15 @@ #include <svx/stddlg.hxx> -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif -#ifndef _GROUP_HXX //autogen #include <vcl/group.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <actctrl.hxx> @@ -135,3 +126,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/dbconfig.hxx b/sw/source/ui/inc/dbconfig.hxx index 39efabdef4..2b64258983 100644 --- a/sw/source/ui/inc/dbconfig.hxx +++ b/sw/source/ui/inc/dbconfig.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,3 +53,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/dbinsdlg.hxx b/sw/source/ui/inc/dbinsdlg.hxx index 0df623f927..e299bff0ab 100644 --- a/sw/source/ui/inc/dbinsdlg.hxx +++ b/sw/source/ui/inc/dbinsdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,18 +30,10 @@ #define _DBINSDLG_HXX -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _GROUP_HXX //autogen #include <vcl/group.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif #include <vcl/lstbox.hxx> #include <svtools/svmedit.hxx> #include <sfx2/basedlgs.hxx> @@ -186,3 +179,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/dbtree.hxx b/sw/source/ui/inc/dbtree.hxx index 6060fefc0b..d5d73c3962 100644 --- a/sw/source/ui/inc/dbtree.hxx +++ b/sw/source/ui/inc/dbtree.hxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -43,7 +44,6 @@ class SwWrtShell; class SW_DLLPUBLIC SwDBTreeList : public SvTreeListBox { ImageList aImageList; - ImageList aImageListHC; Image aDBBMP; Image aTableBMP; Image aQueryBMP; @@ -78,9 +78,10 @@ public: void ShowColumns(sal_Bool bShowCol); void SetWrtShell(SwWrtShell& rSh); - + void AddDataSource(const String& rSource); }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/dbui.hxx b/sw/source/ui/inc/dbui.hxx index fda482126a..0a490f9a8f 100644 --- a/sw/source/ui/inc/dbui.hxx +++ b/sw/source/ui/inc/dbui.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #include <svx/stddlg.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <vcl/fixed.hxx> @@ -84,3 +83,4 @@ private: //member #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/dialmgr.hxx b/sw/source/ui/inc/dialmgr.hxx index a5e8bb8864..dba1a87833 100644 --- a/sw/source/ui/inc/dialmgr.hxx +++ b/sw/source/ui/inc/dialmgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,6 +35,7 @@ // forward --------------------------------------------------------------- class ResMgr; + struct SwDialogsResMgr { static ResMgr* GetResMgr(); @@ -46,3 +48,4 @@ struct SwDialogsResMgr #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/docfnote.hxx b/sw/source/ui/inc/docfnote.hxx index 16eb6288e8..526ad17571 100644 --- a/sw/source/ui/inc/docfnote.hxx +++ b/sw/source/ui/inc/docfnote.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,3 +49,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/docstdlg.hxx b/sw/source/ui/inc/docstdlg.hxx index d0efa37179..ac5af01c14 100644 --- a/sw/source/ui/inc/docstdlg.hxx +++ b/sw/source/ui/inc/docstdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #include <sfx2/tabdlg.hxx> -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif #include <svtools/stdctrl.hxx> #include "docstat.hxx" @@ -39,7 +38,6 @@ /*-------------------------------------------------------------------- Beschreibung: DocInfo jetzt als Page --------------------------------------------------------------------*/ - class SwDocStatPage: public SfxTabPage { public: @@ -82,3 +80,5 @@ private: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/drawbase.hxx b/sw/source/ui/inc/drawbase.hxx index fbf9a5090f..47f7a2d11d 100644 --- a/sw/source/ui/inc/drawbase.hxx +++ b/sw/source/ui/inc/drawbase.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -88,3 +89,4 @@ public: #endif // _SW_DRAWBASE_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/drawsh.hxx b/sw/source/ui/inc/drawsh.hxx index 13f5c6a071..fc39b69bac 100644 --- a/sw/source/ui/inc/drawsh.hxx +++ b/sw/source/ui/inc/drawsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,3 +51,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/drformsh.hxx b/sw/source/ui/inc/drformsh.hxx index 863f88f6a4..ca08eb8b54 100644 --- a/sw/source/ui/inc/drformsh.hxx +++ b/sw/source/ui/inc/drformsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,3 +46,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/drpcps.hxx b/sw/source/ui/inc/drpcps.hxx index 62df044473..908fdeb7df 100644 --- a/sw/source/ui/inc/drpcps.hxx +++ b/sw/source/ui/inc/drpcps.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,25 +31,15 @@ #include <sfx2/basedlgs.hxx> #include <sfx2/tabdlg.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif class SwWrtShell; @@ -123,3 +114,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/drwbassh.hxx b/sw/source/ui/inc/drwbassh.hxx index 455594fc3c..3e9cae0570 100644 --- a/sw/source/ui/inc/drwbassh.hxx +++ b/sw/source/ui/inc/drwbassh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,3 +63,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/drwtxtsh.hxx b/sw/source/ui/inc/drwtxtsh.hxx index a08222bd58..834014452e 100644 --- a/sw/source/ui/inc/drwtxtsh.hxx +++ b/sw/source/ui/inc/drwtxtsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -84,3 +85,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/dselect.hxx b/sw/source/ui/inc/dselect.hxx index 76775fac05..165ae46f92 100644 --- a/sw/source/ui/inc/dselect.hxx +++ b/sw/source/ui/inc/dselect.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,3 +51,4 @@ class DrawSelection : public SwDrawBase #endif // _SW_DSELECT_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/edtwin.hxx b/sw/source/ui/inc/edtwin.hxx index 97de8e3d2a..87031f5bd3 100644 --- a/sw/source/ui/inc/edtwin.hxx +++ b/sw/source/ui/inc/edtwin.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -305,3 +306,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/envimg.hxx b/sw/source/ui/inc/envimg.hxx index 6497f00615..4b0ddc85a7 100644 --- a/sw/source/ui/inc/envimg.hxx +++ b/sw/source/ui/inc/envimg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,11 +33,9 @@ #include "swdllapi.h" // MakeSender ----------------------------------------------------------------- - SW_DLLPUBLIC String MakeSender(); // enum ----------------------------------------------------------------------- - enum SwEnvAlign { ENV_HOR_LEFT = 0, @@ -48,7 +47,6 @@ enum SwEnvAlign }; // class SwEnvItem ------------------------------------------------------------ - class SW_DLLPUBLIC SwEnvItem : public SfxPoolItem { public: @@ -77,8 +75,8 @@ public: virtual int operator ==(const SfxPoolItem& rItem) const; virtual SfxPoolItem* Clone(SfxItemPool* = 0) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); }; // class SwEnvCfgItem ------------------------------------------------------- @@ -96,5 +94,7 @@ public: virtual void Commit(); virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); }; + #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/envlop.hxx b/sw/source/ui/inc/envlop.hxx index 2d4ccf0a16..3036a07006 100644 --- a/sw/source/ui/inc/envlop.hxx +++ b/sw/source/ui/inc/envlop.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,26 +28,16 @@ #ifndef _ENVLOP_HXX #define _ENVLOP_HXX -#ifndef _SV_MEDIT_HXX #include <svtools/svmedit.hxx> -#endif #include <sfx2/tabdlg.hxx> -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#ifndef _IMAGEBTN_HXX //autogen #include <vcl/button.hxx> -#endif #include "envimg.hxx" @@ -59,7 +50,6 @@ class SwWrtShell; class Printer; // class SwEnvPreview --------------------------------------------------------- - class SwEnvPreview : public Window { void Paint(const Rectangle&); @@ -74,7 +64,6 @@ protected: }; // class SwEnvDlg ----------------------------------------------------------- - class SwEnvDlg : public SfxTabDialog { friend class SwEnvPage; @@ -99,7 +88,6 @@ public: }; // class SwEnvPage ---------------------------------------------------------- - class SwEnvPage : public SfxTabPage { FixedText aAddrText; @@ -146,4 +134,4 @@ public: #endif - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/extedit.hxx b/sw/source/ui/inc/extedit.hxx new file mode 100644 index 0000000000..d013890a33 --- /dev/null +++ b/sw/source/ui/inc/extedit.hxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * [ Surendran Mahendran <surenspost@gmail.com>] + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#ifndef _EXTEDIT_HXX +#define _EXTEDIT_HXX + +#include <osl/file.hxx> +#include <osl/process.h> +#include <vcl/graph.hxx> +#include <svtools/grfmgr.hxx> +#include <wrtsh.hxx> +#include <vcl/timer.hxx> + +struct Data +{ + GraphicObject *pGraphicObject; + rtl::OUString fileName; + SwWrtShell *rSh ; +}; + +class ExternalProcessClass_Impl +{ + public: + DECL_LINK( CloseEvent, void *pEvent ); + DECL_LINK( StartListeningEvent, void *pEvent ); +}; + +void EditWithExternalTool(GraphicObject *pGraphic, SwWrtShell *rSh); + +#endif diff --git a/sw/source/ui/inc/fldedt.hxx b/sw/source/ui/inc/fldedt.hxx index c71be21464..9caf4b6dff 100644 --- a/sw/source/ui/inc/fldedt.hxx +++ b/sw/source/ui/inc/fldedt.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,10 +33,6 @@ class SwView; class SwWrtShell; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - class SwFldEditDlg : public SfxSingleTabDialog { SwWrtShell* pSh; @@ -62,5 +59,6 @@ public: void InsertHdl(); }; - #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/fldmgr.hxx b/sw/source/ui/inc/fldmgr.hxx index 76cc1cf2ed..6689bfd33c 100644 --- a/sw/source/ui/inc/fldmgr.hxx +++ b/sw/source/ui/inc/fldmgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,10 +53,10 @@ class SbModule; class SvxMacroItem; class SvNumberFormatter; class Window; + /*-------------------------------------------------------------------- Beschreibung: Die Gruppen von Feldern --------------------------------------------------------------------*/ - enum SwFldGroups { GRP_DOC, @@ -229,6 +230,6 @@ inline const String& SwFldMgr::GetCurFldPar2() const inline sal_uLong SwFldMgr::GetCurFldFmt() const { return nCurFmt; } - #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/fldtdlg.hxx b/sw/source/ui/inc/fldtdlg.hxx index 5fac8a67a6..2d2349a4f9 100644 --- a/sw/source/ui/inc/fldtdlg.hxx +++ b/sw/source/ui/inc/fldtdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,10 +34,6 @@ class SfxTabPage; class SwChildWinWrapper; struct SfxChildWinInfo; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - class SwFldDlg: public SfxTabDialog { SwChildWinWrapper* m_pChildWin; @@ -66,3 +63,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/fldwrap.hxx b/sw/source/ui/inc/fldwrap.hxx index e7c62bd4b8..4bf4117e21 100644 --- a/sw/source/ui/inc/fldwrap.hxx +++ b/sw/source/ui/inc/fldwrap.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,6 +43,7 @@ public: virtual sal_Bool ReInitDlg(SwDocShell *pDocSh); void ShowPage(sal_uInt16 nPage = 0); }; + /* -----------------04.02.2003 14:14----------------- * field dialog only showing database page to support * mail merge @@ -58,6 +60,6 @@ public: virtual sal_Bool ReInitDlg(SwDocShell *pDocSh); }; - #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/fontcfg.hxx b/sw/source/ui/inc/fontcfg.hxx index 8f6d198e07..ce7dbb1505 100644 --- a/sw/source/ui/inc/fontcfg.hxx +++ b/sw/source/ui/inc/fontcfg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,7 +31,7 @@ #include <unotools/configitem.hxx> #include <tools/string.hxx> #include <i18npool/lang.h> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "swdllapi.h" #define FONT_STANDARD 0 @@ -58,6 +59,7 @@ //pt-size of fonts #define FONTSIZE_DEFAULT 240 +#define FONTSIZE_CJK_DEFAULT 210 #define FONTSIZE_OUTLINE 280 @@ -118,3 +120,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/formatclipboard.hxx b/sw/source/ui/inc/formatclipboard.hxx index b01ef7c58b..0de096964c 100644 --- a/sw/source/ui/inc/formatclipboard.hxx +++ b/sw/source/ui/inc/formatclipboard.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,3 +68,5 @@ private: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/formedt.hxx b/sw/source/ui/inc/formedt.hxx index 14f13e3266..2d07f60d88 100644 --- a/sw/source/ui/inc/formedt.hxx +++ b/sw/source/ui/inc/formedt.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,21 +30,13 @@ #include <svx/stddlg.hxx> -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif #include "toxe.hxx" @@ -53,7 +46,6 @@ class SwForm; /*-------------------------------------------------------------------- Beschreibung: Markierung fuer Verzeichniseintrag einfuegen --------------------------------------------------------------------*/ - class SwIdxFormDlg : public SvxStandardDialog { DECL_LINK( EntryHdl, Button * ); @@ -106,3 +98,5 @@ inline const SwForm& SwIdxFormDlg::GetTOXForm() } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/frmdlg.hxx b/sw/source/ui/inc/frmdlg.hxx index e002c1f6c4..75f3f477b9 100644 --- a/sw/source/ui/inc/frmdlg.hxx +++ b/sw/source/ui/inc/frmdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,7 +36,6 @@ class SwWrtShell; /*-------------------------------------------------------------------- Beschreibung: Rahmendialog --------------------------------------------------------------------*/ - class SwFrmDlg : public SfxTabDialog { sal_Bool m_bFormat; @@ -63,5 +63,6 @@ public: inline SwWrtShell* GetWrtShell() { return m_pWrtShell; } }; - #endif // _FRMDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/frmmgr.hxx b/sw/source/ui/inc/frmmgr.hxx index 372055d755..15a1f71a47 100644 --- a/sw/source/ui/inc/frmmgr.hxx +++ b/sw/source/ui/inc/frmmgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -194,3 +195,5 @@ inline sal_uInt16 SwFlyFrmAttrMgr::GetHeightPercent() const } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx index 5706b8a912..2cc63a3c60 100644 --- a/sw/source/ui/inc/frmpage.hxx +++ b/sw/source/ui/inc/frmpage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,7 +41,6 @@ #include <prcntfld.hxx> #include <globals.hrc> - namespace sfx2{class FileDialogHelper;} class SwWrtShell; struct FrmMap; @@ -50,7 +50,6 @@ struct SwPosition; /*-------------------------------------------------------------------- Beschreibung: Rahmendialog --------------------------------------------------------------------*/ - class SwFrmPage: public SfxTabPage { // Size @@ -248,7 +247,6 @@ public: virtual int DeactivatePage(SfxItemSet *pSet); }; - class SwFrmURLPage : public SfxTabPage { //Hyperlink @@ -283,10 +281,6 @@ public: virtual void Reset(const SfxItemSet &rSet); }; -/*-----------------13.11.96 12.59------------------- - ---------------------------------------------------*/ - class SwFrmAddPage : public SfxTabPage { FixedLine aNamesFL; @@ -340,3 +334,5 @@ public: }; #endif // _FRMPAGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/frmsh.hxx b/sw/source/ui/inc/frmsh.hxx index 08bca4af76..5eeb05538e 100644 --- a/sw/source/ui/inc/frmsh.hxx +++ b/sw/source/ui/inc/frmsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,3 +49,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/globals.h b/sw/source/ui/inc/globals.h index d176d54163..7a404392ab 100644 --- a/sw/source/ui/inc/globals.h +++ b/sw/source/ui/inc/globals.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,3 +36,5 @@ enum SwChangeState }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/glosbib.hxx b/sw/source/ui/inc/glosbib.hxx index f9dcd54ace..cc675c6986 100644 --- a/sw/source/ui/inc/glosbib.hxx +++ b/sw/source/ui/inc/glosbib.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,19 +29,13 @@ #ifndef _GLOSBIB_HXX #define _GLOSBIB_HXX -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif #include <svx/stddlg.hxx> -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif #include <svtools/svtabbx.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <vcl/fixed.hxx> class SwGlossaryHdl; @@ -54,15 +49,14 @@ class FEdit : public Edit virtual void KeyInput( const KeyEvent& rKEvent ); }; -/* -----------------------------08.02.00 15:04-------------------------------- - ---------------------------------------------------------------------------*/ struct GlosBibUserData { String sPath; String sGroupName; String sGroupTitle; }; + class SwGlossaryGroupTLB : public SvTabListBox { public: @@ -115,6 +109,6 @@ public: const String& GetCreatedGroupName() const {return sCreatedGroup;} }; - #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/glosdoc.hxx b/sw/source/ui/inc/glosdoc.hxx index 2e0e6faa1b..e2fc4f378e 100644 --- a/sw/source/ui/inc/glosdoc.hxx +++ b/sw/source/ui/inc/glosdoc.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -146,3 +147,5 @@ public: #endif // _GLOSDOC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/gloshdl.hxx b/sw/source/ui/inc/gloshdl.hxx index bb4e332721..ebc869fa9e 100644 --- a/sw/source/ui/inc/gloshdl.hxx +++ b/sw/source/ui/inc/gloshdl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -108,3 +109,5 @@ public: }; #endif // _GLOSHDL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/gloslst.hxx b/sw/source/ui/inc/gloslst.hxx index 20eef122da..d216b23386 100644 --- a/sw/source/ui/inc/gloslst.hxx +++ b/sw/source/ui/inc/gloslst.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -87,3 +88,4 @@ public: +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/glossary.hxx b/sw/source/ui/inc/glossary.hxx index 7dcda31bd0..335f691f7b 100644 --- a/sw/source/ui/inc/glossary.hxx +++ b/sw/source/ui/inc/glossary.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,32 +28,16 @@ #ifndef _GLOSSARY_HXX #define _GLOSSARY_HXX -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif #include <svtools/svtreebx.hxx> #include <svx/stddlg.hxx> -#ifndef _BUTTON_HXX //autogen -#include <vcl/button.hxx> -#endif -#include <vcl/fixed.hxx> - -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif - -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _COMBOBOX_HXX //autogen #include <vcl/combobox.hxx> -#endif -#ifndef _MENUBTN_HXX //autogen #include <vcl/menubtn.hxx> -#endif #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp> @@ -195,3 +180,4 @@ inline String SwGlossaryDlg::GetCurrShortName() const #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/glshell.hxx b/sw/source/ui/inc/glshell.hxx index 1f908bb1d6..ffdcdd61c3 100644 --- a/sw/source/ui/inc/glshell.hxx +++ b/sw/source/ui/inc/glshell.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -112,3 +113,4 @@ public: +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/grfsh.hxx b/sw/source/ui/inc/grfsh.hxx index 7c1e576ebb..3bbe9e3e5e 100644 --- a/sw/source/ui/inc/grfsh.hxx +++ b/sw/source/ui/inc/grfsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,3 +43,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/hidfunc.h b/sw/source/ui/inc/hidfunc.h index 9766f35f2c..0dd616e223 100644 --- a/sw/source/ui/inc/hidfunc.h +++ b/sw/source/ui/inc/hidfunc.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -348,3 +349,5 @@ #define HID_FAX_WIZZARD 1661 #define HID_LETTER_WIZZARD 1660 #define HID_LAUNCH_REGISTRY 1002 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/hyp.hxx b/sw/source/ui/inc/hyp.hxx index 6f06a22658..d8d49e0734 100644 --- a/sw/source/ui/inc/hyp.hxx +++ b/sw/source/ui/inc/hyp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -65,3 +66,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/idxmrk.hxx b/sw/source/ui/inc/idxmrk.hxx index 429db80af8..ff5c562705 100644 --- a/sw/source/ui/inc/idxmrk.hxx +++ b/sw/source/ui/inc/idxmrk.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,9 +34,6 @@ class SwWrtShell; -/* -----------------07.09.99 08:02------------------- - - --------------------------------------------------*/ class SwInsertIdxMarkWrapper : public SfxChildWindow { AbstractMarkFloatDlg* pAbstDlg; @@ -51,9 +49,6 @@ public: void ReInitDlg(SwWrtShell& rWrtShell); }; -/* -----------------07.09.99 08:02------------------- - - --------------------------------------------------*/ class SwInsertAuthMarkWrapper : public SfxChildWindow { AbstractMarkFloatDlg* pAbstDlg; @@ -71,3 +66,4 @@ public: #endif // _IDXMRK_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/imaildsplistener.hxx b/sw/source/ui/inc/imaildsplistener.hxx index 90d6e16450..f90a4b8b53 100644 --- a/sw/source/ui/inc/imaildsplistener.hxx +++ b/sw/source/ui/inc/imaildsplistener.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -75,3 +76,5 @@ public: }; #endif // INCLUDED_IMAILDISPATCHERLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/initui.hxx b/sw/source/ui/inc/initui.hxx index 215ca60392..6e4acd3bb4 100644 --- a/sw/source/ui/inc/initui.hxx +++ b/sw/source/ui/inc/initui.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,3 +78,5 @@ extern void _FinitSpell(); #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/inpdlg.hxx b/sw/source/ui/inc/inpdlg.hxx index 7288fb5474..29159a53bb 100644 --- a/sw/source/ui/inc/inpdlg.hxx +++ b/sw/source/ui/inc/inpdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,13 +30,9 @@ #include <svx/stddlg.hxx> -#ifndef _SV_SVMEDIT_HXX //autogen #include <svtools/svmedit.hxx> -#endif #include <vcl/fixed.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif class SwInputField; class SwSetExpField; @@ -76,3 +73,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/inputwin.hxx b/sw/source/ui/inc/inputwin.hxx index f51f133e4e..05f1896674 100644 --- a/sw/source/ui/inc/inputwin.hxx +++ b/sw/source/ui/inc/inputwin.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -131,3 +132,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/insfnote.hxx b/sw/source/ui/inc/insfnote.hxx index 908d2cca5e..dc5fdd4f7e 100644 --- a/sw/source/ui/inc/insfnote.hxx +++ b/sw/source/ui/inc/insfnote.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,13 +30,9 @@ #include <svx/stddlg.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif #include <vcl/fixed.hxx> class SwWrtShell; @@ -95,3 +92,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/insrule.hxx b/sw/source/ui/inc/insrule.hxx index 3b08a425a3..f06c057a15 100644 --- a/sw/source/ui/inc/insrule.hxx +++ b/sw/source/ui/inc/insrule.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ class SwRulerValueSet; class ValueSet; -/*-----------------14.02.97 12.30------------------- ---------------------------------------------------*/ class SwInsertGrfRulerDlg : public SfxModalDialog { FixedLine aSelectionFL; @@ -64,3 +63,4 @@ public: +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/instable.hxx b/sw/source/ui/inc/instable.hxx index 236b93d9e6..afa0303108 100644 --- a/sw/source/ui/inc/instable.hxx +++ b/sw/source/ui/inc/instable.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,18 +28,10 @@ #ifndef _INSTABLE_HXX #define _INSTABLE_HXX -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif #include <sfx2/basedlgs.hxx> #include <actctrl.hxx> #include <textcontrolcombo.hxx> @@ -98,3 +91,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/javaedit.hxx b/sw/source/ui/inc/javaedit.hxx index 22af3f255b..9a2f54c904 100644 --- a/sw/source/ui/inc/javaedit.hxx +++ b/sw/source/ui/inc/javaedit.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,21 +32,13 @@ #include <svx/stddlg.hxx> -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _SV_SVMEDIT_HXX //autogen #include <svtools/svmedit.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _IMAGEBTN_HXX //autogen #include <vcl/button.hxx> -#endif class SwWrtShell; class SwFldMgr; @@ -116,3 +109,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/label.hxx b/sw/source/ui/inc/label.hxx index 9d369151d5..4f180627ca 100644 --- a/sw/source/ui/inc/label.hxx +++ b/sw/source/ui/inc/label.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -97,3 +98,4 @@ inline void SwLabDlg::ReplaceGroup( const String &rMake ) #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/labelcfg.hxx b/sw/source/ui/inc/labelcfg.hxx index 17a2341746..f178c91fc8 100644 --- a/sw/source/ui/inc/labelcfg.hxx +++ b/sw/source/ui/inc/labelcfg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,3 +58,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/labimg.hxx b/sw/source/ui/inc/labimg.hxx index 91162ff271..c36538b1d3 100644 --- a/sw/source/ui/inc/labimg.hxx +++ b/sw/source/ui/inc/labimg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,8 +34,8 @@ #include "swdllapi.h" // class SwLabItem ---------------------------------------------------------- - class SwLabCfgItem; + class SW_DLLPUBLIC SwLabItem : public SfxPoolItem { @@ -111,7 +112,6 @@ public: }; // class SwLabCfgItem ------------------------------------------------------- - class SwLabCfgItem : public utl::ConfigItem { SwLabItem aItem; @@ -129,3 +129,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/langhelper.hxx b/sw/source/ui/inc/langhelper.hxx index e92ade8947..9d2b8306a7 100755..100644 --- a/sw/source/ui/inc/langhelper.hxx +++ b/sw/source/ui/inc/langhelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -66,3 +67,5 @@ namespace SwLangHelper } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/linenum.hxx b/sw/source/ui/inc/linenum.hxx index 007d3ae0e1..a3a87aa11f 100644 --- a/sw/source/ui/inc/linenum.hxx +++ b/sw/source/ui/inc/linenum.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,9 +34,7 @@ #include <vcl/field.hxx> #include <numberingtypelistbox.hxx> -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif class Window; class SfxItemSet; @@ -45,7 +44,6 @@ class SwWrtShell; /*-------------------------------------------------------------------- Beschreibung: SingleTabDialog --------------------------------------------------------------------*/ - class SwLineNumberingDlg : public SfxSingleTabDialog { SwWrtShell* pSh; @@ -62,7 +60,6 @@ public: /*-------------------------------------------------------------------- Beschreibung: TabPage --------------------------------------------------------------------*/ - class SwLineNumberingPage : public SfxTabPage { CheckBox aNumberingOnCB; @@ -107,4 +104,4 @@ public: #endif - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/listsh.hxx b/sw/source/ui/inc/listsh.hxx index 8817b145e0..939f3cc6ef 100644 --- a/sw/source/ui/inc/listsh.hxx +++ b/sw/source/ui/inc/listsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,3 +43,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/macassgn.hxx b/sw/source/ui/inc/macassgn.hxx index 5ba025eb42..e1329564c4 100644 --- a/sw/source/ui/inc/macassgn.hxx +++ b/sw/source/ui/inc/macassgn.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,7 +35,7 @@ class SvxMacroItem; enum DlgEventType { - MACASSGN_TEXTBAUST, + MACASSGN_AUTOTEXT, MACASSGN_GRAPHIC, MACASSGN_OLE, MACASSGN_FRMURL, @@ -52,3 +53,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/mailconfigpage.hxx b/sw/source/ui/inc/mailconfigpage.hxx index a2b0c14202..7bdc45b6c9 100644 --- a/sw/source/ui/inc/mailconfigpage.hxx +++ b/sw/source/ui/inc/mailconfigpage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,25 +29,15 @@ #define _MAILCONFIGPAGE_HXX #include <sfx2/tabdlg.hxx> -#ifndef _BUTTON_HXX #include <vcl/button.hxx> -#endif -#ifndef _LSTBOX_HXX #include <vcl/lstbox.hxx> -#endif -#ifndef _FIELD_HXX #include <vcl/field.hxx> -#endif -#ifndef _FIXED_HXX #include <vcl/fixed.hxx> -#endif #include <sfx2/basedlgs.hxx> class SwTestAccountSettingsDialog; class SwMailMergeConfigItem; -/*-- 05.05.2004 16:45:45--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwMailConfigPage : public SfxTabPage { friend class SwTestAccountSettingsDialog; @@ -95,9 +86,6 @@ public: }; -/*-- 18.08.2004 12:02:02--------------------------------------------------- - - -----------------------------------------------------------------------*/ class SwMailConfigDlg : public SfxSingleTabDialog { public: @@ -108,3 +96,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/maildispatcher.hxx b/sw/source/ui/inc/maildispatcher.hxx index e2c0d9170b..5e1ec61335 100644 --- a/sw/source/ui/inc/maildispatcher.hxx +++ b/sw/source/ui/inc/maildispatcher.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,6 @@ #ifndef INCLUDED_MAILDISPATCHER_HXX #define INCLUDED_MAILDISPATCHER_HXX -//#ifndef _COM_SUN_STAR_MAIL_XMAILSERVER_HPP_ -//#include "com/sun/star/mail/XMailServer.hpp" -//#endif #include "com/sun/star/mail/XSmtpService.hpp" #include "com/sun/star/mail/XMailMessage.hpp" #include <osl/thread.hxx> @@ -166,3 +164,5 @@ private: }; #endif // INCLUDED_MAILDISPATCHER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/mailmergechildwindow.hxx b/sw/source/ui/inc/mailmergechildwindow.hxx index 2da588778f..83a9420f86 100644 --- a/sw/source/ui/inc/mailmergechildwindow.hxx +++ b/sw/source/ui/inc/mailmergechildwindow.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,6 @@ #include <vcl/toolbox.hxx> #include "swdllapi.h" -/*-- 25.05.2004 15:25:56--------------------------------------------------- - - -----------------------------------------------------------------------*/ class SwMailMergeChildWin : public SfxFloatingWindow { ToolBox m_aBackTB; @@ -47,10 +45,8 @@ public: virtual void FillInfo(SfxChildWinInfo&) const; }; -/*-- 25.05.2004 15:25:56--------------------------------------------------- - - -----------------------------------------------------------------------*/ class SwSendMailDialog; + class SwMailMergeChildWindow : public SfxChildWindow { public: @@ -64,3 +60,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/mailmergehelper.hxx b/sw/source/ui/inc/mailmergehelper.hxx index f8381bca2b..9aec2cb3e5 100644 --- a/sw/source/ui/inc/mailmergehelper.hxx +++ b/sw/source/ui/inc/mailmergehelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,8 +43,8 @@ #include <vcl/scrbar.hxx> #include "swdllapi.h" - class SwMailMergeConfigItem; + namespace com{ namespace sun{ namespace star{ namespace uno{ class XComponentContext; @@ -56,9 +57,7 @@ namespace com{ namespace sun{ namespace star{ class XMailService; } }}} -/*-- 14.06.2004 12:27:42--------------------------------------------------- - -----------------------------------------------------------------------*/ namespace SwMailMergeHelper { SW_DLLPUBLIC String CallSaveAsDialog(String& rFilter); @@ -70,9 +69,7 @@ namespace SwMailMergeHelper const String& rOutMailServerPassword, Window* pDialogParentWindow = 0 ); } -/* -----------------06.04.2004 10:29----------------- - --------------------------------------------------*/ class SW_DLLPUBLIC SwBoldFixedInfo : public FixedInfo { public: @@ -156,6 +153,7 @@ struct SwMergeAddressItem bIsColumn(false), bIsReturn(false) {} }; + class SW_DLLPUBLIC SwAddressIterator { String sAddress; @@ -167,9 +165,6 @@ public: bool HasMore() const{return sAddress.Len() > 0;} }; -/*-- 21.05.2004 10:31:15--------------------------------------------------- - - -----------------------------------------------------------------------*/ class SW_DLLPUBLIC SwAuthenticator : public cppu::WeakImplHelper1< ::com::sun::star::mail::XAuthenticator> { @@ -189,9 +184,7 @@ public: virtual ::rtl::OUString SAL_CALL getPassword( ) throw (::com::sun::star::uno::RuntimeException); }; -/*-- 25.08.2004 12:48:47--------------------------------------------------- - -----------------------------------------------------------------------*/ class SW_DLLPUBLIC SwConnectionContext : public cppu::WeakImplHelper1< ::com::sun::star::uno::XCurrentContext > { @@ -206,17 +199,13 @@ public: virtual ::com::sun::star::uno::Any SAL_CALL getValueByName( const ::rtl::OUString& Name ) throw (::com::sun::star::uno::RuntimeException); }; -/*-- 21.05.2004 10:39:20--------------------------------------------------- - -----------------------------------------------------------------------*/ class SwMutexBase { public: osl::Mutex m_aMutex; }; -/*-- 21.05.2004 10:39:20--------------------------------------------------- - -----------------------------------------------------------------------*/ class SW_DLLPUBLIC SwConnectionListener : public SwMutexBase, public cppu::WeakComponentImplHelper1< ::com::sun::star::mail::XConnectionListener > @@ -239,9 +228,6 @@ public: throw(com::sun::star::uno::RuntimeException); }; -/*-- 13.07.2004 09:02:12--------------------------------------------------- - - -----------------------------------------------------------------------*/ class SwMailTransferable : public SwMutexBase, public cppu::WeakComponentImplHelper2 @@ -281,9 +267,6 @@ class SwMailTransferable : }; -/*-- 22.06.2004 16:38:34--------------------------------------------------- - - -----------------------------------------------------------------------*/ class SwMailMessage : public SwMutexBase, public cppu::WeakComponentImplHelper1< ::com::sun::star::mail::XMailMessage > @@ -338,12 +321,11 @@ public: void SetSenderAddress(const ::rtl::OUString& rSenderAddress) {m_sSenderAddress = rSenderAddress;} }; -/*-- 21.05.2004 10:17:22--------------------------------------------------- - -----------------------------------------------------------------------*/ SW_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> getCurrentCmpCtx( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> rSrvMgr); #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/mailmergewizard.hxx b/sw/source/ui/inc/mailmergewizard.hxx index 123703f2fe..da0e68442b 100644 --- a/sw/source/ui/inc/mailmergewizard.hxx +++ b/sw/source/ui/inc/mailmergewizard.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -101,3 +102,4 @@ public: }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/mailmrge.hxx b/sw/source/ui/inc/mailmrge.hxx index cb5f51d788..b566ecffaf 100644 --- a/sw/source/ui/inc/mailmrge.hxx +++ b/sw/source/ui/inc/mailmrge.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,25 +30,15 @@ #include <svx/stddlg.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif #include <svtools/stdctrl.hxx> -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif #include <com/sun/star/uno/Sequence.h> #include <com/sun/star/uno/Reference.h> @@ -161,9 +152,7 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const; }; -/* -----------------27.11.2002 12:05----------------- - * - * --------------------------------------------------*/ + class SwMailMergeCreateFromDlg : public ModalDialog { FixedLine aCreateFromFL; @@ -179,9 +168,7 @@ public: sal_Bool IsThisDocument() const {return aThisDocRB.IsChecked();} }; -/* -----------------04.02.2003 13:41----------------- - * - * --------------------------------------------------*/ + class SwMailMergeFieldConnectionsDlg : public ModalDialog { FixedLine aConnectionsFL; @@ -202,3 +189,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/mediash.hxx b/sw/source/ui/inc/mediash.hxx index fb71c50e16..f90a18d551 100644 --- a/sw/source/ui/inc/mediash.hxx +++ b/sw/source/ui/inc/mediash.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,3 +42,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/mergetbl.hxx b/sw/source/ui/inc/mergetbl.hxx index 4d62673665..81cc96de77 100644 --- a/sw/source/ui/inc/mergetbl.hxx +++ b/sw/source/ui/inc/mergetbl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,13 +28,9 @@ #ifndef _MERGETBL_HXX #define _MERGETBL_HXX -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif #include <svx/stddlg.hxx> @@ -57,3 +54,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/misc.hrc b/sw/source/ui/inc/misc.hrc index 72db977303..6e71237edf 100644 --- a/sw/source/ui/inc/misc.hrc +++ b/sw/source/ui/inc/misc.hrc @@ -96,6 +96,7 @@ #define MN_REDLINE_POPUP (RC_MISC_BEGIN + 61) #define STR_REMOVE_WARNING (RC_MISC_BEGIN + 62) #define STRRES_NUMTYPES (RC_MISC_BEGIN + 63) +#define STR_MY_AUTOTEXT (RC_MISC_BEGIN + 64) #define MISC_ACT_END STRRES_NUMTYPES diff --git a/sw/source/ui/inc/mmconfigitem.hxx b/sw/source/ui/inc/mmconfigitem.hxx index 4d6a0cc2bf..ba2b202aea 100644 --- a/sw/source/ui/inc/mmconfigitem.hxx +++ b/sw/source/ui/inc/mmconfigitem.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,18 +45,17 @@ namespace com{namespace sun{namespace star{ class XColumnsSupplier; } }}} + class SwMailMergeConfigItem_Impl; class SwView; -/*-- 06.04.2004 10:43:35--------------------------------------------------- - - -----------------------------------------------------------------------*/ struct SwDocMergeInfo { long nStartPageInTarget; long nEndPageInTarget; long nDBRow; }; + class SW_DLLPUBLIC SwMailMergeConfigItem { // com::sun::star::uno::Sequence< ::rtl::OUString> m_aSavedDocuments; @@ -275,5 +275,7 @@ public: //helper methods ::rtl::OUString GetAssignedColumn(sal_uInt32 nColumn)const; }; + #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/multmrk.hxx b/sw/source/ui/inc/multmrk.hxx index cdbd0d702f..79413fe306 100644 --- a/sw/source/ui/inc/multmrk.hxx +++ b/sw/source/ui/inc/multmrk.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,20 +31,10 @@ #include <svx/stddlg.hxx> - -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif #include <svtools/stdctrl.hxx> - -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#include <vcl/fixed.hxx> - -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif class SwTOXMgr; @@ -75,3 +66,4 @@ public: #endif // _MULTMRK_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/navicfg.hxx b/sw/source/ui/inc/navicfg.hxx index c214f723c9..8306ea4549 100644 --- a/sw/source/ui/inc/navicfg.hxx +++ b/sw/source/ui/inc/navicfg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #define _NAVICFG_HXX #include <unotools/configitem.hxx> -/* -----------------------------08.09.00 16:27-------------------------------- - ---------------------------------------------------------------------------*/ class SwNavigationConfig : public utl::ConfigItem { sal_Int32 nRootType; //RootType @@ -115,5 +114,7 @@ public: } } }; + #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/navicont.hxx b/sw/source/ui/inc/navicont.hxx index f1754be1ec..f0df6c3b1e 100644 --- a/sw/source/ui/inc/navicont.hxx +++ b/sw/source/ui/inc/navicont.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -59,3 +60,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/navipi.hxx b/sw/source/ui/inc/navipi.hxx index 0faae89fe2..d29ed815d4 100644 --- a/sw/source/ui/inc/navipi.hxx +++ b/sw/source/ui/inc/navipi.hxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -29,9 +30,7 @@ // INCLUDE --------------------------------------------------------------- -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif #include <svl/lstner.hxx> #include <svtools/transfer.hxx> #include <sfx2/childwin.hxx> @@ -49,9 +48,8 @@ class SwView; class SwNavigationConfig; class SfxObjectShellLock; class SfxChildWindowContext; - -//----------------------------------------------------------------------- class SwNavigationPI; + class SwNavHelpToolBox : public SwHelpToolBox { virtual void MouseButtonDown(const MouseEvent &rEvt); @@ -60,7 +58,6 @@ class SwNavHelpToolBox : public SwHelpToolBox SwNavHelpToolBox(SwNavigationPI* pParent, const ResId &rResId); }; - // CLASS ----------------------------------------------------------------- class SwNavigationPI : public Window, public SfxControllerItem, public SfxListener @@ -73,7 +70,6 @@ class SwNavigationPI : public Window, SwNavHelpToolBox aContentToolBox; SwHelpToolBox aGlobalToolBox; ImageList aContentImageList; - ImageList aContentImageListH; SwContentTree aContentTree; SwGlobalTree aGlobalTree; ListBox aDocListBox; @@ -196,3 +192,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/navmgr.hxx b/sw/source/ui/inc/navmgr.hxx new file mode 100644 index 0000000000..2a86172e6c --- /dev/null +++ b/sw/source/ui/inc/navmgr.hxx @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * [ Maja Djordjevic < ovcica@gmail.com > ] + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Cédric Bosdonnat <cbosdonnat@novell.com> + * Caolan McNamara <caolanm@redhat.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#ifndef _NAVMGR_HXX +#define _NAVMGR_HXX + +#include "swtypes.hxx" +#include "pam.hxx" +#include "swdllapi.h" + +class SwWrtShell; +struct SwPosition; + +class SW_DLLPUBLIC SwNavigationMgr +{ +private: + /* + * List of entries in the navigation history + * Each entry is a SwPosition, which represents a position within the document + * SwPosition is given by a node index (SwNodeIndex) which usually represents the paragraph the position is in + * and an index (SwIndex), which represents the position inside this paragraph. + * You can find more on SwPositions at http://wiki.services.openoffice.org/wiki/Writer_Core_And_Layout + * + * The navigation history behaves as a stack, to which items are added when we jump to a new position + * (e.g. click a link, or double click an entry from the navigator). + * Every use of the back/forward buttons results in moving the stack pointer within the navigation history + */ + std::vector<SwPosition> _entries; + std::vector<SwPosition>::size_type _nCurrent; /* Current position within the navigation history */ + SwWrtShell* _pMyShell; /* The active shell within which the navigation occurs */ + + void GotoSwPosition(const SwPosition &rPos); + +public: + /* Constructor that initializes the shell to the current shell */ + SwNavigationMgr( SwWrtShell* pShell ); + /* Can we go back in the history ? */ + sal_Bool backEnabled() ; + /* Can we go forward in the history ? */ + sal_Bool forwardEnabled(); + /* The method that is called when we click the back button */ + void goBack() ; + /* The method that is called when we click the forward button */ + void goForward() ; + /* The method that adds the position pPos to the navigation history */ + bool addEntry(const SwPosition& rPos); +}; +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/navsh.hxx b/sw/source/ui/inc/navsh.hxx new file mode 100644 index 0000000000..28390687c3 --- /dev/null +++ b/sw/source/ui/inc/navsh.hxx @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * [ Maja Djordjevic < ovcica@gmail.com > ] + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Cédric Bosdonnat <cbosdonnat@novell.com> + * Caolan McNamara <caolanm@redhat.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#ifndef _SWNAVIGATIONSH_HXX +#define _SWNAVIGATIONSH_HXX + +#include "frmsh.hxx" + +class SfxItemSet; +class SwWrtShell; + + + +class SwNavigationShell: public SwBaseShell +{ +public: + SFX_DECL_INTERFACE(SW_NAVIGATIONSHELL) + + SwNavigationShell(SwView &rView); + + void GetState(SfxItemSet &); + void Execute(SfxRequest &); +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/num.hxx b/sw/source/ui/inc/num.hxx index 4234eff998..287b8d341b 100644 --- a/sw/source/ui/inc/num.hxx +++ b/sw/source/ui/inc/num.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,25 +30,13 @@ #include <sfx2/tabdlg.hxx> -#ifndef _MENUBTN_HXX //autogen #include <vcl/menubtn.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif #include <svtools/stdctrl.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif #include <svx/stddlg.hxx> #include <numprevw.hxx> #include "numrule.hxx" @@ -56,36 +45,23 @@ class SwWrtShell; class SvxBrushItem; class SwOutlineTabDialog; - -/*-----------------13.02.97 14.02------------------- - ---------------------------------------------------*/ - struct SwBmpItemInfo { SvxBrushItem* pBrushItem; sal_uInt16 nItemId; }; - -/*-----------------07.02.97 15.37------------------- - ---------------------------------------------------*/ #define NUM_PAGETYPE_BULLET 0 #define NUM_PAGETYPE_SINGLENUM 1 #define NUM_PAGETYPE_NUM 2 #define NUM_PAGETYPE_BMP 3 #define PAGETYPE_USER_START 10 -/*-----------------03.12.97 10:18------------------- - ---------------------------------------------------*/ class SwNumPositionTabPage : public SfxTabPage { FixedLine aLevelFL; MultiListBox aLevelLB; - // --> OD 2008-02-01 #newlistlevelattrs# // former set of controls shown for numbering rules containing list level // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION FixedLine aPositionFL; @@ -98,9 +74,7 @@ class SwNumPositionTabPage : public SfxTabPage MetricField aDistNumMF; FixedText aAlignFT; ListBox aAlignLB; - // <-- - // --> OD 2008-02-01 #newlistlevelattrs# // new set of controls shown for numbering rules containing list level // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT FixedText aLabelFollowedByFT; @@ -113,7 +87,6 @@ class SwNumPositionTabPage : public SfxTabPage MetricField aAlignedAtMF; FixedText aIndentAtFT; MetricField aIndentAtMF; - // <-- PushButton aStandardPB; @@ -129,9 +102,7 @@ class SwNumPositionTabPage : public SfxTabPage sal_Bool bModified : 1; sal_Bool bPreset : 1; sal_Bool bInInintControl : 1; //Modify-Fehler umgehen, soll ab 391 behoben sein - // --> OD 2008-02-01 #newlistlevelattrs# bool bLabelAlignmentPosAndSpaceModeActive; - // <-- void InitControls(); @@ -141,7 +112,6 @@ class SwNumPositionTabPage : public SfxTabPage DECL_LINK( RelativeHdl, CheckBox * ); DECL_LINK( StandardHdl, PushButton * ); - // --> OD 2008-02-01 #newlistlevelattrs# void InitPosAndSpaceMode(); void ShowControlsDependingOnPosAndSpaceMode(); @@ -149,7 +119,6 @@ class SwNumPositionTabPage : public SfxTabPage DECL_LINK( ListtabPosHdl_Impl, MetricField* ); DECL_LINK( AlignAtHdl_Impl, MetricField* ); DECL_LINK( IndentAtHdl_Impl, MetricField* ); - // <-- using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; @@ -203,3 +172,4 @@ class SwSvxNumBulletTabDialog : public SfxTabDialog }; #endif // _NUM_CXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/numberingtypelistbox.hxx b/sw/source/ui/inc/numberingtypelistbox.hxx index 2c11549e15..164e3526a2 100644 --- a/sw/source/ui/inc/numberingtypelistbox.hxx +++ b/sw/source/ui/inc/numberingtypelistbox.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,3 +57,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/numfmtlb.hxx b/sw/source/ui/inc/numfmtlb.hxx index b82bba9f82..72204448f9 100644 --- a/sw/source/ui/inc/numfmtlb.hxx +++ b/sw/source/ui/inc/numfmtlb.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -85,3 +86,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/numpara.hxx b/sw/source/ui/inc/numpara.hxx index 2936a57077..8bde96eaf6 100644 --- a/sw/source/ui/inc/numpara.hxx +++ b/sw/source/ui/inc/numpara.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,9 +33,7 @@ #include <vcl/lstbox.hxx> #include <vcl/fixed.hxx> #include <vcl/field.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif /* --- class SwParagraphNumTabPage ---------------------------------------- @@ -96,3 +95,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/numprevw.hxx b/sw/source/ui/inc/numprevw.hxx index 84b7d443fd..e08e809979 100644 --- a/sw/source/ui/inc/numprevw.hxx +++ b/sw/source/ui/inc/numprevw.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,9 +33,6 @@ #include <vcl/window.hxx> class SwNumRule; -/*-----------------02.12.97 10:31------------------- - ---------------------------------------------------*/ class NumberingPreview : public Window { @@ -69,3 +67,4 @@ class NumberingPreview : public Window #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/olesh.hxx b/sw/source/ui/inc/olesh.hxx index 7785209890..2a36cbf73c 100644 --- a/sw/source/ui/inc/olesh.hxx +++ b/sw/source/ui/inc/olesh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,4 @@ public: +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/olmenu.hxx b/sw/source/ui/inc/olmenu.hxx index d6d21f391c..bd8f2d68a4 100644 --- a/sw/source/ui/inc/olmenu.hxx +++ b/sw/source/ui/inc/olmenu.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -89,3 +90,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/optcomp.hxx b/sw/source/ui/inc/optcomp.hxx index a35e98653f..0416b15167 100644 --- a/sw/source/ui/inc/optcomp.hxx +++ b/sw/source/ui/inc/optcomp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,7 +35,6 @@ #include <svx/checklbx.hxx> // class SwCompatibilityOptPage ------------------------------------------ - class SwWrtShell; struct SwCompatibilityOptPage_Impl; @@ -85,3 +85,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/optload.hxx b/sw/source/ui/inc/optload.hxx index 388f9e44de..c96789733a 100644 --- a/sw/source/ui/inc/optload.hxx +++ b/sw/source/ui/inc/optload.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #include <sfx2/tabdlg.hxx> -#ifndef _GROUP_HXX #include <vcl/group.hxx> -#endif #include <vcl/fixed.hxx> #include <vcl/lstbox.hxx> #include <vcl/field.hxx> @@ -45,10 +44,6 @@ class SwFldMgr; class SvLBoxEntry; class SwWrtShell; -/*-----------------31.08.96 10.09------------------- - ---------------------------------------------------*/ - class SwLoadOptPage : public SfxTabPage { private: @@ -68,6 +63,7 @@ private: FixedText aTabFT; MetricField aTabMF; CheckBox aUseSquaredPageMode; + CheckBox aUseCharUnit; SwWrtShell* pWrtShell; sal_Bool bHTMLMode; @@ -88,18 +84,12 @@ public: virtual void Reset( const SfxItemSet& rSet ); }; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ class SwCaptionOptDlg : public SfxSingleTabDialog { public: SwCaptionOptDlg(Window* pParent, const SfxItemSet& rSet); ~SwCaptionOptDlg(); }; -/* -----------------23.10.98 13:19------------------- - * - * --------------------------------------------------*/ class CaptionComboBox : public SwComboBox { @@ -112,10 +102,6 @@ public: {} }; -/*-----------------31.08.96 10.09------------------- - ---------------------------------------------------*/ - class SwCaptionPreview : public Window { private: @@ -210,4 +196,4 @@ public: #endif - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx index 410b43867b..dcdd067a54 100644 --- a/sw/source/ui/inc/optpage.hxx +++ b/sw/source/ui/inc/optpage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,25 +29,15 @@ #define _OPTPAGE_HXX #include <sfx2/tabdlg.hxx> -#ifndef _GROUP_HXX //autogen #include <vcl/group.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif #include <svtools/ctrlbox.hxx> #include <svx/fntctrl.hxx> #include <fontcfg.hxx> @@ -56,10 +47,6 @@ class SwStdFontConfig; class SwWrtShell; class FontList; -/*-----------------31.08.96 10.09------------------- - ---------------------------------------------------*/ - class SwContentOptPage : public SfxTabPage { //visual aids @@ -107,11 +94,9 @@ public: }; -/*-------- OS 27.01.95 ----------------------------------- +/*-------------------------------------------------------- TabPage Druckereinstellungen Zusaetze --------------------------------------------------------- */ - - class SwAddPrinterTabPage : public SfxTabPage { FixedLine aFL1; @@ -172,10 +157,6 @@ public: }; -/*-----------------03.09.96 11.50------------------- - ---------------------------------------------------*/ - class SwStdFontTabPage : public SfxTabPage { FixedLine aStdChrFL ; @@ -260,10 +241,6 @@ public: virtual void PageCreated (SfxAllItemSet aSet); }; -/*-----------------18.01.97 12.10------------------- - ---------------------------------------------------*/ - class SwTableOptionsTabPage : public SfxTabPage { FixedLine aTableFL; @@ -322,7 +299,8 @@ public: virtual void PageCreated (SfxAllItemSet aSet); }; -/*-----------------31.10.97 17:55------------------- + +/*-------------------------------------------------- TabPage fuer ShadowCrsr --------------------------------------------------*/ class SwShdwCrsrOptionsTabPage : public SfxTabPage @@ -376,7 +354,6 @@ public: /*----------------------------------------------------------------------- Beschreibung: Markierungsvorschau -----------------------------------------------------------------------*/ - class SwMarkPreview : public Window { Color m_aBgCol; // background @@ -414,7 +391,6 @@ public: /*----------------------------------------------------------------------- Beschreibung: Redlining-Optionen -----------------------------------------------------------------------*/ - class SwRedlineOptionsTabPage : public SfxTabPage { FixedLine aInsertFL; @@ -468,11 +444,11 @@ public: virtual void Reset( const SfxItemSet& rSet ); }; -/*--------OS 11.01.95 ----------------------------------- +/*------------------------------------------------------- TabPage Testeinstellungen fuer SW --------------------------------------------------------- */ -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 class SwTestTabPage : public SfxTabPage { @@ -506,4 +482,6 @@ private: }; #endif //PRODUCT + #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/sw/source/ui/inc/outline.hxx b/sw/source/ui/inc/outline.hxx index 9c329ed5c2..7c8e37bc3d 100644 --- a/sw/source/ui/inc/outline.hxx +++ b/sw/source/ui/inc/outline.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,26 +33,16 @@ #include <vcl/menu.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <svtools/stdctrl.hxx> -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif #include "swtypes.hxx" //fuer MAXLEVEL #include <numprevw.hxx> @@ -61,9 +52,6 @@ class SwWrtShell; class SwNumRule; class SwChapterNumRules; -/* -----------------07.07.98 13:38------------------- - * - * --------------------------------------------------*/ class SwOutlineTabDialog : public SfxTabDialog { static sal_uInt16 nNumLevel; @@ -99,9 +87,7 @@ class SwOutlineTabDialog : public SfxTabDialog static sal_uInt16 GetActNumLevel() {return nNumLevel;} static void SetActNumLevel(sal_uInt16 nSet) {nNumLevel = nSet;} }; -/* -----------------07.07.98 13:47------------------- - * - * --------------------------------------------------*/ + class SwOutlineSettingsTabPage : public SfxTabPage { FixedLine aLevelFL; @@ -163,4 +149,7 @@ public: static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet); }; + #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/pardlg.hxx b/sw/source/ui/inc/pardlg.hxx index a8b0f03db1..1ee9b31c13 100644 --- a/sw/source/ui/inc/pardlg.hxx +++ b/sw/source/ui/inc/pardlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,3 +38,5 @@ class SfxItemSet; #define DLG_ENVELOP 2 #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/pattern.hxx b/sw/source/ui/inc/pattern.hxx index 9e3ab6d629..d28afaafc8 100644 --- a/sw/source/ui/inc/pattern.hxx +++ b/sw/source/ui/inc/pattern.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,3 +43,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/pgfnote.hxx b/sw/source/ui/inc/pgfnote.hxx index 30b5db07ee..810a35b6ae 100644 --- a/sw/source/ui/inc/pgfnote.hxx +++ b/sw/source/ui/inc/pgfnote.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,23 +30,16 @@ #include <sfx2/tabdlg.hxx> -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _GROUP_HXX //autogen #include <vcl/group.hxx> -#endif #include <svtools/ctrlbox.hxx> /*-------------------------------------------------------------------- Beschreibung: Fussnoteneinstellungs-TabPage --------------------------------------------------------------------*/ - class SwFootNotePage: public SfxTabPage { public: @@ -91,3 +85,5 @@ private: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/pggrid.hxx b/sw/source/ui/inc/pggrid.hxx index cbc8d52731..3290088472 100644 --- a/sw/source/ui/inc/pggrid.hxx +++ b/sw/source/ui/inc/pggrid.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,17 +30,13 @@ #include <sfx2/tabdlg.hxx> #include <colex.hxx> -#ifndef _FIELD_HXX #include <vcl/field.hxx> -#endif -#ifndef _FIXED_HXX #include <vcl/fixed.hxx> -#endif #include <svtools/ctrlbox.hxx> + /*-------------------------------------------------------------------- Description: TabPage Format/(Styles/)Page/Text grid --------------------------------------------------------------------*/ - class SwTextGridPage: public SfxTabPage { FixedLine aGridTypeFL; @@ -54,12 +51,14 @@ class SwTextGridPage: public SfxTabPage FixedText aLinesPerPageFT; NumericField aLinesPerPageNF; + FixedText aLinesRangeFT; FixedText aTextSizeFT; MetricField aTextSizeMF; FixedText aCharsPerLineFT; NumericField aCharsPerLineNF; + FixedText aCharsRangeFT; FixedText aCharWidthFT; MetricField aCharWidthMF; @@ -76,19 +75,22 @@ class SwTextGridPage: public SfxTabPage FixedText aColorFT; ColorListBox aColorLB; - Window* aControls[18]; + Window* aControls[20]; sal_Int32 m_nRubyUserValue; sal_Bool m_bRubyUserValue; Size m_aPageSize; sal_Bool m_bVertical; sal_Bool m_bSquaredMode; + sal_Bool m_bHRulerChanged; + sal_Bool m_bVRulerChanged; SwTextGridPage(Window *pParent, const SfxItemSet &rSet); ~SwTextGridPage(); void UpdatePageSize(const SfxItemSet& rSet); void PutGridItem(SfxItemSet& rSet); + void SetLinesOrCharsRanges(FixedText & rField, const sal_Int32 nValue ); DECL_LINK(GridTypeHdl, RadioButton*); DECL_LINK(CharorLineChangedHdl, SpinField*); @@ -111,3 +113,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/popbox.hxx b/sw/source/ui/inc/popbox.hxx index 378961ffc1..198159a70b 100644 --- a/sw/source/ui/inc/popbox.hxx +++ b/sw/source/ui/inc/popbox.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #define _POPBOX_HXX -#ifndef _TOOLBOX_HXX #include <vcl/toolbox.hxx> -#endif #include <svtools/transfer.hxx> class SwNavigationPI; @@ -65,3 +64,5 @@ inline void SwHelpToolBox::SetRightClickLink(const Link &rLink) { #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/prcntfld.hxx b/sw/source/ui/inc/prcntfld.hxx index a9ef9c1675..da7de4676e 100644 --- a/sw/source/ui/inc/prcntfld.hxx +++ b/sw/source/ui/inc/prcntfld.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,9 +28,7 @@ #ifndef _PRCNTFLD_HXX #define _PRCNTFLD_HXX -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif #include "swdllapi.h" class SW_DLLPUBLIC PercentField : public MetricField @@ -97,3 +96,4 @@ public: #endif // _PRCNTFLD_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx index 848a022460..875579ce06 100644 --- a/sw/source/ui/inc/pview.hxx +++ b/sw/source/ui/inc/pview.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -170,11 +171,9 @@ public: CreateAccessible(); }; - /*-------------------------------------------------------------------- Beschreibung: Sicht auf ein Dokument --------------------------------------------------------------------*/ - class SW_DLLPUBLIC SwPagePreView: public SfxViewShell { // ViewWindow und Henkel zur Core @@ -326,11 +325,11 @@ public: }; // ----------------- inline Methoden ---------------------- - - inline void SwPagePreView::AdjustEditWin() { OuterResizePixel( Point(), GetFrameWindow()->GetOutputSizePixel() ); } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/redlndlg.hxx b/sw/source/ui/inc/redlndlg.hxx index 43d947df4e..714d52f2fe 100644 --- a/sw/source/ui/inc/redlndlg.hxx +++ b/sw/source/ui/inc/redlndlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include <redline.hxx> #include <tools/datetime.hxx> #include <vcl/msgbox.hxx> -#ifndef _SVSTDARR_HXX #include <svl/svstdarr.hxx> -#endif #include <svl/eitem.hxx> #include <sfx2/basedlgs.hxx> #include <sfx2/viewfrm.hxx> @@ -145,10 +144,6 @@ public: virtual void Resize(); }; -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - class SwModelessRedlineAcceptDlg : public SfxModelessDialog { SwRedlineAcceptDlg* pImplDlg; @@ -165,11 +160,6 @@ public: void Initialize (SfxChildWinInfo* pInfo); }; - -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - class SwRedlineAcceptChild : public SwChildWinWrapper { public: @@ -187,3 +177,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/regionsw.hxx b/sw/source/ui/inc/regionsw.hxx index 27a987f937..8133e1855b 100644 --- a/sw/source/ui/inc/regionsw.hxx +++ b/sw/source/ui/inc/regionsw.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -51,7 +52,6 @@ #include <svx/paraprev.hxx> #include <editeng/lrspitem.hxx> - class SwWrtShell; class EditRegionDlg; @@ -64,7 +64,6 @@ namespace sfx2 /************************************************************************* Dialog "Bereiche bearbeiten" *************************************************************************/ - class SectRepr; typedef SectRepr* SectReprPtr; SV_DECL_PTRARR_SORT( SectReprArr, SectReprPtr, 0, 4 ) @@ -107,7 +106,6 @@ class SwEditRegionDlg : public SfxModalDialog PushButton aDismiss; HelpButton aHelp; ImageList aImageIL; - ImageList aImageILH; SwWrtShell& rSh; SectReprArr aSectReprArr; @@ -120,7 +118,7 @@ class SwEditRegionDlg : public SfxModalDialog sal_Bool bWeb :1; - Image BuildBitmap(sal_Bool bProtect,sal_Bool bHidden,sal_Bool bHighContrast); + Image BuildBitmap(sal_Bool bProtect,sal_Bool bHidden); void RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry); sal_uInt16 FindArrPos(const SwSectionFmt* pFmt); @@ -156,13 +154,10 @@ public: void SelectSection(const String& rSectionName); }; + /************************************************************************* Dialog "Bereich einfuegen" *************************************************************************/ - -/* -----------------21.05.99 11:05------------------- - * - * --------------------------------------------------*/ class SwInsertSectionTabPage : public SfxTabPage { FixedLine aNameFL; @@ -272,9 +267,7 @@ public: static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet); }; -/* -----------------13.06.2003 09:51----------------- - --------------------------------------------------*/ class SwSectionIndentTabPage : public SfxTabPage { FixedLine aIndentFL; @@ -299,9 +292,6 @@ public: void SetWrtShell(SwWrtShell& rSh); }; -/* -----------------21.05.99 13:07------------------- - * - * --------------------------------------------------*/ class SwInsertSectionTabDialog : public SfxTabDialog { SwWrtShell& rWrtSh; @@ -318,9 +308,6 @@ public: SwSectionData * GetSectionData() { return m_pSectionData.get(); } }; -/* -----------------21.05.99 13:07------------------- - * - * --------------------------------------------------*/ class SwSectionPropertyTabDialog : public SfxTabDialog { SwWrtShell& rWrtSh; @@ -333,4 +320,4 @@ public: #endif - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/rowht.hxx b/sw/source/ui/inc/rowht.hxx index a9005eea53..069684e417 100644 --- a/sw/source/ui/inc/rowht.hxx +++ b/sw/source/ui/inc/rowht.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,22 +29,9 @@ #define _ROWHT_HXX #include <svx/stddlg.hxx> - -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif - -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif - -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif - -#ifndef _BUTTON_HXX //autogen -#include <vcl/button.hxx> -#endif class SwWrtShell; @@ -65,3 +53,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/scroll.hxx b/sw/source/ui/inc/scroll.hxx index b2fa916c28..4f888419fe 100644 --- a/sw/source/ui/inc/scroll.hxx +++ b/sw/source/ui/inc/scroll.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,9 +27,7 @@ ************************************************************************/ #ifndef _SCROLL_HXX #define _SCROLL_HXX -#ifndef _SCRBAR_HXX //autogen #include <vcl/scrbar.hxx> -#endif class SwScrollbar: public ScrollBar { @@ -69,3 +68,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/selglos.hxx b/sw/source/ui/inc/selglos.hxx index 1c67f83a48..7cbe016e50 100644 --- a/sw/source/ui/inc/selglos.hxx +++ b/sw/source/ui/inc/selglos.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,18 +28,12 @@ #ifndef _SELGLOS_HXX #define _SELGLOS_HXX -#ifndef _DIALOG_HXX //autogen #include <vcl/dialog.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif #include <vcl/fixed.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif class SwSelGlossaryDlg : public ModalDialog { @@ -72,3 +67,5 @@ inline void SwSelGlossaryDlg::SelectEntryPos(sal_uInt16 nIdx) { aGlosBox.SelectEntryPos(nIdx); } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/sharedconnection.hxx b/sw/source/ui/inc/sharedconnection.hxx index b90c827732..faa27c384c 100644 --- a/sw/source/ui/inc/sharedconnection.hxx +++ b/sw/source/ui/inc/sharedconnection.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,3 +35,5 @@ typedef ::utl::SharedUNOComponent< ::com::sun::star::sdbc::XConnection > SharedConnection; #endif // SW_UI_SHARED_CONNECTION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/shdwcrsr.hxx b/sw/source/ui/inc/shdwcrsr.hxx index fe2b74c4d3..7ea12f66dd 100644 --- a/sw/source/ui/inc/shdwcrsr.hxx +++ b/sw/source/ui/inc/shdwcrsr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -65,3 +66,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/shells.hrc b/sw/source/ui/inc/shells.hrc index 243c4fcf92..4392babdea 100644 --- a/sw/source/ui/inc/shells.hrc +++ b/sw/source/ui/inc/shells.hrc @@ -102,7 +102,9 @@ #define RID_MEDIA_TOOLBOX (RC_SHELLS_BEGIN + 61) -#define SHELLS_ACT_END RID_MEDIA_TOOLBOX +#define STR_SHELLNAME_NAVIGATION (RC_SHELLS_BEGIN + 62) + +#define SHELLS_ACT_END STR_SHELLNAME_NAVIGATION #if SHELLS_ACT_END > RC_SHELLS_END #error Resource-Id Ueberlauf in #file, #line diff --git a/sw/source/ui/inc/split.hxx b/sw/source/ui/inc/split.hxx index 68f5049aed..ce733500a4 100644 --- a/sw/source/ui/inc/split.hxx +++ b/sw/source/ui/inc/split.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,21 +30,13 @@ #include <svx/stddlg.hxx> -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif -#ifndef _IMAGEBTN_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif class SwWrtShell; @@ -74,3 +67,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/splittbl.hxx b/sw/source/ui/inc/splittbl.hxx index 1e3fbfc10d..4d26df7cc7 100644 --- a/sw/source/ui/inc/splittbl.hxx +++ b/sw/source/ui/inc/splittbl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -59,3 +60,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/srcedtw.hxx b/sw/source/ui/inc/srcedtw.hxx index a405469ad1..39858a36ee 100644 --- a/sw/source/ui/inc/srcedtw.hxx +++ b/sw/source/ui/inc/srcedtw.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,9 +33,7 @@ #include <unotools/options.hxx> #include <vcl/timer.hxx> -#ifndef _TABLE_HXX //autogen #include <tools/table.hxx> -#endif #include <svtools/xtextedt.hxx> class ScrollBar; @@ -162,3 +161,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/srcview.hxx b/sw/source/ui/inc/srcview.hxx index 603bae794d..336a9fc18a 100644 --- a/sw/source/ui/inc/srcview.hxx +++ b/sw/source/ui/inc/srcview.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,10 +39,6 @@ class SwDocShell; class SvxSearchItem; class SfxMedium; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - class SwSrcView: public SfxViewShell { SwSrcEditWindow aEditWin; @@ -101,26 +98,6 @@ public: }; - #endif - - - - - - - - - - - - - - - - - - - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/srtdlg.hxx b/sw/source/ui/inc/srtdlg.hxx index 2ae34bd461..689aca753d 100644 --- a/sw/source/ui/inc/srtdlg.hxx +++ b/sw/source/ui/inc/srtdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,18 +28,10 @@ #ifndef _SRTDLG_HXX #define _SRTDLG_HXX -#ifndef _FIXED_HXX #include <vcl/fixed.hxx> -#endif -#ifndef _BUTTON_HXX #include <vcl/button.hxx> -#endif -#ifndef _FIELD_HXX #include <vcl/field.hxx> -#endif -#ifndef _LSTBOX_HXX #include <vcl/lstbox.hxx> -#endif #include <svx/stddlg.hxx> #include <svx/langbox.hxx> @@ -116,3 +109,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/stmenu.hxx b/sw/source/ui/inc/stmenu.hxx index 553f86f0e1..61ba61034b 100644 --- a/sw/source/ui/inc/stmenu.hxx +++ b/sw/source/ui/inc/stmenu.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,16 +31,12 @@ #ifndef _STMENU_HXX #define _STMENU_HXX -#ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> -#endif #include <vector> #include <com/sun/star/smarttags/XSmartTagAction.hpp> -#ifndef _COM_SUN_STAR_SMARTTAGS_XSTRINGKEYMAP_HPP_ #include <com/sun/star/container/XStringKeyMap.hpp> -#endif #include <com/sun/star/text/XTextRange.hpp> class SwView; @@ -83,3 +80,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/swcont.hxx b/sw/source/ui/inc/swcont.hxx index 9702aaeea4..0688dd6732 100644 --- a/sw/source/ui/inc/swcont.hxx +++ b/sw/source/ui/inc/swcont.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -111,3 +112,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/swdtflvr.hxx b/sw/source/ui/inc/swdtflvr.hxx index 64cd88033d..4e37f6390b 100644 --- a/sw/source/ui/inc/swdtflvr.hxx +++ b/sw/source/ui/inc/swdtflvr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -220,3 +221,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/swlbox.hxx b/sw/source/ui/inc/swlbox.hxx index 94938f7067..265b5ad3c5 100644 --- a/sw/source/ui/inc/swlbox.hxx +++ b/sw/source/ui/inc/swlbox.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,13 +30,9 @@ #include <svl/svarray.hxx> -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#ifndef _COMBOBOX_HXX //autogen #include <vcl/combobox.hxx> -#endif #include "swdllapi.h" class SwBoxEntry; @@ -46,7 +43,6 @@ SV_DECL_PTRARR_DEL(SwEntryLst, SwBoxEntry*, 10, 10) /*-------------------------------------------------------------------- Beschreibung: SwBoxEntry --------------------------------------------------------------------*/ - class SW_DLLPUBLIC SwBoxEntry { friend class SwComboBox; @@ -68,8 +64,8 @@ public: /*-------------------------------------------------------------------- Beschreibung: fuer ComboBoxen --------------------------------------------------------------------*/ - typedef sal_uInt16 SwComboBoxStyle; + namespace nsSwComboBoxStyle { const SwComboBoxStyle CBS_UPPER = 0x01; @@ -122,3 +118,5 @@ public: }; #endif /* _SWLBOX_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/swmodalredlineacceptdlg.hxx b/sw/source/ui/inc/swmodalredlineacceptdlg.hxx index 45a00bca24..bfc6ad5aaa 100644 --- a/sw/source/ui/inc/swmodalredlineacceptdlg.hxx +++ b/sw/source/ui/inc/swmodalredlineacceptdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/swrenamexnameddlg.hxx b/sw/source/ui/inc/swrenamexnameddlg.hxx index 7c919c9376..0e53b28337 100644 --- a/sw/source/ui/inc/swrenamexnameddlg.hxx +++ b/sw/source/ui/inc/swrenamexnameddlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include <vcl/dialog.hxx> #include <vcl/fixed.hxx> #include <vcl/edit.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <actctrl.hxx> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/text/XTextCursor.hpp> @@ -43,11 +42,6 @@ #include <tools/resary.hxx> #include <swunodef.hxx> - - -/* -----------------09.06.99 14:36------------------- - * - * --------------------------------------------------*/ class SwRenameXNamedDlg : public ModalDialog { FixedLine aNameFL; @@ -85,3 +79,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/swtablerep.hxx b/sw/source/ui/inc/swtablerep.hxx index 3b378684b8..d0807d0e18 100644 --- a/sw/source/ui/inc/swtablerep.hxx +++ b/sw/source/ui/inc/swtablerep.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -92,3 +93,4 @@ public: }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/swuiccoll.hxx b/sw/source/ui/inc/swuiccoll.hxx index 87f87ccbb8..ff520e4e4d 100644 --- a/sw/source/ui/inc/swuiccoll.hxx +++ b/sw/source/ui/inc/swuiccoll.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -87,3 +88,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/swuicnttab.hxx b/sw/source/ui/inc/swuicnttab.hxx index 213b10d856..9108936473 100644 --- a/sw/source/ui/inc/swuicnttab.hxx +++ b/sw/source/ui/inc/swuicnttab.hxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -27,35 +28,26 @@ #ifndef _SWUI_CNTTAB_HXX #define _SWUI_CNTTAB_HXX -#include <svx/stddlg.hxx> +#include <boost/ptr_container/ptr_vector.hpp> -#ifndef _BUTTON_HXX //autogen +#include <tools/resary.hxx> +#include <sfx2/tabdlg.hxx> +#include <svtools/svtreebx.hxx> +#include <svx/checklbx.hxx> +#include <svx/langbox.hxx> +#include <svx/stddlg.hxx> #include <vcl/button.hxx> -#endif - -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif - -#ifndef _FIXED_HXX //autogen -#include <vcl/fixed.hxx> -#endif - -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif +#include <vcl/fixed.hxx> #include <vcl/lstbox.hxx> -#include <sfx2/tabdlg.hxx> - -#include "tox.hxx" -#include <tools/list.hxx> -#include <toxmgr.hxx> -#include <svx/checklbx.hxx> -#include <tools/resary.hxx> -#include <svtools/svtreebx.hxx> #include <vcl/menubtn.hxx> -#include <svx/langbox.hxx> + #include <cnttab.hxx> +#include <toxmgr.hxx> + +#include "tox.hxx" + class SwWrtShell; class SwTOXMgr; namespace com{namespace sun{namespace star{ @@ -65,15 +57,14 @@ namespace com{namespace sun{namespace star{ } }}} -//----------------------------------------------------------------------------- struct SwIndexSections_Impl { com::sun::star::uno::Reference< com::sun::star::text::XTextSection > xContainerSection; com::sun::star::uno::Reference< com::sun::star::text::XDocumentIndex > xDocumentIndex; }; -//----------------------------------------------------------------------------- class SwOneExampleFrame; + struct SwIndexSections_Impl; class SwMultiTOXTabDialog : public SfxTabDialog @@ -136,9 +127,7 @@ public: static sal_Bool IsNoNum(SwWrtShell& rSh, const String& rName); }; -/* -----------------14.07.99 12:17------------------- - --------------------------------------------------*/ class IndexEntryRessource; class IndexEntrySupplierWrapper; @@ -160,7 +149,6 @@ class SwTOXSelectTabPage : public SfxTabPage //content FixedLine aCreateFromFL; // content, user, illustration CheckBox aFromHeadingsCB; -// PushButton aChapterDlgPB; //#outline level,removed by zhaojianwei CheckBox aAddStylesCB; PushButton aAddStylesPB; Point aAddStylesPosDef; @@ -233,7 +221,6 @@ class SwTOXSelectTabPage : public SfxTabPage DECL_LINK(TOXTypeHdl, ListBox* ); DECL_LINK(TOXAreaHdl, ListBox* ); -// DECL_LINK(ChapterHdl, PushButton* ); //#outline level,removed by zhaojianwei DECL_LINK(AddStylesHdl, PushButton* ); DECL_LINK(MenuEnableHdl, Menu*); DECL_LINK(MenuExecuteHdl, Menu*); @@ -245,7 +232,7 @@ class SwTOXSelectTabPage : public SfxTabPage void ApplyTOXDescription(); void FillTOXDescription(); - + using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; @@ -265,11 +252,6 @@ public: void SelectType(TOXTypes eSet); //preset TOXType, GlobalDoc void SetWrtShell(SwWrtShell& rSh); }; -/* -----------------16.06.99 08:33------------------- - - --------------------------------------------------*/ - -DECLARE_LIST(TOXControlList, Control*) class SwTOXEdit; class SwTOXButton; @@ -277,10 +259,16 @@ class SwTOXEntryTabPage; class SwTokenWindow : public Window { + typedef boost::ptr_vector<Control> TOXControlList; + typedef TOXControlList::iterator ctrl_iterator; + typedef TOXControlList::const_iterator ctrl_const_iterator; + typedef TOXControlList::reverse_iterator ctrl_reverse_iterator; + typedef TOXControlList::const_reverse_iterator ctrl_const_reverse_iterator; + ImageButton aLeftScrollWin; Window aCtrlParentWin; ImageButton aRightScrollWin; - TOXControlList aControlList; + TOXControlList aControlList; SwForm* pForm; sal_uInt16 nLevel; sal_Bool bValid; @@ -342,10 +330,9 @@ public: virtual void Resize(); virtual void GetFocus(); }; -/* -----------------------------23.12.99 14:16-------------------------------- - ---------------------------------------------------------------------------*/ class SwTOXEntryTabPage; + class SwIdxTreeListBox : public SvTreeListBox { SwTOXEntryTabPage* pParent; @@ -355,9 +342,6 @@ public: SwIdxTreeListBox(SwTOXEntryTabPage* pPar, const ResId& rResId); }; -/* -----------------16.06.99 12:49------------------- - - --------------------------------------------------*/ class SwTOXEntryTabPage : public SfxTabPage { FixedText aLevelFT; @@ -487,9 +471,7 @@ public: void PreTokenButtonRemoved(const SwFormToken& rToken); }; -/* -----------------05.07.99 13:00------------------- - --------------------------------------------------*/ class SwTOXStylesTabPage : public SfxTabPage { FixedLine aFormatFL; @@ -502,7 +484,6 @@ class SwTOXStylesTabPage : public SfxTabPage PushButton aEditStyleBT; SwForm* m_pCurrentForm; -// void UpdatePattern(); DECL_LINK( EditStyleHdl, Button *); DECL_LINK( StdHdl, Button * ); @@ -537,3 +518,4 @@ public: #endif // _SWUI_CNTTAB_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/swuiidxmrk.hxx b/sw/source/ui/inc/swuiidxmrk.hxx index a6fee5ae4e..c8ca13b0f7 100644 --- a/sw/source/ui/inc/swuiidxmrk.hxx +++ b/sw/source/ui/inc/swuiidxmrk.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,30 +31,18 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <sfx2/basedlgs.hxx> -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif #include <vcl/lstbox.hxx> -#ifndef _COMBOBOX_HXX //autogen #include <vcl/combobox.hxx> -#endif #include <svx/stddlg.hxx> -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif -#ifndef _GROUP_HXX //autogen #include <vcl/group.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _IMAGEBTN_HXX //autogen #include <vcl/button.hxx> -#endif #include <sfx2/childwin.hxx> #include "toxe.hxx" #include <svtools/stdctrl.hxx> @@ -67,6 +56,7 @@ class SwTOXMark; --------------------------------------------------------------------*/ class SwIndexMarkFloatDlg; class SwIndexMarkModalDlg; + class SwIndexMarkDlg : public Window { friend class SwIndexMarkFloatDlg; @@ -173,9 +163,7 @@ public: sal_Bool IsTOXType(const String& rName) {return LISTBOX_ENTRY_NOTFOUND != aTypeDCB.GetEntryPos(rName);} }; -/* -----------------06.10.99 10:11------------------- - --------------------------------------------------*/ class SwIndexMarkFloatDlg : public SfxModelessDialog { SwIndexMarkDlg aDlg; @@ -188,9 +176,7 @@ class SwIndexMarkFloatDlg : public SfxModelessDialog sal_Bool bNew=sal_True); void ReInitDlg(SwWrtShell& rWrtShell); }; -/* -----------------06.10.99 10:33------------------- - --------------------------------------------------*/ class SwIndexMarkModalDlg : public SvxStandardDialog { SwIndexMarkDlg aDlg; @@ -201,10 +187,8 @@ public: void ReInitDlg(SwWrtShell& rWrtShell); }; -/* -----------------15.09.99 08:39------------------- - - --------------------------------------------------*/ class SwAuthMarkModalDlg; + class SwAuthMarkDlg : public Window { static sal_Bool bIsFromComponent; @@ -262,9 +246,7 @@ public: void ReInitDlg(SwWrtShell& rWrtShell); }; -/* -----------------06.10.99 10:11------------------- - --------------------------------------------------*/ class SwAuthMarkFloatDlg : public SfxModelessDialog { SwAuthMarkDlg aDlg; @@ -277,9 +259,7 @@ class SwAuthMarkFloatDlg : public SfxModelessDialog sal_Bool bNew=sal_True); void ReInitDlg(SwWrtShell& rWrtShell); }; -/* -----------------06.10.99 10:33------------------- - --------------------------------------------------*/ class SwAuthMarkModalDlg : public SvxStandardDialog { SwAuthMarkDlg aDlg; @@ -290,6 +270,6 @@ public: void ReInitDlg(SwWrtShell& rWrtShell); }; - #endif // _SWUI_IDXMRK_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/swuipardlg.hxx b/sw/source/ui/inc/swuipardlg.hxx index d4ac28871e..475265ee87 100644 --- a/sw/source/ui/inc/swuipardlg.hxx +++ b/sw/source/ui/inc/swuipardlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,3 +50,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/swvset.hxx b/sw/source/ui/inc/swvset.hxx index cec1f7b21e..39a6a1fc1b 100644 --- a/sw/source/ui/inc/swvset.hxx +++ b/sw/source/ui/inc/swvset.hxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -26,7 +27,6 @@ ************************************************************************/ #ifndef _SWVSET_HXX #define _SWVSET_HXX -#include <tools/list.hxx> #include <svx/numvset.hxx> class SwRulerValueSet : public SvxBmpNumValueSet @@ -39,3 +39,4 @@ class SwRulerValueSet : public SvxBmpNumValueSet }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/swwrtshitem.hxx b/sw/source/ui/inc/swwrtshitem.hxx index 4224e81b14..95530b608d 100644 --- a/sw/source/ui/inc/swwrtshitem.hxx +++ b/sw/source/ui/inc/swwrtshitem.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,3 +51,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/syncbtn.hxx b/sw/source/ui/inc/syncbtn.hxx index 045091bf34..edfff239aa 100644 --- a/sw/source/ui/inc/syncbtn.hxx +++ b/sw/source/ui/inc/syncbtn.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,13 +32,7 @@ #ifdef _SYNCDLG #include <sfx2/basedlgs.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif - -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ class SwSyncBtnDlg : public SfxFloatingWindow { @@ -51,10 +46,6 @@ public: }; #endif -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - class SwSyncChildWin : public SfxChildWindow { public: @@ -69,3 +60,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/tabledlg.hxx b/sw/source/ui/inc/tabledlg.hxx index f66e832aed..9b26c95762 100644 --- a/sw/source/ui/inc/tabledlg.hxx +++ b/sw/source/ui/inc/tabledlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,3 +54,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/tablemgr.hxx b/sw/source/ui/inc/tablemgr.hxx index 955cf7cf0a..2ffc47c306 100644 --- a/sw/source/ui/inc/tablemgr.hxx +++ b/sw/source/ui/inc/tablemgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -93,3 +94,5 @@ inline SwTableFUNC::SwTableFUNC(SwFrmFmt &rFmt) : } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/tabsh.hxx b/sw/source/ui/inc/tabsh.hxx index 7c985f7b09..163e69d76c 100644 --- a/sw/source/ui/inc/tabsh.hxx +++ b/sw/source/ui/inc/tabsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,7 +36,7 @@ class SwWrtShell; SW_DLLPUBLIC void ItemSetToTableParam( const SfxItemSet& rSet, SwWrtShell &rSh ); -extern const sal_uInt16 __FAR_DATA aUITableAttrRange[]; +extern const sal_uInt16 aUITableAttrRange[]; SW_DLLPUBLIC const sal_uInt16* SwuiGetUITableAttrRange(); class SwTableShell: public SwBaseShell @@ -56,3 +57,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/tautofmt.hxx b/sw/source/ui/inc/tautofmt.hxx index 7fec212497..11d8a4b1ad 100644 --- a/sw/source/ui/inc/tautofmt.hxx +++ b/sw/source/ui/inc/tautofmt.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,25 +29,15 @@ #define SW_TAUTOFMT_HXX #include <sfx2/basedlgs.hxx> -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _MOREBTN_HXX //autogen #include <vcl/morebtn.hxx> -#endif -#ifndef _VIRDEV_HXX //autogen #include <vcl/virdev.hxx> -#endif class SwTableAutoFmt; class AutoFmtPreview; @@ -116,3 +107,4 @@ public: #endif // SW_AUTOFMT_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/tblctrl.hxx b/sw/source/ui/inc/tblctrl.hxx index f7fde59081..73fa55a587 100644 --- a/sw/source/ui/inc/tblctrl.hxx +++ b/sw/source/ui/inc/tblctrl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/tblnumfm.hxx b/sw/source/ui/inc/tblnumfm.hxx index 64f7fa1526..d385f4122d 100644 --- a/sw/source/ui/inc/tblnumfm.hxx +++ b/sw/source/ui/inc/tblnumfm.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,3 +43,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/tbxanchr.hxx b/sw/source/ui/inc/tbxanchr.hxx index d3047be467..cfff29f2fb 100644 --- a/sw/source/ui/inc/tbxanchr.hxx +++ b/sw/source/ui/inc/tbxanchr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,3 +48,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/textcontrolcombo.hxx b/sw/source/ui/inc/textcontrolcombo.hxx index dd73cdcf06..d1ad4126ea 100644 --- a/sw/source/ui/inc/textcontrolcombo.hxx +++ b/sw/source/ui/inc/textcontrolcombo.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #ifndef _TEXTCONTROLCOMBO_HXX #define _TEXTCONTROLCOMBO_HXX -#ifndef _FIXED_HXX #include <vcl/fixed.hxx> -#endif #include <vcl/field.hxx> #include "swdllapi.h" @@ -64,3 +63,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/textsh.hxx b/sw/source/ui/inc/textsh.hxx index f627491138..337c4aead5 100644 --- a/sw/source/ui/inc/textsh.hxx +++ b/sw/source/ui/inc/textsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,10 +48,6 @@ public: SFX_DECL_INTERFACE(SW_TEXTSHELL) TYPEINFO(); -//CHINA001 DECL_LINK( PostItNextHdl, Button * ); -//CHINA001 DECL_LINK( PostItPrevHdl, Button * ); -//CHINA001 DECL_LINK( RedlineNextHdl, Button * ); -//CHINA001 DECL_LINK( RedlinePrevHdl, Button * ); DECL_LINK( RedlineNextHdl, AbstractSvxPostItDialog * ); DECL_LINK( RedlinePrevHdl, AbstractSvxPostItDialog * ); @@ -88,3 +85,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/titlepage.hxx b/sw/source/ui/inc/titlepage.hxx new file mode 100644 index 0000000000..5f102e0082 --- /dev/null +++ b/sw/source/ui/inc/titlepage.hxx @@ -0,0 +1,102 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara <caolanm@redhat.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#ifndef _SWTITLEPAGE_HXX +#define _SWTITLEPAGE_HXX + +#include <sfx2/basedlgs.hxx> +#include <sfx2/tabdlg.hxx> +#include <vcl/fixed.hxx> +#include <vcl/field.hxx> +#include <vcl/lstbox.hxx> +#include <numberingtypelistbox.hxx> + +class Window; +class SfxItemSet; +class SwView; +class SwWrtShell; +class SwPageDesc; + +class SwTitlePageDlg : public SfxModalDialog +{ +private: + FixedLine aMakeInsertFL; + RadioButton aUseExistingPagesRB; + RadioButton aInsertNewPagesRB; + FixedText aPageCountFT; + NumericField aPageCountNF; + FixedText aPagePagesFT; + + FixedText aPageStartFT; + RadioButton aDocumentStartRB; + RadioButton aPageStartRB; + NumericField aPageStartNF; + + FixedLine aNumberingFL; + CheckBox aRestartNumberingCB; + FixedText aRestartNumberingFT; + NumericField aRestartNumberingNF; + CheckBox aSetPageNumberCB; + FixedText aSetPageNumberFT; + NumericField aSetPageNumberNF; + + FixedLine aPagePropertiesFL; + ListBox aPagePropertiesLB; + PushButton aPagePropertiesPB; + + FixedLine aBottomFL; + OKButton aOkPB; + CancelButton aCancelPB; + HelpButton aHelpPB; + + SwWrtShell *mpSh; + + const SwFmtPageDesc *mpPageFmtDesc; + + SwPageDesc *mpTitleDesc; + const SwPageDesc *mpIndexDesc; + const SwPageDesc *mpNormalDesc; + + void FillList(); + + sal_uInt16 GetInsertPosition() const; + + DECL_LINK( OKHdl, Button * ); + DECL_LINK( EditHdl, Button * ); + DECL_LINK( RestartNumberingHdl, CheckBox* ); + DECL_LINK( SetPageNumberHdl, CheckBox* ); + DECL_LINK( UpHdl, NumericField * ); + DECL_LINK( DownHdl, NumericField * ); + DECL_LINK( StartPageHdl, RadioButton * ); +public: + SwTitlePageDlg( Window *pParent ); + ~SwTitlePageDlg(); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/tmpdlg.hxx b/sw/source/ui/inc/tmpdlg.hxx index 7a05c4dc07..6a8e7de1b8 100644 --- a/sw/source/ui/inc/tmpdlg.hxx +++ b/sw/source/ui/inc/tmpdlg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,7 +36,6 @@ class SwWrtShell; /*-------------------------------------------------------------------- Beschreibung: Der Tabdialog Traeger der TabPages --------------------------------------------------------------------*/ - class SwTemplateDlg: public SfxStyleDialog { @@ -61,6 +61,6 @@ public: virtual short Ok(); }; - #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/tmplctrl.hxx b/sw/source/ui/inc/tmplctrl.hxx index ed090a0a2c..6a9a2d35c2 100644 --- a/sw/source/ui/inc/tmplctrl.hxx +++ b/sw/source/ui/inc/tmplctrl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,13 +29,10 @@ #define _TMPLCTRL_HXX // include --------------------------------------------------------------- - #include <sfx2/stbitem.hxx> #include <tools/string.hxx> - // class BookmarkToolBoxControl ------------------------------------------- - class SwTemplateControl : public SfxStatusBarControl { protected: @@ -53,6 +51,6 @@ private: String sTemplate; }; - #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/toxmgr.hxx b/sw/source/ui/inc/toxmgr.hxx index b785ecf509..5c2aeb0b70 100644 --- a/sw/source/ui/inc/toxmgr.hxx +++ b/sw/source/ui/inc/toxmgr.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,7 +40,6 @@ class SwForm; Beschreibung: Manager fuer Verzeichnisfunktionalitaet --------------------------------------------------------------------*/ //one single method will be sufficient to insert AND upate indexes - class SW_DLLPUBLIC SwTOXDescription { TOXTypes eTOXType; @@ -183,7 +183,7 @@ public: void ApplyTo(SwTOXBase& rTOXBase); }; -// -------------------------------------------------------------------------------- + class SwTOXMarkDescription { TOXTypes eTOXType; @@ -309,16 +309,15 @@ public: }; - /*-------------------------------------------------------------------- Beschreibung: Inlines --------------------------------------------------------------------*/ - inline sal_uInt16 SwTOXMgr::GetTOXMarkCount() { return aCurMarks.Count(); } - inline SwTOXMark* SwTOXMgr::GetCurTOXMark() { return pCurTOXMark; } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/uiborder.hxx b/sw/source/ui/inc/uiborder.hxx index 87aacaecbd..44900332e3 100644 --- a/sw/source/ui/inc/uiborder.hxx +++ b/sw/source/ui/inc/uiborder.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,3 +48,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/uiitems.hxx b/sw/source/ui/inc/uiitems.hxx index 7ddccafccc..f34a76b384 100644 --- a/sw/source/ui/inc/uiitems.hxx +++ b/sw/source/ui/inc/uiitems.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,16 +57,14 @@ public: String &rText, const IntlWrapper* pIntl = 0 ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); SwPageFtnInfo& GetPageFtnInfo() { return aFtnInfo; } const SwPageFtnInfo& GetPageFtnInfo() const { return aFtnInfo; } void SetPageFtnInfo(SwPageFtnInfo& rInf) { aFtnInfo = rInf; } }; -/*******************************************************************/ - class SW_DLLPUBLIC SwPtrItem : public SfxPoolItem { void* pMisc; @@ -81,8 +80,6 @@ public: void* GetValue() const { return pMisc; } }; -/*******************************************************************/ - class SW_DLLPUBLIC SwUINumRuleItem : public SfxPoolItem { SwNumRule* pRule; @@ -95,16 +92,13 @@ public: virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual int operator==( const SfxPoolItem& ) const; - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); const SwNumRule* GetNumRule() const { return pRule; } SwNumRule* GetNumRule() { return pRule; } }; -/* -----------------17.06.98 17:40------------------- - * - * --------------------------------------------------*/ class SwBackgroundDestinationItem : public SfxUInt16Item { public: @@ -114,3 +108,5 @@ public: }; #endif // _UIITEMS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/uinums.hxx b/sw/source/ui/inc/uinums.hxx index 98be353c72..c6571787b0 100644 --- a/sw/source/ui/inc/uinums.hxx +++ b/sw/source/ui/inc/uinums.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,7 +41,6 @@ class SvStream; typedef SfxPoolItem* SfxPoolItemPtr; SV_DECL_PTRARR_DEL( _SwNumFmtsAttrs, SfxPoolItemPtr, 5,0 ) -//------------------------------------------------------------------------ class SW_DLLPUBLIC SwNumRulesWithName { String aName; @@ -83,9 +83,7 @@ public: void Store( SvStream& ); }; -/******************************************************************** -********************************************************************/ class SwBaseNumRules { public: @@ -112,9 +110,6 @@ public: }; -/******************************************************************** - -********************************************************************/ class SwChapterNumRules : public SwBaseNumRules { @@ -129,8 +124,10 @@ public: // INLINE METHODE -------------------------------------------------------- inline const SwNumRulesWithName *SwBaseNumRules::GetRules(sal_uInt16 nIdx) const { - ASSERT(nIdx < nMaxRules, Array der NumRules ueberindiziert.); + OSL_ENSURE(nIdx < nMaxRules, "Array der NumRules ueberindiziert."); return pNumRules[nIdx]; } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/uitool.hxx b/sw/source/ui/inc/uitool.hxx index 732a735369..0534680274 100644 --- a/sw/source/ui/inc/uitool.hxx +++ b/sw/source/ui/inc/uitool.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,6 +74,9 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ); SW_DLLPUBLIC FieldUnit GetDfltMetric(sal_Bool bWeb); void SetDfltMetric(FieldUnit eMetric, sal_Bool bWeb); +SW_DLLPUBLIC sal_Bool HasCharUnit( sal_Bool bWeb ); +void SetApplyCharUnit(sal_Bool bApplyChar, sal_Bool bWeb); + // ListBox mit allen Zeichenvorlagen fuellen - ausser Standard! SW_DLLPUBLIC void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, sal_Bool bSorted = sal_False, sal_Bool bWithDefault = sal_False); @@ -90,3 +94,5 @@ String GetAppLangDateTimeString( const DateTime& ); bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16 nId ); #endif // _UITOOL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/uivwimp.hxx b/sw/source/ui/inc/uivwimp.hxx index daed04444c..dc97992b66 100644 --- a/sw/source/ui/inc/uivwimp.hxx +++ b/sw/source/ui/inc/uivwimp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,9 +53,6 @@ namespace com{ namespace sun{ namespace star { } }}} -/* -----------------------------29.05.00 08:22-------------------------------- - - ---------------------------------------------------------------------------*/ class SwScannerEventListener : public ::cppu::WeakImplHelper1< STAR_NMSPC::lang::XEventListener > { @@ -73,7 +71,6 @@ public: }; // --------------------------- Clipboard EventListener ------------------ - class SwClipboardChangeListener : public ::cppu::WeakImplHelper1< CLIP_NMSPC::XClipboardListener > { @@ -96,11 +93,8 @@ public: void AddRemoveListener( sal_Bool bAdd ); }; - -/* --------------------------------------------------------------------------- - - ---------------------------------------------------------------------------*/ class SwMailMergeConfigItem; + class SwView_Impl { STAR_REFERENCE( lang::XEventListener ) xScanEvtLstnr; @@ -186,3 +180,4 @@ public: }; #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/unodispatch.hxx b/sw/source/ui/inc/unodispatch.hxx index 5deae6b3fa..dc77100552 100644 --- a/sw/source/ui/inc/unodispatch.hxx +++ b/sw/source/ui/inc/unodispatch.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,13 +36,10 @@ #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase3.hxx> #include <list> -//#ifndef _OSL_MUTEX_HXX_ -//#include <osl/mutex.hxx> -//#endif -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> class SwView; -//--------------------------------------------------------------------------------------------------------------------- + class SwXDispatchProviderInterceptor : public cppu::WeakImplHelper3 < ::com::sun::star::frame::XDispatchProviderInterceptor, @@ -52,7 +50,7 @@ class SwXDispatchProviderInterceptor : public cppu::WeakImplHelper3 class DispatchMutexLock_Impl { //::osl::MutexGuard aGuard; #102295# solar mutex has to be used currently - vos::OGuard aGuard; + osl::SolarGuard aGuard; DispatchMutexLock_Impl(); public: DispatchMutexLock_Impl(SwXDispatchProviderInterceptor&); @@ -132,3 +130,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/unotools.hxx b/sw/source/ui/inc/unotools.hxx index 7f7367d7b5..16572bb779 100644 --- a/sw/source/ui/inc/unotools.hxx +++ b/sw/source/ui/inc/unotools.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include <vcl/dialog.hxx> #include <vcl/fixed.hxx> #include <vcl/edit.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif #include <actctrl.hxx> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/text/XTextCursor.hpp> @@ -44,10 +43,8 @@ #include <swunodef.hxx> #include "swdllapi.h" -/* -----------------------------15.12.99 09:55-------------------------------- - - ---------------------------------------------------------------------------*/ class SwOneExampleFrame; + class SwFrmCtrlWindow : public Window { SwOneExampleFrame* pExampleFrame; @@ -56,9 +53,7 @@ public: virtual void Command( const CommandEvent& rCEvt ); }; -/* -----------------------------15.12.99 12:56-------------------------------- - ---------------------------------------------------------------------------*/ class MenuResource : public Resource { ResStringArray aMenuArray; @@ -68,9 +63,7 @@ public: ResStringArray& GetMenuArray() {return aMenuArray;} }; -/* -----------------27.07.99 15:20------------------- - --------------------------------------------------*/ #define EX_SHOW_ONLINE_LAYOUT 0x001 // hard zoom value @@ -79,6 +72,7 @@ public: #define EX_SHOW_DEFAULT_PAGE 0x04 class SwView; + class SW_DLLPUBLIC SwOneExampleFrame { ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > _xControl; @@ -133,3 +127,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/unotxvw.hxx b/sw/source/ui/inc/unotxvw.hxx index e4d3a73221..93c42fee61 100644 --- a/sw/source/ui/inc/unotxvw.hxx +++ b/sw/source/ui/inc/unotxvw.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,9 +58,6 @@ class SwView; typedef ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener > * XSelectionChangeListenerPtr; SV_DECL_PTRARR_DEL( SelectionChangeListenerArr, XSelectionChangeListenerPtr, 4, 4 ) -/****************************************************************************** - * - ******************************************************************************/ class SwXTextView : public ::com::sun::star::view::XSelectionSupplier, public ::com::sun::star::lang::XServiceInfo, @@ -159,10 +157,6 @@ public: SfxObjectShellLock BuildTmpSelectionDoc(); }; -/* -----------------17.09.98 12:52------------------- - * - * --------------------------------------------------*/ - typedef cppu::WeakImplHelper8< ::com::sun::star::text::XTextViewCursor, ::com::sun::star::lang::XServiceInfo, @@ -269,6 +263,7 @@ public: virtual const SwDoc* GetDoc() const; virtual SwDoc* GetDoc(); }; -#endif +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/usrpref.hxx b/sw/source/ui/inc/usrpref.hxx index 75a5da36d1..53f2d76af1 100644 --- a/sw/source/ui/inc/usrpref.hxx +++ b/sw/source/ui/inc/usrpref.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,10 +35,8 @@ #include "viewopt.hxx" #include <tools/fldunit.hxx> -/* -----------------------------28.09.00 09:45-------------------------------- - - ---------------------------------------------------------------------------*/ class SwMasterUsrPref; + class SwContentViewConfig : public utl::ConfigItem { SwMasterUsrPref& rParent; @@ -55,9 +54,7 @@ class SwContentViewConfig : public utl::ConfigItem void Load(); void SetModified(){ConfigItem::SetModified();} }; -/* -----------------------------28.09.00 09:45-------------------------------- - ---------------------------------------------------------------------------*/ class SwLayoutViewConfig : public utl::ConfigItem { SwMasterUsrPref& rParent; @@ -73,9 +70,7 @@ class SwLayoutViewConfig : public utl::ConfigItem void Load(); void SetModified(){ConfigItem::SetModified();} }; -/* -----------------------------19.01.01 13:06-------------------------------- - ---------------------------------------------------------------------------*/ class SwGridConfig : public utl::ConfigItem { SwMasterUsrPref& rParent; @@ -91,9 +86,7 @@ class SwGridConfig : public utl::ConfigItem void Load(); void SetModified(){ConfigItem::SetModified();} }; -/* -----------------------------19.01.01 13:06-------------------------------- - ---------------------------------------------------------------------------*/ class SwCursorConfig : public utl::ConfigItem { SwMasterUsrPref& rParent; @@ -108,9 +101,7 @@ class SwCursorConfig : public utl::ConfigItem void Load(); void SetModified(){ConfigItem::SetModified();} }; -/* -----------------------------28.09.00 09:45-------------------------------- - ---------------------------------------------------------------------------*/ class SwWebColorConfig : public utl::ConfigItem { SwMasterUsrPref& rParent; @@ -125,9 +116,7 @@ class SwWebColorConfig : public utl::ConfigItem void Load(); void SetModified(){ConfigItem::SetModified();} }; -/* -----------------------------28.09.00 09:45-------------------------------- - ---------------------------------------------------------------------------*/ class SwMasterUsrPref : public SwViewOption { friend class SwContentViewConfig; @@ -155,6 +144,7 @@ class SwMasterUsrPref : public SwViewOption SwCursorConfig aCursorConfig; SwWebColorConfig* pWebColorConfig; + sal_Bool bApplyCharUnit; // apply_char_unit public: SwMasterUsrPref(sal_Bool bWeb); ~SwMasterUsrPref(); @@ -256,6 +246,17 @@ public: aLayoutConfig.SetModified(); } + sal_Bool IsApplyCharUnit() const + { + return bApplyCharUnit; + } + void SetApplyCharUnit(sal_Bool bSet, sal_Bool bNoModify = sal_False) + { + bApplyCharUnit = bSet; + if(!bNoModify) + aLayoutConfig.SetModified(); + } + sal_Int32 GetDefTab() const { return nDefTab;} void SetDefTab( sal_Int32 nSet, sal_Bool bNoModify = sal_False ) { @@ -284,3 +285,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/utlui.hrc b/sw/source/ui/inc/utlui.hrc index 17961add66..80970bbfb2 100644 --- a/sw/source/ui/inc/utlui.hrc +++ b/sw/source/ui/inc/utlui.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -154,15 +154,7 @@ #define DLG_GLOSSARY_DECIDE_DLG (RC_UTLUI_BEGIN + 3) #define IMG_NAVI_ENTRYBMP (RC_UTLUI_BEGIN + 4) -#define IMG_NAVI_ENTRYBMPH (RC_UTLUI_BEGIN + 5) #define ILIST_DB_DLG (RC_UTLUI_BEGIN + 6) -#define ILIST_DB_DLG_HC (RC_UTLUI_BEGIN + 7) - -#define IMG_ONE_LEFT_HC (RC_UTLUI_BEGIN + 8) -#define IMG_ONE_RIGHT_HC (RC_UTLUI_BEGIN + 9) -#define IMG_ALL_LEFT_HC (RC_UTLUI_BEGIN + 10) -#define IMG_ALL_RIGHT_HC (RC_UTLUI_BEGIN + 11) - #define IMG_VIEWLAYOUT_AUTOMATIC (RC_UTLUI_BEGIN + 12) #define IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE (RC_UTLUI_BEGIN + 13) @@ -170,12 +162,6 @@ #define IMG_VIEWLAYOUT_BOOKMODE_ACTIVE (RC_UTLUI_BEGIN + 15) #define IMG_VIEWLAYOUT_SINGLECOLUMN (RC_UTLUI_BEGIN + 16) #define IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE (RC_UTLUI_BEGIN + 17) -#define IMG_VIEWLAYOUT_AUTOMATIC_HC (RC_UTLUI_BEGIN + 18) -#define IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE_HC (RC_UTLUI_BEGIN + 19) -#define IMG_VIEWLAYOUT_BOOKMODE_HC (RC_UTLUI_BEGIN + 20) -#define IMG_VIEWLAYOUT_BOOKMODE_ACTIVE_HC (RC_UTLUI_BEGIN + 21) -#define IMG_VIEWLAYOUT_SINGLECOLUMN_HC (RC_UTLUI_BEGIN + 22) -#define IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE_HC (RC_UTLUI_BEGIN + 23) //local ids of the Database ImageLists diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index 7ad42b5d81..8961760c08 100644 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,6 +30,7 @@ #include <vcl/timer.hxx> #include <vcl/field.hxx> +#include <vcl/floatwin.hxx> #include <svtools/htmlcfg.hxx> #include <sfx2/viewfac.hxx> #include <sfx2/viewsh.hxx> @@ -127,13 +129,13 @@ enum ShellModes SHELL_MODE_MEDIA, SHELL_MODE_EXTRUDED_CUSTOMSHAPE, SHELL_MODE_FONTWORK, - SHELL_MODE_POSTIT + SHELL_MODE_POSTIT, + SHELL_MODE_NAVIGATION }; /*-------------------------------------------------------------------- Beschreibung: Anwendung einer Vorlage --------------------------------------------------------------------*/ - struct SwApplyTemplate { union @@ -160,11 +162,9 @@ struct SwApplyTemplate } }; - /*-------------------------------------------------------------------- Beschreibung: Sicht auf ein Dokument --------------------------------------------------------------------*/ - class SW_DLLPUBLIC SwView: public SfxViewShell { //Messehack (MA,MBA) @@ -246,6 +246,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell SwPostItMgr *mpPostItMgr; int nSelectionType; + FloatingWindow *mpFieldPopup; static const int MASTERENUMCOMMANDS = 6; @@ -307,6 +308,8 @@ class SW_DLLPUBLIC SwView: public SfxViewShell SW_DLLPRIVATE DECL_LINK( HtmlOptionsHdl, void * ); + SW_DLLPRIVATE DECL_LINK( FieldPopupModeEndHdl, FloatingWindow * ); + inline long GetXScroll() const; inline long GetYScroll() const; SW_DLLPRIVATE Point AlignToPixel(const Point& rPt) const; @@ -329,6 +332,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell SW_DLLPRIVATE DECL_LINK( ScrollHdl, SwScrollbar * ); SW_DLLPRIVATE DECL_LINK( EndScrollHdl, SwScrollbar * ); SW_DLLPRIVATE sal_Bool UpdateScrollbars(); + SW_DLLPRIVATE DECL_LINK( WindowChildEventListener, VclSimpleEvent* ); SW_DLLPRIVATE void CalcVisArea( const Size &rPixelSz ); SW_DLLPRIVATE void CreatePageButtons(sal_Bool bShow); @@ -418,7 +422,7 @@ public: void GotFocus() const; virtual SdrView* GetDrawView() const; virtual sal_Bool HasUIFeature( sal_uInt32 nFeature ); - virtual void ShowCursor( FASTBOOL bOn = sal_True ); + virtual void ShowCursor( bool bOn = sal_True ); virtual ErrCode DoVerb( long nVerb ); virtual sal_uInt16 SetPrinter( SfxPrinter* pNew, @@ -468,7 +472,8 @@ public: DECL_LINK( SpellError, LanguageType * ); sal_Bool ExecSpellPopup( const Point& rPt ); - sal_Bool ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM ); + void ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM ); + // SMARTTAGS sal_Bool ExecSmartTagPopup( const Point& rPt ); @@ -669,7 +674,6 @@ public: }; // ----------------- inline Methoden ---------------------- - inline long SwView::GetXScroll() const { return aVisArea.GetWidth() * nScrollX / 100L; @@ -685,11 +689,10 @@ inline const SwDocShell *SwView::GetDocShell() const return ((SwView*)this)->GetDocShell(); } -//*********************************************************** - SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions, sal_Bool bPreview); #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/viewlayoutctrl.hxx b/sw/source/ui/inc/viewlayoutctrl.hxx index 3100fb6685..6a0a59414a 100644 --- a/sw/source/ui/inc/viewlayoutctrl.hxx +++ b/sw/source/ui/inc/viewlayoutctrl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,11 +29,9 @@ #define _VIEWLAYOUTCTRL_HXX // include --------------------------------------------------------------- - #include <sfx2/stbitem.hxx> // class SwViewLayoutControl ---------------------------------------------- - class SwViewLayoutControl : public SfxStatusBarControl { private: @@ -54,3 +53,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/wformsh.hxx b/sw/source/ui/inc/wformsh.hxx index 3f2831df86..44fc9769d0 100644 --- a/sw/source/ui/inc/wformsh.hxx +++ b/sw/source/ui/inc/wformsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/wfrmsh.hxx b/sw/source/ui/inc/wfrmsh.hxx index 894c9112bb..31750dd389 100644 --- a/sw/source/ui/inc/wfrmsh.hxx +++ b/sw/source/ui/inc/wfrmsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,4 @@ public: +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/wgrfsh.hxx b/sw/source/ui/inc/wgrfsh.hxx index b15a51a127..3d0d9921fb 100644 --- a/sw/source/ui/inc/wgrfsh.hxx +++ b/sw/source/ui/inc/wgrfsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/wlistsh.hxx b/sw/source/ui/inc/wlistsh.hxx index 9482127053..2f34938e0d 100644 --- a/sw/source/ui/inc/wlistsh.hxx +++ b/sw/source/ui/inc/wlistsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,3 +41,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/wolesh.hxx b/sw/source/ui/inc/wolesh.hxx index 7e8faa25ce..ffb6c81270 100644 --- a/sw/source/ui/inc/wolesh.hxx +++ b/sw/source/ui/inc/wolesh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,4 @@ public: +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/wordcountdialog.hxx b/sw/source/ui/inc/wordcountdialog.hxx index d3d7a7d756..3d640caac2 100644 --- a/sw/source/ui/inc/wordcountdialog.hxx +++ b/sw/source/ui/inc/wordcountdialog.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ #define SW_WORDCOUNTDIALOG_HXX #include <sfx2/basedlgs.hxx> #include <svtools/stdctrl.hxx> -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif #include <layout/layout.hxx> #include <layout/layout-pre.hxx> struct SwDocStat; @@ -41,12 +40,16 @@ class SwWordCountDialog : public SfxModalDialog FixedInfo aCurrentWordFI; FixedText aCurrentCharacterFT; FixedInfo aCurrentCharacterFI; + FixedText aCurrentCharacterExcludingSpacesFT; + FixedInfo aCurrentCharacterExcludingSpacesFI; FixedLine aDocFL; FixedText aDocWordFT; FixedInfo aDocWordFI; FixedText aDocCharacterFT; FixedInfo aDocCharacterFI; + FixedText aDocCharacterExcludingSpacesFT; + FixedInfo aDocCharacterExcludingSpacesFI; FixedLine aBottomFL; @@ -63,3 +66,5 @@ public: #include <layout/layout-post.hxx> #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/workctrl.hxx b/sw/source/ui/inc/workctrl.hxx index 009a3f0461..b014472cb1 100644 --- a/sw/source/ui/inc/workctrl.hxx +++ b/sw/source/ui/inc/workctrl.hxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -30,9 +31,7 @@ #include <sfx2/tbxctrl.hxx> #include <vcl/toolbox.hxx> #include <svtools/stdctrl.hxx> -#ifndef _IMAGEBTN_HXX //autogen #include <vcl/button.hxx> -#endif class PopupMenu; class SwView; @@ -137,7 +136,6 @@ class SwScrollNaviPopup : public SfxPopupWindow FixedLine aSeparator; FixedInfo aInfoField; ImageList aIList; - ImageList aIListH; String sQuickHelp[2 * NID_COUNT]; @@ -145,7 +143,7 @@ class SwScrollNaviPopup : public SfxPopupWindow sal_uInt16 nBackId; void ApplyImageList(); - + using Window::GetQuickHelpText; protected: @@ -157,7 +155,7 @@ public: ~SwScrollNaviPopup(); static String GetQuickHelpText(sal_Bool bNext); - + virtual SfxPopupWindow* Clone() const; void GrabFocus(){aToolBox.GrabFocus();} }; @@ -170,7 +168,6 @@ class SwNaviImageButton : public ImageButton { SwScrollNaviPopup* pPopup; Image aImage; - Image aImageH; String sQuickText; SfxPopupWindow* pPopupWindow; SfxPopupWindow* pFloatingWindow; @@ -179,7 +176,7 @@ class SwNaviImageButton : public ImageButton protected: DECL_LINK( PopupModeEndHdl, void * ); DECL_LINK( ClosePopupWindow, SfxPopupWindow * ); - + virtual void Click(); virtual void DataChanged( const DataChangedEvent& rDCEvt ); void SetPopupWindow( SfxPopupWindow* pWindow ); @@ -202,9 +199,7 @@ class SwHlpImageButton : public ImageButton virtual void RequestHelp( const HelpEvent& rHEvt ); }; -/* -----------------26.11.2002 09:25----------------- - * - * --------------------------------------------------*/ + class SwPreviewZoomControl : public SfxToolBoxControl { public: @@ -223,3 +218,4 @@ public: +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/wrap.hxx b/sw/source/ui/inc/wrap.hxx index 52db2f62cd..07ec857cb1 100644 --- a/sw/source/ui/inc/wrap.hxx +++ b/sw/source/ui/inc/wrap.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,21 +31,13 @@ #include <sfx2/tabdlg.hxx> #include <sfx2/basedlgs.hxx> -#ifndef _IMAGEBTN_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif class Window; class SfxItemSet; @@ -149,3 +142,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx index f1e82a1d4c..34b08e195c 100644 --- a/sw/source/ui/inc/wrtsh.hxx +++ b/sw/source/ui/inc/wrtsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,6 +34,7 @@ #include <sortopt.hxx> #include <swurl.hxx> #include <IMark.hxx> +#include "navmgr.hxx" class Window; class OutputDevice; @@ -471,6 +473,21 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)(); String GetSelDescr() const; + SwNavigationMgr& GetNavigationMgr(); + void addCurrentPosition(); + sal_Bool GotoFly( const String& rName, FlyCntType eType = FLYCNTTYPE_ALL, + sal_Bool bSelFrame = sal_True ); + sal_Bool GotoINetAttr( const SwTxtINetFmt& rAttr ); + void GotoOutline( sal_uInt16 nIdx ); + sal_Bool GotoOutline( const String& rName ); + sal_Bool GotoRegion( const String& rName ); + sal_Bool GotoRefMark( const String& rRefMark, sal_uInt16 nSubType = 0, + sal_uInt16 nSeqNo = 0 ); + sal_Bool GotoNextTOXBase( const String* pName = 0); + sal_Bool GotoTable( const String& rName ); + sal_Bool GotoFld( const SwFmtFld& rFld ); + const SwRedline* GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect = sal_False); + private: SW_DLLPRIVATE void OpenMark(); @@ -527,6 +544,7 @@ private: } *pCrsrStack; SwView &rView; + SwNavigationMgr aNavigationMgr; Point aDest; sal_Bool bDestOnStack; @@ -648,3 +666,5 @@ inline sal_Bool SwWrtShell::Is_FnDragEQBeginDrag() const } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/wtabsh.hxx b/sw/source/ui/inc/wtabsh.hxx index 63f4eeed43..d88dea2474 100644 --- a/sw/source/ui/inc/wtabsh.hxx +++ b/sw/source/ui/inc/wtabsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,3 +41,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/wtextsh.hxx b/sw/source/ui/inc/wtextsh.hxx index 2dc2f8c12b..e558bcf6ae 100644 --- a/sw/source/ui/inc/wtextsh.hxx +++ b/sw/source/ui/inc/wtextsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,4 @@ public: +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/wview.hxx b/sw/source/ui/inc/wview.hxx index 935a677a71..2c60c6307f 100644 --- a/sw/source/ui/inc/wview.hxx +++ b/sw/source/ui/inc/wview.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,10 +31,6 @@ #include "swdllapi.h" #include "view.hxx" -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - class SW_DLLPUBLIC SwWebView: public SwView { protected: @@ -49,3 +46,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/zoomctrl.hxx b/sw/source/ui/inc/zoomctrl.hxx index 59a17bad46..b07848c50d 100644 --- a/sw/source/ui/inc/zoomctrl.hxx +++ b/sw/source/ui/inc/zoomctrl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,3 +51,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx index 3bc9565217..17bd9e593e 100644 --- a/sw/source/ui/index/cntex.cxx +++ b/sw/source/ui/index/cntex.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,7 +37,6 @@ #include <rsc/rscsfx.hxx> #include <com/sun/star/text/XDocumentIndexesSupplier.hpp> -#include <com/sun/star/text/XDocumentIndex.hpp> #include <com/sun/star/text/XTextSectionsSupplier.hpp> #include <com/sun/star/style/BreakType.hpp> #include <com/sun/star/text/XTextFieldsSupplier.hpp> @@ -52,9 +52,7 @@ #include <com/sun/star/ui/dialogs/XFilePicker.hpp> #include <com/sun/star/ui/dialogs/XFilterManager.hpp> #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <cnttab.hxx> #include <poolfmt.hxx> #include <unoprnms.hxx> @@ -63,21 +61,11 @@ #include <docsh.hxx> #include <swmodule.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _UTLUI_HRC #include <utlui.hrc> -#endif -#ifndef _INDEX_HRC #include <index.hrc> -#endif -#ifndef _CNTTAB_HRC #include <cnttab.hrc> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <SwStyleNameMapper.hxx> #include <swuicnttab.hxx> #include <unomid.h> @@ -102,14 +90,11 @@ using ::rtl::OUString; #endif #define SW_PROP_NAME_STR(nId) SwGetPropName((nId)).pName -/* -----------------04.11.99 11:28------------------- - - --------------------------------------------------*/ void lcl_SetProp( uno::Reference< XPropertySetInfo > & xInfo, uno::Reference< XPropertySet > & xProps, const char* pPropName, const String& rValue) { - OUString uPropName(C2U(pPropName)); + OUString uPropName(rtl::OUString::createFromAscii(pPropName)); if(xInfo->hasPropertyByName(uPropName)) { uno::Any aValue; @@ -117,17 +102,19 @@ void lcl_SetProp( uno::Reference< XPropertySetInfo > & xInfo, xProps->setPropertyValue(uPropName, aValue); } } + void lcl_SetProp( uno::Reference< XPropertySetInfo > & xInfo, uno::Reference< XPropertySet > & xProps, sal_uInt16 nId, const String& rValue) { lcl_SetProp( xInfo, xProps, SW_PROP_NAME_STR(nId), rValue); } + void lcl_SetProp( uno::Reference< XPropertySetInfo > & xInfo, uno::Reference< XPropertySet > & xProps, sal_uInt16 nId, sal_Int16 nValue ) { - OUString uPropName(C2U(SW_PROP_NAME_STR(nId))); + OUString uPropName(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(nId))); if(xInfo->hasPropertyByName(uPropName)) { uno::Any aValue; @@ -141,7 +128,7 @@ void lcl_SetBOOLProp( uno::Reference< beans::XPropertySet > & xProps, sal_uInt16 nId, sal_Bool bValue ) { - OUString uPropName(C2U(SW_PROP_NAME_STR(nId))); + OUString uPropName(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(nId))); if(xInfo->hasPropertyByName(uPropName)) { uno::Any aValue; @@ -149,7 +136,7 @@ void lcl_SetBOOLProp( xProps->setPropertyValue(uPropName, aValue); } } -//----------------------------------------------------------------------------- + IMPL_LINK( SwMultiTOXTabDialog, CreateExample_Hdl, void*, EMPTYARG ) { try @@ -191,21 +178,18 @@ IMPL_LINK( SwMultiTOXTabDialog, CreateExample_Hdl, void*, EMPTYARG ) } catch(Exception&) { - DBG_ERROR("::CreateExample() - exception caught"); + OSL_ENSURE(false, "::CreateExample() - exception caught"); } return 0; } -/* -------------------------------------------------- - - --------------------------------------------------*/ void SwMultiTOXTabDialog::CreateOrUpdateExample( TOXTypes nTOXIndex, sal_uInt16 nPage, sal_uInt16 nCurrentLevel) { if(!pExampleFrame || !pExampleFrame->IsInitialized()) return; - const char* __FAR_DATA IndexServiceNames[] = + const char* IndexServiceNames[] = { "com.sun.star.text.DocumentIndex", "com.sun.star.text.UserIndex", @@ -218,7 +202,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( try { - DBG_ASSERT(pxIndexSectionsArr[nTOXIndex] && + OSL_ENSURE(pxIndexSectionsArr[nTOXIndex] && pxIndexSectionsArr[nTOXIndex]->xContainerSection.is(), "Section not created"); uno::Reference< frame::XModel > & xModel = pExampleFrame->GetModel(); @@ -243,7 +227,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( uno::Reference< text::XTextRange > xRg(xCrsr, uno::UNO_QUERY); xCrsr->getText()->insertTextContent(xRg, xContent, sal_False); } - OUString uIsVisible(C2U(SW_PROP_NAME_STR(UNO_NAME_IS_VISIBLE))); + OUString uIsVisible(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_IS_VISIBLE))); for(sal_uInt16 i = 0 ; i <= TOX_AUTHORITIES; i++) { uno::Reference< beans::XPropertySet > xSectPr(pxIndexSectionsArr[i]->xContainerSection, uno::UNO_QUERY); @@ -269,10 +253,10 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( //stylenames sal_uInt16 nContentOptions = rDesc.GetContentOptions(); - if(xInfo->hasPropertyByName(C2U(SW_PROP_NAME_STR(UNO_NAME_LEVEL_PARAGRAPH_STYLES)))) + if(xInfo->hasPropertyByName(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LEVEL_PARAGRAPH_STYLES)))) { sal_Bool bOn = 0!=(nContentOptions&nsSwTOXElement::TOX_TEMPLATE ); - uno::Any aStyleNames(xIdxProps->getPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_LEVEL_PARAGRAPH_STYLES)))); + uno::Any aStyleNames(xIdxProps->getPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LEVEL_PARAGRAPH_STYLES)))); uno::Reference< container::XIndexReplace > xAcc; aStyleNames >>= xAcc; @@ -329,8 +313,6 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_STAR_CALC, 0 != (nsSwTOOElements::TOO_CALC &nOLEOptions )); lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_STAR_DRAW, 0 != (nsSwTOOElements::TOO_DRAW_IMPRESS&nOLEOptions)); lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_OTHER_EMBEDDED_OBJECTS, 0 != (nsSwTOOElements::TOO_OTHER|nOLEOptions )); - - //lcl_SetBOOLProp(xInfo, xIdxProps, , rDesc.IsLevelFromChapter()); } const SwForm* pForm = GetForm(eCurrentTOXType); if(bInitialCreate || !nPage || nPage == TOX_PAGE_ENTRY) @@ -347,7 +329,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( nEndLevel = pForm->GetFormMax() - 1; } - if(xInfo->hasPropertyByName(C2U(SW_PROP_NAME_STR(UNO_NAME_LEVEL_FORMAT)))) + if(xInfo->hasPropertyByName(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LEVEL_FORMAT)))) { for(sal_uInt16 nCurrLevel = nStartLevel; nCurrLevel <= nEndLevel; nCurrLevel++) { @@ -440,12 +422,12 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( pValues[nTokenIndex] = aPropVals; nTokenIndex++; - aIt++; // #i24377# + ++aIt; // #i24377# } aSequPropVals.realloc(nTokenIndex); - uno::Any aFormatAccess = xIdxProps->getPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_LEVEL_FORMAT))); - DBG_ASSERT(aFormatAccess.getValueType() == ::getCppuType((uno::Reference<container::XIndexReplace>*)0), + uno::Any aFormatAccess = xIdxProps->getPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LEVEL_FORMAT))); + OSL_ENSURE(aFormatAccess.getValueType() == ::getCppuType((uno::Reference<container::XIndexReplace>*)0), "wrong property type"); @@ -485,32 +467,13 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( pForm->GetTemplate(i + nOffset)); } } -/* - const String& GetAutoMarkURL() const { return sAutoMarkURL;} - const String& GetMainEntryCharStyle() const {return sMainEntryCharStyle;} - - String GetAuthBrackets() const {return sAuthBrackets;} - sal_Bool IsAuthSequence() const {return bIsAuthSequence;} - sal_Bool IsSortByDocument()const {return bSortByDocument ;} - - SwTOXSortKey GetSortKey1() const {return eSortKey1;} - SwTOXSortKey GetSortKey2() const {return eSortKey2;} - SwTOXSortKey GetSortKey3() const {return eSortKey3;} -*/ - // pxIndexSectionsArr[nTOXIndex]->xDocumentIndex->update(); -//#if OSL_DEBUG_LEVEL > 1 -// uno::Reference< frame::XStorable > xStor(xModel, uno::UNO_QUERY); -// String sURL("file:///e|/temp/sw/idxexample.sdw"); -// uno::Sequence< beans::PropertyValue > aArgs(0); -// xStor->storeToURL(S2U(sURL), aArgs); -//#endif - } catch(Exception&) { - DBG_ERROR("::CreateExample() - exception caught"); + OSL_ENSURE(false, "::CreateExample() - exception caught"); } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 2ccb0a498f..dc52c7a441 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -57,20 +58,14 @@ #include <authfld.hxx> #include <swtypes.hxx> #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif -#ifndef _BASESH_HXX #include <basesh.hxx> -#endif #include <outline.hxx> #include <cnttab.hxx> #include <swuicnttab.hxx> #include <formedt.hxx> #include <poolfmt.hxx> -#ifndef _POOLFMT_HRC #include <poolfmt.hrc> -#endif #include <uitool.hxx> #include <fmtcol.hxx> #include <fldbas.hxx> @@ -81,34 +76,18 @@ #include <swmodule.hxx> #include <modcfg.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _UTLUI_HRC #include <utlui.hrc> -#endif -#ifndef _INDEX_HRC #include <index.hrc> -#endif -#ifndef _CNTTAB_HRC #include <cnttab.hrc> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <SwStyleNameMapper.hxx> #include <sfx2/filedlghelper.hxx> -#ifndef _TOXHLP_HXX #include <toxwrap.hxx> -#endif #include <chpfld.hxx> -#ifndef _UTLUI_HRC #include "utlui.hrc" -#endif #include <sfx2/app.hxx> @@ -132,10 +111,17 @@ static const sal_Unicode aDeliEnd = ']'; //fuer die form #define IDX_FILE_EXTENSION String::CreateFromAscii( \ RTL_CONSTASCII_STRINGPARAM( "*.sdi" )) +static boost::ptr_vector<Control>::iterator FindControl (boost::ptr_vector<Control> &list, Control *ctrl) +{ + for (boost::ptr_vector<Control>::iterator it = list.begin(); it != list.end(); ++it) + { + if ((&(*it)) == ctrl) + return it; + } -/* -----------------14.06.99 13:10------------------- + return list.end(); +} - --------------------------------------------------*/ String lcl_CreateAutoMarkFileDlg( const String& rURL, const String& rFileString, sal_Bool bOpen ) { @@ -168,9 +154,7 @@ String lcl_CreateAutoMarkFileDlg( const String& rURL, rLastSaveDir = sSaveDir; return sRet; } -/* -----------------------------19.01.00 11:09-------------------------------- - ---------------------------------------------------------------------------*/ struct AutoMarkEntry { String sSearch; @@ -218,8 +202,6 @@ class SwEntryBrowseBox : public SwEntryBrowseBox_Base protected: virtual sal_Bool SeekRow( long nRow ); -// virtual void PaintField( OutputDevice& rDev, const awt::Rectangle& rRect, -// sal_uInt16 nColumnId ) const; virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId) const; virtual void InitController(::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol); virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol); @@ -257,9 +239,7 @@ public: ~SwAutoMarkDlg_Impl(); }; -/* -----------------04.11.99 11:02------------------- - --------------------------------------------------*/ sal_uInt16 CurTOXType::GetFlatIndex() const { sal_uInt16 nRet = static_cast< sal_uInt16 >(eType); @@ -269,14 +249,9 @@ sal_uInt16 CurTOXType::GetFlatIndex() const } return nRet; } -/************************************************************************* -*************************************************************************/ #define EDIT_MINWIDTH 15 -/* -----------------14.06.99 12:12------------------- - - --------------------------------------------------*/ SwMultiTOXTabDialog::SwMultiTOXTabDialog(Window* pParent, const SfxItemSet& rSet, SwWrtShell &rShell, SwTOXBase* pCurTOX, @@ -362,7 +337,7 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(Window* pParent, const SfxItemSet& rSet } } SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AddTabPage(TP_TOX_SELECT, SwTOXSelectTabPage::Create, 0); AddTabPage(TP_TOX_STYLES, SwTOXStylesTabPage::Create, 0); AddTabPage(TP_COLUMN, SwColumnPage::Create, 0); @@ -389,9 +364,7 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(Window* pParent, const SfxItemSet& rSet if(aNewPos.X() < 0) SetPosPixel(aOldPos); } -/*-- 14.06.99 13:11:40--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMultiTOXTabDialog::~SwMultiTOXTabDialog() { SW_MOD()->GetModuleConfig()->SetShowIndexPreview(aShowExampleCB.IsChecked()); @@ -409,9 +382,7 @@ SwMultiTOXTabDialog::~SwMultiTOXTabDialog() delete pMgr; delete pExampleFrame; } -/*-- 14.06.99 13:11:40--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwMultiTOXTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { if( TP_BACKGROUND == nId ) @@ -435,9 +406,7 @@ void SwMultiTOXTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) ((SwTOXSelectTabPage&)rPage).SelectType((TOXTypes)nInitialTOXType); } } -/*-- 14.06.99 13:11:40--------------------------------------------------- - -----------------------------------------------------------------------*/ short SwMultiTOXTabDialog::Ok() { short nRet = SfxTabDialog::Ok(); @@ -468,9 +437,7 @@ short SwMultiTOXTabDialog::Ok() return nRet; } -/* -----------------16.06.99 11:59------------------- - --------------------------------------------------*/ SwForm* SwMultiTOXTabDialog::GetForm(CurTOXType eType) { sal_uInt16 nIndex = eType.GetFlatIndex(); @@ -478,9 +445,7 @@ SwForm* SwMultiTOXTabDialog::GetForm(CurTOXType eType) pFormArr[nIndex] = new SwForm(eType.eType); return pFormArr[nIndex]; } -/* -----------------09.09.99 11:29------------------- - --------------------------------------------------*/ SwTOXDescription& SwMultiTOXTabDialog::GetTOXDescription(CurTOXType eType) { sal_uInt16 nIndex = eType.GetFlatIndex(); @@ -520,9 +485,7 @@ SwTOXDescription& SwMultiTOXTabDialog::GetTOXDescription(CurTOXType eType) } return *pDescArr[nIndex]; } -/* -----------------09.09.99 11:36------------------- - --------------------------------------------------*/ SwTOXDescription* SwMultiTOXTabDialog::CreateTOXDescFromTOXBase( const SwTOXBase*pCurTOX) { @@ -551,10 +514,6 @@ SwTOXDescription* SwMultiTOXTabDialog::CreateTOXDescFromTOXBase( return pDesc; } -/* -----------------------------29.12.99 09:53-------------------------------- - - ---------------------------------------------------------------------------*/ - IMPL_LINK( SwMultiTOXTabDialog, ShowPreviewHdl, CheckBox *, pBox ) { if(aShowExampleCB.IsChecked()) @@ -635,28 +594,20 @@ IMPL_LINK( SwMultiTOXTabDialog, ShowPreviewHdl, CheckBox *, pBox ) return 0; } - -/* -----------------05.07.99 09:49------------------- - - --------------------------------------------------*/ sal_Bool SwMultiTOXTabDialog::IsNoNum(SwWrtShell& rSh, const String& rName) { SwTxtFmtColl* pColl = rSh.GetParaStyle(rName); - //if(pColl && pColl->GetOutlineLevel() == NO_NUMBERING) //#outline level,zhaojianwei if(pColl && ! pColl->IsAssignedToListLevelOfOutlineStyle()) //<-end,zhaojianwei return sal_True; sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL); if(nId != USHRT_MAX && - //rSh.GetTxtCollFromPool(nId)->GetOutlineLevel() == NO_NUMBERING) //#outline level,zhaojianwei ! rSh.GetTxtCollFromPool(nId)->IsAssignedToListLevelOfOutlineStyle()) //<-end,zhaojianwei return sal_True; return sal_False; } -/* -----------------14.07.99 16:01------------------- - --------------------------------------------------*/ class SwIndexTreeLB : public SvTreeListBox { const HeaderBar* pHeaderBar; @@ -668,9 +619,7 @@ public: virtual long GetTabPos( SvLBoxEntry*, SvLBoxTab* ); void SetHeaderBar(const HeaderBar* pHB) {pHeaderBar = pHB;} }; -/* -----------------14.07.99 16:03------------------- - --------------------------------------------------*/ long SwIndexTreeLB::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab) { long nData = (long)pEntry->GetUserData(); @@ -684,9 +633,7 @@ long SwIndexTreeLB::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab) nData += pTab->GetPos(); return nData; } -/* -----------------25.08.99 11:14------------------- - --------------------------------------------------*/ void SwIndexTreeLB::KeyInput( const KeyEvent& rKEvt ) { SvLBoxEntry* pEntry = FirstSelected(); @@ -721,9 +668,6 @@ void SwIndexTreeLB::KeyInput( const KeyEvent& rKEvt ) SvTreeListBox::KeyInput(rKEvt); } -/* -----------------16.07.99 10:01------------------- - - --------------------------------------------------*/ class SwHeaderTree : public Control { HeaderBar aStylesHB; @@ -737,9 +681,7 @@ public: virtual void GetFocus(); }; -/* -----------------16.07.99 10:11------------------- - --------------------------------------------------*/ SwHeaderTree::SwHeaderTree(Window* pParent, const ResId rResId) : Control(pParent, rResId), aStylesHB( this, ResId(HB_STYLES, *rResId.GetResMgr())), @@ -756,17 +698,13 @@ SwHeaderTree::SwHeaderTree(Window* pParent, const ResId rResId) : aStylesTLB.SetSizePixel(aTLBSize); aStylesTLB.SetHeaderBar(&aStylesHB); } -/* -----------------25.08.99 10:38------------------- - --------------------------------------------------*/ void SwHeaderTree::GetFocus() { Control::GetFocus(); aStylesTLB.GrabFocus(); } -/* -----------------13.07.99 15:29------------------- - --------------------------------------------------*/ class SwAddStylesDlg_Impl : public SfxModalDialog { OKButton aOk; @@ -789,9 +727,7 @@ public: SwAddStylesDlg_Impl(Window* pParent, SwWrtShell& rWrtSh, String rStringArr[]); ~SwAddStylesDlg_Impl(); }; -/* -----------------13.07.99 15:39------------------- - --------------------------------------------------*/ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent, SwWrtShell& rWrtSh, String rStringArr[]) : SfxModalDialog(pParent, SW_RES(DLG_ADD_IDX_STYLES)), @@ -813,9 +749,6 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent, aLeftPB.SetAccessibleRelationMemberOf(&aStylesFL); aRightPB.SetAccessibleRelationMemberOf(&aStylesFL); - aLeftPB.SetModeImage( Image( SW_RES( IMG_ALL_LEFT_HC ) ), BMP_COLOR_HIGHCONTRAST ); - aRightPB.SetModeImage( Image( SW_RES( IMG_ALL_RIGHT_HC ) ), BMP_COLOR_HIGHCONTRAST ); - aOk.SetClickHdl(LINK(this, SwAddStylesDlg_Impl, OkHdl)); aLeftPB.SetClickHdl(LINK(this, SwAddStylesDlg_Impl, LeftRightHdl)); aRightPB.SetClickHdl(LINK(this, SwAddStylesDlg_Impl, LeftRightHdl)); @@ -835,7 +768,6 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent, SwIndexTreeLB& rTLB = aHeaderTree.GetTreeListBox(); rTLB.SetStyle(rTLB.GetStyle()|WB_CLIPCHILDREN|WB_SORT); - //aStylesTLB.SetSelectHdl(LINK(this, SwAddStylesDlg_Impl, SelectHdl)); rTLB.GetModel()->SetSortMode(SortAscending); for(i = 0; i < MAXLEVEL; ++i) { @@ -879,15 +811,10 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent, rTLB.GetModel()->Resort(); } -/* -----------------13.07.99 15:39------------------- - - --------------------------------------------------*/ SwAddStylesDlg_Impl::~SwAddStylesDlg_Impl() { } -/* -----------------13.07.99 15:39------------------- - --------------------------------------------------*/ IMPL_LINK(SwAddStylesDlg_Impl, OkHdl, OKButton*, EMPTYARG) { for(sal_uInt16 i = 0; i < MAXLEVEL; i++) @@ -912,17 +839,13 @@ IMPL_LINK(SwAddStylesDlg_Impl, OkHdl, OKButton*, EMPTYARG) EndDialog(RET_OK); return 0; } -/* -----------------16.07.99 09:27------------------- - --------------------------------------------------*/ IMPL_LINK(SwAddStylesDlg_Impl, HeaderDragHdl, HeaderBar*, EMPTYARG) { aHeaderTree.GetTreeListBox().Invalidate(); return 0; } -/* -----------------13.07.99 15:39------------------- - --------------------------------------------------*/ IMPL_LINK(SwAddStylesDlg_Impl, LeftRightHdl, PushButton*, pBtn) { sal_Bool bLeft = pBtn == &aLeftPB; @@ -950,9 +873,6 @@ IMPL_LINK(SwAddStylesDlg_Impl, LeftRightHdl, PushButton*, pBtn) return 0; } -/*-- 14.06.99 13:11:40--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrSet) : SfxTabPage(pParent, SW_RES(TP_TOX_SELECT), rAttrSet), @@ -971,7 +891,6 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS aCreateFromFL( this, SW_RES(FL_CREATEFROM )), aFromHeadingsCB( this, SW_RES(CB_FROMHEADINGS )), -// aChapterDlgPB( this, SW_RES(PB_CHAPTERDLG )),//#outline level,removed by zhaojianwei aAddStylesCB( this, SW_RES(CB_ADDSTYLES )), aAddStylesPB( this, SW_RES(PB_ADDSTYLES )), @@ -1053,7 +972,6 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS aTypeLB.SetSelectHdl(LINK(this, SwTOXSelectTabPage, TOXTypeHdl)); aAddStylesPB.SetClickHdl(LINK(this, SwTOXSelectTabPage, AddStylesHdl)); - //aChapterDlgPB.SetClickHdl(LINK(this, SwTOXSelectTabPage, ChapterHdl));//#outline level,removed by zhaojianwei PopupMenu* pMenu = aAutoMarkPB.GetPopupMenu(); pMenu->SetActivateHdl(LINK(this, SwTOXSelectTabPage, MenuEnableHdl)); @@ -1084,17 +1002,13 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS aTypeLB.SelectEntryPos(0); aTitleED.SaveValue(); } -/*-- 14.06.99 13:11:41--------------------------------------------------- - -----------------------------------------------------------------------*/ SwTOXSelectTabPage::~SwTOXSelectTabPage() { delete pIndexRes; delete pIndexEntryWrapper; } -/* -----------------21.10.99 17:03------------------- - --------------------------------------------------*/ void SwTOXSelectTabPage::SetWrtShell(SwWrtShell& rSh) { sal_uInt16 nUserTypeCount = rSh.GetTOXTypeCount(TOX_USER); @@ -1106,22 +1020,18 @@ void SwTOXSelectTabPage::SetWrtShell(SwWrtShell& rSh) for(sal_uInt16 nUser = 1; nUser < nUserTypeCount; nUser++) { nPos = aTypeLB.InsertEntry(rSh.GetTOXType(TOX_USER, nUser)->GetTypeName(), nPos); - sal_uInt32 nEntryData = nUser << 8; + sal_uIntPtr nEntryData = nUser << 8; nEntryData |= TO_USER; aTypeLB.SetEntryData(nPos, (void*)nEntryData); } } } -/* -----------------14.06.99 13:10------------------- - --------------------------------------------------*/ sal_Bool SwTOXSelectTabPage::FillItemSet( SfxItemSet& ) { return sal_True; } -/* -----------------25.08.99 14:31------------------- - --------------------------------------------------*/ long lcl_TOXTypesToUserData(CurTOXType eType) { sal_uInt16 nRet = TOX_INDEX; @@ -1142,7 +1052,7 @@ long lcl_TOXTypesToUserData(CurTOXType eType) } return nRet; } -//----------------------------------------------------------------- + void SwTOXSelectTabPage::SelectType(TOXTypes eSet) { CurTOXType eCurType (eSet, 0); @@ -1154,10 +1064,6 @@ void SwTOXSelectTabPage::SelectType(TOXTypes eSet) TOXTypeHdl(&aTypeLB); } -/*-- 14.06.99 13:10:45--------------------------------------------------- - - -----------------------------------------------------------------------*/ -//----------------------------------------------------------------- CurTOXType lcl_UserData2TOXTypes(sal_uInt16 nData) { CurTOXType eRet; @@ -1176,13 +1082,11 @@ CurTOXType lcl_UserData2TOXTypes(sal_uInt16 nData) case TO_OBJECT : eRet.eType = TOX_OBJECTS; break; case TO_TABLE : eRet.eType = TOX_TABLES; break; case TO_AUTHORITIES : eRet.eType = TOX_AUTHORITIES; break; - default: DBG_ERROR("what a type?"); + default: OSL_ENSURE(false, "what a type?"); } return eRet; } -/* -----------------02.09.99 08:16------------------- - --------------------------------------------------*/ void SwTOXSelectTabPage::ApplyTOXDescription() { SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog(); @@ -1231,7 +1135,6 @@ void SwTOXSelectTabPage::ApplyTOXDescription() if(TOX_CONTENT == aCurType.eType) { aFromHeadingsCB.Check( 0 != (nCreateType & nsSwTOXElement::TOX_OUTLINELEVEL) ); - //aChapterDlgPB.Enable(aFromHeadingsCB.IsChecked());//#outline level,removed by zhaojianwei aAddStylesCB.SetText(sAddStyleContent); aAddStylesPB.Enable(aAddStylesCB.IsChecked()); } @@ -1289,7 +1192,7 @@ void SwTOXSelectTabPage::ApplyTOXDescription() for( long nCnt = 0; nCnt < aSortAlgorithmLB.GetEntryCount(); ++nCnt ) { const String* pEntryData = (const String*)aSortAlgorithmLB.GetEntryData( (sal_uInt16)nCnt ); - DBG_ASSERT(pEntryData, "no entry data available"); + OSL_ENSURE(pEntryData, "no entry data available"); if( pEntryData && *pEntryData == rDesc.GetSortAlgorithm()) { aSortAlgorithmLB.SelectEntryPos( (sal_uInt16)nCnt ); @@ -1297,9 +1200,7 @@ void SwTOXSelectTabPage::ApplyTOXDescription() } } } -/* -----------------09.09.99 11:57------------------- - --------------------------------------------------*/ void SwTOXSelectTabPage::FillTOXDescription() { SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog(); @@ -1406,13 +1307,11 @@ void SwTOXSelectTabPage::FillTOXDescription() rDesc.SetLanguage(aLanguageLB.GetSelectLanguage()); const String* pEntryData = (const String*)aSortAlgorithmLB.GetEntryData( aSortAlgorithmLB.GetSelectEntryPos() ); - DBG_ASSERT(pEntryData, "no entry data available"); + OSL_ENSURE(pEntryData, "no entry data available"); if(pEntryData) rDesc.SetSortAlgorithm(*pEntryData); } -/* -----------------05.07.99 15:09------------------- - --------------------------------------------------*/ void SwTOXSelectTabPage::Reset( const SfxItemSet& ) { SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog(); @@ -1445,16 +1344,12 @@ void SwTOXSelectTabPage::Reset( const SfxItemSet& ) TOXTypeHdl(&aTypeLB); CheckBoxHdl(&aAddStylesCB); } -/*-- 14.06.99 13:10:52--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwTOXSelectTabPage::ActivatePage( const SfxItemSet& ) { //nothing to do } -/*-- 14.06.99 13:11:00--------------------------------------------------- - -----------------------------------------------------------------------*/ int SwTOXSelectTabPage::DeactivatePage( SfxItemSet* _pSet ) { if(_pSet) @@ -1463,16 +1358,12 @@ int SwTOXSelectTabPage::DeactivatePage( SfxItemSet* _pSet ) FillTOXDescription(); return LEAVE_PAGE; } -/* -----------------14.06.99 13:10------------------- - --------------------------------------------------*/ SfxTabPage* SwTOXSelectTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet) { return new SwTOXSelectTabPage(pParent, rAttrSet); } -/* -----------------14.06.99 13:10------------------- - --------------------------------------------------*/ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox) { SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog(); @@ -1495,7 +1386,6 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox) aAreaFL.Show( 0 != (nType & (TO_CONTENT|TO_ILLUSTRATION|TO_USER|TO_INDEX|TO_TABLE|TO_OBJECT)) ); aFromHeadingsCB.Show( 0 != (nType & (TO_CONTENT)) ); - // aChapterDlgPB.Show( 0 != (nType & (TO_CONTENT)) );//#outline level,removed by zhaojianwei aAddStylesCB.Show( 0 != (nType & (TO_CONTENT|TO_USER)) ); aAddStylesPB.Show( 0 != (nType & (TO_CONTENT|TO_USER)) ); @@ -1527,13 +1417,6 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox) aSortAlgorithmFT.Show(bEnableSortLanguage); aSortAlgorithmLB.Show(bEnableSortLanguage); - //if(nType & TO_CONTENT) //#outline level,removed by zhaojianwei - //{ - //Point aPos(aAddStylesPB.GetPosPixel()); - //aPos.X() = aChapterDlgPB.GetPosPixel().X(); - //aAddStylesPB.SetPosPixel(aPos); - //} - //else if( nType & TO_ILLUSTRATION )//<-removed end. // initialize button positions //#i111993# add styles button has two different positions @@ -1570,8 +1453,6 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox) aKeyAsEntryCB.Show( 0 != (nType & TO_INDEX) ); aFromFileCB.Show( 0 != (nType & TO_INDEX) ); aAutoMarkPB.Show( 0 != (nType & TO_INDEX) ); -// aCreateAutoMarkPB.Show(nType &TO_INDEX); -// aEditAutoMarkPB.Show(nType & TO_INDEX); aIdxOptionsFL.Show( 0 != (nType & TO_INDEX) ); @@ -1592,9 +1473,7 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox) ModifyHdl(0); return 0; } -/* -----------------30.11.99 12:48------------------- - --------------------------------------------------*/ IMPL_LINK(SwTOXSelectTabPage, ModifyHdl, void*, EMPTYARG) { SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog(); @@ -1605,9 +1484,7 @@ IMPL_LINK(SwTOXSelectTabPage, ModifyHdl, void*, EMPTYARG) } return 0; } -/* -----------------05.07.99 10:13------------------- - --------------------------------------------------*/ IMPL_LINK(SwTOXSelectTabPage, CheckBoxHdl, CheckBox*, pBox ) { SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog(); @@ -1621,7 +1498,6 @@ IMPL_LINK(SwTOXSelectTabPage, CheckBoxHdl, CheckBox*, pBox ) pBox->Check(sal_True); } aAddStylesPB.Enable(aAddStylesCB.IsChecked()); - //aChapterDlgPB.Enable(aFromHeadingsCB.IsChecked());//#outline level,removed by zhaojianwei } if(TOX_USER == aCurType.eType) { @@ -1637,9 +1513,7 @@ IMPL_LINK(SwTOXSelectTabPage, CheckBoxHdl, CheckBox*, pBox ) ModifyHdl(0); return 0; }; -/* -----------------14.07.99 14:21------------------- - --------------------------------------------------*/ IMPL_LINK(SwTOXSelectTabPage, RadioButtonHdl, RadioButton*, EMPTYARG ) { sal_Bool bEnable = aFromCaptionsRB.IsChecked(); @@ -1650,9 +1524,7 @@ IMPL_LINK(SwTOXSelectTabPage, RadioButtonHdl, RadioButton*, EMPTYARG ) ModifyHdl(0); return 0; } -/* -----------------------------06.06.01 09:33-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK(SwTOXSelectTabPage, LanguageHdl, ListBox*, pBox) { Locale aLcl( SvxCreateLocale( aLanguageLB.GetSelectLanguage() ) ); @@ -1691,12 +1563,10 @@ IMPL_LINK(SwTOXSelectTabPage, LanguageHdl, ListBox*, pBox) ModifyHdl(0); return 0; }; -/* -----------------14.06.99 13:10------------------- - --------------------------------------------------*/ IMPL_LINK(SwTOXSelectTabPage, TOXAreaHdl, ListBox*, pBox) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, "not implemented"); switch((long)pBox->GetEntryData( pBox->GetSelectEntryPos() )) { case AREA_DOCUMENT : break; @@ -1705,47 +1575,6 @@ IMPL_LINK(SwTOXSelectTabPage, TOXAreaHdl, ListBox*, pBox) return 0; } -//#outline level, removed by zhaojianwei -//It is no longer used! -///* -----------------14.06.99 13:10------------------- -// -// --------------------------------------------------*/ -//IMPL_LINK(SwTOXSelectTabPage, ChapterHdl, PushButton*, pButton) -//{ -// SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog(); -// SwWrtShell& rSh = pTOXDlg->GetWrtShell(); -// -// SfxItemSet aTmp(rSh.GetView().GetPool(), FN_PARAM_1, FN_PARAM_1); -// SwOutlineTabDialog* pDlg = new SwOutlineTabDialog(pButton, &aTmp, rSh); -// -// if(RET_OK == pDlg->Execute()) -// { -// CurTOXType aCurType = pTOXDlg->GetCurrentTOXType(); -// SwForm* pForm = ((SwMultiTOXTabDialog*)GetTabDialog())->GetForm(aCurType); -// // jetzt muss ueberprueft werden, ob dem sdbcx::Index Ueberschriftenvorlagen -// // zugewiesen wurden -// String sStr; -// for(sal_uInt16 i = 0; i < MAXLEVEL; i++) -// { -// sal_Bool bNum = !SwMultiTOXTabDialog::IsNoNum(rSh, pForm->GetTemplate( i + 1 )); -// if(bNum) -// { -// //es gibt getrennte Resourcebereiche fuer die Inhaltsverzeichnisse -// if(i < 5) -// SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_TOX_CNTNT1 + i), sStr ); -// else -// SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_TOX_CNTNT6 + i - 5), sStr ); -// pForm->SetTemplate( i + 1, sStr ); -// } -// } -// -// } -// delete pDlg; -// return 0; -//} -/* -----------------14.06.99 13:10------------------- - - --------------------------------------------------*/ IMPL_LINK(SwTOXSelectTabPage, AddStylesHdl, PushButton*, pButton) { SwAddStylesDlg_Impl* pDlg = new SwAddStylesDlg_Impl(pButton, @@ -1756,9 +1585,6 @@ IMPL_LINK(SwTOXSelectTabPage, AddStylesHdl, PushButton*, pButton) ModifyHdl(0); return 0; } -/* -----------------------------19.01.00 10:59-------------------------------- - - ---------------------------------------------------------------------------*/ IMPL_LINK(SwTOXSelectTabPage, MenuEnableHdl, Menu*, pMenu) { @@ -1797,9 +1623,6 @@ IMPL_LINK(SwTOXSelectTabPage, MenuExecuteHdl, Menu*, pMenu) return 0; } -/* -----------------16.06.99 10:46------------------- - - --------------------------------------------------*/ class SwTOXEdit : public Edit { SwFormToken aFormToken; @@ -1838,19 +1661,18 @@ public: void AdjustSize(); }; -//--------------------------------------------------- void SwTOXEdit::RequestHelp( const HelpEvent& rHEvt ) { if(!m_pParent->CreateQuickHelp(this, aFormToken, rHEvt)) Edit::RequestHelp(rHEvt); } -//--------------------------------------------------- + void SwTOXEdit::KeyInput( const KeyEvent& rKEvt ) { const Selection& rSel = GetSelection(); sal_uInt16 nTextLen = GetText().Len(); - if( (rSel.A() == rSel.B() && - !rSel.A() ) || rSel.A() == nTextLen ) + if((rSel.A() == rSel.B() && + !rSel.A()) || rSel.A() == nTextLen ) { sal_Bool bCall = sal_False; KeyCode aCode = rKEvt.GetKeyCode(); @@ -1871,9 +1693,7 @@ void SwTOXEdit::KeyInput( const KeyEvent& rKEvt ) } Edit::KeyInput(rKEvt); } -/* -----------------16.07.99 12:41------------------- - --------------------------------------------------*/ void SwTOXEdit::AdjustSize() { Size aSize(GetSizePixel()); @@ -1883,8 +1703,6 @@ void SwTOXEdit::AdjustSize() SetSizePixel(aSize); } -//--------------------------------------------------- -//--------------------------------------------------- class SwTOXButton : public PushButton { SwFormToken aFormToken; @@ -1963,7 +1781,7 @@ public: void SetLinkEnd() { - DBG_ASSERT(TOKEN_LINK_START == aFormToken.eTokenType, + OSL_ENSURE(TOKEN_LINK_START == aFormToken.eTokenType, "call SetLinkEnd for link start only!"); aFormToken.eTokenType = TOKEN_LINK_END; aFormToken.sText.AssignAscii(SwForm::aFormLinkEnd); @@ -1971,7 +1789,7 @@ public: } void SetLinkStart() { - DBG_ASSERT(TOKEN_LINK_END == aFormToken.eTokenType, + OSL_ENSURE(TOKEN_LINK_END == aFormToken.eTokenType, "call SetLinkStart for link start only!"); aFormToken.eTokenType = TOKEN_LINK_START; aFormToken.sText.AssignAscii(SwForm::aFormLinkStt); @@ -1979,7 +1797,6 @@ public: } }; -//--------------------------------------------------- void SwTOXButton::KeyInput( const KeyEvent& rKEvt ) { sal_Bool bCall = sal_False; @@ -2005,23 +1822,19 @@ void SwTOXButton::KeyInput( const KeyEvent& rKEvt ) else PushButton::KeyInput(rKEvt); } -//--------------------------------------------------- + void SwTOXButton::RequestHelp( const HelpEvent& rHEvt ) { if(!m_pParent->CreateQuickHelp(this, aFormToken, rHEvt)) Button::RequestHelp(rHEvt); } -/* -----------------------------23.12.99 14:28-------------------------------- - ---------------------------------------------------------------------------*/ SwIdxTreeListBox::SwIdxTreeListBox(SwTOXEntryTabPage* pPar, const ResId& rResId) : SvTreeListBox(pPar, rResId), pParent(pPar) { } -/* -----------------------------23.12.99 14:19-------------------------------- - ---------------------------------------------------------------------------*/ void SwIdxTreeListBox::RequestHelp( const HelpEvent& rHEvt ) { if( rHEvt.GetMode() & HELPMODE_QUICK ) @@ -2059,7 +1872,7 @@ void SwIdxTreeListBox::RequestHelp( const HelpEvent& rHEvt ) else SvTreeListBox::RequestHelp(rHEvt); } -//--------------------------------------------------- + SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet) : SfxTabPage(pParent, SW_RES(TP_TOX_ENTRY), rAttrSet), aLevelFT(this, SW_RES(FT_LEVEL )), @@ -2146,15 +1959,6 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet aTokenWIN.SetAccessibleRelationMemberOf(&aEntryFL); aTokenWIN.SetAccessibleRelationLabeledBy(&aTokenFT); - Image aSortUpHC(SW_RES(IMG_SORTUP_HC )); - aFirstSortUpRB.SetModeRadioImage(aSortUpHC,BMP_COLOR_HIGHCONTRAST); - aSecondSortUpRB.SetModeRadioImage(aSortUpHC,BMP_COLOR_HIGHCONTRAST); - aThirdSortUpRB.SetModeRadioImage(aSortUpHC,BMP_COLOR_HIGHCONTRAST); - - Image aSortDownHC(SW_RES(IMG_SORTDOWN_HC )); - aFirstSortDownRB.SetModeRadioImage(aSortDownHC,BMP_COLOR_HIGHCONTRAST); - aSecondSortDownRB.SetModeRadioImage(aSortDownHC,BMP_COLOR_HIGHCONTRAST); - aThirdSortDownRB.SetModeRadioImage(aSortDownHC,BMP_COLOR_HIGHCONTRAST); FreeResource(); sLevelStr = aLevelFT.GetText(); @@ -2167,7 +1971,6 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet aLastTOXType.eType = (TOXTypes)USHRT_MAX; aLastTOXType.nIndex = 0; - //aLevelGBSize = aLevelGB.GetSizePixel(); aLevelFLSize = aLevelFT.GetSizePixel(); SetExchangeSupport(); @@ -2223,7 +2026,7 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet (aRelToStyleIdxPos.Y() - aAlphaDelimCB.GetPosPixel().Y()); aEditStylePB.Enable(sal_False); -//get position for Numbering and other stuff + //get position for Numbering and other stuff aChapterEntryFTPosition = aChapterEntryFT.GetPosPixel(); aEntryOutlineLevelFTPosition = aEntryOutlineLevelFT.GetPosPixel(); nBiasToEntryPoint = aEntryOutlineLevelNF.GetPosPixel().X() - @@ -2259,7 +2062,7 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet aSecondKeyLB.SelectEntryPos(0); aThirdKeyLB.SelectEntryPos(0); } -/* -----------------30.11.99 13:37------------------- +/* -------------------------------------------------- pVoid is used as signal to change all levels of the example --------------------------------------------------*/ IMPL_LINK(SwTOXEntryTabPage, ModifyHdl, void*, pVoid) @@ -2278,23 +2081,16 @@ IMPL_LINK(SwTOXEntryTabPage, ModifyHdl, void*, pVoid) return 0; } -/*-- 16.06.99 10:47:33--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwTOXEntryTabPage::~SwTOXEntryTabPage() { } -/*-- 16.06.99 10:47:33--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwTOXEntryTabPage::FillItemSet( SfxItemSet& ) { // nothing to do return sal_True; } -/*-- 16.06.99 10:47:34--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwTOXEntryTabPage::Reset( const SfxItemSet& ) { SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog(); @@ -2319,27 +2115,21 @@ void SwTOXEntryTabPage::Reset( const SfxItemSet& ) aRelToStyleCB.Check(m_pCurrentForm->IsRelTabPos()); aCommaSeparatedCB.Check(m_pCurrentForm->IsCommaSeparated()); } -/*-- 16.06.99 10:47:34--------------------------------------------------- - -----------------------------------------------------------------------*/ void lcl_ChgWidth(Window& rWin, long nDiff) { Size aTempSz(rWin.GetSizePixel()); aTempSz.Width() += nDiff; rWin.SetSizePixel(aTempSz); } -/* ---------------------------------------------------------------------- - -----------------------------------------------------------------------*/ void lcl_ChgXPos(Window& rWin, long nDiff) { Point aTempPos(rWin.GetPosPixel()); aTempPos.X() += nDiff; rWin.SetPosPixel(aTempPos); } -/* ---------------------------------------------------------------------- - -----------------------------------------------------------------------*/ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/) { SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog(); @@ -2386,7 +2176,7 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/) { const SwTOXSortKey* pKey = pFType->GetSortKey(0); aFirstKeyLB.SelectEntryPos( - aFirstKeyLB.GetEntryPos((void*)(sal_uInt32)pKey->eField)); + aFirstKeyLB.GetEntryPos((void*)(sal_uIntPtr)pKey->eField)); aFirstSortUpRB.Check(pKey->bSortAscending); aFirstSortDownRB.Check(!pKey->bSortAscending); } @@ -2394,7 +2184,7 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/) { const SwTOXSortKey* pKey = pFType->GetSortKey(1); aSecondKeyLB.SelectEntryPos( - aSecondKeyLB.GetEntryPos((void*)(sal_uInt32)pKey->eField)); + aSecondKeyLB.GetEntryPos((void*)(sal_uIntPtr)pKey->eField)); aSecondSortUpRB.Check(pKey->bSortAscending); aSecondSortDownRB.Check(!pKey->bSortAscending); } @@ -2402,7 +2192,7 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/) { const SwTOXSortKey* pKey = pFType->GetSortKey(2); aThirdKeyLB.SelectEntryPos( - aThirdKeyLB.GetEntryPos((void*)(sal_uInt32)pKey->eField)); + aThirdKeyLB.GetEntryPos((void*)(sal_uIntPtr)pKey->eField)); aThirdSortUpRB.Check(pKey->bSortAscending); aThirdSortDownRB.Check(!pKey->bSortAscending); } @@ -2425,13 +2215,11 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/) if(nDiff) { -// lcl_ChgWidth(aLevelFL, nDiff); lcl_ChgWidth(aLevelFT, nDiff); lcl_ChgWidth(aLevelLB, nDiff); lcl_ChgXPos(aCharStyleFT, nDiff); lcl_ChgXPos(aCharStyleLB, nDiff); lcl_ChgWidth(aCharStyleLB, -nDiff); - // lcl_ChgXPos(aEditStylePB, -nDiff); lcl_ChgXPos(aFillCharFT, nDiff); lcl_ChgXPos(aFillCharCB, nDiff); lcl_ChgXPos(aTabPosFT, nDiff); @@ -2514,8 +2302,6 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/) aRelToStyleCB.SetPosPixel( bToxIsIndex ? aRelToStyleIdxPos : aRelToStylePos ); -// aRecalcTabCB.Show( aCurType.eType == TOX_CONTENT); - aMainEntryStyleFT.Show( bToxIsIndex ); aMainEntryStyleLB.Show( bToxIsIndex ); aAlphaDelimCB.Show( bToxIsIndex ); @@ -2527,9 +2313,7 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& /*rSet*/) aTokenWIN.SetInvalid(); LevelHdl(&aLevelLB); } -/* -----------------30.11.99 15:04------------------- - --------------------------------------------------*/ void SwTOXEntryTabPage::UpdateDescriptor() { WriteBackLevel(); @@ -2569,24 +2353,18 @@ void SwTOXEntryTabPage::UpdateDescriptor() if(aCommaSeparatedCB.IsVisible()) pCurrentForm->SetCommaSeparated(aCommaSeparatedCB.IsChecked()); } -/*-- 16.06.99 10:47:34--------------------------------------------------- - -----------------------------------------------------------------------*/ int SwTOXEntryTabPage::DeactivatePage( SfxItemSet* /*pSet*/) { UpdateDescriptor(); return LEAVE_PAGE; } -/*-- 16.06.99 10:47:34--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxTabPage* SwTOXEntryTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet) { return new SwTOXEntryTabPage(pParent, rAttrSet); } -/*-- 16.06.99 10:47:35--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwTOXEntryTabPage, EditStyleHdl, PushButton*, pBtn) { if( LISTBOX_ENTRY_NOTFOUND != aCharStyleLB.GetSelectEntryPos()) @@ -2605,9 +2383,7 @@ IMPL_LINK(SwTOXEntryTabPage, EditStyleHdl, PushButton*, pBtn) } return 0; } -/* -----------------04.10.99 11:34------------------- - --------------------------------------------------*/ IMPL_LINK(SwTOXEntryTabPage, RemoveInsertAuthHdl, PushButton*, pButton) { sal_Bool bInsert = pButton == &aAuthInsertPB; @@ -2625,7 +2401,7 @@ IMPL_LINK(SwTOXEntryTabPage, RemoveInsertAuthHdl, PushButton*, pButton) else { Control* pCtrl = aTokenWIN.GetActiveControl(); - DBG_ASSERT(WINDOW_EDIT != pCtrl->GetType(), "Remove should be disabled"); + OSL_ENSURE(WINDOW_EDIT != pCtrl->GetType(), "Remove should be disabled"); if( WINDOW_EDIT != pCtrl->GetType() ) { //fill it into the ListBox @@ -2637,18 +2413,16 @@ IMPL_LINK(SwTOXEntryTabPage, RemoveInsertAuthHdl, PushButton*, pButton) ModifyHdl(0); return 0; } -/* -----------------------------17.01.00 13:44-------------------------------- - ---------------------------------------------------------------------------*/ void SwTOXEntryTabPage::PreTokenButtonRemoved(const SwFormToken& rToken) { //fill it into the ListBox sal_uInt32 nData = rToken.nAuthorityField; String sTemp(SW_RES(STR_AUTH_FIELD_START + nData)); sal_uInt16 nPos = aAuthFieldsLB.InsertEntry(sTemp); - aAuthFieldsLB.SetEntryData(nPos, (void*)(nData)); + aAuthFieldsLB.SetEntryData(nPos, (void*)(sal_uIntPtr)(nData)); } -/*-- 16.06.99 10:47:35--------------------------------------------------- +/*----------------------------------------------------------------------- This function inizializes the default value in the Token put here the UI dependent initializations @@ -2707,9 +2481,7 @@ IMPL_LINK(SwTOXEntryTabPage, InsertTokenHdl, PushButton*, pBtn) ModifyHdl(0); return 0; } -/* -----------------------------14.01.00 11:53-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK(SwTOXEntryTabPage, AllLevelsHdl, PushButton*, EMPTYARG) { //get current level @@ -2725,9 +2497,6 @@ IMPL_LINK(SwTOXEntryTabPage, AllLevelsHdl, PushButton*, EMPTYARG) return 0; } -/* -----------------02.12.99 12:40------------------- - - --------------------------------------------------*/ void SwTOXEntryTabPage::WriteBackLevel() { if(aTokenWIN.IsValid()) @@ -2738,9 +2507,7 @@ void SwTOXEntryTabPage::WriteBackLevel() m_pCurrentForm->SetPattern(nLastLevel + 1, sNewToken ); } } -/*-- 16.06.99 10:47:35--------------------------------------------------- - -----------------------------------------------------------------------*/ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox) { if(bInLevelHdl) @@ -2758,7 +2525,7 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox) { String sTmp(SW_RES(STR_AUTH_FIELD_START + i)); sal_uInt16 nPos = aAuthFieldsLB.InsertEntry(sTmp); - aAuthFieldsLB.SetEntryData(nPos, (void*)(i)); + aAuthFieldsLB.SetEntryData(nPos, (void*)(sal_uIntPtr)(i)); } // #i21237# @@ -2771,12 +2538,12 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox) if(TOKEN_AUTHORITY == aToken.eTokenType) { sal_uInt32 nSearch = aToken.nAuthorityField; - sal_uInt16 nLstBoxPos = aAuthFieldsLB.GetEntryPos( (void*) nSearch ); - DBG_ASSERT(LISTBOX_ENTRY_NOTFOUND != nLstBoxPos, "Entry not found?"); + sal_uInt16 nLstBoxPos = aAuthFieldsLB.GetEntryPos( (void*)(sal_uIntPtr)nSearch ); + OSL_ENSURE(LISTBOX_ENTRY_NOTFOUND != nLstBoxPos, "Entry not found?"); aAuthFieldsLB.RemoveEntry(nLstBoxPos); } - aIt++; // #i21237# + ++aIt; // #i21237# } aAuthFieldsLB.SelectEntryPos(0); } @@ -2784,9 +2551,7 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox) pBox->GrabFocus(); return 0; } -/* -----------------20.10.99 13:16------------------- - --------------------------------------------------*/ IMPL_LINK(SwTOXEntryTabPage, SortKeyHdl, RadioButton*, pButton) { sal_Bool bEnable = &aSortContentRB == pButton; @@ -2805,16 +2570,13 @@ IMPL_LINK(SwTOXEntryTabPage, SortKeyHdl, RadioButton*, pButton) aThirdSortDownRB.Enable(bEnable); return 0; } -/* -----------------01.07.99 12:21------------------- - --------------------------------------------------*/ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken) { if(pToken->sCharStyleName.Len()) aCharStyleLB.SelectEntry(pToken->sCharStyleName); else aCharStyleLB.SelectEntry(sNoCharStyle); - //StyleSelectHdl(&aCharStyleLB); String sEntry = aCharStyleLB.GetSelectEntry(); aEditStylePB.Enable(sEntry != sNoCharStyle); @@ -2839,13 +2601,6 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken) } //<--- //i53420 -//move into position the fixed text -// aEntryOutlineLevelFT.SetPosPixel( aEntryOutlineLevelFTPosition ); -// // then the entry -// Point aPoint; -// aPoint.Y() = aEntryOutlineLevelFTPosition.Y(); -// aPoint.X() = aEntryOutlineLevelFTPosition.X() + nBiasToEntryPoint; -// aEntryOutlineLevelNF.SetPosPixel( aPoint ); aEntryOutlineLevelNF.SetValue(pToken->nOutlineLevel); } @@ -2853,14 +2608,6 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken) //i53420 if(pToken->eTokenType == TOKEN_ENTRY_NO) { -//move into position the fixed text -// aEntryOutlineLevelFT.SetPosPixel( aChapterEntryFTPosition ); -// // then the entry -// Point aPoint; -// aPoint.Y() = aChapterEntryFTPosition.Y(); -// aPoint.X() = aChapterEntryFTPosition.X() + nBiasToEntryPoint; -// aEntryOutlineLevelNF.SetPosPixel( aPoint ); - aEntryOutlineLevelNF.SetValue(pToken->nOutlineLevel); sal_uInt16 nFormat = 0; if( pToken->nChapterFormat == CF_NUM_NOPREPST_TITLE ) @@ -2941,9 +2688,7 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken) return 0; } -/* -----------------01.07.99 12:36------------------- - --------------------------------------------------*/ IMPL_LINK(SwTOXEntryTabPage, StyleSelectHdl, ListBox*, pBox) { String sEntry = pBox->GetSelectEntry(); @@ -2952,7 +2697,7 @@ IMPL_LINK(SwTOXEntryTabPage, StyleSelectHdl, ListBox*, pBox) if(sEntry == sNoCharStyle) sEntry.Erase(); Control* pCtrl = aTokenWIN.GetActiveControl(); - DBG_ASSERT(pCtrl, "no active control?"); + OSL_ENSURE(pCtrl, "no active control?"); if(pCtrl) { if(WINDOW_EDIT == pCtrl->GetType()) @@ -2964,16 +2709,14 @@ IMPL_LINK(SwTOXEntryTabPage, StyleSelectHdl, ListBox*, pBox) ModifyHdl(0); return 0; } -/* -----------------------------11.01.00 12:54-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK(SwTOXEntryTabPage, ChapterInfoHdl, ListBox*, pBox) { sal_uInt16 nPos = pBox->GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nPos) { Control* pCtrl = aTokenWIN.GetActiveControl(); - DBG_ASSERT(pCtrl, "no active control?"); + OSL_ENSURE(pCtrl, "no active control?"); if(pCtrl && WINDOW_EDIT != pCtrl->GetType()) ((SwTOXButton*)pCtrl)->SetChapterInfo(nPos); @@ -2987,7 +2730,7 @@ IMPL_LINK(SwTOXEntryTabPage, ChapterInfoOutlineHdl, NumericField*, pField) const sal_uInt16 nLevel = static_cast<sal_uInt8>(pField->GetValue()); Control* pCtrl = aTokenWIN.GetActiveControl(); - DBG_ASSERT(pCtrl, "no active control?"); + OSL_ENSURE(pCtrl, "no active control?"); if(pCtrl && WINDOW_EDIT != pCtrl->GetType()) ((SwTOXButton*)pCtrl)->SetOutlineLevel(nLevel); @@ -3002,7 +2745,7 @@ IMPL_LINK(SwTOXEntryTabPage, NumberFormatHdl, ListBox*, pBox) if(LISTBOX_ENTRY_NOTFOUND != nPos) { Control* pCtrl = aTokenWIN.GetActiveControl(); - DBG_ASSERT(pCtrl, "no active control?"); + OSL_ENSURE(pCtrl, "no active control?"); if(pCtrl && WINDOW_EDIT != pCtrl->GetType()) { ((SwTOXButton*)pCtrl)->SetEntryNumberFormat(nPos);//i89791 @@ -3012,13 +2755,10 @@ IMPL_LINK(SwTOXEntryTabPage, NumberFormatHdl, ListBox*, pBox) return 0; } -/* -----------------19.08.99 15:37------------------- - - --------------------------------------------------*/ IMPL_LINK(SwTOXEntryTabPage, TabPosHdl, MetricField*, pField) { Control* pCtrl = aTokenWIN.GetActiveControl(); - DBG_ASSERT(pCtrl && WINDOW_EDIT != pCtrl->GetType() && + OSL_ENSURE(pCtrl && WINDOW_EDIT != pCtrl->GetType() && TOKEN_TAB_STOP == ((SwTOXButton*)pCtrl)->GetFormToken().eTokenType, "no active style::TabStop control?"); if( pCtrl && WINDOW_EDIT != pCtrl->GetType() ) @@ -3029,13 +2769,11 @@ IMPL_LINK(SwTOXEntryTabPage, TabPosHdl, MetricField*, pField) ModifyHdl(0); return 0; } -/* -----------------09.09.99 15:37------------------- - --------------------------------------------------*/ IMPL_LINK(SwTOXEntryTabPage, FillCharHdl, ComboBox*, pBox) { Control* pCtrl = aTokenWIN.GetActiveControl(); - DBG_ASSERT(pCtrl && WINDOW_EDIT != pCtrl->GetType() && + OSL_ENSURE(pCtrl && WINDOW_EDIT != pCtrl->GetType() && TOKEN_TAB_STOP == ((SwTOXButton*)pCtrl)->GetFormToken().eTokenType, "no active style::TabStop control?"); if(pCtrl && WINDOW_EDIT != pCtrl->GetType()) @@ -3051,14 +2789,11 @@ IMPL_LINK(SwTOXEntryTabPage, FillCharHdl, ComboBox*, pBox) return 0; } -/*-- 16.06.99 10:47:36--------------------------------------------------- - - -----------------------------------------------------------------------*/ IMPL_LINK(SwTOXEntryTabPage, AutoRightHdl, CheckBox*, pBox) { //the most right style::TabStop is usually right aligned Control* pCurCtrl = aTokenWIN.GetActiveControl(); - DBG_ASSERT(WINDOW_EDIT != pCurCtrl->GetType() && + OSL_ENSURE(WINDOW_EDIT != pCurCtrl->GetType() && ((SwTOXButton*)pCurCtrl)->GetFormToken().eTokenType == TOKEN_TAB_STOP, "no style::TabStop selected!"); @@ -3072,9 +2807,7 @@ IMPL_LINK(SwTOXEntryTabPage, AutoRightHdl, CheckBox*, pBox) ModifyHdl(0); return 0; } -/* -----------------16.06.99 11:00------------------- - --------------------------------------------------*/ void SwTOXEntryTabPage::SetWrtShell(SwWrtShell& rSh) { SwDocShell* pDocSh = rSh.GetView().GetDocShell(); @@ -3092,9 +2825,7 @@ void SwTOXEntryTabPage::SetWrtShell(SwWrtShell& rSh) aMainEntryStyleLB.SelectEntry( SwStyleNameMapper::GetUIName( RES_POOLCHR_IDX_MAIN_ENTRY, aEmptyStr )); } -/* -----------------------------23.12.99 14:23-------------------------------- - ---------------------------------------------------------------------------*/ String SwTOXEntryTabPage::GetLevelHelp(sal_uInt16 nLevel) const { String sRet; @@ -3111,9 +2842,6 @@ String SwTOXEntryTabPage::GetLevelHelp(sal_uInt16 nLevel) const } return sRet; } -/* -----------------16.06.99 15:18------------------- - - --------------------------------------------------*/ SwTokenWindow::SwTokenWindow(SwTOXEntryTabPage* pParent, const ResId& rResId) : Window( pParent, rResId ), @@ -3148,50 +2876,25 @@ SwTokenWindow::SwTokenWindow(SwTOXEntryTabPage* pParent, const ResId& rResId) : aLeftScrollWin.SetClickHdl(aLink); aRightScrollWin.SetClickHdl(aLink); } -/* -----------------01.07.99 12:17------------------- - --------------------------------------------------*/ SwTokenWindow::~SwTokenWindow() { -// for(sal_uInt16 i = GetItemCount(); i ; i--) -// RemoveItem(i - 1); - - for( sal_uInt32 n = 0; n < aControlList.Count(); ++n ) - { - Control* pControl = aControlList.GetObject( n ); - pControl->SetGetFocusHdl( Link() ); - pControl->SetLoseFocusHdl( Link() ); - } - - for( sal_uLong i = aControlList.Count(); i; ) - { - Control* pControl = aControlList.Remove( --i ); - delete pControl; - } } -/* -----------------16.06.99 13:56------------------- - --------------------------------------------------*/ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL) { SetActiveControl(0); bValid = sal_True; + + //apply current level settings to the form if(pForm) - { - //apply current level settings to the form - for( sal_uLong i = aControlList.Count(); i; ) - { - Control* pControl = aControlList.Remove( --i ); - delete pControl; - } - } + aControlList.clear(); + nLevel = nL; pForm = &rForm; //now the display if(nLevel < MAXLEVEL || rForm.GetTOXType() == TOX_AUTHORITIES) { - Size aToolBoxSize = GetSizePixel(); - // #i21237# SwFormTokens aPattern = pForm->GetPattern(nLevel + 1); SwFormTokens::iterator aIt = aPattern.begin(); @@ -3204,7 +2907,7 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL) if(TOKEN_TEXT == aToken.eTokenType) { - DBG_ASSERT(!bLastWasText, "text following text is invalid"); + OSL_ENSURE(!bLastWasText, "text following text is invalid"); Control* pCtrl = InsertItem(aToken.sText, aToken); bLastWasText = sal_True; if(!GetActiveControl()) @@ -3240,7 +2943,7 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL) bLastWasText = sal_False; } - aIt++; // #i21237# + ++aIt; // #i21237# } if(!bLastWasText) { @@ -3254,9 +2957,7 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL) } AdjustScrolling(); } -/* -----------------19.08.99 13:00------------------- - --------------------------------------------------*/ void SwTokenWindow::SetActiveControl(Control* pSet) { if( pSet != pActiveCtrl ) @@ -3278,28 +2979,30 @@ void SwTokenWindow::SetActiveControl(Control* pSet) } } -/* -----------------17.06.99 09:53------------------- - - --------------------------------------------------*/ Control* SwTokenWindow::InsertItem(const String& rText, const SwFormToken& rToken) { Control* pRet = 0; - Control* pLast = aControlList.Last(); Size aControlSize(GetOutputSizePixel()); - Point aControlPos; - if( pLast ) - { - aControlSize = pLast->GetSizePixel(); - aControlPos = pLast->GetPosPixel(); + Point aControlPos; + + if(!aControlList.empty()) + { + ctrl_const_reverse_iterator iterLast = aControlList.rbegin(); + + aControlSize = iterLast->GetSizePixel(); + aControlPos = iterLast->GetPosPixel(); aControlPos.X() += aControlSize.Width(); } + if(TOKEN_TEXT == rToken.eTokenType) { - SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, rToken); + SwTOXEdit *pEdit = new SwTOXEdit(&aCtrlParentWin, this, rToken); pEdit->SetPosPixel(aControlPos); - aControlList.Insert(pEdit, aControlList.Count()); + + aControlList.push_back(pEdit); + pEdit->SetText(rText); - Size aEditSize(aControlSize); + Size aEditSize(aControlSize); aEditSize.Width() = pEdit->GetTextWidth(rText) + EDIT_MINWIDTH; pEdit->SetSizePixel(aEditSize); pEdit->SetModifyHdl(LINK(this, SwTokenWindow, EditResize )); @@ -3312,14 +3015,15 @@ Control* SwTokenWindow::InsertItem(const String& rText, const SwFormToken& rToke { SwTOXButton* pButton = new SwTOXButton(&aCtrlParentWin, this, rToken); pButton->SetPosPixel(aControlPos); - aControlList.Insert(pButton, aControlList.Count()); - Size aEditSize(aControlSize); + + aControlList.push_back(pButton); + + Size aEditSize(aControlSize); aEditSize.Width() = pButton->GetTextWidth(rText) + 5; -// pButton->SetControlBackground(aCtrlColor); -// pButton->SetControlForeground(aTextColor); pButton->SetSizePixel(aEditSize); pButton->SetPrevNextLink(LINK(this, SwTokenWindow, NextItemBtnHdl)); pButton->SetGetFocusHdl(LINK(this, SwTokenWindow, TbxFocusBtnHdl)); + if(TOKEN_AUTHORITY != rToken.eTokenType) pButton->SetText(aButtonTexts[rToken.eTokenType]); else @@ -3329,22 +3033,25 @@ Control* SwTokenWindow::InsertItem(const String& rText, const SwFormToken& rToke (ToxAuthorityField)rToken.nAuthorityField)); pButton->SetText(sTmp.Copy(0, 2)); } + pButton->Show(); pRet = pButton; } + return pRet; } -/* -----------------16.07.99 11:50------------------- - --------------------------------------------------*/ void SwTokenWindow::InsertAtSelection( const String& rText, const SwFormToken& rToken) { - DBG_ASSERT(pActiveCtrl, "no active control!"); + OSL_ENSURE(pActiveCtrl, "no active control!"); + if(!pActiveCtrl) return; + SwFormToken aToInsertToken(rToken); + if(TOKEN_LINK_START == aToInsertToken.eTokenType) { //determine if start or end of hyperlink is appropriate @@ -3356,69 +3063,75 @@ void SwTokenWindow::InsertAtSelection( //<insert> LS //<insert> LE //<insert> - sal_Bool bPreStartLinkFound = sal_False; // - sal_Bool bPreEndLinkFound = sal_False; + bool bPreStartLinkFound = false; + bool bPreEndLinkFound = false; - const Control* pControl = aControlList.First(); - const Control* pExchange = 0; - while( pControl && pActiveCtrl != pControl ) + const Control *pExchange = 0; + ctrl_const_iterator it = aControlList.begin(); + + while ( it != aControlList.end()) { - if( WINDOW_EDIT != pControl->GetType()) + if ((&(*it)) == pActiveCtrl) + break; + + if( WINDOW_EDIT != it->GetType()) { const SwFormToken& rNewToken = - ((SwTOXButton*)pControl)->GetFormToken(); + (reinterpret_cast<const SwTOXButton&>(*it)).GetFormToken(); + if( TOKEN_LINK_START == rNewToken.eTokenType ) { - bPreStartLinkFound = sal_True; + bPreStartLinkFound = true; pExchange = 0; } else if(TOKEN_LINK_END == rNewToken.eTokenType) { if( bPreStartLinkFound ) - bPreStartLinkFound = sal_False; + bPreStartLinkFound = false; else { - bPreEndLinkFound = sal_False; - pExchange = pControl; + bPreEndLinkFound = false; + pExchange = const_cast<Control*>(&(*it)); } } } - pControl = aControlList.Next(); + + ++it; } - sal_Bool bPostLinkEndFound = sal_False; - sal_Bool bPostLinkStartFound = sal_False; + bool bPostLinkStartFound = false; + if(!bPreStartLinkFound && !bPreEndLinkFound) - while(pControl) + { + while(it != aControlList.end()) { - if( pControl != pActiveCtrl && - WINDOW_EDIT != pControl->GetType()) + if( (&(*it)) != pActiveCtrl && + WINDOW_EDIT != it->GetType()) { const SwFormToken& rNewToken = - ((SwTOXButton*)pControl)->GetFormToken(); + reinterpret_cast<const SwTOXButton&>(*it).GetFormToken(); + if( TOKEN_LINK_START == rNewToken.eTokenType ) { if(bPostLinkStartFound) break; - bPostLinkStartFound = sal_True; - pExchange = pControl; + bPostLinkStartFound = true; + pExchange = const_cast<Control*>(&(*it)); } else if(TOKEN_LINK_END == rNewToken.eTokenType ) { if(bPostLinkStartFound) { - bPostLinkStartFound = sal_False; + bPostLinkStartFound = false; pExchange = 0; } - else - { - bPostLinkEndFound = sal_True; - } break; } } - pControl = aControlList.Next(); + + ++it; } + } if(bPreStartLinkFound) { @@ -3428,7 +3141,8 @@ void SwTokenWindow::InsertAtSelection( if(bPostLinkStartFound) { - DBG_ASSERT(pExchange, "no control to exchange?"); + OSL_ENSURE(pExchange, "no control to exchange?"); + if(pExchange) { ((SwTOXButton*)pExchange)->SetLinkEnd(); @@ -3438,7 +3152,8 @@ void SwTokenWindow::InsertAtSelection( if(bPreEndLinkFound) { - DBG_ASSERT(pExchange, "no control to exchange?"); + OSL_ENSURE(pExchange, "no control to exchange?"); + if(pExchange) { ((SwTOXButton*)pExchange)->SetLinkStart(); @@ -3449,15 +3164,18 @@ void SwTokenWindow::InsertAtSelection( //if the active control is text then insert a new button at the selection //else replace the button - sal_uInt32 nActivePos = aControlList.GetPos(pActiveCtrl); - sal_uInt32 nInsertPos = nActivePos; + ctrl_iterator iterActive = FindControl(aControlList,pActiveCtrl); + ctrl_iterator iterInsert = iterActive; Size aControlSize(GetOutputSizePixel()); + if( WINDOW_EDIT == pActiveCtrl->GetType()) { - nInsertPos++; - Selection aSel = ((SwTOXEdit*)pActiveCtrl)->GetSelection(); + ++iterInsert; + + Selection aSel = ((SwTOXEdit*)pActiveCtrl)->GetSelection(); aSel.Justify(); + String sEditText = ((SwTOXEdit*)pActiveCtrl)->GetText(); String sLeft = sEditText.Copy( 0, static_cast< sal_uInt16 >(aSel.A()) ); String sRight = sEditText.Copy( static_cast< sal_uInt16 >(aSel.B()), @@ -3468,7 +3186,9 @@ void SwTokenWindow::InsertAtSelection( SwFormToken aTmpToken(TOKEN_TEXT); SwTOXEdit* pEdit = new SwTOXEdit(&aCtrlParentWin, this, aTmpToken); - aControlList.Insert(pEdit, nActivePos + 1); + + aControlList.insert(iterInsert,pEdit); + pEdit->SetText(sRight); pEdit->SetSizePixel(aControlSize); pEdit->AdjustSize(); @@ -3479,18 +3199,21 @@ void SwTokenWindow::InsertAtSelection( } else { - aControlList.Remove(pActiveCtrl); pActiveCtrl->Hide(); - delete pActiveCtrl; + aControlList.erase(iterActive); } //now the new button SwTOXButton* pButton = new SwTOXButton(&aCtrlParentWin, this, aToInsertToken); - aControlList.Insert(pButton, nInsertPos); + aControlList.insert(iterInsert,pButton); + pButton->SetPrevNextLink(LINK(this, SwTokenWindow, NextItemBtnHdl)); pButton->SetGetFocusHdl(LINK(this, SwTokenWindow, TbxFocusBtnHdl)); + if(TOKEN_AUTHORITY != aToInsertToken.eTokenType) + { pButton->SetText(aButtonTexts[aToInsertToken.eTokenType]); + } else { //use the first two chars as symbol @@ -3499,7 +3222,7 @@ void SwTokenWindow::InsertAtSelection( pButton->SetText(sTmp.Copy(0, 2)); } - Size aEditSize(GetOutputSizePixel()); + Size aEditSize(GetOutputSizePixel()); aEditSize.Width() = pButton->GetTextWidth(rText) + 5; pButton->SetSizePixel(aEditSize); pButton->Check(sal_True); @@ -3508,252 +3231,264 @@ void SwTokenWindow::InsertAtSelection( AdjustPositions(); } -/* -----------------19.08.99 12:42------------------- - --------------------------------------------------*/ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, sal_Bool bInternalCall ) { if(bInternalCall && TOX_AUTHORITIES == pForm->GetTOXType()) m_pParent->PreTokenButtonRemoved(pDel->GetFormToken()); - sal_uInt32 nActivePos = aControlList.GetPos(pDel); - DBG_ASSERT(nActivePos != 0xffffffff, "Control does not exist!"); + ctrl_iterator it = FindControl(aControlList,pDel); + + OSL_ENSURE(it != aControlList.end(), "Control does not exist!"); + // the two neighbours of the box must be merged // the properties of the right one will be lost - DBG_ASSERT(nActivePos && nActivePos < aControlList.Count() - 1, + OSL_ENSURE(it != aControlList.begin() && it != aControlList.end() - 1, "Button at first or last position?"); - aControlList.Seek(nActivePos - 1); - Control* pLeftEdit = aControlList.GetCurObject(); - aControlList.Seek(nActivePos + 1); - Control* pRightEdit = aControlList.GetCurObject(); - String sTemp(((SwTOXEdit*)pLeftEdit)->GetText()); - sTemp += ((SwTOXEdit*)pRightEdit)->GetText(); - ((SwTOXEdit*)pLeftEdit)->SetText(sTemp); - ((SwTOXEdit*)pLeftEdit)->AdjustSize(); - - aControlList.Remove(pRightEdit); - delete pRightEdit; - - aControlList.Remove(pDel); + + Control *pLeftCtrl = const_cast<Control*>(&(*(it-1))); + Control *pRightCtrl = const_cast<Control*>(&(*(it+1))); + + String sTemp(((SwTOXEdit*)pLeftCtrl)->GetText()); + sTemp += ((SwTOXEdit*)pRightCtrl)->GetText(); + ((SwTOXEdit*)pLeftCtrl)->SetText(sTemp); + ((SwTOXEdit*)pLeftCtrl)->AdjustSize(); + + aControlList.erase(it+1); + aControlList.erase(it); + pActiveCtrl->Hide(); - delete pActiveCtrl; - SetActiveControl(pLeftEdit); + + SetActiveControl(pLeftCtrl); AdjustPositions(); + if(aModifyHdl.IsSet()) aModifyHdl.Call(0); } -/* -----------------16.07.99 12:39------------------- - - --------------------------------------------------*/ void SwTokenWindow::AdjustPositions() { - if(aControlList.Count() > 1) + if(aControlList.size() > 1) { - Control* pCtrl = aControlList.First(); - Point aNextPos = pCtrl->GetPosPixel(); - aNextPos.X() += pCtrl->GetSizePixel().Width(); - while(0 != (pCtrl = aControlList.Next())) - { - pCtrl->SetPosPixel(aNextPos); - aNextPos.X() += pCtrl->GetSizePixel().Width(); + ctrl_iterator it = aControlList.begin(); + + Point aNextPos = it->GetPosPixel(); + aNextPos.X() += it->GetSizePixel().Width(); + + for (++it; it != aControlList.end(); ++it) + { + it->SetPosPixel(aNextPos); + aNextPos.X() += it->GetSizePixel().Width(); } + AdjustScrolling(); } }; -/* -----------------------------16.08.00 13:22-------------------------------- - ---------------------------------------------------------------------------*/ void SwTokenWindow::MoveControls(long nOffset) { // move the complete list - Control* pCtrl = aControlList.First(); - do + for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - Point aPos = pCtrl->GetPosPixel(); + Point aPos = it->GetPosPixel(); aPos.X() += nOffset; - pCtrl->SetPosPixel(aPos); - }while(0 != (pCtrl = aControlList.Next())); + + it->SetPosPixel(aPos); + } } -/* -----------------------------14.01.00 13:03-------------------------------- - ---------------------------------------------------------------------------*/ void SwTokenWindow::AdjustScrolling() { - if(aControlList.Count() > 1) + if(aControlList.size() > 1) { //validate scroll buttons - Control* pLastCtrl = aControlList.Last(); - Control* pFirstCtrl = aControlList.First(); + ctrl_const_reverse_iterator iterLast = aControlList.rbegin(); + ctrl_const_iterator iterFirst = aControlList.begin(); + long nSpace = aCtrlParentWin.GetSizePixel().Width(); - long nWidth = pLastCtrl->GetPosPixel().X() - pFirstCtrl->GetPosPixel().X() - + pLastCtrl->GetSizePixel().Width(); - sal_Bool bEnable = nWidth > nSpace; + long nWidth = iterLast->GetPosPixel().X() - iterFirst->GetPosPixel().X() + + iterLast->GetSizePixel().Width(); + bool bEnable = nWidth > nSpace; //the active control must be visible if(bEnable && pActiveCtrl) { - Point aActivePos(pActiveCtrl->GetPosPixel()); long nMove = 0; + Point aActivePos(pActiveCtrl->GetPosPixel()); + if(aActivePos.X() < 0) nMove = -aActivePos.X(); else if((aActivePos.X() + pActiveCtrl->GetSizePixel().Width()) > nSpace) nMove = -(aActivePos.X() + pActiveCtrl->GetSizePixel().Width() - nSpace); + if(nMove) MoveControls(nMove); - aLeftScrollWin.Enable(aControlList.First()->GetPosPixel().X() < 0); - Control* pCtrl = aControlList.Last(); - aRightScrollWin.Enable((pCtrl->GetPosPixel().X() + pCtrl->GetSizePixel().Width()) > nSpace); + + aLeftScrollWin.Enable(iterFirst->GetPosPixel().X() < 0); + aRightScrollWin.Enable((iterLast->GetPosPixel().X() + iterLast->GetSizePixel().Width()) > nSpace); } else { - if(pFirstCtrl) - { - //if the control fits into the space then the first control must be at postion 0 - long nFirstPos = pFirstCtrl->GetPosPixel().X(); - if(nFirstPos != 0) - MoveControls(-nFirstPos); - } - aRightScrollWin.Enable(sal_False); - aLeftScrollWin.Enable(sal_False); + //if the control fits into the space then the first control must be at postion 0 + long nFirstPos = iterFirst->GetPosPixel().X(); + + if(nFirstPos != 0) + MoveControls(-nFirstPos); + + aRightScrollWin.Enable(false); + aLeftScrollWin.Enable(false); } } } -/* -----------------------------14.01.00 13:57-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK(SwTokenWindow, ScrollHdl, ImageButton*, pBtn ) { - if(aControlList.Count()) - { - const long nSpace = aCtrlParentWin.GetSizePixel().Width(); + if(aControlList.empty()) + return 0; + + const long nSpace = aCtrlParentWin.GetSizePixel().Width(); + #if OSL_DEBUG_LEVEL > 1 //find all start/end positions and print it String sMessage(String::CreateFromAscii("Space: ")); sMessage += String::CreateFromInt32(nSpace); sMessage += String::CreateFromAscii(" | "); - Control* pDebugCtrl = aControlList.First(); - do + + for (ctrl_const_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - long nDebugXPos = pDebugCtrl->GetPosPixel().X(); - long nDebugWidth = pDebugCtrl->GetSizePixel().Width(); + long nDebugXPos = it->GetPosPixel().X(); + long nDebugWidth = it->GetSizePixel().Width(); + sMessage += String::CreateFromInt32( nDebugXPos ); sMessage += String::CreateFromAscii(" "); sMessage += String::CreateFromInt32(nDebugXPos + nDebugWidth); sMessage += String::CreateFromAscii(" | "); - - }while(0 != (pDebugCtrl = aControlList.Next())); + } #endif - long nMove = 0; - if(pBtn == &aLeftScrollWin) + long nMove = 0; + if(pBtn == &aLeftScrollWin) + { + //find the first completely visible control (left edge visible) + for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - //find the first completely visible control (left edge visible) - for(sal_uInt16 i = 0; i < aControlList.Count(); i++ ) + long nXPos = it->GetPosPixel().X(); + + if (nXPos >= 0) { - Control* pCtrl = aControlList.GetObject(i); - long nXPos = pCtrl->GetPosPixel().X(); - if(nXPos >= 0) + if(it == aControlList.begin()) { - if(!i) - //move the current control to the left edge - nMove = -nXPos; - else - //move the left neighbor to the start position - nMove = -aControlList.GetObject(i - 1)->GetPosPixel().X(); - break; + //move the current control to the left edge + nMove = -nXPos; + } + else + { + //move the left neighbor to the start position + ctrl_iterator iterLeft = it-1; + nMove = -iterLeft->GetPosPixel().X(); } + + break; } } - else + } + else + { + //find the first completely visible control (right edge visible) + for (ctrl_reverse_iterator it = aControlList.rbegin(); it != aControlList.rend(); ++it) { - //find the first completely visible control (left edge visible) - for(sal_uLong i = aControlList.Count(); i; i-- ) + long nCtrlWidth = it->GetSizePixel().Width(); + long nXPos = it->GetPosPixel().X() + nCtrlWidth; + + if (nXPos <= nSpace) { - Control* pCtrl = aControlList.GetObject(i - 1); - long nCtrlWidth = pCtrl->GetSizePixel().Width(); - long nXPos = pCtrl->GetPosPixel().X() + nCtrlWidth; - if(nXPos <= nSpace) + if (it != aControlList.rbegin()) { - if( i < aControlList.Count()) - { - //move the right neighbor to the right edge right aligned - Control* pRight = aControlList.GetObject(i); - nMove = nSpace - pRight->GetPosPixel().X() - pRight->GetSizePixel().Width(); - } - break; + //move the right neighbor to the right edge right aligned + ctrl_reverse_iterator iterRight = it-1; + nMove = nSpace - iterRight->GetPosPixel().X() - iterRight->GetSizePixel().Width(); } - } - //move it left until it's completely visible + break; + } } - if(nMove) + + //move it left until it's completely visible + } + + if(nMove) + { + // move the complete list + for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - // move the complete list - Control* pCtrl = aControlList.First(); - do - { - Point aPos = pCtrl->GetPosPixel(); - aPos.X() += nMove; - pCtrl->SetPosPixel(aPos); - }while(0 != (pCtrl = aControlList.Next())); - aLeftScrollWin.Enable(aControlList.First()->GetPosPixel().X() < 0); - pCtrl = aControlList.Last(); - aRightScrollWin.Enable((pCtrl->GetPosPixel().X() + pCtrl->GetSizePixel().Width()) > nSpace); + Point aPos = it->GetPosPixel(); + + aPos.X() += nMove; + + it->SetPosPixel(aPos); + } + + ctrl_iterator iterCtrl = aControlList.begin(); + aLeftScrollWin.Enable(iterCtrl->GetPosPixel().X() < 0); + + iterCtrl = aControlList.end()-1; + aRightScrollWin.Enable((iterCtrl->GetPosPixel().X() + iterCtrl->GetSizePixel().Width()) > nSpace); #if OSL_DEBUG_LEVEL > 1 - sMessage.AppendAscii("Move: "); - sMessage += String::CreateFromInt32(nMove); - GetParent()->GetParent()->GetParent()->SetText(sMessage); + sMessage.AppendAscii("Move: "); + sMessage += String::CreateFromInt32(nMove); + GetParent()->GetParent()->GetParent()->SetText(sMessage); #endif - } } + return 0; } -/* -----------------17.06.99 11:59------------------- - --------------------------------------------------*/ String SwTokenWindow::GetPattern() const { String sRet; - const Control* pControl = ((SwTokenWindow*)this)->aControlList.First(); - while(pControl) + const Control *ctrl = 0; + for (ctrl_const_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - const SwFormToken& rNewToken = WINDOW_EDIT == pControl->GetType() - ? ((SwTOXEdit*)pControl)->GetFormToken() - : ((SwTOXButton*)pControl)->GetFormToken(); + ctrl = &(*it); + + const SwFormToken& rNewToken = WINDOW_EDIT == ctrl->GetType() + ? ((SwTOXEdit*)ctrl)->GetFormToken() + : ((SwTOXButton*)ctrl)->GetFormToken(); //TODO: prevent input of TOX_STYLE_DELIMITER in KeyInput sRet += rNewToken.GetString(); - - pControl = ((SwTokenWindow*)this)->aControlList.Next(); } + return sRet; } -/* -----------------19.08.99 11:27------------------- +/* -------------------------------------------------- Description: Check if a control of the specified TokenType is already contained in the list --------------------------------------------------*/ sal_Bool SwTokenWindow::Contains(FormTokenType eSearchFor) const { - sal_Bool bRet = sal_False; - const Control* pControl = ((SwTokenWindow*)this)->aControlList.First(); - while(pControl) + bool bRet = false; + const Control* pControl = 0; + + for (ctrl_const_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { + pControl = &(*it); + const SwFormToken& rNewToken = WINDOW_EDIT == pControl->GetType() ? ((SwTOXEdit*)pControl)->GetFormToken() : ((SwTOXButton*)pControl)->GetFormToken(); - if(eSearchFor == rNewToken.eTokenType) + if (eSearchFor == rNewToken.eTokenType) { - bRet = sal_True; + bRet = true; break; } - pControl = ((SwTokenWindow*)this)->aControlList.Next(); } + return bRet; } -//--------------------------------------------------- + sal_Bool SwTokenWindow::CreateQuickHelp(Control* pCtrl, const SwFormToken& rToken, const HelpEvent& rHEvt) @@ -3775,8 +3510,6 @@ sal_Bool SwTokenWindow::CreateQuickHelp(Control* pCtrl, Rectangle aItemRect( aPos, pCtrl->GetSizePixel() ); if(rToken.eTokenType == TOKEN_TAB_STOP ) { -// sEntry += '\n'; -// sEntry += rToken.nTabStopPosition; } else { @@ -3801,9 +3534,7 @@ sal_Bool SwTokenWindow::CreateQuickHelp(Control* pCtrl, } return bRet; } -/* -----------------------------14.01.00 12:22-------------------------------- - ---------------------------------------------------------------------------*/ void SwTokenWindow::Resize() { Size aCompleteSize(GetOutputSizePixel()); @@ -3821,9 +3552,6 @@ void SwTokenWindow::Resize() aCtrlParentWin.SetSizePixel(aMiddleSize); } -/* -----------------16.06.99 15:23------------------- - - --------------------------------------------------*/ IMPL_LINK(SwTokenWindow, EditResize, Edit*, pEdit) { ((SwTOXEdit*)pEdit)->AdjustSize(); @@ -3832,106 +3560,122 @@ IMPL_LINK(SwTokenWindow, EditResize, Edit*, pEdit) aModifyHdl.Call(0); return 0; } -/* -----------------16.06.99 15:56------------------- - --------------------------------------------------*/ IMPL_LINK(SwTokenWindow, NextItemHdl, SwTOXEdit*, pEdit) { - sal_uInt16 nPos = (sal_uInt16)aControlList.GetPos(pEdit); - if( (nPos && !pEdit->IsNextControl()) || - (nPos < aControlList.Count() - 1 && pEdit->IsNextControl())) + ctrl_iterator it = FindControl(aControlList,pEdit); + + if (it == aControlList.end()) + return 0; + + ctrl_iterator lastIter = aControlList.end()-1; + + if ((it != aControlList.begin() && !pEdit->IsNextControl()) || + (it != lastIter && pEdit->IsNextControl())) { - aControlList.Seek(nPos); - Control* pNextPrev = pEdit->IsNextControl() ? aControlList.Next() : aControlList.Prev(); - nPos += pEdit->IsNextControl() ? 1 : -1; - pNextPrev->GrabFocus(); - ((SwTOXButton*)pNextPrev)->Check(); + ctrl_iterator iterFocus = it; + + pEdit->IsNextControl() ? ++iterFocus : --iterFocus; + + Control *pCtrlFocus = &(*iterFocus); + + pCtrlFocus->GrabFocus(); + + reinterpret_cast<SwTOXButton*>(pCtrlFocus)->Check(); + AdjustScrolling(); } + return 0; } -/* -----------------17.06.99 08:58------------------- - --------------------------------------------------*/ IMPL_LINK(SwTokenWindow, TbxFocusHdl, SwTOXEdit*, pEdit) { - for(sal_uInt16 i = 0; i < aControlList.Count(); i++) + for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - Control* pControl = aControlList.First(); - while(pControl) - { - if(WINDOW_EDIT != pControl->GetType() ) - ((SwTOXButton*)pControl)->Check(sal_False); - pControl = aControlList.Next(); - } + Control *pCtrl = &(*it); + + if (pCtrl && pCtrl->GetType() != WINDOW_EDIT) + reinterpret_cast<SwTOXButton*>(pCtrl)->Check(false); } + SetActiveControl(pEdit); + return 0; } -/* -----------------17.06.99 10:05------------------- - --------------------------------------------------*/ IMPL_LINK(SwTokenWindow, NextItemBtnHdl, SwTOXButton*, pBtn ) { - sal_uInt16 nPos = (sal_uInt16)aControlList.GetPos(pBtn); - if( (nPos && !pBtn->IsNextControl()) || - (nPos < aControlList.Count() - 1 && pBtn->IsNextControl())) + ctrl_iterator iter = FindControl(aControlList,pBtn); + + if (iter == aControlList.end()) + return 0; + + ctrl_iterator lastIter = aControlList.end()-1; + + if((iter != aControlList.begin() && !pBtn->IsNextControl()) || + (iter != lastIter && pBtn->IsNextControl())) { - aControlList.Seek(nPos); - sal_Bool bNext = pBtn->IsNextControl(); - Control* pNextPrev = bNext ? aControlList.Next() : aControlList.Prev(); - pNextPrev->GrabFocus(); - Selection aSel(0, 0); + bool bNext = pBtn->IsNextControl(); + + ctrl_iterator iterFocus = iter; + + bNext ? ++iterFocus : --iterFocus; + + Control *pCtrlFocus = &(*iterFocus); + + pCtrlFocus->GrabFocus(); + + Selection aSel(0,0); + if(!bNext) { - sal_uInt16 nLen = ((SwTOXEdit*)pNextPrev)->GetText().Len(); + sal_uInt16 nLen = ((SwTOXEdit*)pCtrlFocus)->GetText().Len(); aSel.A() = nLen; aSel.B() = nLen; } - ((SwTOXEdit*)pNextPrev)->SetSelection(aSel); - pBtn->Check(sal_False); + + reinterpret_cast<SwTOXEdit*>(pCtrlFocus)->SetSelection(aSel); + + pBtn->Check(false); + AdjustScrolling(); } + return 0; } -/* -----------------17.06.99 10:04------------------- - - --------------------------------------------------*/ IMPL_LINK(SwTokenWindow, TbxFocusBtnHdl, SwTOXButton*, pBtn ) { - for(sal_uInt16 i = 0; i < aControlList.Count(); i++) + Control *pControl = 0; + for (ctrl_iterator sit = aControlList.begin(); sit != aControlList.end(); ++sit) { - Control* pControl = aControlList.First(); - while(pControl) - { - if(WINDOW_EDIT != pControl->GetType() ) - ((SwTOXButton*)pControl)->Check(pBtn == pControl); - pControl = aControlList.Next(); - } + pControl = &(*sit); + + if (pControl && WINDOW_EDIT != pControl->GetType()) + reinterpret_cast<SwTOXButton*>(pControl)->Check(pBtn == pControl); } + SetActiveControl(pBtn); + return 0; } -/* -----------------------------28.01.2002 12:22------------------------------ - ---------------------------------------------------------------------------*/ void SwTokenWindow::GetFocus() { if(GETFOCUS_TAB & GetGetFocusFlags()) { - Control* pFirst = aControlList.First(); - if(pFirst) - { + if (!aControlList.empty()) + { + Control *pFirst = &(*aControlList.begin()); + pFirst->GrabFocus(); SetActiveControl(pFirst); AdjustScrolling(); - } + } } } -/* -----------------25.03.99 15:17------------------- - * - * --------------------------------------------------*/ + SwTOXStylesTabPage::SwTOXStylesTabPage(Window* pParent, const SfxItemSet& rAttrSet ) : SfxTabPage(pParent, SW_RES(TP_TOX_STYLES), rAttrSet), aFormatFL(this, SW_RES(FL_FORMAT )), @@ -3948,8 +3692,6 @@ SwTOXStylesTabPage::SwTOXStylesTabPage(Window* pParent, const SfxItemSet& rAttrS SetExchangeSupport( sal_True ); - aAssignBT.SetModeImage( Image( SW_RES( IMG_ONE_LEFT_HC ) ), BMP_COLOR_HIGHCONTRAST ); - aEditStyleBT.SetClickHdl (LINK( this, SwTOXStylesTabPage, EditStyleHdl)); aAssignBT.SetClickHdl (LINK( this, SwTOXStylesTabPage, AssignHdl)); aStdBT.SetClickHdl (LINK( this, SwTOXStylesTabPage, StdHdl)); @@ -3962,30 +3704,22 @@ SwTOXStylesTabPage::SwTOXStylesTabPage(Window* pParent, const SfxItemSet& rAttrS aEditStyleBT.SetAccessibleRelationMemberOf(&aFormatFL); } -/* -----------------25.03.99 15:17------------------- - * - * --------------------------------------------------*/ + SwTOXStylesTabPage::~SwTOXStylesTabPage() { delete m_pCurrentForm; } -/* -----------------25.03.99 15:17------------------- - * - * --------------------------------------------------*/ + sal_Bool SwTOXStylesTabPage::FillItemSet( SfxItemSet& ) { return sal_True; } -/* -----------------25.03.99 15:17------------------- - * - * --------------------------------------------------*/ + void SwTOXStylesTabPage::Reset( const SfxItemSet& rSet ) { ActivatePage(rSet); } -/* -----------------25.03.99 15:17------------------- - * - * --------------------------------------------------*/ + void SwTOXStylesTabPage::ActivatePage( const SfxItemSet& ) { m_pCurrentForm = new SwForm(GetForm()); @@ -4052,39 +3786,31 @@ void SwTOXStylesTabPage::ActivatePage( const SfxItemSet& ) EnableSelectHdl(&aParaLayLB); } -/* -----------------25.03.99 15:17------------------- - * - * --------------------------------------------------*/ + int SwTOXStylesTabPage::DeactivatePage( SfxItemSet* /*pSet*/ ) { GetForm() = *m_pCurrentForm; return LEAVE_PAGE; } -/* -----------------25.03.99 15:17------------------- - * - * --------------------------------------------------*/ SfxTabPage* SwTOXStylesTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet) { return new SwTOXStylesTabPage(pParent, rAttrSet); } -/* -----------------26.03.99 12:47------------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwTOXStylesTabPage, EditStyleHdl, Button *, pBtn ) { if( LISTBOX_ENTRY_NOTFOUND != aParaLayLB.GetSelectEntryPos()) { SfxStringItem aStyle(SID_STYLE_EDIT, aParaLayLB.GetSelectEntry()); SfxUInt16Item aFamily(SID_STYLE_FAMILY, SFX_STYLE_FAMILY_PARA); -// SwPtrItem aShell(FN_PARAM_WRTSHELL, pWrtShell); Window* pDefDlgParent = Application::GetDefDialogParent(); Application::SetDefDialogParent( pBtn ); SwWrtShell& rSh = ((SwMultiTOXTabDialog*)GetTabDialog())->GetWrtShell(); rSh.GetView().GetViewFrame()->GetDispatcher()->Execute( SID_STYLE_EDIT, SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_MODAL, - &aStyle, &aFamily/*, &aShell*/, 0L); + &aStyle, &aFamily, 0L); Application::SetDefDialogParent( pDefDlgParent ); } return 0; @@ -4118,9 +3844,7 @@ IMPL_LINK( SwTOXStylesTabPage, AssignHdl, Button *, EMPTYARG ) } return 0; } -/* -----------------26.03.99 09:10------------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwTOXStylesTabPage, StdHdl, Button *, EMPTYARG ) { sal_uInt16 nPos = aLevelLB.GetSelectEntryPos(); @@ -4137,9 +3861,7 @@ IMPL_LINK( SwTOXStylesTabPage, StdHdl, Button *, EMPTYARG ) } return 0; } -/* -----------------26.03.99 09:11------------------- - * - * --------------------------------------------------*/ + IMPL_LINK_INLINE_START( SwTOXStylesTabPage, DoubleClickHdl, Button *, EMPTYARG ) { String aTmpName( aParaLayLB.GetSelectEntry() ); @@ -4151,12 +3873,12 @@ IMPL_LINK_INLINE_START( SwTOXStylesTabPage, DoubleClickHdl, Button *, EMPTYARG ) return 0; } IMPL_LINK_INLINE_END( SwTOXStylesTabPage, DoubleClickHdl, Button *, EMPTYARG ) + /*-------------------------------------------------------------------- Beschreibung: nur wenn selektiert enable --------------------------------------------------------------------*/ IMPL_LINK( SwTOXStylesTabPage, EnableSelectHdl, ListBox *, EMPTYARG ) { - //UpdatePattern(); aStdBT.Enable(aLevelLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND); SwWrtShell& rSh = ((SwMultiTOXTabDialog*)GetTabDialog())->GetWrtShell(); @@ -4167,9 +3889,7 @@ IMPL_LINK( SwTOXStylesTabPage, EnableSelectHdl, ListBox *, EMPTYARG ) aEditStyleBT.Enable(aParaLayLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ); return 0; } -/* -----------------------------18.01.00 16:54-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK(SwTOXStylesTabPage, ModifyHdl, void*, EMPTYARG) { SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog(); @@ -4180,9 +3900,7 @@ IMPL_LINK(SwTOXStylesTabPage, ModifyHdl, void*, EMPTYARG) } return 0; } -/****************************************************************************** -******************************************************************************/ #define ITEM_SEARCH 1 #define ITEM_ALTERNATIVE 2 #define ITEM_PRIM_KEY 3 @@ -4251,17 +3969,13 @@ SwEntryBrowseBox::SwEntryBrowseBox(Window* pParent, const ResId& rId, HIB_STDSTYLE, HEADERBAR_APPEND ); } -/* -----------------------------19.01.00 11:29-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwEntryBrowseBox::SeekRow( long nRow ) { nCurrentRow = nRow; return sal_True; } -/* -----------------------------19.01.00 15:32-------------------------------- - ---------------------------------------------------------------------------*/ String SwEntryBrowseBox::GetCellText(long nRow, sal_uInt16 nColumn) const { const String* pRet = &aEmptyStr; @@ -4282,9 +3996,6 @@ String SwEntryBrowseBox::GetCellText(long nRow, sal_uInt16 nColumn) const return *pRet; } -/* -----------------------------19.01.00 11:29-------------------------------- - - ---------------------------------------------------------------------------*/ void SwEntryBrowseBox::PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId) const { @@ -4292,16 +4003,12 @@ void SwEntryBrowseBox::PaintCell(OutputDevice& rDev, sal_uInt16 nStyle = TEXT_DRAW_CLIP | TEXT_DRAW_CENTER; rDev.DrawText( rRect, sPaint, nStyle ); } -/* -----------------------------19.01.00 14:51-------------------------------- - ---------------------------------------------------------------------------*/ ::svt::CellController* SwEntryBrowseBox::GetController(long /*nRow*/, sal_uInt16 nCol) { return nCol < ITEM_CASE ? xController : xCheckController; } -/* -----------------------------19.01.00 15:36-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwEntryBrowseBox::SaveModified() { SetModified(); @@ -4345,9 +4052,7 @@ sal_Bool SwEntryBrowseBox::SaveModified() } return sal_True; } -/* -----------------------------19.01.00 14:32-------------------------------- - ---------------------------------------------------------------------------*/ void SwEntryBrowseBox::InitController( ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol) { @@ -4366,9 +4071,7 @@ void SwEntryBrowseBox::InitController( rTxt == sYes ); } } -/* -----------------------------19.01.00 12:19-------------------------------- - ---------------------------------------------------------------------------*/ void SwEntryBrowseBox::ReadEntries(SvStream& rInStr) { AutoMarkEntry* pToInsert = 0; @@ -4421,9 +4124,7 @@ void SwEntryBrowseBox::ReadEntries(SvStream& rInStr) aEntryArr.Insert(pToInsert, aEntryArr.Count()); RowInserted(0, aEntryArr.Count() + 1, sal_True); } -/* -----------------------------19.01.00 12:19-------------------------------- - ---------------------------------------------------------------------------*/ void SwEntryBrowseBox::WriteEntries(SvStream& rOutStr) { //check if the current controller is modified @@ -4463,9 +4164,7 @@ void SwEntryBrowseBox::WriteEntries(SvStream& rOutStr) rOutStr.WriteByteStringLine( sWrite, eTEnc ); } } -/* -----------------------------21.01.00 11:49-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwEntryBrowseBox::IsModified()const { if(bModified) @@ -4481,9 +4180,7 @@ sal_Bool SwEntryBrowseBox::IsModified()const pController = xCheckController; return pController ->IsModified(); } -/* -----------------------------19.01.00 11:29-------------------------------- - ---------------------------------------------------------------------------*/ SwAutoMarkDlg_Impl::SwAutoMarkDlg_Impl(Window* pParent, const String& rAutoMarkURL, const String& rAutoMarkType, sal_Bool bCreate) : ModalDialog(pParent, SW_RES(DLG_CREATE_AUTOMARK)), @@ -4518,15 +4215,11 @@ SwAutoMarkDlg_Impl::SwAutoMarkDlg_Impl(Window* pParent, const String& rAutoMarkU if(bError) EndDialog(RET_CANCEL); } -/* -----------------------------19.01.00 11:12-------------------------------- - ---------------------------------------------------------------------------*/ SwAutoMarkDlg_Impl::~SwAutoMarkDlg_Impl() { } -/* -----------------------------19.01.00 16:43-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK(SwAutoMarkDlg_Impl, OkHdl, OKButton*, EMPTYARG) { sal_Bool bError = sal_False; @@ -4551,3 +4244,4 @@ IMPL_LINK(SwAutoMarkDlg_Impl, OkHdl, OKButton*, EMPTYARG) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/index/cnttab.hrc b/sw/source/ui/index/cnttab.hrc index 1025cc8a2d..ae8a1b11f8 100644 --- a/sw/source/ui/index/cnttab.hrc +++ b/sw/source/ui/index/cnttab.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -223,8 +223,6 @@ #define LB_LANGUAGE 146 #define FT_SORTALG 147 #define LB_SORTALG 148 -#define IMG_SORTUP_HC 149 -#define IMG_SORTDOWN_HC 150 #define ST_NO_BRACKET 151 #define FT_LEVEL_OL 152 diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src index df6aab933e..6d2f75b643 100644 --- a/sw/source/ui/index/cnttab.src +++ b/sw/source/ui/index/cnttab.src @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -237,7 +237,7 @@ TabPage TP_TOX_SELECT Text = "~..." ; TabStop = TRUE ; }; -*/ +*/ CheckBox CB_ADDSTYLES { HelpID = "sw:CheckBox:TP_TOX_SELECT:CB_ADDSTYLES"; @@ -964,16 +964,6 @@ TabPage TP_TOX_ENTRY Border = TRUE; DropDown = TRUE; }; - Image IMG_SORTUP_HC - { - ImageBitmap = Bitmap{File = "sch10712.bmp"; }; - MaskColor = IMAGE_MASK_COLOR ; - }; - Image IMG_SORTDOWN_HC - { - ImageBitmap = Bitmap{File = "sch10713.bmp"; }; - MaskColor = IMAGE_MASK_COLOR ; - }; ImageRadioButton RB_SORTUP1 { HelpID = "sw:ImageRadioButton:TP_TOX_ENTRY:RB_SORTUP1"; diff --git a/sw/source/ui/index/idxmrk.cxx b/sw/source/ui/index/idxmrk.cxx index 7d3e1694eb..66a407d1d8 100644 --- a/sw/source/ui/index/idxmrk.cxx +++ b/sw/source/ui/index/idxmrk.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <hintids.hxx> -#ifndef _HELPID_H #include <helpid.h> -#endif #define _SVSTDARR_STRINGSSORT #include <svl/svstdarr.hxx> #include <comphelper/processfactory.hxx> @@ -43,9 +42,7 @@ #include <com/sun/star/util/SearchFlags.hpp> #include <com/sun/star/i18n/TransliterationModules.hpp> #include <svl/stritem.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <sfx2/dispatch.hxx> #include <svl/eitem.hxx> #include <svtools/txtcmp.hxx> @@ -56,20 +53,12 @@ #include <idxmrk.hxx> #include <txttxmrk.hxx> #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <multmrk.hxx> #include <swundo.hxx> // fuer Undo-Ids -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _INDEX_HRC #include <index.hrc> -#endif -#ifndef _IDXMRK_HRC #include <idxmrk.hrc> -#endif #include <swmodule.hxx> #include <fldmgr.hxx> #include <fldbas.hxx> @@ -79,10 +68,6 @@ #include <ndtxt.hxx> #include <breakit.hxx> - -/* -----------------07.09.99 08:15------------------- - - --------------------------------------------------*/ SFX_IMPL_CHILDWINDOW(SwInsertIdxMarkWrapper, FN_INSERT_IDX_ENTRY_DLG) SwInsertIdxMarkWrapper::SwInsertIdxMarkWrapper( Window *pParentWindow, @@ -92,17 +77,15 @@ SwInsertIdxMarkWrapper::SwInsertIdxMarkWrapper( Window *pParentWindow, SfxChildWindow(pParentWindow, nId) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); pAbstDlg = pFact->CreateIndexMarkFloatDlg( DLG_INSIDXMARK , pBindings, this, pParentWindow, pInfo ); - DBG_ASSERT(pAbstDlg, "Dialogdiet fail!"); + OSL_ENSURE(pAbstDlg, "Dialogdiet fail!"); pWindow = pAbstDlg->GetWindow(); pWindow->Show(); // at this point,because before pSh has to be initialized in ReInitDlg() // -> Show() will invoke StateChanged() and save pos eChildAlignment = SFX_ALIGN_NOALIGNMENT; } -/* -----------------07.09.99 09:14------------------- - --------------------------------------------------*/ SfxChildWinInfo SwInsertIdxMarkWrapper::GetInfo() const { SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); @@ -115,10 +98,6 @@ void SwInsertIdxMarkWrapper::ReInitDlg(SwWrtShell& rWrtShell) pAbstDlg->ReInitDlg(rWrtShell); } - -/* -----------------07.09.99 08:15------------------- - - --------------------------------------------------*/ SFX_IMPL_CHILDWINDOW(SwInsertAuthMarkWrapper, FN_INSERT_AUTH_ENTRY_DLG) SwInsertAuthMarkWrapper::SwInsertAuthMarkWrapper( Window *pParentWindow, @@ -128,26 +107,23 @@ SwInsertAuthMarkWrapper::SwInsertAuthMarkWrapper( Window *pParentWindow, SfxChildWindow(pParentWindow, nId) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); pAbstDlg = pFact->CreateAuthMarkFloatDlg( DLG_INSAUTHMARK, pBindings, this, pParentWindow, pInfo ); - DBG_ASSERT(pAbstDlg, "Dialogdiet fail!"); + OSL_ENSURE(pAbstDlg, "Dialogdiet fail!"); pWindow = pAbstDlg->GetWindow(); eChildAlignment = SFX_ALIGN_NOALIGNMENT; } -/* -----------------07.09.99 09:14------------------- - --------------------------------------------------*/ SfxChildWinInfo SwInsertAuthMarkWrapper::GetInfo() const { SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); return aInfo; } -/* -----------------19.10.99 11:16------------------- - --------------------------------------------------*/ void SwInsertAuthMarkWrapper::ReInitDlg(SwWrtShell& rWrtShell) { pAbstDlg->ReInitDlg(rWrtShell); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/index/idxmrk.src b/sw/source/ui/index/idxmrk.src index e0a1a4df9c..2eaeb63e67 100644 --- a/sw/source/ui/index/idxmrk.src +++ b/sw/source/ui/index/idxmrk.src @@ -408,7 +408,6 @@ String STR_IDXMRK_EDIT }; String STR_IDXMRK_INSERT { - /* ### ACHTUNG: Neuer Text in Resource? Verzeichniseintrag einf�gen : Verzeichniseintrag einf�gen */ Text [ en-US ] = "Insert Index Entry" ; }; diff --git a/sw/source/ui/index/multmrk.cxx b/sw/source/ui/index/multmrk.cxx index 51ba9f2125..d314fdb410 100644 --- a/sw/source/ui/index/multmrk.cxx +++ b/sw/source/ui/index/multmrk.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -87,7 +88,7 @@ void SwMultiTOXMarkDlg::Apply() rMgr.SetCurTOXMark(nPos); } -/*-----------------25.02.94 22:06------------------- +/*-------------------------------------------------- dtor ueberladen --------------------------------------------------*/ @@ -96,3 +97,4 @@ SwMultiTOXMarkDlg::~SwMultiTOXMarkDlg() {} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 4559882588..d80617053e 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -72,7 +73,6 @@ #include <breakit.hxx> #include <SwRewriter.hxx> -#include "swuiidxmrk.hxx" #include <unomid.h> @@ -198,7 +198,6 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent, aPrevSameBT.SetClickHdl(LINK(this,SwIndexMarkDlg, PrevSameHdl)); aNextBT.SetClickHdl(LINK(this,SwIndexMarkDlg, NextHdl)); aNextSameBT.SetClickHdl(LINK(this,SwIndexMarkDlg, NextSameHdl)); - //aTypeDCB.SetModifyHdl(LINK(this,SwIndexMarkDlg, ModifyHdl)); aTypeDCB.SetSelectHdl(LINK(this,SwIndexMarkDlg, ModifyHdl)); aKeyDCB.SetModifyHdl(LINK(this,SwIndexMarkDlg, KeyDCBModifyHdl)); aKey2DCB.SetModifyHdl(LINK(this,SwIndexMarkDlg, KeyDCBModifyHdl)); @@ -214,16 +213,8 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent, if(bNewMark) { aDelBT.Hide(); - - { - ImageList aTempList( SW_RES( IMG_NAVI_ENTRYBMPH ) ); - aNewBT.SetModeImage( aTempList.GetImage( SID_SW_START + CONTENT_TYPE_INDEX ), BMP_COLOR_HIGHCONTRAST ); - } - - { - ImageList aTempList( SW_RES( IMG_NAVI_ENTRYBMP ) ); - aNewBT.SetModeImage( aTempList.GetImage( SID_SW_START + CONTENT_TYPE_INDEX ), BMP_COLOR_NORMAL ); - } + ImageList aTempList( SW_RES( IMG_NAVI_ENTRYBMP ) ); + aNewBT.SetModeImage( aTempList.GetImage( SID_SW_START + CONTENT_TYPE_INDEX ) ); } else { @@ -239,14 +230,12 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent, Beschreibung: Controls neu initialisieren mit der aktuellen Markierung --------------------------------------------------------------------*/ - - void SwIndexMarkDlg::InitControls() { - DBG_ASSERT(pSh && pTOXMgr, "Shell nicht da?"); + OSL_ENSURE(pSh && pTOXMgr, "no shell?"); // Inhalts-Verzeichnis const SwTOXType* pType = pTOXMgr->GetTOXType(TOX_CONTENT, 0); - ASSERT(pType, "Kein Verzeichnistyp !!"); + OSL_ENSURE(pType, "Kein Verzeichnistyp !!"); String sTmpTypeSelection; if(aTypeDCB.GetSelectEntryCount()) sTmpTypeSelection = aTypeDCB.GetSelectEntry(); @@ -255,7 +244,7 @@ void SwIndexMarkDlg::InitControls() // Stichwort-Verzeichnis pType = pTOXMgr->GetTOXType(TOX_INDEX, 0); - ASSERT(pType, "Kein Verzeichnistyp !!"); + OSL_ENSURE(pType, "Kein Verzeichnistyp !!"); aTypeDCB.InsertEntry(pType->GetTypeName()); // Benutzerverzeichnisse @@ -370,19 +359,19 @@ void SwIndexMarkDlg::UpdateLanguageDependenciesForPhoneticReading() //get the current language if(!bNewMark) //if dialog is opened to iterate existing marks { - ASSERT(pTOXMgr, "need TOXMgr") + OSL_ENSURE(pTOXMgr, "need TOXMgr"); if(!pTOXMgr) return; SwTOXMark* pMark = pTOXMgr->GetCurTOXMark(); - ASSERT(pMark, "need current SwTOXMark"); + OSL_ENSURE(pMark, "need current SwTOXMark"); if(!pMark) return; SwTxtTOXMark* pTxtTOXMark = pMark->GetTxtTOXMark(); - ASSERT(pTxtTOXMark, "need current SwTxtTOXMark"); + OSL_ENSURE(pTxtTOXMark, "need current SwTxtTOXMark"); if(!pTxtTOXMark) return; const SwTxtNode* pTxtNode = pTxtTOXMark->GetpTxtNd(); - ASSERT(pTxtNode, "need current SwTxtNode"); + OSL_ENSURE(pTxtNode, "need current SwTxtNode"); if(!pTxtNode) return; xub_StrLen nTextIndex = *pTxtTOXMark->GetStart(); @@ -396,7 +385,6 @@ void SwIndexMarkDlg::UpdateLanguageDependenciesForPhoneticReading() { case SCRIPTTYPE_ASIAN: nWhich = RES_CHRATR_CJK_LANGUAGE; break; case SCRIPTTYPE_COMPLEX:nWhich = RES_CHRATR_CTL_LANGUAGE; break; - //case SCRIPTTYPE_LATIN: default:nWhich = RES_CHRATR_LANGUAGE; break; } SfxItemSet aLangSet(pSh->GetAttrPool(), nWhich, nWhich); @@ -404,13 +392,6 @@ void SwIndexMarkDlg::UpdateLanguageDependenciesForPhoneticReading() nLangForPhoneticReading = ((const SvxLanguageItem&)aLangSet.Get(nWhich)).GetLanguage(); } - /* - //enable phonetic reading dependent on the current language - { - lang::Locale aLocale( SvxCreateLocale( LanguageType( nLangForPhoneticReading ) ) ); - bIsPhoneticReadingEnabled = xExtendedIndexEntrySupplier->usePhoneticEntry( aLocale ); - } - */ } String SwIndexMarkDlg::GetDefaultPhoneticReading( const String& rText ) @@ -422,10 +403,9 @@ String SwIndexMarkDlg::GetDefaultPhoneticReading( const String& rText ) return xExtendedIndexEntrySupplier->getPhoneticCandidate(rText, aLocale); } -/* -----------------07.09.99 10:43------------------- +/* -------------------------------------------------- Change the content of aEntryED if text is selected --------------------------------------------------*/ - void SwIndexMarkDlg::Activate() { // aktuelle Selektion (1.Element) anzeigen ???? @@ -465,8 +445,6 @@ void SwIndexMarkDlg::Apply() /*-------------------------------------------------------------------- Beschreibung: Aenderungen uebernehmen --------------------------------------------------------------------*/ - - void SwIndexMarkDlg::InsertUpdate() { pSh->StartUndo(bDel ? UNDO_INDEX_ENTRY_DELETE : UNDO_INDEX_ENTRY_INSERT); @@ -586,8 +564,6 @@ void SwIndexMarkDlg::InsertMark() /*-------------------------------------------------------------------- Beschreibung: Marke Updaten --------------------------------------------------------------------*/ - - void SwIndexMarkDlg::UpdateMark() { String aAltText(aEntryED.GetText()); @@ -630,8 +606,6 @@ void SwIndexMarkDlg::UpdateMark() /*-------------------------------------------------------------------- Beschreibung: Neue Keys eintragen --------------------------------------------------------------------*/ - - void SwIndexMarkDlg::UpdateKeyBoxes() { String aKey(aKeyDCB.GetText()); @@ -650,9 +624,7 @@ void SwIndexMarkDlg::UpdateKeyBoxes() aKey2DCB.InsertEntry(aKey); } } -/* -----------------13.10.99 15:10------------------- - --------------------------------------------------*/ class SwNewUserIdxDlg : public ModalDialog { OKButton aOKPB; @@ -708,9 +680,7 @@ IMPL_LINK( SwIndexMarkDlg, NewUserIdxHdl, Button*, EMPTYARG) delete pDlg; return 0; } -/* -----------------------------17.01.00 12:18-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK( SwIndexMarkDlg, SearchTypeHdl, CheckBox*, pBox) { sal_Bool bEnable = pBox->IsChecked() && pBox->IsEnabled(); @@ -718,9 +688,7 @@ IMPL_LINK( SwIndexMarkDlg, SearchTypeHdl, CheckBox*, pBox) aSearchCaseSensitiveCB.Enable(bEnable); return 0; } -/* -----------------07.09.99 10:30------------------- - --------------------------------------------------*/ IMPL_LINK( SwIndexMarkDlg, InsertHdl, Button *, pButton ) { Apply(); @@ -729,9 +697,7 @@ IMPL_LINK( SwIndexMarkDlg, InsertHdl, Button *, pButton ) CloseHdl(pButton); return 0; } -/* -----------------07.09.99 10:29------------------- - --------------------------------------------------*/ IMPL_LINK( SwIndexMarkDlg, CloseHdl, Button *, EMPTYARG ) { if(bNewMark) @@ -746,6 +712,7 @@ IMPL_LINK( SwIndexMarkDlg, CloseHdl, Button *, EMPTYARG ) } return 0; } + /*-------------------------------------------------------------------- Beschreibung: VerzeichnisTyp auswaehlen nur bei Einfuegen --------------------------------------------------------------------*/ @@ -824,11 +791,6 @@ IMPL_LINK( SwIndexMarkDlg, ModifyHdl, ListBox *, pBox ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - IMPL_LINK_INLINE_START( SwIndexMarkDlg, NextHdl, Button *, EMPTYARG ) { InsertUpdate(); @@ -838,7 +800,6 @@ IMPL_LINK_INLINE_START( SwIndexMarkDlg, NextHdl, Button *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwIndexMarkDlg, NextHdl, Button *, EMPTYARG ) - IMPL_LINK_INLINE_START( SwIndexMarkDlg, NextSameHdl, Button *, EMPTYARG ) { InsertUpdate(); @@ -848,7 +809,6 @@ IMPL_LINK_INLINE_START( SwIndexMarkDlg, NextSameHdl, Button *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwIndexMarkDlg, NextSameHdl, Button *, EMPTYARG ) - IMPL_LINK_INLINE_START( SwIndexMarkDlg, PrevHdl, Button *, EMPTYARG ) { InsertUpdate(); @@ -858,7 +818,6 @@ IMPL_LINK_INLINE_START( SwIndexMarkDlg, PrevHdl, Button *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwIndexMarkDlg, PrevHdl, Button *, EMPTYARG ) - IMPL_LINK_INLINE_START( SwIndexMarkDlg, PrevSameHdl, Button *, EMPTYARG ) { InsertUpdate(); @@ -869,7 +828,6 @@ IMPL_LINK_INLINE_START( SwIndexMarkDlg, PrevSameHdl, Button *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwIndexMarkDlg, PrevSameHdl, Button *, EMPTYARG ) - IMPL_LINK( SwIndexMarkDlg, DelHdl, Button *, EMPTYARG ) { bDel = sal_True; @@ -889,13 +847,11 @@ IMPL_LINK( SwIndexMarkDlg, DelHdl, Button *, EMPTYARG ) /*-------------------------------------------------------------------- Beschreibung: Dialoganzeige erneuern --------------------------------------------------------------------*/ - - void SwIndexMarkDlg::UpdateDialog() { - DBG_ASSERT(pSh && pTOXMgr, "Shell nicht da?"); + OSL_ENSURE(pSh && pTOXMgr, "no shell?"); SwTOXMark* pMark = pTOXMgr->GetCurTOXMark(); - ASSERT(pMark, "Keine aktuelle Markierung"); + OSL_ENSURE(pMark, "no current marker"); if(!pMark) return; @@ -995,7 +951,6 @@ void SwIndexMarkDlg::UpdateDialog() /*-------------------------------------------------------------------- Remind wether the edit boxes for Phonetic reading are changed manually --------------------------------------------------------------------*/ - IMPL_LINK( SwIndexMarkDlg, PhoneticEDModifyHdl, Edit *, pEdit ) { if(&aPhoneticED0 == pEdit) @@ -1016,7 +971,6 @@ IMPL_LINK( SwIndexMarkDlg, PhoneticEDModifyHdl, Edit *, pEdit ) /*-------------------------------------------------------------------- Beschreibung: Enable Disable des 2. Schluessels --------------------------------------------------------------------*/ - IMPL_LINK( SwIndexMarkDlg, KeyDCBModifyHdl, ComboBox *, pBox ) { if(&aKeyDCB == pBox) @@ -1072,19 +1026,15 @@ IMPL_LINK( SwIndexMarkDlg, KeyDCBModifyHdl, ComboBox *, pBox ) return 0; } -/*-----------------25.02.94 21:19------------------- +/*-------------------------------------------------- dtor ueberladen --------------------------------------------------*/ - - SwIndexMarkDlg::~SwIndexMarkDlg() { delete pTOXMgr; ViewShell::SetCareWin( 0 ); } -/* -----------------07.09.99 08:41------------------- - --------------------------------------------------*/ void SwIndexMarkDlg::ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark* pCurTOXMark) { pSh = &rWrtShell; @@ -1101,9 +1051,7 @@ void SwIndexMarkDlg::ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark* pCurTOXMark) } InitControls(); } -/* -----------------06.10.99 10:00------------------- - --------------------------------------------------*/ SwIndexMarkFloatDlg::SwIndexMarkFloatDlg(SfxBindings* _pBindings, SfxChildWindow* pChild, Window *pParent, @@ -1116,9 +1064,7 @@ SfxModelessDialog(_pBindings, pChild, pParent, SvtCJKOptions().IsCJKFontEnabled( aDlg.ReInitDlg(*::GetActiveWrtShell()); Initialize(pInfo); } -/* -----------------06.10.99 10:27------------------- - --------------------------------------------------*/ void SwIndexMarkFloatDlg::Activate() { SfxModelessDialog::Activate(); @@ -1130,9 +1076,6 @@ void SwIndexMarkFloatDlg::ReInitDlg(SwWrtShell& rWrtShell) aDlg.ReInitDlg( rWrtShell ); } -/* -----------------06.10.99 10:35------------------- - - --------------------------------------------------*/ SwIndexMarkModalDlg::SwIndexMarkModalDlg(Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark) : SvxStandardDialog(pParent, SvtCJKOptions().IsCJKFontEnabled()?SW_RES(DLG_EDIT_IDXMARK_CJK):SW_RES(DLG_EDIT_IDXMARK)), aDlg(this, sal_False, SW_RES(WIN_DLG), SvtCJKOptions().IsCJKFontEnabled()?DLG_EDIT_IDXMARK_CJK:DLG_EDIT_IDXMARK, rSh) @@ -1140,16 +1083,12 @@ SvxStandardDialog(pParent, SvtCJKOptions().IsCJKFontEnabled()?SW_RES(DLG_EDIT_ID FreeResource(); aDlg.ReInitDlg(rSh, pCurTOXMark); } -/* -----------------06.10.99 10:46------------------- - --------------------------------------------------*/ void SwIndexMarkModalDlg::Apply() { aDlg.Apply(); } -/* -----------------16.09.99 14:19------------------- - --------------------------------------------------*/ class SwCreateAuthEntryDlg_Impl : public ModalDialog { FixedLine aEntriesFL; @@ -1187,9 +1126,7 @@ public: void SetCheckNameHdl(const Link& rLink) {aShortNameCheckLink = rLink;} }; -/*-- 15.09.99 08:43:24--------------------------------------------------- - -----------------------------------------------------------------------*/ struct TextInfo { sal_uInt16 nToxField; @@ -1302,23 +1239,17 @@ SwAuthMarkDlg::SwAuthMarkDlg( Window *pParent, aEntryLB.SetSelectHdl(LINK(this, SwAuthMarkDlg, CompEntryHdl)); } } -/*-- 15.09.99 08:43:25--------------------------------------------------- - -----------------------------------------------------------------------*/ SwAuthMarkDlg::~SwAuthMarkDlg() { } -/*-- 15.09.99 08:43:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwAuthMarkDlg::ReInitDlg(SwWrtShell& rWrtShell) { pSh = &rWrtShell; InitControls(); } -/* -----------------15.09.99 08:57------------------- - --------------------------------------------------*/ IMPL_LINK( SwAuthMarkDlg, CloseHdl, PushButton *, EMPTYARG ) { if(bNewEntry) @@ -1333,9 +1264,7 @@ IMPL_LINK( SwAuthMarkDlg, CloseHdl, PushButton *, EMPTYARG ) } return 0; } -/* -----------------06.12.99 13:54------------------- - --------------------------------------------------*/ static String lcl_FindColumnEntry(const beans::PropertyValue* pFields, sal_Int32 nLen, const String& rColumnTitle) { String sRet; @@ -1352,9 +1281,7 @@ static String lcl_FindColumnEntry(const beans::PropertyValue* pFields, sal_Int32 } return sRet; } -/* -----------------------------07.12.99 15:39-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK( SwAuthMarkDlg, CompEntryHdl, ListBox*, pBox) { String sEntry(pBox->GetSelectEntry()); @@ -1401,17 +1328,14 @@ IMPL_LINK( SwAuthMarkDlg, CompEntryHdl, ListBox*, pBox) return 0; } -/* -----------------15.09.99 08:57------------------- - - --------------------------------------------------*/ IMPL_LINK( SwAuthMarkDlg, InsertHdl, PushButton *, EMPTYARG ) { //insert or update the SwAuthorityField... if(pSh) { sal_Bool bDifferent = sal_False; - DBG_ASSERT(m_sFields[AUTH_FIELD_IDENTIFIER].Len() , "No Id is set!"); - DBG_ASSERT(m_sFields[AUTH_FIELD_AUTHORITY_TYPE].Len() , "No authority type is set!"); + OSL_ENSURE(m_sFields[AUTH_FIELD_IDENTIFIER].Len() , "No Id is set!"); + OSL_ENSURE(m_sFields[AUTH_FIELD_AUTHORITY_TYPE].Len() , "No authority type is set!"); //check if the entry already exists with different content const SwAuthorityFieldType* pFType = (const SwAuthorityFieldType*) pSh->GetFldType(RES_AUTHORITY, aEmptyStr); @@ -1458,9 +1382,7 @@ IMPL_LINK( SwAuthMarkDlg, InsertHdl, PushButton *, EMPTYARG ) CloseHdl(0); return 0; } -/* -----------------17.09.99 13:06------------------- - --------------------------------------------------*/ IMPL_LINK(SwAuthMarkDlg, CreateEntryHdl, PushButton*, pButton) { sal_Bool bCreate = pButton == &aCreateEntryPB; @@ -1492,7 +1414,7 @@ IMPL_LINK(SwAuthMarkDlg, CreateEntryHdl, PushButton*, pButton) } if(bCreate) { - DBG_ASSERT(LISTBOX_ENTRY_NOTFOUND == + OSL_ENSURE(LISTBOX_ENTRY_NOTFOUND == aEntryLB.GetEntryPos(m_sFields[AUTH_FIELD_IDENTIFIER]), "entry exists!"); aEntryLB.InsertEntry(m_sFields[AUTH_FIELD_IDENTIFIER]); @@ -1505,9 +1427,7 @@ IMPL_LINK(SwAuthMarkDlg, CreateEntryHdl, PushButton*, pButton) } return 0; } -/* -----------------------------20.12.99 14:26-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK(SwAuthMarkDlg, ChangeSourceHdl, RadioButton*, pButton) { sal_Bool bFromComp = (pButton == &aFromComponentRB); @@ -1571,9 +1491,7 @@ IMPL_LINK(SwAuthMarkDlg, ChangeSourceHdl, RadioButton*, pButton) CompEntryHdl(&aEntryLB); return 0; } -/* -----------------15.10.2002 13:16----------------- - * - * --------------------------------------------------*/ + IMPL_LINK(SwAuthMarkDlg, EditModifyHdl, Edit*, pEdit) { Link aAllowed = LINK(this, SwAuthMarkDlg, IsEntryAllowedHdl); @@ -1587,9 +1505,7 @@ IMPL_LINK(SwAuthMarkDlg, EditModifyHdl, Edit*, pEdit) } return 0; }; -/* -----------------------------20.12.99 15:11-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK(SwAuthMarkDlg, IsEntryAllowedHdl, Edit*, pEdit) { String sEntry = pEdit->GetText(); @@ -1611,14 +1527,12 @@ IMPL_LINK(SwAuthMarkDlg, IsEntryAllowedHdl, Edit*, pEdit) } return bAllowed; } -/* -----------------21.09.99 14:19------------------- - --------------------------------------------------*/ void SwAuthMarkDlg::InitControls() { - DBG_ASSERT(pSh, "Shell nicht da?"); + OSL_ENSURE(pSh, "no shell?"); SwField* pField = pSh->GetCurFld(); - ASSERT(bNewEntry || pField, "Keine aktuelle Markierung"); + OSL_ENSURE(bNewEntry || pField, "no current marker"); if(bNewEntry) { ChangeSourceHdl(aFromComponentRB.IsChecked() ? &aFromComponentRB : &aFromDocContentRB); @@ -1633,7 +1547,7 @@ void SwAuthMarkDlg::InitControls() const SwAuthEntry* pEntry = ((SwAuthorityFieldType*)pField->GetTyp())-> GetEntryByHandle(((SwAuthorityField*)pField)->GetHandle()); - DBG_ASSERT(pEntry, "No authority entry found"); + OSL_ENSURE(pEntry, "No authority entry found"); if(!pEntry) return; for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++) @@ -1643,17 +1557,13 @@ void SwAuthMarkDlg::InitControls() aAuthorFI.SetText(pEntry->GetAuthorField(AUTH_FIELD_AUTHOR)); aTitleFI.SetText(pEntry->GetAuthorField(AUTH_FIELD_TITLE)); } -/* -----------------------------05.09.2002 09:44------------------------------ - ---------------------------------------------------------------------------*/ void SwAuthMarkDlg::Activate() { aOKBT.Enable(!pSh->HasReadonlySel()); Window::Activate(); } -/* -----------------16.09.99 14:27------------------- - --------------------------------------------------*/ SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(Window* pParent, const String pFields[], SwWrtShell& rSh, @@ -1799,15 +1709,12 @@ SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(Window* pParent, long nHeightDiff = - aFLSz.Height(); aFLSz.Height() = aTL1.Y(); nHeightDiff += aFLSz.Height(); -// aEntriesFL.SetSizePixel(aFLSz); Size aDlgSize(GetSizePixel()); aDlgSize.Height() += nHeightDiff; SetSizePixel(aDlgSize); } -/* -----------------16.09.99 14:47------------------- - --------------------------------------------------*/ SwCreateAuthEntryDlg_Impl::~SwCreateAuthEntryDlg_Impl() { for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++) @@ -1818,20 +1725,18 @@ SwCreateAuthEntryDlg_Impl::~SwCreateAuthEntryDlg_Impl() delete pTypeListBox; delete pIdentifierBox; } -/* -----------------16.09.99 14:27------------------- - --------------------------------------------------*/ String SwCreateAuthEntryDlg_Impl::GetEntryText(ToxAuthorityField eField) const { String sRet; if( AUTH_FIELD_AUTHORITY_TYPE == eField ) { - DBG_ASSERT(pTypeListBox, "No ListBox"); + OSL_ENSURE(pTypeListBox, "No ListBox"); sRet = String::CreateFromInt32(pTypeListBox->GetSelectEntryPos()); } else if( AUTH_FIELD_IDENTIFIER == eField && !m_bNewEntryMode) { - DBG_ASSERT(pIdentifierBox, "No ComboBox"); + OSL_ENSURE(pIdentifierBox, "No ComboBox"); sRet = pIdentifierBox->GetText(); } else @@ -1848,9 +1753,7 @@ String SwCreateAuthEntryDlg_Impl::GetEntryText(ToxAuthorityField eField) const } return sRet; } -/* -----------------21.09.99 13:54------------------- - --------------------------------------------------*/ IMPL_LINK(SwCreateAuthEntryDlg_Impl, IdentifierHdl, ComboBox*, pBox) { const SwAuthorityFieldType* pFType = (const SwAuthorityFieldType*) @@ -1876,9 +1779,6 @@ IMPL_LINK(SwCreateAuthEntryDlg_Impl, IdentifierHdl, ComboBox*, pBox) } return 0; } -/* -----------------------------20.12.99 15:07-------------------------------- - - ---------------------------------------------------------------------------*/ IMPL_LINK(SwCreateAuthEntryDlg_Impl, ShortNameHdl, Edit*, pEdit) { @@ -1890,17 +1790,13 @@ IMPL_LINK(SwCreateAuthEntryDlg_Impl, ShortNameHdl, Edit*, pEdit) } return 0; } -/* -----------------------------20.12.99 15:54-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK(SwCreateAuthEntryDlg_Impl, EnableHdl, ListBox*, pBox) { aOKBT.Enable(m_bNameAllowed && pBox->GetSelectEntryCount()); return 0; }; -/* -----------------06.10.99 10:00------------------- - --------------------------------------------------*/ SwAuthMarkFloatDlg::SwAuthMarkFloatDlg(SfxBindings* _pBindings, SfxChildWindow* pChild, Window *pParent, @@ -1912,12 +1808,10 @@ SwAuthMarkFloatDlg::SwAuthMarkFloatDlg(SfxBindings* _pBindings, FreeResource(); Initialize(pInfo); SwWrtShell* pWrtShell = ::GetActiveWrtShell(); - DBG_ASSERT(pWrtShell, "No shell?"); + OSL_ENSURE(pWrtShell, "No shell?"); aDlg.ReInitDlg(*pWrtShell); } -/* -----------------06.10.99 10:27------------------- - --------------------------------------------------*/ void SwAuthMarkFloatDlg::Activate() { SfxModelessDialog::Activate(); @@ -1929,9 +1823,6 @@ void SwAuthMarkFloatDlg::ReInitDlg(SwWrtShell& rWrtShell) aDlg.ReInitDlg( rWrtShell ); } -/* -----------------06.10.99 10:35------------------- - - --------------------------------------------------*/ SwAuthMarkModalDlg::SwAuthMarkModalDlg(Window *pParent, SwWrtShell& rSh) : SvxStandardDialog(pParent, SW_RES(DLG_EDIT_AUTHMARK)), aDlg(this, SW_RES(WIN_DLG), sal_False) @@ -1939,11 +1830,10 @@ SwAuthMarkModalDlg::SwAuthMarkModalDlg(Window *pParent, SwWrtShell& rSh) : FreeResource(); aDlg.ReInitDlg(rSh); } -/* -----------------06.10.99 10:46------------------- - --------------------------------------------------*/ void SwAuthMarkModalDlg::Apply() { aDlg.InsertHdl(0); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/index/toxmgr.cxx b/sw/source/ui/index/toxmgr.cxx index 707a114ea4..e91c648505 100644 --- a/sw/source/ui/index/toxmgr.cxx +++ b/sw/source/ui/index/toxmgr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -85,9 +86,7 @@ void SwTOXMgr::DeleteTOXMark() // zur naechsten wandern pCurTOXMark = pNext; } -/* -----------------20.08.99 10:48------------------- - --------------------------------------------------*/ void SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc) { SwTOXMark* pMark = 0; @@ -95,8 +94,8 @@ void SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc) { case TOX_CONTENT: { - ASSERT(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL, - ungueltiger Level InsertTOCMark); + OSL_ENSURE(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL, + "invalid InsertTOCMark level"); pMark = new SwTOXMark(pSh->GetTOXType(TOX_CONTENT, 0)); pMark->SetLevel( static_cast< sal_uInt16 >(rDesc.GetLevel()) ); @@ -130,8 +129,8 @@ void SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc) break; case TOX_USER: { - ASSERT(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL, - ungueltiger Level InsertTOCMark); + OSL_ENSURE(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL, + "invalid InsertTOCMark level"); sal_uInt16 nId = rDesc.GetTOUName() ? GetUserTypeID(*rDesc.GetTOUName()) : 0; pMark = new SwTOXMark(pSh->GetTOXType(TOX_USER, nId)); @@ -154,7 +153,7 @@ void SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc) void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& rDesc) { - ASSERT(pCurTOXMark, "kein aktuelles TOXMark"); + OSL_ENSURE(pCurTOXMark, "no current TOXMark"); pSh->StartAllAction(); if(pCurTOXMark->GetTOXType()->GetType() == TOX_INDEX) @@ -252,7 +251,7 @@ sal_uInt16 SwTOXMgr::GetUserTypeID(const String& rStr) void SwTOXMgr::NextTOXMark(sal_Bool bSame) { - ASSERT(pCurTOXMark, "kein aktuelles TOXMark"); + OSL_ENSURE(pCurTOXMark, "no current TOXMark"); if( pCurTOXMark ) { SwTOXSearch eDir = bSame ? TOX_SAME_NXT : TOX_NXT; @@ -263,7 +262,7 @@ void SwTOXMgr::NextTOXMark(sal_Bool bSame) void SwTOXMgr::PrevTOXMark(sal_Bool bSame) { - ASSERT(pCurTOXMark, "kein aktuelles TOXMark"); + OSL_ENSURE(pCurTOXMark, "no current TOXMark"); if( pCurTOXMark ) { SwTOXSearch eDir = bSame ? TOX_SAME_PRV : TOX_PRV; @@ -289,10 +288,6 @@ void SwTOXMgr::SetCurTOXMark(sal_uInt16 nId) pCurTOXMark = (nId < aCurMarks.Count()) ? aCurMarks[nId] : 0; } -/* -----------------01.07.99 16:23------------------- - - --------------------------------------------------*/ - sal_Bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc, SwTOXBase** ppBase, const SfxItemSet* pSet) @@ -407,7 +402,6 @@ sal_Bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc, pSh->DelRight(); pNewTOX = (SwTOXBase*)pCurTOX; } -// pTOX->SetOptions(rDesc.GetIndexOptions()); pNewTOX->SetFromObjectNames(rDesc.IsCreateFromObjectNames()); pNewTOX->SetOLEOptions(rDesc.GetOLEOptions()); } @@ -415,7 +409,7 @@ sal_Bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc, } - DBG_ASSERT(pNewTOX, "no TOXBase created!" ); + OSL_ENSURE(pNewTOX, "no TOXBase created!" ); if(!pNewTOX) return sal_False; @@ -478,9 +472,7 @@ sal_Bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc, return bRet; } -/* -----------------20.10.99 14:11------------------- - --------------------------------------------------*/ void SwTOXDescription::SetSortKeys(SwTOXSortKey eKey1, SwTOXSortKey eKey2, SwTOXSortKey eKey3) @@ -499,9 +491,6 @@ void SwTOXDescription::SetSortKeys(SwTOXSortKey eKey1, eSortKey3 = aArr[2]; } -/* -----------------10.09.99 10:02------------------- - - --------------------------------------------------*/ void SwTOXDescription::ApplyTo(SwTOXBase& rTOXBase) { for(sal_uInt16 i = 0; i < MAXLEVEL; i++) @@ -527,3 +516,4 @@ void SwTOXDescription::ApplyTo(SwTOXBase& rTOXBase) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx index 4c88093fc1..956be1f865 100644 --- a/sw/source/ui/lingu/hhcwrp.cxx +++ b/sw/source/ui/lingu/hhcwrp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,20 +34,14 @@ #include <hintids.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> #include <swundo.hxx> // fuer Undo-Ids -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <splargs.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <editeng/unolingu.hxx> #include <editeng/langitem.hxx> #include <editeng/fontitem.hxx> @@ -67,11 +62,8 @@ #include <ndtxt.hxx> #include <fmtruby.hxx> #include <breakit.hxx> -#include <docsh.hxx> -#ifndef _OLMENU_HRC #include <olmenu.hrc> -#endif #include <unomid.h> @@ -196,11 +188,6 @@ SwHHCWrapper::~SwHHCWrapper() } } - -/* - if( bInfoBox ) - InfoBox(&pView->GetEditWin(), String(SW_RES(STR_SPELL_OK)) ).Execute(); -*/ } @@ -244,7 +231,7 @@ void SwHHCWrapper::SelectNewUnit_impl( sal_Int32 nUnitStart, sal_Int32 nUnitEnd void SwHHCWrapper::HandleNewUnit( const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd ) { - DBG_ASSERT( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" ); + OSL_ENSURE( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" ); if (!(0 <= nUnitStart && nUnitStart <= nUnitEnd)) return; @@ -267,7 +254,7 @@ void SwHHCWrapper::ChangeText( const String &rNewText, //!! please see also TextConvWrapper::ChangeText with is a modified //!! copy of this code - DBG_ASSERT( rNewText.Len() != 0, "unexpected empty string" ); + OSL_ENSURE( rNewText.Len() != 0, "unexpected empty string" ); if (rNewText.Len() == 0) return; @@ -293,7 +280,7 @@ void SwHHCWrapper::ChangeText( const String &rNewText, // different length. Negative values allowed! long nCorrectionOffset = 0; - DBG_ASSERT(nIndices == 0 || nIndices == nConvTextLen, + OSL_ENSURE(nIndices == 0 || nIndices == nConvTextLen, "mismatch between string length and sequence length!" ); // find all substrings that need to be replaced (and only those) @@ -324,7 +311,7 @@ void SwHHCWrapper::ChangeText( const String &rNewText, // set selection to sub string to be replaced in original text xub_StrLen nChgInNodeStartIndex = static_cast< xub_StrLen >( nStartIndex + nCorrectionOffset + nChgPos ); - DBG_ASSERT( rWrtShell.GetCrsr()->HasMark(), "cursor misplaced (nothing selected)" ); + OSL_ENSURE( rWrtShell.GetCrsr()->HasMark(), "cursor misplaced (nothing selected)" ); rWrtShell.GetCrsr()->GetMark()->nContent.Assign( pStartTxtNode, nChgInNodeStartIndex ); rWrtShell.GetCrsr()->GetPoint()->nContent.Assign( pStartTxtNode, nChgInNodeStartIndex + nChgLen ); #ifdef DEBUG @@ -425,7 +412,7 @@ void SwHHCWrapper::ReplaceUnit( static OUString aBracketedStart( C2U( "(" ) ); static OUString aBracketedEnd( C2U( ")" ) ); - DBG_ASSERT( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" ); + OSL_ENSURE( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" ); if (!(nUnitStart >= 0 && nUnitEnd >= nUnitStart)) return; @@ -439,7 +426,7 @@ void SwHHCWrapper::ReplaceUnit( OUString aOrigTxt( rWrtShell.GetSelTxt() ); OUString aNewTxt( rReplaceWith ); - DBG_ASSERT( aOrigTxt == rOrigText, "!! text mismatch !!" ); + OSL_ENSURE( aOrigTxt == rOrigText, "!! text mismatch !!" ); SwFmtRuby *pRuby = 0; sal_Bool bRubyBelow = sal_False; String aNewOrigText; @@ -482,7 +469,7 @@ void SwHHCWrapper::ReplaceUnit( } break; default: - DBG_ERROR( "unexpected case" ); + OSL_ENSURE(false, "unexpected case" ); } nUnitOffset += nUnitStart + aNewTxt.getLength(); @@ -509,9 +496,7 @@ void SwHHCWrapper::ReplaceUnit( pRuby->SetPosition( bRubyBelow ); pRuby->SetAdjustment( RubyAdjust_CENTER ); - //!! the following seem not to be needed - //pRuby->SetCharFmtName( const String& rNm ); - //pRuby->SetCharFmtId( sal_uInt16 nNew ); + #ifdef DEBUG SwPaM *pPaM = rWrtShell.GetCrsr(); (void)pPaM; @@ -539,7 +524,7 @@ void SwHHCWrapper::ReplaceUnit( rWrtShell.SetMark(); rWrtShell.GetCrsr()->GetMark()->nContent -= (xub_StrLen) aNewTxt.getLength(); - DBG_ASSERT( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL, + OSL_ENSURE( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL, "SwHHCWrapper::ReplaceUnit : unexpected target language" ); sal_uInt16 aRanges[] = { @@ -550,13 +535,11 @@ void SwHHCWrapper::ReplaceUnit( SfxItemSet aSet( rWrtShell.GetAttrPool(), aRanges ); if (pNewUnitLanguage) { - //DBG_ASSERT(!IsSimilarChinese( *pNewUnitLanguage, nOldLang ), - // "similar language should not be changed!"); aSet.Put( SvxLanguageItem( *pNewUnitLanguage, RES_CHRATR_CJK_LANGUAGE ) ); } const Font *pTargetFont = GetTargetFont(); - DBG_ASSERT( pTargetFont, "target font missing?" ); + OSL_ENSURE( pTargetFont, "target font missing?" ); if (pTargetFont && pNewUnitLanguage) { SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( RES_CHRATR_CJK_FONT ); @@ -588,7 +571,7 @@ sal_Bool SwHHCWrapper::HasRubySupport() const void SwHHCWrapper::Convert() { - DBG_ASSERT( pConvArgs == 0, "NULL pointer expected" ); + OSL_ENSURE( pConvArgs == 0, "NULL pointer expected" ); { SwPaM *pCrsr = pView->GetWrtShell().GetCrsr(); SwPosition* pSttPos = pCrsr->Start(); @@ -618,13 +601,13 @@ void SwHHCWrapper::Convert() pTxtNode, pSttPos->nContent, pTxtNode, pSttPos->nContent ); } - DBG_ASSERT( pConvArgs->pStartNode && pConvArgs->pStartNode->IsTxtNode(), + OSL_ENSURE( pConvArgs->pStartNode && pConvArgs->pStartNode->IsTxtNode(), "failed to get proper start text node" ); - DBG_ASSERT( pConvArgs->pEndNode && pConvArgs->pEndNode->IsTxtNode(), + OSL_ENSURE( pConvArgs->pEndNode && pConvArgs->pEndNode->IsTxtNode(), "failed to get proper end text node" ); // chinese conversion specific settings - DBG_ASSERT( IsChinese( GetSourceLanguage() ) == IsChinese( GetTargetLanguage() ), + OSL_ENSURE( IsChinese( GetSourceLanguage() ) == IsChinese( GetTargetLanguage() ), "source and target language mismatch?" ); if (IsChinese( GetTargetLanguage() )) { @@ -702,7 +685,6 @@ sal_Bool SwHHCWrapper::ConvNext_impl( ) return sal_False; } - //ResMgr* pMgr = DIALOG_MGR(); sal_Bool bGoOn = sal_False; if ( bIsOtherCntnt ) @@ -724,29 +706,9 @@ sal_Bool SwHHCWrapper::ConvNext_impl( ) } else { - // Ein BODY_Bereich erledigt, Frage nach dem anderen BODY_Bereich -/* - //pWin->LeaveWait(); - - sal_uInt16 nResId = RID_SVXQB_CONTINUE; - QueryBox aBox( pWin, ResId( nResId, pMgr ) ); - if ( aBox.Execute() != RET_YES ) - { - // Verzicht auf den anderen Bereich, ggf. Frage nach Sonderbereich - //pWin->EnterWait(); - bStartDone = bEndDone = sal_True; - return SpellNext(); - } - else - { -*/ bStartChk = !bStartDone; ConvStart_impl( pConvArgs, bStartChk ? SVX_SPELL_BODY_START : SVX_SPELL_BODY_END ); bGoOn = sal_True; -/* - } - pWin->EnterWait(); -*/ } return bGoOn; } @@ -756,8 +718,6 @@ sal_Bool SwHHCWrapper::FindConvText_impl() { //! modified version of SvxSpellWrapper::FindSpellError - //ShowLanguageErrors(); - sal_Bool bFound = sal_False; pWin->EnterWait(); @@ -797,22 +757,20 @@ void SwHHCWrapper::ConvStart_impl( SwConversionArgs /* [out] */ *pConversionArgs void SwHHCWrapper::ConvEnd_impl( SwConversionArgs *pConversionArgs ) { pView->SpellEnd( pConversionArgs ); - //ShowLanguageErrors(); } sal_Bool SwHHCWrapper::ConvContinue_impl( SwConversionArgs *pConversionArgs ) { sal_Bool bProgress = !bIsDrawObj && !bIsSelection; -// bLastRet = aConvText.getLength() == 0; pConversionArgs->aConvText = OUString(); pConversionArgs->nConvTextLang = LANGUAGE_NONE; uno::Any aRet = bProgress ? pView->GetWrtShell().SpellContinue( &nPageCount, &nPageStart, pConversionArgs ) : pView->GetWrtShell().SpellContinue( &nPageCount, NULL, pConversionArgs ); - //aRet >>= aConvText; return pConversionArgs->aConvText.getLength() != 0; } ////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/lingu/hyp.cxx b/sw/source/ui/lingu/hyp.cxx index 6e2c555dd3..ea0d7e1433 100644 --- a/sw/source/ui/lingu/hyp.cxx +++ b/sw/source/ui/lingu/hyp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,9 +37,7 @@ #include "wrtsh.hxx" #include "globals.hrc" #include <vcl/msgbox.hxx> -#ifndef _WRKWIN_HXX //autogen #include <vcl/wrkwin.hxx> -#endif #include <linguistic/lngprops.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <swwait.hxx> @@ -174,3 +173,4 @@ SwHyphWrapper::~SwHyphWrapper() InfoBox( &pView->GetEditWin(), SW_RESSTR(STR_HYP_OK) ).Execute(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index c399c5b5fb..88147f35df 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -52,9 +53,6 @@ #include "viewopt.hxx" #include "wrtsh.hxx" #include "wview.hxx" -#include "swabstdlg.hxx" -#include "chrdlg.hrc" - #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR @@ -81,7 +79,6 @@ #include <svl/itemset.hxx> #include <svl/languageoptions.hxx> #include <svl/stritem.hxx> -#include <svtools/filter.hxx> #include <svtools/langtab.hxx> #include <svx/dlgutil.hxx> #include <unotools/lingucfg.hxx> @@ -89,6 +86,7 @@ #include <vcl/msgbox.hxx> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> +#include <sal/macros.h> #include <map> @@ -177,8 +175,8 @@ LanguageType lcl_CheckLanguage( lang::Locale a3( SvxCreateLocale( aLangList[3] ) ); #endif - sal_Int32 nCount = sizeof(aLangList) / sizeof(aLangList[0]); - for (sal_Int32 i = 0; i < nCount; i++) + sal_Int32 nCount = SAL_N_ELEMENTS(aLangList); + for (sal_Int32 i = 0; i < nCount; i++) { sal_Int16 nTmpLang = aLangList[i]; if (nTmpLang != LANGUAGE_NONE && nTmpLang != LANGUAGE_DONTKNOW) @@ -223,7 +221,7 @@ void SwSpellPopup::fillLangPopupMenu( return; SvtLanguageTable aLanguageTable; - + // set of languages to be displayed in the sub menus std::set< OUString > aLangItems; @@ -307,7 +305,7 @@ void SwSpellPopup::fillLangPopupMenu( aEntryTxt != sAsterix && aEntryTxt != sEmpty) { - DBG_ASSERT( nLangItemIdStart <= nItemId && nItemId <= nLangItemIdStart + MN_MAX_NUM_LANG, + OSL_ENSURE( nLangItemIdStart <= nItemId && nItemId <= nLangItemIdStart + MN_MAX_NUM_LANG, "nItemId outside of expected range!" ); pPopupMenu->InsertItem( nItemId, aEntryTxt, MIB_RADIOCHECK ); if (aEntryTxt == aCurLang) @@ -331,9 +329,8 @@ static Image lcl_GetImageFromPngUrl( const OUString &rFileUrl ) Image aRes; OUString aTmp; osl::FileBase::getSystemPathFromFileURL( rFileUrl, aTmp ); -// ::rtl::OString aPath = OString( aTmp.getStr(), aTmp.getLength(), osl_getThreadTextEncoding() ); #if defined(WNT) -// aTmp = lcl_Win_GetShortPathName( aTmp ); + #endif Graphic aGraphic; const String aFilterName( RTL_CONSTASCII_USTRINGPARAM( IMP_PNG ) ); @@ -352,7 +349,7 @@ OUString RetrieveLabelFromCommand( const OUString& aCmdURL ) { try { - uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()->createInstance( OUString::createFromAscii("com.sun.star.frame.UICommandDescription") ), uno::UNO_QUERY ); + uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.UICommandDescription")) ), uno::UNO_QUERY ); if ( xNameAccess.is() ) { uno::Reference< container::XNameAccess > xUICommandLabels; @@ -367,7 +364,7 @@ OUString RetrieveLabelFromCommand( const OUString& aCmdURL ) { for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ ) { - if ( aPropSeq[i].Name.equalsAscii( "Name" )) + if ( aPropSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Name" ) ) ) { aPropSeq[i].Value >>= aStr; break; @@ -389,15 +386,14 @@ OUString RetrieveLabelFromCommand( const OUString& aCmdURL ) SwSpellPopup::SwSpellPopup( SwWrtShell* pWrtSh, const uno::Reference< linguistic2::XSpellAlternatives > &xAlt, - const String &rParaText ) : -PopupMenu( SW_RES(MN_SPELL_POPUP) ), -pSh( pWrtSh ), -xSpellAlt(xAlt), -bGrammarResults(false) + const String &rParaText +) : PopupMenu( SW_RES(MN_SPELL_POPUP) ) + , pSh( pWrtSh ) + , xSpellAlt(xAlt) + , bGrammarResults(false) { - DBG_ASSERT(xSpellAlt.is(), "no spelling alternatives available"); + OSL_ENSURE(xSpellAlt.is(), "no spelling alternatives available"); -// CreateAutoMnemonics(); SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS); nCheckedLanguage = LANGUAGE_NONE; @@ -409,7 +405,6 @@ bGrammarResults(false) sal_Int16 nStringCount = static_cast< sal_Int16 >( aSuggestions.getLength() ); SvtLinguConfig aCfg; - const bool bHC = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); PopupMenu *pMenu = GetPopupMenu(MN_AUTOCORR); pMenu->SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS); @@ -421,7 +416,7 @@ bGrammarResults(false) uno::Reference< container::XNamed > xNamed( xSpellAlt, uno::UNO_QUERY ); if (xNamed.is()) { - aSuggestionImageUrl = aCfg.GetSpellAndGrammarContextSuggestionImage( xNamed->getName(), bHC ); + aSuggestionImageUrl = aCfg.GetSpellAndGrammarContextSuggestionImage( xNamed->getName() ); aImage = Image( lcl_GetImageFromPngUrl( aSuggestionImageUrl ) ); } @@ -439,7 +434,7 @@ bGrammarResults(false) pMenu->InsertItem( nAutoCorrItemId, aEntry ); pMenu->SetHelpId( nAutoCorrItemId, HID_LINGU_AUTOCORR); - + ++nAutoCorrItemId; ++nItemId; } @@ -472,7 +467,6 @@ bGrammarResults(false) } pMenu = GetPopupMenu(MN_ADD_TO_DIC); -// pMenu->CreateAutoMnemonics(); pMenu->SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS); //! necessary to retrieve the correct dictionary name in 'Execute' below bEnable = sal_False; // enable MN_ADD_TO_DIC? uno::Reference< linguistic2::XDictionaryList > xDicList( SvxGetDictionaryList() ); @@ -512,7 +506,7 @@ bGrammarResults(false) if (xSvcInfo.is()) { OUString aDictionaryImageUrl( aCfg.GetSpellAndGrammarContextDictionaryImage( - xSvcInfo->getImplementationName(), bHC) ); + xSvcInfo->getImplementationName() ) ); if (aDictionaryImageUrl.getLength() > 0) { Image aImage( lcl_GetImageFromPngUrl( aDictionaryImageUrl ) ); @@ -560,19 +554,14 @@ bGrammarResults(false) pMenu = GetPopupMenu(MN_SET_LANGUAGE_PARAGRAPH); fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_PARAGRAPH_START, aSeq, pWrtSh, aLangTable_Paragraph ); EnableItem( MN_SET_LANGUAGE_PARAGRAPH, true ); -/* - pMenu = GetPopupMenu(MN_SET_LANGUAGE_ALL_TEXT); - fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_ALL_TEXT_START, aSeq, pWrtSh, aLangTable_Document ); - EnableItem( MN_SET_LANGUAGE_ALL_TEXT, true ); -*/ + uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(); Image rImg = ::GetImage( xFrame, - OUString::createFromAscii(".uno:SpellingAndGrammarDialog"), sal_False, - Application::GetSettings().GetStyleSettings().GetHighContrastMode() ); + OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:SpellingAndGrammarDialog")), sal_False ); SetItemImage( MN_SPELLING_DLG, rImg ); ////////////////////////////////////////////////////////////////////////////////// - + RemoveDisabledEntries( sal_True, sal_True ); } @@ -600,7 +589,6 @@ aInfo16( SW_RES(IMG_INFO_16) ) InsertItem( MN_SHORT_COMMENT, aMessageText, MIB_NOSELECT, nPos++ ); SetItemImage( MN_SHORT_COMMENT, aInfo16 ); -// CreateAutoMnemonics(); SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS); InsertSeparator( nPos++ ); @@ -644,7 +632,6 @@ aInfo16( SW_RES(IMG_INFO_16) ) nGuessLangPara = LANGUAGE_NONE; if (xLG.is()) { -// nGuessLangWord = lcl_CheckLanguage( xSpellAlt->getWord(), ::GetSpellChecker(), xLG, sal_False ); nGuessLangPara = lcl_CheckLanguage( rParaText, ::GetSpellChecker(), xLG, sal_True ); } if (nGuessLangWord != LANGUAGE_NONE || nGuessLangPara != LANGUAGE_NONE) @@ -693,15 +680,10 @@ aInfo16( SW_RES(IMG_INFO_16) ) pMenu = GetPopupMenu(MN_SET_LANGUAGE_PARAGRAPH); fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_PARAGRAPH_START, aSeq, pWrtSh, aLangTable_Paragraph ); EnableItem( MN_SET_LANGUAGE_PARAGRAPH, true ); -/* - pMenu = GetPopupMenu(MN_SET_LANGUAGE_ALL_TEXT); - fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_ALL_TEXT_START, aSeq, pWrtSh, aLangTable_Document ); - EnableItem( MN_SET_LANGUAGE_ALL_TEXT, true ); -*/ + uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(); Image rImg = ::GetImage( xFrame, - OUString::createFromAscii(".uno:SpellingAndGrammarDialog"), sal_False, - Application::GetSettings().GetStyleSettings().GetHighContrastMode() ); + OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:SpellingAndGrammarDialog")), sal_False ); SetItemImage( MN_SPELLING_DLG, rImg ); ////////////////////////////////////////////////////////////////////////////////// @@ -714,14 +696,11 @@ aInfo16( SW_RES(IMG_INFO_16) ) ---------------------------------------------------------------------------*/ sal_uInt16 SwSpellPopup::Execute( const Rectangle& rWordPos, Window* pWin ) { -// SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS); sal_uInt16 nRet = PopupMenu::Execute(pWin, pWin->LogicToPixel(rWordPos)); Execute( nRet ); return nRet; } -/*-- 19.01.2006 08:15:48--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSpellPopup::Execute( sal_uInt16 nId ) { if (nId == USHRT_MAX) @@ -735,7 +714,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId ) { sal_Int32 nAltIdx = (MN_SUGGESTION_START <= nId && nId <= MN_SUGGESTION_END) ? nId - MN_SUGGESTION_START : nId - MN_AUTOCORR_START; - DBG_ASSERT( 0 <= nAltIdx && nAltIdx < aSuggestions.getLength(), "index out of range" ); + OSL_ENSURE( 0 <= nAltIdx && nAltIdx < aSuggestions.getLength(), "index out of range" ); if (0 <= nAltIdx && nAltIdx < aSuggestions.getLength() && (bGrammarResults || xSpellAlt.is())) { sal_Bool bOldIns = pSh->IsInsMode(); @@ -769,7 +748,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId ) pSh->DelLeft(); pSh->Insert( aTmp ); - + /* #102505# EndAction/EndUndo moved down since insertion of temporary auto correction is now undoable two and must reside in the same undo group.*/ @@ -806,23 +785,23 @@ void SwSpellPopup::Execute( sal_uInt16 nId ) pSh->GetView().GetViewFrame()->GetDispatcher()-> Execute( FN_SPELL_GRAMMAR_DIALOG, SFX_CALLMODE_ASYNCHRON ); } - } + } else if (nId == MN_IGNORE_SELECTION) { SwPaM *pPaM = pSh->GetCrsr(); if (pPaM) pSh->IgnoreGrammarErrorAt( *pPaM ); - } + } else if (nId == MN_IGNORE_WORD) { uno::Reference< linguistic2::XDictionary > xDictionary( SvxGetIgnoreAllList(), uno::UNO_QUERY ); linguistic::AddEntryToDic( xDictionary, xSpellAlt->getWord(), sal_False, aEmptyStr, LANGUAGE_NONE ); - } + } else if (MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END) { OUString aWord( xSpellAlt->getWord() ); - + PopupMenu *pMenu = GetPopupMenu(MN_ADD_TO_DIC); String aDicName ( pMenu->GetItemText(nId) ); @@ -847,18 +826,18 @@ void SwSpellPopup::Execute( sal_uInt16 nId ) nAddRes ); } } - } - else + } + else { // Set language for selection or for paragraph... - + SfxItemSet aCoreSet( pSh->GetView().GetPool(), RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE, 0 ); String aNewLangTxt; - + if (MN_SET_LANGUAGE_SELECTION_START <= nId && nId <= MN_SET_LANGUAGE_SELECTION_END) { //Set language for current selection @@ -913,25 +892,9 @@ void SwSpellPopup::Execute( sal_uInt16 nId ) lcl_CharDialog( *pSh, true, nId, 0, 0 ); pSh->Pop( sal_False ); // restore cursor } -#if 0 - else if (nId == MN_SET_LANGUAGE_ALL_TEXT_START + nNumLanguageDocEntries - 1) - { - //Set Language_None as the default language - SwLangHelper::SetLanguage_None( *pSh, false, aCoreSet ); - } - else if (nId == MN_SET_LANGUAGE_ALL_TEXT_START + nNumLanguageDocEntries) - { - // open the dialog "Tools/Options/Language Settings - Language" - SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - if (pFact) - { - VclAbstractDialog* pDlg = pFact->CreateVclDialog( pSh->GetView().GetWindow(), SID_LANGUAGE_OPTIONS ); - pDlg->Execute(); - delete pDlg; - } - } -#endif - } + } pSh->EnterStdMode(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/lingu/sdrhhcwrap.cxx b/sw/source/ui/lingu/sdrhhcwrap.cxx index 1173774d5f..20619827b9 100644 --- a/sw/source/ui/lingu/sdrhhcwrap.cxx +++ b/sw/source/ui/lingu/sdrhhcwrap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,13 +45,9 @@ #include <unotools/localedatawrapper.hxx> #include <sdrhhcwrap.hxx> #include <frmfmt.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> // " " " -#endif #include <wrtsh.hxx> // MakeVisible -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <dcontact.hxx> // Spelling von DrawObj #include <doc.hxx> // " " " #include <docary.hxx> @@ -109,13 +106,10 @@ SdrHHCWrapper::~SdrHHCWrapper() if (pTextObj) { SdrView *pSdrView = pView->GetWrtShell().GetDrawView(); - ASSERT( pSdrView, "SdrHHCWrapper without DrawView?" ); + OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" ); pSdrView->SdrEndTextEdit( sal_True ); SetUpdateMode(sal_False); pOutlView->SetOutputArea( Rectangle( Point(), Size(1, 1) ) ); -// SetPaperSize( Size(1, 1) ); -// SetText(NULL); -// pTextObj = NULL; } RemoveView( pOutlView ); delete pOutlView; @@ -135,7 +129,7 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument() if ( pTextObj ) { SdrView *pSdrView = pView->GetWrtShell().GetDrawView(); - ASSERT( pSdrView, "SdrHHCWrapper without DrawView?" ); + OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" ); pSdrView->SdrEndTextEdit( sal_True ); SetUpdateMode(sal_False); pOutlView->SetOutputArea( Rectangle( Point(), Size(1, 1) ) ); @@ -207,7 +201,7 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument() if (HasConvertibleTextPortion( nSourceLang )) { SdrView *pSdrView = pView->GetWrtShell().GetDrawView(); - ASSERT( pSdrView, "SdrHHCWrapper without DrawView?" ); + OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" ); SdrPageView* pPV = pSdrView->GetSdrPageView(); nDocIndex = n; bNextDoc = sal_True; @@ -233,3 +227,4 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument() ////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/lingu/sdrhhcwrap.hxx b/sw/source/ui/lingu/sdrhhcwrap.hxx index 197587e916..0803ba0eb3 100644 --- a/sw/source/ui/lingu/sdrhhcwrap.hxx +++ b/sw/source/ui/lingu/sdrhhcwrap.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,3 +68,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index cce6dfe5b8..49d2c40eaa 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,10 +48,8 @@ #include "bookmark.hrc" #include "misc.hrc" - const String BookmarkCombo::aForbiddenChars = String::CreateFromAscii("/\\@:*?\";,.#"); - IMPL_LINK( SwInsertBookmarkDlg, ModifyHdl, BookmarkCombo *, pBox ) { sal_Bool bSelEntries = pBox->GetSelectEntryCount() != 0; @@ -88,7 +87,6 @@ IMPL_LINK( SwInsertBookmarkDlg, ModifyHdl, BookmarkCombo *, pBox ) /*------------------------------------------------------------------------ Beschreibung: Callback zum Loeschen einer Textmarke -----------------------------------------------------------------------*/ - IMPL_LINK( SwInsertBookmarkDlg, DeleteHdl, Button *, EMPTYARG ) { // Textmarken aus der ComboBox entfernen @@ -98,7 +96,6 @@ IMPL_LINK( SwInsertBookmarkDlg, DeleteHdl, Button *, EMPTYARG ) aBookmarkBox.SetText(aEmptyStr); aDeleteBtn.Enable(sal_False); // keine weiteren Eintraege vorhanden - // aBookmarkBox.SetText(aEmptyStr); aOkBtn.Enable(); // Im OK Handler wird geloescht return 0; @@ -109,8 +106,6 @@ IMPL_LINK( SwInsertBookmarkDlg, DeleteHdl, Button *, EMPTYARG ) an die akt. Position ein. Geloeschte Textmarken werden auch am Modell entfernt. -----------------------------------------------------------------------*/ - - void SwInsertBookmarkDlg::Apply() { //at first remove deleted bookmarks to prevent multiple bookmarks with the same @@ -147,8 +142,6 @@ void SwInsertBookmarkDlg::Apply() /*------------------------------------------------------------------------ Beschreibung: CTOR -----------------------------------------------------------------------*/ - - SwInsertBookmarkDlg::SwInsertBookmarkDlg( Window *pParent, SwWrtShell &rS, SfxRequest& rRequest ) : SvxStandardDialog(pParent,SW_RES(DLG_INSERT_BOOKMARK)), @@ -180,45 +173,25 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg( Window *pParent, SwWrtShell &rS, SfxRe sRemoveWarning = String(SW_RES(STR_REMOVE_WARNING)); } -/*------------------------------------------------------------------------ - Beschreibung: - -----------------------------------------------------------------------*/ - SwInsertBookmarkDlg::~SwInsertBookmarkDlg() { } -/*------------------------------------------------------------------------ - Beschreibung: - -----------------------------------------------------------------------*/ - BookmarkCombo::BookmarkCombo( Window* pWin, const ResId& rResId ) : SwComboBox(pWin, rResId) { } -/*------------------------------------------------------------------------ - Beschreibung: - -----------------------------------------------------------------------*/ - sal_uInt16 BookmarkCombo::GetFirstSelEntryPos() const { return GetSelEntryPos(0); } -/*------------------------------------------------------------------------ - Beschreibung: - -----------------------------------------------------------------------*/ - sal_uInt16 BookmarkCombo::GetNextSelEntryPos(sal_uInt16 nPos) const { return GetSelEntryPos(nPos + 1); } -/*------------------------------------------------------------------------ - Beschreibung: - -----------------------------------------------------------------------*/ - sal_uInt16 BookmarkCombo::GetSelEntryPos(sal_uInt16 nPos) const { sal_Unicode cSep = GetMultiSelectionSeparator(); @@ -237,10 +210,6 @@ sal_uInt16 BookmarkCombo::GetSelEntryPos(sal_uInt16 nPos) const return COMBOBOX_ENTRY_NOTFOUND; } -/*------------------------------------------------------------------------ - Beschreibung: - -----------------------------------------------------------------------*/ - sal_uInt16 BookmarkCombo::GetSelectEntryCount() const { sal_uInt16 nCnt = 0; @@ -258,7 +227,6 @@ sal_uInt16 BookmarkCombo::GetSelectEntryCount() const /*------------------------------------------------------------------------ Beschreibung: Position in der Listbox (der ComboBox) -----------------------------------------------------------------------*/ - sal_uInt16 BookmarkCombo::GetSelectEntryPos( sal_uInt16 nSelIndex ) const { sal_uInt16 nCnt = 0; @@ -281,9 +249,7 @@ sal_uInt16 BookmarkCombo::GetSelectEntryPos( sal_uInt16 nSelIndex ) const return COMBOBOX_ENTRY_NOTFOUND; } -/* -----------------05.02.99 08:39------------------- - * - * --------------------------------------------------*/ + long BookmarkCombo::PreNotify( NotifyEvent& rNEvt ) { long nHandled = 0; @@ -299,5 +265,4 @@ long BookmarkCombo::PreNotify( NotifyEvent& rNEvt ) return nHandled; } - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/bookmark.src b/sw/source/ui/misc/bookmark.src index 39529dd67c..bdf00f0636 100644 --- a/sw/source/ui/misc/bookmark.src +++ b/sw/source/ui/misc/bookmark.src @@ -34,7 +34,6 @@ ModalDialog DLG_INSERT_BOOKMARK HelpID = CMD_FN_INSERT_BOOKMARK ; OUTPUTSIZE = TRUE ; Size = MAP_APPFONT ( 179 , 96 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Textmarke einf�gen : Textmarke einf�gen */ Text [ en-US ] = "Insert Bookmark" ; MOVEABLE = TRUE ; SVLOOK = TRUE ; @@ -66,7 +65,6 @@ ModalDialog DLG_INSERT_BOOKMARK HelpID = "sw:PushButton:DLG_INSERT_BOOKMARK:BT_DELETE"; Pos = MAP_APPFONT ( 123 , 40 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; - /* ### ACHTUNG: Neuer Text in Resource? ~L�schen : ~L�schen */ Text [ en-US ] = "~Delete" ; TABSTOP = TRUE ; DISABLE = TRUE ; diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index b188f87406..68bd819576 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,14 +35,9 @@ #include <svl/style.hxx> -#include <errhdl.hxx> #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <docfnote.hxx> #include <impfnote.hxx> #include <ftninfo.hxx> @@ -53,18 +49,10 @@ #include <uitool.hxx> #include <poolfmt.hxx> #include <swstyle.h> -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _MISC_HRC #include <misc.hrc> -#endif -#ifndef _DOCFNOTE_HRC #include <docfnote.hrc> -#endif -#ifndef _FRMUI_HRC #include <frmui.hrc> -#endif #include <SwStyleNameMapper.hxx> SwFootNoteOptionDlg::SwFootNoteOptionDlg( Window *pParent, SwWrtShell &rS ) : @@ -203,7 +191,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& ) aPageTemplLbl.Enable(sal_False); aPageTemplBox.Enable(sal_False); } - else // if ( rInf.ePos == FTNPOS_CHAPTER ) + else { aPosChapterBox.Check(); aNumCountBox.RemoveEntry(aNumPage); @@ -256,7 +244,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& ) aParaTemplBox.SelectEntry( sStr ); // Default else { - ASSERT(!pColl->IsDefault(), "Defaultvorlage fuer Fussnoten ist falsch."); + OSL_ENSURE(!pColl->IsDefault(), "default style for footnotes is wrong"); const sal_uInt16 nPos = aParaTemplBox.GetEntryPos(pColl->GetName()); if( LISTBOX_ENTRY_NOTFOUND != nPos ) aParaTemplBox.SelectEntryPos( nPos ); @@ -312,9 +300,9 @@ void SwEndNoteOptionPage::SelectNumbering(int eNum) case FTNNUM_CHAPTER: sSelect = aNumChapter; break; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 default: - DBG_ERROR("Which numbering type?"); + OSL_ENSURE(false, "Which numbering type?"); #endif } aNumCountBox.SelectEntry(sSelect); @@ -329,9 +317,6 @@ int SwEndNoteOptionPage::GetNumbering() const return (int) bPosDoc? nPos + 1: nPos; } -/*-----------------09.02.98 11:17------------------- - ---------------------------------------------------*/ void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell ) { pSh = &rShell; @@ -369,11 +354,6 @@ IMPL_LINK( SwEndNoteOptionPage, PosPageHdl, Button *, EMPTYARG ) return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - IMPL_LINK( SwEndNoteOptionPage, NumCountHdl, ListBox*, EMPTYARG ) { sal_Bool bEnable = sal_True; @@ -454,7 +434,7 @@ sal_Bool SwEndNoteOptionPage::FillItemSet( SfxItemSet & ) { const String aFmtName( aParaTemplBox.GetSelectEntry() ); SwTxtFmtColl *pColl = pSh->GetParaStyle(aFmtName, SwWrtShell::GETSTYLE_CREATEANY); - ASSERT(pColl, "Absatzvorlage nicht gefunden."); + OSL_ENSURE(pColl, "paragraph style not found"); pInf->SetFtnTxtColl(*pColl); } @@ -501,3 +481,4 @@ SfxTabPage *SwFootNoteOptionPage::Create(Window *pParent, const SfxItemSet &rSet +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/docfnote.src b/sw/source/ui/misc/docfnote.src index bc983676d7..606c76f2e0 100644 --- a/sw/source/ui/misc/docfnote.src +++ b/sw/source/ui/misc/docfnote.src @@ -523,7 +523,6 @@ TabPage TP_ENDNOTEOPTION { Pos = MAP_APPFONT ( 80 , 91 ) ; Size = MAP_APPFONT ( 174 , 8 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Hinweistext mehrseitige Fu�noten : Hinweistext mehrseitige Fu�noten */ Text [ en-US ] = "Continuation notice" ; }; FixedText FT_CONT diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index 750ebe2543..7ebec767ed 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,9 +37,7 @@ #define _SVSTDARR_STRINGS #include <tools/urlobj.hxx> #include <tools/stream.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <vcl/help.hxx> #include <unotools/transliterationwrapper.hxx> #include <unotools/tempfile.hxx> @@ -53,15 +52,9 @@ #include <glosdoc.hxx> #include <swunohelper.hxx> -#ifndef _GLOSBIB_HRC #include <glosbib.hrc> -#endif -#ifndef _MISC_HRC #include <misc.hrc> -#endif -#ifndef _HELPID_H #include <helpid.h> -#endif #define PATH_CASE_SENSITIVE 0x01 @@ -69,9 +62,6 @@ #define RENAME_TOKEN_DELIM (sal_Unicode)1 -/*-----------------09.06.97 13:05------------------- - ---------------------------------------------------*/ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent, const SvStrings* pPathArr, SwGlossaryHdl *pHdl) : @@ -143,7 +133,6 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent, pData->sGroupName = sGroup; pData->sGroupTitle = sTitle; String sTemp(sTitle); - //sGroup.GetToken(0, GLOS_DELIM) sTemp += '\t'; pData->sPath = aPathLB.GetEntry((sal_uInt16)sGroup.GetToken(1, GLOS_DELIM).ToInt32()); sTemp += pData->sPath; @@ -154,9 +143,6 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent, aGroupTLB.GetModel()->Resort(); } -/*-----------------09.06.97 13:05------------------- - ---------------------------------------------------*/ SwGlossaryGroupDlg::~SwGlossaryGroupDlg() { @@ -178,11 +164,7 @@ SwGlossaryGroupDlg::~SwGlossaryGroupDlg() } -/*-----------------09.06.97 13:11------------------- - ---------------------------------------------------*/ - -void __EXPORT SwGlossaryGroupDlg::Apply() +void SwGlossaryGroupDlg::Apply() { if(aNewPB.IsEnabled()) NewHdl(&aNewPB); @@ -252,9 +234,7 @@ void __EXPORT SwGlossaryGroupDlg::Apply() } } } -/*-----------------09.06.97 13:12------------------- ---------------------------------------------------*/ IMPL_LINK( SwGlossaryGroupDlg, SelectHdl, SvTabListBox*, EMPTYARG ) { aNewPB.Enable(sal_False); @@ -280,21 +260,16 @@ IMPL_LINK( SwGlossaryGroupDlg, SelectHdl, SvTabListBox*, EMPTYARG ) return 0; } -/*-----------------09.06.97 13:22------------------- - ---------------------------------------------------*/ IMPL_LINK( SwGlossaryGroupDlg, NewHdl, Button*, EMPTYARG ) { String sGroup(aNameED.GetText()); -// sGroup.ToLower(); sGroup += GLOS_DELIM; sGroup += String::CreateFromInt32(aPathLB.GetSelectEntryPos()); - DBG_ASSERT(!pGlosHdl->FindGroupName(sGroup), "Gruppe bereits vorhanden!"); + OSL_ENSURE(!pGlosHdl->FindGroupName(sGroup), "group already available!"); if(!pInsertedArr) pInsertedArr = new SvStrings; pInsertedArr->Insert(new String(sGroup), pInsertedArr->Count()); String sTemp(aNameED.GetText()); -// sTemp.ToLower(); sTemp += '\t'; sTemp += aPathLB.GetSelectEntry(); SvLBoxEntry* pEntry = aGroupTLB.InsertEntry(sTemp); @@ -309,9 +284,7 @@ IMPL_LINK( SwGlossaryGroupDlg, NewHdl, Button*, EMPTYARG ) return 0; } -/*-----------------09.06.97 13:22------------------- ---------------------------------------------------*/ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton ) { SvLBoxEntry* pEntry = aGroupTLB.FirstSelected(); @@ -377,9 +350,6 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton ) return 0; } -/* -----------------23.11.98 12:26------------------- - * - * --------------------------------------------------*/ IMPL_LINK( SwGlossaryGroupDlg, RenameHdl, Button *, EMPTYARG ) { SvLBoxEntry* pEntry = aGroupTLB.FirstSelected(); @@ -392,7 +362,7 @@ IMPL_LINK( SwGlossaryGroupDlg, RenameHdl, Button *, EMPTYARG ) sNewName += GLOS_DELIM; sNewName += String::CreateFromInt32(aPathLB.GetSelectEntryPos()); - DBG_ASSERT(!pGlosHdl->FindGroupName(sNewName), "Gruppe bereits vorhanden!"); + OSL_ENSURE(!pGlosHdl->FindGroupName(sNewName), "group already available!"); // befindet sich der umzubenennende Name unter den // den neuen - dann austauschen @@ -425,7 +395,6 @@ IMPL_LINK( SwGlossaryGroupDlg, RenameHdl, Button *, EMPTYARG ) delete (GlosBibUserData*)pEntry->GetUserData(); aGroupTLB.GetModel()->Remove(pEntry); String sTemp(aNameED.GetText()); -// sTemp.ToLower(); sTemp += '\t'; sTemp += aPathLB.GetSelectEntry(); pEntry = aGroupTLB.InsertEntry(sTemp); @@ -439,13 +408,10 @@ IMPL_LINK( SwGlossaryGroupDlg, RenameHdl, Button *, EMPTYARG ) aGroupTLB.GetModel()->Resort(); return 0; } -/*-----------------09.06.97 13:42------------------- ---------------------------------------------------*/ IMPL_LINK( SwGlossaryGroupDlg, ModifyHdl, Edit*, EMPTYARG ) { String sEntry(aNameED.GetText()); -// sEntry.ToLower(); sal_Bool bEnableNew = sal_True; sal_Bool bEnableDel = sal_False; sal_uLong nCaseReadonly = @@ -490,11 +456,6 @@ IMPL_LINK( SwGlossaryGroupDlg, ModifyHdl, Edit*, EMPTYARG ) { GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData(); bEnableDel = IsDeleteAllowed(pUserData->sGroupName); - -// String sGroup = aGroupTLB.GetEntryText(pEntry, 0); -// sGroup += GLOS_DELIM; -// sGroup += String::CreateFromInt32(aPathLB.GetEntryPos(aGroupTLB.GetEntryText(pEntry, 1))); -// bEnableDel = IsDeleteAllowed(sGroup); } aDelPB.Enable(bEnableDel); @@ -503,10 +464,6 @@ IMPL_LINK( SwGlossaryGroupDlg, ModifyHdl, Edit*, EMPTYARG ) return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - sal_Bool SwGlossaryGroupDlg::IsDeleteAllowed(const String &rGroup) { sal_Bool bDel = (!pGlosHdl->IsReadOnly(&rGroup)); @@ -532,9 +489,6 @@ sal_Bool SwGlossaryGroupDlg::IsDeleteAllowed(const String &rGroup) return bDel; } -/*-----------------18.07.97 19:06------------------- - ---------------------------------------------------*/ void FEdit::KeyInput( const KeyEvent& rKEvent ) { KeyCode aCode = rKEvent.GetKeyCode(); @@ -544,9 +498,7 @@ void FEdit::KeyInput( const KeyEvent& rKEvent ) SVT_SEARCHPATH_DELIMITER != rKEvent.GetCharCode() ) Edit::KeyInput( rKEvent ); } -/* -----------------------------08.02.00 15:07-------------------------------- - ---------------------------------------------------------------------------*/ void SwGlossaryGroupTLB::RequestHelp( const HelpEvent& rHEvt ) { Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() )); @@ -577,3 +529,5 @@ void SwGlossaryGroupTLB::RequestHelp( const HelpEvent& rHEvt ) } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/glosbib.src b/sw/source/ui/misc/glosbib.src index 9bd9489977..011bfce073 100644 --- a/sw/source/ui/misc/glosbib.src +++ b/sw/source/ui/misc/glosbib.src @@ -50,7 +50,6 @@ ModalDialog DLG_BIB_BASE HelpID = "sw:PushButton:DLG_BIB_BASE:PB_DELETE"; Pos = MAP_APPFONT ( 293 , 83 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; - /* ### ACHTUNG: Neuer Text in Resource? ~L�schen : ~L�schen */ Text [ en-US ] = "~Delete" ; TabStop = TRUE ; Disable = TRUE ; diff --git a/sw/source/ui/misc/glosdoc.cxx b/sw/source/ui/misc/glosdoc.cxx index 0482a4c0da..d06234ddb3 100644 --- a/sw/source/ui/misc/glosdoc.cxx +++ b/sw/source/ui/misc/glosdoc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,15 +41,12 @@ #ifndef __RSC //autogen #include <tools/errinf.hxx> #endif -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <svl/urihelper.hxx> -#ifndef SVTOOLS_FSTATHELPER_HXX #include <svl/fstathelper.hxx> -#endif #include <unotools/pathoptions.hxx> #include <unotools/tempfile.hxx> #include <swtypes.hxx> -#include <errhdl.hxx> // ASSERT #include <uitool.hxx> #include <glosdoc.hxx> #include <shellio.hxx> @@ -56,18 +54,12 @@ #include <unoatxt.hxx> #include <swerror.h> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif using namespace ::com::sun::star; using namespace ::com::sun::star::uno; - // PUBLIC METHODES ------------------------------------------------------- -/* -----------------------------08.02.00 15:54-------------------------------- - - ---------------------------------------------------------------------------*/ String lcl_CheckFileName( const String& rNewFilePath, const String& rNewGroupName ) { @@ -111,25 +103,24 @@ String lcl_CheckFileName( const String& rNewFilePath, } return sRet; } + /*------------------------------------------------------------------------ Beschreibung: Liefert den Namen der Default-Gruppe ------------------------------------------------------------------------*/ - - String SwGlossaries::GetDefName() { return String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "standard" )); } + /*------------------------------------------------------------------------ Beschreibung: Liefert die Anzahl der Textbausteingruppen ------------------------------------------------------------------------*/ - - sal_uInt16 SwGlossaries::GetGroupCnt() { return GetNameList()->Count(); } + /*------------------------------------------------------------------------ Beschreibung: Liefert den Gruppennamen ------------------------------------------------------------------------*/ @@ -165,18 +156,13 @@ sal_Bool SwGlossaries::FindGroupName(String & rGroup) } return sal_False; } -/* --------------------------------------------------------------------------- - - ---------------------------------------------------------------------------*/ String SwGlossaries::GetGroupName(sal_uInt16 nGroupId) { - ASSERT(nGroupId < m_pGlosArr->Count(), Textbausteinarray ueberindiziert); + OSL_ENSURE(nGroupId < m_pGlosArr->Count(), "Textbausteinarray ueberindiziert"); return *(*m_pGlosArr)[nGroupId]; } -/* -----------------------------08.02.00 13:04-------------------------------- - ---------------------------------------------------------------------------*/ String SwGlossaries::GetGroupTitle( const String& rGroupName ) { String sRet; @@ -195,7 +181,6 @@ String SwGlossaries::GetGroupTitle( const String& rGroupName ) /*------------------------------------------------------------------------ Beschreibung: Liefert das Textbaustein-Dokument der Gruppe rName ------------------------------------------------------------------------*/ - SwTextBlocks* SwGlossaries::GetGroupDoc(const String &rName, sal_Bool bCreate) const { @@ -224,17 +209,15 @@ SwTextBlocks* SwGlossaries::GetGroupDoc(const String &rName, /*------------------------------------------------------------------------ Beschreibung: Loeschen Textblock ------------------------------------------------------------------------*/ - void SwGlossaries::PutGroupDoc(SwTextBlocks *pBlock) { delete pBlock; } + /*------------------------------------------------------------------------ Beschreibung: Erzeugt ein neues Dokument mit dem Gruppenname Wird temp. auch als File angelegt, damit die Gruppen auch spaeter (ohne Zugriff) vorhanden sind. ------------------------------------------------------------------------*/ - - sal_Bool SwGlossaries::NewGroupDoc(String& rGroupName, const String& rTitle) { sal_uInt16 nNewPath = (sal_uInt16)rGroupName.GetToken(1, GLOS_DELIM).ToInt32(); @@ -256,9 +239,7 @@ sal_Bool SwGlossaries::NewGroupDoc(String& rGroupName, const String& rTitle) } return sal_False; } -/* -----------------23.11.98 13:13------------------- - * - * --------------------------------------------------*/ + sal_Bool SwGlossaries::RenameGroupDoc( const String& rOldGroup, String& rNewGroup, const String& rNewTitle ) { @@ -271,7 +252,7 @@ sal_Bool SwGlossaries::RenameGroupDoc( sOldFileURL += rOldGroup.GetToken(0, GLOS_DELIM); sOldFileURL += SwGlossaries::GetExtension(); sal_Bool bExist = FStatHelper::IsDocument( sOldFileURL ); - DBG_ASSERT(bExist, "Gruppe existiert nicht!"); + OSL_ENSURE(bExist, "group doesn't exist!"); if(bExist) { sal_uInt16 nNewPath = (sal_uInt16)rNewGroup.GetToken(1, GLOS_DELIM).ToInt32(); @@ -280,14 +261,13 @@ sal_Bool SwGlossaries::RenameGroupDoc( String sNewFilePath(*(*m_pPathArr)[nNewPath]); String sNewFileName = lcl_CheckFileName( sNewFilePath, rNewGroup.GetToken(0, GLOS_DELIM)); - //String aTmp( rNewGroup.GetToken(0, GLOS_DELIM)); const sal_uInt16 nFileNameLen = sNewFileName.Len(); sNewFileName += SwGlossaries::GetExtension(); String sTempNewFilePath(sNewFilePath); sTempNewFilePath += INET_PATH_TOKEN; sTempNewFilePath += sNewFileName ; bExist = FStatHelper::IsDocument( sTempNewFilePath ); - DBG_ASSERT(!bExist, "Gruppe existiert bereits!"); + OSL_ENSURE(!bExist, "group already exists!"); if(!bExist) { sal_Bool bCopyCompleted = SWUnoHelper::UCB_CopyFile( @@ -322,8 +302,6 @@ sal_Bool SwGlossaries::RenameGroupDoc( /*------------------------------------------------------------------------ Beschreibung: Loescht eine Textbausteingruppe ------------------------------------------------------------------------*/ - - sal_Bool SwGlossaries::DelGroupDoc(const String &rName) { sal_uInt16 nPath = (sal_uInt16)rName.GetToken(1, GLOS_DELIM).ToInt32(); @@ -342,15 +320,14 @@ sal_Bool SwGlossaries::DelGroupDoc(const String &rName) // der Textbausteinbereiche entfernt werden // Kein && wegen CFfront sal_Bool bRemoved = SWUnoHelper::UCB_DeleteFile( sFileURL ); - DBG_ASSERT(bRemoved, "file has not been removed"); + OSL_ENSURE(bRemoved, "file has not been removed"); RemoveFileFromList( aName ); return bRemoved; } + /*------------------------------------------------------------------------ Beschreibung: DTOR ------------------------------------------------------------------------*/ - - SwGlossaries::~SwGlossaries() { sal_uInt16 nCount = m_pGlosArr? m_pGlosArr->Count() : 0; @@ -372,11 +349,10 @@ SwGlossaries::~SwGlossaries() InvalidateUNOOjects(); } + /*------------------------------------------------------------------------ Beschreibung: Bausteindokument einlesen ------------------------------------------------------------------------*/ - - SwTextBlocks* SwGlossaries::GetGlosDoc( const String &rName, sal_Bool bCreate ) const { sal_uInt16 nPath = (sal_uInt16)rName.GetToken(1, GLOS_DELIM).ToInt32(); @@ -414,7 +390,6 @@ SwTextBlocks* SwGlossaries::GetGlosDoc( const String &rName, sal_Bool bCreate ) /*------------------------------------------------------------------------ Beschreibung: Zugriff auf die Liste der Name; diese wird gfs. eingelesen ------------------------------------------------------------------------*/ - SvStrings* SwGlossaries::GetNameList() { if( !m_pGlosArr ) @@ -455,8 +430,6 @@ SvStrings* SwGlossaries::GetNameList() /*------------------------------------------------------------------------ Beschreibung: CTOR ------------------------------------------------------------------------*/ - - SwGlossaries::SwGlossaries() : m_pPathArr(0), m_pGlosArr(0) @@ -469,7 +442,7 @@ SwGlossaries::SwGlossaries() : Beschreibung: Neuen Pfad einstellen und internes Array neu aufbauen ------------------------------------------------------------------------*/ -/* -----------------21.01.99 15:36------------------- +/* -------------------------------------------------- * #61050# Doppelte Pfade fuehren zu Verwirrung - als raus damit * --------------------------------------------------*/ sal_Bool lcl_FindSameEntry(const SvStrings& rDirArr, const String& rEntryURL) @@ -548,27 +521,18 @@ void SwGlossaries::UpdateGlosPath(sal_Bool bFull) } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - void SwGlossaries::ShowError() { sal_uInt32 nPathError = *new StringErrorInfo(ERR_AUTOPATH_ERROR, m_sErrPath, ERRCODE_BUTTON_OK ); ErrorHandler::HandleError( nPathError ); } -/* -----------------------------09.02.00 11:37-------------------------------- - ---------------------------------------------------------------------------*/ String SwGlossaries::GetExtension() { return String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( ".bau" )); } - - void SwGlossaries::RemoveFileFromList( const String& rGroup ) { if(m_pGlosArr) @@ -630,7 +594,6 @@ void SwGlossaries::RemoveFileFromList( const String& rGroup ) } } - String SwGlossaries::GetCompleteGroupName( const rtl::OUString& GroupName ) { sal_uInt16 nCount = GetGroupCnt(); @@ -650,7 +613,6 @@ String SwGlossaries::GetCompleteGroupName( const rtl::OUString& GroupName ) return aEmptyStr; } - void SwGlossaries::InvalidateUNOOjects() { // invalidate all the AutoTextGroup-objects @@ -685,9 +647,6 @@ void SwGlossaries::InvalidateUNOOjects() m_aGlossaryEntries.swap( aTmpe ); } -//----------------------------------------------------------------------- -//--- 03.03.2003 14:15:32 ----------------------------------------------- - Reference< text::XAutoTextGroup > SwGlossaries::GetAutoTextGroup( const ::rtl::OUString& _rGroupName, bool _bCreate ) { // first, find the name with path-extension @@ -742,9 +701,6 @@ Reference< text::XAutoTextGroup > SwGlossaries::GetAutoTextGroup( const ::rtl::O return xGroup; } -//----------------------------------------------------------------------- -//--- 03.03.2003 13:46:06 ----------------------------------------------- - Reference< text::XAutoTextEntry > SwGlossaries::GetAutoTextEntry( const String& _rCompleteGroupName, const ::rtl::OUString& _rGroupName, const ::rtl::OUString& _rEntryName, bool _bCreate ) { @@ -802,5 +758,4 @@ Reference< text::XAutoTextEntry > SwGlossaries::GetAutoTextEntry( const String& return xReturn; } - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index c8b1457439..1e0b5acefb 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,9 +40,7 @@ #include <vcl/menu.hxx> #include <vcl/msgbox.hxx> #include <vcl/help.hxx> -#ifndef _SVSTDARR_HXX #include <svl/svstdarr.hxx> -#endif #include <svl/stritem.hxx> #include <unotools/pathoptions.hxx> #include <unotools/lingucfg.hxx> @@ -79,15 +78,9 @@ #include <cmdid.h> #include <helpid.h> #include <swerror.h> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _MISC_HRC #include <misc.hrc> -#endif -#ifndef _GLOSSARY_HRC #include <glossary.hrc> -#endif #include <swmodule.hxx> #include <sfx2/filedlghelper.hxx> @@ -129,9 +122,6 @@ String lcl_GetValidShortCut( const String& rName ) return aBuf; } -/* -----------------------------08.02.00 10:28-------------------------------- - - ---------------------------------------------------------------------------*/ struct GroupUserData { String sGroupName; @@ -204,7 +194,6 @@ SwNewGlosNameDlg::SwNewGlosNameDlg(Window* pParent, /*------------------------------------------------------------------------ Beschreibung: aktuell eingestellte Gruppe erfragen / setzen ------------------------------------------------------------------------*/ - String SwGlossaryDlg::GetCurrGroup() { if( ::GetCurrGlosGroup() && ::GetCurrGlosGroup()->Len() ) @@ -212,8 +201,6 @@ String SwGlossaryDlg::GetCurrGroup() return SwGlossaries::GetDefName(); } - - void SwGlossaryDlg::SetActGroup(const String &rGrp) { if( !::GetCurrGlosGroup() ) @@ -221,8 +208,6 @@ void SwGlossaryDlg::SetActGroup(const String &rGrp) *(::GetCurrGlosGroup()) = rGrp; } - - SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame, SwGlossaryHdl * pGlosHdl, SwWrtShell *pWrtShell) : @@ -306,10 +291,6 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame, Init(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwGlossaryDlg::~SwGlossaryDlg() { @@ -321,11 +302,10 @@ SwGlossaryDlg::~SwGlossaryDlg() delete pMenu; delete pExampleFrame; } + /*------------------------------------------------------------------------ Beschreibung: Auswahl neue Gruppe ------------------------------------------------------------------------*/ - - IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox ) { SvLBoxEntry* pEntry = pBox->FirstSelected(); @@ -368,10 +348,6 @@ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox ) } return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwGlossaryDlg::Apply() { @@ -389,16 +365,14 @@ void SwGlossaryDlg::Apply() aReq.Done(); } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ + /* inline */ void SwGlossaryDlg::EnableShortName(sal_Bool bOn) { aShortNameLbl.Enable(bOn); aShortNameEdit.Enable(bOn); } -/* -----------------26.11.98 16:15------------------- +/* -------------------------------------------------- * existiert der Titel in der ausgewaehlten Gruppe? * --------------------------------------------------*/ SvLBoxEntry* SwGlossaryDlg::DoesBlockExist(const String& rBlock, @@ -424,11 +398,6 @@ SvLBoxEntry* SwGlossaryDlg::DoesBlockExist(const String& rBlock, return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - IMPL_LINK( SwGlossaryDlg, NameModify, Edit *, pEdit ) { String aName(aNameED.GetText()); @@ -472,10 +441,6 @@ IMPL_LINK( SwGlossaryDlg, NameModify, Edit *, pEdit ) } return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK_INLINE_START( SwGlossaryDlg, NameDoubleClick, SvTreeListBox*, pBox ) { @@ -485,10 +450,6 @@ IMPL_LINK_INLINE_START( SwGlossaryDlg, NameDoubleClick, SvTreeListBox*, pBox ) return 0; } IMPL_LINK_INLINE_END( SwGlossaryDlg, NameDoubleClick, SvTreeListBox*, EMPTYARG ) -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwGlossaryDlg, EnableHdl, Menu *, pMn ) { @@ -513,10 +474,6 @@ IMPL_LINK( SwGlossaryDlg, EnableHdl, Menu *, pMn ) pMn->EnableItem( FN_GL_IMPORT, bEnable ); return 1; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn ) { @@ -612,7 +569,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn ) if(aTitle.Len() && pGlossaryHdl->DelGlossary(aShortName)) { SvLBoxEntry* pChild = DoesBlockExist(aTitle, aShortName); - DBG_ASSERT(pChild, "Eintrag nicht gefunden!"); + OSL_ENSURE(pChild, "entry not found!"); SvLBoxEntry* pParent = aCategoryBox.GetParent(pChild); aCategoryBox.Select(pParent); @@ -638,7 +595,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn ) aItem.SetMacro( SW_EVENT_END_INS_GLOSSARY, aEnd ); aSet.Put( aItem ); - aSet.Put( SwMacroAssignDlg::AddEvents( MACASSGN_TEXTBAUST ) ); + aSet.Put( SwMacroAssignDlg::AddEvents( MACASSGN_AUTOTEXT ) ); const SfxPoolItem* pItem; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); @@ -700,11 +657,10 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn ) } return 1; } + /*-------------------------------------------------------------------- Beschreibung: Dialog Verwaltung Bereiche --------------------------------------------------------------------*/ - - IMPL_LINK( SwGlossaryDlg, BibHdl, Button *, EMPTYARG ) { SwGlossaries* pGloss = ::GetGlossaries(); @@ -782,8 +738,6 @@ IMPL_LINK( SwGlossaryDlg, BibHdl, Button *, EMPTYARG ) /*------------------------------------------------------------------------ Beschreibung: Initialisierung; aus Ctor und nach Bearbeiten Bereiche ------------------------------------------------------------------------*/ - - void SwGlossaryDlg::Init() { aCategoryBox.SetUpdateMode( sal_False ); @@ -793,6 +747,9 @@ void SwGlossaryDlg::Init() SvLBoxEntry* pSelEntry = 0; const String sSelStr(::GetCurrGlosGroup()->GetToken(0, GLOS_DELIM)); const sal_uInt16 nSelPath = static_cast< sal_uInt16 >(::GetCurrGlosGroup()->GetToken(1, GLOS_DELIM).ToInt32()); + // #i66304# - "My AutoText" comes from mytexts.bau, but should be translated + const String sMyAutoTextEnglish(RTL_CONSTASCII_USTRINGPARAM("My AutoText")); + const String sMyAutoTextTranslated(SW_RESSTR(STR_MY_AUTOTEXT)); for(sal_uInt16 nId = 0; nId < nCnt; ++nId ) { String sTitle; @@ -801,6 +758,8 @@ void SwGlossaryDlg::Init() continue; if(!sTitle.Len()) sTitle = sGroupName.GetToken( 0, GLOS_DELIM ); + if(sTitle == sMyAutoTextEnglish) + sTitle = sMyAutoTextTranslated; SvLBoxEntry* pEntry = aCategoryBox.InsertEntry( sTitle ); sal_uInt16 nPath = static_cast< sal_uInt16 >(sGroupName.GetToken( 1, GLOS_DELIM ).ToInt32()); @@ -872,10 +831,6 @@ void SwGlossaryDlg::Init() aInsertTipCB.Check( pCfg->IsAutoTextTip() ); aInsertTipCB.SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl)); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK_INLINE_START( SwGlossaryDlg, EditHdl, Button *, EMPTYARG ) { @@ -895,7 +850,6 @@ IMPL_LINK_INLINE_END( SwGlossaryDlg, EditHdl, Button *, EMPTYARG ) /*------------------------------------------------------------------------ Beschreibung: KeyInput fuer ShortName - Edits ohne Spaces ------------------------------------------------------------------------*/ - IMPL_LINK( SwNewGlosNameDlg, Modify, Edit *, pBox ) { String aName(aNewName.GetText()); @@ -910,9 +864,6 @@ IMPL_LINK( SwNewGlosNameDlg, Modify, Edit *, pBox ) aOk.Enable(bEnable); return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ IMPL_LINK( SwNewGlosNameDlg, Rename, Button *, EMPTYARG ) { @@ -930,10 +881,6 @@ IMPL_LINK( SwNewGlosNameDlg, Rename, Button *, EMPTYARG ) return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK( SwGlossaryDlg, CheckBoxHdl, CheckBox *, pBox ) { SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get(); @@ -947,7 +894,7 @@ IMPL_LINK( SwGlossaryDlg, CheckBoxHdl, CheckBox *, pBox ) return 0; } -/* -----------------26.11.98 15:18------------------- +/* -------------------------------------------------- * TreeListBox fuer Gruppen und Bausteine * --------------------------------------------------*/ SwGlTreeListBox::SwGlTreeListBox(Window* pParent, const ResId& rResId) : @@ -958,9 +905,7 @@ SwGlTreeListBox::SwGlTreeListBox(Window* pParent, const ResId& rResId) : FreeResource(); SetDragDropMode( SV_DRAGDROP_CTRL_MOVE|SV_DRAGDROP_CTRL_COPY ); } -/* -----------------30.11.98 10:49------------------- - * - * --------------------------------------------------*/ + void SwGlTreeListBox::Clear() { SvLBoxEntry* pEntry = First(); @@ -975,9 +920,6 @@ void SwGlTreeListBox::Clear() SvTreeListBox::Clear(); } -/*-----------------10.06.97 14.52------------------- - ---------------------------------------------------*/ void SwGlTreeListBox::RequestHelp( const HelpEvent& rHEvt ) { Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() )); @@ -1029,9 +971,7 @@ void SwGlTreeListBox::RequestHelp( const HelpEvent& rHEvt ) } } } -/* -----------------26.11.98 14:42------------------- - * - * --------------------------------------------------*/ + DragDropMode SwGlTreeListBox::NotifyStartDrag( TransferDataContainer& /*rContainer*/, SvLBoxEntry* pEntry ) @@ -1060,9 +1000,7 @@ DragDropMode SwGlTreeListBox::NotifyStartDrag( } return eRet; } -/* -----------------27.11.98 09:35------------------- - * - * --------------------------------------------------*/ + sal_Bool SwGlTreeListBox::NotifyAcceptDrop( SvLBoxEntry* pEntry) { // TODO: Readonly - Ueberpruefung fehlt noch! @@ -1072,9 +1010,7 @@ sal_Bool SwGlTreeListBox::NotifyAcceptDrop( SvLBoxEntry* pEntry) return pDestParent != pSrcParent; } -/* -----------------26.11.98 14:42------------------- - * - * --------------------------------------------------*/ + sal_Bool SwGlTreeListBox::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, SvLBoxEntry*& /*rpNewParent*/, @@ -1120,9 +1056,7 @@ sal_Bool SwGlTreeListBox::NotifyMoving( SvLBoxEntry* pTarget, } return sal_False; //sonst wird der Eintrag automatisch vorgenommen } -/* -----------------26.11.98 14:42------------------- - * - * --------------------------------------------------*/ + sal_Bool SwGlTreeListBox::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, SvLBoxEntry*& /*rpNewParent*/, @@ -1170,10 +1104,6 @@ sal_Bool SwGlTreeListBox::NotifyCopying( SvLBoxEntry* pTarget, return sal_False; //sonst wird der Eintrag automatisch vorgenommen } - -/*-----------------10.06.97 15.18------------------- - ---------------------------------------------------*/ String SwGlossaryDlg::GetCurrGrpName() const { SvLBoxEntry* pEntry = aCategoryBox.FirstSelected(); @@ -1190,16 +1120,13 @@ String SwGlossaryDlg::GetCurrGrpName() const return sRet; } -/*-----------------11.06.97 08.17------------------- - ---------------------------------------------------*/ IMPL_LINK( SwGlossaryDlg, PathHdl, Button *, pBtn ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { AbstractSvxMultiPathDialog* pDlg = pFact->CreateSvxMultiPathDialog( pBtn ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); SvtPathOptions aPathOpt; String sGlosPath( aPathOpt.GetAutoTextPath() ); pDlg->SetPath(sGlosPath); @@ -1217,9 +1144,7 @@ IMPL_LINK( SwGlossaryDlg, PathHdl, Button *, pBtn ) } return 0; } -/* -----------------28.07.99 13:48------------------- - --------------------------------------------------*/ IMPL_LINK( SwGlossaryDlg, ShowPreviewHdl, CheckBox *, pBox ) { sal_Bool bCreated = sal_False; @@ -1243,9 +1168,7 @@ IMPL_LINK( SwGlossaryDlg, ShowPreviewHdl, CheckBox *, pBox ) return 0; }; -/* -----------------18.11.99 17:09------------------- - --------------------------------------------------*/ IMPL_LINK( SwGlossaryDlg, PreviewLoadedHdl, void *, EMPTYARG ) { sal_Bool bShow = aShowExampleCB.IsChecked(); @@ -1255,9 +1178,6 @@ IMPL_LINK( SwGlossaryDlg, PreviewLoadedHdl, void *, EMPTYARG ) return 0; } -/* -----------------28.07.99 16:28------------------- - - --------------------------------------------------*/ void SwGlossaryDlg::ShowAutoText(const String& rGroup, const String& rShortName) { if(aExampleWIN.IsVisible()) @@ -1267,9 +1187,7 @@ void SwGlossaryDlg::ShowAutoText(const String& rGroup, const String& rShortName) pExampleFrame->ClearDocument( sal_True ); } } -/* -----------------------------21.12.00 11:33-------------------------------- - ---------------------------------------------------------------------------*/ void SwGlossaryDlg::ResumeShowAutoText() { String sGroup, sShortName; @@ -1307,4 +1225,4 @@ void SwGlossaryDlg::ResumeShowAutoText() ResetResumeData(); } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/glossary.src b/sw/source/ui/misc/glossary.src index 94d56829bf..721b36522c 100644 --- a/sw/source/ui/misc/glossary.src +++ b/sw/source/ui/misc/glossary.src @@ -138,9 +138,7 @@ ModalDialog DLG_GLOSSARY { Pos = MAP_APPFONT ( 319 , 6 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; - /* ### ACHTUNG: Neuer Text in Resource? ~Einf�gen : ~Einf�gen */ Text [ en-US ] = "~Insert" ; - /* ### ACHTUNG: Neuer Text in Resource? F�gt den aktuellen Textblock ein und schlie�t das Dialogfeld : F�gt den aktuellen Textblock ein und schlie�t das Dialogfeld */ TabStop = TRUE ; DefButton = TRUE ; }; @@ -148,7 +146,6 @@ ModalDialog DLG_GLOSSARY { Pos = MAP_APPFONT ( 319 , 23 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; - /* ### ACHTUNG: Neuer Text in Resource? ~Schlie�en : ~Schlie�en */ Text [ en-US ] = "~Close" ; TabStop = TRUE ; }; @@ -229,7 +226,6 @@ ModalDialog DLG_GLOSSARY { Identifier = FN_GL_DELETE ; HelpID = HID_MD_GLOS_DELETE ; - /* ### ACHTUNG: Neuer Text in Resource? ~L�schen : ~L�schen */ Text [ en-US ] = "~Delete" ; }; MenuItem @@ -267,14 +263,12 @@ ModalDialog DLG_GLOSSARY }; InfoBox MSG_DOUBLE_SHORTNAME { - /* ### ACHTUNG: Neuer Text in Resource? K�rzel wird bereits verwendet. Bitte einen anderen Namen vergeben! : K�rzel wird bereits verwendet. Bitte einen anderen Namen vergeben! */ Message [ en-US ] = "Shortcut name already exists. Please choose another name." ; }; QueryBox MSG_QUERY_DELETE { BUTTONS = WB_YES_NO ; DEFBUTTON = WB_DEF_NO ; - /* ### ACHTUNG: Neuer Text in Resource? Soll der AutoText gel�scht werden? : Soll der AutoText gel�scht werden? */ Message [ en-US ] = "Delete AutoText?" ; }; String STR_QUERY_DELETE_GROUP1 @@ -283,7 +277,6 @@ String STR_QUERY_DELETE_GROUP1 }; String STR_QUERY_DELETE_GROUP2 { - /* ### ACHTUNG: Neuer Text in Resource? gel�scht werden? : gel�scht werden? */ Text [ en-US ] = "?" ; }; String STR_GLOSSARY @@ -393,92 +386,7 @@ InfoBox MSG_NO_GLOSSARIES Message [ en-US ] = "There is no AutoText in this file."; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +String STR_MY_AUTOTEXT +{ + Text[ en-US ] = "My AutoText"; +}; diff --git a/sw/source/ui/misc/glshell.cxx b/sw/source/ui/misc/glshell.cxx index 969babef98..4bc35a1b8c 100644 --- a/sw/source/ui/misc/glshell.cxx +++ b/sw/source/ui/misc/glshell.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -30,7 +31,6 @@ #include <com/sun/star/frame/XTitle.hpp> -#include <tools/list.hxx> #include <svl/eitem.hxx> #include <svl/stritem.hxx> #include <sfx2/printer.hxx> @@ -57,9 +57,9 @@ #include <swerror.h> #include <misc.hrc> - #define SwWebGlosDocShell #define SwGlosDocShell + #include <sfx2/msg.hxx> #include <swslots.hxx> @@ -73,11 +73,9 @@ SFX_IMPL_INTERFACE( SwWebGlosDocShell, SwWebDocShell, SW_RES(0) ) { } - TYPEINIT1( SwGlosDocShell, SwDocShell ); TYPEINIT1( SwWebGlosDocShell, SwWebDocShell ); - void lcl_Execute( SwDocShell& rSh, SfxRequest& rReq ) { if ( rReq.GetSlot() == SID_SAVEDOC ) @@ -97,7 +95,6 @@ void lcl_Execute( SwDocShell& rSh, SfxRequest& rReq ) } } - void lcl_GetState( SwDocShell& rSh, SfxItemSet& rSet ) { if( SFX_ITEM_AVAILABLE >= rSet.GetItemState( SID_SAVEDOC, sal_False )) @@ -109,7 +106,6 @@ void lcl_GetState( SwDocShell& rSh, SfxItemSet& rSet ) } } - sal_Bool lcl_Save( SwWrtShell& rSh, const String& rGroupName, const String& rShortNm, const String& rLongNm ) { @@ -141,11 +137,6 @@ sal_Bool lcl_Save( SwWrtShell& rSh, const String& rGroupName, return nRet != USHRT_MAX; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwGlosDocShell::SwGlosDocShell(sal_Bool bNewShow) : SwDocShell( (bNewShow) ? SFX_CREATE_MODE_STANDARD : SFX_CREATE_MODE_INTERNAL ) @@ -154,40 +145,20 @@ SwGlosDocShell::SwGlosDocShell(sal_Bool bNewShow) SetHelpId(SW_GLOSDOCSHELL); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwGlosDocShell::~SwGlosDocShell( ) { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwGlosDocShell::Execute( SfxRequest& rReq ) { ::lcl_Execute( *this, rReq ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwGlosDocShell::GetState( SfxItemSet& rSet ) { ::lcl_GetState( *this, rSet ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - sal_Bool SwGlosDocShell::Save() { // In case of an API object which holds this document, it is possible that the WrtShell is already @@ -204,53 +175,26 @@ sal_Bool SwGlosDocShell::Save() } } - -/**/ - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwWebGlosDocShell::SwWebGlosDocShell() : SwWebDocShell( SFX_CREATE_MODE_STANDARD ) { SetHelpId(SW_WEBGLOSDOCSHELL); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwWebGlosDocShell::~SwWebGlosDocShell( ) { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwWebGlosDocShell::Execute( SfxRequest& rReq ) { ::lcl_Execute( *this, rReq ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwWebGlosDocShell::GetState( SfxItemSet& rSet ) { ::lcl_GetState( *this, rSet ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - sal_Bool SwWebGlosDocShell::Save() { // same comment as in SwGlosDocShell::Save - see there @@ -263,10 +207,6 @@ sal_Bool SwWebGlosDocShell::Save() } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SV_IMPL_REF ( SwDocShell ) SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rShortName, sal_Bool bShow ) @@ -346,4 +286,4 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS return xDocSh; } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/impfnote.hxx b/sw/source/ui/misc/impfnote.hxx index d0f9adf304..5516b3e3e9 100644 --- a/sw/source/ui/misc/impfnote.hxx +++ b/sw/source/ui/misc/impfnote.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,18 +29,10 @@ #define _IMPFNOTE_HXX #include <sfx2/tabdlg.hxx> -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _FIELD_HXX //autogen #include <vcl/field.hxx> -#endif #include <numberingtypelistbox.hxx> class SwWrtShell; @@ -118,3 +111,5 @@ public: #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index 5a02e812ce..efbe591d26 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -58,7 +59,7 @@ static sal_Bool bFootnote = sal_True; Beschreibung: Einfuegen der Fussnote durch OK ------------------------------------------------------------------------*/ -void __EXPORT SwInsFootNoteDlg::Apply() +void SwInsFootNoteDlg::Apply() { String aStr; @@ -92,37 +93,12 @@ void __EXPORT SwInsFootNoteDlg::Apply() } else { -/* - rSh.StartUndo( UNDO_UI_INSERT_FOOTNOTE ); - rSh.InsertFootnote( aStr, aEndNoteBtn.IsChecked(), !bExtCharAvailable ); - if ( bExtCharAvailable ) - { - rSh.Left( CRSR_SKIP_CHARS, sal_True, 1, sal_False ); - SfxItemSet aSet( rSh.GetAttrPool(), RES_CHRATR_FONT, RES_CHRATR_FONT ); - rSh.GetAttr( aSet ); - SvxFontItem &rFont = (SvxFontItem &) aSet.Get( RES_CHRATR_FONT ); - SvxFontItem aFont( rFont.GetFamily(), aFontName, - rFont.GetStyleName(), rFont.GetPitch(), - eCharSet ); - aSet.Put( aFont ); - rSh.SetAttr( aSet, SETATTR_DONTEXPAND ); - // zur Bearbeitung des Fussnotentextes - rSh.ResetSelect(0, sal_False); - rSh.GotoFtnTxt(); - } - rSh.EndUndo( UNDO_UI_INSERT_FOOTNOTE ); -*/ } bFootnote = aFtnBtn.IsChecked(); } - -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK_INLINE_START( SwInsFootNoteDlg, NumberCharHdl, Button *, EMPTYARG ) { aNumberCharEdit.GrabFocus(); @@ -131,10 +107,6 @@ IMPL_LINK_INLINE_START( SwInsFootNoteDlg, NumberCharHdl, Button *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwInsFootNoteDlg, NumberCharHdl, Button *, EMPTYARG ) -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK_INLINE_START( SwInsFootNoteDlg, NumberEditHdl, void *, EMPTYARG ) { aNumberCharBtn.Check( sal_True ); @@ -144,10 +116,6 @@ IMPL_LINK_INLINE_START( SwInsFootNoteDlg, NumberEditHdl, void *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwInsFootNoteDlg, NumberEditHdl, void *, EMPTYARG ) -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK_INLINE_START( SwInsFootNoteDlg, NumberAutoBtnHdl, Button *, EMPTYARG ) { aOkBtn.Enable( sal_True ); @@ -155,10 +123,6 @@ IMPL_LINK_INLINE_START( SwInsFootNoteDlg, NumberAutoBtnHdl, Button *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwInsFootNoteDlg, NumberAutoBtnHdl, Button *, EMPTYARG ) -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK( SwInsFootNoteDlg, NumberExtCharHdl, Button *, EMPTYARG ) { aNumberCharBtn.Check( sal_True ); @@ -202,10 +166,6 @@ IMPL_LINK( SwInsFootNoteDlg, NumberExtCharHdl, Button *, EMPTYARG ) return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK( SwInsFootNoteDlg, NextPrevHdl, Button *, pBtn ) { Apply(); @@ -222,10 +182,6 @@ IMPL_LINK( SwInsFootNoteDlg, NextPrevHdl, Button *, pBtn ) return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwInsFootNoteDlg::SwInsFootNoteDlg(Window *pParent, SwWrtShell &rShell, sal_Bool bEd) : SvxStandardDialog(pParent,SW_RES(DLG_INS_FOOTNOTE)), @@ -275,11 +231,6 @@ SwInsFootNoteDlg::SwInsFootNoteDlg(Window *pParent, SwWrtShell &rShell, sal_Bool } } - -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwInsFootNoteDlg::~SwInsFootNoteDlg() { rSh.SetCareWin(0); @@ -288,10 +239,6 @@ SwInsFootNoteDlg::~SwInsFootNoteDlg() rSh.ResetSelect(0, sal_False); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwInsFootNoteDlg::Init() { SwFmtFtn aFtnNote; @@ -355,3 +302,4 @@ void SwInsFootNoteDlg::Init() rSh.EndAction(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/insfnote.src b/sw/source/ui/misc/insfnote.src index 761241619e..0081513666 100644 --- a/sw/source/ui/misc/insfnote.src +++ b/sw/source/ui/misc/insfnote.src @@ -35,7 +35,6 @@ ModalDialog DLG_INS_FOOTNOTE OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 160 , 100 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Fu�note einf�gen : Fu�note einf�gen */ Text [ en-US ] = "Insert Footnote/Endnote" ; Moveable = TRUE ; Edit ED_NUMBER_CHAR diff --git a/sw/source/ui/misc/insrule.cxx b/sw/source/ui/misc/insrule.cxx index 9bc004f771..e8074bfc6a 100644 --- a/sw/source/ui/misc/insrule.cxx +++ b/sw/source/ui/misc/insrule.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,9 +37,7 @@ #include "hintids.hxx" #include <svx/gallery.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <editeng/brshitem.hxx> #include <svl/urihelper.hxx> #include <vcl/graph.hxx> @@ -51,11 +50,6 @@ #include "misc.hrc" #include "helpid.h" -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent ) : SfxModalDialog(pParent, SW_RES(DLG_INSERT_RULER)), aSelectionFL(this, SW_RES(FL_SEL )), @@ -90,9 +84,6 @@ SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent ) : pExampleVS->Show(); } -/*-----------------14.02.97 13.18------------------- - ---------------------------------------------------*/ SwInsertGrfRulerDlg::~SwInsertGrfRulerDlg() { @@ -100,10 +91,6 @@ SwInsertGrfRulerDlg::~SwInsertGrfRulerDlg() delete pExampleVS; } -/*-----------------14.02.97 13.17------------------- - ---------------------------------------------------*/ - String SwInsertGrfRulerDlg::GetGraphicName() { String sRet; @@ -115,10 +102,6 @@ String SwInsertGrfRulerDlg::GetGraphicName() return sRet; } -/*-----------------14.02.97 13.20------------------- - ---------------------------------------------------*/ - IMPL_LINK(SwInsertGrfRulerDlg, SelectHdl, ValueSet*, pVS) { nSelPos = pVS->GetSelectItemId(); @@ -126,24 +109,17 @@ IMPL_LINK(SwInsertGrfRulerDlg, SelectHdl, ValueSet*, pVS) return 0; } -/*-----------------14.02.97 14.17------------------- - ---------------------------------------------------*/ SwRulerValueSet::SwRulerValueSet( Window* pParent, const ResId& rResId ) : SvxBmpNumValueSet(pParent, rResId) { SetStyle( GetStyle() & ~WB_ITEMBORDER ); } -/*-----------------14.02.97 14.17------------------- ---------------------------------------------------*/ SwRulerValueSet::~SwRulerValueSet() { } -/*-----------------14.02.97 13.42------------------- ---------------------------------------------------*/ -void __EXPORT SwRulerValueSet::UserDraw( const UserDrawEvent& rUDEvt ) +void SwRulerValueSet::UserDraw( const UserDrawEvent& rUDEvt ) { Rectangle aRect = rUDEvt.GetRect(); OutputDevice* pDev = rUDEvt.GetDevice(); @@ -214,13 +190,10 @@ void __EXPORT SwRulerValueSet::UserDraw( const UserDrawEvent& rUDEvt ) } } -/*-----------------15.02.97 10.03------------------- - ---------------------------------------------------*/ - IMPL_LINK(SwInsertGrfRulerDlg, DoubleClickHdl, ValueSet*, EMPTYARG) { EndDialog(RET_OK); return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx index 584b31ee34..72f76f8124 100644 --- a/sw/source/ui/misc/linenum.cxx +++ b/sw/source/ui/misc/linenum.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,11 +42,6 @@ #include <docsh.hxx> #include <charfmt.hxx> -//#ifndef _FLDMGR_HXX //autogen -//#include <fldmgr.hxx> -//#endif - - #include <docstyle.hxx> #include "fldbas.hxx" @@ -57,10 +53,6 @@ #include <IDocumentStylePoolAccess.hxx> -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwLineNumberingDlg::SwLineNumberingDlg(SwView *pVw) : SfxSingleTabDialog(&pVw->GetViewFrame()->GetWindow(), 0, 0), pSh(pVw->GetWrtShellPtr()) @@ -71,18 +63,10 @@ SwLineNumberingDlg::SwLineNumberingDlg(SwView *pVw) : GetOKButton()->SetClickHdl(LINK(this, SwLineNumberingDlg, OKHdl)); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -__EXPORT SwLineNumberingDlg::~SwLineNumberingDlg() +SwLineNumberingDlg::~SwLineNumberingDlg() { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwLineNumberingDlg, OKHdl, Button *, EMPTYARG ) { if (GetOKButton()->IsEnabled()) @@ -97,10 +81,6 @@ IMPL_LINK( SwLineNumberingDlg, OKHdl, Button *, EMPTYARG ) return 0; } -/*----------------------------------------------------------------------- - Beschreibung: - -----------------------------------------------------------------------*/ - SwLineNumberingPage::SwLineNumberingPage( Window* pParent, const SfxItemSet& rSet ) : SfxTabPage(pParent, SW_RES(TP_LINENUMBERING), rSet), @@ -147,28 +127,16 @@ SwLineNumberingPage::SwLineNumberingPage( Window* pParent, ::FillCharStyleListBox(aCharStyleLB, pSh->GetView().GetDocShell()); } -/*----------------------------------------------------------------------- - Beschreibung: - -----------------------------------------------------------------------*/ - -__EXPORT SwLineNumberingPage::~SwLineNumberingPage() +SwLineNumberingPage::~SwLineNumberingPage() { } -/*----------------------------------------------------------------------- - Beschreibung: - -----------------------------------------------------------------------*/ - -SfxTabPage* __EXPORT SwLineNumberingPage::Create( Window* pParent, const SfxItemSet& rSet ) +SfxTabPage* SwLineNumberingPage::Create( Window* pParent, const SfxItemSet& rSet ) { return new SwLineNumberingPage( pParent, rSet ); } -/*----------------------------------------------------------------------- - Beschreibung: - -----------------------------------------------------------------------*/ - -void __EXPORT SwLineNumberingPage::Reset( const SfxItemSet& ) +void SwLineNumberingPage::Reset( const SfxItemSet& ) { const SwLineNumberInfo &rInf = pSh->GetLineNumberInfo(); IDocumentStylePoolAccess* pIDSPA = pSh->getIDocumentStylePoolAccess(); @@ -188,22 +156,9 @@ void __EXPORT SwLineNumberingPage::Reset( const SfxItemSet& ) } // Format -// SwFldMgr aMgr( pSh ); sal_uInt16 nSelFmt = rInf.GetNumType().GetNumberingType(); -// sal_uInt16 nCnt = aMgr.GetFormatCount( TYP_SEQFLD, sal_False ); - -// for( sal_uInt16 i = 0; i < nCnt; i++) -// { -// aFormatLB.InsertEntry(aMgr.GetFormatStr( TYP_SEQFLD, i)); -// sal_uInt16 nFmtId = aMgr.GetFormatId( TYP_SEQFLD, i ); -// aFormatLB.SetEntryData( i, (void*)nFmtId ); -// if( nFmtId == nSelFmt ) -// aFormatLB.SelectEntryPos( i ); -// } - aFormatLB.SelectNumberingType(nSelFmt); -// if ( !aFormatLB.GetSelectEntryCount() ) -// aFormatLB.SelectEntryPos(aFormatLB.GetEntryCount() - 1); + aFormatLB.SelectNumberingType(nSelFmt); // Position aPosLB.SelectEntryPos((sal_uInt16)rInf.GetPos()); @@ -240,7 +195,6 @@ void __EXPORT SwLineNumberingPage::Reset( const SfxItemSet& ) /*-------------------------------------------------------------------- Beschreibung: Modify --------------------------------------------------------------------*/ - IMPL_LINK( SwLineNumberingPage, ModifyHdl, Edit *, EMPTYARG ) { sal_Bool bHasValue = aDivisorED.GetText().Len() != 0; @@ -255,7 +209,6 @@ IMPL_LINK( SwLineNumberingPage, ModifyHdl, Edit *, EMPTYARG ) /*-------------------------------------------------------------------- Beschreibung: On/Off --------------------------------------------------------------------*/ - IMPL_LINK( SwLineNumberingPage, LineOnOffHdl, CheckBox *, EMPTYARG ) { sal_Bool bEnable = aNumberingOnCB.IsChecked(); @@ -286,11 +239,7 @@ IMPL_LINK( SwLineNumberingPage, LineOnOffHdl, CheckBox *, EMPTYARG ) return 0; } -/*----------------------------------------------------------------------- - Beschreibung: - -----------------------------------------------------------------------*/ - -sal_Bool __EXPORT SwLineNumberingPage::FillItemSet( SfxItemSet& ) +sal_Bool SwLineNumberingPage::FillItemSet( SfxItemSet& ) { SwLineNumberInfo aInf(pSh->GetLineNumberInfo()); @@ -343,4 +292,4 @@ sal_Bool __EXPORT SwLineNumberingPage::FillItemSet( SfxItemSet& ) return sal_False; } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index d9dd5f9e3e..f42cd9a9ed 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,9 +38,7 @@ #define _NUM_CXX #include <hintids.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <tools/urlobj.hxx> #include <sfx2/app.hxx> #include <sfx2/imgmgr.hxx> @@ -50,16 +49,10 @@ #include <swvset.hxx> #include <swmodule.hxx> #include <wrtsh.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif -#ifndef _WVIEW_HXX #include <wview.hxx> -#endif #include <uitool.hxx> -#ifndef _WDOCSH_HXX #include <wdocsh.hxx> -#endif #include <uiitems.hxx> #include <docstyle.hxx> #include <charfmt.hxx> @@ -71,21 +64,11 @@ #include <viewopt.hxx> #include <frmmgr.hxx> -#ifndef _MISC_HRC #include <misc.hrc> -#endif -#ifndef _FRMUI_HRC #include <frmui.hrc> -#endif -#ifndef _NUM_HRC #include <num.hrc> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _HELPID_H #include <helpid.h> -#endif #include <SwStyleNameMapper.hxx> #include <svx/svxids.hrc> #include <svx/dialogs.hrc> @@ -95,9 +78,6 @@ static sal_Bool bLastRelative = sal_False; -/*-----------------03.12.97 10:02------------------- - ---------------------------------------------------*/ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent, const SfxItemSet& rSet) : SfxTabPage( pParent, SW_RES( TP_NUM_POSITION ), rSet ), @@ -114,7 +94,6 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent, aDistNumMF( this, SW_RES(MF_NUMDIST )), aAlignFT( this, SW_RES(FT_ALIGN )), aAlignLB( this, SW_RES(LB_ALIGN )), - // --> OD 2008-02-01 #newlistlevelattrs# aLabelFollowedByFT( this, SW_RES(FT_LABEL_FOLLOWED_BY) ), aLabelFollowedByLB( this, SW_RES(LB_LABEL_FOLLOWED_BY) ), aListtabFT( this, SW_RES(FT_LISTTAB) ), @@ -125,7 +104,6 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent, aAlignedAtMF( this, SW_RES(MF_ALIGNED_AT) ), aIndentAtFT( this, SW_RES(FT_INDENT_AT) ), aIndentAtMF( this, SW_RES(MF_INDENT_AT) ), - // <-- aStandardPB( this, SW_RES(PB_STANDARD )), aPreviewWIN( this, SW_RES(WIN_PREVIEW )), @@ -136,9 +114,7 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent, pOutlineDlg(0), bPreset( sal_False ), bInInintControl(sal_False), - // --> OD 2008-02-01 #newlistlevelattrs# bLabelAlignmentPosAndSpaceModeActive( false ) - // <-- { FreeResource(); SetExchangeSupport(); @@ -149,7 +125,6 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent, aRelativeCB.Check(); aAlignLB.SetSelectHdl(LINK(this, SwNumPositionTabPage, EditModifyHdl)); - // --> OD 2008-02-01 #newlistlevelattrs# aAlign2LB.SetSelectHdl(LINK(this, SwNumPositionTabPage, EditModifyHdl)); for ( sal_uInt16 i = 0; i < aAlignLB.GetEntryCount(); ++i ) { @@ -157,7 +132,6 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent, } aAlign2LB.SetDropDownLineCount( aAlign2LB.GetEntryCount() ); aAlign2FT.SetText( aAlignFT.GetText() ); - // <-- Link aLk = LINK(this, SwNumPositionTabPage, DistanceHdl); aDistBorderMF.SetUpHdl(aLk); @@ -170,7 +144,6 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent, aDistNumMF.SetLoseFocusHdl(aLk); aIndentMF.SetLoseFocusHdl(aLk); - // --> OD 2008-02-01 #newlistlevelattrs# aLabelFollowedByLB.SetDropDownLineCount( aLabelFollowedByLB.GetEntryCount() ); aLabelFollowedByLB.SetSelectHdl( LINK(this, SwNumPositionTabPage, LabelFollowedByHdl_Impl) ); @@ -188,7 +161,6 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent, aIndentAtMF.SetUpHdl(aLk); aIndentAtMF.SetDownHdl(aLk); aIndentAtMF.SetLoseFocusHdl(aLk); - // <-- aLevelLB.SetSelectHdl(LINK(this, SwNumPositionTabPage, LevelHdl)); aRelativeCB.SetClickHdl(LINK(this, SwNumPositionTabPage, RelativeHdl)); @@ -205,20 +177,15 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent, aRelativeCB.Check(bLastRelative); aPreviewWIN.SetPositionMode(); } -/*-----------------03.12.97 10:02------------------- ---------------------------------------------------*/ SwNumPositionTabPage::~SwNumPositionTabPage() { delete pActNum; } -/*-----------------03.12.97 10:06------------------- ---------------------------------------------------*/ void SwNumPositionTabPage::InitControls() { bInInintControl = sal_True; - // --> OD 2008-02-01 #newlistlevelattrs# const bool bRelative = !bLabelAlignmentPosAndSpaceModeActive && aRelativeCB.IsEnabled() && aRelativeCB.IsChecked(); const bool bSingleSelection = aLevelLB.GetSelectEntryCount() == 1 && @@ -228,7 +195,6 @@ void SwNumPositionTabPage::InitControls() ( bSingleSelection || bRelative || pOutlineDlg != 0 ) ); aDistBorderFT.Enable( !bLabelAlignmentPosAndSpaceModeActive && ( bSingleSelection || bRelative || pOutlineDlg != 0 ) ); - // <-- bool bSetDistEmpty = false; bool bSameDistBorderNum = !bLabelAlignmentPosAndSpaceModeActive; @@ -236,18 +202,14 @@ void SwNumPositionTabPage::InitControls() bool bSameIndent = !bLabelAlignmentPosAndSpaceModeActive; bool bSameAdjust = true; - // --> OD 2008-02-01 #newlistlevelattrs# bool bSameLabelFollowedBy = bLabelAlignmentPosAndSpaceModeActive; bool bSameListtab = bLabelAlignmentPosAndSpaceModeActive; bool bSameAlignAt = bLabelAlignmentPosAndSpaceModeActive; bool bSameIndentAt = bLabelAlignmentPosAndSpaceModeActive; - // <-- const SwNumFmt* aNumFmtArr[MAXLEVEL]; - const SwFmtVertOrient* pFirstOrient = 0; sal_uInt16 nMask = 1; sal_uInt16 nLvl = USHRT_MAX; - long nFirstBorderText = 0; long nFirstBorderTextRelative = -1; for(sal_uInt16 i = 0; i < MAXLEVEL; i++) { @@ -257,21 +219,10 @@ void SwNumPositionTabPage::InitControls() if(USHRT_MAX == nLvl) { nLvl = i; - // --> OD 2008-02-01 #newlistlevelattrs# - if ( !bLabelAlignmentPosAndSpaceModeActive ) - { - pFirstOrient = aNumFmtArr[nLvl]->GetGraphicOrientation(); - nFirstBorderText = nLvl > 0 ? - aNumFmtArr[nLvl]->GetAbsLSpace() + aNumFmtArr[nLvl]->GetFirstLineOffset() - - aNumFmtArr[nLvl - 1]->GetAbsLSpace() + aNumFmtArr[nLvl - 1]->GetFirstLineOffset(): - aNumFmtArr[nLvl]->GetAbsLSpace() + aNumFmtArr[nLvl]->GetFirstLineOffset(); - } - // <-- } if( i > nLvl) { - // --> OD 2008-02-01 #newlistlevelattrs# bSameAdjust &= aNumFmtArr[i]->GetNumAdjust() == aNumFmtArr[nLvl]->GetNumAdjust(); if ( !bLabelAlignmentPosAndSpaceModeActive ) { @@ -309,8 +260,6 @@ void SwNumPositionTabPage::InitControls() bSameIndentAt &= aNumFmtArr[i]->GetIndentAt() == aNumFmtArr[nLvl]->GetIndentAt(); } - // <-- - } } nMask <<= 1; @@ -351,19 +300,14 @@ void SwNumPositionTabPage::InitControls() else if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_RIGHT) nPos = 2; aAlignLB.SelectEntryPos(nPos); - // --> OD 2008-02-01 #newlistlevelattrs# aAlign2LB.SelectEntryPos( nPos ); - // <-- } else { aAlignLB.SetNoSelection(); - // --> OD 2008-02-01 #newlistlevelattrs# aAlign2LB.SetNoSelection(); - // <-- } - // --> OD 2008-02-01 #newlistlevelattrs# if ( bSameLabelFollowedBy ) { sal_uInt16 nPos = 0; // LISTTAB @@ -423,7 +367,6 @@ void SwNumPositionTabPage::InitControls() { aIndentAtMF.SetText(aEmptyStr); } - // <-- if(sal_True == bSetDistEmpty) aDistBorderMF.SetText(aEmptyStr); @@ -431,9 +374,6 @@ void SwNumPositionTabPage::InitControls() bInInintControl = sal_False; } -/*-----------------03.12.97 10:02------------------- - ---------------------------------------------------*/ void SwNumPositionTabPage::ActivatePage(const SfxItemSet& ) { const SfxPoolItem* pItem; @@ -444,7 +384,6 @@ void SwNumPositionTabPage::ActivatePage(const SfxItemSet& ) { bPreset = ((const SfxBoolItem*)pItem)->GetValue(); } - // bModified = (!pActNum->GetNumFmt( 0 ) || bPreset); if(*pActNum != *pSaveNum || nActNumLvl != nTmpNumLvl ) @@ -464,10 +403,8 @@ void SwNumPositionTabPage::ActivatePage(const SfxItemSet& ) } aLevelLB.SetUpdateMode(sal_True); - // --> OD 2008-02-01 #newlistlevelattrs# InitPosAndSpaceMode(); ShowControlsDependingOnPosAndSpaceMode(); - // <-- InitControls(); } @@ -475,9 +412,6 @@ void SwNumPositionTabPage::ActivatePage(const SfxItemSet& ) aPreviewWIN.Invalidate(); } -/*-----------------03.12.97 10:02------------------- - ---------------------------------------------------*/ int SwNumPositionTabPage::DeactivatePage(SfxItemSet *_pSet) { SwOutlineTabDialog::SetActNumLevel(nActNumLvl); @@ -487,9 +421,6 @@ int SwNumPositionTabPage::DeactivatePage(SfxItemSet *_pSet) } -/*-----------------03.12.97 10:02------------------- - ---------------------------------------------------*/ sal_Bool SwNumPositionTabPage::FillItemSet( SfxItemSet& rSet ) { if(pOutlineDlg) @@ -503,9 +434,6 @@ sal_Bool SwNumPositionTabPage::FillItemSet( SfxItemSet& rSet ) return bModified; } -/*-----------------03.12.97 10:02------------------- - ---------------------------------------------------*/ void SwNumPositionTabPage::Reset( const SfxItemSet& rSet ) { const SfxPoolItem* pItem; @@ -539,20 +467,17 @@ void SwNumPositionTabPage::Reset( const SfxItemSet& rSet ) else if(*pSaveNum != *pActNum) *pActNum = *pSaveNum; aPreviewWIN.SetNumRule(pActNum); - // --> OD 2008-02-01 #newlistlevelattrs# InitPosAndSpaceMode(); ShowControlsDependingOnPosAndSpaceMode(); - // <-- InitControls(); bModified = sal_False; } -// --> OD 2008-01-11 #newlistlevelattrs# void SwNumPositionTabPage::InitPosAndSpaceMode() { if ( pActNum == 0 ) { - DBG_ASSERT( false, + OSL_ENSURE( false, "<SwNumPositionTabPage::InitPosAndSpaceMode()> - misusage of method -> <pAktNum> has to be already set!" ); return; } @@ -601,45 +526,32 @@ void SwNumPositionTabPage::ShowControlsDependingOnPosAndSpaceMode() aIndentAtFT.Show( bLabelAlignmentPosAndSpaceModeActive ); aIndentAtMF.Show( bLabelAlignmentPosAndSpaceModeActive ); } -// <-- -/*-----------------03.12.97 10:02------------------- - ---------------------------------------------------*/ SfxTabPage* SwNumPositionTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet) { return new SwNumPositionTabPage(pParent, rAttrSet); } -/*-----------------04.12.97 12:51------------------- - ---------------------------------------------------*/ void SwNumPositionTabPage::SetWrtShell(SwWrtShell* pSh) { pWrtSh = pSh; - // --> OD 2008-02-01 #newlistlevelattrs# const SwTwips nWidth = pWrtSh->GetAnyCurRect(RECT_FRM).Width(); aDistBorderMF.SetMax(aDistBorderMF.Normalize( nWidth ), FUNIT_TWIP ); aDistNumMF .SetMax(aDistNumMF .Normalize( nWidth ), FUNIT_TWIP ); aIndentMF .SetMax(aIndentMF .Normalize( nWidth ), FUNIT_TWIP ); - // --> OD 2008-02-18 #newlistlevelattrs# aListtabMF.SetMax(aListtabMF.Normalize( nWidth ), FUNIT_TWIP ); aAlignedAtMF.SetMax(aAlignedAtMF.Normalize( nWidth ), FUNIT_TWIP ); aIndentAtMF.SetMax(aIndentAtMF.Normalize( nWidth ), FUNIT_TWIP ); - // <-- const SwTwips nLast2 = nWidth /2; aDistBorderMF.SetLast( aDistBorderMF.Normalize( nLast2 ), FUNIT_TWIP ); aDistNumMF .SetLast( aDistNumMF .Normalize( nLast2 ), FUNIT_TWIP ); aIndentMF .SetLast( aIndentMF .Normalize( nLast2 ), FUNIT_TWIP ); - // --> OD 2008-02-18 #newlistlevelattrs# aListtabMF.SetLast(aListtabMF.Normalize( nLast2 ), FUNIT_TWIP ); aAlignedAtMF.SetLast(aAlignedAtMF.Normalize( nLast2 ), FUNIT_TWIP ); aIndentAtMF.SetLast(aIndentAtMF.Normalize( nLast2 ), FUNIT_TWIP ); - // <-- - // <-- const SwRect& rPrtRect = pWrtSh->GetAnyCurRect(RECT_PAGE); aPreviewWIN.SetPageWidth(rPrtRect.Width()); @@ -649,25 +561,18 @@ void SwNumPositionTabPage::SetWrtShell(SwWrtShell* pSh) aDistBorderMF .SetDecimalDigits(1); aDistNumMF .SetDecimalDigits(1); aIndentMF .SetDecimalDigits(1); - // --> OD 2008-02-18 #newlistlevelattrs# aListtabMF.SetDecimalDigits(1); aAlignedAtMF.SetDecimalDigits(1); aIndentAtMF.SetDecimalDigits(1); - // <-- } aDistBorderMF .SetUnit( eMetric ); aDistNumMF .SetUnit( eMetric ); aIndentMF .SetUnit( eMetric ); - // --> OD 2008-02-18 #newlistlevelattrs# aListtabMF.SetUnit( eMetric ); aAlignedAtMF.SetUnit( eMetric ); aIndentAtMF.SetUnit( eMetric ); - // <-- } -/*-----------------03.12.97 11:06------------------- - ---------------------------------------------------*/ IMPL_LINK( SwNumPositionTabPage, EditModifyHdl, Edit *, EMPTYARG ) { sal_uInt16 nMask = 1; @@ -677,11 +582,9 @@ IMPL_LINK( SwNumPositionTabPage, EditModifyHdl, Edit *, EMPTYARG ) { SwNumFmt aNumFmt(pActNum->Get(i)); - // --> OD 2008-02-01 #newlistlevelattrs# const sal_uInt16 nPos = aAlignLB.IsVisible() ? aAlignLB.GetSelectEntryPos() : aAlign2LB.GetSelectEntryPos(); - // <-- SvxAdjust eAdjust = SVX_ADJUST_CENTER; if(nPos == 0) eAdjust = SVX_ADJUST_LEFT; @@ -695,9 +598,7 @@ IMPL_LINK( SwNumPositionTabPage, EditModifyHdl, Edit *, EMPTYARG ) SetModified(); return 0; } -/*-----------------03.12.97 11:11------------------- ---------------------------------------------------*/ IMPL_LINK( SwNumPositionTabPage, LevelHdl, ListBox *, pBox ) { sal_uInt16 nSaveNumLvl = nActNumLvl; @@ -738,16 +639,12 @@ IMPL_LINK( SwNumPositionTabPage, LevelHdl, ListBox *, pBox ) } aRelativeCB.Enable(1 != nActNumLvl); SetModified(); - // --> OD 2008-02-01 #newlistlevelattrs# InitPosAndSpaceMode(); ShowControlsDependingOnPosAndSpaceMode(); - // <-- InitControls(); return 0; } -/*-----------------03.12.97 12:24------------------- ---------------------------------------------------*/ IMPL_LINK( SwNumPositionTabPage, DistanceHdl, MetricField *, pFld ) { if(bInInintControl) @@ -808,9 +705,6 @@ IMPL_LINK( SwNumPositionTabPage, DistanceHdl, MetricField *, pFld ) return 0; } -/*-----------------04.12.97 12:35------------------- - ---------------------------------------------------*/ IMPL_LINK( SwNumPositionTabPage, RelativeHdl, CheckBox *, pBox ) { sal_Bool bOn = pBox->IsChecked(); @@ -850,7 +744,6 @@ IMPL_LINK( SwNumPositionTabPage, RelativeHdl, CheckBox *, pBox ) return 0; } -// --> OD 2008-02-01 #newlistlevelattrs# IMPL_LINK( SwNumPositionTabPage, LabelFollowedByHdl_Impl, ListBox*, EMPTYARG ) { // determine value to be set at the chosen list levels @@ -912,9 +805,7 @@ IMPL_LINK( SwNumPositionTabPage, LabelFollowedByHdl_Impl, ListBox*, EMPTYARG ) return 0; } -// <-- -// --> OD 2008-02-01 #newlistlevelattrs# IMPL_LINK( SwNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pFld ) { // determine value to be set at the chosen list levels @@ -937,9 +828,7 @@ IMPL_LINK( SwNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pFld ) return 0; } -// <-- -// --> OD 2008-02-01 #newlistlevelattrs# IMPL_LINK( SwNumPositionTabPage, AlignAtHdl_Impl, MetricField*, pFld ) { // determine value to be set at the chosen list levels @@ -963,9 +852,7 @@ IMPL_LINK( SwNumPositionTabPage, AlignAtHdl_Impl, MetricField*, pFld ) return 0; } -// <-- -// --> OD 2008-02-01 #newlistlevelattrs# IMPL_LINK( SwNumPositionTabPage, IndentAtHdl_Impl, MetricField*, pFld ) { // determine value to be set at the chosen list levels @@ -992,11 +879,7 @@ IMPL_LINK( SwNumPositionTabPage, IndentAtHdl_Impl, MetricField*, pFld ) return 0; } -// <-- -/*-----------------05.12.97 15:33------------------- - ---------------------------------------------------*/ IMPL_LINK( SwNumPositionTabPage, StandardHdl, PushButton *, EMPTYARG ) { sal_uInt16 nMask = 1; @@ -1005,13 +888,10 @@ IMPL_LINK( SwNumPositionTabPage, StandardHdl, PushButton *, EMPTYARG ) if(nActNumLvl & nMask) { SwNumFmt aNumFmt( pActNum->Get( i ) ); - // --> OD 2008-02-11 #newlistlevelattrs# SwNumRule aTmpNumRule( pWrtSh->GetUniqueNumRuleName(), aNumFmt.GetPositionAndSpaceMode(), pOutlineDlg ? OUTLINE_RULE : NUM_RULE ); - // <-- SwNumFmt aTempFmt(aTmpNumRule.Get( i )); - // --> OD 2008-02-05 #newlistlevelattrs# aNumFmt.SetPositionAndSpaceMode( aTempFmt.GetPositionAndSpaceMode() ); if ( aTempFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) { @@ -1027,8 +907,6 @@ IMPL_LINK( SwNumPositionTabPage, StandardHdl, PushButton *, EMPTYARG ) aNumFmt.SetFirstLineIndent( aTempFmt.GetFirstLineIndent() ); aNumFmt.SetIndentAt( aTempFmt.GetIndentAt() ); } - // <-- - pActNum->Set( i, aNumFmt ); } nMask <<= 1; @@ -1052,12 +930,6 @@ void SwNumPositionTabPage::SetModified(sal_Bool bRepaint) #endif -/**************************************************************************/ -/* */ -/* */ -/**************************************************************************/ - - SwSvxNumBulletTabDialog::SwSvxNumBulletTabDialog(Window* pParent, const SfxItemSet* pSwItemSet, SwWrtShell & rSh) : SfxTabDialog(pParent, SW_RES(DLG_SVXTEST_NUM_BULLET), pSwItemSet, sal_False, &aEmptyStr), @@ -1079,18 +951,11 @@ SwSvxNumBulletTabDialog::SwSvxNumBulletTabDialog(Window* pParent, AddTabPage( RID_SVXPAGE_NUM_POSITION ); } -/*-----------------07.02.97 12.08------------------- - ---------------------------------------------------*/ SwSvxNumBulletTabDialog::~SwSvxNumBulletTabDialog() { } -/*-----------------07.02.97 14.48------------------- - ---------------------------------------------------*/ - void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage) { //Namen der Vorlagen und Metric setzen @@ -1150,27 +1015,22 @@ void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage) SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)) ); rPage.PageCreated(aSet); -// ((SvxNumPositionTabPage&)rPage).SetWrtShell(&rWrtSh); } break; } } -/*-----------------17.02.97 16.52------------------- ---------------------------------------------------*/ short SwSvxNumBulletTabDialog::Ok() { short nRet = SfxTabDialog::Ok(); pExampleSet->ClearItem(SID_PARAM_NUM_PRESET); return nRet; } -/* -----------------02.12.98 08:35------------------- - * - * --------------------------------------------------*/ + IMPL_LINK(SwSvxNumBulletTabDialog, RemoveNumberingHdl, PushButton*, EMPTYARG) { EndDialog(RET_USER); return 0; } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/num.src b/sw/source/ui/misc/num.src index 9bf1cf54f9..3d5f83f4eb 100644 --- a/sw/source/ui/misc/num.src +++ b/sw/source/ui/misc/num.src @@ -338,7 +338,6 @@ TabDialog DLG_SVXTEST_NUM_BULLET PageItem { Identifier = RID_SVXPAGE_NUM_OPTIONS ; - /* ### ACHTUNG: Neuer Text in Resource? Optionen : ~Optionen */ Text [ en-US ] = "Options" ; }; }; diff --git a/sw/source/ui/misc/numberingtypelistbox.cxx b/sw/source/ui/misc/numberingtypelistbox.cxx index 256303fe3e..4dcdad06a8 100644 --- a/sw/source/ui/misc/numberingtypelistbox.cxx +++ b/sw/source/ui/misc/numberingtypelistbox.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" #include <numberingtypelistbox.hxx> -#ifndef _MISC_HRC #include <misc.hrc> -#endif #include <cnttab.hxx> #include <com/sun/star/style/NumberingType.hpp> #include <com/sun/star/text/XDefaultNumberingProvider.hpp> @@ -40,18 +39,14 @@ #include <unomid.h> using namespace com::sun::star; -using namespace rtl; -/* -----------------------------01.03.01 16:04-------------------------------- +using ::rtl::OUString; - ---------------------------------------------------------------------------*/ struct SwNumberingTypeListBox_Impl { uno::Reference<text::XNumberingTypeInfo> xInfo; }; -/* -----------------------------01.03.01 14:46-------------------------------- - ---------------------------------------------------------------------------*/ SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, const ResId& rResId, sal_uInt16 nTypeFlags ) : ListBox(pWin, rResId), @@ -59,23 +54,19 @@ SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, const ResId& rResI { uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); uno::Reference < uno::XInterface > xI = xMSF->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.text.DefaultNumberingProvider" ) ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.DefaultNumberingProvider")) ); uno::Reference<text::XDefaultNumberingProvider> xDefNum(xI, uno::UNO_QUERY); - DBG_ASSERT(xDefNum.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\""); + OSL_ENSURE(xDefNum.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\""); pImpl->xInfo = uno::Reference<text::XNumberingTypeInfo>(xDefNum, uno::UNO_QUERY); Reload(nTypeFlags); } -/* -----------------------------01.03.01 14:46-------------------------------- - ---------------------------------------------------------------------------*/ SwNumberingTypeListBox::~SwNumberingTypeListBox() { delete pImpl; } -/* -----------------------------01.03.01 16:02-------------------------------- - ---------------------------------------------------------------------------*/ void SwNumberingTypeListBox::Reload(sal_uInt16 nTypeFlags) { Clear(); @@ -150,24 +141,20 @@ void SwNumberingTypeListBox::Reload(sal_uInt16 nTypeFlags) SelectEntryPos(0); } } -/* -----------------------------01.03.01 14:46-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int16 SwNumberingTypeListBox::GetSelectedNumberingType() { sal_Int16 nRet = 0; sal_uInt16 nSelPos = GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nSelPos) nRet = (sal_Int16)(sal_uLong)GetEntryData(nSelPos); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 else - DBG_ERROR("SwNumberingTypeListBox not selected"); + OSL_ENSURE(false, "SwNumberingTypeListBox not selected"); #endif return nRet; } -/* -----------------------------01.03.01 14:46-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwNumberingTypeListBox::SelectNumberingType(sal_Int16 nType) { sal_uInt16 nPos = GetEntryPos((void*)(sal_uLong)nType); @@ -175,3 +162,4 @@ sal_Bool SwNumberingTypeListBox::SelectNumberingType(sal_Int16 nType) return LISTBOX_ENTRY_NOTFOUND != nPos; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 277e645bcd..b69393b0f7 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,12 +33,8 @@ #endif #include <hintids.hxx> #include <tools/shl.hxx> -#ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> -#endif -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <sfx2/tabdlg.hxx> #include <editeng/brshitem.hxx> #include <unotools/configmgr.hxx> @@ -47,14 +44,9 @@ #define USE_NUMTABPAGES #include <num.hxx> #endif -#ifndef _VIEW_HXX #include <view.hxx> -#endif -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <uitool.hxx> -#include <errhdl.hxx> #include <wrtsh.hxx> #include <swmodule.hxx> #include <fmtcol.hxx> @@ -67,26 +59,16 @@ #include <docstyle.hxx> #include <viewopt.hxx> #include <svtools/ctrlbox.hxx> -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> // fuer Vorlagenname 'keins' -#endif -#ifndef _MISC_HRC #include <misc.hrc> -#endif -#ifndef _OUTLINE_HRC #include <outline.hrc> -#endif #include <paratr.hxx> #include <unomid.h> #include <IDocumentOutlineNodes.hxx> -// --> OD 2008-04-14 #outlinelevel# #include <app.hrc> -// <-- #ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_ #include <com/sun/star/accessibility/AccessibleRole.hpp> @@ -94,16 +76,8 @@ using namespace ::com::sun::star; -/* -----------------------------31.01.01 10:23-------------------------------- - - ---------------------------------------------------------------------------*/ - DBG_NAME(outlinehdl) -/*--------------------------------------------------------------------- - ----------------------------------------------------------------------*/ - class SwNumNamesDlg: public ModalDialog { FixedLine aFormFL; @@ -128,8 +102,6 @@ public: /*------------------------------------------------------------------------ Beschreibung: selektierten Eintrag merken ------------------------------------------------------------------------*/ - - IMPL_LINK_INLINE_START( SwNumNamesDlg, SelectHdl, ListBox *, pBox ) { aFormEdit.SetText(pBox->GetSelectEntry()); @@ -143,8 +115,6 @@ IMPL_LINK_INLINE_END( SwNumNamesDlg, SelectHdl, ListBox *, pBox ) Parameter: Liste der vom Benutzer vergebenen Namen; nicht vom Benutzer benannte Positionen sind 0. ------------------------------------------------------------------------*/ - - void SwNumNamesDlg::SetUserNames(const String *pList[]) { sal_uInt16 nSelect = 0; @@ -161,22 +131,20 @@ void SwNumNamesDlg::SetUserNames(const String *pList[]) aFormBox.SelectEntryPos(nSelect); SelectHdl(&aFormBox); } + /*------------------------------------------------------------------------ Beschreibung: OK-Button freischalten, wenn Text im Edit steht. ------------------------------------------------------------------------*/ - - IMPL_LINK_INLINE_START( SwNumNamesDlg, ModifyHdl, Edit *, pBox ) { aOKBtn.Enable(0 != pBox->GetText().Len()); return 0; } IMPL_LINK_INLINE_END( SwNumNamesDlg, ModifyHdl, Edit *, pBox ) + /*------------------------------------------------------------------------ Beschreibung: DoubleClickHdl ------------------------------------------------------------------------*/ - - IMPL_LINK_INLINE_START( SwNumNamesDlg, DoubleClickHdl, ListBox *, EMPTYARG ) { EndDialog(RET_OK); @@ -184,10 +152,6 @@ IMPL_LINK_INLINE_START( SwNumNamesDlg, DoubleClickHdl, ListBox *, EMPTYARG ) } IMPL_LINK_INLINE_END( SwNumNamesDlg, DoubleClickHdl, ListBox *, EMPTYARG ) -/*-------------------------------------------------- - ---------------------------------------------------*/ - SwNumNamesDlg::SwNumNamesDlg(Window *pParent) : ModalDialog(pParent, SW_RES(DLG_NUM_NAMES)), aFormFL(this, SW_RES(FL_FORM)), @@ -204,16 +168,8 @@ SwNumNamesDlg::SwNumNamesDlg(Window *pParent) SelectHdl(&aFormBox); } -/*-------------------------------------------------- +SwNumNamesDlg::~SwNumNamesDlg() {} ---------------------------------------------------*/ - -__EXPORT SwNumNamesDlg::~SwNumNamesDlg() {} - - -/* -----------------08.07.98 08:46------------------- - * - * --------------------------------------------------*/ sal_uInt16 lcl_BitToLevel(sal_uInt16 nActLevel) { sal_uInt16 nTmp = nActLevel; @@ -223,9 +179,6 @@ sal_uInt16 lcl_BitToLevel(sal_uInt16 nActLevel) return nTmpLevel; } -/* -----------------07.07.98 14:13------------------- - * - * --------------------------------------------------*/ sal_uInt16 SwOutlineTabDialog::nNumLevel = 1; SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent, const SfxItemSet* pSwItemSet, @@ -273,8 +226,6 @@ SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent, SwTxtFmtColl &rTxtColl = rWrtSh.GetTxtFmtColl(i); if(!rTxtColl.IsDefault()) { - //sal_uInt8 nOutLevel = rTxtColl.GetOutlineLevel(); //<-#outline level, removed out by zhaojianwei - //if(nOutLevel != NO_NUMBERING) //->added by zhaojianwei if(rTxtColl.IsAssignedToListLevelOfOutlineStyle()) { @@ -286,17 +237,11 @@ SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent, } } -/* -----------------07.07.98 14:13------------------- - * - * --------------------------------------------------*/ SwOutlineTabDialog::~SwOutlineTabDialog() { delete pNumRule; } -/* -----------------07.07.98 14:13------------------- - * - * --------------------------------------------------*/ void SwOutlineTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage) { switch ( nPageId ) @@ -310,9 +255,7 @@ void SwOutlineTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage) break; } } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwOutlineTabDialog, CancelHdl, Button *, EMPTYARG ) { if (!bModified) @@ -320,9 +263,7 @@ IMPL_LINK( SwOutlineTabDialog, CancelHdl, Button *, EMPTYARG ) EndDialog(RET_CANCEL); return 0; } -/* -----------------08.07.98 12:14------------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwOutlineTabDialog, FormHdl, Button *, pBtn ) { //PopupMenu auffuellen @@ -337,9 +278,6 @@ IMPL_LINK( SwOutlineTabDialog, FormHdl, Button *, pBtn ) return 0; } -/* -----------------08.07.98 12:14------------------- - * - * --------------------------------------------------*/ IMPL_LINK( SwOutlineTabDialog, MenuSelectHdl, Menu *, pMenu ) { sal_uInt8 nLevelNo = 0; @@ -400,9 +338,7 @@ IMPL_LINK( SwOutlineTabDialog, MenuSelectHdl, Menu *, pMenu ) return 0; } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ + sal_uInt16 SwOutlineTabDialog::GetLevel(const String &rFmtName) const { for(sal_uInt16 i = 0; i < MAXLEVEL; ++i) @@ -413,9 +349,7 @@ sal_uInt16 SwOutlineTabDialog::GetLevel(const String &rFmtName) const return MAXLEVEL;//NO_NUMBERING; //#outline level,zhaojianwei } -/* -----------------07.07.98 16:30------------------- - * - * --------------------------------------------------*/ + short SwOutlineTabDialog::Ok() { SfxTabDialog::Ok(); @@ -437,28 +371,10 @@ short SwOutlineTabDialog::Ok() SwTxtFmtColl &rTxtColl = rWrtSh.GetTxtFmtColl(i); if( !rTxtColl.IsDefault() ) { - //rTxtColl.SetOutlineLevel( (sal_uInt8)GetLevel(rTxtColl.GetName()));//#outline level,removed by zhaojianwei const SfxPoolItem & rItem = rTxtColl.GetFmtAttr(RES_PARATR_NUMRULE, sal_False); - //if ((sal_uInt8)GetLevel(rTxtColl.GetName()) == NO_NUMBERING) //#outline level,removed by zhaojianwei - //{ - // if (static_cast<const SwNumRuleItem &>(rItem).GetValue() == - // pOutlineRule->GetName()) - // { - // rTxtColl.ResetFmtAttr(RES_PARATR_NUMRULE); - // } - //} - //else - //{ - // if (static_cast<const SwNumRuleItem &>(rItem).GetValue() != - // pOutlineRule->GetName()) - // { - // SwNumRuleItem aItem(pOutlineRule->GetName()); - // rTxtColl.SetFmtAttr(aItem); - // } - //} if ((sal_uInt8)GetLevel(rTxtColl.GetName()) == MAXLEVEL) //add by zhaojianwei { if(rTxtColl.IsAssignedToListLevelOfOutlineStyle()) @@ -493,25 +409,6 @@ short SwOutlineTabDialog::Ok() SwTxtFmtColl* pColl = rWrtSh.FindTxtFmtCollByName( sHeadline ); if( !pColl ) { - //if( !aCollNames[i].Len() ) //#outline level,removed by zhaojianwei - //{ - // SwTxtFmtColl* pTxtColl = rWrtSh.GetTxtCollFromPool( - // static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i) ); - // pTxtColl->SetOutlineLevel( NO_NUMBERING ); - // pTxtColl->ResetFmtAttr(RES_PARATR_NUMRULE); - //} - //else if(aCollNames[i] != sHeadline) - //{ - // SwTxtFmtColl* pTxtColl = rWrtSh.GetParaStyle( - // aCollNames[i], SwWrtShell::GETSTYLE_CREATESOME); - // if(pTxtColl) - // { - // pTxtColl->SetOutlineLevel( static_cast< sal_uInt8 >(i) ); - - // SwNumRuleItem aItem(pOutlineRule->GetName()); - // pTxtColl->SetFmtAttr(aItem); - // } - //} if(aCollNames[i] != sHeadline)//->added by zhaojianwei { SwTxtFmtColl* pTxtColl = rWrtSh.GetTxtCollFromPool( @@ -543,9 +440,6 @@ short SwOutlineTabDialog::Ok() return RET_OK; } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(Window* pParent, const SfxItemSet& rSet) : SfxTabPage(pParent, SW_RES(TP_OUTLINE_NUM), rSet), aLevelFL( this, SW_RES(FL_LEVEL )), @@ -588,9 +482,7 @@ SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(Window* pParent, const SfxIte aCharFmtLB.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage, CharFmtHdl)); } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ + void SwOutlineSettingsTabPage::Update() { // falls eine Vorlage fuer diese Ebene bereits selektiert wurde, @@ -704,9 +596,6 @@ void SwOutlineSettingsTabPage::Update() SetModified(); } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ IMPL_LINK( SwOutlineSettingsTabPage, LevelHdl, ListBox *, pBox ) { nActLevel = 0; @@ -727,9 +616,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, LevelHdl, ListBox *, pBox ) Update(); return 0; } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwOutlineSettingsTabPage, ToggleComplete, NumericField *, pFld ) { sal_uInt16 nMask = 1; @@ -747,9 +634,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, ToggleComplete, NumericField *, pFld ) SetModified(); return 0; } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, ListBox *, pBox ) { sal_uInt8 i; @@ -800,13 +685,10 @@ IMPL_LINK( SwOutlineSettingsTabPage, CollSelectGetFocus, ListBox *, EMPTYARG ) return 0; } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ IMPL_LINK( SwOutlineSettingsTabPage, NumberSelect, SwNumberingTypeListBox *, pBox ) { sal_uInt16 nMask = 1; - sal_Int16 nNumberType = pBox->GetSelectedNumberingType();//(sal_Int16)(sal_uLong)pBox->GetEntryData(pBox->GetSelectEntryPos()); + sal_Int16 nNumberType = pBox->GetSelectedNumberingType(); for(sal_uInt16 i = 0; i < MAXLEVEL; i++) { if(nActLevel & nMask) @@ -821,9 +703,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, NumberSelect, SwNumberingTypeListBox *, pBo SetModified(); return 0; } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwOutlineSettingsTabPage, DelimModify, Edit *, EMPTYARG ) { sal_uInt16 nMask = 1; @@ -841,9 +721,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, DelimModify, Edit *, EMPTYARG ) SetModified(); return 0; } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwOutlineSettingsTabPage, StartModified, NumericField *, pFld ) { sal_uInt16 nMask = 1; @@ -860,12 +738,9 @@ IMPL_LINK( SwOutlineSettingsTabPage, StartModified, NumericField *, pFld ) SetModified(); return 0; } -/* -----------------21.09.98 12:21------------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwOutlineSettingsTabPage, CharFmtHdl, ListBox *, EMPTYARG ) { -// bAutomaticCharStyles = sal_False; String sEntry = aCharFmtLB.GetSelectEntry(); sal_uInt16 nMask = 1; sal_Bool bFormatNone = sEntry == ViewShell::GetShellRes()->aStrNone; @@ -909,15 +784,11 @@ IMPL_LINK( SwOutlineSettingsTabPage, CharFmtHdl, ListBox *, EMPTYARG ) } return RET_OK; } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ + SwOutlineSettingsTabPage::~SwOutlineSettingsTabPage() { } -/* -----------------07.07.98 16:27------------------- - * - * --------------------------------------------------*/ + void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell) { pSh = pShell; @@ -925,8 +796,6 @@ void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell) pNumRule = ((SwOutlineTabDialog*)GetTabDialog())->GetNumRule(); pCollNames = ((SwOutlineTabDialog*)GetTabDialog())->GetCollNames(); - //pNumRule = new SwNumRule( *rSh.GetOutlineNumRule() ); - aPreviewWIN.SetNumRule(pNumRule); aPreviewWIN.SetOutlineNames(pCollNames); // Startwert setzen - nActLevel muss hier 1 sein @@ -978,9 +847,7 @@ void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell) pSh->GetView().GetDocShell()); Update(); } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ + void SwOutlineSettingsTabPage::ActivatePage(const SfxItemSet& ) { nActLevel = SwOutlineTabDialog::GetActNumLevel(); @@ -990,39 +857,29 @@ void SwOutlineSettingsTabPage::ActivatePage(const SfxItemSet& ) aLevelLB.SelectEntryPos(MAXLEVEL); LevelHdl(&aLevelLB); } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ + int SwOutlineSettingsTabPage::DeactivatePage(SfxItemSet*) { SwOutlineTabDialog::SetActNumLevel(nActLevel); return LEAVE_PAGE; } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ + sal_Bool SwOutlineSettingsTabPage::FillItemSet( SfxItemSet& ) { return sal_True; } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ + void SwOutlineSettingsTabPage::Reset( const SfxItemSet& rSet ) { ActivatePage(rSet); } -/* -----------------07.07.98 14:19------------------- - * - * --------------------------------------------------*/ + SfxTabPage* SwOutlineSettingsTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet) { return new SwOutlineSettingsTabPage(pParent, rAttrSet); } -/* -----------------07.11.2002 15:13----------------- - * - * --------------------------------------------------*/ + void SwOutlineSettingsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType) { sal_Bool bIsNull = aStartEdit.GetValue() == 0; @@ -1033,9 +890,7 @@ void SwOutlineSettingsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType if(bIsNull && bNoZeroAllowed) aStartEdit.GetModifyHdl().Call(&aStartEdit); } -/*-----------------09.12.97 11:54------------------- ---------------------------------------------------*/ sal_uInt16 lcl_DrawBullet(VirtualDevice* pVDev, const SwNumFmt& rFmt, sal_uInt16 nXStart, sal_uInt16 nYStart, const Size& rSize) @@ -1053,9 +908,7 @@ sal_uInt16 lcl_DrawBullet(VirtualDevice* pVDev, pVDev->SetFont(aTmpFont); return nRet; } -/*-----------------09.12.97 11:49------------------- ---------------------------------------------------*/ sal_uInt16 lcl_DrawGraphic(VirtualDevice* pVDev, const SwNumFmt &rFmt, sal_uInt16 nXStart, sal_uInt16 nYStart, sal_uInt16 nDivision) { @@ -1077,7 +930,8 @@ sal_uInt16 lcl_DrawGraphic(VirtualDevice* pVDev, const SwNumFmt &rFmt, sal_uInt1 return nRet; } -/*-----------------02.12.97 10:34------------------- + +/*-------------------------------------------------- Vorschau der Numerierung painten --------------------------------------------------*/ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) @@ -1120,7 +974,6 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) // #101524# OJ aStdFont.SetColor( SwViewOption::GetFontColor() ); - // sal_uInt16 nFontHeight = nYStep * 6 / 10; if(bPosition) nFontHeight = nYStep * 15 / 10; @@ -1146,7 +999,6 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) const SwNumFmt &rFmt = pActNum->Get(nLevel); aNumVector.push_back(rFmt.GetStart()); - // --> OD 2008-02-01 #newlistlevelattrs# sal_uInt16 nXStart( 0 ); short nTextOffset( 0 ); sal_uInt16 nNumberXPos( 0 ); @@ -1176,7 +1028,6 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) nNumberXPos = static_cast<sal_uInt16>(nTmpNumberXPos); } } - // <-- sal_uInt16 nBulletWidth = 0; if( SVX_NUM_BITMAP == rFmt.GetNumberingType() ) @@ -1201,7 +1052,6 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) nBulletWidth = (sal_uInt16)pVDev->GetTextWidth(aText); nPreNum++; } - // --> OD 2008-02-01 #newlistlevelattrs# if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT && rFmt.GetLabelFollowedBy() == SvxNumberFormat::SPACE ) { @@ -1210,9 +1060,7 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) pVDev->DrawText( Point(nNumberXPos, nYStart), aText ); nBulletWidth = nBulletWidth + (sal_uInt16)pVDev->GetTextWidth(aText); } - // <-- - // --> OD 2008-02-01 #newlistlevelattrs# sal_uInt16 nTextXPos( 0 ); if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) { @@ -1246,7 +1094,6 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) nXStart = static_cast<sal_uInt16>( rFmt.GetIndentAt() / nWidthRelation ); } - // <-- Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2)); @@ -1267,7 +1114,6 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) { const SwNumFmt &rFmt = pActNum->Get(nLevel); aNumVector.push_back(rFmt.GetStart()); - // --> OD 2008-02-01 #newlistlevelattrs# sal_uInt16 nXStart( 0 ); if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) { @@ -1289,7 +1135,6 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) } nXStart /= 2; nXStart += 2; - // <-- sal_uInt16 nTextOffset = 2 * nXStep; if( SVX_NUM_BITMAP == rFmt.GetNumberingType() ) { @@ -1317,7 +1162,7 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) pVDev->SetFont(aStdFont); // Changed as per BugID 79541 Branding/Configuration - uno::Any MyAny = ::utl::ConfigManager::GetConfigManager()-> + uno::Any MyAny = ::utl::ConfigManager::GetConfigManager(). GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); ::rtl::OUString aProductName; @@ -1338,11 +1183,8 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) } -/*-----------------02.12.97 10:34------------------- - ---------------------------------------------------*/ NumberingPreview::~NumberingPreview() { } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index efb98d9d5c..f68ba4d9d4 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,14 +35,11 @@ -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <hintids.hxx> #include <tools/ref.hxx> -#ifndef _SVX_DIALOGS_HRC #include <svx/dialogs.hrc> -#endif +#include <sal/macros.h> #include <vcl/field.hxx> #include <vcl/svapp.hxx> #include <unotools/localedatawrapper.hxx> @@ -55,22 +53,16 @@ #include <pgfnote.hxx> #include <uiitems.hxx> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _MISC_HRC #include <misc.hrc> -#endif -#ifndef _PGFNOTE_HRC #include <pgfnote.hrc> -#endif #define TWIP_TO_LBOX 5 + /*-----------------------------------------------------#--------------- Beschreibung: vordefinierte Linien in Point --------------------------------------------------------------------*/ - -static const sal_uInt16 __FAR_DATA nLines[] = { +static const sal_uInt16 nLines[] = { 0, 50, 100, @@ -79,20 +71,17 @@ static const sal_uInt16 __FAR_DATA nLines[] = { 500 }; -static const sal_uInt16 nLineCount = sizeof(nLines) / sizeof(nLines[0]); +static const sal_uInt16 nLineCount = SAL_N_ELEMENTS(nLines); -static sal_uInt16 __FAR_DATA aPageRg[] = { +static sal_uInt16 aPageRg[] = { FN_PARAM_FTN_INFO, FN_PARAM_FTN_INFO, 0 }; - /*------------------------------------------------------------------------ Beschreibung: liefert zurueck, ob die Linienbreite nWidth bereits in der Listbox enthalten ist. ------------------------------------------------------------------------*/ - - sal_Bool lcl_HasLineWidth(sal_uInt16 nWidth) { for(sal_uInt16 i = 0; i < nLineCount; ++i) { @@ -107,8 +96,6 @@ sal_Bool lcl_HasLineWidth(sal_uInt16 nWidth) Arten, wie die Hoehe des Fussnotenbereiches angegeben werden kann. ------------------------------------------------------------------------*/ - - IMPL_LINK_INLINE_START( SwFootNotePage, HeightPage, Button *, EMPTYARG ) { aMaxHeightEdit.Enable(sal_False); @@ -128,8 +115,6 @@ IMPL_LINK_INLINE_END( SwFootNotePage, HeightMetric, Button *, EMPTYARG ) /*------------------------------------------------------------------------ Beschreibung: Handler Grenzwerte ------------------------------------------------------------------------*/ - - IMPL_LINK( SwFootNotePage, HeightModify, MetricField *, EMPTYARG ) { aMaxHeightEdit.SetMax(aMaxHeightEdit.Normalize(lMaxHeight - @@ -190,18 +175,11 @@ SwFootNotePage::~SwFootNotePage() { } - SfxTabPage* SwFootNotePage::Create(Window *pParent, const SfxItemSet &rSet) { return new SwFootNotePage(pParent, rSet); } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwFootNotePage::Reset(const SfxItemSet &rSet) { // Falls noch kein Bsp vorhanden Init hier sonst im Activate @@ -267,8 +245,6 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet) /*-------------------------------------------------------------------- Beschreibung: Attribute in den Set stopfen bei OK --------------------------------------------------------------------*/ - - sal_Bool SwFootNotePage::FillItemSet(SfxItemSet &rSet) { SwPageFtnInfoItem aItem((const SwPageFtnInfoItem&)GetItemSet().Get(FN_PARAM_FTN_INFO)); @@ -369,5 +345,4 @@ sal_uInt16* SwFootNotePage::GetRanges() return aPageRg; } - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index 8a103b809a..41ab7dee62 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,14 +37,10 @@ #include <sfx2/app.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <hintids.hxx> #include <swtypes.hxx> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <svx/xtable.hxx> #include <uitool.hxx> #include <editeng/sizeitem.hxx> @@ -51,6 +48,7 @@ #include <editeng/ulspitem.hxx> #include <editeng/boxitem.hxx> #include <editeng/frmdiritem.hxx> +#include <svx/ruler.hxx> #include <pggrid.hxx> #include <tgrditem.hxx> #include <pggrid.hrc> @@ -60,9 +58,7 @@ #include "uiitems.hxx" #include "swmodule.hxx" #include "view.hxx" -/*-- 06.02.2002 15:25:39--------------------------------------------------- - -----------------------------------------------------------------------*/ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) : SfxTabPage(pParent, SW_RES(TP_TEXTGRID_PAGE), rSet), aGridTypeFL (this, SW_RES(FL_GRID_TYPE )), @@ -74,10 +70,12 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) : aLayoutFL (this, SW_RES(FL_LAYOUT )), aLinesPerPageFT (this, SW_RES(FT_LINESPERPAGE )), aLinesPerPageNF (this, SW_RES(NF_LINESPERPAGE )), + aLinesRangeFT (this, SW_RES(FT_LINERANGE )), aTextSizeFT (this, SW_RES(FT_TEXTSIZE )), aTextSizeMF (this, SW_RES(MF_TEXTSIZE )), aCharsPerLineFT (this, SW_RES(FT_CHARSPERLINE )), aCharsPerLineNF (this, SW_RES(NF_CHARSPERLINE )), + aCharsRangeFT (this, SW_RES(FT_CHARRANGE )), aCharWidthFT (this, SW_RES(FT_CHARWIDTH )), aCharWidthMF (this, SW_RES(MF_CHARWIDTH )), aRubySizeFT (this, SW_RES(FT_RUBYSIZE )), @@ -92,7 +90,9 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) : m_bRubyUserValue(sal_False), m_aPageSize(MM50, MM50), m_bVertical(sal_False), - m_bSquaredMode(sal_False) + m_bSquaredMode(sal_False), + m_bHRulerChanged( sal_False ), + m_bVRulerChanged( sal_False ) { FreeResource(); @@ -113,7 +113,9 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) : aControls[14] =&aPrintCB; aControls[15] =&aColorFT; aControls[16] =&aColorLB; - aControls[17] =0; + aControls[17] =&aLinesRangeFT; + aControls[18] =&aCharsRangeFT; + aControls[19] =0; Link aLink = LINK(this, SwTextGridPage, CharorLineChangedHdl); aCharsPerLineNF.SetUpHdl(aLink); @@ -186,22 +188,16 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) : aCharWidthMF.Show(); } } -/*-- 06.02.2002 15:25:40--------------------------------------------------- - -----------------------------------------------------------------------*/ SwTextGridPage::~SwTextGridPage() { } -/*-- 06.02.2002 15:25:40--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxTabPage *SwTextGridPage::Create(Window *pParent, const SfxItemSet &rSet) { return new SwTextGridPage(pParent, rSet); } -/*-- 06.02.2002 15:25:40--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwTextGridPage::FillItemSet(SfxItemSet &rSet) { sal_Bool bRet = sal_False; @@ -224,11 +220,15 @@ sal_Bool SwTextGridPage::FillItemSet(SfxItemSet &rSet) bRet = sal_True; } + // draw ticks of ruler + SwView * pView = ::GetActiveView(); + if ( m_bHRulerChanged ) + pView->GetHLineal().DrawTicks(); + if ( m_bVRulerChanged ) + pView->GetVLineal().DrawTicks(); return bRet; } -/*-- 06.02.2002 15:25:40--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwTextGridPage::Reset(const SfxItemSet &rSet) { if(SFX_ITEM_AVAILABLE <= rSet.GetItemState(RES_TEXTGRID, sal_True)) @@ -246,6 +246,7 @@ void SwTextGridPage::Reset(const SfxItemSet &rSet) GridTypeHdl(pButton); aSnapToCharsCB.Check(rGridItem.IsSnapToChars()); aLinesPerPageNF.SetValue(rGridItem.GetLines()); + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); m_nRubyUserValue = rGridItem.GetBaseHeight(); m_bRubyUserValue = sal_True; aTextSizeMF.SetValue(aTextSizeMF.Normalize(m_nRubyUserValue), FUNIT_TWIP); @@ -270,9 +271,7 @@ void SwTextGridPage::Reset(const SfxItemSet &rSet) aPrintCB.SaveValue(); aColorLB.SaveValue(); } -/*-- 06.02.2002 15:25:41--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwTextGridPage::ActivatePage( const SfxItemSet& rSet ) { aExampleWN.Hide(); @@ -281,16 +280,12 @@ void SwTextGridPage::ActivatePage( const SfxItemSet& rSet ) aExampleWN.Show(); aExampleWN.Invalidate(); } -/*-- 06.02.2002 15:25:41--------------------------------------------------- - -----------------------------------------------------------------------*/ int SwTextGridPage::DeactivatePage( SfxItemSet* ) { return LEAVE_PAGE; } -/* -----------------------------08.02.2002 11:57------------------------------ - ---------------------------------------------------------------------------*/ void SwTextGridPage::PutGridItem(SfxItemSet& rSet) { SwTextGridItem aGridItem; @@ -309,10 +304,20 @@ void SwTextGridPage::PutGridItem(SfxItemSet& rSet) aGridItem.SetPrintGrid(aPrintCB.IsChecked()); aGridItem.SetColor(aColorLB.GetSelectEntryColor()); rSet.Put(aGridItem); +/// Amelia + SwView * pView = ::GetActiveView(); + if ( aGridItem.GetGridType() != GRID_NONE ) + { + if ( aGridItem.GetGridType() == GRID_LINES_CHARS ) + { + m_bHRulerChanged = sal_True; + } + m_bVRulerChanged = sal_True; + pView->GetHLineal().SetCharWidth((long)(aCharWidthMF.GetValue(FUNIT_TWIP)/56.7)); + pView->GetVLineal().SetLineHeight((long)(aTextSizeMF.GetValue(FUNIT_TWIP)/56.7)); + } } -/* -----------------------------08.02.2002 10:54------------------------------ - ---------------------------------------------------------------------------*/ void SwTextGridPage::UpdatePageSize(const SfxItemSet& rSet) { if( SFX_ITEM_UNKNOWN != rSet.GetItemState( RES_FRAMEDIR, sal_True )) @@ -359,6 +364,12 @@ void SwTextGridPage::UpdatePageSize(const SfxItemSet& rSet) if ( m_bSquaredMode ) { aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextSize); + aCharsPerLineNF.SetMax( aCharsPerLineNF.GetValue() ); + aLinesPerPageNF.SetMax( m_aPageSize.Height() / + ( aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)) + + aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP)))); + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() ); + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); } else { @@ -368,22 +379,28 @@ void SwTextGridPage::UpdatePageSize(const SfxItemSet& rSet) aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextWidth); else aCharsPerLineNF.SetValue( 45 ); + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() ); + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); } } } -/* -----------------------------06.02.2002 15:24------------------------------ - ---------------------------------------------------------------------------*/ +void SwTextGridPage::SetLinesOrCharsRanges(FixedText & rField, const sal_Int32 nValue ) +{ + String aFieldStr = String::CreateFromAscii("( 1 -"); + aFieldStr += String::CreateFromInt32( nValue ); + aFieldStr += String::CreateFromAscii(" )"); + rField.SetText( aFieldStr ); +} + sal_uInt16* SwTextGridPage::GetRanges() { - static sal_uInt16 __FAR_DATA aPageRg[] = { + static sal_uInt16 aPageRg[] = { RES_TEXTGRID, RES_TEXTGRID, 0}; return aPageRg; } -/* -----------------------------08.02.2002 10:56------------------------------ - ---------------------------------------------------------------------------*/ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField) { //if in squared mode @@ -405,6 +422,8 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField) aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP)))); aLinesPerPageNF.SetMax(nMaxLines); } + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() ); } else//in normal mode { @@ -413,6 +432,7 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField) long nHeight = static_cast< sal_Int32 >(m_aPageSize.Height() / aLinesPerPageNF.GetValue()); aTextSizeMF.SetValue(aTextSizeMF.Normalize(nHeight), FUNIT_TWIP); aRubySizeMF.SetValue(0, FUNIT_TWIP); + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); m_nRubyUserValue = nHeight; m_bRubyUserValue = sal_True; @@ -421,13 +441,13 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField) { long nWidth = static_cast< sal_Int32 >(m_aPageSize.Width() / aCharsPerLineNF.GetValue()); aCharWidthMF.SetValue(aCharWidthMF.Normalize(nWidth), FUNIT_TWIP); + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() ); } } GridModifyHdl(0); return 0; } -/* -----------------------------04.09.2006 15:46------------------------------ - ---------------------------------------------------------------------------*/ + IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField) { //if in squared mode @@ -435,8 +455,6 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField) { if (&aTextSizeMF == pField) { - sal_Int32 nTextSize = static_cast< sal_Int32 >(aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP))); - aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextSize); m_bRubyUserValue = sal_False; } //set maximum line per page @@ -445,6 +463,7 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField) ( aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP)) + aRubySizeMF.Denormalize(aRubySizeMF.GetValue(FUNIT_TWIP)))); aLinesPerPageNF.SetMax(nMaxLines); + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); } } else @@ -454,23 +473,23 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField) sal_Int32 nTextSize = static_cast< sal_Int32 >(aTextSizeMF.Denormalize(aTextSizeMF.GetValue(FUNIT_TWIP))); aLinesPerPageNF.SetValue(m_aPageSize.Height() / nTextSize); m_bRubyUserValue = sal_False; + SetLinesOrCharsRanges( aLinesRangeFT , aLinesPerPageNF.GetMax() ); } else if (&aCharWidthMF == pField) { sal_Int32 nTextWidth = static_cast< sal_Int32 >(aCharWidthMF.Denormalize(aCharWidthMF.GetValue(FUNIT_TWIP))); + sal_Int32 nMaxChar = 45 ; if (nTextWidth) - aCharsPerLineNF.SetValue(m_aPageSize.Width() / nTextWidth); - else - aCharsPerLineNF.SetValue( 45 ); + nMaxChar = m_aPageSize.Width() / nTextWidth; + aCharsPerLineNF.SetValue( nMaxChar ); + SetLinesOrCharsRanges( aCharsRangeFT , aCharsPerLineNF.GetMax() ); } //rubySize is disabled } GridModifyHdl(0); return 0; } -/* -----------------------------22.04.2002 14:53------------------------------ - ---------------------------------------------------------------------------*/ IMPL_LINK(SwTextGridPage, GridTypeHdl, RadioButton*, pButton) { sal_Bool bEnable = &aNoGridRB != pButton; @@ -489,6 +508,7 @@ IMPL_LINK(SwTextGridPage, GridTypeHdl, RadioButton*, pButton) { aCharsPerLineFT.Enable(sal_False); aCharsPerLineNF.Enable(sal_False); + aCharsRangeFT.Enable(sal_False); aCharWidthFT.Enable(sal_False); aCharWidthMF.Enable(sal_False); } @@ -496,17 +516,13 @@ IMPL_LINK(SwTextGridPage, GridTypeHdl, RadioButton*, pButton) GridModifyHdl(0); return 0; } -/* -----------------------------22.04.2002 15:46------------------------------ - ---------------------------------------------------------------------------*/ IMPL_LINK(SwTextGridPage, DisplayGridHdl, CheckBox*, EMPTYARG) { aPrintCB.Enable(aDisplayCB.IsChecked()); return 0; } -/* -----------------------------08.02.2002 11:54------------------------------ - ---------------------------------------------------------------------------*/ IMPL_LINK(SwTextGridPage, GridModifyHdl, void*, EMPTYARG) { const SfxItemSet& rOldSet = GetItemSet(); @@ -519,3 +535,4 @@ IMPL_LINK(SwTextGridPage, GridModifyHdl, void*, EMPTYARG) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/pggrid.hrc b/sw/source/ui/misc/pggrid.hrc index 695bad1e76..567a1df33a 100644 --- a/sw/source/ui/misc/pggrid.hrc +++ b/sw/source/ui/misc/pggrid.hrc @@ -50,3 +50,5 @@ #define CB_SNAPTOCHARS 23 #define FT_CHARWIDTH 24 #define MF_CHARWIDTH 25 +#define FT_LINERANGE 26 +#define FT_CHARRANGE 27 diff --git a/sw/source/ui/misc/pggrid.src b/sw/source/ui/misc/pggrid.src index a39ca828f9..f660772415 100644 --- a/sw/source/ui/misc/pggrid.src +++ b/sw/source/ui/misc/pggrid.src @@ -102,6 +102,12 @@ TabPage TP_TEXTGRID_PAGE Last = 154 ; SpinSize = 1 ; }; + FixedText FT_LINERANGE + { + Pos = MAP_APPFONT ( 103 , 82 ) ; + Size = MAP_APPFONT ( 25 , 8 ); + Text [ en-US ] = "( 1 - 48 )" ; + }; FixedText FT_TEXTSIZE { Pos = MAP_APPFONT ( 133 , 82 ) ; @@ -174,6 +180,12 @@ TabPage TP_TEXTGRID_PAGE Last = 5600 ; SpinSize = 5 ; }; + FixedText FT_CHARRANGE + { + Pos = MAP_APPFONT ( 103 , 96 ) ; + Size = MAP_APPFONT ( 25 , 8 ) ; + Text [ en-US ] = "( 1 - 45 )" ; + }; FixedText FT_RUBYSIZE { Pos = MAP_APPFONT ( 133 , 98 ) ; diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx index b32dabff5d..aef9050a0d 100644 --- a/sw/source/ui/misc/redlndlg.cxx +++ b/sw/source/ui/misc/redlndlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -76,10 +77,6 @@ #include <IDocumentRedlineAccess.hxx> -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SFX_IMPL_MODELESSDIALOG( SwRedlineAcceptChild, FN_REDLINE_ACCEPT ) SV_IMPL_PTRARR(SwRedlineDataParentArr, SwRedlineDataParentPtr) @@ -90,10 +87,6 @@ SV_IMPL_PTRARR(SvLBoxEntryArr, SvLBoxEntryPtr) static sal_uInt16 nSortMode = 0xffff; static sal_Bool bSortDir = sal_True; -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwRedlineAcceptChild::SwRedlineAcceptChild( Window* _pParent, sal_uInt16 nId, SfxBindings* pBindings, @@ -108,7 +101,6 @@ SwRedlineAcceptChild::SwRedlineAcceptChild( Window* _pParent, /*-------------------------------------------------------------------- Beschreibung: Nach Dok-Wechsel Dialog neu initialisieren --------------------------------------------------------------------*/ - sal_Bool SwRedlineAcceptChild::ReInitDlg(SwDocShell *pDocSh) { sal_Bool bRet; @@ -119,10 +111,6 @@ sal_Bool SwRedlineAcceptChild::ReInitDlg(SwDocShell *pDocSh) return bRet; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwModelessRedlineAcceptDlg::SwModelessRedlineAcceptDlg( SfxBindings* _pBindings, SwChildWinWrapper* pChild, Window *_pParent) : @@ -134,10 +122,6 @@ SwModelessRedlineAcceptDlg::SwModelessRedlineAcceptDlg( SfxBindings* _pBindings, FreeResource(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwModelessRedlineAcceptDlg::Activate() { SwView *pView = ::GetActiveView(); @@ -168,10 +152,6 @@ void SwModelessRedlineAcceptDlg::Activate() pImplDlg->Activate(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwModelessRedlineAcceptDlg::Initialize(SfxChildWinInfo *pInfo) { String aStr; @@ -181,39 +161,23 @@ void SwModelessRedlineAcceptDlg::Initialize(SfxChildWinInfo *pInfo) SfxModelessDialog::Initialize(pInfo); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwModelessRedlineAcceptDlg::FillInfo(SfxChildWinInfo& rInfo) const { SfxModelessDialog::FillInfo(rInfo); pImplDlg->FillInfo(rInfo.aExtraString); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwModelessRedlineAcceptDlg::Resize() { pImplDlg->Resize(); SfxModelessDialog::Resize(); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwModelessRedlineAcceptDlg::~SwModelessRedlineAcceptDlg() { delete pImplDlg; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt) : pParentDlg (pParent), aTabPagesCTRL (pParent, SW_RES(CTRL_TABPAGES)), @@ -300,18 +264,10 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt) : aSelectTimer.SetTimeoutHdl(LINK(this, SwRedlineAcceptDlg, GotoHdl)); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwRedlineAcceptDlg::~SwRedlineAcceptDlg() { } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwRedlineAcceptDlg::Init(sal_uInt16 nStart) { SwWait aWait( *::GetActiveView()->GetDocShell(), sal_False ); @@ -338,10 +294,6 @@ void SwRedlineAcceptDlg::Init(sal_uInt16 nStart) pTable->MakeVisible( pSelEntry, sal_True ); //#i70937#, force the scroll } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwRedlineAcceptDlg::InitAuthors() { SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr(); @@ -369,10 +321,6 @@ void SwRedlineAcceptDlg::InitAuthors() if( bOnlyFormatedRedlines && nsRedlineType_t::REDLINE_FORMAT != rRedln.GetType() ) bOnlyFormatedRedlines = sal_False; -//JP 27.9.2001: make no sense if we handle readonly sections -// if( !bHasReadonlySel && rRedln.HasReadonlySel() ) -// bHasReadonlySel = sal_True; - String *pAuthor = new String(rRedln.GetAuthorString()); if (!aStrings.Insert(pAuthor)) delete pAuthor; @@ -411,10 +359,6 @@ void SwRedlineAcceptDlg::InitAuthors() !bOnlyFormatedRedlines ); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - String SwRedlineAcceptDlg::GetRedlineText( const SwRedline& rRedln, DateTime &rDateTime, sal_uInt16 nStack) { @@ -434,10 +378,6 @@ String SwRedlineAcceptDlg::GetRedlineText( const SwRedline& rRedln, return sEntry; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - const String &SwRedlineAcceptDlg::GetActionText(const SwRedline& rRedln, sal_uInt16 nStack) { switch( rRedln.GetType(nStack) ) @@ -453,10 +393,6 @@ const String &SwRedlineAcceptDlg::GetActionText(const SwRedline& rRedln, sal_uIn return aEmptyStr; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwRedlineAcceptDlg::Resize() { Size aSz(pParentDlg->GetOutputSizePixel()); @@ -472,7 +408,6 @@ void SwRedlineAcceptDlg::Resize() /*-------------------------------------------------------------------- Beschreibung: Nach Aktivierung neu initialisieren --------------------------------------------------------------------*/ - void SwRedlineAcceptDlg::Activate() { // prevent update if flag is set (#102547#) @@ -487,12 +422,6 @@ void SwRedlineAcceptDlg::Activate() if (!pView) // Kann passieren, wenn man auf eine andere App umschaltet, wenn return; // vorher eine Listbox im Dialog den Focus hatte (eigentlich THs Bug) -/* if (HasRedlineAutoFmt()) - { - Init(); - return; - }*/ - // Hat sich was geaendert? SwWrtShell* pSh = pView->GetWrtShellPtr(); sal_uInt16 nCount = pSh->GetRedlineCount(); @@ -578,10 +507,6 @@ void SwRedlineAcceptDlg::Activate() InitAuthors(); } -/* -----------------05.06.98 13:06------------------- - * - * --------------------------------------------------*/ - sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, sal_Bool bChild) { if (!nStart) @@ -655,10 +580,6 @@ sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, sal_Bool bChild) return USHRT_MAX; } -/* -----------------05.06.98 13:57------------------- - * - * --------------------------------------------------*/ - void SwRedlineAcceptDlg::InsertChilds(SwRedlineDataParent *pParent, const SwRedline& rRedln, const sal_uInt16 nAutoFmt) { String sChild; @@ -738,10 +659,6 @@ void SwRedlineAcceptDlg::InsertChilds(SwRedlineDataParent *pParent, const SwRedl } } -/* -----------------05.06.98 15:20------------------- - * - * --------------------------------------------------*/ - void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd) { SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr(); @@ -816,10 +733,6 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd) aRedlineParents.DeleteAndDestroy( nStart, nEnd - nStart + 1); } -/* -----------------05.06.98 15:20------------------- - * - * --------------------------------------------------*/ - void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd) { SwView *pView = ::GetActiveView(); @@ -883,10 +796,6 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd) } } -/* -----------------05.06.98 13:06------------------- - * - * --------------------------------------------------*/ - void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept ) { SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr(); @@ -897,7 +806,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept ) ListBoxEntries_t aRedlines; // don't activate - DBG_ASSERT( bInhibitActivate == false, + OSL_ENSURE( bInhibitActivate == false, "recursive call of CallAcceptReject?"); bInhibitActivate = true; @@ -951,7 +860,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept ) ListBoxEntries_t::iterator aEnd = aRedlines.end(); for( ListBoxEntries_t::iterator aIter = aRedlines.begin(); aIter != aEnd; - aIter++ ) + ++aIter ) { sal_uInt16 nPosition = GetRedlinePos( **aIter ); if( nPosition != USHRT_MAX ) @@ -986,10 +895,6 @@ void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept ) pTPView->EnableUndo(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwRedlineAcceptDlg::GetRedlinePos( const SvLBoxEntry& rEntry ) const { SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr(); @@ -997,50 +902,30 @@ sal_uInt16 SwRedlineAcceptDlg::GetRedlinePos( const SvLBoxEntry& rEntry ) const rEntry.GetUserData())->pData)->pData ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwRedlineAcceptDlg, AcceptHdl, void*, EMPTYARG) { CallAcceptReject( sal_True, sal_True ); return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwRedlineAcceptDlg, AcceptAllHdl, void*, EMPTYARG ) { CallAcceptReject( sal_False, sal_True ); return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwRedlineAcceptDlg, RejectHdl, void*, EMPTYARG ) { CallAcceptReject( sal_True, sal_False ); return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwRedlineAcceptDlg, RejectAllHdl, void*, EMPTYARG ) { CallAcceptReject( sal_False, sal_False ); return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwRedlineAcceptDlg, UndoHdl, void*, EMPTYARG ) { SwView * pView = ::GetActiveView(); @@ -1053,10 +938,6 @@ IMPL_LINK( SwRedlineAcceptDlg, UndoHdl, void*, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwRedlineAcceptDlg, FilterChangedHdl, void*, EMPTYARG ) { SvxTPFilter *pFilterTP = aTabPagesCTRL.GetFilterPage(); @@ -1071,10 +952,6 @@ IMPL_LINK( SwRedlineAcceptDlg, FilterChangedHdl, void*, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwRedlineAcceptDlg, DeselectHdl, void*, EMPTYARG ) { // Flackern der Buttons vermeiden: @@ -1083,10 +960,6 @@ IMPL_LINK( SwRedlineAcceptDlg, DeselectHdl, void*, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwRedlineAcceptDlg, SelectHdl, void*, EMPTYARG ) { aDeselectTimer.Stop(); @@ -1095,10 +968,6 @@ IMPL_LINK( SwRedlineAcceptDlg, SelectHdl, void*, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwRedlineAcceptDlg, GotoHdl, void*, EMPTYARG ) { SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr(); @@ -1106,7 +975,6 @@ IMPL_LINK( SwRedlineAcceptDlg, GotoHdl, void*, EMPTYARG ) sal_Bool bIsNotFormated = sal_False; sal_Bool bSel = sal_False; -// sal_Bool bReadonlySel = sal_False; //#98883# don't select redlines while the dialog is not focussed //#107938# But not only ask pTable if it has the focus. To move @@ -1147,10 +1015,6 @@ IMPL_LINK( SwRedlineAcceptDlg, GotoHdl, void*, EMPTYARG ) const SwRedline& rRedln = pSh->GetRedline( nPos ); bIsNotFormated |= nsRedlineType_t::REDLINE_FORMAT != rRedln.GetType(); -//JP 27.9.2001: make no sense if we handle readonly sections -// if( !bReadonlySel && rRedln.HasReadonlySel() ) -// bReadonlySel = sal_True; - if (pSh->GotoRedline(nPos, sal_True)) { pSh->SetInSelect(); @@ -1173,10 +1037,6 @@ IMPL_LINK( SwRedlineAcceptDlg, GotoHdl, void*, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG ) { const CommandEvent aCEvt(pTable->GetCommandEvent()); @@ -1246,16 +1106,16 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG ) /* enable again once we have redline comments in the margin sComment = rRedline.GetComment(); - if ( sComment == String(::rtl::OUString::createFromAscii("")) ) + if ( !sComment.Len() ) GetActiveView()->GetDocShell()->Broadcast(SwRedlineHint(&rRedline,SWREDLINE_INSERTED)); const_cast<SwRedline&>(rRedline).Broadcast(SwRedlineHint(&rRedline,SWREDLINE_FOCUS)); */ sComment = rRedline.GetComment(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); ::DialogGetRanges fnGetRange = pFact->GetDialogGetRangesFunc( RID_SVXDLG_POSTIT ); - DBG_ASSERT(fnGetRange, "Dialogdiet fail! GetRanges()"); + OSL_ENSURE(fnGetRange, "Dialogdiet fail! GetRanges()"); SfxItemSet aSet( pSh->GetAttrPool(), fnGetRange() ); aSet.Put(SvxPostItTextItem(sComment.ConvertLineEnd(), SID_ATTR_POSTIT_TEXT)); @@ -1266,7 +1126,7 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG ) SID_ATTR_POSTIT_DATE )); AbstractSvxPostItDialog* pDlg = pFact->CreateSvxPostItDialog( pParentDlg, aSet, sal_False ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->HideAuthor(); @@ -1343,10 +1203,6 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwRedlineAcceptDlg::Initialize(const String& rExtraData) { if (rExtraData.Len()) @@ -1384,10 +1240,6 @@ void SwRedlineAcceptDlg::Initialize(const String& rExtraData) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwRedlineAcceptDlg::FillInfo(String &rExtraData) const { rExtraData.AppendAscii("AcceptChgDat:("); @@ -1403,3 +1255,5 @@ void SwRedlineAcceptDlg::FillInfo(String &rExtraData) const } rExtraData += ')'; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/redlndlg.src b/sw/source/ui/misc/redlndlg.src index 3af8626ee8..eb139b6c59 100644 --- a/sw/source/ui/misc/redlndlg.src +++ b/sw/source/ui/misc/redlndlg.src @@ -52,7 +52,6 @@ ModelessDialog DLG_REDLINE_ACCEPT { HelpID = HID_REDLINE_ACCEPT ; - /* ### ACHTUNG: Neuer Text in Resource? �nderungen akzeptieren oder verwerfen : Redlining */ Text [ en-US ] = "Accept or Reject Changes" ; REDLNDLG }; diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx index 8f5d5ffa80..6d8c8f0270 100644 --- a/sw/source/ui/misc/srtdlg.cxx +++ b/sw/source/ui/misc/srtdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,9 +34,7 @@ #include "srtdlg.hxx" -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <svl/intitem.hxx> #include <svl/eitem.hxx> #include <sfx2/dispatch.hxx> @@ -86,7 +85,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; using ::rtl::OUString; - void lcl_ClearLstBoxAndDelUserData( ListBox& rLstBox ) { void* pDel; @@ -100,8 +98,6 @@ void lcl_ClearLstBoxAndDelUserData( ListBox& rLstBox ) Beschreibung: Fuer Tabellenselektion sel. Zeilen und Spalten feststellen --------------------------------------------------------------------*/ - - sal_Bool lcl_GetSelTbl( SwWrtShell &rSh, sal_uInt16& rX, sal_uInt16& rY ) { const SwTableNode* pTblNd = rSh.IsCrsrInTbl(); @@ -129,7 +125,6 @@ sal_Bool lcl_GetSelTbl( SwWrtShell &rSh, sal_uInt16& rX, sal_uInt16& rY ) /*-------------------------------------------------------------------- Beschreibung: Init-Liste --------------------------------------------------------------------*/ - SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) : SvxStandardDialog(pParent, SW_RES(DLG_SORTING)), @@ -407,9 +402,6 @@ void SwSortDlg::Apply() InfoBox( this->GetParent(), SW_RES(MSG_SRTERR)).Execute(); } -/* -----------------30.09.98 10:03------------------- - * - * --------------------------------------------------*/ IMPL_LINK( SwSortDlg, DelimHdl, RadioButton*, pButton ) { sal_Bool bEnable = pButton == &aDelimFreeRB && aDelimFreeRB.IsEnabled(); @@ -439,7 +431,6 @@ IMPL_LINK( SwSortDlg, DelimCharHdl, PushButton*, EMPTYARG ) return 0; } - IMPL_LINK( SwSortDlg, CheckHdl, CheckBox *, pCheck ) { if( pCheck == ( CheckBox* ) &aRowRB) @@ -525,8 +516,4 @@ IMPL_LINK( SwSortDlg, LanguageHdl, ListBox*, pLBox ) return 0; } - - - - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/srtdlg.src b/sw/source/ui/misc/srtdlg.src index ddacdac459..5ff6c48a8c 100644 --- a/sw/source/ui/misc/srtdlg.src +++ b/sw/source/ui/misc/srtdlg.src @@ -68,7 +68,6 @@ ModalDialog DLG_SORTING { Pos = MAP_APPFONT ( 101, 12 ) ; Size = MAP_APPFONT ( 48 , 8 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Schl�sseltyp : Schl�sseltyp */ Text [ en-US ] = "Key type" ; Left = TRUE ; }; @@ -83,7 +82,6 @@ ModalDialog DLG_SORTING HelpID = "sw:CheckBox:DLG_SORTING:CB_KEY1"; Pos = MAP_APPFONT ( 12 , 25 ) ; Size = MAP_APPFONT ( 49 , 8 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Schl�ssel ~1 : Schl�ssel ~1 */ Text [ en-US ] = "Key ~1" ; Check = TRUE ; }; @@ -141,7 +139,6 @@ ModalDialog DLG_SORTING HelpID = "sw:CheckBox:DLG_SORTING:CB_KEY2"; Pos = MAP_APPFONT ( 12 , 52 ) ; Size = MAP_APPFONT ( 49 , 8 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Schl�ssel ~2 : Schl�ssel ~2 */ Text [ en-US ] = "Key ~2" ; }; NumericField ED_KEY2 @@ -193,7 +190,6 @@ ModalDialog DLG_SORTING HelpID = "sw:CheckBox:DLG_SORTING:CB_KEY3"; Pos = MAP_APPFONT ( 12 , 81 ) ; Size = MAP_APPFONT ( 49 , 8 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Schl�ssel ~3 : Schl�ssel ~3 */ Text [ en-US ] = "Key ~3" ; }; NumericField ED_KEY3 diff --git a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx index 5be24603a0..0e16b9ebaa 100644 --- a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx +++ b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,9 +42,7 @@ #include <redline.hxx> #include <tools/datetime.hxx> #include <vcl/msgbox.hxx> -#ifndef _SVSTDARR_HXX #include <svl/svstdarr.hxx> -#endif #include <svl/eitem.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> @@ -51,28 +50,16 @@ #include <svx/postattr.hxx> #include <swtypes.hxx> #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <swmodule.hxx> #include <swwait.hxx> #include <uitool.hxx> -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _MISC_HRC #include <misc.hrc> -#endif -#ifndef _REDLNDLG_HRC #include <redlndlg.hrc> -#endif -#ifndef _SHELLS_HRC #include <shells.hrc> -#endif #include <vector> #ifndef _REDLNDLG_HXX @@ -83,7 +70,6 @@ #include <unomid.h> - SwModalRedlineAcceptDlg::SwModalRedlineAcceptDlg(Window *pParent) : SfxModalDialog(pParent, SW_RES(DLG_MOD_REDLINE_ACCEPT)) { @@ -95,10 +81,6 @@ SwModalRedlineAcceptDlg::SwModalRedlineAcceptDlg(Window *pParent) : FreeResource(); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwModalRedlineAcceptDlg::~SwModalRedlineAcceptDlg() { AcceptAll(sal_False); // Alles uebriggebliebene ablehnen @@ -107,28 +89,16 @@ SwModalRedlineAcceptDlg::~SwModalRedlineAcceptDlg() delete pImplDlg; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwModalRedlineAcceptDlg::Activate() { } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwModalRedlineAcceptDlg::Resize() { pImplDlg->Resize(); SfxModalDialog::Resize(); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwModalRedlineAcceptDlg::AcceptAll( sal_Bool bAccept ) { SvxTPFilter* pFilterTP = pImplDlg->GetChgCtrl()->GetFilterPage(); @@ -145,3 +115,5 @@ void SwModalRedlineAcceptDlg::AcceptAll( sal_Bool bAccept ) pImplDlg->CallAcceptReject( sal_False, bAccept ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx new file mode 100644 index 0000000000..f41bc49c9d --- /dev/null +++ b/sw/source/ui/misc/titlepage.cxx @@ -0,0 +1,367 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara <caolanm@redhat.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sw.hxx" + +#ifdef SW_DLLIMPLEMENTATION +#undef SW_DLLIMPLEMENTATION +#endif + +#include <sfx2/viewfrm.hxx> +#include <vcl/msgbox.hxx> +#include <view.hxx> +#include <swmodule.hxx> +#include <wrtsh.hxx> +#include <poolfmt.hxx> +#include <docsh.hxx> +#include <charfmt.hxx> +#include <docstyle.hxx> + +#include "fldbas.hxx" +#include "lineinfo.hxx" +#include "globals.hrc" +#include "titlepage.hrc" +#include "titlepage.hxx" +#include "uitool.hxx" +#include "fmtpdsc.hxx" +#include "pagedesc.hxx" + +#include <IDocumentStylePoolAccess.hxx> + +namespace +{ + bool lcl_GetPageDesc(SwWrtShell *pSh, sal_uInt16 &rPageNo, const SwFmtPageDesc **ppPageFmtDesc) + { + bool bRet = false; + SfxItemSet aSet( pSh->GetAttrPool(), RES_PAGEDESC, RES_PAGEDESC ); + if (pSh->GetCurAttr( aSet )) + { + const SfxPoolItem* pItem(0); + if (SFX_ITEM_SET == aSet.GetItemState( RES_PAGEDESC, sal_True, &pItem ) && pItem) + { + rPageNo = ((const SwFmtPageDesc *)pItem)->GetNumOffset(); + if (ppPageFmtDesc) + (*ppPageFmtDesc) = (const SwFmtPageDesc *)(pItem->Clone()); + bRet = true; + } + } + return bRet; + } + + bool lcl_SkipNPages(SwWrtShell *pSh, sal_uInt16 nNoPages) + { + bool bAllOk = true; + for (sal_uInt16 nI = 0; nI < nNoPages && bAllOk; ++nI) + bAllOk = pSh->SttNxtPg(); + return bAllOk; + } + + void lcl_ChangePage(SwWrtShell *pSh, sal_uInt16 nNewNumber, + const SwPageDesc *pNewDesc) + { + const sal_uInt16 nCurIdx = pSh->GetCurPageDesc(); + const SwPageDesc &rCurrentDesc = pSh->GetPageDesc( nCurIdx ); + + const SwFmtPageDesc *pPageFmtDesc(0); + sal_uInt16 nDontCare; + lcl_GetPageDesc(pSh, nDontCare, &pPageFmtDesc); + + //If we want a new number then set it, otherwise reuse the existing one + sal_uInt16 nPgNo = nNewNumber ? + nNewNumber : ( pPageFmtDesc ? pPageFmtDesc->GetNumOffset() : 0 ); + + //If we want a new descriptior then set it, otherwise reuse the existing one + if (!pNewDesc) + { + SwFmtPageDesc aPageFmtDesc(pPageFmtDesc ? *pPageFmtDesc : &rCurrentDesc); + if (nPgNo) aPageFmtDesc.SetNumOffset(nPgNo); + pSh->SetAttr(aPageFmtDesc); + } + else + { + SwFmtPageDesc aPageFmtDesc(pNewDesc); + if (nPgNo) aPageFmtDesc.SetNumOffset(nPgNo); + pSh->SetAttr(aPageFmtDesc); + } + + delete pPageFmtDesc; + } + + void lcl_PushCursor(SwWrtShell *pSh) + { + pSh->LockView( sal_True ); + pSh->StartAllAction(); + pSh->SwCrsrShell::Push(); + } + + void lcl_PopCursor(SwWrtShell *pSh) + { + pSh->SwCrsrShell::Pop( sal_False ); + pSh->EndAllAction(); + pSh->LockView( sal_False ); + } + + sal_uInt16 lcl_GetCurrentPage(SwWrtShell *pSh) + { + String sDummy; + sal_uInt16 nPhyNum=1, nVirtNum=1; + pSh->GetPageNumber(0, true, nPhyNum, nVirtNum, sDummy); + return nPhyNum; + } +} + +/* + * Only include the Index page in the list if the page count implies one + * to reduce confusing things + */ +void SwTitlePageDlg::FillList() +{ + sal_uInt16 nTitlePages = aPageCountNF.GetValue(); + aPagePropertiesLB.Clear(); + if (mpTitleDesc) + aPagePropertiesLB.InsertEntry(mpTitleDesc->GetName()); + if (nTitlePages > 1 && mpIndexDesc) + aPagePropertiesLB.InsertEntry(mpIndexDesc->GetName()); + if (mpNormalDesc) + aPagePropertiesLB.InsertEntry(mpNormalDesc->GetName()); + aPagePropertiesLB.SelectEntryPos(0); +} + +sal_uInt16 SwTitlePageDlg::GetInsertPosition() const +{ + sal_uInt16 nPage = 1; + if (aPageStartNF.IsEnabled()) + nPage = aPageStartNF.GetValue(); + return nPage; +} + +SwTitlePageDlg::SwTitlePageDlg( Window *pParent ) : + SfxModalDialog( pParent, SW_RES(DLG_TITLEPAGE) ), +#ifdef MSC +#pragma warning (disable : 4355) +#endif + aMakeInsertFL ( this, SW_RES( FL_MAKEINSERT )), + aUseExistingPagesRB ( this, SW_RES( RB_USE_EXISTING_PAGES )), + aInsertNewPagesRB ( this, SW_RES( RB_INSERT_NEW_PAGES )), + aPageCountFT ( this, SW_RES( FT_PAGE_COUNT )), + aPageCountNF ( this, SW_RES( NF_PAGE_COUNT )), + aPagePagesFT ( this, SW_RES( FT_PAGE_PAGES )), + aPageStartFT ( this, SW_RES( FT_PAGE_START )), + aDocumentStartRB ( this, SW_RES( RB_DOCUMENT_START )), + aPageStartRB ( this, SW_RES( RB_PAGE_START )), + aPageStartNF ( this, SW_RES( NF_PAGE_START )), + aNumberingFL ( this, SW_RES( FL_NUMBERING )), + aRestartNumberingCB ( this, SW_RES( CB_RESTART_NUMBERING )), + aRestartNumberingFT ( this, SW_RES( FT_RESTART_NUMBERING )), + aRestartNumberingNF ( this, SW_RES( NF_RESTART_NUMBERING )), + aSetPageNumberCB ( this, SW_RES( CB_SET_PAGE_NUMBER )), + aSetPageNumberFT ( this, SW_RES( FT_SET_PAGE_NUMBER )), + aSetPageNumberNF ( this, SW_RES( NF_SET_PAGE_NUMBER )), + aPagePropertiesFL ( this, SW_RES( FL_PAGE_PROPERTIES )), + aPagePropertiesLB ( this, SW_RES( LB_PAGE_PROPERTIES )), + aPagePropertiesPB ( this, SW_RES( PB_PAGE_PROPERTIES )), + aBottomFL ( this, SW_RES( FL_BOTTOM )), + aOkPB ( this, SW_RES( PB_OK )), + aCancelPB ( this, SW_RES( PB_CANCEL )), + aHelpPB ( this, SW_RES( PB_HELP )), + mpPageFmtDesc (0) +#ifdef MSC +#pragma warning (default : 4355) +#endif +{ + FreeResource(); + + aOkPB.SetClickHdl(LINK(this, SwTitlePageDlg, OKHdl)); + aRestartNumberingCB.SetClickHdl(LINK(this, SwTitlePageDlg, RestartNumberingHdl)); + aSetPageNumberCB.SetClickHdl(LINK(this, SwTitlePageDlg, SetPageNumberHdl)); + + sal_uInt16 nSetPage = 1; + sal_uInt16 nResetPage = 1; + sal_uInt16 nTitlePages = 1; + mpSh = ::GetActiveView()->GetWrtShellPtr(); + lcl_PushCursor(mpSh); + + SwView& rView = mpSh->GetView(); + rView.InvalidateRulerPos(); + + bool bMaybeResetNumbering = false; + + mpTitleDesc = mpSh->GetPageDescFromPool(RES_POOLPAGE_FIRST); + mpIndexDesc = mpSh->GetPageDescFromPool(RES_POOLPAGE_REGISTER); + mpNormalDesc = mpSh->GetPageDescFromPool(RES_POOLPAGE_STANDARD); + + mpSh->SttDoc(); + if (lcl_GetPageDesc( mpSh, nSetPage, &mpPageFmtDesc )) + { + if (mpPageFmtDesc->GetPageDesc() == mpTitleDesc) + { + while (mpSh->SttNxtPg()) + { + const sal_uInt16 nCurIdx = mpSh->GetCurPageDesc(); + const SwPageDesc &rPageDesc = mpSh->GetPageDesc( nCurIdx ); + + if (mpIndexDesc != &rPageDesc) + { + mpNormalDesc = &rPageDesc; + bMaybeResetNumbering = lcl_GetPageDesc(mpSh, nResetPage, NULL); + break; + } + ++nTitlePages; + } + } + } + lcl_PopCursor(mpSh); + + aUseExistingPagesRB.Check(); + aPageCountNF.SetValue(nTitlePages); + aPageCountNF.SetUpHdl(LINK(this, SwTitlePageDlg, UpHdl)); + aPageCountNF.SetDownHdl(LINK(this, SwTitlePageDlg, DownHdl)); + + aDocumentStartRB.Check(); + aPageStartNF.Enable(false); + aPageStartNF.SetValue(lcl_GetCurrentPage(mpSh)); + Link aStartPageHdl = LINK(this, SwTitlePageDlg, StartPageHdl); + aDocumentStartRB.SetClickHdl(aStartPageHdl); + aPageStartRB.SetClickHdl(aStartPageHdl); + + if (bMaybeResetNumbering && nResetPage > 0) + { + aRestartNumberingCB.Check(); + aRestartNumberingNF.SetValue(nResetPage); + } + aRestartNumberingNF.Enable(aRestartNumberingCB.IsChecked()); + + aSetPageNumberNF.SetValue(nSetPage); + if (nSetPage > 1) + aSetPageNumberCB.Check(); + aSetPageNumberNF.Enable(aSetPageNumberCB.IsChecked()); + + FillList(); + aPagePropertiesPB.SetClickHdl(LINK(this, SwTitlePageDlg, EditHdl)); +} + +IMPL_LINK(SwTitlePageDlg, UpHdl, NumericField *, EMPTYARG) +{ + if (aPageCountNF.GetValue() == 2) + FillList(); + return 0; +} + +IMPL_LINK(SwTitlePageDlg, DownHdl, NumericField *, EMPTYARG) +{ + if (aPageCountNF.GetValue() == 1) + FillList(); + return 0; +} + +IMPL_LINK(SwTitlePageDlg, RestartNumberingHdl, CheckBox*, EMPTYARG) +{ + aRestartNumberingNF.Enable(aRestartNumberingCB.IsChecked()); + return 0; +} + +IMPL_LINK(SwTitlePageDlg, SetPageNumberHdl, CheckBox*, EMPTYARG) +{ + aSetPageNumberNF.Enable(aSetPageNumberCB.IsChecked()); + return 0; +} + +IMPL_LINK(SwTitlePageDlg, StartPageHdl, RadioButton*, EMPTYARG) +{ + aPageStartNF.Enable(aPageStartRB.IsChecked()); + return 0; +} + +SwTitlePageDlg::~SwTitlePageDlg() +{ + delete mpPageFmtDesc; +} + +IMPL_LINK( SwTitlePageDlg, EditHdl, Button *, /*pBtn*/ ) +{ + SwView& rView = mpSh->GetView(); + rView.GetDocShell()->FormatPage(aPagePropertiesLB.GetSelectEntry(), false, mpSh); + rView.InvalidateRulerPos(); + + return 0; +} + +IMPL_LINK( SwTitlePageDlg, OKHdl, Button *, /*pBtn*/ ) +{ + lcl_PushCursor(mpSh); + + mpSh->StartUndo(); + + SwFmtPageDesc aTitleDesc(mpTitleDesc); + + if (aSetPageNumberCB.IsChecked()) + aTitleDesc.SetNumOffset(aSetPageNumberNF.GetValue()); + else if (mpPageFmtDesc) + aTitleDesc.SetNumOffset(mpPageFmtDesc->GetNumOffset()); + + sal_uInt16 nNoPages = aPageCountNF.GetValue(); + if (!aUseExistingPagesRB.IsChecked()) + { + mpSh->GotoPage(GetInsertPosition(), false); + for (sal_uInt16 nI=0; nI < nNoPages; ++nI) + mpSh->InsertPageBreak(); + } + + mpSh->GotoPage(GetInsertPosition(), false); + for (sal_uInt16 nI=1; nI < nNoPages; ++nI) + { + if (mpSh->SttNxtPg()) + lcl_ChangePage(mpSh, 0, mpIndexDesc); + } + + mpSh->GotoPage(GetInsertPosition(), false); + mpSh->SetAttr(aTitleDesc); + + if (nNoPages > 1 && mpSh->GotoPage(GetInsertPosition() + nNoPages, false)) + { + SwFmtPageDesc aPageFmtDesc(mpNormalDesc); + mpSh->SetAttr(aPageFmtDesc); + } + + if (aRestartNumberingCB.IsChecked() || nNoPages > 1) + { + sal_uInt16 nPgNo = aRestartNumberingCB.IsChecked() ? aRestartNumberingNF.GetValue() : 0; + const SwPageDesc *pNewDesc = nNoPages > 1 ? mpNormalDesc : 0; + mpSh->GotoPage(GetInsertPosition() + nNoPages, false); + lcl_ChangePage(mpSh, nPgNo, pNewDesc); + } + + mpSh->EndUndo(); + lcl_PopCursor(mpSh); + if (!aUseExistingPagesRB.IsChecked()) + mpSh->GotoPage(GetInsertPosition(), false); + EndDialog( RET_OK ); + return 0; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/titlepage.hrc b/sw/source/ui/misc/titlepage.hrc new file mode 100644 index 0000000000..63678427cf --- /dev/null +++ b/sw/source/ui/misc/titlepage.hrc @@ -0,0 +1,50 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara <caolanm@redhat.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#define FL_MAKEINSERT 1 +#define RB_USE_EXISTING_PAGES 2 +#define RB_INSERT_NEW_PAGES 3 +#define FT_PAGE_COUNT 4 +#define NF_PAGE_COUNT 5 +#define FT_PAGE_PAGES 6 +#define FT_PAGE_START 7 +#define RB_DOCUMENT_START 8 +#define RB_PAGE_START 9 +#define NF_PAGE_START 10 +#define FL_NUMBERING 11 +#define CB_RESTART_NUMBERING 12 +#define FT_RESTART_NUMBERING 13 +#define NF_RESTART_NUMBERING 14 +#define CB_SET_PAGE_NUMBER 15 +#define FT_SET_PAGE_NUMBER 16 +#define NF_SET_PAGE_NUMBER 17 +#define FL_PAGE_PROPERTIES 18 +#define LB_PAGE_PROPERTIES 19 +#define PB_PAGE_PROPERTIES 20 +#define FL_BOTTOM 21 +#define PB_OK 22 +#define PB_CANCEL 23 +#define PB_HELP 24 diff --git a/sw/source/ui/misc/titlepage.src b/sw/source/ui/misc/titlepage.src new file mode 100644 index 0000000000..8e6aec6cff --- /dev/null +++ b/sw/source/ui/misc/titlepage.src @@ -0,0 +1,248 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Caolán McNamara <caolanm@redhat.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +/* StarView ressource file */ + +#include <sfx2/sfx.hrc> +#include <svx/dialogs.hrc> +#include "globals.hrc" +#include "misc.hrc" +#include "titlepage.hrc" +#include "helpid.h" +/**************************************************************************/ +/* */ +/**************************************************************************/ +ModalDialog DLG_TITLEPAGE +{ + HelpID = HID_TITLEPAGE ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 216 , 229 ) ; + Text [ en-US ] = "Title Pages" ; + Moveable = TRUE ; + + FixedLine FL_MAKEINSERT + { + Pos = MAP_APPFONT ( 6 , 5 ) ; + Size = MAP_APPFONT ( 204 , 8 ) ; + Text [ en-US ] = "Make Title Pages" ; + Text [ x-comment ] = " "; + }; + RadioButton RB_USE_EXISTING_PAGES + { + Pos = MAP_APPFONT ( 12 , 18 ) ; + Size = MAP_APPFONT ( 198 , 10 ) ; + Text [ en-US ] = "Convert existing pages to title pages" ; + TabStop = TRUE ; + Check = TRUE ; + Text [ x-comment ] = " "; + }; + RadioButton RB_INSERT_NEW_PAGES + { + Pos = MAP_APPFONT ( 12 , 34 ) ; + Size = MAP_APPFONT ( 198 , 10 ) ; + Text [ en-US ] = "Insert new title pages" ; + Text [ x-comment ] = " "; + }; + FixedText FT_PAGE_COUNT + { + Pos = MAP_APPFONT ( 12 , 50 ) ; + Size = MAP_APPFONT ( 82 , 8 ) ; + Text [ en-US ] = "Number of title pages" ; + Text [ x-comment ] = " "; + }; + NumericField NF_PAGE_COUNT + { + Pos = MAP_APPFONT ( 100 , 50 ) ; + Size = MAP_APPFONT ( 30 , 12 ) ; + Border = TRUE ; + TabStop = TRUE ; + Left = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 1 ; + Maximum = 65535; + First = 1 ; + Last = 65535; + SpinSize = 1 ; + }; + FixedText FT_PAGE_PAGES + { + Pos = MAP_APPFONT ( 136 , 50 ) ; + Size = MAP_APPFONT ( 80 , 10 ) ; + Text [ en-US ] = "pages" ; + Text [ x-comment ] = " "; + }; + FixedText FT_PAGE_START + { + Pos = MAP_APPFONT ( 12 , 66 ) ; + Size = MAP_APPFONT ( 82 , 8 ) ; + Text [ en-US ] = "Place title pages at" ; + Text [ x-comment ] = " "; + }; + RadioButton RB_DOCUMENT_START + { + Pos = MAP_APPFONT ( 100 , 66 ) ; + Size = MAP_APPFONT ( 110 , 10 ) ; + Text [ en-US ] = "Document Start" ; + TabStop = TRUE ; + Check = TRUE ; + Text [ x-comment ] = " "; + }; + RadioButton RB_PAGE_START + { + Pos = MAP_APPFONT ( 100 , 78 ) ; + Size = MAP_APPFONT ( 30 , 10 ) ; + Text [ en-US ] = "Page" ; + Text [ x-comment ] = " "; + }; + NumericField NF_PAGE_START + { + Pos = MAP_APPFONT ( 131 , 78 ) ; + Size = MAP_APPFONT ( 30 , 12 ) ; + Border = TRUE ; + TabStop = TRUE ; + Left = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 1 ; + Maximum = 65535; + First = 1 ; + Last = 65535; + SpinSize = 1 ; + }; + FixedLine FL_NUMBERING + { + Pos = MAP_APPFONT ( 6 , 98 ) ; + Size = MAP_APPFONT ( 204 , 8 ) ; + Text [ en-US ] = "Page Numbering" ; + Text [ x-comment ] = " "; + }; + CheckBox CB_RESTART_NUMBERING + { + Pos = MAP_APPFONT ( 12, 111 ) ; + Size = MAP_APPFONT ( 198 , 10 ) ; + TabStop = TRUE ; + Text [ en-US ] = "Reset Page Numbering after title pages" ; + Text [ x-comment ] = " "; + }; + FixedText FT_RESTART_NUMBERING + { + Pos = MAP_APPFONT ( 20 , 125 ) ; + Size = MAP_APPFONT ( 74 , 10 ) ; + Text [ en-US ] = "Page Number" ; + Text [ x-comment ] = " "; + }; + NumericField NF_RESTART_NUMBERING + { + Pos = MAP_APPFONT ( 100 , 125 ) ; + Size = MAP_APPFONT ( 30 , 12 ) ; + Border = TRUE ; + TabStop = TRUE ; + Left = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 1 ; + Maximum = 65535; + First = 1 ; + Last = 65535; + SpinSize = 1 ; + }; + CheckBox CB_SET_PAGE_NUMBER + { + Pos = MAP_APPFONT ( 12 , 139 ) ; + Size = MAP_APPFONT ( 198 , 10 ) ; + TabStop = TRUE ; + Text [ en-US ] = "Set Page Number for first title page" ; + Text [ x-comment ] = " "; + }; + FixedText FT_SET_PAGE_NUMBER + { + Pos = MAP_APPFONT ( 20 , 153 ) ; + Size = MAP_APPFONT ( 74 , 10 ) ; + Text [ en-US ] = "Page Number" ; + Text [ x-comment ] = " "; + }; + NumericField NF_SET_PAGE_NUMBER + { + Pos = MAP_APPFONT ( 100 , 153 ) ; + Size = MAP_APPFONT ( 30 , 12 ) ; + Border = TRUE ; + TabStop = TRUE ; + Left = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 1 ; + Maximum = 65535; + First = 1 ; + Last = 65535; + SpinSize = 1 ; + }; + FixedLine FL_PAGE_PROPERTIES + { + Pos = MAP_APPFONT ( 6 , 169 ) ; + Size = MAP_APPFONT ( 204 , 8 ) ; + Text [ en-US ] = "Edit Page Properties" ; + Text [ x-comment ] = " "; + }; + ListBox LB_PAGE_PROPERTIES + { + Border = TRUE ; + Pos = MAP_APPFONT ( 12 , 182 ) ; + Size = MAP_APPFONT ( 132 , 80 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + CurPos = 0 ; + }; + PushButton PB_PAGE_PROPERTIES + { + Pos = MAP_APPFONT ( 150 , 182 ) ; + Size = MAP_APPFONT ( 50 , 12 ) ; + Text [ en-US ] = "Edit..." ; + }; + FixedLine FL_BOTTOM + { + Pos = MAP_APPFONT ( 6 , 198 ) ; + Size = MAP_APPFONT ( 204 , 8 ) ; + }; + OKButton PB_OK + { + Pos = MAP_APPFONT ( 54 , 209 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + DefButton = TRUE ; + }; + CancelButton PB_CANCEL + { + Pos = MAP_APPFONT ( 107 , 209 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + DefButton = TRUE ; + }; + HelpButton PB_HELP + { + Pos = MAP_APPFONT ( 160 , 209 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + }; +}; diff --git a/sw/source/ui/ribbar/conarc.cxx b/sw/source/ui/ribbar/conarc.cxx index de256b77c2..fde2a98d7d 100644 --- a/sw/source/ui/ribbar/conarc.cxx +++ b/sw/source/ui/ribbar/conarc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -106,11 +107,6 @@ sal_Bool ConstArc::MouseButtonUp( const MouseEvent& rMEvt ) m_pSh->EndCreate(SDRCREATE_NEXTPOINT); } } -/* else if ( pView->IsCreateObj() && rMEvt.IsRight() ) - { - pView->EndCreateObj( SDRCREATE_FORCEEND ); - bReturn = sal_True; - }*/ return (bReturn); } @@ -159,3 +155,4 @@ void ConstArc::Deactivate() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/ribbar/concustomshape.cxx b/sw/source/ui/ribbar/concustomshape.cxx index 75a656ae71..ff266f1b47 100644 --- a/sw/source/ui/ribbar/concustomshape.cxx +++ b/sw/source/ui/ribbar/concustomshape.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,24 +41,16 @@ #include <svx/svdview.hxx> #include <svx/svdocapt.hxx> #include <editeng/outlobj.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <edtwin.hxx> #include <wrtsh.hxx> #include <viewopt.hxx> -#ifndef _DRAWBASE_HXX #include <drawbase.hxx> -#endif #include <concustomshape.hxx> #include <svx/gallery.hxx> #include <sfx2/request.hxx> -#ifndef _FM_FMMODEL_HXX #include <svx/fmmodel.hxx> -#endif #include <svl/itempool.hxx> #include <svx/svdpage.hxx> #include <svx/svdoashp.hxx> @@ -116,13 +109,9 @@ sal_Bool ConstCustomShape::MouseButtonDown(const MouseEvent& rMEvt) if ( pObj ) { SetAttributes( pObj ); - sal_Bool bForceFillStyle = sal_True; sal_Bool bForceNoFillStyle = sal_False; if ( ((SdrObjCustomShape*)pObj)->UseNoFillStyle() ) - { - bForceFillStyle = sal_False; bForceNoFillStyle = sal_True; - } SfxItemSet aAttr( m_pView->GetPool() ); if ( bForceNoFillStyle ) @@ -250,3 +239,5 @@ bool ConstCustomShape::doConstructOrthogonal() const } // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/ribbar/conform.cxx b/sw/source/ui/ribbar/conform.cxx index 29ec731994..46082251a8 100644 --- a/sw/source/ui/ribbar/conform.cxx +++ b/sw/source/ui/ribbar/conform.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -120,9 +121,7 @@ void ConstFormControl::Activate(const sal_uInt16 nSlotId) m_pWin->SetPointer(Pointer(POINTER_DRAW_RECT)); } -/* -----------------------------19.04.2002 12:42------------------------------ - ---------------------------------------------------------------------------*/ void ConstFormControl::CreateDefaultObject() { Point aStartPos(GetDefaultCenterPos()); @@ -142,3 +141,4 @@ void ConstFormControl::CreateDefaultObject() m_pSh->EndCreate(SDRCREATE_FORCEEND); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/ribbar/conpoly.cxx b/sw/source/ui/ribbar/conpoly.cxx index eb5baeadf0..5dbb5583ba 100644 --- a/sw/source/ui/ribbar/conpoly.cxx +++ b/sw/source/ui/ribbar/conpoly.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -161,3 +162,4 @@ void ConstPolygon::Activate(const sal_uInt16 nSlotId) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/ribbar/conrect.cxx b/sw/source/ui/ribbar/conrect.cxx index 608f3ebc08..315006cc3d 100644 --- a/sw/source/ui/ribbar/conrect.cxx +++ b/sw/source/ui/ribbar/conrect.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -227,3 +228,4 @@ void ConstRectangle::Activate(const sal_uInt16 nSlotId) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/ribbar/drawbase.cxx b/sw/source/ui/ribbar/drawbase.cxx index 16e59ba0c9..1b28476669 100644 --- a/sw/source/ui/ribbar/drawbase.cxx +++ b/sw/source/ui/ribbar/drawbase.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -29,7 +30,6 @@ #include "precompiled_sw.hxx" #include <hintids.hxx> -#include <tools/list.hxx> #include <svx/svdview.hxx> #include <svx/svdobj.hxx> #include <svl/ptitem.hxx> @@ -81,7 +81,7 @@ SwDrawBase::SwDrawBase(SwWrtShell* pSwWrtShell, SwEditWin* pWindow, SwView* pSwV |* \************************************************************************/ -__EXPORT SwDrawBase::~SwDrawBase() +SwDrawBase::~SwDrawBase() { if (m_pView->GetWrtShellPtr()) // Im view-Dtor koennte die wrtsh bereits geloescht worden sein... m_pSh->GetDrawView()->SetEditMode(sal_True); @@ -101,7 +101,6 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt) SdrView *pSdrView = m_pSh->GetDrawView(); // #i33136# - // pSdrView->SetOrtho(rMEvt.IsShift()); pSdrView->SetOrtho(doConstructOrthogonal() ? !rMEvt.IsShift() : rMEvt.IsShift()); pSdrView->SetAngleSnapEnabled(rMEvt.IsShift()); @@ -212,8 +211,6 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt) { bNoInterrupt = sal_True; pSdrView->MarkPoint(*pHdl); -// bReturn = pSdrView->BegDragObj(m_aStartPos, (OutputDevice*) NULL, pHdl); -// m_pWin->SetDrawAction(sal_True); } } } @@ -240,11 +237,9 @@ sal_Bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt) { if (!pSdrView->HasMarkablePoints()) { - //JP 10.10.2001: Bug 89619 - don't scroll the - // cursor into the visible area sal_Bool bUnlockView = !m_pSh->IsViewLocked(); m_pSh->LockView( sal_True ); //lock visible section - m_pSh->SelectObj(Point(LONG_MAX, LONG_MAX)); // Alles deselektieren + m_pSh->SelectObj(Point(LONG_MAX, LONG_MAX)); // deselect all if( bUnlockView ) m_pSh->LockView( sal_False ); } @@ -281,7 +276,6 @@ sal_Bool SwDrawBase::MouseMove(const MouseEvent& rMEvt) if (IsCreateObj() && !m_pWin->IsDrawSelMode() && pSdrView->IsCreateObj()) { // #i33136# - // pSdrView->SetOrtho(rMEvt.IsShift()); pSdrView->SetOrtho(doConstructOrthogonal() ? !rMEvt.IsShift() : rMEvt.IsShift()); pSdrView->SetAngleSnapEnabled(rMEvt.IsShift()); @@ -519,7 +513,7 @@ void SwDrawBase::Activate(const sal_uInt16 nSlot) \************************************************************************/ -void __EXPORT SwDrawBase::Deactivate() +void SwDrawBase::Deactivate() { SdrView *pSdrView = m_pSh->GetDrawView(); pSdrView->SetOrtho(sal_False); @@ -533,9 +527,6 @@ void __EXPORT SwDrawBase::Deactivate() m_pWin->ReleaseMouse(); bNoInterrupt = sal_False; -// if(!m_pSh->IsObjSelected()) -// m_pSh->Edit(); - if(m_pWin->GetApplyTemplate()) m_pWin->SetApplyTemplate(SwApplyTemplate()); m_pSh->GetView().GetViewFrame()->GetBindings().Invalidate(SID_INSERT_DRAW); @@ -649,7 +640,6 @@ void SwDrawBase::BreakCreate() m_pWin->ReleaseMouse(); Deactivate(); -// m_pView->LeaveDrawCreate(); } /************************************************************************* @@ -702,9 +692,7 @@ void SwDrawBase::EnterSelectMode(const MouseEvent& rMEvt) m_pView->NoRotate(); } } -/* -----------------------------03.04.2002 10:52------------------------------ - ---------------------------------------------------------------------------*/ void SwDrawBase::CreateDefaultObject() { Point aStartPos = GetDefaultCenterPos(); @@ -716,9 +704,7 @@ void SwDrawBase::CreateDefaultObject() Rectangle aRect(aStartPos, aEndPos); m_pSh->CreateDefaultShape( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), aRect, m_nSlotId); } -/* -----------------25.10.2002 14:14----------------- - * - * --------------------------------------------------*/ + Point SwDrawBase::GetDefaultCenterPos() { Size aDocSz(m_pSh->GetDocSize()); @@ -738,3 +724,5 @@ bool SwDrawBase::doConstructOrthogonal() const } // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/ribbar/dselect.cxx b/sw/source/ui/ribbar/dselect.cxx index d2871f0c91..65056b24e6 100644 --- a/sw/source/ui/ribbar/dselect.cxx +++ b/sw/source/ui/ribbar/dselect.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -100,3 +101,4 @@ void DrawSelection::Activate(const sal_uInt16 nSlotId) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx index 0016a4ac45..a2be68441f 100755 --- a/sw/source/ui/ribbar/inputwin.cxx +++ b/sw/source/ui/ribbar/inputwin.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -99,10 +100,9 @@ SwInputWindow::SwInputWindow( Window* pParent, SfxBindings* pBind ) InsertWindow( ED_FORMULA, &aEdit); SetHelpId(ED_FORMULA, HID_EDIT_FORMULA); - sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); - SetItemImage( FN_FORMULA_CALC, pManager->GetImage(FN_FORMULA_CALC, bHC )); - SetItemImage( FN_FORMULA_CANCEL, pManager->GetImage(FN_FORMULA_CANCEL, bHC )); - SetItemImage( FN_FORMULA_APPLY, pManager->GetImage(FN_FORMULA_APPLY, bHC )); + SetItemImage( FN_FORMULA_CALC, pManager->GetImage(FN_FORMULA_CALC )); + SetItemImage( FN_FORMULA_CANCEL, pManager->GetImage(FN_FORMULA_CANCEL )); + SetItemImage( FN_FORMULA_APPLY, pManager->GetImage(FN_FORMULA_APPLY )); SetItemBits( FN_FORMULA_CALC, GetItemBits( FN_FORMULA_CALC ) | TIB_DROPDOWNONLY ); SetDropdownClickHdl( LINK( this, SwInputWindow, DropdownClickHdl )); @@ -133,7 +133,7 @@ SwInputWindow::SwInputWindow( Window* pParent, SfxBindings* pBind ) //================================================================== -__EXPORT SwInputWindow::~SwInputWindow() +SwInputWindow::~SwInputWindow() { SfxImageManager::GetImageManager( SW_MOD() )->ReleaseToolBox(this); @@ -178,11 +178,9 @@ void SwInputWindow::DataChanged( const DataChangedEvent& rDCEvt ) // update item images SwModule *pMod = SW_MOD(); SfxImageManager *pImgMgr = SfxImageManager::GetImageManager( pMod ); - sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); - // - SetItemImage( FN_FORMULA_CALC, pImgMgr->GetImage(FN_FORMULA_CALC, bHC )); - SetItemImage( FN_FORMULA_CANCEL, pImgMgr->GetImage(FN_FORMULA_CANCEL, bHC )); - SetItemImage( FN_FORMULA_APPLY, pImgMgr->GetImage(FN_FORMULA_APPLY, bHC )); + SetItemImage( FN_FORMULA_CALC, pImgMgr->GetImage(FN_FORMULA_CALC )); + SetItemImage( FN_FORMULA_CANCEL, pImgMgr->GetImage(FN_FORMULA_CANCEL )); + SetItemImage( FN_FORMULA_APPLY, pImgMgr->GetImage(FN_FORMULA_APPLY )); } ToolBox::DataChanged( rDCEvt ); @@ -190,7 +188,7 @@ void SwInputWindow::DataChanged( const DataChangedEvent& rDCEvt ) //================================================================== -void __EXPORT SwInputWindow::Resize() +void SwInputWindow::Resize() { ToolBox::Resize(); @@ -214,7 +212,7 @@ void SwInputWindow::ShowWin() pView->GetHLineal().SetActive( sal_False ); pView->GetVLineal().SetActive( sal_False ); - DBG_ASSERT(pWrtShell, "Keine WrtShell!"); + OSL_ENSURE(pWrtShell, "no WrtShell!"); // Cursor in Tabelle bIsTable = pWrtShell->IsCrsrInTbl() ? sal_True : sal_False; @@ -235,11 +233,11 @@ void SwInputWindow::ShowWin() aPos.SetText(SW_RESSTR(STR_TBL_FORMULA)); // Aktuelles Feld bearbeiten - ASSERT(pMgr == 0, FieldManager nicht geloescht.); + OSL_ENSURE(pMgr == 0, "FieldManager not deleted"); pMgr = new SwFldMgr; - // JP 13.01.97: Formel soll immer mit einem "=" beginnen, hier - // also setzen + // Formel soll immer mit einem "=" beginnen, hier + // also setzen String sEdit( '=' ); if( pMgr->GetCurFld() && TYP_FORMELFLD == pMgr->GetCurTypeId() ) { @@ -314,7 +312,7 @@ void SwInputWindow::ShowWin() IMPL_LINK( SwInputWindow, MenuHdl, Menu *, pMenu ) { -static const char * __READONLY_DATA aStrArr[] = { +static const char * const aStrArr[] = { sCalc_Phd, sCalc_Sqrt, sCalc_Or, @@ -373,7 +371,7 @@ IMPL_LINK( SwInputWindow, DropdownClickHdl, ToolBox*, EMPTYARG ) //================================================================== -void __EXPORT SwInputWindow::Click( ) +void SwInputWindow::Click( ) { sal_uInt16 nCurID = GetCurItemId(); EndSelection(); // setzt CurItemId zurueck ! @@ -401,8 +399,8 @@ void SwInputWindow::ApplyFormula() CleanupUglyHackWithUndo(); pWrtShell->Pop( sal_False ); - // JP 13.01.97: Formel soll immer mit einem "=" beginnen, hier - // also wieder entfernen + // Formel soll immer mit einem "=" beginnen, hier + // also wieder entfernen String sEdit( aEdit.GetText() ); sEdit.EraseLeadingChars().EraseTrailingChars(); if( sEdit.Len() && '=' == sEdit.GetChar( 0 ) ) @@ -536,7 +534,7 @@ void SwInputWindow::DelBoxCntnt() //================================================================== -void __EXPORT InputEdit::KeyInput(const KeyEvent& rEvent) +void InputEdit::KeyInput(const KeyEvent& rEvent) { const KeyCode aCode = rEvent.GetKeyCode(); if(aCode == KEY_RETURN || aCode == KEY_F2 ) @@ -549,7 +547,7 @@ void __EXPORT InputEdit::KeyInput(const KeyEvent& rEvent) //================================================================== -void __EXPORT InputEdit::UpdateRange(const String& rBoxes, +void InputEdit::UpdateRange(const String& rBoxes, const String& rName ) { if( !rBoxes.Len() ) @@ -582,7 +580,7 @@ void __EXPORT InputEdit::UpdateRange(const String& rBoxes, aStr += cClose; SetText(aStr); sal_uInt16 nPos = aStr.Search( cClose ); - ASSERT(nPos < aStr.Len(), Delimiter nicht gefunden.); + OSL_ENSURE(nPos < aStr.Len(), "delimiter not found"); ++nPos; SetSelection( Selection( nPos, nPos )); } @@ -608,8 +606,7 @@ void __EXPORT InputEdit::UpdateRange(const String& rBoxes, nEndPos = nStartPos; while( nEndPos < nLen ) { - if( cClose == (cCh = aActText.GetChar( nEndPos )) /*|| - cCh == cCloseBracket*/ ) + if( cClose == (cCh = aActText.GetChar( nEndPos ))) { bFound = sal_True; break; @@ -641,7 +638,6 @@ void __EXPORT InputEdit::UpdateRange(const String& rBoxes, { SetText( aActText ); SetSelection( Selection( nPos, nPos ) ); -// GetModifyHdl().Call( this ); } } GrabFocus(); @@ -649,7 +645,6 @@ void __EXPORT InputEdit::UpdateRange(const String& rBoxes, } //================================================================== - SwInputChild::SwInputChild(Window* _pParent, sal_uInt16 nId, SfxBindings* pBindings, @@ -663,16 +658,17 @@ SwInputChild::SwInputChild(Window* _pParent, } -__EXPORT SwInputChild::~SwInputChild() +SwInputChild::~SwInputChild() { if(pDispatch) pDispatch->Lock(sal_False); } -SfxChildWinInfo __EXPORT SwInputChild::GetInfo() const +SfxChildWinInfo SwInputChild::GetInfo() const { SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \ return aInfo; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/ribbar/inputwin.src b/sw/source/ui/ribbar/inputwin.src index 24ae9a48bc..8e6d36ad62 100644 --- a/sw/source/ui/ribbar/inputwin.src +++ b/sw/source/ui/ribbar/inputwin.src @@ -47,22 +47,18 @@ ToolBox RID_TBX_FORMULA HelpId = HID_TBX_FORMULA_CALC ; DropDown = TRUE ; Text [ en-US ] = "Formula" ; - /* ### ACHTUNG: Neuer Text in Resource? Formel ausw�hlen : Formel ausw�hlen */ }; ToolBoxItem { Identifier = FN_FORMULA_CANCEL ; HelpId = HID_TBX_FORMULA_CANCEL ; Text [ en-US ] = "Cancel" ; - /* ### ACHTUNG: Neuer Text in Resource? Formel nicht �benehmen : Formel nicht �benehmen */ }; ToolBoxItem { Identifier = FN_FORMULA_APPLY ; HelpId = HID_TBX_FORMULA_APPLY ; - /* ### ACHTUNG: Neuer Text in Resource? �bernehmen : �bernehmen */ Text [ en-US ] = "Apply" ; - /* ### ACHTUNG: Neuer Text in Resource? Formel einf�gen : Formel einf�gen */ }; }; Edit ED_POS @@ -152,7 +148,6 @@ Menu MN_CALC_POPUP { Identifier = MN_CALC_GEQ ; HelpID = HID_MN_CALC_GEQ ; - /* ### ACHTUNG: Neuer Text in Resource? Gr~��er Gleich : Gr~��er Gleich */ Text [ en-US ] = "Greater Than or Equal" ; }; MenuItem @@ -165,7 +160,6 @@ Menu MN_CALC_POPUP { Identifier = MN_CALC_GRE ; HelpID = HID_MN_CALC_GRE ; - /* ### ACHTUNG: Neuer Text in Resource? G~r��er : G~r��er */ Text [ en-US ] = "Greater" ; }; MenuItem @@ -289,22 +283,18 @@ String STR_TBL_FORMULA Identifier = FN_FORMULA_CALC ; \ HelpID = HID_TBX_FORMULA_CALC ; \ Text [ en-US ] = "Formula" ; \ - /* ### ACHTUNG: Neuer Text in Resource? Formel ausw�hlen : Formel ausw�hlen */\ };\ ToolBoxItem\ {\ Identifier = FN_FORMULA_CANCEL ; \ HelpId = HID_TBX_FORMULA_CANCEL ; \ Text [ en-US ] = "Cancel" ; \ - /* ### ACHTUNG: Neuer Text in Resource? Formel nicht �benehmen : Formel nicht �benehmen */\ };\ ToolBoxItem\ {\ Identifier = FN_FORMULA_APPLY ; \ HelpID = HID_TBX_FORMULA_APPLY ; \ - /* ### ACHTUNG: Neuer Text in Resource? �bernehmen : �bernehmen */\ Text [ en-US ] = "Apply" ; \ - /* ### ACHTUNG: Neuer Text in Resource? Formel einf�gen : Formel einf�gen */\ }; diff --git a/sw/source/ui/ribbar/tblctrl.cxx b/sw/source/ui/ribbar/tblctrl.cxx index 7d750435e7..497b8518f8 100644 --- a/sw/source/ui/ribbar/tblctrl.cxx +++ b/sw/source/ui/ribbar/tblctrl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -91,3 +92,5 @@ SfxPopupWindowType SwTableOptimizeCtrl::GetPopupWindowType() const { return SFX_POPUPWINDOW_ONCLICK; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/ribbar/tbxanchr.cxx b/sw/source/ui/ribbar/tbxanchr.cxx index 2cfbc6f085..f6927b44b9 100644 --- a/sw/source/ui/ribbar/tbxanchr.cxx +++ b/sw/source/ui/ribbar/tbxanchr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,15 +31,13 @@ -#include <string> // HACK: prevent conflict between STLPORT and Workshop headers +#include <string> #include <vcl/timer.hxx> #include <sfx2/app.hxx> #include <svx/htmlmode.hxx> #include <svl/intitem.hxx> #include <sfx2/dispatch.hxx> -#ifndef _TOOLBOX_HXX //autogen #include <vcl/toolbox.hxx> -#endif #include <sfx2/mnumgr.hxx> @@ -49,7 +48,6 @@ #include "wrtsh.hxx" #include "view.hxx" #include "viewopt.hxx" -#include "errhdl.hxx" #include "ribbar.hrc" #include "tbxanchr.hxx" @@ -57,10 +55,6 @@ SFX_IMPL_TOOLBOX_CONTROL(SwTbxAnchor, SfxUInt16Item); -/****************************************************************************** - * Beschreibung: - ******************************************************************************/ - SwTbxAnchor::SwTbxAnchor( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) : SfxToolBoxControl( nSlotId, nId, rTbx ), nActAnchorId(0) @@ -68,18 +62,10 @@ SwTbxAnchor::SwTbxAnchor( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) : rTbx.SetItemBits( nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( nId ) ); } -/****************************************************************************** - * Beschreibung: - ******************************************************************************/ - SwTbxAnchor::~SwTbxAnchor() { } -/****************************************************************************** - * Beschreibung: - ******************************************************************************/ - void SwTbxAnchor::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { GetToolBox().EnableItem( GetId(), (GetItemState(pState) != SFX_ITEM_DISABLED) ); @@ -93,20 +79,12 @@ void SwTbxAnchor::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const } -/****************************************************************************** - * Beschreibung: - ******************************************************************************/ - SfxPopupWindow* SwTbxAnchor::CreatePopupWindow() { SwTbxAnchor::Click(); return 0; } -/****************************************************************************** - * Beschreibung: - ******************************************************************************/ - void SwTbxAnchor::Click() { PopupMenu aPopMenu(SW_RES(MN_ANCHOR_POPUP)); @@ -122,8 +100,6 @@ void SwTbxAnchor::Click() pDispatch = pViewFrame->GetDispatcher(); } -// SfxDispatcher* pDispatch = GetBindings().GetDispatcher(); -// SfxViewFrame* pViewFrame = pDispatch ? pDispatch->GetFrame() : 0; SwView* pActiveView = 0; if(pViewFrame) { @@ -141,7 +117,7 @@ void SwTbxAnchor::Click() } if(!pActiveView) { - DBG_ERROR("No active view could be found"); + OSL_ENSURE(false, "No active view found"); return; } SwWrtShell* pWrtShell = pActiveView->GetWrtShellPtr(); @@ -164,3 +140,5 @@ void SwTbxAnchor::Click() if (nSlotId) pDispatch->Execute(nSlotId, SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx index a534907ef5..2713a22f3a 100644 --- a/sw/source/ui/ribbar/workctrl.cxx +++ b/sw/source/ui/ribbar/workctrl.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -29,37 +30,24 @@ #include "precompiled_sw.hxx" - -#include <string> // HACK: prevent conflict between STLPORT and Workshop headers +#include <string> #include <svl/eitem.hxx> #include <svx/htmlmode.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/bindings.hxx> -#ifndef _SFX_IMAGEMGR_HXX #include <sfx2/imagemgr.hxx> -#endif #include <swmodule.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <initui.hxx> #include <viewopt.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <gloshdl.hxx> #include <glosdoc.hxx> #include <gloslst.hxx> #include <workctrl.hxx> -#ifndef _WORKCTRL_HRC #include <workctrl.hrc> -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _HELPID_H #include <helpid.h> -#endif #include <wrtsh.hxx> #include <svl/imageitm.hxx> #include <vcl/lstbox.hxx> @@ -69,7 +57,7 @@ #include <vcl/svapp.hxx> -//JP 14.01.99: Size Abpruefung +// Size Abpruefung #define NAVI_ENTRIES 20 #if NAVI_ENTRIES != NID_COUNT #error SwScrollNaviPopup-CTOR static Array falsche Size. Wurden neue IDs zugefuegt ?? @@ -84,9 +72,6 @@ using namespace ::com::sun::star::frame; SFX_IMPL_TOOLBOX_CONTROL( SwTbxInsertCtrl, SfxImageItem); SFX_IMPL_TOOLBOX_CONTROL( SwTbxAutoTextCtrl, SfxBoolItem ); -/********************************************************************** - -**********************************************************************/ SwTbxInsertCtrl::SwTbxInsertCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, @@ -96,9 +81,7 @@ SwTbxInsertCtrl::SwTbxInsertCtrl( { rTbx.SetItemBits( nId, TIB_DROPDOWN | rTbx.GetItemBits( nId ) ); } -/********************************************************************** -**********************************************************************/ SwTbxInsertCtrl::~SwTbxInsertCtrl() { } @@ -108,10 +91,7 @@ void SAL_CALL SwTbxInsertCtrl::update() throw (uno::RuntimeException) ToolBox& rTbx = GetToolBox(); rtl::OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); aSlotURL += rtl::OUString::valueOf( sal_Int32( nLastSlotId )); - Image aImage = GetImage( m_xFrame, - aSlotURL, - hasBigImages(), - rTbx.GetSettings().GetStyleSettings().GetHighContrastMode() ); + Image aImage = GetImage( m_xFrame, aSlotURL, hasBigImages() ); rTbx.SetItemImage(GetId(), aImage); rTbx.Invalidate(); @@ -119,11 +99,6 @@ void SAL_CALL SwTbxInsertCtrl::update() throw (uno::RuntimeException) SfxToolBoxControl::update(); } -/********************************************************************** - -**********************************************************************/ - - void SwTbxInsertCtrl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) @@ -143,10 +118,7 @@ void SwTbxInsertCtrl::StateChanged( sal_uInt16 /*nSID*/, rtl::OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); aSlotURL += rtl::OUString::valueOf( sal_Int32( nId )); ToolBox& rBox = GetToolBox(); - Image aImage = GetImage( m_xFrame, - aSlotURL, - hasBigImages(), - rBox.GetSettings().GetStyleSettings().GetHighContrastMode() ); + Image aImage = GetImage( m_xFrame, aSlotURL, hasBigImages() ); rBox.SetItemImage(GetId(), aImage); rBox.SetItemImageMirrorMode( GetId(), sal_False ); rBox.SetItemImageAngle( GetId(), pItem->GetRotation() ); @@ -155,10 +127,6 @@ void SwTbxInsertCtrl::StateChanged( sal_uInt16 /*nSID*/, } } -/********************************************************************** - -**********************************************************************/ - SfxPopupWindow* SwTbxInsertCtrl::CreatePopupWindow() { @@ -175,22 +143,12 @@ SfxPopupWindow* SwTbxInsertCtrl::CreatePopupWindow() return NULL; } -/********************************************************************** - -**********************************************************************/ - - SfxPopupWindowType SwTbxInsertCtrl::GetPopupWindowType() const { return nLastSlotId ? SFX_POPUPWINDOW_ONTIMEOUT : SFX_POPUPWINDOW_ONCLICK; } -/********************************************************************** - -**********************************************************************/ - - void SwTbxInsertCtrl::Select( sal_Bool /*bMod1*/ ) { if( nLastSlotId ) @@ -210,11 +168,6 @@ void SwTbxInsertCtrl::Select( sal_Bool /*bMod1*/ ) } } -/********************************************************************** - -**********************************************************************/ - - SwTbxAutoTextCtrl::SwTbxAutoTextCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, @@ -225,21 +178,12 @@ SwTbxAutoTextCtrl::SwTbxAutoTextCtrl( { rTbx.SetItemBits( nId, TIB_DROPDOWN | rTbx.GetItemBits( nId ) ); } -/********************************************************************** - -**********************************************************************/ - SwTbxAutoTextCtrl::~SwTbxAutoTextCtrl() { DelPopup(); } -/********************************************************************** - -**********************************************************************/ - - SfxPopupWindow* SwTbxAutoTextCtrl::CreatePopupWindow() { pView = ::GetActiveView(); @@ -315,21 +259,11 @@ SfxPopupWindow* SwTbxAutoTextCtrl::CreatePopupWindow() } -/********************************************************************** - -**********************************************************************/ - - SfxPopupWindowType SwTbxAutoTextCtrl::GetPopupWindowType() const { return SFX_POPUPWINDOW_ONTIMEOUT; } -/********************************************************************** - -**********************************************************************/ - - void SwTbxAutoTextCtrl::StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) @@ -341,11 +275,6 @@ void SwTbxAutoTextCtrl::StateChanged( sal_uInt16 nSID, } } -/********************************************************************** - -**********************************************************************/ - - IMPL_LINK(SwTbxAutoTextCtrl, PopupHdl, PopupMenu*, pMenu) { sal_uInt16 nId = pMenu->GetCurItemId(); @@ -393,7 +322,7 @@ IMPL_LINK(SwTbxAutoTextCtrl, PopupHdl, PopupMenu*, pMenu) SwGlossaryHdl* pGlosHdl = pView->GetGlosHdl(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS ); if ( fnSetActGroup ) (*fnSetActGroup)( sGroup ); @@ -403,11 +332,6 @@ IMPL_LINK(SwTbxAutoTextCtrl, PopupHdl, PopupMenu*, pMenu) return 0; } -/********************************************************************** - -**********************************************************************/ - - void SwTbxAutoTextCtrl::DelPopup() { if(pPopup) @@ -425,11 +349,9 @@ void SwTbxAutoTextCtrl::DelPopup() } } -/*-----------------19.02.97 10.52------------------- - Navigations-Popup ---------------------------------------------------*/ +/* Navigations-Popup */ // determine the order of the toolbox items -static sal_uInt16 __READONLY_DATA aNavigationInsertIds[ NAVI_ENTRIES ] = +static sal_uInt16 aNavigationInsertIds[ NAVI_ENTRIES ] = { // -- first line NID_TBL, @@ -454,7 +376,7 @@ static sal_uInt16 __READONLY_DATA aNavigationInsertIds[ NAVI_ENTRIES ] = NID_TABLE_FORMULA_ERROR, NID_NEXT }; -static const char* __READONLY_DATA aNavigationHelpIds[ NAVI_ENTRIES ] = +static const char* aNavigationHelpIds[ NAVI_ENTRIES ] = { // -- first line HID_NID_TBL, @@ -486,7 +408,6 @@ SwScrollNaviPopup::SwScrollNaviPopup( sal_uInt16 nId, const Reference< XFrame >& aSeparator(this, SW_RES(FL_SEP)), aInfoField(this, SW_RES(FI_INFO)), aIList(SW_RES(IL_VALUES)), - aIListH(SW_RES(ILH_VALUES)), nFwdId(FN_START_OF_NEXT_PAGE), nBackId(FN_START_OF_PREV_PAGE) { @@ -545,16 +466,11 @@ SwScrollNaviPopup::SwScrollNaviPopup( sal_uInt16 nId, const Reference< XFrame >& aToolBox.StartSelection(); aToolBox.Show(); } -/*-----------------19.02.97 12.45------------------- - ---------------------------------------------------*/ SwScrollNaviPopup::~SwScrollNaviPopup() { } -/* -----------------------------08.05.2002 14:00------------------------------ - ---------------------------------------------------------------------------*/ void SwScrollNaviPopup::DataChanged( const DataChangedEvent& rDCEvt ) { if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && @@ -563,32 +479,22 @@ void SwScrollNaviPopup::DataChanged( const DataChangedEvent& rDCEvt ) Window::DataChanged( rDCEvt ); } -/* -----------------------------08.05.2002 14:02------------------------------ - ---------------------------------------------------------------------------*/ void SwScrollNaviPopup::ApplyImageList() { - ImageList& rImgLst = aToolBox.GetSettings().GetStyleSettings().GetHighContrastMode() ? - aIListH : aIList; + ImageList& rImgLst = aIList; for(sal_uInt16 i = 0; i < NID_COUNT; i++) { sal_uInt16 nNaviId = aNavigationInsertIds[i]; aToolBox.SetItemImage(nNaviId, rImgLst.GetImage(nNaviId)); } } -/*-----------------19.02.97 13.58------------------- - ---------------------------------------------------*/ SfxPopupWindow* SwScrollNaviPopup::Clone() const { return new SwScrollNaviPopup( GetId(), GetFrame() ); } -/*-----------------19.02.97 14.10------------------- - ---------------------------------------------------*/ - IMPL_LINK(SwScrollNaviPopup, SelectHdl, ToolBox*, pSet) { sal_uInt16 nSet = pSet->GetCurItemId(); @@ -619,9 +525,6 @@ IMPL_LINK(SwScrollNaviPopup, SelectHdl, ToolBox*, pSet) } return 0; } -/*-----------------23.02.97 18.21------------------- - ---------------------------------------------------*/ void SwScrollNaviToolBox::MouseButtonUp( const MouseEvent& rMEvt ) { @@ -630,9 +533,6 @@ void SwScrollNaviToolBox::MouseButtonUp( const MouseEvent& rMEvt ) ((SwScrollNaviPopup*)GetParent())->EndPopupMode( FLOATWIN_POPUPMODEEND_CLOSEALL ); } -/*-----------------20.06.97 13:28------------------- - ---------------------------------------------------*/ void SwScrollNaviToolBox::RequestHelp( const HelpEvent& rHEvt ) { SetItemText(NID_NEXT, SwScrollNaviPopup::GetQuickHelpText(sal_True)); @@ -641,9 +541,6 @@ void SwScrollNaviToolBox::RequestHelp( const HelpEvent& rHEvt ) } -/*-----------------20.06.97 13:41------------------- - ---------------------------------------------------*/ String SwScrollNaviPopup::GetQuickHelpText(sal_Bool bNext) { sal_uInt16 nResId = STR_IMGBTN_START; @@ -652,17 +549,12 @@ String SwScrollNaviPopup::GetQuickHelpText(sal_Bool bNext) nResId += NID_COUNT; return String(SW_RES(nResId)); } -/* -----------------------------05.09.2002 13:53------------------------------ - ---------------------------------------------------------------------------*/ void SwNaviImageButton::Click() { -// SfxBindings& rBind = SfxViewFrame::Current()->GetBindings(); -// rBind.ENTERREGISTRATIONS(); pPopup = new SwScrollNaviPopup( FN_SCROLL_NAVIGATION, m_xFrame ); -// rBind.LEAVEREGISTRATIONS(); Point aPos = OutputToScreenPixel(Point(0,0)); Rectangle aRect(aPos, GetSizePixel()); SetPopupWindow( pPopup ); @@ -711,10 +603,6 @@ IMPL_LINK( SwNaviImageButton, ClosePopupWindow, SfxPopupWindow *, pWindow ) return 1; } -/*-----------------21.02.97 09:41------------------- - ---------------------------------------------------*/ - void SwHlpImageButton::RequestHelp( const HelpEvent& rHEvt ) { @@ -723,17 +611,12 @@ void SwHlpImageButton::RequestHelp( const HelpEvent& rHEvt ) ImageButton::RequestHelp(rHEvt); } -/*-----------------25.02.97 12:38------------------- - ---------------------------------------------------*/ - SwNaviImageButton::SwNaviImageButton( Window* pParent, const Reference< XFrame >& rFrame ) : ImageButton(pParent, SW_RES(BTN_NAVI)), pPopup(0), aImage(SW_RES(IMG_BTN)), - aImageH(SW_RES(IMG_BTN_H)), sQuickText(SW_RES(ST_QUICK)), pPopupWindow(0), pFloatingWindow(0), @@ -742,22 +625,18 @@ SwNaviImageButton::SwNaviImageButton( FreeResource(); SetStyle(GetStyle()|WB_NOPOINTERFOCUS); SetQuickHelpText(sQuickText); - SetModeImage( GetSettings().GetStyleSettings().GetHighContrastMode() ? aImageH : aImage); + SetModeImage( aImage ); } -/* -----------------------------2002/07/05 9:41------------------------------- - ---------------------------------------------------------------------------*/ void SwNaviImageButton::DataChanged( const DataChangedEvent& rDCEvt ) { if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) - SetModeImage( GetSettings().GetStyleSettings().GetHighContrastMode() ? aImageH : aImage); + SetModeImage( aImage ); Window::DataChanged( rDCEvt ); } -/* -----------------26.11.2002 09:28----------------- - * - * --------------------------------------------------*/ + class SwZoomBox_Impl : public ComboBox { sal_uInt16 nSlotId; @@ -778,9 +657,7 @@ protected: void ReleaseFocus(); }; -/* -----------------26.11.2002 09:29----------------- - * - * --------------------------------------------------*/ + SwZoomBox_Impl::SwZoomBox_Impl( Window* pParent, sal_uInt16 nSlot, @@ -800,14 +677,10 @@ SwZoomBox_Impl::SwZoomBox_Impl( InsertEntry(sEntry); } } -/* -----------------26.11.2002 09:29----------------- - * - * --------------------------------------------------*/ + SwZoomBox_Impl::~SwZoomBox_Impl() {} -/* -----------------26.11.2002 09:34----------------- - * - * --------------------------------------------------*/ + void SwZoomBox_Impl::Select() { if ( !IsTravelSelect() ) @@ -837,9 +710,7 @@ void SwZoomBox_Impl::Select() ReleaseFocus(); } } -/* -----------------02.12.2002 07:49----------------- - * - * --------------------------------------------------*/ + long SwZoomBox_Impl::Notify( NotifyEvent& rNEvt ) { long nHandled = 0; @@ -876,9 +747,7 @@ long SwZoomBox_Impl::Notify( NotifyEvent& rNEvt ) return nHandled ? nHandled : ComboBox::Notify( rNEvt ); } -/* -----------------02.12.2002 07:51----------------- - * - * --------------------------------------------------*/ + void SwZoomBox_Impl::ReleaseFocus() { if ( !bRelease ) @@ -897,9 +766,6 @@ void SwZoomBox_Impl::ReleaseFocus() } } -/* -----------------26.11.2002 09:29----------------- - * - * --------------------------------------------------*/ SFX_IMPL_TOOLBOX_CONTROL( SwPreviewZoomControl, SfxUInt16Item); SwPreviewZoomControl::SwPreviewZoomControl( @@ -909,15 +775,11 @@ SwPreviewZoomControl::SwPreviewZoomControl( SfxToolBoxControl( nSlotId, nId, rTbx ) { } -/* -----------------26.11.2002 09:29----------------- - * - * --------------------------------------------------*/ + SwPreviewZoomControl::~SwPreviewZoomControl() { } -/* -----------------26.11.2002 09:29----------------- - * - * --------------------------------------------------*/ + void SwPreviewZoomControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) @@ -933,11 +795,11 @@ void SwPreviewZoomControl::StateChanged( sal_uInt16 /*nSID*/, pBox->SaveValue(); } } -/* -----------------26.11.2002 09:29----------------- - * - * --------------------------------------------------*/ + Window* SwPreviewZoomControl::CreateItemWindow( Window *pParent ) { SwZoomBox_Impl* pRet = new SwZoomBox_Impl( pParent, GetSlotId(), Reference< XDispatchProvider >( m_xFrame->getController(), UNO_QUERY )); return pRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/ribbar/workctrl.hrc b/sw/source/ui/ribbar/workctrl.hrc index 108cf44ee8..64dfb6eddb 100644 --- a/sw/source/ui/ribbar/workctrl.hrc +++ b/sw/source/ui/ribbar/workctrl.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -37,9 +37,6 @@ #define ST_QUICK 7 #define FI_INFO 8 #define FL_SEP 9 -#define ILH_VALUES 10 -#define IMG_BTN_H 11 - #define ST_TBL 12 #define ST_FRM 13 diff --git a/sw/source/ui/ribbar/workctrl.src b/sw/source/ui/ribbar/workctrl.src index 3cb93cb585..ce0163974f 100644 --- a/sw/source/ui/ribbar/workctrl.src +++ b/sw/source/ui/ribbar/workctrl.src @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -51,7 +51,6 @@ Menu RID_INSERT_FIELD_CTRL HelpId = CMD_FN_INSERT_FLD_TIME ; Text [ en-US ] = "Time" ; }; - //#ifndef MN_SW_WEB MenuItem { Identifier = FN_INSERT_FLD_PGNUMBER ; @@ -76,7 +75,6 @@ Menu RID_INSERT_FIELD_CTRL HelpId = CMD_FN_INSERT_FLD_TITLE ; Text [ en-US ] = "Title" ; }; - //#endif MenuItem { Identifier = FN_INSERT_FLD_AUTHOR ; @@ -134,12 +132,6 @@ FloatingWindow RID_SCROLL_NAVIGATION_WIN MaskColor = IMAGE_MASK_COLOR ; SCROLL_IMAGE_IDLIST }; - ImageList ILH_VALUES - { - Prefix = "srh"; - MaskColor = IMAGE_MASK_COLOR ; - SCROLL_IMAGE_IDLIST - }; FixedLine FL_SEP { //no position, no text @@ -189,7 +181,6 @@ FloatingWindow RID_SCROLL_NAVIGATION_WIN }; String ST_OUTL { - /* ### ACHTUNG: Neuer Text in Resource? �berschrift : �berschrift */ Text [ en-US ] = "Headings" ; }; String ST_SEL @@ -198,7 +189,6 @@ FloatingWindow RID_SCROLL_NAVIGATION_WIN }; String ST_FTN { - /* ### ACHTUNG: Neuer Text in Resource? Fu�note : Fu�note */ Text [ en-US ] = "Footnote" ; }; String ST_MARK @@ -227,31 +217,6 @@ FloatingWindow RID_SCROLL_NAVIGATION_WIN }; Text [ en-US ] = "Navigation" ; }; -/* -Noch ein paar Reserven - ToolBoxItem - { - Identifier = NID_NEXT; - Text = "Vorw�rts" ; - }; - ToolBoxItem - { - Identifier = NID_PREV; - Text = "R�ckw�rts" ; - }; - ToolBoxItem - { - Identifier = NID_CTRL; - Text = "Control" ; - }; - ToolBoxItem - { - Identifier = NID_DRW; - Text = "Zeichenobjekt" ; - }; - - -*/ /*************************************************************** Strings fuer die Quickhelp der View-PgUp/Down-Buttons ***************************************************************/ @@ -265,73 +230,58 @@ String STR_IMGBTN_PREV_DOWN }; String STR_IMGBTN_TBL_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chste Tabelle : N�chste Tabelle */ Text [ en-US ] = "Next table" ; }; String STR_IMGBTN_FRM_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chster Textrahmen : N�chster Textrahmen */ Text [ en-US ] = "Next text frame" ; }; String STR_IMGBTN_PGE_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chste Seite : N�chste Seite */ Text [ en-US ] = "Next page" ; }; String STR_IMGBTN_DRW_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chstes Zeichenobjekt : N�chstes Zeichenobjekt */ Text [ en-US ] = "Next drawing" ; }; String STR_IMGBTN_CTRL_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chstes Kontrollfeld : N�chstes Kontrollfeld */ Text [ en-US ] = "Next control" ; }; String STR_IMGBTN_REG_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chster Bereich : N�chster Bereich */ Text [ en-US ] = "Next section" ; }; String STR_IMGBTN_BKM_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chste Textmarke : N�chste Textmarke */ Text [ en-US ] = "Next bookmark" ; }; String STR_IMGBTN_GRF_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chste Grafik : N�chste Grafik */ Text [ en-US ] = "Next graphic" ; }; String STR_IMGBTN_OLE_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chstes OLE-Objekt : N�chstes OLE object */ - /* ### ACHTUNG: Neuer Text in Resource? N�chstes OLE-Objekt : N�chstes OLE-Objekt */ Text [ en-US ] = "Next OLE object" ; }; String STR_IMGBTN_OUTL_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chste �berschrift : N�chste �berschrift */ Text [ en-US ] = "Next heading" ; }; String STR_IMGBTN_SEL_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chste Markierung : N�chste Markierung */ Text [ en-US ] = "Next selection" ; }; String STR_IMGBTN_FTN_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chste Fu�note : N�chste Fu�note */ Text [ en-US ] = "Next footnote" ; }; String STR_IMGBTN_MARK_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chster Merker : N�chster Merker */ Text [ en-US ] = "Next Reminder" ; }; String STR_IMGBTN_POSTIT_DOWN { - /* ### ACHTUNG: Neuer Text in Resource? N�chste Notiz : N�chste Notiz */ Text [ en-US ] = "Next Note" ; }; String STR_IMGBTN_SRCH_REP_DOWN @@ -384,12 +334,10 @@ String STR_IMGBTN_GRF_UP }; String STR_IMGBTN_OLE_UP { - /* ### ACHTUNG: Neuer Text in Resource? Voriges OLE-Objekt : Voriges OLE object */ Text [ en-US ] = "Previous OLE object" ; }; String STR_IMGBTN_OUTL_UP { - /* ### ACHTUNG: Neuer Text in Resource? Vorige �berschrift : Vorige �berschrift */ Text [ en-US ] = "Previous heading" ; }; String STR_IMGBTN_SEL_UP @@ -398,7 +346,6 @@ String STR_IMGBTN_SEL_UP }; String STR_IMGBTN_FTN_UP { - /* ### ACHTUNG: Neuer Text in Resource? Vorige Fu�note : Vorige Fu�note */ Text [ en-US ] = "Previous footnote" ; }; String STR_IMGBTN_MARK_UP @@ -445,11 +392,6 @@ ImageButton BTN_NAVI ImageBitmap = Bitmap { File = "punkt.bmp" ; }; MaskColor = IMAGE_MASK_COLOR ; }; - Image IMG_BTN_H - { - ImageBitmap = Bitmap { File = "punkt_h.bmp" ; }; - MaskColor = IMAGE_MASK_COLOR ; - }; String ST_QUICK { Text [ en-US ] = "Navigation" ; diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index 84181f183d..16f04b3fa2 100755..100644 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -115,9 +116,7 @@ #include <editeng/editview.hxx> #include <svl/languageoptions.hxx> -#include <editeng/langitem.hxx> #include <svtools/langtab.hxx> -#include <svl/slstitm.hxx> #include <docsh.hxx> #include <svl/undo.hxx> @@ -167,7 +166,7 @@ SwAnnotationShell::~SwAnnotationShell() if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() ) { - DBG_ASSERT(pPostItMgr,"PostItMgr::Layout(): We are looping forever"); + OSL_ENSURE(pPostItMgr,"PostItMgr::Layout(): We are looping forever"); return 0; } return &pPostItMgr->GetActiveSidebarWin()->GetOutlinerView()->GetOutliner()->GetUndoManager(); @@ -372,10 +371,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) case FN_FORMAT_FOOTNOTE_DLG: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( rView.GetWindow(), rView.GetWrtShell(), DLG_DOC_FOOTNOTE ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; break; @@ -384,10 +383,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) { SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE, rView.GetWindow(), &aTmp, rView.GetWrtShell()); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; rReq.Done(); @@ -397,7 +396,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) { try { - uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY); + uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ui.XSLTFilterDialog"))), uno::UNO_QUERY); if( xDialog.is() ) { xDialog->execute(); @@ -423,7 +422,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) } SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( rView.GetWindow() ); pDialog->SetValues(aCurr, aDocStat ); pDialog->Execute(); @@ -448,12 +447,11 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) aDlgAttr.Put( aEditAttr ); aDlgAttr.Put( SvxKerningItem(0, RES_CHRATR_KERNING) ); - //CHINA001 SwCharDlg* pDlg = new SwCharDlg(pView->GetWindow(), *pView, aDlgAttr, 0, sal_True); - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();//CHINA001 - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");//CHINA001 + SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( rView.GetWindow(), rView, aDlgAttr, DLG_CHAR,0, sal_True ); - DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001 + OSL_ENSURE(pDlg, "Dialogdiet fail!"); sal_uInt16 nRet = pDlg->Execute(); if(RET_OK == nRet ) { @@ -496,13 +494,12 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) aDlgAttr.Put( SvxWidowsItem( 0, RES_PARATR_WIDOWS ) ); aDlgAttr.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) ); - //CHINA001 SwParaDlg* pDlg = new SwParaDlg(GetView().GetWindow(), GetView(), aDlgAttr, DLG_STD, 0, sal_True); - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();//CHINA001 - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");//CHINA001 + SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateSwParaDlg( rView.GetWindow(), rView, aDlgAttr,DLG_STD, DLG_PARA, 0, sal_True ); - DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001 + OSL_ENSURE(pDlg, "Dialogdiet fail!"); sal_uInt16 nRet = pDlg->Execute(); if(RET_OK == nRet) { @@ -903,7 +900,6 @@ void SwAnnotationShell::StateClpbrd(SfxItemSet &rSet) SvxClipboardFmtItem aFormats( SID_CLIPBOARD_FORMAT_ITEMS ); if ( aDataHelper.HasFormat( SOT_FORMAT_RTF ) ) aFormats.AddClipbrdFormat( SOT_FORMAT_RTF ); - //if ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) ) aFormats.AddClipbrdFormat( SOT_FORMAT_STRING ); rSet.Put( aFormats ); } @@ -1024,15 +1020,6 @@ void SwAnnotationShell::NoteExec(SfxRequest &rReq) break; } case FN_HIDE_NOTE: - /* - if ( Mgr()->GetActiveSidebarWin() == this ) - { - Mgr()->SetActivePostIt(0); - // put the cursor back into the document - SwitchToFieldPos(); - } - Mgr()->Hide(mpFld); - */ break; case FN_HIDE_ALL_NOTES: pPostItMgr->Hide(); @@ -1164,7 +1151,7 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq) { Reference< ui::dialogs::XExecutableDialog > xDialog( xMCF->createInstanceWithContext( - rtl::OUString::createFromAscii("com.sun.star.linguistic2.ChineseTranslationDialog") + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.ChineseTranslationDialog")) , xContext), UNO_QUERY); Reference< lang::XInitialization > xInit( xDialog, UNO_QUERY ); if( xInit.is() ) @@ -1174,7 +1161,7 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq) Sequence<Any> aSeq(1); Any* pArray = aSeq.getArray(); PropertyValue aParam; - aParam.Name = rtl::OUString::createFromAscii("ParentWindow"); + aParam.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow")); aParam.Value <<= makeAny(xDialogParentWindow); pArray[0] <<= makeAny(aParam); xInit->initialize( aSeq ); @@ -1345,7 +1332,7 @@ void SwAnnotationShell::ExecTransliteration(SfxRequest &rReq) break; default: - ASSERT(!this, "falscher Dispatcher"); + OSL_ENSURE(!this, "wrong dispatcher"); } if( nMode ) @@ -1680,3 +1667,5 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) rReq.Done(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 05b7fdea6e..b292ccab87 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -119,7 +120,6 @@ FlyMode SwBaseShell::eFrameMode = FLY_DRAG_END; - //Fuer die Erkennung der Id, die variable von Gallery mit SID_GALLERY_BG_BRUSH //ankommt. static sal_uInt8 nParagraphPos; @@ -152,7 +152,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; - SFX_IMPL_INTERFACE(SwBaseShell, SfxShell, SW_RES(0)) { SFX_CHILDWINDOW_REGISTRATION(SvxIMapDlgChildWindow::GetChildWindowId()); @@ -164,8 +163,6 @@ TYPEINIT1(SwBaseShell,SfxShell) /*-------------------------------------------------------------------- Beschreibung: statics --------------------------------------------------------------------*/ - - void lcl_UpdateIMapDlg( SwWrtShell& rSh ) { Graphic aGrf( rSh.GetIMapGraphic() ); @@ -181,16 +178,11 @@ void lcl_UpdateIMapDlg( SwWrtShell& rSh ) SvxIMapDlgChildWindow::UpdateIMapDlg( aGrf, rURL.GetMap(), pList, pEditObj ); - sal_uInt16 nCount = (sal_uInt16)pList->Count(); - if(nCount) - for( sal_uInt16 i = nCount; i; i-- ) - { - delete pList->GetObject(i-1); - } + for ( size_t i = 0, n = pList->size(); i < n; ++i ) + delete pList->at( i ); delete pList; } - sal_Bool lcl_UpdateContourDlg( SwWrtShell &rSh, int nSel ) { Graphic aGraf( rSh.GetIMapGraphic() ); @@ -212,7 +204,6 @@ sal_Bool lcl_UpdateContourDlg( SwWrtShell &rSh, int nSel ) /*-------------------------------------------------------------------- Beschreibung: loeschen --------------------------------------------------------------------*/ - void SwBaseShell::ExecDelete(SfxRequest &rReq) { SwWrtShell &rSh = GetShell(); @@ -231,10 +222,6 @@ void SwBaseShell::ExecDelete(SfxRequest &rReq) sal_Bool bLeft = rSh.Left( CRSR_SKIP_CHARS, sal_True, 1, sal_False ); if( bLeft ) { - // JP 28.03.96: ein Backspace im Absatz ohne Nummer wird zum Delete - //rSh.SwapPam(); - //rSh.DelRight( sal_False ); - rSh.DelLeft(); } else @@ -252,7 +239,7 @@ void SwBaseShell::ExecDelete(SfxRequest &rReq) rSh.DelLeft(); break; default: - DBG_ERROR("falscher Dispatcher"); + OSL_ENSURE(false, "wrong Dispatcher"); return; } rReq.Done(); @@ -261,10 +248,6 @@ void SwBaseShell::ExecDelete(SfxRequest &rReq) rTmpEditWin.SetUseInputLanguage( sal_False ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwBaseShell::ExecClpbrd(SfxRequest &rReq) { //Achtung: Suizid gefaehrdet! Nach Paste, Paste special kann der die @@ -420,7 +403,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq) } break; default: - DBG_ERROR("falscher Dispatcher"); + OSL_ENSURE(false, "wrong Dispatcher"); return; } if(!bIgnore) @@ -430,7 +413,6 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq) /*-------------------------------------------------------------------- Beschreibung: ClipBoard-Status --------------------------------------------------------------------*/ - void SwBaseShell::StateClpbrd(SfxItemSet &rSet) { SwWrtShell &rSh = GetShell(); @@ -487,7 +469,6 @@ void SwBaseShell::StateClpbrd(SfxItemSet &rSet) /*-------------------------------------------------------------------- Beschreibung: Undo ausfuehren --------------------------------------------------------------------*/ - void SwBaseShell::ExecUndo(SfxRequest &rReq) { SwWrtShell &rSh = GetShell(); @@ -519,7 +500,7 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq) rSh.Do( SwWrtShell::REPEAT ); break; default: - DBG_ERROR("falscher Dispatcher"); + OSL_ENSURE(false, "wrong Dispatcher"); } if (pViewFrame) { pViewFrame->GetBindings().InvalidateAll(sal_False); } @@ -528,7 +509,6 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq) /*-------------------------------------------------------------------- Beschreibung: Zustand Undo --------------------------------------------------------------------*/ - void SwBaseShell::StateUndo(SfxItemSet &rSet) { SwWrtShell &rSh = GetShell(); @@ -602,7 +582,6 @@ void SwBaseShell::StateUndo(SfxItemSet &rSet) /*-------------------------------------------------------------------- Beschreibung: Slot-Id auswerten bzw. Dispatchen --------------------------------------------------------------------*/ - void SwBaseShell::Execute(SfxRequest &rReq) { const SfxPoolItem *pItem; @@ -765,22 +744,6 @@ void SwBaseShell::Execute(SfxRequest &rReq) { const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, pGal->GetURL().GetMainURL( INetURLObject::NO_DECODE ) ); GetView().GetViewFrame()->GetDispatcher()->Execute( SID_INSERT_AVMEDIA, SFX_CALLMODE_SYNCHRON, &aMediaURLItem, 0L ); -/* - String sURL( pGal->GetURL().GetMainURL( INetURLObject::NO_DECODE ) ); - String sLabel( pGal->GetURL().getBase() ); - String sTarget; // empty string! - - bool bIsHTMLMode = - 0 == ( HTMLMODE_ON & - ::GetHtmlMode( GetView().GetDocShell() ) ); - - // in Writer, we insert a button which plays the - // sound. In Writer/Web, we just insert a (text) link. - if( bIsHTMLMode ) - InsertURLButton( sURL, sTarget, sLabel ); - else - rSh.InsertURL( SwFmtINetFmt( sURL, sTarget ), sLabel ); -*/ } } } @@ -875,11 +838,11 @@ void SwBaseShell::Execute(SfxRequest &rReq) else { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSwConvertTableDlg* pDlg = pFact->CreateSwConvertTableDlg( GetView(),DLG_CONV_TEXT_TABLE , bToTable); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if( RET_OK == pDlg->Execute() ) { pDlg->GetValues( cDelim, aInsTblOpts, pTAFmt ); @@ -1182,7 +1145,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) static_cast<const SfxBoolItem*>( pItem )->GetValue(); // set form design mode - DBG_ASSERT( GetView().GetFormShell() != NULL, "form shell?" ); + OSL_ENSURE( GetView().GetFormShell() != NULL, "form shell?" ); SfxRequest aReq( GetView().GetViewFrame(), SID_FM_DESIGN_MODE ); aReq.AppendItem( SfxBoolItem( SID_FM_DESIGN_MODE, bDesignMode ) ); GetView().GetFormShell()->Execute( aReq ); @@ -1241,7 +1204,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) case FN_PAGE_STYLE_SET_PAPER_SIZE: case FN_PAGE_STYLE_SET_PAPER_BIN: { - DBG_ERROR("not implemented"); + OSL_ENSURE(false, "not implemented"); } break; @@ -1268,13 +1231,13 @@ void SwBaseShell::Execute(SfxRequest &rReq) } break; default: - DBG_ERROR("falscher Dispatcher"); + OSL_ENSURE(false, "wrong Dispatcher"); } } } -/* -----------------14.04.99 15:10------------------- +/* -------------------------------------------------- * Hier wird der State fuer SID_IMAP / SID_CONTOUR behandelt, * wenn die Grafik ausgeswappt ist * --------------------------------------------------*/ @@ -1820,8 +1783,6 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) /*-------------------------------------------------------------------- Beschreibung: Slots mit dieser Statusmethode disablen --------------------------------------------------------------------*/ - - void SwBaseShell::StateDisableItems( SfxItemSet &rSet ) { SfxWhichIter aIter(rSet); @@ -1837,8 +1798,6 @@ void SwBaseShell::StateDisableItems( SfxItemSet &rSet ) /*-------------------------------------------------------------------- Beschreibung: Slots mit dieser Statusmethode disablen --------------------------------------------------------------------*/ - - void SwBaseShell::StateStyle( SfxItemSet &rSet ) { sal_Bool bParentCntProt = GetShell().IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0; @@ -1863,11 +1822,6 @@ void SwBaseShell::StateStyle( SfxItemSet &rSet ) GetView().GetDocShell()->StateStyleSheet(rSet, &GetShell()); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwBaseShell::SetWrapMode( sal_uInt16 nSlot ) { SwWrtShell &rSh = GetShell(); @@ -1959,7 +1913,6 @@ void SwBaseShell::SetWrapMode( sal_uInt16 nSlot ) /*-------------------------------------------------------------------- Beschreibung: Update der Statuszeile erzwingen --------------------------------------------------------------------*/ - void SwBaseShell::SetFrmMode(FlyMode eMode, SwWrtShell *pSh ) { eFrameMode = eMode; @@ -1975,7 +1928,7 @@ void SwBaseShell::SetFrmMode(FlyMode eMode, SwWrtShell *pSh ) } else if( eMode == FLY_DRAG_END ) { - static sal_uInt16 __READONLY_DATA aInval[] = + static sal_uInt16 aInval[] = { SID_ATTR_POSITION, SID_ATTR_SIZE, 0 }; @@ -1986,7 +1939,6 @@ void SwBaseShell::SetFrmMode(FlyMode eMode, SwWrtShell *pSh ) /*-------------------------------------------------------------------- Beschreibung: Ctor --------------------------------------------------------------------*/ - SwBaseShell::SwBaseShell(SwView& rVw) : SfxShell( &rVw ), rView(rVw), @@ -1999,7 +1951,6 @@ SwBaseShell::SwBaseShell(SwView& rVw) : rWrtSh.SetGrfArrivedLnk( LINK( this, SwBaseShell, GraphicArrivedHdl)); } - SwBaseShell::~SwBaseShell() { if( rView.GetCurShell() == this ) @@ -2010,10 +1961,6 @@ SwBaseShell::~SwBaseShell() rView.GetWrtShell().SetGrfArrivedLnk( Link() ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwBaseShell::ExecTxtCtrl( SfxRequest& rReq ) { const SfxItemSet *pArgs = rReq.GetArgs(); @@ -2139,10 +2086,6 @@ void SwBaseShell::ExecTxtCtrl( SfxRequest& rReq ) rReq.Done(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwBaseShell::GetTxtCtrlState( SfxItemSet& rSet ) { SwWrtShell &rSh = GetShell(); @@ -2229,10 +2172,6 @@ void SwBaseShell::GetTxtFontCtrlState( SfxItemSet& rSet ) delete pFntCoreSet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwBaseShell::GetBckColState(SfxItemSet &rSet) { SwWrtShell &rSh = GetShell(); @@ -2240,7 +2179,6 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet) sal_uInt16 nWhich = aIter.FirstWhich(); int nSelType = rSh.GetSelectionType(); -// if ( nSelType & nsSelectionType::SEL_GRF || if( nSelType & nsSelectionType::SEL_OLE ) { rSet.DisableItem( SID_BACKGROUND_COLOR ); @@ -2290,10 +2228,6 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwBaseShell::ExecBckCol(SfxRequest& rReq) { SwWrtShell &rSh = GetShell(); @@ -2324,8 +2258,6 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND); } -// sal_Bool bMsgOk = sal_False; - switch (nSlot) { // RES_BACKGROUND (=SID_ATTR_BRUSH) muss ueber zwei IDs @@ -2334,7 +2266,6 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) { aBrushItem.SetGraphicPos(GPOS_NONE); - //Brush &rBrush = aBrushItem.GetBrush(); if(pArgs) { const SvxColorItem& rNewColorItem = (const SvxColorItem&) @@ -2360,9 +2291,8 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) } break; default: -// bMsgOk = sal_False; rReq.Ignore(); - DBG_ERROR( "Unbekannte Message bei ExecuteAttr!" ); + OSL_ENSURE(false, "unknown message in ExecuteAttr!" ); return; } @@ -2398,11 +2328,6 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) rReq.Done(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwBaseShell::GetBorderState(SfxItemSet &rSet) { SwWrtShell &rSh = GetShell(); @@ -2434,11 +2359,6 @@ void SwBaseShell::GetBorderState(SfxItemSet &rSet) rSet.Put( SfxBoolItem( SID_BORDER_REDUCED_MODE, !bTableMode )); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwBaseShell::ExecDlg(SfxRequest &rReq) { SwWrtShell &rSh = GetShell(); @@ -2456,6 +2376,14 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) switch ( nSlot ) { + case FN_FORMAT_TITLEPAGE_DLG: + { + SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); + VclAbstractDialog* pDlg = pFact->CreateTitlePageDlg( pMDI ); + pDlg->Execute(); + delete pDlg; + } + break; case FN_FORMAT_PAGE_COLUMN_DLG: case FN_FORMAT_PAGE_DLG: { @@ -2487,10 +2415,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) ::PrepareBoxInfo( aSet, rSh ); rSh.GetTabBorders( aSet ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_TABLE, RC_DLG_SWBORDERDLG ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if ( pDlg->Execute() == RET_OK ) { rSh.SetTabBorders( *pDlg->GetOutputItemSet() ); @@ -2504,10 +2432,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) aSet.Put( aMgr.GetAttrSet() ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_FRAME, RC_DLG_SWBORDERDLG ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if ( pDlg->Execute() == RET_OK ) { aMgr.SetAttrSet( *pDlg->GetOutputItemSet() ); @@ -2522,10 +2450,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) ::PrepareBoxInfo( aSet, rSh ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_PARA, RC_DLG_SWBORDERDLG ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if ( pDlg->Execute() == RET_OK ) { rSh.SetAttr( *pDlg->GetOutputItemSet() ); @@ -2547,7 +2475,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) SfxAbstractDialog * pDlg = 0; SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); // Tabellenzelle(n) selektiert? @@ -2559,11 +2487,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) pDlg = pFact->CreateSfxDialog( pMDI, aSet, rView.GetViewFrame()->GetFrame().GetFrameInterface(), RC_SWDLG_BACKGROUND ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); aSet.Put( aBrush ); if ( pDlg->Execute() == RET_OK ) { - //aBrush = (SvxBrushItem) pDlg->GetOutputItemSet()->Get( RES_BACKGROUND ); rSh.SetBoxBackground( (SvxBrushItem&) pDlg->GetOutputItemSet()->Get( RES_BACKGROUND )); @@ -2578,7 +2505,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) pDlg = pFact->CreateSfxDialog( pMDI, aSet, rView.GetViewFrame()->GetFrame().GetFrameInterface(), RC_SWDLG_BACKGROUND ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if ( pDlg->Execute() == RET_OK ) { rSh.SetFlyFrmAttr((SfxItemSet &) *pDlg->GetOutputItemSet() ); @@ -2593,7 +2520,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) pDlg = pFact->CreateSfxDialog( pMDI, aSet, rView.GetViewFrame()->GetFrame().GetFrameInterface(), RC_SWDLG_BACKGROUND ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if ( pDlg->Execute() == RET_OK ) { rSh.SetAttr( *pDlg->GetOutputItemSet() ); @@ -2609,29 +2536,22 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) } break; - default:DBG_ERROR("falscher Dispatcher (basesh.cxx)"); + default:OSL_ENSURE(false, "wrong Dispatcher (basesh.cxx)"); } if(!bDone) rReq.Done(); } -// ---------------------------------------------------------------------------- - - SwWrtShell& SwBaseShell::GetShell() { return rView.GetWrtShell(); } -// ---------------------------------------------------------------------------- - SwWrtShell* SwBaseShell::GetShellPtr() { return rView.GetWrtShellPtr(); } -// ---------------------------------------------------------------------------- - void SwBaseShell::InsertTable( SfxRequest& _rRequest ) { const SfxItemSet* pArgs = _rRequest.GetArgs(); @@ -2710,9 +2630,9 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest ) if( !nCols || !nRows ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractInsTableDlg* pDlg = pFact->CreateInsTableDlg( DLG_INSERT_TABLE, rTempView ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if( RET_OK == pDlg->Execute() ) { pDlg->GetValues( aTableName, nRows, nCols, aInsTblOpts, aAutoName, pTAFmt ); @@ -2768,8 +2688,6 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest ) } } -// ---------------------------------------------------------------------------- - void SwBaseShell::GetGalleryState( SfxItemSet &rSet ) { SwWrtShell &rSh = GetShell(); @@ -2850,7 +2768,6 @@ void SwBaseShell::GetGalleryState( SfxItemSet &rSet ) } } - void SwBaseShell::ExecuteGallery(SfxRequest &rReq) { SwWrtShell &rSh = GetShell(); @@ -2919,16 +2836,17 @@ void SwBaseShell::ExecField( SfxRequest& rReq ) case FN_CHANGE_DBFIELD: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); VclAbstractDialog* pDlg = pFact->CreateSwChangeDBDlg(GetView(), DLG_CHANGE_DB ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; } break; default: - ASSERT(sal_False, falscher Dispatcher); + OSL_ENSURE(false, "wrong dispatcher"); } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/beziersh.cxx b/sw/source/ui/shells/beziersh.cxx index 7f419d96bd..dbcd205d73 100644 --- a/sw/source/ui/shells/beziersh.cxx +++ b/sw/source/ui/shells/beziersh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,7 +55,6 @@ #include <unomid.h> - SFX_IMPL_INTERFACE(SwBezierShell, SwBaseShell, SW_RES(STR_SHELLNAME_BEZIER)) { SFX_POPUPMENU_REGISTRATION(SW_RES(MN_DRAW_POPUPMENU)); @@ -63,11 +63,6 @@ SFX_IMPL_INTERFACE(SwBezierShell, SwBaseShell, SW_RES(STR_SHELLNAME_BEZIER)) TYPEINIT1(SwBezierShell,SwBaseShell) -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwBezierShell::SwBezierShell(SwView &_rView): SwBaseShell( _rView ) { @@ -79,11 +74,6 @@ SwBezierShell::SwBezierShell(SwView &_rView): pSdrView->SetEliminatePolyPointLimitAngle(1500L); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwBezierShell::Execute(SfxRequest &rReq) { SwWrtShell *pSh = &GetShell(); @@ -140,7 +130,7 @@ void SwBezierShell::Execute(SfxRequest &rReq) case SID_BEZIER_INSERT: { GetView().GetEditWin().SetBezierMode(nSlotId); - static sal_uInt16 __READONLY_DATA aInva[] = + static sal_uInt16 aInva[] = { SID_BEZIER_INSERT, SID_BEZIER_MOVE, @@ -200,7 +190,7 @@ void SwBezierShell::Execute(SfxRequest &rReq) { pSdrView->SetMarkedPointsSmooth(eKind); - static sal_uInt16 __READONLY_DATA aInva[] = + static sal_uInt16 aInva[] = { SID_BEZIER_SMOOTH, SID_BEZIER_EDGE, @@ -239,11 +229,6 @@ void SwBezierShell::Execute(SfxRequest &rReq) pSdrView->GetModel()->SetChanged(sal_True); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwBezierShell::GetState(SfxItemSet &rSet) { SdrView* pSdrView = GetShell().GetDrawView(); @@ -352,5 +337,4 @@ void SwBezierShell::GetState(SfxItemSet &rSet) } } - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/drawdlg.cxx b/sw/source/ui/shells/drawdlg.cxx index a9088e991c..9e82ea68d4 100644 --- a/sw/source/ui/shells/drawdlg.cxx +++ b/sw/source/ui/shells/drawdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,15 +30,8 @@ #include "precompiled_sw.hxx" - - - -#ifndef _SVX_SVXIDS_HRC //autogen #include <svx/svxids.hrc> -#endif -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <sfx2/request.hxx> #include <sfx2/dispatch.hxx> #include <svx/svdview.hxx> @@ -55,11 +49,6 @@ #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) { SwWrtShell* pSh = &GetShell(); @@ -104,12 +93,12 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) sal_Bool bHasMarked = pView->AreObjectsMarked(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet Factory fail!"); + OSL_ENSURE(pFact, "Dialogdiet Factory fail!"); AbstractSvxAreaTabDialog * pDlg = pFact->CreateSvxAreaTabDialog( NULL, &aNewAttr, pDoc, pView); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); const SvxColorTableItem* pColorItem = (const SvxColorTableItem*) GetView().GetDocShell()->GetItem(SID_COLOR_TABLE); if(pColorItem->GetColorTable() == XColorTable::GetStdColorTable()) @@ -123,7 +112,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) pView->SetDefaultAttr(*pDlg->GetOutputItemSet(), sal_False); pSh->EndAction(); - static sal_uInt16 __READONLY_DATA aInval[] = + static sal_uInt16 aInval[] = { SID_ATTR_FILL_STYLE, SID_ATTR_FILL_COLOR, 0 }; @@ -146,13 +135,13 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet Factory fail!"); + OSL_ENSURE(pFact, "Dialogdiet Factory fail!"); SfxAbstractTabDialog * pDlg = pFact->CreateSvxLineTabDialog( NULL, &aNewAttr, pDoc, pObj, bHasMarked); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if (pDlg->Execute() == RET_OK) { pSh->StartAction(); @@ -162,7 +151,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) pView->SetDefaultAttr(*pDlg->GetOutputItemSet(), sal_False); pSh->EndAction(); - static sal_uInt16 __READONLY_DATA aInval[] = + static sal_uInt16 aInval[] = { SID_ATTR_LINE_STYLE, SID_ATTR_LINE_WIDTH, SID_ATTR_LINE_COLOR, 0 @@ -186,11 +175,6 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) pDoc->SetChanged(sal_True); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwDrawShell::ExecDrawAttrArgs(SfxRequest& rReq) { SwWrtShell* pSh = &GetShell(); @@ -235,11 +219,6 @@ void SwDrawShell::ExecDrawAttrArgs(SfxRequest& rReq) pView->GetModel()->SetChanged(sal_True); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet) { SdrView* pSdrView = GetShell().GetDrawView(); @@ -255,5 +234,4 @@ void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet) rSet.Put(pSdrView->GetDefaultAttr()); } - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/drawsh.cxx b/sw/source/ui/shells/drawsh.cxx index 0560b011fc..6152846ae9 100644 --- a/sw/source/ui/shells/drawsh.cxx +++ b/sw/source/ui/shells/drawsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -68,7 +69,7 @@ #define SwDrawShell #include <sfx2/msg.hxx> #include "swslots.hxx" -#include "swabstdlg.hxx" //CHINA001 +#include "swabstdlg.hxx" #include "misc.hrc" using namespace ::com::sun::star; @@ -83,11 +84,6 @@ SFX_IMPL_INTERFACE(SwDrawShell, SwDrawBaseShell, SW_RES(STR_SHELLNAME_DRAW)) TYPEINIT1(SwDrawShell,SwDrawBaseShell) -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwDrawShell::Execute(SfxRequest &rReq) { SwWrtShell &rSh = GetShell(); @@ -197,10 +193,10 @@ void SwDrawShell::Execute(SfxRequest &rReq) case FN_FORMAT_FOOTNOTE_DLG: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), GetView().GetWrtShell(), DLG_DOC_FOOTNOTE ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; break; @@ -209,10 +205,10 @@ void SwDrawShell::Execute(SfxRequest &rReq) { SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE, GetView().GetWindow(), &aTmp, GetView().GetWrtShell()); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; rReq.Done(); @@ -222,7 +218,7 @@ void SwDrawShell::Execute(SfxRequest &rReq) { try { - uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY); + uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ui.XSLTFilterDialog"))), uno::UNO_QUERY); if( xDialog.is() ) { xDialog->execute(); @@ -247,7 +243,7 @@ void SwDrawShell::Execute(SfxRequest &rReq) } SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() ); pDialog->SetValues(aCurr, aDocStat ); pDialog->Execute(); @@ -289,7 +285,7 @@ void SwDrawShell::Execute(SfxRequest &rReq) break; default: - DBG_ASSERT(!this, "falscher Dispatcher"); + OSL_ENSURE(!this, "wrong dispatcher"); return; } if (pSdrView->GetModel()->IsChanged()) @@ -298,12 +294,6 @@ void SwDrawShell::Execute(SfxRequest &rReq) pSdrView->GetModel()->SetChanged(sal_True); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - void SwDrawShell::GetState(SfxItemSet& rSet) { SwWrtShell &rSh = GetShell(); @@ -377,12 +367,6 @@ void SwDrawShell::GetState(SfxItemSet& rSet) svx::FontworkBar::getState( pSdrView, rSet ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - SwDrawShell::SwDrawShell(SwView &_rView) : SwDrawBaseShell(_rView) { @@ -395,9 +379,6 @@ SwDrawShell::SwDrawShell(SwView &_rView) : |* SfxRequests fuer FontWork bearbeiten |* \************************************************************************/ - - - void SwDrawShell::ExecFormText(SfxRequest& rReq) { SwWrtShell &rSh = GetShell(); @@ -449,9 +430,6 @@ void SwDrawShell::ExecFormText(SfxRequest& rReq) |* Statuswerte fuer FontWork zurueckgeben |* \************************************************************************/ - - - void SwDrawShell::GetFormTextState(SfxItemSet& rSet) { SwWrtShell &rSh = GetShell(); @@ -492,6 +470,4 @@ void SwDrawShell::GetFormTextState(SfxItemSet& rSet) } } - - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/drformsh.cxx b/sw/source/ui/shells/drformsh.cxx index 9b68f28f84..afd4585286 100644 --- a/sw/source/ui/shells/drformsh.cxx +++ b/sw/source/ui/shells/drformsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -119,7 +120,7 @@ void SwDrawFormShell::Execute(SfxRequest &rReq) { uno::Reference< awt::XControlModel > xControlModel = pUnoCtrl->GetUnoControlModel(); - ASSERT( xControlModel.is(), "UNO-Control ohne Model" ); + OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" ); if( !xControlModel.is() ) return; @@ -169,7 +170,7 @@ void SwDrawFormShell::Execute(SfxRequest &rReq) break; default: - DBG_ASSERT(!this, "falscher Dispatcher"); + OSL_ENSURE(!this, "wrong dispatcher"); return; } } @@ -196,7 +197,7 @@ void SwDrawFormShell::GetState(SfxItemSet& rSet) { uno::Reference< awt::XControlModel > xControlModel = pUnoCtrl->GetUnoControlModel(); - ASSERT( xControlModel.is(), "UNO-Control ohne Model" ); + OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" ); if( !xControlModel.is() ) return; @@ -274,3 +275,4 @@ SwDrawFormShell::~SwDrawFormShell() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx index 644923d431..1b0f431fc8 100644 --- a/sw/source/ui/shells/drwbassh.cxx +++ b/sw/source/ui/shells/drwbassh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -85,11 +86,6 @@ SFX_IMPL_INTERFACE(SwDrawBaseShell, SwBaseShell, SW_RES(0)) TYPEINIT1(SwDrawBaseShell,SwBaseShell) -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwDrawBaseShell::SwDrawBaseShell(SwView &_rView): SwBaseShell( _rView ) { @@ -105,11 +101,6 @@ SwDrawBaseShell::SwDrawBaseShell(SwView &_rView): SwTransferable::CreateSelection( GetShell() ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwDrawBaseShell::~SwDrawBaseShell() { GetView().ExitDraw(); @@ -117,11 +108,6 @@ SwDrawBaseShell::~SwDrawBaseShell() SwTransferable::ClearSelection( GetShell() ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwDrawBaseShell::Execute(SfxRequest &rReq) { SwWrtShell *pSh = &GetShell(); @@ -137,7 +123,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) //Sonderfall Align per Menue if(pItem && nSlotId == SID_OBJECT_ALIGN) { - DBG_ASSERT(PTR_CAST(SfxEnumItem, pItem),"SfxEnumItem erwartet"); + OSL_ENSURE(PTR_CAST(SfxEnumItem, pItem),"SfxEnumItem expected"); nSlotId = nSlotId + ((const SfxEnumItem*)pItem)->GetValue(); nSlotId++; } @@ -174,10 +160,10 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) pSh->GetObjAttr(aSet); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractDialog* pDlg = pFact->CreateSwWrapDlg( GetView().GetWindow(), aSet, pSh, sal_True, RC_DLG_SWWRAPDLG ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if (pDlg->Execute() == RET_OK) { @@ -236,7 +222,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) pFact->CreateCaptionDialog( NULL, pSdrView, nAllowedAnchors ); pCaptionDlg->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) ); pDlg = pCaptionDlg; - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); } } else @@ -249,7 +235,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) pFact->CreateSvxTransformTabDialog( NULL, NULL, pSdrView, nAllowedAnchors ); pTransform->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) ); pDlg = pTransform; - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); } } SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked()); @@ -422,7 +408,6 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) { pSh->LeaveSelFrmMode(); // #105852# FME -// pSh->NoEdit(); } bNotify = sal_True; } @@ -616,7 +601,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) } default: - DBG_ASSERT(!this, "falscher Dispatcher"); + OSL_ENSURE(!this, "wrong Dispatcher"); return; } if(!bDone) @@ -632,6 +617,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) GetView().AttrChangedNotify(pSh); // ggf Shellwechsel... } } + /* -----------------------------27.02.2002 15:27------------------------------ Checks whether a given name is allowed for a group shape ---------------------------------------------------------------------------*/ @@ -640,7 +626,7 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam SwWrtShell &rSh = GetShell(); SdrView *pSdrView = rSh.GetDrawView(); const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - DBG_ASSERT(rMarkList.GetMarkCount() == 1, "wrong draw selection"); + OSL_ENSURE(rMarkList.GetMarkCount() == 1, "wrong draw selection"); SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); const String sCurrentName = pObj->GetName(); String sNewName; @@ -652,19 +638,6 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam { nRet = 1; SdrModel* pModel = rSh.getIDocumentDrawModelAccess()->GetDrawModel(); - // --> OD 2006-03-09 #i51726# - all drawing objects can be named now. - // consider also drawing objects inside group objects -// SdrPage* pPage = pModel->GetPage(0); -// sal_uInt32 nCount = pPage->GetObjCount(); -// for( sal_uInt32 i=0; i< nCount; i++ ) -// { -// SdrObject* pTemp = pPage->GetObj(i); -// if(pObj != pTemp && pTemp->ISA(SdrObjGroup) && pTemp->GetName() == sNewName) -// { -// nRet = 0; -// break; -// } -// } SdrObjListIter aIter( *(pModel->GetPage(0)), IM_DEEPWITHGROUPS ); while( aIter.IsMore() ) { @@ -679,9 +652,7 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam } return nRet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ + void SwDrawBaseShell::GetState(SfxItemSet& rSet) { SwWrtShell &rSh = GetShell(); @@ -774,11 +745,6 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - sal_Bool SwDrawBaseShell::Disable(SfxItemSet& rSet, sal_uInt16 nWhich) { sal_Bool bDisable = GetShell().IsSelObjProtected(FLYPROTECT_CONTENT); @@ -995,6 +961,4 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation*, pValidation return 0; } - - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx index 3296ab56f8..9da8d9f837 100644 --- a/sw/source/ui/shells/drwtxtex.cxx +++ b/sw/source/ui/shells/drwtxtex.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,7 +48,6 @@ #include <editeng/adjitem.hxx> #include <editeng/crsditem.hxx> #include <editeng/shdditem.hxx> -#include <editeng/hyznitem.hxx> #include <editeng/udlnitem.hxx> #include <editeng/fontitem.hxx> #include <editeng/fhgtitem.hxx> @@ -63,18 +63,13 @@ #include <svl/ctloptions.hxx> #include <svtools/langtab.hxx> #include <svl/languageoptions.hxx> -#include <sfx2/bindings.hxx> #include <vcl/msgbox.hxx> -#include <sfx2/dispatch.hxx> -#include <sfx2/request.hxx> #include <editeng/flditem.hxx> #include <editeng/editstat.hxx> #include <svx/hlnkitem.hxx> #include <svx/htmlmode.hxx> -#include <svl/languageoptions.hxx> #include <svl/slstitm.hxx> #include <editeng/langitem.hxx> -#include <svtools/langtab.hxx> #include <editeng/unolingu.hxx> #include <editeng/scripttypeitem.hxx> #include <editeng/writingmodeitem.hxx> @@ -86,26 +81,6 @@ #include <editeng/editview.hxx> #include <vcl/outdev.hxx> #include <editeng/hyznitem.hxx> -#include <editeng/kernitem.hxx> -#include <editeng/langitem.hxx> -#include <editeng/lspcitem.hxx> -#include <editeng/orphitem.hxx> -#include <editeng/outliner.hxx> -#include <editeng/postitem.hxx> -#include <editeng/scripttypeitem.hxx> -#include <editeng/shdditem.hxx> -#include <editeng/spltitem.hxx> -#include <svx/svdoutl.hxx> -#include <svx/svdview.hxx> -#include <editeng/udlnitem.hxx> -#include <editeng/unolingu.hxx> -#include <editeng/wghtitem.hxx> -#include <editeng/widwitem.hxx> -#include <editeng/writingmodeitem.hxx> -#include <tools/shl.hxx> -#include <vcl/msgbox.hxx> -#include <vcl/outdev.hxx> -#include <vcl/window.hxx> #include <cmdid.h> #include <doc.hxx> @@ -132,14 +107,8 @@ #include "misc.hrc" -#include <langhelper.hxx> - using namespace ::com::sun::star; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwDrawTextShell::Execute( SfxRequest &rReq ) { SwWrtShell &rSh = GetShell(); @@ -317,10 +286,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) aDlgAttr.Put( SvxKerningItem(0, RES_CHRATR_KERNING) ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( pView->GetWindow(), *pView, aDlgAttr, DLG_CHAR,0, sal_True ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); sal_uInt16 nRet = pDlg->Execute(); if(RET_OK == nRet ) { @@ -338,10 +307,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) case FN_FORMAT_FOOTNOTE_DLG: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), rView.GetWrtShell(), DLG_DOC_FOOTNOTE ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; break; @@ -350,10 +319,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) { SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE, GetView().GetWindow(), &aTmp, GetView().GetWrtShell()); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; rReq.Done(); @@ -363,7 +332,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) { try { - uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY); + uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ui.XSLTFilterDialog"))), uno::UNO_QUERY); if( xDialog.is() ) { xDialog->execute(); @@ -388,7 +357,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) } SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() ); pDialog->SetValues(aCurr, aDocStat ); pDialog->Execute(); @@ -414,10 +383,6 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) aDlgAttr.Put(aEditAttr); - // Die Werte sind erst einmal uebernommen worden, um den Dialog anzuzeigen. - // Muss natuerlich noch geaendert werden - // aDlgAttr.Put( SvxParaDlgLimitsItem( 567 * 50, 5670) ); - aDlgAttr.Put( SvxHyphenZoneItem( sal_False, RES_PARATR_HYPHENZONE) ); aDlgAttr.Put( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) ); aDlgAttr.Put( SvxFmtSplitItem( sal_True, RES_PARATR_SPLIT ) ); @@ -425,10 +390,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) aDlgAttr.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateSwParaDlg( GetView().GetWindow(), GetView(), aDlgAttr,DLG_STD, DLG_PARA, 0, sal_True ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); sal_uInt16 nRet = pDlg->Execute(); if(RET_OK == nRet) { @@ -555,7 +520,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) } return; default: - ASSERT(!this, falscher Dispatcher); + OSL_ENSURE(!this, "wrong dispatcher"); return; } if(nEEWhich && pNewAttrs) @@ -575,10 +540,6 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwDrawTextShell::GetState(SfxItemSet& rSet) { if (!IsTextEdit()) // Sonst manchmal Absturz! @@ -801,9 +762,6 @@ ASK_ESCAPE: } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ void SwDrawTextShell::GetDrawTxtCtrlState(SfxItemSet& rSet) { if (!IsTextEdit()) // Sonst Absturz! @@ -868,9 +826,6 @@ void SwDrawTextShell::GetDrawTxtCtrlState(SfxItemSet& rSet) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ void SwDrawTextShell::ExecClpbrd(SfxRequest &rReq) { if (!IsTextEdit()) // Sonst Absturz! @@ -898,7 +853,7 @@ void SwDrawTextShell::ExecClpbrd(SfxRequest &rReq) break; default: - DBG_ERROR("falscher Dispatcher"); + OSL_ENSURE(false, "wrong dispatcher"); return; } } @@ -958,7 +913,6 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet) /*-------------------------------------------------------------------- Beschreibung: Hyperlink-Status --------------------------------------------------------------------*/ - void SwDrawTextShell::StateInsert(SfxItemSet &rSet) { if (!IsTextEdit()) // Sonst Absturz! @@ -1010,3 +964,4 @@ void SwDrawTextShell::StateInsert(SfxItemSet &rSet) } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx index 1bdd8c2872..6fce73b22e 100644 --- a/sw/source/ui/shells/drwtxtsh.cxx +++ b/sw/source/ui/shells/drwtxtsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,19 +68,13 @@ #include <cmdid.h> #include <helpid.h> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _SHELLS_HRC #include <shells.hrc> -#endif #define SwDrawTextShell #include <sfx2/msg.hxx> #include <swslots.hxx> -#ifndef _POPUP_HRC #include <popup.hrc> -#endif #include <uitool.hxx> #include <wview.hxx> #include <swmodule.hxx> @@ -88,12 +83,9 @@ #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> -#include <svx/svxdlg.hxx> -#include <svx/dialogs.hrc> - #include <cppuhelper/bootstrap.hxx> -#include "swabstdlg.hxx" //CHINA001 +#include "swabstdlg.hxx" #include "misc.hrc" using namespace ::com::sun::star; @@ -101,8 +93,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::i18n; - - SFX_IMPL_INTERFACE(SwDrawTextShell, SfxShell, SW_RES(STR_SHELLNAME_DRAW_TEXT)) { SFX_POPUPMENU_REGISTRATION(SW_RES(MN_DRWTXT_POPUPMENU)); @@ -112,12 +102,6 @@ SFX_IMPL_INTERFACE(SwDrawTextShell, SfxShell, SW_RES(STR_SHELLNAME_DRAW_TEXT)) TYPEINIT1(SwDrawTextShell,SfxShell) -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - void SwDrawTextShell::Init() { SwWrtShell &rSh = GetShell(); @@ -146,11 +130,6 @@ void SwDrawTextShell::Init() pOLV->ShowCursor(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwDrawTextShell::SwDrawTextShell(SwView &rV) : SfxShell(&rV), rView(rV) @@ -165,28 +144,10 @@ SwDrawTextShell::SwDrawTextShell(SwView &rV) : SetHelpId(SW_DRWTXTSHELL); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - -__EXPORT SwDrawTextShell::~SwDrawTextShell() +SwDrawTextShell::~SwDrawTextShell() { if ( GetView().GetCurShell() == this ) rView.ResetSubShell(); - - //MA 13. Nov. 96: Das kommt durchaus vor #33141#: - //(doppel-)Klick von einem Texteditmode in ein anderes Objekt, zwischendurch - //wird eine andere (Draw-)Shell gepusht, die alte aber noch nicht deletet. - //Dann wird vor dem Flush wieder ein DrawTextShell gepusht und der Mode ist - //eingeschaltet. In diesem Moment wird der Dispatcher geflusht und die alte - //DrawTextShell zerstoert. -// ASSERT( !pSdrView->IsTextEdit(), "TextEdit in DTor DrwTxtSh?" ); -// if (pSdrView->IsTextEdit()) -// GetShell().EndTextEdit(); // Danebengeklickt, Ende mit Edit - -// GetShell().Edit(); } SwWrtShell& SwDrawTextShell::GetShell() @@ -194,11 +155,9 @@ SwWrtShell& SwDrawTextShell::GetShell() return rView.GetWrtShell(); } - /*-------------------------------------------------------------------- Beschreibung: Slots mit dieser Statusmethode disablen --------------------------------------------------------------------*/ - void SwDrawTextShell::StateDisableItems( SfxItemSet &rSet ) { SfxWhichIter aIter(rSet); @@ -211,15 +170,11 @@ void SwDrawTextShell::StateDisableItems( SfxItemSet &rSet ) } } - /************************************************************************* |* |* Attribute setzen |* \************************************************************************/ - - - void SwDrawTextShell::SetAttrToMarked(const SfxItemSet& rAttr) { Rectangle aNullRect; @@ -233,23 +188,11 @@ void SwDrawTextShell::SetAttrToMarked(const SfxItemSet& rAttr) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - sal_Bool SwDrawTextShell::IsTextEdit() { return pSdrView->IsTextEdit(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - void SwDrawTextShell::ExecFontWork(SfxRequest& rReq) { SwWrtShell &rSh = GetShell(); @@ -268,12 +211,6 @@ void SwDrawTextShell::ExecFontWork(SfxRequest& rReq) pVFrame->GetBindings().Invalidate(SID_FONTWORK); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - void SwDrawTextShell::StateFontWork(SfxItemSet& rSet) { const sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId(); @@ -285,9 +222,6 @@ void SwDrawTextShell::StateFontWork(SfxItemSet& rSet) |* SfxRequests fuer FontWork bearbeiten |* \************************************************************************/ - - - void SwDrawTextShell::ExecFormText(SfxRequest& rReq) { SwWrtShell &rSh = GetShell(); @@ -337,9 +271,6 @@ void SwDrawTextShell::ExecFormText(SfxRequest& rReq) |* Statuswerte fuer FontWork zurueckgeben |* \************************************************************************/ - - - void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet) { SwWrtShell &rSh = GetShell(); @@ -379,12 +310,6 @@ void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq) { SwWrtShell &rSh = GetShell(); @@ -414,7 +339,7 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq) { Reference< ui::dialogs::XExecutableDialog > xDialog( xMCF->createInstanceWithContext( - rtl::OUString::createFromAscii("com.sun.star.linguistic2.ChineseTranslationDialog") + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.ChineseTranslationDialog")) , xContext), UNO_QUERY); Reference< lang::XInitialization > xInit( xDialog, UNO_QUERY ); if( xInit.is() ) @@ -424,7 +349,7 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq) Sequence<Any> aSeq(1); Any* pArray = aSeq.getArray(); PropertyValue aParam; - aParam.Name = rtl::OUString::createFromAscii("ParentWindow"); + aParam.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow")); aParam.Value <<= makeAny(xDialogParentWindow); pArray[0] <<= makeAny(aParam); xInit->initialize( aSeq ); @@ -473,14 +398,11 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq) break; default: - ASSERT(!this, "unexpected slot-id"); + OSL_ENSURE(!this, "unexpected slot-id"); } } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) { SwWrtShell &rSh = GetShell(); @@ -589,7 +511,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) break; default: - ASSERT(!this, "unexpected slot-id"); + OSL_ENSURE(!this, "unexpected slot-id"); return; } @@ -602,9 +524,6 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) /*-------------------------------------------------------------------- Beschreibung: Undo ausfuehren --------------------------------------------------------------------*/ - - - void SwDrawTextShell::ExecUndo(SfxRequest &rReq) { if( IsTextEdit() ) @@ -650,9 +569,6 @@ void SwDrawTextShell::ExecUndo(SfxRequest &rReq) /*-------------------------------------------------------------------- Beschreibung: Zustand Undo --------------------------------------------------------------------*/ - - - void SwDrawTextShell::StateUndo(SfxItemSet &rSet) { if ( !IsTextEdit() ) @@ -749,7 +665,7 @@ void SwDrawTextShell::ExecTransliteration( SfxRequest & rReq ) break; default: - ASSERT(!this, "falscher Dispatcher"); + OSL_ENSURE(!this, "wrong dispatcher"); } if( nMode ) @@ -763,7 +679,6 @@ void SwDrawTextShell::ExecTransliteration( SfxRequest & rReq ) /*-------------------------------------------------------------------- Beschreibung: Sonderzeichen einfuegen (siehe SDraw: FUBULLET.CXX) --------------------------------------------------------------------*/ - void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) { OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); @@ -896,9 +811,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) rReq.Done(); } } -/*-- 22.10.2003 14:26:32--------------------------------------------------- - -----------------------------------------------------------------------*/ ::svl::IUndoManager* SwDrawTextShell::GetUndoManager() { SwWrtShell &rSh = GetShell(); @@ -908,5 +821,4 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) return &pOutliner->GetUndoManager(); } - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx index 969819d07c..447d46e926 100644 --- a/sw/source/ui/shells/frmsh.cxx +++ b/sw/source/ui/shells/frmsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,6 +33,7 @@ #include <hintids.hxx> #include <svl/whiter.hxx> #include <svtools/imapobj.hxx> +#include <svtools/miscopt.hxx> #include <svl/srchitem.hxx> #include <svtools/imap.hxx> #include <sfx2/viewfrm.hxx> @@ -88,11 +90,17 @@ #include <svx/dialogs.hrc> // <-- +#include <sfx2/filedlghelper.hxx> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> +#include <com/sun/star/beans/PropertyValues.hpp> +#include <com/sun/star/uno/Reference.h> +#include <com/sun/star/frame/XStorable.hpp> +#include <com/sun/star/uno/Any.h> + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; // Prototypen ------------------------------------------------------------ - void lcl_FrmGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLine& rBorderLine); const SwFrmFmt* lcl_GetFrmFmtByName(SwWrtShell& rSh, const String& rName) { @@ -116,7 +124,9 @@ SFX_IMPL_INTERFACE(SwFrameShell, SwBaseShell, SW_RES(STR_SHELLNAME_FRAME)) SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_FRAME_TOOLBOX)); } - +#include <com/sun/star/frame/XComponentLoader.hpp> +#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/frame/XDispatchHelper.hpp> void SwFrameShell::Execute(SfxRequest &rReq) { @@ -129,6 +139,135 @@ void SwFrameShell::Execute(SfxRequest &rReq) switch ( nSlot ) { + case FN_EXPORT_OLE_AS_GRAPHIC: + { + const int nSel = rSh.GetSelectionType(); + if (nSel & nsSelectionType::SEL_OLE) + { + sfx2::FileDialogHelper aDlgHelper( ::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION, 0 ); + aDlgHelper.SetTitle(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Export as JPG" ))); + String aExt(RTL_CONSTASCII_USTRINGPARAM("*.jpg")); + aDlgHelper.AddFilter( aExt, aExt ); + aDlgHelper.SetCurrentFilter( aExt ); + if( aDlgHelper.Execute() == ERRCODE_NONE ) + { + String aFile(aDlgHelper.GetPath()); + // copy the object + uno::Reference< frame::XController > xController = rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface()->getController(); + uno::Reference< frame::XFrame > xFrame = xController->getFrame(); + uno::Reference< frame::XDispatchHelper > xDispatchHelper(::comphelper::getProcessServiceFactory()->createInstance( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.DispatchHelper" )) ), + uno::UNO_QUERY ); + uno::Reference< frame::XDispatchProvider > xDispatchProvider(xFrame,UNO_QUERY); + xDispatchHelper->executeDispatch(xDispatchProvider, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Copy")), + ::rtl::OUString(), 0, + Sequence < ::com::sun::star::beans::PropertyValue >()); + // create new draw document + ::beans::PropertyValues aPropertyValue(1); + aPropertyValue[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Hidden" ) ); + aPropertyValue[0].Value <<= sal_Bool(sal_False); + + uno::Reference< ::frame::XComponentLoader > xLoader(xFrame, UNO_QUERY); + uno::Reference< ::lang::XComponent > xDrawComponent( xLoader->loadComponentFromURL( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:factory/sdraw" ) ), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" ) ), 0, + aPropertyValue)); + + // paste it into draw + uno::Reference< frame::XModel > xDrawModel(xDrawComponent, UNO_QUERY); + xController = xDrawModel->getCurrentController(); + xFrame = xController->getFrame(); + uno::Reference< frame::XDispatchProvider > xDrawDispatchProvider(xFrame,UNO_QUERY); + + xDispatchHelper->executeDispatch(xDrawDispatchProvider, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Paste")), + ::rtl::OUString(), 0, + Sequence < ::com::sun::star::beans::PropertyValue >()); + xDispatchHelper->executeDispatch(xDrawDispatchProvider, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:AlignUp")), + ::rtl::OUString(), 0, + Sequence < ::com::sun::star::beans::PropertyValue >()); + xDispatchHelper->executeDispatch(xDrawDispatchProvider, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:AlignCenter")), + ::rtl::OUString(), 0, + Sequence < ::com::sun::star::beans::PropertyValue >()); + // export as jpeg + xController = xFrame->getController(); + aPropertyValue[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) ); + aPropertyValue[0].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "draw_jpg_Export" ) ); + uno::Reference< frame::XStorable > xStorable(xController->getModel(), uno::UNO_QUERY ); + xStorable->storeToURL(aFile, aPropertyValue); + + // destroy draw document + xDrawComponent->dispose(); + } + } + rReq.Ignore(); + } + break; + case FN_EXPORT_OLE_AS_PDF: + { + const int nSel = rSh.GetSelectionType(); + if (nSel & nsSelectionType::SEL_OLE) + { + sfx2::FileDialogHelper aDlgHelper( ::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION, 0 ); + aDlgHelper.SetTitle(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Export as PDF" ))); + String aExt(RTL_CONSTASCII_USTRINGPARAM("*.pdf")); + aDlgHelper.AddFilter( aExt, aExt ); + aDlgHelper.SetCurrentFilter( aExt ); + if( aDlgHelper.Execute() == ERRCODE_NONE ) + { + String aFile(aDlgHelper.GetPath()); + Reference< frame::XController > xController = rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface()->getController(); + ::beans::PropertyValues aPropertyValue(3); + aPropertyValue[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) ); + aPropertyValue[0].Value <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "writer_pdf_Export" ) ); + Sequence< ::beans::PropertyValue > aSequence(10); + ::beans::PropertyValue aValue; + aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" )); + aValue.Value <<= sal_Bool(sal_False); + aSequence[0] = aValue; + aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Quality" )); + aValue.Value <<= sal_Int32(90); + aSequence[1] = aValue; + aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" )); + aValue.Value <<= sal_Bool(sal_False); + aSequence[2] = aValue; + aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" )); + aValue.Value <<= sal_Int32(300); + aSequence[3] = aValue; + aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" )); + aValue.Value <<= sal_Bool(sal_False); + aSequence[4] = aValue; + aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" )); + aValue.Value <<= sal_Bool(sal_False); + aSequence[5] = aValue; + aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" )); + aValue.Value <<= sal_Bool(sal_True); + aSequence[6] = aValue; + aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FormsType" )); + aValue.Value <<= sal_Int32(0); + aSequence[7] = aValue; + uno::Any aAny; + Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY ); + xView->getSelection() >>= aAny; + aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Selection" )); + aValue.Value <<= aAny; + aSequence[8] = aValue; + aValue.Name = rtl::OUString(); + aValue.Value <<= sal_Int32(0); + aSequence[9] = aValue; + aPropertyValue[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) ); + aPropertyValue[1].Value <<= aSequence; + aPropertyValue[2].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Selection" ) ); + aPropertyValue[2].Value <<= sal_Bool(sal_True); + Reference< frame::XStorable > xStorable(xController->getModel(), uno::UNO_QUERY ); + xStorable->storeToURL(aFile, aPropertyValue); + } + } + rReq.Ignore(); + } + break; case FN_FRAME_TO_ANCHOR: if ( rSh.IsFrmSelected() ) { @@ -241,10 +380,10 @@ void SwFrameShell::Execute(SfxRequest &rReq) case FN_FORMAT_FOOTNOTE_DLG: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), GetView().GetWrtShell(), DLG_DOC_FOOTNOTE ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; break; @@ -253,10 +392,10 @@ void SwFrameShell::Execute(SfxRequest &rReq) { SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE, GetView().GetWindow(), &aTmp, GetView().GetWrtShell()); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; rReq.Done(); @@ -266,7 +405,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) { try { - uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY); + uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ui.XSLTFilterDialog"))), uno::UNO_QUERY); if( xDialog.is() ) { xDialog->execute(); @@ -291,7 +430,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) } SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() ); pDialog->SetValues(aCurr, aDocStat ); pDialog->Execute(); @@ -420,10 +559,8 @@ void SwFrameShell::Execute(SfxRequest &rReq) aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName())); if( nSel & nsSelectionType::SEL_OLE ) { - // --> OD 2009-07-13 #i73249# -// aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + // #i73249# aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) ); - // <-- } const SwRect &rPg = rSh.GetAnyCurRect(RECT_PAGE); @@ -460,7 +597,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView())); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric) )); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_STD, GetView().GetViewFrame(), GetView().GetWindow(), @@ -470,7 +607,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) DLG_FRM_STD, sal_False, nDefPage); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if ( pDlg->Execute() ) { @@ -487,10 +624,8 @@ void SwFrameShell::Execute(SfxRequest &rReq) } if (SFX_ITEM_SET == pOutSet->GetItemState(FN_SET_FRM_ALT_NAME, sal_True, &pItem)) { - // --> OD 2009-07-13 #i73249# -// rSh.SetAlternateText(((const SfxStringItem*)pItem)->GetValue()); + // #i73249# rSh.SetObjTitle(((const SfxStringItem*)pItem)->GetValue()); - // <-- } // Vorlagen-AutoUpdate SwFrmFmt* pFmt = rSh.GetCurFrmFmt(); @@ -542,7 +677,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) //needs cast - no non-const method available SwFrmFmt* pPrevFmt = (SwFrmFmt*) lcl_GetFrmFmtByName(rSh, sPrevName); - DBG_ASSERT(pPrevFmt, "No frame found!"); + OSL_ENSURE(pPrevFmt, "No frame found!"); if(pPrevFmt) { rSh.Chain(*pPrevFmt, *pCurrFlyFmt); @@ -576,7 +711,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) //needs cast - no non-const method available SwFrmFmt* pNextFmt = (SwFrmFmt*) lcl_GetFrmFmtByName(rSh, sNextName); - DBG_ASSERT(pNextFmt, "No frame found!"); + OSL_ENSURE(pNextFmt, "No frame found!"); if(pNextFmt) { rSh.Chain(*(SwFrmFmt*) @@ -639,7 +774,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) break; // <-- default: - ASSERT( !this, "falscher Dispatcher" ); + OSL_ENSURE( !this, "wrong dispatcher" ); return; } // Vorlagen-AutoUpdate @@ -656,11 +791,6 @@ void SwFrameShell::Execute(SfxRequest &rReq) } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwFrameShell::GetState(SfxItemSet& rSet) { SwWrtShell &rSh = GetShell(); @@ -716,8 +846,9 @@ void SwFrameShell::GetState(SfxItemSet& rSet) case FN_FRAME_ALIGN_HORZ_RIGHT: case FN_FRAME_ALIGN_HORZ_LEFT: if ( (eFrmType & FRMTYPE_FLY_INCNT) || - bProtect || - ((nWhich == FN_FRAME_ALIGN_HORZ_CENTER || nWhich == SID_OBJECT_ALIGN_CENTER)&& bHtmlMode) ) + bProtect || + ((nWhich == FN_FRAME_ALIGN_HORZ_CENTER || nWhich == SID_OBJECT_ALIGN_CENTER) && + bHtmlMode )) rSet.DisableItem( nWhich ); break; case FN_FRAME_ALIGN_VERT_ROW_TOP: @@ -727,10 +858,20 @@ void SwFrameShell::GetState(SfxItemSet& rSet) case FN_FRAME_ALIGN_VERT_CHAR_CENTER: case FN_FRAME_ALIGN_VERT_CHAR_BOTTOM: if ( !(eFrmType & FRMTYPE_FLY_INCNT) || bProtect - || (bHtmlMode && FN_FRAME_ALIGN_VERT_CHAR_BOTTOM == nWhich) ) + || (bHtmlMode && FN_FRAME_ALIGN_VERT_CHAR_BOTTOM == nWhich) ) rSet.DisableItem( nWhich ); break; + case FN_EXPORT_OLE: + case FN_EXPORT_OLE_AS_PDF: + case FN_EXPORT_OLE_AS_GRAPHIC: + { + SvtMiscOptions aMiscOptions; + if ( !aMiscOptions.IsExperimentalMode() ) + rSet.DisableItem( nWhich ); + break; + } + case SID_OBJECT_ALIGN_UP : case SID_OBJECT_ALIGN_MIDDLE : case SID_OBJECT_ALIGN_DOWN : @@ -738,7 +879,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet) case FN_FRAME_ALIGN_VERT_TOP: case FN_FRAME_ALIGN_VERT_CENTER: case FN_FRAME_ALIGN_VERT_BOTTOM: - if ( bProtect || (bHtmlMode && eFrmType & FRMTYPE_FLY_ATCNT) ) + if ( bProtect || (bHtmlMode && eFrmType & FRMTYPE_FLY_ATCNT)) rSet.DisableItem( nWhich ); else { @@ -899,8 +1040,6 @@ void SwFrameShell::GetState(SfxItemSet& rSet) /*-------------------------------------------------------------------- Beschreibung: Ctor fuer FrameShell --------------------------------------------------------------------*/ - - SwFrameShell::SwFrameShell(SwView &_rView) : SwBaseShell( _rView ) { @@ -919,12 +1058,6 @@ SwFrameShell::~SwFrameShell() SwTransferable::ClearSelection( GetShell(), (ViewShell *) this ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - void SwFrameShell::ExecFrameStyle(SfxRequest& rReq) { SwWrtShell &rSh = GetShell(); @@ -1100,8 +1233,6 @@ void SwFrameShell::ExecFrameStyle(SfxRequest& rReq) } - - void lcl_FrmGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLine& rBorderLine) { if(pBorderLine->GetInWidth() > rBorderLine.GetInWidth()) @@ -1116,8 +1247,6 @@ void lcl_FrmGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLine& rBo rBorderLine.SetColor(pBorderLine->GetColor()); } - - void SwFrameShell::GetLineStyleState(SfxItemSet &rSet) { SwWrtShell &rSh = GetShell(); @@ -1153,3 +1282,4 @@ void SwFrameShell::StateInsert(SfxItemSet &rSet) rSet.DisableItem(FN_INSERT_FRAME); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx index 079bf94bbc..2d826fec42 100644 --- a/sw/source/ui/shells/grfsh.cxx +++ b/sw/source/ui/shells/grfsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <hintids.hxx> #include <tools/urlobj.hxx> #include <vcl/msgbox.hxx> @@ -77,7 +76,7 @@ #include <swwait.hxx> #include <shells.hrc> #include <popup.hrc> - +#include <extedit.hxx> #define SwGrfShell #include <sfx2/msg.hxx> #include "swslots.hxx" @@ -115,6 +114,19 @@ void SwGrfShell::Execute(SfxRequest &rReq) } } break; + case FN_EXTERNAL_EDIT: + { + /* When the graphic is selected to be opened via some external tool + * for advanced editing + */ + GraphicObject *pGraphicObject = (GraphicObject *) rSh.GetGraphicObj(); + if(0 != pGraphicObject) + { + EditWithExternalTool(pGraphicObject, &rSh); + } + } + break; + case SID_INSERT_GRAPHIC: case FN_FORMAT_GRAFIC_DLG: { @@ -153,10 +165,8 @@ void SwGrfShell::Execute(SfxRequest &rReq) aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName())); if ( nSlot == FN_FORMAT_GRAFIC_DLG ) { - // --> OD 2009-07-13 #i73249# -// aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + // #i73249# aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) ); - // <-- } pRect = &rSh.GetAnyCurRect(RECT_PAGE_PRT); @@ -228,12 +238,12 @@ void SwGrfShell::Execute(SfxRequest &rReq) aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetTopFrame())); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_GRF, GetView().GetViewFrame(), GetView().GetWindow(), aSet, sal_False, DLG_FRM_GRF); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if( pDlg->Execute() ) { rSh.StartAllAction(); @@ -329,11 +339,8 @@ void SwGrfShell::Execute(SfxRequest &rReq) if ( SFX_ITEM_SET == pSet->GetItemState( FN_SET_FRM_ALT_NAME, sal_True, &pItem )) { - // --> OD 2009-07-13 #i73249# -// rSh.SetAlternateText( -// ((const SfxStringItem*)pItem)->GetValue() ); + // #i73249# rSh.SetObjTitle( ((const SfxStringItem*)pItem)->GetValue() ); - // <-- } SfxItemSet aGrfSet( rSh.GetAttrPool(), RES_GRFATR_BEGIN, @@ -360,7 +367,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) break; default: - ASSERT(!this, falscher Dispatcher); + OSL_ENSURE(!this, "wrong dispatcher"); return; } } @@ -504,7 +511,7 @@ void SwGrfShell::ExecAttr( SfxRequest &rReq ) break; default: - ASSERT(!this, falscher Dispatcher); + OSL_ENSURE(!this, "wrong dispatcher"); } if( aGrfSet.Count() ) GetShell().SetAttr( aGrfSet ); @@ -519,10 +526,6 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) rSh.GetCurAttr( aCoreSet ); sal_Bool bParentCntProt = 0 != rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ); sal_Bool bIsGrfCntnt = CNT_GRF == GetShell().GetCntType(); - // --> OD 2006-11-03 #i59688# -// sal_Bool bSwappedOut = rSh.IsGrfSwapOut( sal_True ); -// sal_Bool bBitmapType = !bSwappedOut && GRAPHIC_BITMAP == rSh.GetGraphicType(); - // <-- SetGetStateSet( &rSet ); @@ -543,6 +546,13 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) if( rSh.GetGraphicType() == GRAPHIC_NONE ) bDisable = sal_True; break; + /* + * If the Graphic is None type it should be externally editable + */ + case FN_EXTERNAL_EDIT: + if( rSh.GetGraphicType() == GRAPHIC_NONE ) + bDisable = sal_True; + break; case SID_COLOR_SETTINGS: { if ( bParentCntProt || !bIsGrfCntnt ) @@ -652,16 +662,7 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) { if( bParentCntProt || !bIsGrfCntnt ) bDisable = sal_True; - // --> OD 2006-11-03 #i59688# - // load graphic only if type is unknown -// else if( bSwappedOut ) -// { -// rSet.DisableItem( nWhich ); -// if( AddGrfUpdateSlot( nWhich )) -// rSh.GetGraphic(sal_False); // start the loading -// } -// else -// bDisable = !bBitmapType; + // #i59688# load graphic only if type is unknown else { const sal_uInt16 eGraphicType( rSh.GetGraphicType() ); @@ -705,3 +706,4 @@ SwGrfShell::SwGrfShell(SwView &_rView) : +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/grfshex.cxx b/sw/source/ui/shells/grfshex.cxx index da3c94dc7d..2273153881 100644 --- a/sw/source/ui/shells/grfshex.cxx +++ b/sw/source/ui/shells/grfshex.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,7 +34,6 @@ #include <grfsh.hxx> #include <wrtsh.hxx> #include <view.hxx> -#include <docary.hxx> #include <textsh.hxx> #include <viewopt.hxx> #include <swundo.hxx> @@ -148,3 +148,5 @@ bool SwTextShell::InsertMediaDlg( SfxRequest& rReq ) return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx index 5f6f520f0e..cad6681743 100755 --- a/sw/source/ui/shells/langhelper.cxx +++ b/sw/source/ui/shells/langhelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -255,7 +256,7 @@ namespace SwLangHelper sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nLang ); EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : NULL; - DBG_ASSERT( !pOLV || pEditEngine, "OutlinerView without EditEngine???" ); + OSL_ENSURE( !pOLV || pEditEngine, "OutlinerView without EditEngine???" ); //get ScriptType sal_uInt16 nLangWhichId = 0; @@ -267,7 +268,7 @@ namespace SwLangHelper case SCRIPTTYPE_COMPLEX : nLangWhichId = pEditEngine ? EE_CHAR_LANGUAGE_CTL : RES_CHRATR_CTL_LANGUAGE; break; default: bIsSingleScriptType = false; - DBG_ERROR( "unexpected case" ); + OSL_ENSURE(false, "unexpected case" ); } if (bIsSingleScriptType) { @@ -338,7 +339,7 @@ namespace SwLangHelper // whole paragraph) EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : NULL; - DBG_ASSERT( !pOLV || pEditEngine, "OutlinerView without EditEngine???" ); + OSL_ENSURE( !pOLV || pEditEngine, "OutlinerView without EditEngine???" ); if (pEditEngine) { for (sal_uInt16 i = 0; i < 3; ++i) @@ -436,7 +437,7 @@ namespace SwLangHelper // there is more than one language... nLang = LANGUAGE_DONTKNOW; } - DBG_ASSERT( nLang != LANGUAGE_SYSTEM, "failed to get the language?" ); + OSL_ENSURE( nLang != LANGUAGE_SYSTEM, "failed to get the language?" ); return nLang; } @@ -487,7 +488,7 @@ namespace SwLangHelper } } } - DBG_ASSERT( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" ); + OSL_ENSURE( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" ); return nCurrentLang; } @@ -535,7 +536,7 @@ namespace SwLangHelper } } } - DBG_ASSERT( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" ); + OSL_ENSURE( nCurrentLang != LANGUAGE_SYSTEM, "failed to get the language?" ); return nCurrentLang; } @@ -608,3 +609,4 @@ namespace SwLangHelper } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/listsh.cxx b/sw/source/ui/shells/listsh.cxx index ba60d44912..e9d341ac69 100644 --- a/sw/source/ui/shells/listsh.cxx +++ b/sw/source/ui/shells/listsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,9 +46,7 @@ #include <tools/shl.hxx> #include <svl/srchitem.hxx> -// --> FME 2005-01-04 #i35572# #include <numrule.hxx> -// <-- #include <fmtornt.hxx> #include "wrtsh.hxx" #include "swmodule.hxx" @@ -152,11 +151,10 @@ void SwListShell::Execute(SfxRequest &rReq) sal_uInt16 nSlot = rReq.GetSlot(); SwWrtShell& rSh = GetShell(); - // --> FME 2005-01-04 #i35572# + // #i35572# const SwNumRule* pCurRule = rSh.GetCurNumRule(); - ASSERT( pCurRule, "SwListShell::Execute without NumRule" ) + OSL_ENSURE( pCurRule, "SwListShell::Execute without NumRule" ); bool bOutline = pCurRule && pCurRule->IsOutlineRule(); - // <-- switch (nSlot) { @@ -242,7 +240,7 @@ void SwListShell::Execute(SfxRequest &rReq) } break; default: - ASSERT(!this, falscher Dispatcher); + OSL_ENSURE(!this, "wrong dispatcher"); return; } } @@ -293,3 +291,4 @@ SwListShell::SwListShell(SwView &_rView) : } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/mediash.cxx b/sw/source/ui/shells/mediash.cxx index c2ad81e399..897300ed18 100644 --- a/sw/source/ui/shells/mediash.cxx +++ b/sw/source/ui/shells/mediash.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,11 +30,7 @@ #include "precompiled_sw.hxx" - - -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <hintids.hxx> #include <tools/urlobj.hxx> #include <vcl/msgbox.hxx> @@ -71,12 +68,8 @@ #include <usrpref.hxx> #include <edtwin.hxx> #include <swwait.hxx> -#ifndef _SHELLS_HRC #include <shells.hrc> -#endif -#ifndef _POPUP_HRC #include <popup.hrc> -#endif #include <sfx2/objface.hxx> #include <svx/svdomedia.hxx> @@ -94,8 +87,6 @@ SFX_IMPL_INTERFACE(SwMediaShell, SwBaseShell, SW_RES(STR_SHELLNAME_MEDIA)) SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_MEDIA_TOOLBOX)); } -// ------------------------------------------------------------------------------ - void SwMediaShell::ExecMedia(SfxRequest &rReq) { SwWrtShell* pSh = &GetShell(); @@ -167,8 +158,6 @@ void SwMediaShell::ExecMedia(SfxRequest &rReq) } } -// ------------------------------------------------------------------------------ - void SwMediaShell::GetMediaState(SfxItemSet &rSet) { SfxWhichIter aIter( rSet ); @@ -211,8 +200,6 @@ void SwMediaShell::GetMediaState(SfxItemSet &rSet) } } -// ------------------------------------------------------------------------------ - SwMediaShell::SwMediaShell(SwView &_rView) : SwBaseShell(_rView) @@ -220,3 +207,5 @@ SwMediaShell::SwMediaShell(SwView &_rView) : SetName(String::CreateFromAscii("Media Playback")); SetHelpId(SW_MEDIASHELL); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/navsh.cxx b/sw/source/ui/shells/navsh.cxx new file mode 100644 index 0000000000..7c0c338149 --- /dev/null +++ b/sw/source/ui/shells/navsh.cxx @@ -0,0 +1,139 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * [ Maja Djordjevic < ovcica@gmail.com > ] + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Cédric Bosdonnat <cbosdonnat@novell.com> + * Caolan McNamara <caolanm@redhat.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sw.hxx" + + +#include "cmdid.h" +#include <svx/svdview.hxx> +#include <svl/srchitem.hxx> +#include <svl/eitem.hxx> +#include <svl/whiter.hxx> +#include <svx/svdopath.hxx> +#include <sfx2/request.hxx> +#include <sfx2/dispatch.hxx> +#include <sfx2/objface.hxx> + +#include "wrtsh.hxx" +#include "view.hxx" +#include "edtwin.hxx" +#include "helpid.h" +#include "globals.hrc" + +#include "navsh.hxx" + + +#include "popup.hrc" +#include "shells.hrc" +#define SwNavigationShell +#include "swslots.hxx" + +#include <unomid.h> + +#include "navmgr.hxx" + + +SFX_IMPL_INTERFACE(SwNavigationShell, SwBaseShell, SW_RES(STR_SHELLNAME_NAVIGATION)) +{ +} + +SwNavigationShell::SwNavigationShell(SwView &_rView): + SwBaseShell( _rView ) + +{ + SetName(C2S("Navigation")); + SetHelpId(SW_NAVIGATIONSHELL); +} + +void SwNavigationShell::Execute(SfxRequest &rReq) +{ + SwWrtShell *pSh = &GetShell(); + SdrView* pSdrView = pSh->GetDrawView(); + const SfxItemSet *pArgs = rReq.GetArgs(); + sal_uInt16 nSlotId = rReq.GetSlot(); + sal_Bool bChanged = pSdrView->GetModel()->IsChanged(); + pSdrView->GetModel()->SetChanged(sal_False); + SwNavigationMgr& aSwNavigationMgr = pSh->GetNavigationMgr(); + const SfxPoolItem* pItem; + if(pArgs) + pArgs->GetItemState(nSlotId, sal_False, &pItem); + switch (nSlotId) + { + case FN_NAVIGATION_BACK: + aSwNavigationMgr.goBack(); + break; + + case FN_NAVIGATION_FORWARD: + aSwNavigationMgr.goForward(); + break; + default: + break; + } + if (pSdrView->GetModel()->IsChanged()) + GetShell().SetModified(); + else if (bChanged) + pSdrView->GetModel()->SetChanged(sal_True); +} + +/*-------------------------------------------------------------------- + determine if the buttons should be enabled/disabled + --------------------------------------------------------------------*/ + + +void SwNavigationShell::GetState(SfxItemSet &rSet) +{ + SwWrtShell *pSh = &GetShell(); + SfxWhichIter aIter( rSet ); + sal_uInt16 nWhich = aIter.FirstWhich(); + SwNavigationMgr& aNavigationMgr = pSh->GetNavigationMgr(); + while( nWhich ) + { + switch( nWhich ) + { + case FN_NAVIGATION_BACK: + { + if (!aNavigationMgr.backEnabled()) { + rSet.DisableItem(FN_NAVIGATION_BACK); + } + } + break; + case FN_NAVIGATION_FORWARD: + { + if (!aNavigationMgr.forwardEnabled()) + rSet.DisableItem(FN_NAVIGATION_FORWARD); + } + break; + default: + break; + } + nWhich = aIter.NextWhich(); + } +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/olesh.cxx b/sw/source/ui/shells/olesh.cxx index 537af7b0f2..736e83e47d 100644 --- a/sw/source/ui/shells/olesh.cxx +++ b/sw/source/ui/shells/olesh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,26 +36,14 @@ #include <sfx2/objitem.hxx> #include <wrtsh.hxx> #include <view.hxx> -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <frmsh.hxx> -#ifndef _OLESH_HXX #include <olesh.hxx> -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _POPUP_HRC #include <popup.hrc> -#endif -#ifndef _SHELLS_HRC #include <shells.hrc> -#endif #define SwOleShell @@ -78,3 +67,4 @@ SwOleShell::SwOleShell(SwView &_rView) : } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/shells.src b/sw/source/ui/shells/shells.src index 76b4580800..bf2343c406 100644 --- a/sw/source/ui/shells/shells.src +++ b/sw/source/ui/shells/shells.src @@ -152,7 +152,6 @@ String STR_PAGE }; String RID_TEXT_TOOLBOX { - /* ### ACHTUNG: Neuer Text in Resource? Textobjektleiste : Textleiste */ Text [ en-US ] = "Text Object Bar" ; Text [ x-comment ] = " "; }; diff --git a/sw/source/ui/shells/slotadd.cxx b/sw/source/ui/shells/slotadd.cxx index 67d842dde1..c91d12a684 100644 --- a/sw/source/ui/shells/slotadd.cxx +++ b/sw/source/ui/shells/slotadd.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,9 +53,7 @@ #include <editeng/wrlmitem.hxx> #include <editeng/protitem.hxx> #include <editeng/opaqitem.hxx> -#ifndef _SVX_TSTPITEM_HXX //autogen #include <editeng/tstpitem.hxx> -#endif #include <editeng/akrnitem.hxx> #include <editeng/keepitem.hxx> #include <editeng/kernitem.hxx> @@ -82,9 +81,7 @@ #include <editeng/udlnitem.hxx> #include <editeng/postitem.hxx> #include <editeng/fhgtitem.hxx> -#ifndef _SVX_CNTRITEM_HXX //autogen #include <editeng/cntritem.hxx> -#endif #include <editeng/colritem.hxx> #include <editeng/boxitem.hxx> #include <editeng/sizeitem.hxx> @@ -148,3 +145,4 @@ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx index 2b7163f50b..6390291c93 100644 --- a/sw/source/ui/shells/tabsh.cxx +++ b/sw/source/ui/shells/tabsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -85,8 +86,6 @@ #include <dialog.hrc> - - //!!! new: insert table /* #include <svx/htmlmode.hxx> @@ -96,19 +95,10 @@ */ //!!! -#ifndef _POPUP_HRC #include <popup.hrc> -#endif -#ifndef _SHELLS_HRC #include <shells.hrc> -#endif -#ifndef _TABLE_HRC -#include <table.hrc> -#endif #include <cmdid.h> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <helpid.h> #include <unobaseclass.hxx> @@ -121,20 +111,15 @@ using namespace ::com::sun::star; -//----------------------------------------------------------------------------- - SFX_IMPL_INTERFACE(SwTableShell, SwBaseShell, SW_RES(STR_SHELLNAME_TABLE)) { SFX_POPUPMENU_REGISTRATION(SW_RES(MN_TAB_POPUPMENU)); SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_TABLE_TOOLBOX)); } - TYPEINIT1(SwTableShell,SwBaseShell) -/************************************************************************/ - -const sal_uInt16 __FAR_DATA aUITableAttrRange[] = +const sal_uInt16 aUITableAttrRange[] = { FN_PARAM_TABLE_NAME, FN_PARAM_TABLE_NAME, FN_PARAM_TABLE_HEADLINE, FN_PARAM_TABLE_HEADLINE, @@ -173,9 +158,6 @@ static void lcl_SetAttr( SwWrtShell &rSh, const SfxPoolItem &rItem ) rSh.SetTblAttr( aSet ); } -/************************************************************************/ - - static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh ) { SwFrmFmt *pFmt = rSh.GetTableFmt(); @@ -195,8 +177,6 @@ static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh ) sal_uInt16 nBackgroundDestination = rSh.GetViewOptions()->GetTblDest(); rSet.Put(SwBackgroundDestinationItem(SID_BACKGRND_DESTINATION, nBackgroundDestination )); SvxBrushItem aBrush( RES_BACKGROUND ); -// rSh.GetBoxBackground(aBrush); -// rSet.Put( aBrush ); if(rSh.GetRowBackground(aBrush)) rSet.Put( aBrush, SID_ATTR_BRUSH_ROW ); else @@ -303,9 +283,6 @@ static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh ) return pRep; } -/************************************************************************/ - - void ItemSetToTableParam( const SfxItemSet& rSet, SwWrtShell &rSh ) { @@ -451,7 +428,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet, rSh.SetTableName( *pFmt, ((const SfxStringItem*)pItem)->GetValue() ); // kopiere die ausgesuchten Attribute in den ItemSet - static sal_uInt16 __READONLY_DATA aIds[] = + static sal_uInt16 aIds[] = { RES_PAGEDESC, RES_BREAK, @@ -483,9 +460,6 @@ void ItemSetToTableParam( const SfxItemSet& rSet, rSh.EndAllAction(); } -/************************************************************************/ - - static void lcl_TabGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLine& rBorderLine) { if(pBorderLine->GetInWidth() > rBorderLine.GetInWidth()) @@ -500,7 +474,6 @@ static void lcl_TabGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLi rBorderLine.SetColor(pBorderLine->GetColor()); } - void SwTableShell::Execute(SfxRequest &rReq) { sal_Bool bUseDialog = sal_True; @@ -518,23 +491,6 @@ void SwTableShell::Execute(SfxRequest &rReq) { case SID_ATTR_BORDER: { -/* sal_Bool bPopCrsr = sal_False; - if ( !rReq.IsAPI() ) - { - //Keine Tabellenselektion -> Aenderung wird auf die gesamte - //Tabelle. - if ( !rSh.IsTableMode() ) - { - rSh.StartAction(); - bPopCrsr = sal_True; - rSh.Push(); - rSh.EnterStdMode(); - rSh.MoveTable( fnTableCurr, fnTableStart ); - rSh.SttSelect(); - rSh.MoveTable( fnTableCurr, fnTableEnd ); - rSh.EndSelect(); - } - }*/ if(!pArgs) break; //Items erzeugen, weil wir sowieso nacharbeiten muessen @@ -558,7 +514,7 @@ void SwTableShell::Execute(SfxRequest &rReq) aBox.SetDistance( Max(rCoreBox.GetDistance(),(sal_uInt16)MIN_BORDER_DIST) ); } else - {ASSERT( !this, "Wo ist das Box-Item?" )} + OSL_ENSURE( !this, "where is BoxItem?" ); //since the drawing layer also supports borders the which id might be a different one SvxBoxInfoItem aInfo( SID_ATTR_BORDER_INNER ); @@ -610,9 +566,6 @@ void SwTableShell::Execute(SfxRequest &rReq) if ((pBorderLine = aInfo.GetVert()) != NULL) aInfo.SetLine(&aBorderLine, BOXINFO_LINE_VERT), bLine |= sal_True; -// if ( bPopCrsr && !bLine ) -// aBox.SetDistance( 0 ); - aCoreSet.Put( aBox ); aCoreSet.Put( aInfo ); rSh.SetTabBorders( aCoreSet ); @@ -624,12 +577,6 @@ void SwTableShell::Execute(SfxRequest &rReq) rReq.AppendItem( aInfo ); bCallDone = sal_True; -/* if ( bPopCrsr ) - { - rSh.KillPams(); - rSh.Pop(sal_False); - rSh.EndAction(); - }*/ } break; case FN_INSERT_TABLE: @@ -649,10 +596,10 @@ void SwTableShell::Execute(SfxRequest &rReq) if ( bUseDialog ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); pDlg = pFact->CreateSwTableTabDlg( GetView().GetWindow(), GetPool(), &aCoreSet, &rSh, DLG_FORMAT_TABLE ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); } aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell()))); rSh.GetTblAttr(aCoreSet); @@ -726,12 +673,12 @@ void SwTableShell::Execute(SfxRequest &rReq) sCurText, SID_ATTR_NUMBERFORMAT_INFO )); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(),aCoreSet, pView->GetViewFrame()->GetFrame().GetFrameInterface(), RC_DLG_SWNUMFMTDLG ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if (RET_OK == pDlg->Execute()) { @@ -821,7 +768,7 @@ void SwTableShell::Execute(SfxRequest &rReq) aInfoBox.Execute(); break; } - default: ASSERT( !this, "unbekannter Returnwert MergeTab."); + default: OSL_ENSURE( !this, "unknown return value MergeTab."); } break; case FN_TABLE_ADJUST_CELLS: @@ -874,10 +821,10 @@ void SwTableShell::Execute(SfxRequest &rReq) case SID_AUTOFORMAT: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(&GetView().GetViewFrame()->GetWindow(), &rSh , DLG_AUTOFMT_TABLE ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; } @@ -885,17 +832,17 @@ void SwTableShell::Execute(SfxRequest &rReq) case FN_TABLE_SET_ROW_HEIGHT: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); VclAbstractDialog* pDlg = pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh, DLG_ROW_HEIGHT ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; } break; case FN_NUMBER_BULLETS: case FN_NUM_BULLET_ON: - ASSERT( !this, "Funktion darf zur Zeit nicht gerufen werden." ); + OSL_ENSURE( !this, "function may not be called now." ); break; case FN_TABLE_INSERT_COL: @@ -1044,10 +991,10 @@ void SwTableShell::Execute(SfxRequest &rReq) else { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSplitTableDialog* pDlg = pFact->CreateSplitTblDialog( GetView().GetWindow(), rSh ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); rReq.AppendItem( SfxUInt16Item( FN_PARAM_1, pDlg->GetSplitMode() ) ); delete pDlg; @@ -1064,9 +1011,9 @@ void SwTableShell::Execute(SfxRequest &rReq) if( bPrev && bNext ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); VclAbstractDialog* pDlg = pFact->CreateSwVclDialog( DLG_MERGE_TABLE, GetView().GetWindow(), bPrev ); - DBG_ASSERT(pDlg, "dialogdiet pDlg fail!"); + OSL_ENSURE(pDlg, "dialogdiet pDlg fail!"); if( RET_OK != pDlg->Execute()) bPrev = bNext = sal_False; delete pDlg; @@ -1087,7 +1034,7 @@ void SwTableShell::Execute(SfxRequest &rReq) : TBLVAR_CHGABS ) ); SfxBindings& rBind = GetView().GetViewFrame()->GetBindings(); - static sal_uInt16 __READONLY_DATA aInva[] = + static sal_uInt16 aInva[] = { FN_TABLE_MODE_FIX, FN_TABLE_MODE_FIX_PROP, FN_TABLE_MODE_VARIABLE, @@ -1237,15 +1184,12 @@ void SwTableShell::Execute(SfxRequest &rReq) break; default: - ASSERT( !this, "falscher Dispatcher" ); + OSL_ENSURE( !this, "wrong Dispatcher" ); return; } if(bCallDone) rReq.Done(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ void SwTableShell::GetState(SfxItemSet &rSet) { @@ -1296,7 +1240,6 @@ void SwTableShell::GetState(SfxItemSet &rSet) case FN_INSERT_TABLE: // Irgendeinen Wert "putten", damit Controller enabled bleibt. // Statt "Insert:Table" erscheint dann "Format:Table". -// rSet.Put(SfxUInt16Item(nSlot, 1)); break; case FN_TABLE_OPTIMAL_HEIGHT: @@ -1428,10 +1371,6 @@ void SwTableShell::GetState(SfxItemSet &rSet) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwTableShell::SwTableShell(SwView &_rView) : SwBaseShell(_rView) { @@ -1439,10 +1378,6 @@ SwTableShell::SwTableShell(SwView &_rView) : SetHelpId(SW_TABSHELL); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwTableShell::GetFrmBorderState(SfxItemSet &rSet) { SfxItemSet aCoreSet( GetPool(), @@ -1454,10 +1389,6 @@ void SwTableShell::GetFrmBorderState(SfxItemSet &rSet) rSet.Put( aCoreSet ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwTableShell::ExecTableStyle(SfxRequest& rReq) { SwWrtShell &rSh = GetShell(); @@ -1468,24 +1399,6 @@ void SwTableShell::ExecTableStyle(SfxRequest& rReq) case SID_FRAME_LINESTYLE: case SID_FRAME_LINECOLOR: { -/* Tabellenselektion ist abgeschafft - sal_Bool bPopCrsr = sal_False; - if ( !rReq.IsAPI() ) - { - //Keine Tabellenselektion -> Aenderung wird auf die gesamte - //Tabelle. - if ( !rSh.IsTableMode() ) - { - bPopCrsr = sal_True; - rSh.Push(); - rSh.StartAction(); - rSh.EnterStdMode(); - rSh.MoveTable( fnTableCurr, fnTableStart ); - rSh.SttSelect(); - rSh.MoveTable( fnTableCurr, fnTableEnd ); - rSh.EndSelect(); - } - }*/ if ( rReq.GetSlot() == SID_FRAME_LINESTYLE ) { const SvxLineItem &rLineItem = (const SvxLineItem&)pArgs-> @@ -1501,18 +1414,12 @@ void SwTableShell::ExecTableStyle(SfxRequest& rReq) } rReq.Done(); -/* if ( bPopCrsr ) - { - rSh.KillPams(); - rSh.Pop(sal_False); - rSh.EndAction(); - }*/ + break; } } } - void SwTableShell::GetLineStyleState(SfxItemSet &rSet) { SfxItemSet aCoreSet( GetPool(), @@ -1580,7 +1487,7 @@ void SwTableShell::ExecNumberFormat(SfxRequest& rReq) break; default: - ASSERT(sal_False, falscher Dispatcher); + OSL_ENSURE(false, "wrong dispatcher"); return; } @@ -1596,3 +1503,4 @@ void SwTableShell::ExecNumberFormat(SfxRequest& rReq) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/textdrw.cxx b/sw/source/ui/shells/textdrw.cxx index 584da30a17..16e47464ad 100644 --- a/sw/source/ui/shells/textdrw.cxx +++ b/sw/source/ui/shells/textdrw.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,9 +43,7 @@ #include <swundo.hxx> #include <basesh.hxx> -#ifndef _POOLFMT_HRC #include <poolfmt.hrc> -#endif #include <docsh.hxx> #include <sfx2/docfile.hxx> @@ -53,12 +52,8 @@ #include <unomid.h> - using namespace ::com::sun::star; using ::rtl::OUString; -/*--------------------------------------------------------------------------- - Beschreibung: - ----------------------------------------------------------------------------*/ void SwBaseShell::InsertURLButton(const String& rURL, const String& rTarget, const String& rTxt) { @@ -92,7 +87,7 @@ void SwBaseShell::InsertURLButton(const String& rURL, const String& rTarget, con SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetMarkedSdrObj()); uno::Reference< awt::XControlModel > xControlModel = pUnoCtrl->GetUnoControlModel(); - ASSERT( xControlModel.is(), "UNO-Control ohne Model" ); + OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" ); if( !xControlModel.is() ) return; @@ -140,4 +135,4 @@ void SwBaseShell::InsertURLButton(const String& rURL, const String& rTarget, con rSh.EndAction(); } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx index 01f20a1bc4..ead452771e 100644 --- a/sw/source/ui/shells/textfld.cxx +++ b/sw/source/ui/shells/textfld.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************ ************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,7 +56,6 @@ #include <view.hxx> #include <wrtsh.hxx> #include <basesh.hxx> -#include <wrtsh.hxx> #include <flddat.hxx> #include <numrule.hxx> #include <textsh.hxx> @@ -71,7 +71,6 @@ #include <shells.hrc> #include <sfx2/app.hxx> -#include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> #include "swabstdlg.hxx" #include "dialog.hrc" @@ -84,7 +83,6 @@ using namespace nsSwDocInfoSubType; - extern sal_Bool bNoInterrupt; // in mainwn.cxx String& lcl_AppendRedlineStr( String& rStr, sal_uInt16 nRedlId ) @@ -104,7 +102,6 @@ String& lcl_AppendRedlineStr( String& rStr, sal_uInt16 nRedlId ) } // STATIC DATA ----------------------------------------------------------- - void SwTextShell::ExecField(SfxRequest &rReq) { SwWrtShell& rSh = GetShell(); @@ -150,10 +147,10 @@ void SwTextShell::ExecField(SfxRequest &rReq) default: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractDialog* pDlg = pFact->CreateSwFldEditDlg( GetView(),RC_DLG_SWFLDEDITDLG ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; } @@ -241,7 +238,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) if( SFX_ITEM_SET == pArgs->GetItemState( FN_PARAM_FIELD_FORMAT, sal_False, &pItem )) nFormat = ((SfxUInt32Item *)pItem)->GetValue(); - DBG_WARNING("Command is not yet used"); + OSL_ENSURE(false, "Command is not yet used"); sal_Unicode cSeparator = ' '; SwInsertFld_Data aData(nType, 0, aPar1, aPar2, nFormat, GetShellPtr(), cSeparator ); bRes = aFldMgr.InsertFld(aData); @@ -402,7 +399,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) if (pRedline) { sComment = pRedline->GetComment(); - if ( sComment == String(rtl::OUString::createFromAscii("")) ) + if ( !sComment.Len() ) GetView().GetDocShell()->Broadcast(SwRedlineHint(pRedline,SWREDLINE_INSERTED)); const_cast<SwRedline*>(pRedline)->Broadcast(SwRedlineHint(pRedline,SWREDLINE_FOCUS,&GetView())); } @@ -419,9 +416,9 @@ void SwTextShell::ExecField(SfxRequest &rReq) sal_Bool bTravel = sal_False; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); ::DialogGetRanges fnGetRange = pFact->GetDialogGetRangesFunc( RID_SVXDLG_POSTIT ); - DBG_ASSERT(fnGetRange, "Dialogdiet fail! GetRanges()"); + OSL_ENSURE(fnGetRange, "Dialogdiet fail! GetRanges()"); SfxItemSet aSet(GetPool(), fnGetRange()); aSet.Put(SvxPostItTextItem(sComment.ConvertLineEnd(), SID_ATTR_POSTIT_TEXT)); aSet.Put(SvxPostItAuthorItem(pRedline->GetAuthorString(), SID_ATTR_POSTIT_AUTHOR)); @@ -464,9 +461,9 @@ void SwTextShell::ExecField(SfxRequest &rReq) bTravel |= bNext|bPrev; SvxAbstractDialogFactory* pFact2 = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact2, "Dialogdiet fail!"); + OSL_ENSURE(pFact2, "Dialogdiet fail!"); AbstractSvxPostItDialog* pDlg = pFact2->CreateSvxPostItDialog( pMDI, aSet, bTravel, sal_True ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->HideAuthor(); String sTitle(SW_RES(STR_REDLINE_COMMENT)); @@ -525,10 +522,10 @@ void SwTextShell::ExecField(SfxRequest &rReq) else { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractJavaEditDialog* pDlg = pFact->CreateJavaEditDialog( DLG_JAVAEDIT, pMDI, &rSh); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if ( pDlg->Execute() ) { aType = pDlg->GetType(); @@ -604,7 +601,7 @@ FIELD_INSERT: } break; default: - ASSERT(sal_False, falscher Dispatcher); + OSL_ENSURE(false, "wrong dispatcher"); return; } } @@ -641,12 +638,6 @@ void SwTextShell::StateField( SfxItemSet &rSet ) break; case FN_EDIT_FIELD: { - /* #108536# Fields can be selected, too now. Removed - - if( rSh.HasSelection() ) - rSet.DisableItem(nWhich); - else ... - */ if( !bGetField ) { @@ -722,11 +713,6 @@ void SwTextShell::StateField( SfxItemSet &rSet ) } } -/*--------------------------------------------------------------------------- - Beschreibung: - ----------------------------------------------------------------------------*/ - - void SwTextShell::InsertHyperlink(const SvxHyperlinkItem& rHlnkItem) { const String& rName = rHlnkItem.GetName(); @@ -891,4 +877,4 @@ IMPL_LINK( SwTextShell, RedlinePrevHdl, AbstractSvxPostItDialog *, pBtn ) return 0; } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/textglos.cxx b/sw/source/ui/shells/textglos.cxx index 839db6ab45..60db5a8c10 100644 --- a/sw/source/ui/shells/textglos.cxx +++ b/sw/source/ui/shells/textglos.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,9 +34,7 @@ #include <svl/eitem.hxx> #include <svl/stritem.hxx> -#include "errhdl.hxx" #include "view.hxx" -#include "initui.hxx" #include "cmdid.h" #include "textsh.hxx" #include "initui.hxx" @@ -46,7 +45,6 @@ #include <misc.hrc> // STATIC DATA ----------------------------------------------------------- - void SwTextShell::ExecGlossary(SfxRequest &rReq) { sal_uInt16 nSlot = rReq.GetSlot(); @@ -88,7 +86,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq) aShortName = (( const SfxStringItem *)pItem)->GetValue(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS ); if ( fnSetActGroup ) (*fnSetActGroup)( aGroup ); @@ -104,7 +102,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq) { String aGroup = (( const SfxStringItem *)pItem)->GetValue(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS ); if ( fnSetActGroup ) (*fnSetActGroup)( aGroup ); @@ -120,7 +118,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq) if(SFX_ITEM_SET == pArgs->GetItemState(FN_PARAM_1, sal_False, &pItem )) aName = (( const SfxStringItem *)pItem)->GetValue(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); ::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS ); if ( fnSetActGroup ) (*fnSetActGroup)( aGroup ); @@ -131,7 +129,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq) } break; default: - ASSERT(sal_False, falscher Dispatcher); + OSL_ENSURE(false, "wrong dispatcher"); return; } if(bUpdateList) @@ -142,4 +140,4 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq) } } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/textidx.cxx b/sw/source/ui/shells/textidx.cxx index c7040261cf..123059e4e1 100644 --- a/sw/source/ui/shells/textidx.cxx +++ b/sw/source/ui/shells/textidx.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -51,9 +52,7 @@ #include <index.hrc> #include <globals.hrc> - // STATIC DATA ----------------------------------------------------------- - void SwTextShell::ExecIdx(SfxRequest &rReq) { const SfxItemSet *pArgs = rReq.GetArgs(); @@ -70,9 +69,9 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) case FN_EDIT_AUTH_ENTRY_DLG : { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); VclAbstractDialog* pDlg = pFact->CreateVclAbstractDialog( pMDI, GetShell(), DLG_EDIT_AUTHMARK); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; } @@ -98,19 +97,19 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) { // Mehrere Marken, welche solls denn sein ? // SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); VclAbstractDialog* pMultDlg = pFact->CreateMultiTOXMarkDlg( DLG_MULTMRK, pMDI, aMgr); - DBG_ASSERT(pMultDlg, "Dialogdiet fail!"); + OSL_ENSURE(pMultDlg, "Dialogdiet fail!"); nRet = pMultDlg->Execute(); delete pMultDlg; } if( nRet == RET_OK) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); VclAbstractDialog* pDlg = pFact->CreateIndexMarkModalDlg( DLG_EDIT_IDXMARK, pMDI, GetShell(), aMgr.GetCurTOXMark() ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; } @@ -155,11 +154,11 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) aSet.Put(*pSet); } SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractMultiTOXTabDialog* pDlg = pFact->CreateMultiTOXTabDialog( DLG_MULTI_TOX, pMDI, aSet, rSh, (SwTOXBase* )pCurTOX, USHRT_MAX, bGlobal); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; } @@ -168,18 +167,17 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) { SwWrtShell& rSh = GetShell(); const SwTOXBase* pBase = rSh.GetCurTOX(); - DBG_ASSERT(pBase, "no TOXBase to remove"); + OSL_ENSURE(pBase, "no TOXBase to remove"); if( pBase ) rSh.DeleteTOX(*pBase, sal_True); } break; default: - ASSERT(!this, falscher Dispatcher); + OSL_ENSURE(!this, "wrong dispatcher"); return; } } - void SwTextShell::GetIdxState(SfxItemSet &rSet) { SwWrtShell& rSh = GetShell(); @@ -215,7 +213,7 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet) rSet.Put(SfxBoolItem(FN_INSERT_AUTH_ENTRY_DLG, sal_True)); } - else //if( SFX_ITEM_UNKNOWN != rSet.GetItemState( FN_EDIT_IDX_ENTRY_DLG )) + else { sal_Bool bEnableEdit = sal_True; @@ -257,5 +255,4 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet) } } -// ----------------------------------------------------------------------- - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index b99cc467f7..93c297dd8d 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -127,12 +128,6 @@ using ::rtl::OUString; #include <frmui.hrc> #include <unomid.h> - - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SFX_IMPL_INTERFACE(SwTextShell, SwBaseShell, SW_RES(STR_SHELLNAME_TEXT)) { SFX_POPUPMENU_REGISTRATION(SW_RES(MN_TEXT_POPUPMENU)); @@ -144,18 +139,14 @@ SFX_IMPL_INTERFACE(SwTextShell, SwBaseShell, SW_RES(STR_SHELLNAME_TEXT)) SFX_CHILDWINDOW_REGISTRATION(SID_RUBY_DIALOG); } - - TYPEINIT1(SwTextShell,SwBaseShell) - - void SwTextShell::ExecInsert(SfxRequest &rReq) { SwWrtShell &rSh = GetShell(); - ASSERT( !rSh.IsObjSelected() && !rSh.IsFrmSelected(), - "Falsche Shell auf dem Dispatcher" ); + OSL_ENSURE( !rSh.IsObjSelected() && !rSh.IsFrmSelected(), + "wrong shell on dispatcher" ); const SfxItemSet *pArgs = rReq.GetArgs(); const SfxPoolItem* pItem = 0; @@ -261,7 +252,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY ); if ( xSet.is() ) { - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("PluginURL"), + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginURL")), uno::makeAny( ::rtl::OUString( pURL->GetMainURL( INetURLObject::NO_DECODE ) ) ) ); } } @@ -312,7 +303,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) try { if ( sClassLocation.Len() ) - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("PluginURL"), + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginURL")), uno::makeAny( ::rtl::OUString( URIHelper::SmartRel2Abs( @@ -322,7 +313,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) if ( aCommandList.Count() ) { aCommandList.FillSequence( aSeq ); - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("PluginCommands"), uno::makeAny( aSeq ) ); + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginCommands")), uno::makeAny( aSeq ) ); } } catch ( uno::Exception& ) @@ -336,7 +327,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) } else { - DBG_ASSERT( !pNameItem || nSlot == SID_INSERT_OBJECT, "Superfluous argument!" ); + OSL_ENSURE( !pNameItem || nSlot == SID_INSERT_OBJECT, "Superfluous argument!" ); rSh.InsertObject( xObj, pName, sal_True, nSlot); rReq.Done(); } @@ -372,31 +363,27 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) aMargin = pMarginItem->GetSize(); if ( pURLItem ) - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameURL"), uno::makeAny( ::rtl::OUString( pURLItem->GetValue() ) ) ); + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameURL")), uno::makeAny( ::rtl::OUString( pURLItem->GetValue() ) ) ); if ( pNameItem ) - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameName"), uno::makeAny( ::rtl::OUString( pNameItem->GetValue() ) ) ); + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameName")), uno::makeAny( ::rtl::OUString( pNameItem->GetValue() ) ) ); if ( eScroll == ScrollingAuto ) - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoScroll"), + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsAutoScroll")), uno::makeAny( sal_True ) ); else - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsScrollingMode"), + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsScrollingMode")), uno::makeAny( (sal_Bool) ( eScroll == ScrollingYes) ) ); - //if ( aFrmDescr.IsFrameBorderSet() ) if ( pBorderItem ) - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsBorder"), + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsBorder")), uno::makeAny( (sal_Bool) pBorderItem->GetValue() ) ); - /*else - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoBorder"), - makeAny( sal_True ) );*/ if ( pMarginItem ) { - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginWidth"), + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginWidth")), uno::makeAny( sal_Int32( aMargin.Width() ) ) ); - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginHeight"), + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginHeight")), uno::makeAny( sal_Int32( aMargin.Height() ) ) ); } } @@ -433,9 +420,6 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) { SwFrmFmt* pTblFmt = GetShell().GetTableFmt(); String aCurrentTblName = pTblFmt->GetName(); - // String aText( String::CreateFromAscii("<.>") ); // was used for UI - // aText.Insert( rWrtShell.GetBoxNms(), 2); - // aText.Insert( aCurrentTblName, 1 ); aRangeString = aCurrentTblName; aRangeString += OUString::valueOf( sal_Unicode('.') ); aRangeString += GetShell().GetBoxNms(); @@ -576,7 +560,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) } else { - static sal_uInt16 __READONLY_DATA aFrmAttrRange[] = + static sal_uInt16 aFrmAttrRange[] = { RES_FRMATR_BEGIN, RES_FRMATR_END-1, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, @@ -612,10 +596,10 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, GetView().GetDocShell())); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_STD, GetView().GetViewFrame(), &GetView().GetViewFrame()->GetWindow(), aSet, sal_True); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(pDlg->Execute() && pDlg->GetOutputItemSet()) { //local variable necessary at least after call of .AutoCaption() because this could be deleted at this point @@ -678,10 +662,10 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) else { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractInsertGrfRulerDlg* pDlg = pFact->CreateInsertGrfRulerDlg( DLG_INSERT_RULER, pParent ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); // MessageBox fuer fehlende Grafiken if(!pDlg->HasImages()) InfoBox( pParent, SW_RES(MSG_NO_RULER)).Execute(); @@ -733,16 +717,16 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) case FN_FORMAT_COLUMN : { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); VclAbstractDialog* pColDlg = pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh, DLG_COLUMN); - DBG_ASSERT(pColDlg, "Dialogdiet fail!"); + OSL_ENSURE(pColDlg, "Dialogdiet fail!"); pColDlg->Execute(); delete pColDlg; } break; default: - ASSERT( !this, "falscher Dispatcher" ); + OSL_ENSURE(!this, "wrong dispatcher"); return; } } @@ -755,7 +739,6 @@ bool lcl_IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect ) return bRet; } - void SwTextShell::StateInsert( SfxItemSet &rSet ) { sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); @@ -893,7 +876,7 @@ void SwTextShell::StateInsert( SfxItemSet &rSet ) } break; case FN_INSERT_HRULER : - if((rSh.IsReadOnlyAvailable() && rSh.HasReadonlySel()) || bCrsrInHidden ) + if ( (rSh.IsReadOnlyAvailable() && rSh.HasReadonlySel()) || bCrsrInHidden ) rSet.DisableItem(nWhich); break; case FN_FORMAT_COLUMN : @@ -923,10 +906,6 @@ void SwTextShell::StateInsert( SfxItemSet &rSet ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwTextShell::ExecDelete(SfxRequest &rReq) { SwWrtShell &rSh = GetShell(); @@ -966,7 +945,7 @@ void SwTextShell::ExecDelete(SfxRequest &rReq) rSh.DelLine(); break; default: - ASSERT(!this, "falscher Dispatcher"); + OSL_ENSURE(!this, "wrong dispatcher"); return; } rReq.Done(); @@ -1011,7 +990,7 @@ void SwTextShell::ExecTransliteration( SfxRequest & rReq ) break; default: - ASSERT(!this, "falscher Dispatcher"); + OSL_ENSURE(!this, "wrong dispatcher"); } if( nMode ) @@ -1019,13 +998,6 @@ void SwTextShell::ExecTransliteration( SfxRequest & rReq ) } } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - SwTextShell::SwTextShell(SwView &_rView) : SwBaseShell(_rView), pPostItFldMgr( 0 ) { @@ -1033,18 +1005,10 @@ SwTextShell::SwTextShell(SwView &_rView) : SetHelpId(SW_TEXTSHELL); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwTextShell::~SwTextShell() { } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwTextShell::InsertSymbol( SfxRequest& rReq ) { const SfxItemSet *pArgs = rReq.GetArgs(); @@ -1126,7 +1090,6 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) delete pDlg; } - sal_Bool bFontChanged = sal_False; if( aChars.Len() ) { rSh.StartAllAction(); @@ -1159,7 +1122,6 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) // #108876# a font attribute has to be set always due to a guessed script type if( aNewFont.GetName().Len() ) { - bFontChanged = sal_True; SvxFontItem aNewFontItem( aFont ); aNewFontItem.GetFamilyName() = aNewFont.GetName(); aNewFontItem.GetFamily() = aNewFont.GetFamily(); @@ -1219,4 +1181,4 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) } } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 5baaf23d57..a1cce6c575 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -102,7 +103,6 @@ #include <web.hrc> #include "paratr.hxx" #include <crsskip.hxx> -#include <docstat.hxx> #include <vcl/svapp.hxx> #include <sfx2/app.hxx> #include <breakit.hxx> @@ -116,7 +116,6 @@ #include <IDocumentStatistics.hxx> #include <sfx2/sfxdlg.hxx> -#include <svl/languageoptions.hxx> #include <unotools/lingucfg.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/util/XChangesBatch.hpp> @@ -132,7 +131,6 @@ using namespace ::com::sun::star; - void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,const SfxItemSet *pArgs, SfxRequest *pReq ) { FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &rWrtSh.GetView())); @@ -182,10 +180,10 @@ void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,c if ( bUseDialog && GetActiveView() ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); pDlg = pFact->CreateSwCharDlg( rWrtSh.GetView().GetWindow(), rWrtSh.GetView(), aCoreSet, DLG_CHAR ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if( FN_INSERT_HYPERLINK == nSlot ) pDlg->SetCurPageId(TP_CHAR_URL); } @@ -262,10 +260,6 @@ void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,c delete pDlg; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - short lcl_AskRedlineMode(Window *pWin) { MessBox aQBox( pWin, 0, @@ -429,7 +423,6 @@ void SwTextShell::Execute(SfxRequest &rReq) { String aStr; SFX_REQUEST_ARG( rReq, pFont, SfxStringItem, FN_PARAM_1 , sal_False ); -// SFX_REQUEST_ARG( rReq, pCharset, SfxInt16Item, FN_PARAM_2 , sal_False ); SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, nSlot , sal_False ); if ( pNameItem ) aStr = pNameItem->GetValue(); @@ -444,7 +437,6 @@ void SwTextShell::Execute(SfxRequest &rReq) SvxFontItem &rFont = (SvxFontItem &) aSet.Get( RES_CHRATR_FONT ); SvxFontItem aFont( rFont.GetFamily(), pFont->GetValue(), rFont.GetStyleName(), rFont.GetPitch(), RTL_TEXTENCODING_DONTKNOW, RES_CHRATR_FONT ); - //pCharset ? (CharSet) pCharset->GetValue() : RTL_TEXTENCODING_DONTKNOW ); rWrtSh.SetAttr( aSet, nsSetAttrMode::SETATTR_DONTEXPAND ); rWrtSh.ResetSelect(0, sal_False); rWrtSh.EndSelect(); @@ -457,10 +449,10 @@ void SwTextShell::Execute(SfxRequest &rReq) case FN_INSERT_FOOTNOTE_DLG: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractInsFootNoteDlg* pDlg = pFact->CreateInsFootNoteDlg( DLG_INS_FOOTNOTE, GetView().GetWindow(), rWrtSh, sal_False ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->SetHelpId(GetStaticInterface()->GetSlot(nSlot)->GetCommand()); if ( pDlg->Execute() == RET_OK ) { @@ -470,7 +462,6 @@ void SwTextShell::Execute(SfxRequest &rReq) aReq.AppendItem( SfxStringItem( nId, pDlg->GetStr() ) ); if ( pDlg->GetFontName().Len() ) aReq.AppendItem( SfxStringItem( FN_PARAM_1, pDlg->GetFontName() ) ); - //aReq.AppendItem( SfxStringItem( FN_PARAM_2, pDlg->GetCharSet() ) ); ExecuteSlot( aReq ); } @@ -481,10 +472,10 @@ void SwTextShell::Execute(SfxRequest &rReq) case FN_FORMAT_FOOTNOTE_DLG: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), rWrtSh, DLG_DOC_FOOTNOTE ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; break; @@ -501,21 +492,19 @@ void SwTextShell::Execute(SfxRequest &rReq) // remove the languages from that) SvUShortsSort aAttribs; - sal_uInt16 __FAR_DATA aResetableSetRange[] = { + sal_uInt16 aResetableSetRange[] = { RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_CHRATR_BEGIN, RES_CHRATR_LANGUAGE - 1, RES_CHRATR_LANGUAGE + 1, RES_CHRATR_CJK_LANGUAGE - 1, RES_CHRATR_CJK_LANGUAGE + 1, RES_CHRATR_CTL_LANGUAGE - 1, RES_CHRATR_CTL_LANGUAGE + 1, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, - RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, - RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY, RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, 0 }; - sal_uInt16 __FAR_DATA *pUShorts = aResetableSetRange; + sal_uInt16 *pUShorts = aResetableSetRange; while (*pUShorts) { sal_uInt16 nL = pUShorts[1] - pUShorts[0] + 1; @@ -546,10 +535,10 @@ void SwTextShell::Execute(SfxRequest &rReq) else { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSwBreakDlg* pDlg = pFact->CreateSwBreakDlg( GetView().GetWindow(), rWrtSh, DLG_BREAK ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if ( pDlg->Execute() == RET_OK ) { nKind = pDlg->GetKind(); @@ -594,10 +583,10 @@ void SwTextShell::Execute(SfxRequest &rReq) else { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); VclAbstractDialog* pDlg = pFact->CreateSwInsertBookmarkDlg( GetView().GetWindow(), rWrtSh, rReq, DLG_INSERT_BOOKMARK ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; } @@ -627,10 +616,10 @@ void SwTextShell::Execute(SfxRequest &rReq) pVFrame->ToggleChildWindow(FN_REDLINE_ACCEPT); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSwModalRedlineAcceptDlg* pDlg = pFact->CreateSwModalRedlineAcceptDlg( &GetView().GetEditWin(), DLG_MOD_REDLINE_ACCEPT ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); switch (lcl_AskRedlineMode(&GetView().GetEditWin())) { @@ -692,10 +681,10 @@ void SwTextShell::Execute(SfxRequest &rReq) case FN_SORTING_DLG: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); VclAbstractDialog* pDlg = pFact->CreateVclAbstractDialog( GetView().GetWindow(), rWrtSh, DLG_SORTING ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; rReq.Done(); @@ -705,10 +694,10 @@ void SwTextShell::Execute(SfxRequest &rReq) { SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE, GetView().GetWindow(), &aTmp, rWrtSh); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; rReq.Done(); @@ -877,11 +866,13 @@ void SwTextShell::Execute(SfxRequest &rReq) { FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView())); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); + + sal_Bool bApplyCharUnit = ::HasCharUnit(0 != PTR_CAST(SwWebView, &GetView())); + SW_MOD()->PutItem(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bApplyCharUnit)); + SfxItemSet aCoreSet( GetPool(), RES_PARATR_BEGIN, RES_PARATR_END - 1, - // --> OD 2008-02-25 #refactorlists# RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1, - // <-- RES_FRMATR_BEGIN, RES_FRMATR_END - 1, SID_ATTR_TABSTOP_POS, SID_ATTR_TABSTOP_POS, SID_ATTR_TABSTOP_DEFAULTS, SID_ATTR_TABSTOP_DEFAULTS, @@ -894,10 +885,8 @@ void SwTextShell::Execute(SfxRequest &rReq) FN_NUMBER_NEWSTART, FN_NUMBER_NEWSTART_AT, FN_DROP_TEXT, FN_DROP_CHAR_STYLE_NAME, 0); - // --> OD 2008-01-16 #newlistlevelattrs# // get also the list level indent values merged as LR-SPACE item, if needed. rWrtSh.GetCurAttr( aCoreSet, true ); - // <-- aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell()))); @@ -935,12 +924,8 @@ void SwTextShell::Execute(SfxRequest &rReq) { SfxBoolItem aStart( FN_NUMBER_NEWSTART, rWrtSh.IsNumRuleStart() ); aCoreSet.Put(aStart); - // --> OD 2008-02-29 #refactorlists# -// SfxUInt16Item aStartAt(FN_NUMBER_NEWSTART_AT, -// rWrtSh.IsNodeNumStart()); SfxUInt16Item aStartAt( FN_NUMBER_NEWSTART_AT, rWrtSh.GetNodeNumStart() ); - // <-- aCoreSet.Put(aStartAt); } SfxAbstractTabDialog* pDlg = NULL; @@ -948,10 +933,10 @@ void SwTextShell::Execute(SfxRequest &rReq) if ( bUseDialog && GetActiveView() ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); pDlg = pFact->CreateSwParaDlg( GetView().GetWindow(),GetView(), aCoreSet,DLG_STD, DLG_PARA,NULL, sal_False, nDefPage ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); } SfxItemSet* pSet = NULL; if ( !bUseDialog ) @@ -1006,14 +991,12 @@ void SwTextShell::Execute(SfxRequest &rReq) if( pSet->Count() ) { rWrtSh.StartAction(); -// rWrtSh.StartUndo( UNDO_START ); if ( SFX_ITEM_SET == pSet->GetItemState(FN_DROP_TEXT, sal_False, &pItem) ) { if ( ((SfxStringItem*)pItem)->GetValue().Len() ) rWrtSh.ReplaceDropTxt(((SfxStringItem*)pItem)->GetValue()); } rWrtSh.SetAttr( *pSet ); -// rWrtSh.EndUndo( UNDO_END ); rWrtSh.EndAction(); SwTxtFmtColl* pColl = rWrtSh.GetCurTxtFmtColl(); if(pColl && pColl->IsAutoUpdateFmt()) @@ -1062,7 +1045,6 @@ void SwTextShell::Execute(SfxRequest &rReq) break; case FN_NUM_CONTINUE: { - // --> OD 2008-03-18 #refactorlists# String sContinuedListId; const SwNumRule* pRule = rWrtSh.SearchNumRule( false, true, false, -1, sContinuedListId ); @@ -1077,7 +1059,6 @@ void SwTextShell::Execute(SfxRequest &rReq) { rWrtSh.SetCurNumRule( *pRule, false, sContinuedListId ); } - // <-- } break; case FN_SELECT_PARA: @@ -1111,30 +1092,15 @@ void SwTextShell::Execute(SfxRequest &rReq) SwEditWin& rEditWin = GetView().GetEditWin(); rEditWin.SetTextColor(aSet); SwApplyTemplate* pApply = rEditWin.GetApplyTemplate(); - SvxColorItem aItem(aSet, RES_CHRATR_COLOR); - // besteht eine Selektion, wird sie gleich gefaerbt - if(!pApply && rWrtSh.HasSelection()) + // If there is a selection, then set the color on it + // otherwise, it'll be the color for the next text to be typed + if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_EXT) { rWrtSh.SetAttr(SvxColorItem (aSet, RES_CHRATR_COLOR)); } - else if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_EXT) - { - GetView().GetViewFrame()->GetDispatcher()->Execute(SID_ATTR_CHAR_COLOR_EXT); - } rReq.Done(); -/* OS 22.02.97 18:40 Das alte Verhalten ist unerwuenscht - SwEditWin& rEdtWin = GetView().GetEditWin(); - - SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate(); - SvxColorItem aItem(aSet, RES_CHRATR_COLOR); - - if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_EXT) - { - GetShell().SetAttr(aItem); - } -*/ } } break; @@ -1165,15 +1131,6 @@ void SwTextShell::Execute(SfxRequest &rReq) rReq.Done(); -/* OS 22.02.97 18:40 Das alte Verhalten ist unerwuenscht - if(!pApply || pApply->nColor != SID_ATTR_CHAR_COLOR_BACKGROUND_EXT) - { - Brush aBrush(pItem ? BRUSH_SOLID : BRUSH_NULL); - if(pItem) - aBrush.SetColor( aSet ); - GetShell().SetAttr( SvxBrushItem(aBrush, RES_CHRATR_BACKGROUND) ); - } -*/ } break; case SID_ATTR_CHAR_COLOR_BACKGROUND_EXT: @@ -1288,7 +1245,7 @@ void SwTextShell::Execute(SfxRequest &rReq) { try { - uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY); + uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ui.XSLTFilterDialog"))), uno::UNO_QUERY); if( xDialog.is() ) { xDialog->execute(); @@ -1334,7 +1291,7 @@ void SwTextShell::Execute(SfxRequest &rReq) } SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() ); pDialog->SetValues(aCurr, aDocStat ); pDialog->Execute(); @@ -1342,17 +1299,11 @@ void SwTextShell::Execute(SfxRequest &rReq) } break; default: - ASSERT(!this, falscher Dispatcher); + OSL_ENSURE(!this, "wrong dispatcher"); return; } } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwTextShell::GetState( SfxItemSet &rSet ) { SwWrtShell &rSh = GetShell(); @@ -1592,7 +1543,6 @@ void SwTextShell::GetState( SfxItemSet &rSet ) GetViewFrame()->GetChildWindow( nWhich ) )); break; case FN_EDIT_HYPERLINK: - case FN_REMOVE_HYPERLINK: case FN_COPY_HYPERLINK_LOCATION: { SfxItemSet aSet(GetPool(), @@ -1605,6 +1555,20 @@ void SwTextShell::GetState( SfxItemSet &rSet ) } } break; + case FN_REMOVE_HYPERLINK: + { + SfxItemSet aSet(GetPool(), + RES_TXTATR_INETFMT, + RES_TXTATR_INETFMT); + rSh.GetCurAttr(aSet); + + // If a hyperlink is selected, either alone or along with other text... + if( ((SFX_ITEM_DONTCARE & aSet.GetItemState( RES_TXTATR_INETFMT, sal_True )) == 0) || rSh.HasReadonlySel()) + { + rSet.DisableItem(nWhich); + } + } + break; case SID_TRANSLITERATE_HALFWIDTH: case SID_TRANSLITERATE_FULLWIDTH: case SID_TRANSLITERATE_HIRAGANA: @@ -1683,13 +1647,6 @@ void SwTextShell::GetState( SfxItemSet &rSet ) break; case FN_NUM_CONTINUE: { - // --> OD 2009-08-26 #i86492# - // Allow continuation of previous list, even if at current cursor - // a list is active. -// if ( rSh.GetCurNumRule() ) -// rSet.DisableItem(nWhich); -// else - // <-- { // --> OD 2009-08-26 #i86492# // Search also for bullet list @@ -1722,6 +1679,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) nWhich = aIter.NextWhich(); } } + /* -----------------------------2002/07/05 10:31------------------------------ Switch on/off header of footer of a page style - if an empty name is given all styles are changed @@ -1730,6 +1688,7 @@ void SwTextShell::ChangeHeaderOrFooter( const String& rStyleName, sal_Bool bHeader, sal_Bool bOn, sal_Bool bShowWarning) { SwWrtShell& rSh = GetShell(); + rSh.addCurrentPosition(); rSh.StartAllAction(); rSh.StartUndo( UNDO_HEADER_FOOTER ); // #i7983# sal_Bool bExecute = sal_True; @@ -1742,9 +1701,9 @@ void SwTextShell::ChangeHeaderOrFooter( String sTmp(aDesc.GetName()); if( !rStyleName.Len() || rStyleName == sTmp ) { - if( bShowWarning && !bOn && GetActiveView() && GetActiveView() == &GetView() && - ((bHeader && aDesc.GetMaster().GetHeader().IsActive()) || - (!bHeader && aDesc.GetMaster().GetFooter().IsActive()))) + if( (bShowWarning && !bOn && GetActiveView() && GetActiveView() == &GetView() && + (bHeader && aDesc.GetMaster().GetHeader().IsActive())) || + (!bHeader && aDesc.GetMaster().GetFooter().IsActive())) { bShowWarning = sal_False; //Actions have to be closed while the dialog is showing @@ -1788,3 +1747,4 @@ void SwTextShell::ChangeHeaderOrFooter( rSh.EndAllAction(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/textsh2.cxx b/sw/source/ui/shells/textsh2.cxx index e711989a58..c7b6821b07 100644 --- a/sw/source/ui/shells/textsh2.cxx +++ b/sw/source/ui/shells/textsh2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ -#if STLPORT_VERSION>=321 #include <cstdarg> -#endif #include <svtools/svmedit.hxx> #include <svl/eitem.hxx> @@ -40,9 +39,7 @@ #include <sfx2/event.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/viewfrm.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <svl/stritem.hxx> #include <svl/itemset.hxx> #include <sfx2/request.hxx> @@ -90,7 +87,6 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::beans; - #define DB_DD_DELIM 0x0b struct DBTextStruct_Impl @@ -100,10 +96,7 @@ struct DBTextStruct_Impl Reference<XResultSet> xCursor; Reference<XConnection> xConnection; }; -inline void AddSelList( List& rLst, long nRow ) -{ - rLst.Insert( (void*)nRow , LIST_APPEND ); -} + void SwTextShell::ExecDB(SfxRequest &rReq) { const SfxItemSet *pArgs = rReq.GetArgs(); @@ -251,15 +244,11 @@ void SwTextShell::ExecDB(SfxRequest &rReq) break; default: - ASSERT(!this, falscher Dispatcher); + OSL_ENSURE(!this, "wrong dispatcher"); return; } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_STATIC_LINK( SwBaseShell, InsertDBTextHdl, DBTextStruct_Impl*, pDBStruct ) { if( pDBStruct ) @@ -288,7 +277,7 @@ IMPL_STATIC_LINK( SwBaseShell, InsertDBTextHdl, DBTextStruct_Impl*, pDBStruct ) { SwDBData aDBData = pDBStruct->aDBData; SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); ::std::auto_ptr<AbstractSwInsertDBColAutoPilot>pDlg (pFact->CreateSwInsertDBColAutoPilot( pThis->GetView(), xSource, xColSupp, @@ -308,5 +297,4 @@ IMPL_STATIC_LINK( SwBaseShell, InsertDBTextHdl, DBTextStruct_Impl*, pDBStruct ) return 0; } - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx index 3b65cbc3f9..35bfcc587e 100644 --- a/sw/source/ui/shells/txtattr.cxx +++ b/sw/source/ui/shells/txtattr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include <hintids.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <svl/whiter.hxx> #include <svl/stritem.hxx> #include <svl/itemiter.hxx> @@ -52,29 +51,19 @@ #include "paratr.hxx" #include <fmtinfmt.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <viewopt.hxx> #include <uitool.hxx> -#ifndef _TEXTSH_HXX #include <textsh.hxx> -#endif #include <num.hxx> #include <swundo.hxx> #include <fmtcol.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <globals.h> -#ifndef _SHELLS_HRC #include <shells.hrc> -#endif #include <SwStyleNameMapper.hxx> #include "swabstdlg.hxx" #include "chrdlg.hrc" @@ -191,7 +180,7 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq) rSh.DontExpandFmt(); break; default: - ASSERT(sal_False, falscher Dispatcher); + OSL_ENSURE(false, "wrong dispatcher"); return; } } @@ -291,72 +280,11 @@ void SwTextShell::ExecCharAttrArgs(SfxRequest &rReq) break; default: - ASSERT(sal_False, falscher Dispatcher); + OSL_ENSURE(false, "wrong dispatcher"); return; } } - - -#ifdef CFRONT - -void lcl_SetAdjust(SvxAdjust eAdjst, SfxItemSet& rSet) -{ - rSet.Put(SvxAdjustItem(eAdjst,RES_PARATR_ADJUST )); -} - - - -void lcl_SetLineSpace(sal_uInt8 ePropL,SfxItemSet& rSet) -{ - SvxLineSpacingItem aLineSpacing(ePropL, RES_PARATR_LINESPACING ); - aLineSpacing.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO; - if( 100 == ePropL ) - aLineSpacing.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF; - else - aLineSpacing.SetPropLineSpace(ePropL); - rSet.Put( aLineSpacing ); -} - - - -void SwTextShell::ExecParaAttr(SfxRequest &rReq) -{ - // gleiche beide Attribute holen, ist nicht teuerer !! - SfxItemSet aSet( GetPool(), RES_PARATR_LINESPACING, RES_PARATR_ADJUST ); - - switch (rReq.GetSlot()) - { - case FN_SET_LEFT_PARA: lcl_SetAdjust(ADJLEFT,aSet); break; - case FN_SET_RIGHT_PARA: lcl_SetAdjust(ADJRIGHT,aSet); break; - case FN_SET_CENTER_PARA: lcl_SetAdjust(ADJCENTER,aSet); break; - case SID_ATTR_PARA_ADJUST_BLOCK:lcl_SetAdjust(ADJBLOCK,aSet); break; - - case FN_SET_LINE_SPACE_1: lcl_SetLineSpace(100,aSet); break; - case FN_SET_LINE_SPACE_15: lcl_SetLineSpace(150,aSet); break; - case FN_SET_LINE_SPACE_2: lcl_SetLineSpace(200,aSet); break; - - default: - DBG_ERROR("SwTextShell::ExecParaAttr falscher Dispatcher"); - return; - } - SwWrtShell& rWrtSh = GetShell(); - SwTxtFmtColl* pColl = rWrtSh.GetCurTxtFmtColl(); - if(pColl && pColl->IsAutoUpdateFmt()) - { - rWrtSh.AutoUpdatePara(pColl, *pSet); - } - else - { - rWrtSh.SetAttr( aSet ); - rReq.Done( aSet ); - } -} - -#else - - - void SwTextShell::ExecParaAttr(SfxRequest &rReq) { SvxAdjust eAdjst; @@ -431,14 +359,7 @@ SET_LINESPACE: int eState = pArgs ? pArgs->GetItemState(nSlot) : SFX_ITEM_DISABLED; if (pArgs && SFX_ITEM_SET == eState) bSet = ((const SfxBoolItem&)pArgs->Get(nSlot)).GetValue(); -/* -// toggling of the slots not used anymore - - if(!bSet) - nSlot = SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot ? - SID_ATTR_PARA_RIGHT_TO_LEFT : - SID_ATTR_PARA_LEFT_TO_RIGHT; -*/ + SfxItemSet aAdjustSet( GetPool(), RES_PARATR_ADJUST, RES_PARATR_ADJUST ); GetShell().GetCurAttr(aAdjustSet); @@ -448,7 +369,6 @@ SET_LINESPACE: { int eAdjust = (int)(( const SvxAdjustItem& ) aAdjustSet.Get(RES_PARATR_ADJUST)).GetAdjust(); -// bChgAdjust = SVX_ADJUST_CENTER != eAdjust && SVX_ADJUST_BLOCK != eAdjust; bChgAdjust = (SVX_ADJUST_LEFT == eAdjust && SID_ATTR_PARA_RIGHT_TO_LEFT == nSlot) || (SVX_ADJUST_RIGHT == eAdjust && SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot); } @@ -485,23 +405,19 @@ SET_LINESPACE: aRule.SetLevel(i, aFmt, aRule.Get(i) != 0); } - // --> OD 2008-02-11 #newlistlevelattrs# SwNumRule aSetRule( pCurRule->GetName(), pCurRule->Get( 0 ).GetPositionAndSpaceMode() ); - // <-- aSetRule.SetSvxRule( aRule, GetShell().GetDoc()); aSetRule.SetAutoRule( sal_True ); - // --> OD 2008-03-17 #refactorlists# // no start or continuation of a list - list style is only changed GetShell().SetCurNumRule( aSetRule, false ); - // <-- } } } break; default: - ASSERT(sal_False, falscher Dispatcher); + OSL_ENSURE(false, "wrong dispatcher"); return; } SwWrtShell& rWrtSh = GetShell(); @@ -515,10 +431,6 @@ SET_LINESPACE: rReq.Done(); } -#endif - - - void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) { SwWrtShell &rSh = GetShell(); @@ -558,11 +470,11 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) HINT_END, HINT_END, 0); rSh.GetCurAttr(aSet); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(), aSet, rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), DLG_SWDROPCAPS ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if (pDlg->Execute() == RET_OK) { rSh.StartAction(); @@ -604,7 +516,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) break; default: - ASSERT(sal_False, falscher Dispatcher); + OSL_ENSURE(false, "wrong dispatcher"); return; } } @@ -845,3 +757,4 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/txtcrsr.cxx b/sw/source/ui/shells/txtcrsr.cxx index 9d4b4e038d..54a509058e 100644 --- a/sw/source/ui/shells/txtcrsr.cxx +++ b/sw/source/ui/shells/txtcrsr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,32 +32,22 @@ #include <sfx2/request.hxx> #include <svl/eitem.hxx> -#ifndef __SBX_SBXVARIABLE_HXX //autogen #include <basic/sbxvar.hxx> -#endif #include <sfx2/viewfrm.hxx> #include <sfx2/bindings.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> -#ifndef _TEXTSH_HXX #include <textsh.hxx> -#endif #include <num.hxx> #include <edtwin.hxx> #include <crsskip.hxx> #include <doc.hxx> #include <docsh.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <globals.h> -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <svx/svdouno.hxx> #include <svx/fmshell.hxx> @@ -106,7 +97,7 @@ void SwTextShell::ExecBasicMove(SfxRequest &rReq) case FN_CHAR_RIGHT: rSh.Right( CRSR_SKIP_CELLS, bSelect, 1, sal_False, sal_True ); break; case FN_LINE_UP: rSh.Up ( bSelect, 1 ); break; case FN_LINE_DOWN: rSh.Down ( bSelect, 1 ); break; - default: ASSERT(sal_False, falscher Dispatcher); return; + default: OSL_ENSURE(false, "wrong Dispatcher"); return; } } @@ -143,7 +134,7 @@ void SwTextShell::ExecMove(SfxRequest &rReq) case FN_SELECT_WORD: bRet = rSh.SelNearestWrd(); break; case SID_SELECTALL: bRet = 0 != rSh.SelAll(); break; - default: ASSERT(sal_False, falscher Dispatcher); return; + default: OSL_ENSURE(false, "wrong dispatcher"); return; } if ( bRet ) @@ -180,7 +171,7 @@ void SwTextShell::ExecMovePage(SfxRequest &rReq) case FN_END_OF_PAGE_SEL: case FN_END_OF_PAGE: rSh.EndPg ( FN_END_OF_PAGE_SEL == nSlot ); break; - default: ASSERT(sal_False, falscher Dispatcher); return; + default: OSL_ENSURE(false, "wrong dispatcher"); return; } rReq.Done(); } @@ -197,7 +188,7 @@ void SwTextShell::ExecMoveCol(SfxRequest &rReq) case FN_END_OF_NEXT_COLUMN: rSh.EndOfNextColumn ( sal_False ); break; case FN_START_OF_PREV_COLUMN: rSh.StartOfPrevColumn( sal_False ); break; case FN_END_OF_PREV_COLUMN: rSh.EndOfPrevColumn ( sal_False ); break; - default: ASSERT(sal_False, falscher Dispatcher); return; + default: OSL_ENSURE(false, "wrong dispatcher"); return; } rReq.Done(); } @@ -208,39 +199,38 @@ void SwTextShell::ExecMoveLingu(SfxRequest &rReq) GetView().GetEditWin().FlushInBuffer(); sal_uInt16 nSlot = rReq.GetSlot(); - sal_Bool bRet = sal_False; switch ( nSlot ) { case FN_NEXT_WORD_SEL: - case FN_NEXT_WORD: bRet = rSh.NxtWrd( FN_NEXT_WORD_SEL == nSlot ); + case FN_NEXT_WORD: rSh.NxtWrd( FN_NEXT_WORD_SEL == nSlot ); break; case FN_START_OF_PARA_SEL: - case FN_START_OF_PARA: bRet = rSh.SttPara( FN_START_OF_PARA_SEL == nSlot ); + case FN_START_OF_PARA: rSh.SttPara( FN_START_OF_PARA_SEL == nSlot ); break; case FN_END_OF_PARA_SEL: - case FN_END_OF_PARA: bRet = rSh.EndPara( FN_END_OF_PARA_SEL == nSlot ); + case FN_END_OF_PARA: rSh.EndPara( FN_END_OF_PARA_SEL == nSlot ); break; case FN_PREV_WORD_SEL: - case FN_PREV_WORD: bRet = rSh.PrvWrd( FN_PREV_WORD_SEL == nSlot ); + case FN_PREV_WORD: rSh.PrvWrd( FN_PREV_WORD_SEL == nSlot ); break; case FN_NEXT_SENT_SEL: - case FN_NEXT_SENT: bRet = rSh.FwdSentence( FN_NEXT_SENT_SEL == nSlot ); + case FN_NEXT_SENT: rSh.FwdSentence( FN_NEXT_SENT_SEL == nSlot ); break; case FN_PREV_SENT_SEL: - case FN_PREV_SENT: bRet = rSh.BwdSentence( FN_PREV_SENT_SEL == nSlot ); + case FN_PREV_SENT: rSh.BwdSentence( FN_PREV_SENT_SEL == nSlot ); break; - case FN_NEXT_PARA: bRet = rSh.FwdPara ( sal_False ); + case FN_NEXT_PARA: rSh.FwdPara ( sal_False ); break; - case FN_PREV_PARA: bRet = rSh.BwdPara ( sal_False ); + case FN_PREV_PARA: rSh.BwdPara ( sal_False ); break; - default: ASSERT(sal_False, falscher Dispatcher); return; + default: OSL_ENSURE(false, "wrong dispatcher"); return; } rReq.Done(); } @@ -358,7 +348,7 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq) break; default: - ASSERT(sal_False, falscher Dispatcher); + OSL_ENSURE(false, "wrong dispatcher"); return; } @@ -368,3 +358,4 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/shells/txtnum.cxx b/sw/source/ui/shells/txtnum.cxx index 0bf427ccbc..6604eed53a 100644 --- a/sw/source/ui/shells/txtnum.cxx +++ b/sw/source/ui/shells/txtnum.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,9 +31,7 @@ #include <hintids.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <sfx2/request.hxx> #include <svl/eitem.hxx> #include <svl/stritem.hxx> @@ -96,10 +95,6 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) break; case FN_NUMBER_BULLETS: { - // --> OD 2008-02-29 #refactorlists# -// // per default sal_True, damit die Schleife im Dialog richtig arbeitet! -// sal_Bool bHasChild = sal_True; - // <-- SfxItemSet aSet(GetPool(), SID_HTML_MODE, SID_HTML_MODE, SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL, @@ -130,11 +125,9 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) aRule.SetFeatureFlag(NUM_ENABLE_EMBEDDED_BMP, sal_False); aSet.Put(SvxNumBulletItem(aRule)); - // --> OD 2008-02-29 #refactorlists# - removed <bHasChild> - ASSERT( GetShell().GetNumLevel() < MAXLEVEL, + OSL_ENSURE( GetShell().GetNumLevel() < MAXLEVEL, "<SwTextShell::ExecEnterNum()> - numbered node without valid list level. Serious defect -> please inform OD." ); sal_uInt16 nLevel = GetShell().GetNumLevel(); - // <-- if( nLevel < MAXLEVEL ) { nLevel = 1<<nLevel; @@ -143,12 +136,10 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) } else { - // --> OD 2008-02-11 #newlistlevelattrs# SwNumRule aRule( GetShell().GetUniqueNumRuleName(), // --> OD 2008-06-06 #i89178# numfunc::GetDefaultPositionAndSpaceMode() ); // <-- - // <-- SvxNumRule aSvxRule = aRule.MakeSvxNumRule(); const bool bRightToLeft = GetShell().IsInRightToLeftText( 0 ); @@ -183,10 +174,10 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) pDocSh->PutItem(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(pDocSh))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_SVXTEST_NUM_BULLET, GetView().GetWindow(), &aSet, GetShell()); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); sal_uInt16 nRet = pDlg->Execute(); const SfxPoolItem* pItem; if( RET_OK == nRet ) @@ -197,22 +188,18 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) rReq.Done(); SvxNumRule* pSetRule = ((SvxNumBulletItem*)pItem)->GetNumRule(); pSetRule->UnLinkGraphics(); - // --> OD 2008-02-11 #newlistlevelattrs# SwNumRule aSetRule( pCurRule ? pCurRule->GetName() : GetShell().GetUniqueNumRuleName(), // --> OD 2008-06-06 #i89178# numfunc::GetDefaultPositionAndSpaceMode() ); // <-- - // <-- aSetRule.SetSvxRule( *pSetRule, GetShell().GetDoc()); aSetRule.SetAutoRule( sal_True ); - // --> OD 2008-03-17 #refactorlists# // No start of new list, if an existing list style is edited. // Otherwise start a new list. const bool bCreateList = (pCurRule == 0); GetShell().SetCurNumRule( aSetRule, bCreateList ); - // <-- } // wenn der Dialog mit OK verlassen wurde, aber nichts ausgewaehlt // wurde dann muss die Numerierung zumindest eingeschaltet werden, @@ -222,18 +209,14 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) rReq.AppendItem( *pItem ); rReq.Done(); SvxNumRule* pSetRule = ((SvxNumBulletItem*)pItem)->GetNumRule(); - // --> OD 2008-02-11 #newlistlevelattrs# SwNumRule aSetRule( GetShell().GetUniqueNumRuleName(), // --> OD 2008-06-06 #i89178# numfunc::GetDefaultPositionAndSpaceMode() ); // <-- - // <-- aSetRule.SetSvxRule(*pSetRule, GetShell().GetDoc()); aSetRule.SetAutoRule( sal_True ); - // --> OD 2008-03-17 #refactorlists# // start new list GetShell().SetCurNumRule( aSetRule, true ); - // <-- } } else if(RET_USER == nRet) @@ -243,9 +226,10 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) } break; default: - ASSERT(sal_False, falscher Dispatcher); + OSL_ENSURE(false, "wrong dispatcher"); return; } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/smartmenu/stmenu.cxx b/sw/source/ui/smartmenu/stmenu.cxx index d8c10fc3ed..88319f0d66 100644 --- a/sw/source/ui/smartmenu/stmenu.cxx +++ b/sw/source/ui/smartmenu/stmenu.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,12 +37,8 @@ #include <SwSmartTagMgr.hxx> -#ifndef _STMENU_HRC #include <stmenu.hrc> -#endif -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <breakit.hxx> #define C2U(cChar) rtl::OUString::createFromAscii(cChar) @@ -57,8 +54,6 @@ SwSmartTagPopup::SwSmartTagPopup( SwView* pSwView, mpSwView ( pSwView ), mxTextRange( xTextRange ) { - //CreateAutoMnemonics(); - Reference <frame::XController> xController = mpSwView->GetController(); const lang::Locale aLocale( SW_BREAKITER()->GetLocale( (LanguageType)GetAppLanguage() ) ); @@ -184,3 +179,5 @@ sal_uInt16 SwSmartTagPopup::Execute( const Rectangle& rWordPos, Window* pWin ) return nId; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/chartins.cxx b/sw/source/ui/table/chartins.cxx index 418e805ae2..8225a9bff1 100644 --- a/sw/source/ui/table/chartins.cxx +++ b/sw/source/ui/table/chartins.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,7 +83,7 @@ Point SwGetChartDialogPos( const Window *pParentWin, const Size& rDialogSize, co Point aRet; - DBG_ASSERT( pParentWin, "Window not found" ); + OSL_ENSURE( pParentWin, "Window not found" ); if (pParentWin) { Rectangle aObjPixel = pParentWin->LogicToPixel( rLogicChart, pParentWin->GetMapMode() ); @@ -148,11 +149,6 @@ Point SwGetChartDialogPos( const Window *pParentWin, const Size& rDialogSize, co return aRet; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - - void SwInsertChart(Window* pParent, SfxBindings* pBindings ) { (void) pParent; @@ -177,9 +173,6 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings ) { SwFrmFmt* pTblFmt = rWrtShell.GetTableFmt(); String aCurrentTblName = pTblFmt->GetName(); -// String aText( String::CreateFromAscii("<.>") ); // was used for UI -// aText.Insert( rWrtShell.GetBoxNms(), 2); -// aText.Insert( aCurrentTblName, 1 ); aRangeString = aCurrentTblName; aRangeString += OUString::valueOf( sal_Unicode('.') ); aRangeString += rWrtShell.GetBoxNms(); @@ -203,7 +196,7 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings ) { uno::Reference< ui::dialogs::XExecutableDialog > xDialog( xMCF->createInstanceWithContext( - C2U("com.sun.star.comp.chart2.WizardDialog") + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.chart2.WizardDialog")) , xContext), uno::UNO_QUERY); uno::Reference< lang::XInitialization > xInit( xDialog, uno::UNO_QUERY ); if( xInit.is() ) @@ -213,10 +206,10 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings ) uno::Sequence<uno::Any> aSeq(2); uno::Any* pArray = aSeq.getArray(); beans::PropertyValue aParam1; - aParam1.Name = C2U("ParentWindow"); + aParam1.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow")); aParam1.Value <<= uno::makeAny(xDialogParentWindow); beans::PropertyValue aParam2; - aParam2.Name = C2U("ChartModel"); + aParam2.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ChartModel")); aParam2.Value <<= uno::makeAny(xChartModel); pArray[0] <<= uno::makeAny(aParam1); pArray[1] <<= uno::makeAny(aParam2); @@ -230,7 +223,7 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings ) { //get dialog size: awt::Size aDialogAWTSize; - if( xDialogProps->getPropertyValue( ::rtl::OUString::createFromAscii("Size") ) + if( xDialogProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Size")) ) >>= aDialogAWTSize ) { Size aDialogSize( aDialogAWTSize.Width, aDialogAWTSize.Height ); @@ -242,14 +235,14 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings ) aSwRect = pFlyFrmFmt->GetAnchoredObj()->GetObjRectWithSpaces(); Rectangle aRect( aSwRect.SVRect() ); Point aDialogPos = SwGetChartDialogPos( &rWrtShell.GetView().GetEditWin(), aDialogSize, aRect ); - xDialogProps->setPropertyValue( ::rtl::OUString::createFromAscii("Position"), + xDialogProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Position")), uno::makeAny( awt::Point(aDialogPos.getX(),aDialogPos.getY()) ) ); } } } catch( uno::Exception& ) { - DBG_ERROR( "Chart wizard couldn't be positioned automatically\n" ); + OSL_ENSURE(false, "Chart wizard couldn't be positioned automatically\n" ); } } @@ -261,7 +254,7 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings ) } else { - DBG_ASSERT( nDialogRet == ui::dialogs::ExecutableDialogResults::OK, + OSL_ENSURE( nDialogRet == ui::dialogs::ExecutableDialogResults::OK, "dialog execution failed" ); } } @@ -273,7 +266,7 @@ void SwInsertChart(Window* pParent, SfxBindings* pBindings ) } -void __EXPORT AutoEdit::KeyInput( const KeyEvent& rEvt ) +void AutoEdit::KeyInput( const KeyEvent& rEvt ) { sal_uInt16 nCode = rEvt.GetKeyCode().GetCode(); if( nCode != KEY_SPACE ) @@ -283,3 +276,4 @@ void __EXPORT AutoEdit::KeyInput( const KeyEvent& rEvt ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/chartins.src b/sw/source/ui/table/chartins.src index 92e20c682b..1a05d64f44 100644 --- a/sw/source/ui/table/chartins.src +++ b/sw/source/ui/table/chartins.src @@ -102,8 +102,6 @@ ModelessDialog DLG_INSERT_CHART HelpID = "sw:PushButton:DLG_INSERT_CHART:BT_PREV"; Pos = MAP_APPFONT ( 130 , 151 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; - // ### ACHTUNG: Neuer Text in Resource? << ~Zur�ck : << Zur�ck - /* ### ACHTUNG: Neuer Text in Resource? << ~Zur�ck : << ~Zur�ck */ TabStop = TRUE ; Disable = TRUE ; Text [ en-US ] = "<< ~Back" ; diff --git a/sw/source/ui/table/colwd.cxx b/sw/source/ui/table/colwd.cxx index 2361f50a98..7c90ca6968 100644 --- a/sw/source/ui/table/colwd.cxx +++ b/sw/source/ui/table/colwd.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,27 +39,15 @@ #include <colwd.hxx> #include <tablemgr.hxx> #include <wrtsh.hxx> -#ifndef _WDOCSH_HXX #include <wdocsh.hxx> -#endif -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <swmodule.hxx> -#ifndef _MODCFG_HXX #include <modcfg.hxx> -#endif #include <usrpref.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _COLWD_HRC #include <colwd.hrc> -#endif -#ifndef _TABLE_HRC #include <table.hrc> -#endif IMPL_LINK_INLINE_START( SwTableWidthDlg, LoseFocusHdl, Edit *, EMPTYARG ) @@ -121,3 +110,4 @@ void SwTableWidthDlg::Apply() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx index 1c08d7c075..fc70f5f79b 100644 --- a/sw/source/ui/table/convert.cxx +++ b/sw/source/ui/table/convert.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -233,10 +234,10 @@ SwConvertTableDlg:: ~SwConvertTableDlg() IMPL_LINK( SwConvertTableDlg, AutoFmtHdl, PushButton*, pButton ) { SwAbstractDialogFactory* pFact = swui::GetFactory(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton, pShell, DLG_AUTOFMT_TABLE, sal_False, pTAutoFmt); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if( RET_OK == pDlg->Execute()) pDlg->FillAutoFmtOfIndex( pTAutoFmt ); delete pDlg; @@ -279,3 +280,5 @@ IMPL_LINK(SwConvertTableDlg, ReapeatHeaderCheckBoxHdl, void*, EMPTYARG) return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx index d5243cef98..1bb8d76d9c 100644 --- a/sw/source/ui/table/instable.cxx +++ b/sw/source/ui/table/instable.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -184,9 +185,6 @@ IMPL_LINK_INLINE_START( SwInsTableDlg, ModifyName, Edit *, pEdit ) } IMPL_LINK_INLINE_END( SwInsTableDlg, ModifyName, Edit *, EMPTYARG ) -/*-----------------15.04.98 11:36------------------- - ---------------------------------------------------*/ IMPL_LINK( SwInsTableDlg, ModifyRowCol, NumericField *, pField ) { if(pField == &aColEdit) @@ -220,10 +218,10 @@ IMPL_LINK( SwInsTableDlg, ModifyRowCol, NumericField *, pField ) IMPL_LINK( SwInsTableDlg, AutoFmtHdl, PushButton*, pButton ) { SwAbstractDialogFactory* pFact = swui::GetFactory(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(pButton,pShell, DLG_AUTOFMT_TABLE, sal_False, pTAutoFmt ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if( RET_OK == pDlg->Execute()) pDlg->FillAutoFmtOfIndex( pTAutoFmt ); delete pDlg; @@ -251,3 +249,4 @@ IMPL_LINK(SwInsTableDlg, ModifyRepeatHeaderNF_Hdl, void*, EMPTYARG) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/mergetbl.cxx b/sw/source/ui/table/mergetbl.cxx index 777f38db0f..98b6905503 100644 --- a/sw/source/ui/table/mergetbl.cxx +++ b/sw/source/ui/table/mergetbl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,12 +36,8 @@ #include <swtypes.hxx> #include <mergetbl.hxx> -#ifndef _MERGETBL_HRC #include <mergetbl.hrc> -#endif -#ifndef _TABLE_HRC #include <table.hrc> -#endif SwMergeTblDlg::SwMergeTblDlg( Window *pParent, sal_Bool& rWithPrev ) @@ -64,3 +61,4 @@ void SwMergeTblDlg::Apply() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/rowht.cxx b/sw/source/ui/table/rowht.cxx index 0493123823..19922e0da2 100644 --- a/sw/source/ui/table/rowht.cxx +++ b/sw/source/ui/table/rowht.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,24 +45,14 @@ #include <rowht.hxx> #include <wrtsh.hxx> #include <frmatr.hxx> -#ifndef _WDOCSH_HXX #include <wdocsh.hxx> -#endif -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <swmodule.hxx> #include <usrpref.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _ROWHT_HRC #include <rowht.hrc> -#endif -#ifndef _TABLE_HRC #include <table.hrc> -#endif @@ -118,3 +109,4 @@ SwTableHeightDlg::SwTableHeightDlg( Window *pParent, SwWrtShell &rS ) : +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/rowht.src b/sw/source/ui/table/rowht.src index 6d537f415a..e7422e1626 100644 --- a/sw/source/ui/table/rowht.src +++ b/sw/source/ui/table/rowht.src @@ -35,7 +35,6 @@ ModalDialog DLG_ROW_HEIGHT OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 157 , 60 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Zeilenh�he : Zellenh�he */ Text [ en-US ] = "Row Height" ; Moveable = TRUE ; OKButton BT_OK @@ -80,7 +79,6 @@ ModalDialog DLG_ROW_HEIGHT HelpID = "sw:CheckBox:DLG_ROW_HEIGHT:CB_AUTOHEIGHT"; Pos = MAP_APPFONT ( 12 , 34 ) ; Size = MAP_APPFONT ( 80 , 10 ) ; - /* ### ACHTUNG: Neuer Text in Resource? ~dynamisch anpassen : auto. H~�he */ TabStop = TRUE ; Text [ en-US ] = "~Fit to size" ; }; diff --git a/sw/source/ui/table/splittbl.cxx b/sw/source/ui/table/splittbl.cxx index 9763755886..3663f92b88 100644 --- a/sw/source/ui/table/splittbl.cxx +++ b/sw/source/ui/table/splittbl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,9 +39,7 @@ #include <splittbl.hrc> #include <table.hrc> #include <tblenum.hxx> -/*-----------------17.03.98 10:56------------------- ---------------------------------------------------*/ SwSplitTblDlg::SwSplitTblDlg( Window *pParent, SwWrtShell &rSh ) : SvxStandardDialog(pParent, SW_RES(DLG_SPLIT_TABLE)), aOKPB( this, SW_RES(PB_OK )), @@ -58,9 +57,6 @@ SwSplitTblDlg::SwSplitTblDlg( Window *pParent, SwWrtShell &rSh ) : aCntntCopyRB.Check(); } -/*-----------------17.03.98 10:56------------------- - ---------------------------------------------------*/ void SwSplitTblDlg::Apply() { m_nSplit = HEADLINE_CNTNTCOPY; @@ -77,3 +73,4 @@ void SwSplitTblDlg::Apply() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/swtablerep.cxx b/sw/source/ui/table/swtablerep.cxx index 018628680b..13480e3561 100644 --- a/sw/source/ui/table/swtablerep.cxx +++ b/sw/source/ui/table/swtablerep.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -28,13 +29,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <hintids.hxx> -#include <tools/list.hxx> #include <vcl/msgbox.hxx> #include <svl/stritem.hxx> #include <svl/intitem.hxx> -#include <svx/htmlmode.hxx> #include <editeng/keepitem.hxx> #include <editeng/brkitem.hxx> #include <editeng/ulspitem.hxx> @@ -49,53 +47,25 @@ #include <fmtrowsplt.hxx> #include <svx/htmlmode.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <viewopt.hxx> #include <uitool.hxx> #include <frmatr.hxx> -#ifndef _TABLEPG_HXX #include <tablepg.hxx> -#endif #include <tablemgr.hxx> #include <pagedesc.hxx> #include <poolfmt.hxx> #include <SwStyleNameMapper.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _TABLEDLG_HRC #include <tabledlg.hrc> -#endif -#ifndef _TABLE_HRC #include <table.hrc> -#endif #include "swtablerep.hxx" -#ifdef DEBUG_TBLDLG - -void DbgTColumn(TColumn* pTColumn, sal_uInt16 nCount) -{ - for(sal_uInt16 i = 0; i < nCount; i++) - { - String sMsg(i); - sMsg += pTColumn[i].bVisible ? " v " : " h "; - sMsg += pTColumn[i].nWidth; - DBG_ERROR(sMsg) - } -} -#endif - -/*-----------------20.08.96 09.43------------------- ---------------------------------------------------*/ SwTableRep::SwTableRep( const SwTabCols& rTabCol, sal_Bool bCplx ) : nTblWidth(0), @@ -128,15 +98,11 @@ SwTableRep::SwTableRep( const SwTabCols& rTabCol, sal_Bool bCplx ) nAllCols++; } -/*-----------------20.08.96 09.43------------------- ---------------------------------------------------*/ SwTableRep::~SwTableRep() { delete[] pTColumns; } -/*-----------------20.08.96 13.33------------------- ---------------------------------------------------*/ sal_Bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const { long nOldLeft = rTabCols.GetLeft(), @@ -152,10 +118,6 @@ sal_Bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const break; } -#ifdef DEBUG_TBLDLG -#define DbgTColumn(pTColumns, nAllCols); -#endif - SwTwips nPos = 0; SwTwips nLeft = GetLeftSpace(); rTabCols.SetLeft(nLeft); @@ -176,10 +138,6 @@ sal_Bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const pOldTColumns[nAllCols - 1].nWidth = rTabCols.GetRight() - rTabCols.GetLeft() - nStart; pOldTColumns[nAllCols - 1].bVisible = sal_True; -#ifdef DEBUG_TBLDLG -#define DbgTColumn(pOldTColumns, nAllCols); -#endif - sal_uInt16 nOldPos = 0; sal_uInt16 nNewPos = 0; SwTwips nOld = 0; @@ -239,3 +197,5 @@ sal_Bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const rTabCols.SetRight(rTabCols.GetRightMax()); return bSingleLine; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index cd0255d5cb..dcbe73c1cd 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -32,13 +33,10 @@ #undef SW_DLLIMPLEMENTATION #endif - #include <hintids.hxx> -#include <tools/list.hxx> #include <vcl/msgbox.hxx> #include <svl/stritem.hxx> #include <svl/intitem.hxx> -#include <svx/htmlmode.hxx> #include <editeng/keepitem.hxx> #include <editeng/brkitem.hxx> #include <editeng/ulspitem.hxx> @@ -55,35 +53,23 @@ #include "access.hrc" -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <viewopt.hxx> #include <uitool.hxx> #include <frmatr.hxx> #include <tabledlg.hxx> -#ifndef _TABLEPG_HXX #include <tablepg.hxx> -#endif #include <tablemgr.hxx> #include <pagedesc.hxx> #include <uiitems.hxx> #include <poolfmt.hxx> #include <SwStyleNameMapper.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _TABLEDLG_HRC #include <tabledlg.hrc> -#endif -#ifndef _TABLE_HRC #include <table.hrc> -#endif #include <svx/svxids.hrc> #include <svx/dialogs.hrc> #include <svx/flagsdef.hxx> @@ -92,41 +78,6 @@ using namespace ::com::sun::star; -#ifdef DEBUG_TBLDLG -void DbgTblRep(SwTableRep* pRep) -{ - DBG_ERROR(String(pRep->GetColCount())) - DBG_ERROR(String(pRep->GetAllColCount())) - SwTwips nSum = 0; - for(sal_uInt16 i = 0; i < pRep->GetAllColCount(); i++) - { - String sMsg(i); - sMsg += pRep->GetColumns()[i].bVisible ? " v " : " h "; - sMsg += pRep->GetColumns()[i].nWidth; - nSum +=pRep->GetColumns()[i].nWidth; - DBG_ERROR(sMsg) - } - String sMsg("Spaltensumme: "); - sMsg += nSum; - sMsg += " Tblbreite: "; - sMsg += pRep->GetWidth(); - DBG_ERROR(sMsg) - sMsg = "Gesamt/Links/Rechts: "; - sMsg += pRep->GetSpace(); - sMsg += '/'; - sMsg += pRep->GetLeftSpace(); - sMsg += '/'; - sMsg += pRep->GetRightSpace(); - DBG_ERROR(sMsg) - sMsg = "Align: "; - sMsg += pRep->GetAlign(); - DBG_ERROR(sMsg) - -}; - -#endif - - SwFormatTablePage::SwFormatTablePage( Window* pParent, const SfxItemSet& rSet ) : SfxTabPage(pParent, SW_RES( TP_FORMAT_TABLE ), rSet ), aOptionsFL(this, SW_RES( FL_OPTIONS )), @@ -225,7 +176,7 @@ void SwFormatTablePage::Init() IMPL_LINK( SwFormatTablePage, RelWidthClickHdl, CheckBox *, pBtn ) { - DBG_ASSERT(pTblData, "Tabellendaten nicht da?"); + OSL_ENSURE(pTblData, "table data not available?"); sal_Bool bIsChecked = pBtn->IsChecked(); sal_Int64 nLeft = aLeftMF.DenormalizePercent(aLeftMF.GetValue(FUNIT_TWIP )); sal_Int64 nRight = aRightMF.DenormalizePercent(aRightMF.GetValue(FUNIT_TWIP )); @@ -240,8 +191,8 @@ IMPL_LINK( SwFormatTablePage, RelWidthClickHdl, CheckBox *, pBtn ) aRightMF.SetRefValue(pTblData->GetSpace()); aLeftMF.MetricField::SetMin(0); // wird vom Percentfield ueberschrieben aRightMF.MetricField::SetMin(0);// -""- - aLeftMF.MetricField::SetMax(99); // - aRightMF.MetricField::SetMax(99);// + aLeftMF.MetricField::SetMax(99); // + aRightMF.MetricField::SetMax(99);// aLeftMF.SetPrcntValue(aLeftMF.NormalizePercent(nLeft ), FUNIT_TWIP ); aRightMF.SetPrcntValue(aRightMF.NormalizePercent(nRight ), FUNIT_TWIP ); } @@ -332,9 +283,7 @@ IMPL_LINK( SwFormatTablePage, RightModifyHdl, MetricField *, EMPTYARG ) if(aFreeBtn.IsChecked()) { sal_Bool bEnable = aRightMF.GetValue() == 0; -// aWidthMF.Enable(bEnable); aRelWidthCB.Enable(bEnable); -// aWidthFT.Enable(bEnable); if ( !bEnable ) { aRelWidthCB.Check(sal_False); @@ -654,7 +603,7 @@ void SwFormatTablePage::Reset( const SfxItemSet& ) //text direction if( SFX_ITEM_SET == rSet.GetItemState( RES_FRAMEDIR, sal_True, &pItem ) ) { - sal_uInt32 nVal = ((SvxFrameDirectionItem*)pItem)->GetValue(); + sal_uIntPtr nVal = ((SvxFrameDirectionItem*)pItem)->GetValue(); sal_uInt16 nPos = aTextDirectionLB.GetEntryPos( (void*) nVal ); aTextDirectionLB.SelectEntryPos( nPos ); aTextDirectionLB.SaveValue(); @@ -671,7 +620,7 @@ void SwFormatTablePage::Reset( const SfxItemSet& ) ------------------------------------------------------------------------*/ void SwFormatTablePage::ActivatePage( const SfxItemSet& rSet ) { - DBG_ASSERT(pTblData, "Tabellendaten nicht da?"); + OSL_ENSURE(pTblData, "table data not available?"); if(SFX_ITEM_SET == rSet.GetItemState( FN_TABLE_REP )) { SwTwips nCurWidth = text::HoriOrientation::FULL != pTblData->GetAlign() ? @@ -799,8 +748,6 @@ int SwFormatTablePage::DeactivatePage( SfxItemSet* _pSet ) pTblData->SetAlign(nAlign); } - - // if( text::HoriOrientation::CENTER && lWidth != (SwTwips)aWidthMF.GetSavedValue()) if(pTblData->GetWidth() != lWidth ) { pTblData->SetWidthChanged(); @@ -810,9 +757,6 @@ int SwFormatTablePage::DeactivatePage( SfxItemSet* _pSet ) if(pTblData->HasWidthChanged()) _pSet->Put(SwPtrItem(FN_TABLE_REP, pTblData)); } -#ifdef DEBUG_TBLDLG -DbgTblRep(pTblData) -#endif } return sal_True; } @@ -1139,7 +1083,7 @@ void SwTableColumnPage::UpdateCols( sal_uInt16 nAktPos ) nDiff = 0; SetVisibleWidth(nAktPos, GetVisibleWidth(nAktPos) -nDiff); } - DBG_ASSERT(nDiff >= 0, "nDiff < 0 kann hier nicht sein!"); + OSL_ENSURE(nDiff >= 0, "nDiff < 0 cannot be here!"); } } } @@ -1147,7 +1091,7 @@ void SwTableColumnPage::UpdateCols( sal_uInt16 nAktPos ) { // Differenz wird ueber die Tabellenbreite ausgeglichen, // andere Spalten bleiben unveraendert - DBG_ASSERT(nDiff <= pTblData->GetSpace() - nTableWidth, "Maximum falsch eingestellt" ); + OSL_ENSURE(nDiff <= pTblData->GetSpace() - nTableWidth, "wrong maximum" ); SwTwips nActSpace = pTblData->GetSpace() - nTableWidth; if(nDiff > nActSpace) { @@ -1163,7 +1107,7 @@ void SwTableColumnPage::UpdateCols( sal_uInt16 nAktPos ) { // Alle Spalten werden proportional mitveraendert, die Tabellenbreite wird // entsprechend angepasst - DBG_ASSERT(nDiff * nNoOfVisibleCols <= pTblData->GetSpace() - nTableWidth, "Maximum falsch eingestellt" ); + OSL_ENSURE(nDiff * nNoOfVisibleCols <= pTblData->GetSpace() - nTableWidth, "wrong maximum" ); long nAdd = nDiff; if(nDiff * nNoOfVisibleCols > pTblData->GetSpace() - nTableWidth) { @@ -1190,34 +1134,7 @@ void SwTableColumnPage::UpdateCols( sal_uInt16 nAktPos ) } nTableWidth += nAdd; - } - else - { -// Die Differenz wird gleichmaessig auf alle anderen Spalten aufgeteilt -// die Tabellenbreite bleibt konstant -/* - SwTwips nDiffn = nDiff/(nNoOfVisibleCols - 1); - if(nDiff < 0 && (nNoOfVisibleCols - 1) * nDiffn != nDiff) - nDiffn-- ; - sal_uInt16 nStart = nAktPos++; - if(nAktPos == nNoOfVisibleCols) - nStart = 0; - for(sal_uInt16 i = 0; i < nNoOfVisibleCols; i++ ) - { - if((nVisWidth = GetVisibleWidth(i)) + nDiff < MINLAY) - { - nAdd += nVisWidth - MINLAY; - SetVisibleWidth(i, MINLAY); - } - } -*/ - - } - -#ifdef DEBUG_TBLDLG -DbgTblRep(pTblData) -#endif if(!bPercentMode) aSpaceED.SetValue(aSpaceED.Normalize( pTblData->GetSpace() - nTableWidth) , FUNIT_TWIP); @@ -1271,10 +1188,6 @@ void SwTableColumnPage::ActivatePage( const SfxItemSet& ) aModifyTableCB.Enable( !bPercentMode && bModifyTbl ); aProportionalCB.Enable(!bPercentMode && bModifyTbl ); -/* if(pTblData->IsLineSelected() && pTblData->IsComplex()) - { - - }*/ aSpaceED.SetValue(aSpaceED.Normalize( pTblData->GetSpace() - nTableWidth) , FUNIT_TWIP); @@ -1339,9 +1252,6 @@ int SwTableColumnPage::DeactivatePage( SfxItemSet* _pSet ) } pTblData->SetWidthChanged(); } -#ifdef DEBUG_TBLDLG -DbgTblRep(pTblData) -#endif _pSet->Put(SwPtrItem( FN_TABLE_REP, pTblData )); } return sal_True; @@ -1360,11 +1270,10 @@ SwTwips SwTableColumnPage::GetVisibleWidth(sal_uInt16 nPos) i++; } SwTwips nReturn = pTblData->GetColumns()[i].nWidth; - DBG_ASSERT(i < nNoOfCols, "Array index out of range"); + OSL_ENSURE(i < nNoOfCols, "Array index out of range"); while(!pTblData->GetColumns()[i].bVisible && (i + 1) < nNoOfCols) nReturn += pTblData->GetColumns()[++i].nWidth; -// return (*ppTableColumns)[i].nWidth; return nReturn; } @@ -1379,7 +1288,7 @@ void SwTableColumnPage::SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth) nPos--; i++; } - DBG_ASSERT(i < nNoOfCols, "Array index out of range"); + OSL_ENSURE(i < nNoOfCols, "Array index out of range"); pTblData->GetColumns()[i].nWidth = nNewWidth; while(!pTblData->GetColumns()[i].bVisible && (i + 1) < nNoOfCols) pTblData->GetColumns()[++i].nWidth = 0; @@ -1396,7 +1305,7 @@ SwTableTabDlg::SwTableTabDlg(Window* pParent, SfxItemPool& , { FreeResource(); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AddTabPage(TP_FORMAT_TABLE, &SwFormatTablePage::Create, 0 ); AddTabPage(TP_TABLE_TEXTFLOW, &SwTextFlowPage::Create, 0 ); AddTabPage(TP_TABLE_COLUMN, &SwTableColumnPage::Create, 0 ); @@ -1433,8 +1342,6 @@ void SwTableTabDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) } } -/*-----------------12.12.96 12.22------------------- ---------------------------------------------------*/ SwTextFlowPage::SwTextFlowPage( Window* pParent, const SfxItemSet& rSet ) : SfxTabPage(pParent, SW_RES( TP_TABLE_TEXTFLOW ), rSet ), @@ -1511,22 +1418,16 @@ SwTextFlowPage::SwTextFlowPage( Window* pParent, HeadLineCBClickHdl(); } -/*-----------------12.12.96 12.22------------------- ---------------------------------------------------*/ SwTextFlowPage::~SwTextFlowPage() { } -/*-----------------12.12.96 12.22------------------- ---------------------------------------------------*/ SfxTabPage* SwTextFlowPage::Create( Window* pParent, const SfxItemSet& rAttrSet) { return new SwTextFlowPage(pParent, rAttrSet); } -/*-----------------12.12.96 12.22------------------- ---------------------------------------------------*/ sal_Bool SwTextFlowPage::FillItemSet( SfxItemSet& rSet ) { sal_Bool bModified = sal_False; @@ -1643,8 +1544,6 @@ sal_Bool SwTextFlowPage::FillItemSet( SfxItemSet& rSet ) } -/*-----------------12.12.96 12.22------------------- ---------------------------------------------------*/ void SwTextFlowPage::Reset( const SfxItemSet& rSet ) { const SfxPoolItem* pItem; @@ -1829,9 +1728,6 @@ void SwTextFlowPage::Reset( const SfxItemSet& rSet ) HeadLineCBClickHdl(); } -/*-----------------16.04.98 14:48------------------- - ---------------------------------------------------*/ void SwTextFlowPage::SetShell(SwWrtShell* pSh) { @@ -1844,8 +1740,6 @@ void SwTextFlowPage::SetShell(SwWrtShell* pSh) } } -/*-----------------12.12.96 16.18------------------- ---------------------------------------------------*/ IMPL_LINK( SwTextFlowPage, PageBreakHdl_Impl, CheckBox*, EMPTYARG ) { if( aPgBrkCB.IsChecked() ) @@ -1884,8 +1778,6 @@ IMPL_LINK( SwTextFlowPage, PageBreakHdl_Impl, CheckBox*, EMPTYARG ) return 0; } -/*-----------------12.12.96 16.18------------------- ---------------------------------------------------*/ IMPL_LINK( SwTextFlowPage, ApplyCollClickHdl_Impl, CheckBox*, EMPTYARG ) { sal_Bool bEnable = sal_False; @@ -1908,8 +1800,6 @@ IMPL_LINK( SwTextFlowPage, ApplyCollClickHdl_Impl, CheckBox*, EMPTYARG ) return 0; } -/*-----------------12.12.96 16.18------------------- ---------------------------------------------------*/ IMPL_LINK( SwTextFlowPage, PageBreakPosHdl_Impl, RadioButton*, pBtn ) { if ( aPgBrkCB.IsChecked() ) @@ -1940,8 +1830,6 @@ IMPL_LINK( SwTextFlowPage, PageBreakPosHdl_Impl, RadioButton*, pBtn ) return 0; } -/*-----------------12.12.96 16.18------------------- ---------------------------------------------------*/ IMPL_LINK( SwTextFlowPage, PageBreakTypeHdl_Impl, RadioButton*, pBtn ) { if ( pBtn == &aColBrkRB || aPgBrkAfterRB.IsChecked() ) @@ -1956,17 +1844,13 @@ IMPL_LINK( SwTextFlowPage, PageBreakTypeHdl_Impl, RadioButton*, pBtn ) PageBreakPosHdl_Impl( &aPgBrkBeforeRB ); return 0; } -/*-----------------17.11.2003 11:30----------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwTextFlowPage, SplitHdl_Impl, CheckBox*, pBox ) { aSplitRowCB.Enable(pBox->IsChecked()); return 0; } -/*-----------------17.11.2003 11:30----------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwTextFlowPage, SplitRowHdl_Impl, TriStateBox*, pBox ) { pBox->EnableTriState(sal_False); @@ -1980,9 +1864,6 @@ IMPL_LINK( SwTextFlowPage, HeadLineCBClickHdl, void*, EMPTYARG ) return 0; } -/*-----------------30.05.97 07:37------------------- - ---------------------------------------------------*/ void SwTextFlowPage::DisablePageBreak() { bPageBreak = sal_False; @@ -1999,3 +1880,4 @@ void SwTextFlowPage::DisablePageBreak() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/tabledlg.src b/sw/source/ui/table/tabledlg.src index 8c33398ca9..b1c2f2d846 100644 --- a/sw/source/ui/table/tabledlg.src +++ b/sw/source/ui/table/tabledlg.src @@ -616,7 +616,6 @@ TabPage TP_TABLE_TEXTFLOW // Disable = TRUE; Pos = MAP_APPFONT ( 178 , 14 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; - // ### ACHTUNG: Neuer Text in Resource? S~palte : ~Spalte Text [ en-US ] = "Col~umn" ; }; RadioButton RB_PAGEBREAKBEFORE diff --git a/sw/source/ui/table/tablemgr.cxx b/sw/source/ui/table/tablemgr.cxx index 7ba9a89783..6991074cf4 100644 --- a/sw/source/ui/table/tablemgr.cxx +++ b/sw/source/ui/table/tablemgr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,7 +38,6 @@ #include <sot/clsids.hxx> #include "edtwin.hxx" -#include "errhdl.hxx" #include "wrtsh.hxx" #include "cmdid.h" #include "frmatr.hxx" @@ -66,10 +66,10 @@ void SwTableFUNC::ColWidthDlg( Window *pParent ) { InitTabCols(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); VclAbstractDialog* pDlg = pFact->CreateSwTableWidthDlg( pParent, *this ,DLG_COL_WIDTH ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; } @@ -113,7 +113,7 @@ SwTwips SwTableFUNC::GetColWidth(sal_uInt16 nNum) const SwTwips SwTableFUNC::GetMaxColWidth( sal_uInt16 nNum ) const { - ASSERT(nNum <= aCols.Count(), "Index out of Area"); + OSL_ENSURE(nNum <= aCols.Count(), "Index out of Area"); if ( GetColCount() > 0 ) { @@ -138,13 +138,12 @@ void SwTableFUNC::SetColWidth(sal_uInt16 nNum, SwTwips nNewWidth ) // aktuelle Breite setzen // alle folgenden Verschieben sal_Bool bCurrentOnly = sal_False; - SwTwips nWidth = 0; if ( aCols.Count() > 0 ) { if(aCols.Count() != GetColCount()) bCurrentOnly = sal_True; - nWidth = GetColWidth(nNum); + SwTwips nWidth = GetColWidth(nNum); int nDiff = (int)(nNewWidth - nWidth); if( !nNum ) @@ -175,7 +174,7 @@ void SwTableFUNC::SetColWidth(sal_uInt16 nNum, SwTwips nNewWidth ) void SwTableFUNC::InitTabCols() { - ASSERT(pSh, keine Shell); + OSL_ENSURE(pSh, "no Shell"); if( pFmt && pSh) pSh->GetTabCols( aCols ); @@ -314,22 +313,22 @@ uno::Reference< frame::XModel > SwTableFUNC::InsertChart( else if (nColLen > 1) eDataRowSource = chart::ChartDataRowSource_COLUMNS; else { - DBG_ERROR( "unexpected state" ); + OSL_ENSURE(false, "unexpected state" ); } } uno::Sequence< beans::PropertyValue > aArgs( 4 ); aArgs[0] = beans::PropertyValue( - ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CellRangeRepresentation")), -1, uno::makeAny( rCellRange ), beans::PropertyState_DIRECT_VALUE ); aArgs[1] = beans::PropertyValue( - ::rtl::OUString::createFromAscii("HasCategories"), -1, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HasCategories")), -1, uno::makeAny( bHasCategories ), beans::PropertyState_DIRECT_VALUE ); aArgs[2] = beans::PropertyValue( - ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FirstCellAsLabel")), -1, uno::makeAny( bFirstCellAsLabel ), beans::PropertyState_DIRECT_VALUE ); aArgs[3] = beans::PropertyValue( - ::rtl::OUString::createFromAscii("DataRowSource"), -1, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataRowSource")), -1, uno::makeAny( eDataRowSource ), beans::PropertyState_DIRECT_VALUE ); xDataReceiver->setArguments( aArgs ); } @@ -367,7 +366,7 @@ sal_uInt16 SwTableFUNC::GetColCount() const int SwTableFUNC::GetRightSeparator(int nNum) const { - DBG_ASSERT( nNum < (int)GetColCount() ,"Index out of range"); + OSL_ENSURE( nNum < (int)GetColCount() ,"Index out of range"); int i = 0; while( nNum >= 0 ) { @@ -380,3 +379,4 @@ int SwTableFUNC::GetRightSeparator(int nNum) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/tablepg.hxx b/sw/source/ui/table/tablepg.hxx index a95e659fe0..90d528fae1 100644 --- a/sw/source/ui/table/tablepg.hxx +++ b/sw/source/ui/table/tablepg.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,15 +28,9 @@ #ifndef _SWTABLEPG_HXX #define _SWTABLEPG_HXX #include <sfx2/tabdlg.hxx> -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _IMAGEBTN_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif #include <actctrl.hxx> #include "prcntfld.hxx" #include "swtypes.hxx" @@ -236,3 +231,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 88854b9a88..bf7fb8de2d 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,12 +36,8 @@ -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <vcl/svapp.hxx> #include <svl/zforlist.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -51,18 +48,12 @@ #include <svx/framelinkarray.hxx> #include "swmodule.hxx" #include "swtypes.hxx" -#ifndef _VIEW_HXX #include "view.hxx" -#endif #include "wrtsh.hxx" #include "tblafmt.hxx" -#ifndef _TAUTOFMT_HXX #include "tautofmt.hxx" -#endif #include "shellres.hxx" -#ifndef _TAUTOFMT_HRC #include "tautofmt.hrc" -#endif using namespace com::sun::star; @@ -170,7 +161,7 @@ void SwStringInputDlg::GetInputString( String& rString ) const } -__EXPORT SwStringInputDlg::~SwStringInputDlg() +SwStringInputDlg::~SwStringInputDlg() { } @@ -224,7 +215,7 @@ SwAutoFormatDlg::SwAutoFormatDlg( Window* pParent, SwWrtShell* pWrtShell, //------------------------------------------------------------------------ -__EXPORT SwAutoFormatDlg::~SwAutoFormatDlg() +SwAutoFormatDlg::~SwAutoFormatDlg() { delete pWndPreview; @@ -337,8 +328,6 @@ IMPL_LINK( SwAutoFormatDlg, CheckHdl, Button *, pBtn ) pData->SetBackground( bCheck ); else if ( pBtn == &aBtnAlignment ) pData->SetJustify( bCheck ); -// else if ( pBtn == &aBtnAdjust ) -// pData->SetIncludeWidthHeight( bCheck ); else bDataChgd = sal_False; @@ -608,12 +597,12 @@ AutoFmtPreview::AutoFmtPreview( Window* pParent, const ResId& rRes, SwWrtShell* else mbRTL = pWrtShell->IsTableRightToLeft(); - DBG_ASSERT( m_xMSF.is(), "AutoFmtPreview: no MultiServiceFactory"); + OSL_ENSURE( m_xMSF.is(), "AutoFmtPreview: no MultiServiceFactory"); if ( m_xMSF.is() ) { m_xBreak = uno::Reference< i18n::XBreakIterator >( m_xMSF->createInstance ( - rtl::OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) ), uno::UNO_QUERY); } pNumFmt = new SvNumberFormatter( m_xMSF, LANGUAGE_SYSTEM ); @@ -623,7 +612,7 @@ AutoFmtPreview::AutoFmtPreview( Window* pParent, const ResId& rRes, SwWrtShell* //------------------------------------------------------------------------ -__EXPORT AutoFmtPreview::~AutoFmtPreview() +AutoFmtPreview::~AutoFmtPreview() { delete pNumFmt; } @@ -764,9 +753,6 @@ MAKENUMSTR: Rectangle cellRect = maArray.GetCellRect( nCol, nRow ); Point aPos = cellRect.TopLeft(); sal_uInt16 nRightX = 0; -// sal_Bool bJustify = aCurData.IsJustify(); -// ScHorJustifyAttr aHorJustifyItem; -// CellHorJustify eJustification; Size theMaxStrSize( cellRect.GetWidth() - FRAME_OFFSET, cellRect.GetHeight() - FRAME_OFFSET ); @@ -795,9 +781,6 @@ MAKENUMSTR: while( theMaxStrSize.Width() <= aStrSize.Width() && cellString.Len() > 1 ) { -// if( eJustification == SVX_HOR_JUSTIFY_RIGHT ) -// cellString.Erase( 0, 1 ); -// else cellString.Erase( cellString.Len() - 1 ); aScriptedText.SetText( cellString, m_xBreak ); aStrSize = aScriptedText.GetTextSize(); @@ -806,18 +789,6 @@ MAKENUMSTR: nRightX = (sal_uInt16)( cellRect.GetWidth() - aStrSize.Width() - FRAME_OFFSET ); - //------------- - // Ausrichtung: - //------------- - /* if ( bJustify ) - { - aCurData.GetHorJustify( nFmtIndex, aHorJustifyItem ); - eJustification = (CellHorJustify)aHorJustifyItem.GetValue(); - } - else - { - eJustification = SC_HOR_JUSTIFY_STANDARD; - }*/ //----------------------------- // vertikal (immer zentrieren): @@ -827,7 +798,6 @@ MAKENUMSTR: //----------- // horizontal //----------- -/* if ( eJustification != SC_HOR_JUSTIFY_STANDARD )*/ if( mbRTL ) aPos.X() += nRightX; else if (aCurData.IsJustify()) @@ -922,7 +892,7 @@ void AutoFmtPreview::PaintCells() //------------------------------------------------------------------------ -void __EXPORT AutoFmtPreview::Init() +void AutoFmtPreview::Init() { SetBorderStyle( GetBorderStyle() | WINDOW_BORDER_MONO ); maArray.Initialize( 5, 5 ); @@ -1051,7 +1021,9 @@ void AutoFmtPreview::DoPaint( const Rectangle& /*rRect*/ ) //------------------------------------------------------------------------ -void __EXPORT AutoFmtPreview::Paint( const Rectangle& rRect ) +void AutoFmtPreview::Paint( const Rectangle& rRect ) { DoPaint( rRect ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/tautofmt.src b/sw/source/ui/table/tautofmt.src index ec6eaad812..5043c981ab 100644 --- a/sw/source/ui/table/tautofmt.src +++ b/sw/source/ui/table/tautofmt.src @@ -214,8 +214,6 @@ ModalDialog DLG_AUTOFMT_TABLE }; String STR_INVALID_AFNAME { - /* ### ACHTUNG: Neuer Text in Resource? Sie haben einen ung�ltigen Namen angegeben.\nDas AutoFormat konnte nicht angelegt werden.\nW�hlen Sie einen anderen Namen. : Sie haben einen ung�ltigen Namen angegeben.\nDas Autoformat konnte nicht angelegt werden.\nW�hlen Sie einen anderen Namen. */ - /* ### ACHTUNG: Neuer Text in Resource? Sie haben einen ung�ltigen Namen angegeben.\nDas AutoFormat konnte nicht angelegt werden.\nW�hlen Sie einen anderen Namen. : Sie haben einen ung�ltigen Namen angegeben.\nDas Autoformat konnte nicht angelegt werden.\nW�hlen Sie einen anderen Namen. */ Text [ en-US ] = "You have entered an invalid name.\nThe desired AutoFormat could not be created. \nTry again using a different name." ; }; }; diff --git a/sw/source/ui/uiview/formatclipboard.cxx b/sw/source/ui/uiview/formatclipboard.cxx index 2cfeb7305c..6fbb37e934 100644 --- a/sw/source/ui/uiview/formatclipboard.cxx +++ b/sw/source/ui/uiview/formatclipboard.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,12 +33,8 @@ #include <hintids.hxx> -#ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <format.hxx> #include <charfmt.hxx> #include <fmtcol.hxx> @@ -67,12 +64,6 @@ #include <swundo.hxx> // fuer die UndoIds #include <boost/shared_ptr.hpp> -//#define FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES 1 - -#ifdef FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES -#include <cellatr.hxx> -#endif - /*-------------------------------------------------------------------- --------------------------------------------------------------------*/ @@ -129,9 +120,6 @@ SfxItemSet* lcl_CreateEmptyItemSet( int nSelectionType, SfxItemPool& rPool FN_PARAM_TABLE_HEADLINE, FN_PARAM_TABLE_HEADLINE, FN_TABLE_BOX_TEXTDIRECTION, FN_TABLE_BOX_TEXTDIRECTION, FN_TABLE_SET_VERT_ALIGN, FN_TABLE_SET_VERT_ALIGN, -#ifdef FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES - RES_BOXATR_FORMAT, RES_BOXATR_FORMAT, -#endif 0); } else if( nSelectionType & nsSelectionType::SEL_TXT ) @@ -192,11 +180,6 @@ void lcl_getTableAttributes( SfxItemSet& rSet, SwWrtShell &rSh ) rSh.GetRowSplit(pSplit); if(pSplit) rSet.Put(*pSplit); - - //-- numberformat in cells -#ifdef FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES - rSh.GetTblBoxFormulaAttrs( rSet ); //RES_BOXATR_FORMAT -#endif } void lcl_setTableAttributes( const SfxItemSet& rSet, SwWrtShell &rSh ) @@ -285,17 +268,6 @@ void lcl_setTableAttributes( const SfxItemSet& rSet, SwWrtShell &rSh ) if( SFX_ITEM_SET == rSet.GetItemState( RES_ROW_SPLIT, sal_False, &pItem) ) rSh.SetRowSplit(*static_cast<const SwFmtRowSplit*>(pItem)); - - //-- numberformat in cells -#ifdef FORMAT_PAINTBRUSH_ALSO_COPY_NUMBERFORMAT_FOR_TABLES - if( SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_FORMAT, sal_False, &pItem )) - { - SfxItemSet aBoxSet( *rSet.GetPool(), RES_BOXATR_FORMAT, RES_BOXATR_FORMAT ); - aBoxSet.Put( SwTblBoxNumFormat( ((SfxUInt32Item*)pItem)->GetValue() )); - rSh.SetTblBoxFormulaAttrs( aBoxSet ); - - } -#endif } }//end anonymous namespace @@ -451,7 +423,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP } typedef boost::shared_ptr< SfxPoolItem > SfxPoolItemSharedPtr; typedef std::vector< SfxPoolItemSharedPtr > ItemVector; -// #144857# collect all PoolItems from the applied styles +// collect all PoolItems from the applied styles void lcl_AppendSetItems( ItemVector& rItemVector, const SfxItemSet& rStyleAttrSet ) { const sal_uInt16* pRanges = rStyleAttrSet.GetRanges(); @@ -468,7 +440,7 @@ void lcl_AppendSetItems( ItemVector& rItemVector, const SfxItemSet& rStyleAttrSe pRanges += 2; } } -// #144857# remove all items that are inherited from the styles +// remove all items that are inherited from the styles void lcl_RemoveEqualItems( SfxItemSet& rTemplateItemSet, ItemVector& rItemVector ) { ItemVector::iterator aEnd = rItemVector.end(); @@ -510,9 +482,9 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo if( pStyle ) { SwFmtCharFmt aFmt(pStyle->GetCharFmt()); - // #144857# collect items from character style + // collect items from character style lcl_AppendSetItems( aItemVector, aFmt.GetCharFmt()->GetAttrSet()); - sal_uInt16 nFlags=0; //(nMode & KEY_SHIFT) ? SETATTR_DONTREPLACE : SETATTR_DEFAULT; + sal_uInt16 nFlags=0; rWrtShell.SetAttr( aFmt, nFlags ); } } @@ -521,7 +493,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo SwDocStyleSheet* pStyle = (SwDocStyleSheet*)pPool->Find(m_aParaStyle, SFX_STYLE_FAMILY_PARA); if( pStyle ) { - // #144857# collect items from paragraph style + // collect items from paragraph style lcl_AppendSetItems( aItemVector, pStyle->GetCollection()->GetAttrSet()); rWrtShell.SetTxtFmtColl( pStyle->GetCollection() ); } @@ -547,7 +519,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo if(pTemplateItemSet) { pTemplateItemSet->Put( *m_pItemSet ); - // #144857# only _set_ attributes that differ from style attributes should be applied - the style is applied anyway + // only _set_ attributes that differ from style attributes should be applied - the style is applied anyway lcl_RemoveEqualItems( *pTemplateItemSet, aItemVector ); if( nSelectionType & (nsSelectionType::SEL_FRM | nsSelectionType::SEL_OLE | nsSelectionType::SEL_GRF) ) @@ -615,3 +587,5 @@ void SwFormatClipboard::Erase() m_bPersistentCopy = false; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index a3eb75e924..293b03022a 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -81,16 +82,14 @@ #define SwPagePreView #include <sfx2/msg.hxx> #include <swslots.hxx> -// OD 12.12.2002 #103492# #include <pagepreviewlayout.hxx> #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> using namespace ::com::sun::star; - SFX_IMPL_NAMED_VIEWFACTORY(SwPagePreView, "PrintPreview") { SFX_VIEW_REGISTRATION(SwDocShell); @@ -107,17 +106,13 @@ SFX_IMPL_INTERFACE(SwPagePreView, SfxViewShell, SW_RES(RID_PVIEW_TOOLBOX)) SW_RES(RID_PVIEW_TOOLBOX)); } - TYPEINIT1(SwPagePreView,SfxViewShell) #define SWVIEWFLAGS ( SFX_VIEW_CAN_PRINT|SFX_VIEW_HAS_PRINTOPTIONS ) #define MIN_PREVIEW_ZOOM 25 #define MAX_PREVIEW_ZOOM 600 -/* */ -/* -----------------26.11.2002 10:41----------------- - * - * --------------------------------------------------*/ + sal_uInt16 lcl_GetNextZoomStep(sal_uInt16 nCurrentZoom, sal_Bool bZoomIn) { static sal_uInt16 aZoomArr[] = @@ -139,24 +134,18 @@ sal_uInt16 lcl_GetNextZoomStep(sal_uInt16 nCurrentZoom, sal_Bool bZoomIn) } return bZoomIn ? MAX_PREVIEW_ZOOM : MIN_PREVIEW_ZOOM; }; -/* -----------------02.12.2002 09:11----------------- - * - * --------------------------------------------------*/ + void lcl_InvalidateZoomSlots(SfxBindings& rBindings) { - static sal_uInt16 __READONLY_DATA aInval[] = + static sal_uInt16 const aInval[] = { SID_ATTR_ZOOM, SID_ZOOM_OUT, SID_ZOOM_IN, SID_ATTR_ZOOMSLIDER, FN_PREVIEW_ZOOM, FN_STAT_ZOOM, 0 }; rBindings.Invalidate( aInval ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ // erstmal der Zoom-Dialog - class SwPreViewZoomDlg : public SvxStandardDialog { FixedText aRowLbl; @@ -175,11 +164,6 @@ public: ~SwPreViewZoomDlg(); }; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwPreViewZoomDlg::SwPreViewZoomDlg( SwPagePreViewWin& rParent ) : SvxStandardDialog( &rParent, SW_RES(DLG_PAGEPREVIEW_ZOOM) ), aRowLbl(this,SW_RES(FT_ROW)), @@ -196,13 +180,7 @@ SwPreViewZoomDlg::SwPreViewZoomDlg( SwPagePreViewWin& rParent ) : aColEdit.SetValue( rParent.GetCol() ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwPreViewZoomDlg::~SwPreViewZoomDlg() {} - - void SwPreViewZoomDlg::Apply() { ((SwPagePreViewWin*)GetParent())->CalcWish( @@ -210,13 +188,7 @@ void SwPreViewZoomDlg::Apply() sal_uInt8(aColEdit.GetValue()) ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - // alles fuers SwPagePreViewWin - - SwPagePreViewWin::SwPagePreViewWin( Window *pParent, SwPagePreView& rPView ) : Window( pParent, WinBits( WB_CLIPCHILDREN) ), mpViewShell( 0 ), @@ -224,7 +196,7 @@ SwPagePreViewWin::SwPagePreViewWin( Window *pParent, SwPagePreView& rPView ) mbCalcScaleForPreviewLayout( true ), maPaintedPreviewDocRect( Rectangle(0,0,0,0) ) { - SetOutDevViewType( OUTDEV_VIEWTYPE_PRINTPREVIEW ); //#106611# + SetOutDevViewType( OUTDEV_VIEWTYPE_PRINTPREVIEW ); SetHelpId(HID_PAGEPREVIEW); SetFillColor( GetBackground().GetColor() ); SetLineColor( GetBackground().GetColor()); @@ -233,26 +205,15 @@ SwPagePreViewWin::SwPagePreViewWin( Window *pParent, SwPagePreView& rPView ) const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(sal_False); mnRow = pUsrPref->GetPagePrevRow(); // 1 Zeile mnCol = pUsrPref->GetPagePrevCol(); // 1 Spalte - // OD 24.03.2003 #108282# - member <mnVirtPage> no longer exists. mnSttPage = USHRT_MAX; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwPagePreViewWin::~SwPagePreViewWin() { if( mpViewShell ) delete mpViewShell; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwPagePreViewWin::Paint( const Rectangle& rRect ) { if( !mpViewShell || !mpViewShell->GetLayout() ) @@ -281,16 +242,12 @@ void SwPagePreViewWin::Paint( const Rectangle& rRect ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ void SwPagePreViewWin::CalcWish( sal_uInt8 nNewRow, sal_uInt8 nNewCol ) { if( !mpViewShell || !mpViewShell->GetLayout() ) return; sal_uInt16 nOldCol = mnCol; - // OD 02.12.2002 #103492# - update <mnRow> and <mnCol>. mnRow = nNewRow; mnCol = nNewCol; sal_uInt16 nPages = mnRow * mnCol, @@ -312,8 +269,8 @@ void SwPagePreViewWin::CalcWish( sal_uInt8 nNewRow, sal_uInt8 nNewCol ) mrView.ScrollDocSzChg(); // Sortierung muss eingehalten werden!! - // OD 24.03.2003 #108282# - additional invalidate page status. - static sal_uInt16 __READONLY_DATA aInval[] = + // additional invalidate page status. + static sal_uInt16 aInval[] = { SID_ATTR_ZOOM, SID_ZOOM_OUT, SID_ZOOM_IN, FN_PREVIEW_ZOOM, @@ -326,23 +283,20 @@ void SwPagePreViewWin::CalcWish( sal_uInt8 nNewRow, sal_uInt8 nNewCol ) rBindings.Invalidate( aInval ); rBindings.Update( FN_SHOW_TWO_PAGES ); rBindings.Update( FN_SHOW_MULTIPLE_PAGES ); - // OD 18.12.2002 #103492# - adjust scrollbars + // adjust scrollbars mrView.ScrollViewSzChg(); } + /*-------------------------------------------------------------------- Beschreibung:, mnSttPage is Absolute --------------------------------------------------------------------*/ - - int SwPagePreViewWin::MovePage( int eMoveMode ) { // soviele Seiten hoch sal_uInt16 nPages = mnRow * mnCol; sal_uInt16 nNewSttPage = mnSttPage; - // OD 04.12.2002 #103492# sal_uInt16 nPageCount = mrView.GetPageCount(); sal_uInt16 nDefSttPg = GetDefSttPage(); - // OD 06.12.2002 #103492# bool bPaintPageAtFirstCol = true; switch( eMoveMode ) @@ -380,37 +334,36 @@ int SwPagePreViewWin::MovePage( int eMoveMode ) SetSelectedPage( mpPgPrevwLayout->ConvertRelativeToAbsolutePageNum( nNewSttPage ? nNewSttPage : 1 ) ); break; case MV_DOC_END: - // OD 03.12.2002 #103492# - correct calculation of new start page. + // correct calculation of new start page. nNewSttPage = nPageCount; SetSelectedPage( nPageCount ); break; - // OD 12.12.2002 #103492# - add new move mode case MV_SELPAGE: // <nNewSttPage> and <SelectedPage()> are already set. - // OD 20.02.2003 #107369# - not start at first column, only if the + // not start at first column, only if the // complete preview layout columns doesn't fit into window. if ( !mpPgPrevwLayout->DoesPreviewLayoutColsFitIntoWindow() ) bPaintPageAtFirstCol = false; break; case MV_SCROLL: - // OD 17.01.2003 #103492# - check, if paint page at first column + // check, if paint page at first column // has to be avoided if ( !mpPgPrevwLayout->DoesPreviewLayoutRowsFitIntoWindow() || !mpPgPrevwLayout->DoesPreviewLayoutColsFitIntoWindow() ) bPaintPageAtFirstCol = false; break; case MV_NEWWINSIZE: - // OD 18.12.2002 #103492# - nothing special to do. + // nothing special to do. break; case MV_CALC: - // OD 18.12.2002 #103492# - re-init page preview layout. + // re-init page preview layout. mpPgPrevwLayout->ReInit(); - // OD 03.12.2002 #103492# - correct calculation of new start page. + // correct calculation of new start page. if( nNewSttPage > nPageCount ) nNewSttPage = nPageCount; - // OD 18.12.2002 #103492# - correct selected page number + // correct selected page number if( SelectedPage() > nPageCount ) SetSelectedPage( nNewSttPage ? nNewSttPage : 1 ); } @@ -425,8 +378,8 @@ int SwPagePreViewWin::MovePage( int eMoveMode ) SetPagePreview(mnRow, mnCol); mnSttPage = nNewSttPage; - // OD 24.03.2003 #108282# - additional invalidate page status. - static sal_uInt16 __READONLY_DATA aInval[] = + // additional invalidate page status. + static sal_uInt16 aInval[] = { FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN, FN_STAT_PAGE, 0 @@ -438,11 +391,6 @@ int SwPagePreViewWin::MovePage( int eMoveMode ) return sal_True; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwPagePreViewWin::SetWinSize( const Size& rNewSize ) { // die Size wollen wir aber immer in Pixel-Einheiten haben @@ -470,15 +418,9 @@ void SwPagePreViewWin::SetWinSize( const Size& rNewSize ) maScale = GetMapMode().GetScaleX(); } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwPagePreViewWin::GetStatusStr( String& rStr, sal_uInt16 nPageCnt ) const { - // OD 24.03.2003 #108282# - show physical and virtual page number of + // show physical and virtual page number of // selected page, if it's visible. sal_uInt16 nPageNum; if ( mpPgPrevwLayout->IsPageVisible( mpPgPrevwLayout->SelectedPage() ) ) @@ -500,11 +442,6 @@ void SwPagePreViewWin::GetStatusStr( String& rStr, sal_uInt16 nPageCnt ) const rStr += String::CreateFromInt32( nPageCnt ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwPagePreViewWin::KeyInput( const KeyEvent &rKEvt ) { const KeyCode& rKeyCode = rKEvt.GetKeyCode(); @@ -530,10 +467,6 @@ void SwPagePreViewWin::KeyInput( const KeyEvent &rKEvt ) Window::KeyInput( rKEvt ); } -/****************************************************************************** - * Beschreibung: - ******************************************************************************/ - void SwPagePreViewWin::Command( const CommandEvent& rCEvt ) { sal_Bool bCallBase = sal_True; @@ -561,7 +494,6 @@ void SwPagePreViewWin::Command( const CommandEvent& rCEvt ) } break; default: - // OD 17.12.2002 #103492# - delete assertion ; } @@ -571,7 +503,7 @@ void SwPagePreViewWin::Command( const CommandEvent& rCEvt ) void SwPagePreViewWin::MouseButtonDown( const MouseEvent& rMEvt ) { - // OD 17.12.2002 #103492# - consider single-click to set selected page + // consider single-click to set selected page if( MOUSE_LEFT == ( rMEvt.GetModifier() + rMEvt.GetButtons() ) ) { Point aPrevwPos( PixelToLogic( rMEvt.GetPosPixel() ) ); @@ -596,18 +528,17 @@ void SwPagePreViewWin::MouseButtonDown( const MouseEvent& rMEvt ) SFX_CALLMODE_ASYNCHRON ); } else if ( bIsDocPos || bPosInEmptyPage ) - // OD 2004-03-04 #i20684# - add missing parenthesis { // show clicked page as the selected one mpPgPrevwLayout->MarkNewSelectedPage( nNewSelectedPage ); GetViewShell()->ShowPreViewSelection( nNewSelectedPage ); - // OD 19.02.2003 #107369# - adjust position at vertical scrollbar. + // adjust position at vertical scrollbar. if ( mpPgPrevwLayout->DoesPreviewLayoutRowsFitIntoWindow() ) { mrView.SetVScrollbarThumbPos( nNewSelectedPage ); } - // OD 24.03.2003 #108282# - invalidate page status. - static sal_uInt16 __READONLY_DATA aInval[] = + // invalidate page status. + static sal_uInt16 aInval[] = { FN_STAT_PAGE, 0 }; @@ -620,8 +551,6 @@ void SwPagePreViewWin::MouseButtonDown( const MouseEvent& rMEvt ) /****************************************************************************** * Beschreibung: Userprefs bzw Viewoptions setzen ******************************************************************************/ - - void SwPagePreViewWin::SetPagePreview( sal_uInt8 nRow, sal_uInt8 nCol ) { SwMasterUsrPref *pOpt = (SwMasterUsrPref *)SW_MOD()->GetUsrPref(sal_False); @@ -639,8 +568,6 @@ void SwPagePreViewWin::SetPagePreview( sal_uInt8 nRow, sal_uInt8 nCol ) /** get selected page in document preview - OD 13.12.2002 #103492# - @author OD */ sal_uInt16 SwPagePreViewWin::SelectedPage() const @@ -650,8 +577,6 @@ sal_uInt16 SwPagePreViewWin::SelectedPage() const /** set selected page number in document preview - OD 13.12.2002 #103492# - @author OD */ void SwPagePreViewWin::SetSelectedPage( sal_uInt16 _nSelectedPageNum ) @@ -661,8 +586,6 @@ void SwPagePreViewWin::SetSelectedPage( sal_uInt16 _nSelectedPageNum ) /** method to enable/disable book preview - OD 2004-03-05 #i18143# - @author OD */ bool SwPagePreViewWin::SetBookPreviewMode( const bool _bBookPreview ) @@ -685,7 +608,7 @@ void SwPagePreViewWin::DataChanged( const DataChangedEvent& rDCEvt ) // den Settings abgefragt werden. if( rDCEvt.GetFlags() & SETTINGS_STYLE ) mrView.InvalidateBorder(); //Scrollbarbreiten - //#106746# zoom has to be disabled if Accessibility support is switched on + // zoom has to be disabled if Accessibility support is switched on lcl_InvalidateZoomSlots(mrView.GetViewFrame()->GetBindings()); break; @@ -702,8 +625,6 @@ void SwPagePreViewWin::DataChanged( const DataChangedEvent& rDCEvt ) /** help method to execute SfxRequest FN_PAGEUP and FN_PAGEDOWN - OD 04.03.2003 #107369# - @author OD */ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp, @@ -762,8 +683,8 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp, aViewWin.SetSelectedPage( nNewSelectedPageNum ); } ScrollViewSzChg(); - // OD 24.03.2003 #108282# - additional invalidate page status. - static sal_uInt16 __READONLY_DATA aInval[] = + // additional invalidate page status. + static sal_uInt16 aInval[] = { FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN, FN_STAT_PAGE, 0 @@ -778,9 +699,6 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp, _pReq->Done(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ // dann mal alles fuer die SwPagePreView void SwPagePreView::Execute( SfxRequest &rReq ) { @@ -829,7 +747,7 @@ void SwPagePreView::Execute( SfxRequest &rReq ) // book preview mode changed. Thus, adjust scrollbars and // invalidate corresponding states. ScrollViewSzChg(); - static sal_uInt16 __READONLY_DATA aInval[] = + static sal_uInt16 aInval[] = { FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN, FN_STAT_PAGE, FN_SHOW_BOOKVIEW, 0 @@ -870,7 +788,7 @@ void SwPagePreView::Execute( SfxRequest &rReq ) if(pFact) { pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); } pDlg->SetLimits( MINZOOM, MAXZOOM ); @@ -941,7 +859,7 @@ void SwPagePreView::Execute( SfxRequest &rReq ) if ( pPagePrevwLay->IsPageVisible( nNewSelectedPage ) ) { pPagePrevwLay->MarkNewSelectedPage( nNewSelectedPage ); - // OD 19.02.2003 #107369# - adjust position at vertical scrollbar. + // adjust position at vertical scrollbar. SetVScrollbarThumbPos( nNewSelectedPage ); bRefresh = false; } @@ -953,8 +871,8 @@ void SwPagePreView::Execute( SfxRequest &rReq ) bRefresh = 0 != nRet; } GetViewShell()->ShowPreViewSelection( nNewSelectedPage ); - // OD 24.03.2003 #108282# - invalidate page status. - static sal_uInt16 __READONLY_DATA aInval[] = + // invalidate page status. + static sal_uInt16 aInval[] = { FN_STAT_PAGE, 0 }; @@ -1040,7 +958,7 @@ MOVEPAGE: } break; default: - ASSERT(!this, falscher Dispatcher); + OSL_ENSURE(!this, "wrong dispatcher"); return; } @@ -1048,20 +966,14 @@ MOVEPAGE: aViewWin.Invalidate(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwPagePreView::GetState( SfxItemSet& rSet ) { SfxWhichIter aIter(rSet); sal_uInt8 nRow = 1; sal_uInt16 nWhich = aIter.FirstWhich(); - ASSERT(nWhich, leeres Set); + OSL_ENSURE(nWhich, "empty set"); SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout(); - //#106746# zoom has to be disabled if Accessibility support is switched on - // MT 2010/01, see #110498# + // zoom has to be disabled if Accessibility support is switched on sal_Bool bZoomEnabled = sal_True; // !Application::GetSettings().GetMiscSettings().GetEnableATToolSupport(); while(nWhich) @@ -1207,11 +1119,6 @@ void SwPagePreView::GetState( SfxItemSet& rSet ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwPagePreView::StateUndo(SfxItemSet& rSet) { SfxWhichIter aIter(rSet); @@ -1224,11 +1131,6 @@ void SwPagePreView::StateUndo(SfxItemSet& rSet) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwPagePreView::Init(const SwViewOption * pPrefs) { if ( GetViewShell()->HasDrawView() ) @@ -1274,7 +1176,7 @@ void SwPagePreView::Init(const SwViewOption * pPrefs) GetViewShell()->ApplyViewOptions( aOpt ); GetViewShell()->ApplyAccessiblityOptions(SW_MOD()->GetAccessibilityOptions()); - // OD 09.01.2003 #i6467# - adjust view shell option to the same as for print + // adjust view shell option to the same as for print SwPrintData const aPrintOptions = *SW_MOD()->GetPrtOptions(false); GetViewShell()->AdjustOptionsForPagePreview( aPrintOptions ); @@ -1296,12 +1198,6 @@ void SwPagePreView::Init(const SwViewOption * pPrefs) pScrollFill->Show(pPrefs->IsViewVScrollBar() && pPrefs->IsViewHScrollBar()); } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh): SfxViewShell( pViewFrame, SWVIEWFLAGS ), aViewWin( &pViewFrame->GetWindow(), *this ), @@ -1313,7 +1209,6 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh): pScrollFill(new ScrollBarBox( &pViewFrame->GetWindow(), pViewFrame->GetFrame().GetParentFrame() ? 0 : WB_SIZEABLE )), mnPageCount( 0 ), - // OD 09.01.2003 #106334# mbResetFormDesignMode( false ), mbFormDesignModeToReset( false ) { @@ -1352,14 +1247,14 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh): { // setze die akt. Seite als die erste sal_uInt16 nPhysPg, nVirtPg; - ((SwCrsrShell*)pVS)->GetPageNum( nPhysPg, nVirtPg, /*sal_False*/sal_True, sal_False ); + ((SwCrsrShell*)pVS)->GetPageNum( nPhysPg, nVirtPg, sal_True, sal_False ); if( 1 != aViewWin.GetCol() && 1 == nPhysPg ) --nPhysPg; aViewWin.SetSttPage( nPhysPg ); } } - // OD 09.01.2003 #106334# - for form shell remember design mode of draw view + // for form shell remember design mode of draw view // of previous view shell if ( pVS && pVS->HasDrawView() ) { @@ -1379,13 +1274,7 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh): Init(); } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - SwPagePreView::~SwPagePreView() +SwPagePreView::~SwPagePreView() { SetWindow( 0 ); @@ -1395,39 +1284,19 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh): delete pPageUpBtn; delete pPageDownBtn; -/* SfxObjectShell* pDocSh = GetDocShell(); - for( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocSh ); - pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pDocSh ) ) - if( pFrame != GetViewFrame() ) - { - // es gibt noch eine weitere Sicht auf unser Dokument, also - // aktiviere dieses - pFrame->GetFrame().Appear(); - break; - } -*/} - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - +} SwDocShell* SwPagePreView::GetDocShell() { return PTR_CAST(SwDocShell, GetViewFrame()->GetObjectShell()); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - int SwPagePreView::_CreateScrollbar( sal_Bool bHori ) { Window *pMDI = &GetViewFrame()->GetWindow(); SwScrollbar** ppScrollbar = bHori ? &pHScrollbar : &pVScrollbar; - ASSERT( !*ppScrollbar, "vorher abpruefen!" ) + OSL_ENSURE( !*ppScrollbar, "vorher abpruefen!" ); if( !bHori ) { @@ -1457,33 +1326,18 @@ int SwPagePreView::_CreateScrollbar( sal_Bool bHori ) return 1; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - /* * Button-Handler */ IMPL_LINK_INLINE_START( SwPagePreView, BtnPage, Button *, pButton ) { - // OD 04.03.2003 #107369# - use new helper method to perform page up + // use new helper method to perform page up // respectively page down. _ExecPgUpAndPgDown( pButton == pPageUpBtn ); return 0; } IMPL_LINK_INLINE_END( SwPagePreView, BtnPage, Button *, pButton ) -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - int SwPagePreView::ChgPage( int eMvMode, int bUpdateScrollbar ) { Rectangle aPixVisArea( aViewWin.LogicToPixel( aVisArea ) ); @@ -1503,7 +1357,7 @@ int SwPagePreView::ChgPage( int eMvMode, int bUpdateScrollbar ) { ScrollViewSzChg(); - static sal_uInt16 __READONLY_DATA aInval[] = + static sal_uInt16 aInval[] = { FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN, 0 @@ -1515,21 +1369,11 @@ int SwPagePreView::ChgPage( int eMvMode, int bUpdateScrollbar ) return bChg; } - -/* */ -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - // ab hier alles aus der SwView uebernommen - - void SwPagePreView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*/ ) { -// const long nAdd = bInner ? 0 : ScrollBar::GetWindowOverlapPixel(); const StyleSettings &rSet = aViewWin.GetSettings().GetStyleSettings(); - const long nTmp = rSet.GetScrollBarSize();// - nAdd; + const long nTmp = rSet.GetScrollBarSize(); if ( pVScrollbar->IsVisible( sal_False )) rToFill.Right() = nTmp; if ( pHScrollbar->IsVisible( sal_False ) ) @@ -1537,11 +1381,6 @@ void SwPagePreView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner* SetBorderPixel( rToFill ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwPagePreView::InnerResizePixel( const Point &rOfst, const Size &rSize ) { SvBorder aBorder; @@ -1558,11 +1397,6 @@ void SwPagePreView::InnerResizePixel( const Point &rOfst, const Size &rSize ) //VisArea niemals einstellen! } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwPagePreView::OuterResizePixel( const Point &rOfst, const Size &rSize ) { SvBorder aBorder; @@ -1586,11 +1420,6 @@ void SwPagePreView::OuterResizePixel( const Point &rOfst, const Size &rSize ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwPagePreView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollbar ) { const Point aTopLeft(AlignToPixel(rRect.TopLeft())); @@ -1615,7 +1444,7 @@ void SwPagePreView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollba if(aLR.Right() < 0) aLR.Right() = 0; if(aLR.Bottom() < 0) aLR.Bottom() = 0; if(aLR == aVisArea || - // JP 29.10.97: Bug 45173 - Leeres Rechteck nicht beachten + // Leeres Rechteck nicht beachten ( 0 == aLR.Bottom() - aLR.Top() && 0 == aLR.Right() - aLR.Left() ) ) return; @@ -1634,17 +1463,11 @@ void SwPagePreView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollba // setze am View-Win die aktuelle Size aVisArea = aLR; aViewWin.SetWinSize( aLR.GetSize() ); - // OD 18.12.2002 #103492# - use new mode ChgPage( SwPagePreViewWin::MV_NEWWINSIZE, bUpdateScrollbar ); aViewWin.Invalidate(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - IMPL_LINK( SwPagePreView, ScrollHdl, SwScrollbar *, pScrollbar ) { if(!GetViewShell()) @@ -1663,7 +1486,6 @@ IMPL_LINK( SwPagePreView, ScrollHdl, SwScrollbar *, pScrollbar ) Point aPos = pScrollbar->GetParent()->OutputToScreenPixel( pScrollbar->GetPosPixel()); aPos.Y() = pScrollbar->OutputToScreenPixel(pScrollbar->GetPointerPosPixel()).Y(); - Size aSize = pScrollbar->GetSizePixel(); Rectangle aRect; aRect.Left() = aPos.X() -8; aRect.Right() = aRect.Left(); @@ -1679,17 +1501,12 @@ IMPL_LINK( SwPagePreView, ScrollHdl, SwScrollbar *, pScrollbar ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar ) { if(!GetViewShell()) return 0; - // OD 04.03.2003 #107369# - boolean to avoid unnecessary invalidation of the window. + // boolean to avoid unnecessary invalidation of the window. bool bInvalidateWin = true; if( !pScrollbar->IsHoriScroll() ) // scroll vertically @@ -1700,33 +1517,33 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar ) { // wieviele Seiten scrollen ?? sal_uInt16 nThmbPos = (sal_uInt16)pScrollbar->GetThumbPos(); - // OD 05.12.2002 #103492# - adjust to new preview functionality + // adjust to new preview functionality if( nThmbPos != aViewWin.SelectedPage() ) { - // OD 17.01.2003 #103492# - consider case that page <nThmbPos> + // consider case that page <nThmbPos> // is already visible SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout(); if ( pPagePrevwLay->IsPageVisible( nThmbPos ) ) { pPagePrevwLay->MarkNewSelectedPage( nThmbPos ); - // OD 04.03.2003 #107369# - invalidation of window is unnecessary + // invalidation of window is unnecessary bInvalidateWin = false; } else { - // OD 17.01.2003 #103492# - consider whether layout columns + // consider whether layout columns // fit or not. if ( !pPagePrevwLay->DoesPreviewLayoutColsFitIntoWindow() ) { aViewWin.SetSttPage( nThmbPos ); aViewWin.SetSelectedPage( nThmbPos ); ChgPage( SwPagePreViewWin::MV_SCROLL, sal_False ); - // OD 20.01.2003 #103492# - update scrollbars + // update scrollbars ScrollViewSzChg(); } else { - // OD 04.03.2003 #107369# - correct scroll amount + // correct scroll amount const sal_Int16 nPageDiff = nThmbPos - aViewWin.SelectedPage(); const sal_uInt16 nVisPages = aViewWin.GetRow() * aViewWin.GetCol(); sal_Int16 nWinPagesToScroll = nPageDiff / nVisPages; @@ -1739,12 +1556,12 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar ) aViewWin.Scroll( 0, pPagePrevwLay->GetWinPagesScrollAmount( nWinPagesToScroll ) ); } } - // OD 17.01.2003 #103492# - update accessibility + // update accessibility GetViewShell()->ShowPreViewSelection( nThmbPos ); } else { - // OD 04.03.2003 #107369# - invalidation of window is unnecessary + // invalidation of window is unnecessary bInvalidateWin = false; } } @@ -1759,36 +1576,27 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar ) long nThmbPos = pScrollbar->GetThumbPos(); aViewWin.Scroll(nThmbPos - aViewWin.GetPaintedPreviewDocRect().Left(), 0); } - // OD 24.03.2003 #108282# - additional invalidate page status. - static sal_uInt16 __READONLY_DATA aInval[] = + // additional invalidate page status. + static sal_uInt16 aInval[] = { FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN, FN_STAT_PAGE, 0 }; SfxBindings& rBindings = GetViewFrame()->GetBindings(); rBindings.Invalidate( aInval ); - // OD 04.03.2003 #107369# - control invalidation of window + // control invalidation of window if ( bInvalidateWin ) { aViewWin.Invalidate(); } return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - Point SwPagePreView::AlignToPixel(const Point &rPt) const { return aViewWin.PixelToLogic( aViewWin.LogicToPixel( rPt ) ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwPagePreView::DocSzChgd( const Size &rSz ) { if( aDocSz == rSz ) @@ -1796,7 +1604,7 @@ void SwPagePreView::DocSzChgd( const Size &rSz ) aDocSz = rSz; - // --> OD 2009-08-20 #i96726# + // #i96726# // Due to the multiple page layout it is needed to trigger recalculation // of the page preview layout, even if the count of pages is not changing. mnPageCount = GetViewShell()->GetNumPages(); @@ -1808,14 +1616,8 @@ void SwPagePreView::DocSzChgd( const Size &rSz ) aViewWin.Invalidate(); } - // <-- } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwPagePreView::ScrollViewSzChg() { if(!GetViewShell()) @@ -1825,10 +1627,10 @@ void SwPagePreView::ScrollViewSzChg() if(GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow()) { //vertical scrolling by row - // OD 04.12.2002 #103492# - adjust to new preview functionality + // adjust to new preview functionality sal_uInt16 nVisPages = aViewWin.GetRow() * aViewWin.GetCol(); pVScrollbar->SetVisibleSize( nVisPages ); - // OD 19.02.2003 #107369# - set selected page as scroll bar position, + // set selected page as scroll bar position, // if it is visible. SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout(); if ( pPagePrevwLay->IsPageVisible( aViewWin.SelectedPage() ) ) @@ -1845,7 +1647,7 @@ void SwPagePreView::ScrollViewSzChg() Range aScrollbarRange( 1, mnPageCount ); // increase range by one, because left-top-corner is left blank. ++aScrollbarRange.Max(); - // OD 17.01.2003 #103492# - increase range in order to access all pages + // increase range in order to access all pages aScrollbarRange.Max() += ( nVisPages - 1 ); pVScrollbar->SetRange( aScrollbarRange ); } @@ -1885,35 +1687,17 @@ void SwPagePreView::ScrollViewSzChg() } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwPagePreView::ScrollDocSzChg() { ScrollViewSzChg(); } - -/* */ -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - // alles zum Thema Drucken - SfxPrinter* SwPagePreView::GetPrinter( sal_Bool bCreate ) { return aViewWin.GetViewShell()->getIDocumentDeviceAccess()->getPrinter( bCreate ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags, bool ) { ViewShell &rSh = *GetViewShell(); @@ -1948,16 +1732,16 @@ sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags, rESh.SetModified(); rESh.EndAllAction(); - static sal_uInt16 __READONLY_DATA aInval[] = + static sal_uInt16 aInval[] = { SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE, SID_RULER_BORDERS, SID_RULER_PAGE_POS, 0 }; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 { const sal_uInt16* pPtr = aInval + 1; do { - ASSERT( *(pPtr - 1) < *pPtr, "falsche Sortierung!" ); + OSL_ENSURE( *(pPtr - 1) < *pPtr, "wrong sorting!" ); } while( *++pPtr ); } #endif @@ -1968,58 +1752,18 @@ sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags, return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SfxTabPage* SwPagePreView::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ) { return ::CreatePrintOptionsPage( pParent, rOptions, !bNormalPrint ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - -// OD 18.12.2002 #103492# - no longer needed ?? Size SwPagePreView::GetOptimalSizePixel() const { - ASSERT( false, "overloaded virtual method <SwPagePreView::GetOptimalSizePixel()> needed ??" ) + OSL_ENSURE( false, "overloaded virtual method <SwPagePreView::GetOptimalSizePixel()> needed ??" ); return Size( -1, -1 ); -/* - //JP 09.06.99: was wird hier errechnet ????? -// ALT: -// SfxApplicationWindow* pWin = SFX_APPWINDOW ; -// Rectangle aRect = pWin->GetClientAreaPixel(); - - Window& rWin = GetViewFrame()->GetWindow(); - Rectangle aRect( Point(0, 0), rWin.GetOutputSizePixel() ); - Size aMaxSize( aRect.GetWidth(), aRect.GetHeight() ); - Size aInSize = rWin.GetOutputSizePixel(); - Size aOutSize = rWin.GetSizePixel(); - sal_uInt16 nXBorder = sal_uInt16(aOutSize.Width() - aInSize.Width()); - sal_uInt16 nYBorder = sal_uInt16(aOutSize.Height() - aInSize.Height()); - aMaxSize.Width() -= nXBorder; - //'auf Verdacht' etwas vom Border abziehen (Menue) - nYBorder -= (nYBorder - nXBorder) / 2; - aMaxSize.Height() -= nYBorder; - //mit der max. moeglichen Outputsize guenstigstes Verhaeltnis ausrechnen - aViewWin.GetOptimalSize(aMaxSize); - // Border wieder dazuzaehlen - aMaxSize.Height() += nYBorder; - aMaxSize.Width() += nXBorder; - return aMaxSize; -*/ } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -// OD 12.12.2002 #103492# void SwPagePreViewWin::SetViewShell( ViewShell* pShell ) { mpViewShell = pShell; @@ -2031,7 +1775,7 @@ void SwPagePreViewWin::SetViewShell( ViewShell* pShell ) void SwPagePreViewWin::RepaintCoreRect( const SwRect& rRect ) { - // OD 2004-03-04 #i24183# + // #i24183# if ( mpPgPrevwLayout->PreviewLayoutValid() ) { mpPgPrevwLayout->Repaint( Rectangle( rRect.Pos(), rRect.SSize() ) ); @@ -2040,13 +1784,12 @@ void SwPagePreViewWin::RepaintCoreRect( const SwRect& rRect ) /** method to adjust preview to a new zoom factor - OD 02.12.2002 #103492# - OD 24.09.2003 #i19975# - also consider zoom type - adding parameter <_eZoomType> + #i19975# also consider zoom type - adding parameter <_eZoomType> */ void SwPagePreViewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor, const SvxZoomType _eZoomType ) { - // OD 24.09.2003 #i19975# - consider zoom type + // #i19975# consider zoom type if ( _eZoomType == SVX_ZOOM_WHOLEPAGE ) { mnRow = 1; @@ -2081,11 +1824,12 @@ void SwPagePreViewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor, } } -/* -----------------04.12.2002 10:46----------------- + +/** * pixel scrolling - horizontally always or vertically * when less than the desired number of rows fits into * the view - * --------------------------------------------------*/ + */ void SwPagePreViewWin::Scroll(long nXMove, long nYMove, sal_uInt16 /*nFlags*/) { maPaintedPreviewDocRect.Move(nXMove, nYMove); @@ -2126,50 +1870,37 @@ sal_Bool SwPagePreView::HandleWheelCommands( const CommandEvent& rCEvt ) return bOk; } - uno::Reference< ::com::sun::star::accessibility::XAccessible > SwPagePreViewWin::CreateAccessible() { - vos::OGuard aGuard(Application::GetSolarMutex()); // this should have - // happend already!!! + SolarMutexGuard aGuard; // this should have happend already!!! - DBG_ASSERT( GetViewShell() != NULL, "We need a view shell" ); + OSL_ENSURE( GetViewShell() != NULL, "We need a view shell" ); return GetViewShell()->CreateAccessiblePreview(); } -/* -----------------------------06.05.2002 13:18------------------------------ - - ---------------------------------------------------------------------------*/ void SwPagePreView::ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions) { GetViewShell()->ApplyAccessiblityOptions(rAccessibilityOptions); } -/* -----------------------------2002/06/26 14:30------------------------------ - ---------------------------------------------------------------------------*/ void SwPagePreView::ShowHScrollbar(sal_Bool bShow) { pHScrollbar->Show(bShow); InvalidateBorder(); } -/* -----------------------------2002/06/26 14:30------------------------------ - - ---------------------------------------------------------------------------*/ void SwPagePreView::ShowVScrollbar(sal_Bool bShow) { pVScrollbar->Show(bShow); InvalidateBorder(); } -/* -----------------25.11.2002 16:36----------------- - * - * --------------------------------------------------*/ void SwPagePreView::SetZoom(SvxZoomType eType, sal_uInt16 nFactor) { ViewShell& rSh = *GetViewShell(); SwViewOption aOpt(*rSh.GetViewOptions()); - // OD 16.12.2002 #103492# - perform action only on changes of zoom or zoom type. + // perform action only on changes of zoom or zoom type. if ( aOpt.GetZoom() != nFactor || aOpt.GetZoomType() != eType ) { @@ -2177,8 +1908,7 @@ void SwPagePreView::SetZoom(SvxZoomType eType, sal_uInt16 nFactor) aOpt.SetZoomType(eType); rSh.ApplyViewOptions( aOpt ); lcl_InvalidateZoomSlots(GetViewFrame()->GetBindings()); - // OD 02.12.2002 #103492# - // OD 24.09.2003 #i19975# - also consider zoom type + // #i19975# also consider zoom type aViewWin.AdjustPreviewToNewZoom( nFactor, eType ); ScrollViewSzChg(); } @@ -2186,8 +1916,6 @@ void SwPagePreView::SetZoom(SvxZoomType eType, sal_uInt16 nFactor) /** adjust position of vertical scrollbar - OD 19.02.2003 #107369 - @author OD */ void SwPagePreView::SetVScrollbarThumbPos( const sal_uInt16 _nNewThumbPos ) @@ -2197,3 +1925,5 @@ void SwPagePreView::SetVScrollbarThumbPos( const sal_uInt16 _nNewThumbPos ) pVScrollbar->SetThumbPos( _nNewThumbPos ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/pview.src b/sw/source/ui/uiview/pview.src index 99b325b3ce..0cfd2b1ec0 100644 --- a/sw/source/ui/uiview/pview.src +++ b/sw/source/ui/uiview/pview.src @@ -29,7 +29,6 @@ #include "pview.hrc" #include "helpid.h" #include "cmdid.h" - ModalDialog DLG_PAGEPREVIEW_ZOOM { HelpID = HID_PPREV_ZOOM ; diff --git a/sw/source/ui/uiview/scroll.cxx b/sw/source/ui/uiview/scroll.cxx index b1e5b19e7a..2589dc09d4 100644 --- a/sw/source/ui/uiview/scroll.cxx +++ b/sw/source/ui/uiview/scroll.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - #include "swtypes.hxx" #include "swrect.hxx" #include "scroll.hxx" @@ -65,7 +64,6 @@ void SwScrollbar::DocSzChgd( const Size &rSize ) SetRange( Range( 0, bHori ? rSize.Width() : rSize.Height()) ); const sal_uLong nVisSize = GetVisibleSize(); SetLineSize( SCROLL_LINE_SIZE ); -// SetLineSize( nVisSize * 10 / 100 ); SetPageSize( nVisSize * 77 / 100 ); } @@ -97,9 +95,6 @@ void SwScrollbar::ViewPortChgd( const Rectangle &rRect ) AutoShow(); } -/*-----------------10/21/97 02:48pm----------------- - ---------------------------------------------------*/ void SwScrollbar::ExtendedShow( sal_Bool bSet ) { bVisible = bSet; @@ -107,9 +102,6 @@ void SwScrollbar::ExtendedShow( sal_Bool bSet ) ScrollBar::Show(bSet); } -/*-----------------10/21/97 03:23pm----------------- - ---------------------------------------------------*/ void SwScrollbar::SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ) { ScrollBar::SetPosSizePixel(rNewPos, rNewSize); @@ -119,10 +111,6 @@ void SwScrollbar::SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ) } - -/*-----------------14.04.98 11:38------------------- - ---------------------------------------------------*/ void SwScrollbar::SetAuto(sal_Bool bSet) { if(bAuto != bSet) @@ -136,14 +124,11 @@ void SwScrollbar::SetAuto(sal_Bool bSet) AutoShow(); // oder automatisch verstecken } } -/*-----------------14.04.98 11:43------------------- ---------------------------------------------------*/ void SwScrollbar::AutoShow() { long nVis = GetVisibleSize(); long nLen = GetRange().Len(); - { if( nVis >= nLen - 1) { if(ScrollBar::IsVisible()) @@ -156,5 +141,6 @@ void SwScrollbar::AutoShow() { ScrollBar::Show(sal_True); } - } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index 880574ea65..5ac3120a30 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -137,11 +138,6 @@ SFX_IMPL_INTERFACE( SwSrcView, SfxViewShell, SW_RES(0) ) TYPEINIT1(SwSrcView, SfxViewShell) -/*-----------------18.11.96 08.05------------------- - ---------------------------------------------------*/ - - void lcl_PrintHeader( OutputDevice &rOutDev, sal_uInt16 nPages, sal_uInt16 nCurPage, const String& rTitle ) { short nLeftMargin = LMARGPRN; @@ -195,9 +191,7 @@ void lcl_PrintHeader( OutputDevice &rOutDev, sal_uInt16 nPages, sal_uInt16 nCurP rOutDev.SetFont( aOldFont ); rOutDev.SetFillColor( aOldFillColor ); } -/* -----------------13.11.2003 16:24----------------- - --------------------------------------------------*/ rtl_TextEncoding lcl_GetStreamCharSet(rtl_TextEncoding eLoadEncoding) { rtl_TextEncoding eRet = eLoadEncoding; @@ -210,9 +204,6 @@ rtl_TextEncoding lcl_GetStreamCharSet(rtl_TextEncoding eLoadEncoding) } return eRet; } -/*-----------------18.11.96 08.21------------------- - ---------------------------------------------------*/ void lcl_ConvertTabsToSpaces( String& rLine ) { @@ -236,11 +227,6 @@ void lcl_ConvertTabsToSpaces( String& rLine ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwSrcView::SwSrcView(SfxViewFrame* pViewFrame, SfxViewShell*) : SfxViewShell( pViewFrame, SWSRCVIEWFLAGS ), aEditWin( &pViewFrame->GetWindow(), this ), @@ -251,15 +237,10 @@ SwSrcView::SwSrcView(SfxViewFrame* pViewFrame, SfxViewShell*) : Init(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwSrcView::~SwSrcView() { SwDocShell* pDocShell = GetDocShell(); - DBG_ASSERT(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?"); + OSL_ENSURE(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?"); const TextSelection& rSel = aEditWin.GetTextView()->GetSelection(); ((SwWebDocShell*)pDocShell)->SetSourcePara( static_cast< sal_uInt16 >( rSel.GetStart().GetPara() ) ); @@ -270,27 +251,18 @@ SwSrcView::~SwSrcView() ::rtl::OUString url = xDocProps->getAutoloadURL(); sal_Int32 delay = xDocProps->getAutoloadSecs(); pDocShell->SetAutoLoad(INetURLObject(url), delay, - (delay != 0) || !url.equalsAscii("")); -// EndListening(*GetViewFrame()); + (delay != 0) || url.getLength()); EndListening(*pDocShell); delete pSearchItem; } -/*-----------------24.04.97 10:37------------------- - ---------------------------------------------------*/ void SwSrcView::SaveContentTo(SfxMedium& rMed) { SvStream* pOutStream = rMed.GetOutStream(); pOutStream->SetStreamCharSet(lcl_GetStreamCharSet(eLoadEncoding)); - aEditWin.Write( *pOutStream );//, EE_FORMAT_TEXT); + aEditWin.Write( *pOutStream ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwSrcView::Init() { SetHelpId(SW_SRC_VIEWSHELL); @@ -306,39 +278,24 @@ void SwSrcView::Init() aEditWin.SetReadonly(sal_True); } -// StartListening(*GetViewFrame()); StartListening(*pDocShell,sal_True); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwDocShell* SwSrcView::GetDocShell() { SfxObjectShell* pObjShell = GetViewFrame()->GetObjectShell(); return PTR_CAST(SwDocShell, pObjShell); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwSrcView::SaveContent(const String& rTmpFile) { SfxMedium aMedium( rTmpFile, STREAM_WRITE, sal_True); SvStream* pOutStream = aMedium.GetOutStream(); pOutStream->SetStreamCharSet( lcl_GetStreamCharSet(eLoadEncoding) ); - aEditWin.Write(*pOutStream);//, EE_FORMAT_TEXT); + aEditWin.Write(*pOutStream); aMedium.Commit(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwSrcView::Execute(SfxRequest& rReq) { sal_uInt16 nSlot = rReq.GetSlot(); @@ -353,7 +310,6 @@ void SwSrcView::Execute(SfxRequest& rReq) TemplateDescription::FILESAVE_AUTOEXTENSION, TemplateDescription::FILESAVE_SIMPLE ); uno::Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker(); -// pFileDlg->SetHelpId(HID_FILEDLG_SRCVIEW); uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY); // search for an html filter for export @@ -421,7 +377,7 @@ void SwSrcView::Execute(SfxRequest& rReq) const SfxItemSet* pTmpArgs = rReq.GetArgs(); sal_uInt16 nWhich = pTmpArgs->GetWhichByPos( 0 ); - DBG_ASSERT( nWhich, "Wich fuer SearchItem ?" ); + OSL_ENSURE( nWhich, "Wich fuer SearchItem ?" ); const SfxPoolItem& rItem = pTmpArgs->Get( nWhich ); SetSearchItem( (const SvxSearchItem&)rItem); StartSearchAndReplace( (const SvxSearchItem&)rItem, sal_False, rReq.IsAPI() ); @@ -474,11 +430,6 @@ void SwSrcView::Execute(SfxRequest& rReq) aEditWin.Invalidate(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwSrcView::GetState(SfxItemSet& rSet) { SfxWhichIter aIter(rSet); @@ -608,11 +559,6 @@ void SwSrcView::GetState(SfxItemSet& rSet) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SvxSearchItem* SwSrcView::GetSearchItem() { if(!pSearchItem) @@ -622,22 +568,12 @@ SvxSearchItem* SwSrcView::GetSearchItem() return pSearchItem; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwSrcView::SetSearchItem( const SvxSearchItem& rItem ) { delete pSearchItem; pSearchItem = (SvxSearchItem*)rItem.Clone(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - sal_uInt16 SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem, sal_Bool bFromStart, sal_Bool bApi, @@ -720,10 +656,6 @@ sal_uInt16 SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem, return nFound; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uInt16 SwSrcView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool ) { SwDocShell* pDocSh = GetDocShell(); @@ -745,18 +677,11 @@ sal_uInt16 SwSrcView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SfxPrinter* SwSrcView::GetPrinter( sal_Bool bCreate ) { return GetDocShell()->GetDoc()->getPrinter( bCreate ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ sal_Int32 SwSrcView::PrintSource( OutputDevice *pOutDev, sal_Int32 nPage, @@ -827,16 +752,10 @@ sal_Int32 SwSrcView::PrintSource( pOutDev->Pop(); - DBG_ASSERT( bCalcNumPagesOnly || nPage <= nCurPage, "page number out of range" ); + OSL_ENSURE( bCalcNumPagesOnly || nPage <= nCurPage, "page number out of range" ); return nCurPage; } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwSrcView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { if ( rHint.ISA(SfxSimpleHint) && @@ -857,9 +776,6 @@ void SwSrcView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SfxViewShell::Notify(rBC, rHint); } -/*-----------------19.04.97 10:19------------------- - ---------------------------------------------------*/ void SwSrcView::Load(SwDocShell* pDocShell) { SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get(); @@ -898,7 +814,7 @@ void SwSrcView::Load(SwDocShell* pDocShell) pStream->Seek(0); TextEngine* pTextEngine = aEditWin.GetTextEngine(); pTextEngine->EnableUndo(sal_False); - aEditWin.Read(*pStream);//, EE_FORMAT_TEXT); + aEditWin.Read(*pStream); pTextEngine->EnableUndo(sal_True); } else @@ -934,7 +850,7 @@ void SwSrcView::Load(SwDocShell* pDocShell) pInStream->SetStreamCharSet( eDestEnc ); - aEditWin.Read(*pInStream);//, EE_FORMAT_TEXT); + aEditWin.Read(*pInStream); } } aEditWin.ClearModifyFlag(); @@ -945,7 +861,7 @@ void SwSrcView::Load(SwDocShell* pDocShell) pDocShell->SetModified();// das Flag wird zwischendurch zurueckgesetzt // AutoLoad abschalten pDocShell->SetAutoLoad(INetURLObject(), 0, sal_False); - DBG_ASSERT(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?"); + OSL_ENSURE(PTR_CAST(SwWebDocShell, pDocShell), "Wieso keine WebDocShell?"); sal_uInt16 nLine = ((SwWebDocShell*)pDocShell)->GetSourcePara(); aEditWin.SetStartLine(nLine); aEditWin.GetTextEngine()->ResetUndo(); @@ -953,3 +869,4 @@ void SwSrcView::Load(SwDocShell* pDocShell) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/swcli.cxx b/sw/source/ui/uiview/swcli.cxx index 53aabc5171..344c9bb680 100644 --- a/sw/source/ui/uiview/swcli.cxx +++ b/sw/source/ui/uiview/swcli.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,7 +30,6 @@ #include "precompiled_sw.hxx" #include <com/sun/star/embed/NoVisualAreaSizeException.hpp> - #include <wrtsh.hxx> #include <doc.hxx> #include <swtypes.hxx> @@ -142,8 +142,8 @@ void SwOleClient::ViewChanged() Size aVisSize( aSz.Width, aSz.Height ); - // Bug 24833: solange keine vernuenftige Size vom Object kommt, - // kann nichts skaliert werden + // solange keine vernuenftige Size vom Object kommt, + // kann nichts skaliert werden if( !aVisSize.Width() || !aVisSize.Height() ) return; @@ -171,7 +171,6 @@ void SwOleClient::MakeVisible() rSh.MakeObjVisible( GetObject() ); } -// --> #i972# void SwOleClient::FormatChanged() { const uno::Reference < embed::XEmbeddedObject >& xObj( GetObject() ); @@ -183,5 +182,5 @@ void SwOleClient::FormatChanged() rWrtSh.AlignFormulaToBaseline( xObj ); } } -// <-- +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/uivwimp.cxx b/sw/source/ui/uiview/uivwimp.cxx index ecb0e5e164..0563c27af6 100644 --- a/sw/source/ui/uiview/uivwimp.cxx +++ b/sw/source/ui/uiview/uivwimp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <cmdid.h> #include "globals.hrc" @@ -38,7 +38,7 @@ #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> #include <vcl/msgbox.hxx> @@ -58,16 +58,12 @@ #include <view.hrc> - using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::scanner; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::datatransfer::clipboard; -/* -----------------02.06.98 15:31------------------- - * - * --------------------------------------------------*/ SwView_Impl::SwView_Impl(SwView* pShell) : pxXTextView(new uno::Reference<view::XSelectionSupplier>), pView(pShell), @@ -84,9 +80,6 @@ SwView_Impl::SwView_Impl(SwView* pShell) : xDisProvInterceptor = new SwXDispatchProviderInterceptor(*pView); } -/*-----------------13.12.97 09:51------------------- - ---------------------------------------------------*/ SwView_Impl::~SwView_Impl() { Reference<XUnoTunnel> xDispTunnel(xDisProvInterceptor, UNO_QUERY); @@ -114,31 +107,22 @@ SwView_Impl::~SwView_Impl() delete m_pRequest; } -/*-----------------13.12.97 09:54------------------- - ---------------------------------------------------*/ void SwView_Impl::SetShellMode(ShellModes eSet) { eShellMode = eSet; } -/*-----------------13.12.97 09:59------------------- ---------------------------------------------------*/ view::XSelectionSupplier* SwView_Impl::GetUNOObject() { return pxXTextView->get(); } -/* -----------------02.06.98 15:29------------------- - * - * --------------------------------------------------*/ + SwXTextView* SwView_Impl::GetUNOObject_Impl() { view::XSelectionSupplier* pTextView = pxXTextView->get(); return ((SwXTextView*)pTextView); } -/* -----------------------------29.05.00 09:04-------------------------------- - ---------------------------------------------------------------------------*/ void SwView_Impl::ExecuteScan( SfxRequest& rReq ) { sal_uInt16 nSlot = rReq.GetSlot(); @@ -172,8 +156,6 @@ void SwView_Impl::ExecuteScan( SfxRequest& rReq ) else { rReq.Ignore(); -// KA 04.07.2002 -// InfoBox( 0, SW_RES(MSG_SCAN_NOSOURCE) ).Execute(); } } break; @@ -218,9 +200,6 @@ void SwView_Impl::ExecuteScan( SfxRequest& rReq ) } } -/* -----------------------------29.05.00 08:26-------------------------------- - - ---------------------------------------------------------------------------*/ SwScannerEventListener& SwView_Impl::GetScannerEventListener() { if(!xScanEvtLstnr.is()) @@ -228,7 +207,6 @@ SwScannerEventListener& SwView_Impl::GetScannerEventListener() return *pScanEvtLstnr; } - void SwView_Impl::AddClipboardListener() { if(!xClipEvtLstnr.is()) @@ -237,9 +215,7 @@ void SwView_Impl::AddClipboardListener() pClipEvtLstnr->AddRemoveListener( sal_True ); } } -/* -----------------3/31/2003 11:42AM---------------- - --------------------------------------------------*/ void SwView_Impl::Invalidate() { GetUNOObject_Impl()->Invalidate(); @@ -254,9 +230,7 @@ void SwView_Impl::Invalidate() pTransferable->Invalidate(); } } -/* -----------------3/31/2003 12:40PM---------------- - --------------------------------------------------*/ void SwView_Impl::AddTransferable(SwTransferable& rTransferable) { //prevent removing of the non-referenced SwTransferable @@ -285,23 +259,19 @@ void SwView_Impl::InitRequest( const SfxRequest& rRequest ) m_pRequest = new SfxRequest( rRequest ); } -// ------------------------- SwScannerEventListener --------------------- - SwScannerEventListener::~SwScannerEventListener() { } void SAL_CALL SwScannerEventListener::disposing( const EventObject& rEventObject) throw(uno::RuntimeException) { - vos::OGuard aGuard(Application::GetSolarMutex()); #if defined WNT || defined UNX + SolarMutexGuard aGuard; if( pView ) pView->ScannerEventHdl( rEventObject ); #endif } -// ------------------------- SwClipboardChangeListener --------------------- - SwClipboardChangeListener::~SwClipboardChangeListener() { } @@ -315,7 +285,7 @@ void SAL_CALL SwClipboardChangeListener::changedContents( const CLIP_NMSPC::Clip throw ( RuntimeException ) { - const ::vos::OGuard aGuard( Application::GetSolarMutex() ); + const SolarMutexGuard aGuard; if( pView ) { { @@ -343,3 +313,4 @@ void SwClipboardChangeListener::AddRemoveListener( sal_Bool bAdd ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 0666533454..36c1d96082 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -28,8 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -#include <string> // HACK: prevent conflict between STLPORT and Workshop headers +#include <string> #include <stdlib.h> #include <hintids.hxx> #include <rtl/logfile.hxx> @@ -72,6 +72,7 @@ #include <drformsh.hxx> #include <drwtxtsh.hxx> #include <beziersh.hxx> +#include <navsh.hxx> #include <globdoc.hxx> #include <scroll.hxx> #include <navipi.hxx> @@ -95,7 +96,6 @@ #include <prtopt.hxx> #include <linguistic/lngprops.hxx> #include <editeng/unolingu.hxx> -//#include <sfx2/app.hxx> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/scanner/ScannerContext.hpp> #include <com/sun/star/scanner/XScannerManager.hpp> @@ -114,6 +114,7 @@ #include <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> +#include <svl/cjkoptions.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -122,7 +123,6 @@ using namespace ::com::sun::star::scanner; using ::rtl::OUString; using ::rtl::OUStringBuffer; - extern sal_Bool bNoInterrupt; // in mainwn.cxx #define SWVIEWFLAGS ( SFX_VIEW_CAN_PRINT| \ @@ -144,26 +144,17 @@ sal_Bool SwView::bExtra = sal_False; sal_Bool SwView::bFound = sal_False; sal_Bool SwView::bJustOpened = sal_False; - SvxSearchDialog* SwView::pSrchDlg = 0; SearchAttrItemList* SwView::pSrchList = 0; SearchAttrItemList* SwView::pReplList = 0; DBG_NAME(viewhdl) -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - inline SfxDispatcher &SwView::GetDispatcher() { return *GetViewFrame()->GetDispatcher(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwView::ImpSetVerb( int nSelType ) { sal_Bool bResetVerbs = bVerbsActive; @@ -191,7 +182,6 @@ void SwView::ImpSetVerb( int nSelType ) Description: called by the SwEditWin when it gets the focus --------------------------------------------------------------------*/ - void SwView::GotFocus() const { // if we got the focus, and the form shell *is* on the top of the dispatcher @@ -222,7 +212,6 @@ void SwView::GotFocus() const a request to put the form shell on the top of the dispatcher stack --------------------------------------------------------------------*/ - IMPL_LINK( SwView, FormControlActivated, FmFormShell*, EMPTYARG ) { // if a form control has been activated, and the form shell is not on the top @@ -262,7 +251,7 @@ void SwView::SelectShell() } pLastTableFormat = pCurTableFmt; - //SEL_TBL und SEL_TBL_CELLS koennen verodert sein! + //SEL_TBL and SEL_TBL_CELLS can be changed! int nNewSelectionType = (pWrtShell->GetSelectionType() & ~nsSelectionType::SEL_TBL_CELLS); @@ -283,7 +272,6 @@ void SwView::SelectShell() SfxDispatcher &rDispatcher = GetDispatcher(); SwToolbarConfigItem *pBarCfg = SW_MOD()->GetToolbarConfig(); - // DELETEZ(pxSelectionObj); //Selektionsobjekt loeschen if ( pShell ) { rDispatcher.Flush(); // alle gecachten Shells wirklich loeschen @@ -331,6 +319,10 @@ void SwView::SelectShell() if ( !( nSelectionType & nsSelectionType::SEL_FOC_FRM_CTRL ) ) rDispatcher.Push( *pFormShell ); + eShellMode = SHELL_MODE_NAVIGATION; + pShell = new SwNavigationShell( *this ); + rDispatcher.Push( *pShell ); + if ( nSelectionType & nsSelectionType::SEL_OLE ) { eShellMode = SHELL_MODE_OBJECT; @@ -470,7 +462,7 @@ void SwView::SelectShell() if ( GetDocShell()->GetDoc()->IsOLEPrtNotifyPending() ) GetDocShell()->GetDoc()->PrtOLENotify( sal_False ); - //jetzt das Tabellen-Update + // now the table-update if(bUpdateTable) pWrtShell->UpdateTable(); @@ -483,8 +475,6 @@ void SwView::SelectShell() //Da wir aber keine Stati mehr liefern koennen und wollen locken wir //stattdessen den Dispatcher. - - extern "C" { int lcl_CmpIds( const void *pFirst, const void *pSecond) @@ -493,8 +483,6 @@ extern "C" } } - - IMPL_LINK( SwView, AttrChangedNotify, SwWrtShell *, EMPTYARG ) { if ( GetEditWin().IsChainMode() ) @@ -506,7 +494,6 @@ IMPL_LINK( SwView, AttrChangedNotify, SwWrtShell *, EMPTYARG ) GetDocShell()->IsReadOnly() ) _CheckReadonlyState(); - // JP 19.01.99: Cursor in Readonly Bereichen if( !pWrtShell->IsPaintLocked() && !bNoInterrupt ) _CheckReadonlySelection(); @@ -534,34 +521,17 @@ IMPL_LINK( SwView, AttrChangedNotify, SwWrtShell *, EMPTYARG ) } - //#i6193#, change ui if cursor is at a SwPostItField + // change ui if cursor is at a SwPostItField if (mpPostItMgr) { - // --> OD 2008-06-19 #i90516# // only perform the code that is needed to determine, if at the // actual cursor position is a post-it field -// SwRect aFldRect; -// SwContentAtPos aCntntAtPos( SwContentAtPos::SW_FIELD); -// if( pWrtShell->GetContentAtPos( pWrtShell->GetCrsrDocPos(), aCntntAtPos, sal_False, &aFldRect ) ) -// { -// const SwField* pFld = aCntntAtPos.aFnd.pFld; -// if (pFld->Which()== RES_POSTITFLD) -// { -// mpPostItMgr->SetShadowState(reinterpret_cast<const SwPostItField*>(pFld)); -// } -// else -// mpPostItMgr->SetShadowState(0); -// } -// else -// mpPostItMgr->SetShadowState(0); mpPostItMgr->SetShadowState( pWrtShell->GetPostItFieldAtCursor() ); } return 0; } - - IMPL_LINK( SwView, TimeoutHdl, Timer *, EMPTYARG ) { DBG_PROFSTART(viewhdl); @@ -599,8 +569,8 @@ void SwView::_CheckReadonlyState() //Um erkennen zu koennen ob bereits disabled ist! SfxItemState eStateRO, eStateProtAll; const SfxPoolItem *pItem; - // JP 29.04.97: von einem nur uns bekannten Slot den Status abfragen. - // Ansonsten kennen andere den Slot; wie z.B. die BasidIde + // von einem nur uns bekannten Slot den Status abfragen. + // Ansonsten kennen andere den Slot; wie z.B. die BasidIde eStateRO = rDis.QueryState( FN_INSERT_BOOKMARK, pItem ); eStateProtAll = rDis.QueryState( FN_EDIT_REGION, pItem ); sal_Bool bChgd = sal_False; @@ -705,7 +675,7 @@ void SwView::_CheckReadonlySelection() case SHELL_MODE_TABLE_TEXT: case SHELL_MODE_TABLE_LIST_TEXT: { -//JP 22.01.99: temporaere Loesung!!! Sollte bei jeder Cursorbewegung +// temporaere Loesung!!! Sollte bei jeder Cursorbewegung // den Font von der akt. Einfuegeposition setzen, also ausserhalb // dieses if's. Aber TH wertet den Font zur Zeit nicht aus und // das besorgen erscheint mir hier zu teuer zu sein. @@ -736,13 +706,12 @@ void SwView::_CheckReadonlySelection() } } - SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) : SfxViewShell( _pFrame, SWVIEWFLAGS ), aPageStr( SW_RES( STR_PAGE )), nNewPage(USHRT_MAX), - pNumRuleNodeFromDoc(0), // #i23726# + pNumRuleNodeFromDoc(0), pEditWin( new SwEditWin( &_pFrame->GetWindow(), *this ) ), pWrtShell(0), pShell(0), @@ -783,7 +752,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) bInDtor(sal_False), bOldShellWasPagePreView(sal_False) { - // OD 18.12.2002 #103492# - According to discussion with MBA and further + // According to discussion with MBA and further // investigations, no old SfxViewShell will be set as parameter <pOldSh>, // if function "New Window" is performed to open an additional view beside // an already existing one. @@ -812,7 +781,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) sal_Bool bOldModifyFlag = pDocSh->IsEnableSetModified(); if(bOldModifyFlag) pDocSh->EnableSetModified( sal_False ); - ASSERT( pDocSh, "View ohne DocShell." ); + OSL_ENSURE( pDocSh, "view without DocShell." ); SwWebDocShell* pWebDShell = PTR_CAST( SwWebDocShell, pDocSh ); const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(0 != pWebDShell); @@ -827,7 +796,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) sal_Bool bOldShellWasSrcView = sal_False; - // OD 18.12.2002 #103492# - determine, if there is an existing view for + // determine if there is an existing view for // document SfxViewShell* pExistingSh = 0; if ( pOldSh ) @@ -882,20 +851,20 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) aUsrPref.SetViewLayoutColumns( 1 ); } pWrtShell = new SwWrtShell( rDoc, pEditWin, *this, &aUsrPref ); - //#97610# creating an SwView from a SwPagePreView needs to + // creating an SwView from a SwPagePreView needs to // add the ViewShell to the ring of the other ViewShell(s) if(bOldShellWasPagePreView) { ViewShell& rPreviewViewShell = *((SwPagePreView*)pExistingSh)->GetViewShell(); pWrtShell->MoveTo(&rPreviewViewShell); - //#95521# to update the field command et.al. if necessary + // to update the field command et.al. if necessary const SwViewOption* pPreViewOpt = rPreviewViewShell.GetViewOptions(); if( pPreViewOpt->IsFldName() != aUsrPref.IsFldName() || pPreViewOpt->IsShowHiddenField() != aUsrPref.IsShowHiddenField() || pPreViewOpt->IsShowHiddenPara() != aUsrPref.IsShowHiddenPara() || pPreViewOpt->IsShowHiddenChar() != aUsrPref.IsShowHiddenChar() ) rPreviewViewShell.ApplyViewOptions(aUsrPref); - // OD 09.01.2003 #106334# - reset design mode at draw view for form + // reset design mode at draw view for form // shell, if needed. if ( ((SwPagePreView*)pExistingSh)->ResetFormDesignMode() && pWrtShell->HasDrawView() ) @@ -907,16 +876,15 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) } RTL_LOGFILE_CONTEXT_TRACE( aLog, "after create WrtShell" ); - // --> OD 2005-02-11 #i38810# - assure that modified state of document + // assure that modified state of document // isn't reset, if document is already modified. const bool bIsDocModified = pWrtShell->GetDoc()->IsModified(); - // <-- - // JP 05.02.99: Bug 61495 - damit unter anderem das HLineal im + // damit unter anderem das HLineal im // ReadonlyFall nicht angezeigt wird aUsrPref.SetReadonly( pWrtShell->GetViewOptions()->IsReadonly() ); - //Kein Margin fuer OLE! + // no margin for OLE! Size aBrwsBorder; if( SFX_CREATE_MODE_EMBEDDED != pDocSh->GetCreateMode() ) aBrwsBorder = GetMargin(); @@ -942,16 +910,20 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) StartListening( *pViewFrame, sal_True ); StartListening( *pDocSh, sal_True ); - // Vom HLineal den ZOOM-Faktor einstellen + // Set Zoom-factor from HLineal Fraction aZoomFract( aUsrPref.GetZoom(), 100 ); pHRuler->SetZoom( aZoomFract ); pVRuler->SetZoom( aZoomFract ); pHRuler->SetDoubleClickHdl(LINK( this, SwView, ExecRulerClick )); FieldUnit eMetric = pUsrPref->GetHScrollMetric(); pHRuler->SetUnit( eMetric ); + eMetric = pUsrPref->GetVScrollMetric(); pVRuler->SetUnit( eMetric ); + pHRuler->SetCharWidth( 371 ); // default character width + pVRuler->SetLineHeight( 551 ); // default line height + // DocShell setzen pDocSh->SetView( this ); SW_MOD()->SetView( this ); @@ -1014,14 +986,13 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) SfxViewFrame* pFirst = SfxViewFrame::GetFirst(pDocSh); // zur Zeit(360) wird die View erst nach dem Ctor eingetragen // der folgende Ausdruck funktioniert auch, wenn sich das aendert - //JP 27.07.98: wenn per Undo nicht mehr die Modifizierung aufhebar ist, + // wenn per Undo nicht mehr die Modifizierung aufhebar ist, // so setze das Modified NICHT zurueck. - // --> OD 2005-02-11 #i38810# - no reset of modified state, if document + // no reset of modified state, if document // was already modified. if (!pWrtShell->GetDoc()->GetIDocumentUndoRedo().IsUndoNoResetModified() && ( !pFirst || pFirst == pVFrame ) && !bIsDocModified ) - // <-- { pWrtShell->ResetModified(); } @@ -1036,15 +1007,10 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) GetDispatcher().Execute(SID_NAVIGATOR, SFX_CALLMODE_ASYNCHRON, &aNavi, 0L); } - - /*uno::Reference< awt::XWindow > aTmpRef; - _pFrame->GetFrame().GetFrameInterface()->setComponent( aTmpRef, - pViewImpl->GetUNOObject_Impl());*/ - - uno::Reference< frame::XFrame > xFrame = pVFrame->GetFrame().GetFrameInterface(); + uno::Reference< frame::XFrame > xFrame = pVFrame->GetFrame().GetFrameInterface(); uno::Reference< frame::XFrame > xBeamerFrame = xFrame->findFrame( - OUString::createFromAscii("_beamer"), frame::FrameSearchFlag::CHILDREN); + OUString(RTL_CONSTASCII_USTRINGPARAM("_beamer")), frame::FrameSearchFlag::CHILDREN); if(xBeamerFrame.is()) { SwDBData aData = pWrtShell->GetDBData(); @@ -1065,19 +1031,19 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) pDocSh->EnableSetModified( sal_True ); InvalidateBorder(); -} - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ + if( !pHScrollbar->IsVisible( sal_True ) ) + ShowHScrollbar( sal_False ); + if( !pVScrollbar->IsVisible( sal_True ) ) + ShowVScrollbar( sal_False ); + GetViewFrame()->GetWindow().AddChildEventListener( LINK( this, SwView, WindowChildEventListener ) ); +} SwView::~SwView() { + GetViewFrame()->GetWindow().RemoveChildEventListener( LINK( this, SwView, WindowChildEventListener ) ); delete mpPostItMgr; - // --> OD 2009-03-10 #i100035# mpPostItMgr = 0; - // <-- bInDtor = sal_True; pEditWin->Hide(); // damit kein Paint Aerger machen kann! @@ -1091,7 +1057,7 @@ SwView::~SwView() if( aTimer.IsActive() && bAttrChgNotifiedWithRegistrations ) GetViewFrame()->GetBindings().LEAVEREGISTRATIONS(); - //JP 27.11.00: Bug 80631 - the last view must end the text edit + // the last view must end the text edit SdrView *pSdrView = pWrtShell ? pWrtShell->GetDrawView() : 0; if( pSdrView && pSdrView->IsTextEdit() ) pSdrView->SdrEndTextEdit( sal_True ); @@ -1122,8 +1088,6 @@ SwView::~SwView() /*-------------------------------------------------------------------- Beschreibung: DocShell rausgrabbeln ueber das FrameWindow --------------------------------------------------------------------*/ - - SwDocShell* SwView::GetDocShell() { SfxObjectShell* pDocShell = GetViewFrame()->GetObjectShell(); @@ -1133,8 +1097,6 @@ SwDocShell* SwView::GetDocShell() /*-------------------------------------------------------------------- Beschreibung: CursorPos merken --------------------------------------------------------------------*/ - - void SwView::WriteUserData( String &rUserData, sal_Bool bBrowse ) { //Das Browse-Flag wird vom Sfx durchgereicht, wenn Dokumente gebrowsed @@ -1163,10 +1125,10 @@ void SwView::WriteUserData( String &rUserData, sal_Bool bBrowse ) rUserData += ';'; rUserData += FRMTYPE_NONE == pWrtShell->GetSelFrmType() ? '0' : '1'; } + /*-------------------------------------------------------------------- Beschreibung: CursorPos setzen --------------------------------------------------------------------*/ -//#i43146# go to the last editing position when opening own files bool lcl_IsOwnDocument( SwView& rView ) { uno::Reference<document::XDocumentPropertiesSupplier> xDPS( @@ -1181,7 +1143,6 @@ bool lcl_IsOwnDocument( SwView& rView ) (!Changed.Len() && Created.Len() && Created == FullName ); } - void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse ) { if ( rUserData.GetTokenCount() > 1 && @@ -1189,7 +1150,6 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse ) //Forward/Backward (!pWrtShell->IsNewLayout() || pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) || bBrowse) ) { - //#i43146# go to the last editing position when opening own files bool bIsOwnDocument = lcl_IsOwnDocument( *this ); SET_CURR_SHELL(pWrtShell); @@ -1230,14 +1190,13 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse ) sal_Bool bSelectObj = (0 != rUserData.GetToken( nOff, ';', nPos ).ToInt32()) && pWrtShell->IsObjSelectable( aCrsrPos ); - //#i33307# restore editing position + // restore editing position pViewImpl->SetRestorePosition(aCrsrPos, bSelectObj); - // OD 11.02.2003 #100556# - set flag value to avoid macro execution. + // set flag value to avoid macro execution. bool bSavedFlagValue = pWrtShell->IsMacroExecAllowed(); pWrtShell->SetMacroExecAllowed( false ); -//!!! pb (11.08.2004): #i32536# // os: changed: The user data has to be read if the view is switched back from page preview -//#i43146# go to the last editing position when opening own files +// go to the last editing position when opening own files if(bOldShellWasPagePreView || bIsOwnDocument) { pWrtShell->SwCrsrShell::SetCrsr( aCrsrPos, !bSelectObj ); @@ -1248,15 +1207,14 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse ) } } - // OD 11.02.2003 #100556# - reset flag value + // reset flag value pWrtShell->SetMacroExecAllowed( bSavedFlagValue ); - // OD 08.04.2003 #108693# - set visible area before applying + // set visible area before applying // information from print preview. Otherwise, the applied information // is lost. -//!!! pb (11.08.2004): #i32536# // os: changed: The user data has to be read if the view is switched back from page preview -//#i43146# go to the last editing position when opening own files +// go to the last editing position when opening own files if(bOldShellWasPagePreView || bIsOwnDocument ) { if ( bBrowse ) @@ -1307,7 +1265,6 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > { if(GetDocShell()->IsPreview()) return; - //#i43146# go to the last editing position when opening own files bool bIsOwnDocument = lcl_IsOwnDocument( *this ); sal_Int32 nLength = rSequence.getLength(); if (nLength && (!pWrtShell->IsNewLayout() || pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) || bBrowse) ) @@ -1326,7 +1283,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > sal_Int16 nViewLayoutColumns = pVOpt->GetViewLayoutColumns(); sal_Bool bSelectedFrame = ( pWrtShell->GetSelFrmType() != FRMTYPE_NONE ), - bGotViewLeft = sal_False, bGotViewTop = sal_False, bGotVisibleLeft = sal_False, + bGotVisibleLeft = sal_False, bGotVisibleTop = sal_False, bGotVisibleRight = sal_False, bGotVisibleBottom = sal_False, bGotZoomType = sal_False, bGotZoomFactor = sal_False, bGotIsSelectedFrame = sal_False, @@ -1338,13 +1295,11 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > { pValue->Value >>= nX; nX = MM100_TO_TWIP( nX ); - bGotViewLeft = sal_True; } else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ViewTop" ) ) ) { pValue->Value >>= nY; nY = MM100_TO_TWIP( nY ); - bGotViewTop = sal_True; } else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "VisibleLeft" ) ) ) { @@ -1420,13 +1375,11 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > sal_Bool bSelectObj = (sal_False != bSelectedFrame ) && pWrtShell->IsObjSelectable( aCrsrPos ); - // OD 11.02.2003 #100556# - set flag value to avoid macro execution. + // set flag value to avoid macro execution. bool bSavedFlagValue = pWrtShell->IsMacroExecAllowed(); pWrtShell->SetMacroExecAllowed( false ); -//!!! pb (11.08.2004): #i32536# // os: changed: The user data has to be read if the view is switched back from page preview -//#i43146# go to the last editing position when opening own files - //#i33307# restore editing position +// go to the last editing position when opening own files pViewImpl->SetRestorePosition(aCrsrPos, bSelectObj); if(bOldShellWasPagePreView|| bIsOwnDocument) { @@ -1438,7 +1391,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > } } - // OD 11.02.2003 #100556# - reset flag value + // reset flag value pWrtShell->SetMacroExecAllowed( bSavedFlagValue ); } SelectShell(); @@ -1459,7 +1412,6 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > bSetViewSettings && eZoom != SVX_ZOOM_PERCENT; - if ( !bZoomNeedsViewLayout ) pWrtShell->StartAction(); @@ -1472,15 +1424,14 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > if ( bSetViewSettings ) SetZoom( eZoom, nZoomFactor, sal_True ); -//!!! pb (11.08.2004): #i32536# // os: changed: The user data has to be read if the view is switched back from page preview -//#i43146# go to the last editing position when opening own files +// go to the last editing position when opening own files if(bOldShellWasPagePreView||bIsOwnDocument) { if ( bBrowse && bGotVisibleLeft && bGotVisibleTop ) { Point aTopLeft(aVis.TopLeft()); - //#i76699# make sure the document is still centered + // make sure the document is still centered const SwTwips lBorder = IsDocumentBorder() ? DOCUMENTBORDER : 2 * DOCUMENTBORDER; SwTwips nEditWidth = GetEditWin().GetOutputSize().Width(); if(nEditWidth > (aDocSz.Width() + lBorder )) @@ -1506,6 +1457,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > } } } + #define NUM_VIEW_SETTINGS 12 void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSequence, sal_Bool bBrowse ) { @@ -1577,11 +1529,9 @@ void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSe } #undef NUM_VIEW_SETTINGS - - -void SwView::ShowCursor( FASTBOOL bOn ) +void SwView::ShowCursor( bool bOn ) { - //JP 10.10.2001: Bug 90461 - don't scroll the cursor into the visible area + //don't scroll the cursor into the visible area sal_Bool bUnlockView = !pWrtShell->IsViewLocked(); pWrtShell->LockView( sal_True ); //lock visible section @@ -1594,8 +1544,6 @@ void SwView::ShowCursor( FASTBOOL bOn ) pWrtShell->LockView( sal_False ); } - - ErrCode SwView::DoVerb( long nVerb ) { if ( !GetViewFrame()->GetFrame().IsInPlace() ) @@ -1608,27 +1556,19 @@ ErrCode SwView::DoVerb( long nVerb ) return ERRCODE_NONE; } -/*-----------------17.02.98 13:33------------------- - nur sal_True fuer eine Textselektion zurueck geben ---------------------------------------------------*/ +/* only return sal_True for a text selection +*/ sal_Bool SwView::HasSelection( sal_Bool bText ) const { return bText ? GetWrtShell().SwCrsrShell::HasSelection() : GetWrtShell().HasSelection(); } -/*-----------------09/16/97 09:50am----------------- - ---------------------------------------------------*/ - String SwView::GetSelectionText( sal_Bool bCompleteWrds ) { return GetSelectionTextParam( bCompleteWrds, sal_True ); } -/*-----------------09/16/97 09:50am----------------- - ---------------------------------------------------*/ String SwView::GetSelectionTextParam( sal_Bool bCompleteWrds, sal_Bool bEraseTrail ) { @@ -1642,12 +1582,6 @@ String SwView::GetSelectionTextParam( sal_Bool bCompleteWrds, return sReturn; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - SwGlossaryHdl* SwView::GetGlosHdl() { if(!pGlosHdl) @@ -1655,12 +1589,6 @@ SwGlossaryHdl* SwView::GetGlosHdl() return pGlosHdl; } -/*-----------------05.09.96 15.50------------------- - ---------------------------------------------------*/ - - - void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { sal_Bool bCallBase = sal_True; @@ -1669,7 +1597,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) sal_uInt32 nId = ((SfxSimpleHint&)rHint).GetId(); switch ( nId ) { - // --> OD 2005-03-03 #i43775# - sub shells will be destroyed by the + // sub shells will be destroyed by the // dispatcher, if the view frame is dying. Thus, reset member <pShell>. case SFX_HINT_DYING: { @@ -1679,7 +1607,6 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } } break; - // <-- case SFX_HINT_MODECHANGED: { // Modalmodus-Umschaltung? @@ -1688,7 +1615,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) pVRuler->SetActive( !bModal ); } - /* kein break hier */ + /* no break here */ case SFX_HINT_TITLECHANGED: if ( GetDocShell()->IsReadOnly() != GetWrtShell().GetViewOptions()->IsReadonly() ) @@ -1705,7 +1632,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) else KillTab(); bool bReadonly = GetDocShell()->IsReadOnly(); - //#i76332# if document is to be opened in alive-mode then this has to be regarded while switching from readonly-mode to edit-mode + // if document is to be opened in alive-mode then this has to be regarded while switching from readonly-mode to edit-mode if( !bReadonly ) { SwDrawDocument * pDrawDoc = 0; @@ -1752,9 +1679,6 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SfxViewShell::Notify(rBC, rHint); } -/*-----------------02.12.96 12:36------------------- - ---------------------------------------------------*/ #if defined WNT || defined UNX void SwView::ScannerEventHdl( const EventObject& /*rEventObject*/ ) @@ -1787,11 +1711,6 @@ void SwView::ScannerEventHdl( const EventObject& /*rEventObject*/ ) } #endif -/*-----------------04.03.97 15:07------------------- - ---------------------------------------------------*/ - - void SwView::StopShellTimer() { if(aTimer.IsActive()) @@ -1807,9 +1726,6 @@ void SwView::StopShellTimer() } } -/*-----------------09/03/97 04:12pm----------------- - ---------------------------------------------------*/ sal_uInt16 SwView::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing ) { SfxViewFrame* pVFrame = GetViewFrame(); @@ -1827,10 +1743,8 @@ sal_uInt16 SwView::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing ) return SfxViewShell::PrepareClose( bUI, bForBrowsing ); } - - - // status methods for clipboard. - // Status changes now notified from the clipboard. +// status methods for clipboard. +// Status changes now notified from the clipboard. sal_Bool SwView::IsPasteAllowed() { sal_uInt16 nPasteDestination = SwTransferable::GetSotDestination( *pWrtShell ); @@ -1880,9 +1794,7 @@ sal_Bool SwView::IsPasteSpecialAllowed() } return bPasteSpecialState; } -/* -----------------------------12.07.01 13:25-------------------------------- - ---------------------------------------------------------------------------*/ void SwView::NotifyDBChanged() { GetViewImpl()->GetUNOObject_Impl()->NotifyDBChanged(); @@ -1891,17 +1803,11 @@ void SwView::NotifyDBChanged() /*-------------------------------------------------------------------- Beschreibung: Drucken --------------------------------------------------------------------*/ - -/* -----------------------------28.10.02 13:25-------------------------------- - - ---------------------------------------------------------------------------*/ SfxObjectShellLock & SwView::GetTmpSelectionDoc() { return GetViewImpl()->GetTmpSelectionDoc(); } -/* -----------------------------31.10.02 13:25-------------------------------- - ---------------------------------------------------------------------------*/ SfxObjectShellLock & SwView::GetOrCreateTmpSelectionDoc() { SfxObjectShellLock &rxTmpDoc = GetViewImpl()->GetTmpSelectionDoc(); @@ -1912,16 +1818,12 @@ SfxObjectShellLock & SwView::GetOrCreateTmpSelectionDoc() } return rxTmpDoc; } -/* -----------------3/31/2003 12:39PM---------------- - --------------------------------------------------*/ void SwView::AddTransferable(SwTransferable& rTransferable) { GetViewImpl()->AddTransferable(rTransferable); } -/* --------------------------------------------------*/ - namespace sw { void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb) @@ -1931,3 +1833,4 @@ void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb) } // namespace sw +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx index 87ebb24116..641aa159bb 100644 --- a/sw/source/ui/uiview/view0.cxx +++ b/sw/source/ui/uiview/view0.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - #include "hintids.hxx" #include <vcl/graph.hxx> #include <svx/galbrws.hxx> @@ -88,7 +87,6 @@ #include "swslots.hxx" #include <PostItMgr.hxx> - using namespace ::com::sun::star; using ::rtl::OUString; @@ -121,7 +119,6 @@ SFX_IMPL_INTERFACE( SwView, SfxViewShell, SW_RES(RID_TOOLS_TOOLBOX) ) SFX_CHILDWINDOW_REGISTRATION(FN_INSERT_FIELD_DATA_ONLY); SFX_FEATURED_CHILDWINDOW_REGISTRATION(FN_SYNC_LABELS, CHILDWIN_LABEL ); SFX_FEATURED_CHILDWINDOW_REGISTRATION(FN_MAILMERGE_CHILDWINDOW, CHILDWIN_MAILMERGE); -// SFX_CHILDWINDOW_REGISTRATION(FN_MAILMERGE_SENDMAIL_CHILDWINDOW); SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_TOOLS| SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER, SW_RES(RID_TOOLS_TOOLBOX) ); @@ -129,24 +126,16 @@ SFX_IMPL_INTERFACE( SwView, SfxViewShell, SW_RES(RID_TOOLS_TOOLBOX) ) TYPEINIT1(SwView,SfxViewShell) -/*-----------------13.12.97 11:06------------------- - ---------------------------------------------------*/ ShellModes SwView::GetShellMode() { return pViewImpl->GetShellMode(); } -/*-----------------13.12.97 11:28------------------- - ---------------------------------------------------*/ view::XSelectionSupplier* SwView::GetUNOObject() { return pViewImpl->GetUNOObject(); } -/* -----------------------------06.05.2002 13:18------------------------------ - ---------------------------------------------------------------------------*/ void SwView::ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions) { pWrtShell->ApplyAccessiblityOptions(rAccessibilityOptions); @@ -155,39 +144,29 @@ void SwView::ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOpt pWrtShell->ShowCrsr(); } -/*-- 26.05.2004 09:14:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwView::SetMailMergeConfigItem(SwMailMergeConfigItem* pConfigItem, sal_uInt16 nRestart, sal_Bool bIsSource) { pViewImpl->SetMailMergeConfigItem(pConfigItem, nRestart, bIsSource); UIFeatureChanged(); } -/*-- 26.05.2004 09:14:25--------------------------------------------------- - -----------------------------------------------------------------------*/ SwMailMergeConfigItem* SwView::GetMailMergeConfigItem() { return pViewImpl->GetMailMergeConfigItem(); } -/*-- 26.05.2004 09:14:25--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_uInt16 SwView::GetMailMergeRestartPage() const { return pViewImpl->GetMailMergeRestartPage(); } -/*-- 03.09.2004 11:56:33--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwView::IsMailMergeSourceView() const { return pViewImpl->IsMailMergeSourceView(); } -/*-- 12.04.2006 11:51:40--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool lcl_IsViewMarks( const SwViewOption& rVOpt ) { return rVOpt.IsHardBlank() && @@ -506,7 +485,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq) break; default: - ASSERT(sal_False, Falsche Request-Methode); + OSL_ENSURE(sal_False, "wrong request method"); return; } @@ -531,7 +510,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq) pModule->ApplyUsrPref( *pOpt, this, bWebView ? VIEWOPT_DEST_WEB : VIEWOPT_DEST_TEXT ); - //mod #i6193# let postits know about new spellcheck setting + // #i6193# let postits know about new spellcheck setting if ( nSlot == SID_AUTOSPELL_CHECK ) GetPostItMgr()->SetSpellChecking(); @@ -553,3 +532,5 @@ IMPL_LINK( SwView, HtmlOptionsHdl, void*, EMPTYARG ) GetViewFrame()->GetBindings().Invalidate(SID_DRAW_TEXT_MARQUEE); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/view1.cxx b/sw/source/ui/uiview/view1.cxx index 5d6152de1c..d1fdb5f32b 100644 --- a/sw/source/ui/uiview/view1.cxx +++ b/sw/source/ui/uiview/view1.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,34 +29,23 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <svx/svdpagv.hxx> #include <svx/svdview.hxx> #include <svx/ruler.hxx> #include <idxmrk.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> #include <swmodule.hxx> #include <viewopt.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif -#ifndef _GLOBDOC_HXX #include <globdoc.hxx> -#endif #include <navipi.hxx> #include <fldwrap.hxx> -#ifndef _REDLNDLG_HXX #include <redlndlg.hxx> -#endif #include <dpage.hxx> #include <edtwin.hxx> #include "formatclipboard.hxx" -#ifndef _CMDID_H #include <cmdid.h> -#endif // header for class SfxRequest #include <sfx2/request.hxx> @@ -63,12 +53,6 @@ extern int bDocSzUpdated; - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwView::Activate(sal_Bool bMDIActivate) { // aktuelle View anmelden an der DocShell @@ -85,7 +69,7 @@ void SwView::Activate(sal_Bool bMDIActivate) if(!bDocSzUpdated) DocSzChgd(aDocSz); - // #b6330459# make selection visible + // make selection visible if(bMakeSelectionVisible) { pWrtShell->MakeSelVisible(); @@ -139,11 +123,6 @@ void SwView::Activate(sal_Bool bMDIActivate) SfxViewShell::Activate(bMDIActivate); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void SwView::Deactivate(sal_Bool bMDIActivate) { extern sal_Bool bFlushCharBuffer ; @@ -161,18 +140,11 @@ void SwView::Deactivate(sal_Bool bMDIActivate) SfxViewShell::Deactivate(bMDIActivate); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwView::MarginChanged() { GetWrtShell().SetBrowseBorder( GetMargin() ); } -/*-------------------------------------------------------------------- - --------------------------------------------------------------------*/ - void SwView::ExecFormatPaintbrush(SfxRequest& rReq) { if(!pFormatClipboard) @@ -217,3 +189,5 @@ void SwView::StateFormatPaintbrush(SfxItemSet &rSet) rSet.DisableItem( SID_FORMATPAINTBRUSH ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 522a4cadd9..aace13c3c8 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,6 +50,7 @@ #include <caption.hxx> #include <svl/PasswordHelper.hxx> #include <svl/urihelper.hxx> +#include <svtools/miscopt.hxx> #include <sfx2/passwd.hxx> #include <sfx2/sfxdlg.hxx> #include <sfx2/filedlghelper.hxx> @@ -57,6 +59,7 @@ #include <svx/viewlayoutitem.hxx> #include <svx/zoomslideritem.hxx> #include <svtools/xwindowitem.hxx> +#include <svx/linkwarn.hxx> #include <svx/htmlmode.hxx> #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> @@ -142,8 +145,8 @@ #include <svx/ofaitem.hxx> #include <unomid.h> -const char __FAR_DATA sStatusDelim[] = " : "; -const char __FAR_DATA sStatusComma[] = " , ";//#outlinelevel, define a Variable for "," add by zhaojianwei +const char sStatusDelim[] = " : "; +const char sStatusComma[] = " , ";//#outlinelevel, define a Variable for "," add by zhaojianwei using ::rtl::OUString; using namespace sfx2; @@ -158,7 +161,6 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::ui::dialogs; - static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, sal_uInt16 nWhichId ) { if (nWhichId == RES_CHRATR_LANGUAGE || @@ -187,7 +189,6 @@ static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, sal_uInt16 nWhi /*--------------------------------------------------------------------------- Beschreibung: String fuer die Seitenanzeige in der Statusbar basteln. ----------------------------------------------------------------------------*/ - String SwView::GetPageStr( sal_uInt16 nPg, sal_uInt16 nLogPg, const String& rDisplay ) { @@ -208,7 +209,6 @@ String SwView::GetPageStr( sal_uInt16 nPg, sal_uInt16 nLogPg, return aStr; } - int SwView::InsertGraphic( const String &rPath, const String &rFilter, sal_Bool bLink, GraphicFilter *pFlt, Graphic* pPreviewGrf, sal_Bool bRule ) @@ -223,7 +223,7 @@ int SwView::InsertGraphic( const String &rPath, const String &rFilter, { if( !pFlt ) pFlt = GraphicFilter::GetGraphicFilter(); - nRes = GraphicFilter::LoadGraphic( rPath, rFilter, aGrf, pFlt /*, nFilter*/ ); + nRes = GraphicFilter::LoadGraphic( rPath, rFilter, aGrf, pFlt ); } if( GRFILTER_OK == nRes ) @@ -254,7 +254,6 @@ int SwView::InsertGraphic( const String &rPath, const String &rFilter, return nRes; } - sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq ) { #ifndef ENABLE_PROP_WITHOUTLINK @@ -324,7 +323,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq ) } catch(Exception& ) { - DBG_ERROR("control acces failed"); + OSL_ENSURE(false, "control acces failed"); } SFX_REQUEST_ARG( rReq, pName, SfxStringItem, SID_INSERT_GRAPHIC , sal_False ); @@ -355,7 +354,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq ) try { Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0); - DBG_ASSERT(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found"); + OSL_ENSURE(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found"); bAsLink = aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True; Any aTemplateValue = xCtrlAcc->getValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE, @@ -366,7 +365,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq ) } catch(Exception& ) { - DBG_ERROR("control acces failed"); + OSL_ENSURE(false, "control access failed"); } } rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bAsLink ) ); @@ -390,7 +389,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq ) else { Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0); - DBG_ASSERT(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found"); + OSL_ENSURE(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found"); bAsLink = aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True; Any aTemplateValue = xCtrlAcc->getValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE, @@ -402,13 +401,20 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq ) rReq.AppendItem( SfxStringItem( FN_PARAM_2, sGraphicFormat ) ); rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bAsLink ) ); } + + // really store as link only? + if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() ) + { + SvxLinkWarningDialog aWarnDlg(GetWindow(),pFileDlg->GetPath()); + if( aWarnDlg.Execute() != RET_OK ) + bAsLink=sal_False; // don't store as link + } } SwWrtShell& rSh = GetWrtShell(); rSh.LockPaint(); rSh.StartAction(); - /// #111827# SwRewriter aRewriter; aRewriter.AddRule(UNDO_ARG1, String(SW_RES(STR_GRAPHIC_DEFNAME))); @@ -479,8 +485,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq ) return bReturn; } - -void __EXPORT SwView::Execute(SfxRequest &rReq) +void SwView::Execute(SfxRequest &rReq) { sal_uInt16 nSlot = rReq.GetSlot(); const SfxItemSet* pArgs = rReq.GetArgs(); @@ -489,17 +494,15 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) switch( nSlot ) { case SID_CREATE_SW_DRAWVIEW: - // --> OD 2005-08-08 #i52858# - method name changed pWrtShell->getIDocumentDrawModelAccess()->GetOrCreateDrawModel(); - // <-- break; case FN_LINE_NUMBERING_DLG: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); VclAbstractDialog* pDlg = pFact->CreateVclSwViewDialog( DLG_LINE_NUMBERING, *this); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; break; @@ -537,7 +540,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) Sequence <sal_Int8> aPasswd = pIDRA->GetRedlinePassword(); if( aPasswd.getLength() ) { - DBG_ASSERT( !((const SfxBoolItem*)pItem)->GetValue(), "SwView::Execute(): password set an redlining off doesn't match!" ); + OSL_ENSURE( !((const SfxBoolItem*)pItem)->GetValue(), "SwView::Execute(): password set an redlining off doesn't match!" ); // xmlsec05: new password dialog Window* pParent; const SfxPoolItem* pParentItem; @@ -855,8 +858,8 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) pWrtShell->ApplyAutoMark(); bAutoMarkApplied = sal_True; } - // JP 15.07.96: das pBase wird nur fuer die Schnittstelle - // benoetigt. Muss mal umgetstellt werden!!! + // das pBase wird nur fuer die Schnittstelle + // benoetigt. Muss mal umgetstellt werden!!! pWrtShell->UpdateTableOf( *pBase ); if( pWrtShell->GotoNextTOXBase() ) @@ -969,10 +972,10 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) JumpToSwMark( (( const SfxStringItem*)pItem)->GetValue() ); break; case SID_GALLERY : - GetViewFrame()->ChildWindowExecute(rReq);//ToggleChildWindow(SID_GALLERY); + GetViewFrame()->ChildWindowExecute(rReq); break; case SID_AVMEDIA_PLAYER : - GetViewFrame()->ChildWindowExecute(rReq);//ToggleChildWindow(SID_AVMEDIA_PLAYER); + GetViewFrame()->ChildWindowExecute(rReq); break; case SID_VIEW_DATA_SOURCE_BROWSER: { @@ -991,7 +994,6 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) if( pArgs && SFX_ITEM_SET == pArgs->GetItemState(nSlot, sal_False, &pItem )) bShow = ((const SfxBoolItem*)pItem)->GetValue(); - //GetViewFrame()->ShowChildWindow(nSlot, bShow && bInMailMerge); if((bShow && bInMailMerge) != GetViewFrame()->HasChildWindow(nSlot)) GetViewFrame()->ToggleChildWindow(nSlot); //if fields have been succesfully inserted call the "real" @@ -1033,10 +1035,10 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) SfxViewFrame* pTmpFrame = GetViewFrame(); SfxHelp::OpenHelpAgent( &pTmpFrame->GetFrame(), HID_MAIL_MERGE_SELECT ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractMailMergeCreateFromDlg* pDlg = pFact->CreateMailMergeCreateFromDlg( DLG_MERGE_CREATE, &pTmpFrame->GetWindow()); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(RET_OK == pDlg->Execute()) bUseCurrentDocument = pDlg->IsThisDocument(); else @@ -1151,7 +1153,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) default: - ASSERT(!this, falscher Dispatcher); + OSL_ENSURE(!this, "wrong dispatcher"); return; } if(!bIgnore) @@ -1161,7 +1163,6 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) /*-------------------------------------------------------------------- Beschreibung: SeitenNr-Feld invalidieren --------------------------------------------------------------------*/ - void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr) { String sTemp(GetPageStr( nPhyNum, nVirtNum, rPgStr )); @@ -1174,33 +1175,19 @@ void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const Strin /*-------------------------------------------------------------------- Beschreibung: Status der Stauszeile --------------------------------------------------------------------*/ - - void SwView::StateStatusLine(SfxItemSet &rSet) { SwWrtShell& rShell = GetWrtShell(); SfxWhichIter aIter( rSet ); sal_uInt16 nWhich = aIter.FirstWhich(); - ASSERT( nWhich, "leeres Set"); + OSL_ENSURE( nWhich, "empty set"); while( nWhich ) { switch( nWhich ) { - case FN_STAT_PAGE: -/* -//JP 07.01.00: is a nice feature - show the selektion of DrawObjects - if( rShell.IsObjSelected() -//??? || rShell.IsFrmSelected() - ) - { - String sDisplay( rShell.GetDrawView()->GetMarkedObjectList(). - GetDescriptionOfMarkedObjects() ); - rSet.Put( SfxStringItem( FN_STAT_PAGE, sDisplay )); - } - else -*/ { + case FN_STAT_PAGE: { // Anzahl der Seiten, log. SeitenNr. SeitenNr ermitteln sal_uInt16 nPage, nLogPage; String sDisplay; @@ -1371,7 +1358,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) sStr = pTOX->GetTOXName(); else { - ASSERT( !this, + OSL_ENSURE( !this, "was ist das fuer ein Verzeichnis?" ); sStr = pCurrSect->GetSectionName(); } @@ -1383,75 +1370,26 @@ void SwView::StateStatusLine(SfxItemSet &rSet) } } } - - //#outline level, removed by zhaojianwei - //const SwNumRule* pNumRule = rShell.GetCurNumRule(); - //if (pNumRule) // Cursor in Numerierung - //{ - // sal_uInt8 nNumLevel = rShell.GetNumLevel(); - // if( IsShowNum(nNumLevel) && MAXLEVEL > - // ( nNumLevel = GetRealLevel( nNumLevel )) ) - // { - // if( sStr.Len() ) - // sStr.AppendAscii(sStatusDelim); - // sStr += SW_RESSTR(STR_NUM_LEVEL); - // sStr += String::CreateFromInt32( nNumLevel + 1 ); - // if(!pNumRule->IsAutoRule()) - // { - // SfxItemSet aSet(GetPool(), - // RES_PARATR_NUMRULE, RES_PARATR_NUMRULE); - // rShell.GetCurAttr(aSet); - // /* const SfxPoolItem* pItem; */ - // if(SFX_ITEM_AVAILABLE <= - // aSet.GetItemState(RES_PARATR_NUMRULE, sal_True - // /*, &pItem */ )) - // { - // const String& rNumStyle = - // ((const SfxStringItem &) - // aSet.Get(RES_PARATR_NUMRULE)).GetValue(); - // /* #i5116# GetItemState does not necessarily - // change pItem */ - // // ((const SfxStringItem*)pItem)->GetValue(); - // if(rNumStyle.Len()) - // { - // sStr.AppendAscii(sStatusDelim); - // sStr += rNumStyle; - // } - // } - // } - // } - //}//<-removed end ,zhaojianwei - //-->#outline level,added by zhaojianwei const SwNumRule* pNumRule = rShell.GetCurNumRule(); const bool bOutlineNum = pNumRule ? pNumRule->IsOutlineRule() : 0; - //((SwTxtFmtColl*)rShell.GetCrsr()->GetNode()->GetTxtNode()->GetFmtColl())->IsAssignedToListLevelOfOutlineStyle(); if (pNumRule && !bOutlineNum ) // Cursor in Numerierung { sal_uInt8 nNumLevel = rShell.GetNumLevel(); - // --> OD 2008-04-02 #refactorlists# -// if( IsShowNum(nNumLevel) && MAXLEVEL > -// ( nNumLevel = GetRealLevel( nNumLevel )) ) if ( nNumLevel < MAXLEVEL ) - // <-- { if(!pNumRule->IsAutoRule()) { SfxItemSet aSet(GetPool(), RES_PARATR_NUMRULE, RES_PARATR_NUMRULE); rShell.GetCurAttr(aSet); - /* const SfxPoolItem* pItem; */ if(SFX_ITEM_AVAILABLE <= - aSet.GetItemState(RES_PARATR_NUMRULE, sal_True - /*, &pItem */ )) + aSet.GetItemState(RES_PARATR_NUMRULE, sal_True)) { const String& rNumStyle = ((const SfxStringItem &) aSet.Get(RES_PARATR_NUMRULE)).GetValue(); - /* #i5116# GetItemState does not necessarily - change pItem */ - // ((const SfxStringItem*)pItem)->GetValue(); if(rNumStyle.Len()) { if( sStr.Len() ) @@ -1522,8 +1460,6 @@ void SwView::StateStatusLine(SfxItemSet &rSet) /*-------------------------------------------------------------------- Beschreibung: Execute fuer die Stauszeile --------------------------------------------------------------------*/ - - void SwView::ExecuteStatusLine(SfxRequest &rReq) { SwWrtShell &rSh = GetWrtShell(); @@ -1604,7 +1540,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) if(pFact) { pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); } pDlg->SetLimits( MINZOOM, MAXZOOM ); @@ -1809,7 +1745,6 @@ void SwView::InsFrmMode(sal_uInt16 nCols) /*-------------------------------------------------------------------- Beschreibung: Links bearbeiten --------------------------------------------------------------------*/ - void SwView::EditLinkDlg() { sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this); @@ -1820,13 +1755,6 @@ void SwView::EditLinkDlg() pDlg->Execute(); delete pDlg; } -/* - SwLinkDlg* pDlg = new SwLinkDlg(GetFrameWindow()); - pDlg->SetShell(&GetWrtShell()); - pDlg->Execute(); - - DELETEZ(pDlg); -*/ } sal_Bool SwView::JumpToSwMark( const String& rMark ) @@ -1839,7 +1767,6 @@ sal_Bool SwView::JumpToSwMark( const String& rMark ) sal_Bool bSaveCT = IsCrsrAtTop(); SetCrsrAtTop( sal_True ); - //JP 27.04.98: Bug 49786 // Damit in FrameSet auch gescrollt werden kann, muss die // entsprechende Shell auch das Focus-Flag gesetzt haben! sal_Bool bHasShFocus = pWrtShell->HasShFcs(); @@ -1909,8 +1836,10 @@ sal_Bool SwView::JumpToSwMark( const String& rMark ) } else if( pMarkAccess->getMarksEnd() != (ppMark = pMarkAccess->findMark(sMark)) ) pWrtShell->GotoMark( ppMark->get(), sal_False, sal_True ), bRet = sal_True; - else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) )) + else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) )) { + pWrtShell->addCurrentPosition(); bRet = pWrtShell->GotoINetAttr( *pINet->GetTxtINetFmt() ); + } // fuer alle Arten von Flys if( FLYCNTTYPE_ALL != eFlyType && pWrtShell->GotoFly( sName, eFlyType )) @@ -1947,11 +1876,10 @@ sal_Bool SwView::JumpToSwMark( const String& rMark ) return bRet; } -// #i67305, #1367991: Undo after insert from file: +// #i67305# Undo after insert from file: // Undo "Insert form file" crashes with documents imported from binary filter (.sdw) => disabled // Undo "Insert form file" crashes with (.odt) documents crashes if these documents contains // page styles with active header/footer => disabled for those documents - sal_uInt16 lcl_PageDescWithHeader( const SwDoc& rDoc ) { sal_uInt16 nRet = 0; @@ -1973,7 +1901,6 @@ sal_uInt16 lcl_PageDescWithHeader( const SwDoc& rDoc ) /*-------------------------------------------------------------------- Beschreibung: Links bearbeiten --------------------------------------------------------------------*/ - void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem ) { pViewImpl->InitRequest( rRequest ); @@ -2041,18 +1968,18 @@ long SwView::InsertDoc( sal_uInt16 nSlotId, const String& rFileName, const Strin long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVersion ) { - sal_Bool bInsert = sal_False, bCompare = sal_False, bMerge = sal_False; + sal_Bool bInsert = sal_False, bCompare = sal_False; long nFound = 0; SwDocShell* pDocSh = GetDocShell(); switch( nSlotId ) { - case SID_DOCUMENT_MERGE: bMerge = sal_True; break; + case SID_DOCUMENT_MERGE: break; case SID_DOCUMENT_COMPARE: bCompare = sal_True; break; case SID_INSERTDOC: bInsert = sal_True; break; default: - ASSERT( !this, "Unbekannte SlotId!" ); + OSL_ENSURE( !this, "unknown SlotId!" ); bInsert = sal_True; nSlotId = SID_INSERTDOC; break; @@ -2122,8 +2049,8 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe } if( pDoc ) - { // Disable Undo for .sdw (136991) or - // if the number of page styles with header/footer has changed (#i67305) + { // Disable Undo for .sdw or + // if the number of page styles with header/footer has changed if( !pRead || nUndoCheck != lcl_PageDescWithHeader( *pDoc ) ) { pDoc->GetIDocumentUndoRedo().DelAllUndoObj(); @@ -2181,9 +2108,7 @@ extern int lcl_FindDocShell( SfxObjectShellRef& xDocSh, SfxObjectShellLock& xLoc delete pMedium; return nFound; } -/* -----------------05.02.2003 12:06----------------- - * - * --------------------------------------------------*/ + void SwView::EnableMailMerge(sal_Bool bEnable ) { bInMailMerge = bEnable; @@ -2191,8 +2116,7 @@ void SwView::EnableMailMerge(sal_Bool bEnable ) rBind.Invalidate(FN_INSERT_FIELD_DATA_ONLY); rBind.Update(FN_INSERT_FIELD_DATA_ONLY); } -/* -*/ + namespace { sal_Bool lcl_NeedAdditionalDataSource( const uno::Reference< XNameAccess >& _rDatasourceContext ) @@ -2207,10 +2131,6 @@ namespace } } -/* -----------------27.11.2002 12:12----------------- - * - * --------------------------------------------------*/ - class SwMergeSourceWarningBox_Impl : public ModalDialog { FixedInfo aMessageFI; @@ -2257,9 +2177,6 @@ class SwMergeSourceWarningBox_Impl : public ModalDialog void SetMessText( const String& rText ) { aMessageFI.SetText( rText ); } }; - - - void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument) { if(bUseCurrentDocument) @@ -2272,7 +2189,7 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument) if( xMgr.is() ) { uno::Reference<XInterface> xInstance = xMgr->createInstance( - OUString::createFromAscii( "com.sun.star.sdb.DatabaseContext" )); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DatabaseContext"))); xDBContext = uno::Reference<XNameAccess>(xInstance, UNO_QUERY) ; } if(!xDBContext.is()) @@ -2293,11 +2210,11 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument) { //take an existing data source or create a new one? SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractMailMergeFieldConnectionsDlg* pConnectionsDlg = pFact->CreateMailMergeFieldConnectionsDlg( DLG_MERGE_FIELD_CONNECTIONS, &GetViewFrame()->GetWindow()); - DBG_ASSERT(pConnectionsDlg, "Dialogdiet fail!"); + OSL_ENSURE(pConnectionsDlg, "Dialogdiet fail!"); if(RET_OK == pConnectionsDlg->Execute()) bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections(); else @@ -2354,7 +2271,17 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument) SwDBData aData; SwWrtShell &rSh = GetWrtShell(); - aData = rSh.GetDBData(); + + SvStringsDtor aDBNameList(5, 1); + SvStringsDtor aAllDBNames(5, 5); + rSh.GetAllUsedDB( aDBNameList, &aAllDBNames ); + if ( aDBNameList.Count( ) ) + { + String sDBName = *aDBNameList[0]; + aData.sDataSource = sDBName.GetToken(0, DB_DELIM); + aData.sCommand = sDBName.GetToken(1, DB_DELIM); + aData.nCommandType = sDBName.GetToken(2, DB_DELIM ).ToInt32(); + } rSh.EnterStdMode(); // Wechsel in Textshell erzwingen; ist fuer // das Mischen von DB-Feldern notwendig. AttrChangedNotify( &rSh ); @@ -2398,8 +2325,6 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument) // after the destruction of the dialogue its parent comes to top, // but we want that the new document is on top pTopWin->ToTop(); - -// return; } } @@ -2453,3 +2378,4 @@ void SwView::ExecuteScan( SfxRequest& rReq ) pViewImpl->ExecuteScan(rReq) ; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewcoll.cxx b/sw/source/ui/uiview/viewcoll.cxx index 831124049f..ae81629926 100644 --- a/sw/source/ui/uiview/viewcoll.cxx +++ b/sw/source/ui/uiview/viewcoll.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -28,24 +29,18 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - #include "cmdid.h" #include "uiitems.hxx" -#include <tools/list.hxx> #include <vcl/window.hxx> #include <sfx2/request.hxx> #include <sfx2/viewfrm.hxx> #include <svl/stritem.hxx> #include <rsc/rscsfx.hxx> - -#include "errhdl.hxx" #include "view.hxx" #include "wrtsh.hxx" #include "basesh.hxx" - void SwView::ExecColl(SfxRequest &rReq) { const SfxItemSet* pArgs = rReq.GetArgs(); @@ -55,7 +50,7 @@ void SwView::ExecColl(SfxRequest &rReq) { case FN_SET_PAGE: { - DBG_ASSERT(!this, "Not implemented"); + OSL_ENSURE(!this, "Not implemented"); } break; case FN_SET_PAGE_STYLE: @@ -89,10 +84,11 @@ void SwView::ExecColl(SfxRequest &rReq) } break; default: - ASSERT(sal_False, falscher CommandProcessor fuer Dispatch); + OSL_ENSURE(false, "wrong CommandProcessor for Dispatch"); return; } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewdlg.cxx b/sw/source/ui/uiview/viewdlg.cxx index fe9e768420..4dcb2911cc 100644 --- a/sw/source/ui/uiview/viewdlg.cxx +++ b/sw/source/ui/uiview/viewdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,15 +29,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - #include "hintids.hxx" #include <sfx2/viewfrm.hxx> #include <editeng/tstpitem.hxx> #include <svl/stritem.hxx> #include <sfx2/request.hxx> - #include "view.hxx" #include "wrtsh.hxx" #include "basesh.hxx" @@ -83,7 +81,7 @@ void SwView::ExecDlg(SfxRequest &rReq) break; default: - ASSERT(!this, falscher Dispatcher); + OSL_ENSURE(!this, "wrong dispatcher"); return; } @@ -96,3 +94,4 @@ void SwView::ExecDlg(SfxRequest &rReq) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewdlg2.cxx b/sw/source/ui/uiview/viewdlg2.cxx index 77d3228bd9..1712cd0565 100644 --- a/sw/source/ui/uiview/viewdlg2.cxx +++ b/sw/source/ui/uiview/viewdlg2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,11 +29,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <sfx2/request.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/objface.hxx> - #include <fldmgr.hxx> #include <expfld.hxx> #include <modcfg.hxx> @@ -60,10 +59,6 @@ extern String* pOldTabCat; extern String* pOldFrmCat; extern String* pOldDrwCat; -/* -----------------06.11.98 13:45------------------- - * - * --------------------------------------------------*/ - void SwView::ExecDlgExt(SfxRequest &rReq) { Window *pMDI = &GetViewFrame()->GetWindow(); @@ -73,10 +68,10 @@ void SwView::ExecDlgExt(SfxRequest &rReq) case FN_INSERT_CAPTION: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); VclAbstractDialog* pDialog = pFact->CreateSwCaptionDialog( pMDI, *this, DLG_CAPTION ); - DBG_ASSERT(pDialog, "Dialogdiet fail!"); + OSL_ENSURE(pDialog, "Dialogdiet fail!"); if ( pDialog ) { pDialog->Execute(); @@ -87,10 +82,10 @@ void SwView::ExecDlgExt(SfxRequest &rReq) case FN_EDIT_FOOTNOTE: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractInsFootNoteDlg* pDlg = pFact->CreateInsFootNoteDlg( DLG_INS_FOOTNOTE, pMDI, *pWrtShell, sal_True ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->SetHelpId(GetStaticInterface()->GetSlot(FN_EDIT_FOOTNOTE)->GetCommand()); pDlg->SetText( SW_RESSTR(STR_EDIT_FOOTNOTE) ); @@ -101,10 +96,6 @@ void SwView::ExecDlgExt(SfxRequest &rReq) } } -/* -----------------06.11.98 14:53------------------- - * - * --------------------------------------------------*/ - void SwView::AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId) { SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); @@ -118,10 +109,6 @@ void SwView::AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId) } } -/* -----------------06.11.98 12:58------------------- - * - * --------------------------------------------------*/ - void SwView::InsertCaption(const InsCaptionOpt *pOpt) { if (!pOpt) @@ -239,3 +226,4 @@ void SwView::InsertCaption(const InsCaptionOpt *pOpt) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewdraw.cxx b/sw/source/ui/uiview/viewdraw.cxx index b88861e7f7..4219857b89 100644 --- a/sw/source/ui/uiview/viewdraw.cxx +++ b/sw/source/ui/uiview/viewdraw.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include "hintids.hxx" #include <svl/aeitem.hxx> #include <svl/itempool.hxx> @@ -73,19 +73,17 @@ #include "dselect.hxx" #include "edtwin.hxx" -// #108784# #include <dcontact.hxx> -// #108784# #include <svx/svdpagv.hxx> #include <svx/extrusionbar.hxx> #include <vcl/svapp.hxx> using namespace ::com::sun::star; + /*-------------------------------------------------------------------- Beschreibung: Drawing-Ids ausfuehren --------------------------------------------------------------------*/ - void SwView::ExecDraw(SfxRequest& rReq) { const SfxItemSet *pArgs = rReq.GetArgs(); @@ -145,7 +143,7 @@ void SwView::ExecDraw(SfxRequest& rReq) if ( pFormView ) { SFX_REQUEST_ARG( rReq, pDescriptorItem, SfxUnoAnyItem, SID_FM_DATACCESS_DESCRIPTOR, sal_False ); - DBG_ASSERT( pDescriptorItem, "SwView::ExecDraw(SID_FM_CREATE_FIELDCONTROL): invalid request args!" ); + OSL_ENSURE( pDescriptorItem, "SwView::ExecDraw(SID_FM_CREATE_FIELDCONTROL): invalid request args!" ); if( pDescriptorItem ) { ::svx::ODataAccessDescriptor aDescriptor( pDescriptorItem->GetValue() ); @@ -346,7 +344,7 @@ void SwView::ExecDraw(SfxRequest& rReq) break; } - static sal_uInt16 __READONLY_DATA aInval[] = + static sal_uInt16 const aInval[] = { // Slot-Ids muessen beim Aufruf von Invalidate sortiert sein! SID_ATTRIBUTES_AREA, @@ -410,16 +408,13 @@ void SwView::ExecDraw(SfxRequest& rReq) /*-------------------------------------------------------------------- Beschreibung: Drawing beenden --------------------------------------------------------------------*/ - - - void SwView::ExitDraw() { NoRotate(); if(pShell) { - //#126062 # the shell may be invalid at close/reload/SwitchToViewShell + // the shell may be invalid at close/reload/SwitchToViewShell SfxDispatcher* pDispatch = GetViewFrame()->GetDispatcher(); sal_uInt16 nIdx = 0; SfxShell* pTest = 0; @@ -464,9 +459,6 @@ void SwView::ExitDraw() /*-------------------------------------------------------------------- Beschreibung: Rotate-Mode abschalten --------------------------------------------------------------------*/ - - - void SwView::NoRotate() { if (IsDrawRotate()) @@ -482,14 +474,13 @@ void SwView::NoRotate() /****************************************************************************** * Beschreibung: DrawTextEditMode einschalten ******************************************************************************/ - sal_Bool SwView::EnterDrawTextMode(const Point& aDocPos) { SdrObject* pObj; SdrPageView* pPV; SwWrtShell *pSh = &GetWrtShell(); SdrView *pSdrView = pSh->GetDrawView(); - ASSERT( pSdrView, "EnterDrawTextMode without DrawView?" ); + OSL_ENSURE( pSdrView, "EnterDrawTextMode without DrawView?" ); sal_Bool bReturn = sal_False; @@ -500,9 +491,7 @@ sal_Bool SwView::EnterDrawTextMode(const Point& aDocPos) !pSdrView->PickHandle( aDocPos ) && IsTextTool() && pSdrView->PickObj( aDocPos, pSdrView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKTEXTEDIT ) && - // #108784# // To allow SwDrawVirtObj text objects to be activated, allow their type, too. - //pObj->ISA( SdrTextObj ) && ( pObj->ISA( SdrTextObj ) || ( pObj->ISA(SwDrawVirtObj) && ((SwDrawVirtObj*)pObj)->GetReferencedObj().ISA(SdrTextObj) ) ) && @@ -558,24 +547,18 @@ sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin, if( bIsNewObj ) pOutliner->SetVertical( SID_DRAW_TEXT_VERTICAL == nDrawSfxId || SID_DRAW_CAPTION_VERTICAL == nDrawSfxId ); - // #i7672# - // No longer necessary, see text below - // Color aBackground(pSh->GetShapeBackgrd()); - // pOutliner->SetBackgroundColor(aBackground); - // OD 09.12.2002 #103045# - set default horizontal text direction at outliner + // set default horizontal text direction at outliner EEHorizontalTextDirection aDefHoriTextDir = pSh->IsShapeDefaultHoriTextDirR2L() ? EE_HTEXTDIR_R2L : EE_HTEXTDIR_L2R; pOutliner->SetDefaultHorizontalTextDirection( aDefHoriTextDir ); } - // #108784# // To allow editing the referenced object from a SwDrawVirtObj here // the original needs to be fetched evenually. This ATM activates the // text edit mode for the original object. SdrObject* pToBeActivated = pObj; - // #108784# // Always the original object is edited. To allow the TextEdit to happen // where the VirtObj is positioned, on demand a occurring offset is set at // the TextEdit object. That offset is used for creating and managing the @@ -621,15 +604,12 @@ sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin, /****************************************************************************** * Beschreibung: Ist ein DrawTextObjekt selektiert? ******************************************************************************/ - - - sal_Bool SwView::IsTextTool() const { sal_uInt16 nId; sal_uInt32 nInvent; SdrView *pSdrView = GetWrtShell().GetDrawView(); - ASSERT( pSdrView, "IsTextTool without DrawView?" ); + OSL_ENSURE( pSdrView, "IsTextTool without DrawView?" ); if (pSdrView->IsCreateMode()) pSdrView->SetCreateMode(sal_False); @@ -638,32 +618,16 @@ sal_Bool SwView::IsTextTool() const return (nInvent==SdrInventor); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - SdrView* SwView::GetDrawView() const { return GetWrtShell().GetDrawView(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - sal_Bool SwView::IsBezierEditMode() { return (!IsDrawSelMode() && GetWrtShell().GetDrawView()->HasMarkablePoints()); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool SwView::IsFormMode() const { if (GetDrawFuncPtr() && GetDrawFuncPtr()->IsCreateObj()) @@ -674,12 +638,6 @@ sal_Bool SwView::IsFormMode() const return AreOnlyFormsSelected(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - void SwView::SetDrawFuncPtr(SwDrawBase* pFuncPtr) { if (pDrawActual) @@ -687,20 +645,12 @@ void SwView::SetDrawFuncPtr(SwDrawBase* pFuncPtr) pDrawActual = pFuncPtr; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwView::SetSelDrawSlot() { nDrawSfxId = SID_OBJECT_SELECT; sDrawCustom.Erase(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool SwView::AreOnlyFormsSelected() const { if ( GetWrtShell().IsFrmSelected() ) @@ -733,10 +683,6 @@ sal_Bool SwView::AreOnlyFormsSelected() const return bForm; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool SwView::HasDrwObj(SdrObject *pSdrObj) const { sal_Bool bRet = sal_False; @@ -756,10 +702,6 @@ sal_Bool SwView::HasDrwObj(SdrObject *pSdrObj) const return bRet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool SwView::HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const { sal_Bool bRet = sal_False; @@ -779,7 +721,6 @@ sal_Bool SwView::HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const return bRet; } - //#i87414# mod IMPL_LINK(SwView, OnlineSpellCallback, SpellCallbackInfo*, pInfo) { @@ -788,9 +729,6 @@ IMPL_LINK(SwView, OnlineSpellCallback, SpellCallbackInfo*, pInfo) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ sal_Bool SwView::ExecDrwTxtSpellPopup(const Point& rPt) { sal_Bool bRet = sal_False; @@ -807,12 +745,6 @@ sal_Bool SwView::ExecDrwTxtSpellPopup(const Point& rPt) return bRet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - sal_Bool SwView::IsDrawTextHyphenate() { SdrView *pSdrView = pWrtShell->GetDrawView(); @@ -828,12 +760,6 @@ sal_Bool SwView::IsDrawTextHyphenate() return bHyphenate; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - void SwView::HyphenateDrawText() { SdrView *pSdrView = pWrtShell->GetDrawView(); @@ -845,5 +771,4 @@ void SwView::HyphenateDrawText() GetViewFrame()->GetBindings().Invalidate(FN_HYPHENATE_OPT_DLG); } - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewfunc.hxx b/sw/source/ui/uiview/viewfunc.hxx index 24a8021ab0..630e2b9170 100644 --- a/sw/source/ui/uiview/viewfunc.hxx +++ b/sw/source/ui/uiview/viewfunc.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -64,3 +65,5 @@ void ViewResizePixel( const Window &rRef, #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx index e2a3a98685..2b1d3060ec 100755..100644 --- a/sw/source/ui/uiview/viewling.cxx +++ b/sw/source/ui/uiview/viewling.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -114,8 +115,6 @@ using namespace ::com::sun::star::smarttags; /*-------------------------------------------------------------------- Beschreibung: Lingu-Dispatcher --------------------------------------------------------------------*/ - - void SwView::ExecLingu(SfxRequest &rReq) { switch(rReq.GetSlot()) @@ -140,7 +139,7 @@ void SwView::ExecLingu(SfxRequest &rReq) { Reference< ui::dialogs::XExecutableDialog > xDialog( xMCF->createInstanceWithContext( - rtl::OUString::createFromAscii("com.sun.star.linguistic2.ChineseTranslationDialog") + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.ChineseTranslationDialog")) , xContext), UNO_QUERY); Reference< lang::XInitialization > xInit( xDialog, UNO_QUERY ); if( xInit.is() ) @@ -150,7 +149,7 @@ void SwView::ExecLingu(SfxRequest &rReq) Sequence<Any> aSeq(1); Any* pArray = aSeq.getArray(); PropertyValue aParam; - aParam.Name = rtl::OUString::createFromAscii("ParentWindow"); + aParam.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow")); aParam.Value <<= makeAny(xDialogParentWindow); pArray[0] <<= makeAny(aParam); xInit->initialize( aSeq ); @@ -210,7 +209,7 @@ void SwView::ExecLingu(SfxRequest &rReq) { SwTxtNode *pTxtNode = aPointNodeIndex.GetNode().GetTxtNode(); // check for unexpected error case - DBG_ASSERT( pTxtNode && pTxtNode->GetTxt().Len() >= nPointIndex, + OSL_ENSURE( pTxtNode && pTxtNode->GetTxt().Len() >= nPointIndex, "text missing: corrupted node?" ); if (!pTxtNode || pTxtNode->GetTxt().Len() < nPointIndex) nPointIndex = 0; @@ -233,7 +232,7 @@ void SwView::ExecLingu(SfxRequest &rReq) HyphenateDocument(); break; default: - ASSERT(!this, falscher Dispatcher); + OSL_ENSURE(!this, "wrong Dispatcher"); return; } } @@ -241,7 +240,6 @@ void SwView::ExecLingu(SfxRequest &rReq) /*-------------------------------------------------------------------- Description: start language specific text conversion --------------------------------------------------------------------*/ - void SwView::StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, @@ -287,7 +285,6 @@ void SwView::StartTextConversion( /*-------------------------------------------------------------------- spellcheck and text conversion related stuff --------------------------------------------------------------------*/ - void SwView::SpellStart( SvxSpellArea eWhich, sal_Bool bStartDone, sal_Bool bEndDone, SwConversionArgs *pConvArgs ) @@ -342,7 +339,7 @@ void SwView::SpellStart( SvxSpellArea eWhich, } break; default: - ASSERT( !this, "SpellStart with unknown Area" ); + OSL_ENSURE( !this, "SpellStart with unknown Area" ); } pWrtShell->SpellStart( eStart, eEnde, eCurr, pConvArgs ); } @@ -350,8 +347,6 @@ void SwView::SpellStart( SvxSpellArea eWhich, /*-------------------------------------------------------------------- Beschreibung: Fehlermeldung beim Spelling --------------------------------------------------------------------*/ - - // Der uebergebene Pointer nLang ist selbst der Wert IMPL_LINK( SwView, SpellError, LanguageType *, pLang ) { @@ -415,8 +410,6 @@ IMPL_LINK( SwView, SpellError, LanguageType *, pLang ) /*-------------------------------------------------------------------- Beschreibung: Spelling beenden und Cursor wiederherstellen --------------------------------------------------------------------*/ - - void SwView::SpellEnd( SwConversionArgs *pConvArgs ) { pWrtShell->SpellEnd( pConvArgs ); @@ -424,7 +417,6 @@ void SwView::SpellEnd( SwConversionArgs *pConvArgs ) pWrtShell->SetMark(); } - void SwView::HyphStart( SvxSpellArea eWhich ) { switch ( eWhich ) @@ -442,15 +434,13 @@ void SwView::HyphStart( SvxSpellArea eWhich ) pWrtShell->HyphStart( DOCPOS_OTHERSTART, DOCPOS_OTHEREND ); break; default: - ASSERT( !this, "HyphStart with unknown Area" ); + OSL_ENSURE( !this, "HyphStart with unknown Area" ); } } /*-------------------------------------------------------------------- Beschreibung: Interaktive Trennung --------------------------------------------------------------------*/ - - void SwView::HyphenateDocument() { // do not hyphenate if interactive hyphenationg is active elsewhere @@ -523,9 +513,6 @@ void SwView::HyphenateDocument() } } -/*-------------------------------------------------------------------- - --------------------------------------------------------------------*/ - bool SwView::IsValidSelectionForThesaurus() const { // must not be a multi-selection, and if it is a selection it needs @@ -536,13 +523,11 @@ bool SwView::IsValidSelectionForThesaurus() const return !bMultiSel && (!bSelection || pWrtShell->IsSelOnePara() ); } - String SwView::GetThesaurusLookUpText( bool bSelection ) const { return bSelection ? pWrtShell->GetSelTxt() : pWrtShell->GetCurWord(); } - void SwView::InsertThesaurusSynonym( const String &rSynonmText, const String &rLookUpText, bool bSelection ) { sal_Bool bOldIns = pWrtShell->IsInsMode(); @@ -574,8 +559,8 @@ void SwView::InsertThesaurusSynonym( const String &rSynonmText, const String &rL // adjust existing selection SwPaM *pCrsr = pWrtShell->GetCrsr(); - pCrsr->GetPoint()->nContent/*.nIndex*/ -= nRight; - pCrsr->GetMark()->nContent/*.nIndex*/ += nLeft; + pCrsr->GetPoint()->nContent -= nRight; + pCrsr->GetMark()->nContent += nLeft; } pWrtShell->Insert( rSynonmText ); @@ -586,12 +571,9 @@ void SwView::InsertThesaurusSynonym( const String &rSynonmText, const String &rL pWrtShell->SetInsMode( bOldIns ); } - /*-------------------------------------------------------------------- Beschreibung: Thesaurus starten --------------------------------------------------------------------*/ - - void SwView::StartThesaurus() { if (!IsValidSelectionForThesaurus()) @@ -648,7 +630,6 @@ void SwView::StartThesaurus() /*-------------------------------------------------------------------- Beschreibung: Online-Vorschlaege anbieten *--------------------------------------------------------------------*/ - //!! Start of extra code for context menu modifying extensions struct ExecuteInfo { @@ -704,13 +685,13 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt) // default context menu. bool bUseGrammarContext = false; Reference< XSpellAlternatives > xAlt( pWrtShell->GetCorrection(&rPt, aToFill) ); - /*linguistic2::*/ProofreadingResult aGrammarCheckRes; - sal_Int32 nErrorPosInText = -1; + ProofreadingResult aGrammarCheckRes; sal_Int32 nErrorInResult = -1; uno::Sequence< rtl::OUString > aSuggestions; bool bCorrectionRes = false; if (!xAlt.is() || xAlt->getAlternatives().getLength() == 0) { + sal_Int32 nErrorPosInText = -1; bCorrectionRes = pWrtShell->GetGrammarCorrection( aGrammarCheckRes, nErrorPosInText, nErrorInResult, aSuggestions, &rPt, aToFill ); ::rtl::OUString aMessageText; if (nErrorInResult >= 0) @@ -734,7 +715,7 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt) aParaText = pNode->GetTxt(); // this may include hidden text but that should be Ok else { - DBG_ERROR( "text node expected but not found" ); + OSL_ENSURE(false, "text node expected but not found" ); } bRet = sal_True; @@ -756,8 +737,8 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt) aEvent.ExecutePosition.Y = aPixPos.Y(); Menu* pMenu = 0; - ::rtl::OUString sMenuName = ::rtl::OUString::createFromAscii( - bUseGrammarContext ? "private:resource/GrammarContextMenu" : "private:resource/SpellContextMenu"); + ::rtl::OUString sMenuName = bUseGrammarContext ? + OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/GrammarContextMenu")) : OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/SpellContextMenu")); if(TryContextMenuInterception( *pPopup, sMenuName, pMenu, aEvent )) { @@ -833,7 +814,6 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt) This function shows the popup menu for smarttag actions. */ - sal_Bool SwView::ExecSmartTagPopup( const Point& rPt ) { sal_Bool bRet = sal_False; @@ -864,58 +844,32 @@ sal_Bool SwView::ExecSmartTagPopup( const Point& rPt ) return bRet; } - - -class SwFieldPopup : public PopupMenu -{ -public: - SwFieldPopup() { - InsertItem(1, ::rtl::OUString::createFromAscii("Hello")); - } -}; - -class SwFieldListBox : public ListBox -{ -public: - SwFieldListBox(Window* pParent) : ListBox(pParent /*, WB_DROPDOWN*/) { - } - - void *GetImplWin() { - return NULL; //FIXME!!! -// return mpImplWin; - } - -protected: - virtual void LoseFocus() { -// printf("ListBox: lose focus!!\n"); - ListBox::LoseFocus(); - } - - virtual void Select() { -// printf("SELECT!!! IsTravelSelect=%i\n", IsTravelSelect()); - ListBox::Select(); - } -}; - -class SwFieldDialog : public Dialog +class SwFieldDialog : public FloatingWindow { private: - SwFieldListBox aListBox; - Edit aText; - int selection; + ListBox aListBox; + IFieldmark *pFieldmark; DECL_LINK( MyListBoxHandler, ListBox * ); public: - SwFieldDialog(Window* parent, IFieldmark *fieldBM) : Dialog(parent, WB_BORDER | WB_SYSTEMWINDOW | WB_NOSHADOW ), aListBox(this), aText(this, WB_RIGHT | WB_READONLY), selection(-1) { + SwFieldDialog( SwEditWin* parent, IFieldmark *fieldBM ); +}; - assert(fieldBM!=NULL); - if (fieldBM!=NULL) { +SwFieldDialog::SwFieldDialog( SwEditWin* parent, IFieldmark *fieldBM ) : + FloatingWindow( parent, WB_BORDER | WB_SYSTEMWINDOW ), + aListBox(this), + pFieldmark( fieldBM ) +{ + if ( fieldBM != NULL ) + { const IFieldmark::parameter_map_t* const pParameters = fieldBM->GetParameters(); - IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY)); + + rtl::OUString sListKey = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ODF_FORMDROPDOWN_LISTENTRY ) ); + IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find( sListKey ); if(pListEntries != pParameters->end()) { - Sequence< ::rtl::OUString> vListEntries; + Sequence< ::rtl::OUString > vListEntries; pListEntries->second >>= vListEntries; for( ::rtl::OUString* pCurrent = vListEntries.getArray(); pCurrent != vListEntries.getArray() + vListEntries.getLength(); @@ -924,82 +878,68 @@ public: aListBox.InsertEntry(*pCurrent); } } + + // Select the current one + rtl::OUString sResultKey = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_FORMDROPDOWN_RESULT ) ); + IFieldmark::parameter_map_t::const_iterator pResult = pParameters->find( sResultKey ); + if ( pResult != pParameters->end() ) + { + sal_Int32 nSelection = -1; + pResult->second >>= nSelection; + aListBox.SelectEntryPos( nSelection ); + } } + Size lbSize=aListBox.GetOptimalSize(WINDOWSIZE_PREFERRED); lbSize.Width()+=50; lbSize.Height()+=20; aListBox.SetSizePixel(lbSize); aListBox.SetSelectHdl( LINK( this, SwFieldDialog, MyListBoxHandler ) ); aListBox.Show(); - aText.SetText(rtl::OUString::createFromAscii("Cancel")); - Size tSize=aText.GetOptimalSize(WINDOWSIZE_PREFERRED); - aText.SetSizePixel(Size(lbSize.Width(), tSize.Height())); - aText.SetPosPixel(Point(0, lbSize.Height())); - aText.Show(); - SetSizePixel(Size(lbSize.Width(), lbSize.Height()+tSize.Height())); -// SetSizePixel(Size(200, 200)); - } - int getSelection() { - return selection; - } -protected: - /* - virtual void LoseFocus() { - printf("lose focus!!\n"); - Dialog::LoseFocus(); - printf("close:\n"); - EndDialog(8); - } - */ - - virtual long PreNotify( NotifyEvent& rNEvt ) { - if (rNEvt.GetType() == EVENT_LOSEFOCUS && aListBox.GetImplWin()==rNEvt.GetWindow()) { - EndDialog(8); - return 1; - } - if (rNEvt.GetType() == EVENT_KEYINPUT) { -// printf("PreNotify::KEYINPUT\n"); - } - return Dialog::PreNotify(rNEvt); - } -}; + SetSizePixel( lbSize ); +} IMPL_LINK( SwFieldDialog, MyListBoxHandler, ListBox *, pBox ) { -// printf("### DROP DOWN SELECT... IsTravelSelect=%i\n", pBox->IsTravelSelect()); - if (pBox->IsTravelSelect()) { - return 0; - } else { - this->selection=pBox->GetSelectEntryPos(); - EndDialog(9); //@TODO have meaningfull returns... - return 1; + short res = 0; + if ( !pBox->IsTravelSelect() ) + { + sal_Int32 selection = pBox->GetSelectEntryPos(); + if ( selection >= 0 ) + { + rtl::OUString sKey = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ODF_FORMDROPDOWN_RESULT ) ); + (*pFieldmark->GetParameters())[ sKey ] = makeAny(selection); + pFieldmark->Invalidate(); + SwView& rView = ( ( SwEditWin* )GetParent() )->GetView(); + rView.GetDocShell()->SetModified( sal_True ); + } + + EndPopupMode(); + res = 1; } + return res; } - -sal_Bool SwView::ExecFieldPopup( const Point& rPt, IFieldmark *fieldBM ) +IMPL_LINK( SwView, FieldPopupModeEndHdl, FloatingWindow*, EMPTYARG ) { - sal_Bool bRet = sal_False; - const sal_Bool bOldViewLock = pWrtShell->IsViewLocked(); - pWrtShell->LockView( sal_True ); - pWrtShell->Push(); + if ( mpFieldPopup ) + { + delete mpFieldPopup; + mpFieldPopup = NULL; + } + return 0; +} - bRet=sal_True; +void SwView::ExecFieldPopup( const Point& rPt, IFieldmark *fieldBM ) +{ const Point aPixPos = GetEditWin().LogicToPixel( rPt ); - SwFieldDialog aFldDlg(pEditWin, fieldBM); - aFldDlg.SetPosPixel(pEditWin->OutputToScreenPixel(aPixPos)); - - /*short ret=*/aFldDlg.Execute(); - sal_Int32 selection=aFldDlg.getSelection(); - if (selection>=0) { - (*fieldBM->GetParameters())[::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_RESULT)] = makeAny(selection); - } + mpFieldPopup = new SwFieldDialog( pEditWin, fieldBM ); + mpFieldPopup->SetPopupModeEndHdl( LINK( this, SwView, FieldPopupModeEndHdl ) ); - pWrtShell->Pop( sal_False ); - pWrtShell->LockView( bOldViewLock ); - - return bRet; + Rectangle aRect( pEditWin->OutputToScreenPixel( aPixPos ), Size( 0, 0 ) ); + mpFieldPopup->StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN|FLOATWIN_POPUPMODE_GRABFOCUS ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx index 9a58b0a79c..b321f32431 100644 --- a/sw/source/ui/uiview/viewmdi.cxx +++ b/sw/source/ui/uiview/viewmdi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - -#include <string> // HACK: prevent conflict between STLPORT and Workshop headers +#include <string> #include "hintids.hxx" #include <vcl/svapp.hxx> @@ -40,18 +39,12 @@ #include <svl/srchitem.hxx> #include <sfx2/request.hxx> #include <swmodule.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <viewopt.hxx> #include <frmatr.hxx> -#ifndef _WDOCSH_HXX #include <wdocsh.hxx> -#endif #include <uitool.hxx> #include <edtwin.hxx> #include <pagedesc.hxx> @@ -60,25 +53,13 @@ #include <workctrl.hxx> #include <usrpref.hxx> #include <scroll.hxx> -#ifndef _WVIEW_HXX #include <wview.hxx> -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _VIEW_HRC #include <view.hrc> -#endif -#ifndef _RIBBAR_HRC #include <ribbar.hrc> -#endif -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <IDocumentSettingAccess.hxx> #include <PostItMgr.hxx> @@ -142,15 +123,9 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, if( SVX_ZOOM_OPTIMAL == eZoomType ) { - if (pPostItMgr->HasNotes() && pPostItMgr->ShowNotes()) - { - lLeftMargin = long(rLRSpace.GetLeft()) + aPageRect.Left() + nLeftOfst; - } - else - { + if (!pPostItMgr->HasNotes() || !pPostItMgr->ShowNotes()) aPageSize.Width() -= ( rLRSpace.GetLeft() + rLRSpace.GetRight() + nLeftOfst * 2 ); - lLeftMargin = long(rLRSpace.GetLeft()) + aPageRect.Left() + nLeftOfst; - } + lLeftMargin = long(rLRSpace.GetLeft()) + DOCUMENTBORDER + nLeftOfst; nFac = aWindowSize.Width() * 100 / aPageSize.Width(); } else if(SVX_ZOOM_WHOLEPAGE == eZoomType || SVX_ZOOM_PAGEWIDTH == eZoomType ) @@ -167,7 +142,7 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, nFac = Min( nFac, nVisPercent ); } } - else /*if( SVX_ZOOM_PAGEWIDTH_NOBORDER == eZoomType )*/ + else { const long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width(); nFac = aWindowSize.Width() * 100 / nTmpWidth; @@ -239,15 +214,6 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, pWrtShell->UnlockPaint(); if( bUnLockView ) pWrtShell->LockView( sal_False ); - -// if ( mpPostItMgr ) -// { -// mpPostItMgr->Rescale(); -// mpPostItMgr->CalcRects(); -// mpPostItMgr->LayoutPostIts(); -// } - -// eZoom = eZoomType; } void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, sal_Bool bViewOnly ) @@ -307,13 +273,41 @@ void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, sal_Bool bViewO /* * Scrollbar - Handler */ +IMPL_LINK( SwView, WindowChildEventListener, VclSimpleEvent*, pEvent ) +{ + OSL_ENSURE( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" ); + if ( pEvent && pEvent->ISA( VclWindowEvent ) ) + { + VclWindowEvent *pVclEvent = static_cast< VclWindowEvent * >( pEvent ); + OSL_ENSURE( pVclEvent->GetWindow(), "Window???" ); + Window* pChildWin = static_cast< Window* >( pVclEvent->GetData() ); + + switch ( pVclEvent->GetId() ) + { + case VCLEVENT_WINDOW_HIDE: + if( pChildWin == pHScrollbar ) + ShowHScrollbar( sal_False ); + else if( pChildWin == pVScrollbar ) + ShowVScrollbar( sal_False ); + break; + case VCLEVENT_WINDOW_SHOW: + if( pChildWin == pHScrollbar ) + ShowHScrollbar( sal_True ); + else if( pChildWin == pVScrollbar ) + ShowVScrollbar( sal_True ); + break; + } + } + + return 0; +} int SwView::_CreateScrollbar( sal_Bool bHori ) { Window *pMDI = &GetViewFrame()->GetWindow(); SwScrollbar** ppScrollbar = bHori ? &pHScrollbar : &pVScrollbar; - ASSERT( !*ppScrollbar, "vorher abpruefen!" ) + OSL_ENSURE( !*ppScrollbar, "vorher abpruefen!" ); if( !bHori ) CreatePageButtons( !bShowAtResize ); @@ -328,6 +322,8 @@ int SwView::_CreateScrollbar( sal_Bool bHori ) (*ppScrollbar)->EnableDrag( sal_True ); + (*ppScrollbar)->SetAuto( sal_True ); + if(GetWindow()) InvalidateBorder(); @@ -376,9 +372,7 @@ IMPL_LINK( SwView, BtnPage, Button *, pButton ) Application::PostUserEvent( STATIC_LINK(this, SwView, MoveNavigationHdl), pbNext ); return 0; } -/*-----------------20.06.97 10:46------------------- ---------------------------------------------------*/ IMPL_STATIC_LINK( SwView, MoveNavigationHdl, bool *, pbNext ) { if ( !pbNext ) @@ -528,16 +522,6 @@ IMPL_STATIC_LINK( SwView, MoveNavigationHdl, bool *, pbNext ) return 0; } -/************************************************************************* -|* -|* SwView::CreateTab() -|* -|* Beschreibung -|* Ersterstellung VB 29.05.91 -|* Letzte Aenderung OS 09.05.96 -|* -*************************************************************************/ - int SwView::CreateTab() { pHRuler->SetActive(GetFrame() && IsActive()); @@ -547,16 +531,6 @@ int SwView::CreateTab() return 1; } -/************************************************************************* -|* -|* SwView::KillTab() -|* -|* Beschreibung -|* Ersterstellung VB 29.05.91 -|* Letzte Aenderung OS 09.05.96 -|* -*************************************************************************/ - int SwView::KillTab() { pHRuler->Hide(); @@ -581,28 +555,16 @@ void SwView::ChangeVLinealMetric( FieldUnit eUnit ) pVRuler->Invalidate(); } } -/* -----------------------------07.04.01 17:09-------------------------------- - ---------------------------------------------------------------------------*/ void SwView::GetVLinealMetric(FieldUnit& eToFill) const { eToFill = pVRuler->GetUnit(); } -/* -----------------------------07.04.01 17:09-------------------------------- - ---------------------------------------------------------------------------*/ void SwView::GetHLinealMetric(FieldUnit& eToFill) const { eToFill = pHRuler->GetUnit(); } -/************************************************************************* -|* -|* SwView::CreateVLineal() -|* -|* Beschreibung -|* Ersterstellung VB 29.05.91 -|* -*************************************************************************/ int SwView::CreateVLineal() { @@ -614,15 +576,6 @@ int SwView::CreateVLineal() return 1; } -/************************************************************************* -|* -|* SwView::KillVLineal() -|* -|* Beschreibung -|* Ersterstellung VB 29.05.91 -|* -*************************************************************************/ - int SwView::KillVLineal() { pVRuler->Hide(); @@ -630,15 +583,6 @@ int SwView::KillVLineal() InvalidateBorder(); return 1; } -/************************************************************************* -|* -|* SwView::ExecRulerClick() -|* -|* Beschreibung -|* Ersterstellung OS 15.06.95 -|* Letzte Aenderung -|* -*************************************************************************/ IMPL_LINK( SwView, ExecRulerClick, Ruler *, pRuler ) { @@ -664,18 +608,10 @@ IMPL_LINK( SwView, ExecRulerClick, Ruler *, pRuler ) return 0; } - -/*-----------------20.02.97 09:11------------------- - ---------------------------------------------------*/ - sal_uInt16 SwView::GetMoveType() { return nMoveType; } -/*-----------------20.02.97 09:11------------------- - ---------------------------------------------------*/ void SwView::SetMoveType(sal_uInt16 nSet) { @@ -695,18 +631,11 @@ void SwView::SetMoveType(sal_uInt16 nSet) } } -/*-----------------20.06.97 11:18------------------- - ---------------------------------------------------*/ void SwView::SetActMark(sal_Int32 nSet) { nActMark = nSet; } -/*-----------------15.03.97 10:53------------------- - ---------------------------------------------------*/ - void SwView::SetImageButtonColor(Color& rColor) { if(pPageUpBtn) @@ -715,40 +644,33 @@ void SwView::SetImageButtonColor(Color& rColor) pPageDownBtn->SetControlForeground(rColor); } } -/* -----------------------------2002/06/26 13:57------------------------------ - ---------------------------------------------------------------------------*/ void SwView::ShowHScrollbar(sal_Bool bShow) { - DBG_ASSERT(pHScrollbar, "Scrollbar invalid"); + OSL_ENSURE(pHScrollbar, "Scrollbar invalid"); pHScrollbar->ExtendedShow(bShow); } -/* -----------------------------2002/06/26 13:57------------------------------ - ---------------------------------------------------------------------------*/ sal_Bool SwView::IsHScrollbarVisible()const { - DBG_ASSERT(pHScrollbar, "Scrollbar invalid"); + OSL_ENSURE(pHScrollbar, "Scrollbar invalid"); return pHScrollbar->IsVisible( sal_False ) || pHScrollbar->IsAuto(); } -/* -----------------------------2002/06/26 13:57------------------------------ - ---------------------------------------------------------------------------*/ void SwView::ShowVScrollbar(sal_Bool bShow) { - DBG_ASSERT(pVScrollbar, "Scrollbar invalid"); + OSL_ENSURE(pVScrollbar, "Scrollbar invalid"); pVScrollbar->ExtendedShow(bShow); pPageUpBtn->Show(bShow); pPageDownBtn->Show(bShow); pNaviBtn->Show(bShow); } -/* -----------------------------2002/06/26 13:57------------------------------ - ---------------------------------------------------------------------------*/ sal_Bool SwView::IsVScrollbarVisible()const { - DBG_ASSERT(pVScrollbar, "Scrollbar invalid"); + OSL_ENSURE(pVScrollbar, "Scrollbar invalid"); return pVScrollbar->IsVisible( sal_False ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx index 05e60a203d..1d1c376593 100644 --- a/sw/source/ui/uiview/viewport.cxx +++ b/sw/source/ui/uiview/viewport.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,31 +29,22 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include "hintids.hxx" #include <vcl/help.hxx> #include <svx/ruler.hxx> #include <editeng/paperinf.hxx> #include <editeng/lrspitem.hxx> #include <sfx2/bindings.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <wrtsh.hxx> #include <swmodule.hxx> #include <viewopt.hxx> #include <frmatr.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <edtwin.hxx> #include <scroll.hxx> -#ifndef _WVIEW_HXX #include <wview.hxx> -#endif #include <usrpref.hxx> #include <pagedesc.hxx> #include <workctrl.hxx> @@ -88,8 +80,6 @@ inline long GetLeftMargin( SwView &rView ) lRet + DOCUMENTBORDER + nLeftOfst; } -//------------------------------------------------------------------------- - void lcl_GetPos(SwView* pView, Point& rPos, SwScrollbar* pScrollbar, @@ -107,8 +97,8 @@ void lcl_GetPos(SwView* pView, long lDelta = lPos - rSh.VisArea().Pos().*pPt; const long lSize = aDocSz.*pSz + lBorder; - // Bug 11693: sollte rechts oder unten zuviel Wiese sein, dann muss - // diese von der VisArea herausgerechnet werden! + // sollte rechts oder unten zuviel Wiese sein, dann muss + // diese von der VisArea herausgerechnet werden! long nTmp = pView->GetVisArea().Right()+lDelta; if ( bHori && nTmp > lSize ) lDelta -= nTmp - lSize; @@ -124,10 +114,9 @@ void lcl_GetPos(SwView* pView, /*-------------------------------------------------------------------- Beschreibung: Nullpunkt Lineal setzen --------------------------------------------------------------------*/ - void SwView::InvalidateRulerPos() { - static sal_uInt16 __READONLY_DATA aInval[] = + static sal_uInt16 aInval[] = { SID_ATTR_PARA_LRSPACE, SID_RULER_BORDERS, SID_RULER_PAGE_POS, SID_RULER_LR_MIN_MAX, SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE, @@ -140,7 +129,7 @@ void SwView::InvalidateRulerPos() GetViewFrame()->GetBindings().Invalidate(aInval); - DBG_ASSERT(pHRuler, "warum ist das Lineal nicht da?"); + OSL_ENSURE(pHRuler, "warum ist das Lineal nicht da?"); pHRuler->ForceUpdate(); pVRuler->ForceUpdate(); } @@ -150,7 +139,6 @@ void SwView::InvalidateRulerPos() viertel Bildschirm bis vor das Ende des Dokumentes gescrollt werden kann. --------------------------------------------------------------------*/ - long SwView::SetHScrollMax( long lMax ) { const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2; @@ -161,7 +149,6 @@ long SwView::SetHScrollMax( long lMax ) return Max( Min( lMax, lSize ), 0L ); } - long SwView::SetVScrollMax( long lMax ) { const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2; @@ -169,7 +156,6 @@ long SwView::SetVScrollMax( long lMax ) return Max( Min( lMax, lSize), 0L ); // siehe horz. } - Point SwView::AlignToPixel(const Point &rPt) const { return GetEditWin().PixelToLogic( GetEditWin().LogicToPixel( rPt ) ); @@ -178,7 +164,6 @@ Point SwView::AlignToPixel(const Point &rPt) const /*-------------------------------------------------------------------- Beschreibung: Dokumentgroesse hat sich geaendert --------------------------------------------------------------------*/ - void SwView::DocSzChgd(const Size &rSz) { @@ -229,7 +214,6 @@ aDocSz = rSz; /*-------------------------------------------------------------------- Beschreibung: Visarea neu setzen --------------------------------------------------------------------*/ - void SwView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollbar ) { const Size aOldSz( aVisArea.GetSize() ); @@ -323,7 +307,6 @@ void SwView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollbar ) /*-------------------------------------------------------------------- Beschreibung: Pos VisArea setzen --------------------------------------------------------------------*/ - void SwView::SetVisArea( const Point &rPt, sal_Bool bUpdateScrollbar ) { //einmal alignen, damit Brushes korrekt angesetzt werden. @@ -351,7 +334,6 @@ void SwView::SetVisArea( const Point &rPt, sal_Bool bUpdateScrollbar ) bUpdateScrollbar); } - void SwView::CheckVisArea() { pHScrollbar->SetAuto( pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) && @@ -379,7 +361,6 @@ void SwView::CheckVisArea() sal_uInt16 nRange optional exakte Angabe des Bereiches, um den ggfs. gescrollt werden soll --------------------------------------------------------------------*/ - void SwView::CalcPt( Point *pPt, const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRangeY) { @@ -427,13 +408,11 @@ void SwView::CalcPt( Point *pPt, const Rectangle &rRect, /*-------------------------------------------------------------------- Beschreibung: Scrolling --------------------------------------------------------------------*/ - sal_Bool SwView::IsScroll( const Rectangle &rRect ) const { return bCenterCrsr || bTopCrsr || !aVisArea.IsInside(rRect); } - void SwView::Scroll( const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRangeY ) { if ( aVisArea.IsEmpty() ) @@ -560,7 +539,6 @@ void SwView::Scroll( const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRan Beschreibung: Seitenweises Scrollen Liefern den Wert, um den bei PageUp / -Down gescrollt werden soll --------------------------------------------------------------------*/ - sal_Bool SwView::GetPageScrollUpOffset( SwTwips &rOff ) const { if ( !aVisArea.Top() || !aVisArea.GetHeight() ) @@ -575,7 +553,6 @@ sal_Bool SwView::GetPageScrollUpOffset( SwTwips &rOff ) const return sal_True; } - sal_Bool SwView::GetPageScrollDownOffset( SwTwips &rOff ) const { if ( !aVisArea.GetHeight() || @@ -593,7 +570,6 @@ sal_Bool SwView::GetPageScrollDownOffset( SwTwips &rOff ) const } // Seitenweises Blaettern - long SwView::PageUp() { if (!aVisArea.GetHeight()) @@ -606,7 +582,6 @@ long SwView::PageUp() return 1; } - long SwView::PageDown() { if ( !aVisArea.GetHeight() ) @@ -618,7 +593,6 @@ long SwView::PageDown() return 1; } - long SwView::PhyPageUp() { //aktuell sichtbare Seite erfragen, nicht formatieren @@ -639,7 +613,6 @@ long SwView::PhyPageUp() return 1; } - long SwView::PhyPageDown() { //aktuell sichtbare Seite erfragen, nicht formatieren @@ -659,7 +632,6 @@ long SwView::PhyPageDown() return 1; } - long SwView::PageUpCrsr( sal_Bool bSelect ) { if ( !bSelect ) @@ -686,7 +658,6 @@ long SwView::PageUpCrsr( sal_Bool bSelect ) return sal_False; } - long SwView::PageDownCrsr(sal_Bool bSelect) { SwTwips lOff = 0; @@ -704,7 +675,6 @@ long SwView::PageDownCrsr(sal_Bool bSelect) /*------------------------------------------------------------------------ Beschreibung: Handler der Scrollbars ------------------------------------------------------------------------*/ - IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar ) { if ( GetWrtShell().ActionPend() ) @@ -717,8 +687,8 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar ) pScrollbar->GetType() == SCROLL_DRAG) { //Hier wieder auskommentieren wenn das mitscrollen nicht gewuenscht ist. - // JP 21.07.00: the end scrollhandler invalidate the FN_STAT_PAGE, - // so we dont must do it agin. + // the end scrollhandler invalidate the FN_STAT_PAGE, + // so we dont must do it agin. EndScrollHdl(pScrollbar); Point aPos( aVisArea.TopLeft() ); @@ -730,10 +700,6 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar ) String sDisplay; if(pWrtShell->GetPageNumber( aPos.Y(), sal_False, nPhNum, nVirtNum, sDisplay )) { - // JP 21.07.00: the end scrollhandler invalidate the FN_STAT_PAGE, - // so we dont must do it agin. -// if(!GetViewFrame()->GetFrame().IsInPlace()) -// S F X_BINDINGS().Update(FN_STAT_PAGE); //QuickHelp: if( pWrtShell->GetPageCnt() > 1 && Help::IsQuickHelpEnabled() ) @@ -775,10 +741,10 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar ) return 0; } + /*------------------------------------------------------------------------ Beschreibung: Handler der Scrollbars ------------------------------------------------------------------------*/ - IMPL_LINK( SwView, EndScrollHdl, SwScrollbar *, pScrollbar ) { if ( !GetWrtShell().ActionPend() ) @@ -803,12 +769,9 @@ IMPL_LINK( SwView, EndScrollHdl, SwScrollbar *, pScrollbar ) /*-------------------------------------------------------------------- Beschreibung: - berechnet die Groesse von aVisArea abhaengig von der Groesse des EditWin auf dem Schirm. - --------------------------------------------------------------------*/ - void SwView::CalcVisArea( const Size &rOutPixel ) { Point aTopLeft; @@ -852,8 +815,6 @@ void SwView::CalcVisArea( const Size &rOutPixel ) /*-------------------------------------------------------------------- Beschreibung: Bedienelemente neu anordnen --------------------------------------------------------------------*/ - - void SwView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*/ ) { sal_Bool bRightVRuler = pWrtShell->GetViewOptions()->IsVRulerRight(); @@ -866,7 +827,7 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*/ ) rToFill.Left() = nWidth; } - DBG_ASSERT(pHRuler, "warum ist das Lineal nicht da?"); + OSL_ENSURE(pHRuler, "warum ist das Lineal nicht da?"); if ( pHRuler->IsVisible() ) rToFill.Top() = pHRuler->GetSizePixel().Height(); @@ -887,7 +848,6 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*/ ) SetBorderPixel( rToFill ); } - void ViewResizePixel( const Window &rRef, const Point &rOfst, const Size &rSize, @@ -946,7 +906,7 @@ void ViewResizePixel( const Window &rRef, if(!aSize.Height()) aSize.Height() = pHLineal->GetSizePixel().Height(); pHLineal->SetPosSizePixel( rOfst, aSize ); -// #46802 VCL ruft an unsichtbaren Fenstern kein Resize +// VCL ruft an unsichtbaren Fenstern kein Resize // fuer das Lineal ist das aber keine gute Idee if(!pHLineal->IsVisible()) pHLineal->Resize(); @@ -984,7 +944,7 @@ void ViewResizePixel( const Window &rRef, Size aImgSz( nVBSzWidth, nVBSzWidth ); - //#55949# wenn der Platz fuer Scrollbar und Page-Buttons zu klein wird, dann + // wenn der Platz fuer Scrollbar und Page-Buttons zu klein wird, dann // werden die Buttons versteckt sal_uInt16 nCnt = pNaviBtn ? 3 : 2; long nSubSize = (aImgSz.Width() * nCnt ); @@ -1021,7 +981,6 @@ void ViewResizePixel( const Window &rRef, } } - void SwView::ShowAtResize() { bShowAtResize = sal_False; @@ -1029,7 +988,6 @@ void SwView::ShowAtResize() pHRuler->Show(); } - void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize ) { Size aObjSize = GetObjectShell()->GetVisArea().GetSize(); @@ -1112,10 +1070,9 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize ) bInInnerResizePixel = sal_False; } - void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) { - // FME 22.08.2003 #i16909# - return, if no size (caused by minimize window). + // #i16909# return, if no size (caused by minimize window). if ( bInOuterResizePixel || ( !rSize.Width() && !rSize.Height() ) ) return; bInOuterResizePixel = sal_True; @@ -1135,6 +1092,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) { bShowH = pVOpt->IsViewHScrollBar(); bShowV = pVOpt->IsViewVScrollBar(); + bAuto = bHAuto = sal_True; break; } } @@ -1156,10 +1114,10 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) { bShowH = bShowV = bHAuto = bAuto = sal_False; } - if(pHScrollbar->IsVisible(sal_False) != bShowH) + if(pHScrollbar->IsVisible(sal_False) != bShowH && !bHAuto) ShowHScrollbar(bShowH); pHScrollbar->SetAuto( bHAuto ); - if(pVScrollbar->IsVisible(sal_False) != bShowV) + if(pVScrollbar->IsVisible(sal_False) != bShowV && !bAuto) ShowVScrollbar(bShowV); pVScrollbar->SetAuto(bAuto); @@ -1194,7 +1152,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) //nicht mehr zum aktuell sichtbaren Bereich passen pWrtShell->ResetCursorStack(); - ASSERT( !GetEditWin().IsVisible() || + OSL_ENSURE( !GetEditWin().IsVisible() || (( aEditSz.Width() > 0 && aEditSz.Height() > 0 ) || !aVisArea.IsEmpty()), "Small world, isn't it?" ); @@ -1259,7 +1217,6 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) } } - void SwView::SetZoomFactor( const Fraction &rX, const Fraction &rY ) { const Fraction &rFrac = rX < rY ? rX : rY; @@ -1270,7 +1227,6 @@ void SwView::SetZoomFactor( const Fraction &rX, const Fraction &rY ) SfxViewShell::SetZoomFactor( rX, rY ); } - Size SwView::GetOptimalSizePixel() const { Size aPgSize; @@ -1292,7 +1248,6 @@ Size SwView::GetOptimalSizePixel() const return GetEditWin().LogicToPixel( aPgSize ); } - sal_Bool SwView::UpdateScrollbars() { sal_Bool bRet = sal_False; @@ -1341,11 +1296,10 @@ sal_Bool SwView::UpdateScrollbars() return bRet; } - void SwView::Move() { if ( GetWrtShell().IsInSelect() ) - GetWrtShell().EndSelect(); //#32427# + GetWrtShell().EndSelect(); SfxViewShell::Move(); } @@ -1381,4 +1335,4 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt ) return bOk; } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx index 4387fb2cec..58efdb46f5 100644 --- a/sw/source/ui/uiview/viewprt.cxx +++ b/sw/source/ui/uiview/viewprt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,13 +31,9 @@ #include <com/sun/star/text/NotePrintMode.hpp> -#if STLPORT_VERSION>=321 #include <cstdarg> -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif #ifndef _SVSTDARR_HXX #define _SVSTDARR_STRINGSDTOR @@ -46,7 +43,6 @@ #include <sfx2/progress.hxx> #include <sfx2/app.hxx> -#include <svl/flagitem.hxx> #include <vcl/msgbox.hxx> #include <vcl/oldprintadaptor.hxx> #include <sfx2/printer.hxx> @@ -82,7 +78,6 @@ #include <globals.hrc> #include <view.hrc> #include <app.hrc> -#include <svl/eitem.hxx> #include <swwrtshitem.hxx> #include "swabstdlg.hxx" #include <svl/slstitm.hxx> @@ -91,13 +86,10 @@ using namespace ::com::sun::star; - /*-------------------------------------------------------------------- Beschreibung: Drucker an Sfx uebergeben --------------------------------------------------------------------*/ - - -SfxPrinter* __EXPORT SwView::GetPrinter( sal_Bool bCreate ) +SfxPrinter* SwView::GetPrinter( sal_Bool bCreate ) { const IDocumentDeviceAccess* pIDDA = GetWrtShell().getIDocumentDeviceAccess(); SfxPrinter *pOld = pIDDA->getPrinter( false ); @@ -113,7 +105,6 @@ SfxPrinter* __EXPORT SwView::GetPrinter( sal_Bool bCreate ) /*-------------------------------------------------------------------- Beschreibung: Druckerwechsel weitermelden --------------------------------------------------------------------*/ - void SetPrinter( IDocumentDeviceAccess* pIDDA, SfxPrinter* pNew, sal_Bool bWeb ) { SwPrintOptions* pOpt = SW_MOD()->GetPrtOptions(bWeb); @@ -134,8 +125,7 @@ void SetPrinter( IDocumentDeviceAccess* pIDDA, SfxPrinter* pNew, sal_Bool bWeb ) } } - -sal_uInt16 __EXPORT SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool ) +sal_uInt16 SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool ) { SwWrtShell &rSh = GetWrtShell(); SfxPrinter* pOld = rSh.getIDocumentDeviceAccess()->getPrinter( false ); @@ -174,8 +164,7 @@ sal_uInt16 __EXPORT SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, /*-------------------------------------------------------------------- Beschreibung: TabPage fuer applikationsspezifische Druckoptionen --------------------------------------------------------------------*/ - -SfxTabPage* __EXPORT SwView::CreatePrintOptionsPage(Window* pParent, +SfxTabPage* SwView::CreatePrintOptionsPage(Window* pParent, const SfxItemSet& rSet) { return ::CreatePrintOptionsPage( pParent, rSet, sal_False ); @@ -184,8 +173,7 @@ SfxTabPage* __EXPORT SwView::CreatePrintOptionsPage(Window* pParent, /*-------------------------------------------------------------------- Beschreibung: Print-Dispatcher --------------------------------------------------------------------*/ - -void __EXPORT SwView::ExecutePrint(SfxRequest& rReq) +void SwView::ExecutePrint(SfxRequest& rReq) { sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this); ::SetAppPrintOptions( &GetWrtShell(), bWeb ); @@ -246,8 +234,7 @@ void __EXPORT SwView::ExecutePrint(SfxRequest& rReq) } else if( rReq.GetSlot() == SID_PRINTDOCDIRECT && ! bSilent ) { - if( /*!bIsAPI && */ - ( pSh->IsSelection() || pSh->IsFrmSelected() || pSh->IsObjSelected() ) ) + if( ( pSh->IsSelection() || pSh->IsFrmSelected() || pSh->IsObjSelected() ) ) { short nBtn = SvxPrtQryBox(&GetEditWin()).Execute(); if( RET_CANCEL == nBtn ) @@ -270,7 +257,7 @@ void __EXPORT SwView::ExecutePrint(SfxRequest& rReq) return; } default: - ASSERT(!this, falscher Dispatcher); + OSL_ENSURE(!this, "wrong dispatcher"); return; } } @@ -279,26 +266,31 @@ void __EXPORT SwView::ExecutePrint(SfxRequest& rReq) Beschreibung: Page Drucker/Zusaetze erzeugen fuer SwView und SwPagePreview --------------------------------------------------------------------*/ - SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions, sal_Bool bPreview ) { - SfxTabPage* pPage = NULL; SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - if ( pFact ) - { - ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( TP_OPTPRINT_PAGE ); - if ( fnCreatePage ) - pPage = (*fnCreatePage)( pParent, rOptions ); - } + OSL_ENSURE(pFact, "No Print Dialog"); + if (!pFact) + return NULL; + + ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc(TP_OPTPRINT_PAGE); + OSL_ENSURE(pFact, "No Page Creator"); + if (!fnCreatePage) + return NULL; + + SfxTabPage* pPage = (*fnCreatePage)(pParent, rOptions); + OSL_ENSURE(pPage, "No page"); + if (!pPage) + return NULL; + SfxAllItemSet aSet(*(rOptions.GetPool())); - aSet.Put (SfxBoolItem(SID_PREVIEWFLAG_TYPE, bPreview)); - aSet.Put (SfxBoolItem(SID_FAX_LIST, sal_True)); + aSet.Put(SfxBoolItem(SID_PREVIEWFLAG_TYPE, bPreview)); + aSet.Put(SfxBoolItem(SID_FAX_LIST, sal_True)); pPage->PageCreated(aSet); return pPage; } - void SetAppPrintOptions( ViewShell* pSh, sal_Bool bWeb ) { const IDocumentDeviceAccess* pIDDA = pSh->getIDocumentDeviceAccess(); @@ -331,3 +323,5 @@ void SetAppPrintOptions( ViewShell* pSh, sal_Bool bWeb ) } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx index 0088ce1252..5a21b7aafb 100644 --- a/sw/source/ui/uiview/viewsrch.cxx +++ b/sw/source/ui/uiview/viewsrch.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,8 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -#include <string> // HACK: prevent conflict between STLPORT and Workshop headers +#include <string> #include <hintids.hxx> #include <com/sun/star/util/SearchOptions.hpp> #include <svl/cjkoptions.hxx> @@ -42,6 +42,7 @@ #include <svl/itempool.hxx> #include <svl/eitem.hxx> #include <svl/srchitem.hxx> +#include <sal/macros.h> #include <sfx2/request.hxx> #include <svx/srchdlg.hxx> #include <vcl/msgbox.hxx> @@ -96,12 +97,6 @@ inline Window* GetParentWindow( SvxSearchDialog* pSrchDlg ) return pWin; } - -/*-----------------12.04.97 13:04------------------- - ---------------------------------------------------*/ - - void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) { const SfxItemSet* pArgs = rReq.GetArgs(); @@ -195,14 +190,14 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) if (nSlot == FN_REPEAT_SEARCH) { - ASSERT(pSrchItem, "Search-Item fehlt"); + OSL_ENSURE(pSrchItem, "SearchItem missing"); if( !pSrchItem ) pSrchItem = new SvxSearchItem(SID_SEARCH_ITEM); } else { // SearchItem aus Request besorgen - ASSERT(pArgs, "Args fehlen"); + OSL_ENSURE(pArgs, "Args missing"); if ( pArgs ) { delete pSrchItem; @@ -288,7 +283,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) case SVX_SEARCHCMD_REPLACE_ALL: { SwSearchOptions aOpts( pWrtShell, pSrchItem->GetBackward() ); - + SwCrsrSaveState aSaveCursor( *pWrtShell->GetSwCrsr()); if( !pSrchItem->GetSelection() ) { @@ -308,8 +303,11 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) SwWait aWait( *GetDocShell(), sal_True ); pWrtShell->StartAllAction(); nFound = FUNC_Search( aOpts ); + // #i8288# Now that everything has been replaced, restore the original cursor position. + pWrtShell->GetSwCrsr()->RestoreSavePos(); // (position saved by SwCrsrSaveState above) pWrtShell->EndAllAction(); } + rReq.SetReturnValue(SfxBoolItem(nSlot, nFound != 0 && ULONG_MAX != nFound)); if( !nFound ) { @@ -378,16 +376,16 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) SvUShorts aArr( 0, 16 ); aArr.Insert( aNormalAttr, - sizeof( aNormalAttr ) / sizeof( aNormalAttr[0] ), + SAL_N_ELEMENTS( aNormalAttr ), 0 ); if( SW_MOD()->GetCTLOptions().IsCTLFontEnabled() ) aArr.Insert( aCTLAttr, - sizeof( aCTLAttr ) / sizeof( aCTLAttr[0] ), + SAL_N_ELEMENTS( aCTLAttr ), 14 ); SvtCJKOptions aCJKOpt; if( aCJKOpt.IsAnyEnabled() ) aArr.Insert( aCJKAttr, - sizeof( aCJKAttr ) / sizeof( aCJKAttr[0] ), + SAL_N_ELEMENTS( aCJKAttr ), 14 ); SfxItemSet aSet( pWrtShell->GetAttrPool(), aArr.GetData() ); @@ -412,13 +410,13 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) } break; default: -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 if(nSlot) { ByteString sStr( "nSlot: " ); sStr += ByteString::CreateFromInt32( nSlot ); - sStr += " falscher Dispatcher (viewsrch.cxx)"; - DBG_ERROR( sStr.GetBuffer() ); + sStr += " wrong Dispatcher (viewsrch.cxx)"; + OSL_ENSURE(false, sStr.GetBuffer() ); } #endif return; @@ -579,13 +577,13 @@ void SwView::Replace() aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS)); aRewriter.AddRule(UNDO_ARG3, pSrchItem->GetReplaceString()); - pWrtShell->StartUndo(UNDO_UI_REPLACE_STYLE, &aRewriter); // #111827# + pWrtShell->StartUndo(UNDO_UI_REPLACE_STYLE, &aRewriter); pWrtShell->SetTxtFmtColl( pWrtShell->GetParaStyle( pSrchItem->GetReplaceString(), SwWrtShell::GETSTYLE_CREATESOME )); - pWrtShell->EndUndo(); // #111827# + pWrtShell->EndUndo(); } else { @@ -639,7 +637,7 @@ sal_uLong SwView::FUNC_Search( const SwSearchOptions& rOptions ) pWrtShell->SttSelect(); - static sal_uInt16 __READONLY_DATA aSearchAttrRange[] = { + static sal_uInt16 aSearchAttrRange[] = { RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, @@ -767,38 +765,6 @@ void SwView::StateSearch(SfxItemSet &rSet) rSet.Put( *pSrchItem ); } break; - -/* case SID_SEARCH_REPLACESET: - case SID_SEARCH_SEARCHSET: - { - static sal_uInt16 __READONLY_DATA aSearchAttrRange[] = - { - RES_CHRATR_CASEMAP, RES_CHRATR_POSTURE, - RES_CHRATR_SHADOWED, RES_CHRATR_WORDLINEMODE, - RES_PARATR_LINESPACING, RES_PARATR_HYPHENZONE, - RES_LR_SPACE, RES_UL_SPACE, - SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP, - 0 - }; - - SfxItemSet aSet(pWrtShell->GetAttrPool(), aSearchAttrRange ); - if( SID_SEARCH_REPLACESET==nWhich ) - { - if( pReplList ) - { - pReplList->Get( aSet ); - DELETEZ( pReplList ); - } - } - else if( pSrchList ) - { - pSrchList->Get( aSet ); - DELETEZ( pSrchList ); - } - rSet.Put( SvxSetItem( nWhich, aSet )); - } - break; -*/ } nWhich = aIter.NextWhich(); } @@ -806,3 +772,4 @@ void SwView::StateSearch(SfxItemSet &rSet) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx index 2bbc325f54..3e7406867d 100644 --- a/sw/source/ui/uiview/viewstat.cxx +++ b/sw/source/ui/uiview/viewstat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -69,10 +70,6 @@ using namespace ::com::sun::star; -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwView::GetState(SfxItemSet &rSet) { SfxWhichIter aIter(rSet); @@ -161,8 +158,8 @@ void SwView::GetState(SfxItemSet &rSet) break; case SID_UNDO: { - //JP 21.07.98: Bug 53429 - die muss noch nicht vorhanden sein - // also lasse sie mal anlegen: + // die muss noch nicht vorhanden sein + // also lasse sie mal anlegen: if( !pShell ) SelectShell(); @@ -335,7 +332,6 @@ void SwView::GetState(SfxItemSet &rSet) case SID_DOCUMENT_COMPARE: case SID_DOCUMENT_MERGE: if( GetDocShell()->IsA( SwGlobalDocShell::StaticType() ) || -// pWrtShell->IsAnySectionInDoc( sal_True, sal_True, sal_True )|| (SID_DOCUMENT_MERGE == nWhich && pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength())) rSet.DisableItem(nWhich); break; @@ -436,11 +432,6 @@ void SwView::GetState(SfxItemSet &rSet) } } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwView::GetDrawState(SfxItemSet &rSet) { SfxWhichIter aIter(rSet); @@ -468,7 +459,6 @@ void SwView::GetDrawState(SfxItemSet &rSet) case SID_SHOW_HIDDEN: case SID_SHOW_FORMS: rSet.DisableItem( nWhich ); - // rSet.Put( SfxBoolItem(nWhich,sal_True )); break; case SID_DRAW_TEXT_MARQUEE: @@ -506,10 +496,6 @@ void SwView::GetDrawState(SfxItemSet &rSet) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool SwView::HasUIFeature( sal_uInt32 nFeature ) { sal_Bool bRet = sal_False; @@ -521,3 +507,4 @@ sal_Bool SwView::HasUIFeature( sal_uInt32 nFeature ) return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx index 806831d334..4504e55c6d 100644 --- a/sw/source/ui/uiview/viewtab.cxx +++ b/sw/source/ui/uiview/viewtab.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -28,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -#include <tools/list.hxx> - #include <hintids.hxx> #include "uitool.hxx" #include <sfx2/app.hxx> @@ -65,10 +63,8 @@ #include "fmtcol.hxx" #include "section.hxx" -// -> #i23726# #include "ndtxt.hxx" #include "pam.hxx" -// <- #i23726# #include <IDocumentSettingAccess.hxx> @@ -79,12 +75,9 @@ using namespace ::com::sun::star; Beschreibung: Debug-Methode --------------------------------------------------------------------*/ - /*-------------------------------------------------------------------- Beschreibung: Columns eintueten --------------------------------------------------------------------*/ - - void lcl_FillSvxColumn(const SwFmtCol& rCol, sal_uInt16 nTotalWidth, SvxColumnItem& rColItem, @@ -126,14 +119,12 @@ void lcl_FillSvxColumn(const SwFmtCol& rCol, /*-------------------------------------------------------------------- Beschreibung: ColumnItem in ColumnInfo ueberfuehren --------------------------------------------------------------------*/ - - void lcl_ConvertToCols(const SvxColumnItem& rColItem, sal_uInt16 nTotalWidth, SwFmtCol& rCols) { - ASSERT( rCols.GetNumCols() == rColItem.Count(), "Column count mismatch" ); - // #126939# ruler executes that change the columns shortly after the selection has changed + OSL_ENSURE( rCols.GetNumCols() == rColItem.Count(), "Column count mismatch" ); + // ruler executes that change the columns shortly after the selection has changed // can result in a crash if(rCols.GetNumCols() != rColItem.Count()) return; @@ -146,7 +137,7 @@ void lcl_ConvertToCols(const SvxColumnItem& rColItem, // Tabcols der Reihe nach for( sal_uInt16 i=0; i < rColItem.Count()-1; ++i ) { - DBG_ASSERT(rColItem[i+1].nStart >= rColItem[i].nEnd,"\201berlappende Spalten" ); + OSL_ENSURE(rColItem[i+1].nStart >= rColItem[i].nEnd,"overlapping columns" ); sal_uInt16 nStart = static_cast< sal_uInt16 >(rColItem[i+1].nStart); sal_uInt16 nEnd = static_cast< sal_uInt16 >(rColItem[i].nEnd); if(nStart < nEnd) @@ -178,8 +169,6 @@ void lcl_ConvertToCols(const SvxColumnItem& rColItem, /*-------------------------------------------------------------------- Beschreibung: Tabs loeschen --------------------------------------------------------------------*/ - - void lcl_EraseDefTabs(SvxTabStopItem& rTabStops) { // Def Tabs loeschen @@ -199,8 +188,6 @@ void lcl_EraseDefTabs(SvxTabStopItem& rTabStops) /*-------------------------------------------------------------------- Beschreibung: Seitenrand umdrehen --------------------------------------------------------------------*/ - - void SwView::SwapPageMargin(const SwPageDesc& rDesc, SvxLRSpaceItem& rLRSpace) { sal_uInt16 nPhyPage, nVirPage; @@ -218,8 +205,6 @@ void SwView::SwapPageMargin(const SwPageDesc& rDesc, SvxLRSpaceItem& rLRSpace) Beschreibung: Wenn der Rahmenrand verschoben wird, sollen die Spaltentrenner an der gleichen absoluten Position bleiben --------------------------------------------------------------------*/ - - void lcl_Scale(long& nVal, long nScale) { nVal *= nScale; @@ -264,12 +249,11 @@ void ResizeFrameCols(SwFmtCol& rCol, //reset auto width rCol.SetOrtho(sal_False, 0, 0 ); } + /*-------------------------------------------------------------------- Beschreibung: Hier werden alle Aenderungen der Tableiste wieder in das Modell geschossen --------------------------------------------------------------------*/ - - void SwView::ExecTabWin( SfxRequest& rReq ) { SwWrtShell &rSh = GetWrtShell(); @@ -604,21 +588,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) { SvxLRSpaceItem aParaMargin((const SvxLRSpaceItem&)rReq. GetArgs()->Get(nSlot)); - if(nFrmType & FRMTYPE_FLY_ANY) - { - sal_Bool bFirstColumn = sal_True; - sal_Bool bLastColumn = sal_True; - if(nFrmType & FRMTYPE_COLUMN) - { - sal_uInt16 nCurFrameCol = rSh.GetCurColNum() - 1; - bFirstColumn = !nCurFrameCol; - const SwFrmFmt* pFmt = rSh.GetFlyFrmFmt(); - const SwFmtCol* pCols = &pFmt->GetCol(); - const SwColumns& rCols = pCols->GetColumns(); - sal_uInt16 nColumnCount = rCols.Count(); - bLastColumn = nColumnCount == nCurFrameCol + 1; - } - } + aParaMargin.SetRight( aParaMargin.GetRight() - nRightBorderDistance ); aParaMargin.SetTxtLeft(aParaMargin.GetTxtLeft() - nLeftBorderDistance ); @@ -628,7 +598,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) // #i23726# if (pNumRuleNodeFromDoc) { - // --> FME 2005-02-22 #i42922# Mouse move of numbering label + // --> #i42922# Mouse move of numbering label // has to consider the left indent of the paragraph SfxItemSet aSet( GetPool(), RES_LR_SPACE, RES_LR_SPACE ); rSh.GetCurAttr( aSet ); @@ -637,11 +607,9 @@ void SwView::ExecTabWin( SfxRequest& rReq ) // <-- SwPosition aPos(*pNumRuleNodeFromDoc); - // --> OD 2008-06-09 #i90078# + // #i90078# rSh.SetIndent( static_cast< short >(aParaMargin.GetTxtLeft() - rLR.GetTxtLeft()), aPos); - // <-- - // --> OD 2005-02-18 #i42921# - invalidate state of indent in order - // to get a ruler update. + // #i42921# invalidate state of indent in order to get a ruler update. aParaMargin.SetWhich( nSlot ); GetViewFrame()->GetBindings().SetState( aParaMargin ); // <-- @@ -705,7 +673,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if( bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()) ) { - ASSERT(aColItem.Count(), "ColDesc ist leer!!"); + OSL_ENSURE(aColItem.Count(), "ColDesc is empty!!"); const sal_Bool bSingleLine = ((const SfxBoolItem&)rReq. GetArgs()->Get(SID_RULER_ACT_LINE_ONLY)).GetValue(); @@ -722,13 +690,6 @@ void SwView::ExecTabWin( SfxRequest& rReq ) nBorder = (bVerticalWriting ? nPageHeight : nPageWidth) - aTabCols.GetLeftMin() - aColItem.GetRight(); -#ifdef DEBUG - long nTmp1 = nPageWidth; - long nTmp2 = aTabCols.GetLeftMin() + nBorder; - (void)nTmp1; - (void)nTmp2; -#endif - if ( aColItem.GetRight() > 0 ) aTabCols.SetRight( nBorder ); @@ -742,7 +703,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if(bIsTableRTL) { sal_uInt16 nColCount = aColItem.Count() - 1; - for ( sal_uInt16 i = 0; i < nColCount; ++i ) + for ( sal_uInt16 i = 0; i < nColCount && i < aTabCols.Count(); ++i ) { const SvxColumnDescription& rCol = aColItem[nColCount - i]; aTabCols[i] = aTabCols.GetRight() - rCol.nStart; @@ -751,7 +712,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) } else { - for ( sal_uInt16 i = 0; i < aColItem.Count()-1; ++i ) + for ( sal_uInt16 i = 0; i < aColItem.Count()-1 && i < aTabCols.Count(); ++i ) { const SvxColumnDescription& rCol = aColItem[i]; aTabCols[i] = rCol.nEnd + aTabCols.GetLeft(); @@ -782,7 +743,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if(bSect) { const SwSection *pSect = rSh.GetAnySection(); - ASSERT( pSect, "Welcher Bereich?"); + OSL_ENSURE( pSect, "Which section?"); pSectFmt = pSect->GetFmt(); } else @@ -837,7 +798,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if( bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()) ) { - ASSERT(aColItem.Count(), "ColDesc ist leer!!"); + OSL_ENSURE(aColItem.Count(), "ColDesc is empty!!"); SwTabCols aTabCols; if ( bSetTabRowFromDoc ) @@ -895,7 +856,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) break; default: - ASSERT( !this, "Falsche SlotId"); + OSL_ENSURE( !this, "wrong SlotId"); } rSh.EndAllAction(); @@ -911,8 +872,6 @@ void SwView::ExecTabWin( SfxRequest& rReq ) sprich alle relevanten Attribute an der CursorPos werden der Tableiste uebermittelt --------------------------------------------------------------------*/ - - void SwView::StateTabWin(SfxItemSet& rSet) { SwWrtShell &rSh = GetWrtShell(); @@ -954,10 +913,8 @@ void SwView::StateTabWin(SfxItemSet& rSet) SfxItemSet aCoreSet( GetPool(), RES_PARATR_TABSTOP, RES_PARATR_TABSTOP, RES_LR_SPACE, RES_UL_SPACE, 0 ); - // --> OD 2008-01-17 #newlistlevelattrs# // get also the list level indent values merged as LR-SPACE item, if needed. rSh.GetCurAttr( aCoreSet, true ); - // <-- SelectionType nSelType = rSh.GetSelectionType(); SfxWhichIter aIter( rSet ); @@ -968,8 +925,6 @@ void SwView::StateTabWin(SfxItemSet& rSet) { switch ( nWhich ) { -// case RES_LR_SPACE: -// case SID_ATTR_LRSPACE: case SID_ATTR_LONG_LRSPACE: { SvxLongLRSpaceItem aLongLR( (long)aPageLRSpace.GetLeft(), @@ -1032,8 +987,6 @@ void SwView::StateTabWin(SfxItemSet& rSet) break; } case SID_ATTR_LONG_ULSPACE: -// case SID_ATTR_ULSPACE: -// case RES_UL_SPACE: { // Rand Seite Oben Unten SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() ); @@ -1083,13 +1036,13 @@ void SwView::StateTabWin(SfxItemSet& rSet) if ( ISA( SwWebView ) || IsTabColFromDoc() || IsTabRowFromDoc() || - ( nSelType & nsSelectionType::SEL_GRF) || - (nSelType & nsSelectionType::SEL_FRM) || - (nSelType & nsSelectionType::SEL_OLE) || - SFX_ITEM_AVAILABLE > aCoreSet.GetItemState(RES_LR_SPACE)|| - (!bVerticalWriting && (SID_ATTR_TABSTOP_VERTICAL == nWhich))|| - (bVerticalWriting && (RES_PARATR_TABSTOP == nWhich)) - ) + ( nSelType & nsSelectionType::SEL_GRF ) || + ( nSelType & nsSelectionType::SEL_FRM ) || + ( nSelType & nsSelectionType::SEL_OLE ) || + ( SFX_ITEM_AVAILABLE > aCoreSet.GetItemState(RES_LR_SPACE) ) || + (!bVerticalWriting && (SID_ATTR_TABSTOP_VERTICAL == nWhich) ) || + ( bVerticalWriting && (RES_PARATR_TABSTOP == nWhich)) + ) rSet.DisableItem( nWhich ); else { @@ -1099,7 +1052,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) const SvxTabStopItem& rDefTabs = (const SvxTabStopItem&) rSh.GetDefault(RES_PARATR_TABSTOP); - DBG_ASSERT(pHRuler, "warum ist das Lineal nicht da?"); + OSL_ENSURE(pHRuler, "why is there no ruler?"); long nDefTabDist = ::GetTabDist(rDefTabs); pHRuler->SetDefTabDist( nDefTabDist ); pVRuler->SetDefTabDist( nDefTabDist ); @@ -1112,12 +1065,12 @@ void SwView::StateTabWin(SfxItemSet& rSet) case SID_ATTR_PARA_LRSPACE: { if ( nSelType & nsSelectionType::SEL_GRF || - nSelType & nsSelectionType::SEL_FRM || - nSelType & nsSelectionType::SEL_OLE || - nFrmType == FRMTYPE_DRAWOBJ || - (!bVerticalWriting && (SID_ATTR_PARA_LRSPACE_VERTICAL == nWhich))|| - (bVerticalWriting && (SID_ATTR_PARA_LRSPACE == nWhich)) - ) + nSelType & nsSelectionType::SEL_FRM || + nSelType & nsSelectionType::SEL_OLE || + nFrmType == FRMTYPE_DRAWOBJ || + (!bVerticalWriting && (SID_ATTR_PARA_LRSPACE_VERTICAL == nWhich)) || + ( bVerticalWriting && (SID_ATTR_PARA_LRSPACE == nWhich)) + ) { rSet.DisableItem(nWhich); } @@ -1132,7 +1085,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) if (pNumRuleNodeFromDoc) { short nOffset = static_cast< short >(aLR.GetTxtLeft() + - // --> FME 2005-02-22 #i42922# Mouse move of numbering label + // #i42922# Mouse move of numbering label // has to consider the left indent of the paragraph pNumRuleNodeFromDoc->GetLeftMarginWithNum( sal_True ) ); // <-- @@ -1296,12 +1249,13 @@ void SwView::StateTabWin(SfxItemSet& rSet) sal_Bool bTableVertical = bHasTable && rSh.IsTableVertical(); - if( ( (SID_RULER_BORDERS_VERTICAL == nWhich) && - ((bHasTable && !bTableVertical)|| - (!bVerticalWriting && !bFrmSelection && !bHasTable ) || (bFrmSelection && !bFrameHasVerticalColumns)) ) || - ((SID_RULER_BORDERS == nWhich) && - ((bHasTable && bTableVertical)|| - (bVerticalWriting && !bFrmSelection&& !bHasTable) || bFrameHasVerticalColumns))) + if(((SID_RULER_BORDERS_VERTICAL == nWhich) && + ((bHasTable && !bTableVertical) || + (!bVerticalWriting && !bFrmSelection && !bHasTable ) || + ( bFrmSelection && !bFrameHasVerticalColumns))) || + ((SID_RULER_BORDERS == nWhich) && + ((bHasTable && bTableVertical) || + (bVerticalWriting && !bFrmSelection&& !bHasTable) || bFrameHasVerticalColumns))) rSet.DisableItem(nWhich); else if ( bHasTable ) { @@ -1320,7 +1274,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) nNum = aTabCols.Count() - nNum; } - ASSERT(nNum <= aTabCols.Count(), "TabCol not found"); + OSL_ENSURE(nNum <= aTabCols.Count(), "TabCol not found"); const int nLft = aTabCols.GetLeftMin() + aTabCols.GetLeft(); const int nRgt = (sal_uInt16)(bTableVertical ? nPageHeight : nPageWidth) - (aTabCols.GetLeftMin() + @@ -1395,7 +1349,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) nFrmType & FRMTYPE_COLSECT ) { const SwSection *pSect = rSh.GetAnySection(sal_False, pPt); - ASSERT( pSect, "Welcher Bereich?"); + OSL_ENSURE( pSect, "Which section?"); if( pSect ) { SwSectionFmt *pFmt = pSect->GetFmt(); @@ -1520,10 +1474,10 @@ void SwView::StateTabWin(SfxItemSet& rSet) bFrmSelection; } - if( ( (SID_RULER_ROWS == nWhich) && - ((!bVerticalWriting && !bFrmSelection) || (bFrmSelection && !bFrameHasVerticalColumns)) ) || - ((SID_RULER_ROWS_VERTICAL == nWhich) && - ((bVerticalWriting && !bFrmSelection) || bFrameHasVerticalColumns))) + if(((SID_RULER_ROWS == nWhich) && + ((!bVerticalWriting && !bFrmSelection) || (bFrmSelection && !bFrameHasVerticalColumns))) || + ((SID_RULER_ROWS_VERTICAL == nWhich) && + ((bVerticalWriting && !bFrmSelection) || bFrameHasVerticalColumns))) rSet.DisableItem(nWhich); else if ( IsTabRowFromDoc() || ( rSh.GetTableFmt() && !bFrmSelection && @@ -1541,7 +1495,6 @@ void SwView::StateTabWin(SfxItemSet& rSet) rSh.GetTabRows( aTabCols ); } -// ASSERT(nNum <= aTabCols.Count(), "TabCol not found"); const int nLft = aTabCols.GetLeftMin(); const int nRgt = (sal_uInt16)(bVerticalWriting ? nPageWidth : nPageHeight) - (aTabCols.GetLeftMin() + @@ -1751,7 +1704,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) eRecType = bSectOutTbl ? RECT_OUTTABSECTION : RECT_SECTION; const SwSection *pSect = rSh.GetAnySection( bSectOutTbl, pPt ); - ASSERT( pSect, "Welcher Bereich?"); + OSL_ENSURE( pSect, "Which section?"); pFmt = pSect->GetFmt(); } else if( bFrame ) @@ -1783,7 +1736,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) if( nNum > rCols.Count() ) { - ASSERT( !this, "es wird auf dem falschen FmtCol gearbeitet!" ); + OSL_ENSURE( !this, "wrong FmtCol is being edited!" ); nNum = rCols.Count(); } @@ -1864,4 +1817,4 @@ void SwView::StateTabWin(SfxItemSet& rSet) } } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/RefreshListenerContainer.cxx b/sw/source/ui/uno/RefreshListenerContainer.cxx index a57353254d..fe595b76ed 100644 --- a/sw/source/ui/uno/RefreshListenerContainer.cxx +++ b/sw/source/ui/uno/RefreshListenerContainer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,3 +57,5 @@ void SwRefreshListenerContainer::Refreshed () xRefreshListener->refreshed(aObj); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index 0ea8077f6d..639d0bd67d 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <sfx2/sfxbasecontroller.hxx> #include <SwXDocumentSettings.hxx> #include <comphelper/MasterPropertySetInfo.hxx> @@ -53,11 +54,6 @@ #include "cfgitems.hxx" #include "prtopt.hxx" - -#include "swmodule.hxx" -#include "cfgitems.hxx" -#include "prtopt.hxx" - using rtl::OUString; using namespace comphelper; @@ -124,7 +120,9 @@ enum SwDocumentSettingsPropertyHandles HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, // <-- HANDLE_MODIFYPASSWORDINFO, - HANDLE_MATH_BASELINE_ALIGNMENT + HANDLE_MATH_BASELINE_ALIGNMENT, + HANDLE_INVERT_BORDER_SPACING, + HANDLE_COLLAPSE_EMPTY_CELL_PARA }; MasterPropertySetInfo * lcl_createSettingsInfo() @@ -180,7 +178,8 @@ MasterPropertySetInfo * lcl_createSettingsInfo() { RTL_CONSTASCII_STRINGPARAM("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, CPPUTYPE_BOOLEAN, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("ModifyPasswordInfo"), HANDLE_MODIFYPASSWORDINFO, CPPUTYPE_PROPERTYVALUE, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("MathBaselineAlignment"), HANDLE_MATH_BASELINE_ALIGNMENT, CPPUTYPE_BOOLEAN, 0, 0}, - + { RTL_CONSTASCII_STRINGPARAM("InvertBorderSpacing"), HANDLE_INVERT_BORDER_SPACING, CPPUTYPE_BOOLEAN, 0, 0}, + { RTL_CONSTASCII_STRINGPARAM("CollapseEmptyCellPara"), HANDLE_COLLAPSE_EMPTY_CELL_PARA, CPPUTYPE_BOOLEAN, 0, 0}, /* * As OS said, we don't have a view when we need to set this, so I have to * find another solution before adding them to this property set - MTG @@ -257,7 +256,7 @@ void SwXDocumentSettings::release () uno::Sequence< uno::Type > SAL_CALL SwXDocumentSettings::getTypes( ) throw (RuntimeException) { - vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; uno::Sequence< uno::Type > aBaseTypes( 5 ); uno::Type* pBaseTypes = aBaseTypes.getArray(); @@ -276,7 +275,7 @@ uno::Sequence< uno::Type > SAL_CALL SwXDocumentSettings::getTypes( ) uno::Sequence< sal_Int8 > SAL_CALL SwXDocumentSettings::getImplementationId( ) throw (RuntimeException) { - vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; static Sequence< sal_Int8 > aId( 16 ); static sal_Bool bInit = sal_False; if(!bInit) @@ -302,7 +301,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException ) { if (rInfo.mnAttributes & PropertyAttribute::READONLY) - throw PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + C2U(rInfo.mpName), static_cast < cppu::OWeakObject * > ( 0 ) ); + throw PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rtl::OUString::createFromAscii(rInfo.mpName), static_cast < cppu::OWeakObject * > ( 0 ) ); switch( rInfo.mnHandle ) { @@ -406,7 +405,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf SvMemoryStream aStream (aSequence.getArray(), nSize, STREAM_READ ); aStream.Seek ( STREAM_SEEK_TO_BEGIN ); - static sal_uInt16 __READONLY_DATA nRange[] = + static sal_uInt16 const nRange[] = { FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER, SID_HTML_MODE, SID_HTML_MODE, @@ -694,6 +693,18 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf mpDoc->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, bTmp ); } break; + case HANDLE_INVERT_BORDER_SPACING: + { + sal_Bool bTmp = *(sal_Bool*)rValue.getValue(); + mpDoc->set(IDocumentSettingAccess::INVERT_BORDER_SPACING, bTmp); + } + break; + case HANDLE_COLLAPSE_EMPTY_CELL_PARA: + { + sal_Bool bTmp = *(sal_Bool*)rValue.getValue(); + mpDoc->set(IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA, bTmp); + } + break; default: throw UnknownPropertyException(); } @@ -807,7 +818,6 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf break; case HANDLE_IS_KERN_ASIAN_PUNCTUATION: { - //sal_Bool bParaSpace = mpDoc->IsKernAsianPunctuation(); sal_Bool bParaSpace = mpDoc->get(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION); rValue.setValue(&bParaSpace, ::getBooleanCppuType()); } @@ -1028,7 +1038,18 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf rValue.setValue( &bTmp, ::getBooleanCppuType() ); } break; - + case HANDLE_INVERT_BORDER_SPACING: + { + sal_Bool bTmp = mpDoc->get(IDocumentSettingAccess::INVERT_BORDER_SPACING); + rValue.setValue( &bTmp, ::getBooleanCppuType() ); + } + break; + case HANDLE_COLLAPSE_EMPTY_CELL_PARA: + { + sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA ); + rValue.setValue( &bTmp, ::getBooleanCppuType() ); + } + break; default: throw UnknownPropertyException(); } @@ -1074,3 +1095,4 @@ Sequence< OUString > SAL_CALL SwXDocumentSettings::getSupportedServiceNames( ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/SwXDocumentSettings.hxx b/sw/source/ui/uno/SwXDocumentSettings.hxx index b9eb996326..48ca75ba97 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.hxx +++ b/sw/source/ui/uno/SwXDocumentSettings.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,12 +33,8 @@ #include "ui_pch.hxx" #endif -#ifndef _COMPHELPER_MASTERPROPERTYSET_HXX_ #include <comphelper/MasterPropertySet.hxx> -#endif -#ifndef _COM_SUN_STAR_TEXT_XTEXTDOCUMENT_HPP #include <com/sun/star/text/XTextDocument.hpp> -#endif #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> #include <cppuhelper/weak.hxx> @@ -107,3 +104,5 @@ public: virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/SwXFilterOptions.cxx b/sw/source/ui/uno/SwXFilterOptions.cxx index 128c278e28..8d8aa1c4b3 100644 --- a/sw/source/ui/uno/SwXFilterOptions.cxx +++ b/sw/source/ui/uno/SwXFilterOptions.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,7 +32,7 @@ #include <shellio.hxx> #include <swdll.hxx> #include <unoprnms.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <vcl/msgbox.hxx> #include <com/sun/star/lang/XUnoTunnel.hpp> @@ -50,37 +51,27 @@ using namespace ::com::sun::star::lang; #define SWFILTEROPTIONSOBJ_SERVICE RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.FilterOptionsDialog") #define SWFILTEROPTIONSOBJ_IMPLNAME RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.FilterOptionsDialog") #define FILTER_OPTIONS_NAME RTL_CONSTASCII_USTRINGPARAM("FilterOptions") -/*-- 2002/06/21 11:01:23--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXFilterOptions::SwXFilterOptions() : bExport( sal_False ) { } -/*-- 2002/06/21 11:01:24--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXFilterOptions::~SwXFilterOptions() { } -/*-- 2002/06/21 11:01:24--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwXFilterOptions::getImplementationName_Static() { return ::rtl::OUString(SWFILTEROPTIONSOBJ_IMPLNAME); } -/*-- 2002/06/21 11:01:24--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< ::rtl::OUString> SwXFilterOptions::getSupportedServiceNames_Static() { ::rtl::OUString sService(SWFILTEROPTIONSOBJ_SERVICE); return uno::Sequence< ::rtl::OUString> (&sService, 1); } -/*-- 2002/06/21 11:01:25--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< beans::PropertyValue > SwXFilterOptions::getPropertyValues() throw (uno::RuntimeException) { uno::Sequence<beans::PropertyValue> aRet(1); @@ -91,9 +82,7 @@ uno::Sequence< beans::PropertyValue > SwXFilterOptions::getPropertyValues() thro return aRet; } -/*-- 2002/06/21 11:01:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFilterOptions::setPropertyValues( const uno::Sequence<beans::PropertyValue >& aProps ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, IllegalArgumentException, WrappedTargetException, uno::RuntimeException) @@ -109,20 +98,16 @@ void SwXFilterOptions::setPropertyValues( const uno::Sequence<beans::PropertyV rProp.Value >>= sFilterName; else if ( aPropName == ::rtl::OUString(FILTER_OPTIONS_NAME) ) rProp.Value >>= sFilterOptions; - else if ( aPropName.equalsAscii( "InputStream" ) ) + else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "InputStream" ) ) ) rProp.Value >>= xInputStream; } } -/*-- 2002/06/21 11:01:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFilterOptions::setTitle( const ::rtl::OUString& /*rTitle*/ ) throw (uno::RuntimeException) { } -/*-- 2002.06.21 11:01:25--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int16 SwXFilterOptions::execute() throw (uno::RuntimeException) { sal_Int16 nRet = ui::dialogs::ExecutableDialogResults::CANCEL; @@ -143,10 +128,10 @@ sal_Int16 SwXFilterOptions::execute() throw (uno::RuntimeException) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSwAsciiFilterDlg* pAsciiDlg = pFact->CreateSwAsciiFilterDlg( NULL, *pDocShell,pInStream, DLG_ASCII_FILTER ); - DBG_ASSERT(pAsciiDlg, "Dialogdiet fail!"); + OSL_ENSURE(pAsciiDlg, "Dialogdiet fail!"); if(RET_OK == pAsciiDlg->Execute()) { SwAsciiOptions aOptions; @@ -164,54 +149,44 @@ sal_Int16 SwXFilterOptions::execute() throw (uno::RuntimeException) return nRet; } -/*-- 2002/06/21 11:01:26--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFilterOptions::setTargetDocument( const uno::Reference< XComponent >& xDoc ) throw (IllegalArgumentException, uno::RuntimeException) { bExport = sal_False; xModel = xDoc; } -/*-- 2002/06/21 11:01:26--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXFilterOptions::setSourceDocument( const uno::Reference<XComponent >& xDoc ) throw (IllegalArgumentException,uno::RuntimeException) { bExport = sal_True; xModel = xDoc; } -/*-- 2002/06/21 11:01:26--------------------------------------------------- - -----------------------------------------------------------------------*/ ::rtl::OUString SwXFilterOptions::getImplementationName() throw(uno::RuntimeException) { return ::rtl::OUString(SWFILTEROPTIONSOBJ_IMPLNAME); } -/*-- 2002/06/21 11:01:27--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXFilterOptions::supportsService( const ::rtl::OUString& rServiceName ) throw(uno::RuntimeException) { return rServiceName == ::rtl::OUString(SWFILTEROPTIONSOBJ_SERVICE); } -/*-- 2002/06/21 11:01:28--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< ::rtl::OUString > SwXFilterOptions::getSupportedServiceNames() throw(uno::RuntimeException) { return SwXFilterOptions::getSupportedServiceNames_Static(); } - uno::Reference<uno::XInterface> SAL_CALL SwXFilterOptions_createInstance( const uno::Reference<lang::XMultiServiceFactory>& ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; SwDLL::Init(); return (::cppu::OWeakObject*) new SwXFilterOptions; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/detreg.cxx b/sw/source/ui/uno/detreg.cxx index 06cd210b70..d7dcf4bea9 100644 --- a/sw/source/ui/uno/detreg.cxx +++ b/sw/source/ui/uno/detreg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -83,3 +84,4 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/dlelstnr.cxx b/sw/source/ui/uno/dlelstnr.cxx index c09a35bf5d..ecffc0c9ae 100644 --- a/sw/source/ui/uno/dlelstnr.cxx +++ b/sw/source/ui/uno/dlelstnr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - - #include <com/sun/star/linguistic2/DictionaryListEventFlags.hpp> #include <com/sun/star/linguistic2/XDictionaryList.hpp> #include <com/sun/star/linguistic2/XLinguServiceManager.hpp> @@ -42,7 +40,7 @@ #include <com/sun/star/uno/Reference.h> #include <comphelper/processfactory.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <tools/shl.hxx> #include "dlelstnr.hxx" @@ -50,7 +48,6 @@ #include <wrtsh.hxx> #include <view.hxx> - using ::rtl::OUString; using namespace ::com::sun::star; using namespace ::com::sun::star::lang; @@ -59,11 +56,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::linguistic2; using namespace ::com::sun::star::linguistic2::LinguServiceEventFlags; -#define A2OU(x) OUString::createFromAscii(x) - -/* -----------------------------17.03.00 09:07-------------------------------- - - ---------------------------------------------------------------------------*/ SwLinguServiceEventListener::SwLinguServiceEventListener() { Reference< XMultiServiceFactory > xMgr( comphelper::getProcessServiceFactory() ); @@ -71,20 +63,20 @@ SwLinguServiceEventListener::SwLinguServiceEventListener() { try { - OUString aSvcName( A2OU( "com.sun.star.frame.Desktop" ) ); + OUString aSvcName( OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" )) ); xDesktop = Reference< frame::XDesktop >( xMgr->createInstance( aSvcName ), UNO_QUERY ); if (xDesktop.is()) xDesktop->addTerminateListener( this ); - aSvcName = A2OU( "com.sun.star.linguistic2.LinguServiceManager" ); + aSvcName = OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.linguistic2.LinguServiceManager" )); xLngSvcMgr = Reference< XLinguServiceManager >( xMgr->createInstance( aSvcName ), UNO_QUERY ); if (xLngSvcMgr.is()) xLngSvcMgr->addLinguServiceManagerListener( (XLinguServiceEventListener *) this ); if (SvtLinguConfig().HasGrammarChecker()) { - aSvcName = A2OU( "com.sun.star.linguistic2.ProofreadingIterator" ); + aSvcName = OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.linguistic2.ProofreadingIterator" )); xGCIterator = Reference< XProofreadingIterator >( xMgr->createInstance( aSvcName ), UNO_QUERY ); Reference< XLinguServiceEventBroadcaster > xBC( xGCIterator, UNO_QUERY ); if (xBC.is()) @@ -93,26 +85,20 @@ SwLinguServiceEventListener::SwLinguServiceEventListener() } catch (uno::Exception &) { - DBG_ASSERT(0, "exception caught in SwLinguServiceEventListener c-tor" ); + OSL_ENSURE(0, "exception caught in SwLinguServiceEventListener c-tor" ); } } } -/* -----------------------------17.03.00 09:07-------------------------------- - ---------------------------------------------------------------------------*/ SwLinguServiceEventListener::~SwLinguServiceEventListener() { } -/* -----------------------------17.03.00 09:06-------------------------------- - - ---------------------------------------------------------------------------*/ - void SwLinguServiceEventListener::processDictionaryListEvent( const DictionaryListEvent& rDicListEvent) throw( RuntimeException ) { - vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Int16 nEvt = rDicListEvent.nCondensedEvent; @@ -133,12 +119,11 @@ void SwLinguServiceEventListener::processDictionaryListEvent( SW_MOD()->CheckSpellChanges( sal_False, bIsSpellWrong, bIsSpellAll, sal_False ); } - void SAL_CALL SwLinguServiceEventListener::processLinguServiceEvent( const LinguServiceEvent& rLngSvcEvent ) throw(RuntimeException) { - vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bIsSpellWrong = 0 != (rLngSvcEvent.nEvent & SPELL_WRONG_WORDS_AGAIN); sal_Bool bIsSpellAll = 0 != (rLngSvcEvent.nEvent & SPELL_CORRECT_WORDS_AGAIN); @@ -164,12 +149,11 @@ void SAL_CALL SwLinguServiceEventListener::processLinguServiceEvent( } } - void SAL_CALL SwLinguServiceEventListener::disposing( const EventObject& rEventObj ) throw(RuntimeException) { - vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if (xLngSvcMgr.is() && rEventObj.Source == xLngSvcMgr) xLngSvcMgr = 0; @@ -177,20 +161,17 @@ void SAL_CALL SwLinguServiceEventListener::disposing( xGCIterator = 0; } - void SAL_CALL SwLinguServiceEventListener::queryTermination( const EventObject& /*rEventObj*/ ) throw(TerminationVetoException, RuntimeException) { - //vos::OGuard aGuard(Application::GetSolarMutex()); } - void SAL_CALL SwLinguServiceEventListener::notifyTermination( const EventObject& rEventObj ) throw(RuntimeException) { - vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if (xDesktop.is() && rEventObj.Source == xDesktop) { @@ -202,3 +183,4 @@ void SAL_CALL SwLinguServiceEventListener::notifyTermination( } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/swdet2.cxx b/sw/source/ui/uno/swdet2.cxx index 7dea5e076f..6ba37ce5fc 100644 --- a/sw/source/ui/uno/swdet2.cxx +++ b/sw/source/ui/uno/swdet2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -75,36 +76,7 @@ sal_uLong SwFilterDetect::DetectFilter( SfxMedium& rMedium, const SfxFilter** pp const SfxFilter* pTmp = SwIoSystem::GetFileFilter( rMedium.GetPhysicalName(), aPrefFlt, &rMedium ); if( !pTmp ) return ERRCODE_ABORT; - /* - else if( *ppFilter && (*ppFilter)->GetUserData().EqualsAscii( "W4W", 0, 3 ) - && pTmp->GetUserData().EqualsAscii( FILTER_TEXT, 0, 4 ) ) - { - // Bug 95262 - if the user (or short detect) select a - // Word 4 Word filter, but the autodect of mastersoft - // can't detect it, we normally return the ascii filter - // But the user may have a change to use the W4W filter, - // so the SFX must show now a dialog with the 2 filters - nRet = ERRCODE_SFX_CONSULTUSER; - *ppFilter = pTmp; - } */ - // sollte der voreingestellte Filter ASCII sein und wir haben - // ASCII erkannt, dann ist das ein gultiger Filter, ansonsten ist das - // ein Fehler und wir wollen die Filterbox sehen - /* - else if( pTmp->GetUserData().EqualsAscii( FILTER_TEXT ) ) - { - // Bug 28974: "Text" erkannt, aber "Text Dos" "Text ..." eingestellt - // -> keine FilterBox, sondern den eingestellten Filter benutzen - if( *ppFilter && (*ppFilter)->GetUserData().EqualsAscii( FILTER_TEXT, 0, 4 ) ) - ; - else -// if( !*ppFilter || COMPARE_EQUAL != pTmp->GetUserData().Compare((*ppFilter)->GetUserData(), 4 )) - { -// nRet = ERRCODE_ABORT; - *ppFilter = pTmp; - } - } */ else { //Bug 41417: JP 09.07.97: HTML documents should be loaded by WebWriter @@ -120,3 +92,4 @@ sal_uLong SwFilterDetect::DetectFilter( SfxMedium& rMedium, const SfxFilter** pp return nRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx index d41db3cdcb..601bd439e9 100644 --- a/sw/source/ui/uno/swdetect.cxx +++ b/sw/source/ui/uno/swdetect.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,9 +34,7 @@ #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> @@ -44,9 +43,7 @@ #include <com/sun/star/ucb/InteractiveAppException.hpp> #include <com/sun/star/ucb/XContent.hpp> #include <com/sun/star/packages/zip/ZipIOException.hpp> -#ifndef _TOOLKIT_UNOHLP_HXX #include <toolkit/helper/vclunohelper.hxx> -#endif #include <ucbhelper/simpleinteractionrequest.hxx> #include <rtl/ustring.h> #include <rtl/logfile.hxx> @@ -55,7 +52,7 @@ #include <svl/eitem.hxx> #include <svl/stritem.hxx> #include <tools/urlobj.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> #include <sot/storinfo.hxx> @@ -116,7 +113,6 @@ SwFilterDetect::~SwFilterDetect() // now some parameters that can already be in the array, but may be overwritten or new inserted here // remember their indices in the case new values must be added to the array sal_Int32 nPropertyCount = lDescriptor.getLength(); - sal_Int32 nIndexOfFilterName = -1; sal_Int32 nIndexOfInputStream = -1; sal_Int32 nIndexOfContent = -1; sal_Int32 nIndexOfReadOnlyFlag = -1; @@ -146,10 +142,6 @@ SwFilterDetect::~SwFilterDetect() { lDescriptor[nProperty].Value >>= sTemp; aPreselectedFilterName = sTemp; - - // if the preselected filter name is not correct, it must be erased after detection - // remember index of property to get access to it later - nIndexOfFilterName = nProperty; } else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("InputStream")) ) nIndexOfInputStream = nProperty; @@ -173,9 +165,7 @@ SwFilterDetect::~SwFilterDetect() nIndexOfDocumentTitle = nProperty; } - // can't check the type for external filters, so set the "dont" flag accordingly - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - //SfxFilterFlags nMust = SFX_FILTER_IMPORT, nDont = SFX_FILTER_NOTINSTALLED; + SolarMutexGuard aGuard; SfxApplication* pApp = SFX_APP(); SfxAllItemSet *pSet = new SfxAllItemSet( pApp->GetPool() ); @@ -193,7 +183,6 @@ SwFilterDetect::~SwFilterDetect() String aPattern( aPrefix ); aPattern += String::CreateFromAscii("swriter"); if ( aURL.Match( aPattern ) >= aPattern.Len() ) - //pFilter = SfxFilter::GetDefaultFilterFromFactory( aURL ); return aTypeName; } } @@ -240,7 +229,7 @@ SwFilterDetect::~SwFilterDetect() } else { - DBG_ASSERT( xStorage.is(), "At this point storage must exist!" ); + OSL_ENSURE( xStorage.is(), "At this point storage must exist!" ); try { @@ -366,7 +355,7 @@ SwFilterDetect::~SwFilterDetect() { // if input stream wasn't part of the descriptor, now it should be, otherwise the content would be opend twice lDescriptor.realloc( nPropertyCount + 1 ); - lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("InputStream"); + lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InputStream")); lDescriptor[nPropertyCount].Value <<= xStream; nPropertyCount++; } @@ -375,7 +364,7 @@ SwFilterDetect::~SwFilterDetect() { // if input stream wasn't part of the descriptor, now it should be, otherwise the content would be opend twice lDescriptor.realloc( nPropertyCount + 1 ); - lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("UCBContent"); + lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UCBContent")); lDescriptor[nPropertyCount].Value <<= xContent; nPropertyCount++; } @@ -385,7 +374,7 @@ SwFilterDetect::~SwFilterDetect() if ( nIndexOfReadOnlyFlag == -1 ) { lDescriptor.realloc( nPropertyCount + 1 ); - lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("ReadOnly"); + lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")); lDescriptor[nPropertyCount].Value <<= bReadOnly; nPropertyCount++; } @@ -396,7 +385,7 @@ SwFilterDetect::~SwFilterDetect() if ( !bRepairPackage && bRepairAllowed ) { lDescriptor.realloc( nPropertyCount + 1 ); - lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("RepairPackage"); + lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage")); lDescriptor[nPropertyCount].Value <<= bRepairAllowed; nPropertyCount++; bOpenAsTemplate = sal_True; @@ -408,7 +397,7 @@ SwFilterDetect::~SwFilterDetect() if ( nIndexOfTemplateFlag == -1 ) { lDescriptor.realloc( nPropertyCount + 1 ); - lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("AsTemplate"); + lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AsTemplate")); lDescriptor[nPropertyCount].Value <<= bOpenAsTemplate; nPropertyCount++; } @@ -422,7 +411,7 @@ SwFilterDetect::~SwFilterDetect() if ( nIndexOfDocumentTitle == -1 ) { lDescriptor.realloc( nPropertyCount + 1 ); - lDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("DocumentTitle"); + lDescriptor[nPropertyCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle")); lDescriptor[nPropertyCount].Value <<= aDocumentTitle; nPropertyCount++; } @@ -468,16 +457,16 @@ UNOSEQUENCE< UNOOUSTRING > SwFilterDetect::impl_getStaticSupportedServiceNames() { UNOMUTEXGUARD aGuard( UNOMUTEX::getGlobalMutex() ); UNOSEQUENCE< UNOOUSTRING > seqServiceNames( 3 ); - seqServiceNames.getArray() [0] = UNOOUSTRING::createFromAscii( "com.sun.star.frame.ExtendedTypeDetection" ); - seqServiceNames.getArray() [1] = UNOOUSTRING::createFromAscii( "com.sun.star.text.FormatDetector" ); - seqServiceNames.getArray() [2] = UNOOUSTRING::createFromAscii( "com.sun.star.text.W4WFormatDetector" ); + seqServiceNames.getArray() [0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ExtendedTypeDetection" )); + seqServiceNames.getArray() [1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.FormatDetector" )); + seqServiceNames.getArray() [2] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.W4WFormatDetector" )); return seqServiceNames ; } /* Helper for XServiceInfo */ UNOOUSTRING SwFilterDetect::impl_getStaticImplementationName() { - return UNOOUSTRING::createFromAscii( "com.sun.star.comp.writer.FormatDetector" ); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.writer.FormatDetector" )); } /* Helper for registry */ @@ -486,3 +475,4 @@ UNOREFERENCE< UNOXINTERFACE > SAL_CALL SwFilterDetect::impl_createInstance( cons return UNOREFERENCE< UNOXINTERFACE >( *new SwFilterDetect( xServiceManager ) ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/swdetect.hxx b/sw/source/ui/uno/swdetect.hxx index a93bb2e702..92518cf433 100644 --- a/sw/source/ui/uno/swdetect.hxx +++ b/sw/source/ui/uno/swdetect.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,7 +29,7 @@ #define _SW_TYPEDETECT_HXX #include <rtl/ustring.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <com/sun/star/document/XExtendedFilterDetection.hpp> #include <com/sun/star/uno/Exception.hpp> #include <com/sun/star/uno/Reference.h> @@ -93,3 +94,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx index 2ebfca1ee0..db0727ea66 100644 --- a/sw/source/ui/uno/unoatxt.cxx +++ b/sw/source/ui/uno/unoatxt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,8 +33,8 @@ #define _SVSTDARR_STRINGS #include <com/sun/star/beans/PropertyAttribute.hpp> -#include <vos/mutex.hxx> -#include <tools/debug.hxx> +#include <osl/mutex.hxx> +#include <osl/diagnose.h> #include <vcl/svapp.hxx> #include <svl/svstdarr.hxx> #include <svtools/unoevent.hxx> @@ -70,67 +71,48 @@ SV_IMPL_REF ( SwDocShell ) using namespace ::com::sun::star; using ::rtl::OUString; -/****************************************************************** - * - ******************************************************************/ -/* -----------------30.03.99 14:31------------------- - * - * --------------------------------------------------*/ uno::Reference< uno::XInterface > SAL_CALL SwXAutoTextContainer_createInstance( const uno::Reference< lang::XMultiServiceFactory > & ) throw( uno::Exception ) { //the module may not be loaded - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; SwDLL::Init(); static uno::Reference< uno::XInterface > xAText = (cppu::OWeakObject*)new SwXAutoTextContainer();; return xAText; } -/* -----------------------------17.04.01 13:17-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SAL_CALL SwXAutoTextContainer_getSupportedServiceNames() throw() { OUString sService( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.AutoTextContainer")); const uno::Sequence< OUString > aSeq( &sService, 1 ); return aSeq; } -/* -----------------------------17.04.01 13:18-------------------------------- - ---------------------------------------------------------------------------*/ OUString SAL_CALL SwXAutoTextContainer_getImplementationName() throw() { return OUString( RTL_CONSTASCII_USTRINGPARAM("SwXAutoTextContainer" ) ); } -/*-- 21.12.98 12:42:16--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXAutoTextContainer::SwXAutoTextContainer() { pGlossaries = ::GetGlossaries(); } -/*-- 21.12.98 12:42:17--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXAutoTextContainer::~SwXAutoTextContainer() { } -/*-- 21.12.98 12:42:17--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwXAutoTextContainer::getCount(void) throw( uno::RuntimeException ) { return pGlossaries->GetGroupCnt(); } -/*-- 21.12.98 12:42:18--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXAutoTextContainer::getByIndex(sal_Int32 nIndex) throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; uno::Any aRet; sal_uInt16 nCount = pGlossaries->GetGroupCnt(); if ( 0 <= nIndex && nIndex < nCount ) @@ -139,29 +121,23 @@ uno::Any SwXAutoTextContainer::getByIndex(sal_Int32 nIndex) throw lang::IndexOutOfBoundsException(); return aRet; } -/*-- 21.12.98 12:42:18--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SwXAutoTextContainer::getElementType(void) throw( uno::RuntimeException ) { return ::getCppuType((const uno::Reference<text::XAutoTextGroup>*)0); } -/*-- 21.12.98 12:42:18--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXAutoTextContainer::hasElements(void) throw( uno::RuntimeException ) { //zumindest Standard sollte es immer geben! return sal_True; } -/*-- 21.12.98 12:42:18--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXAutoTextContainer::getByName(const OUString& GroupName) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; uno::Reference< text::XAutoTextGroup > xGroup; if ( pGlossaries && hasByName( GroupName ) ) // group name already known? @@ -173,12 +149,10 @@ uno::Any SwXAutoTextContainer::getByName(const OUString& GroupName) return makeAny( xGroup ); } -/*-- 21.12.98 12:42:19--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXAutoTextContainer::getElementNames(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_uInt16 nCount = pGlossaries->GetGroupCnt(); uno::Sequence< OUString > aGroupNames(nCount); @@ -192,26 +166,24 @@ uno::Sequence< OUString > SwXAutoTextContainer::getElementNames(void) throw( uno } return aGroupNames; } -/*-- 21.12.98 12:42:19--------------------------------------------------- +/*----------------------------------------------------------------------- findet Gruppennamen mit und ohne Pfadindex -----------------------------------------------------------------------*/ sal_Bool SwXAutoTextContainer::hasByName(const OUString& Name) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; String sGroupName( pGlossaries->GetCompleteGroupName( Name ) ); if(sGroupName.Len()) return sal_True; return sal_False; } -/*-- 21.12.98 12:42:19--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XAutoTextGroup > SwXAutoTextContainer::insertNewByName( const OUString& aGroupName) throw( lang::IllegalArgumentException, container::ElementExistException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(hasByName(aGroupName)) throw container::ElementExistException(); //check for non-ASCII characters @@ -246,34 +218,28 @@ uno::Reference< text::XAutoTextGroup > SwXAutoTextContainer::insertNewByName( pGlossaries->NewGroupDoc(sGroup, sGroup.GetToken(0, GLOS_DELIM)); uno::Reference< text::XAutoTextGroup > xGroup = pGlossaries->GetAutoTextGroup( sGroup, true ); - DBG_ASSERT( xGroup.is(), "SwXAutoTextContainer::insertNewByName: no UNO object created? How this?" ); + OSL_ENSURE( xGroup.is(), "SwXAutoTextContainer::insertNewByName: no UNO object created? How this?" ); // we just inserted the group into the glossaries, so why doesn't it exist? return xGroup; } -/*-- 21.12.98 12:42:19--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextContainer::removeByName(const OUString& aGroupName) throw( container::NoSuchElementException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; //zunaechst den Namen mit Pfad-Extension finden String sGroupName = pGlossaries->GetCompleteGroupName( aGroupName ); if(!sGroupName.Len()) throw container::NoSuchElementException(); pGlossaries->DelGroupDoc(sGroupName); } -/* -----------------------------06.04.00 11:11-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXAutoTextContainer::getImplementationName(void) throw( uno::RuntimeException ) { return SwXAutoTextContainer_getImplementationName(); } -/* -----------------------------06.04.00 11:11-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwXAutoTextContainer::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { const uno::Sequence< OUString > aNames = SwXAutoTextContainer_getSupportedServiceNames(); @@ -284,27 +250,18 @@ sal_Bool SwXAutoTextContainer::supportsService(const OUString& rServiceName) thr } return sal_False; } -/* -----------------------------06.04.00 11:11-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXAutoTextContainer::getSupportedServiceNames(void) throw( uno::RuntimeException ) { return SwXAutoTextContainer_getSupportedServiceNames(); } -/****************************************************************** - * - ******************************************************************/ -/* -----------------------------10.03.00 18:02-------------------------------- - ---------------------------------------------------------------------------*/ const uno::Sequence< sal_Int8 > & SwXAutoTextGroup::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; } -/* -----------------------------10.03.00 18:04-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int64 SAL_CALL SwXAutoTextGroup::getSomething( const uno::Sequence< sal_Int8 >& rId ) throw(uno::RuntimeException) { @@ -317,9 +274,6 @@ sal_Int64 SAL_CALL SwXAutoTextGroup::getSomething( const uno::Sequence< sal_Int8 return 0; } -/*-- 21.12.98 12:42:24--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXAutoTextGroup::SwXAutoTextGroup(const OUString& rName, SwGlossaries* pGlos) : pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_AUTO_TEXT_GROUP)), @@ -327,25 +281,17 @@ SwXAutoTextGroup::SwXAutoTextGroup(const OUString& rName, sName(rName), m_sGroupName(rName) { - DBG_ASSERT( -1 != rName.indexOf( GLOS_DELIM ), + OSL_ENSURE( -1 != rName.indexOf( GLOS_DELIM ), "SwXAutoTextGroup::SwXAutoTextGroup: to be constructed with a complete name only!" ); } -/*-- 21.12.98 12:42:24--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXAutoTextGroup::~SwXAutoTextGroup() { } -/*-- 21.12.98 12:42:24--------------------------------------------------- - - -----------------------------------------------------------------------*/ -/*-- 21.12.98 12:42:25--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXAutoTextGroup::getTitles(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_uInt16 nCount = 0; SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0; if(pGlosGroup && !pGlosGroup->GetError()) @@ -361,15 +307,13 @@ uno::Sequence< OUString > SwXAutoTextGroup::getTitles(void) throw( uno::RuntimeE delete pGlosGroup; return aEntryTitles; } -/*-- 21.12.98 12:42:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextGroup::renameByName(const OUString& aElementName, const OUString& aNewElementName, const OUString& aNewElementTitle) throw( lang::IllegalArgumentException, container::ElementExistException, io::IOException, uno::RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; // throw exception only if the programmatic name is to be changed into an existing name if(aNewElementName != aElementName && hasByName(aNewElementName)) throw container::ElementExistException(); @@ -400,7 +344,7 @@ void SwXAutoTextGroup::renameByName(const OUString& aElementName, sal_Bool lcl_CopySelToDoc( SwDoc* pInsDoc, OTextCursorHelper* pxCursor, SwXTextRange* pxRange) { - ASSERT( pInsDoc, "kein Ins.Dokument" ); + OSL_ENSURE( pInsDoc, "no InsDoc"); SwNodes& rNds = pInsDoc->GetNodes(); @@ -435,14 +379,12 @@ sal_Bool lcl_CopySelToDoc( SwDoc* pInsDoc, OTextCursorHelper* pxCursor, SwXTextR return bRet; } -/*-- 21.12.98 12:42:25--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const OUString& aName, const OUString& aTitle, const uno::Reference< text::XTextRange > & xTextRange) throw( container::ElementExistException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(hasByName(aName)) throw container::ElementExistException(); if(!xTextRange.is()) @@ -453,10 +395,6 @@ uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const String sLongName(aTitle); if(pGlosGroup && !pGlosGroup->GetError()) { - /*if( pGlosGroup->IsOld() && pGlosGroup->ConvertToNew()) - { - throw uno::RuntimeException(); - } */ uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY); SwXTextRange* pxRange = 0; OTextCursorHelper* pxCursor = 0; @@ -515,17 +453,15 @@ uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const } uno::Reference< text::XAutoTextEntry > xEntry = pGlossaries->GetAutoTextEntry( m_sGroupName, sName, sShortName, true ); - DBG_ASSERT( xEntry.is(), "SwXAutoTextGroup::insertNewByName: no UNO object created? How this?" ); + OSL_ENSURE( xEntry.is(), "SwXAutoTextGroup::insertNewByName: no UNO object created? How this?" ); // we just inserted the entry into the group, so why doesn't it exist? return xEntry; } -/*-- 21.12.98 12:42:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextGroup::removeByName(const OUString& aEntryName) throw( container::NoSuchElementException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0; if(pGlosGroup && !pGlosGroup->GetError()) { @@ -537,20 +473,16 @@ void SwXAutoTextGroup::removeByName(const OUString& aEntryName) throw( container else throw container::NoSuchElementException(); } -/*-- 21.12.98 12:42:25--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString SwXAutoTextGroup::getName(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; return sName; } -/*-- 21.12.98 12:42:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextGroup::setName(const OUString& rName) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if( !pGlossaries ) throw uno::RuntimeException(); @@ -593,12 +525,10 @@ void SwXAutoTextGroup::setName(const OUString& rName) throw( uno::RuntimeExcepti pGlossaries = pTempGlossaries; } } -/*-- 21.12.98 12:42:26--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Int32 SwXAutoTextGroup::getCount(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; int nCount = 0; SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0; if(pGlosGroup && !pGlosGroup->GetError()) @@ -608,13 +538,11 @@ sal_Int32 SwXAutoTextGroup::getCount(void) throw( uno::RuntimeException ) delete pGlosGroup; return nCount; } -/*-- 21.12.98 12:42:26--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXAutoTextGroup::getByIndex(sal_Int32 nIndex) throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; uno::Any aRet; sal_uInt16 nCount = 0; SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0; @@ -629,20 +557,16 @@ uno::Any SwXAutoTextGroup::getByIndex(sal_Int32 nIndex) delete pGlosGroup; return aRet; } -/*-- 21.12.98 12:42:26--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SwXAutoTextGroup::getElementType(void) throw( uno::RuntimeException ) { return ::getCppuType((uno::Reference<text::XAutoTextEntry>*)0); } -/*-- 21.12.98 12:42:26--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXAutoTextGroup::hasElements(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0; sal_uInt16 nCount = 0; if(pGlosGroup && !pGlosGroup->GetError()) @@ -653,25 +577,21 @@ sal_Bool SwXAutoTextGroup::hasElements(void) throw( uno::RuntimeException ) return nCount > 0; } -/*-- 21.12.98 12:42:27--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXAutoTextGroup::getByName(const OUString& _rName) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; uno::Reference< text::XAutoTextEntry > xEntry = pGlossaries->GetAutoTextEntry( m_sGroupName, sName, _rName, true ); - DBG_ASSERT( xEntry.is(), "SwXAutoTextGroup::getByName: GetAutoTextEntry is fractious!" ); + OSL_ENSURE( xEntry.is(), "SwXAutoTextGroup::getByName: GetAutoTextEntry is fractious!" ); // we told it to create the object, so why didn't it? return makeAny( xEntry ); } -/*-- 21.12.98 12:42:27--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SwXAutoTextGroup::getElementNames(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_uInt16 nCount = 0; SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0; if(pGlosGroup && !pGlosGroup->GetError()) @@ -687,13 +607,11 @@ uno::Sequence< OUString > SwXAutoTextGroup::getElementNames(void) delete pGlosGroup; return aEntryNames; } -/*-- 21.12.98 12:42:27--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXAutoTextGroup::hasByName(const OUString& rName) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; sal_uInt16 nCount = 0; SwTextBlocks* pGlosGroup = pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName, sal_False) : 0; @@ -715,24 +633,19 @@ sal_Bool SwXAutoTextGroup::hasByName(const OUString& rName) return bRet; } -/*-- 09.02.00 15:33:30--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySetInfo > SwXAutoTextGroup::getPropertySetInfo(void) throw( uno::RuntimeException ) { static uno::Reference< beans::XPropertySetInfo > xRet = pPropSet->getPropertySetInfo(); return xRet; } -/*-- 09.02.00 15:33:31--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextGroup::setPropertyValue( const OUString& rPropertyName, const uno::Any& aValue) throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName ); if(!pEntry) @@ -758,13 +671,11 @@ void SwXAutoTextGroup::setPropertyValue( } delete pGlosGroup; } -/*-- 09.02.00 15:33:31--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXAutoTextGroup::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName); if(!pEntry) @@ -786,64 +697,48 @@ uno::Any SwXAutoTextGroup::getPropertyValue(const OUString& rPropertyName) delete pGlosGroup; return aAny; } -/*-- 09.02.00 15:33:31--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextGroup::addPropertyChangeListener( const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { } -/*-- 09.02.00 15:33:31--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextGroup::removePropertyChangeListener( const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { } -/*-- 09.02.00 15:33:32--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextGroup::addVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { } -/*-- 09.02.00 15:33:32--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextGroup::removeVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) { } -/*-- 21.12.98 12:42:27--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextGroup::Invalidate() { pGlossaries = 0; sName = aEmptyStr; m_sGroupName = aEmptyStr; } -/* -----------------------------06.04.00 11:11-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXAutoTextGroup::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXAutoTextGroup"); } -/* -----------------------------06.04.00 11:11-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwXAutoTextGroup::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return C2U("com.sun.star.text.AutoTextGroup") == rServiceName; } -/* -----------------------------06.04.00 11:11-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXAutoTextGroup::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(1); @@ -851,20 +746,13 @@ uno::Sequence< OUString > SwXAutoTextGroup::getSupportedServiceNames(void) throw pArray[0] = C2U("com.sun.star.text.AutoTextGroup"); return aRet; } -/****************************************************************** - * - ******************************************************************/ -/* -----------------------------10.03.00 18:02-------------------------------- - ---------------------------------------------------------------------------*/ const uno::Sequence< sal_Int8 > & SwXAutoTextEntry::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; } -/* -----------------------------10.03.00 18:04-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int64 SAL_CALL SwXAutoTextEntry::getSomething( const uno::Sequence< sal_Int8 >& rId ) throw(uno::RuntimeException) { @@ -876,9 +764,7 @@ sal_Int64 SAL_CALL SwXAutoTextEntry::getSomething( const uno::Sequence< sal_Int8 } return 0; } -/*-- 21.12.98 12:42:33--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXAutoTextEntry::SwXAutoTextEntry(SwGlossaries* pGlss, const String& rGroupName, const String& rEntryName) : pGlossaries(pGlss), @@ -887,13 +773,11 @@ SwXAutoTextEntry::SwXAutoTextEntry(SwGlossaries* pGlss, const String& rGroupName pBodyText ( NULL ) { } -/*-- 21.12.98 12:42:33--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXAutoTextEntry::~SwXAutoTextEntry() { { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; // ensure that any pending modifications are written implFlushDocument( true ); @@ -905,9 +789,6 @@ SwXAutoTextEntry::~SwXAutoTextEntry() } } -//--------------------------------------------------------------------- -//--- 03.03.2003 13:24:58 ----------------------------------------------- - void SwXAutoTextEntry::implFlushDocument( bool _bCloseDoc ) { if ( xDocSh.Is() ) @@ -926,9 +807,6 @@ void SwXAutoTextEntry::implFlushDocument( bool _bCloseDoc ) } } -//----------------------------------------------------------------------- -//--- 03.03.2003 15:51:52 ----------------------------------------------- - void SwXAutoTextEntry::Notify( SfxBroadcaster& _rBC, const SfxHint& _rHint ) { if ( &_rBC == &xDocSh ) @@ -959,10 +837,10 @@ void SwXAutoTextEntry::Notify( SfxBroadcaster& _rBC, const SfxHint& _rHint ) void SwXAutoTextEntry::GetBodyText () { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; xDocSh = pGlossaries->EditGroupDoc ( sGroupName, sEntryName, sal_False ); - DBG_ASSERT( xDocSh.Is(), "SwXAutoTextEntry::GetBodyText: unexpected: no doc returned by EditGroupDoc!" ); + OSL_ENSURE( xDocSh.Is(), "SwXAutoTextEntry::GetBodyText: unexpected: no doc returned by EditGroupDoc!" ); // start listening at the document StartListening( *&xDocSh ); @@ -973,114 +851,92 @@ void SwXAutoTextEntry::GetBodyText () uno::Reference< text::XTextCursor > SwXAutoTextEntry::createTextCursor(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; EnsureBodyText(); return pBodyText->createTextCursor(); } -/*-- 21.12.98 12:42:34--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextCursor > SwXAutoTextEntry::createTextCursorByRange( const uno::Reference< text::XTextRange > & aTextPosition) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; EnsureBodyText(); return pBodyText->createTextCursorByRange ( aTextPosition ); } -/*-- 21.12.98 12:42:34--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextEntry::insertString(const uno::Reference< text::XTextRange > & xRange, const OUString& aString, sal_Bool bAbsorb) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; EnsureBodyText(); pBodyText->insertString ( xRange, aString, bAbsorb ); } -/*-- 21.12.98 12:42:34--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextEntry::insertControlCharacter(const uno::Reference< text::XTextRange > & xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb) throw( lang::IllegalArgumentException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; EnsureBodyText(); pBodyText->insertControlCharacter ( xRange, nControlCharacter, bAbsorb ); } -/*-- 21.12.98 12:42:34--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextEntry::insertTextContent( const uno::Reference< text::XTextRange > & xRange, const uno::Reference< text::XTextContent > & xContent, sal_Bool bAbsorb) throw( lang::IllegalArgumentException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; EnsureBodyText(); pBodyText->insertTextContent ( xRange, xContent, bAbsorb ); } -/*-- 21.12.98 12:42:34--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextEntry::removeTextContent( const uno::Reference< text::XTextContent > & xContent) throw( container::NoSuchElementException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; EnsureBodyText(); pBodyText->removeTextContent ( xContent ); } -/*-- 21.12.98 12:42:35--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XText > SwXAutoTextEntry::getText(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; uno::Reference< text::XText > xRet = (text::XText*)this; return xRet; } -/*-- 21.12.98 12:42:35--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextRange > SwXAutoTextEntry::getStart(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; EnsureBodyText(); return pBodyText->getStart(); } -/*-- 21.12.98 12:42:36--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextRange > SwXAutoTextEntry::getEnd(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; EnsureBodyText(); return pBodyText->getEnd(); } -/*-- 21.12.98 12:42:36--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString SwXAutoTextEntry::getString(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; EnsureBodyText(); return pBodyText->getString(); } -/*-- 21.12.98 12:42:36--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXAutoTextEntry::setString(const OUString& aString) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; EnsureBodyText(); pBodyText->setString( aString ); } -/* -----------------15.07.99 10:11------------------- - --------------------------------------------------*/ void SwXAutoTextEntry::applyTo(const uno::Reference< text::XTextRange > & xTextRange)throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; // ensure that any pending modifications are written // reason is that we're holding the _copy_ of the auto text, while the real auto text @@ -1149,23 +1005,17 @@ void SwXAutoTextEntry::applyTo(const uno::Reference< text::XTextRange > & xTextR if(!bResult) throw uno::RuntimeException(); } -/* -----------------------------06.04.00 11:11-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXAutoTextEntry::getImplementationName(void) throw( uno::RuntimeException ) { return C2U("SwXAutoTextEntry"); } -/* -----------------------------06.04.00 11:11-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwXAutoTextEntry::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { return C2U("com.sun.star.text.AutoTextEntry") == rServiceName; } -/* -----------------------------06.04.00 11:11-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< OUString > SwXAutoTextEntry::getSupportedServiceNames(void) throw( uno::RuntimeException ) { uno::Sequence< OUString > aRet(1); @@ -1173,17 +1023,13 @@ uno::Sequence< OUString > SwXAutoTextEntry::getSupportedServiceNames(void) throw pArray[0] = C2U("com.sun.star.text.AutoTextEntry"); return aRet; } -/* -----------------------------06.04.00 11:11-------------------------------- - ---------------------------------------------------------------------------*/ uno::Reference< container::XNameReplace > SwXAutoTextEntry::getEvents() throw( uno::RuntimeException ) { return new SwAutoTextEventDescriptor( *this ); } -/* -----------------------------30.01.01 18:40-------------------------------- - ---------------------------------------------------------------------------*/ const struct SvEventDescription aAutotextEvents[] = { { SW_EVENT_START_INS_GLOSSARY, "OnInsertStart" }, @@ -1191,9 +1037,6 @@ const struct SvEventDescription aAutotextEvents[] = { 0, NULL } }; -/* -----------------------------30.01.01 18:40-------------------------------- - - ---------------------------------------------------------------------------*/ SwAutoTextEventDescriptor::SwAutoTextEventDescriptor( SwXAutoTextEntry& rAutoText ) : SvBaseEventDescriptor(aAutotextEvents), @@ -1202,23 +1045,17 @@ SwAutoTextEventDescriptor::SwAutoTextEventDescriptor( rAutoTextEntry(rAutoText) { } -/* -----------------------------30.01.01 18:40-------------------------------- - ---------------------------------------------------------------------------*/ SwAutoTextEventDescriptor::~SwAutoTextEventDescriptor() { } -/* -----------------------------30.01.01 18:40-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwAutoTextEventDescriptor::getImplementationName() throw( uno::RuntimeException ) { return sSwAutoTextEventDescriptor; } -/* -----------------------------30.01.01 18:40-------------------------------- - ---------------------------------------------------------------------------*/ void SwAutoTextEventDescriptor::replaceByName( const sal_uInt16 nEvent, const SvxMacro& rMacro) @@ -1228,16 +1065,16 @@ void SwAutoTextEventDescriptor::replaceByName( lang::WrappedTargetException, uno::RuntimeException) { - DBG_ASSERT( NULL != rAutoTextEntry.GetGlossaries(), + OSL_ENSURE( NULL != rAutoTextEntry.GetGlossaries(), "Strangely enough, the AutoText vanished!" ); - DBG_ASSERT( (nEvent == SW_EVENT_END_INS_GLOSSARY) || + OSL_ENSURE( (nEvent == SW_EVENT_END_INS_GLOSSARY) || (nEvent == SW_EVENT_START_INS_GLOSSARY) , "Unknown event ID" ); const SwGlossaries* pGlossaries = rAutoTextEntry.GetGlossaries(); SwTextBlocks* pBlocks = pGlossaries->GetGroupDoc( rAutoTextEntry.GetGroupName() ); - DBG_ASSERT( NULL != pBlocks, + OSL_ENSURE( NULL != pBlocks, "can't get autotext group; SwAutoTextEntry has illegal name?"); if( pBlocks && !pBlocks->GetError()) @@ -1258,9 +1095,7 @@ void SwAutoTextEventDescriptor::replaceByName( } // else: ignore } -/* -----------------------------30.01.01 18:40-------------------------------- - ---------------------------------------------------------------------------*/ void SwAutoTextEventDescriptor::getByName( SvxMacro& rMacro, const sal_uInt16 nEvent ) @@ -1269,15 +1104,15 @@ void SwAutoTextEventDescriptor::getByName( lang::WrappedTargetException, uno::RuntimeException) { - DBG_ASSERT( NULL != rAutoTextEntry.GetGlossaries(), "no AutoText" ); - DBG_ASSERT( (nEvent == SW_EVENT_END_INS_GLOSSARY) || + OSL_ENSURE( NULL != rAutoTextEntry.GetGlossaries(), "no AutoText" ); + OSL_ENSURE( (nEvent == SW_EVENT_END_INS_GLOSSARY) || (nEvent == SW_EVENT_START_INS_GLOSSARY) , "Unknown event ID" ); const SwGlossaries* pGlossaries = rAutoTextEntry.GetGlossaries(); SwTextBlocks* pBlocks = pGlossaries->GetGroupDoc( rAutoTextEntry.GetGroupName() ); - DBG_ASSERT( NULL != pBlocks, + OSL_ENSURE( NULL != pBlocks, "can't get autotext group; SwAutoTextEntry has illegal name?"); // return empty macro, unless macro is found @@ -1306,3 +1141,4 @@ void SwAutoTextEventDescriptor::getByName( +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/unodefaults.cxx b/sw/source/ui/uno/unodefaults.cxx index bc22cbe144..32bb7e7c37 100644 --- a/sw/source/ui/uno/unodefaults.cxx +++ b/sw/source/ui/uno/unodefaults.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,23 +35,16 @@ #include <svx/unoprov.hxx> #include <doc.hxx> -/* -----------------------------13.03.01 14:16-------------------------------- - - ---------------------------------------------------------------------------*/ SwSvxUnoDrawPool::SwSvxUnoDrawPool( SwDoc* pDoc ) throw() : SvxUnoDrawPool(pDoc->GetDrawModel(), SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER), m_pDoc(pDoc) { } -/* -----------------------------13.03.01 14:16-------------------------------- - ---------------------------------------------------------------------------*/ SwSvxUnoDrawPool::~SwSvxUnoDrawPool() throw() { } -/* -----------------------------13.03.01 14:16-------------------------------- - ---------------------------------------------------------------------------*/ SfxItemPool* SwSvxUnoDrawPool::getModelPool( sal_Bool /*bReadOnly*/ ) throw() { if(m_pDoc) @@ -68,5 +62,4 @@ SfxItemPool* SwSvxUnoDrawPool::getModelPool( sal_Bool /*bReadOnly*/ ) throw() return 0; } - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/unodefaults.hxx b/sw/source/ui/uno/unodefaults.hxx index a96785a283..48ffa96f74 100644 --- a/sw/source/ui/uno/unodefaults.hxx +++ b/sw/source/ui/uno/unodefaults.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/unodispatch.cxx b/sw/source/ui/uno/unodispatch.cxx index 24e386259e..3b006453d3 100644 --- a/sw/source/ui/uno/unodispatch.cxx +++ b/sw/source/ui/uno/unodispatch.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,8 +43,8 @@ using namespace ::com::sun::star; -using namespace rtl; -using namespace vos; + +using ::rtl::OUString; const char* cURLStart = ".uno:DataSourceBrowser/"; const char* cURLFormLetter = ".uno:DataSourceBrowser/FormLetter"; @@ -51,9 +52,7 @@ const char* cURLInsertContent = ".uno:DataSourceBrowser/InsertContent";//data i const char* cURLInsertColumns = ".uno:DataSourceBrowser/InsertColumns";//data into text const char* cURLDocumentDataSource = ".uno:DataSourceBrowser/DocumentDataSource";//current data source of the document const sal_Char* cInternalDBChangeNotification = ".uno::Writer/DataSourceChanged"; -/*-- 07.11.00 13:25:51--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXDispatchProviderInterceptor::SwXDispatchProviderInterceptor(SwView& rVw) : m_pView(&rVw) { @@ -71,15 +70,11 @@ SwXDispatchProviderInterceptor::SwXDispatchProviderInterceptor(SwView& rVw) : m_refCount--; } } -/*-- 07.11.00 13:25:51--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXDispatchProviderInterceptor::~SwXDispatchProviderInterceptor() { } -/*-- 07.11.00 13:25:51--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< frame::XDispatch > SwXDispatchProviderInterceptor::queryDispatch( const util::URL& aURL, const OUString& aTargetFrameName, sal_Int32 nSearchFlags ) throw(uno::RuntimeException) @@ -106,9 +101,7 @@ uno::Reference< frame::XDispatch > SwXDispatchProviderInterceptor::queryDispatch return xResult; } -/*-- 07.11.00 13:25:52--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< uno::Reference< frame::XDispatch > > SwXDispatchProviderInterceptor::queryDispatches( const uno::Sequence< frame::DispatchDescriptor >& aDescripts ) throw(uno::RuntimeException) { @@ -123,45 +116,35 @@ uno::Sequence< uno::Reference< frame::XDispatch > > SwXDispatchProviderIntercept } return aReturn; } -/*-- 07.11.00 13:25:52--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< frame::XDispatchProvider > SwXDispatchProviderInterceptor::getSlaveDispatchProvider( ) throw(uno::RuntimeException) { DispatchMutexLock_Impl aLock(*this); return m_xSlaveDispatcher; } -/*-- 07.11.00 13:25:52--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXDispatchProviderInterceptor::setSlaveDispatchProvider( const uno::Reference< frame::XDispatchProvider >& xNewDispatchProvider ) throw(uno::RuntimeException) { DispatchMutexLock_Impl aLock(*this); m_xSlaveDispatcher = xNewDispatchProvider; } -/*-- 07.11.00 13:25:52--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< frame::XDispatchProvider > SwXDispatchProviderInterceptor::getMasterDispatchProvider( ) throw(uno::RuntimeException) { DispatchMutexLock_Impl aLock(*this); return m_xMasterDispatcher; } -/*-- 07.11.00 13:25:52--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXDispatchProviderInterceptor::setMasterDispatchProvider( const uno::Reference< frame::XDispatchProvider >& xNewSupplier ) throw(uno::RuntimeException) { DispatchMutexLock_Impl aLock(*this); m_xMasterDispatcher = xNewSupplier; } -/*-- 07.11.00 13:25:53--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXDispatchProviderInterceptor::disposing( const lang::EventObject& ) throw(uno::RuntimeException) { @@ -176,17 +159,13 @@ void SwXDispatchProviderInterceptor::disposing( const lang::EventObject& ) } m_xIntercepted = NULL; } -/* -----------------------------01.10.2001 14:31------------------------------ - ---------------------------------------------------------------------------*/ const uno::Sequence< sal_Int8 > & SwXDispatchProviderInterceptor::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; } -/* -----------------------------01.10.2001 14:31------------------------------ - ---------------------------------------------------------------------------*/ sal_Int64 SwXDispatchProviderInterceptor::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) throw(uno::RuntimeException) @@ -199,9 +178,7 @@ sal_Int64 SwXDispatchProviderInterceptor::getSomething( } return 0; } -/* -----------------------------01.10.2001 14:32------------------------------ - ---------------------------------------------------------------------------*/ void SwXDispatchProviderInterceptor::Invalidate() { DispatchMutexLock_Impl aLock(*this); @@ -216,18 +193,14 @@ void SwXDispatchProviderInterceptor::Invalidate() m_xIntercepted = NULL; m_pView = 0; } -/* -----------------------------07.11.00 14:26-------------------------------- - ---------------------------------------------------------------------------*/ SwXDispatch::SwXDispatch(SwView& rVw) : m_pView(&rVw), m_bOldEnable(sal_False), m_bListenerAdded(sal_False) { } -/*-- 07.11.00 14:26:13--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXDispatch::~SwXDispatch() { if(m_bListenerAdded && m_pView) @@ -237,9 +210,7 @@ SwXDispatch::~SwXDispatch() xSupplier->removeSelectionChangeListener(xThis); } } -/*-- 07.11.00 14:26:13--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXDispatch::dispatch( const util::URL& aURL, const uno::Sequence< beans::PropertyValue >& aArgs ) throw(uno::RuntimeException) { @@ -264,7 +235,6 @@ void SwXDispatch::dispatch( FN_MAILMERGE_WIZARD, SFX_CALLMODE_ASYNCHRON, &aDBProperties, 0L); -// pNewDBMgr->ExecuteFormLetter(rSh, aArgs); } else if(!aURL.Complete.compareToAscii(cURLDocumentDataSource)) { @@ -300,9 +270,7 @@ void SwXDispatch::dispatch( throw uno::RuntimeException(); } -/*-- 07.11.00 14:26:13--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXDispatch::addStatusListener( const uno::Reference< frame::XStatusListener >& xControl, const util::URL& aURL ) throw(uno::RuntimeException) { @@ -351,9 +319,7 @@ void SwXDispatch::addStatusListener( m_bListenerAdded = sal_True; } } -/*-- 07.11.00 14:26:15--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXDispatch::removeStatusListener( const uno::Reference< frame::XStatusListener >& xControl, const util::URL& ) throw(uno::RuntimeException) { @@ -375,9 +341,7 @@ void SwXDispatch::removeStatusListener( m_bListenerAdded = sal_False; } } -/* -----------------------------07.03.01 10:27-------------------------------- - ---------------------------------------------------------------------------*/ void SwXDispatch::selectionChanged( const lang::EventObject& ) throw(uno::RuntimeException) { ShellModes eMode = m_pView->GetShellMode(); @@ -403,9 +367,7 @@ void SwXDispatch::selectionChanged( const lang::EventObject& ) throw(uno::Runti } } } -/* -----------------------------07.03.01 10:46-------------------------------- - ---------------------------------------------------------------------------*/ void SwXDispatch::disposing( const lang::EventObject& rSource ) throw(uno::RuntimeException) { uno::Reference<view::XSelectionSupplier> xSupplier(rSource.Source, uno::UNO_QUERY); @@ -423,26 +385,20 @@ void SwXDispatch::disposing( const lang::EventObject& rSource ) throw(uno::Runti } m_pView = 0; } -/* -----------------------------12.07.01 13:30-------------------------------- - ---------------------------------------------------------------------------*/ const sal_Char* SwXDispatch::GetDBChangeURL() { return cInternalDBChangeNotification; } -/* -----------------------------09.09.2002 08:48------------------------------ - ---------------------------------------------------------------------------*/ SwXDispatchProviderInterceptor::DispatchMutexLock_Impl::DispatchMutexLock_Impl( SwXDispatchProviderInterceptor& ) : -// aGuard(rInterceptor.m_aMutex) #102295# solar mutex has to be used currently aGuard(Application::GetSolarMutex()) { } -/* -----------------------------09.09.2002 08:48------------------------------ - ---------------------------------------------------------------------------*/ SwXDispatchProviderInterceptor::DispatchMutexLock_Impl::~DispatchMutexLock_Impl() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/unodoc.cxx b/sw/source/ui/uno/unodoc.cxx index fc0c440ff2..400c2c5be2 100644 --- a/sw/source/ui/uno/unodoc.cxx +++ b/sw/source/ui/uno/unodoc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,7 +37,7 @@ #include "docsh.hxx" #include "globdoc.hxx" #include "wdocsh.hxx" -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> using namespace ::com::sun::star; @@ -64,7 +65,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwTextDocument_createInstance( const uno::Reference< lang::XMultiServiceFactory >&, const sal_uInt64 _nCreationFlags ) throw( uno::Exception ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SwDLL::Init(); SfxObjectShell* pShell = new SwDocShell( _nCreationFlags ); return uno::Reference< uno::XInterface >( pShell->GetModel() ); @@ -93,7 +94,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwWebDocument_createInstance( const uno::Reference< lang::XMultiServiceFactory > & ) throw( uno::Exception ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SwDLL::Init(); SfxObjectShell* pShell = new SwWebDocShell( SFX_CREATE_MODE_STANDARD ); return uno::Reference< uno::XInterface >( pShell->GetModel() ); @@ -120,9 +121,10 @@ uno::Reference< uno::XInterface > SAL_CALL SwGlobalDocument_createInstance( const uno::Reference< lang::XMultiServiceFactory > &) throw( uno::Exception ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SwDLL::Init(); SfxObjectShell* pShell = new SwGlobalDocShell( SFX_CREATE_MODE_STANDARD ); return uno::Reference< uno::XInterface >( pShell->GetModel() ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/unofreg.cxx b/sw/source/ui/uno/unofreg.cxx index 9ad0a44617..4b0b8e6293 100644 --- a/sw/source/ui/uno/unofreg.cxx +++ b/sw/source/ui/uno/unofreg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,10 +39,11 @@ #define INCLUDED_STRING_H #endif -using namespace rtl; using namespace ::com::sun::star; using namespace ::com::sun::star::lang; +using ::rtl::OUString; + // module extern uno::Sequence< OUString > SAL_CALL SwUnoModule_getSupportedServiceNames() throw(); extern OUString SAL_CALL SwUnoModule_getImplementationName() throw(); @@ -381,3 +383,5 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( #ifdef __cplusplus } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx index ca4218a287..bb65d66d79 100644 --- a/sw/source/ui/uno/unomailmerge.cxx +++ b/sw/source/ui/uno/unomailmerge.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,7 +31,6 @@ #include <vcl/svapp.hxx> -#include <vos/mutex.hxx> #include <osl/mutex.hxx> #include <svl/itemprop.hxx> #include <svl/urihelper.hxx> @@ -54,9 +54,7 @@ #include <com/sun/star/sdbc/XRowSet.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/util/XCloseable.hpp> -#ifndef _COM_SUN_STAR_UTIL_CloseVetoException_HPP_ #include <com/sun/star/util/CloseVetoException.hpp> -#endif #include <com/sun/star/sdbcx/XRowLocate.hpp> #include <com/sun/star/frame/XStorable.hpp> #include "com/sun/star/mail/XSmtpService.hpp" @@ -70,9 +68,7 @@ #include <unomap.hxx> #include <swunohelper.hxx> #include <docsh.hxx> -#ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED #include <IDocumentDeviceAccess.hxx> -#endif #include <view.hxx> #include <dbmgr.hxx> #include <unotxdoc.hxx> @@ -264,12 +260,12 @@ namespace acquire(); } else { - DBG_ERROR( "DelayedFileDeletion::DelayedFileDeletion: model is no component!" ); + OSL_ENSURE(false, "DelayedFileDeletion::DelayedFileDeletion: model is no component!" ); } } catch( const Exception& ) { - DBG_ERROR( "DelayedFileDeletion::DelayedFileDeletion: could not register as event listener at the model!" ); + OSL_ENSURE(false, "DelayedFileDeletion::DelayedFileDeletion: could not register as event listener at the model!" ); } osl_decrementInterlockedCount( &m_refCount ); } @@ -302,7 +298,7 @@ namespace } catch( const Exception& ) { - DBG_ERROR( "DelayedFileDeletion::OnTryDeleteFile: caught a strange exception!" ); + OSL_ENSURE(false, "DelayedFileDeletion::OnTryDeleteFile: caught a strange exception!" ); bSuccess = sal_True; // can't do anything here ... } @@ -326,7 +322,7 @@ namespace } catch( const Exception & ) { - DBG_ERROR( "DelayedFileDeletion::implTakeOwnership: could not revoke the listener!" ); + OSL_ENSURE(false, "DelayedFileDeletion::implTakeOwnership: could not revoke the listener!" ); } m_aDeleteTimer.SetTimeout( 3000 ); // 3 seconds @@ -350,7 +346,7 @@ namespace //-------------------------------------------------------------------- void SAL_CALL DelayedFileDeletion::notifyClosing( const EventObject& ) throw (RuntimeException) { - DBG_ERROR( "DelayedFileDeletion::notifyClosing: how this?" ); + OSL_ENSURE(false, "DelayedFileDeletion::notifyClosing: how this?" ); // this should not happen: // Either, a foreign instance closes the document, then we should veto this, and take the ownership // Or, we ourself close the document, then we should not be a listener anymore @@ -359,7 +355,7 @@ namespace //------------------------------------------------------ void SAL_CALL DelayedFileDeletion::disposing( const EventObject& ) throw (RuntimeException) { - DBG_ERROR( "DelayedFileDeletion::disposing: how this?" ); + OSL_ENSURE(false, "DelayedFileDeletion::disposing: how this?" ); // this should not happen: // Either, a foreign instance closes the document, then we should veto this, and take the ownership // Or, we ourself close the document, then we should not be a listener anymore @@ -452,7 +448,7 @@ SwXMailMerge::~SwXMailMerge() //! because there is no automatism that will do that later. //! #120086# if ( eVetoed == CloseModelAndDocSh( xModel, xDocSh ) ) - DBG_WARNING( "owner ship transfered to vetoing object!" ); + OSL_ENSURE(false, "owner ship transfered to vetoing object!" ); xModel = 0; xDocSh = 0; // destroy doc shell @@ -463,7 +459,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( const uno::Sequence< beans::NamedValue >& rArguments ) throw (IllegalArgumentException, Exception, RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; // // get property values to be used @@ -643,7 +639,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( { if (!aCurDataSourceName.getLength() || !aCurDataCommand.getLength() ) { - DBG_ERROR("PropertyValues missing or unset"); + OSL_ENSURE(false, "PropertyValues missing or unset"); throw IllegalArgumentException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Either the ResultSet or DataSourceName and DataCommand must be set." ) ), static_cast < cppu::OWeakObject * > ( this ), 0 ); } @@ -657,7 +653,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( C2U( "com.sun.star.sdb.RowSet" )); aRowSetDisposeHelper.reset( xInstance, SharedComponent::TakeOwnership ); Reference< XPropertySet > xRowSetPropSet( xInstance, UNO_QUERY ); - DBG_ASSERT( xRowSetPropSet.is(), "failed to get XPropertySet interface from RowSet" ); + OSL_ENSURE( xRowSetPropSet.is(), "failed to get XPropertySet interface from RowSet" ); if (xRowSetPropSet.is()) { if (xCurConnection.is()) @@ -675,7 +671,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( if( !xCurConnection.is() ) xCurConnection.set( xRowSetPropSet->getPropertyValue( C2U( "ActiveConnection" )), UNO_QUERY ); xCurResultSet = Reference< sdbc::XResultSet >( xRowSet, UNO_QUERY ); - DBG_ASSERT( xCurResultSet.is(), "failed to build ResultSet" ); + OSL_ENSURE( xCurResultSet.is(), "failed to build ResultSet" ); } } } @@ -704,7 +700,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( SwNewDBMgr* pMgr = rSh.GetNewDBMgr(); //force layout creation rSh.CalcLayout(); - DBG_ASSERT( pMgr, "database manager missing" ); + OSL_ENSURE( pMgr, "database manager missing" ); SwMergeDescriptor aMergeDesc( nMergeType, rSh, aDescriptor ); @@ -736,7 +732,6 @@ uno::Any SAL_CALL SwXMailMerge::execute( aCurFileNamePrefix = aURLObj.GetBase(); // filename without extension if (!aCurOutputURL.getLength()) { - //aCurOutputURL = aURLObj.GetURLPath(); aURLObj.removeSegment(); aCurOutputURL = aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI ); } @@ -769,7 +764,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( aMergeDesc.aSaveToFilterData = aSaveFilterData; aMergeDesc.bCreateSingleFile = bSaveAsSingleFile; } - else /*if(MailMergeType::MAIL == nCurOutputType)*/ + else { pMgr->SetEMailColumn( sAddressFromColumn ); if(!sAddressFromColumn.getLength()) @@ -823,7 +818,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( pMgr->SetMergeSilent( sal_True ); // suppress dialogs, message boxes, etc. const SwXMailMerge *pOldSrc = pMgr->GetMailMergeEvtSrc(); - DBG_ASSERT( !pOldSrc || pOldSrc == this, "Ooops... different event source already set." ); + OSL_ENSURE( !pOldSrc || pOldSrc == this, "Ooops... different event source already set." ); pMgr->SetMailMergeEvtSrc( this ); // launch events for listeners SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), xCurDocSh)); @@ -882,7 +877,7 @@ void SwXMailMerge::launchEvent( const PropertyChangeEvent &rEvt ) const uno::Reference< beans::XPropertySetInfo > SAL_CALL SwXMailMerge::getPropertySetInfo( ) throw (RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; static Reference< XPropertySetInfo > aRef = pPropSet->getPropertySetInfo(); return aRef; } @@ -891,7 +886,7 @@ void SAL_CALL SwXMailMerge::setPropertyValue( const OUString& rPropertyName, const uno::Any& rValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; const SfxItemPropertySimpleEntry* pCur = pPropSet->getPropertyMap()->getByName( rPropertyName ); if (!pCur) @@ -936,7 +931,7 @@ void SAL_CALL SwXMailMerge::setPropertyValue( case WID_IN_SERVER_PASSWORD: pData = &sInServerPassword; break; case WID_OUT_SERVER_PASSWORD: pData = &sOutServerPassword; break; default : - DBG_ERROR("unknown WID"); + OSL_ENSURE(false, "unknown WID"); } Any aOld( pData, *pType ); @@ -1025,9 +1020,9 @@ void SAL_CALL SwXMailMerge::setPropertyValue( else if(pData == &sOutServerPassword) bOK = rValue >>= sInServerPassword; else { - DBG_ERROR( "invalid pointer" ); + OSL_ENSURE(false, "invalid pointer" ); } - DBG_ASSERT( bOK, "set value failed" ); + OSL_ENSURE( bOK, "set value failed" ); bChanged = sal_True; } if (!bOK) @@ -1046,7 +1041,7 @@ uno::Any SAL_CALL SwXMailMerge::getPropertyValue( const OUString& rPropertyName ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Any aRet; @@ -1089,7 +1084,7 @@ uno::Any SAL_CALL SwXMailMerge::getPropertyValue( case WID_IN_SERVER_PASSWORD: aRet <<= sInServerPassword; break; case WID_OUT_SERVER_PASSWORD: aRet <<= sOutServerPassword; break; default : - DBG_ERROR("unknown WID"); + OSL_ENSURE(false, "unknown WID"); } } @@ -1101,7 +1096,7 @@ void SAL_CALL SwXMailMerge::addPropertyChangeListener( const uno::Reference< beans::XPropertyChangeListener >& rListener ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if (!bDisposing && rListener.is()) { const SfxItemPropertySimpleEntry* pCur = pPropSet->getPropertyMap()->getByName( rPropertyName ); @@ -1117,7 +1112,7 @@ void SAL_CALL SwXMailMerge::removePropertyChangeListener( const uno::Reference< beans::XPropertyChangeListener >& rListener ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if (!bDisposing && rListener.is()) { const SfxItemPropertySimpleEntry* pCur = pPropSet->getPropertyMap()->getByName( rPropertyName ); @@ -1134,7 +1129,7 @@ void SAL_CALL SwXMailMerge::addVetoableChangeListener( throw (UnknownPropertyException, WrappedTargetException, RuntimeException) { // no vetoable property, thus no support for vetoable change listeners - DBG_WARNING( "not implemented"); + OSL_ENSURE(false, "not implemented"); } void SAL_CALL SwXMailMerge::removeVetoableChangeListener( @@ -1143,14 +1138,14 @@ void SAL_CALL SwXMailMerge::removeVetoableChangeListener( throw (UnknownPropertyException, WrappedTargetException, RuntimeException) { // no vetoable property, thus no support for vetoable change listeners - DBG_WARNING( "not implemented"); + OSL_ENSURE(false,"not implemented"); } void SAL_CALL SwXMailMerge::dispose() throw(RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if (!bDisposing) { @@ -1167,7 +1162,7 @@ void SAL_CALL SwXMailMerge::addEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if (!bDisposing && rxListener.is()) aEvtListeners.addInterface( rxListener ); } @@ -1176,7 +1171,7 @@ void SAL_CALL SwXMailMerge::removeEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if (!bDisposing && rxListener.is()) aEvtListeners.removeInterface( rxListener ); } @@ -1185,7 +1180,7 @@ void SAL_CALL SwXMailMerge::addMailMergeEventListener( const uno::Reference< XMailMergeListener >& rxListener ) throw (RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if (!bDisposing && rxListener.is()) aMergeListeners.addInterface( rxListener ); } @@ -1194,7 +1189,7 @@ void SAL_CALL SwXMailMerge::removeMailMergeEventListener( const uno::Reference< XMailMergeListener >& rxListener ) throw (RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if (!bDisposing && rxListener.is()) aMergeListeners.removeInterface( rxListener ); } @@ -1202,14 +1197,14 @@ void SAL_CALL SwXMailMerge::removeMailMergeEventListener( OUString SAL_CALL SwXMailMerge::getImplementationName() throw(RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return SwXMailMerge_getImplementationName(); } sal_Bool SAL_CALL SwXMailMerge::supportsService( const OUString& rServiceName ) throw(RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return C2U( SN_MAIL_MERGE ) == rServiceName || C2U( SN_DATA_ACCESS_DESCRIPTOR ) == rServiceName; } @@ -1217,7 +1212,7 @@ sal_Bool SAL_CALL SwXMailMerge::supportsService( const OUString& rServiceName ) uno::Sequence< OUString > SAL_CALL SwXMailMerge::getSupportedServiceNames() throw(RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return SwXMailMerge_getSupportedServiceNames(); } @@ -1243,7 +1238,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMailMerge_createInstance( const uno::Reference< XMultiServiceFactory > & /*rSMgr*/) throw( uno::Exception ) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; //the module may not be loaded SwDLL::Init(); @@ -1251,3 +1246,4 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMailMerge_createInstance( return xRef; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx index 20ff10b7f8..c9c52bf876 100644 --- a/sw/source/ui/uno/unomod.cxx +++ b/sw/source/ui/uno/unomod.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,7 +31,7 @@ #include <swtypes.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <unomod.hxx> #include <unomid.h> #include <unoprnms.hxx> @@ -42,7 +43,7 @@ #include <docsh.hxx> #include <wrtsh.hxx> #include <viewopt.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <com/sun/star/text/NotePrintMode.hpp> #include <doc.hxx> @@ -53,7 +54,6 @@ #include <edtwin.hxx> #include <rtl/ustrbuf.hxx> #include <tools/urlobj.hxx> - using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -106,6 +106,7 @@ enum SwViewSettingsPropertyHandles HANDLE_VIEWSET_HORI_RULER_METRIC, HANDLE_VIEWSET_VERT_RULER_METRIC }; + enum SwPrintSettingsPropertyHandles { HANDLE_PRINTSET_ANNOTATION_MODE, @@ -177,6 +178,7 @@ static ChainablePropertySetInfo * lcl_createViewSettingsInfo() }; return new ChainablePropertySetInfo ( aViewSettingsMap_Impl ); } + static ChainablePropertySetInfo * lcl_createPrintSettingsInfo() { static PropertyInfo aPrintSettingsMap_Impl[] = @@ -207,85 +209,66 @@ static ChainablePropertySetInfo * lcl_createPrintSettingsInfo() /****************************************************************** * SwXModule ******************************************************************/ -/* -----------------30.03.99 15:10------------------- - * - * --------------------------------------------------*/ Reference< uno::XInterface > SAL_CALL SwXModule_createInstance( const Reference< XMultiServiceFactory > & /*rSMgr*/) throw( Exception ) { static Reference< uno::XInterface > xModule = (cppu::OWeakObject*)new SwXModule();; return xModule; } -/* -----------------------------17.04.01 13:11-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< OUString > SAL_CALL SwXModule_getSupportedServiceNames() throw() { OUString sService( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.GlobalSettings")); const Sequence< OUString > aSeq( &sService, 1 ); return aSeq; } -/* -----------------------------17.04.01 13:11-------------------------------- - ---------------------------------------------------------------------------*/ OUString SAL_CALL SwXModule_getImplementationName() throw() { return OUString( RTL_CONSTASCII_USTRINGPARAM("SwXModule" ) ); } -/*-- 17.12.98 12:19:01--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXModule::SwXModule() : pxViewSettings(0), pxPrintSettings(0) { } -/*-- 17.12.98 12:19:02--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXModule::~SwXModule() { delete pxViewSettings; delete pxPrintSettings; } -/*-- 17.12.98 12:19:03--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XPropertySet > SwXModule::getViewSettings(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!pxViewSettings) { ((SwXModule*)this)->pxViewSettings = new Reference< XPropertySet > ; - DBG_ERROR("Web oder Text?"); + OSL_ENSURE(false, "Web or Text?"); *pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( sal_False, 0 ) ); } return *pxViewSettings; } -/*-- 17.12.98 12:19:03--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XPropertySet > SwXModule::getPrintSettings(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!pxPrintSettings) { ((SwXModule*)this)->pxPrintSettings = new Reference< XPropertySet > ; - DBG_ERROR("Web oder Text?"); + OSL_ENSURE(false, "Web or Text?"); *pxPrintSettings = static_cast < HelperBaseNoState * > ( new SwXPrintSettings ( PRINT_SETTINGS_MODULE ) ); } return *pxPrintSettings; } -/* -----------------------------06.04.00 10:59-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXModule::getImplementationName(void) throw( RuntimeException ) { return SwXModule_getImplementationName(); } -/* -----------------------------06.04.00 10:59-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwXModule::supportsService(const OUString& rServiceName) throw( RuntimeException ) { const Sequence< OUString > aNames = SwXModule_getSupportedServiceNames(); @@ -296,9 +279,7 @@ sal_Bool SwXModule::supportsService(const OUString& rServiceName) throw( Runtime } return sal_False; } -/* -----------------------------06.04.00 10:59-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< OUString > SwXModule::getSupportedServiceNames(void) throw( RuntimeException ) { return SwXModule_getSupportedServiceNames(); @@ -307,9 +288,6 @@ Sequence< OUString > SwXModule::getSupportedServiceNames(void) throw( RuntimeExc /****************************************************************** * SwXPrintSettings ******************************************************************/ -/*-- 17.12.98 12:54:04--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXPrintSettings::SwXPrintSettings(SwXPrintSettingsType eType, SwDoc* pDoc) : ChainableHelperNoState ( lcl_createPrintSettingsInfo (), &Application::GetSolarMutex() ) , meType(eType) @@ -317,9 +295,7 @@ SwXPrintSettings::SwXPrintSettings(SwXPrintSettingsType eType, SwDoc* pDoc) , mpDoc ( pDoc ) { } -/*-- 17.12.98 12:54:05--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXPrintSettings::~SwXPrintSettings() throw() { @@ -475,6 +451,7 @@ void SwXPrintSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, throw UnknownPropertyException(); } } + void SwXPrintSettings::_postSetValues () throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) { @@ -501,6 +478,7 @@ void SwXPrintSettings::_preGetValues () break; } } + void SwXPrintSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, uno::Any & rValue ) throw(UnknownPropertyException, WrappedTargetException ) { @@ -574,28 +552,23 @@ void SwXPrintSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, throw UnknownPropertyException(); } } + void SwXPrintSettings::_postGetValues () throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) { mpPrtOpt = NULL; } -/* -----------------------------06.04.00 11:02-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXPrintSettings::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXPrintSettings"); } -/* -----------------------------06.04.00 11:02-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwXPrintSettings::supportsService(const OUString& rServiceName) throw( RuntimeException ) { return C2U("com.sun.star.text.PrintSettings") == rServiceName; } -/* -----------------------------06.04.00 11:02-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< OUString > SwXPrintSettings::getSupportedServiceNames(void) throw( RuntimeException ) { Sequence< OUString > aRet(1); @@ -604,13 +577,6 @@ Sequence< OUString > SwXPrintSettings::getSupportedServiceNames(void) throw( Run return aRet; } - -/****************************************************************** - * - ******************************************************************/ -/*-- 18.12.98 11:01:10--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXViewSettings::SwXViewSettings(sal_Bool bWebView, SwView* pVw) : ChainableHelperNoState( lcl_createViewSettingsInfo (), &Application::GetSolarMutex() ) , pView(pVw) @@ -628,14 +594,13 @@ SwXViewSettings::SwXViewSettings(sal_Bool bWebView, SwView* pVw) mpInfo->remove ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "HelpURL" ) ) ); } -/*-- 18.12.98 11:01:10--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXViewSettings::~SwXViewSettings() throw() { } + void SwXViewSettings::_preSetValues () throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) { @@ -654,6 +619,7 @@ void SwXViewSettings::_preSetValues () if(pView) mpViewOption->SetStarOneSetting(sal_True); } + void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, const uno::Any &rValue ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) { @@ -763,8 +729,8 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c break; default: throw IllegalArgumentException( - ::rtl::OUString::createFromAscii( - "SwXViewSettings: invalid zoom type"), 0, 0); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "SwXViewSettings: invalid zoom type")), 0, 0); break; } if(eZoom < USHRT_MAX) @@ -875,6 +841,7 @@ void SwXViewSettings::_preGetValues () else mpConstViewOption = SW_MOD()->GetViewOption(bWeb); } + void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, uno::Any & rValue ) throw(UnknownPropertyException, WrappedTargetException ) { @@ -1012,11 +979,12 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u bBool = sal_False; } break; - default: DBG_ERROR("Diese Id gibt's nicht!"); + default: OSL_ENSURE(false, "there is no such ID!"); } if( bBool ) rValue.setValue(&bBoolVal, ::getBooleanCppuType()); } + void SwXViewSettings::_postGetValues () throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) { @@ -1041,3 +1009,4 @@ Sequence< OUString > SwXViewSettings::getSupportedServiceNames(void) throw( Runt return aRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/unomodule.cxx b/sw/source/ui/uno/unomodule.cxx index fe0041d04e..12f4736eb1 100644 --- a/sw/source/ui/uno/unomodule.cxx +++ b/sw/source/ui/uno/unomodule.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,7 +38,7 @@ #include <sfx2/objface.hxx> #include <sfx2/bindings.hxx> #include <sfx2/request.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> using namespace ::com::sun::star; @@ -57,7 +58,7 @@ uno::Sequence< rtl::OUString > SAL_CALL SwUnoModule_getSupportedServiceNames() t uno::Reference< uno::XInterface > SAL_CALL SwUnoModule_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return uno::Reference< uno::XInterface >( dynamic_cast< frame::XDispatch * >(new SwUnoModule( rSMgr )), uno::UNO_QUERY ); } @@ -69,7 +70,7 @@ void SAL_CALL SwUnoModule::dispatchWithNotification( const util::URL& aURL, cons // asynchronous ... uno::Reference< uno::XInterface > xThis(static_cast< frame::XNotifyingDispatch* >(this)); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SwDLL::Init(); const SfxSlot* pSlot = SW_MOD()->GetInterface()->GetSlot( aURL.Complete ); @@ -136,7 +137,7 @@ REFERENCE< XDISPATCH > SAL_CALL SwUnoModule::queryDispatch( { REFERENCE< XDISPATCH > xReturn; - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SwDLL::Init(); const SfxSlot* pSlot = SW_MOD()->GetInterface()->GetSlot( aURL.Complete ); if ( pSlot ) @@ -170,3 +171,4 @@ uno::Sequence< ::rtl::OUString > SAL_CALL SwUnoModule::getSupportedServiceNames( return SwUnoModule_getSupportedServiceNames(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/unomodule.hxx b/sw/source/ui/uno/unomodule.hxx index 4292c47a68..405f712da4 100644 --- a/sw/source/ui/uno/unomodule.hxx +++ b/sw/source/ui/uno/unomodule.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -96,3 +97,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index e7ad92a0f8..1de417b97b 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* - * + * * 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 @@ -28,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/image.hxx> #include <vcl/virdev.hxx> #include <vcl/svapp.hxx> @@ -42,9 +43,7 @@ #include <swtypes.hxx> #include <wdocsh.hxx> #include <wrtsh.hxx> -#include <view.hxx> #include <pview.hxx> -#include <srcview.hxx> #include <viewsh.hxx> #include <pvprtdat.hxx> #include <printdata.hxx> @@ -77,7 +76,6 @@ #include <globdoc.hxx> #include <viewopt.hxx> #include <unochart.hxx> -#include <doc.hxx> #include <charatr.hxx> #include <svx/xmleohlp.hxx> #include <globals.hrc> @@ -115,17 +113,12 @@ #include <osl/file.hxx> #include <comphelper/storagehelper.hxx> - // --> FME 2004-06-08 #i12836# enhanced pdf export #include <EnhancedPDFExportHelper.hxx> // <-- #include <numrule.hxx> -///////////////////////////Modified on Jun. 14th////////////////////////// -///////////////////////for getDocumentLanguages/////////////////////////// -//--> #include <editeng/langitem.hxx> -#include <doc.hxx> #include <docary.hxx> //SwCharFmts #include <i18npool/mslangid.hxx> @@ -140,7 +133,6 @@ #include <view.hxx> #include <srcview.hxx> -//#include <com/sun/star/i18n/ScriptType.hpp> #include <svtools/langtab.hxx> #include <map> #include <set> @@ -152,8 +144,6 @@ #include <svl/languageoptions.hxx> #include <svx/svdview.hxx> -// -//<-- using namespace ::com::sun::star; using namespace ::com::sun::star::text; using namespace ::com::sun::star::i18n; @@ -166,9 +156,6 @@ using namespace ::com::sun::star::i18n; using ::rtl::OUString; using ::osl::FileBase; -/* -----------------------------17.01.01 15:43-------------------------------- - - ---------------------------------------------------------------------------*/ #define SW_CREATE_DASH_TABLE 0x01 #define SW_CREATE_GRADIENT_TABLE 0x02 #define SW_CREATE_HATCH_TABLE 0x03 @@ -177,6 +164,7 @@ using ::osl::FileBase; #define SW_CREATE_MARKER_TABLE 0x06 #define SW_CREATE_DRAW_DEFAULTS 0x07 +#include <comphelper/processfactory.hxx> /****************************************************************************** * @@ -196,16 +184,13 @@ SwPrintUIOptions * lcl_GetPrintUIOptions( const SwView * pSwView = dynamic_cast< const SwView * >(pView); const bool bHasSelection = pSwView ? pSwView->HasSelection( sal_False ) : false; // check for any selection, not just text selection const bool bHasPostIts = lcl_GetPostIts( pDocShell->GetDoc(), 0 ); - + // get default values to use in dialog from documents SwPrintData const SwPrintData &rPrintData = pDocShell->GetDoc()->getPrintData(); - + return new SwPrintUIOptions( bWebDoc, bSwSrcView, bHasSelection, bHasPostIts, rPrintData ); } -//////////////////////////////////////////////////////////// - - SwTxtFmtColl *lcl_GetParaStyle(const String& rCollName, SwDoc* pDoc) { SwTxtFmtColl* pColl = pDoc->FindTxtFmtCollByName( rCollName ); @@ -217,6 +202,7 @@ SwTxtFmtColl *lcl_GetParaStyle(const String& rCollName, SwDoc* pDoc) } return pColl; } + void lcl_DisposeView( SfxViewFrame* pToClose, SwDocShell* pDocShell ) { // check if the view frame still exists @@ -234,17 +220,13 @@ void lcl_DisposeView( SfxViewFrame* pToClose, SwDocShell* pDocShell ) sal_False ); } } -/* -----------------------------10.03.00 18:02-------------------------------- - ---------------------------------------------------------------------------*/ const Sequence< sal_Int8 > & SwXTextDocument::getUnoTunnelId() { static Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; } -/* -----------------------------10.03.00 18:04-------------------------------- - ---------------------------------------------------------------------------*/ sal_Int64 SAL_CALL SwXTextDocument::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException) { @@ -254,6 +236,12 @@ sal_Int64 SAL_CALL SwXTextDocument::getSomething( const Sequence< sal_Int8 >& rI { return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this )); } + if( rId.getLength() == 16 + && 0 == rtl_compareMemory( SfxObjectShell::getUnoTunnelId().getConstArray(), + rId.getConstArray(), 16 ) ) + { + return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(pDocShell )); + } sal_Int64 nRet = SfxBaseModel::getSomething( rId ); if ( nRet ) @@ -270,9 +258,7 @@ sal_Int64 SAL_CALL SwXTextDocument::getSomething( const Sequence< sal_Int8 >& rI return SfxBaseModel::getSomething( rId ); } -/* -----------------------------16.03.00 14:12-------------------------------- - ---------------------------------------------------------------------------*/ Any SAL_CALL SwXTextDocument::queryInterface( const uno::Type& rType ) throw(RuntimeException) { Any aRet = SwXTextDocumentBaseClass::queryInterface(rType); @@ -285,7 +271,7 @@ Any SAL_CALL SwXTextDocument::queryInterface( const uno::Type& rType ) throw(Run aRet <<= xTmp; } - if ( !aRet.hasValue() + if ( !aRet.hasValue() && rType != ::getCppuType((Reference< com::sun::star::document::XDocumentEventBroadcaster>*)0) && rType != ::getCppuType((Reference< com::sun::star::frame::XController>*)0) && rType != ::getCppuType((Reference< com::sun::star::frame::XFrame>*)0) @@ -300,30 +286,22 @@ Any SAL_CALL SwXTextDocument::queryInterface( const uno::Type& rType ) throw(Run } return aRet; } -/* -----------------------------16.03.00 14:12-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextDocument::acquire()throw() { SfxBaseModel::acquire(); } -/* -----------------------------16.03.00 14:12-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextDocument::release()throw() { SfxBaseModel::release(); } -/* -----------------------------07.12.00 11:37-------------------------------- - ---------------------------------------------------------------------------*/ Reference< XAdapter > SwXTextDocument::queryAdapter( ) throw(RuntimeException) { return SfxBaseModel::queryAdapter(); } -/* -----------------------------16.03.00 14:12-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< uno::Type > SAL_CALL SwXTextDocument::getTypes() throw(RuntimeException) { Sequence< uno::Type > aBaseTypes = SfxBaseModel::getTypes(); @@ -359,9 +337,7 @@ Sequence< uno::Type > SAL_CALL SwXTextDocument::getTypes() throw(RuntimeExceptio pBaseTypes[nIndex++] = ::getCppuType((Reference<lang::XMultiServiceFactory>*)0); return aBaseTypes; } -/*-- 18.12.98 11:52:59--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextDocument::SwXTextDocument(SwDocShell* pShell) : SfxBaseModel(pShell), @@ -402,10 +378,11 @@ SwXTextDocument::SwXTextDocument(SwDocShell* pShell) : m_pPrintUIOptions( NULL ), m_pRenderData( NULL ) { + uno::Reference< document::XDocumentProperties > xWriterProps( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.writer.DocumentProperties") ), uno::UNO_QUERY_THROW); + + SfxBaseModel::setDocumentProperties( xWriterProps ); } -/*-- 18.12.98 11:53:00--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextDocument::~SwXTextDocument() { InitNewDoc(); @@ -419,13 +396,6 @@ SwXTextDocument::~SwXTextDocument() delete m_pRenderData; } - -/*-- 18.12.98 11:55:08--------------------------------------------------- - - -----------------------------------------------------------------------*/ -/* -----------------18.12.98 12:49------------------- - * - * --------------------------------------------------*/ SwXDocumentPropertyHelper * SwXTextDocument::GetPropertyHelper () { if(!xPropertyHelper.is()) @@ -435,6 +405,7 @@ SwXDocumentPropertyHelper * SwXTextDocument::GetPropertyHelper () } return pPropertyHelper; } + void SwXTextDocument::GetNumberFormatter() { if(IsValid()) @@ -463,18 +434,16 @@ void SwXTextDocument::GetNumberFormatter() xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId())); } - DBG_ASSERT(pNumFmt, "No number formatter available"); + OSL_ENSURE(pNumFmt, "No number formatter available"); if(!pNumFmt->GetNumberFormatter()) pNumFmt->SetNumberFormatter(pDocShell->GetDoc()->GetNumberFormatter( sal_True )); } } } -/*-- 18.12.98 11:55:11--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XText > SwXTextDocument::getText(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!xBodyText.is()) @@ -484,21 +453,17 @@ Reference< XText > SwXTextDocument::getText(void) throw( RuntimeException ) } return xBodyText; } -/*-- 18.12.98 11:55:11--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::reformat(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); } -/*-- 18.12.98 11:55:16--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::lockControllers(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(IsValid()) { UnoActionContext* pContext = new UnoActionContext(pDocShell->GetDoc()); @@ -507,12 +472,10 @@ void SwXTextDocument::lockControllers(void) throw( RuntimeException ) else throw RuntimeException(); } -/*-- 18.12.98 11:55:16--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::unlockControllers(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(aActionArr.Count()) { UnoActionContext* pContext = aActionArr.GetObject(0); @@ -522,35 +485,27 @@ void SwXTextDocument::unlockControllers(void) throw( RuntimeException ) else throw RuntimeException(); } -/*-- 18.12.98 11:55:17--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextDocument::hasControllersLocked(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; return aActionArr.Count() > 0; } -/*-- 18.12.98 13:12:23--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< frame::XController > SwXTextDocument::getCurrentController(void) throw( RuntimeException ) { return SfxBaseModel::getCurrentController(); } -/*-- 18.12.98 13:12:24--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::setCurrentController(const Reference< frame::XController > & xController) throw( NoSuchElementException, RuntimeException ) { SfxBaseModel::setCurrentController(xController); } -/* -----------------27.01.99 11:48------------------- - * - * --------------------------------------------------*/ + Reference< XInterface > SwXTextDocument::getCurrentSelection() throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; Reference< XInterface > xRef; if(IsValid()) { @@ -570,80 +525,58 @@ Reference< XInterface > SwXTextDocument::getCurrentSelection() throw( RuntimeEx return xRef; } -/*-- 18.12.98 13:12:24--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_Bool SwXTextDocument::attachResource(const OUString& aURL, const Sequence< beans::PropertyValue >& aArgs) throw( RuntimeException ) { return SfxBaseModel::attachResource(aURL, aArgs); } -/*-- 18.12.98 13:12:24--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString SwXTextDocument::getURL(void) throw( RuntimeException ) { return SfxBaseModel::getURL(); } -/*-- 18.12.98 13:12:24--------------------------------------------------- - -----------------------------------------------------------------------*/ Sequence< beans::PropertyValue > SwXTextDocument::getArgs(void) throw( RuntimeException ) { return SfxBaseModel::getArgs(); } -/*-- 18.12.98 13:12:24--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::connectController(const Reference< frame::XController > & xController) throw( RuntimeException ) { SfxBaseModel::connectController(xController); } -/*-- 18.12.98 13:12:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::disconnectController(const Reference< frame::XController > & xController) throw( RuntimeException ) { SfxBaseModel::disconnectController(xController); } -/*-- 18.12.98 13:12:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::dispose(void) throw( RuntimeException ) { SfxBaseModel::dispose(); } -/*-- 10.05.2005 14:14:39--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::close( sal_Bool bDeliverOwnership ) throw( util::CloseVetoException, RuntimeException ) { if(IsValid() && m_pHiddenViewFrame) lcl_DisposeView( m_pHiddenViewFrame, pDocShell); SfxBaseModel::close(bDeliverOwnership); } -/*-- 18.12.98 13:12:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::addEventListener(const Reference< lang::XEventListener > & aListener) throw( RuntimeException ) { SfxBaseModel::addEventListener(aListener); } -/*-- 18.12.98 13:12:26--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::removeEventListener(const Reference< lang::XEventListener > & aListener) throw( RuntimeException ) { SfxBaseModel::removeEventListener(aListener); } -/*-- 18.12.98 11:55:19--------------------------------------------------- - - -----------------------------------------------------------------------*/ Reference< XPropertySet > SwXTextDocument::getLineNumberingProperties(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(IsValid()) { if(!pxXLineNumberingProperties) @@ -656,13 +589,11 @@ Reference< XPropertySet > SwXTextDocument::getLineNumberingProperties(void) throw RuntimeException(); return *pxXLineNumberingProperties; } -/*-- 18.12.98 11:55:20--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XIndexReplace > SwXTextDocument::getChapterNumberingRules(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXChapterNumbering) @@ -675,7 +606,7 @@ Reference< XIndexReplace > SwXTextDocument::getChapterNumberingRules(void) Reference< XIndexAccess > SwXTextDocument::getNumberingRules(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXNumberingRules ) @@ -686,12 +617,9 @@ Reference< XIndexAccess > SwXTextDocument::getNumberingRules(void) throw( Runti return *pxXNumberingRules; } -/*-- 18.12.98 11:55:21--------------------------------------------------- - - -----------------------------------------------------------------------*/ Reference< XIndexAccess > SwXTextDocument::getFootnotes(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXFootnotes) @@ -701,13 +629,11 @@ Reference< XIndexAccess > SwXTextDocument::getFootnotes(void) throw( RuntimeExc } return *pxXFootnotes; } -/*-- 18.12.98 11:55:21--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XPropertySet > SAL_CALL SwXTextDocument::getFootnoteSettings(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXFootnoteSettings) @@ -717,12 +643,10 @@ Reference< XPropertySet > SAL_CALL } return *pxXFootnoteSettings; } -/*-- 18.12.98 11:55:21--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XIndexAccess > SwXTextDocument::getEndnotes(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXEndnotes) @@ -732,12 +656,10 @@ Reference< XIndexAccess > SwXTextDocument::getEndnotes(void) throw( RuntimeExce } return *pxXEndnotes; } -/*-- 18.12.98 11:55:22--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XPropertySet > SwXTextDocument::getEndnoteSettings(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXEndnoteSettings) @@ -747,19 +669,15 @@ Reference< XPropertySet > SwXTextDocument::getEndnoteSettings(void) throw( Runt } return *pxXEndnoteSettings; } -/*-- 18.12.98 11:55:22--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< util::XReplaceDescriptor > SwXTextDocument::createReplaceDescriptor(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; Reference< util::XReplaceDescriptor > xRet = new SwXTextSearch; return xRet; } -/* -----------------26.02.99 15:52------------------- - * - * --------------------------------------------------*/ + SwUnoCrsr* SwXTextDocument::CreateCursorForSearch(Reference< XTextCursor > & xCrsr) { getText(); @@ -773,13 +691,10 @@ SwUnoCrsr* SwXTextDocument::CreateCursorForSearch(Reference< XTextCursor > & xC return pUnoCrsr; } -/*-- 18.12.98 11:55:22--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor > & xDesc) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; Reference< XUnoTunnel > xDescTunnel(xDesc, UNO_QUERY); if(!IsValid() || !xDescTunnel.is() || !xDescTunnel->getSomething(SwXTextSearch::getUnoTunnelId())) throw RuntimeException(); @@ -848,18 +763,17 @@ sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor > return (sal_Int32)nResult; } -/*-- 18.12.98 11:55:22--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< util::XSearchDescriptor > SwXTextDocument::createSearchDescriptor(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; Reference< util::XSearchDescriptor > xRet = new SwXTextSearch; return xRet; } -/* -----------------26.02.99 16:08------------------- + +/* -------------------------------------------------- * wird fuer findAll/First/Next verwendet * --------------------------------------------------*/ SwUnoCrsr* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor > & xDesc, @@ -967,7 +881,7 @@ SwUnoCrsr* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor > (FindRanges)eRanges, pReplaceColl ); } else - { + { //todo/mba: assuming that notes should be omitted sal_Bool bSearchInNotes = sal_False; sal_Bool bCancel; @@ -984,14 +898,12 @@ SwUnoCrsr* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor > } return pUnoCrsr; } -/*-- 18.12.98 11:55:23--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XIndexAccess > SwXTextDocument::findAll(const Reference< util::XSearchDescriptor > & xDesc) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; Reference< XInterface > xTmp; sal_Int32 nResult = 0; Reference< XTextCursor > xCrsr; @@ -1003,13 +915,11 @@ Reference< XIndexAccess > delete pResultCrsr; return xRet; } -/*-- 18.12.98 11:55:23--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XInterface > SwXTextDocument::findFirst(const Reference< util::XSearchDescriptor > & xDesc) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; Reference< XInterface > xTmp; sal_Int32 nResult = 0; Reference< XTextCursor > xCrsr; @@ -1027,14 +937,12 @@ Reference< XInterface > SwXTextDocument::findFirst(const Reference< util::XSear } return xRet; } -/*-- 18.12.98 11:55:24--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XInterface > SwXTextDocument::findNext(const Reference< XInterface > & xStartAt, const Reference< util::XSearchDescriptor > & xDesc) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; Reference< XInterface > xTmp; sal_Int32 nResult = 0; Reference< XTextCursor > xCrsr; @@ -1055,13 +963,11 @@ Reference< XInterface > SwXTextDocument::findNext(const Reference< XInterface > } return xRet; } -/*-- 18.12.98 11:55:24--------------------------------------------------- - -----------------------------------------------------------------------*/ Sequence< beans::PropertyValue > SwXTextDocument::getPagePrintSettings(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; Sequence< beans::PropertyValue > aSeq(9); if(IsValid()) { @@ -1095,9 +1001,7 @@ Sequence< beans::PropertyValue > SwXTextDocument::getPagePrintSettings(void) throw RuntimeException(); return aSeq; } -/* -----------------24.02.99 10:57------------------- - * - * --------------------------------------------------*/ + sal_uInt32 lcl_Any_To_ULONG(const Any& rValue, sal_Bool& bException) { bException = sal_False; @@ -1116,9 +1020,7 @@ sal_uInt32 lcl_Any_To_ULONG(const Any& rValue, sal_Bool& bException) return nRet; } -/*-- 09.06.2004 12:18:10--------------------------------------------------- - -----------------------------------------------------------------------*/ String lcl_CreateOutlineString( sal_uInt16 nIndex, const SwOutlineNodes& rOutlineNodes, const SwNumRule* pOutlRule) { @@ -1140,13 +1042,11 @@ String lcl_CreateOutlineString( sal_uInt16 nIndex, GetTxtNode()->GetExpandTxt( 0, STRING_LEN, sal_False ); return sEntry; } -/*-- 18.12.98 11:55:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::setPagePrintSettings(const Sequence< beans::PropertyValue >& aSettings) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(IsValid()) { SwPagePreViewPrtData aData; @@ -1213,13 +1113,11 @@ void SwXTextDocument::setPagePrintSettings(const Sequence< beans::PropertyValue else throw RuntimeException(); } -/*-- 18.12.98 11:55:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOptions) throw( IllegalArgumentException, RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(IsValid()) { SfxViewFrame* pFrame = SfxViewFrame::LoadHiddenDocument( *pDocShell, 7 ); @@ -1227,11 +1125,11 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption pDocShell->GetDoc()->GetAttrPool()); aReq.AppendItem(SfxBoolItem(FN_PRINT_PAGEPREVIEW, sal_True)); - OUString sFileName( C2U(SW_PROP_NAME_STR(UNO_NAME_FILE_NAME))); - OUString sCopyCount(C2U(SW_PROP_NAME_STR(UNO_NAME_COPY_COUNT))); - OUString sCollate(C2U(SW_PROP_NAME_STR(UNO_NAME_COLLATE))); - OUString sSort(C2U(SW_PROP_NAME_STR(UNO_NAME_SORT))); - OUString sPages(C2U(SW_PROP_NAME_STR(UNO_NAME_PAGES))); + OUString sFileName(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_FILE_NAME))); + OUString sCopyCount(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_COPY_COUNT))); + OUString sCollate(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_COLLATE))); + OUString sSort(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SORT))); + OUString sPages(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_PAGES))); for ( int n = 0; n < xOptions.getLength(); ++n ) { @@ -1301,13 +1199,11 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption else throw RuntimeException(); } -/*-- 18.12.98 11:55:25--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XNameAccess > SwXTextDocument::getReferenceMarks(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXReferenceMarks) @@ -1317,12 +1213,10 @@ Reference< XNameAccess > SwXTextDocument::getReferenceMarks(void) } return *pxXReferenceMarks; } -/* -----------------21.12.98 10:20------------------- - * - * --------------------------------------------------*/ + Reference< XEnumerationAccess > SwXTextDocument::getTextFields(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXTextFieldTypes) @@ -1332,13 +1226,11 @@ Reference< XEnumerationAccess > SwXTextDocument::getTextFields(void) throw( Run } return *pxXTextFieldTypes; } -/*-- 21.12.98 10:21:12--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XNameAccess > SwXTextDocument::getTextFieldMasters(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXTextFieldMasters) @@ -1348,12 +1240,10 @@ Reference< XNameAccess > SwXTextDocument::getTextFieldMasters(void) } return *pxXTextFieldMasters; } -/*-- 21.12.98 10:21:12--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XNameAccess > SwXTextDocument::getEmbeddedObjects(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXEmbeddedObjects) @@ -1363,12 +1253,10 @@ Reference< XNameAccess > SwXTextDocument::getEmbeddedObjects(void) throw( Runti } return *pxXEmbeddedObjects; } -/*-- 21.12.98 10:21:13--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XNameAccess > SwXTextDocument::getBookmarks(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXBookmarks) @@ -1378,12 +1266,10 @@ Reference< XNameAccess > SwXTextDocument::getBookmarks(void) throw( RuntimeExce } return *pxXBookmarks; } -/*-- 21.12.98 10:21:13--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XNameAccess > SwXTextDocument::getTextSections(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXTextSections) @@ -1393,12 +1279,10 @@ Reference< XNameAccess > SwXTextDocument::getTextSections(void) throw( RuntimeE } return *pxXTextSections; } -/*-- 21.12.98 10:21:13--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XNameAccess > SwXTextDocument::getTextTables(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXTextTables) @@ -1408,12 +1292,10 @@ Reference< XNameAccess > SwXTextDocument::getTextTables(void) throw( RuntimeExc } return *pxXTextTables; } -/*-- 21.12.98 10:21:13--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XNameAccess > SwXTextDocument::getGraphicObjects(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXGraphicObjects) @@ -1423,12 +1305,10 @@ Reference< XNameAccess > SwXTextDocument::getGraphicObjects(void) throw( Runtim } return *pxXGraphicObjects; } -/*-- 21.12.98 10:21:14--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XNameAccess > SwXTextDocument::getTextFrames(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXTextFrames) @@ -1438,12 +1318,10 @@ Reference< XNameAccess > SwXTextDocument::getTextFrames(void) throw( RuntimeExc } return *pxXTextFrames; } -/* -----------------21.12.98 10:56------------------- - * - * --------------------------------------------------*/ + Reference< XNameAccess > SwXTextDocument::getStyleFamilies(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXStyleFamilies) @@ -1453,13 +1331,11 @@ Reference< XNameAccess > SwXTextDocument::getStyleFamilies(void) throw( Runtime } return *pxXStyleFamilies; } -/*-- 19.05.06 10:15:22--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< style::XAutoStyles > SwXTextDocument::getAutoStyles( ) throw (uno::RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXAutoStyles) @@ -1470,12 +1346,10 @@ uno::Reference< style::XAutoStyles > SwXTextDocument::getAutoStyles( ) return *pxXAutoStyles; } -/*-- 22.01.99 10:18:03--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< drawing::XDrawPage > SwXTextDocument::getDrawPage(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXDrawPage) @@ -1484,17 +1358,10 @@ Reference< drawing::XDrawPage > SwXTextDocument::getDrawPage(void) throw( Runti // for the case that it did something by purpose ((SwXTextDocument*)this)->pDrawPage = new SwXDrawPage(pDocShell->GetDoc()); ((SwXTextDocument*)this)->pxXDrawPage = new Reference< drawing::XDrawPage >(pDrawPage); - - //((SwXTextDocument*)this)->pxXDrawPage = new Reference< drawing::XDrawPage > ; - //((SwXTextDocument*)this)->pDrawPage = new SwXDrawPage(pDocShell->GetDoc()); - //Reference< drawing::XShapes > xTmp = pDrawPage; - //*pxXDrawPage = Reference< drawing::XDrawPage>(xTmp, UNO_QUERY); } return *pxXDrawPage; } -/* -----------------07.04.99 10:11------------------- - * - * --------------------------------------------------*/ + SwXDrawPage* SwXTextDocument::GetDrawPage() { if(!IsValid()) @@ -1503,9 +1370,7 @@ SwXDrawPage* SwXTextDocument::GetDrawPage() getDrawPage(); return pDrawPage; } -/*-- 18.12.98 11:55:26--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::Invalidate() { bObjectValid = sal_False; @@ -1521,15 +1386,13 @@ void SwXTextDocument::Invalidate() xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId())); pNumFmt->SetNumberFormatter(0); } - DBG_ASSERT(pNumFmt, "No number formatter available"); + OSL_ENSURE(pNumFmt, "No number formatter available"); } InitNewDoc(); pDocShell = 0; aRefreshCont.Disposing(); } -/* -----------------------------13.07.00 15:59-------------------------------- - ---------------------------------------------------------------------------*/ void SwXTextDocument::Reactivate(SwDocShell* pNewDocShell) { if(pDocShell && pDocShell != pNewDocShell) @@ -1537,9 +1400,7 @@ void SwXTextDocument::Reactivate(SwDocShell* pNewDocShell) pDocShell = pNewDocShell; bObjectValid = sal_True; } -/*-- 18.12.98 11:55:26--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::InitNewDoc() { // zunaechst alle Collections invalidieren, dann Referenzen loeschen und Null setzen @@ -1593,7 +1454,7 @@ void SwXTextDocument::InitNewDoc() xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId())); } - DBG_ASSERT(pNumFmt, "No number formatter available"); + OSL_ENSURE(pNumFmt, "No number formatter available"); pNumFmt->SetNumberFormatter(0); } @@ -1748,14 +1609,11 @@ void SwXTextDocument::InitNewDoc() } } -/*-- 11.03.99 11:51:40--------------------------------------------------- - - -----------------------------------------------------------------------*/ #define COM_SUN_STAR__DRAWING_LENGTH 13 Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServiceName) throw( Exception, RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); Reference< XInterface > xRet; @@ -1833,7 +1691,7 @@ Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServic if ( bShape && rServiceName.compareToAscii( "com.sun.star.drawing.temporaryForXMLImportOLE2Shape" ) == 0 ) { - aTmpServiceName = OUString::createFromAscii( "com.sun.star.drawing.OLE2Shape" ); + aTmpServiceName = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")); } //hier den Draw - Service suchen Reference< XInterface > xTmp = SvxFmMSFactory::createInstance(aTmpServiceName); @@ -1856,9 +1714,7 @@ Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServic } return xRet; } -/*-- 11.03.99 11:51:40--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XInterface > SwXTextDocument::createInstanceWithArguments( const OUString& ServiceSpecifier, const Sequence< Any >& /*Arguments*/) @@ -1869,9 +1725,7 @@ Reference< XInterface > SwXTextDocument::createInstanceWithArguments( //Parameter zwingend angewiesen sind - bis jetzt haben wir das nicht return xInt; } -/*-- 11.03.99 11:51:41--------------------------------------------------- - -----------------------------------------------------------------------*/ Sequence< OUString > SwXTextDocument::getAvailableServiceNames(void) throw( RuntimeException ) { @@ -1895,16 +1749,12 @@ Sequence< OUString > SwXTextDocument::getAvailableServiceNames(void) return aServices; } -/* -----------------18.03.99 11:36------------------- - * - * --------------------------------------------------*/ + OUString SwXTextDocument::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXTextDocument"); } -/* -----------------20.01.04 10:14------------------- - * - * --------------------------------------------------*/ + sal_Bool SwXTextDocument::supportsService(const OUString& rServiceName) throw( RuntimeException ) { if ( @@ -1923,9 +1773,7 @@ sal_Bool SwXTextDocument::supportsService(const OUString& rServiceName) throw( R (bTextDoc && rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextDocument" ))) ); } -/* -----------------20.01.04 10:17------------------- - * - * --------------------------------------------------*/ + Sequence< OUString > SwXTextDocument::getSupportedServiceNames(void) throw( RuntimeException ) { sal_Bool bWebDoc = (0 != PTR_CAST(SwWebDocShell, pDocShell)); @@ -1949,12 +1797,10 @@ Sequence< OUString > SwXTextDocument::getSupportedServiceNames(void) throw( Runt return aRet; } -/* -----------------05.05.99 12:10------------------- - * - * --------------------------------------------------*/ + Reference< XIndexAccess > SwXTextDocument::getDocumentIndexes(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); if(!pxXDocumentIndexes) @@ -1965,23 +1811,18 @@ Reference< XIndexAccess > SwXTextDocument::getDocumentIndexes(void) throw( Runt return *pxXDocumentIndexes; } -/*-- 10.05.99 13:58:58--------------------------------------------------- - - -----------------------------------------------------------------------*/ Reference< XPropertySetInfo > SwXTextDocument::getPropertySetInfo(void) throw( RuntimeException ) { static Reference< XPropertySetInfo > xRet = pPropSet->getPropertySetInfo(); return xRet; } -/*-- 10.05.99 13:58:58--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any& aValue) throw( UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName); @@ -2153,13 +1994,11 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, } } } -/*-- 10.05.99 13:58:59--------------------------------------------------- - -----------------------------------------------------------------------*/ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName); @@ -2169,6 +2008,9 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) Any aAny; switch(pEntry->nWID) { + case WID_DOC_ISTEMPLATEID : + aAny <<= pDocShell->IsTemplate(); + break; case WID_DOC_CHAR_COUNT : case WID_DOC_PARA_COUNT : case WID_DOC_WORD_COUNT : @@ -2277,6 +2119,14 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) case WID_DOC_DIALOG_LIBRARIES: aAny <<= pDocShell->GetDialogContainer(); break; + case WID_DOC_VBA_DOCOBJ: + { + beans::PropertyValue aProp; + aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ThisWordDoc") ); + aProp.Value <<= pDocShell->GetModel(); + aAny <<= aProp; + } + break; case WID_DOC_RUNTIME_UID: aAny <<= getRuntimeUID(); break; @@ -2305,45 +2155,35 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) } return aAny; } -/*-- 10.05.99 13:58:59--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::addPropertyChangeListener(const OUString& /*PropertyName*/, const Reference< XPropertyChangeListener > & /*aListener*/) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, "not implemented"); } -/*-- 10.05.99 13:58:59--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::removePropertyChangeListener(const OUString& /*PropertyName*/, const Reference< XPropertyChangeListener > & /*aListener*/) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, "not implemented"); } -/*-- 10.05.99 13:59:00--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::addVetoableChangeListener(const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener > & /*aListener*/) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, "not implemented"); } -/*-- 10.05.99 13:59:00--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::removeVetoableChangeListener(const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener > & /*aListener*/) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, "not implemented"); } -/* -----------------25.10.99 10:42------------------- - --------------------------------------------------*/ Reference< XNameAccess > SwXTextDocument::getLinks(void) throw( RuntimeException ) { if(!pxLinkTargetSupplier) @@ -2353,9 +2193,7 @@ Reference< XNameAccess > SwXTextDocument::getLinks(void) throw( RuntimeExceptio } return (*pxLinkTargetSupplier); } -/* -----------------------------11.01.01 15:01-------------------------------- - ---------------------------------------------------------------------------*/ Reference< XEnumerationAccess > SwXTextDocument::getRedlines( ) throw(RuntimeException) { if(!pxXRedlines) @@ -2365,12 +2203,10 @@ Reference< XEnumerationAccess > SwXTextDocument::getRedlines( ) throw(RuntimeEx } return *pxXRedlines; } -/*-- 21.02.00 08:41:06--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::refresh(void) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); SwWrtShell *pWrtShell = pDocShell->GetWrtShell(); @@ -2378,33 +2214,27 @@ void SwXTextDocument::refresh(void) throw( RuntimeException ) if(pWrtShell) pWrtShell->CalcLayout(); } -/*-- 21.02.00 08:41:06--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::addRefreshListener(const Reference< util::XRefreshListener > & l) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if ( !IsValid() ) throw RuntimeException(); aRefreshCont.AddListener ( reinterpret_cast < const Reference < lang::XEventListener > &> ( l )); } -/*-- 21.02.00 08:41:07--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextDocument::removeRefreshListener(const Reference< util::XRefreshListener > & l) throw( RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if ( !IsValid() || !aRefreshCont.RemoveListener ( reinterpret_cast < const Reference < lang::XEventListener > &> ( l ) ) ) throw RuntimeException(); } -/* -----------------------------26.02.01 12:22-------------------------------- - ---------------------------------------------------------------------------*/ void SwXTextDocument::updateLinks( ) throw(RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); SwDoc* pDoc = pDocShell->GetDoc(); @@ -2415,11 +2245,12 @@ void SwXTextDocument::updateLinks( ) throw(RuntimeException) rLnkMan.UpdateAllLinks( sal_False, sal_False, sal_True ); } } + //XPropertyState PropertyState SAL_CALL SwXTextDocument::getPropertyState( const OUString& rPropertyName ) throw (UnknownPropertyException, RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; PropertyState eRet = PropertyState_DIRECT_VALUE; if(!IsValid()) throw RuntimeException(); @@ -2434,6 +2265,7 @@ PropertyState SAL_CALL SwXTextDocument::getPropertyState( const OUString& rPrope } return eRet; } + Sequence< PropertyState > SAL_CALL SwXTextDocument::getPropertyStates( const Sequence< OUString >& rPropertyNames ) throw (UnknownPropertyException, RuntimeException) { @@ -2447,10 +2279,11 @@ Sequence< PropertyState > SAL_CALL SwXTextDocument::getPropertyStates( const Seq return aRet; } + void SAL_CALL SwXTextDocument::setPropertyToDefault( const OUString& rPropertyName ) throw (UnknownPropertyException, RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName); @@ -2461,10 +2294,11 @@ void SAL_CALL SwXTextDocument::setPropertyToDefault( const OUString& rPropertyNa case 0:default:break; } } + Any SAL_CALL SwXTextDocument::getPropertyDefault( const OUString& rPropertyName ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap()->getByName( rPropertyName); @@ -2481,7 +2315,7 @@ Any SAL_CALL SwXTextDocument::getPropertyDefault( const OUString& rPropertyName static OutputDevice * lcl_GetOutputDevice( const SwPrintUIOptions &rPrintUIOptions ) { OutputDevice *pOut = 0; - + uno::Any aAny( rPrintUIOptions.getValue( C2U( "RenderDevice" ) )); uno::Reference< awt::XDevice > xRenderDevice; aAny >>= xRenderDevice; @@ -2492,10 +2326,9 @@ static OutputDevice * lcl_GetOutputDevice( const SwPrintUIOptions &rPrintUIOptio } return pOut; -} - +} -static bool lcl_SeqHasProperty( +static bool lcl_SeqHasProperty( const uno::Sequence< beans::PropertyValue >& rOptions, const sal_Char *pPropName ) { @@ -2506,14 +2339,13 @@ static bool lcl_SeqHasProperty( { if (pProps[i].Name.equalsAscii( pPropName )) bRes = true; - } + } return bRes; -} - +} -SfxViewShell * SwXTextDocument::GetRenderView( - bool &rbIsSwSrcView, - const uno::Sequence< beans::PropertyValue >& rOptions, +SfxViewShell * SwXTextDocument::GetRenderView( + bool &rbIsSwSrcView, + const uno::Sequence< beans::PropertyValue >& rOptions, bool bIsPDFExport ) { // get view shell to use @@ -2527,23 +2359,22 @@ SfxViewShell * SwXTextDocument::GetRenderView( const beans::PropertyValue *pProps = rOptions.getConstArray(); for (sal_Int32 i = 0; i < nLen; ++i) { - if (pProps[i].Name.equalsAscii( "View" )) - { + if (pProps[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "View" ) )) + { aTmp = pProps[i].Value; break; } - } + } uno::Reference< frame::XController > xController; if (aTmp >>= xController) { - DBG_ASSERT( xController.is(), "controller is empty!" ); + OSL_ENSURE( xController.is(), "controller is empty!" ); pView = GuessViewShell( rbIsSwSrcView, xController ); } } return pView; -} - +} /* * GetRenderDoc: @@ -2553,10 +2384,9 @@ SfxViewShell * SwXTextDocument::GetRenderView( * The rpView variable will be set (if not already done) to the used * SfxViewShell. */ - -SwDoc * SwXTextDocument::GetRenderDoc( - SfxViewShell *&rpView, - const uno::Any& rSelection, +SwDoc * SwXTextDocument::GetRenderDoc( + SfxViewShell *&rpView, + const uno::Any& rSelection, bool bIsPDFExport ) { SwDoc *pDoc = 0; @@ -2567,7 +2397,7 @@ SwDoc * SwXTextDocument::GetRenderDoc( pDoc = pDocShell->GetDoc(); else { - DBG_ASSERT( !xModel.is(), "unexpected model found" ); + OSL_ENSURE( !xModel.is(), "unexpected model found" ); if (rSelection.hasValue()) // is anything selected ? { @@ -2579,11 +2409,11 @@ SwDoc * SwXTextDocument::GetRenderDoc( { (void) bIsPDFExport; // aside from maybe PDF export the view should always have been provided! - DBG_ASSERT( bIsPDFExport, "view is missing, guessing one..." ); + OSL_ENSURE( bIsPDFExport, "view is missing, guessing one..." ); rpView = GuessViewShell( bIsSwSrcView ); } - DBG_ASSERT( rpView, "ViewShell missing" ); + OSL_ENSURE( rpView, "ViewShell missing" ); // the view shell should be SwView for documents PDF export. // for the page preview no selection should be possible // (the export dialog does not allow for this option) @@ -2599,24 +2429,20 @@ SwDoc * SwXTextDocument::GetRenderDoc( } else { - DBG_ERROR( "unexpected ViewShell" ); + OSL_ENSURE(false, "unexpected ViewShell" ); } } } return pDoc; } -/* -----------------------------23.08.02 16:00-------------------------------- - - ---------------------------------------------------------------------------*/ - -static void lcl_SavePrintUIOptionsToDocumentPrintData( - SwDoc &rDoc, +static void lcl_SavePrintUIOptionsToDocumentPrintData( + SwDoc &rDoc, const SwPrintUIOptions &rPrintUIOptions, bool bIsPDFEXport ) { SwPrintData aDocPrintData( rDoc.getPrintData() ); - + aDocPrintData.SetPrintGraphic( rPrintUIOptions.IsPrintGraphics() ); aDocPrintData.SetPrintTable( rPrintUIOptions.IsPrintTables() ); aDocPrintData.SetPrintDraw( rPrintUIOptions.IsPrintDrawings() ); @@ -2638,30 +2464,28 @@ static void lcl_SavePrintUIOptionsToDocumentPrintData( rDoc.setPrintData( aDocPrintData ); } - sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( const uno::Any& rSelection, const uno::Sequence< beans::PropertyValue >& rxOptions ) throw (IllegalArgumentException, RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ); bool bIsSwSrcView = false; SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport ); - + if (!bIsSwSrcView && !m_pRenderData) m_pRenderData = new SwRenderData; if (!m_pPrintUIOptions) m_pPrintUIOptions = lcl_GetPrintUIOptions( pDocShell, pView ); bool bFormat = m_pPrintUIOptions->processPropertiesAndCheckFormat( rxOptions ); - // const bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport ); - + SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport ); - DBG_ASSERT( pDoc && pView, "doc or view shell missing!" ); + OSL_ENSURE( pDoc && pView, "doc or view shell missing!" ); if (!pDoc || !pView) return 0; @@ -2697,7 +2521,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( // reformating the document for printing will show the changes in the view // which is likely to produce many unwanted and not nice to view actions. - // We don't want that! Thus we disable updating of the view. + // We don't want that! Thus we disable updating of the view. pWrtShell->StartAction(); const TypeId aSwViewTypeId = TYPE(SwView); @@ -2729,10 +2553,10 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( bool bStateChanged = false; if ( bOrigStatus && !SvtPrintWarningOptions().IsModifyDocumentOnPrintingAllowed() ) { - pRenderDocShell->EnableSetModified( sal_False ); + pRenderDocShell->EnableSetModified( sal_False ); bStateChanged = true; } - + // --> FME 2005-05-23 #122919# Force field update before PDF export: pWrtShell->ViewShell::UpdateFlds(sal_True); @@ -2745,10 +2569,10 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( //TODO: check what exatly needs to be done and make just one function for that pWrtShell->CalcLayout(); pWrtShell->CalcPagesForPrint( pDoc->GetPageCount() ); - + pWrtShell->SetPDFExportOption( sal_False ); - + // enable view again pWrtShell->EndAction(); } @@ -2786,27 +2610,25 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( nRet = m_pRenderData->GetPagesToPrint().size(); } } - DBG_ASSERT( nRet >= 0, "negative number of pages???" ); - + OSL_ENSURE( nRet >= 0, "negative number of pages???" ); + return nRet; } -/* -----------------------------23.08.02 16:00-------------------------------- - ---------------------------------------------------------------------------*/ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( sal_Int32 nRenderer, const uno::Any& rSelection, const uno::Sequence< beans::PropertyValue >& rxOptions ) throw (IllegalArgumentException, RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ); bool bIsSwSrcView = false; SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport ); - + // m_pRenderData should NOT be created here! // That should only be done in getRendererCount. If this function is called before // getRendererCount was called then the caller will probably just retrieve the extra UI options @@ -2822,7 +2644,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( const bool bPrintPaperFromSetup = m_pPrintUIOptions->getBoolValue( "PrintPaperFromSetup", false ); SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport ); - DBG_ASSERT( pDoc && pView, "doc or view shell missing!" ); + OSL_ENSURE( pDoc && pView, "doc or view shell missing!" ); if (!pDoc || !pView) return uno::Sequence< beans::PropertyValue >(); @@ -2834,7 +2656,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( sal_Int32 nMaxRenderer = 0; if (!bIsSwSrcView && m_pRenderData) { - DBG_ASSERT( m_pRenderData, "m_pRenderData missing!!" ); + OSL_ENSURE( m_pRenderData, "m_pRenderData missing!!" ); nMaxRenderer = bPrintProspect? m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 : m_pRenderData->GetPagesToPrint().size() - 1; @@ -2855,8 +2677,8 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( ? nRenderer + 1 : m_pRenderData->GetPagesToPrint()[ nRenderer ]; // <-- - - // get paper tray to use ... + + // get paper tray to use ... sal_Int32 nPrinterPaperTray = -1; if (! bPrintPaperFromSetup) { @@ -2873,7 +2695,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( if (bIsSwSrcView || bPrintProspect) { // for printing of HTML source code and prospect printing we should use - // the printers paper size since + // the printers paper size since // a) HTML source view has no page size // b) prospect printing has a different page size from the documents page // since two document pages will get rendered on one printer page @@ -2945,16 +2767,14 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( aRenderer.realloc( nLen ); aRenderer[ nLen - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PrinterPaperTray" ) ); aRenderer[ nLen - 1 ].Value <<= nPrinterPaperTray; - } + } } m_pPrintUIOptions->appendPrintUIOptions( aRenderer ); - + return aRenderer; } -/* -----------------------------28.10.02 16:00-------------------------------- - ---------------------------------------------------------------------------*/ SfxViewShell * SwXTextDocument::GuessViewShell( /* out */ bool &rbIsSwSrcView, const uno::Reference< css::frame::XController > xController ) @@ -2988,23 +2808,19 @@ SfxViewShell * SwXTextDocument::GuessViewShell( pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell, sal_False ); } - DBG_ASSERT( pSwView || pSwPagePreView || pSwSrcView, "failed to get view shell" ); + OSL_ENSURE( pSwView || pSwPagePreView || pSwSrcView, "failed to get view shell" ); if (pView) rbIsSwSrcView = pSwSrcView != 0; return pView; -// return pSwView ? dynamic_cast< SfxViewShell * >(pSwView) : -// (pSwSrcView ? dynamic_cast< SfxViewShell * >(pSwSrcView) : -// dynamic_cast< SfxViewShell * >(pSwPagePreView) ); } - void SAL_CALL SwXTextDocument::render( sal_Int32 nRenderer, const uno::Any& rSelection, const uno::Sequence< beans::PropertyValue >& rxOptions ) throw (IllegalArgumentException, RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); @@ -3017,9 +2833,9 @@ void SAL_CALL SwXTextDocument::render( const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ); bool bIsSwSrcView = false; SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport ); - - DBG_ASSERT( m_pRenderData, "data should have been created already in getRendererCount..." ); - DBG_ASSERT( m_pPrintUIOptions, "data should have been created already in getRendererCount..." ); + + OSL_ENSURE( m_pRenderData, "data should have been created already in getRendererCount..." ); + OSL_ENSURE( m_pPrintUIOptions, "data should have been created already in getRendererCount..." ); if (!bIsSwSrcView && !m_pRenderData) m_pRenderData = new SwRenderData; if (!m_pPrintUIOptions) @@ -3029,13 +2845,13 @@ void SAL_CALL SwXTextDocument::render( const bool bLastPage = m_pPrintUIOptions->getBoolValue( "IsLastPage", sal_False ); SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport ); - DBG_ASSERT( pDoc && pView, "doc or view shell missing!" ); + OSL_ENSURE( pDoc && pView, "doc or view shell missing!" ); if (pDoc && pView) { sal_Int32 nMaxRenderer = 0; if (!bIsSwSrcView) { - DBG_ASSERT( m_pRenderData, "m_pRenderData missing!!" ); + OSL_ENSURE( m_pRenderData, "m_pRenderData missing!!" ); nMaxRenderer = bPrintProspect? m_pRenderData->GetPagePairsForProspectPrinting().size() - 1 : m_pRenderData->GetPagesToPrint().size() - 1; @@ -3055,7 +2871,7 @@ void SAL_CALL SwXTextDocument::render( // the view shell should be SwView for documents PDF export // or SwPagePreView for PDF export of the page preview //!! (check for SwView first as in GuessViewShell) !! - DBG_ASSERT( pView, "!! view missing !!" ); + OSL_ENSURE( pView, "!! view missing !!" ); const TypeId aSwViewTypeId = TYPE(SwView); ViewShell* pVwSh = 0; if (pView) @@ -3064,24 +2880,24 @@ void SAL_CALL SwXTextDocument::render( ((SwView*)pView)->GetWrtShellPtr() : ((SwPagePreView*)pView)->GetViewShell(); } - + // get output device to use OutputDevice * pOut = lcl_GetOutputDevice( *m_pPrintUIOptions ); - + if(pVwSh && pOut && m_pRenderData->HasSwPrtOptions()) { const rtl::OUString aPageRange = m_pPrintUIOptions->getStringValue( "PageRange", OUString() ); const bool bFirstPage = m_pPrintUIOptions->getBoolValue( "IsFirstPage", sal_False ); bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport ); - - DBG_ASSERT(( pView->IsA(aSwViewTypeId) && m_pRenderData->IsViewOptionAdjust()) - || (!pView->IsA(aSwViewTypeId) && !m_pRenderData->IsViewOptionAdjust()), + + OSL_ENSURE(( pView->IsA(aSwViewTypeId) && m_pRenderData->IsViewOptionAdjust()) + || (!pView->IsA(aSwViewTypeId) && !m_pRenderData->IsViewOptionAdjust()), "SwView / SwViewOptionAdjust_Impl availability mismatch" ); - + // since printing now also use the API for PDF export this option // should be set for printing as well ... pVwSh->SetPDFExportOption( sal_True ); - + // --> FME 2004-06-08 #i12836# enhanced pdf export // // First, we have to export hyperlinks, notes, and outline to pdf. @@ -3116,18 +2932,18 @@ void SAL_CALL SwXTextDocument::render( SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPageRange, bIsSkipEmptyPages, sal_True ); } // <-- - + pVwSh->SetPDFExportOption( sal_False ); - + // last page to be rendered? (not necessarily the last page of the document) // -> do clean-up of data - if (bLastPage) + if (bLastPage) { // #i96167# haggai: delete ViewOptionsAdjust here because it makes use // of the shell, which might get destroyed in lcl_DisposeView! if (m_pRenderData && m_pRenderData->IsViewOptionAdjust()) m_pRenderData->ViewOptionAdjustStop(); - + if (m_pRenderData && m_pRenderData->HasPostItData()) m_pRenderData->DeletePostItData(); if (m_pHiddenViewFrame) @@ -3152,10 +2968,8 @@ void SAL_CALL SwXTextDocument::render( delete m_pPrintUIOptions; m_pPrintUIOptions = NULL; } } -/* -----------------------------03.10.04 ------------------------------------- - ---------------------------------------------------------------------------*/ - // xforms::XFormsSupplier +// xforms::XFormsSupplier Reference<XNameContainer> SAL_CALL SwXTextDocument::getXForms() throw( RuntimeException ) { @@ -3165,20 +2979,15 @@ Reference<XNameContainer> SAL_CALL SwXTextDocument::getXForms() return pDoc->getXForms(); } -/* -----------------------------25.09.07 ------------------------------------- - - ---------------------------------------------------------------------------*/ uno::Reference< text::XFlatParagraphIterator > SAL_CALL SwXTextDocument::getFlatParagraphIterator(::sal_Int32 nTextMarkupType, sal_Bool bAutomatic) throw ( uno::RuntimeException ) { return new SwXFlatParagraphIterator( *pDocShell->GetDoc(), nTextMarkupType, bAutomatic ); } -/*-- 07.05.2009 09:21:12--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< util::XCloneable > SwXTextDocument::createClone( ) throw (uno::RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!IsValid()) throw RuntimeException(); @@ -3195,22 +3004,17 @@ uno::Reference< util::XCloneable > SwXTextDocument::createClone( ) throw (uno:: xStorageDoc->loadFromStorage( xNewStorage, aTempMediaDescriptor ); return uno::Reference< util::XCloneable >( xNewModel, UNO_QUERY ); } -/* -----------------------------20.06.00 09:54-------------------------------- - ---------------------------------------------------------------------------*/ void * SAL_CALL SwXTextDocument::operator new( size_t t) throw() { return SwXTextDocumentBaseClass::operator new(t); } -/* -----------------------------20.06.00 09:54-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextDocument::operator delete( void * p) throw() { SwXTextDocumentBaseClass::operator delete(p); } - /*--------------------------------------------------- retrieve languages already used in current document -----------------------------------------------------*/ @@ -3219,7 +3023,8 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages( ::sal_Int16 nMaxCount ) throw (lang::IllegalArgumentException, uno::RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; + // possible canonical values for nScriptTypes // any bit wise combination is allowed @@ -3233,7 +3038,7 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages( const bool bComplex = 0 != (nScriptTypes & nComplex); if (nScriptTypes < nLatin || nScriptTypes > (nLatin | nAsian | nComplex)) - throw IllegalArgumentException(::rtl::OUString::createFromAscii("nScriptTypes ranges from 1 to 7!"), Reference< XInterface >(), 1); + throw IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nScriptTypes ranges from 1 to 7!")), Reference< XInterface >(), 1); if (!pDocShell) throw DisposedException(); SwDoc* pDoc = pDocShell->GetDoc(); @@ -3385,11 +3190,11 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages( nMaxCount = static_cast< sal_Int16 >( aAllLangs.size() ); // build return value - sal_Int32 nCount = 0; uno::Sequence< lang::Locale > aLanguages( nMaxCount ); lang::Locale* pLanguage = aLanguages.getArray(); if (nMaxCount > 0) { + sal_Int32 nCount = 0; const SvtLanguageTable aLangTab; for (std::set< LanguageType >::const_iterator it = aAllLangs.begin(); it != aAllLangs.end(); ++it) { @@ -3407,9 +3212,6 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages( return aLanguages; } -/* -----------------25.10.99 11:06------------------- - - --------------------------------------------------*/ SwXLinkTargetSupplier::SwXLinkTargetSupplier(SwXTextDocument& rxDoc) : pxDoc(&rxDoc) { @@ -3421,16 +3223,11 @@ SwXLinkTargetSupplier::SwXLinkTargetSupplier(SwXTextDocument& rxDoc) : sOutlines = String(SW_RES(STR_CONTENT_TYPE_OUTLINE)); sBookmarks = String(SW_RES(STR_CONTENT_TYPE_BOOKMARK)); } -/* -----------------25.10.99 11:11------------------- - --------------------------------------------------*/ SwXLinkTargetSupplier::~SwXLinkTargetSupplier() { } -/*-- 25.10.99 11:12:45--------------------------------------------------- - - -----------------------------------------------------------------------*/ Any SwXLinkTargetSupplier::getByName(const OUString& rName) throw( NoSuchElementException, WrappedTargetException, RuntimeException ) { @@ -3464,14 +3261,6 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName) Reference< XPropertySet > xRet(xTbls, UNO_QUERY); aRet.setValue(&xRet, ::getCppuType((Reference< XPropertySet>*)0)); } -/* else if(sToCompare == ) - { - sSuffix += UniString::CreateFromAscii(pMarkToText); - Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper( - pxDoc->, sSuffix ); - Reference< XPropertySet > xRet(xTbls, UNO_QUERY); - aRet.setValue(&xRet, ::getCppuType((const XPropertySet*)0)); - }*/ else if(sToCompare == sGraphics) { sSuffix += UniString::CreateFromAscii(pMarkToGraphic); @@ -3508,9 +3297,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName) throw NoSuchElementException(); return aRet; } -/*-- 25.10.99 11:12:46--------------------------------------------------- - -----------------------------------------------------------------------*/ Sequence< OUString > SwXLinkTargetSupplier::getElementNames(void) throw( RuntimeException ) { @@ -3525,9 +3312,7 @@ Sequence< OUString > SwXLinkTargetSupplier::getElementNames(void) pNames[6] = sBookmarks; return aRet; } -/*-- 25.10.99 11:12:46--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXLinkTargetSupplier::hasByName(const OUString& rName) throw( RuntimeException ) { @@ -3542,40 +3327,30 @@ sal_Bool SwXLinkTargetSupplier::hasByName(const OUString& rName) return sal_True; return sal_False; } -/*-- 25.10.99 11:12:47--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SwXLinkTargetSupplier::getElementType(void) throw( RuntimeException ) { return ::getCppuType((Reference< XPropertySet>*)0); } -/*-- 25.10.99 11:12:47--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXLinkTargetSupplier::hasElements(void) throw( RuntimeException ) { return 0 != pxDoc; } -/*-- 25.10.99 11:12:47--------------------------------------------------- - -----------------------------------------------------------------------*/ OUString SwXLinkTargetSupplier::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXLinkTargetSupplier"); } -/*-- 25.10.99 11:12:48--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXLinkTargetSupplier::supportsService(const OUString& rServiceName) throw( RuntimeException ) { return (rServiceName == C2U("com.sun.star.document.LinkTargets")); } -/*-- 25.10.99 11:12:48--------------------------------------------------- - -----------------------------------------------------------------------*/ Sequence< OUString > SwXLinkTargetSupplier::getSupportedServiceNames(void) throw( RuntimeException ) { @@ -3585,9 +3360,6 @@ Sequence< OUString > SwXLinkTargetSupplier::getSupportedServiceNames(void) return aRet; } -/*-- 26.10.99 09:16:23--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXLinkNameAccessWrapper::SwXLinkNameAccessWrapper( Reference< XNameAccess > xAccess, const String& rLinkDisplayName, String sSuffix ) : xRealAccess(xAccess), @@ -3597,9 +3369,7 @@ SwXLinkNameAccessWrapper::SwXLinkNameAccessWrapper( pxDoc(0) { } -/* -----------------26.10.99 14:17------------------- - --------------------------------------------------*/ SwXLinkNameAccessWrapper::SwXLinkNameAccessWrapper(SwXTextDocument& rxDoc, const String& rLinkDisplayName, String sSuffix) : pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_LINK_TARGET)), @@ -3609,15 +3379,11 @@ SwXLinkNameAccessWrapper::SwXLinkNameAccessWrapper(SwXTextDocument& rxDoc, pxDoc(&rxDoc) { } -/*-- 26.10.99 09:16:23--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXLinkNameAccessWrapper::~SwXLinkNameAccessWrapper() { } -/*-- 26.10.99 09:16:24--------------------------------------------------- - -----------------------------------------------------------------------*/ Any SwXLinkNameAccessWrapper::getByName(const OUString& rName) throw( NoSuchElementException, WrappedTargetException, RuntimeException ) { @@ -3669,9 +3435,7 @@ Any SwXLinkNameAccessWrapper::getByName(const OUString& rName) throw NoSuchElementException(); return aRet; } -/*-- 26.10.99 09:16:24--------------------------------------------------- - -----------------------------------------------------------------------*/ Sequence< OUString > SwXLinkNameAccessWrapper::getElementNames(void) throw( RuntimeException ) { @@ -3709,9 +3473,7 @@ Sequence< OUString > SwXLinkNameAccessWrapper::getElementNames(void) } return aRet; } -/*-- 26.10.99 09:16:25--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXLinkNameAccessWrapper::hasByName(const OUString& rName) throw( RuntimeException ) { @@ -3750,23 +3512,19 @@ sal_Bool SwXLinkNameAccessWrapper::hasByName(const OUString& rName) } return bRet; } -/*-- 26.10.99 09:16:25--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Type SwXLinkNameAccessWrapper::getElementType(void) throw( RuntimeException ) { return ::getCppuType((Reference<XPropertySet>*)0); } -/*-- 26.10.99 09:16:25--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXLinkNameAccessWrapper::hasElements(void) throw( RuntimeException ) { sal_Bool bRet = sal_False; if(pxDoc) { - DBG_ERROR("not implemented"); + OSL_ENSURE(false, "not implemented"); } else { @@ -3774,18 +3532,14 @@ sal_Bool SwXLinkNameAccessWrapper::hasElements(void) throw( RuntimeException ) } return bRet; } -/*-- 26.10.99 09:16:26--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XPropertySetInfo > SwXLinkNameAccessWrapper::getPropertySetInfo(void) throw( RuntimeException ) { static Reference< XPropertySetInfo > xRet = pPropSet->getPropertySetInfo(); return xRet; } -/*-- 26.10.99 09:16:26--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXLinkNameAccessWrapper::setPropertyValue( const OUString& , const Any& ) throw( UnknownPropertyException, @@ -3796,9 +3550,7 @@ void SwXLinkNameAccessWrapper::setPropertyValue( { throw UnknownPropertyException(); } -/* -----------------------------08.12.99 11:10-------------------------------- - ---------------------------------------------------------------------------*/ Any lcl_GetDisplayBitmap(String sLinkSuffix) { Any aRet; @@ -3814,8 +3566,6 @@ Any lcl_GetDisplayBitmap(String sLinkSuffix) nImgId = CONTENT_TYPE_FRAME; else if(COMPARE_EQUAL == sLinkSuffix.CompareToAscii(pMarkToGraphic)) nImgId = CONTENT_TYPE_GRAPHIC; -// else if(== sLinkSuffix) -// nImgId = CONTENT_TYPE_BOOKMARK; else if(COMPARE_EQUAL == sLinkSuffix.CompareToAscii(pMarkToRegion)) nImgId = CONTENT_TYPE_REGION; else if(COMPARE_EQUAL == sLinkSuffix.CompareToAscii(pMarkToOLE)) @@ -3825,8 +3575,7 @@ Any lcl_GetDisplayBitmap(String sLinkSuffix) if(USHRT_MAX != nImgId) { nImgId += 20000; - sal_Bool bHighContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); - ImageList aEntryImages( SW_RES(bHighContrast ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP) ); + ImageList aEntryImages( SW_RES(IMG_NAVI_ENTRYBMP) ); const Image& rImage = aEntryImages.GetImage( nImgId ); Bitmap aBitmap( rImage.GetBitmapEx().GetBitmap() ); Reference<awt::XBitmap> xBmp = VCLUnoHelper::CreateBitmap( aBitmap ); @@ -3834,9 +3583,7 @@ Any lcl_GetDisplayBitmap(String sLinkSuffix) } return aRet; } -/*-- 26.10.99 09:16:27--------------------------------------------------- - -----------------------------------------------------------------------*/ Any SwXLinkNameAccessWrapper::getPropertyValue(const OUString& rPropertyName) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { @@ -3853,62 +3600,44 @@ Any SwXLinkNameAccessWrapper::getPropertyValue(const OUString& rPropertyName) throw UnknownPropertyException(); return aRet; } -/*-- 26.10.99 09:16:27--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXLinkNameAccessWrapper::addPropertyChangeListener( const OUString& /*PropertyName*/, const Reference< XPropertyChangeListener > & /*aListener*/) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) {} -/*-- 26.10.99 09:16:28--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXLinkNameAccessWrapper::removePropertyChangeListener( const OUString& /*PropertyName*/, const Reference< XPropertyChangeListener > & /*aListener*/) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) {} -/*-- 26.10.99 09:16:28--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXLinkNameAccessWrapper::addVetoableChangeListener( const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener > & /*aListener*/) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) {} -/*-- 26.10.99 09:16:29--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXLinkNameAccessWrapper::removeVetoableChangeListener( const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener > & /*aListener*/) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) {} -/*-- 26.10.99 09:16:32--------------------------------------------------- - - -----------------------------------------------------------------------*/ Reference< XNameAccess > SwXLinkNameAccessWrapper::getLinks(void) throw( RuntimeException ) { return (SwXLinkNameAccessWrapper*)this; } -/*-- 26.10.99 09:21:48--------------------------------------------------- - - -----------------------------------------------------------------------*/ OUString SwXLinkNameAccessWrapper::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXLinkNameAccessWrapper"); } -/*-- 26.10.99 09:21:48--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXLinkNameAccessWrapper::supportsService(const OUString& rServiceName) throw( RuntimeException ) { return (rServiceName == C2U("com.sun.star.document.LinkTargets")); } -/*-- 26.10.99 09:21:48--------------------------------------------------- - -----------------------------------------------------------------------*/ Sequence< OUString > SwXLinkNameAccessWrapper::getSupportedServiceNames(void) throw( RuntimeException ) { @@ -3917,31 +3646,23 @@ Sequence< OUString > SwXLinkNameAccessWrapper::getSupportedServiceNames(void) pNames[0] = C2U("com.sun.star.document.LinkTargets"); return aRet; } -/* -----------------26.10.99 15:50------------------- - --------------------------------------------------*/ SwXOutlineTarget::SwXOutlineTarget(const String& rOutlineText) : pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_LINK_TARGET)), sOutlineText(rOutlineText) { } -/*-- 26.10.99 15:51:45--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXOutlineTarget::~SwXOutlineTarget() { } -/*-- 26.10.99 15:51:46--------------------------------------------------- - -----------------------------------------------------------------------*/ Reference< XPropertySetInfo > SwXOutlineTarget::getPropertySetInfo(void) throw( RuntimeException ) { static Reference< XPropertySetInfo > xRet = pPropSet->getPropertySetInfo(); return xRet; } -/*-- 26.10.99 15:51:46--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXOutlineTarget::setPropertyValue( const OUString& /*PropertyName*/, const Any& /*aValue*/) throw( UnknownPropertyException, PropertyVetoException, @@ -3949,9 +3670,7 @@ void SwXOutlineTarget::setPropertyValue( { throw UnknownPropertyException(); } -/*-- 26.10.99 15:51:46--------------------------------------------------- - -----------------------------------------------------------------------*/ Any SwXOutlineTarget::getPropertyValue(const OUString& rPropertyName) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { @@ -3962,55 +3681,41 @@ Any SwXOutlineTarget::getPropertyValue(const OUString& rPropertyName) throw UnknownPropertyException(); return aRet; } -/*-- 26.10.99 15:51:46--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXOutlineTarget::addPropertyChangeListener( const OUString& /*PropertyName*/, const Reference< XPropertyChangeListener > & /*aListener*/) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { } -/*-- 26.10.99 15:51:47--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXOutlineTarget::removePropertyChangeListener( const OUString& /*PropertyName*/, const Reference< XPropertyChangeListener > & /*aListener*/) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { } -/*-- 26.10.99 15:51:47--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXOutlineTarget::addVetoableChangeListener( const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener > & /*aListener*/) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { } -/*-- 26.10.99 15:51:47--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXOutlineTarget::removeVetoableChangeListener( const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener > & /*aListener*/) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { } -/* -----------------03.05.99 12:28------------------- - * - * --------------------------------------------------*/ + OUString SwXOutlineTarget::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXOutlineTarget"); } -/* -----------------03.05.99 12:28------------------- - * - * --------------------------------------------------*/ + sal_Bool SwXOutlineTarget::supportsService(const OUString& ServiceName) throw( RuntimeException ) { return C2U("com.sun.star.document.LinkTarget") == ServiceName; } -/* -----------------03.05.99 12:28------------------- - * - * --------------------------------------------------*/ + Sequence< OUString > SwXOutlineTarget::getSupportedServiceNames(void) throw( RuntimeException ) { Sequence < OUString > aRet(1); @@ -4019,23 +3724,17 @@ Sequence< OUString > SwXOutlineTarget::getSupportedServiceNames(void) throw( Run return aRet; } -/* -----------------------------17.01.01 16:06-------------------------------- - ---------------------------------------------------------------------------*/ SwXDocumentPropertyHelper::SwXDocumentPropertyHelper(SwDoc& rDoc) : SvxUnoForbiddenCharsTable ( rDoc.getForbiddenCharacterTable() ) ,m_pDoc(&rDoc) { } -/* -----------------------------17.01.01 16:06-------------------------------- - ---------------------------------------------------------------------------*/ SwXDocumentPropertyHelper::~SwXDocumentPropertyHelper() { } -/* -----------------------------17.01.01 16:06-------------------------------- - ---------------------------------------------------------------------------*/ Reference<XInterface> SwXDocumentPropertyHelper::GetDrawTable(short nWhich) { Reference<XInterface> xRet; @@ -4081,8 +3780,8 @@ Reference<XInterface> SwXDocumentPropertyHelper::GetDrawTable(short nWhich) xDrawDefaults = (cppu::OWeakObject*)new SwSvxUnoDrawPool(m_pDoc); xRet = xDrawDefaults; break; -#ifdef DBG_UTIL - default: DBG_ERROR("which table?"); +#if OSL_DEBUG_LEVEL > 1 + default: OSL_ENSURE(false, "which table?"); #endif } } @@ -4099,33 +3798,26 @@ void SwXDocumentPropertyHelper::Invalidate() xMarkerTable = 0; xDrawDefaults = 0; m_pDoc = 0; - SvxUnoForbiddenCharsTable::mxForbiddenChars.unbind(); + SvxUnoForbiddenCharsTable::mxForbiddenChars.clear(); } -/* -----------------13.08.2003 12:43----------------- - --------------------------------------------------*/ void SwXDocumentPropertyHelper::onChange() { if(m_pDoc) m_pDoc->SetModified(); } - -/*****************************************************************************/ - SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions ) : m_rShell( rSh ), m_aOldViewOptions( rViewOptions ) { } - SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl() { m_rShell.ApplyViewOptions( m_aOldViewOptions ); } - void SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions) { @@ -4143,7 +3835,7 @@ SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions) SwViewOption aRenderViewOptions( m_aOldViewOptions ); // disable anything in the view that should not be printed (or exported to PDF) by default - // (see also dialog "Tools/Options - StarOffice Writer - Formatting Aids" + // (see also dialog "Tools/Options - StarOffice Writer - Formatting Aids" // in section "Display of ...") aRenderViewOptions.SetParagraph( sal_False ); // paragraph end aRenderViewOptions.SetSoftHyph( sal_False ); // aka custom hyphens @@ -4160,17 +3852,17 @@ SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions) aRenderViewOptions.SetShowHiddenField( bVal ); if (bContainsHiddenParagraphs) aRenderViewOptions.SetShowHiddenPara( bVal ); - + if (bContainsPlaceHolders) { // should always be printed in PDF export! bVal = pPrtOptions ? pPrtOptions->bPrintTextPlaceholder : sal_True; aRenderViewOptions.SetShowPlaceHolderFields( bVal ); } - + if (bContainsFields) aRenderViewOptions.SetFldName( sal_False ); - + // we need to set this flag in order to get to see the visible effect of // some of the above settings (needed for correct rendering) aRenderViewOptions.SetViewMetaChars( sal_True ); @@ -4182,7 +3874,4 @@ SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions) } } - -/*****************************************************************************/ - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 84854a0f29..c10ba278f5 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -60,7 +61,7 @@ #include <sfx2/bindings.hxx> #include <sfx2/request.hxx> #include <frmatr.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <IMark.hxx> #include <unotxdoc.hxx> #include <unodraw.hxx> @@ -85,7 +86,6 @@ #include "swdtflvr.hxx" #include <vcl/svapp.hxx> - using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; @@ -93,28 +93,24 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::text; using namespace ::com::sun::star::view; using namespace ::com::sun::star::frame; -using namespace rtl; using ::com::sun::star::util::URL; using comphelper::HelperBaseNoState; +using ::rtl::OUString; + SV_IMPL_PTRARR( SelectionChangeListenerArr, XSelectionChangeListenerPtr ); -/* -----------------22.05.98 12:20------------------- - * - * --------------------------------------------------*/ SwPaM* lcl_createPamCopy(const SwPaM& rPam) { SwPaM *const pRet = new SwPaM(*rPam.GetPoint()); ::sw::DeepCopyPaM(rPam, *pRet); return pRet; } + /****************************************************************** * SwXTextView ******************************************************************/ -/*-- 17.12.98 09:34:25--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXTextView::SwXTextView(SwView* pSwView) : SfxBaseController(pSwView), m_pView(pSwView), @@ -124,16 +120,12 @@ SwXTextView::SwXTextView(SwView* pSwView) : { } -/*-- 17.12.98 09:34:25--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextView::~SwXTextView() { Invalidate(); } -/* -----------------------------09.03.01 15:47-------------------------------- - ---------------------------------------------------------------------------*/ void SwXTextView::Invalidate() { if(pxViewSettings) @@ -174,12 +166,8 @@ void SwXTextView::Invalidate() m_pView = 0; } -/* -----------------------------18.05.00 10:18-------------------------------- - - ---------------------------------------------------------------------------*/ Sequence< uno::Type > SAL_CALL SwXTextView::getTypes( ) throw(uno::RuntimeException) { -// uno::Sequence< uno::Type > aViewTypes = SwXTextViewBaseClass::getTypes(); uno::Sequence< uno::Type > aBaseTypes = SfxBaseController::getTypes(); long nIndex = aBaseTypes.getLength(); @@ -197,12 +185,10 @@ Sequence< uno::Type > SAL_CALL SwXTextView::getTypes( ) throw(uno::RuntimeExcep pBaseTypes[nIndex++] = ::getCppuType((uno::Reference<datatransfer::XTransferableSupplier >*)0); return aBaseTypes; } -/* -----------------------------18.05.00 10:18-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< sal_Int8 > SAL_CALL SwXTextView::getImplementationId( ) throw(uno::RuntimeException) { - vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; static Sequence< sal_Int8 > aId( 16 ); static sal_Bool bInit = sal_False; if(!bInit) @@ -212,23 +198,17 @@ Sequence< sal_Int8 > SAL_CALL SwXTextView::getImplementationId( ) throw(uno::Ru } return aId; } -/* -----------------------------18.05.00 10:18-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextView::acquire( )throw() { SfxBaseController::acquire(); } -/* -----------------------------18.05.00 10:18-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextView::release( )throw() { SfxBaseController::release(); } -/* -----------------------------18.05.00 10:23-------------------------------- - ---------------------------------------------------------------------------*/ uno::Any SAL_CALL SwXTextView::queryInterface( const uno::Type& aType ) throw (RuntimeException) { @@ -282,12 +262,10 @@ uno::Any SAL_CALL SwXTextView::queryInterface( const uno::Type& aType ) aRet = SfxBaseController::queryInterface(aType); return aRet; } -/*-- 17.12.98 09:34:26--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArgumentException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; uno::Reference< uno::XInterface > xInterface; if(GetView() && (aInterface >>= xInterface)) { @@ -476,7 +454,6 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg SdrObject *pObj = pSvxShape->GetSdrObject(); if (pObj) { -// lcl_ShowObject( *m_pViewSh, *pDrawView, pObj ); SdrPageView* pPV = pDrawView->GetSdrPageView(); if ( pPV && pObj->GetPage() == pPV->GetPage() ) { @@ -509,7 +486,6 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg { if (!pPV) // erstes Objekt { -// lcl_ShowObject( *m_pViewSh, *pDrawView, pObj ); pPV = pDrawView->GetSdrPageView(); } if ( pPV && pObj->GetPage() == pPV->GetPage() ) @@ -529,12 +505,10 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg return sal_False; } -/*-- 17.12.98 09:34:26--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; uno::Reference< uno::XInterface > aRef; if(GetView()) { @@ -549,7 +523,7 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException ) { if(rSh.GetTableCrsr()) { - DBG_ASSERT(rSh.GetTableFmt(), "kein Tabellenformat?"); + OSL_ENSURE(rSh.GetTableFmt(), "kein Tabellenformat?"); uno::Reference< text::XTextTableCursor > xCrsr = new SwXTextTableCursor(*rSh.GetTableFmt(), rSh.GetTableCrsr()); aRef = uno::Reference< uno::XInterface > (xCrsr, uno::UNO_QUERY);; @@ -635,26 +609,22 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException ) uno::Any aRet(&aRef, ::getCppuType((uno::Reference<uno::XInterface>*)0)); return aRet; } -/*-- 17.12.98 09:34:27--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextView::addSelectionChangeListener( const uno::Reference< view::XSelectionChangeListener > & rxListener) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; uno::Reference< view::XSelectionChangeListener > * pInsert = new uno::Reference< view::XSelectionChangeListener > ; *pInsert = rxListener; aSelChangedListeners.Insert(pInsert, aSelChangedListeners.Count()); } -/*-- 17.12.98 09:34:27--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextView::removeSelectionChangeListener( const uno::Reference< view::XSelectionChangeListener > & rxListener) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; view::XSelectionChangeListener* pLeft = rxListener.get(); for(sal_uInt16 i = 0; i < aSelChangedListeners.Count(); i++) { @@ -668,9 +638,7 @@ void SwXTextView::removeSelectionChangeListener( } } } -/* -----------------------------01.06.01 14:41-------------------------------- - ---------------------------------------------------------------------------*/ SdrObject* SwXTextView::GetControl( const uno::Reference< awt::XControlModel > & xModel, uno::Reference< awt::XControl >& xToFill ) @@ -680,37 +648,32 @@ SdrObject* SwXTextView::GetControl( SdrView* pDrawView = pView2 ? pView2->GetDrawView() : NULL; Window* pWindow = pView2 ? pView2->GetWrtShell().GetWin() : NULL; - DBG_ASSERT( pFormShell && pDrawView && pWindow, "SwXTextView::GetControl: how could I?" ); + OSL_ENSURE( pFormShell && pDrawView && pWindow, "SwXTextView::GetControl: how could I?" ); SdrObject* pControl = NULL; if ( pFormShell && pDrawView && pWindow ) pControl = pFormShell->GetFormControl( xModel, *pDrawView, *pWindow, xToFill ); return pControl; } -/*-- 17.12.98 09:34:27--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< awt::XControl > SwXTextView::getControl(const uno::Reference< awt::XControlModel > & xModel) throw( container::NoSuchElementException, uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; uno::Reference< awt::XControl > xRet; GetControl(xModel, xRet); return xRet; } -/*-- 08.03.07 13:55------------------------------------------------------ - - -----------------------------------------------------------------------*/ uno::Reference< form::runtime::XFormController > SAL_CALL SwXTextView::getFormController( const uno::Reference< form::XForm >& _Form ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SwView* pView2 = GetView(); FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : NULL; SdrView* pDrawView = pView2 ? pView2->GetDrawView() : NULL; Window* pWindow = pView2 ? pView2->GetWrtShell().GetWin() : NULL; - DBG_ASSERT( pFormShell && pDrawView && pWindow, "SwXTextView::getFormController: how could I?" ); + OSL_ENSURE( pFormShell && pDrawView && pWindow, "SwXTextView::getFormController: how could I?" ); uno::Reference< form::runtime::XFormController > xController; if ( pFormShell && pDrawView && pWindow ) @@ -718,35 +681,26 @@ uno::Reference< form::runtime::XFormController > SAL_CALL SwXTextView::getFormCo return xController; } -/*-- 08.03.07 13:55------------------------------------------------------ - - -----------------------------------------------------------------------*/ ::sal_Bool SAL_CALL SwXTextView::isFormDesignMode( ) throw (uno::RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SwView* pView2 = GetView(); FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : NULL; return pFormShell ? pFormShell->IsDesignMode() : sal_True; } -/*-- 08.03.07 13:55------------------------------------------------------ - - -----------------------------------------------------------------------*/ void SAL_CALL SwXTextView::setFormDesignMode( ::sal_Bool _DesignMode ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; SwView* pView2 = GetView(); FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : NULL; if ( pFormShell ) pFormShell->SetDesignMode( _DesignMode ); } -/*-- 17.12.98 09:34:28--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Reference< text::XTextViewCursor > SwXTextView::getViewCursor(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(GetView()) { if(!pxTextViewCursor) @@ -759,12 +713,10 @@ uno::Reference< text::XTextViewCursor > SwXTextView::getViewCursor(void) throw( else throw uno::RuntimeException(); } -/*-- 17.12.98 09:34:28--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< beans::XPropertySet > SwXTextView::getViewSettings(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(m_pView) { if(!pxViewSettings) @@ -777,12 +729,10 @@ uno::Reference< beans::XPropertySet > SwXTextView::getViewSettings(void) throw( throw uno::RuntimeException(); return *pxViewSettings; } -/* -----------------------------30.01.01 15:01-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAutomatic*/ ) throw(RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!GetView()) throw RuntimeException(); @@ -810,29 +760,27 @@ Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAuto pRet[n].realloc(5); PropertyValue* pValues = pRet[n].getArray(); - pValues[0].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_RUBY_BASE_TEXT)); + pValues[0].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_BASE_TEXT)); pValues[0].Value <<= OUString(rEntryText); - pValues[1].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_RUBY_TEXT)); + pValues[1].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_TEXT)); pValues[1].Value <<= OUString(rAttr.GetText()); - pValues[2].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_RUBY_CHAR_STYLE_NAME)); + pValues[2].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_CHAR_STYLE_NAME)); SwStyleNameMapper::FillProgName(rAttr.GetCharFmtName(), aString, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True ); pValues[2].Value <<= OUString( aString ); - pValues[3].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_RUBY_ADJUST)); + pValues[3].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_ADJUST)); pValues[3].Value <<= (sal_Int16)rAttr.GetAdjustment(); - pValues[4].Name = C2U(SW_PROP_NAME_STR(UNO_NAME_RUBY_IS_ABOVE)); + pValues[4].Name = rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RUBY_IS_ABOVE)); sal_Bool bVal = !rAttr.GetPosition(); pValues[4].Value.setValue(&bVal, ::getBooleanCppuType()); } return aRet; } -/* -----------------------------30.01.01 15:02-------------------------------- - ---------------------------------------------------------------------------*/ void SAL_CALL SwXTextView::setRubyList( const Sequence< Sequence< PropertyValue > >& rRubyList, sal_Bool /*bAutomatic*/ ) throw(RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(!GetView() || !rRubyList.getLength()) throw RuntimeException(); @@ -900,9 +848,7 @@ void SAL_CALL SwXTextView::setRubyList( SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); pDoc->SetRubyList( *rSh.GetCrsr(), aList, 0 ); } -/*-- 29.12.02 15:45:29--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxObjectShellLock SwXTextView::BuildTmpSelectionDoc() { SwWrtShell& rOldSh = m_pView->GetWrtShell(); @@ -938,12 +884,9 @@ SfxObjectShellLock SwXTextView::BuildTmpSelectionDoc() return xDocSh; } -/*-- 17.12.98 09:34:29--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwXTextView::NotifySelChanged() { - DBG_ASSERT( m_pView, "view is missing" ); + OSL_ENSURE( m_pView, "view is missing" ); // destroy temporary document with selected text that is used // in PDF export of (multi-)selections. @@ -964,13 +907,11 @@ void SwXTextView::NotifySelChanged() (*pObj)->selectionChanged(aEvent); } } -/* -----------------------------12.07.01 13:26-------------------------------- - ---------------------------------------------------------------------------*/ void SwXTextView::NotifyDBChanged() { URL aURL; - aURL.Complete = C2U(SwXDispatch::GetDBChangeURL()); + aURL.Complete = rtl::OUString::createFromAscii(SwXDispatch::GetDBChangeURL()); sal_uInt16 nCount = aSelChangedListeners.Count(); for ( sal_uInt16 i = nCount; i--; ) @@ -982,24 +923,19 @@ void SwXTextView::NotifyDBChanged() } } -/* -----------------------------10.12.04 11:07-------------------------------- - - ---------------------------------------------------------------------------*/ - uno::Reference< beans::XPropertySetInfo > SAL_CALL SwXTextView::getPropertySetInfo( ) throw (uno::RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; static uno::Reference< XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo(); return aRef; } - void SAL_CALL SwXTextView::setPropertyValue( const OUString& rPropertyName, const uno::Any& rValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); if (!pEntry) throw UnknownPropertyException(); @@ -1025,17 +961,16 @@ void SAL_CALL SwXTextView::setPropertyValue( } break; default : - DBG_ERROR("unknown WID"); + OSL_ENSURE(false, "unknown WID"); } } } - uno::Any SAL_CALL SwXTextView::getPropertyValue( const OUString& rPropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Any aRet; @@ -1076,67 +1011,56 @@ uno::Any SAL_CALL SwXTextView::getPropertyValue( } break; default : - DBG_ERROR("unknown WID"); + OSL_ENSURE(false, "unknown WID"); } } return aRet; } - void SAL_CALL SwXTextView::addPropertyChangeListener( const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*rxListener*/ ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, "not implemented"); } - void SAL_CALL SwXTextView::removePropertyChangeListener( const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*rxListener*/ ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, "not implemented"); } - void SAL_CALL SwXTextView::addVetoableChangeListener( const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*rxListener*/ ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, "not implemented"); } - void SAL_CALL SwXTextView::removeVetoableChangeListener( const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*rxListener*/ ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, "not implemented"); } -/* -----------------------------06.04.00 11:07-------------------------------- - - ---------------------------------------------------------------------------*/ OUString SwXTextView::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXTextView"); } -/* -----------------------------06.04.00 11:07-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwXTextView::supportsService(const OUString& rServiceName) throw( RuntimeException ) { - return rServiceName.equalsAscii("com.sun.star.text.TextDocumentView") || - rServiceName.equalsAscii("com.sun.star.view.OfficeDocumentView"); + return rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextDocumentView")) || + rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.view.OfficeDocumentView")); } -/* -----------------------------06.04.00 11:07-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< OUString > SwXTextView::getSupportedServiceNames(void) throw( RuntimeException ) { Sequence< OUString > aRet(2); @@ -1149,23 +1073,15 @@ Sequence< OUString > SwXTextView::getSupportedServiceNames(void) throw( RuntimeE /****************************************************************** * SwXTextViewCursor ******************************************************************/ -/*-- 17.12.98 09:36:23--------------------------------------------------- - - -----------------------------------------------------------------------*/ SwXTextViewCursor::SwXTextViewCursor(SwView* pVw) : m_pView(pVw), m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)) { } -/*-- 17.12.98 09:36:24--------------------------------------------------- - -----------------------------------------------------------------------*/ SwXTextViewCursor::~SwXTextViewCursor() { } -/*-- 06.10.04 09:36:25--------------------------------------------------- - - -----------------------------------------------------------------------*/ // used to determine if there is a text selction or not. // If there is no text selection the functions that need a working @@ -1175,12 +1091,11 @@ SwXTextViewCursor::~SwXTextViewCursor() // - XTextCursor // - XTextRange // - XLineCursor - sal_Bool SwXTextViewCursor::IsTextSelection( sal_Bool bAllowTables ) const { sal_Bool bRes = sal_False; - DBG_ASSERT(m_pView, "m_pView is NULL ???"); + OSL_ENSURE(m_pView, "m_pView is NULL ???"); if(m_pView) { //! m_pView->GetShellMode() will only work after the shell @@ -1193,29 +1108,22 @@ sal_Bool SwXTextViewCursor::IsTextSelection( sal_Bool bAllowTables ) const return bRes; } -/*-- 17.12.98 09:36:25--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::isVisible(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); - DBG_WARNING("not implemented"); + SolarMutexGuard aGuard; + OSL_ENSURE(false, "not implemented"); return sal_True; } -/*-- 17.12.98 09:36:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::setVisible(sal_Bool /*bVisible*/) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); - DBG_WARNING("not implemented"); + SolarMutexGuard aGuard; + OSL_ENSURE(false, "not implemented"); } -/*-- 17.12.98 09:36:26--------------------------------------------------- - -----------------------------------------------------------------------*/ awt::Point SwXTextViewCursor::getPosition(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; awt::Point aRet; if(m_pView) { @@ -1236,12 +1144,10 @@ awt::Point SwXTextViewCursor::getPosition(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return aRet; } -/*-- 17.12.98 09:36:26--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::collapseToStart(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(m_pView) { if (!IsTextSelection()) @@ -1261,12 +1167,10 @@ void SwXTextViewCursor::collapseToStart(void) throw( uno::RuntimeException ) else throw uno::RuntimeException(); } -/*-- 17.12.98 09:36:26--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::collapseToEnd(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(m_pView) { if (!IsTextSelection()) @@ -1286,12 +1190,10 @@ void SwXTextViewCursor::collapseToEnd(void) throw( uno::RuntimeException ) else throw uno::RuntimeException(); } -/*-- 17.12.98 09:36:27--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::isCollapsed(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) { @@ -1306,12 +1208,10 @@ sal_Bool SwXTextViewCursor::isCollapsed(void) throw( uno::RuntimeException ) return bRet; } -/*-- 17.12.98 09:36:27--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::goLeft(sal_Int16 nCount, sal_Bool bExpand) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) { @@ -1325,12 +1225,10 @@ sal_Bool SwXTextViewCursor::goLeft(sal_Int16 nCount, sal_Bool bExpand) throw( un throw uno::RuntimeException(); return bRet; } -/*-- 17.12.98 09:36:27--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::goRight(sal_Int16 nCount, sal_Bool bExpand) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) { @@ -1345,15 +1243,13 @@ sal_Bool SwXTextViewCursor::goRight(sal_Int16 nCount, sal_Bool bExpand) throw( u return bRet; } -/* -----------------08.03.99 11:18------------------- - * - * --------------------------------------------------*/ + void SwXTextViewCursor::gotoRange( const uno::Reference< text::XTextRange > & xRange, sal_Bool bExpand) throw(RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(m_pView && xRange.is()) { if (!IsTextSelection()) @@ -1489,12 +1385,10 @@ void SwXTextViewCursor::gotoRange( throw uno::RuntimeException(); } -/*-- 17.12.98 09:36:28--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::gotoStart(sal_Bool bExpand) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(m_pView) { if (!IsTextSelection()) @@ -1505,12 +1399,10 @@ void SwXTextViewCursor::gotoStart(sal_Bool bExpand) throw( uno::RuntimeException else throw uno::RuntimeException(); } -/*-- 17.12.98 09:36:28--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::gotoEnd(sal_Bool bExpand) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(m_pView) { if (!IsTextSelection()) @@ -1521,12 +1413,10 @@ void SwXTextViewCursor::gotoEnd(sal_Bool bExpand) throw( uno::RuntimeException ) else throw uno::RuntimeException(); } -/*-- 17.12.98 09:36:28--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::jumpToFirstPage(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) { @@ -1543,12 +1433,10 @@ sal_Bool SwXTextViewCursor::jumpToFirstPage(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return bRet; } -/*-- 17.12.98 09:36:29--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::jumpToLastPage(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) { @@ -1566,12 +1454,10 @@ sal_Bool SwXTextViewCursor::jumpToLastPage(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return bRet; } -/*-- 17.12.98 09:36:30--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::jumpToPage(sal_Int16 nPage) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) bRet = m_pView->GetWrtShell().GotoPage(nPage, sal_True); @@ -1579,12 +1465,10 @@ sal_Bool SwXTextViewCursor::jumpToPage(sal_Int16 nPage) throw( uno::RuntimeExcep throw uno::RuntimeException(); return bRet; } -/*-- 17.12.98 09:36:30--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::jumpToNextPage(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) bRet = m_pView->GetWrtShell().SttNxtPg(); @@ -1592,12 +1476,10 @@ sal_Bool SwXTextViewCursor::jumpToNextPage(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return bRet; } -/*-- 17.12.98 09:36:31--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::jumpToPreviousPage(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) bRet = m_pView->GetWrtShell().EndPrvPg(); @@ -1605,12 +1487,10 @@ sal_Bool SwXTextViewCursor::jumpToPreviousPage(void) throw( uno::RuntimeExceptio throw uno::RuntimeException(); return bRet; } -/*-- 17.12.98 09:36:32--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::jumpToEndOfPage(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) bRet = m_pView->GetWrtShell().EndPg(); @@ -1618,12 +1498,10 @@ sal_Bool SwXTextViewCursor::jumpToEndOfPage(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return bRet; } -/*-- 17.12.98 09:36:32--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::jumpToStartOfPage(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) bRet = m_pView->GetWrtShell().SttPg(); @@ -1631,12 +1509,10 @@ sal_Bool SwXTextViewCursor::jumpToStartOfPage(void) throw( uno::RuntimeException throw uno::RuntimeException(); return bRet; } -/* -----------------04.10.99 14:21------------------- - --------------------------------------------------*/ sal_Int16 SwXTextViewCursor::getPage(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; short nRet = 0; if(m_pView) { @@ -1648,12 +1524,10 @@ sal_Int16 SwXTextViewCursor::getPage(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return nRet; } -/*-- 17.12.98 09:36:33--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::screenDown(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) { @@ -1666,12 +1540,10 @@ sal_Bool SwXTextViewCursor::screenDown(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return bRet; } -/*-- 17.12.98 09:36:33--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::screenUp(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) { @@ -1684,12 +1556,10 @@ sal_Bool SwXTextViewCursor::screenUp(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return bRet; } -/*-- 17.12.98 11:59:05--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XText > SwXTextViewCursor::getText(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; uno::Reference< text::XText > xRet; if(m_pView) { @@ -1705,12 +1575,10 @@ uno::Reference< text::XText > SwXTextViewCursor::getText(void) throw( uno::Runt throw uno::RuntimeException(); return xRet; } -/*-- 17.12.98 11:59:05--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextRange > SwXTextViewCursor::getStart(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; uno::Reference< text::XTextRange > xRet; if(m_pView) { @@ -1726,12 +1594,10 @@ uno::Reference< text::XTextRange > SwXTextViewCursor::getStart(void) throw( uno throw uno::RuntimeException(); return xRet; } -/*-- 17.12.98 11:59:06--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Reference< text::XTextRange > SwXTextViewCursor::getEnd(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; uno::Reference< text::XTextRange > xRet; if(m_pView) { @@ -1747,12 +1613,10 @@ uno::Reference< text::XTextRange > SwXTextViewCursor::getEnd(void) throw( uno:: throw uno::RuntimeException(); return xRet; } -/* -----------------12.10.99 09:03------------------- - --------------------------------------------------*/ OUString SwXTextViewCursor::getString(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; OUString uRet; if(m_pView) { @@ -1780,12 +1644,10 @@ OUString SwXTextViewCursor::getString(void) throw( uno::RuntimeException ) } return uRet; } -/*-- 17.12.98 11:59:06--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::setString(const OUString& aString) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(m_pView) { if (!IsTextSelection( sal_False )) @@ -1812,22 +1674,17 @@ void SwXTextViewCursor::setString(const OUString& aString) throw( uno::RuntimeEx } } -/*-- 29.06.00 17:33:38--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Reference< XPropertySetInfo > SwXTextViewCursor::getPropertySetInfo( ) throw(RuntimeException) { static uno::Reference< XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); return xRef; } -/*-- 29.06.00 17:33:39--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::setPropertyValue( const OUString& rPropertyName, const Any& aValue ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(m_pView) { SwWrtShell& rSh = m_pView->GetWrtShell(); @@ -1844,13 +1701,11 @@ void SwXTextViewCursor::setPropertyValue( const OUString& rPropertyName, const else throw RuntimeException(); } -/*-- 29.06.00 17:33:39--------------------------------------------------- - -----------------------------------------------------------------------*/ Any SwXTextViewCursor::getPropertyValue( const OUString& rPropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; Any aRet; if(m_pView) { @@ -1863,44 +1718,34 @@ Any SwXTextViewCursor::getPropertyValue( const OUString& rPropertyName ) throw RuntimeException(); return aRet; } -/*-- 29.06.00 17:33:40--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::addPropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { } -/*-- 29.06.00 17:33:40--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::removePropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*aListener*/ ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { } -/*-- 29.06.00 17:33:41--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::addVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< XVetoableChangeListener >& /*aListener*/ ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { } -/*-- 29.06.00 17:33:41--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::removeVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< XVetoableChangeListener >& /*aListener*/ ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { } -/*-- 29.06.00 17:33:41--------------------------------------------------- - -----------------------------------------------------------------------*/ PropertyState SwXTextViewCursor::getPropertyState( const OUString& rPropertyName ) throw(UnknownPropertyException, RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; PropertyState eState; if(m_pView) { @@ -1913,13 +1758,11 @@ PropertyState SwXTextViewCursor::getPropertyState( const OUString& rPropertyNam throw RuntimeException(); return eState; } -/*-- 29.06.00 17:33:42--------------------------------------------------- - -----------------------------------------------------------------------*/ Sequence< PropertyState > SwXTextViewCursor::getPropertyStates( const Sequence< OUString >& rPropertyNames ) throw(UnknownPropertyException, RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; Sequence< PropertyState > aRet; if(m_pView) { @@ -1930,13 +1773,11 @@ Sequence< PropertyState > SwXTextViewCursor::getPropertyStates( } return aRet; } -/*-- 29.06.00 17:33:42--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::setPropertyToDefault( const OUString& rPropertyName ) throw(UnknownPropertyException, RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(m_pView) { SwWrtShell& rSh = m_pView->GetWrtShell(); @@ -1945,14 +1786,12 @@ void SwXTextViewCursor::setPropertyToDefault( const OUString& rPropertyName ) *pShellCrsr, *m_pPropSet, rPropertyName); } } -/*-- 29.06.00 17:33:43--------------------------------------------------- - -----------------------------------------------------------------------*/ Any SwXTextViewCursor::getPropertyDefault( const OUString& rPropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { Any aRet; - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(m_pView) { SwWrtShell& rSh = m_pView->GetWrtShell(); @@ -1962,12 +1801,10 @@ Any SwXTextViewCursor::getPropertyDefault( const OUString& rPropertyName ) } return aRet; } -/*-- 28.09.99 08:31:19--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::goDown(sal_Int16 nCount, sal_Bool bExpand) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) { @@ -1981,12 +1818,10 @@ sal_Bool SwXTextViewCursor::goDown(sal_Int16 nCount, sal_Bool bExpand) throw( un throw uno::RuntimeException(); return bRet; } -/*-- 28.09.99 08:31:20--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::goUp(sal_Int16 nCount, sal_Bool bExpand) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) { @@ -2000,12 +1835,10 @@ sal_Bool SwXTextViewCursor::goUp(sal_Int16 nCount, sal_Bool bExpand) throw( uno: throw uno::RuntimeException(); return bRet; } -/*-- 28.09.99 08:31:20--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::isAtStartOfLine(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) { @@ -2018,12 +1851,10 @@ sal_Bool SwXTextViewCursor::isAtStartOfLine(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return bRet; } -/*-- 28.09.99 08:31:21--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::isAtEndOfLine(void) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Bool bRet = sal_False; if(m_pView) { @@ -2036,12 +1867,10 @@ sal_Bool SwXTextViewCursor::isAtEndOfLine(void) throw( uno::RuntimeException ) throw uno::RuntimeException(); return bRet; } -/*-- 28.09.99 08:31:21--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::gotoEndOfLine(sal_Bool bExpand) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(m_pView) { if (!IsTextSelection( sal_False )) @@ -2052,12 +1881,10 @@ void SwXTextViewCursor::gotoEndOfLine(sal_Bool bExpand) throw( uno::RuntimeExcep else throw uno::RuntimeException(); } -/*-- 28.09.99 08:31:22--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwXTextViewCursor::gotoStartOfLine(sal_Bool bExpand) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; if(m_pView) { if (!IsTextSelection( sal_False )) @@ -2068,16 +1895,12 @@ void SwXTextViewCursor::gotoStartOfLine(sal_Bool bExpand) throw( uno::RuntimeExc else throw uno::RuntimeException(); } -/* -----------------------------06.04.00 11:07-------------------------------- - ---------------------------------------------------------------------------*/ OUString SwXTextViewCursor::getImplementationName(void) throw( RuntimeException ) { return C2U("SwXTextViewCursor"); } -/* -----------------------------06.04.00 11:07-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SwXTextViewCursor::supportsService(const OUString& rServiceName) throw( RuntimeException ) { return !rServiceName.compareToAscii("com.sun.star.text.TextViewCursor") || @@ -2088,9 +1911,7 @@ sal_Bool SwXTextViewCursor::supportsService(const OUString& rServiceName) throw( !rServiceName.compareToAscii("com.sun.star.style.ParagraphPropertiesAsian") || !rServiceName.compareToAscii("com.sun.star.style.ParagraphPropertiesComplex"); } -/* -----------------------------06.04.00 11:07-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< OUString > SwXTextViewCursor::getSupportedServiceNames(void) throw( RuntimeException ) { Sequence< OUString > aRet(7); @@ -2104,17 +1925,13 @@ Sequence< OUString > SwXTextViewCursor::getSupportedServiceNames(void) throw( Ru pArray[6] = C2U("com.sun.star.style.ParagraphPropertiesComplex"); return aRet; } -/* -----------------------------03.03.03 11:07-------------------------------- - ---------------------------------------------------------------------------*/ const uno::Sequence< sal_Int8 > & SwXTextViewCursor::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); return aSeq; } -/* -----------------------------03.03.03 11:07-------------------------------- - ---------------------------------------------------------------------------*/ //XUnoTunnel sal_Int64 SAL_CALL SwXTextViewCursor::getSomething( const uno::Sequence< sal_Int8 >& rId ) @@ -2128,7 +1945,6 @@ sal_Int64 SAL_CALL SwXTextViewCursor::getSomething( } return OTextCursorHelper::getSomething(rId);; } -// ----------------------------------------------------------------------------- IMPLEMENT_FORWARD_XINTERFACE2(SwXTextViewCursor,SwXTextViewCursor_Base,OTextCursorHelper) const SwDoc* SwXTextViewCursor::GetDoc() const @@ -2136,19 +1952,19 @@ const SwDoc* SwXTextViewCursor::GetDoc() const SwWrtShell& rSh = m_pView->GetWrtShell(); return rSh.GetCrsr() ? rSh.GetCrsr()->GetDoc() : 0; } -// ----------------------------------------------------------------------------- + SwDoc* SwXTextViewCursor::GetDoc() { SwWrtShell& rSh = m_pView->GetWrtShell(); return rSh.GetCrsr() ? rSh.GetCrsr()->GetDoc() : 0; } -// ----------------------------------------------------------------------------- + const SwPaM* SwXTextViewCursor::GetPaM() const { SwWrtShell& rSh = m_pView->GetWrtShell(); return rSh.GetCrsr(); } -// ----------------------------------------------------------------------------- + SwPaM* SwXTextViewCursor::GetPaM() { SwWrtShell& rSh = m_pView->GetWrtShell(); @@ -2157,7 +1973,7 @@ SwPaM* SwXTextViewCursor::GetPaM() uno::Reference< datatransfer::XTransferable > SAL_CALL SwXTextView::getTransferable( ) throw (uno::RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; //force immediat shell update GetView()->StopShellTimer(); @@ -2181,7 +1997,7 @@ uno::Reference< datatransfer::XTransferable > SAL_CALL SwXTextView::getTransfera void SAL_CALL SwXTextView::insertTransferable( const uno::Reference< datatransfer::XTransferable >& xTrans ) throw (datatransfer::UnsupportedFlavorException, uno::RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; //force immediat shell update GetView()->StopShellTimer(); @@ -2205,5 +2021,4 @@ void SAL_CALL SwXTextView::insertTransferable( const uno::Reference< datatransfe } } -// ----------------------------------------------------------------------------- - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/attrdesc.cxx b/sw/source/ui/utlui/attrdesc.cxx index 4bbd7b592e..c151976dc5 100644 --- a/sw/source/ui/utlui/attrdesc.cxx +++ b/sw/source/ui/utlui/attrdesc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -60,9 +61,7 @@ #include <charfmt.hxx> #include <fmtcol.hxx> #include <tox.hxx> -#ifndef _ATTRDESC_HRC #include <attrdesc.hrc> -#endif #include <fmtftntx.hxx> #include <fmtfollowtextflow.hxx> @@ -72,14 +71,14 @@ using namespace com::sun::star; TYPEINIT2(SwFmtCharFmt,SfxPoolItem,SwClient); -// erfrage die Attribut-Beschreibung +// query the attribute descriptions void SwAttrSet::GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, String &rText ) const { -static sal_Char __READONLY_DATA sKomma[] = ", "; +static sal_Char const sKomma[] = ", "; rText.Erase(); String aStr; @@ -912,20 +911,12 @@ SfxItemPresentation SwFmtFtnEndAtTxtEnd::GetPresentation switch( GetValue() ) { case FTNEND_ATPGORDOCEND: -// rText = SW_RESSTR( STR_LAYOUT_FTN ); break; case FTNEND_ATTXTEND: break; case FTNEND_ATTXTEND_OWNNUMSEQ: - { -// String sPrefix; -// String sSuffix; -// SvxNumberType aFmt; -// sal_uInt16 nOffset; -// rText += - } break; } } @@ -1063,20 +1054,6 @@ SfxItemPresentation SwHeaderAndFooterEatSpacingItem::GetPresentation const IntlWrapper* /*pIntl*/ ) const { -// rText.Erase(); -// switch ( ePres ) -// { -// case SFX_ITEM_PRESENTATION_NONE: -// rText.Erase(); -// break; -// case SFX_ITEM_PRESENTATION_NAMELESS: -// case SFX_ITEM_PRESENTATION_COMPLETE: -// { -// if ( GetValue() ) -// rText = SW_RESSTR(STR_EDIT_IN_READONLY); -// return ePres; -// } -// } return SFX_ITEM_PRESENTATION_NONE; } @@ -1348,3 +1325,4 @@ SfxItemPresentation SwFmtFollowTextFlow::GetPresentation( SfxItemPresentation eP return ePres; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/attrdesc.src b/sw/source/ui/utlui/attrdesc.src index 809af110da..474ff791e7 100644 --- a/sw/source/ui/utlui/attrdesc.src +++ b/sw/source/ui/utlui/attrdesc.src @@ -32,7 +32,6 @@ ---------------------------------------------------------------------*/ String STR_DROP_OVER { - /* ### ACHTUNG: Neuer Text in Resource? Initialen �ber : Initialen �ber */ Text [ en-US ] = "Drop Caps over" ; }; String STR_DROP_LINES @@ -77,12 +76,10 @@ String STR_NO_CHARFMT }; String STR_FOOTER { - /* ### ACHTUNG: Neuer Text in Resource? Fu�zeile : Fu�zeile */ Text [ en-US ] = "Footer" ; }; String STR_NO_FOOTER { - /* ### ACHTUNG: Neuer Text in Resource? keine Fu�zeile : keine Fu�zeile */ Text [ en-US ] = "No footer" ; }; String STR_HEADER @@ -127,7 +124,6 @@ String STR_SURROUND_INSIDE }; String STR_SURROUND_OUTSIDE { - /* ### ACHTUNG: Neuer Text in Resource? Umlauf au�en : Umlauf au�en */ Text [ en-US ] = "Outer wrap" ; }; String STR_SURROUND_ANCHORONLY @@ -140,12 +136,10 @@ String STR_FRM_WIDTH }; String STR_FRM_FIXEDHEIGHT { - /* ### ACHTUNG: Neuer Text in Resource? feste H�he: : feste H�he: */ Text [ en-US ] = "Fixed height:" ; }; String STR_FRM_MINHEIGHT { - /* ### ACHTUNG: Neuer Text in Resource? min. H�he: : min. H�he: */ Text [ en-US ] = "Min. height:" ; }; String STR_FLY_AT_PARA @@ -218,7 +212,6 @@ String STR_HORI_INSIDE }; String STR_HORI_OUTSIDE { - /* ### ACHTUNG: Neuer Text in Resource? au�en : au�en */ Text [ en-US ] = "outside" ; }; String STR_HORI_FULL @@ -235,17 +228,10 @@ String STR_LINE_WIDTH }; String STR_MAX_FTN_HEIGHT { - /* ### ACHTUNG: Neuer Text in Resource? max. Fu�notenbereich: : max. Fu�notenbereich: */ Text [ en-US ] = "Max. footnote area:" ; }; String STR_EDIT_IN_READONLY { - /* ### ACHTUNG: Neuer Text in Resource? editierbar im schreibgesch�tztem Dokument : editierbar im Schreibesch�tztem Dokument */ - /* ### ACHTUNG: Neuer Text in Resource? editierbar im schreibgesch�tztem Dokument : editierbar im Schreibesch�tztem Dokument */ - /* ### ACHTUNG: Neuer Text in Resource? editierbar im schreibgesch�tztem Dokument : editierbar im Schreibesch�tztem Dokument */ - /* ### ACHTUNG: Neuer Text in Resource? editierbar im schreibgesch�tztem Dokument : editierbar im Schreibesch�tztem Dokument */ - /* ### ACHTUNG: Neuer Text in Resource? editierbar im schreibgesch�tztem Dokument : editierbar im Schreibesch�tztem Dokument */ - /* ### ACHTUNG: Neuer Text in Resource? editierbar im schreibgesch�tztem Dokument : editierbar im schreibgesch�tztem Dokument */ Text [ en-US ] = "Editable in read-only document" ; }; String STR_LAYOUT_SPLIT diff --git a/sw/source/ui/utlui/bookctrl.cxx b/sw/source/ui/utlui/bookctrl.cxx index b9e0bf09d6..cc28c8aaf0 100644 --- a/sw/source/ui/utlui/bookctrl.cxx +++ b/sw/source/ui/utlui/bookctrl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,17 +38,10 @@ #include <svl/intitem.hxx> #include <svl/stritem.hxx> #include <sfx2/dispatch.hxx> -#ifndef _EVENT_HXX //autogen #include <vcl/event.hxx> -#endif -#ifndef _STATUS_HXX //autogen #include <vcl/status.hxx> -#endif -#ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> -#endif #include "cmdid.h" -#include "errhdl.hxx" #include "swmodule.hxx" #include "wrtsh.hxx" #include "IMark.hxx" @@ -71,16 +65,12 @@ private: virtual void Select(); }; -// ----------------------------------------------------------------------- - BookmarkPopup_Impl::BookmarkPopup_Impl() : PopupMenu(), nCurId(USHRT_MAX) { } -// ----------------------------------------------------------------------- - void BookmarkPopup_Impl::Select() { nCurId = GetCurItemId(); @@ -95,14 +85,10 @@ SwBookmarkControl::SwBookmarkControl( sal_uInt16 _nSlotId, { } -// ----------------------------------------------------------------------- - SwBookmarkControl::~SwBookmarkControl() { } -// ----------------------------------------------------------------------- - void SwBookmarkControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { @@ -115,15 +101,11 @@ void SwBookmarkControl::StateChanged( } } -// ----------------------------------------------------------------------- - void SwBookmarkControl::Paint( const UserDrawEvent& ) { GetStatusBar().SetItemText( GetId(), sPageNumber ); } -// ----------------------------------------------------------------------- - void SwBookmarkControl::Command( const CommandEvent& rCEvt ) { if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU && @@ -162,3 +144,5 @@ void SwBookmarkControl::Command( const CommandEvent& rCEvt ) ReleaseMouse(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/condedit.cxx b/sw/source/ui/utlui/condedit.cxx index 1ca8e6548e..653492788e 100644 --- a/sw/source/ui/utlui/condedit.cxx +++ b/sw/source/ui/utlui/condedit.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,14 +29,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -// include --------------------------------------------------------------- - - #include <sot/formats.hxx> -#ifndef _CONDEDIT_HXX #include <condedit.hxx> -#endif #include <svx/dbaexchange.hxx> using namespace ::svx; using ::rtl::OUString; @@ -44,10 +40,6 @@ using namespace ::com::sun::star::uno; // STATIC DATA ----------------------------------------------------------- -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - ConditionEdit::ConditionEdit( Window* pParent, const ResId& rResId ) : Edit( pParent, rResId ), DropTargetHelper( this ), @@ -58,7 +50,6 @@ ConditionEdit::ConditionEdit( Window* pParent, const ResId& rResId ) /*-------------------------------------------------------------------- Beschreibung: Drop moeglich, bzw Format bekannt? --------------------------------------------------------------------*/ - sal_Int8 ConditionEdit::AcceptDrop( const AcceptDropEvent& /*rEvt*/ ) { return OColumnTransferable::canExtractColumnDescriptor @@ -106,3 +97,4 @@ sal_Int8 ConditionEdit::ExecuteDrop( const ExecuteDropEvent& rEvt ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index 703bd3307f..a63193ac55 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,7 +47,6 @@ #include <swmodule.hxx> #include <wrtsh.hxx> #include <view.hxx> -#include <errhdl.hxx> #include <docsh.hxx> #include <content.hxx> #include <frmfmt.hxx> @@ -83,7 +83,6 @@ #include <svx/svdpage.hxx> #include <svx/svdview.hxx> #include <vcl/scrbar.hxx> -#include <comcore.hrc> #include <SwRewriter.hxx> #include <hints.hxx> #include <numrule.hxx> @@ -98,6 +97,7 @@ #include "globals.hrc" #include <unomid.h> +#include "navmgr.hxx" #define CTYPE_CNT 0 #define CTYPE_CTT 1 @@ -108,20 +108,14 @@ using namespace ::com::sun::star::text; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::container; - #define NAVI_BOOKMARK_DELIM (sal_Unicode)1 -/*************************************************************************** - -***************************************************************************/ - typedef SwContent* SwContentPtr; SV_DECL_PTRARR_SORT_DEL( SwContentArr, SwContentPtr, 0,4) SV_IMPL_OP_PTRARR_SORT(SwContentArr, SwContentPtr) sal_Bool SwContentTree::bIsInDrag = sal_False; - namespace { static sal_Bool lcl_IsContent(SvLBoxEntry* pEntry) @@ -129,13 +123,11 @@ namespace return ((SwTypeNumber*)pEntry->GetUserData())->GetTypeId() == CTYPE_CNT; } - static sal_Bool lcl_IsContentType(SvLBoxEntry* pEntry) { return ((SwTypeNumber*)pEntry->GetUserData())->GetTypeId() == CTYPE_CTT; } - static sal_Bool lcl_FindShell(SwWrtShell* pShell) { sal_Bool bFound = sal_False; @@ -162,7 +154,6 @@ namespace Beschreibung: Inhalt, enthaelt Namen und Verweis auf den Inhalstyp ***************************************************************************/ - SwContent::SwContent(const SwContentType* pCnt, const String& rName, long nYPos) : SwTypeNumber(CTYPE_CNT), pParent(pCnt), @@ -172,7 +163,6 @@ SwContent::SwContent(const SwContentType* pCnt, const String& rName, long nYPos) { } - sal_uInt8 SwTypeNumber::GetTypeId() { return nTypeId; @@ -203,6 +193,7 @@ sal_Bool SwURLFieldContent::IsProtect() const SwGraphicContent::~SwGraphicContent() { } + SwTOXBaseContent::~SwTOXBaseContent() { } @@ -211,7 +202,6 @@ SwTOXBaseContent::~SwTOXBaseContent() Beschreibung: Inhaltstyp, kennt seine Inhalte und die WrtShell ***************************************************************************/ - SwContentType::SwContentType(SwWrtShell* pShell, sal_uInt16 nType, sal_uInt8 nLevel) : SwTypeNumber(CTYPE_CTT), pWrtShell(pShell), @@ -233,7 +223,6 @@ SwContentType::SwContentType(SwWrtShell* pShell, sal_uInt16 nType, sal_uInt8 nLe Beschreibung: Initialisierung ***************************************************************************/ - void SwContentType::Init(sal_Bool* pbInvalidateWindow) { // wenn sich der MemberCount aendert ... @@ -336,7 +325,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow) if( !pFmt->GetInfo( aAskItem ) && !aAskItem.pObject ) // not visible pCnt->SetInvisible(); - pMember->Insert(pCnt);//, pMember->Count()); + pMember->Insert(pCnt); sal_uInt16 nPos = pMember->Count() - 1; if(nOldRegionCount > nPos && @@ -394,7 +383,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow) RTL_TEXTENCODING_UTF8 ), &p->rINetAttr, n ); - pMember->Insert( pCnt );//, n ); + pMember->Insert( pCnt ); } bEdit = sal_True; nOldMemberCount = nMemberCount; @@ -431,28 +420,8 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow) nMemberCount++; } } - /* - // this code can be used once we want redline comments in the margin - else // redcomment - { - SwRedline* pRedline = static_cast<SwRedline*>((*i)->GetBroadCaster()); - if ( pRedline->GetComment() != String(::rtl::OUString::createFromAscii("")) ) - { - String sEntry = pRedline->GetComment(); - RemoveNewline(sEntry); - SwPostItContent* pCnt = new SwPostItContent( - this, - sEntry, // hier steht der Text - pRedline, - nMemberCount); - pMember->Insert(pCnt); - nMemberCount++; - } - } - */ } } - // sTypeToken = aEmptyStr; bEdit = sal_True; nOldMemberCount = nMemberCount; @@ -470,10 +439,8 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow) for( sal_uInt32 i=0; i< nCount; i++ ) { SdrObject* pTemp = pPage->GetObj(i); - // --> OD 2006-03-09 #i51726# - all drawing objects can be named now -// if(pTemp->ISA(SdrObjGroup) && pTemp->GetName().Len()) + // #i51726# - all drawing objects can be named now if ( pTemp->GetName().Len() ) - // <-- nMemberCount++; } } @@ -487,11 +454,6 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow) bDataValid = sal_False; } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - - SwContentType::~SwContentType() { delete pMember; @@ -501,7 +463,6 @@ SwContentType::~SwContentType() Beschreibung: Inhalt liefern, dazu gfs. die Liste fuellen ***************************************************************************/ - const SwContent* SwContentType::GetMember(sal_uInt16 nIndex) { if(!bDataValid || !pMember) @@ -515,12 +476,6 @@ const SwContent* SwContentType::GetMember(sal_uInt16 nIndex) } - -/*************************************************************************** - Beschreibung: -***************************************************************************/ - - void SwContentType::Invalidate() { bDataValid = sal_False; @@ -530,7 +485,6 @@ void SwContentType::Invalidate() Beschreibung: Liste der Inhalte fuellen ***************************************************************************/ - void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) { SwContentArr* pOldMember = 0; @@ -584,9 +538,8 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) case CONTENT_TYPE_TABLE : { - DBG_ASSERT(nMemberCount == - pWrtShell->GetTblFrmFmtCount(sal_True), - "MemberCount differiert"); + OSL_ENSURE(nMemberCount == pWrtShell->GetTblFrmFmtCount(sal_True), + "MemberCount differs"); Point aNullPt; nMemberCount = pWrtShell->GetTblFrmFmtCount(sal_True); for(sal_uInt16 i = 0; i < nMemberCount; i++) @@ -600,7 +553,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) !aAskItem.pObject ) // not visible pCnt->SetInvisible(); - pMember->Insert(pCnt);//, i); + pMember->Insert(pCnt); if(nOldMemberCount > (int)i && (pOldMember->GetObject(i))->IsInvisible() != pCnt->IsInvisible()) @@ -617,8 +570,8 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) eType = FLYCNTTYPE_OLE; else if(nContentType == CONTENT_TYPE_GRAPHIC) eType = FLYCNTTYPE_GRF; - DBG_ASSERT(nMemberCount == pWrtShell->GetFlyCount(eType), - "MemberCount differiert"); + OSL_ENSURE(nMemberCount == pWrtShell->GetFlyCount(eType), + "MemberCount differs"); Point aNullPt; nMemberCount = pWrtShell->GetFlyCount(eType); for(sal_uInt16 i = 0; i < nMemberCount; i++) @@ -645,7 +598,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) if( !pFrmFmt->GetInfo( aAskItem ) && !aAskItem.pObject ) // not visible pCnt->SetInvisible(); - pMember->Insert(pCnt);//, i); + pMember->Insert(pCnt); if(nOldMemberCount > (int)i && (pOldMember->GetObject(i))->IsInvisible() != pCnt->IsInvisible()) *pbLevelOrVisibiblityChanged = sal_True; @@ -664,7 +617,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) const String& rBkmName = ppBookmark->get()->GetName(); //nYPos von 0 -> text::Bookmarks werden nach Alphabet sortiert SwContent* pCnt = new SwContent(this, rBkmName, 0); - pMember->Insert(pCnt);//, pMember->Count()); + pMember->Insert(pCnt); } } } @@ -697,7 +650,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) if( !pFmt->GetInfo( aAskItem ) && !aAskItem.pObject ) // not visible pCnt->SetInvisible(); - pMember->Insert(pCnt);//, pMember->Count()); + pMember->Insert(pCnt); sal_uInt16 nPos = pMember->Count() - 1; if(nOldMemberCount > nPos && @@ -719,7 +672,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) //Referenzen nach Alphabet sortiert SwContent* pCnt = new SwContent( this, *aRefMarks.GetObject(i), 0); - pMember->Insert(pCnt);//, i); + pMember->Insert(pCnt); } } break; @@ -740,7 +693,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) RTL_TEXTENCODING_UTF8 ), &p->rINetAttr, n ); - pMember->Insert( pCnt );//, n ); + pMember->Insert( pCnt ); } } break; @@ -760,7 +713,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) !aAskItem.pObject ) // not visible pCnt->SetInvisible(); - pMember->Insert( pCnt );//, nTox ); + pMember->Insert( pCnt ); sal_uInt16 nPos = pMember->Count() - 1; if(nOldMemberCount > nPos && (pOldMember->GetObject(nPos))->IsInvisible() @@ -798,27 +751,8 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) nMemberCount++; } } - /* this code can be used once we want redline comments in the margin - else // redcomment - { - SwRedline* pRedline = static_cast<SwRedline*>((*i)->GetBroadCaster()); - if ( pRedline->GetComment() != String(::rtl::OUString::createFromAscii("")) ) - { - String sEntry = pRedline->GetComment(); - RemoveNewline(sEntry); - SwPostItContent* pCnt = new SwPostItContent( - this, - sEntry, - pRedline, - nMemberCount); - pMember->Insert(pCnt); - nMemberCount++; - } - } - */ } } - // } break; case CONTENT_TYPE_DRAWOBJECT: @@ -838,10 +772,8 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) for( sal_uInt32 i=0; i< nCount; i++ ) { SdrObject* pTemp = pPage->GetObj(i); - // --> OD 2006-03-09 #i51726# - all drawing objects can be named now -// if(pTemp->ISA(SdrObjGroup) && pTemp->GetName().Len()) + // #i51726# - all drawing objects can be named now if ( pTemp->GetName().Len() ) - // <-- { SwContact* pContact = (SwContact*)pTemp->GetUserCall(); long nYPos = 0; @@ -875,7 +807,6 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) Beschreibung: TreeListBox fuer Inhaltsanzeige ***************************************************************************/ - SwContentTree::SwContentTree(Window* pParent, const ResId& rResId) : SvTreeListBox( pParent, rResId ), @@ -939,11 +870,6 @@ SwContentTree::SwContentTree(Window* pParent, const ResId& rResId) : SetStyle( GetStyle() | WB_QUICK_SEARCH ); } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - - SwContentTree::~SwContentTree() { Clear(); // vorher gfs. Inhaltstypen loeschen @@ -953,7 +879,6 @@ SwContentTree::~SwContentTree() /*************************************************************************** Drag&Drop methods ***************************************************************************/ - void SwContentTree::StartDrag( sal_Int8 nAction, const Point& rPosPixel ) { if( !bIsRoot || nRootType != CONTENT_TYPE_OUTLINE ) @@ -1003,14 +928,50 @@ sal_Int8 SwContentTree::AcceptDrop( const AcceptDropEvent& rEvt ) /*************************************************************************** Beschreibung: Drop wird im Navigator ausgefuehrt ***************************************************************************/ +void* lcl_GetOutlineKey( SwContentTree* pTree, SwOutlineContent* pContent) +{ + void* key = 0; + if( pTree && pContent ) + { + SwWrtShell* pShell = pTree->GetWrtShell(); + sal_Int32 nPos = pContent->GetYPos(); + if( nPos ) + { + key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos ); + } + } + return key; +} + sal_Int8 SwContentTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) { + SvLBoxEntry* pEntry = pTargetEntry; + if( pEntry && ( nRootType == CONTENT_TYPE_OUTLINE ) && lcl_IsContent( pEntry ) ) + { + SwOutlineContent* pOutlineContent = ( SwOutlineContent* )( pEntry->GetUserData() ); + if( pOutlineContent ) + { + void* key = lcl_GetOutlineKey(this, pOutlineContent); + if( !mOutLineNodeMap[key] ) + { + while( pEntry->HasChilds() ) + { + SvLBoxEntry* pChildEntry = FirstChild( pEntry ); + while( pChildEntry ) + { + pEntry = pChildEntry; + pChildEntry = NextSibling( pChildEntry ); + } + } + pTargetEntry = pEntry; + } + } + } if( bIsRoot ) return SvTreeListBox::ExecuteDrop( rEvt ); return bIsInDrag ? DND_ACTION_NONE : GetParentWindow()->ExecuteDrop(rEvt); } - /*************************************************************************** Beschreibung: Handler fuer Dragging und ContextMenu ***************************************************************************/ @@ -1165,14 +1126,6 @@ PopupMenu* SwContentTree::CreateContextMenu( void ) pSubPop4->InsertItem(600, sPostItShow ); pSubPop4->InsertItem(601, sPostItHide ); pSubPop4->InsertItem(602, sPostItDelete ); - /* - pSubPop4->InsertItem(603,rtl::OUString::createFromAscii("Sort")); - PopupMenu* pMenuSort = new PopupMenu; - pMenuSort->InsertItem(604,rtl::OUString::createFromAscii("By Position")); - pMenuSort->InsertItem(605,rtl::OUString::createFromAscii("By Author")); - pMenuSort->InsertItem(606,rtl::OUString::createFromAscii("By Date")); - pSubPop4->SetPopupMenu(603, pMenuSort); - */ pPop->InsertItem(4, pType->GetSingleName()); pPop->SetPopupMenu(4, pSubPop4); } @@ -1184,11 +1137,10 @@ PopupMenu* SwContentTree::CreateContextMenu( void ) return pPop; } + /*************************************************************************** Beschreibung: Einrueckung fuer outlines (und sections) ***************************************************************************/ - - long SwContentTree::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab) { sal_uInt16 nLevel = 0; @@ -1212,8 +1164,6 @@ long SwContentTree::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab) /*************************************************************************** Beschreibung: Inhalte werden erst auf Anforderung in die Box eingefuegt ***************************************************************************/ - - void SwContentTree::RequestingChilds( SvLBoxEntry* pParent ) { // ist es ein Inhaltstyp? @@ -1221,34 +1171,79 @@ void SwContentTree::RequestingChilds( SvLBoxEntry* pParent ) { if(!pParent->HasChilds()) { - DBG_ASSERT(pParent->GetUserData(), "keine UserData?"); + OSL_ENSURE(pParent->GetUserData(), "no UserData?"); SwContentType* pCntType = (SwContentType*)pParent->GetUserData(); sal_uInt16 nCount = pCntType->GetMemberCount(); - for(sal_uInt16 i = 0; i < nCount; i++) - { - const SwContent* pCnt = pCntType->GetMember(i); - if(pCnt) - { - String sEntry = pCnt->GetName(); - if(!sEntry.Len()) - sEntry = sSpace; - InsertEntry(sEntry, pParent, - sal_False, LIST_APPEND, (void*)pCnt); - } - + /************************************************************** + Add for outline plus/minus + ***************************************************************/ + if(pCntType->GetType() == CONTENT_TYPE_OUTLINE) + { + SvLBoxEntry* pChild = 0; + for(sal_uInt16 i = 0; i < nCount; i++) + { + const SwContent* pCnt = pCntType->GetMember(i); + if(pCnt) + { + sal_uInt16 nLevel = ((SwOutlineContent*)pCnt)->GetOutlineLevel(); + String sEntry = pCnt->GetName(); + if(!sEntry.Len()) + sEntry = sSpace; + if(!pChild || (nLevel == 0)) + pChild = InsertEntry(sEntry, pParent, + sal_False, LIST_APPEND,(void*)pCnt); + else + { + //back search parent. + if(((SwOutlineContent*)pCntType->GetMember(i-1))->GetOutlineLevel() < nLevel) + pChild = InsertEntry(sEntry, pChild, + sal_False, LIST_APPEND, (void*)pCnt); + else + { + pChild = Prev(pChild); + while(pChild && + lcl_IsContent(pChild) && + !(((SwOutlineContent*)pChild->GetUserData())->GetOutlineLevel() < nLevel) + ) + { + pChild = Prev(pChild); + } + if(pChild) + pChild = InsertEntry(sEntry, pChild, + sal_False, LIST_APPEND, (void*)pCnt); + } + } + } + } + } + else + { + for(sal_uInt16 i = 0; i < nCount; i++) + { + const SwContent* pCnt = pCntType->GetMember(i); + if(pCnt) + { + String sEntry = pCnt->GetName(); + if(!sEntry.Len()) + sEntry = sSpace; + InsertEntry(sEntry, pParent, + sal_False, LIST_APPEND, (void*)pCnt); + } + + } } } } } + /*************************************************************************** Beschreibung: Expand - Zustand fuer Inhaltstypen merken ***************************************************************************/ - - sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent ) { - if(!bIsRoot) + if(!bIsRoot || (((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) || + (nRootType == CONTENT_TYPE_OUTLINE)) { if(lcl_IsContentType(pParent)) { @@ -1261,22 +1256,58 @@ sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent ) } else nHiddenBlock |= nOr; + if((pCntType->GetType() == CONTENT_TYPE_OUTLINE)) + { + std::map< void*, sal_Bool > mCurrOutLineNodeMap; + + SwWrtShell* pShell = GetWrtShell(); + sal_Bool bBool = SvTreeListBox::Expand(pParent); + SvLBoxEntry* pChild = Next(pParent); + while(pChild && lcl_IsContent(pChild) && pParent->HasChilds()) + { + if(pChild->HasChilds()) + { + sal_Int32 nPos = ((SwContent*)pChild->GetUserData())->GetYPos(); + void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos ); + mCurrOutLineNodeMap.insert(std::map<void*, sal_Bool>::value_type( key, sal_False ) ); + std::map<void*,sal_Bool>::iterator iter = mOutLineNodeMap.find( key ); + if( iter != mOutLineNodeMap.end() && mOutLineNodeMap[key]) + { + mCurrOutLineNodeMap[key] = sal_True; + SvTreeListBox::Expand(pChild); + } + } + pChild = Next(pChild); + } + mOutLineNodeMap = mCurrOutLineNodeMap; + return bBool; + } + + } + else if( lcl_IsContent(pParent) ) + { + SwWrtShell* pShell = GetWrtShell(); + sal_Int32 nPos = ((SwContent*)pParent->GetUserData())->GetYPos(); + void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos ); + mOutLineNodeMap[key] = sal_True; } } return SvTreeListBox::Expand(pParent); } + /*************************************************************************** Beschreibung: Collapse - Zustand fuer Inhaltstypen merken ***************************************************************************/ - - sal_Bool SwContentTree::Collapse( SvLBoxEntry* pParent ) { sal_Bool bRet; - if(!bIsRoot) + if(!bIsRoot || (((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) || + (nRootType == CONTENT_TYPE_OUTLINE)) { if(lcl_IsContentType(pParent)) { + if(bIsRoot) + return bRet = sal_False; SwContentType* pCntType = (SwContentType*)pParent->GetUserData(); sal_uInt16 nAnd = 1 << pCntType->GetType(); nAnd = ~nAnd; @@ -1288,29 +1319,33 @@ sal_Bool SwContentTree::Collapse( SvLBoxEntry* pParent ) else nHiddenBlock &= nAnd; } + else if( lcl_IsContent(pParent) ) + { + SwWrtShell* pShell = GetWrtShell(); + sal_Int32 nPos = ((SwContent*)pParent->GetUserData())->GetYPos(); + void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos ); + mOutLineNodeMap[key] = sal_False; + } bRet = SvTreeListBox::Collapse(pParent); } else - bRet = sal_False; + bRet = SvTreeListBox::Collapse(pParent); return bRet; } - /*************************************************************************** Beschreibung: Auch auf Doppelclick wird zunaechst nur aufgeklappt ***************************************************************************/ - - IMPL_LINK( SwContentTree, ContentDoubleClickHdl, SwContentTree *, EMPTYARG ) { SvLBoxEntry* pEntry = GetCurEntry(); // ist es ein Inhaltstyp? - DBG_ASSERT(pEntry, "kein aktueller Eintrag!"); + OSL_ENSURE(pEntry, "no current entry!"); if(pEntry) { - if(lcl_IsContentType(pEntry)) + if(lcl_IsContentType(pEntry) && !pEntry->HasChilds()) RequestingChilds(pEntry); - else if(bIsActive || bIsConstant) + else if(!lcl_IsContentType(pEntry) && (bIsActive || bIsConstant)) { if(bIsConstant) { @@ -1318,7 +1353,7 @@ IMPL_LINK( SwContentTree, ContentDoubleClickHdl, SwContentTree *, EMPTYARG ) } //Inhaltstyp anspringen: SwContent* pCnt = (SwContent*)pEntry->GetUserData(); - DBG_ASSERT( pCnt, "keine UserData"); + OSL_ENSURE( pCnt, "no UserData"); GotoContent(pCnt); if(pCnt->GetParent()->GetType() == CONTENT_TYPE_FRAME) pActiveShell->EnterStdMode(); @@ -1330,14 +1365,11 @@ IMPL_LINK( SwContentTree, ContentDoubleClickHdl, SwContentTree *, EMPTYARG ) /*************************************************************************** Beschreibung: Anzeigen der Datei ***************************************************************************/ - - void SwContentTree::Display( sal_Bool bActive ) { if(!bIsImageListInitialized) { - sal_uInt16 nResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP; - aEntryImages = ImageList(SW_RES(nResId)); + aEntryImages = ImageList(SW_RES(IMG_NAVI_ENTRYBMP)); bIsImageListInitialized = sal_True; } // erst den selektierten Eintrag auslesen, um ihn spaeter evtl. wieder @@ -1354,9 +1386,14 @@ void SwContentTree::Display( sal_Bool bActive ) nOldScrollPos = pVScroll->GetThumbPos(); sEntryName = GetEntryText(pOldSelEntry); + SvLBoxEntry* pParantEntry = pOldSelEntry; + while( GetParent(pParantEntry)) + { + pParantEntry = GetParent(pParantEntry); + } if(GetParent(pOldSelEntry)) { - nEntryRelPos = (sal_uInt16)(GetModel()->GetAbsPos(pOldSelEntry) - GetModel()->GetAbsPos(GetParent(pOldSelEntry))); + nEntryRelPos = (sal_uInt16)(GetModel()->GetAbsPos(pOldSelEntry) - GetModel()->GetAbsPos(pParantEntry)); } } Clear(); @@ -1391,7 +1428,6 @@ void SwContentTree::Display( sal_Bool bActive ) if(!*ppContentT) (*ppContentT) = new SwContentType(pShell, nCntType, nOutlineLevel ); - String sEntry = (*ppContentT)->GetName(); SvLBoxEntry* pEntry; const Image& rImage = aEntryImages.GetImage(SID_SW_START + nCntType); @@ -1450,18 +1486,23 @@ void SwContentTree::Display( sal_Bool bActive ) (*ppRootContentT)->GetName(), rImage, rImage, 0, sal_False, LIST_APPEND, *ppRootContentT); - for(sal_uInt16 i = 0; i < (*ppRootContentT)->GetMemberCount(); i++ ) + if(nRootType != CONTENT_TYPE_OUTLINE) { - const SwContent* pCnt = (*ppRootContentT)->GetMember(i); - if(pCnt) + for(sal_uInt16 i = 0; i < (*ppRootContentT)->GetMemberCount(); i++ ) { - String sEntry = pCnt->GetName(); - if(!sEntry.Len()) - sEntry = sSpace; - InsertEntry( sEntry, pParent, - sal_False, LIST_APPEND, (void*)pCnt); + const SwContent* pCnt = (*ppRootContentT)->GetMember(i); + if(pCnt) + { + String sEntry = pCnt->GetName(); + if(!sEntry.Len()) + sEntry = sSpace; + InsertEntry( sEntry, pParent, + sal_False, LIST_APPEND, (void*)pCnt); + } } - } + } + else + RequestingChilds(pParent); Expand(pParent); if( nRootType == CONTENT_TYPE_OUTLINE && bIsActive ) { @@ -1522,8 +1563,6 @@ void SwContentTree::Display( sal_Bool bActive ) /*************************************************************************** Beschreibung: Im Clear muessen auch die ContentTypes geloescht werden ***************************************************************************/ - - void SwContentTree::Clear() { SetUpdateMode(sal_False); @@ -1531,15 +1570,11 @@ void SwContentTree::Clear() SetUpdateMode(sal_True); } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - sal_Bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, sal_Int8& rDragMode ) { SwWrtShell* pWrtShell = GetWrtShell(); - DBG_ASSERT(pWrtShell, "keine Shell!"); + OSL_ENSURE(pWrtShell, "no Shell!"); SvLBoxEntry* pEntry = GetCurEntry(); if(!pEntry || lcl_IsContentType(pEntry) || !pWrtShell) return sal_False; @@ -1555,10 +1590,10 @@ sal_Bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, case CONTENT_TYPE_OUTLINE: { sal_uInt16 nPos = ((SwOutlineContent*)pCnt)->GetPos(); - DBG_ASSERT(nPos < pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineNodesCount(), - "outlinecnt veraendert"); + OSL_ENSURE(nPos < pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineNodesCount(), + "outlinecnt changed"); - // #100738# make sure outline may actually be copied + // make sure outline may actually be copied if( pWrtShell->IsOutlineCopyable( nPos ) ) { const SwNumRule* pOutlRule = pWrtShell->GetOutlineNumRule(); @@ -1593,7 +1628,7 @@ sal_Bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, break; case CONTENT_TYPE_URLFIELD: sUrl = ((SwURLFieldContent*)pCnt)->GetURL(); - // kein break; + // no break; case CONTENT_TYPE_OLE: case CONTENT_TYPE_GRAPHIC: if(GetParentWindow()->GetRegionDropMode() != REGION_MODE_NONE) @@ -1674,11 +1709,10 @@ sal_Bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, } return bRet; } + /*************************************************************************** Beschreibung: Umschalten der Anzeige auf Root ***************************************************************************/ - - sal_Bool SwContentTree::ToggleToRoot() { if(!bIsRoot) @@ -1711,8 +1745,6 @@ sal_Bool SwContentTree::ToggleToRoot() /*************************************************************************** Beschreibung: Angezeigten Inhalt auf Gueltigkeit pruefen ***************************************************************************/ - - sal_Bool SwContentTree::HasContentChanged() { /* @@ -1836,9 +1868,9 @@ sal_Bool SwContentTree::HasContentChanged() // or if the visibility of objects (frames, sections, tables) has changed // i.e. in header/footer pArrType->FillMemberList(&bLevelOrVisibiblityChanged); - if(bLevelOrVisibiblityChanged) - bInvalidate = sal_True; sal_uInt16 nChildCount = (sal_uInt16)GetChildCount(pEntry); + if((nType == CONTENT_TYPE_OUTLINE) && bLevelOrVisibiblityChanged) + bRepaint = sal_True; if(bLevelOrVisibiblityChanged) bInvalidate = sal_True; @@ -1945,8 +1977,6 @@ void SwContentTree::FindActiveTypeAndRemoveUserData() if(pEntry->GetUserData() && lcl_IsContentType(pEntry)) nLastSelType = ((SwContentType*)pEntry->GetUserData())->GetType(); } -// else -// nLastSelType = USHRT_MAX; pEntry = First(); while(pEntry) { @@ -1959,8 +1989,6 @@ void SwContentTree::FindActiveTypeAndRemoveUserData() Beschreibung: Nachdem ein File auf den Navigator gedroppt wurde, wird die neue Shell gesetzt ***************************************************************************/ - - void SwContentTree::SetHiddenShell(SwWrtShell* pSh) { pHiddenShell = pSh; @@ -1978,8 +2006,6 @@ void SwContentTree::SetHiddenShell(SwWrtShell* pSh) /*************************************************************************** Beschreibung: Dokumentwechsel - neue Shell setzen ***************************************************************************/ - - void SwContentTree::SetActiveShell(SwWrtShell* pSh) { if(bIsInternalDrag) @@ -2017,8 +2043,6 @@ void SwContentTree::SetActiveShell(SwWrtShell* pSh) /*************************************************************************** Beschreibung: Eine offene View als aktiv festlegen ***************************************************************************/ - - void SwContentTree::SetConstantShell(SwWrtShell* pSh) { pActiveShell = pSh; @@ -2031,11 +2055,10 @@ void SwContentTree::SetConstantShell(SwWrtShell* pSh) } Display(sal_True); } + /*************************************************************************** Beschreibung: Kommandos des Navigators ausfuehren ***************************************************************************/ - - void SwContentTree::ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier) { sal_Bool nMove = sal_False; @@ -2055,7 +2078,7 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier) SvLBoxEntry* pFirstEntry = FirstSelected(); if (pFirstEntry && lcl_IsContent(pFirstEntry)) { - if((bIsRoot && nRootType == CONTENT_TYPE_OUTLINE) || + if ( (bIsRoot && nRootType == CONTENT_TYPE_OUTLINE) || ((SwContent*)pFirstEntry->GetUserData())->GetParent()->GetType() == CONTENT_TYPE_OUTLINE) { @@ -2073,8 +2096,8 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier) if( nMove ) { short nDir = nCmd == FN_ITEM_UP ? -1 : 1; - if( !bModifier && ((nDir == -1 && nActPos > 0) || - (nDir == 1 && nActPos < GetEntryCount() - 2 )) ) + if( !bModifier && ( (nDir == -1 && nActPos > 0) || + (nDir == 1 && nActPos < GetEntryCount() - 2) ) ) { pShell->MoveOutlinePara( nDir ); //Cursor wieder an die aktuelle Position setzen @@ -2192,10 +2215,6 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier) } } } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - void SwContentTree::ShowTree() { @@ -2206,8 +2225,6 @@ void SwContentTree::ShowTree() /*************************************************************************** Beschreibung: zusammengefaltet wird nicht geidlet ***************************************************************************/ - - void SwContentTree::HideTree() { aUpdTimer.Stop(); @@ -2217,8 +2234,6 @@ void SwContentTree::HideTree() /*************************************************************************** Beschreibung: Kein Idle mit Focus oder waehrend des Dragging ***************************************************************************/ - - IMPL_LINK( SwContentTree, TimerUpdate, Timer*, EMPTYARG) { // kein Update waehrend D&D @@ -2256,11 +2271,6 @@ IMPL_LINK( SwContentTree, TimerUpdate, Timer*, EMPTYARG) return 0; } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - - DragDropMode SwContentTree::NotifyStartDrag( TransferDataContainer& rContainer, SvLBoxEntry* pEntry ) @@ -2280,13 +2290,10 @@ DragDropMode SwContentTree::NotifyStartDrag( return eMode; } - /*************************************************************************** Beschreibung : Nach dem Drag wird der aktuelle Absatz m i t Childs verschoben ***************************************************************************/ - - sal_Bool SwContentTree::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, SvLBoxEntry*& , sal_uLong& ) { @@ -2309,8 +2316,8 @@ sal_Bool SwContentTree::NotifyMoving( SvLBoxEntry* pTarget, } - DBG_ASSERT( pEntry && - lcl_IsContent(pEntry),"Source == 0 oder Source hat keinen Content" ); + OSL_ENSURE( pEntry && + lcl_IsContent(pEntry),"Source == 0 or Source has no Content" ); GetParentWindow()->MoveOutline( nSourcePos, nTargetPos, sal_True); @@ -2318,15 +2325,14 @@ sal_Bool SwContentTree::NotifyMoving( SvLBoxEntry* pTarget, aActiveContentArr[CONTENT_TYPE_OUTLINE]->Invalidate(); Display(sal_True); } - //TreeListBox wird aus dem Dokument neu geladen + //TreeListBox will be reloaded from the document return sal_False; } + /*************************************************************************** Beschreibung : Nach dem Drag wird der aktuelle Absatz o h n e Childs verschoben ***************************************************************************/ - - sal_Bool SwContentTree::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, SvLBoxEntry*& , sal_uLong& ) { @@ -2350,9 +2356,8 @@ sal_Bool SwContentTree::NotifyCopying( SvLBoxEntry* pTarget, } - - DBG_ASSERT( pEntry && - lcl_IsContent(pEntry),"Source == 0 oder Source hat keinen Content" ); + OSL_ENSURE( pEntry && + lcl_IsContent(pEntry),"Source == 0 or Source has no Content" ); GetParentWindow()->MoveOutline( nSourcePos, nTargetPos, sal_False); //TreeListBox wird aus dem Dokument neu geladen @@ -2365,13 +2370,11 @@ sal_Bool SwContentTree::NotifyCopying( SvLBoxEntry* pTarget, /*************************************************************************** Beschreibung: Kein Drop vor den ersten Eintrag - es ist ein SwContentType ***************************************************************************/ - sal_Bool SwContentTree::NotifyAcceptDrop( SvLBoxEntry* pEntry) { return pEntry != 0; } - /*************************************************************************** Beschreibung: Wird ein Ctrl+DoubleClick in einen freien Bereich ausgefuehrt, * dann soll die Basisfunktion des Controls gerufen werden @@ -2389,8 +2392,6 @@ void SwContentTree::MouseButtonDown( const MouseEvent& rMEvt ) /*************************************************************************** Beschreibung: sofort aktualisieren ***************************************************************************/ - - void SwContentTree::GetFocus() { SwView* pActView = GetParentWindow()->GetCreateView(); @@ -2415,11 +2416,6 @@ void SwContentTree::GetFocus() SvTreeListBox::GetFocus(); } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - - void SwContentTree::KeyInput(const KeyEvent& rEvent) { const KeyCode aCode = rEvent.GetKeyCode(); @@ -2471,11 +2467,6 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent) } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - - void SwContentTree::RequestHelp( const HelpEvent& rHEvt ) { sal_Bool bCallBase = sal_True; @@ -2591,11 +2582,6 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt ) Window::RequestHelp( rHEvt ); } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - - void SwContentTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) { SvLBoxEntry* pFirst = FirstSelected(); @@ -2660,7 +2646,7 @@ void SwContentTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry break; } //Anzeige - default: // nSelectedPopupEntry > 300 + default: if(nSelectedPopupEntry > 300 && nSelectedPopupEntry < 400) { nSelectedPopupEntry -= 300; @@ -2686,11 +2672,6 @@ void SwContentTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry GetParentWindow()->UpdateListBox(); } -/*************************************************************************** - Beschreibung: -***************************************************************************/ - - void SwContentTree::SetOutlineLevel(sal_uInt8 nSet) { nOutlineLevel = nSet; @@ -2709,8 +2690,6 @@ void SwContentTree::SetOutlineLevel(sal_uInt8 nSet) /*************************************************************************** Beschreibung: Moduswechsel: gedropptes Doc anzeigen ***************************************************************************/ - - void SwContentTree::ShowHiddenShell() { if(pHiddenShell) @@ -2724,8 +2703,6 @@ void SwContentTree::ShowHiddenShell() /*************************************************************************** Beschreibung: Moduswechsel: aktive Sicht anzeigen ***************************************************************************/ - - void SwContentTree::ShowActualView() { bIsActive = sal_True; @@ -2734,20 +2711,23 @@ void SwContentTree::ShowActualView() GetParentWindow()->UpdateListBox(); } -/*-----------------20.11.96 13.34------------------- +/*************************************************************************** Beschreibung: Hier sollen die Buttons zum Verschieben von Outlines en-/disabled werden ---------------------------------------------------*/ - +***************************************************************************/ sal_Bool SwContentTree::Select( SvLBoxEntry* pEntry, sal_Bool bSelect ) { if(!pEntry) return sal_False; sal_Bool bEnable = sal_False; SvLBoxEntry* pParentEntry = GetParent(pEntry); + while(pParentEntry && (!lcl_IsContentType(pParentEntry))) + { + pParentEntry = GetParent(pParentEntry); + } if(!bIsLastReadOnly && (!IsVisible() || - ((bIsRoot && nRootType == CONTENT_TYPE_OUTLINE && pParentEntry) || - (lcl_IsContent(pEntry) && ((SwContentType*)pParentEntry->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE)))) + ( (bIsRoot && nRootType == CONTENT_TYPE_OUTLINE && pParentEntry) || + (lcl_IsContent(pEntry) && ((SwContentType*)pParentEntry->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE)) )) bEnable = sal_True; SwNavigationPI* pNavi = GetParentWindow(); pNavi->aContentToolBox.EnableItem(FN_ITEM_UP , bEnable); @@ -2758,10 +2738,6 @@ sal_Bool SwContentTree::Select( SvLBoxEntry* pEntry, sal_Bool bSelect ) return SvTreeListBox::Select(pEntry, bSelect); } -/*-----------------27.11.96 12.56------------------- - ---------------------------------------------------*/ - void SwContentTree::SetRootType(sal_uInt16 nType) { nRootType = nType; @@ -2769,10 +2745,6 @@ void SwContentTree::SetRootType(sal_uInt16 nType) pConfig->SetRootType( nRootType ); } -/*-----------------10.01.97 12.19------------------- - ---------------------------------------------------*/ - void SwContentType::RemoveNewline(String& rEntry) { sal_Unicode* pStr = rEntry.GetBufferAccess(); @@ -2783,10 +2755,6 @@ void SwContentType::RemoveNewline(String& rEntry) } } -/*-----------------14.01.97 16.38------------------- - ---------------------------------------------------*/ - void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode) { SwContent* pCnt = (SwContent*)pEntry->GetUserData(); @@ -2920,15 +2888,6 @@ void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode) pActiveShell->GetView().GetPostItMgr()->SetActiveSidebarWin(0); pActiveShell->DelRight(); } - /* - // this code can be used once we want redline comments in the margin - else - { - SwMarginWin* pComment = pActiveShell->GetView().GetPostItMgr()->GetPostIt(((SwPostItContent*)pCnt)->GetRedline()); - if (pComment) - pComment->Delete(); - } - */ } else { @@ -2996,10 +2955,10 @@ void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode) aObj >>= xTmp; uno::Reference< container::XNamed > xNamed(xTmp, uno::UNO_QUERY); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractSwRenameXNamedDlg* pDlg = pFact->CreateSwRenameXNamedDlg( this, xNamed, xNameAccess, DLG_RENAME_XNAMED ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(xSecond.is()) pDlg->SetAlternativeAccess( xSecond, xThird); @@ -3018,10 +2977,6 @@ void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode) } } -/*-----------------14.01.97 16.53------------------- - ---------------------------------------------------*/ - void SwContentTree::GotoContent(SwContent* pCnt) { pActiveShell->EnterStdMode(); @@ -3091,6 +3046,7 @@ void SwContentTree::GotoContent(SwContent* pCnt) break; case CONTENT_TYPE_DRAWOBJECT: { + SwPosition aPos = *pActiveShell->GetCrsr()->GetPoint(); SdrView* pDrawView = pActiveShell->GetDrawView(); if (pDrawView) { @@ -3102,10 +3058,8 @@ void SwContentTree::GotoContent(SwContent* pCnt) for( sal_uInt32 i=0; i< nCount; i++ ) { SdrObject* pTemp = pPage->GetObj(i); - // --> OD 2006-03-09 #i51726# - all drawing objects can be named now -// if(pTemp->ISA(SdrObjGroup) && pTemp->GetName() == pCnt->GetName()) + // #i51726# - all drawing objects can be named now if ( pTemp->GetName() == pCnt->GetName() ) - // <-- { SdrPageView* pPV = pDrawView->GetSdrPageView(); if( pPV ) @@ -3114,6 +3068,7 @@ void SwContentTree::GotoContent(SwContent* pCnt) } } } + pActiveShell->GetNavigationMgr().addEntry(aPos); } } break; @@ -3128,10 +3083,8 @@ void SwContentTree::GotoContent(SwContent* pCnt) rView.GetPostItMgr()->SetActiveSidebarWin(0); rView.GetEditWin().GrabFocus(); } -/*-----------------06.02.97 19.14------------------- - Jetzt nochtdie passende text::Bookmark ---------------------------------------------------*/ +/* Jetzt nochtdie passende text::Bookmark */ NaviContentBookmark::NaviContentBookmark() : nDocSh(0), @@ -3139,10 +3092,6 @@ NaviContentBookmark::NaviContentBookmark() { } -/*-----------------06.02.97 20.12------------------- - ---------------------------------------------------*/ - NaviContentBookmark::NaviContentBookmark( const String &rUrl, const String& rDesc, sal_uInt16 nDragType, @@ -3183,10 +3132,6 @@ sal_Bool NaviContentBookmark::Paste( TransferableDataHelper& rData ) return bRet; } - -/* -----------------------------09.12.99 13:50-------------------------------- - - ---------------------------------------------------------------------------*/ class SwContentLBoxString : public SvLBoxString { public: @@ -3197,9 +3142,6 @@ public: SvLBoxEntry* pEntry); }; -/* -----------------------------09.12.99 13:49-------------------------------- - - ---------------------------------------------------------------------------*/ void SwContentTree::InitEntry(SvLBoxEntry* pEntry, const XubString& rStr ,const Image& rImg1,const Image& rImg2, SvLBoxButtonKind eButtonKind) @@ -3210,16 +3152,13 @@ void SwContentTree::InitEntry(SvLBoxEntry* pEntry, SwContentLBoxString* pStr = new SwContentLBoxString( pEntry, 0, pCol->GetText() ); pEntry->ReplaceItem( pStr, nColToHilite ); } -/* -----------------------------09.12.99 13:49-------------------------------- - ---------------------------------------------------------------------------*/ void SwContentLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry ) { if(lcl_IsContent(pEntry) && ((SwContent *)pEntry->GetUserData())->IsInvisible()) { - //* pCont = (SwContent*)pEntry->GetUserData(); Font aOldFont( rDev.GetFont()); Font aFont(aOldFont); Color aCol( COL_LIGHTGRAY ); @@ -3231,20 +3170,17 @@ void SwContentLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFl else SvLBoxString::Paint( rPos, rDev, nFlags, pEntry); } -/* -----------------------------06.05.2002 10:20------------------------------ - ---------------------------------------------------------------------------*/ void SwContentTree::DataChanged( const DataChangedEvent& rDCEvt ) { if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - sal_uInt16 nResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP; - aEntryImages = ImageList(SW_RES(nResId)); + aEntryImages = ImageList(SW_RES(IMG_NAVI_ENTRYBMP)); FindActiveTypeAndRemoveUserData(); Display(sal_True); } SvTreeListBox::DataChanged( rDCEvt ); } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx index 3602f20932..8c2fdfd13c 100644 --- a/sw/source/ui/utlui/glbltree.cxx +++ b/sw/source/ui/utlui/glbltree.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -51,7 +52,6 @@ #include <swmodule.hxx> #include <wrtsh.hxx> #include <view.hxx> -#include <errhdl.hxx> #include <docsh.hxx> #include <content.hxx> #include <edglbldc.hxx> @@ -66,26 +66,17 @@ #include <cmdid.h> #include <helpid.h> -#ifndef _NAVIPI_HRC #include <navipi.hrc> -#endif -#ifndef _UTLUI_HRC #include <utlui.hrc> -#endif -#ifndef _COMCORE_HRC #include <comcore.hrc> -#endif #include <globals.hrc> #include "swabstdlg.hxx" using namespace ::com::sun::star::uno; using ::rtl::OUString; - // Kontextmenue fuer GlobalTree #define CTX_INSERT_ANY_INDEX 10 -//#define CTX_INSERT_CNTIDX 11 -//#define CTX_INSERT_USRIDX 12 #define CTX_INSERT_FILE 11 #define CTX_INSERT_NEW_FILE 12 #define CTX_INSERT_TEXT 13 @@ -117,7 +108,7 @@ using ::rtl::OUString; #define GLBL_TABPOS_SUB 5 const SfxObjectShell* SwGlobalTree::pShowShell = 0; -static const char* __FAR_DATA aHelpForMenu[] = +static const char* aHelpForMenu[] = { 0, // HID_GLBLTREE_UPDATE, //CTX_UPDATE @@ -145,12 +136,6 @@ static const char* __FAR_DATA aHelpForMenu[] = HID_GLBLTREEUPD_ALL //CTX_UPDATE_ALL }; -/************************************************************************/ -/* */ -/************************************************************************/ -/* -----------------------------24.08.00 12:04-------------------------------- - - ---------------------------------------------------------------------------*/ class SwGlobalFrameListener_Impl : public SfxListener { sal_Bool bValid; @@ -165,9 +150,7 @@ public: sal_Bool IsValid() const {return bValid;} }; -/* -----------------------------24.08.00 12:05-------------------------------- - ---------------------------------------------------------------------------*/ void SwGlobalFrameListener_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { if( rHint.ISA(SfxSimpleHint) && @@ -175,9 +158,6 @@ void SwGlobalFrameListener_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHi bValid = sal_False; } -/*-----------------12.06.97 09:38------------------- - ---------------------------------------------------*/ SwGlobalTree::SwGlobalTree(Window* pParent, const ResId& rResId) : SvTreeListBox(pParent, rResId), @@ -212,18 +192,12 @@ SwGlobalTree::SwGlobalTree(Window* pParent, const ResId& rResId) : EnableContextMenuHandling(); } -/*-----------------12.06.97 09:38------------------- - ---------------------------------------------------*/ SwGlobalTree::~SwGlobalTree() { delete pSwGlblDocContents; delete pDocInserter; } -/*-----------------12.06.97 09:38------------------- - ---------------------------------------------------*/ sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) { sal_Int8 nRet = DND_ACTION_NONE; @@ -303,9 +277,7 @@ sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) return nRet; } -/*-----------------12.06.97 09:38------------------- ---------------------------------------------------*/ sal_Int8 SwGlobalTree::AcceptDrop( const AcceptDropEvent& rEvt ) { sal_Int8 nRet = rEvt.mnAction; @@ -364,9 +336,7 @@ sal_Int8 SwGlobalTree::AcceptDrop( const AcceptDropEvent& rEvt ) } return nRet; } -/*-----------------12.06.97 09:38------------------- ---------------------------------------------------*/ PopupMenu* SwGlobalTree::CreateContextMenu() { PopupMenu* pPop = 0; @@ -427,9 +397,7 @@ PopupMenu* SwGlobalTree::CreateContextMenu() } return pPop; } -/*-----------------16.06.97 10:41------------------- ---------------------------------------------------*/ void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox) { sal_uInt16 nEnableFlags = GetEnableFlags(); @@ -442,8 +410,6 @@ void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox) pMenu->SetHelpId(i, aHelpForMenu[i] ); } pMenu->EnableItem(CTX_INSERT_ANY_INDEX, 0 != (nEnableFlags & ENABLE_INSERT_IDX )); -// pMenu->EnableItem(CTX_INSERT_CNTIDX, 0 != (nEnableFlags & ENABLE_INSERT_IDX )); -// pMenu->EnableItem(CTX_INSERT_USRIDX, 0 != (nEnableFlags & ENABLE_INSERT_IDX )); pMenu->EnableItem(CTX_INSERT_TEXT, 0 != (nEnableFlags & ENABLE_INSERT_TEXT)); pMenu->EnableItem(CTX_INSERT_FILE, 0 != (nEnableFlags & ENABLE_INSERT_FILE)); pMenu->EnableItem(CTX_INSERT_NEW_FILE, 0 != (nEnableFlags & ENABLE_INSERT_FILE)); @@ -469,9 +435,7 @@ void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox) pBox->Invalidate(); } } -/*-----------------16.06.97 11:02------------------- ---------------------------------------------------*/ sal_uInt16 SwGlobalTree::GetEnableFlags() const { SvLBoxEntry* pEntry = FirstSelected(); @@ -502,9 +466,6 @@ sal_uInt16 SwGlobalTree::GetEnableFlags() const return nRet; } -/*-----------------12.06.97 09:38------------------- - ---------------------------------------------------*/ void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt ) { sal_Bool bParent = sal_True; @@ -552,9 +513,7 @@ void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt ) if(bParent) SvTreeListBox::RequestHelp(rHEvt); } -/*-----------------16.06.97 16:15------------------- ---------------------------------------------------*/ void SwGlobalTree::SelectHdl() { @@ -573,17 +532,12 @@ void SwGlobalTree::SelectHdl() nSelCount == 1 && nAbsPos < ((sal_uInt16)GetEntryCount()) - 1 && !bReadonly); } -/*-----------------16.06.97 16:15------------------- ---------------------------------------------------*/ void SwGlobalTree::DeselectHdl() { SelectHdl(); } -/*-----------------17.06.97 13:11------------------- - ---------------------------------------------------*/ DragDropMode SwGlobalTree::NotifyStartDrag( TransferDataContainer& , SvLBoxEntry* pEntry ) { @@ -592,17 +546,11 @@ DragDropMode SwGlobalTree::NotifyStartDrag( TransferDataContainer& , return SV_DRAGDROP_CTRL_MOVE; } -/*-----------------21.06.97 12:44------------------- - ---------------------------------------------------*/ long SwGlobalTree::GetTabPos( SvLBoxEntry*, SvLBoxTab* pTab) { return pTab->GetPos() - GLBL_TABPOS_SUB; } -/*-----------------12.06.97 09:38------------------- - ---------------------------------------------------*/ sal_Bool SwGlobalTree::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pSource, SvLBoxEntry*&, @@ -619,9 +567,7 @@ sal_Bool SwGlobalTree::NotifyMoving( SvLBoxEntry* pTarget, Display(); return sal_False; } -/*-----------------12.06.97 09:39------------------- ---------------------------------------------------*/ sal_Bool SwGlobalTree::NotifyCopying( SvLBoxEntry* /*pTarget*/, SvLBoxEntry* /*pEntry*/, SvLBoxEntry*& /*rpNewParent*/, @@ -630,24 +576,18 @@ sal_Bool SwGlobalTree::NotifyCopying( SvLBoxEntry* /*pTarget*/, { return sal_False; } -/*-----------------12.06.97 09:39------------------- ---------------------------------------------------*/ sal_Bool SwGlobalTree::NotifyAcceptDrop( SvLBoxEntry* pEntry) { return pEntry != 0; } -/*-----------------12.06.97 09:39------------------- ---------------------------------------------------*/ void SwGlobalTree::StartDrag( sal_Int8 nAction, const Point& rPt ) { if( 1 == GetSelectionCount() ) SvTreeListBox::StartDrag( nAction, rPt ); } -/*-----------------12.06.97 09:39------------------- ---------------------------------------------------*/ void SwGlobalTree::DragFinished( sal_Int8 nAction ) { SvTreeListBox::DragFinished( nAction ); @@ -668,9 +608,6 @@ void SwGlobalTree::MouseButtonDown( const MouseEvent& rMEvt ) SvTreeListBox::MouseButtonDown( rMEvt ); } -/*-----------------12.06.97 13:08------------------- - ---------------------------------------------------*/ void SwGlobalTree::GetFocus() { if(Update( sal_False )) @@ -678,9 +615,6 @@ void SwGlobalTree::GetFocus() SvTreeListBox::GetFocus(); } -/*-----------------12.06.97 12:34------------------- - ---------------------------------------------------*/ void SwGlobalTree::KeyInput(const KeyEvent& rKEvt) { const KeyCode aCode = rKEvt.GetKeyCode(); @@ -698,23 +632,17 @@ void SwGlobalTree::KeyInput(const KeyEvent& rKEvt) SvTreeListBox::KeyInput(rKEvt); } -/*-----------------17.06.97 11:59------------------- - ---------------------------------------------------*/ void SwGlobalTree::Clear() { pEmphasisEntry = 0; SvTreeListBox::Clear(); } -/*-----------------12.06.97 12:38------------------- ---------------------------------------------------*/ void SwGlobalTree::Display(sal_Bool bOnlyUpdateUserData) { if(!bIsImageListInitialized) { - sal_uInt16 nResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP; - aEntryImages = ImageList(SW_RES(nResId)); + aEntryImages = ImageList(SW_RES(IMG_NAVI_ENTRYBMP)); bIsImageListInitialized = sal_True; } sal_uInt16 nCount = pSwGlblDocContents->Count(); @@ -795,9 +723,6 @@ void SwGlobalTree::Display(sal_Bool bOnlyUpdateUserData) } } -/*-----------------13.06.97 10:32------------------- - ---------------------------------------------------*/ void SwGlobalTree::InsertRegion( const SwGlblDocContent* pCont, const String* pFileName ) { Sequence< OUString > aFileNames; @@ -820,9 +745,6 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* pCont, const String* pF } } -/*-----------------18.06.97 12:42------------------- - ---------------------------------------------------*/ void SwGlobalTree::EditContent(const SwGlblDocContent* pCont ) { sal_uInt16 nSlot = 0; @@ -857,21 +779,14 @@ void SwGlobalTree::EditContent(const SwGlblDocContent* pCont ) } } -/*-----------------13.06.97 14:22------------------- - ---------------------------------------------------*/ IMPL_LINK( SwGlobalTree, PopupHdl, Menu* , pMenu) { ExcecuteContextMenuAction( pMenu->GetCurItemId()); return sal_True; } -/* -----------------26.08.2003 11:57----------------- - --------------------------------------------------*/ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) -//IMPL_LINK( SwGlobalTree, PopupHdl, Menu* , pMenu) { -// sal_uInt16 nId = pMenu->GetCurItemId(); SvLBoxEntry* pEntry = FirstSelected(); SwGlblDocContent* pCont = pEntry ? (SwGlblDocContent*)pEntry->GetUserData() : 0; // wird waehrend des Dialogs ein RequestHelp gerufen, @@ -928,13 +843,13 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry break; case CTX_EDIT: { - DBG_ASSERT(pCont, "Edit ohne Entry ? " ); + OSL_ENSURE(pCont, "edit without entry ? " ); EditContent(pCont); } break; case CTX_EDIT_LINK: { - DBG_ASSERT(pCont, "Edit ohne Entry ? " ); + OSL_ENSURE(pCont, "edit without entry ? " ); SfxStringItem aName(FN_EDIT_REGION, pCont->GetSection()->GetSectionName()); rDispatch.Execute(FN_EDIT_REGION, SFX_CALLMODE_ASYNCHRON, &aName, 0L); @@ -966,8 +881,6 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry } break; case CTX_INSERT_ANY_INDEX: -// case CTX_INSERT_CNTIDX: -// case CTX_INSERT_USRIDX: { if(pContCopy) { @@ -981,14 +894,14 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry 0); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractMultiTOXTabDialog* pDlg = pFact->CreateMultiTOXTabDialog( DLG_MULTI_TOX, this, aSet, *pActiveShell, 0, USHRT_MAX, sal_True); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(RET_OK == pDlg->Execute()) { SwTOXDescription& rDesc = pDlg->GetTOXDescription( @@ -1101,12 +1014,8 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry delete pContCopy; else bDeleteContentCopy = true; -// return sal_True; } -/*-----------------16.06.97 07:57------------------- - ---------------------------------------------------*/ IMPL_LINK( SwGlobalTree, Timeout, Timer*, EMPTYARG ) { if(!HasFocus() && Update( sal_False )) @@ -1114,9 +1023,6 @@ IMPL_LINK( SwGlobalTree, Timeout, Timer*, EMPTYARG ) return 0; } -/*-----------------13.06.97 16:56------------------- - ---------------------------------------------------*/ void SwGlobalTree::GotoContent(const SwGlblDocContent* pCont) { pActiveShell->EnterStdMode(); @@ -1138,29 +1044,23 @@ void SwGlobalTree::GotoContent(const SwGlblDocContent* pCont) } } -/*-----------------16.06.97 07:42------------------- ---------------------------------------------------*/ void SwGlobalTree::ShowTree() { aUpdateTimer.Start(); SvTreeListBox::Show(); } -/*-----------------16.06.97 07:42------------------- ---------------------------------------------------*/ void SwGlobalTree::HideTree() { aUpdateTimer.Stop(); SvTreeListBox::Hide(); } -/*-----------------18.06.97 10:02------------------- ---------------------------------------------------*/ void SwGlobalTree::ExecCommand(sal_uInt16 nCmd) { SvLBoxEntry* pEntry = FirstSelected(); - DBG_ASSERT(pEntry, "gleich knallt's"); + OSL_ENSURE(pEntry, "gleich knallt's"); if(FN_GLOBAL_EDIT == nCmd) { const SwGlblDocContent* pCont = (const SwGlblDocContent*) @@ -1199,9 +1099,6 @@ void SwGlobalTree::ExecCommand(sal_uInt16 nCmd) } } -/*-----------------16.06.97 07:43------------------- - ---------------------------------------------------*/ sal_Bool SwGlobalTree::Update(sal_Bool bHard) { SwView* pActView = GetParentWindow()->GetCreateView(); @@ -1284,9 +1181,6 @@ sal_Bool SwGlobalTree::Update(sal_Bool bHard) return bRet; } -/*-----------------25.06.97 16:20------------------- - ---------------------------------------------------*/ void SwGlobalTree::OpenDoc(const SwGlblDocContent* pCont) { String sFileName(pCont->GetSection()->GetLinkFileName().GetToken(0, @@ -1320,9 +1214,6 @@ void SwGlobalTree::OpenDoc(const SwGlblDocContent* pCont) } } -/*-----------------25.06.97 16:08------------------- - ---------------------------------------------------*/ IMPL_LINK( SwGlobalTree, DoubleClickHdl, SwGlobalTree *, EMPTYARG ) { SvLBoxEntry* pEntry = GetCurEntry(); @@ -1337,9 +1228,6 @@ IMPL_LINK( SwGlobalTree, DoubleClickHdl, SwGlobalTree *, EMPTYARG ) return 0; } -/*-----------------07.10.97 08:09------------------- - ---------------------------------------------------*/ IMPL_STATIC_LINK_NOINSTANCE(SwGlobalTree, ShowFrameHdl, SwGlobalTree*, EMPTYARG) { if(SwGlobalTree::GetShowShell()) @@ -1347,9 +1235,7 @@ IMPL_STATIC_LINK_NOINSTANCE(SwGlobalTree, ShowFrameHdl, SwGlobalTree*, EMPTYARG) SwGlobalTree::SetShowShell(0); return 0; } -/* -----------------04.11.98 10:43------------------- - * - * --------------------------------------------------*/ + void SwGlobalTree::InitEntry(SvLBoxEntry* pEntry, const XubString& rStr ,const Image& rImg1,const Image& rImg2, SvLBoxButtonKind eButtonKind) @@ -1360,17 +1246,13 @@ void SwGlobalTree::InitEntry(SvLBoxEntry* pEntry, SwLBoxString* pStr = new SwLBoxString( pEntry, 0, pCol->GetText() ); pEntry->ReplaceItem( pStr, nColToHilite ); } -/* -----------------04.11.98 10:39------------------- - * - * --------------------------------------------------*/ void SwLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry ) { SwGlblDocContent* pCont = (SwGlblDocContent*)pEntry->GetUserData(); - const SwSection* pSect; if(pCont->GetType() == GLBLDOC_SECTION && - !(pSect = pCont->GetSection())->IsConnectFlag() ) + !(pCont->GetSection())->IsConnectFlag() ) { Font aOldFont( rDev.GetFont()); Font aFont(aOldFont); @@ -1383,16 +1265,13 @@ void SwLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, else SvLBoxString::Paint( rPos, rDev, nFlags, pEntry); } -/* -----------------------------06.05.2002 10:20------------------------------ - ---------------------------------------------------------------------------*/ void SwGlobalTree::DataChanged( const DataChangedEvent& rDCEvt ) { if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - sal_uInt16 nResId = GetSettings().GetStyleSettings().GetHighContrastMode() ? IMG_NAVI_ENTRYBMPH : IMG_NAVI_ENTRYBMP; - aEntryImages = ImageList(SW_RES(nResId)); + aEntryImages = ImageList(SW_RES(IMG_NAVI_ENTRYBMP)); Update(sal_True); } SvTreeListBox::DataChanged( rDCEvt ); @@ -1435,7 +1314,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen //update the global document content after each inserted document rSh.GetGlobalDocContent(aTempContents); SwGlblDocContent* pAnchorContent = 0; - DBG_ASSERT(aTempContents.Count() > (nAnchorContent + nFile), "invalid anchor content -> last insertion failed"); + OSL_ENSURE(aTempContents.Count() > (nAnchorContent + nFile), "invalid anchor content -> last insertion failed"); if ( aTempContents.Count() > (nAnchorContent + nFile) ) pAnchorContent = aTempContents.GetObject(nAnchorContent + (sal_uInt16)nFile); else @@ -1500,18 +1379,17 @@ IMPL_LINK( SwGlobalTree, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg ) SfxMediumList* pMedList = pDocInserter->CreateMediumList(); if ( pMedList ) { - Sequence< OUString >aFileNames( pMedList->Count() ); + Sequence< OUString >aFileNames( pMedList->size() ); OUString* pFileNames = aFileNames.getArray(); - SfxMedium* pMed = pMedList->First(); sal_Int32 nPos = 0; - while ( pMed ) + for ( size_t i = 0, n = pMedList->size(); i < n; ++i ) { + SfxMedium* pMed = pMedList->at( i ); String sFileName = pMed->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); sFileName += sfx2::cTokenSeperator; sFileName += pMed->GetFilter()->GetFilterName(); sFileName += sfx2::cTokenSeperator; pFileNames[nPos++] = sFileName; - pMed = pMedList->Next(); } delete pMedList; InsertRegion( pDocContent, aFileNames ); @@ -1521,3 +1399,4 @@ IMPL_LINK( SwGlobalTree, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/gloslst.cxx b/sw/source/ui/utlui/gloslst.cxx index bc6af5ab96..bf1ec6d9c7 100644 --- a/sw/source/ui/utlui/gloslst.cxx +++ b/sw/source/ui/utlui/gloslst.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,16 +38,10 @@ #include <tools/urlobj.hxx> #include <vcl/dialog.hxx> #include <vcl/msgbox.hxx> -#ifndef _SV_BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif #include <vcl/lstbox.hxx> -#ifndef SVTOOLS_FSTATHELPER_HXX #include <svl/fstathelper.hxx> -#endif #include <unotools/pathoptions.hxx> #include <unotools/transliterationwrapper.hxx> #include <swtypes.hxx> @@ -57,12 +52,8 @@ #include <gloslst.hxx> #include <swunohelper.hxx> -#ifndef _UTLUI_HRC #include <utlui.hrc> -#endif -#ifndef _GLOSLST_HRC #include <gloslst.hrc> -#endif #define STRING_DELIM (char)0x0A @@ -97,10 +88,6 @@ class SwGlossDecideDlg : public ModalDialog ListBox& GetListBox() {return aListLB;} }; -/*-----------------21.01.97 13.25------------------- - ---------------------------------------------------*/ - SwGlossDecideDlg::SwGlossDecideDlg(Window* pParent) : ModalDialog(pParent, SW_RES(DLG_GLOSSARY_DECIDE_DLG)), aOk(this, SW_RES(PB_OK)), @@ -114,18 +101,11 @@ SwGlossDecideDlg::SwGlossDecideDlg(Window* pParent) : aListLB.SetSelectHdl(LINK(this, SwGlossDecideDlg, SelectHdl)); } -/*-----------------21.01.97 13.25------------------- - ---------------------------------------------------*/ - IMPL_LINK(SwGlossDecideDlg, DoubleClickHdl, ListBox*, EMPTYARG) { EndDialog(RET_OK); return 0; } -/*-----------------21.01.97 13.29------------------- - ---------------------------------------------------*/ IMPL_LINK(SwGlossDecideDlg, SelectHdl, ListBox*, EMPTYARG) { @@ -246,7 +226,7 @@ sal_uInt16 SwGlossaryList::GetGroupCount() String SwGlossaryList::GetGroupName(sal_uInt16 nPos, sal_Bool bNoPath, String* pTitle) { - DBG_ASSERT(aGroupArr.Count() > nPos, "Gruppe nicht vorhanden"); + OSL_ENSURE(aGroupArr.Count() > nPos, "group not available"); String sRet(aEmptyStr); if(nPos < aGroupArr.Count()) { @@ -268,7 +248,7 @@ String SwGlossaryList::GetGroupName(sal_uInt16 nPos, sal_Bool bNoPath, String* p sal_uInt16 SwGlossaryList::GetBlockCount(sal_uInt16 nGroup) { - DBG_ASSERT(aGroupArr.Count() > nGroup, "Gruppe nicht vorhanden"); + OSL_ENSURE(aGroupArr.Count() > nGroup, "group not available"); if(nGroup < aGroupArr.Count()) { AutoTextGroup* pGroup = aGroupArr.GetObject(nGroup); @@ -284,7 +264,7 @@ sal_uInt16 SwGlossaryList::GetBlockCount(sal_uInt16 nGroup) String SwGlossaryList::GetBlockName(sal_uInt16 nGroup, sal_uInt16 nBlock, String& rShortName) { - DBG_ASSERT(aGroupArr.Count() > nGroup, "Gruppe nicht vorhanden"); + OSL_ENSURE(aGroupArr.Count() > nGroup, "group not available"); if(nGroup < aGroupArr.Count()) { AutoTextGroup* pGroup = aGroupArr.GetObject(nGroup); @@ -512,3 +492,4 @@ void SwGlossaryList::ClearGroups() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx index ab4a47856d..5663af9604 100644 --- a/sw/source/ui/utlui/initui.cxx +++ b/sw/source/ui/utlui/initui.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,19 +39,11 @@ #include <glosdoc.hxx> #include <gloslst.hxx> -#ifndef _UTLUI_HRC #include <utlui.hrc> -#endif -#ifndef _INITUI_HRC #include <initui.hrc> -#endif -#ifndef _COMCORE_HRC #include <comcore.hrc> -#endif #include <authfld.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <unotools/syslocale.hxx> #include <unomid.h> @@ -205,11 +198,24 @@ ShellResource::~ShellResource() delete pAutoFmtNameLst, pAutoFmtNameLst = 0; } -String ShellResource::GetPageDescName( sal_uInt16 nNo, sal_Bool bIsFirst, sal_Bool bFollow ) +String ShellResource::GetPageDescName( sal_uInt16 nNo, PageNameMode eMode ) { - String sRet( bIsFirst ? sPageDescFirstName - : bFollow ? sPageDescFollowName - : sPageDescName ); + String sRet; + + switch (eMode) + { + case NORMAL_PAGE: + sRet = sPageDescName; + break; + break; + case FIRST_PAGE: + sRet = sPageDescFirstName; + break; + case FOLLOW_PAGE: + sRet = sPageDescFollowName; + break; + } + sRet.SearchAndReplaceAscii( "$(ARG1)", String::CreateFromInt32( nNo )); return sRet; } @@ -271,9 +277,7 @@ ImpAutoFmtNameListLoader::ImpAutoFmtNameListLoader( SvStringsDtor& rLst ) } FreeResource(); } -/* -----------------16.09.99 12:28------------------- - --------------------------------------------------*/ const String& SwAuthorityFieldType::GetAuthFieldName(ToxAuthorityField eType) { if(!pAuthFieldNameList) @@ -287,9 +291,7 @@ const String& SwAuthorityFieldType::GetAuthFieldName(ToxAuthorityField eType) } return *pAuthFieldNameList->GetObject( static_cast< sal_uInt16 >(eType) ); } -/* -----------------16.09.99 12:29------------------- - --------------------------------------------------*/ const String& SwAuthorityFieldType::GetAuthTypeName(ToxAuthorityType eType) { if(!pAuthFieldTypeList) @@ -305,3 +307,4 @@ const String& SwAuthorityFieldType::GetAuthTypeName(ToxAuthorityType eType) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/initui.src b/sw/source/ui/utlui/initui.src index 619b208f37..75cd672e98 100644 --- a/sw/source/ui/utlui/initui.src +++ b/sw/source/ui/utlui/initui.src @@ -62,7 +62,6 @@ Resource RID_SW_SHELLRES String STR_CALC_POW { Text [ en-US ] = "** Square function overflow **" ; - /* ### ACHTUNG: Neuer Text in Resource? ** �berlauf in Quadratfunktion ** : ** �berlauf in Quadratfunktion ** */ }; String STR_CALC_VARNFND { @@ -71,7 +70,6 @@ Resource RID_SW_SHELLRES String STR_CALC_OVERFLOW { Text [ en-US ] = "** Overflow **" ; - /* ### ACHTUNG: Neuer Text in Resource? ** �berlauf ** : ** �berlauf ** */ }; String STR_CALC_WRONGTIME { @@ -162,7 +160,6 @@ Resource RID_SW_SHELLRES }; String FLD_DOCINFO_KEYS { - /* ### ACHTUNG: Neuer Text in Resource? Schl�sselw�rter : Schl�sselw�rter */ Text [ en-US ] = "Keywords" ; }; String FLD_DOCINFO_COMMENT diff --git a/sw/source/ui/utlui/navicfg.cxx b/sw/source/ui/utlui/navicfg.cxx index 227b98abff..222cc0f57a 100644 --- a/sw/source/ui/utlui/navicfg.cxx +++ b/sw/source/ui/utlui/navicfg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,7 +33,7 @@ #include <swtypes.hxx> // fuer Pathfinder #include <navicfg.hxx> #include <swcont.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> @@ -42,9 +43,6 @@ using namespace ::utl; using namespace ::rtl; using namespace ::com::sun::star::uno; -/* -----------------------------08.09.00 16:30-------------------------------- - - ---------------------------------------------------------------------------*/ Sequence<OUString> SwNavigationConfig::GetPropertyNames() { static const char* aPropNames[] = @@ -66,9 +64,6 @@ Sequence<OUString> SwNavigationConfig::GetPropertyNames() } return aNames; } -/*-----------------13.11.96 11.03------------------- - ---------------------------------------------------*/ SwNavigationConfig::SwNavigationConfig() : utl::ConfigItem(C2U("Office.Writer/Navigator")), @@ -82,9 +77,8 @@ SwNavigationConfig::SwNavigationConfig() : { Sequence<OUString> aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); -// EnableNotification(aNames); const Any* pValues = aValues.getConstArray(); - DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); + OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { for(int nProp = 0; nProp < aNames.getLength(); nProp++) @@ -105,14 +99,11 @@ SwNavigationConfig::SwNavigationConfig() : } } } -/* -----------------------------08.09.00 16:35-------------------------------- - ---------------------------------------------------------------------------*/ SwNavigationConfig::~SwNavigationConfig() -{} -/* -----------------------------08.09.00 16:35-------------------------------- +{ +} - ---------------------------------------------------------------------------*/ void SwNavigationConfig::Commit() { Sequence<OUString> aNames = GetPropertyNames(); @@ -139,3 +130,4 @@ void SwNavigationConfig::Commit() void SwNavigationConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx index 74566081dc..eac367ce43 100644 --- a/sw/source/ui/utlui/navipi.cxx +++ b/sw/source/ui/utlui/navipi.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -28,12 +29,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - #define NAVIPI_CXX -#include <string> // HACK: prevent conflict between STLPORT and Workshop headers -#include <tools/list.hxx> +#include <string> #include <svl/urlbmk.hxx> #include <svl/stritem.hxx> #include <svtools/filter.hxx> @@ -46,16 +44,11 @@ #include <sfx2/dockwin.hxx> #include <vcl/toolbox.hxx> #include <swtypes.hxx> // fuer Pathfinder -#include <errhdl.hxx> #include <swmodule.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <navicfg.hxx> #include <wrtsh.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <actctrl.hxx> #include <IMark.hxx> #include <navipi.hxx> @@ -64,27 +57,16 @@ #include <section.hxx> #include <edtwin.hxx> #include <sfx2/app.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _RIBBAR_HRC #include <ribbar.hrc> -#endif -#ifndef _NAVIPI_HRC #include <navipi.hrc> -#endif -#ifndef _UTLUI_HRC #include <utlui.hrc> -#endif #include "access.hrc" #include <unomid.h> - #define PAGE_CHANGE_TIMEOUT 1000 //Timeout fuer Seitenwechsel #define JUMP_TYPE_TBL 0 @@ -299,7 +281,6 @@ IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox ) } } return sal_True; - //break; // Funktionen, die eine direkte Aktion ausloesen case FN_SELECT_FOOTER: @@ -415,9 +396,6 @@ IMPL_LINK( SwNavigationPI, ToolBoxClickHdl, ToolBox *, pBox ) return sal_True; } -/*-----------------13.07.04 ------------------- - ----------------------------------------------*/ - IMPL_LINK( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox ) { const sal_uInt16 nCurrItemId = pBox->GetCurItemId(); @@ -479,15 +457,11 @@ IMPL_LINK( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox ) return sal_True; } -/*-----------------13.07.04 ------------------- ---------------------------------------------------*/ SwNavHelpToolBox::SwNavHelpToolBox(SwNavigationPI* pParent, const ResId &rResId) : SwHelpToolBox(pParent, rResId) {} -/*-----------------19.06.97 09:09------------------- ---------------------------------------------------*/ void SwNavHelpToolBox::MouseButtonDown(const MouseEvent &rEvt) { if(rEvt.GetButtons() == MOUSE_LEFT && @@ -498,18 +472,13 @@ void SwNavHelpToolBox::MouseButtonDown(const MouseEvent &rEvt) else SwHelpToolBox::MouseButtonDown(rEvt); } -/* -----------------------------12.03.2002 16:55------------------------------ - ---------------------------------------------------------------------------*/ void SwNavigationPI::CreateNavigationTool(const Rectangle& rRect, sal_Bool bSetFocus) { -// SfxBindings& rBind = GetCreateView()->GetViewFrame()->GetBindings(); -// rBind.ENTERREGISTRATIONS(); Reference< XFrame > xFrame = GetCreateView()->GetViewFrame()->GetFrame().GetFrameInterface(); SwScrollNaviPopup* pPopup = new SwScrollNaviPopup(FN_SCROLL_NAVIGATION, xFrame ); -// rBind.LEAVEREGISTRATIONS(); Rectangle aRect(rRect); Point aT1 = aRect.TopLeft(); @@ -524,9 +493,6 @@ void SwNavigationPI::CreateNavigationTool(const Rectangle& rRect, sal_Bool bSetF } } -/*-----------------19.06.97 10:12------------------- - ---------------------------------------------------*/ void SwNavHelpToolBox::RequestHelp( const HelpEvent& rHEvt ) { sal_uInt16 nItemId = GetItemId(ScreenToOutputPixel(rHEvt.GetMousePosPixel())); @@ -576,10 +542,6 @@ IMPL_LINK( SwNavigationPI, EditGetFocus, NumEditAction *, pEdit ) return 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - sal_Bool SwNavigationPI::Close() { SfxViewFrame* pVFrame = pCreateView->GetViewFrame(); @@ -614,7 +576,7 @@ void SwNavigationPI::MakeMark() // this assumes that IDocumentMarkAccess generates Names in ascending order if(vNavMarkNames.size() == MAX_MARKS) pMarkAccess->deleteMark(pMarkAccess->findMark(vNavMarkNames[nAutoMarkIdx])); - + rSh.SetBookmark(KeyCode(), ::rtl::OUString(), ::rtl::OUString(), IDocumentMarkAccess::NAVIGATOR_REMINDER); SwView::SetActMark( nAutoMarkIdx ); @@ -622,10 +584,6 @@ void SwNavigationPI::MakeMark() nAutoMarkIdx = 0; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwNavigationPI::GotoPage() { if ( pContextWin->GetFloatingWindow() && pContextWin->GetFloatingWindow()->IsRollUp()) @@ -636,10 +594,6 @@ void SwNavigationPI::GotoPage() GetPageEdit().GrabFocus(); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwNavigationPI::_ZoomOut() { if (_IsZoomedIn()) @@ -670,10 +624,6 @@ void SwNavigationPI::_ZoomOut() } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwNavigationPI::_ZoomIn() { FloatingWindow* pFloat = pContextWin->GetFloatingWindow(); @@ -700,9 +650,6 @@ void SwNavigationPI::_ZoomIn() aContentToolBox.CheckItem(FN_SHOW_CONTENT_BOX, sal_False); } } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ void SwNavigationPI::Resize() { @@ -752,11 +699,6 @@ void SwNavigationPI::Resize() } } - -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, SfxChildWindowContext* pCw, Window* pParent) : @@ -767,7 +709,6 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, aContentToolBox(this, SW_RES(TB_CONTENT)), aGlobalToolBox(this, SW_RES(TB_GLOBAL)), aContentImageList(SW_RES(IL_CONTENT)), - aContentImageListH(SW_RES(ILH_CONTENT)), aContentTree(this, SW_RES(TL_CONTENT)), aGlobalTree(this, SW_RES(TL_GLOBAL)), aDocListBox(this, SW_RES(LB_DOCS)), @@ -813,8 +754,6 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, pEdit->SetAccessibleName(pEdit->GetQuickHelpText()); bPageCtrlsVisible = sal_True; -// Rectangle aFirstRect = aContentToolBox.GetItemRect(FN_SHOW_ROOT); -// sal_uInt16 nWidth = 2 * (sal_uInt16)aFirstRect.Left(); //doppelte Separatoren sind nicht erlaubt, also muss //die passende Groesse anders ermittelt werden Rectangle aFirstRect = aContentToolBox.GetItemRect(FN_SELECT_FOOTNOTE); @@ -861,7 +800,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, if( ( aTmpParentSize.Width() < aMinSize.Width() || - aTmpParentSize.Height() < aMinSize.Height() + aTmpParentSize.Height() < aMinSize.Height() ) && ((SfxDockingWindow*)pParent)->GetFloatingWindow() && @@ -941,10 +880,6 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, aDocListBox.SetAccessibleName(aStatusArr[3]); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwNavigationPI::~SwNavigationPI() { if(IsGlobalDoc() && !IsGlobalMode()) @@ -975,10 +910,6 @@ SwNavigationPI::~SwNavigationPI() rBindings.Release(*this); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwNavigationPI::SetPopupWindow( SfxPopupWindow* pWindow ) { pPopupWindow = pWindow; @@ -986,10 +917,6 @@ void SwNavigationPI::SetPopupWindow( SfxPopupWindow* pWindow ) pPopupWindow->SetDeleteLink_Impl( LINK( this, SwNavigationPI, ClosePopupWindow )); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK( SwNavigationPI, PopupModeEndHdl, void *, EMPTYARG ) { if ( pPopupWindow->IsVisible() ) @@ -1010,10 +937,6 @@ IMPL_LINK( SwNavigationPI, PopupModeEndHdl, void *, EMPTYARG ) return 1; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK( SwNavigationPI, ClosePopupWindow, SfxPopupWindow *, pWindow ) { if ( pWindow == pFloatingWindow ) @@ -1024,10 +947,6 @@ IMPL_LINK( SwNavigationPI, ClosePopupWindow, SfxPopupWindow *, pWindow ) return 1; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwNavigationPI::StateChanged( sal_uInt16 nSID, SfxItemState /*eState*/, const SfxPoolItem* /*pState*/ ) { @@ -1067,10 +986,6 @@ NumEditAction& SwNavigationPI::GetPageEdit() return *(NumEditAction*)aContentToolBox.GetItemWindow(FN_PAGENUMBER); } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SfxChildAlignment SwNavigationPI::CheckAlignment ( SfxChildAlignment eActAlign, @@ -1155,10 +1070,6 @@ void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( SwNavigationPI, MenuSelectHdl, Menu *, pMenu ) { sal_uInt16 nMenuId = pMenu->GetCurItemId(); @@ -1172,11 +1083,6 @@ IMPL_LINK( SwNavigationPI, MenuSelectHdl, Menu *, pMenu ) return 0; } - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void SwNavigationPI::UpdateListBox() { aDocListBox.SetUpdateMode(sal_False); @@ -1194,7 +1100,7 @@ void SwNavigationPI::UpdateListBox() while (pView) { SfxObjectShell* pDoc = pView->GetDocShell(); - // pb: #i53333# don't show help pages here + // #i53333# don't show help pages here if ( !pDoc->IsHelpDocument() ) { String sEntry = pDoc->GetTitle(); @@ -1247,14 +1153,6 @@ void SwNavigationPI::UpdateListBox() aDocListBox.SetUpdateMode(sal_True); } -/*-----------------16.06.97 15:05------------------- - ---------------------------------------------------*/ - -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem *, pItem) { const SfxViewFrameItem* pFrameItem = PTR_CAST(SfxViewFrameItem, pItem ); @@ -1265,7 +1163,7 @@ IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem *, pItem) { aContentTree.Clear(); pContentView = PTR_CAST(SwView, pFrame->GetViewShell()); - DBG_ASSERT(pContentView, "keine SwView"); + OSL_ENSURE(pContentView, "no SwView"); if(pContentView) pContentWrtShell = pContentView->GetWrtShellPtr(); else @@ -1309,10 +1207,6 @@ String SwNavigationPI::CreateDropFileName( TransferableDataHelper& rData ) return sFileName; } -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - sal_Int8 SwNavigationPI::AcceptDrop( const AcceptDropEvent& /*rEvt*/ ) { return ( !aContentTree.IsInDrag() && @@ -1366,10 +1260,6 @@ sal_Int8 SwNavigationPI::ExecuteDrop( const ExecuteDropEvent& rEvt ) return nRet; } -/*-----------------27.11.96 13.00------------------- - ---------------------------------------------------*/ - void SwNavigationPI::SetRegionDropMode(sal_uInt16 nNewMode) { nRegionMode = nNewMode; @@ -1381,18 +1271,12 @@ void SwNavigationPI::SetRegionDropMode(sal_uInt16 nNewMode) else if(nRegionMode == REGION_MODE_EMBEDDED) nDropId = FN_DROP_REGION_COPY; - ImageList& rImgLst = aContentToolBox.GetSettings().GetStyleSettings().GetHighContrastMode() - ? aContentImageListH : aContentImageList; + ImageList& rImgLst = aContentImageList; - aContentToolBox.SetItemImage( FN_DROP_REGION, - rImgLst.GetImage(nDropId)); + aContentToolBox.SetItemImage( FN_DROP_REGION, rImgLst.GetImage(nDropId)); } -/*-----------------12.06.97 09:47------------------- - ---------------------------------------------------*/ - sal_Bool SwNavigationPI::ToggleTree() { sal_Bool bRet = sal_True; @@ -1426,9 +1310,6 @@ sal_Bool SwNavigationPI::ToggleTree() return bRet; } -/*-----------------13.06.97 09:42------------------- - ---------------------------------------------------*/ sal_Bool SwNavigationPI::IsGlobalDoc() const { sal_Bool bRet = sal_False; @@ -1440,18 +1321,14 @@ sal_Bool SwNavigationPI::IsGlobalDoc() const } return bRet; } -/* -----------------26.10.98 08:10------------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwNavigationPI, ChangePageHdl, Timer*, EMPTYARG ) { EditAction(&GetPageEdit()); GetPageEdit().GrabFocus(); return 0; } -/* -----------------26.10.98 08:14------------------- - * - * --------------------------------------------------*/ + IMPL_LINK( SwNavigationPI, PageEditModifyHdl, Edit*, EMPTYARG ) { if(aPageChgTimer.IsActive()) @@ -1460,9 +1337,6 @@ IMPL_LINK( SwNavigationPI, PageEditModifyHdl, Edit*, EMPTYARG ) return 0; } -/* -----------------------------23.04.01 07:34-------------------------------- - - ---------------------------------------------------------------------------*/ SwView* SwNavigationPI::GetCreateView() const { if(!pCreateView) @@ -1482,11 +1356,6 @@ SwView* SwNavigationPI::GetCreateView() const return pCreateView; } - -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - SwNavigationChild::SwNavigationChild( Window* pParent, sal_uInt16 nId, SfxBindings* _pBindings, @@ -1514,9 +1383,7 @@ SwNavigationChild::SwNavigationChild( Window* pParent, pNavi->_ZoomIn(); } } -/* -----------------------------06.05.2002 10:06------------------------------ - ---------------------------------------------------------------------------*/ void SwNavigationPI::DataChanged( const DataChangedEvent& rDCEvt ) { Window::DataChanged( rDCEvt ); @@ -1530,15 +1397,12 @@ void SwNavigationPI::DataChanged( const DataChangedEvent& rDCEvt ) SetBackground( aBack ); } } -/* -----------------------------06.05.2002 10:07------------------------------ - ---------------------------------------------------------------------------*/ void SwNavigationPI::InitImageList() { sal_uInt16 k; - ImageList& rImgLst = aContentToolBox.GetSettings().GetStyleSettings().GetHighContrastMode() ? - aContentImageListH : aContentImageList; + ImageList& rImgLst = aContentImageList; for( k = 0; k < aContentToolBox.GetItemCount(); k++) aContentToolBox.SetItemImage(aContentToolBox.GetItemId(k), rImgLst.GetImage(aContentToolBox.GetItemId(k))); @@ -1556,3 +1420,4 @@ void SwNavigationPI::InitImageList() rImgLst.GetImage(nDropId)); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/navipi.hrc b/sw/source/ui/utlui/navipi.hrc index f7d1e1c329..fbf97d851e 100644 --- a/sw/source/ui/utlui/navipi.hrc +++ b/sw/source/ui/utlui/navipi.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -31,7 +31,6 @@ #define BT_UP 5 #define BT_DOWN 6 #define IL_CONTENT 7 -#define ILH_CONTENT 8 #define FT_PAGE 10 #define ED_PAGE 11 #define LB_SELECT 22 diff --git a/sw/source/ui/utlui/navipi.src b/sw/source/ui/utlui/navipi.src index ff2522d9bd..d0130b589e 100644 --- a/sw/source/ui/utlui/navipi.src +++ b/sw/source/ui/utlui/navipi.src @@ -92,12 +92,6 @@ Window DLG_NAVIGATION_PI MaskColor = IMAGE_MASK_COLOR ; NAVI_IDLIST }; - ImageList ILH_CONTENT - { - Prefix = "sch"; - MaskColor = IMAGE_MASK_COLOR ; - NAVI_IDLIST - }; Toolbox TB_CONTENT { Pos = MAP_PIXEL ( 5 , 5 ) ; @@ -123,7 +117,6 @@ Window DLG_NAVIGATION_PI Identifier = FN_UP ; // ItemBitmap = Bitmap { File = "navup.bmp"; }; HelpID = HID_NAVI_TBX2 ; - /* ### ACHTUNG: Neuer Text in Resource? R�ckw�rts : R�ckw�rts */ Text [ en-US ] = "Back" ; }; ToolBoxItem @@ -131,14 +124,12 @@ Window DLG_NAVIGATION_PI Identifier = FN_DOWN ; // ItemBitmap = Bitmap { File = "navdn.bmp"; }; HelpID = HID_NAVI_TBX3 ; - /* ### ACHTUNG: Neuer Text in Resource? Vorw�rts : Vorw�rts */ Text [ en-US ] = "Forward" ; }; ToolBoxItem { Identifier = FN_DROP_REGION ; HelpID = HID_NAVI_TBX4 ; - /* ### ACHTUNG: Neuer Text in Resource? Modus f�r Drag & Drop ausw�hlen : Modus f�r Drag & Drop ausw�hlen */ DropDown = TRUE ; Text [ en-US ] = "Drag Mode" ; }; @@ -204,9 +195,7 @@ Window DLG_NAVIGATION_PI Identifier = FN_SELECT_FOOTER ; // ItemBitmap = Bitmap { File = "navfoot.bmp"; }; HelpID = HID_NAVI_TBX11 ; - /* ### ACHTUNG: Neuer Text in Resource? Fu�zeile : Fu�zeile */ Text [ en-US ] = "Footer" ; - /* ### ACHTUNG: Neuer Text in Resource? Springen zur Fu�zeile : Springen zur Fu�zeile */ }; ToolBoxItem { @@ -214,7 +203,6 @@ Window DLG_NAVIGATION_PI // ItemBitmap = Bitmap { File = "navnote.bmp"; }; HelpID = HID_NAVI_TBX12 ; Text [ en-US ] = "Anchor<->Text" ; - /* ### ACHTUNG: Neuer Text in Resource? Springen zwischen Fu�notenankern und dem Fu�notentext : Springen zwischen Fu�notenankern und dem Fu�notentext */ }; ToolBoxItem { @@ -224,7 +212,6 @@ Window DLG_NAVIGATION_PI { Identifier = FN_OUTLINE_LEVEL ; HelpID = HID_NAVI_TBX13 ; - /* ### ACHTUNG: Neuer Text in Resource? Angezeigte �berschriftenebenen : Angezeigte �berschriftenebenen */ Text [ en-US ] = "Heading Levels Shown" ; DropDown = TRUE ; }; @@ -282,7 +269,6 @@ Window DLG_NAVIGATION_PI { Identifier = FN_GLOBAL_OPEN ; HelpID = HID_NAVI_TBX20 ; - /* ### ACHTUNG: Neuer Text in Resource? Einf�gen : Einf�gen */ Text [ en-US ] = "Insert" ; }; ToolBoxItem @@ -303,14 +289,12 @@ Window DLG_NAVIGATION_PI { Identifier = FN_ITEM_UP ; HelpID = HID_NAVI_TBX22 ; - /* ### ACHTUNG: Neuer Text in Resource? Nach oben verschieben : Nach unten verschieben */ Text [ en-US ] = "Move Up" ; }; ToolBoxItem { Identifier = FN_ITEM_DOWN ; HelpID = HID_NAVI_TBX23 ; - /* ### ACHTUNG: Neuer Text in Resource? Nach unten verschieben : Nach oben verschieben */ Text [ en-US ] = "Move Down" ; }; }; @@ -369,17 +353,14 @@ Window DLG_NAVIGATION_PI }; String ST_HYPERLINK { - /* ### ACHTUNG: Neuer Text in Resource? Als Hyperlink einf�gen : Als Hyperlink einf�gen */ Text [ en-US ] = "Insert as Hyperlink" ; }; String ST_LINK_REGION { - /* ### ACHTUNG: Neuer Text in Resource? Als Verkn�pfung einf�gen : Als Verkn�pfung einf�gen */ Text [ en-US ] = "Insert as Link" ; }; String ST_COPY_REGION { - /* ### ACHTUNG: Neuer Text in Resource? Als Kopie einf�gen : Als Kopie einf�gen */ Text [ en-US ] = "Insert as Copy" ; }; String ST_DISPLAY @@ -420,7 +401,6 @@ Window DLG_NAVIGATION_PI }; String ST_INSERT { - /* ### ACHTUNG: Neuer Text in Resource? Einf�gen : Einf�gen */ Text [ en-US ] = "Insert" ; }; String ST_INDEX @@ -441,7 +421,6 @@ Window DLG_NAVIGATION_PI }; String ST_DELETE { - /* ### ACHTUNG: Neuer Text in Resource? L�schen : L�schen */ Text [ en-US ] = "Delete" ; }; String ST_DELETE_ENTRY @@ -458,7 +437,6 @@ Window DLG_NAVIGATION_PI }; String ST_UPDATE_LINK { - /* ### ACHTUNG: Neuer Text in Resource? Verkn�pfungen : Verkn�pfungen */ Text [ en-US ] = "Links" ; }; String ST_UPDATE_ALL @@ -520,8 +498,6 @@ Window DLG_NAVIGATION_PI }; \ IdCount = { 12 ; }; - - ImageList IMG_NAVI_ENTRYBMP { Prefix = "nc"; @@ -529,12 +505,6 @@ ImageList IMG_NAVI_ENTRYBMP NAVI_ENTRY_IDS }; -ImageList IMG_NAVI_ENTRYBMPH -{ - Prefix = "nch"; - MaskColor = IMAGE_MASK_COLOR ; - NAVI_ENTRY_IDS -}; //IAccessibility2 Implementation 2009----- String STR_ACCESS_TL_GLOBAL @@ -546,4 +516,3 @@ String STR_ACCESS_TL_CONTENT Text [ en-US ] = "Content View"; }; //-----IAccessibility2 Implementation 2009 - diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx index 5af7777ac4..65d84597b5 100644 --- a/sw/source/ui/utlui/numfmtlb.cxx +++ b/sw/source/ui/utlui/numfmtlb.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -86,10 +87,6 @@ NumFormatListBox::NumFormatListBox( Window* pWin, const ResId& rResId, Init(nFormatType, bUsrFmts); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - NumFormatListBox::NumFormatListBox( Window* pWin, SwView* pView, const ResId& rResId, short nFormatType, sal_uLong nDefFmt, sal_Bool bUsrFmts ) : @@ -106,10 +103,6 @@ NumFormatListBox::NumFormatListBox( Window* pWin, SwView* pView, Init(nFormatType, bUsrFmts); } -/* -----------------15.06.98 11:29------------------- - * - * --------------------------------------------------*/ - void NumFormatListBox::Init(short nFormatType, sal_Bool bUsrFmts) { SwView *pView = GetView(); @@ -131,18 +124,11 @@ void NumFormatListBox::Init(short nFormatType, sal_Bool bUsrFmts) SetSelectHdl(LINK(this, NumFormatListBox, SelectHdl)); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - NumFormatListBox::~NumFormatListBox() { if (pOwnFormatter) delete pOwnFormatter; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ SwView* NumFormatListBox::GetView() { @@ -151,10 +137,6 @@ SwView* NumFormatListBox::GetView() return ::GetActiveView(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void NumFormatListBox::SetFormatType(const short nFormatType) { if (nCurrFormatType == -1 || @@ -167,7 +149,7 @@ void NumFormatListBox::SetFormatType(const short nFormatType) else { SwView *pView = GetView(); - DBG_ASSERT(pView, "no view found"); + OSL_ENSURE(pView, "no view found"); if(!pView) return; SwWrtShell &rSh = pView->GetWrtShell(); @@ -237,7 +219,7 @@ void NumFormatListBox::SetFormatType(const short nFormatType) break; default: - DBG_ERROR("what a format?"); + OSL_ENSURE(false, "what a format?"); break; } @@ -298,10 +280,6 @@ void NumFormatListBox::SetFormatType(const short nFormatType) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt) { if (nDefFmt == ULONG_MAX) @@ -316,7 +294,7 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt) else { SwView *pView = GetView(); - DBG_ASSERT(pView, "no view found"); + OSL_ENSURE(pView, "no view found"); if(!pView) return; SwWrtShell &rSh = pView->GetWrtShell(); @@ -357,7 +335,6 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt) while ((sal_uLong)GetEntryData(nPos) == ULONG_MAX) nPos++; -// sal_uLong nSysNumFmt = pFormatter->GetFormatIndex( NF_NUMBER_SYSTEM, eCurLanguage); sal_uLong nSysShortDateFmt = pFormatter->GetFormatIndex( NF_DATE_SYSTEM_SHORT, eCurLanguage); sal_uLong nSysLongDateFmt = pFormatter->GetFormatIndex( NF_DATE_SYSTEM_LONG, eCurLanguage); @@ -391,10 +368,6 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt) nDefFormat = GetFormat(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_uLong NumFormatListBox::GetFormat() const { sal_uInt16 nPos = GetSelectEntryPos(); @@ -402,10 +375,6 @@ sal_uLong NumFormatListBox::GetFormat() const return (sal_uLong)GetEntryData(nPos); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox ) { sal_uInt16 nPos = pBox->GetSelectEntryPos(); @@ -441,12 +410,12 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox ) aCoreSet.Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ADD_AUTO, bUseAutomaticLanguage)); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( this, aCoreSet, GetView()->GetViewFrame()->GetFrame().GetFrameInterface(), RC_DLG_SWNUMFMTDLG ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if (RET_OK == pDlg->Execute()) { @@ -487,10 +456,6 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox ) return 0; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - double NumFormatListBox::GetDefValue(const short nFormatType) const { double fDefValue = 0.0; @@ -505,12 +470,6 @@ double NumFormatListBox::GetDefValue(const short nFormatType) const case NUMBERFORMAT_TIME: fDefValue = SVX_NUMVAL_TIME; break; -/* { - String sValue("31.8.1997 16:57:34"); - sal_uLong nFormat = pFormatter->GetStandardFormat(nFormatType, LANGUAGE_GERMAN); - pFormatter->IsNumberFormat( sValue, nFormat, fDefValue ); - } - break;*/ case NUMBERFORMAT_TEXT: case NUMBERFORMAT_UNDEFINED: @@ -537,13 +496,10 @@ double NumFormatListBox::GetDefValue(const short nFormatType) const return fDefValue; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void NumFormatListBox::Clear() { ListBox::Clear(); nCurrFormatType = -1; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/prcntfld.cxx b/sw/source/ui/utlui/prcntfld.cxx index d32bd78906..9ccb0f077a 100644 --- a/sw/source/ui/utlui/prcntfld.cxx +++ b/sw/source/ui/utlui/prcntfld.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,17 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -// include --------------------------------------------------------------- - - #include "prcntfld.hxx" -// STATIC DATA ----------------------------------------------------------- - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - PercentField::PercentField( Window* pWin, const ResId& rResId ) : MetricField ( pWin, rResId ), @@ -56,10 +48,6 @@ PercentField::PercentField( Window* pWin, const ResId& rResId ) : SetCustomUnitText('%'); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void PercentField::SetRefValue(sal_Int64 nValue) { sal_Int64 nRealValue = GetRealValue(eOldUnit); @@ -70,10 +58,6 @@ void PercentField::SetRefValue(sal_Int64 nValue) SetPrcntValue(nRealValue, eOldUnit); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void PercentField::ShowPercent(sal_Bool bPercent) { if ((bPercent && GetUnit() == FUNIT_CUSTOM) || @@ -98,7 +82,7 @@ void PercentField::ShowPercent(sal_Bool bPercent) SetDecimalDigits( 0 ); nAktWidth = ConvertValue(nOldMin, 0, nOldDigits, eOldUnit, FUNIT_TWIP); - // Um 0.5 Prozent aufrunden + // round to 0.5 percent nPercent = ((nAktWidth * 10) / nRefValue + 5) / 10; MetricField::SetMin(Max(static_cast< sal_Int64 >(1), nPercent)); @@ -115,7 +99,6 @@ void PercentField::ShowPercent(sal_Bool bPercent) } else MetricFormatter::SetValue(nLastPercent); -// SetValue(100, FUNIT_CUSTOM); } else { @@ -141,16 +124,11 @@ void PercentField::ShowPercent(sal_Bool bPercent) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ void PercentField::SetValue(sal_Int64 nNewValue, FieldUnit eInUnit) { MetricFormatter::SetValue(nNewValue, eInUnit); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ + void PercentField::SetPrcntValue(sal_Int64 nNewValue, FieldUnit eInUnit) { if (GetUnit() != FUNIT_CUSTOM || eInUnit == FUNIT_CUSTOM) @@ -174,10 +152,6 @@ void PercentField::SetPrcntValue(sal_Int64 nNewValue, FieldUnit eInUnit) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void PercentField::SetUserValue( sal_Int64 nNewValue, FieldUnit eInUnit ) { if (GetUnit() != FUNIT_CUSTOM || eInUnit == FUNIT_CUSTOM) @@ -202,10 +176,6 @@ void PercentField::SetUserValue( sal_Int64 nNewValue, FieldUnit eInUnit ) } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void PercentField::SetBaseValue(sal_Int64 nNewValue, FieldUnit eInUnit) { if (GetUnit() == FUNIT_CUSTOM) @@ -214,19 +184,11 @@ void PercentField::SetBaseValue(sal_Int64 nNewValue, FieldUnit eInUnit) MetricField::SetBaseValue(nNewValue, eInUnit); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Int64 PercentField::GetValue( FieldUnit eOutUnit ) { return Convert(MetricField::GetValue(), GetUnit(), eOutUnit); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void PercentField::SetMin(sal_Int64 nNewMin, FieldUnit eInUnit) { if (GetUnit() != FUNIT_CUSTOM) @@ -242,10 +204,6 @@ void PercentField::SetMin(sal_Int64 nNewMin, FieldUnit eInUnit) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - void PercentField::SetMax(sal_Int64 nNewMax, FieldUnit eInUnit) { if (GetUnit() != FUNIT_CUSTOM) @@ -254,14 +212,9 @@ void PercentField::SetMax(sal_Int64 nNewMax, FieldUnit eInUnit) { if (eInUnit == FUNIT_NONE) eInUnit = eOldUnit; -// SetRefValue(Convert(nNewMax, eInUnit, FUNIT_TWIP)); } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Int64 PercentField::NormalizePercent(sal_Int64 nValue) { if (GetUnit() != FUNIT_CUSTOM) @@ -272,10 +225,6 @@ sal_Int64 PercentField::NormalizePercent(sal_Int64 nValue) return nValue; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Int64 PercentField::DenormalizePercent(sal_Int64 nValue) { if (GetUnit() != FUNIT_CUSTOM) @@ -289,10 +238,6 @@ sal_Int64 PercentField::DenormalizePercent(sal_Int64 nValue) return nValue; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Bool PercentField::IsValueModified() { if (GetUnit() == FUNIT_CUSTOM) @@ -301,10 +246,6 @@ sal_Bool PercentField::IsValueModified() return MetricField::IsValueModified(); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Int64 PercentField::ImpPower10( sal_uInt16 n ) { sal_uInt16 i; @@ -316,10 +257,6 @@ sal_Int64 PercentField::ImpPower10( sal_uInt16 n ) return nValue; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Int64 PercentField::GetRealValue(FieldUnit eOutUnit) { if (GetUnit() != FUNIT_CUSTOM) @@ -328,10 +265,6 @@ sal_Int64 PercentField::GetRealValue(FieldUnit eOutUnit) return Convert(GetValue(), GetUnit(), eOutUnit); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - sal_Int64 PercentField::Convert(sal_Int64 nValue, FieldUnit eInUnit, FieldUnit eOutUnit) { if (eInUnit == eOutUnit || @@ -360,7 +293,7 @@ sal_Int64 PercentField::Convert(sal_Int64 nValue, FieldUnit eInUnit, FieldUnit e nAktWidth = nValue; else nAktWidth = ConvertValue(nValue, 0, nOldDigits, eInUnit, FUNIT_TWIP); - // Um 0.5 Prozent runden + // Round to 0.5 percent return ((nAktWidth * 1000) / nRefValue + 5) / 10; } @@ -368,3 +301,4 @@ sal_Int64 PercentField::Convert(sal_Int64 nValue, FieldUnit eInUnit, FieldUnit e } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/shdwcrsr.cxx b/sw/source/ui/utlui/shdwcrsr.cxx index a3da33283a..b72a9556ca 100644 --- a/sw/source/ui/utlui/shdwcrsr.cxx +++ b/sw/source/ui/utlui/shdwcrsr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -133,3 +134,4 @@ Rectangle SwShadowCursor::GetRect() const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx b/sw/source/ui/utlui/swrenamexnameddlg.cxx index 29f58799cf..d977d5aa97 100644 --- a/sw/source/ui/utlui/swrenamexnameddlg.cxx +++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -39,7 +40,7 @@ #include <utlui.hrc> #include <unotools.hrc> #include <unoprnms.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <vcl/msgbox.hxx> #include <com/sun/star/text/XTextViewCursorSupplier.hpp> #include <com/sun/star/view/XScreenCursor.hpp> @@ -94,9 +95,7 @@ SwRenameXNamedDlg::SwRenameXNamedDlg( Window* pWin, aNewNameED.SetModifyHdl(LINK(this, SwRenameXNamedDlg, ModifyHdl)); aOk.Enable(sal_False); } -/* -----------------09.06.99 15:34------------------- - * - * --------------------------------------------------*/ + IMPL_LINK(SwRenameXNamedDlg, OkHdl, OKButton*, EMPTYARG) { try @@ -105,14 +104,12 @@ IMPL_LINK(SwRenameXNamedDlg, OkHdl, OKButton*, EMPTYARG) } catch(uno::RuntimeException&) { - DBG_ERROR("Name wurde nicht geaendert"); + OSL_ENSURE(false, "name wasn't changed"); } EndDialog(RET_OK); return 0; } -/* -----------------09.06.99 15:48------------------- - * - * --------------------------------------------------*/ + IMPL_LINK(SwRenameXNamedDlg, ModifyHdl, NoSpaceEdit*, pEdit) { String sTmp(pEdit->GetText()); @@ -141,3 +138,5 @@ IMPL_LINK(SwRenameXNamedDlg, ModifyHdl, NoSpaceEdit*, pEdit) ); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/textcontrolcombo.cxx b/sw/source/ui/utlui/textcontrolcombo.cxx index 271ec9d5f4..2d1a0ea8be 100644 --- a/sw/source/ui/utlui/textcontrolcombo.cxx +++ b/sw/source/ui/utlui/textcontrolcombo.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,7 +63,7 @@ void TextControlCombo::Arrange( FixedText& _rFTcomplete, sal_Bool /*bShow*/ ) nYCtrl += aMetricVals.Height(); // separate text parts - const String aReplStr( RTL_CONSTASCII_STRINGPARAM( "%POSITION_OF_CONTROL" ) ); + const String aReplStr( RTL_CONSTASCII_USTRINGPARAM( "%POSITION_OF_CONTROL" ) ); String aTxtBefore( _rFTcomplete.GetText() ); String aTxtAfter; xub_StrLen nReplPos = aTxtBefore.Search( aReplStr ); @@ -111,3 +112,4 @@ void TextControlCombo::Enable( sal_Bool _bEnable, sal_Bool _bChild ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/tmplctrl.cxx b/sw/source/ui/utlui/tmplctrl.cxx index d399efae63..545e861a33 100644 --- a/sw/source/ui/utlui/tmplctrl.cxx +++ b/sw/source/ui/utlui/tmplctrl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,18 +29,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -// include --------------------------------------------------------------- - - #include <svl/style.hxx> -#ifndef _MENU_HXX //autogen #include <vcl/menu.hxx> -#endif #include <svl/stritem.hxx> #include <sfx2/dispatch.hxx> -#ifndef _STATUS_HXX //autogen #include <vcl/status.hxx> -#endif #include "wrtsh.hxx" #include "view.hxx" @@ -51,7 +45,6 @@ // STATIC DATA ----------------------------------------------------------- - SFX_IMPL_STATUSBAR_CONTROL( SwTemplateControl, SfxStringItem ); // class TemplatePopup_Impl -------------------------------------------------- @@ -69,16 +62,12 @@ private: virtual void Select(); }; -// ----------------------------------------------------------------------- - TemplatePopup_Impl::TemplatePopup_Impl() : PopupMenu(), nCurId(USHRT_MAX) { } -// ----------------------------------------------------------------------- - void TemplatePopup_Impl::Select() { nCurId = GetCurItemId(); @@ -93,14 +82,10 @@ SwTemplateControl::SwTemplateControl( sal_uInt16 _nSlotId, { } -// ----------------------------------------------------------------------- - SwTemplateControl::~SwTemplateControl() { } -// ----------------------------------------------------------------------- - void SwTemplateControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { @@ -113,15 +98,11 @@ void SwTemplateControl::StateChanged( } } -// ----------------------------------------------------------------------- - void SwTemplateControl::Paint( const UserDrawEvent& ) { GetStatusBar().SetItemText( GetId(), sTemplate ); } -// ----------------------------------------------------------------------- - void SwTemplateControl::Command( const CommandEvent& rCEvt ) { if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU && @@ -172,3 +153,4 @@ void SwTemplateControl::Command( const CommandEvent& rCEvt ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/uiitems.cxx b/sw/source/ui/utlui/uiitems.cxx index 420228cc9a..87a8045c7c 100644 --- a/sw/source/ui/utlui/uiitems.cxx +++ b/sw/source/ui/utlui/uiitems.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,16 +39,14 @@ #include "utlui.hrc" #include "attrdesc.hrc" -#ifndef _UNOMID_H #include <unomid.h> -#endif #include <numrule.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; // Breitenangaben der Fussnotenlinien, mit TabPage abstimmen -static const sal_uInt16 __FAR_DATA nFtnLines[] = { +static const sal_uInt16 nFtnLines[] = { 0, 10, 50, @@ -86,7 +85,7 @@ SfxPoolItem* SwPageFtnInfoItem::Clone( SfxItemPool * /*pPool*/ ) const int SwPageFtnInfoItem::operator==( const SfxPoolItem& rAttr ) const { - DBG_ASSERT( Which() == rAttr.Which(), "keine gleichen Attribute" ); + OSL_ENSURE( Which() == rAttr.Which(), "keine gleichen Attribute" ); return ( aFtnInfo == ((SwPageFtnInfoItem&)rAttr).GetPageFtnInfo()); } @@ -122,12 +121,10 @@ SfxItemPresentation SwPageFtnInfoItem::GetPresentation } return SFX_ITEM_PRESENTATION_NONE; } -/* -----------------------------26.04.01 12:25-------------------------------- - ---------------------------------------------------------------------------*/ -sal_Bool SwPageFtnInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const +bool SwPageFtnInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const { - sal_Bool bRet = sal_True; + bool bRet = true; switch(nMemberId & ~CONVERT_TWIPS) { case MID_FTN_HEIGHT : rVal <<= (sal_Int32)TWIP_TO_MM100(aFtnInfo.GetHeight());break; @@ -144,17 +141,15 @@ sal_Bool SwPageFtnInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const case MID_LINE_TEXT_DIST : rVal <<= (sal_Int32)TWIP_TO_MM100(aFtnInfo.GetTopDist());break; case MID_LINE_FOOTNOTE_DIST: rVal <<= (sal_Int32)TWIP_TO_MM100(aFtnInfo.GetBottomDist());break; default: - bRet = sal_False; + bRet = false; } return bRet; } -/* -----------------------------26.04.01 12:26-------------------------------- - ---------------------------------------------------------------------------*/ -sal_Bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId) +bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId) { sal_Int32 nSet32 = 0; - sal_Bool bRet = sal_True; + bool bRet = true; switch(nMemberId & ~CONVERT_TWIPS) { case MID_LINE_COLOR : @@ -166,7 +161,7 @@ sal_Bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId) case MID_LINE_FOOTNOTE_DIST: rVal >>= nSet32; if(nSet32 < 0) - bRet = sal_False; + bRet = false; else { nSet32 = MM100_TO_TWIP(nSet32); @@ -185,7 +180,7 @@ sal_Bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId) if(nSet >= 0) aFtnInfo.SetLineWidth(MM100_TO_TWIP(nSet)); else - bRet = sal_False; + bRet = false; } break; case MID_LINE_RELWIDTH : @@ -193,7 +188,7 @@ sal_Bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId) sal_Int8 nSet = 0; rVal >>= nSet; if(nSet < 0) - bRet = sal_False; + bRet = false; else aFtnInfo.SetWidth(Fraction(nSet, 100)); } @@ -205,11 +200,11 @@ sal_Bool SwPageFtnInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId) if(nSet >= 0 && nSet < 3) //text::HorizontalAdjust aFtnInfo.SetAdj((SwFtnAdj)nSet); else - bRet = sal_False; + bRet = false; } break; default: - bRet = sal_False; + bRet = false; } return bRet; } @@ -240,20 +235,15 @@ SfxPoolItem* SwPtrItem::Clone( SfxItemPool * /*pPool*/ ) const return new SwPtrItem( *this ); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - int SwPtrItem::operator==( const SfxPoolItem& rAttr ) const { - DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); + OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" ); const SwPtrItem& rItem = (SwPtrItem&)rAttr; return ( pMisc == rItem.pMisc ); } -/*-----------------12.11.97 12:55------------------------------- +/*-------------------------------------------------------------- SwUINumRuleItem fuer die NumTabPages der FormatNumRule/Stylisten ---------------------------------------------------------------*/ SwUINumRuleItem::SwUINumRuleItem( const SwNumRule& rRul, const sal_uInt16 nId ) @@ -280,17 +270,17 @@ SfxPoolItem* SwUINumRuleItem::Clone( SfxItemPool * /*pPool*/ ) const int SwUINumRuleItem::operator==( const SfxPoolItem& rAttr ) const { - DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); + OSL_ENSURE( SfxPoolItem::operator==(rAttr), "unequal types" ); return *pRule == *((SwUINumRuleItem&)rAttr).pRule; } -sal_Bool SwUINumRuleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const +bool SwUINumRuleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { uno::Reference< container::XIndexReplace >xRules = new SwXNumberingRules(*pRule); rVal.setValue(&xRules, ::getCppuType((uno::Reference< container::XIndexReplace>*)0)); - return sal_True; + return true; } -sal_Bool SwUINumRuleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) +bool SwUINumRuleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { uno::Reference< container::XIndexReplace> xRulesRef; if(rVal >>= xRulesRef) @@ -303,18 +293,14 @@ sal_Bool SwUINumRuleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId* *pRule = *pSwXRules->GetNumRule(); } } - return sal_True; + return true; } -/* -----------------17.06.98 17:43------------------- - * - * --------------------------------------------------*/ + SwBackgroundDestinationItem::SwBackgroundDestinationItem(sal_uInt16 _nWhich, sal_uInt16 nValue) : SfxUInt16Item(_nWhich, nValue) { } -/* -----------------17.06.98 17:44------------------- - * - * --------------------------------------------------*/ + SfxPoolItem* SwBackgroundDestinationItem::Clone( SfxItemPool * /*pPool*/ ) const { return new SwBackgroundDestinationItem(Which(), GetValue()); @@ -322,3 +308,4 @@ SfxPoolItem* SwBackgroundDestinationItem::Clone( SfxItemPool * /*pPool*/ ) c +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx index bbf9888ebf..7f64011422 100644 --- a/sw/source/ui/utlui/uitool.cxx +++ b/sw/source/ui/utlui/uitool.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,6 +32,7 @@ #include <hintids.hxx> +#include <osl/diagnose.h> #include <tools/datetime.hxx> #include <vcl/svapp.hxx> #include <unotools/collatorwrapper.hxx> @@ -41,17 +43,13 @@ #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> #include <editeng/pmdlitem.hxx> -#ifndef _SVX_TSTPITEM_HXX //autogen #include <editeng/tstpitem.hxx> -#endif #include <editeng/boxitem.hxx> #include <editeng/sizeitem.hxx> #include <svx/pageitem.hxx> #include <editeng/lrspitem.hxx> #include <svl/style.hxx> -#ifndef _VCL_LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> -#endif #include <unotools/localedatawrapper.hxx> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> @@ -66,14 +64,10 @@ #include <fmtpdsc.hxx> #include <wview.hxx> #include <uiitems.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <wrtsh.hxx> #include <swmodule.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <uitool.hxx> #include <frmatr.hxx> #include <paratr.hxx> @@ -81,18 +75,9 @@ #include <poolfmt.hxx> #include "usrpref.hxx" -#ifndef _ERROR_H -#include <error.h> -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif -#ifndef _UTLUI_HRC #include <utlui.hrc> -#endif #include <doc.hxx> #include <docary.hxx> #include <charfmt.hxx> @@ -231,7 +216,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) // SwFmtHeader aHeaderFmt(rMaster.GetHeader()); SwFrmFmt *pHeaderFmt = aHeaderFmt.GetHeaderFmt(); - ASSERT(pHeaderFmt != 0, "kein HeaderFormat"); + OSL_ENSURE(pHeaderFmt != 0, "no header format"); ::FillHdFt(pHeaderFmt, rHeaderSet); @@ -267,7 +252,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) // SwFmtFooter aFooterFmt(rMaster.GetFooter()); SwFrmFmt *pFooterFmt = aFooterFmt.GetFooterFmt(); - ASSERT(pFooterFmt != 0, "kein FooterFormat"); + OSL_ENSURE(pFooterFmt != 0, "no footer format"); ::FillHdFt(pFooterFmt, rFooterSet); @@ -326,11 +311,6 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) } } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet) { const SwFrmFmt& rMaster = rPageDesc.GetMaster(); @@ -385,7 +365,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet) { const SwFmtHeader &rHeaderFmt = rMaster.GetHeader(); const SwFrmFmt *pHeaderFmt = rHeaderFmt.GetHeaderFmt(); - ASSERT(pHeaderFmt != 0, kein HeaderFormat.); + OSL_ENSURE(pHeaderFmt != 0, "no header format"); // HeaderInfo, Raender, Hintergrund, Umrandung // @@ -431,7 +411,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet) { const SwFmtFooter &rFooterFmt = rMaster.GetFooter(); const SwFrmFmt *pFooterFmt = rFooterFmt.GetFooterFmt(); - ASSERT(pFooterFmt != 0, kein FooterFormat.); + OSL_ENSURE(pFooterFmt != 0, "no footer format"); // FooterInfo, Raender, Hintergrund, Umrandung // @@ -622,9 +602,6 @@ void SetDfltMetric( FieldUnit eMetric, sal_Bool bWeb ) SW_MOD()->ApplyUserMetric(eMetric, bWeb); } -/*-----------------09.04.98 16:58------------------- - ---------------------------------------------------*/ sal_uInt16 InsertStringSorted(const String& rEntry, ListBox& rToFill, sal_uInt16 nOffset ) { sal_uInt16 i = nOffset; @@ -681,9 +658,6 @@ void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, sal_Bool bSorted } }; -/* -----------------27.04.98 08:26------------------- - * - * --------------------------------------------------*/ SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, sal_uInt16 *pPercent, SwWrtShell* pSh ) { @@ -715,7 +689,7 @@ SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, sal_uInt16 *pPercent, } else { - DBG_ERROR("wo soll die Breite denn herkommen?"); + OSL_ENSURE(false, "where to get the actual width from?"); } const SvxLRSpaceItem& rLRSpace = pFmt->GetLRSpace(); nWidth -= (rLRSpace.GetRight() + rLRSpace.GetLeft()); @@ -726,8 +700,6 @@ SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, sal_uInt16 *pPercent, return nWidth; } -/*------------------------------------------------------------------------*/ - String GetAppLangDateTimeString( const DateTime& rDT ) { const SvtSysLocale aSysLocale; @@ -737,9 +709,19 @@ String GetAppLangDateTimeString( const DateTime& rDT ) return sRet; } -/*-- 26.01.2006 08:06:33--------------------------------------------------- +/*---------------------------------------------------------------------------- + * add a new function which can get and set the current "SID_ATTR_APPLYCHARUNIT" value + *---------------------------------------------------------------------------*/ +sal_Bool HasCharUnit( sal_Bool bWeb) +{ + return SW_MOD()->GetUsrPref(bWeb)->IsApplyCharUnit(); +} + +void SetApplyCharUnit(sal_Bool bApplyChar, sal_Bool bWeb) +{ + SW_MOD()->ApplyUserCharUnit(bApplyChar, bWeb); +} - -----------------------------------------------------------------------*/ bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16 nId ) { bool bRet = false; @@ -761,7 +743,7 @@ bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16 uno::Reference < frame::XDispatchProvider > xProv( xFrame, uno::UNO_QUERY ); util::URL aURL; aURL.Complete = sCommand; - uno::Reference < util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), uno::UNO_QUERY ); + uno::Reference < util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), uno::UNO_QUERY ); xTrans->parseStrict( aURL ); uno::Reference< frame::XDispatch > xDisp = xProv->queryDispatch( aURL, ::rtl::OUString(), 0 ); if( xDisp.is() ) @@ -773,3 +755,5 @@ bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16 } return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx index 3f4f4aa716..dc363abc9e 100644 --- a/sw/source/ui/utlui/unotools.cxx +++ b/sw/source/ui/utlui/unotools.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,7 +37,7 @@ #include <unotools.hrc> #include <unotools.hxx> #include <unoprnms.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <vcl/msgbox.hxx> #include <com/sun/star/text/XTextViewCursorSupplier.hpp> #include <com/sun/star/view/XScreenCursor.hpp> @@ -62,21 +63,14 @@ #include <unomid.h> - using namespace ::com::sun::star; using ::rtl::OUString; const sal_Char cFrameControl[] = "com.sun.star.frame.FrameControl"; const sal_Char cFactory[] = "private:factory/swriter"; -/************************************************************************ - -************************************************************************/ sal_Bool SwOneExampleFrame::bShowServiceNotAvailableMessage = sal_True; -/* -----------------27.07.99 15:26------------------- - - --------------------------------------------------*/ SwOneExampleFrame::SwOneExampleFrame( Window& rWin, sal_uInt32 nFlags, const Link* pInitializedLink, @@ -103,7 +97,6 @@ SwOneExampleFrame::SwOneExampleFrame( Window& rWin, // the controller is asynchronously set aLoadedTimer.SetTimeoutHdl(LINK(this, SwOneExampleFrame, TimeoutHdl)); -// aLoadedTimer.SetTimeout(500); aLoadedTimer.SetTimeout(200); rWin.Enable(sal_False); @@ -112,9 +105,6 @@ SwOneExampleFrame::SwOneExampleFrame( Window& rWin, aTopWindow.Show(); } -/* -----------------------------08.12.99 13:44-------------------------------- - - ---------------------------------------------------------------------------*/ void SwOneExampleFrame::CreateErrorMessage(Window* pParent) { if(SwOneExampleFrame::bShowServiceNotAvailableMessage) @@ -125,16 +115,12 @@ void SwOneExampleFrame::CreateErrorMessage(Window* pParent) SwOneExampleFrame::bShowServiceNotAvailableMessage = sal_False; } } -/* -----------------27.07.99 15:26------------------- - --------------------------------------------------*/ SwOneExampleFrame::~SwOneExampleFrame() { DisposeControl(); } -/* -----------------------------21.12.00 10:16-------------------------------- - ---------------------------------------------------------------------------*/ void SwOneExampleFrame::CreateControl() { if(_xControl.is()) @@ -159,7 +145,6 @@ void SwOneExampleFrame::CreateControl() uno::Reference< beans::XPropertySet > xPrSet(xInst, uno::UNO_QUERY); uno::Any aURL; - // // create new doc String sTempURL = C2S(cFactory); if(sArgumentURL.Len()) @@ -189,10 +174,6 @@ void SwOneExampleFrame::CreateControl() } } - -/* -----------------------------21.12.00 10:16-------------------------------- - - ---------------------------------------------------------------------------*/ void SwOneExampleFrame::DisposeControl() { _xCursor = 0; @@ -202,9 +183,7 @@ void SwOneExampleFrame::DisposeControl() _xModel = 0; _xController = 0; } -/* -----------------27.07.99 15:26------------------- - --------------------------------------------------*/ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer ) { if(!_xControl.is()) @@ -247,32 +226,32 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer ) if( !bIsInitialized ) { - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_BREAKS )), aFalseSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_DRAWINGS )), aTrueSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_FIELD_COMMANDS )), aFalseSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_GRAPHICS )), aTrueSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_HIDDEN_PARAGRAPHS )), aFalseSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_HIDDEN_TEXT )), aFalseSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_RULER )), aFalseSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_PARA_BREAKS )), aFalseSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_PROTECTED_SPACES )), aFalseSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_SOFT_HYPHENS )), aFalseSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_SPACES )), aFalseSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_TABLES )), aTrueSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_TABSTOPS )), aFalseSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_RULER )), aFalseSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_BREAKS)), aFalseSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_DRAWINGS)), aTrueSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_FIELD_COMMANDS)), aFalseSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_GRAPHICS)), aTrueSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HIDDEN_PARAGRAPHS)), aFalseSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HIDDEN_TEXT)), aFalseSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_RULER)), aFalseSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_PARA_BREAKS)), aFalseSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_PROTECTED_SPACES)), aFalseSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_SOFT_HYPHENS)), aFalseSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_SPACES)), aFalseSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_TABLES)), aTrueSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_TABSTOPS)), aFalseSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_RULER)), aFalseSet); if(0 ==(nStyleFlags&EX_SHOW_ONLINE_LAYOUT)) { uno::Any aZoom; aZoom <<= (sal_Int16)view::DocumentZoomType::PAGE_WIDTH_EXACT; - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom); } else { uno::Any aZoom; aZoom <<= (sal_Int16)view::DocumentZoomType::BY_VALUE; - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom); sal_Int16 nZoomValue = 50; if(EX_SHOW_BUSINESS_CARDS == nStyleFlags) @@ -280,10 +259,10 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer ) nZoomValue = 80; } aZoom <<= nZoomValue; - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom); } // set onlinelayout property behind setting the zoom - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_ONLINE_LAYOUT)), + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_ONLINE_LAYOUT)), (nStyleFlags&EX_SHOW_ONLINE_LAYOUT) ? aTrueSet : aFalseSet ); bIsInitialized = sal_True; } @@ -293,7 +272,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer ) _xCursor = xText->createTextCursor(); uno::Reference< beans::XPropertySet > xCrsrProp(_xCursor, uno::UNO_QUERY); uno::Any aPageStyle = xCrsrProp->getPropertyValue( - C2U(SW_PROP_NAME_STR(UNO_NAME_PAGE_STYLE_NAME))); + rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_PAGE_STYLE_NAME))); OUString sPageStyle; aPageStyle >>= sPageStyle; @@ -309,27 +288,26 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer ) uno::Reference< style::XStyle > xPStyle; aPStyle >>= xPStyle; uno::Reference< beans::XPropertySet > xPProp(xPStyle, uno::UNO_QUERY); - uno::Any aSize = xPProp->getPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SIZE))); + uno::Any aSize = xPProp->getPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SIZE))); awt::Size aPSize; aSize >>= aPSize; //TODO: set page width to card width aPSize.Width = 10000; aSize.setValue(&aPSize, ::getCppuType((awt::Size*)0)); - xPProp->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SIZE)), aSize); + xPProp->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SIZE)), aSize); uno::Any aZero; aZero <<= (sal_Int32)0; - xPProp->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_LEFT_MARGIN)), aZero); - xPProp->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_RIGHT_MARGIN)), aZero); + xPProp->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LEFT_MARGIN)), aZero); + xPProp->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RIGHT_MARGIN)), aZero); } // can only be done here - the SFX changes the ScrollBar values - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_SCROLL_BAR )), aFalseSet); - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_SCROLL_BAR )), aFalseSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_SCROLL_BAR )), aFalseSet); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_SCROLL_BAR )), aFalseSet); if( aInitializedLink.IsSet() ) { rWindow.Enable(sal_False, sal_True); - //rWindow.Enable(sal_True, sal_False); aInitializedLink.Call(this); } @@ -364,9 +342,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer ) pTimer->Start(); return 0; } -/* -----------------------------27.12.99 09:59-------------------------------- - ---------------------------------------------------------------------------*/ void SwOneExampleFrame::ClearDocument( sal_Bool bStartUpdateTimer ) { uno::Reference< lang::XUnoTunnel> xTunnel( _xCursor, uno::UNO_QUERY); @@ -398,9 +374,7 @@ void SwOneExampleFrame::ClearDocument( sal_Bool bStartUpdateTimer ) } } } -/* -----------------------------15.12.99 11:09-------------------------------- - ---------------------------------------------------------------------------*/ static const sal_Int16 nZoomValues[] = { 20, @@ -409,7 +383,7 @@ static const sal_Int16 nZoomValues[] = 75, 100 }; -//--------------------------------------------------------------------------- + #define ITEM_UP 100 #define ITEM_DOWN 200 #define ITEM_ZOOM 300 @@ -432,7 +406,7 @@ void SwOneExampleFrame::CreatePopup(const Point& rPt) uno::Reference< view::XViewSettingsSupplier > xSettings(_xController, uno::UNO_QUERY); uno::Reference< beans::XPropertySet > xViewProps = xSettings->getViewSettings(); - uno::Any aZoom = xViewProps->getPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE))); + uno::Any aZoom = xViewProps->getPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE))); sal_Int16 nZoom = 0; aZoom >>= nZoom; @@ -451,9 +425,7 @@ void SwOneExampleFrame::CreatePopup(const Point& rPt) aPop.Execute( &aTopWindow, rPt ); } -/* -----------------------------15.12.99 11:09-------------------------------- - ---------------------------------------------------------------------------*/ IMPL_LINK(SwOneExampleFrame, PopupHdl, Menu*, pMenu ) { sal_uInt16 nId = pMenu->GetCurItemId(); @@ -465,9 +437,9 @@ IMPL_LINK(SwOneExampleFrame, PopupHdl, Menu*, pMenu ) uno::Any aZoom; aZoom <<= nZoom; - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom); aZoom <<= (sal_Int16)view::DocumentZoomType::BY_VALUE; - xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom); + xViewProps->setPropertyValue(rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom); } else if(ITEM_UP == nId || ITEM_DOWN == nId) { @@ -480,18 +452,14 @@ IMPL_LINK(SwOneExampleFrame, PopupHdl, Menu*, pMenu ) } return 0; }; -/* -----------------------------15.12.99 10:37-------------------------------- - ---------------------------------------------------------------------------*/ SwFrmCtrlWindow::SwFrmCtrlWindow(Window* pParent, WinBits nBits, SwOneExampleFrame* pFrame) : Window(pParent, nBits), pExampleFrame(pFrame) { } -/* -----------------------------15.12.99 09:57-------------------------------- - ---------------------------------------------------------------------------*/ void SwFrmCtrlWindow::Command( const CommandEvent& rCEvt ) { switch ( rCEvt.GetCommand() ) @@ -510,9 +478,7 @@ void SwFrmCtrlWindow::Command( const CommandEvent& rCEvt ) default:; } } -/* -----------------------------15.12.99 12:57-------------------------------- - ---------------------------------------------------------------------------*/ MenuResource::MenuResource(const ResId& rResId) : Resource(rResId), aMenuArray(ResId(1,*rResId.GetResMgr())) @@ -520,3 +486,4 @@ MenuResource::MenuResource(const ResId& rResId) : FreeResource(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/utlui.src b/sw/source/ui/utlui/utlui.src index a48e36487c..115bd809a9 100644 --- a/sw/source/ui/utlui/utlui.src +++ b/sw/source/ui/utlui/utlui.src @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -319,51 +319,6 @@ ImageList ILIST_DB_DLG MaskColor = IMAGE_MASK_COLOR; IMGLIST_IDS; }; - -ImageList ILIST_DB_DLG_HC -{ - Prefix = "sxh"; - MaskColor = IMAGE_MASK_COLOR ; - IMGLIST_IDS; -}; - -Image IMG_ONE_LEFT_HC -{ - ImageBitmap = Bitmap - { - File = "one_left_h.bmp" ; - }; - MaskColor = IMAGE_MASK_COLOR ; -}; - -Image IMG_ONE_RIGHT_HC -{ - ImageBitmap = Bitmap - { - File = "one_right_h.bmp" ; - }; - MaskColor = IMAGE_MASK_COLOR ; -}; - -Image IMG_ALL_LEFT_HC -{ - ImageBitmap = Bitmap - { - File = "all_left_h.bmp" ; - }; - MaskColor = IMAGE_MASK_COLOR ; -}; - -Image IMG_ALL_RIGHT_HC -{ - ImageBitmap = Bitmap - { - File = "all_right_h.bmp" ; - }; - MaskColor = IMAGE_MASK_COLOR ; -}; - - Image IMG_VIEWLAYOUT_AUTOMATIC { ImageBitmap = Bitmap @@ -414,59 +369,6 @@ Image IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE }; MaskColor = IMAGE_MASK_COLOR; }; - -Image IMG_VIEWLAYOUT_AUTOMATIC_HC -{ - ImageBitmap = Bitmap - { - File = "twopages_11x25_h.png" ; - }; - MaskColor = IMAGE_MASK_COLOR; -}; -Image IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE_HC -{ - ImageBitmap = Bitmap - { - File = "twopages_a_11x25_h.png" ; - }; - MaskColor = IMAGE_MASK_COLOR; -}; - -Image IMG_VIEWLAYOUT_BOOKMODE_HC -{ - ImageBitmap = Bitmap - { - File = "doublepage_11x23_h.png" ; - }; - MaskColor = IMAGE_MASK_COLOR; -}; -Image IMG_VIEWLAYOUT_BOOKMODE_ACTIVE_HC -{ - ImageBitmap = Bitmap - { - File = "doublepage_a_11x23_h.png" ; - }; - MaskColor = IMAGE_MASK_COLOR; -}; -Image IMG_VIEWLAYOUT_SINGLECOLUMN_HC -{ - ImageBitmap = Bitmap - { - File = "emptypage_11x15_h.png" ; - }; - MaskColor = IMAGE_MASK_COLOR; -}; -Image IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE_HC -{ - ImageBitmap = Bitmap - { - File = "emptypage_a_11x15_h.png" ; - }; - MaskColor = IMAGE_MASK_COLOR; -}; - - - String STR_HYPERCTRL_SEL { Text [ en-US ] = "SEL"; @@ -475,4 +377,3 @@ String STR_HYPERCTRL_HYP { Text [ en-US ] = "HYP"; }; - diff --git a/sw/source/ui/utlui/viewlayoutctrl.cxx b/sw/source/ui/utlui/viewlayoutctrl.cxx index b2003483b9..a52632ef08 100644 --- a/sw/source/ui/utlui/viewlayoutctrl.cxx +++ b/sw/source/ui/utlui/viewlayoutctrl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,31 +32,23 @@ // include --------------------------------------------------------------- #include <viewlayoutctrl.hxx> -#ifndef _STATUS_HXX //autogen #include <vcl/status.hxx> -#endif #include <vcl/image.hxx> #include <svl/eitem.hxx> #include <svx/viewlayoutitem.hxx> -#ifndef _UTLUI_HRC #include <utlui.hrc> -#endif #include <swtypes.hxx> // fuer Pathfinder // STATIC DATA ----------------------------------------------------------- SFX_IMPL_STATUSBAR_CONTROL( SwViewLayoutControl, SvxViewLayoutItem ); -// ----------------------------------------------------------------------- - const long nImageWidthSingle = 15; const long nImageWidthAuto = 25; const long nImageWidthBook = 23; const long nImageWidthSum = 63; const long nImageHeight = 11; -// ----------------------------------------------------------------------- - struct SwViewLayoutControl::SwViewLayoutControl_Impl { sal_uInt16 mnState; // 0 = single, 1 = auto, 2 = book, 3 = none @@ -75,31 +68,26 @@ SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, { mpImpl->mnState = 0; - const sal_Bool bHC = GetStatusBar().GetSettings().GetStyleSettings().GetHighContrastMode(); - mpImpl->maImageSingleColumn = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_HC) : SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN) ); - mpImpl->maImageSingleColumn_Active = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE_HC) : SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE) ); - mpImpl->maImageAutomatic = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_HC) : SW_RES(IMG_VIEWLAYOUT_AUTOMATIC) ); - mpImpl->maImageAutomatic_Active = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE_HC) : SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE) ); - mpImpl->maImageBookMode = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_BOOKMODE_HC) : SW_RES(IMG_VIEWLAYOUT_BOOKMODE) ); - mpImpl->maImageBookMode_Active = Image( bHC ? SW_RES(IMG_VIEWLAYOUT_BOOKMODE_ACTIVE_HC) : SW_RES(IMG_VIEWLAYOUT_BOOKMODE_ACTIVE) ); + mpImpl->maImageSingleColumn = Image( SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN) ); + mpImpl->maImageSingleColumn_Active = Image( SW_RES(IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE) ); + mpImpl->maImageAutomatic = Image( SW_RES(IMG_VIEWLAYOUT_AUTOMATIC) ); + mpImpl->maImageAutomatic_Active = Image( SW_RES(IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE) ); + mpImpl->maImageBookMode = Image( SW_RES(IMG_VIEWLAYOUT_BOOKMODE) ); + mpImpl->maImageBookMode_Active = Image( SW_RES(IMG_VIEWLAYOUT_BOOKMODE_ACTIVE) ); } -// ----------------------------------------------------------------------- - SwViewLayoutControl::~SwViewLayoutControl() { delete mpImpl; } -// ----------------------------------------------------------------------- - void SwViewLayoutControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { if ( SFX_ITEM_AVAILABLE != eState || pState->ISA( SfxVoidItem ) ) GetStatusBar().SetItemText( GetId(), String() ); else { - DBG_ASSERT( pState->ISA( SvxViewLayoutItem ), "invalid item type" ); + OSL_ENSURE( pState->ISA( SvxViewLayoutItem ), "invalid item type" ); const sal_uInt16 nColumns = static_cast<const SvxViewLayoutItem*>( pState )->GetValue(); const bool bBookMode = static_cast<const SvxViewLayoutItem*>( pState )->IsBookMode(); @@ -120,17 +108,10 @@ void SwViewLayoutControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState GetStatusBar().SetItemData( GetId(), 0 ); // force repaint } -// ----------------------------------------------------------------------- - void SwViewLayoutControl::Paint( const UserDrawEvent& rUsrEvt ) { OutputDevice* pDev = rUsrEvt.GetDevice(); Rectangle aRect = rUsrEvt.GetRect(); - Color aOldLineColor = pDev->GetLineColor(); - Color aOldFillColor = pDev->GetFillColor(); - - //pDev->SetLineColor(); - //pDev->SetFillColor( pDev->GetBackground().GetColor() ); const bool bSingleColumn = 0 == mpImpl->mnState; const bool bAutomatic = 1 == mpImpl->mnState; @@ -152,17 +133,6 @@ void SwViewLayoutControl::Paint( const UserDrawEvent& rUsrEvt ) // draw bookmode image: aRect.Left() += nImageWidthAuto; pDev->DrawImage( aRect.TopLeft(), bBookMode ? mpImpl->maImageBookMode_Active : mpImpl->maImageBookMode ); - - // draw separators - //aRect = rUsrEvt.GetRect(); - //aRect.Left() += nImageWidth; - //aRect.setWidth( 1 ); - //pDev->DrawRect( aRect ); - //aRect.Left() += nImageWidth; - //pDev->DrawRect( aRect ); - - //pDev->SetLineColor( aOldLineColor ); - //pDev->SetFillColor( aOldFillColor ); } sal_Bool SwViewLayoutControl::MouseButtonDown( const MouseEvent & rEvt ) @@ -207,3 +177,5 @@ sal_Bool SwViewLayoutControl::MouseButtonDown( const MouseEvent & rEvt ) return sal_True; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/zoomctrl.cxx b/sw/source/ui/utlui/zoomctrl.cxx index 2c3965cac6..3d91b7c10f 100644 --- a/sw/source/ui/utlui/zoomctrl.cxx +++ b/sw/source/ui/utlui/zoomctrl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,13 +29,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - #include "hintids.hxx" -#ifndef _STATUS_HXX //autogen #include <vcl/status.hxx> -#endif #include <sfx2/app.hxx> #include <svl/stritem.hxx> #include <svx/zoomitem.hxx> @@ -42,10 +39,8 @@ #include "swtypes.hxx" #include "zoomctrl.hxx" - SFX_IMPL_STATUSBAR_CONTROL( SwZoomControl, SvxZoomItem ); - SwZoomControl::SwZoomControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, StatusBar& rStb ) : @@ -53,14 +48,10 @@ SwZoomControl::SwZoomControl( sal_uInt16 _nSlotId, { } -// ----------------------------------------------------------------------- - SwZoomControl::~SwZoomControl() { } -// ----------------------------------------------------------------------- - void SwZoomControl::StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) { @@ -76,8 +67,6 @@ void SwZoomControl::StateChanged( sal_uInt16 nSID, SfxItemState eState, } } -// ----------------------------------------------------------------------- - void SwZoomControl::Paint( const UserDrawEvent& rUsrEvt ) { if(!sPreviewZoom.Len()) @@ -86,8 +75,6 @@ void SwZoomControl::Paint( const UserDrawEvent& rUsrEvt ) GetStatusBar().SetItemText( GetId(), sPreviewZoom ); } -// ----------------------------------------------------------------------- - void SwZoomControl::Command( const CommandEvent& rCEvt ) { if(!sPreviewZoom.Len()) @@ -97,3 +84,4 @@ void SwZoomControl::Command( const CommandEvent& rCEvt ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/service.cxx b/sw/source/ui/vba/service.cxx index 6e607e861e..291f0e8989 100644 --- a/sw/source/ui/vba/service.cxx +++ b/sw/source/ui/vba/service.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,6 +58,11 @@ namespace vbaeventshelper extern sdecl::ServiceDecl const serviceDecl; } +namespace vbaeventshelper +{ +extern sdecl::ServiceDecl const serviceDecl; +} + extern "C" { SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( @@ -78,3 +84,4 @@ extern "C" } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaaddin.cxx b/sw/source/ui/vba/vbaaddin.cxx index 418a2dcd41..71a372ee12 100644 --- a/sw/source/ui/vba/vbaaddin.cxx +++ b/sw/source/ui/vba/vbaaddin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -102,3 +103,4 @@ SwVbaAddin::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaaddin.hxx b/sw/source/ui/vba/vbaaddin.hxx index 585d2f865e..ae92cddcb2 100644 --- a/sw/source/ui/vba/vbaaddin.hxx +++ b/sw/source/ui/vba/vbaaddin.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,3 +58,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_ADDIN_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaaddins.cxx b/sw/source/ui/vba/vbaaddins.cxx index 62faf145c6..e454ad1cb6 100644 --- a/sw/source/ui/vba/vbaaddins.cxx +++ b/sw/source/ui/vba/vbaaddins.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,7 +41,7 @@ uno::Reference< container::XIndexAccess > lcl_getAddinCollection( const uno::Ref // first get the autoload addins in the directory STARTUP uno::Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager(), uno::UNO_QUERY_THROW ); - uno::Reference< ucb::XSimpleFileAccess > xSFA( xMCF->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), xContext), uno::UNO_QUERY_THROW ); + uno::Reference< ucb::XSimpleFileAccess > xSFA( xMCF->createInstanceWithContext( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), xContext), uno::UNO_QUERY_THROW ); SvtPathOptions aPathOpt; // FIXME: temporary the STARTUP path is located in $OO/basic3.1/program/addin String aAddinPath = aPathOpt.GetAddinPath(); @@ -105,3 +106,5 @@ SwVbaAddins::getServiceNames() } return sNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaaddins.hxx b/sw/source/ui/vba/vbaaddins.hxx index 6d3c269af4..65642aada2 100644 --- a/sw/source/ui/vba/vbaaddins.hxx +++ b/sw/source/ui/vba/vbaaddins.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,3 +51,5 @@ public: }; #endif /* SW_VBA_ADDINS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx index fd815b2b04..140da0b697 100644 --- a/sw/source/ui/vba/vbaapplication.cxx +++ b/sw/source/ui/vba/vbaapplication.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,6 +41,7 @@ #include <editeng/acorrcfg.hxx> #include "wordvbahelper.hxx" #include <docsh.hxx> +#include "vbalistgalleries.hxx" using namespace ::ooo; using namespace ::ooo::vba; @@ -151,6 +153,16 @@ SwVbaApplication::Dialogs( const uno::Any& index ) throw (uno::RuntimeException) return uno::makeAny( xCol ); } +uno::Any SAL_CALL +SwVbaApplication::ListGalleries( const uno::Any& index ) throw (uno::RuntimeException) +{ + uno::Reference< text::XTextDocument > xTextDoc( getCurrentDocument(), uno::UNO_QUERY_THROW ); + uno::Reference< XCollection > xCol( new SwVbaListGalleries( this, mxContext, xTextDoc ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} + sal_Bool SAL_CALL SwVbaApplication::getDisplayAutoCompleteTips() throw (css::uno::RuntimeException) { return SvxAutoCorrCfg::Get()->IsAutoTextTip(); @@ -201,3 +213,5 @@ SwVbaApplication::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaapplication.hxx b/sw/source/ui/vba/vbaapplication.hxx index 66f9bca50b..9d741013a7 100644 --- a/sw/source/ui/vba/vbaapplication.hxx +++ b/sw/source/ui/vba/vbaapplication.hxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -56,10 +57,11 @@ public: virtual css::uno::Reference< ov::word::XWindow > SAL_CALL getActiveWindow() throw (css::uno::RuntimeException); virtual css::uno::Reference< ooo::vba::word::XOptions > SAL_CALL getOptions() throw (css::uno::RuntimeException); virtual css::uno::Reference< ooo::vba::word::XSelection > SAL_CALL getSelection() throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Documents( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Addins( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Dialogs( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Documents( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Addins( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Dialogs( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL ListGalleries( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual sal_Bool SAL_CALL getDisplayAutoCompleteTips() throw (css::uno::RuntimeException); virtual void SAL_CALL setDisplayAutoCompleteTips( sal_Bool _displayAutoCompleteTips ) throw (css::uno::RuntimeException); virtual sal_Int32 SAL_CALL getEnableCancelKey() throw (css::uno::RuntimeException); @@ -72,3 +74,5 @@ protected: virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() throw (css::uno::RuntimeException); }; #endif /* SW_VBA_APPLICATION_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaautotextentry.cxx b/sw/source/ui/vba/vbaautotextentry.cxx index 5d098a2992..5c302da869 100644 --- a/sw/source/ui/vba/vbaautotextentry.cxx +++ b/sw/source/ui/vba/vbaautotextentry.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,7 +27,9 @@ ************************************************************************/ #include "vbaautotextentry.hxx" #include <vbahelper/vbahelper.hxx> +#include <com/sun/star/text/XParagraphCursor.hpp> #include <tools/diagnose_ex.h> +#include "wordvbahelper.hxx" #include "vbarange.hxx" using namespace ::ooo::vba; @@ -41,7 +44,7 @@ SwVbaAutoTextEntry::~SwVbaAutoTextEntry() { } -uno::Reference< word::XRange > SAL_CALL SwVbaAutoTextEntry::Insert( const uno::Reference< word::XRange >& _where, const uno::Any& /*_richtext*/ ) throw ( uno::RuntimeException ) +uno::Reference< word::XRange > SAL_CALL SwVbaAutoTextEntry::Insert( const uno::Reference< word::XRange >& _where, const uno::Any& _richtext ) throw ( uno::RuntimeException ) { SwVbaRange* pWhere = dynamic_cast<SwVbaRange*>( _where.get() ); if( pWhere ) @@ -55,8 +58,27 @@ uno::Reference< word::XRange > SAL_CALL SwVbaAutoTextEntry::Insert( const uno::R uno::Reference< text::XTextCursor > xTC = xText->createTextCursorByRange( xTextRange->getStart() ); xTC->goRight( 1, sal_True ); xTC->setString( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("") ) ); // remove marker + // remove the blank paragraph if it is a rich text + sal_Bool bRich = sal_False; + _richtext >>= bRich; + if( bRich ) + { + // check if it is a blank paragraph + uno::Reference< text::XParagraphCursor > xParaCursor( xTC, uno::UNO_QUERY_THROW ); + if( xParaCursor->isStartOfParagraph() && xParaCursor->isEndOfParagraph() ) + { + //remove the blank paragraph + uno::Reference< frame::XModel > xModel( getCurrentWordDoc( mxContext ), uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextViewCursor > xTVCursor = word::getXTextViewCursor( xModel ); + uno::Reference< text::XTextRange > xCurrentRange( xTC->getEnd(), uno::UNO_QUERY_THROW ); + xTVCursor->gotoRange( xCurrentRange, sal_False ); + rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Delete")); + dispatchRequests( xModel,url ); + xTVCursor->gotoRange( xEndMarker->getEnd(), sal_False ); + } + } xEndMarker->setString( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("") ) ); // remove marker - xTC->gotoRange( xEndMarker, sal_True ); + xTC = xText->createTextCursorByRange( xEndMarker->getEnd() ); pWhere->setXTextCursor( xTC ); } return uno::Reference< word::XRange >( pWhere ); @@ -95,8 +117,7 @@ SwVbaAutoTextEntries::getElementType() throw (uno::RuntimeException) uno::Reference< container::XEnumeration > SwVbaAutoTextEntries::createEnumeration() throw (uno::RuntimeException) { - uno::Reference< container::XEnumerationAccess > xEnumerationAccess( m_xIndexAccess, uno::UNO_QUERY_THROW ); - return xEnumerationAccess->createEnumeration(); + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); } uno::Any @@ -124,3 +145,5 @@ SwVbaAutoTextEntries::getServiceNames() } return sNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaautotextentry.hxx b/sw/source/ui/vba/vbaautotextentry.hxx index 62575243b4..c37a62f8ca 100644 --- a/sw/source/ui/vba/vbaautotextentry.hxx +++ b/sw/source/ui/vba/vbaautotextentry.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -78,3 +79,5 @@ public: }; #endif /* SW_VBA_AUTOTEXTENTRY_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbabookmark.cxx b/sw/source/ui/vba/vbabookmark.cxx index bb67fac461..e580f946ef 100644 --- a/sw/source/ui/vba/vbabookmark.cxx +++ b/sw/source/ui/vba/vbabookmark.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,12 @@ #include <tools/diagnose_ex.h> #include <com/sun/star/text/XTextDocument.hpp> #include <com/sun/star/text/XTextContent.hpp> +#include <com/sun/star/text/XTextRange.hpp> #include <com/sun/star/text/XTextViewCursor.hpp> #include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> #include "vbarange.hxx" +#include "wordvbahelper.hxx" using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -65,8 +69,8 @@ void SAL_CALL SwVbaBookmark::Delete() throw ( uno::RuntimeException ) void SAL_CALL SwVbaBookmark::Select() throw ( uno::RuntimeException ) { checkVality(); - uno::Reference< text::XTextViewCursorSupplier > xViewCursorSupplier( mxModel->getCurrentController(), uno::UNO_QUERY_THROW ); - xViewCursorSupplier->getViewCursor()->gotoRange( mxBookmark->getAnchor(),sal_False ); + uno::Reference< view::XSelectionSupplier > xSelectSupp( mxModel->getCurrentController(), uno::UNO_QUERY_THROW ); + xSelectSupp->select( uno::makeAny( mxBookmark ) ); } rtl::OUString SAL_CALL SwVbaBookmark::getName() throw ( uno::RuntimeException ) @@ -107,3 +111,4 @@ SwVbaBookmark::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbabookmark.hxx b/sw/source/ui/vba/vbabookmark.hxx index b8af460742..4c17749a5f 100644 --- a/sw/source/ui/vba/vbabookmark.hxx +++ b/sw/source/ui/vba/vbabookmark.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,3 +64,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_BOOKMARK_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbabookmarks.cxx b/sw/source/ui/vba/vbabookmarks.cxx index bccfeeff0e..9c45b8f193 100644 --- a/sw/source/ui/vba/vbabookmarks.cxx +++ b/sw/source/ui/vba/vbabookmarks.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -117,9 +118,6 @@ SwVbaBookmarks::SwVbaBookmarks( const uno::Reference< XHelperInterface >& xParen { mxBookmarksSupplier.set( mxModel, uno::UNO_QUERY_THROW ); uno::Reference< text::XTextDocument > xDocument( mxModel, uno::UNO_QUERY_THROW ); - // use view cursor to insert bookmark, or it will fail if insert bookmark in table - // mxText = xDocument->getText(); - mxText = word::getXTextViewCursor( mxModel )->getText(); } // XEnumerationAccess uno::Type @@ -145,16 +143,16 @@ SwVbaBookmarks::createCollectionObject( const css::uno::Any& aSource ) void SwVbaBookmarks::removeBookmarkByName( const rtl::OUString& rName ) throw (uno::RuntimeException) { uno::Reference< text::XTextContent > xBookmark( m_xNameAccess->getByName( rName ), uno::UNO_QUERY_THROW ); - mxText->removeTextContent( xBookmark ); + word::getXTextViewCursor( mxModel )->getText()->removeTextContent( xBookmark ); } -void SwVbaBookmarks::addBookmarkByName( const rtl::OUString& rName, const uno::Reference< text::XTextRange >& rTextRange ) throw (uno::RuntimeException) +void SwVbaBookmarks::addBookmarkByName( const uno::Reference< frame::XModel >& xModel, const rtl::OUString& rName, const uno::Reference< text::XTextRange >& rTextRange ) throw (uno::RuntimeException) { - uno::Reference< lang::XMultiServiceFactory > xDocMSF( mxModel, uno::UNO_QUERY_THROW ); + uno::Reference< lang::XMultiServiceFactory > xDocMSF( xModel, uno::UNO_QUERY_THROW ); uno::Reference< text::XTextContent > xBookmark( xDocMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Bookmark")) ), uno::UNO_QUERY_THROW ); uno::Reference< container::XNamed > xNamed( xBookmark, uno::UNO_QUERY_THROW ); xNamed->setName( rName ); - mxText->insertTextContent( rTextRange, xBookmark, sal_False ); + rTextRange->getText()->insertTextContent( rTextRange, xBookmark, sal_False ); } uno::Any SAL_CALL @@ -175,12 +173,11 @@ SwVbaBookmarks::Add( const rtl::OUString& rName, const uno::Any& rRange ) throw } // remove the exist bookmark - // rtl::OUString aName = rName.toAsciiLowerCase(); rtl::OUString aName = rName; if( m_xNameAccess->hasByName( aName ) ) removeBookmarkByName( aName ); - addBookmarkByName( aName, xTextRange ); + addBookmarkByName( mxModel, aName, xTextRange ); return uno::makeAny( uno::Reference< word::XBookmark >( new SwVbaBookmark( getParent(), mxContext, mxModel, aName ) ) ); } @@ -234,3 +231,5 @@ SwVbaBookmarks::getServiceNames() } return sNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbabookmarks.hxx b/sw/source/ui/vba/vbabookmarks.hxx index 5efef7a31a..606f57b043 100644 --- a/sw/source/ui/vba/vbabookmarks.hxx +++ b/sw/source/ui/vba/vbabookmarks.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,12 +48,12 @@ private: private: void removeBookmarkByName( const rtl::OUString& rName ) throw (css::uno::RuntimeException); - void addBookmarkByName( const rtl::OUString& rName, const css::uno::Reference< css::text::XTextRange >& rTextRange ) throw (css::uno::RuntimeException); public: SwVbaBookmarks( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::container::XIndexAccess >& xBookmarks, const css::uno::Reference< css::frame::XModel >& xModel ); virtual ~SwVbaBookmarks() {} + static void addBookmarkByName( const css::uno::Reference< css::frame::XModel >& xModel, const rtl::OUString& rName, const css::uno::Reference< css::text::XTextRange >& rTextRange ) throw (css::uno::RuntimeException); // XEnumerationAccess virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); @@ -73,3 +74,5 @@ public: }; #endif /* SW_VBA_BOOKMARKS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaborders.cxx b/sw/source/ui/vba/vbaborders.cxx index 634ab630cd..26d5a6bf18 100644 --- a/sw/source/ui/vba/vbaborders.cxx +++ b/sw/source/ui/vba/vbaborders.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -28,6 +29,7 @@ #include <ooo/vba/word/XBorder.hpp> #include <ooo/vba/word/WdBorderType.hpp> #include <ooo/vba/word/WdLineStyle.hpp> +#include <sal/macros.h> #include <cppuhelper/implbase3.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/table/TableBorder.hpp> @@ -58,7 +60,7 @@ class SwVbaBorder : public SwVbaBorder_Base { private: uno::Reference< beans::XPropertySet > m_xProps; - sal_Int32 m_LineType; + sal_Int32 m_LineType; VbaPalette m_Palette; bool setBorderLine( table::BorderLine& rBorderLine ) { @@ -75,7 +77,7 @@ private: aTableBorder.IsTopLineValid = sal_True; aTableBorder.TopLine = rBorderLine; break; - + case word::WdBorderType::wdBorderBottom: aTableBorder.IsBottomLineValid = sal_True; aTableBorder.BottomLine = rBorderLine; @@ -96,13 +98,13 @@ private: case word::WdBorderType::wdBorderDiagonalUp: // #TODO have to ignore at the momement, would be // nice to investigate what we can do here - break; + break; default: return false; } m_xProps->setPropertyValue( sTableBorder, uno::makeAny(aTableBorder) ); return true; - } + } bool getBorderLine( table::BorderLine& rBorderLine ) { @@ -139,18 +141,18 @@ private: case word::WdBorderType::wdBorderDiagonalUp: // #TODO have to ignore at the momement, would be // nice to investigate what we can do here - break; + break; default: return false; } return true; - } + } SwVbaBorder(); // no impl -protected: +protected: virtual rtl::OUString& getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaBorder") ); - return sImplName; + return sImplName; } virtual css::uno::Sequence<rtl::OUString> getServiceNames() { @@ -160,10 +162,10 @@ protected: aServiceNames.realloc( 1 ); aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Border" ) ); } - return aServiceNames; + return aServiceNames; } public: - SwVbaBorder( const uno::Reference< beans::XPropertySet > & xProps, const uno::Reference< uno::XComponentContext >& xContext, sal_Int32 lineType, VbaPalette& rPalette) : SwVbaBorder_Base( uno::Reference< XHelperInterface >( xProps, uno::UNO_QUERY ), xContext ), m_xProps( xProps ), m_LineType( lineType ), m_Palette( rPalette ) {} + SwVbaBorder( const uno::Reference< beans::XPropertySet > & xProps, const uno::Reference< uno::XComponentContext >& xContext, sal_Int32 lineType, VbaPalette& rPalette) : SwVbaBorder_Base( uno::Reference< XHelperInterface >( xProps, uno::UNO_QUERY ), xContext ), m_xProps( xProps ), m_LineType( lineType ), m_Palette( rPalette ) {} uno::Any SAL_CALL getLineStyle() throw (uno::RuntimeException) { @@ -186,7 +188,7 @@ public: } return uno::makeAny( nLineStyle ); } - void SAL_CALL setLineStyle( const uno::Any& _linestyle ) throw (uno::RuntimeException) + void SAL_CALL setLineStyle( const uno::Any& _linestyle ) throw (uno::RuntimeException) { // Urk no choice but to silently ignore we don't support this attribute // #TODO would be nice to support the word line styles @@ -265,14 +267,14 @@ public: RangeBorders( const uno::Reference< table::XCellRange >& xRange, const uno::Reference< uno::XComponentContext > & xContext, VbaPalette& rPalette ) : m_xRange( xRange ), m_xContext( xContext ), m_Palette( rPalette ) { } - // XIndexAccess + // XIndexAccess virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) { - return sizeof( supportedIndexTable ) / sizeof( supportedIndexTable[0] ); + return SAL_N_ELEMENTS( supportedIndexTable ); } - virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) + virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) { - + sal_Int32 nIndex = getTableIndex( Index ); if ( nIndex >= 0 && nIndex < getCount() ) { @@ -291,7 +293,7 @@ public: } }; -uno::Reference< container::XIndexAccess > +uno::Reference< container::XIndexAccess > rangeToBorderIndexAccess( const uno::Reference< table::XCellRange >& xRange, const uno::Reference< uno::XComponentContext > & xContext, VbaPalette& rPalette ) { return new RangeBorders( xRange, xContext, rPalette ); @@ -334,7 +336,7 @@ SwVbaBorders::createCollectionObject( const css::uno::Any& aSource ) return aSource; // its already a Border object } -uno::Type +uno::Type SwVbaBorders::getElementType() throw (uno::RuntimeException) { return word::XBorders::static_type(0); @@ -348,24 +350,24 @@ SwVbaBorders::getItemByIntIndex( const sal_Int32 nIndex ) throw (uno::RuntimeEx sal_Bool SAL_CALL SwVbaBorders::getShadow() throw (uno::RuntimeException) { - table::ShadowFormat aShadowFormat; - m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ShadowFormat") ) ) >>= aShadowFormat; - return ( aShadowFormat.Location != table::ShadowLocation_NONE ); + // always return False for table border in MS Word + return sal_False; } void SAL_CALL SwVbaBorders::setShadow( sal_Bool /*_shadow*/ ) throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + // not support in Table border in Word + // TODO: } -rtl::OUString& +rtl::OUString& SwVbaBorders::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaBorders") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > SwVbaBorders::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -376,3 +378,5 @@ SwVbaBorders::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaborders.hxx b/sw/source/ui/vba/vbaborders.hxx index a64ba27654..17f4fe5f6d 100644 --- a/sw/source/ui/vba/vbaborders.hxx +++ b/sw/source/ui/vba/vbaborders.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,3 +62,4 @@ public: #endif //SW_VBA_BORDERS_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbacell.cxx b/sw/source/ui/vba/vbacell.cxx new file mode 100644 index 0000000000..cbba50de68 --- /dev/null +++ b/sw/source/ui/vba/vbacell.cxx @@ -0,0 +1,119 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbacell.hxx" +#include <vbahelper/vbahelper.hxx> +#include <tools/diagnose_ex.h> +#include "vbatable.hxx" +#include <com/sun/star/table/XCellRange.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> +#include <rtl/ustrbuf.hxx> +#include "wordvbahelper.hxx" +#include "vbatablehelper.hxx" +#include "vbarow.hxx" + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +SwVbaCell::SwVbaCell( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nColumn, sal_Int32 nRow ) throw ( uno::RuntimeException ) : + SwVbaCell_BASE( rParent, rContext ), mxTextTable( xTextTable ), mnColumn( nColumn ), mnRow( nRow ) +{ +} + +SwVbaCell::~SwVbaCell() +{ +} + +::sal_Int32 SAL_CALL SwVbaCell::getWidth() throw (css::uno::RuntimeException) +{ + SwVbaTableHelper aTableHelper( mxTextTable ); + return aTableHelper.GetColWidth( mnColumn, mnRow, sal_True ); +} + +void SAL_CALL SwVbaCell::setWidth( ::sal_Int32 _width ) throw (css::uno::RuntimeException) +{ + SwVbaTableHelper aTableHelper( mxTextTable ); + aTableHelper.SetColWidth( _width, mnColumn, mnRow, sal_True ); +} + +uno::Any SAL_CALL SwVbaCell::getHeight() throw (css::uno::RuntimeException) +{ + uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, mnRow ) ); + return xRow->getHeight(); +} + +void SAL_CALL SwVbaCell::setHeight( const uno::Any& _height ) throw (css::uno::RuntimeException) +{ + uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, mnRow ) ); + xRow->setHeight( _height ); +} + +::sal_Int32 SAL_CALL SwVbaCell::getHeightRule() throw (css::uno::RuntimeException) +{ + uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, mnRow ) ); + return xRow->getHeightRule(); +} + +void SAL_CALL SwVbaCell::setHeightRule( ::sal_Int32 _heightrule ) throw (css::uno::RuntimeException) +{ + uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, mnRow ) ); + xRow->setHeightRule( _heightrule ); +} + +void SAL_CALL SwVbaCell::SetWidth( float width, sal_Int32 /*rulestyle*/ ) throw (css::uno::RuntimeException) +{ + // FIXME: handle the argument: rulestyle + setWidth( width ); +} + +void SAL_CALL SwVbaCell::SetHeight( float height, sal_Int32 heightrule ) throw (css::uno::RuntimeException) +{ + // FIXME: handle the argument: heightrule + setHeightRule( heightrule ); + setHeight( uno::makeAny( height ) ); +} + +rtl::OUString& +SwVbaCell::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaCell") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +SwVbaCell::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Cell" ) ); + } + return aServiceNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbacell.hxx b/sw/source/ui/vba/vbacell.hxx new file mode 100644 index 0000000000..1e26b79440 --- /dev/null +++ b/sw/source/ui/vba/vbacell.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_CELL_HXX +#define SW_VBA_CELL_HXX + +#include <ooo/vba/word/XCell.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/text/XTextTable.hpp> + +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XCell > SwVbaCell_BASE; + +class SwVbaCell : public SwVbaCell_BASE +{ +private: + css::uno::Reference< css::text::XTextTable > mxTextTable; + sal_Int32 mnColumn; + sal_Int32 mnRow; + +public: + SwVbaCell( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nColumn, sal_Int32 nRow ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaCell(); + + // Attributes + virtual ::sal_Int32 SAL_CALL getWidth() throw (css::uno::RuntimeException); + virtual void SAL_CALL setWidth( ::sal_Int32 _width ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getHeight() throw (css::uno::RuntimeException); + virtual void SAL_CALL setHeight( const css::uno::Any& _height ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getHeightRule() throw (css::uno::RuntimeException); + virtual void SAL_CALL setHeightRule( ::sal_Int32 _heightrule ) throw (css::uno::RuntimeException); + + // Methods + virtual void SAL_CALL SetWidth( float width, sal_Int32 rulestyle ) throw (css::uno::RuntimeException); + virtual void SAL_CALL SetHeight( float height, sal_Int32 heightrule ) throw (css::uno::RuntimeException); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif /* SW_VBA_CELL_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbacells.cxx b/sw/source/ui/vba/vbacells.cxx new file mode 100644 index 0000000000..a104ea29c1 --- /dev/null +++ b/sw/source/ui/vba/vbacells.cxx @@ -0,0 +1,223 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbacells.hxx" +#include "vbacell.hxx" +#include "wordvbahelper.hxx" +#include "vbatablehelper.hxx" +#include "vbarow.hxx" + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XEnumerationAccess > CellCollectionHelper_Base; + +class CellsEnumWrapper : public EnumerationHelper_BASE +{ + uno::Reference< container::XIndexAccess > mxIndexAccess; + sal_Int32 nIndex; + +public: + CellsEnumWrapper( const uno::Reference< container::XIndexAccess >& xIndexAccess ) : mxIndexAccess( xIndexAccess ), nIndex( 0 ) + { + } + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { + return ( nIndex < mxIndexAccess->getCount() ); + } + + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if( nIndex < mxIndexAccess->getCount() ) + { + return mxIndexAccess->getByIndex( nIndex++ ); + } + throw container::NoSuchElementException(); + } +}; + +class CellCollectionHelper : public CellCollectionHelper_Base +{ +private: + uno::Reference< XHelperInterface > mxParent; + uno::Reference< uno::XComponentContext > mxContext; + uno::Reference< css::text::XTextTable > mxTextTable; + sal_Int32 mnLeft; + sal_Int32 mnTop; + sal_Int32 mnRight; + sal_Int32 mnBottom; + +public: + CellCollectionHelper( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) throw ( css::uno::RuntimeException ): mxParent( xParent ), mxContext( xContext ), mxTextTable( xTextTable ), mnLeft( nLeft ), mnTop( nTop ), mnRight( nRight ), mnBottom( nBottom ) + { + } + virtual ~CellCollectionHelper() {} + + virtual sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) + { + return ( mnRight - mnLeft + 1 ) * ( mnBottom - mnTop + 1 ); + } + virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( Index < 0 || Index >= getCount() ) + throw css::lang::IndexOutOfBoundsException(); + + for( sal_Int32 row = mnTop; row <= mnBottom; row++ ) + { + for( sal_Int32 col = mnLeft; col <= mnRight; col++ ) + { + if( Index == ( ( row - mnTop ) * ( mnRight - mnLeft + 1 ) + ( col - mnLeft ) ) ) + return uno::makeAny( uno::Reference< word::XCell >( new SwVbaCell( mxParent, mxContext, mxTextTable, col, row ) ) ); + } + } + throw css::lang::IndexOutOfBoundsException(); + + } + virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) + { + return word::XCell::static_type(0); + } + virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) + { + return sal_True; + } + // XEnumerationAccess + virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException) + { + return new CellsEnumWrapper( this ); + } +}; + +SwVbaCells::SwVbaCells( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) throw (uno::RuntimeException) : SwVbaCells_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new CellCollectionHelper( xParent, xContext, xTextTable, nLeft, nTop, nRight, nBottom ) ) ), mxTextTable( xTextTable ), mnLeft( nLeft ), mnTop( nTop ), mnRight( nRight ), mnBottom( nBottom ) +{ +} + +::sal_Int32 SAL_CALL SwVbaCells::getWidth() throw (css::uno::RuntimeException) +{ + uno::Reference< word::XCell > xCell( m_xIndexAccess->getByIndex( 0 ), uno::UNO_QUERY_THROW ); + return xCell->getWidth(); +} + +void SAL_CALL SwVbaCells::setWidth( ::sal_Int32 _width ) throw (css::uno::RuntimeException) +{ + sal_Int32 nIndex = 0; + while( nIndex < m_xIndexAccess->getCount() ) + { + uno::Reference< word::XCell > xCell( m_xIndexAccess->getByIndex( nIndex++ ), uno::UNO_QUERY_THROW ); + xCell->setWidth( _width ); + } +} + +uno::Any SAL_CALL SwVbaCells::getHeight() throw (css::uno::RuntimeException) +{ + uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, mnTop ) ); + return xRow->getHeight(); +} + +void SAL_CALL SwVbaCells::setHeight( const uno::Any& _height ) throw (css::uno::RuntimeException) +{ + for( sal_Int32 row = mnTop; row <= mnBottom; row++ ) + { + uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, row ) ); + xRow->setHeight( _height ); + } +} + +::sal_Int32 SAL_CALL SwVbaCells::getHeightRule() throw (css::uno::RuntimeException) +{ + uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, mnTop ) ); + return xRow->getHeightRule(); +} + +void SAL_CALL SwVbaCells::setHeightRule( ::sal_Int32 _heightrule ) throw (css::uno::RuntimeException) +{ + for( sal_Int32 row = mnTop; row <= mnBottom; row++ ) + { + uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, row ) ); + xRow->setHeightRule( _heightrule ); + } +} + +void SAL_CALL SwVbaCells::SetWidth( float width, sal_Int32 rulestyle ) throw (css::uno::RuntimeException) +{ + sal_Int32 nIndex = 0; + while( nIndex < m_xIndexAccess->getCount() ) + { + uno::Reference< word::XCell > xCell( m_xIndexAccess->getByIndex( nIndex++ ), uno::UNO_QUERY_THROW ); + xCell->SetWidth( width, rulestyle ); + } +} + +void SAL_CALL SwVbaCells::SetHeight( float height, sal_Int32 heightrule ) throw (css::uno::RuntimeException) +{ + for( sal_Int32 row = mnTop; row <= mnBottom; row++ ) + { + uno::Reference< word::XRow > xRow( new SwVbaRow( getParent(), mxContext, mxTextTable, row ) ); + xRow->SetHeight( height, heightrule ); + } +} + +// XEnumerationAccess +uno::Type +SwVbaCells::getElementType() throw (uno::RuntimeException) +{ + return word::XCell::static_type(0); +} + +uno::Reference< container::XEnumeration > +SwVbaCells::createEnumeration() throw (uno::RuntimeException) +{ + uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xIndexAccess, uno::UNO_QUERY_THROW ); + return xEnumAccess->createEnumeration(); +} + +uno::Any +SwVbaCells::createCollectionObject( const uno::Any& aSource ) +{ + return aSource; +} + +rtl::OUString& +SwVbaCells::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaCells") ); + return sImplName; +} + +uno::Sequence<rtl::OUString> +SwVbaCells::getServiceNames() +{ + static uno::Sequence< rtl::OUString > sNames; + if ( sNames.getLength() == 0 ) + { + sNames.realloc( 1 ); + sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Cells") ); + } + return sNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbacells.hxx b/sw/source/ui/vba/vbacells.hxx new file mode 100644 index 0000000000..e3fe940aa2 --- /dev/null +++ b/sw/source/ui/vba/vbacells.hxx @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_CELLS_HXX +#define SW_VBA_CELLS_HXX + +#include <vbahelper/vbacollectionimpl.hxx> +#include <ooo/vba/word/XCells.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <com/sun/star/text/XTextTable.hpp> + +typedef CollTestImplHelper< ooo::vba::word::XCells > SwVbaCells_BASE; + +class SwVbaCells : public SwVbaCells_BASE +{ +private: + css::uno::Reference< css::text::XTextTable > mxTextTable; + sal_Int32 mnLeft; + sal_Int32 mnTop; + sal_Int32 mnRight; + sal_Int32 mnBottom; + +public: + SwVbaCells( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaCells() {} + + // Attributes + virtual ::sal_Int32 SAL_CALL getWidth() throw (css::uno::RuntimeException); + virtual void SAL_CALL setWidth( ::sal_Int32 _width ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getHeight() throw (css::uno::RuntimeException); + virtual void SAL_CALL setHeight( const css::uno::Any& _height ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getHeightRule() throw (css::uno::RuntimeException); + virtual void SAL_CALL setHeightRule( ::sal_Int32 _heightrule ) throw (css::uno::RuntimeException); + + // Methods + virtual void SAL_CALL SetWidth( float width, sal_Int32 rulestyle ) throw (css::uno::RuntimeException); + virtual void SAL_CALL SetHeight( float height, sal_Int32 heightrule ) throw (css::uno::RuntimeException); + + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + + // SwVbaCells_BASE + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif /* SW_VBA_CELLS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbacheckbox.cxx b/sw/source/ui/vba/vbacheckbox.cxx new file mode 100644 index 0000000000..65b55a3142 --- /dev/null +++ b/sw/source/ui/vba/vbacheckbox.cxx @@ -0,0 +1,97 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbacheckbox.hxx" +#include <vbahelper/vbahelper.hxx> +#include <tools/diagnose_ex.h> +#include <com/sun/star/text/XTextDocument.hpp> +#include <com/sun/star/text/XTextContent.hpp> +#include <com/sun/star/text/XTextViewCursor.hpp> +#include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <ecmaflds.hxx> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +SwVbaCheckBox::SwVbaCheckBox( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< frame::XModel >& rModel, const uno::Reference< text::XFormField >& xFormField ) throw ( uno::RuntimeException ) : SwVbaCheckBox_BASE( rParent, rContext ), mxModel( rModel ), mxFormField( xFormField ) +{ + rtl::OUString sType = mxFormField->getFieldType(); + if( !sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMCHECKBOX ) ) + { + throw uno::RuntimeException( rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("It is not a CheckBox")), uno::Reference< uno::XInterface >() ); + } +} + +SwVbaCheckBox::~SwVbaCheckBox() +{ +} + +sal_Bool SAL_CALL SwVbaCheckBox::getValue() throw ( uno::RuntimeException ) +{ + sal_Bool bValue = sal_False; + sal_Int32 nCount = mxFormField->getParamCount(); + for( sal_Int32 i = 0; i < nCount; i++ ) + { + if( mxFormField->getParamName(i).equalsIgnoreAsciiCaseAscii( ECMA_FORMCHECKBOX_CHECKED ) ) + { + if( mxFormField->getParamValue(i).equalsIgnoreAsciiCaseAscii("on") ) + bValue = sal_True; + else + bValue = sal_False; + break; + } + } + return bValue; +} + +void SAL_CALL SwVbaCheckBox::setValue( sal_Bool value ) throw ( uno::RuntimeException ) +{ + rtl::OUString sValue = value ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("on")) : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("off")); + mxFormField->addParam( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ECMA_FORMCHECKBOX_CHECKED )), sValue, sal_True ); +} + +rtl::OUString& +SwVbaCheckBox::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaCheckBox") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +SwVbaCheckBox::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.CheckBox" ) ); + } + return aServiceNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbacheckbox.hxx b/sw/source/ui/vba/vbacheckbox.hxx new file mode 100644 index 0000000000..e8e4da8e2e --- /dev/null +++ b/sw/source/ui/vba/vbacheckbox.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_CHECKBOX_HXX +#define SW_VBA_CHECKBOX_HXX + +#include <ooo/vba/word/XCheckBox.hpp> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/text/XFormField.hpp> +#include <vbahelper/vbahelperinterface.hxx> + +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XCheckBox > SwVbaCheckBox_BASE; + +class SwVbaCheckBox : public SwVbaCheckBox_BASE +{ +private: + css::uno::Reference< css::frame::XModel > mxModel; + css::uno::Reference< css::text::XFormField > mxFormField; + +public: + SwVbaCheckBox( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const css::uno::Reference< css::text::XFormField >& xFormField ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaCheckBox(); + + // Methods + sal_Bool SAL_CALL getValue() throw ( css::uno::RuntimeException ); + void SAL_CALL setValue( sal_Bool value ) throw ( css::uno::RuntimeException ); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif /* SW_VBA_CHECKBOX_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbacolumn.cxx b/sw/source/ui/vba/vbacolumn.cxx new file mode 100644 index 0000000000..86b2f27dae --- /dev/null +++ b/sw/source/ui/vba/vbacolumn.cxx @@ -0,0 +1,165 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbacolumn.hxx" +#include <vbahelper/vbahelper.hxx> +#include <tools/diagnose_ex.h> +#include "vbatable.hxx" +#include <com/sun/star/table/XCellRange.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> +#include <rtl/ustrbuf.hxx> +#include "wordvbahelper.hxx" +#include "vbatablehelper.hxx" + +#define RELATIVE_TABLE_WIDTH 10000 + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +SwVbaColumn::SwVbaColumn( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nIndex ) throw ( uno::RuntimeException ) : + SwVbaColumn_BASE( rParent, rContext ), mxTextTable( xTextTable ), mnIndex( nIndex ) +{ + mxTableColumns = mxTextTable->getColumns(); +} + +SwVbaColumn::~SwVbaColumn() +{ +} + +void SwVbaColumn::calculateAbsoluteColumnWidth( sal_Int32 nTableWidth, const css::uno::Sequence< css::text::TableColumnSeparator >& aSeparators, double* pAbsWidth ) +{ + const text::TableColumnSeparator* pArray = aSeparators.getConstArray(); + sal_Int32 nSepCount = aSeparators.getLength(); + for( sal_Int32 i = 0; i <= nSepCount; i++ ) + { + sal_Int32 nRelColWidth = 0; + if( i == 0 ) + { + if( nSepCount != 0 ) + { + nRelColWidth = pArray[0].Position; + } + else + { + nRelColWidth = RELATIVE_TABLE_WIDTH; + } + } + else + { + if( i == nSepCount ) + { + nRelColWidth = RELATIVE_TABLE_WIDTH - pArray[i-1].Position; + } + else + { + nRelColWidth = pArray[i].Position - pArray[i-1].Position; + } + } + pAbsWidth[i] = ( (double)nRelColWidth / RELATIVE_TABLE_WIDTH ) * (double) nTableWidth; + } +} + +void SwVbaColumn::calculateRelativeColumnWidth( const double* pAbsWidth, double* pRelWidth, sal_Int32 nCount ) +{ + double tableWidth = 0.0; + for( sal_Int32 i = 0; i < nCount; i++ ) + { + tableWidth += pAbsWidth[i]; + } + + pRelWidth[ nCount - 1 ] = tableWidth; + for( sal_Int32 i = 0; i < nCount - 1; i++ ) + { + if( i == 0 ) + { + pRelWidth[i] = ( pAbsWidth[i] * RELATIVE_TABLE_WIDTH ) / tableWidth; + } + else + { + pRelWidth[i] = pRelWidth[i-1] + ( pAbsWidth[i] * RELATIVE_TABLE_WIDTH ) / tableWidth; + } + } +} + +sal_Int32 SAL_CALL +SwVbaColumn::getWidth( ) throw ( css::uno::RuntimeException ) +{ + SwVbaTableHelper aTableHelper( mxTextTable ); + return aTableHelper.GetColWidth( mnIndex ); +} + +void SAL_CALL +SwVbaColumn::setWidth( sal_Int32 _width ) throw ( css::uno::RuntimeException ) +{ + + SwVbaTableHelper aTableHelper( mxTextTable ); + aTableHelper.SetColWidth( _width, mnIndex ); +} + +void SAL_CALL +SwVbaColumn::Select( ) throw ( uno::RuntimeException ) +{ + SelectColumn( getCurrentWordDoc(mxContext), mxTextTable, mnIndex, mnIndex ); +} + +void SwVbaColumn::SelectColumn( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nStartColumn, sal_Int32 nEndColumn ) throw ( uno::RuntimeException ) +{ + rtl::OUStringBuffer aRangeName; + rtl::OUString sStartCol = SwVbaTableHelper::getColumnStr( nStartColumn ); + aRangeName.append(sStartCol).append(sal_Int32( 1 ) ); + rtl::OUString sEndCol = SwVbaTableHelper::getColumnStr( nEndColumn ); + sal_Int32 nRowCount = xTextTable->getRows()->getCount(); + aRangeName.appendAscii(":").append( sEndCol ).append( sal_Int32( nRowCount ) ); + + uno::Reference< table::XCellRange > xCellRange( xTextTable, uno::UNO_QUERY_THROW ); + rtl::OUString sSelRange = aRangeName.makeStringAndClear(); + uno::Reference< table::XCellRange > xSelRange = xCellRange->getCellRangeByName( sSelRange ); + + uno::Reference< view::XSelectionSupplier > xSelection( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); + xSelection->select( uno::makeAny( xSelRange ) ); +} + +rtl::OUString& +SwVbaColumn::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaColumn") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +SwVbaColumn::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Column" ) ); + } + return aServiceNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbacolumn.hxx b/sw/source/ui/vba/vbacolumn.hxx new file mode 100644 index 0000000000..3ab42d6491 --- /dev/null +++ b/sw/source/ui/vba/vbacolumn.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_COLUMN_HXX +#define SW_VBA_COLUMN_HXX + +#include <ooo/vba/word/XColumn.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/table/XTableColumns.hpp> +#include <com/sun/star/text/XTextTable.hpp> +#include <com/sun/star/text/TableColumnSeparator.hpp> + +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XColumn > SwVbaColumn_BASE; + +class SwVbaColumn : public SwVbaColumn_BASE +{ +private: + css::uno::Reference< css::text::XTextTable > mxTextTable; + css::uno::Reference< css::table::XTableColumns > mxTableColumns; + sal_Int32 mnIndex; + +private: + void calculateAbsoluteColumnWidth( sal_Int32 nTableWidth, const css::uno::Sequence< css::text::TableColumnSeparator >& aSeparators, double* pAbsWidth ); + void calculateRelativeColumnWidth( const double* pAbsWidth, double* pRelWidth, sal_Int32 nCount ); + +public: + SwVbaColumn( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nIndex ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaColumn(); + + // Methods + virtual sal_Int32 SAL_CALL getWidth() throw ( css::uno::RuntimeException ); + virtual void SAL_CALL setWidth( sal_Int32 _width ) throw ( css::uno::RuntimeException ); + virtual void SAL_CALL Select( ) throw (css::uno::RuntimeException); + + static void SelectColumn( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nStartColumn, sal_Int32 nEndColumn ) throw (css::uno::RuntimeException); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif /* SW_VBA_COLUMN_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbacolumns.cxx b/sw/source/ui/vba/vbacolumns.cxx new file mode 100644 index 0000000000..1d8cc55fc4 --- /dev/null +++ b/sw/source/ui/vba/vbacolumns.cxx @@ -0,0 +1,160 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbacolumns.hxx" +#include "vbacolumn.hxx" +#include <com/sun/star/text/HoriOrientation.hpp> +#include <com/sun/star/table/XCellRange.hpp> +#include <ooo/vba/word/WdConstants.hpp> +#include <ooo/vba/word/WdRulerStyle.hpp> +#include "wordvbahelper.hxx" +#include "vbatablehelper.hxx" + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +class ColumnsEnumWrapper : public EnumerationHelper_BASE +{ + uno::WeakReference< XHelperInterface > mxParent; + uno::Reference< uno::XComponentContext > mxContext; + uno::Reference< text::XTextTable > mxTextTable; + uno::Reference< container::XIndexAccess > mxIndexAccess; + sal_Int32 nIndex; + +public: + ColumnsEnumWrapper( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< text::XTextTable >& xTextTable ) : mxParent( xParent ), mxContext( xContext ), mxTextTable( xTextTable ), nIndex( 0 ) + { + mxIndexAccess.set( mxTextTable->getColumns(), uno::UNO_QUERY ); + } + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { + return ( nIndex < mxIndexAccess->getCount() ); + } + + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if( nIndex < mxIndexAccess->getCount() ) + { + return uno::makeAny( uno::Reference< word::XColumn > ( new SwVbaColumn( mxParent, mxContext, mxTextTable, nIndex++ ) ) ); + } + throw container::NoSuchElementException(); + } +}; + +SwVbaColumns::SwVbaColumns( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, const uno::Reference< table::XTableColumns >& xTableColumns ) throw (uno::RuntimeException) : SwVbaColumns_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xTableColumns, uno::UNO_QUERY_THROW ) ), mxTextTable( xTextTable ), mxTableColumns( xTableColumns ) +{ + mnStartColumnIndex = 0; + SwVbaTableHelper aTableHelper( mxTextTable ); + mnEndColumnIndex = aTableHelper.getTabColumnsMaxCount( ) - 1; +} + +SwVbaColumns::SwVbaColumns( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, const uno::Reference< table::XTableColumns >& xTableColumns, sal_Int32 nStartCol, sal_Int32 nEndCol ) throw (uno::RuntimeException) : SwVbaColumns_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xTableColumns, uno::UNO_QUERY_THROW ) ), mxTextTable( xTextTable ), mxTableColumns( xTableColumns ), mnStartColumnIndex( nStartCol ), mnEndColumnIndex( nEndCol ) +{ + if( mnEndColumnIndex < mnStartColumnIndex ) + throw uno::RuntimeException(); +} + +uno::Reference< word::XColumn > SwVbaColumns::getColumnAtIndex( sal_Int32 index ) throw (uno::RuntimeException) +{ + return uno::Reference< word::XColumn >( new SwVbaColumn( this, mxContext, mxTextTable, index ) ); +} + +::sal_Int32 SAL_CALL SwVbaColumns::getWidth() throw (uno::RuntimeException) +{ + return getColumnAtIndex( mnStartColumnIndex )->getWidth(); +} + +void SAL_CALL SwVbaColumns::setWidth( ::sal_Int32 _width ) throw (uno::RuntimeException) +{ + for( sal_Int32 index = mnStartColumnIndex; index <= mnEndColumnIndex; index++ ) + { + getColumnAtIndex( index )->setWidth( _width ); + } +} + +void SAL_CALL SwVbaColumns::Select( ) throw (uno::RuntimeException) +{ + SwVbaColumn::SelectColumn( getCurrentWordDoc(mxContext), mxTextTable, mnStartColumnIndex, mnEndColumnIndex ); +} + +::sal_Int32 SAL_CALL SwVbaColumns::getCount() throw (uno::RuntimeException) +{ + return ( mnEndColumnIndex - mnStartColumnIndex + 1 ); +} + +uno::Any SAL_CALL SwVbaColumns::Item( const uno::Any& Index1, const uno::Any& /*not processed in this base class*/ ) throw (uno::RuntimeException) +{ + sal_Int32 nIndex = 0; + if( ( Index1 >>= nIndex ) == sal_True ) + { + if( nIndex <= 0 || nIndex > getCount() ) + { + throw lang::IndexOutOfBoundsException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() ); + } + return uno::makeAny( uno::Reference< word::XColumn >( new SwVbaColumn( this, mxContext, mxTextTable, nIndex - 1 ) ) ); + } + throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() ); +} + +// XEnumerationAccess +uno::Type +SwVbaColumns::getElementType() throw (uno::RuntimeException) +{ + return word::XColumn::static_type(0); +} +uno::Reference< container::XEnumeration > +SwVbaColumns::createEnumeration() throw (uno::RuntimeException) +{ + return new ColumnsEnumWrapper( this, mxContext, mxTextTable ); +} + +uno::Any +SwVbaColumns::createCollectionObject( const uno::Any& aSource ) +{ + return aSource; +} + +rtl::OUString& +SwVbaColumns::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaColumns") ); + return sImplName; +} + +uno::Sequence<rtl::OUString> +SwVbaColumns::getServiceNames() +{ + static uno::Sequence< rtl::OUString > sNames; + if ( sNames.getLength() == 0 ) + { + sNames.realloc( 1 ); + sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Columns") ); + } + return sNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbacolumns.hxx b/sw/source/ui/vba/vbacolumns.hxx new file mode 100644 index 0000000000..f6f14ea098 --- /dev/null +++ b/sw/source/ui/vba/vbacolumns.hxx @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_COLUMNS_HXX +#define SW_VBA_COLUMNS_HXX + +#include <vbahelper/vbacollectionimpl.hxx> +#include <ooo/vba/word/XColumns.hpp> +#include <ooo/vba/word/XColumn.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <com/sun/star/table/XTableColumns.hpp> +#include <com/sun/star/text/XTextTable.hpp> + +typedef CollTestImplHelper< ooo::vba::word::XColumns > SwVbaColumns_BASE; + +class SwVbaColumns : public SwVbaColumns_BASE +{ +private: + css::uno::Reference< css::text::XTextTable > mxTextTable; + css::uno::Reference< css::table::XTableColumns > mxTableColumns; + sal_Int32 mnStartColumnIndex; + sal_Int32 mnEndColumnIndex; + +private: + css::uno::Reference< ooo::vba::word::XColumn > getColumnAtIndex( sal_Int32 index ) throw (css::uno::RuntimeException); + +public: + SwVbaColumns( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, const css::uno::Reference< css::table::XTableColumns >& xTableColumns ) throw ( css::uno::RuntimeException ); + SwVbaColumns( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, const css::uno::Reference< css::table::XTableColumns >& xTableColumns, sal_Int32 nStartCol, sal_Int32 nEndCol ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaColumns() {} + + virtual sal_Int32 SAL_CALL getWidth( ) throw (css::uno::RuntimeException); + virtual void SAL_CALL setWidth( sal_Int32 _width ) throw (css::uno::RuntimeException); + virtual void SAL_CALL Select( ) throw (css::uno::RuntimeException); + + //XCollection + virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/ ) throw ( css::uno::RuntimeException ); + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + + // SwVbaColumns_BASE + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif /* SW_VBA_COLUMNS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbadialog.cxx b/sw/source/ui/vba/vbadialog.cxx index 0e96be4c15..adcc464e9e 100644 --- a/sw/source/ui/vba/vbadialog.cxx +++ b/sw/source/ui/vba/vbadialog.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -76,3 +77,5 @@ SwVbaDialog::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbadialog.hxx b/sw/source/ui/vba/vbadialog.hxx index 41f066a938..f4f8d1b5bd 100644 --- a/sw/source/ui/vba/vbadialog.hxx +++ b/sw/source/ui/vba/vbadialog.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,3 +49,5 @@ public: }; #endif /* SW_VBA_DIALOG_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbadialogs.cxx b/sw/source/ui/vba/vbadialogs.cxx index b52fe83a27..7db0dafdd5 100644 --- a/sw/source/ui/vba/vbadialogs.cxx +++ b/sw/source/ui/vba/vbadialogs.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -59,3 +60,4 @@ SwVbaDialogs::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbadialogs.hxx b/sw/source/ui/vba/vbadialogs.hxx index 224a50cb08..ff6a0748de 100644 --- a/sw/source/ui/vba/vbadialogs.hxx +++ b/sw/source/ui/vba/vbadialogs.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -51,3 +52,5 @@ public: }; #endif /* SW_VBA_DIALOGS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx index 98692d56ca..36b9d8e104 100644 --- a/sw/source/ui/vba/vbadocument.cxx +++ b/sw/source/ui/vba/vbadocument.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,9 +37,10 @@ #include <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/drawing/XControlShape.hpp> -#include <com/sun/star/drawing/XControlShape.hpp> #include <com/sun/star/form/XFormsSupplier.hpp> +#include <com/sun/star/document/XRedlinesSupplier.hpp> #include <ooo/vba/XControlProvider.hpp> +#include <ooo/vba/word/WdProtectionType.hpp> #include <vbahelper/helperdecl.hxx> #include <wordvbahelper.hxx> @@ -50,7 +52,14 @@ #include "vbafield.hxx" #include "vbapagesetup.hxx" #include "vbasections.hxx" +#include "vbatablesofcontents.hxx" #include <vbahelper/vbashapes.hxx> +#include <vbahelper/vbahelper.hxx> +#include "vbarevisions.hxx" +#include "vbaframes.hxx" +#include "vbaformfields.hxx" +#include <osl/file.hxx> +#include <tools/urlobj.hxx> using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -200,7 +209,6 @@ uno::Any SAL_CALL SwVbaDocument::Shapes( const uno::Any& index ) throw (uno::RuntimeException) { uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( getModel(), uno::UNO_QUERY_THROW ); - //uno::Reference< drawing::XShapes > xShapes( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW ); uno::Reference< XCollection > xCol( new ScVbaShapes( this, mxContext, xIndexAccess, xModel ) ); @@ -220,6 +228,22 @@ SwVbaDocument::Sections( const uno::Any& index ) throw (uno::RuntimeException) } uno::Any SAL_CALL +SwVbaDocument::TablesOfContents( const uno::Any& index ) throw (uno::RuntimeException) +{ + uno::Reference< XCollection > xCol( new SwVbaTablesOfContents( this, mxContext, mxTextDocument ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} + +uno::Any SAL_CALL +SwVbaDocument::FormFields( const uno::Any& /*index*/ ) throw (uno::RuntimeException) +{ + uno::Reference< XCollection > xCol; + return uno::makeAny( xCol ); +} + +uno::Any SAL_CALL SwVbaDocument::PageSetup( ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xPageProps( word::getCurrentPageStyle( mxModel ), uno::UNO_QUERY_THROW ); @@ -239,16 +263,34 @@ SwVbaDocument::getAttachedTemplate() throw (uno::RuntimeException) uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( getModel(), uno::UNO_QUERY_THROW ); uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW ); uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW ); - rtl::OUString sTemplateName = xDocProps->getTemplateName(); + rtl::OUString sTemplateUrl = xDocProps->getTemplateURL(); - xTemplate = new SwVbaTemplate( this, mxContext, getModel(), sTemplateName ); + xTemplate = new SwVbaTemplate( this, mxContext, getModel(), sTemplateUrl ); return uno::makeAny( xTemplate ); } void SAL_CALL -SwVbaDocument::setAttachedTemplate( const css::uno::Any& /*_attachedtemplate*/ ) throw (uno::RuntimeException) +SwVbaDocument::setAttachedTemplate( const css::uno::Any& _attachedtemplate ) throw (uno::RuntimeException) { - throw uno::RuntimeException(); + rtl::OUString sTemplate; + if( !( _attachedtemplate >>= sTemplate ) ) + { + throw uno::RuntimeException(); + } + rtl::OUString aURL; + INetURLObject aObj; + aObj.SetURL( sTemplate ); + bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + if ( bIsURL ) + aURL = sTemplate; + else + osl::FileBase::getFileURLFromSystemPath( sTemplate, aURL ); + + uno::Reference< word::XTemplate > xTemplate; + uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( getModel(), uno::UNO_QUERY_THROW ); + uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW ); + uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW ); + xDocProps->setTemplateURL( aURL ); } uno::Any SAL_CALL @@ -267,6 +309,116 @@ void SAL_CALL SwVbaDocument::Activate() throw (uno::RuntimeException) VbaDocumentBase::Activate(); } +::sal_Int32 SAL_CALL SwVbaDocument::getProtectionType() throw (css::uno::RuntimeException) +{ + //TODO + return word::WdProtectionType::wdNoProtection; +} + +void SAL_CALL SwVbaDocument::setProtectionType( ::sal_Int32 /*_protectiontype*/ ) throw (css::uno::RuntimeException) +{ + //TODO +} + +::sal_Bool SAL_CALL SwVbaDocument::getUpdateStylesOnOpen() throw (css::uno::RuntimeException) +{ + //TODO + return sal_False; +} + +void SAL_CALL SwVbaDocument::setUpdateStylesOnOpen( ::sal_Bool /*_updatestylesonopen*/ ) throw (uno::RuntimeException) +{ + //TODO +} + +::sal_Bool SAL_CALL SwVbaDocument::getAutoHyphenation() throw (uno::RuntimeException) +{ + // check this property only in default paragraph style + sal_Bool IsAutoHyphenation = sal_False; + uno::Reference< beans::XPropertySet > xParaProps( word::getDefaultParagraphStyle( getModel() ), uno::UNO_QUERY_THROW ); + xParaProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaIsHyphenation")) ) >>= IsAutoHyphenation; + return IsAutoHyphenation; +} + +void SAL_CALL SwVbaDocument::setAutoHyphenation( ::sal_Bool _autohyphenation ) throw (uno::RuntimeException) +{ + //TODO + uno::Reference< beans::XPropertySet > xParaProps( word::getDefaultParagraphStyle( getModel() ), uno::UNO_QUERY_THROW ); + xParaProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaIsHyphenation")), uno::makeAny( _autohyphenation ) ); +} + +::sal_Int32 SAL_CALL SwVbaDocument::getHyphenationZone() throw (uno::RuntimeException) +{ + //TODO + return 0; +} + +void SAL_CALL SwVbaDocument::setHyphenationZone( ::sal_Int32 /*_hyphenationzone*/ ) throw (uno::RuntimeException) +{ + //TODO +} + +::sal_Int32 SAL_CALL SwVbaDocument::getConsecutiveHyphensLimit() throw (uno::RuntimeException) +{ + //TODO + sal_Int16 nHyphensLimit = 0; + uno::Reference< beans::XPropertySet > xParaProps( word::getDefaultParagraphStyle( getModel() ), uno::UNO_QUERY_THROW ); + xParaProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaHyphenationMaxHyphens")) ) >>= nHyphensLimit; + return nHyphensLimit; +} + +void SAL_CALL SwVbaDocument::setConsecutiveHyphensLimit( ::sal_Int32 _consecutivehyphenslimit ) throw (uno::RuntimeException) +{ + sal_Int16 nHyphensLimit = static_cast< sal_Int16 >( _consecutivehyphenslimit ); + uno::Reference< beans::XPropertySet > xParaProps( word::getDefaultParagraphStyle( getModel() ), uno::UNO_QUERY_THROW ); + xParaProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaHyphenationMaxHyphens")), uno::makeAny( nHyphensLimit ) ); +} + +void SAL_CALL SwVbaDocument::Protect( ::sal_Int32 /*Type*/, const uno::Any& /*NOReset*/, const uno::Any& /*Password*/, const uno::Any& /*UseIRM*/, const uno::Any& /*EnforceStyleLock*/ ) throw (uno::RuntimeException) +{ + // Seems not support in Writer + // VbaDocumentBase::Protect( Password ); +} + +void SAL_CALL SwVbaDocument::PrintOut( const uno::Any& /*Background*/, const uno::Any& /*Append*/, const uno::Any& /*Range*/, const uno::Any& /*OutputFileName*/, const uno::Any& /*From*/, const uno::Any& /*To*/, const uno::Any& /*Item*/, const uno::Any& /*Copies*/, const uno::Any& /*Pages*/, const uno::Any& /*PageType*/, const uno::Any& /*PrintToFile*/, const uno::Any& /*Collate*/, const uno::Any& /*FileName*/, const uno::Any& /*ActivePrinterMacGX*/, const uno::Any& /*ManualDuplexPrint*/, const uno::Any& /*PrintZoomColumn*/, const uno::Any& /*PrintZoomRow*/, const uno::Any& /*PrintZoomPaperWidth*/, const uno::Any& /*PrintZoomPaperHeight*/ ) throw (uno::RuntimeException) +{ + //TODO +} + +void SAL_CALL SwVbaDocument::PrintPreview( ) throw (uno::RuntimeException) +{ + rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrintPreview")); + dispatchRequests( mxModel,url ); +} + +void SAL_CALL SwVbaDocument::ClosePrintPreview( ) throw (uno::RuntimeException) +{ + rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ClosePreview")); + dispatchRequests( mxModel,url ); +} + +uno::Any SAL_CALL +SwVbaDocument::Revisions( const uno::Any& index ) throw (uno::RuntimeException) +{ + uno::Reference< document::XRedlinesSupplier > xRedlinesSupp( mxTextDocument, uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xRedlines( xRedlinesSupp->getRedlines(), uno::UNO_QUERY_THROW ); + uno::Reference< XCollection > xCol( new SwVbaRevisions( this, mxContext, getModel(), xRedlines ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} + +uno::Any SAL_CALL +SwVbaDocument::Frames( const uno::Any& index ) throw (uno::RuntimeException) +{ + uno::Reference< text::XTextFramesSupplier > xTextFramesSupp( mxTextDocument, uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xFrames( xTextFramesSupp->getTextFrames(), uno::UNO_QUERY_THROW ); + uno::Reference< XCollection > xCol( new SwVbaFrames( this, mxContext, xFrames, getModel() ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} + uno::Any SwVbaDocument::getControlShape( const ::rtl::OUString& sName ) { @@ -379,3 +531,4 @@ extern sdecl::ServiceDecl const serviceDecl( "ooo.vba.word.Document" ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbadocument.hxx b/sw/source/ui/vba/vbadocument.hxx index 4602e9ab08..a8ff27a506 100644 --- a/sw/source/ui/vba/vbadocument.hxx +++ b/sw/source/ui/vba/vbadocument.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -65,6 +66,25 @@ public: virtual css::uno::Any SAL_CALL Sections( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual void SAL_CALL Activate() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL PageSetup() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL TablesOfContents( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL FormFields( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getProtectionType() throw (css::uno::RuntimeException); + virtual void SAL_CALL setProtectionType( ::sal_Int32 _protectiontype ) throw (css::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getUpdateStylesOnOpen() throw (css::uno::RuntimeException); + virtual void SAL_CALL setUpdateStylesOnOpen( ::sal_Bool _updatestylesonopen ) throw (css::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getAutoHyphenation() throw (css::uno::RuntimeException); + virtual void SAL_CALL setAutoHyphenation( ::sal_Bool _autohyphenation ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getHyphenationZone() throw (css::uno::RuntimeException); + virtual void SAL_CALL setHyphenationZone( ::sal_Int32 _hyphenationzone ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getConsecutiveHyphensLimit() throw (css::uno::RuntimeException); + virtual void SAL_CALL setConsecutiveHyphensLimit( ::sal_Int32 _consecutivehyphenslimit ) throw (css::uno::RuntimeException); + virtual void SAL_CALL Protect( ::sal_Int32 Type, const css::uno::Any& NOReset, const css::uno::Any& Password, const css::uno::Any& UseIRM, const css::uno::Any& EnforceStyleLock ) throw (css::uno::RuntimeException); + virtual void SAL_CALL PrintOut( const css::uno::Any& Background, const css::uno::Any& Append, const css::uno::Any& Range, const css::uno::Any& OutputFileName, const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Item, const css::uno::Any& Copies, const css::uno::Any& Pages, const css::uno::Any& PageType, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& FileName, const css::uno::Any& ActivePrinterMacGX, const css::uno::Any& ManualDuplexPrint, const css::uno::Any& PrintZoomColumn, const css::uno::Any& PrintZoomRow, const css::uno::Any& PrintZoomPaperWidth, const css::uno::Any& PrintZoomPaperHeight ) throw (css::uno::RuntimeException); + virtual void SAL_CALL PrintPreview( ) throw (css::uno::RuntimeException); + virtual void SAL_CALL ClosePrintPreview( ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Revisions( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Frames( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + // XInvocation virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection( ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const css::uno::Sequence< css::uno::Any >& aParams, css::uno::Sequence< ::sal_Int16 >& aOutParamIndex, css::uno::Sequence< css::uno::Any >& aOutParam ) throw (css::lang::IllegalArgumentException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException); @@ -78,3 +98,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_DOCUMENT_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbadocumentproperties.cxx b/sw/source/ui/vba/vbadocumentproperties.cxx index ed540e931f..69c6539634 100644 --- a/sw/source/ui/vba/vbadocumentproperties.cxx +++ b/sw/source/ui/vba/vbadocumentproperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -135,7 +136,6 @@ public: { // Characters, ParagraphCount & WordCount are available from // the model ( and addtionally these also update the statics object ) - //return mxProps->getPropertyValue( rPropName ); return mxModelProps->getPropertyValue( rPropName ); } catch( uno::Exception& ) @@ -203,16 +203,16 @@ public: static DocPropInfo createDocPropInfo( const rtl::OUString& sDesc, const rtl::OUString& sPropName, boost::shared_ptr< PropertGetSetHelper >& rHelper ) { - return createDocPropInfo( rtl::OUStringToOString( sDesc, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( sPropName, RTL_TEXTENCODING_UTF8 ).getStr(), rHelper ); + DocPropInfo aItem; + aItem.msMSODesc = sDesc; + aItem.msOOOPropName = sPropName; + aItem.mpPropGetSetHelper = rHelper; + return aItem; } static DocPropInfo createDocPropInfo( const sal_Char* sDesc, const sal_Char* sPropName, boost::shared_ptr< PropertGetSetHelper >& rHelper ) { - DocPropInfo aItem; - aItem.msMSODesc = rtl::OUString::createFromAscii( sDesc ); - aItem.msOOOPropName = rtl::OUString::createFromAscii( sPropName ); - aItem.mpPropGetSetHelper = rHelper; - return aItem; + return createDocPropInfo( rtl::OUString::createFromAscii( sDesc ), rtl::OUString::createFromAscii( sPropName ), rHelper ); } uno::Any getValue() { @@ -236,7 +236,7 @@ public: }; -typedef std::hash_map< sal_Int32, DocPropInfo > MSOIndexToOODocPropInfo; +typedef boost::unordered_map< sal_Int32, DocPropInfo > MSOIndexToOODocPropInfo; class BuiltInIndexHelper { @@ -305,7 +305,7 @@ public: virtual rtl::OUString SAL_CALL getLinkSource( ) throw (script::BasicErrorException, uno::RuntimeException); virtual void SAL_CALL setLinkSource( const rtl::OUString& LinkSource ) throw (script::BasicErrorException, uno::RuntimeException); //XDefaultProperty - virtual ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (uno::RuntimeException) { return rtl::OUString::createFromAscii("Value"); } + virtual ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (uno::RuntimeException) { return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); } // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual uno::Sequence<rtl::OUString> getServiceNames(); @@ -482,7 +482,7 @@ typedef ::cppu::WeakImplHelper3< com::sun::star::container::XIndexAccess ,com::sun::star::container::XEnumerationAccess > PropertiesImpl_BASE; -typedef std::hash_map< sal_Int32, uno::Reference< XDocumentProperty > > DocProps; +typedef boost::unordered_map< sal_Int32, uno::Reference< XDocumentProperty > > DocProps; typedef ::cppu::WeakImplHelper1< com::sun::star::container::XEnumeration > DocPropEnumeration_BASE; class DocPropEnumeration : public DocPropEnumeration_BASE @@ -504,7 +504,7 @@ public: } }; -typedef std::hash_map< rtl::OUString, uno::Reference< XDocumentProperty >, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > DocPropsByName; +typedef boost::unordered_map< rtl::OUString, uno::Reference< XDocumentProperty >, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > DocPropsByName; class BuiltInPropertiesImpl : public PropertiesImpl_BASE { @@ -762,3 +762,5 @@ SwVbaCustomDocumentProperties::getServiceImplName() static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaCustomDocumentProperties") ); return sImplName; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbadocumentproperties.hxx b/sw/source/ui/vba/vbadocumentproperties.hxx index 9ab704eff3..25cc54bd87 100644 --- a/sw/source/ui/vba/vbadocumentproperties.hxx +++ b/sw/source/ui/vba/vbadocumentproperties.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,7 +31,7 @@ #include <ooo/vba/XDocumentProperties.hpp> #include <com/sun/star/frame/XModel.hpp> #include <vbahelper/vbacollectionimpl.hxx> -#include <hash_map> +#include <boost/unordered_map.hpp> typedef CollTestImplHelper< ov::XDocumentProperties > SwVbaDocumentproperties_BASE; @@ -65,3 +66,5 @@ public: }; #endif /* SW_VBA_DOCUMENTPROPERTY_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbadocuments.cxx b/sw/source/ui/vba/vbadocuments.cxx index 5ea30844e8..a354574c10 100644 --- a/sw/source/ui/vba/vbadocuments.cxx +++ b/sw/source/ui/vba/vbadocuments.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,7 +56,7 @@ #include "vbadocuments.hxx" #include <vbahelper/vbahelper.hxx> -#include <hash_map> +#include <boost/unordered_map.hpp> #include <osl/file.hxx> using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -176,3 +177,5 @@ SwVbaDocuments::getServiceNames() } return sNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbadocuments.hxx b/sw/source/ui/vba/vbadocuments.hxx index a7d977594e..d8ad9ff306 100644 --- a/sw/source/ui/vba/vbadocuments.hxx +++ b/sw/source/ui/vba/vbadocuments.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -59,3 +60,5 @@ public: }; #endif /* SW_VBA_DOCUMENTS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaeventshelper.cxx b/sw/source/ui/vba/vbaeventshelper.cxx index b2270b009c..e837785be3 100755..100644 --- a/sw/source/ui/vba/vbaeventshelper.cxx +++ b/sw/source/ui/vba/vbaeventshelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -101,3 +102,5 @@ extern sdecl::ServiceDecl const serviceDecl( } // ============================================================================ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaeventshelper.hxx b/sw/source/ui/vba/vbaeventshelper.hxx index 7f951bdaa4..a5817eef2d 100755..100644 --- a/sw/source/ui/vba/vbaeventshelper.hxx +++ b/sw/source/ui/vba/vbaeventshelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -51,3 +52,4 @@ protected: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbafield.cxx b/sw/source/ui/vba/vbafield.cxx index d702607bdb..0ff4295a12 100644 --- a/sw/source/ui/vba/vbafield.cxx +++ b/sw/source/ui/vba/vbafield.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -33,6 +34,7 @@ #include <ooo/vba/word/WdFieldType.hpp> #include <com/sun/star/text/FilenameDisplayFormat.hpp> #include <com/sun/star/util/XRefreshable.hpp> +#include <com/sun/star/util/XUpdatable.hpp> #include <swtypes.hxx> using namespace ::ooo::vba; @@ -45,15 +47,26 @@ SwVbaField::SwVbaField( const uno::Reference< ooo::vba::XHelperInterface >& rPa mxTextField.set( xTextField, uno::UNO_QUERY_THROW ); } +sal_Bool SAL_CALL SwVbaField::Update() throw (uno::RuntimeException) +{ + uno::Reference< util::XUpdatable > xUpdatable( mxTextField, uno::UNO_QUERY ); + if( xUpdatable.is() ) + { + xUpdatable->update(); + return sal_True; + } + return sal_False; +} + // XHelperInterface -rtl::OUString& +rtl::OUString& SwVbaField::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaField") ); - return sImplName; + return sImplName; } -uno::Sequence<rtl::OUString> +uno::Sequence<rtl::OUString> SwVbaField::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -113,13 +126,11 @@ _ReadFieldParams::_ReadFieldParams( const String& _rData ) nFnd = nNext; nSavPtr = nNext; aFieldName = aData.Copy( 0, nFnd ); -// cLastChar = aData.GetChar( nSavPtr ); } _ReadFieldParams::~_ReadFieldParams() { -// aData.SetChar( nSavPtr, cLastChar ); } @@ -276,7 +287,7 @@ uno::Any lcl_createField( const uno::Reference< XHelperInterface >& xParent, con typedef ::cppu::WeakImplHelper1< css::container::XEnumeration > FieldEnumeration_BASE; typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XEnumerationAccess > FieldCollectionHelper_BASE; -class FieldEnumeration : public FieldEnumeration_BASE +class FieldEnumeration : public FieldEnumeration_BASE { uno::Reference< XHelperInterface > mxParent; uno::Reference< uno::XComponentContext > mxContext; @@ -286,8 +297,8 @@ public: FieldEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< container::XEnumeration >& xEnumeration ) : mxParent( xParent ), mxContext( xContext ), mxModel( xModel ), mxEnumeration( xEnumeration ) { } - virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) - { + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { return mxEnumeration->hasMoreElements(); } virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) @@ -315,15 +326,15 @@ public: virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { return mxEnumerationAccess->hasElements(); } // XIndexAccess virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) - { + { uno::Reference< container::XEnumeration > xEnumeration = mxEnumerationAccess->createEnumeration(); sal_Int32 nCount = 0; while( xEnumeration->hasMoreElements() ) { ++nCount; xEnumeration->nextElement(); - } - return nCount; + } + return nCount; } virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) { @@ -349,13 +360,13 @@ public: return uno::Reference< container::XEnumeration >( new FieldEnumeration( mxParent, mxContext, mxModel, xEnumeration ) ); } }; - + SwVbaFields::SwVbaFields( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ) : SwVbaFields_BASE( xParent, xContext , uno::Reference< container::XIndexAccess >( new FieldCollectionHelper( xParent, xContext, xModel ) ) ), mxModel( xModel ) { mxMSF.set( mxModel, uno::UNO_QUERY_THROW ); } -uno::Reference< word::XField > SAL_CALL +uno::Reference< word::XField > SAL_CALL SwVbaFields::Add( const css::uno::Reference< ::ooo::vba::word::XRange >& Range, const css::uno::Any& Type, const css::uno::Any& Text, const css::uno::Any& /*PreserveFormatting*/ ) throw (css::uno::RuntimeException) { sal_Int32 nType = word::WdFieldType::wdFieldEmpty; @@ -368,6 +379,7 @@ SwVbaFields::Add( const css::uno::Reference< ::ooo::vba::word::XRange >& Range, { _ReadFieldParams aReadParam(sText); sFieldName = aReadParam.GetFieldName(); + OSL_TRACE("SwVbaFields::Add, the field name is %s ",rtl::OUStringToOString( sFieldName, RTL_TEXTENCODING_UTF8 ).getStr() ); } uno::Reference< text::XTextContent > xTextField; @@ -375,6 +387,10 @@ SwVbaFields::Add( const css::uno::Reference< ::ooo::vba::word::XRange >& Range, { xTextField.set( Create_Field_FileName( sText ), uno::UNO_QUERY_THROW ); } + else if( nType == word::WdFieldType::wdFieldDocProperty || sFieldName.EqualsIgnoreCaseAscii("DOCPROPERTY") ) + { + xTextField.set( Create_Field_DocProperty( sText ), uno::UNO_QUERY_THROW ); + } else { throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); @@ -389,7 +405,7 @@ SwVbaFields::Add( const css::uno::Reference< ::ooo::vba::word::XRange >& Range, uno::Reference< text::XTextField > SwVbaFields::Create_Field_FileName( const rtl::OUString _text ) throw (uno::RuntimeException) { - uno::Reference< text::XTextField > xTextField( mxMSF->createInstance( rtl::OUString::createFromAscii("com.sun.star.text.TextField.FileName") ), uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextField > xTextField( mxMSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextField.FileName")) ), uno::UNO_QUERY_THROW ); sal_Int16 nFileFormat = text::FilenameDisplayFormat::NAME_AND_EXT; if( _text.getLength() > 0 ) { @@ -419,19 +435,117 @@ uno::Reference< text::XTextField > SwVbaFields::Create_Field_FileName( const rtl return xTextField; } -uno::Reference< container::XEnumeration > SAL_CALL +struct DocPropertyTable +{ + const char* sDocPropertyName; + const char* sFieldService; +}; + +static const DocPropertyTable aDocPropertyTables[] = +{ + { "Author", "com.sun.star.text.textfield.docinfo.CreateAuthor" }, + { "Bytes", NULL }, + { "Category", NULL }, + { "Characters",NULL }, + { "CharactersWithSpaces", NULL }, + { "Comments", "com.sun.star.text.textfield.docinfo.Description" }, + { "Company", NULL }, + { "CreateTime", "com.sun.star.text.textfield.docinfo.CreateDateTime" }, + { "HyperlinkBase", NULL }, + { "Keywords", "com.sun.star.text.textfield.docinfo.Keywords" }, + { "LastPrinted", "com.sun.star.text.textfield.docinfo.PrintDateTime" }, + { "LastSavedBy", "com.sun.star.text.textfield.docinfo.ChangeAuthor" }, + { "LastSavedTime", "com.sun.star.text.textfield.docinfo.ChangeDateTime" }, + { "Lines", NULL }, + { "Manager", NULL }, + { "NameofApplication", NULL }, + { "ODMADocID", NULL }, + { "Pages", "com.sun.star.text.textfield.PageCount" }, + { "Paragraphs", "com.sun.star.text.textfield.ParagraphCount" }, + { "RevisionNumber", "com.sun.star.text.textfield.docinfo.Revision" }, + { "Security", NULL }, + { "Subject", "com.sun.star.text.textfield.docinfo.Subject" }, + { "Template", "com.sun.star.text.textfield.TemplateName" }, + { "Title", "com.sun.star.text.textfield.docinfo.Title" }, + { "TotalEditingTime", "com.sun.star.text.textfield.docinfo.EditTime" }, + { "Words", "com.sun.star.text.textfield.WordCount" }, + { NULL, NULL } +}; + +uno::Reference< text::XTextField > SwVbaFields::Create_Field_DocProperty( const rtl::OUString _text ) throw (uno::RuntimeException) +{ + String aDocProperty; + _ReadFieldParams aReadParam( _text ); + long nRet; + while( -1 != ( nRet = aReadParam.SkipToNextToken() )) + { + switch( nRet ) + { + case -2: + if( !aDocProperty.Len() ) + aDocProperty = aReadParam.GetResult(); + break; + case '*': + //Skip over MERGEFORMAT + aReadParam.SkipToNextToken(); + break; + } + } + aDocProperty.EraseAllChars('"'); + OSL_TRACE("SwVbaFields::Create_Field_DocProperty, the document property name is %s ",rtl::OUStringToOString( aDocProperty, RTL_TEXTENCODING_UTF8 ).getStr() ); + if( aDocProperty.Len() == 0 ) + { + throw uno::RuntimeException(); + } + + sal_Bool bCustom = sal_True; + rtl::OUString sFieldService; + // find the build in document properties + for( const DocPropertyTable* pTable = aDocPropertyTables; pTable->sDocPropertyName != NULL; pTable++ ) + { + if( aDocProperty.EqualsIgnoreCaseAscii( pTable->sDocPropertyName ) ) + { + if( pTable->sFieldService != NULL ) + sFieldService = rtl::OUString::createFromAscii(pTable->sFieldService); + bCustom = sal_False; + break; + } + } + + if( bCustom ) + { + sFieldService = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.textfield.docinfo.Custom" ) ); + } + else if( sFieldService.getLength() == 0 ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + } + + uno::Reference< text::XTextField > xTextField( mxMSF->createInstance( sFieldService ), uno::UNO_QUERY_THROW ); + + if( bCustom ) + { + uno::Reference< beans::XPropertySet > xProps( xTextField, uno::UNO_QUERY_THROW ); + rtl::OUString sDocPropertyName( aDocProperty ); + xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ), uno::makeAny( sDocPropertyName ) ); + } + + return xTextField; +} + +uno::Reference< container::XEnumeration > SAL_CALL SwVbaFields::createEnumeration() throw (uno::RuntimeException) { uno::Reference< container::XEnumerationAccess > xEnumerationAccess( m_xIndexAccess, uno::UNO_QUERY_THROW ); return xEnumerationAccess->createEnumeration(); } -// ScVbaCollectionBaseImpl -uno::Any +// ScVbaCollectionBaseImpl +uno::Any SwVbaFields::createCollectionObject( const uno::Any& aSource ) { return lcl_createField( mxParent, mxContext, mxModel, aSource ); -} +} sal_Int32 SAL_CALL SwVbaFields::Update() throw (uno::RuntimeException) { @@ -450,21 +564,21 @@ sal_Int32 SAL_CALL SwVbaFields::Update() throw (uno::RuntimeException) } // XHelperInterface -rtl::OUString& +rtl::OUString& SwVbaFields::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaFields") ); - return sImplName; + return sImplName; } // XEnumerationAccess -uno::Type SAL_CALL +uno::Type SAL_CALL SwVbaFields::getElementType() throw (uno::RuntimeException) { - return word::XField::static_type(0); + return word::XField::static_type(0); } -uno::Sequence<rtl::OUString> +uno::Sequence<rtl::OUString> SwVbaFields::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -476,3 +590,4 @@ SwVbaFields::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbafield.hxx b/sw/source/ui/vba/vbafield.hxx index f421179d35..57bdf44bb2 100644 --- a/sw/source/ui/vba/vbafield.hxx +++ b/sw/source/ui/vba/vbafield.hxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -42,9 +43,10 @@ class SwVbaField : public SwVbaField_BASE public: SwVbaField( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rDocument, const css::uno::Reference< css::text::XTextField >& xTextField) throw ( css::uno::RuntimeException); + virtual sal_Bool SAL_CALL Update() throw ( css::uno::RuntimeException); // XHelperInterface virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; // *** SwVbaFields *********************************************** @@ -57,6 +59,7 @@ class SwVbaFields : public SwVbaFields_BASE css::uno::Reference< css::lang::XMultiServiceFactory > mxMSF; private: css::uno::Reference< css::text::XTextField > Create_Field_FileName( const rtl::OUString _text ) throw (css::uno::RuntimeException); + css::uno::Reference< css::text::XTextField > Create_Field_DocProperty( const rtl::OUString _text ) throw (css::uno::RuntimeException); public: SwVbaFields( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel ); @@ -66,12 +69,14 @@ public: // XEnumerationAccess virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); - // ScVbaCollectionBaseImpl + // ScVbaCollectionBaseImpl virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); // XHelperInterface virtual rtl::OUString& getServiceImplName(); - virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbafind.cxx b/sw/source/ui/vba/vbafind.cxx index 1af48f7c1e..25f1bcdc78 100644 --- a/sw/source/ui/vba/vbafind.cxx +++ b/sw/source/ui/vba/vbafind.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -80,13 +81,6 @@ void SwVbaFind::SetReplace( sal_Int32 type ) mnReplaceType = type; mbReplace = sal_True; } -#ifdef TOMORROW -rtl::OUString SwVbaFind::ReplaceWildcards( const rtl::OUString& /*rText*/ ) throw ( uno::RuntimeException ) -{ - // TODO: - return rtl::OUString(); -} -#endif uno::Reference< text::XTextRange > SwVbaFind::FindOneElement() throw ( uno::RuntimeException ) { uno::Reference< text::XTextRange > xFoundOne; @@ -426,3 +420,4 @@ SwVbaFind::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbafind.hxx b/sw/source/ui/vba/vbafind.hxx index c624a5aa7a..da07d2fd5a 100644 --- a/sw/source/ui/vba/vbafind.hxx +++ b/sw/source/ui/vba/vbafind.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -58,9 +59,6 @@ private: void SetReplace( sal_Int32 type ); void SetReplaceWith( const rtl::OUString& rText ) throw ( css::uno::RuntimeException ); rtl::OUString GetReplaceWith() throw ( css::uno::RuntimeException ); -#ifdef TOMORROW - rtl::OUString ReplaceWildcards( const rtl::OUString& rText ) throw ( css::uno::RuntimeException ); -#endif css::uno::Reference< css::text::XTextRange > FindOneElement() throw ( css::uno::RuntimeException ); sal_Bool SearchReplace() throw ( css::uno::RuntimeException ); @@ -101,3 +99,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_FIND_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbafont.cxx b/sw/source/ui/vba/vbafont.cxx index 4855d923ff..4553c4705a 100644 --- a/sw/source/ui/vba/vbafont.cxx +++ b/sw/source/ui/vba/vbafont.cxx @@ -1,7 +1,9 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "vbafont.hxx" #include <com/sun/star/awt/FontUnderline.hpp> #include <ooo/vba/word/WdUnderline.hpp> -#include <hash_map> +#include <boost/unordered_map.hpp> +#include <sal/macros.h> #include <ooo/vba/word/WdColorIndex.hpp> using namespace ::ooo::vba; @@ -37,7 +39,7 @@ static MapPair UnderLineTable[] = { { word::WdUnderline::wdUnderlineDashLongHeavy, com::sun::star::awt::FontUnderline::BOLDLONGDASH }, }; -typedef std::hash_map< sal_Int32, sal_Int32 > ConstToConst; +typedef boost::unordered_map< sal_Int32, sal_Int32 > ConstToConst; class UnderLineMapper { ConstToConst MSO2OOO; @@ -45,7 +47,7 @@ class UnderLineMapper private: UnderLineMapper() { - sal_Int32 nLen = sizeof( UnderLineTable )/ sizeof( UnderLineTable[0] ); + sal_Int32 nLen = SAL_N_ELEMENTS( UnderLineTable ); for ( sal_Int32 index=0; index<nLen; ++index ) { @@ -214,3 +216,4 @@ SwVbaFont::getServiceNames() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbafont.hxx b/sw/source/ui/vba/vbafont.hxx index b684daa58b..fead5bf58b 100644 --- a/sw/source/ui/vba/vbafont.hxx +++ b/sw/source/ui/vba/vbafont.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #ifndef VBA_FONT_HXX #define VBA_FONT_HXX @@ -29,3 +30,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaformfield.cxx b/sw/source/ui/vba/vbaformfield.cxx new file mode 100644 index 0000000000..ed6bf39a60 --- /dev/null +++ b/sw/source/ui/vba/vbaformfield.cxx @@ -0,0 +1,138 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbaformfield.hxx" +#include <vbahelper/vbahelper.hxx> +#include <tools/diagnose_ex.h> +#include <com/sun/star/text/XTextDocument.hpp> +#include <com/sun/star/text/XTextContent.hpp> +#include <com/sun/star/text/XTextViewCursor.hpp> +#include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <ecmaflds.hxx> +#include "vbacheckbox.hxx" + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +SwVbaFormField::SwVbaFormField( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< frame::XModel >& rModel, const uno::Reference< text::XFormField >& xFormField ) throw ( uno::RuntimeException ) : SwVbaFormField_BASE( rParent, rContext ), mxModel( rModel ), mxFormField( xFormField ) +{ +} + +SwVbaFormField::~SwVbaFormField() +{ +} + +rtl::OUString SAL_CALL SwVbaFormField::getResult() throw ( uno::RuntimeException ) +{ + rtl::OUString sResult; + rtl::OUString sType = mxFormField->getFieldType(); + if( sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMTEXT ) ) + { + uno::Reference< text::XTextContent > xTextContent( mxFormField, uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextRange > xTextRange = xTextContent->getAnchor(); + sResult = xTextRange->getString(); + } + else if( sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMCHECKBOX ) ) + { + sal_Int32 nValue = 0; + sal_Int32 nCount = mxFormField->getParamCount(); + for( sal_Int32 i = 0; i < nCount; i++ ) + { + if( mxFormField->getParamName(i).equalsIgnoreAsciiCaseAscii( ECMA_FORMCHECKBOX_CHECKED ) ) + { + if( mxFormField->getParamValue(i).equalsIgnoreAsciiCaseAscii("on") ) + nValue = 1; + else + nValue = 0; + break; + } + + } + sResult = rtl::OUString::valueOf( nValue ); + } + else + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + } + return sResult; +} + +void SAL_CALL SwVbaFormField::setResult( const rtl::OUString& result ) throw ( uno::RuntimeException ) +{ + rtl::OUString sType = mxFormField->getFieldType(); + if( sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMTEXT ) ) + { + uno::Reference< text::XTextContent > xTextContent( mxFormField, uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextRange > xTextRange = xTextContent->getAnchor(); + xTextRange->setString( result ); + } + else if( sType.equalsIgnoreAsciiCaseAscii( ECMA_FORMCHECKBOX ) ) + { + // do nothing + } + else + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + } +} + +sal_Bool SAL_CALL SwVbaFormField::getEnabled() throw ( uno::RuntimeException ) +{ + //allways return true + return sal_True; +} + +void SAL_CALL SwVbaFormField::setEnabled( sal_Bool/* enabled */ ) throw ( uno::RuntimeException ) +{ + // not support in Writer +} + +uno::Any SAL_CALL SwVbaFormField::CheckBox() throw ( uno::RuntimeException ) +{ + return uno::makeAny( uno::Reference< word::XCheckBox >( new SwVbaCheckBox( this, mxContext, mxModel, mxFormField ) ) ); +} + +rtl::OUString& +SwVbaFormField::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaFormField") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +SwVbaFormField::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.FormField" ) ); + } + return aServiceNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaformfield.hxx b/sw/source/ui/vba/vbaformfield.hxx new file mode 100644 index 0000000000..00ba837443 --- /dev/null +++ b/sw/source/ui/vba/vbaformfield.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_FORMFIELD_HXX +#define SW_VBA_FORMFIELD_HXX + +#include <ooo/vba/word/XFormField.hpp> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/text/XFormField.hpp> +#include <vbahelper/vbahelperinterface.hxx> + +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XFormField > SwVbaFormField_BASE; + +class SwVbaFormField : public SwVbaFormField_BASE +{ +private: + css::uno::Reference< css::frame::XModel > mxModel; + css::uno::Reference< css::text::XFormField > mxFormField; + +public: + SwVbaFormField( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const css::uno::Reference< css::text::XFormField >& xFormField ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaFormField(); + + // Methods + rtl::OUString SAL_CALL getResult() throw ( css::uno::RuntimeException ); + void SAL_CALL setResult( const rtl::OUString& result ) throw ( css::uno::RuntimeException ); + sal_Bool SAL_CALL getEnabled() throw ( css::uno::RuntimeException ); + void SAL_CALL setEnabled( sal_Bool enabled ) throw ( css::uno::RuntimeException ); + css::uno::Any SAL_CALL CheckBox() throw ( css::uno::RuntimeException ); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif /* SW_VBA_FORMFIELD_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaformfields.cxx b/sw/source/ui/vba/vbaformfields.cxx new file mode 100644 index 0000000000..43c8e3cd5e --- /dev/null +++ b/sw/source/ui/vba/vbaformfields.cxx @@ -0,0 +1,205 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbaformfields.hxx" +#include "vbaformfield.hxx" +#include <com/sun/star/container/XNamed.hpp> +#include <com/sun/star/text/XTextDocument.hpp> +#include <com/sun/star/text/XTextViewCursor.hpp> +#include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include "wordvbahelper.hxx" +#include <cppuhelper/implbase3.hxx> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +typedef std::vector< uno::Reference< text::XFormField > > XFormFieldVec; +typedef ::cppu::WeakImplHelper1< container::XEnumeration > FormFiledEnumeration_BASE; +typedef ::cppu::WeakImplHelper3< container::XNameAccess, container::XIndexAccess, container::XEnumerationAccess > FormFieldCollectionHelper_BASE; + +rtl::OUString lcl_getFormFieldName( const uno::Reference< text::XFormField >& xFormField ) +{ + rtl::OUString sName; + sal_Int32 nCount = xFormField->getParamCount(); + for( sal_Int32 i = 0; i < nCount; i++ ) + { + if( xFormField->getParamName(i).equalsIgnoreAsciiCaseAscii( "Name" ) ) + { + sName = xFormField->getParamValue(i); + OSL_TRACE("lcl_getFormFieldName: %s", rtl::OUStringToOString( sName, RTL_TEXTENCODING_UTF8 ).getStr() ); + break; + } + } + return sName; +} + +class FormFieldsEnumeration : public FormFiledEnumeration_BASE +{ +private: + uno::Reference< XHelperInterface > mxParent; + uno::Reference< uno::XComponentContext > mxContext; + uno::Reference< frame::XModel > mxModel; + XFormFieldVec mxFormFields; + XFormFieldVec::iterator cachePos; +public: + FormFieldsEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const XFormFieldVec& xFormFiels ) throw (uno::RuntimeException) : mxParent( xParent ), mxContext( xContext ), mxModel( xModel ), mxFormFields( xFormFiels ), cachePos( mxFormFields.begin() ) + { + } + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { + return ( cachePos != mxFormFields.end() ); + } + + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( !hasMoreElements() ) + throw container::NoSuchElementException(); + uno::Reference< text::XFormField > xFormField( *cachePos++ ); + return uno::makeAny( uno::Reference< word::XFormField > ( new SwVbaFormField( mxParent, mxContext, mxModel, xFormField ) ) ); + } + +}; + +class FormFieldCollectionHelper : public FormFieldCollectionHelper_BASE +{ +private: + uno::Reference< XHelperInterface > mxParent; + uno::Reference< uno::XComponentContext > mxContext; + uno::Reference< frame::XModel > mxModel; + XFormFieldVec mxFormFields; + XFormFieldVec::iterator cachePos; +public: + FormFieldCollectionHelper( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) : mxParent( xParent ), mxContext( xContext ), mxModel( xModel ) + { + uno::Reference< text::XBookmarksSupplier > xBookmarksSupplier( xModel,uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xIndexAccess( xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY_THROW ); + sal_Int32 nCount = xIndexAccess->getCount(); + for( sal_Int32 i = 0; i < nCount; i++ ) + { + uno::Reference< text::XFormField > xFormField( xIndexAccess->getByIndex( i ), uno::UNO_QUERY ); + if( xFormField.is() ) + mxFormFields.push_back( xFormField ); + } + cachePos = mxFormFields.begin(); + } + // XElementAccess + virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { return word::XFormField::static_type(0); } + virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { return getCount() > 0 ; } + // XNameAcess + virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( !hasByName(aName) ) + throw container::NoSuchElementException(); + uno::Reference< text::XFormField > xFormField( *cachePos, uno::UNO_QUERY_THROW ); + return uno::makeAny( uno::Reference< word::XFormField >( new SwVbaFormField( mxParent, mxContext, mxModel, xFormField ) ) ); + } + virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException) + { + uno::Sequence< rtl::OUString > sNames( mxFormFields.size() ); + rtl::OUString* pString = sNames.getArray(); + XFormFieldVec::iterator it = mxFormFields.begin(); + XFormFieldVec::iterator it_end = mxFormFields.end(); + for ( ; it != it_end; ++it, ++pString ) + { + uno::Reference< text::XFormField > xFormField( *cachePos, uno::UNO_QUERY_THROW ); + *pString = lcl_getFormFieldName( xFormField ); + } + return sNames; + } + virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException) + { + cachePos = mxFormFields.begin(); + XFormFieldVec::iterator it_end = mxFormFields.end(); + for ( ; cachePos != it_end; ++cachePos ) + { + //uno::Reference< container::XNamed > xName( *cachePos, uno::UNO_QUERY_THROW ); + uno::Reference< text::XFormField > xFormField( *cachePos, uno::UNO_QUERY_THROW ); + if ( aName.equalsIgnoreAsciiCase( lcl_getFormFieldName( xFormField )) ) + break; + } + return ( cachePos != it_end ); + } + // XIndexAccess + virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) + { + return mxFormFields.size(); + } + virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) + { + if ( Index < 0 || Index >= getCount() ) + throw lang::IndexOutOfBoundsException(); + return uno::makeAny( uno::Reference< word::XFormField >( new SwVbaFormField( mxParent, mxContext, mxModel, mxFormFields[ Index ] ) ) ); + } + // XEnumerationAccess + virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException) + { + return new FormFieldsEnumeration( mxParent, mxContext, mxModel, mxFormFields ); + } +}; + +SwVbaFormFields::SwVbaFormFields( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ): SwVbaFormFields_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new FormFieldCollectionHelper( xParent, xContext, xModel ) ) ), mxModel( xModel ) +{ +} +// XEnumerationAccess +uno::Type +SwVbaFormFields::getElementType() throw (uno::RuntimeException) +{ + return word::XFormField::static_type(0); +} +uno::Reference< container::XEnumeration > +SwVbaFormFields::createEnumeration() throw (uno::RuntimeException) +{ + uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xIndexAccess, uno::UNO_QUERY_THROW ); + return xEnumAccess->createEnumeration(); +} + +uno::Any +SwVbaFormFields::createCollectionObject( const css::uno::Any& aSource ) +{ + return aSource; +} + +rtl::OUString& +SwVbaFormFields::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaFormFields") ); + return sImplName; +} + +css::uno::Sequence<rtl::OUString> +SwVbaFormFields::getServiceNames() +{ + static uno::Sequence< rtl::OUString > sNames; + if ( sNames.getLength() == 0 ) + { + sNames.realloc( 1 ); + sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.FormFields") ); + } + return sNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaformfields.hxx b/sw/source/ui/vba/vbaformfields.hxx new file mode 100644 index 0000000000..335fceb743 --- /dev/null +++ b/sw/source/ui/vba/vbaformfields.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_FORMFIELDS_HXX +#define SW_VBA_FORMFIELDS_HXX + +#include <vbahelper/vbacollectionimpl.hxx> +#include <ooo/vba/word/XFormFields.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <com/sun/star/text/XBookmarksSupplier.hpp> +#include <com/sun/star/text/XTextRange.hpp> + +typedef CollTestImplHelper< ooo::vba::word::XFormFields > SwVbaFormFields_BASE; + +class SwVbaFormFields : public SwVbaFormFields_BASE +{ +private: + css::uno::Reference< css::frame::XModel > mxModel; + +public: + SwVbaFormFields( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel ); + virtual ~SwVbaFormFields() {} + + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + + // SwVbaFormFields_BASE + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif /* SW_VBA_FORMFIELDS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaframe.cxx b/sw/source/ui/vba/vbaframe.cxx new file mode 100644 index 0000000000..04d13a0967 --- /dev/null +++ b/sw/source/ui/vba/vbaframe.cxx @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbaframe.hxx" +#include <vbahelper/vbahelper.hxx> +#include <tools/diagnose_ex.h> +#include <com/sun/star/text/XTextDocument.hpp> +#include <com/sun/star/text/XTextContent.hpp> +#include <com/sun/star/text/XTextViewCursor.hpp> +#include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +SwVbaFrame::SwVbaFrame( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const css::uno::Reference< frame::XModel >& rModel, const css::uno::Reference< text::XTextFrame >& xTextFrame ) throw ( css::uno::RuntimeException ) : + SwVbaFrame_BASE( rParent, rContext ), mxModel( rModel ), mxTextFrame( xTextFrame ) +{ +} + +SwVbaFrame::~SwVbaFrame() +{ +} + +void SAL_CALL SwVbaFrame::Select() throw ( uno::RuntimeException ) +{ + uno::Reference< view::XSelectionSupplier > xSelectSupp( mxModel->getCurrentController(), uno::UNO_QUERY_THROW ); + xSelectSupp->select( uno::makeAny( mxTextFrame ) ); +} + +rtl::OUString& +SwVbaFrame::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaFrame") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +SwVbaFrame::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Frame" ) ); + } + return aServiceNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaframe.hxx b/sw/source/ui/vba/vbaframe.hxx new file mode 100644 index 0000000000..745d5f2096 --- /dev/null +++ b/sw/source/ui/vba/vbaframe.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_FRAME_HXX +#define SW_VBA_FRAME_HXX + +#include <ooo/vba/word/XFrame.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/text/XTextFrame.hpp> + +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XFrame > SwVbaFrame_BASE; + +class SwVbaFrame : public SwVbaFrame_BASE +{ +private: + css::uno::Reference< css::frame::XModel > mxModel; + css::uno::Reference< css::text::XTextFrame > mxTextFrame; + +public: + SwVbaFrame( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const css::uno::Reference< css::text::XTextFrame >& xTextFrame ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaFrame(); + + // Methods + virtual void SAL_CALL Select() throw ( css::uno::RuntimeException ); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif /* SW_VBA_FRAME_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaframes.cxx b/sw/source/ui/vba/vbaframes.cxx new file mode 100644 index 0000000000..e3aba63cfb --- /dev/null +++ b/sw/source/ui/vba/vbaframes.cxx @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbaframes.hxx" +#include "vbaframe.hxx" +#include <com/sun/star/text/XTextDocument.hpp> +#include <com/sun/star/text/XTextViewCursor.hpp> +#include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include "wordvbahelper.hxx" + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +typedef ::cppu::WeakImplHelper1< container::XEnumeration > FramesEnumeration_Base; +class FramesEnumeration : public FramesEnumeration_Base +{ +private: + uno::Reference< XHelperInterface > mxParent; + uno::Reference< uno::XComponentContext > mxContext; + uno::Reference< container::XIndexAccess> mxIndexAccess; + uno::Reference< frame::XModel > mxModel; + sal_Int32 nCurrentPos; +public: + FramesEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess, const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) : mxParent( xParent ), mxContext( xContext), mxIndexAccess( xIndexAccess ), mxModel( xModel ), nCurrentPos(0) + { + } + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { + return ( nCurrentPos < mxIndexAccess->getCount() ); + } + + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( !hasMoreElements() ) + throw container::NoSuchElementException(); + uno::Reference< text::XTextFrame > xTextFrame( mxIndexAccess->getByIndex( nCurrentPos++ ), uno::UNO_QUERY_THROW ); + return uno::makeAny( uno::Reference< word::XFrame > ( new SwVbaFrame( mxParent, mxContext, mxModel, xTextFrame ) ) ); + } + +}; + +SwVbaFrames::SwVbaFrames( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xFrames, const uno::Reference< frame::XModel >& xModel ): SwVbaFrames_BASE( xParent, xContext, xFrames ), mxModel( xModel ) +{ + mxFramesSupplier.set( mxModel, uno::UNO_QUERY_THROW ); +} +// XEnumerationAccess +uno::Type +SwVbaFrames::getElementType() throw (uno::RuntimeException) +{ + return word::XFrame::static_type(0); +} + +uno::Reference< container::XEnumeration > +SwVbaFrames::createEnumeration() throw (uno::RuntimeException) +{ + return new FramesEnumeration( this, mxContext,m_xIndexAccess, mxModel ); +} + +uno::Any +SwVbaFrames::createCollectionObject( const css::uno::Any& aSource ) +{ + uno::Reference< text::XTextFrame > xTextFrame( aSource, uno::UNO_QUERY_THROW ); + return uno::makeAny( uno::Reference< word::XFrame > ( new SwVbaFrame( this, mxContext, mxModel, xTextFrame ) ) ); +} + +rtl::OUString& +SwVbaFrames::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaFrames") ); + return sImplName; +} + +css::uno::Sequence<rtl::OUString> +SwVbaFrames::getServiceNames() +{ + static uno::Sequence< rtl::OUString > sNames; + if ( sNames.getLength() == 0 ) + { + sNames.realloc( 1 ); + sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Frames") ); + } + return sNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaframes.hxx b/sw/source/ui/vba/vbaframes.hxx new file mode 100644 index 0000000000..38015fd47c --- /dev/null +++ b/sw/source/ui/vba/vbaframes.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_FRAMES_HXX +#define SW_VBA_FRAMES_HXX + +#include <vbahelper/vbacollectionimpl.hxx> +#include <ooo/vba/word/XFrames.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <com/sun/star/text/XTextFramesSupplier.hpp> + +typedef CollTestImplHelper< ooo::vba::word::XFrames > SwVbaFrames_BASE; + +class SwVbaFrames : public SwVbaFrames_BASE +{ +private: + css::uno::Reference< css::frame::XModel > mxModel; + css::uno::Reference< css::text::XTextFramesSupplier > mxFramesSupplier; + +public: + SwVbaFrames( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::container::XIndexAccess >& xFrames, const css::uno::Reference< css::frame::XModel >& xModel ); + virtual ~SwVbaFrames() {} + + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + + // SwVbaFrames_BASE + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + +}; + +#endif /* SW_VBA_FRAMES_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaglobals.cxx b/sw/source/ui/vba/vbaglobals.cxx index 0770ea3196..d7d975549e 100644 --- a/sw/source/ui/vba/vbaglobals.cxx +++ b/sw/source/ui/vba/vbaglobals.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,7 +27,7 @@ ************************************************************************/ #include <vbahelper/helperdecl.hxx> #include "vbaglobals.hxx" - +#include <sal/macros.h> #include <comphelper/unwrapargs.hxx> #include <com/sun/star/lang/XMultiComponentFactory.hpp> @@ -49,7 +50,7 @@ SwVbaGlobals::SwVbaGlobals( uno::Sequence< uno::Any > const& aArgs, uno::Refere { OSL_TRACE("SwVbaGlobals::SwVbaGlobals()"); uno::Sequence< beans::PropertyValue > aInitArgs( 2 ); - aInitArgs[ 0 ].Name = rtl::OUString::createFromAscii("Application"); + aInitArgs[ 0 ].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Application")); aInitArgs[ 0 ].Value = uno::makeAny( getApplication() ); aInitArgs[ 1 ].Name = sDocCtxName; aInitArgs[ 1 ].Value = uno::makeAny( getXSomethingFromArgs< frame::XModel >( aArgs, 0 ) ); @@ -129,6 +130,12 @@ SwVbaGlobals::Dialogs( const uno::Any& index ) throw (uno::RuntimeException) return getApplication()->Dialogs( index ); } +uno::Any SAL_CALL +SwVbaGlobals::ListGalleries( const uno::Any& index ) throw (uno::RuntimeException) +{ + return getApplication()->ListGalleries( index ); +} + uno::Reference<word::XSelection > SAL_CALL SwVbaGlobals::getSelection() throw (uno::RuntimeException) { @@ -171,7 +178,7 @@ SwVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException) // #FIXME #TODO make Application a proper service // ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.word.Application" ) ), }; - sal_Int32 nWordServices = ( sizeof( names )/ sizeof( names[0] ) ); + sal_Int32 nWordServices = SAL_N_ELEMENTS( names ); sal_Int32 startIndex = serviceNames.getLength(); serviceNames.realloc( serviceNames.getLength() + nWordServices ); for ( sal_Int32 index = 0; index < nWordServices; ++index ) @@ -191,3 +198,4 @@ extern sdecl::ServiceDecl const serviceDecl( "ooo.vba.word.Globals" ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaglobals.hxx b/sw/source/ui/vba/vbaglobals.hxx index ad6ce95bce..3ad5cf4195 100644 --- a/sw/source/ui/vba/vbaglobals.hxx +++ b/sw/source/ui/vba/vbaglobals.hxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -46,7 +47,7 @@ typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::word::XGlobals > SwVbaGlobals_BASE; -class SwVbaGlobals : public SwVbaGlobals_BASE +class SwVbaGlobals : public SwVbaGlobals_BASE { private: css::uno::Reference< ooo::vba::word::XApplication > mxApplication; @@ -54,7 +55,7 @@ private: virtual css::uno::Reference< ooo::vba::word::XApplication > getApplication() throw (css::uno::RuntimeException); public: - + SwVbaGlobals( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& rxContext ); virtual ~SwVbaGlobals(); @@ -65,10 +66,11 @@ public: virtual css::uno::Reference< ov::word::XWindow > SAL_CALL getActiveWindow() throw (css::uno::RuntimeException); virtual css::uno::Reference< ooo::vba::word::XOptions > SAL_CALL getOptions() throw (css::uno::RuntimeException); virtual css::uno::Reference< ooo::vba::word::XSelection > SAL_CALL getSelection() throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Documents( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Addins( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Dialogs( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Documents( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Addins( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Dialogs( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL ListGalleries( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual float SAL_CALL CentimetersToPoints( float _Centimeters ) throw (css::uno::RuntimeException); // XMultiServiceFactory virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames( ) throw (css::uno::RuntimeException); @@ -77,4 +79,6 @@ public: virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; -#endif /* SW_VBA_GLOBALS_HXX */ +#endif /* SW_VBA_GLOBALS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaheaderfooter.cxx b/sw/source/ui/vba/vbaheaderfooter.cxx index ec3b0cef27..0a7bd993d6 100644 --- a/sw/source/ui/vba/vbaheaderfooter.cxx +++ b/sw/source/ui/vba/vbaheaderfooter.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -81,6 +82,7 @@ uno::Reference< word::XRange > SAL_CALL SwVbaHeaderFooter::getRange() throw (uno uno::Any SAL_CALL SwVbaHeaderFooter::Shapes( const uno::Any& index ) throw (uno::RuntimeException) { + // #FIXME: only get the shapes in the current header/footer uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( mxModel, uno::UNO_QUERY_THROW ); //uno::Reference< drawing::XShapes > xShapes( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); @@ -90,14 +92,14 @@ SwVbaHeaderFooter::Shapes( const uno::Any& index ) throw (uno::RuntimeException) return uno::makeAny( xCol ); } -rtl::OUString& +rtl::OUString& SwVbaHeaderFooter::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaHeaderFooter") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > SwVbaHeaderFooter::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -109,3 +111,4 @@ SwVbaHeaderFooter::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaheaderfooter.hxx b/sw/source/ui/vba/vbaheaderfooter.hxx index 2c4832d7d3..5d93f3cd8b 100644 --- a/sw/source/ui/vba/vbaheaderfooter.hxx +++ b/sw/source/ui/vba/vbaheaderfooter.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -58,3 +59,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_HEADERFOOTER_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaheaderfooterhelper.cxx b/sw/source/ui/vba/vbaheaderfooterhelper.cxx index d91f37a20d..c1d04f6369 100644 --- a/sw/source/ui/vba/vbaheaderfooterhelper.cxx +++ b/sw/source/ui/vba/vbaheaderfooterhelper.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -29,50 +30,74 @@ #include <comphelper/processfactory.hxx> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <com/sun/star/text/XTextRangeCompare.hpp> +#include <com/sun/star/text/XTextRange.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/IllegalArgumentException.hpp> using namespace ::com::sun::star; using namespace ::ooo::vba; #define FIRST_PAGE 1; -// Class HeaderFooterHelper +// Class HeaderFooterHelper +sal_Bool HeaderFooterHelper::isHeaderFooter( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) +{ + return isHeaderFooter( word::getCurrentXText( xModel ) ); +} -sal_Bool HeaderFooterHelper::isHeader( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException) +sal_Bool HeaderFooterHelper::isHeaderFooter( const uno::Reference< text::XText >& xText ) throw (uno::RuntimeException) { - uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xStyleProps( word::getCurrentPageStyle( xModel ), uno::UNO_QUERY_THROW ); - - sal_Bool isOn = sal_False; - xStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsOn"))) >>= isOn; - if( !isOn ) - return sal_False; + uno::Reference< lang::XServiceInfo > xServiceInfo( xText, uno::UNO_QUERY_THROW ); + rtl::OUString aImplName = xServiceInfo->getImplementationName(); + if( aImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SwXHeadFootText")) ) + return sal_True; + return sal_False; +} - sal_Bool isShared = sal_False; - xStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsShared"))) >>= isShared; +sal_Bool HeaderFooterHelper::isHeader( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) +{ + const uno::Reference< text::XText > xCurrentText = word::getCurrentXText( xModel ); + if( !isHeaderFooter( xCurrentText ) ) + return sal_False; + rtl::OUString aPropIsShared = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderIsShared") ); rtl::OUString aPropText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderText") ); + uno::Reference< style::XStyle > xPageStyle = word::getCurrentPageStyle( xModel ); + uno::Reference< beans::XPropertySet > xPageProps( xPageStyle, uno::UNO_QUERY_THROW ); + sal_Bool isShared = sal_True; + xPageProps->getPropertyValue( aPropIsShared ) >>= isShared; if( !isShared ) { + uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW ); if( 0 == xPageCursor->getPage() % 2 ) - { aPropText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderTextLeft") ); - } else - { aPropText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HeaderTextRight") ); - } } - - uno::Reference< text::XText > xText( xStyleProps->getPropertyValue( aPropText ), uno::UNO_QUERY_THROW ); - //FIXME: can not compare in this way? - return ( xText == xCurrentText ); + + uno::Reference< text::XText > xHeaderText( xPageProps->getPropertyValue( aPropText ), uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextRangeCompare > xTRC( xHeaderText, uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextRange > xTR1( xCurrentText, uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextRange > xTR2( xHeaderText, uno::UNO_QUERY_THROW ); + try + { + if( xTRC->compareRegionStarts( xTR1, xTR2 ) == 0 ) + return sal_True; + } + catch( lang::IllegalArgumentException& ) + { + return sal_False; + } + + return sal_False; } -sal_Bool HeaderFooterHelper::isFirstPageHeader( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException) +sal_Bool HeaderFooterHelper::isFirstPageHeader( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) { - if( isHeader( xModel, xCurrentText ) ) + if( isHeader( xModel ) ) { uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW ); // FIXME: getPage allways returns 1 @@ -82,9 +107,9 @@ sal_Bool HeaderFooterHelper::isFirstPageHeader( const uno::Reference< frame::XMo return sal_False; } -sal_Bool HeaderFooterHelper::isEvenPagesHeader( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException) +sal_Bool HeaderFooterHelper::isEvenPagesHeader( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) { - if( isHeader( xModel, xCurrentText ) ) + if( isHeader( xModel ) ) { uno::Reference< beans::XPropertySet > xStyleProps( word::getCurrentPageStyle( xModel ), uno::UNO_QUERY_THROW ); sal_Bool isShared = sal_False; @@ -93,45 +118,52 @@ sal_Bool HeaderFooterHelper::isEvenPagesHeader( const uno::Reference< frame::XMo { uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW ); return ( 0 == xPageCursor->getPage() % 2 ); - } + } } return sal_False; } -sal_Bool HeaderFooterHelper::isFooter( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException) +sal_Bool HeaderFooterHelper::isFooter( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) { - uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xStyleProps( word::getCurrentPageStyle( xModel ), uno::UNO_QUERY_THROW ); - - sal_Bool isOn = sal_False; - xStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsOn"))) >>= isOn; - if( !isOn ) + const uno::Reference< text::XText > xCurrentText = word::getCurrentXText( xModel ); + if( !isHeaderFooter( xCurrentText ) ) return sal_False; - sal_Bool isShared = sal_False; - xStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsShared"))) >>= isShared; - + rtl::OUString aPropIsShared = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterIsShared") ); rtl::OUString aPropText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterText") ); + uno::Reference< style::XStyle > xPageStyle = word::getCurrentPageStyle( xModel ); + uno::Reference< beans::XPropertySet > xPageProps( xPageStyle, uno::UNO_QUERY_THROW ); + sal_Bool isShared = sal_True; + xPageProps->getPropertyValue( aPropIsShared ) >>= isShared; if( !isShared ) { + uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW ); if( 0 == xPageCursor->getPage() % 2 ) - { aPropText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterTextLeft") ); - } else - { aPropText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FooterTextRight") ); - } } - - uno::Reference< text::XText > xText( xStyleProps->getPropertyValue( aPropText ), uno::UNO_QUERY_THROW ); - return ( xText == xCurrentText ); + uno::Reference< text::XText > xFooterText( xPageProps->getPropertyValue( aPropText ), uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextRangeCompare > xTRC( xFooterText, uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextRange > xTR1( xCurrentText, uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextRange > xTR2( xFooterText, uno::UNO_QUERY_THROW ); + try + { + if( xTRC->compareRegionStarts( xTR1, xTR2 ) == 0 ) + return sal_True; + } + catch( lang::IllegalArgumentException& ) + { + return sal_False; + } + + return sal_False; } -sal_Bool HeaderFooterHelper::isFirstPageFooter( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException) +sal_Bool HeaderFooterHelper::isFirstPageFooter( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) { - if( isFooter( xModel, xCurrentText ) ) + if( isFooter( xModel ) ) { uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW ); sal_Int32 nPage = xPageCursor->getPage(); @@ -140,9 +172,9 @@ sal_Bool HeaderFooterHelper::isFirstPageFooter( const uno::Reference< frame::XMo return sal_False; } -sal_Bool HeaderFooterHelper::isEvenPagesFooter( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException) +sal_Bool HeaderFooterHelper::isEvenPagesFooter( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) { - if( isFooter( xModel, xCurrentText ) ) + if( isFooter( xModel ) ) { uno::Reference< beans::XPropertySet > xStyleProps( word::getCurrentPageStyle( xModel ), uno::UNO_QUERY_THROW ); sal_Bool isShared = sal_False; @@ -151,26 +183,9 @@ sal_Bool HeaderFooterHelper::isEvenPagesFooter( const uno::Reference< frame::XMo { uno::Reference< text::XPageCursor > xPageCursor( word::getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW ); return ( 0 == xPageCursor->getPage() % 2 ); - } - } - return sal_False; -} -#ifdef TOMORROW -sal_Bool HeaderFooterHelper::isPrimaryHeader( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException) -{ - if( isHeader( xModel, xCurrentText ) ) - { - return( !( isFirstPageHeader( xModel, xCurrentText ) && isEvenPagesHeader( xModel, xCurrentText ) ) ); + } } return sal_False; } -sal_Bool HeaderFooterHelper::isPrimaryFooter( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XText >& xCurrentText ) throw (uno::RuntimeException) -{ - if( isHeader( xModel, xCurrentText ) ) - { - return( !( isFirstPageFooter( xModel, xCurrentText ) && isEvenPagesFooter( xModel, xCurrentText ) ) ); - } - return sal_False; -} -#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaheaderfooterhelper.hxx b/sw/source/ui/vba/vbaheaderfooterhelper.hxx index 0e5fd4c450..551db0a94f 100644 --- a/sw/source/ui/vba/vbaheaderfooterhelper.hxx +++ b/sw/source/ui/vba/vbaheaderfooterhelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,16 +37,18 @@ class HeaderFooterHelper { public: - static sal_Bool isHeader( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException); - static sal_Bool isFirstPageHeader( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException); - static sal_Bool isEvenPagesHeader( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException); - static sal_Bool isFooter( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException); - static sal_Bool isFirstPageFooter( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException); - static sal_Bool isEvenPagesFooter( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException); -#ifdef TOMORROW - static sal_Bool isPrimaryHeader( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException); - static sal_Bool isPrimaryFooter( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XText >& xCurrentText ) throw (css::uno::RuntimeException); -#endif + static sal_Bool isHeaderFooter( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException); + static sal_Bool isHeaderFooter( const css::uno::Reference< css::text::XText >& xText ) throw (css::uno::RuntimeException); + static sal_Bool isHeader( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException); + static sal_Bool isFirstPageHeader( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException); + static sal_Bool isEvenPagesHeader( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException); + static sal_Bool isFooter( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException); + static sal_Bool isFirstPageFooter( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException); + static sal_Bool isEvenPagesFooter( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException); + static sal_Bool isPrimaryHeader( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException); + static sal_Bool isPrimaryFooter( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaheadersfooters.cxx b/sw/source/ui/vba/vbaheadersfooters.cxx new file mode 100644 index 0000000000..27b2756998 --- /dev/null +++ b/sw/source/ui/vba/vbaheadersfooters.cxx @@ -0,0 +1,150 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbaheadersfooters.hxx" +#include "vbaheaderfooter.hxx" +#include <ooo/vba/word/WdHeaderFooterIndex.hpp> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +// I assume there is only one headersfooters in Writer +typedef ::cppu::WeakImplHelper1<container::XIndexAccess > HeadersFootersIndexAccess_Base; +class HeadersFootersIndexAccess : public HeadersFootersIndexAccess_Base +{ +private: + uno::Reference< XHelperInterface > mxParent; + uno::Reference< uno::XComponentContext > mxContext; + uno::Reference< frame::XModel > mxModel; + uno::Reference< beans::XPropertySet > mxPageStyleProps; + sal_Bool mbHeader; + +public: + HeadersFootersIndexAccess( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< beans::XPropertySet >& xPageStyleProps, sal_Bool bHeader ) : mxParent( xParent ), mxContext( xContext ), mxModel( xModel ), mxPageStyleProps( xPageStyleProps ), mbHeader( bHeader ) {} + ~HeadersFootersIndexAccess(){} + + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) + { + // first page, evenpages and primary page + return 3; + } + virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) + { + if( Index < 1 || Index > 3 ) + throw container::NoSuchElementException(); + return uno::makeAny( uno::Reference< word::XHeaderFooter >( new SwVbaHeaderFooter( mxParent, mxContext, mxModel, mxPageStyleProps, mbHeader, Index ) ) ); + } + virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) + { + return word::XHeaderFooter::static_type(0); + } + virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) + { + return sal_True; + } +}; + +class HeadersFootersEnumWrapper : public EnumerationHelper_BASE +{ + SwVbaHeadersFooters* pHeadersFooters; + sal_Int32 nIndex; +public: + HeadersFootersEnumWrapper( SwVbaHeadersFooters* _pHeadersFooters ) : pHeadersFooters( _pHeadersFooters ), nIndex( 0 ) {} + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { + return ( nIndex < pHeadersFooters->getCount() ); + } + + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( nIndex < pHeadersFooters->getCount() ) + return pHeadersFooters->Item( uno::makeAny( ++nIndex ), uno::Any() ); + throw container::NoSuchElementException(); + } +}; + +SwVbaHeadersFooters::SwVbaHeadersFooters( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< beans::XPropertySet >& xPageStyleProps, sal_Bool isHeader ): SwVbaHeadersFooters_BASE( xParent, xContext, new HeadersFootersIndexAccess( xParent, xContext, xModel, xPageStyleProps, isHeader ) ), mxModel( xModel ), mxPageStyleProps( xPageStyleProps ), mbHeader( isHeader ) +{ +} + +::sal_Int32 SAL_CALL SwVbaHeadersFooters::getCount() throw (uno::RuntimeException) +{ + // wdHeaderFooterFirstPage, wdHeaderFooterPrimary and wdHeaderFooterEvenPages + return 3; +} + +uno::Any SAL_CALL SwVbaHeadersFooters::Item( const uno::Any& Index1, const uno::Any& ) throw (uno::RuntimeException) +{ + sal_Int32 nIndex = 0; + Index1 >>= nIndex; + if( ( nIndex < 1 ) || ( nIndex > 3 ) ) + { + throw container::NoSuchElementException(); + } + return uno::makeAny( uno::Reference< word::XHeaderFooter >( new SwVbaHeaderFooter( this, mxContext, mxModel, mxPageStyleProps, mbHeader, nIndex ) ) ); +} + +// XEnumerationAccess +uno::Type +SwVbaHeadersFooters::getElementType() throw (uno::RuntimeException) +{ + return word::XHeaderFooter::static_type(0); +} +uno::Reference< container::XEnumeration > + +SwVbaHeadersFooters::createEnumeration() throw (uno::RuntimeException) +{ + return new HeadersFootersEnumWrapper( this ); +} + +uno::Any +SwVbaHeadersFooters::createCollectionObject( const uno::Any& aSource ) +{ + return aSource; +} + +rtl::OUString& +SwVbaHeadersFooters::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaHeadersFooters") ); + return sImplName; +} + +uno::Sequence<rtl::OUString> +SwVbaHeadersFooters::getServiceNames() +{ + static uno::Sequence< rtl::OUString > sNames; + if ( sNames.getLength() == 0 ) + { + sNames.realloc( 1 ); + sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.HeadersFooters") ); + } + return sNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaheadersfooters.hxx b/sw/source/ui/vba/vbaheadersfooters.hxx new file mode 100644 index 0000000000..253942b0b1 --- /dev/null +++ b/sw/source/ui/vba/vbaheadersfooters.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_HEADERSFOOTERS_HXX +#define SW_VBA_HEADERSFOOTERS_HXX + +#include <vbahelper/vbacollectionimpl.hxx> +#include <ooo/vba/word/XHeadersFooters.hpp> +#include <vbahelper/vbahelperinterface.hxx> + +typedef CollTestImplHelper< ooo::vba::word::XHeadersFooters > SwVbaHeadersFooters_BASE; + +class SwVbaHeadersFooters : public SwVbaHeadersFooters_BASE +{ +private: + css::uno::Reference< css::frame::XModel > mxModel; + css::uno::Reference< css::beans::XPropertySet > mxPageStyleProps; + sal_Bool mbHeader; + +public: + SwVbaHeadersFooters( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::beans::XPropertySet >& xProps, sal_Bool isHeader ); + virtual ~SwVbaHeadersFooters() {} + + virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& )throw (css::uno::RuntimeException); + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + + // SwVbaHeadersFooters_BASE + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif /* SW_VBA_HEADERSFOOTERS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbainformationhelper.cxx b/sw/source/ui/vba/vbainformationhelper.cxx index b2f24406f4..ac58721da3 100644 --- a/sw/source/ui/vba/vbainformationhelper.cxx +++ b/sw/source/ui/vba/vbainformationhelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -66,3 +67,5 @@ double SwVbaInformationHelper::handleWdVerticalPositionRelativeToPage( const css nCurrentPos = nCurrentPos + nTopMargin - ( DEFAULT_PAGE_DISTANCE + TWIP_TO_MM100( nPageHeight ) ) * ( nCurrentPage - 1 ); return Millimeter::getInPoints( nCurrentPos ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbainformationhelper.hxx b/sw/source/ui/vba/vbainformationhelper.hxx index 0cf436cef5..581bb95fdd 100644 --- a/sw/source/ui/vba/vbainformationhelper.hxx +++ b/sw/source/ui/vba/vbainformationhelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,3 +42,5 @@ public: }; #endif /* SW_VBA_INFORMATIONHELPER_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalistformat.cxx b/sw/source/ui/vba/vbalistformat.cxx new file mode 100644 index 0000000000..15eed9a8b4 --- /dev/null +++ b/sw/source/ui/vba/vbalistformat.cxx @@ -0,0 +1,120 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbalistformat.hxx" +#include <vbahelper/vbahelper.hxx> +#include <tools/diagnose_ex.h> +#include <ooo/vba/word/WdListApplyTo.hpp> +#include <ooo/vba/word/WdDefaultListBehavior.hpp> +#include <com/sun/star/container/XEnumerationAccess.hpp> +#include <com/sun/star/container/XEnumeration.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include "vbalisttemplate.hxx" + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +SwVbaListFormat::SwVbaListFormat( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextRange >& xTextRange ) throw ( uno::RuntimeException ) : SwVbaListFormat_BASE( rParent, rContext ), mxTextRange( xTextRange ) +{ +} + +SwVbaListFormat::~SwVbaListFormat() +{ +} + +void SAL_CALL SwVbaListFormat::ApplyListTemplate( const css::uno::Reference< word::XListTemplate >& ListTemplate, const css::uno::Any& ContinuePreviousList, const css::uno::Any& ApplyTo, const css::uno::Any& DefaultListBehavior ) throw (css::uno::RuntimeException) +{ + sal_Bool bContinuePreviousList = sal_True; + if( ContinuePreviousList.hasValue() ) + ContinuePreviousList >>= bContinuePreviousList; + + // "applyto" must be current selection + sal_Int32 bApplyTo = word::WdListApplyTo::wdListApplyToSelection; + if( ApplyTo.hasValue() ) + ApplyTo >>= bApplyTo; + if( bApplyTo != word::WdListApplyTo::wdListApplyToSelection ) + throw uno::RuntimeException(); + + // default behaviour must be wdWord8ListBehavior + sal_Int32 nDefaultListBehavior = word::WdDefaultListBehavior::wdWord8ListBehavior; + if( DefaultListBehavior.hasValue() ) + DefaultListBehavior >>= nDefaultListBehavior; + if( nDefaultListBehavior != word::WdDefaultListBehavior::wdWord8ListBehavior ) + throw uno::RuntimeException(); + + SwVbaListTemplate* pListTemplate = dynamic_cast< SwVbaListTemplate* >( ListTemplate.get() ); + + uno::Reference< container::XEnumerationAccess > xEnumAccess( mxTextRange, uno::UNO_QUERY_THROW ); + uno::Reference< container::XEnumeration > xEnum = xEnumAccess->createEnumeration(); + sal_Bool isFirstElement = sal_True; + while( xEnum->hasMoreElements() ) + { + uno::Reference< beans::XPropertySet > xProps( xEnum->nextElement(), uno::UNO_QUERY_THROW ); + if( isFirstElement ) + { + sal_Bool isNumberingRestart = !bContinuePreviousList; + xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaIsNumberingRestart") ), uno::makeAny( isNumberingRestart ) ); + if( isNumberingRestart ) + { + sal_Int16 nStartValue = 1; + xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingStartValue") ), uno::makeAny( nStartValue ) ); + } + isFirstElement = sal_False; + } + else + { + xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaIsNumberingRestart") ), uno::makeAny( sal_False ) ); + } + pListTemplate->applyListTemplate( xProps ); + } +} + +void SAL_CALL SwVbaListFormat::ConvertNumbersToText( ) throw (css::uno::RuntimeException) +{ + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); +} + +rtl::OUString& +SwVbaListFormat::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListFormat") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +SwVbaListFormat::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListFormat" ) ); + } + return aServiceNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalistformat.hxx b/sw/source/ui/vba/vbalistformat.hxx new file mode 100644 index 0000000000..0483df54e0 --- /dev/null +++ b/sw/source/ui/vba/vbalistformat.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_LISTFORMAT_HXX +#define SW_VBA_LISTFORMAT_HXX + +#include <ooo/vba/word/XListFormat.hpp> +#include <ooo/vba/word/XListTemplate.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/text/XTextRange.hpp> +#include "vbalisthelper.hxx" + + +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XListFormat > SwVbaListFormat_BASE; + +class SwVbaListFormat : public SwVbaListFormat_BASE +{ +private: + css::uno::Reference< css::text::XTextRange > mxTextRange; + +public: + SwVbaListFormat( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextRange >& xTextRange ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaListFormat(); + + // Methods + virtual void SAL_CALL ApplyListTemplate( const css::uno::Reference< ::ooo::vba::word::XListTemplate >& ListTemplate, const css::uno::Any& ContinuePreviousList, const css::uno::Any& ApplyTo, const css::uno::Any& DefaultListBehavior ) throw (css::uno::RuntimeException); + virtual void SAL_CALL ConvertNumbersToText( ) throw (css::uno::RuntimeException); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif /* SW_VBA_LISTFORMAT_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalistgalleries.cxx b/sw/source/ui/vba/vbalistgalleries.cxx new file mode 100644 index 0000000000..7ddd7145a6 --- /dev/null +++ b/sw/source/ui/vba/vbalistgalleries.cxx @@ -0,0 +1,115 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbalistgalleries.hxx" +#include "vbalistgallery.hxx" +#include <ooo/vba/word/WdListGalleryType.hpp> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +class ListGalleriesEnumWrapper : public EnumerationHelper_BASE +{ + SwVbaListGalleries* pListGalleries; + sal_Int32 nIndex; +public: + ListGalleriesEnumWrapper( SwVbaListGalleries* pGalleries ) : pListGalleries( pGalleries ), nIndex( 1 ) {} + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { + return ( nIndex <= pListGalleries->getCount() ); + } + + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( nIndex <= pListGalleries->getCount() ) + return pListGalleries->Item( uno::makeAny( nIndex++ ), uno::Any() ); + throw container::NoSuchElementException(); + } +}; + +SwVbaListGalleries::SwVbaListGalleries( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextDocument >& xTextDoc ) throw (uno::RuntimeException) : SwVbaListGalleries_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >() ), mxTextDocument( xTextDoc ) +{ +} + +::sal_Int32 SAL_CALL SwVbaListGalleries::getCount() throw (uno::RuntimeException) +{ + // 3 types of list( bullet, numbered and outline ) + return 3; +} + +uno::Any SAL_CALL SwVbaListGalleries::Item( const uno::Any& Index1, const uno::Any& /*not processed in this base class*/ ) throw (uno::RuntimeException) +{ + sal_Int32 nIndex = 0; + if( ( Index1 >>= nIndex ) == sal_True ) + { + if( nIndex == word::WdListGalleryType::wdBulletGallery + || nIndex == word::WdListGalleryType::wdNumberGallery + || nIndex == word::WdListGalleryType::wdOutlineNumberGallery ) + return uno::makeAny( uno::Reference< word::XListGallery >( new SwVbaListGallery( this, mxContext, mxTextDocument, nIndex ) ) ); + } + throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() ); +} + +// XEnumerationAccess +uno::Type +SwVbaListGalleries::getElementType() throw (uno::RuntimeException) +{ + return word::XListGallery::static_type(0); +} + +uno::Reference< container::XEnumeration > +SwVbaListGalleries::createEnumeration() throw (uno::RuntimeException) +{ + return new ListGalleriesEnumWrapper( this ); +} + +uno::Any +SwVbaListGalleries::createCollectionObject( const css::uno::Any& aSource ) +{ + return aSource; +} + +rtl::OUString& +SwVbaListGalleries::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListGalleries") ); + return sImplName; +} + +css::uno::Sequence<rtl::OUString> +SwVbaListGalleries::getServiceNames() +{ + static uno::Sequence< rtl::OUString > sNames; + if ( sNames.getLength() == 0 ) + { + sNames.realloc( 1 ); + sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListGalleries") ); + } + return sNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalistgalleries.hxx b/sw/source/ui/vba/vbalistgalleries.hxx new file mode 100644 index 0000000000..a6e829783a --- /dev/null +++ b/sw/source/ui/vba/vbalistgalleries.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_LISTGALLERIES_HXX +#define SW_VBA_LISTGALLERIES_HXX + +#include <vbahelper/vbacollectionimpl.hxx> +#include <ooo/vba/word/XListGalleries.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <com/sun/star/text/XTextDocument.hpp> + +typedef CollTestImplHelper< ooo::vba::word::XListGalleries > SwVbaListGalleries_BASE; + +class SwVbaListGalleries : public SwVbaListGalleries_BASE +{ +private: + css::uno::Reference< css::text::XTextDocument > mxTextDocument; + +public: + SwVbaListGalleries( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextDocument >& xTextDoc ) throw (css::uno::RuntimeException); + virtual ~SwVbaListGalleries() {} + + virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/ ) throw ( css::uno::RuntimeException ); + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + + // SwVbaListGalleries_BASE + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif /* SW_VBA_LISTGALLERIES_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalistgallery.cxx b/sw/source/ui/vba/vbalistgallery.cxx new file mode 100644 index 0000000000..016de8c7ba --- /dev/null +++ b/sw/source/ui/vba/vbalistgallery.cxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbalistgallery.hxx" +#include <vbahelper/vbahelper.hxx> +#include <tools/diagnose_ex.h> +#include "vbalisttemplates.hxx" + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +SwVbaListGallery::SwVbaListGallery( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextDocument >& xTextDoc, sal_Int32 nType ) throw ( uno::RuntimeException ) : SwVbaListGallery_BASE( rParent, rContext ), mxTextDocument( xTextDoc ), mnType( nType ) +{ +} + +SwVbaListGallery::~SwVbaListGallery() +{ +} + +uno::Any SAL_CALL +SwVbaListGallery::ListTemplates( const uno::Any& index ) throw (uno::RuntimeException) +{ + uno::Reference< XCollection > xCol( new SwVbaListTemplates( mxParent, mxContext, mxTextDocument, mnType ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} + +rtl::OUString& +SwVbaListGallery::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListGallery") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +SwVbaListGallery::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListGallery" ) ); + } + return aServiceNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalistgallery.hxx b/sw/source/ui/vba/vbalistgallery.hxx new file mode 100644 index 0000000000..6371e8613f --- /dev/null +++ b/sw/source/ui/vba/vbalistgallery.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_LISTGALLERY_HXX +#define SW_VBA_LISTGALLERY_HXX + +#include <ooo/vba/word/XListGallery.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/text/XTextDocument.hpp> + + +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XListGallery > SwVbaListGallery_BASE; + +class SwVbaListGallery : public SwVbaListGallery_BASE +{ +private: + css::uno::Reference< css::text::XTextDocument > mxTextDocument; + sal_Int32 mnType; + +public: + SwVbaListGallery( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& xTextDoc, sal_Int32 nType ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaListGallery(); + + // Methods + virtual css::uno::Any SAL_CALL ListTemplates( const css::uno::Any& index ) throw ( css::uno::RuntimeException ); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif /* SW_VBA_LISTGALLERY_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalisthelper.cxx b/sw/source/ui/vba/vbalisthelper.cxx new file mode 100644 index 0000000000..65949d6502 --- /dev/null +++ b/sw/source/ui/vba/vbalisthelper.cxx @@ -0,0 +1,705 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbalisthelper.hxx" +#include <tools/diagnose_ex.h> +#include <ooo/vba/word/WdListGalleryType.hpp> +#include <com/sun/star/style/XStyleFamiliesSupplier.hpp> +#include <com/sun/star/style/NumberingType.hpp> +#include <com/sun/star/container/XIndexReplace.hpp> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +static const sal_Int32 LIST_LEVEL_COUNT = 9; + +static const char WORD_BULLET_GALLERY[] = "WdBullet"; +static const char WORD_NUMBER_GALLERY[] = "WdNumber"; +static const char WORD_OUTLINE_NUMBER_GALLERY[] = "WdOutlineNumber"; + +static const char UNO_NAME_ADJUST[] = "Adjust"; +static const char UNO_NAME_PARENT_NUMBERING[] = "ParentNumbering"; +static const char UNO_NAME_PREFIX[] = "Prefix"; +static const char UNO_NAME_SUFFIX[] = "Suffix"; +static const char UNO_NAME_CHAR_STYLE_NAME[] = "CharStyleName"; +static const char UNO_NAME_START_WITH[] = "StartWith"; +static const char UNO_NAME_POSITION_AND_SPACE_MODE[] = "PositionAndSpaceMode"; +static const char UNO_NAME_LABEL_FOLLOWED_BY[] = "LabelFollowedBy"; +static const char UNO_NAME_LIST_TAB_STOP_POSITION[] = "ListtabStopPosition"; +static const char UNO_NAME_FIRST_LINE_INDENT[] = "FirstLineIndent"; +static const char UNO_NAME_INDENT_AT[] = "IndentAt"; +static const char UNO_NAME_NUMBERING_TYPE[] = "NumberingType"; +static const char UNO_NAME_BULLET_ID[] = "BulletId"; +static const char UNO_NAME_BULLET_CHAR[] = "BulletChar"; +static const char UNO_NAME_BULLET_FONT_NAME[] = "BulletFontName"; +static const char UNO_NAME_BULLET_FONT[] = "BulletFont"; + +static const sal_Int16 CHAR_CLOSED_DOT = 8226; +static const sal_Int16 CHAR_EMPTY_DOT = 111; +static const sal_Int16 CHAR_SQUARE = 9632; +static const sal_Int16 CHAR_STAR_SYMBOL = 10026; +static const sal_Int16 CHAR_FOUR_DIAMONDS = 10070; +static const sal_Int16 CHAR_DIAMOND = 10022; +static const sal_Int16 CHAR_ARROW = 10146; +static const sal_Int16 CHAR_CHECK_MARK = 10003; + +SwVbaListHelper::SwVbaListHelper( const css::uno::Reference< css::text::XTextDocument >& xTextDoc, sal_Int32 nGalleryType, sal_Int32 nTemplateType ) throw( css::uno::RuntimeException ) : mxTextDocument( xTextDoc ), mnGalleryType( nGalleryType ), mnTemplateType( nTemplateType ) +{ + Init(); +} + +void SwVbaListHelper::Init() throw( css::uno::RuntimeException ) +{ + // set the numbering style name + switch( mnGalleryType ) + { + case word::WdListGalleryType::wdBulletGallery: + { + msStyleName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( WORD_BULLET_GALLERY )); + break; + } + case word::WdListGalleryType::wdNumberGallery: + { + msStyleName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( WORD_NUMBER_GALLERY )); + break; + } + case word::WdListGalleryType::wdOutlineNumberGallery: + { + msStyleName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( WORD_OUTLINE_NUMBER_GALLERY )); + break; + } + default: + { + throw uno::RuntimeException(); + } + } + msStyleName += rtl::OUString::valueOf( mnTemplateType ); + + // get the numbering style + uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( mxTextDocument, uno::UNO_QUERY_THROW ); + mxStyleFamily.set( xStyleSupplier->getStyleFamilies()->getByName(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingStyles") ) ), uno::UNO_QUERY_THROW ); + OSL_TRACE("SwVbaListHelper::Init: numbering style name: %s", rtl::OUStringToOString( msStyleName, RTL_TEXTENCODING_UTF8 ).getStr() ); + if( mxStyleFamily->hasByName( msStyleName ) ) + { + mxStyleProps.set( mxStyleFamily->getByName( msStyleName ), uno::UNO_QUERY_THROW ); + mxNumberingRules.set( mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingRules") ) ), uno::UNO_QUERY_THROW ); + } + else + { + // create new numbering style + uno::Reference< lang::XMultiServiceFactory > xDocMSF( mxTextDocument, uno::UNO_QUERY_THROW ); + mxStyleProps.set( xDocMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.style.NumberingStyle") ) ), uno::UNO_QUERY_THROW ); + // insert this style into style family, or the property NumberingRules doesn't exist. + mxStyleFamily->insertByName( msStyleName, uno::makeAny( mxStyleProps ) ); + mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingRules") ) ) >>= mxNumberingRules; + + CreateListTemplate(); + + mxStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingRules") ) , uno::makeAny( mxNumberingRules ) ); + } +} + +void SwVbaListHelper::CreateListTemplate() throw( css::uno::RuntimeException ) +{ + switch( mnGalleryType ) + { + case word::WdListGalleryType::wdBulletGallery: + { + CreateBulletListTemplate(); + break; + } + case word::WdListGalleryType::wdNumberGallery: + { + CreateNumberListTemplate(); + break; + } + case word::WdListGalleryType::wdOutlineNumberGallery: + { + CreateOutlineNumberListTemplate(); + break; + } + default: + { + throw uno::RuntimeException(); + } + } +} + +void SwVbaListHelper::CreateBulletListTemplate() throw( css::uno::RuntimeException ) +{ + // there is only 1 level for each bullet list in MSWord + sal_Int32 nLevel = 0; + uno::Sequence< beans::PropertyValue > aPropertyValues; + mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues; + rtl::OUString sCharStyleName( RTL_CONSTASCII_USTRINGPARAM("Bullet Symbols") ); + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_CHAR_STYLE_NAME )), uno::makeAny( sCharStyleName ) ); + sal_Int16 nNumberingType = style::NumberingType::CHAR_SPECIAL; + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) ); + + rtl::OUString aBulletChar; + switch( mnTemplateType ) + { + case 1: + { + aBulletChar = rtl::OUString( sal_Unicode( CHAR_CLOSED_DOT ) ); + break; + } + case 2: + { + aBulletChar = rtl::OUString( sal_Unicode( CHAR_EMPTY_DOT ) ); + break; + } + case 3: + { + aBulletChar = rtl::OUString( sal_Unicode( CHAR_SQUARE ) ); + break; + } + case 4: + { + aBulletChar = rtl::OUString( sal_Unicode( CHAR_STAR_SYMBOL ) ); + break; + } + case 5: + { + aBulletChar = rtl::OUString( sal_Unicode( CHAR_FOUR_DIAMONDS ) ); + break; + } + case 6: + { + aBulletChar = rtl::OUString( sal_Unicode( CHAR_ARROW ) ); + break; + } + case 7: + { + aBulletChar = rtl::OUString( sal_Unicode( CHAR_CHECK_MARK ) ); + break; + } + default: + { + // we only support 7 types template now + throw css::uno::RuntimeException(); + } + } + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_BULLET_CHAR )), uno::makeAny( aBulletChar ) ); + + mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) ); +} + +void SwVbaListHelper::CreateNumberListTemplate() throw( css::uno::RuntimeException ) +{ + // there is only 1 level for each bullet list in MSWord + sal_Int32 nLevel = 0; + uno::Sequence< beans::PropertyValue > aPropertyValues; + mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues; + + sal_Int16 nNumberingType = 0; + rtl::OUString sSuffix; + switch( mnTemplateType ) + { + case 1: + { + nNumberingType = style::NumberingType::ARABIC; + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + case 2: + { + nNumberingType = style::NumberingType::ARABIC; + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 3: + { + nNumberingType = style::NumberingType::ROMAN_UPPER; + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + case 4: + { + nNumberingType = style::NumberingType::CHARS_UPPER_LETTER; + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + case 5: + { + nNumberingType = style::NumberingType::CHARS_LOWER_LETTER; + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 6: + { + nNumberingType = style::NumberingType::CHARS_LOWER_LETTER; + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + case 7: + { + nNumberingType = style::NumberingType::ROMAN_LOWER; + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + default: + { + // we only support 7 types template now + throw css::uno::RuntimeException(); + } + } + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) ); + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_SUFFIX )), uno::makeAny( sSuffix ) ); + + mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) ); +} + +void SwVbaListHelper::CreateOutlineNumberListTemplate() throw( css::uno::RuntimeException ) +{ + switch( mnTemplateType ) + { + case 1: + { + CreateOutlineNumberForType1(); + break; + } + case 2: + { + CreateOutlineNumberForType2(); + break; + } + case 3: + { + CreateOutlineNumberForType3(); + break; + } + case 4: + { + CreateOutlineNumberForType4(); + break; + } + case 5: + { + CreateOutlineNumberForType5(); + break; + } + case 6: + { + CreateOutlineNumberForType6(); + break; + } + case 7: + { + CreateOutlineNumberForType7(); + break; + } + default: + { + // we only support 7 types template now + throw css::uno::RuntimeException(); + } + } +} + +void SwVbaListHelper::CreateOutlineNumberForType1() throw( css::uno::RuntimeException ) +{ + sal_Int16 nNumberingType = 0; + rtl::OUString sPrefix; + rtl::OUString sSuffix; + uno::Sequence< beans::PropertyValue > aPropertyValues; + + for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ ) + { + mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues; + switch( nLevel ) + { + case 0: + case 1: + { + nNumberingType = style::NumberingType::ARABIC; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 2: + { + nNumberingType = style::NumberingType::ROMAN_LOWER; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 3: + { + nNumberingType = style::NumberingType::ARABIC; + sPrefix = rtl::OUString::valueOf( sal_Unicode('(') ); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 4: + { + nNumberingType = style::NumberingType::CHARS_LOWER_LETTER; + sPrefix = rtl::OUString::valueOf( sal_Unicode('(') ); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 5: + { + nNumberingType = style::NumberingType::ROMAN_LOWER; + sPrefix = rtl::OUString::valueOf( sal_Unicode('(') ); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 6: + { + nNumberingType = style::NumberingType::ARABIC; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + case 7: + { + nNumberingType = style::NumberingType::CHARS_LOWER_LETTER; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + case 8: + { + nNumberingType = style::NumberingType::ROMAN_LOWER; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + default: + { + throw uno::RuntimeException(); + } + } + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) ); + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PREFIX )), uno::makeAny( sPrefix ) ); + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_SUFFIX )), uno::makeAny( sSuffix ) ); + mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) ); + } +} + +void SwVbaListHelper::CreateOutlineNumberForType2() throw( css::uno::RuntimeException ) +{ + sal_Int16 nNumberingType = style::NumberingType::ARABIC; + sal_Int16 nParentNumbering = 0; + rtl::OUString sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + uno::Sequence< beans::PropertyValue > aPropertyValues; + + for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ ) + { + mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues; + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) ); + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_SUFFIX )), uno::makeAny( sSuffix ) ); + if( nLevel != 0 ) + { + nParentNumbering = sal_Int16( nLevel - 1 ); + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PARENT_NUMBERING )), uno::makeAny( nParentNumbering ) ); + } + mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) ); + } +} + +void SwVbaListHelper::CreateOutlineNumberForType3() throw( css::uno::RuntimeException ) +{ + sal_Int16 nNumberingType = style::NumberingType::CHAR_SPECIAL; + rtl::OUString sCharStyleName( RTL_CONSTASCII_USTRINGPARAM("Bullet Symbols") ); + rtl::OUString aBulletChar; + uno::Sequence< beans::PropertyValue > aPropertyValues; + + for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ ) + { + mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues; + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) ); + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_CHAR_STYLE_NAME )), uno::makeAny( sCharStyleName ) ); + switch( nLevel ) + { + case 0: + { + aBulletChar = rtl::OUString( sal_Unicode( CHAR_FOUR_DIAMONDS ) ); + break; + } + case 1: + case 5: + { + aBulletChar = rtl::OUString( sal_Unicode( CHAR_ARROW ) ); + break; + } + case 2: + case 6: + { + aBulletChar = rtl::OUString( sal_Unicode( CHAR_SQUARE ) ); + break; + } + case 3: + case 7: + { + aBulletChar = rtl::OUString( sal_Unicode( CHAR_CLOSED_DOT ) ); + break; + } + case 4: + case 8: + { + aBulletChar = rtl::OUString( sal_Unicode( CHAR_DIAMOND ) ); + break; + } + default: + { + throw uno::RuntimeException(); + } + } + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_BULLET_CHAR )), uno::makeAny( aBulletChar ) ); + mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) ); + } +} + +void SwVbaListHelper::CreateOutlineNumberForType4() throw( css::uno::RuntimeException ) +{ + sal_Int16 nNumberingType = 0; + rtl::OUString sPrefix; + rtl::OUString sSuffix; + uno::Sequence< beans::PropertyValue > aPropertyValues; + + for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ ) + { + mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues; + switch( nLevel ) + { + case 0: + { + nNumberingType = style::NumberingType::ROMAN_UPPER; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + case 1: + { + nNumberingType = style::NumberingType::ARABIC; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + sal_Int16 nParentNumbering = 0; + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PARENT_NUMBERING )), uno::makeAny( nParentNumbering ) ); + break; + } + case 2: + { + nNumberingType = style::NumberingType::CHARS_LOWER_LETTER; + sPrefix = rtl::OUString::valueOf( sal_Unicode('(') ); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 3: + { + nNumberingType = style::NumberingType::ROMAN_LOWER; + sPrefix = rtl::OUString::valueOf( sal_Unicode('(') ); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 4: + { + nNumberingType = style::NumberingType::ARABIC; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 5: + { + nNumberingType = style::NumberingType::CHARS_LOWER_LETTER; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 6: + { + nNumberingType = style::NumberingType::ROMAN_LOWER; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 7: + { + nNumberingType = style::NumberingType::CHARS_LOWER_LETTER; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + case 8: + { + nNumberingType = style::NumberingType::ROMAN_LOWER; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + default: + { + throw uno::RuntimeException(); + } + } + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) ); + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PREFIX )), uno::makeAny( sPrefix ) ); + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_SUFFIX )), uno::makeAny( sSuffix ) ); + mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) ); + } +} + +void SwVbaListHelper::CreateOutlineNumberForType5() throw( css::uno::RuntimeException ) +{ + sal_Int16 nNumberingType = style::NumberingType::ARABIC; + sal_Int16 nParentNumbering = 0; + uno::Sequence< beans::PropertyValue > aPropertyValues; + + for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ ) + { + mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues; + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) ); + if( nLevel != 0 ) + { + nParentNumbering = sal_Int16( nLevel - 1 ); + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PARENT_NUMBERING )), uno::makeAny( nParentNumbering ) ); + } + mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) ); + } +} + +void SwVbaListHelper::CreateOutlineNumberForType6() throw( css::uno::RuntimeException ) +{ + sal_Int16 nNumberingType = 0; + rtl::OUString sPrefix; + rtl::OUString sSuffix; + uno::Sequence< beans::PropertyValue > aPropertyValues; + + for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ ) + { + mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues; + switch( nLevel ) + { + case 0: + { + nNumberingType = style::NumberingType::ROMAN_UPPER; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + case 1: + { + nNumberingType = style::NumberingType::CHARS_UPPER_LETTER; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + case 2: + { + nNumberingType = style::NumberingType::ARABIC; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 3: + { + nNumberingType = style::NumberingType::CHARS_LOWER_LETTER; + sPrefix = rtl::OUString(); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 4: + { + nNumberingType = style::NumberingType::ARABIC; + sPrefix = rtl::OUString::valueOf( sal_Unicode('(') ); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 5: + { + nNumberingType = style::NumberingType::CHARS_LOWER_LETTER; + sPrefix = rtl::OUString::valueOf( sal_Unicode('(') ); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 6: + { + nNumberingType = style::NumberingType::ROMAN_LOWER; + sPrefix = rtl::OUString::valueOf( sal_Unicode('(') ); + sSuffix = rtl::OUString::valueOf( sal_Unicode(')') ); + break; + } + case 7: + { + nNumberingType = style::NumberingType::CHARS_LOWER_LETTER; + sPrefix = rtl::OUString::valueOf( sal_Unicode('(') ); + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + case 8: + { + nNumberingType = style::NumberingType::ROMAN_LOWER; + sPrefix = rtl::OUString::valueOf( sal_Unicode('(') ); + sSuffix = rtl::OUString::valueOf( sal_Unicode('.') ); + break; + } + default: + { + throw uno::RuntimeException(); + } + } + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) ); + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PREFIX )), uno::makeAny( sPrefix ) ); + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_SUFFIX )), uno::makeAny( sSuffix ) ); + mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) ); + } +} + +void SwVbaListHelper::CreateOutlineNumberForType7() throw( css::uno::RuntimeException ) +{ + sal_Int16 nNumberingType = style::NumberingType::ARABIC; + uno::Sequence< beans::PropertyValue > aPropertyValues; + rtl::OUString sPrefix(RTL_CONSTASCII_USTRINGPARAM("Chapter ")); + + for( sal_Int32 nLevel = 0; nLevel < LIST_LEVEL_COUNT; nLevel++ ) + { + mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues; + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_NUMBERING_TYPE )), uno::makeAny( nNumberingType ) ); + setOrAppendPropertyValue( aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_PREFIX )), uno::makeAny( sPrefix ) ); + mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) ); + } +} + +uno::Any SwVbaListHelper::getPropertyValueWithNameAndLevel( sal_Int32 nLevel, const rtl::OUString& sName ) throw( css::uno::RuntimeException ) +{ + uno::Sequence< beans::PropertyValue > aPropertyValues; + mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues; + return getPropertyValue( aPropertyValues, sName ); +} + +void SwVbaListHelper::setPropertyValueWithNameAndLevel( sal_Int32 nLevel, const rtl::OUString& sName, const css::uno::Any& aValue ) throw( css::uno::RuntimeException ) +{ + uno::Sequence< beans::PropertyValue > aPropertyValues; + mxNumberingRules->getByIndex( nLevel ) >>= aPropertyValues; + setOrAppendPropertyValue( aPropertyValues, sName, aValue ); + mxNumberingRules->replaceByIndex( nLevel, uno::makeAny( aPropertyValues ) ); + mxStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingRules") ) , uno::makeAny( mxNumberingRules ) ); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalisthelper.hxx b/sw/source/ui/vba/vbalisthelper.hxx new file mode 100644 index 0000000000..0e862fa0dd --- /dev/null +++ b/sw/source/ui/vba/vbalisthelper.hxx @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): <pflin@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#ifndef SW_VBA_LISTHELPER_HXX +#define SW_VBA_LISTHELPER_HXX + +#include <vbahelper/vbahelperinterface.hxx> +#include <com/sun/star/container/XIndexReplace.hpp> +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/text/XTextDocument.hpp> +#include <boost/shared_ptr.hpp> + + +class SwVbaListHelper; +typedef ::boost::shared_ptr< SwVbaListHelper > SwVbaListHelperRef; + +class SwVbaListHelper +{ +private: + css::uno::Reference< css::text::XTextDocument > mxTextDocument; + css::uno::Reference< css::container::XIndexReplace > mxNumberingRules; + css::uno::Reference< css::container::XNameContainer > mxStyleFamily; + css::uno::Reference< css::beans::XPropertySet > mxStyleProps; + sal_Int32 mnGalleryType; + sal_Int32 mnTemplateType; + rtl::OUString msStyleName; + + void Init() throw( css::uno::RuntimeException ); + void CreateListTemplate() throw( css::uno::RuntimeException ); + void CreateBulletListTemplate() throw( css::uno::RuntimeException ); + void CreateNumberListTemplate() throw( css::uno::RuntimeException ); + void CreateOutlineNumberListTemplate() throw( css::uno::RuntimeException ); + void CreateOutlineNumberForType1() throw( css::uno::RuntimeException ); + void CreateOutlineNumberForType2() throw( css::uno::RuntimeException ); + void CreateOutlineNumberForType3() throw( css::uno::RuntimeException ); + void CreateOutlineNumberForType4() throw( css::uno::RuntimeException ); + void CreateOutlineNumberForType5() throw( css::uno::RuntimeException ); + void CreateOutlineNumberForType6() throw( css::uno::RuntimeException ); + void CreateOutlineNumberForType7() throw( css::uno::RuntimeException ); + +public: + SwVbaListHelper( const css::uno::Reference< css::text::XTextDocument >& xTextDoc, sal_Int32 nGalleryType, sal_Int32 nTemplateType ) throw( css::uno::RuntimeException ); + + sal_Int32 getGalleryType() const { return mnGalleryType; } + css::uno::Reference< css::container::XIndexReplace > getNumberingRules() const { return mxNumberingRules; } + css::uno::Any getPropertyValueWithNameAndLevel( sal_Int32 nLevel, const rtl::OUString& sName ) throw( css::uno::RuntimeException ); + void setPropertyValueWithNameAndLevel( sal_Int32 nLevel, const rtl::OUString& sName, const css::uno::Any& aValue ) throw( css::uno::RuntimeException ); + +}; + +#endif//SW_VBA_LISTHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalistlevel.cxx b/sw/source/ui/vba/vbalistlevel.cxx new file mode 100644 index 0000000000..b35f7b52f5 --- /dev/null +++ b/sw/source/ui/vba/vbalistlevel.cxx @@ -0,0 +1,400 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbalistlevel.hxx" +#include <vbahelper/vbahelper.hxx> +#include <tools/diagnose_ex.h> +#include <com/sun/star/style/NumberingType.hpp> +#include <ooo/vba/word/WdListNumberStyle.hpp> +#include <ooo/vba/word/WdTrailingCharacter.hpp> +#include <com/sun/star/text/HoriOrientation.hpp> +#include <ooo/vba/word/WdListLevelAlignment.hpp> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +SwVbaListLevel::SwVbaListLevel( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, SwVbaListHelperRef pHelper, sal_Int32 nLevel ) throw ( uno::RuntimeException ) : SwVbaListLevel_BASE( rParent, rContext ), pListHelper( pHelper ), mnLevel( nLevel ) +{ +} + +SwVbaListLevel::~SwVbaListLevel() +{ +} + +::sal_Int32 SAL_CALL SwVbaListLevel::getAlignment() throw (uno::RuntimeException) +{ + sal_Int16 nAlignment = 0; + pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Adjust") ) ) >>= nAlignment; + switch( nAlignment ) + { + case text::HoriOrientation::LEFT: + { + nAlignment = word::WdListLevelAlignment::wdListLevelAlignLeft; + break; + } + case text::HoriOrientation::RIGHT: + { + nAlignment = word::WdListLevelAlignment::wdListLevelAlignRight; + break; + } + case text::HoriOrientation::CENTER: + { + nAlignment = word::WdListLevelAlignment::wdListLevelAlignCenter; + break; + } + default: + { + throw uno::RuntimeException(); + } + } + return nAlignment; +} + +void SAL_CALL SwVbaListLevel::setAlignment( ::sal_Int32 _alignment ) throw (uno::RuntimeException) +{ + sal_Int16 nAlignment = text::HoriOrientation::LEFT; + switch( _alignment ) + { + case word::WdListLevelAlignment::wdListLevelAlignLeft: + { + nAlignment = text::HoriOrientation::LEFT; + break; + } + case word::WdListLevelAlignment::wdListLevelAlignRight: + { + nAlignment = text::HoriOrientation::RIGHT; + break; + } + case word::WdListLevelAlignment::wdListLevelAlignCenter: + { + nAlignment = text::HoriOrientation::CENTER; + break; + } + default: + { + throw uno::RuntimeException(); + } + } + pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Adjust") ), uno::makeAny( nAlignment ) ); +} + +uno::Reference< ::ooo::vba::word::XFont > SAL_CALL SwVbaListLevel::getFont() throw (uno::RuntimeException) +{ + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + return uno::Reference< word::XFont >(); +} + +void SAL_CALL SwVbaListLevel::setFont( const uno::Reference< ::ooo::vba::word::XFont >& /*_font*/ ) throw (uno::RuntimeException) +{ + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); +} + +::sal_Int32 SAL_CALL SwVbaListLevel::getIndex() throw (uno::RuntimeException) +{ + return mnLevel + 1; +} + +::rtl::OUString SAL_CALL SwVbaListLevel::getLinkedStyle() throw (uno::RuntimeException) +{ + // TODO: + return rtl::OUString(); +} + +void SAL_CALL SwVbaListLevel::setLinkedStyle( const ::rtl::OUString& /*_linkedstyle*/ ) throw (uno::RuntimeException) +{ + // TODO: +} + +::rtl::OUString SAL_CALL SwVbaListLevel::getNumberFormat() throw (uno::RuntimeException) +{ + // TODO:: + return rtl::OUString(); +} + +void SAL_CALL SwVbaListLevel::setNumberFormat( const ::rtl::OUString& /*_numberformat*/ ) throw (uno::RuntimeException) +{ + // TODO:: +} + +float SAL_CALL SwVbaListLevel::getNumberPosition() throw (uno::RuntimeException) +{ + // indentAt + firstlineindent + sal_Int32 nIndentAt = 0; + sal_Int32 nFirstLineIndent = 0; + pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IndentAt") ) ) >>= nIndentAt; + pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstLineIndent") ) ) >>= nFirstLineIndent; + + sal_Int32 nResult = nIndentAt + nFirstLineIndent; + + return static_cast< float >( Millimeter::getInPoints( nResult ) ); +} + +void SAL_CALL SwVbaListLevel::setNumberPosition( float _numberposition ) throw (uno::RuntimeException) +{ + sal_Int32 nNumberPosition = Millimeter::getInHundredthsOfOneMillimeter( _numberposition ); + + sal_Int32 nIndentAt = 0; + pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IndentAt") ) ) >>= nIndentAt; + + sal_Int32 nFirstLineIndent = nNumberPosition - nIndentAt; + pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstLineIndent") ), uno::makeAny( nFirstLineIndent ) ); +} + +::sal_Int32 SAL_CALL SwVbaListLevel::getNumberStyle() throw (uno::RuntimeException) +{ + sal_Int16 nNumberingType = 0; + pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingType") ) ) >>= nNumberingType; + switch( nNumberingType ) + { + case style::NumberingType::CHAR_SPECIAL: + { + nNumberingType = word::WdListNumberStyle::wdListNumberStyleBullet; + break; + } + case style::NumberingType::CHARS_UPPER_LETTER: + { + nNumberingType = word::WdListNumberStyle::wdListNumberStyleUppercaseLetter; + break; + } + case style::NumberingType::CHARS_LOWER_LETTER: + { + nNumberingType = word::WdListNumberStyle::wdListNumberStyleLowercaseLetter; + break; + } + case style::NumberingType::ROMAN_UPPER: + { + nNumberingType = word::WdListNumberStyle::wdListNumberStyleUppercaseRoman; + break; + } + case style::NumberingType::ROMAN_LOWER: + { + nNumberingType = word::WdListNumberStyle::wdListNumberStyleLowercaseRoman; + break; + } + case style::NumberingType::ARABIC: + { + nNumberingType = word::WdListNumberStyle::wdListNumberStyleArabic; + break; + } + case style::NumberingType::NUMBER_NONE: + { + nNumberingType = word::WdListNumberStyle::wdListNumberStyleNone; + break; + } + case style::NumberingType::FULLWIDTH_ARABIC: + { + nNumberingType = word::WdListNumberStyle::wdListNumberStyleArabicFullWidth; + break; + } + case style::NumberingType::CIRCLE_NUMBER: + { + nNumberingType = word::WdListNumberStyle::wdListNumberStyleNumberInCircle; + break; + } + case style::NumberingType::CHARS_ARABIC: + { + nNumberingType = word::WdListNumberStyle::wdListNumberStyleCardinalText; + break; + } + default: + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + } + } + return nNumberingType; +} + +void SAL_CALL SwVbaListLevel::setNumberStyle( ::sal_Int32 _numberstyle ) throw (uno::RuntimeException) +{ + sal_Int16 nNumberingType = 0; + switch( _numberstyle ) + { + case word::WdListNumberStyle::wdListNumberStyleBullet: + { + nNumberingType = style::NumberingType::CHAR_SPECIAL; + break; + } + case word::WdListNumberStyle::wdListNumberStyleUppercaseLetter: + { + nNumberingType = style::NumberingType::CHARS_UPPER_LETTER_N; + break; + } + case word::WdListNumberStyle::wdListNumberStyleLowercaseLetter: + { + nNumberingType = style::NumberingType::CHARS_LOWER_LETTER_N; + break; + } + case word::WdListNumberStyle::wdListNumberStyleUppercaseRoman: + { + nNumberingType = style::NumberingType::ROMAN_UPPER; + break; + } + case word::WdListNumberStyle::wdListNumberStyleLowercaseRoman: + { + nNumberingType = style::NumberingType::ROMAN_LOWER; + break; + } + case word::WdListNumberStyle::wdListNumberStyleArabic: + { + nNumberingType = style::NumberingType::ARABIC; + break; + } + case word::WdListNumberStyle::wdListNumberStyleNone: + { + nNumberingType = style::NumberingType::NUMBER_NONE; + break; + } + case word::WdListNumberStyle::wdListNumberStyleArabicFullWidth: + { + nNumberingType = style::NumberingType::FULLWIDTH_ARABIC; + break; + } + case word::WdListNumberStyle::wdListNumberStyleNumberInCircle: + { + nNumberingType = style::NumberingType::CIRCLE_NUMBER; + break; + } + case word::WdListNumberStyle::wdListNumberStyleCardinalText: + { + nNumberingType = style::NumberingType::CHARS_ARABIC; + break; + } + case word::WdListNumberStyle::wdListNumberStyleOrdinal: + case word::WdListNumberStyle::wdListNumberStyleOrdinalText: + case word::WdListNumberStyle::wdListNumberStyleKanji: + case word::WdListNumberStyle::wdListNumberStyleKanjiDigit: + case word::WdListNumberStyle::wdListNumberStyleAiueoHalfWidth: + case word::WdListNumberStyle::wdListNumberStyleIrohaHalfWidth: + { + nNumberingType = style::NumberingType::ARABIC; + break; + } + default: + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + } + } + + pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingType") ), uno::makeAny( nNumberingType ) ); +} + +::sal_Int32 SAL_CALL SwVbaListLevel::getResetOnHigher() throw (uno::RuntimeException) +{ + //seems not support? + return 0; +} + +void SAL_CALL SwVbaListLevel::setResetOnHigher( ::sal_Int32 /*_resetonhigher*/ ) throw (uno::RuntimeException) +{ + //seems not support? +} + +::sal_Int32 SAL_CALL SwVbaListLevel::getStartAt() throw (uno::RuntimeException) +{ + sal_Int16 nStartWith = 0; + pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StartWith") ) ) >>= nStartWith; + return nStartWith; +} + +void SAL_CALL SwVbaListLevel::setStartAt( ::sal_Int32 _startat ) throw (uno::RuntimeException) +{ + sal_Int16 nStartWith = (sal_Int16)_startat; + pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StartWith") ), uno::makeAny( nStartWith ) ); +} + +float SAL_CALL SwVbaListLevel::getTabPosition() throw (uno::RuntimeException) +{ + sal_Int32 nTabPosition = 0; + pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ListtabStopPosition") ) ) >>= nTabPosition; + + return static_cast< float >( Millimeter::getInPoints( nTabPosition ) ); +} + +void SAL_CALL SwVbaListLevel::setTabPosition( float _tabposition ) throw (uno::RuntimeException) +{ + sal_Int32 nTabPosition = Millimeter::getInHundredthsOfOneMillimeter( _tabposition ); + pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ListtabStopPosition") ), uno::makeAny( nTabPosition ) ); +} + +float SAL_CALL SwVbaListLevel::getTextPosition() throw (uno::RuntimeException) +{ + // indentAt + sal_Int32 nIndentAt = 0; + pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IndentAt") ) ) >>= nIndentAt; + + return static_cast< float >( Millimeter::getInPoints( nIndentAt ) ); +} + +void SAL_CALL SwVbaListLevel::setTextPosition( float _textposition ) throw (uno::RuntimeException) +{ + sal_Int32 nIndentAt = 0; + sal_Int32 nFirstLineIndent = 0; + pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IndentAt") ) ) >>= nIndentAt; + pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstLineIndent") ) ) >>= nFirstLineIndent; + + sal_Int32 nAlignedAt = nIndentAt + nFirstLineIndent; + + nIndentAt = Millimeter::getInHundredthsOfOneMillimeter( _textposition ); + nFirstLineIndent = nAlignedAt - nIndentAt; + pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IndentAt") ), uno::makeAny( nIndentAt ) ); + pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstLineIndent") ), uno::makeAny( nFirstLineIndent ) ); +} + +::sal_Int32 SAL_CALL SwVbaListLevel::getTrailingCharacter() throw (uno::RuntimeException) +{ + sal_Int16 nLabelFollowedBy= 0; + pListHelper->getPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LabelFollowedBy") ) ) >>= nLabelFollowedBy; + + return nLabelFollowedBy; +} + +void SAL_CALL SwVbaListLevel::setTrailingCharacter( ::sal_Int32 _trailingcharacter ) throw (uno::RuntimeException) +{ + sal_Int16 nLabelFollowedBy = (sal_Int16)_trailingcharacter; + pListHelper->setPropertyValueWithNameAndLevel( mnLevel, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LabelFollowedBy") ), uno::makeAny( nLabelFollowedBy ) ); +} + +rtl::OUString& +SwVbaListLevel::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListLevel") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +SwVbaListLevel::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListLevel" ) ); + } + return aServiceNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalistlevel.hxx b/sw/source/ui/vba/vbalistlevel.hxx new file mode 100644 index 0000000000..9be001ae3e --- /dev/null +++ b/sw/source/ui/vba/vbalistlevel.hxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_LISTLEVEL_HXX +#define SW_VBA_LISTLEVEL_HXX + +#include <ooo/vba/word/XListLevel.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/text/XTextDocument.hpp> +#include "vbalisthelper.hxx" + + +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XListLevel > SwVbaListLevel_BASE; + +class SwVbaListLevel : public SwVbaListLevel_BASE +{ +private: + SwVbaListHelperRef pListHelper; + sal_Int32 mnLevel; + +public: + SwVbaListLevel( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, SwVbaListHelperRef pHelper, sal_Int32 nLevel ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaListLevel(); + + // Attributes + virtual ::sal_Int32 SAL_CALL getAlignment() throw (css::uno::RuntimeException); + virtual void SAL_CALL setAlignment( ::sal_Int32 _alignment ) throw (css::uno::RuntimeException); + virtual css::uno::Reference< ::ooo::vba::word::XFont > SAL_CALL getFont() throw (css::uno::RuntimeException); + virtual void SAL_CALL setFont( const css::uno::Reference< ::ooo::vba::word::XFont >& _font ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getIndex() throw (css::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getLinkedStyle() throw (css::uno::RuntimeException); + virtual void SAL_CALL setLinkedStyle( const ::rtl::OUString& _linkedstyle ) throw (css::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getNumberFormat() throw (css::uno::RuntimeException); + virtual void SAL_CALL setNumberFormat( const ::rtl::OUString& _numberformat ) throw (css::uno::RuntimeException); + virtual float SAL_CALL getNumberPosition() throw (css::uno::RuntimeException); + virtual void SAL_CALL setNumberPosition( float _numberposition ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getNumberStyle() throw (css::uno::RuntimeException); + virtual void SAL_CALL setNumberStyle( ::sal_Int32 _numberstyle ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getResetOnHigher() throw (css::uno::RuntimeException); + virtual void SAL_CALL setResetOnHigher( ::sal_Int32 _resetonhigher ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getStartAt() throw (css::uno::RuntimeException); + virtual void SAL_CALL setStartAt( ::sal_Int32 _startat ) throw (css::uno::RuntimeException); + virtual float SAL_CALL getTabPosition() throw (css::uno::RuntimeException); + virtual void SAL_CALL setTabPosition( float _tabposition ) throw (css::uno::RuntimeException); + virtual float SAL_CALL getTextPosition() throw (css::uno::RuntimeException); + virtual void SAL_CALL setTextPosition( float _textposition ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getTrailingCharacter() throw (css::uno::RuntimeException); + virtual void SAL_CALL setTrailingCharacter( ::sal_Int32 _trailingcharacter ) throw (css::uno::RuntimeException); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif /* SW_VBA_LISTLEVEL_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalistlevels.cxx b/sw/source/ui/vba/vbalistlevels.cxx new file mode 100644 index 0000000000..2c1301127d --- /dev/null +++ b/sw/source/ui/vba/vbalistlevels.cxx @@ -0,0 +1,118 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbalistlevels.hxx" +#include "vbalistlevel.hxx" +#include <ooo/vba/word/WdListGalleryType.hpp> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +class ListLevelsEnumWrapper : public EnumerationHelper_BASE +{ + SwVbaListLevels* pListLevels; + sal_Int32 nIndex; +public: + ListLevelsEnumWrapper( SwVbaListLevels* pLevels ) : pListLevels( pLevels ), nIndex( 1 ) {} + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { + return ( nIndex <= pListLevels->getCount() ); + } + + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( nIndex <= pListLevels->getCount() ) + return pListLevels->Item( uno::makeAny( nIndex++ ), uno::Any() ); + throw container::NoSuchElementException(); + } +}; + +SwVbaListLevels::SwVbaListLevels( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, SwVbaListHelperRef pHelper ) throw (uno::RuntimeException) : SwVbaListLevels_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >() ), pListHelper( pHelper ) +{ +} + +::sal_Int32 SAL_CALL SwVbaListLevels::getCount() throw (uno::RuntimeException) +{ + sal_Int32 nGalleryType = pListHelper->getGalleryType(); + if( nGalleryType == word::WdListGalleryType::wdBulletGallery + || nGalleryType == word::WdListGalleryType::wdNumberGallery ) + return 1; + else if( nGalleryType == word::WdListGalleryType::wdOutlineNumberGallery ) + return 9; + return 0; +} + +uno::Any SAL_CALL SwVbaListLevels::Item( const uno::Any& Index1, const uno::Any& /*not processed in this base class*/ ) throw (uno::RuntimeException) +{ + sal_Int32 nIndex = 0; + if( ( Index1 >>= nIndex ) == sal_False ) + throw uno::RuntimeException(); + if( nIndex <=0 || nIndex > getCount() ) + throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() ); + + return uno::makeAny( uno::Reference< word::XListLevel >( new SwVbaListLevel( this, mxContext, pListHelper, nIndex - 1 ) ) ); +} + +// XEnumerationAccess +uno::Type +SwVbaListLevels::getElementType() throw (uno::RuntimeException) +{ + return word::XListLevel::static_type(0); +} + +uno::Reference< container::XEnumeration > +SwVbaListLevels::createEnumeration() throw (uno::RuntimeException) +{ + return new ListLevelsEnumWrapper( this ); +} + +uno::Any +SwVbaListLevels::createCollectionObject( const css::uno::Any& aSource ) +{ + return aSource; +} + +rtl::OUString& +SwVbaListLevels::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListLevels") ); + return sImplName; +} + +css::uno::Sequence<rtl::OUString> +SwVbaListLevels::getServiceNames() +{ + static uno::Sequence< rtl::OUString > sNames; + if ( sNames.getLength() == 0 ) + { + sNames.realloc( 1 ); + sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListLevels") ); + } + return sNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalistlevels.hxx b/sw/source/ui/vba/vbalistlevels.hxx new file mode 100644 index 0000000000..595c0fb34b --- /dev/null +++ b/sw/source/ui/vba/vbalistlevels.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_LISTLEVELS_HXX +#define SW_VBA_LISTLEVELS_HXX + +#include <vbahelper/vbacollectionimpl.hxx> +#include <ooo/vba/word/XListLevels.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include "vbalisthelper.hxx" + + +typedef CollTestImplHelper< ooo::vba::word::XListLevels > SwVbaListLevels_BASE; + +class SwVbaListLevels : public SwVbaListLevels_BASE +{ +private: + SwVbaListHelperRef pListHelper; + +public: + SwVbaListLevels( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, SwVbaListHelperRef pHelper ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaListLevels() {} + + virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/ ) throw ( css::uno::RuntimeException ); + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + + // SwVbaListLevels_BASE + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif /* SW_VBA_LISTLEVELS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalisttemplate.cxx b/sw/source/ui/vba/vbalisttemplate.cxx new file mode 100644 index 0000000000..49305c74e5 --- /dev/null +++ b/sw/source/ui/vba/vbalisttemplate.cxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbalisttemplate.hxx" +#include <vbahelper/vbahelper.hxx> +#include <tools/diagnose_ex.h> +#include "vbalistlevels.hxx" + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +SwVbaListTemplate::SwVbaListTemplate( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextDocument >& xTextDoc, sal_Int32 nGalleryType, sal_Int32 nTemplateType ) throw ( uno::RuntimeException ) : SwVbaListTemplate_BASE( rParent, rContext ) +{ + pListHelper.reset( new SwVbaListHelper( xTextDoc, nGalleryType, nTemplateType ) ); +} + +SwVbaListTemplate::~SwVbaListTemplate() +{ +} + +uno::Any SAL_CALL +SwVbaListTemplate::ListLevels( const uno::Any& index ) throw (uno::RuntimeException) +{ + uno::Reference< XCollection > xCol( new SwVbaListLevels( mxParent, mxContext, pListHelper ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} + +void SwVbaListTemplate::applyListTemplate( uno::Reference< beans::XPropertySet >& xProps ) throw (uno::RuntimeException) +{ + uno::Reference< container::XIndexReplace > xNumberingRules = pListHelper->getNumberingRules(); + xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingRules") ) , uno::makeAny( xNumberingRules ) ); +} + +rtl::OUString& +SwVbaListTemplate::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListTemplate") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +SwVbaListTemplate::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListTemplate" ) ); + } + return aServiceNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalisttemplate.hxx b/sw/source/ui/vba/vbalisttemplate.hxx new file mode 100644 index 0000000000..d876cffb03 --- /dev/null +++ b/sw/source/ui/vba/vbalisttemplate.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_LISTTEMPLATE_HXX +#define SW_VBA_LISTTEMPLATE_HXX + +#include <ooo/vba/word/XListTemplate.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/text/XTextDocument.hpp> +#include "vbalisthelper.hxx" + + +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XListTemplate > SwVbaListTemplate_BASE; + +class SwVbaListTemplate : public SwVbaListTemplate_BASE +{ +private: + SwVbaListHelperRef pListHelper; + +public: + SwVbaListTemplate( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& xTextDoc, sal_Int32 nGalleryType, sal_Int32 nTemplateType ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaListTemplate(); + + void applyListTemplate( css::uno::Reference< css::beans::XPropertySet >& xProps ) throw ( css::uno::RuntimeException ); + + // Methods + virtual css::uno::Any SAL_CALL ListLevels( const css::uno::Any& index ) throw ( css::uno::RuntimeException ); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif /* SW_VBA_LISTTEMPLATE_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalisttemplates.cxx b/sw/source/ui/vba/vbalisttemplates.cxx new file mode 100644 index 0000000000..e54aa16372 --- /dev/null +++ b/sw/source/ui/vba/vbalisttemplates.cxx @@ -0,0 +1,112 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbalisttemplates.hxx" +#include "vbalisttemplate.hxx" + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +class ListTemplatesEnumWrapper : public EnumerationHelper_BASE +{ + SwVbaListTemplates* pListTemplates; + sal_Int32 nIndex; +public: + ListTemplatesEnumWrapper( SwVbaListTemplates* pTemplates ) : pListTemplates( pTemplates ), nIndex( 1 ) {} + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { + return ( nIndex <= pListTemplates->getCount() ); + } + + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( nIndex <= pListTemplates->getCount() ) + return pListTemplates->Item( uno::makeAny( nIndex++ ), uno::Any() ); + throw container::NoSuchElementException(); + } +}; + +SwVbaListTemplates::SwVbaListTemplates( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextDocument >& xTextDoc, sal_Int32 nType ) throw (uno::RuntimeException) : SwVbaListTemplates_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >() ), mxTextDocument( xTextDoc ), mnGalleryType( nType ) +{ +} + +::sal_Int32 SAL_CALL SwVbaListTemplates::getCount() throw (uno::RuntimeException) +{ + // 3 types of list( bullet, numbered and outline ) + return 7; +} + +uno::Any SAL_CALL SwVbaListTemplates::Item( const uno::Any& Index1, const uno::Any& /*not processed in this base class*/ ) throw (uno::RuntimeException) +{ + sal_Int32 nIndex = 0; + if( ( Index1 >>= nIndex ) == sal_False ) + throw uno::RuntimeException(); + if( nIndex <=0 || nIndex > getCount() ) + throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() ); + + return uno::makeAny( uno::Reference< word::XListTemplate >( new SwVbaListTemplate( this, mxContext, mxTextDocument, mnGalleryType, nIndex ) ) ); +} + +// XEnumerationAccess +uno::Type +SwVbaListTemplates::getElementType() throw (uno::RuntimeException) +{ + return word::XListTemplate::static_type(0); +} + +uno::Reference< container::XEnumeration > +SwVbaListTemplates::createEnumeration() throw (uno::RuntimeException) +{ + return new ListTemplatesEnumWrapper( this ); +} + +uno::Any +SwVbaListTemplates::createCollectionObject( const css::uno::Any& aSource ) +{ + return aSource; +} + +rtl::OUString& +SwVbaListTemplates::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaListTemplates") ); + return sImplName; +} + +css::uno::Sequence<rtl::OUString> +SwVbaListTemplates::getServiceNames() +{ + static uno::Sequence< rtl::OUString > sNames; + if ( sNames.getLength() == 0 ) + { + sNames.realloc( 1 ); + sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.ListTemplates") ); + } + return sNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbalisttemplates.hxx b/sw/source/ui/vba/vbalisttemplates.hxx new file mode 100644 index 0000000000..a421379848 --- /dev/null +++ b/sw/source/ui/vba/vbalisttemplates.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_LISTTEMPLATES_HXX +#define SW_VBA_LISTTEMPLATES_HXX + +#include <vbahelper/vbacollectionimpl.hxx> +#include <ooo/vba/word/XListTemplates.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <com/sun/star/text/XTextDocument.hpp> + +typedef CollTestImplHelper< ooo::vba::word::XListTemplates > SwVbaListTemplates_BASE; + +class SwVbaListTemplates : public SwVbaListTemplates_BASE +{ +private: + css::uno::Reference< css::text::XTextDocument > mxTextDocument; + sal_Int32 mnGalleryType; + +public: + SwVbaListTemplates( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextDocument >& xTextDoc, sal_Int32 nType ) throw (css::uno::RuntimeException); + virtual ~SwVbaListTemplates() {} + + virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/ ) throw ( css::uno::RuntimeException ); + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + + // SwVbaListTemplates_BASE + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif /* SW_VBA_LISTTEMPLATES_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaoptions.cxx b/sw/source/ui/vba/vbaoptions.cxx index 34f1e2a588..f2dca6b947 100644 --- a/sw/source/ui/vba/vbaoptions.cxx +++ b/sw/source/ui/vba/vbaoptions.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -103,7 +104,7 @@ void SwVbaOptions::setValueEvent( const uno::Any& value ) value >>= sNewPath; rtl::OUString sNewPathUrl; ::osl::File::getFileURLFromSystemPath( sNewPath, sNewPathUrl ); - uno::Reference< beans::XPropertySet > xPathSettings( mxFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.PathSettings") ), uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xPathSettings( mxFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.PathSettings")) ), uno::UNO_QUERY_THROW ); rtl::OUString sOldPathUrl; xPathSettings->getPropertyValue( msDefaultFilePath ) >>= sOldPathUrl; // path could be a multipath, Microsoft doesn't support this feature in Word currently @@ -118,7 +119,7 @@ void SwVbaOptions::setValueEvent( const uno::Any& value ) uno::Any SwVbaOptions::getValueEvent() { - uno::Reference< beans::XPropertySet > xPathSettings( mxFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.PathSettings") ), uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xPathSettings( mxFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.PathSettings")) ), uno::UNO_QUERY_THROW ); rtl::OUString sPathUrl; xPathSettings->getPropertyValue( msDefaultFilePath ) >>= sPathUrl; // path could be a multipath, Microsoft doesn't support this feature in Word currently @@ -282,3 +283,5 @@ SwVbaOptions::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaoptions.hxx b/sw/source/ui/vba/vbaoptions.hxx index 0a1c1f8f61..169f1beebb 100644 --- a/sw/source/ui/vba/vbaoptions.hxx +++ b/sw/source/ui/vba/vbaoptions.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -85,3 +86,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_OPTIONS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbapagesetup.cxx b/sw/source/ui/vba/vbapagesetup.cxx index 892f2a918f..4303e4813a 100644 --- a/sw/source/ui/vba/vbapagesetup.cxx +++ b/sw/source/ui/vba/vbapagesetup.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -144,7 +145,7 @@ void SAL_CALL SwVbaPageSetup::setFooterDistance( double _footerdistance ) throw sal_Bool SAL_CALL SwVbaPageSetup::getDifferentFirstPageHeaderFooter() throw (uno::RuntimeException) { rtl::OUString pageStyle = getStyleOfFirstPage(); - if( pageStyle.equalsAscii( "First Page" ) ) + if( pageStyle.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "First Page" ) ) ) return sal_True; return sal_False; @@ -236,10 +237,9 @@ rtl::OUString SwVbaPageSetup::getStyleOfFirstPage() throw (uno::RuntimeException sal_Int32 wdSectionStart = word::WdSectionStart::wdSectionNewPage; uno::Reference< container::XNamed > xNamed( mxPageProps, uno::UNO_QUERY_THROW ); rtl::OUString sStyleName = xNamed->getName(); - //mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) ) >>= sStyleName; - if( sStyleName.equalsAscii("Left Page") ) + if( sStyleName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Left Page")) ) wdSectionStart = word::WdSectionStart::wdSectionEvenPage; - else if( sStyleName.equalsAscii("Right Page") ) + else if( sStyleName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Right Page")) ) wdSectionStart = word::WdSectionStart::wdSectionOddPage; else wdSectionStart = word::WdSectionStart::wdSectionNewPage; @@ -270,3 +270,5 @@ SwVbaPageSetup::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbapagesetup.hxx b/sw/source/ui/vba/vbapagesetup.hxx index 8449b7f908..1437b4d92b 100644 --- a/sw/source/ui/vba/vbapagesetup.hxx +++ b/sw/source/ui/vba/vbapagesetup.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -65,3 +66,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbapalette.cxx b/sw/source/ui/vba/vbapalette.cxx index 40191df6f8..8943b73b4a 100644 --- a/sw/source/ui/vba/vbapalette.cxx +++ b/sw/source/ui/vba/vbapalette.cxx @@ -1,8 +1,10 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "vbapalette.hxx" #include <cppuhelper/implbase1.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <ooo/vba/word/WdColor.hpp> #include <ooo/vba/word/WdColorIndex.hpp> +#include <sal/macros.h> using namespace ::ooo::vba; using namespace ::ooo::vba::word; @@ -39,7 +41,7 @@ public: // Methods XIndexAccess virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException) { - return sizeof(ColorTable) / sizeof(ColorTable[0]); + return SAL_N_ELEMENTS(ColorTable); } virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) @@ -73,3 +75,4 @@ VbaPalette::getPalette() const return mxPalette; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbapalette.hxx b/sw/source/ui/vba/vbapalette.hxx index 130e405a13..5d7b6fe652 100644 --- a/sw/source/ui/vba/vbapalette.hxx +++ b/sw/source/ui/vba/vbapalette.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #ifndef VBAPALETTE_HXX #define VBAPALETTE_HXX #include <vbahelper/vbahelper.hxx> @@ -13,3 +14,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbapane.cxx b/sw/source/ui/vba/vbapane.cxx index 3fcd415c1d..a76596c3fd 100644 --- a/sw/source/ui/vba/vbapane.cxx +++ b/sw/source/ui/vba/vbapane.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -74,3 +75,4 @@ SwVbaPane::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbapane.hxx b/sw/source/ui/vba/vbapane.hxx index c9b11d99aa..bbb341dc86 100644 --- a/sw/source/ui/vba/vbapane.hxx +++ b/sw/source/ui/vba/vbapane.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,3 +53,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_PANE_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbapanes.cxx b/sw/source/ui/vba/vbapanes.cxx index b97991a550..076a26f7cb 100644 --- a/sw/source/ui/vba/vbapanes.cxx +++ b/sw/source/ui/vba/vbapanes.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -122,3 +123,5 @@ SwVbaPanes::getServiceNames() } return sNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbapanes.hxx b/sw/source/ui/vba/vbapanes.hxx index 6294e81ba5..5a7fd67eb4 100644 --- a/sw/source/ui/vba/vbapanes.hxx +++ b/sw/source/ui/vba/vbapanes.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,5 @@ public: }; #endif /* SW_VBA_PANES_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaparagraph.cxx b/sw/source/ui/vba/vbaparagraph.cxx index 075ea6f107..f512c5844a 100644 --- a/sw/source/ui/vba/vbaparagraph.cxx +++ b/sw/source/ui/vba/vbaparagraph.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,6 +49,20 @@ SwVbaParagraph::getRange( ) throw ( uno::RuntimeException ) return uno::Reference< word::XRange >( new SwVbaRange( this, mxContext, mxTextDocument, mxTextRange->getStart(), mxTextRange->getEnd(), mxTextRange->getText(), sal_True ) ); } +uno::Any SAL_CALL +SwVbaParagraph::getStyle( ) throw ( uno::RuntimeException ) +{ + uno::Reference< word::XRange > xRange = getRange(); + return xRange->getStyle(); +} + +void SAL_CALL +SwVbaParagraph::setStyle( const uno::Any& style ) throw ( uno::RuntimeException ) +{ + uno::Reference< word::XRange > xRange = getRange(); + xRange->setStyle( style ); +} + rtl::OUString& SwVbaParagraph::getServiceImplName() { @@ -67,8 +82,6 @@ SwVbaParagraph::getServiceNames() return aServiceNames; } - -//typedef ::cppu::WeakImplHelper1< container::XEnumeration > ParagraphEnumeration_BASE; typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XEnumerationAccess > ParagraphCollectionHelper_BASE; class ParagraphCollectionHelper : public ParagraphCollectionHelper_BASE @@ -172,3 +185,5 @@ SwVbaParagraphs::getServiceNames() } return sNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaparagraph.hxx b/sw/source/ui/vba/vbaparagraph.hxx index 4c2cc448e5..a475ceb6bf 100644 --- a/sw/source/ui/vba/vbaparagraph.hxx +++ b/sw/source/ui/vba/vbaparagraph.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,6 +51,8 @@ public: // XParagraph virtual css::uno::Reference< ooo::vba::word::XRange > SAL_CALL getRange() throw ( css::uno::RuntimeException ); + virtual css::uno::Any SAL_CALL getStyle() throw ( css::uno::RuntimeException ); + virtual void SAL_CALL setStyle( const css::uno::Any& style ) throw ( css::uno::RuntimeException ); // XHelperInterface virtual rtl::OUString& getServiceImplName(); @@ -79,3 +82,5 @@ public: }; #endif /* SW_VBA_PARAGRAPH_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaparagraphformat.cxx b/sw/source/ui/vba/vbaparagraphformat.cxx index dbcadac1e3..8a2391f4c4 100644 --- a/sw/source/ui/vba/vbaparagraphformat.cxx +++ b/sw/source/ui/vba/vbaparagraphformat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,6 +35,7 @@ #include <ooo/vba/word/WdOutlineLevel.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/style/BreakType.hpp> +#include "vbatabstops.hxx" using namespace ::ooo::vba; @@ -200,9 +202,12 @@ sal_Int32 SAL_CALL SwVbaParagraphFormat::getOutlineLevel() throw (uno::RuntimeEx return nLevel; } -void SAL_CALL SwVbaParagraphFormat::setOutlineLevel( sal_Int32 /*_outlinelevel*/ ) throw (uno::RuntimeException) +void SAL_CALL SwVbaParagraphFormat::setOutlineLevel( sal_Int32 _outlinelevel ) throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + if( _outlinelevel != getOutlineLevel() ) + { + // TODO: in my test in msword, there is no effect for this function. + } } uno::Any SAL_CALL SwVbaParagraphFormat::getPageBreakBefore() throw (uno::RuntimeException) @@ -296,7 +301,7 @@ void SAL_CALL SwVbaParagraphFormat::setRightIndent( float _rightindent ) throw ( uno::Any SAL_CALL SwVbaParagraphFormat::getTabStops() throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + return uno::makeAny( uno::Reference< word::XTabStops >( new SwVbaTabStops( this, mxContext, mxParaProps ) ) ); } void SAL_CALL SwVbaParagraphFormat::setTabStops( const uno::Any& /*_tabstops*/ ) throw (uno::RuntimeException) @@ -571,3 +576,4 @@ SwVbaParagraphFormat::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaparagraphformat.hxx b/sw/source/ui/vba/vbaparagraphformat.hxx index 4a061b96b7..232046ff0d 100644 --- a/sw/source/ui/vba/vbaparagraphformat.hxx +++ b/sw/source/ui/vba/vbaparagraphformat.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -93,3 +94,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_PARAGRAPHFORMAT_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbarange.cxx b/sw/source/ui/vba/vbarange.cxx index d6f719dd0b..f58f7ab89b 100644 --- a/sw/source/ui/vba/vbarange.cxx +++ b/sw/source/ui/vba/vbarange.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -32,12 +33,21 @@ #include <com/sun/star/style/BreakType.hpp> #include <com/sun/star/text/ControlCharacter.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> -#include "wordvbahelper.hxx" +#include <com/sun/star/text/XTextRangeCompare.hpp> +#include <com/sun/star/text/XWordCursor.hpp> +#include <com/sun/star/text/XParagraphCursor.hpp> +#include <ooo/vba/word/WdUnits.hpp> +#include <ooo/vba/word/WdMovementType.hpp> #include "vbaparagraphformat.hxx" #include "vbastyle.hxx" #include "vbafont.hxx" #include "vbapalette.hxx" #include "vbapagesetup.hxx" +#include "vbalistformat.hxx" +#include "vbarevisions.hxx" +#include "vbabookmarks.hxx" +#include "vbasections.hxx" +#include "vbafield.hxx" using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -67,9 +77,11 @@ void SwVbaRange::initialize( const uno::Reference< text::XTextRange >& rStart, c if( !mxText.is() ) { mxText = mxTextDocument->getText(); - } - + } + mxTextCursor = SwVbaRangeHelper::initCursor( rStart, mxText ); + if( !mxTextCursor.is() ) + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Fails to create text cursor") ), uno::Reference< uno::XInterface >() ); mxTextCursor->collapseToStart(); if( rEnd.is() ) @@ -84,13 +96,7 @@ SwVbaRange::getXTextRange() throw (uno::RuntimeException) uno::Reference< text::XTextRange > xTextRange( mxTextCursor, uno::UNO_QUERY_THROW ); return xTextRange; } -#ifdef TOMORROW -void SwVbaRange::setXTextRange( const uno::Reference< text::XTextRange >& xRange ) throw (uno::RuntimeException) -{ - mxTextCursor->gotoRange( xRange->getStart(), sal_False ); - mxTextCursor->gotoRange( xRange->getEnd(), sal_True ); -} -#endif + /** * The complexity in this method is because we need to workaround * an issue that the last paragraph in a document does not have a trailing CRLF. @@ -128,17 +134,46 @@ SwVbaRange::getText() throw ( uno::RuntimeException ) void SAL_CALL SwVbaRange::setText( const rtl::OUString& rText ) throw ( uno::RuntimeException ) { + // Emulate the MSWord behavior, Don't delete the bookmark + // which contains no text string in current inserting position, + rtl::OUString sName; + uno::Reference< text::XTextRange > xRange( mxTextCursor, uno::UNO_QUERY_THROW ); + try + { + uno::Reference< text::XTextContent > xBookmark = SwVbaRangeHelper::findBookmarkByPosition( mxTextDocument, xRange->getStart() ); + if( xBookmark.is() ) + { + uno::Reference< container::XNamed > xNamed( xBookmark, uno::UNO_QUERY_THROW ); + sName = xNamed->getName(); + } + } + catch( uno::Exception& ) + { + // do nothing + } + if( rText.indexOf( '\n' ) != -1 ) { mxTextCursor->setString( rtl::OUString() ); // process CR in strings - uno::Reference< text::XTextRange > xRange( mxTextCursor, uno::UNO_QUERY_THROW ); SwVbaRangeHelper::insertString( xRange, mxText, rText, sal_True ); } else { mxTextCursor->setString( rText ); } + + // insert the bookmark if the bookmark is deleted during setting text string + if( sName.getLength() ) + { + uno::Reference< text::XBookmarksSupplier > xBookmarksSupplier( mxTextDocument, uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameAccess > xNameAccess( xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY_THROW ); + if( !xNameAccess->hasByName( sName ) ) + { + uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW ); + SwVbaBookmarks::addBookmarkByName( xModel, sName, xRange->getStart() ); + } + } } // FIXME: test is not pass @@ -229,11 +264,8 @@ SwVbaRange::setParagraphFormat( const uno::Reference< word::XParagraphFormat >& throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); } -uno::Reference< word::XStyle > SAL_CALL -SwVbaRange::getStyle() throw ( uno::RuntimeException ) +void SwVbaRange::GetStyleInfo(rtl::OUString& aStyleName, rtl::OUString& aStyleType ) throw ( uno::RuntimeException ) { - rtl::OUString aStyleName; - rtl::OUString aStyleType; uno::Reference< beans::XPropertySet > xProp( mxTextCursor, uno::UNO_QUERY_THROW ); if( ( xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CharStyleName") ) ) >>= aStyleName ) && aStyleName.getLength() ) { @@ -247,14 +279,23 @@ SwVbaRange::getStyle() throw ( uno::RuntimeException ) { DebugHelper::exception( SbERR_INTERNAL_ERROR, rtl::OUString() ); } +} + +uno::Any SAL_CALL +SwVbaRange::getStyle() throw ( uno::RuntimeException ) +{ + rtl::OUString aStyleName; + rtl::OUString aStyleType; + GetStyleInfo( aStyleName, aStyleType ); uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( mxTextDocument, uno::UNO_QUERY_THROW); uno::Reference< container::XNameAccess > xStylesAccess( xStyleSupplier->getStyleFamilies()->getByName( aStyleType ), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xStyleProps( xStylesAccess->getByName( aStyleName ), uno::UNO_QUERY_THROW ); - return uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, xStyleProps ) ); + uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW ); + return uno::makeAny( uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, xModel, xStyleProps ) ) ); } void SAL_CALL -SwVbaRange::setStyle( const uno::Reference< word::XStyle >& rStyle ) throw ( uno::RuntimeException ) +SwVbaRange::setStyle( const uno::Any& rStyle ) throw ( uno::RuntimeException ) { uno::Reference< beans::XPropertySet > xParaProps( mxTextCursor, uno::UNO_QUERY_THROW ); SwVbaStyle::setStyle( xParaProps, rStyle ); @@ -267,6 +308,12 @@ SwVbaRange::getFont() throw ( uno::RuntimeException ) return new SwVbaFont( mxParent, mxContext, aColors.getPalette(), uno::Reference< beans::XPropertySet >( getXTextRange(), uno::UNO_QUERY_THROW ) ); } +uno::Reference< word::XListFormat > SAL_CALL +SwVbaRange::getListFormat() throw ( uno::RuntimeException ) +{ + return uno::Reference< word::XListFormat >( new SwVbaListFormat( this, mxContext, getXTextRange() ) ); +} + ::sal_Int32 SAL_CALL SwVbaRange::getLanguageID() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xParaProps( mxTextCursor, uno::UNO_QUERY_THROW ); @@ -324,14 +371,58 @@ void SAL_CALL SwVbaRange::setEnd( ::sal_Int32 _end ) throw (uno::RuntimeExceptio mxTextCursor->gotoRange( xEnd, sal_True ); } -rtl::OUString& +::sal_Bool SAL_CALL SwVbaRange::InRange( const uno::Reference< ::ooo::vba::word::XRange >& Range ) throw (uno::RuntimeException) +{ + SwVbaRange* pRange = dynamic_cast< SwVbaRange* >( Range.get() ); + if( !pRange ) + throw uno::RuntimeException(); + uno::Reference< text::XTextRange > xTextRange = pRange->getXTextRange(); + uno::Reference< text::XTextRangeCompare > xTRC( mxTextCursor->getText(), uno::UNO_QUERY_THROW ); + if( xTRC->compareRegionStarts( xTextRange, getXTextRange() ) >= 0 && xTRC->compareRegionEnds( xTextRange, getXTextRange() ) <= 0 ) + return sal_True; + return sal_False; +} + +uno::Any SAL_CALL +SwVbaRange::Revisions( const uno::Any& index ) throw (uno::RuntimeException) +{ + uno::Reference< text::XTextRange > xTextRange = getXTextRange(); + uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW ); + uno::Reference< XCollection > xCol( new SwVbaRevisions( mxParent, mxContext, xModel, xTextRange ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} + +uno::Any SAL_CALL +SwVbaRange::Sections( const uno::Any& index ) throw (uno::RuntimeException) +{ + uno::Reference< text::XTextRange > xTextRange = getXTextRange(); + uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW ); + uno::Reference< XCollection > xCol( new SwVbaSections( mxParent, mxContext, xModel, xTextRange ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} + +uno::Any SAL_CALL +SwVbaRange::Fields( const uno::Any& index ) throw (uno::RuntimeException) +{ + //FIXME: should be get the field in current range + uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW ); + uno::Reference< XCollection > xCol( new SwVbaFields( mxParent, mxContext, xModel ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} +rtl::OUString& SwVbaRange::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaRange") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > SwVbaRange::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -343,3 +434,4 @@ SwVbaRange::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbarange.hxx b/sw/source/ui/vba/vbarange.hxx index ca3a4ea21b..f29bfeb209 100644 --- a/sw/source/ui/vba/vbarange.hxx +++ b/sw/source/ui/vba/vbarange.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,6 +36,8 @@ #include <com/sun/star/text/XTextRange.hpp> #include <com/sun/star/text/XTextDocument.hpp> #include <ooo/vba/word/XStyle.hpp> +#include <ooo/vba/word/XListFormat.hpp> +#include "wordvbahelper.hxx" typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XRange > SwVbaRange_BASE; @@ -48,29 +51,29 @@ private: private: void initialize( const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd ) throw (css::uno::RuntimeException); + void GetStyleInfo(rtl::OUString& aStyleName, rtl::OUString& aStyleType ) throw ( css::uno::RuntimeException ); public: SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart, sal_Bool _bMaySpanEndOfDocument = sal_False ) throw (css::uno::RuntimeException); SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd, sal_Bool _bMaySpanEndOfDocument = sal_False ) throw (css::uno::RuntimeException); SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd, const css::uno::Reference< css::text::XText >& rText, sal_Bool _bMaySpanEndOfDocument = sal_False ) throw (css::uno::RuntimeException); virtual ~SwVbaRange(); - css::uno::Reference< css::text::XTextDocument > getDocument() { return mxTextDocument; } + css::uno::Reference< css::text::XTextDocument > getDocument() const { return mxTextDocument; } virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getXTextRange() throw (css::uno::RuntimeException); -#ifdef TOMORROW - void setXTextRange( const css::uno::Reference< css::text::XTextRange >& xRange ) throw (css::uno::RuntimeException); -#endif - css::uno::Reference< css::text::XText > getXText() { return mxText; } + css::uno::Reference< css::text::XText > getXText() const { return mxText; } void setXTextCursor( const css::uno::Reference< css::text::XTextCursor >& xTextCursor ) { mxTextCursor = xTextCursor; } + void Move( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend, ooo::vba::word::E_DIRECTION eDirection ) throw (css::uno::RuntimeException); // Attribute virtual rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException); virtual void SAL_CALL setText( const rtl::OUString& rText ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() throw (css::uno::RuntimeException); virtual void SAL_CALL setParagraphFormat( const css::uno::Reference< ooo::vba::word::XParagraphFormat >& rParagraphFormat ) throw (css::uno::RuntimeException); - virtual css::uno::Reference< ooo::vba::word::XStyle > SAL_CALL getStyle() throw (css::uno::RuntimeException); - virtual void SAL_CALL setStyle( const css::uno::Reference< ooo::vba::word::XStyle >& _xStyle ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getStyle() throw (css::uno::RuntimeException); + virtual void SAL_CALL setStyle( const css::uno::Any& _xStyle ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() throw (css::uno::RuntimeException); + virtual css::uno::Reference< ooo::vba::word::XListFormat > SAL_CALL getListFormat() throw (css::uno::RuntimeException); // Methods virtual void SAL_CALL InsertBreak( const css::uno::Any& _breakType ) throw (css::uno::RuntimeException); virtual void SAL_CALL Select() throw (css::uno::RuntimeException); @@ -84,9 +87,15 @@ public: virtual void SAL_CALL setStart( ::sal_Int32 _start ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getEnd() throw (css::uno::RuntimeException); virtual void SAL_CALL setEnd( ::sal_Int32 _end ) throw (css::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL InRange( const css::uno::Reference< ::ooo::vba::word::XRange >& Range ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Revisions( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Sections( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Fields( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_RANGE_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbarangehelper.cxx b/sw/source/ui/vba/vbarangehelper.cxx index 337fd9d6ae..3723d0cb71 100644 --- a/sw/source/ui/vba/vbarangehelper.cxx +++ b/sw/source/ui/vba/vbarangehelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,6 +28,7 @@ #include "vbarangehelper.hxx" #include <com/sun/star/text/ControlCharacter.hpp> #include <com/sun/star/text/XTextRangeCompare.hpp> +#include <com/sun/star/text/XBookmarksSupplier.hpp> using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -111,7 +113,7 @@ uno::Reference< text::XTextCursor > SwVbaRangeHelper::initCursor( const uno::Ref DebugHelper::exception(e); } - if( !bGotTextCursor ) + if( !bGotTextCursor || !xTextCursor.is() ) { try { @@ -125,7 +127,7 @@ uno::Reference< text::XTextCursor > SwVbaRangeHelper::initCursor( const uno::Ref } } - if( !bGotTextCursor ) + if( !bGotTextCursor || !xTextCursor.is() ) { try { @@ -169,3 +171,30 @@ sal_Int32 SwVbaRangeHelper::getPosition( const uno::Reference< text::XText >& rT return nPosition; } + +uno::Reference< text::XTextContent > SwVbaRangeHelper::findBookmarkByPosition( const uno::Reference< text::XTextDocument >& xTextDoc, const uno::Reference< text::XTextRange >& xTextRange ) throw ( css::uno::RuntimeException ) +{ + uno::Reference< text::XBookmarksSupplier > xBookmarksSupplier( xTextDoc, uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xIndexAccess( xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY_THROW ); + for( sal_Int32 index = 0; index < xIndexAccess->getCount(); index++ ) + { + uno::Reference< text::XTextContent > xBookmark( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextRange > xBkAnchor = xBookmark->getAnchor(); + uno::Reference< text::XTextRangeCompare > xCompare( xBkAnchor->getText(), uno::UNO_QUERY_THROW ); + if( xCompare->compareRegionStarts( xBkAnchor->getStart(), xBkAnchor->getEnd() ) == 0 ) + { + try + { + if( xCompare->compareRegionStarts( xTextRange, xBkAnchor->getStart() ) == 0 ) + return xBookmark; + } + catch( uno::Exception& ) + { + continue; + } + } + } + return uno::Reference< text::XTextContent >(); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbarangehelper.hxx b/sw/source/ui/vba/vbarangehelper.hxx index 530c7e1fa1..283a97f538 100644 --- a/sw/source/ui/vba/vbarangehelper.hxx +++ b/sw/source/ui/vba/vbarangehelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,6 +31,8 @@ #include <vbahelper/vbahelperinterface.hxx> #include <com/sun/star/text/XTextViewCursor.hpp> #include <com/sun/star/text/XText.hpp> +#include <com/sun/star/text/XTextRange.hpp> +#include <com/sun/star/text/XTextDocument.hpp> class SwVbaRangeHelper { @@ -38,6 +41,9 @@ public: static void insertString( css::uno::Reference< css::text::XTextRange >& rTextRange, css::uno::Reference< css::text::XText >& rText, const rtl::OUString& rStr, sal_Bool _bAbsorb ) throw ( css::uno::RuntimeException ); static css::uno::Reference< css::text::XTextCursor > initCursor( const css::uno::Reference< css::text::XTextRange >& rTextRange, const css::uno::Reference< css::text::XText >& rText ) throw ( css::uno::RuntimeException ); static sal_Int32 getPosition( const css::uno::Reference< css::text::XText >& rText, const css::uno::Reference< css::text::XTextRange >& rTextRange ) throw ( css::uno::RuntimeException ); + static css::uno::Reference< css::text::XTextContent > findBookmarkByPosition( const css::uno::Reference< css::text::XTextDocument >& xTextDoc, const css::uno::Reference< css::text::XTextRange >& xTextRange ) throw ( css::uno::RuntimeException ); }; #endif /* SW_VBA_RANGEHELPER_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbareplacement.cxx b/sw/source/ui/vba/vbareplacement.cxx index 2bd7dcfa58..fd8d4ecb9f 100644 --- a/sw/source/ui/vba/vbareplacement.cxx +++ b/sw/source/ui/vba/vbareplacement.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,6 +51,12 @@ void SAL_CALL SwVbaReplacement::setText( const ::rtl::OUString& _text ) throw (u mxPropertyReplace->setReplaceString( _text ); } +void SAL_CALL SwVbaReplacement::ClearFormatting( ) throw (uno::RuntimeException) +{ + uno::Sequence< beans::PropertyValue > aPropValues; + mxPropertyReplace->setReplaceAttributes( aPropValues ); +} + rtl::OUString& SwVbaReplacement::getServiceImplName() { @@ -69,3 +76,4 @@ SwVbaReplacement::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbareplacement.hxx b/sw/source/ui/vba/vbareplacement.hxx index c0f66af45f..52778bd92d 100644 --- a/sw/source/ui/vba/vbareplacement.hxx +++ b/sw/source/ui/vba/vbareplacement.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,8 +48,13 @@ public: virtual ::rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException); virtual void SAL_CALL setText( const ::rtl::OUString& _text ) throw (css::uno::RuntimeException); + //Methods + virtual void SAL_CALL ClearFormatting() throw (css::uno::RuntimeException); + // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_REPLACEMENT_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbarevision.cxx b/sw/source/ui/vba/vbarevision.cxx new file mode 100644 index 0000000000..5c1f0e841b --- /dev/null +++ b/sw/source/ui/vba/vbarevision.cxx @@ -0,0 +1,104 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbarevision.hxx" +#include <vbahelper/vbahelper.hxx> +#include <tools/diagnose_ex.h> +#include <com/sun/star/document/XRedlinesSupplier.hpp> +#include "wordvbahelper.hxx" +#include <docsh.hxx> +#include <doc.hxx> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +SwVbaRevision::SwVbaRevision( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< beans::XPropertySet >& xRedlineProps ) throw ( uno::RuntimeException ) : SwVbaRevision_BASE( rParent, rContext ), mxModel( xModel ), mxRedlineProps( xRedlineProps ) +{ +} + +SwVbaRevision::~SwVbaRevision() +{ +} + +sal_Int32 SwVbaRevision::GetPosition() throw (css::uno::RuntimeException) +{ + sal_Int32 nPos = -1; + uno::Reference< document::XRedlinesSupplier > xRedlinesSupp( mxModel, uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xRedlines( xRedlinesSupp->getRedlines(), uno::UNO_QUERY_THROW ); + sal_Int32 nCount = xRedlines->getCount(); + for( sal_Int32 i = 0; i < nCount; i++ ) + { + uno::Reference< beans::XPropertySet > xProps( xRedlines->getByIndex( i ), uno::UNO_QUERY_THROW ); + if( xProps == mxRedlineProps ) + { + nPos = i; + OSL_TRACE(" SwVbaRevision::SwVbaRevision, the redline position is %d, ", nPos ); + break; + } + } + if( nPos == -1 ) + throw uno::RuntimeException(); + + return nPos; +} + +void SAL_CALL +SwVbaRevision::Accept() throw ( css::uno::RuntimeException ) +{ + SwDoc* pDoc = word::getDocShell( mxModel )->GetDoc(); + if( pDoc ) + pDoc->AcceptRedline( GetPosition(), sal_True ); +} + +void SAL_CALL +SwVbaRevision::Reject( ) throw ( css::uno::RuntimeException ) +{ + SwDoc* pDoc = word::getDocShell( mxModel )->GetDoc(); + if( pDoc ) + pDoc->RejectRedline( GetPosition(), sal_True ); +} + +rtl::OUString& +SwVbaRevision::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaRevision") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +SwVbaRevision::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Revision" ) ); + } + return aServiceNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbarevision.hxx b/sw/source/ui/vba/vbarevision.hxx new file mode 100644 index 0000000000..1ecadcd1f6 --- /dev/null +++ b/sw/source/ui/vba/vbarevision.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_REVISION_HXX +#define SW_VBA_REVISION_HXX + +#include <ooo/vba/word/XRevision.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <cppuhelper/implbase1.hxx> + +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XRevision > SwVbaRevision_BASE; + +class SwVbaRevision : public SwVbaRevision_BASE +{ +private: + css::uno::Reference< css::frame::XModel > mxModel; + css::uno::Reference< css::beans::XPropertySet > mxRedlineProps; + +private: + sal_Int32 GetPosition() throw (css::uno::RuntimeException); + +public: + SwVbaRevision( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::beans::XPropertySet >& xRedlineProps ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaRevision(); + + // Methods + virtual void SAL_CALL Accept( ) throw (css::uno::RuntimeException); + virtual void SAL_CALL Reject( ) throw (css::uno::RuntimeException); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif /* SW_VBA_REVISION_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbarevisions.cxx b/sw/source/ui/vba/vbarevisions.cxx new file mode 100644 index 0000000000..85f4d8b112 --- /dev/null +++ b/sw/source/ui/vba/vbarevisions.cxx @@ -0,0 +1,188 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbarevisions.hxx" +#include "vbarevision.hxx" +#include <cppuhelper/implbase2.hxx> +#include <com/sun/star/document/XRedlinesSupplier.hpp> +#include <com/sun/star/text/XTextRangeCompare.hpp> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +typedef ::cppu::WeakImplHelper1< container::XEnumeration > RevisionEnumeration_BASE; +typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XEnumerationAccess > RevisionCollectionHelper_BASE; +typedef std::vector< uno::Reference< beans::XPropertySet > > RevisionMap; + +class RedlinesEnumeration : public RevisionEnumeration_BASE +{ + RevisionMap mRevisionMap; + RevisionMap::iterator mIt; +public: + RedlinesEnumeration( const RevisionMap& sMap ) : mRevisionMap( sMap ), mIt( mRevisionMap.begin() ) {} + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { + return ( mIt != mRevisionMap.end() ); + } + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( !hasMoreElements() ) + throw container::NoSuchElementException(); + uno::Reference< beans::XPropertySet > xRevision( *mIt++ ); + return uno::makeAny( xRevision ) ; + } +}; + +class RevisionCollectionHelper : public RevisionCollectionHelper_BASE +{ + RevisionMap mRevisionMap; +public: +RevisionCollectionHelper( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange ) throw (uno::RuntimeException); + + // XElementAccess + virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { return beans::XPropertySet::static_type(0); } + virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { return ( mRevisionMap.size() > 0 ); } + // XIndexAccess + virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) { return mRevisionMap.size(); } + virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) + { + if ( Index < 0 || Index >= getCount() ) + throw lang::IndexOutOfBoundsException(); + + return uno::makeAny( mRevisionMap[ Index ] ); + + } + // XEnumerationAccess + virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException) + { + return new RedlinesEnumeration( mRevisionMap ); + } +}; + +RevisionCollectionHelper::RevisionCollectionHelper( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange ) throw (uno::RuntimeException) + { + uno::Reference< text::XTextRangeCompare > xTRC( xTextRange->getText(), uno::UNO_QUERY_THROW ); + uno::Reference< document::XRedlinesSupplier > xRedlinesSupp( xModel, uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xRedlines( xRedlinesSupp->getRedlines(), uno::UNO_QUERY_THROW ); + sal_Int32 nCount = xRedlines->getCount(); + for( sal_Int32 index = 0; index < nCount; index++ ) + { + uno::Reference< text::XTextRange > xRedlineRange( xRedlines->getByIndex( index ), uno::UNO_QUERY_THROW ); + if( xTRC->compareRegionStarts( xTextRange, xRedlineRange ) >= 0 && xTRC->compareRegionEnds( xTextRange, xRedlineRange ) <= 0 ) + { + uno::Reference< beans::XPropertySet > xRedlineProps( xRedlineRange, uno::UNO_QUERY_THROW ); + mRevisionMap.push_back( xRedlineProps ); + } + } + } +class RevisionsEnumeration : public EnumerationHelperImpl +{ + uno::Reference< frame::XModel > m_xModel; +public: + RevisionsEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration, const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) : EnumerationHelperImpl( xParent, xContext, xEnumeration ), m_xModel( xModel ) {} + + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + uno::Reference< beans::XPropertySet > xRevision( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); + return uno::makeAny( uno::Reference< word::XRevision > ( new SwVbaRevision( m_xParent, m_xContext, m_xModel, xRevision ) ) ); + } + +}; + +SwVbaRevisions::SwVbaRevisions( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange ): SwVbaRevisions_BASE( xParent, xContext, new RevisionCollectionHelper( xModel, xTextRange ) ), mxModel( xModel ) +{ +} + +SwVbaRevisions::SwVbaRevisions( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< container::XIndexAccess >& xIndexAccess ): SwVbaRevisions_BASE( xParent, xContext, xIndexAccess ), mxModel( xModel ) +{ +} + +// XEnumerationAccess +uno::Type +SwVbaRevisions::getElementType() throw (uno::RuntimeException) +{ + return word::XRevision::static_type(0); +} +uno::Reference< container::XEnumeration > +SwVbaRevisions::createEnumeration() throw (uno::RuntimeException) +{ + uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xIndexAccess, uno::UNO_QUERY_THROW ); + return new RevisionsEnumeration( this, mxContext, xEnumAccess->createEnumeration(), mxModel ); +} + +uno::Any +SwVbaRevisions::createCollectionObject( const css::uno::Any& aSource ) +{ + uno::Reference< beans::XPropertySet > xRevision( aSource, uno::UNO_QUERY_THROW ); + return uno::makeAny( uno::Reference< word::XRevision > ( new SwVbaRevision( this, mxContext, mxModel, xRevision ) ) ); +} + +void SAL_CALL SwVbaRevisions::AcceptAll( ) throw (css::uno::RuntimeException) +{ + // First we need to put all the redline into a vector, because if the redline is accepted, + // it will auto delete in the document. + std::vector< uno::Reference< word::XRevision > > aRevisions; + uno::Reference< container::XEnumeration > xEnumeration = createEnumeration(); + while( xEnumeration->hasMoreElements() ) + { + uno::Reference< word::XRevision > xRevision( xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); + aRevisions.push_back( xRevision ); + } + + std::vector< uno::Reference< word::XRevision > >::iterator it = aRevisions.begin(); + for( ; it != aRevisions.end(); ++it ) + { + uno::Reference< word::XRevision > xRevision( *it ); + xRevision->Accept(); + } +} + +void SAL_CALL SwVbaRevisions::RejectAll( ) throw (css::uno::RuntimeException) +{ + throw uno::RuntimeException(); +} + +rtl::OUString& +SwVbaRevisions::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaRevisions") ); + return sImplName; +} + +css::uno::Sequence<rtl::OUString> +SwVbaRevisions::getServiceNames() +{ + static uno::Sequence< rtl::OUString > sNames; + if ( sNames.getLength() == 0 ) + { + sNames.realloc( 1 ); + sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Revisions") ); + } + return sNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbarevisions.hxx b/sw/source/ui/vba/vbarevisions.hxx new file mode 100644 index 0000000000..142bf8987b --- /dev/null +++ b/sw/source/ui/vba/vbarevisions.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_PANES_HXX +#define SW_VBA_PANES_HXX + +#include <vbahelper/vbacollectionimpl.hxx> +#include <ooo/vba/word/XRevisions.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <com/sun/star/text/XTextRange.hpp> + + +typedef CollTestImplHelper< ooo::vba::word::XRevisions > SwVbaRevisions_BASE; + +class SwVbaRevisions : public SwVbaRevisions_BASE +{ +private: + css::uno::Reference< css::frame::XModel > mxModel; + +public: + SwVbaRevisions( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XTextRange >& xTextRange ); + + SwVbaRevisions( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ); + virtual ~SwVbaRevisions() {} + + // Methods + virtual void SAL_CALL AcceptAll( ) throw (css::uno::RuntimeException); + virtual void SAL_CALL RejectAll( ) throw (css::uno::RuntimeException); + + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + + // SwVbaRevisions_BASE + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif /* SW_VBA_PANES_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbarow.cxx b/sw/source/ui/vba/vbarow.cxx new file mode 100644 index 0000000000..7199b99f4b --- /dev/null +++ b/sw/source/ui/vba/vbarow.cxx @@ -0,0 +1,135 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbarow.hxx" +#include <vbahelper/vbahelper.hxx> +#include <tools/diagnose_ex.h> +#include <com/sun/star/table/XCellRange.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> +#include <ooo/vba/word/WdRowHeightRule.hpp> +#include <ooo/vba/word/WdConstants.hpp> +#include <rtl/ustrbuf.hxx> +#include "wordvbahelper.hxx" +#include "vbatablehelper.hxx" + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +SwVbaRow::SwVbaRow( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext,const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nIndex ) throw ( uno::RuntimeException ) : + SwVbaRow_BASE( rParent, rContext ), mxTextTable( xTextTable ), mnIndex( nIndex ) +{ + mxTableRows = mxTextTable->getRows(); + mxRowProps.set( mxTableRows->getByIndex( mnIndex ), uno::UNO_QUERY_THROW ); +} + +SwVbaRow::~SwVbaRow() +{ +} + +uno::Any SAL_CALL SwVbaRow::getHeight() throw (css::uno::RuntimeException) +{ + if( getHeightRule() == word::WdRowHeightRule::wdRowHeightAuto ) + return uno::makeAny( sal_Int32( word::WdConstants::wdUndefined ) ); + + sal_Int32 nHeight = 0; + mxRowProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height") ) ) >>= nHeight; + return uno::makeAny( (float)Millimeter::getInPoints( nHeight ) ); +} + +void SAL_CALL SwVbaRow::setHeight( const uno::Any& _height ) throw (css::uno::RuntimeException) +{ + float height = 0; + _height >>= height; + + sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( height ); + mxRowProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Height") ), uno::makeAny( nHeight ) ); +} + +::sal_Int32 SAL_CALL SwVbaRow::getHeightRule() throw (css::uno::RuntimeException) +{ + sal_Bool isAutoHeight = sal_False; + mxRowProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsAutoHeight") ) ) >>= isAutoHeight; + return isAutoHeight ? word::WdRowHeightRule::wdRowHeightAuto : word::WdRowHeightRule::wdRowHeightExactly; +} + +void SAL_CALL SwVbaRow::setHeightRule( ::sal_Int32 _heightrule ) throw (css::uno::RuntimeException) +{ + sal_Bool isAutoHeight = ( _heightrule == word::WdRowHeightRule::wdRowHeightAuto ); + mxRowProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsAutoHeight") ), uno::makeAny( isAutoHeight ) ); +} + +void SAL_CALL +SwVbaRow::Select( ) throw ( uno::RuntimeException ) +{ + SelectRow( getCurrentWordDoc(mxContext), mxTextTable, mnIndex, mnIndex ); +} + +void SwVbaRow::SelectRow( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nStartRow, sal_Int32 nEndRow ) throw ( uno::RuntimeException ) +{ + rtl::OUStringBuffer aRangeName; + aRangeName.appendAscii("A").append(sal_Int32( nStartRow + 1 ) ); + SwVbaTableHelper aTableHelper( xTextTable ); + sal_Int32 nColCount = aTableHelper.getTabColumnsCount( nEndRow ); + // FIXME: the column count > 26 + //sal_Char cCol = 'A' + nColCount - 1; + rtl::OUString sCol = aTableHelper.getColumnStr( nColCount - 1); + aRangeName.appendAscii(":").append( sCol ).append( sal_Int32( nEndRow + 1 ) ); + + uno::Reference< table::XCellRange > xCellRange( xTextTable, uno::UNO_QUERY_THROW ); + rtl::OUString sSelRange = aRangeName.makeStringAndClear(); + uno::Reference< table::XCellRange > xSelRange = xCellRange->getCellRangeByName( sSelRange ); + + uno::Reference< view::XSelectionSupplier > xSelection( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); + xSelection->select( uno::makeAny( xSelRange ) ); +} + +void SAL_CALL SwVbaRow::SetHeight( float height, sal_Int32 heightrule ) throw (css::uno::RuntimeException) +{ + setHeightRule( heightrule ); + setHeight( uno::makeAny( height ) ); +} + +rtl::OUString& +SwVbaRow::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaRow") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +SwVbaRow::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Row" ) ); + } + return aServiceNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbarow.hxx b/sw/source/ui/vba/vbarow.hxx new file mode 100644 index 0000000000..e4cf51f4e9 --- /dev/null +++ b/sw/source/ui/vba/vbarow.hxx @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_ROW_HXX +#define SW_VBA_ROW_HXX + +#include <ooo/vba/word/XRow.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/table/XTableRows.hpp> +#include <com/sun/star/text/XTextTable.hpp> + +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XRow > SwVbaRow_BASE; + +class SwVbaRow : public SwVbaRow_BASE +{ +private: + css::uno::Reference< css::text::XTextTable > mxTextTable; + css::uno::Reference< css::table::XTableRows > mxTableRows; + css::uno::Reference< css::beans::XPropertySet > mxRowProps; + sal_Int32 mnIndex; + +public: + SwVbaRow( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nIndex ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaRow(); + + // Attributes + virtual css::uno::Any SAL_CALL getHeight() throw (css::uno::RuntimeException); + virtual void SAL_CALL setHeight( const css::uno::Any& _height ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getHeightRule() throw (css::uno::RuntimeException); + virtual void SAL_CALL setHeightRule( ::sal_Int32 _heightrule ) throw (css::uno::RuntimeException); + + // Methods + virtual void SAL_CALL Select( ) throw (css::uno::RuntimeException); + virtual void SAL_CALL SetHeight( float height, sal_Int32 heightrule ) throw (css::uno::RuntimeException); + + static void SelectRow( const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XTextTable >& xTextTable, sal_Int32 nStartRow, sal_Int32 nEndRow ) throw (css::uno::RuntimeException); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif /* SW_VBA_ROW_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbarows.cxx b/sw/source/ui/vba/vbarows.cxx new file mode 100644 index 0000000000..7b1f939251 --- /dev/null +++ b/sw/source/ui/vba/vbarows.cxx @@ -0,0 +1,368 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbarows.hxx" +#include "vbarow.hxx" +#include <com/sun/star/text/HoriOrientation.hpp> +#include <com/sun/star/table/XCellRange.hpp> +#include <ooo/vba/word/WdRowAlignment.hpp> +#include <ooo/vba/word/WdConstants.hpp> +#include <ooo/vba/word/WdRulerStyle.hpp> +#include "wordvbahelper.hxx" +#include "vbacolumns.hxx" +#include "vbatablehelper.hxx" + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +class RowsEnumWrapper : public EnumerationHelper_BASE +{ + uno::WeakReference< XHelperInterface > mxParent; + uno::Reference< uno::XComponentContext > mxContext; + uno::Reference< text::XTextTable > mxTextTable; + uno::Reference< container::XIndexAccess > mxIndexAccess; + sal_Int32 nIndex; + +public: + RowsEnumWrapper( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< text::XTextTable >& xTextTable ) : mxParent( xParent ), mxContext( xContext ), mxTextTable( xTextTable ), nIndex( 0 ) + { + mxIndexAccess.set( mxTextTable->getRows(), uno::UNO_QUERY ); + } + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { + return ( nIndex < mxIndexAccess->getCount() ); + } + + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if( nIndex < mxIndexAccess->getCount() ) + { + return uno::makeAny( uno::Reference< word::XRow > ( new SwVbaRow( mxParent, mxContext, mxTextTable, nIndex++ ) ) ); + } + throw container::NoSuchElementException(); + } +}; + +SwVbaRows::SwVbaRows( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, const uno::Reference< table::XTableRows >& xTableRows ) throw (uno::RuntimeException) : SwVbaRows_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xTableRows, uno::UNO_QUERY_THROW ) ), mxTextTable( xTextTable ), mxTableRows( xTableRows ) +{ + mnStartRowIndex = 0; + mnEndRowIndex = m_xIndexAccess->getCount() - 1; +} + +SwVbaRows::SwVbaRows( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, const uno::Reference< table::XTableRows >& xTableRows, sal_Int32 nStarIndex, sal_Int32 nEndIndex ) throw (uno::RuntimeException) : SwVbaRows_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xTableRows, uno::UNO_QUERY_THROW ) ), mxTextTable( xTextTable ), mxTableRows( xTableRows ), mnStartRowIndex( nStarIndex ), mnEndRowIndex( nEndIndex ) +{ + if( mnEndRowIndex < mnStartRowIndex ) + throw uno::RuntimeException(); +} + +/** + * get the alignment of the rows: SO format com.sun.star.text.HoriOrientation + * is mapped to WdRowAlignment in Word + * @return the alignment + */ +::sal_Int32 SAL_CALL SwVbaRows::getAlignment() throw (uno::RuntimeException) +{ + sal_Int16 nAlignment = text::HoriOrientation::LEFT; + uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW ); + xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HoriOrient") ) ) >>= nAlignment; + sal_Int32 nRet = 0; + switch( nAlignment ) + { + case text::HoriOrientation::CENTER: + { + nRet = word::WdRowAlignment::wdAlignRowCenter; + break; + } + case text::HoriOrientation::RIGHT: + { + nRet = word::WdRowAlignment::wdAlignRowRight; + break; + } + default: + { + nRet = word::WdRowAlignment::wdAlignRowLeft; + } + } + return nRet; +} + +void SAL_CALL SwVbaRows::setAlignment( ::sal_Int32 _alignment ) throw (uno::RuntimeException) +{ + sal_Int16 nAlignment = text::HoriOrientation::LEFT; + switch( _alignment ) + { + case word::WdRowAlignment::wdAlignRowCenter: + { + nAlignment = text::HoriOrientation::CENTER; + break; + } + case word::WdRowAlignment::wdAlignRowRight: + { + nAlignment = text::HoriOrientation::RIGHT; + break; + } + default: + { + nAlignment = text::HoriOrientation::LEFT; + } + } + uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW ); + xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HoriOrient") ), uno::makeAny( nAlignment ) ); +} + +uno::Any SAL_CALL SwVbaRows::getAllowBreakAcrossPages() throw (uno::RuntimeException) +{ + sal_Bool bAllowBreak = sal_False; + uno::Reference< container::XIndexAccess > xRowsAccess( mxTableRows, uno::UNO_QUERY_THROW ); + for( sal_Int32 index = mnStartRowIndex; index <= mnEndRowIndex; ++index ) + { + uno::Reference< beans::XPropertySet > xRowProps( xRowsAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); + sal_Bool bSplit = sal_False; + xRowProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsSplitAllowed") ) ) >>= bSplit; + if( index == 0 ) + { + bAllowBreak = bSplit; + } + if( bSplit != bAllowBreak ) + { + sal_Int32 nRet = word::WdConstants::wdUndefined; + return uno::makeAny( nRet ); + } + } + return uno::makeAny( bAllowBreak ); +} + +void SAL_CALL SwVbaRows::setAllowBreakAcrossPages( const uno::Any& _allowbreakacrosspages ) throw (uno::RuntimeException) +{ + sal_Bool bAllowBreak = sal_False; + _allowbreakacrosspages >>= bAllowBreak; + uno::Reference< container::XIndexAccess > xRowsAccess( mxTableRows, uno::UNO_QUERY_THROW ); + for( sal_Int32 index = mnStartRowIndex; index <= mnEndRowIndex; ++index ) + { + uno::Reference< beans::XPropertySet > xRowProps( xRowsAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); + xRowProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsSplitAllowed") ), uno::makeAny( bAllowBreak ) ); + } +} + +float SAL_CALL SwVbaRows::getSpaceBetweenColumns() throw (uno::RuntimeException) +{ + // just get the first spacing of the first cell + uno::Reference< table::XCellRange > xCellRange( mxTextTable, uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xCellProps( xCellRange->getCellByPosition( 0, mnStartRowIndex ), uno::UNO_QUERY_THROW ); + sal_Int32 nLeftBorderDistance = 0; + sal_Int32 nRightBorderDistance = 0; + xCellProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftBorderDistance") ) ) >>= nLeftBorderDistance; + xCellProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightBorderDistance") ) ) >>= nRightBorderDistance; + return static_cast< float >( Millimeter::getInPoints( nLeftBorderDistance + nRightBorderDistance ) ); +} + +void SAL_CALL SwVbaRows::setSpaceBetweenColumns( float _spacebetweencolumns ) throw (uno::RuntimeException) +{ + sal_Int32 nSpace = Millimeter::getInHundredthsOfOneMillimeter( _spacebetweencolumns ) / 2; + uno::Reference< container::XIndexAccess > xColumnAccess( mxTextTable->getColumns(), uno::UNO_QUERY_THROW ); + uno::Reference< table::XCellRange > xCellRange( mxTextTable, uno::UNO_QUERY_THROW ); + SwVbaTableHelper aTableHelper( mxTextTable ); + for( sal_Int32 row = mnStartRowIndex; row <= mnEndRowIndex; ++row ) + { + sal_Int32 nColumns = aTableHelper.getTabColumnsCount( row ); + for( sal_Int32 column = 0; column < nColumns; ++column ) + { + uno::Reference< beans::XPropertySet > xCellProps( xCellRange->getCellByPosition( column, row ), uno::UNO_QUERY_THROW ); + xCellProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftBorderDistance") ), uno::makeAny( nSpace ) ); + xCellProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightBorderDistance") ), uno::makeAny( nSpace ) ); + } + } +} + +void SAL_CALL SwVbaRows::Delete( ) throw (uno::RuntimeException) +{ + mxTableRows->removeByIndex( mnStartRowIndex, getCount() ); +} + +void SAL_CALL SwVbaRows::SetLeftIndent( float LeftIndent, ::sal_Int32 RulerStyle ) throw (uno::RuntimeException) +{ + uno::Reference< word::XColumns > xColumns( new SwVbaColumns( getParent(), mxContext, mxTextTable, mxTextTable->getColumns() ) ); + sal_Int32 nIndent = (sal_Int32)( LeftIndent ); + switch( RulerStyle ) + { + case word::WdRulerStyle::wdAdjustFirstColumn: + { + setIndentWithAdjustFirstColumn( xColumns, nIndent ); + break; + } + case word::WdRulerStyle::wdAdjustNone: + { + setIndentWithAdjustNone( nIndent ); + break; + } + case word::WdRulerStyle::wdAdjustProportional: + { + setIndentWithAdjustProportional( xColumns, nIndent ); + break; + } + case word::WdRulerStyle::wdAdjustSameWidth: + { + setIndentWithAdjustSameWidth( xColumns, nIndent ); + break; + } + default: + { + DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString()); + } + } +} + +void SwVbaRows::setIndentWithAdjustNone( sal_Int32 indent ) throw (uno::RuntimeException) +{ + uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW ); + sal_Int32 nMargin = 0; + xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin") ) ) >>= nMargin; + nMargin += indent; + xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin") ), uno::makeAny( nMargin ) ); +} + + void SwVbaRows::setIndentWithAdjustFirstColumn( const uno::Reference< word::XColumns >& xColumns, sal_Int32 indent ) throw (uno::RuntimeException) + { + sal_Int32 nIndex = 1; + uno::Reference< XCollection > xCol( xColumns, uno::UNO_QUERY_THROW ); + uno::Reference< word::XColumn > xColumn( xCol->Item( uno::makeAny( nIndex ), uno::Any() ), uno::UNO_QUERY_THROW ); + sal_Int32 nWidth = xColumn->getWidth(); + nWidth -= indent; + xColumn->setWidth( nWidth ); + setIndentWithAdjustNone( indent ); + } + + void SwVbaRows::setIndentWithAdjustProportional( const uno::Reference< word::XColumns >& xColumns, sal_Int32 indent ) throw (uno::RuntimeException) + { + // calculate the new width and get the proportion between old and new + uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW ); + sal_Int32 nWidth = 0; + xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ) ) >>= nWidth; + sal_Int32 nNewWidth = nWidth - indent; + double propFactor = (double)nNewWidth/(double)nWidth; + + // get all columns, calculate and set the new width of the columns + uno::Reference< XCollection > xCol( xColumns, uno::UNO_QUERY_THROW ); + sal_Int32 nColCount = xCol->getCount(); + for( sal_Int32 i = 0; i < nColCount; i++ ) + { + uno::Reference< word::XColumn > xColumn( xCol->Item( uno::makeAny( i ), uno::Any() ), uno::UNO_QUERY_THROW ); + sal_Int32 nColWidth = xColumn->getWidth(); + sal_Int32 nNewColWidth = ( sal_Int32 )( propFactor * nColWidth ); + xColumn->setWidth( nNewColWidth ); + } + + // set the width and position of the table + setIndentWithAdjustNone( indent ); + xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ), uno::makeAny( nNewWidth ) ); + } + + void SwVbaRows::setIndentWithAdjustSameWidth( const uno::Reference< word::XColumns >& xColumns, sal_Int32 indent ) throw (uno::RuntimeException) + { + // calculate the new width and get the width of all columns + uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW ); + sal_Int32 nWidth = 0; + xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ) ) >>= nWidth; + sal_Int32 nNewWidth = nWidth - indent; + + // get all columns, calculate and set the new width of the columns + uno::Reference< XCollection > xCol( xColumns, uno::UNO_QUERY_THROW ); + sal_Int32 nColCount = xCol->getCount(); + sal_Int32 nNewColWidth = (sal_Int32)( double( nNewWidth )/nColCount ); + for( sal_Int32 i = 0; i < nColCount; i++ ) + { + uno::Reference< word::XColumn > xColumn( xCol->Item( uno::makeAny( i ), uno::Any() ), uno::UNO_QUERY_THROW ); + xColumn->setWidth( nNewColWidth ); + } + + // set the width and position of the table + setIndentWithAdjustNone( indent ); + xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ), uno::makeAny( nNewWidth ) ); + } + +void SAL_CALL SwVbaRows::Select( ) throw (uno::RuntimeException) +{ + SwVbaRow::SelectRow( getCurrentWordDoc(mxContext), mxTextTable, mnStartRowIndex, mnEndRowIndex ); +} + +::sal_Int32 SAL_CALL SwVbaRows::getCount() throw (uno::RuntimeException) +{ + return ( mnEndRowIndex - mnStartRowIndex + 1 ); +} + +uno::Any SAL_CALL SwVbaRows::Item( const uno::Any& Index1, const uno::Any& /*not processed in this base class*/ ) throw (uno::RuntimeException) +{ + sal_Int32 nIndex = 0; + if( ( Index1 >>= nIndex ) == sal_True ) + { + if( nIndex <= 0 || nIndex > getCount() ) + { + throw lang::IndexOutOfBoundsException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() ); + } + return uno::makeAny( uno::Reference< word::XRow >( new SwVbaRow( this, mxContext, mxTextTable, nIndex - 1 ) ) ); + } + throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() ); +} + +// XEnumerationAccess +uno::Type +SwVbaRows::getElementType() throw (uno::RuntimeException) +{ + return word::XRow::static_type(0); +} +uno::Reference< container::XEnumeration > +SwVbaRows::createEnumeration() throw (uno::RuntimeException) +{ + return new RowsEnumWrapper( this, mxContext, mxTextTable ); +} + +uno::Any +SwVbaRows::createCollectionObject( const uno::Any& aSource ) +{ + return aSource; +} + +rtl::OUString& +SwVbaRows::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaRows") ); + return sImplName; +} + +uno::Sequence<rtl::OUString> +SwVbaRows::getServiceNames() +{ + static uno::Sequence< rtl::OUString > sNames; + if ( sNames.getLength() == 0 ) + { + sNames.realloc( 1 ); + sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Rows") ); + } + return sNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbarows.hxx b/sw/source/ui/vba/vbarows.hxx new file mode 100644 index 0000000000..eb310dc0e1 --- /dev/null +++ b/sw/source/ui/vba/vbarows.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_ROWS_HXX +#define SW_VBA_ROWS_HXX + +#include <vbahelper/vbacollectionimpl.hxx> +#include <ooo/vba/word/XRows.hpp> +#include <ooo/vba/word/XColumns.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <com/sun/star/table/XTableRows.hpp> +#include <com/sun/star/text/XTextTable.hpp> + +typedef CollTestImplHelper< ooo::vba::word::XRows > SwVbaRows_BASE; + +class SwVbaRows : public SwVbaRows_BASE +{ +private: + css::uno::Reference< css::text::XTextTable > mxTextTable; + css::uno::Reference< css::table::XTableRows > mxTableRows; + sal_Int32 mnStartRowIndex; + sal_Int32 mnEndRowIndex; + +private: + void setIndentWithAdjustNone( sal_Int32 indent ) throw (css::uno::RuntimeException); + void setIndentWithAdjustFirstColumn( const css::uno::Reference< ooo::vba::word::XColumns >& xColumns, sal_Int32 indent ) throw (css::uno::RuntimeException); + void setIndentWithAdjustProportional( const css::uno::Reference< ooo::vba::word::XColumns >& xColumns, sal_Int32 indent ) throw (css::uno::RuntimeException); + void setIndentWithAdjustSameWidth( const css::uno::Reference< ooo::vba::word::XColumns >& xColumns, sal_Int32 indent ) throw (css::uno::RuntimeException); + +public: + SwVbaRows( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, const css::uno::Reference< css::table::XTableRows >& xTableRows ) throw ( css::uno::RuntimeException ); + SwVbaRows( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextTable >& xTextTable, const css::uno::Reference< css::table::XTableRows >& xTableRows, sal_Int32 nStarIndex, sal_Int32 nEndIndex ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaRows() {} + + // Attributes + virtual ::sal_Int32 SAL_CALL getAlignment() throw (css::uno::RuntimeException); + virtual void SAL_CALL setAlignment( ::sal_Int32 _alignment ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getAllowBreakAcrossPages() throw (css::uno::RuntimeException); + virtual void SAL_CALL setAllowBreakAcrossPages( const css::uno::Any& _allowbreakacrosspages ) throw (css::uno::RuntimeException); + virtual float SAL_CALL getSpaceBetweenColumns() throw (css::uno::RuntimeException); + virtual void SAL_CALL setSpaceBetweenColumns( float _spacebetweencolumns ) throw (css::uno::RuntimeException); + + // Methods + virtual void SAL_CALL Delete( ) throw (css::uno::RuntimeException); + virtual void SAL_CALL SetLeftIndent( float LeftIndent, ::sal_Int32 RulerStyle ) throw (css::uno::RuntimeException); + virtual void SAL_CALL Select( ) throw (css::uno::RuntimeException); + + //XCollection + virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/ ) throw ( css::uno::RuntimeException ); + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + + // SwVbaRows_BASE + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif /* SW_VBA_ROWS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbasection.cxx b/sw/source/ui/vba/vbasection.cxx index 4df6f0b5b3..70d9c8df78 100644 --- a/sw/source/ui/vba/vbasection.cxx +++ b/sw/source/ui/vba/vbasection.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,6 +29,7 @@ #include <vbahelper/vbahelper.hxx> #include <tools/diagnose_ex.h> #include "vbapagesetup.hxx" +#include "vbaheadersfooters.hxx" using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -50,14 +52,20 @@ void SAL_CALL SwVbaSection::setProtectedForForms( ::sal_Bool /*_protectedforform { } -uno::Any SAL_CALL SwVbaSection::Headers( ) throw (uno::RuntimeException) +uno::Any SAL_CALL SwVbaSection::Headers( const uno::Any& index ) throw (uno::RuntimeException) { - return uno::Any(); + uno::Reference< XCollection > xCol( new SwVbaHeadersFooters( this, mxContext, mxModel, mxPageProps, sal_True ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); } -uno::Any SAL_CALL SwVbaSection::Footers( ) throw (uno::RuntimeException) +uno::Any SAL_CALL SwVbaSection::Footers( const uno::Any& index ) throw (uno::RuntimeException) { - return uno::Any(); + uno::Reference< XCollection > xCol( new SwVbaHeadersFooters( this, mxContext, mxModel, mxPageProps, sal_False ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); } uno::Any SAL_CALL @@ -85,3 +93,4 @@ SwVbaSection::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbasection.hxx b/sw/source/ui/vba/vbasection.hxx index 9dd4058699..89819155c8 100644 --- a/sw/source/ui/vba/vbasection.hxx +++ b/sw/source/ui/vba/vbasection.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,8 +49,8 @@ public: virtual void SAL_CALL setProtectedForForms( ::sal_Bool _protectedforforms ) throw (css::uno::RuntimeException); // Methods - virtual css::uno::Any SAL_CALL Headers( ) throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL Footers( ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Headers( const css::uno::Any& index ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Footers( const css::uno::Any& index ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL PageSetup( ) throw (css::uno::RuntimeException); // XHelperInterface @@ -57,3 +58,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_SECTION_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbasections.cxx b/sw/source/ui/vba/vbasections.cxx index 6a4ae0e45e..60a2edd1d5 100644 --- a/sw/source/ui/vba/vbasections.cxx +++ b/sw/source/ui/vba/vbasections.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -87,6 +88,15 @@ public: } } + SectionCollectionHelper( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange ) throw (uno::RuntimeException) : mxParent( xParent ), mxContext( xContext ), mxModel( xModel ) + { + // Hacky implementation of Range.Sections, only support 1 secction + uno::Reference< beans::XPropertySet > xRangeProps( xTextRange, uno::UNO_QUERY_THROW ); + uno::Reference< style::XStyle > xStyle = word::getCurrentPageStyle( mxModel, xRangeProps ); + uno::Reference< beans::XPropertySet > xPageProps( xStyle, uno::UNO_QUERY_THROW ); + mxSections.push_back( xPageProps ); + } + ~SectionCollectionHelper(){} // XIndexAccess @@ -134,6 +144,10 @@ SwVbaSections::SwVbaSections( const uno::Reference< XHelperInterface >& xParent, { } +SwVbaSections::SwVbaSections( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange ): SwVbaSections_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new SectionCollectionHelper( xParent, xContext, xModel, xTextRange ) ) ), mxModel( xModel ) +{ +} + uno::Any SAL_CALL SwVbaSections::PageSetup( ) throw (uno::RuntimeException) { @@ -184,3 +198,5 @@ SwVbaSections::getServiceNames() } return sNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbasections.hxx b/sw/source/ui/vba/vbasections.hxx index 9cb35cf74e..051b2dc912 100644 --- a/sw/source/ui/vba/vbasections.hxx +++ b/sw/source/ui/vba/vbasections.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,6 +32,7 @@ #include <ooo/vba/word/XSections.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> #include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/text/XTextRange.hpp> #include <vbahelper/vbahelperinterface.hxx> typedef CollTestImplHelper< ooo::vba::word::XSections > SwVbaSections_BASE; @@ -42,6 +44,7 @@ private: public: SwVbaSections( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel ); + SwVbaSections( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XTextRange >& xTextRange ); virtual ~SwVbaSections() {} // XEnumerationAccess @@ -57,3 +60,5 @@ public: }; #endif /* SW_VBA_SECTIONS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaselection.cxx b/sw/source/ui/vba/vbaselection.cxx index 234e46412a..3b115ad4c7 100644 --- a/sw/source/ui/vba/vbaselection.cxx +++ b/sw/source/ui/vba/vbaselection.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -29,7 +30,6 @@ #include <tools/diagnose_ex.h> #include "vbarange.hxx" #include "vbafind.hxx" -#include "wordvbahelper.hxx" #include <com/sun/star/text/XTextRange.hpp> #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/text/XTextTableCursor.hpp> @@ -41,14 +41,19 @@ #include <ooo/vba/word/WdGoToDirection.hpp> #include <ooo/vba/word/XBookmark.hpp> #include <ooo/vba/word/XApplication.hpp> +#include <ooo/vba/word/WdCollapseDirection.hpp> #include <com/sun/star/text/XPageCursor.hpp> #include "unotbl.hxx" #include "unocoll.hxx" #include "vbatable.hxx" #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/view/XViewCursor.hpp> +#include <com/sun/star/view/XLineCursor.hpp> +#include <com/sun/star/text/XWordCursor.hpp> +#include <com/sun/star/text/XParagraphCursor.hpp> #include <ooo/vba/word/WdInformation.hpp> #include <ooo/vba/word/WdHeaderFooterIndex.hpp> +#include <ooo/vba/word/WdSeekView.hpp> #include "vbainformationhelper.hxx" #include "vbafield.hxx" #include "vbaheaderfooter.hxx" @@ -56,6 +61,16 @@ #include <vbahelper/vbashaperange.hxx> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/drawing/XDrawPage.hpp> +#include "vbarows.hxx" +#include "vbacolumns.hxx" +#include "vbatablehelper.hxx" +#include "vbacells.hxx" +#include "vbaview.hxx" +#include "vbaparagraph.hxx" +#include "vbastyle.hxx" +#include <docsh.hxx> +#include <tblenum.hxx> +#include <fesh.hxx> using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -73,7 +88,7 @@ uno::Reference< text::XTextRange > SwVbaSelection::GetSelectedRange() throw ( un { uno::Reference< text::XTextRange > xTextRange; uno::Reference< lang::XServiceInfo > xServiceInfo( mxModel->getCurrentSelection(), uno::UNO_QUERY_THROW ); - if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextRanges") ) ) ) + if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextRanges") ) ) ) { uno::Reference< container::XIndexAccess > xTextRanges( xServiceInfo, uno::UNO_QUERY_THROW ); if( xTextRanges->getCount() > 0 ) @@ -89,7 +104,7 @@ uno::Reference< text::XTextRange > SwVbaSelection::GetSelectedRange() throw ( un return xTextRange; } -uno::Reference< word::XRange > SAL_CALL +uno::Reference< word::XRange > SAL_CALL SwVbaSelection::getRange() throw ( uno::RuntimeException ) { uno::Reference< text::XTextRange > xTextRange = GetSelectedRange(); @@ -123,23 +138,25 @@ SwVbaSelection::HomeKey( const uno::Any& _unit, const uno::Any& _extend ) throw sal_Int32 nExtend = word::WdMovementType::wdMove; _unit >>= nUnit; _extend >>= nExtend; + sal_Bool bExtend = ( nExtend == word::WdMovementType::wdExtend ) ? sal_True : sal_False; switch( nUnit ) { case word::WdUnits::wdStory: { + // go to the valid text first so that the current view cursor is valid to call gotoRange. + word::gotoSelectedObjectAnchor(mxModel); // go to the begin of the document - rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:GoToStartOfDoc")); - dispatchRequests( mxModel,url ); - // If something is selected, it needs to go twice - dispatchRequests( mxModel,url ); + uno::Reference< text::XText > xCurrentText = word::getCurrentXText( mxModel ); + uno::Reference< text::XTextRange > xFirstRange = word::getFirstObjectPosition( xCurrentText ); + mxTextViewCursor->gotoRange( xFirstRange, bExtend ); break; } case word::WdUnits::wdLine: { // go to the begin of the Line - rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:GoToStartOfLine")); - dispatchRequests( mxModel,url ); + uno::Reference< view::XLineCursor > xLineCursor( mxTextViewCursor, uno::UNO_QUERY_THROW ); + xLineCursor->gotoStartOfLine( bExtend ); break; } default: @@ -157,23 +174,25 @@ SwVbaSelection::EndKey( const uno::Any& _unit, const uno::Any& _extend ) throw ( sal_Int32 nExtend = word::WdMovementType::wdMove; _unit >>= nUnit; _extend >>= nExtend; + sal_Bool bExtend = ( nExtend == word::WdMovementType::wdExtend ) ? sal_True : sal_False; switch( nUnit ) { case word::WdUnits::wdStory: { + // go to the valid text first so that the current view cursor is valid to call gotoRange. + word::gotoSelectedObjectAnchor(mxModel); // go to the end of the document - rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:GoToEndOfDoc")); - dispatchRequests( mxModel,url ); - // If something is selected, it needs to go twice - dispatchRequests( mxModel,url ); + uno::Reference< text::XText > xCurrentText = word::getCurrentXText( mxModel ); + uno::Reference< text::XTextRange > xEnd = xCurrentText->getEnd(); + mxTextViewCursor->gotoRange( xEnd, bExtend ); break; } case word::WdUnits::wdLine: { // go to the end of the Line - rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:GoToEndOfLine")); - dispatchRequests( mxModel,url ); + uno::Reference< view::XLineCursor > xLineCursor( mxTextViewCursor, uno::UNO_QUERY_THROW ); + xLineCursor->gotoEndOfLine( bExtend ); break; } default: @@ -185,14 +204,161 @@ SwVbaSelection::EndKey( const uno::Any& _unit, const uno::Any& _extend ) throw ( } void SAL_CALL -SwVbaSelection::Delete( const uno::Any& /*_unit*/, const uno::Any& /*_count*/ ) throw ( uno::RuntimeException ) +SwVbaSelection::Delete( const uno::Any& _unit, const uno::Any& _count ) throw ( uno::RuntimeException ) { - // FIXME: handle the arguments: _unit and _count + sal_Int32 nUnit = word::WdUnits::wdLine; + sal_Int32 nCount = 0; + if( _count.hasValue() ) + _count >>= nCount; + if( _unit.hasValue() && ( nCount > 0 ) ) + { + _unit >>= nUnit; + switch( nUnit ) + { + case word::WdUnits::wdCharacter: + { + if( HasSelection() ) + nCount--; + mxTextViewCursor->goRight( nCount, sal_True ); + break; + } + default: + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + } + } + } rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Delete")); dispatchRequests( mxModel,url ); } -void SwVbaSelection::NextCell( sal_Int32 nCount, E_DIRECTION eDirection ) throw ( uno::RuntimeException ) +void +SwVbaSelection::Move( const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend, word::E_DIRECTION eDirection ) throw ( uno::RuntimeException ) +{ + sal_Int32 nUnit = word::WdUnits::wdCharacter; + sal_Int32 nCount = 1; + sal_Int32 nExtend = word::WdMovementType::wdMove; + + if( _unit.hasValue() ) + _unit >>= nUnit; + if( _count.hasValue() ) + _count >>= nCount; + if( _extend.hasValue() ) + _extend >>= nExtend; + + if( nCount == 0 ) + return; + + sal_Bool bExpand = ( nExtend == word::WdMovementType::wdMove ) ? sal_False : sal_True; + + switch( nUnit ) + { + case word::WdUnits::wdCell: + { + if( nExtend == word::WdMovementType::wdExtend ) + { + DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString()); + return; + } + NextCell( nCount, eDirection ); + break; + } + case word::WdUnits::wdLine: + { + if( eDirection == word::MOVE_LEFT || eDirection == word::MOVE_RIGHT ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + } + uno::Reference< view::XViewCursor > xViewCursor( mxTextViewCursor, uno::UNO_QUERY_THROW ); + if( eDirection == word::MOVE_UP ) + xViewCursor->goUp( nCount, bExpand ); + else if( eDirection == word::MOVE_DOWN ) + xViewCursor->goDown( nCount, bExpand ); + break; + } + case word::WdUnits::wdCharacter: + { + if( eDirection == word::MOVE_UP || eDirection == word::MOVE_DOWN ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + } + if( word::gotoSelectedObjectAnchor( mxModel ) ) + { + nCount--; + } + uno::Reference< view::XViewCursor > xViewCursor( mxTextViewCursor, uno::UNO_QUERY_THROW ); + if( eDirection == word::MOVE_LEFT ) + { + // if current select is a cellrange or table, + // the first count of move should move to the first selected cell. + uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY ); + if ( xTextTableCursor.is() ) + { + uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextTable > xTextTable; + xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TextTable") ) ) >>= xTextTable; + if( xTextTable.is() ) + { + uno::Reference< text::XTextRange > xRange( xTextTable->getCellByName( xTextTableCursor->getRangeName()), uno::UNO_QUERY_THROW ); + mxTextViewCursor->gotoRange( xRange->getStart(), bExpand ); + nCount--; + } + } + xViewCursor->goLeft( nCount, bExpand ); + } + else if( eDirection == word::MOVE_RIGHT ) + xViewCursor->goRight( nCount, bExpand ); + break; + } + case word::WdUnits::wdWord: + case word::WdUnits::wdParagraph: + { + uno::Reference< text::XTextRange > xRange = GetSelectedRange(); + uno::Reference< text::XText > xText = xRange->getText(); + uno::Reference< text::XTextCursor > xTextCursor = xText->createTextCursorByRange( xRange ); + if( nUnit == word::WdUnits::wdParagraph ) + { + if( eDirection == word::MOVE_LEFT || eDirection == word::MOVE_RIGHT ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + } + uno::Reference< text::XParagraphCursor > xParagraphCursor( xTextCursor, uno::UNO_QUERY_THROW ); + for( sal_Int32 i=0; i<nCount; i++ ) + { + if( ( eDirection == word::MOVE_UP ) && ( xParagraphCursor->gotoPreviousParagraph( bExpand ) == sal_False ) ) + break; + else if( ( eDirection == word::MOVE_DOWN ) && ( xParagraphCursor->gotoNextParagraph( bExpand ) == sal_False ) ) + break; + } + } + else if( nUnit == word::WdUnits::wdWord ) + { + if( eDirection == word::MOVE_UP || eDirection == word::MOVE_DOWN ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + } + uno::Reference< text::XWordCursor > xWordCursor( xTextCursor, uno::UNO_QUERY_THROW ); + for( sal_Int32 i=0; i<nCount; i++ ) + { + if( (eDirection == word::MOVE_LEFT ) && ( xWordCursor->gotoPreviousWord( bExpand ) == sal_False ) ) + break; + else if( ( eDirection == word::MOVE_RIGHT ) && ( xWordCursor->gotoNextWord( bExpand ) == sal_False ) ) + break; + } + } + mxTextViewCursor->gotoRange( xTextCursor->getStart(), sal_False ); + mxTextViewCursor->gotoRange( xTextCursor->getEnd(), sal_True ); + break; + } + default: + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + break; + } + } +} + +void SwVbaSelection::NextCell( sal_Int32 nCount, word::E_DIRECTION eDirection ) throw ( uno::RuntimeException ) { uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW ); uno::Reference< text::XTextTable > xTextTable; @@ -208,25 +374,25 @@ void SwVbaSelection::NextCell( sal_Int32 nCount, E_DIRECTION eDirection ) throw rtl::OUString aCellName; xCellProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CellName") ) ) >>= aCellName; uno::Reference< text::XTextTableCursor > xTextTableCursor = xTextTable->createCursorByCellName( aCellName ); - // move the table cursor + // move the table cursor switch( eDirection ) { - case MOVE_LEFT: + case word::MOVE_LEFT: { xTextTableCursor->goLeft( nCount, sal_False ); break; } - case MOVE_RIGHT: + case word::MOVE_RIGHT: { xTextTableCursor->goRight( nCount, sal_False ); break; } - case MOVE_UP: + case word::MOVE_UP: { xTextTableCursor->goUp( nCount, sal_False ); break; } - case MOVE_DOWN: + case word::MOVE_DOWN: { xTextTableCursor->goDown( nCount, sal_False ); break; @@ -245,138 +411,86 @@ void SwVbaSelection::NextCell( sal_Int32 nCount, E_DIRECTION eDirection ) throw void SAL_CALL SwVbaSelection::MoveRight( const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend ) throw ( uno::RuntimeException ) { - sal_Int32 nUnit = word::WdUnits::wdCharacter; sal_Int32 nCount = 1; - sal_Int32 nExtend = word::WdMovementType::wdMove; - if( _unit.hasValue() ) - _unit >>= nUnit; if( _count.hasValue() ) _count >>= nCount; - if( _extend.hasValue() ) - _extend >>= nExtend; - + if( nCount == 0 ) return; - + if( nCount < 0 ) { - // TODO: call MoveLeft; MoveLeft( _unit, uno::makeAny( -nCount ), _extend ); return; } - - switch( nUnit ) - { - case word::WdUnits::wdCell: - { - if( nExtend == word::WdMovementType::wdExtend ) - { - DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString()); - return; - } - NextCell( nCount, MOVE_RIGHT ); - break; - } - default: - { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); - break; - } - } + Move( _unit, _count, _extend, word::MOVE_RIGHT ); } void SAL_CALL SwVbaSelection::MoveLeft( const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend ) throw ( uno::RuntimeException ) { - sal_Int32 nUnit = word::WdUnits::wdCharacter; sal_Int32 nCount = 1; - sal_Int32 nExtend = word::WdMovementType::wdMove; - - if( _unit.hasValue() ) - _unit >>= nUnit; if( _count.hasValue() ) _count >>= nCount; - if( _extend.hasValue() ) - _extend >>= nExtend; - + if( nCount == 0 ) return; - + if( nCount < 0 ) { MoveRight( _unit, uno::makeAny( -nCount ), _extend ); return; } - - switch( nUnit ) - { - case word::WdUnits::wdCell: - { - if( nExtend == word::WdMovementType::wdExtend ) - { - DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString()); - return; - } - NextCell( nCount, MOVE_LEFT ); - break; - } - default: - { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); - break; - } - } + Move( _unit, _count, _extend, word::MOVE_LEFT ); } void SAL_CALL SwVbaSelection::MoveDown( const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend ) throw ( uno::RuntimeException ) { - sal_Int32 nUnit = word::WdUnits::wdCharacter; sal_Int32 nCount = 1; - sal_Int32 nExtend = word::WdMovementType::wdMove; - if( _unit.hasValue() ) - _unit >>= nUnit; if( _count.hasValue() ) _count >>= nCount; - if( _extend.hasValue() ) - _extend >>= nExtend; - + if( nCount == 0 ) return; - + if( nCount < 0 ) { - // TODO: call MoveLeft; - //MoveUp( _unit, uno::makeAny( -nCount ), _extend ); + MoveUp( _unit, uno::makeAny( -nCount ), _extend ); return; } - - switch( nUnit ) + + Move( _unit, _count, _extend, word::MOVE_DOWN ); +} + +void SAL_CALL +SwVbaSelection::MoveUp( const uno::Any& _unit, const uno::Any& _count, const uno::Any& _extend ) throw ( uno::RuntimeException ) +{ + sal_Int32 nCount = 1; + + if( _count.hasValue() ) + _count >>= nCount; + + if( nCount == 0 ) + return; + + if( nCount < 0 ) { - case word::WdUnits::wdLine: - { - uno::Reference< view::XViewCursor > xViewCursor( mxTextViewCursor, uno::UNO_QUERY_THROW ); - sal_Bool bExpand = ( nExtend == word::WdMovementType::wdMove ) ? sal_False : sal_True; - xViewCursor->goDown( nCount, bExpand ); - break; - } - default: - { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); - break; - } + MoveDown( _unit, uno::makeAny( -nCount ), _extend ); + return; } + Move( _unit, _count, _extend, word::MOVE_UP ); } void SAL_CALL SwVbaSelection::TypeParagraph() throw ( uno::RuntimeException ) { - // #FIXME: if the selection is an entire paragraph, it's replaced + // #FIXME: if the selection is an entire paragraph, it's replaced // by the new paragraph sal_Bool isCollapsed = mxTextViewCursor->isCollapsed(); InsertParagraph(); @@ -415,23 +529,24 @@ SwVbaSelection::setParagraphFormat( const uno::Reference< word::XParagraphFormat return getRange()->setParagraphFormat( rParagraphFormat ); } -uno::Reference< word::XFind > SAL_CALL +uno::Reference< word::XFind > SAL_CALL SwVbaSelection::getFind() throw ( uno::RuntimeException ) { uno::Reference< text::XTextRange > xTextRange = GetSelectedRange(); return uno::Reference< word::XFind >( new SwVbaFind( this, mxContext, mxModel, xTextRange ) ); } -uno::Reference< word::XStyle > SAL_CALL +uno::Any SAL_CALL SwVbaSelection::getStyle() throw ( uno::RuntimeException ) { return getRange()->getStyle(); } void SAL_CALL -SwVbaSelection::setStyle( const uno::Reference< word::XStyle >& rStyle ) throw ( uno::RuntimeException ) +SwVbaSelection::setStyle( const uno::Any& rStyle ) throw ( uno::RuntimeException ) { - return getRange()->setStyle( rStyle ); + uno::Reference< beans::XPropertySet > xParaProps( mxTextViewCursor, uno::UNO_QUERY_THROW ); + return SwVbaStyle::setStyle( xParaProps, rStyle ); } uno::Reference< word::XFont > SAL_CALL @@ -460,7 +575,6 @@ uno::Reference< word::XRange > SAL_CALL SwVbaSelection::GoTo( const uno::Any& _w uno::Reference< word::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); uno::Reference< word::XBookmark > xBookmark( xApplication->getActiveDocument()->Bookmarks(_name), uno::UNO_QUERY_THROW ); xBookmark->Select(); - //return uno::Reference< word::XRange >( xBookmark->Range(), uno::UNO_QUERY_THROW ); break; } case word::WdGoToItem::wdGoToPage: @@ -474,39 +588,79 @@ uno::Reference< word::XRange > SAL_CALL SwVbaSelection::GoTo( const uno::Any& _w sal_Int32 nWhich = 0; if( _which.hasValue() ) _which >>= nWhich; - sal_Int32 nPage = 0; - switch( nWhich ) - { - case word::WdGoToDirection::wdGoToLast: - { - nPage = nLastPage; - break; - } - case word::WdGoToDirection::wdGoToNext: - { - nPage = nCurrPage + 1; - break; - } - case word::WdGoToDirection::wdGoToPrevious: - { - nPage = nCurrPage - 1; - break; - } - default: - { - nPage = nCount; - } - } - if( nPage <= 0 ) - nPage = 1; - if( nPage > nLastPage ) - nPage = nLastPage; - xPageCursor->jumpToPage( ( sal_Int16 )( nPage ) ); - break; + sal_Int32 nPage = 0; + switch( nWhich ) + { + case word::WdGoToDirection::wdGoToLast: + { + nPage = nLastPage; + break; + } + case word::WdGoToDirection::wdGoToNext: + { + if( nCount !=0 ) + nPage = nCurrPage + nCount; + else + nPage = nCurrPage + 1; + break; + } + case word::WdGoToDirection::wdGoToPrevious: + { + if( nCount !=0 ) + nPage = nCurrPage - nCount; + else + nPage = nCurrPage - 1; + break; + } + default: + { + nPage = nCount; + } + } + if( _name.hasValue() ) + { + rtl::OUString sName; + _name >>= sName; + sal_Int32 nName = sName.toInt32(); + if( nName !=0 ) + nPage = nName; + } + if( nPage <= 0 ) + nPage = 1; + if( nPage > nLastPage ) + nPage = nLastPage; + xPageCursor->jumpToPage( ( sal_Int16 )( nPage ) ); + break; } case word::WdGoToItem::wdGoToSection: { - // TODO: implement Section object + uno::Reference< text::XPageCursor > xPageCursor( mxTextViewCursor, uno::UNO_QUERY_THROW ); + sal_Int32 nCount = 0; + if( _count.hasValue() ) + _count >>= nCount; + sal_Int32 nWhich = 0; + if( _which.hasValue() ) + _which >>= nWhich; + sal_Int32 nPage = 0; + switch( nWhich ) + { + case word::WdGoToDirection::wdGoToAbsolute: + { + // currently only support this type + if( nCount == 1 ) + nPage = 1; + break; + } + default: + { + nPage = 0; + } + } + if( nPage != 0 ) + xPageCursor->jumpToPage( ( sal_Int16 )( nPage ) ); + else + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + break; } default: throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); @@ -527,8 +681,6 @@ void SAL_CALL SwVbaSelection::setLanguageID( ::sal_Int32 _languageid ) throw (un uno::Any SAL_CALL SwVbaSelection::Information( sal_Int32 _type ) throw (uno::RuntimeException) { uno::Any result; - //uno::Reference< view::XSelectionSupplier > xSel( mxModel->getCurrentController(), uno::UNO_QUERY_THROW ); - //uno::Any aSelectedObject = xSel->getSelection(); switch( _type ) { case word::WdInformation::wdActiveEndPageNumber: @@ -546,11 +698,85 @@ uno::Any SAL_CALL SwVbaSelection::Information( sal_Int32 _type ) throw (uno::Run result = uno::makeAny( SwVbaInformationHelper::handleWdVerticalPositionRelativeToPage( mxModel, mxTextViewCursor ) ); break; } + case word::WdInformation::wdWithInTable: + { + uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextTable > xTextTable; + xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TextTable") ) ) >>= xTextTable; + if( xTextTable.is() ) + result = uno::makeAny( sal_True ); + else + result = uno::makeAny( sal_False ); + break; + } + case word::WdInformation::wdHeaderFooterType: + { + uno::Reference< word::XView > xView( new SwVbaView( this, mxContext, mxModel ) ); + sal_Int32 nView = xView->getSeekView(); + sal_Int32 nHeaderFooterType = 0; + switch( nView ) + { + case word::WdSeekView::wdSeekMainDocument: + { + nHeaderFooterType = -1; // not in a header or footer + break; + } + case word::WdSeekView::wdSeekEvenPagesHeader: + { + nHeaderFooterType = 0; // even page header + break; + } + case word::WdSeekView::wdSeekPrimaryHeader: + { + nHeaderFooterType = 1; // odd page header + break; + } + case word::WdSeekView::wdSeekEvenPagesFooter: + { + nHeaderFooterType = 2; // even page footer + break; + } + case word::WdSeekView::wdSeekPrimaryFooter: + { + nHeaderFooterType = 3; // odd page footer + break; + } + case word::WdSeekView::wdSeekFirstPageHeader: + case word::WdSeekView::wdSeekFirstPageFooter: + { + uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW ); + rtl::OUString aPageStyleName; + xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageStyleName"))) >>= aPageStyleName; + sal_Bool bFirstPage = sal_False; + if( aPageStyleName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "First Page" ) ) ) + bFirstPage = sal_True; + if( nView == word::WdSeekView::wdSeekFirstPageHeader ) + { + if( bFirstPage ) + nHeaderFooterType = 4; + else + nHeaderFooterType = 1; + } + else + { + if( bFirstPage ) + nHeaderFooterType = 5; + else + nHeaderFooterType = 3; + } + break; + } + default: + { + nHeaderFooterType = -1; + } + } + result = uno::makeAny( nHeaderFooterType ); + break; + } default: throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); } - // This method fails to restore the previouse selection - //xSel->select( aSelectedObject ); return result; } @@ -565,12 +791,7 @@ SwVbaSelection::Tables( const uno::Any& aIndex ) throw (uno::RuntimeException) // Hacky implementation due to missing api ( and lack of knowledge ) // we can only support a selection that is a single table if ( !aIndex.hasValue() ) // currently we can't support multiple tables in a selection - throw uno::RuntimeException(); - // if the current selection is a XTextTableCursor and the index is 1 then we can service this request, otherwise we just have to throw - uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY ); - - if ( !xTextTableCursor.is() ) - throw uno::RuntimeException(); + throw uno::RuntimeException(); sal_Int32 nIndex = 0; aIndex >>= nIndex; @@ -578,7 +799,25 @@ SwVbaSelection::Tables( const uno::Any& aIndex ) throw (uno::RuntimeException) uno::Any aRet; if ( nIndex != 1 ) - throw uno::RuntimeException(); + throw uno::RuntimeException(); + + uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextTable > xTextTable; + xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TextTable") ) ) >>= xTextTable; + if( xTextTable.is() ) + { + uno::Reference< css::text::XTextDocument > xTextDoc( mxModel, uno::UNO_QUERY_THROW ); + uno::Reference< word::XTable > xVBATbl = new SwVbaTable( mxParent, mxContext, xTextDoc, xTextTable ); + aRet <<= xVBATbl; + return aRet; + } + + // if the current selection is a XTextTableCursor and the index is 1 then we can service this request, otherwise we just have to throw + uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY ); + + if ( !xTextTableCursor.is() ) + throw uno::RuntimeException(); + SwXTextTableCursor* pTTCursor = dynamic_cast< SwXTextTableCursor* >( xTextTableCursor.get() ); if ( pTTCursor ) { @@ -588,12 +827,12 @@ SwVbaSelection::Tables( const uno::Any& aIndex ) throw (uno::RuntimeException) { uno::Reference< text::XTextTable > xTbl = SwXTextTables::GetObject(*pFmt); uno::Reference< css::text::XTextDocument > xTextDoc( mxModel, uno::UNO_QUERY_THROW ); - uno::Reference< word::XTable > xVBATbl = new SwVbaTable( mxParent, mxContext, xTextDoc, xTbl ); + uno::Reference< word::XTable > xVBATbl = new SwVbaTable( mxParent, mxContext, xTextDoc, xTbl ); aRet <<= xVBATbl; } } return aRet; - + } uno::Any SAL_CALL @@ -608,17 +847,16 @@ SwVbaSelection::Fields( const uno::Any& index ) throw (uno::RuntimeException) uno::Reference< word::XHeaderFooter > SAL_CALL SwVbaSelection::getHeaderFooter() throw ( uno::RuntimeException ) { - uno::Reference< text::XText > xCurrentText = word::getXTextViewCursor( mxModel )->getText(); - if( HeaderFooterHelper::isHeader( mxModel, xCurrentText ) || HeaderFooterHelper::isFooter( mxModel, xCurrentText ) ) + if( HeaderFooterHelper::isHeaderFooter( mxModel ) ) { uno::Reference< beans::XPropertySet > xPageStyleProps( word::getCurrentPageStyle( mxModel ), uno::UNO_QUERY_THROW ); sal_Int32 nIndex = word::WdHeaderFooterIndex::wdHeaderFooterPrimary; - sal_Bool isHeader = HeaderFooterHelper::isHeader( mxModel, xCurrentText ); - if( HeaderFooterHelper::isEvenPagesHeader( mxModel, xCurrentText ) || HeaderFooterHelper::isEvenPagesFooter( mxModel, xCurrentText ) ) + sal_Bool isHeader = HeaderFooterHelper::isHeader( mxModel ); + if( HeaderFooterHelper::isEvenPagesHeader( mxModel ) || HeaderFooterHelper::isEvenPagesFooter( mxModel ) ) nIndex = word::WdHeaderFooterIndex::wdHeaderFooterEvenPages; - else if( HeaderFooterHelper::isFirstPageHeader( mxModel, xCurrentText ) || HeaderFooterHelper::isFirstPageFooter( mxModel, xCurrentText ) ) + else if( HeaderFooterHelper::isFirstPageHeader( mxModel ) || HeaderFooterHelper::isFirstPageFooter( mxModel ) ) nIndex = word::WdHeaderFooterIndex::wdHeaderFooterFirstPage; - + return uno::Reference< word::XHeaderFooter >( new SwVbaHeaderFooter( this, mxContext, mxModel, xPageStyleProps, isHeader, nIndex ) ); } @@ -629,9 +867,13 @@ uno::Any SAL_CALL SwVbaSelection::ShapeRange( ) throw (uno::RuntimeException) { uno::Reference< drawing::XShapes > xShapes( mxModel->getCurrentSelection(), uno::UNO_QUERY ); - if ( !xShapes.is() ) - throw uno::RuntimeException(); + { + uno::Reference< drawing::XShape > xShape( mxModel->getCurrentSelection(), uno::UNO_QUERY_THROW ); + uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); + xShapes.set( xMSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ShapeCollection")) ), uno::UNO_QUERY_THROW ); + xShapes->add( xShape ); + } uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( mxModel, uno::UNO_QUERY_THROW ); uno::Reference< drawing::XDrawPage > xDrawPage = xDrawPageSupplier->getDrawPage(); @@ -658,14 +900,289 @@ void SAL_CALL SwVbaSelection::setEnd( ::sal_Int32 _end ) throw (uno::RuntimeExce getRange()->setEnd( _end ); } -rtl::OUString& +void SAL_CALL SwVbaSelection::SelectRow() throw (uno::RuntimeException) +{ + uno::Reference< word::XRows > xRows( Rows( uno::Any() ), uno::UNO_QUERY_THROW ); + xRows->Select(); +} + +void SAL_CALL SwVbaSelection::SelectColumn() throw (uno::RuntimeException) +{ + uno::Reference< word::XColumns > xColumns( Columns( uno::Any() ), uno::UNO_QUERY_THROW ); + xColumns->Select(); +} + +uno::Any SAL_CALL SwVbaSelection::Rows( const uno::Any& index ) throw (uno::RuntimeException) +{ + rtl::OUString sTLName; + rtl::OUString sBRName; + GetSelectedCellRange( sTLName, sBRName ); + + sal_Int32 nStartRow = 0; + sal_Int32 nEndRow = 0; + uno::Reference< text::XTextTable > xTextTable = GetXTextTable(); + SwVbaTableHelper aTableHelper( xTextTable ); + nStartRow = aTableHelper.getTabRowIndex( sTLName ); + if( sBRName.getLength() > 0 ) + { + nEndRow = aTableHelper.getTabRowIndex( sBRName ); + } + else + { + nEndRow = nStartRow; + } + + uno::Reference< XCollection > xCol( new SwVbaRows( this, mxContext, xTextTable, xTextTable->getRows(), nStartRow, nEndRow ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} + +uno::Any SAL_CALL SwVbaSelection::Columns( const uno::Any& index ) throw (uno::RuntimeException) +{ + rtl::OUString sTLName; + rtl::OUString sBRName; + GetSelectedCellRange( sTLName, sBRName ); + sal_Int32 nStartColumn = 0; + sal_Int32 nEndColumn = 0; + + uno::Reference< text::XTextTable > xTextTable = GetXTextTable(); + SwVbaTableHelper aTableHelper( xTextTable ); + nStartColumn = aTableHelper.getTabColIndex( sTLName ); + if( sBRName.getLength() > 0 ) + { + nEndColumn = aTableHelper.getTabColIndex( sBRName ); + } + else + { + nEndColumn = nStartColumn; + } + + uno::Reference< XCollection > xCol( new SwVbaColumns( this, mxContext, xTextTable, xTextTable->getColumns(), nStartColumn, nEndColumn ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} + +uno::Reference< text::XTextTable > SwVbaSelection::GetXTextTable() throw( uno::RuntimeException ) +{ + uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextTable > xTextTable; + xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TextTable") ) ) >>= xTextTable; + return xTextTable; +} + +sal_Bool SwVbaSelection::IsInTable() throw( uno::RuntimeException ) +{ + uno::Reference< text::XTextTable > xTextTable = GetXTextTable(); + if( xTextTable.is() ) + return sal_True; + return sal_False; +} + +sal_Bool SwVbaSelection::HasSelection() throw( uno::RuntimeException ) +{ + uno::Reference< text::XTextRange > xStart = mxTextViewCursor->getStart(); + uno::Reference< text::XTextRange > xEnd = mxTextViewCursor->getEnd(); + uno::Reference< text::XTextRangeCompare > xTRC( mxTextViewCursor->getText(), uno::UNO_QUERY_THROW ); + if( xTRC->compareRegionStarts( xStart, xEnd ) == 0 && xTRC->compareRegionEnds( xStart, xEnd ) == 0 ) + return sal_False; + return sal_True; +} + +void SwVbaSelection::GetSelectedCellRange( rtl::OUString& sTLName, rtl::OUString& sBRName ) throw( uno::RuntimeException ) +{ + uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextTable > xTextTable; + xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TextTable") ) ) >>= xTextTable; + if( !xTextTable.is() ) + throw uno::RuntimeException( ); + + uno::Reference< text::XTextTableCursor > xTextTableCursor( mxModel->getCurrentSelection(), uno::UNO_QUERY ); + if( xTextTableCursor.is() ) + { + String sRange( xTextTableCursor->getRangeName() ); + if( sRange.GetTokenCount(':') > 0 ) + { + sTLName = sRange.GetToken(0, ':'); + sBRName = sRange.GetToken(1, ':'); + } + } + if( !sTLName.getLength() ) + { + uno::Reference< table::XCell > xCell; + xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Cell") ) ) >>= xCell; + if( !xCell.is() ) + { + throw uno::RuntimeException( ); + } + uno::Reference< beans::XPropertySet > xCellProps( xCell, uno::UNO_QUERY_THROW ); + xCellProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CellName") ) ) >>= sTLName; + } +} + +uno::Any SAL_CALL SwVbaSelection::Cells( const uno::Any& index ) throw (uno::RuntimeException) +{ + rtl::OUString sTLName; + rtl::OUString sBRName; + GetSelectedCellRange( sTLName, sBRName ); + sal_Int32 nLeft = 0; + sal_Int32 nTop = 0; + sal_Int32 nRight = 0; + sal_Int32 nBottom = 0; + + uno::Reference< text::XTextTable > xTextTable = GetXTextTable(); + SwVbaTableHelper aTableHelper( xTextTable ); + nLeft = aTableHelper.getTabColIndex( sTLName ); + nTop = aTableHelper.getTabRowIndex( sTLName ); + if( sBRName.getLength() > 0 ) + { + nRight = aTableHelper.getTabColIndex( sBRName ); + nBottom = aTableHelper.getTabRowIndex( sBRName ); + } + else + { + nRight = nLeft; + nBottom = nTop; + } + + uno::Reference< XCollection > xCol( new SwVbaCells( this, mxContext, xTextTable, nLeft, nTop, nRight, nBottom ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} + +void SAL_CALL SwVbaSelection::Copy( ) throw (uno::RuntimeException) +{ + rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Copy")); + dispatchRequests( mxModel,url ); +} + +void SAL_CALL SwVbaSelection::CopyAsPicture( ) throw (uno::RuntimeException) +{ + // seems not support in Writer + Copy(); +} + +void SAL_CALL SwVbaSelection::Paste( ) throw (uno::RuntimeException) +{ + rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Paste")); + dispatchRequests( mxModel,url ); +} + +void SAL_CALL SwVbaSelection::Collapse( const uno::Any& Direction ) throw (uno::RuntimeException) +{ + if( word::gotoSelectedObjectAnchor( mxModel ) ) + return; + + sal_Int32 nDirection = word::WdCollapseDirection::wdCollapseStart; + if( Direction.hasValue() ) + Direction >>= nDirection; + + uno::Reference< text::XTextViewCursor > xTextViewCursor = word::getXTextViewCursor( mxModel ); + if( nDirection == word::WdCollapseDirection::wdCollapseStart ) + { + // it is inaccurate if current seleciton is multipul cells, so it needs to go to start + uno::Reference< text::XTextRange > xTextRange = mxTextViewCursor->getStart(); + xTextViewCursor->gotoRange( xTextRange, sal_False ); + xTextViewCursor->collapseToStart(); + } + else if( nDirection == word::WdCollapseDirection::wdCollapseEnd ) + { + uno::Reference< text::XTextRange > xTextRange = mxTextViewCursor->getEnd(); + xTextViewCursor->gotoRange( xTextRange, sal_False ); + xTextViewCursor->collapseToEnd(); + } + else + { + throw uno::RuntimeException(); + } +} + +void SAL_CALL SwVbaSelection::WholeStory( ) throw (uno::RuntimeException) +{ + uno::Reference< text::XText > xText = word::getCurrentXText( mxModel ); + // FIXME: for i#7747,if the first line is a table, it fails to select all the contents in the story. + // Temporary solution, insert an empty line before the table so that it could select all the contents. + uno::Reference< container::XEnumerationAccess > xParaAccess( xText, uno::UNO_QUERY_THROW ); + uno::Reference< container::XEnumeration> xParaEnum = xParaAccess->createEnumeration(); + if( xParaEnum->hasMoreElements() ) + { + uno::Reference< text::XTextTable > xTextTable( xParaEnum->nextElement(), uno::UNO_QUERY ); + if( xTextTable.is() ) + { + // insert an empty line + uno::Reference< text::XTextRange > xFirstCellRange = word::getFirstObjectPosition( xText ); + mxTextViewCursor->gotoRange( xFirstCellRange, sal_False ); + rtl::OUString url = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertPara")); + dispatchRequests( mxModel,url ); + } + } + uno::Reference< text::XTextRange > xStart = xText->getStart(); + uno::Reference< text::XTextRange > xEnd = xText->getEnd(); + mxTextViewCursor->gotoRange( xStart, sal_False ); + mxTextViewCursor->gotoRange( xEnd, sal_True ); +} + +::sal_Bool SAL_CALL SwVbaSelection::InRange( const uno::Reference< ::ooo::vba::word::XRange >& Range ) throw (uno::RuntimeException) +{ + return getRange()->InRange( Range ); +} + +void SAL_CALL SwVbaSelection::SplitTable( ) throw (uno::RuntimeException) +{ + if( !IsInTable() ) + throw uno::RuntimeException(); + + SwDocShell* pDocShell = word::getDocShell( mxModel ); + if( pDocShell ) + { + SwFEShell* pFEShell = pDocShell->GetFEShell(); + if( pFEShell ) + { + pFEShell->SplitTable( HEADLINE_CNTNTCOPY ); + } + } +} + +uno::Any SAL_CALL +SwVbaSelection::Paragraphs( const uno::Any& aIndex ) throw (uno::RuntimeException) +{ + // Hacky implementation due to missing api ( and lack of knowledge ) + // we can only support a selection that is a single paragraph + if ( !aIndex.hasValue() ) // currently we can't support multiple paragraphs in a selection + throw uno::RuntimeException(); + + sal_Int32 nIndex = 0; + aIndex >>= nIndex; + + uno::Any aRet; + + if ( nIndex != 1 ) + throw uno::RuntimeException(); + + uno::Reference< text::XTextRange > xTextRange = mxTextViewCursor->getStart(); + uno::Reference< text::XText > xText = xTextRange->getText(); + uno::Reference< text::XParagraphCursor > xParaCursor( xText->createTextCursor(), uno::UNO_QUERY_THROW ); + xParaCursor->gotoStartOfParagraph( sal_False ); + xParaCursor->gotoStartOfParagraph( sal_True ); + + uno::Reference< text::XTextDocument > xTextDoc( mxModel, uno::UNO_QUERY_THROW ); + uno::Reference< text::XTextRange > xParaRange( xParaCursor, uno::UNO_QUERY_THROW ); + uno::Reference< word::XParagraph > xParagraph = new SwVbaParagraph( mxParent, mxContext, xTextDoc, xParaRange ); + + aRet <<= xParagraph; + return aRet; +} + +rtl::OUString& SwVbaSelection::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaSelection") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > SwVbaSelection::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -677,3 +1194,4 @@ SwVbaSelection::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaselection.hxx b/sw/source/ui/vba/vbaselection.hxx index afbf79a6c3..edda22be4b 100644 --- a/sw/source/ui/vba/vbaselection.hxx +++ b/sw/source/ui/vba/vbaselection.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,11 +32,13 @@ #include <ooo/vba/word/XRange.hpp> #include <vbahelper/vbahelperinterface.hxx> #include <com/sun/star/text/XTextViewCursor.hpp> +#include <com/sun/star/text/XTextTable.hpp> #include <ooo/vba/word/XParagraphFormat.hpp> #include <ooo/vba/word/XFind.hpp> #include <ooo/vba/word/XStyle.hpp> #include <ooo/vba/word/XFont.hpp> #include <ooo/vba/word/XHeaderFooter.hpp> +#include "wordvbahelper.hxx" typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XSelection > SwVbaSelection_BASE; @@ -46,17 +49,14 @@ private: css::uno::Reference< css::text::XTextViewCursor > mxTextViewCursor; css::uno::Reference< ooo::vba::word::XRange > mxRange; - enum E_DIRECTION - { - MOVE_LEFT = 1, - MOVE_RIGHT, - MOVE_UP, - MOVE_DOWN - }; - private: - void NextCell( sal_Int32 nCount, E_DIRECTION eDirection ) throw ( css::uno::RuntimeException ); + void Move( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend, ooo::vba::word::E_DIRECTION eDirection ) throw (css::uno::RuntimeException); + void NextCell( sal_Int32 nCount, ooo::vba::word::E_DIRECTION eDirection ) throw ( css::uno::RuntimeException ); css::uno::Reference< css::text::XTextRange > GetSelectedRange() throw ( css::uno::RuntimeException ); + void GetSelectedCellRange( rtl::OUString& sTLName, rtl::OUString& sBRName ) throw ( css::uno::RuntimeException ); + css::uno::Reference< css::text::XTextTable > GetXTextTable() throw ( css::uno::RuntimeException ); + sal_Bool IsInTable() throw ( css::uno::RuntimeException ); + sal_Bool HasSelection() throw ( css::uno::RuntimeException ); public: SwVbaSelection( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel ) throw ( css::uno::RuntimeException ); @@ -73,6 +73,7 @@ public: virtual void SAL_CALL MoveRight( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend ) throw (css::uno::RuntimeException); virtual void SAL_CALL MoveLeft( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend ) throw (css::uno::RuntimeException); virtual void SAL_CALL MoveDown( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend ) throw (css::uno::RuntimeException); + virtual void SAL_CALL MoveUp( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend ) throw (css::uno::RuntimeException); virtual void SAL_CALL TypeParagraph() throw (css::uno::RuntimeException); virtual void SAL_CALL InsertParagraph() throw (css::uno::RuntimeException); virtual void SAL_CALL InsertParagraphBefore() throw (css::uno::RuntimeException); @@ -80,8 +81,8 @@ public: virtual css::uno::Reference< ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() throw (css::uno::RuntimeException); virtual void SAL_CALL setParagraphFormat( const css::uno::Reference< ooo::vba::word::XParagraphFormat >& rParagraphFormat ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ooo::vba::word::XFind > SAL_CALL getFind() throw (css::uno::RuntimeException); - virtual css::uno::Reference< ooo::vba::word::XStyle > SAL_CALL getStyle() throw (css::uno::RuntimeException); - virtual void SAL_CALL setStyle( const css::uno::Reference< ooo::vba::word::XStyle >& _xStyle ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getStyle() throw (css::uno::RuntimeException); + virtual void SAL_CALL setStyle( const css::uno::Any& _xStyle ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() throw (css::uno::RuntimeException); virtual void SAL_CALL TypeBackspace() throw (css::uno::RuntimeException); virtual css::uno::Reference< ooo::vba::word::XRange > SAL_CALL GoTo( const css::uno::Any& _what, const css::uno::Any& _which, const css::uno::Any& _count, const css::uno::Any& _name ) throw (css::uno::RuntimeException); @@ -97,9 +98,24 @@ public: virtual void SAL_CALL setStart( ::sal_Int32 _start ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getEnd() throw (css::uno::RuntimeException); virtual void SAL_CALL setEnd( ::sal_Int32 _end ) throw (css::uno::RuntimeException); + virtual void SAL_CALL SelectRow() throw (css::uno::RuntimeException); + virtual void SAL_CALL SelectColumn() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Rows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Columns( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Cells( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual void SAL_CALL Copy( ) throw (css::uno::RuntimeException); + virtual void SAL_CALL CopyAsPicture( ) throw (css::uno::RuntimeException); + virtual void SAL_CALL Paste( ) throw (css::uno::RuntimeException); + virtual void SAL_CALL Collapse( const css::uno::Any& Direction ) throw (css::uno::RuntimeException); + virtual void SAL_CALL WholeStory( ) throw (css::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL InRange( const css::uno::Reference< ::ooo::vba::word::XRange >& Range ) throw (css::uno::RuntimeException); + virtual void SAL_CALL SplitTable( ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Paragraphs( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_SELECTION_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbastyle.cxx b/sw/source/ui/vba/vbastyle.cxx index a8bb6bee9c..5ff6697df1 100644 --- a/sw/source/ui/vba/vbastyle.cxx +++ b/sw/source/ui/vba/vbastyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,15 +29,18 @@ #include "vbastyle.hxx" #include <ooo/vba/word/WdStyleType.hpp> #include <com/sun/star/lang/Locale.hpp> +#include <com/sun/star/text/XTextDocument.hpp> #include <i18npool/mslangid.hxx> #include "vbafont.hxx" #include "vbapalette.hxx" +#include "vbaparagraphformat.hxx" +#include "vbastyles.hxx" using namespace ::ooo::vba; using namespace ::com::sun::star; -SwVbaStyle::SwVbaStyle( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& _xPropertySet ) throw ( script::BasicErrorException, uno::RuntimeException ) : SwVbaStyle_BASE( xParent, xContext ) , mxStyleProps( _xPropertySet ) +SwVbaStyle::SwVbaStyle( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel>& xModel, const uno::Reference< beans::XPropertySet >& _xPropertySet ) throw ( script::BasicErrorException, uno::RuntimeException ) : SwVbaStyle_BASE( xParent, xContext ) , mxModel( xModel ), mxStyleProps( _xPropertySet ) { mxStyle.set( _xPropertySet, uno::UNO_QUERY_THROW ); } @@ -84,7 +88,7 @@ void SAL_CALL SwVbaStyle::setLanguageID( ::sal_Int32 _languageid ) throw (uno::R nType = word::WdStyleType::wdStyleTypeParagraph; else if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.style.CharacterStyle") ) ) ) nType = word::WdStyleType::wdStyleTypeCharacter; - else // if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.NumberingStyle") ) ) ) + else nType = word::WdStyleType::wdStyleTypeList; return nType; } @@ -96,10 +100,31 @@ SwVbaStyle::getFont() throw ( uno::RuntimeException ) return new SwVbaFont( mxParent, mxContext, aColors.getPalette(), mxStyleProps ); } -void SwVbaStyle::setStyle( const uno::Reference< beans::XPropertySet >& xTCProps, const uno::Reference< ooo::vba::word::XStyle >& xStyle )throw (uno::RuntimeException) + +void SAL_CALL SwVbaStyle::LinkToListTemplate( const uno::Reference< word::XListTemplate >& /*ListTemplate*/, const uno::Any& /*ListLevelNumber*/ ) throw (uno::RuntimeException) +{ +} + +void SwVbaStyle::setStyle( const uno::Reference< beans::XPropertySet >& xParaProps, const uno::Any& rStyle )throw (uno::RuntimeException) { - rtl::OUString aStyleType = getOOoStyleTypeFromMSWord( xStyle->getType() ); - xTCProps->setPropertyValue( aStyleType, uno::makeAny( xStyle->getName() ) ); + rtl::OUString sStyle; + uno::Reference< word::XStyle > xStyle; + if( rStyle >>= xStyle ) + { + sStyle = xStyle->getName(); + } + else + { + rStyle >>= sStyle; + } + + if( sStyle.getLength() ) + { + xParaProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaStyleName") ), uno::makeAny( sStyle ) ); + return; + } + + throw uno::RuntimeException(); } rtl::OUString SwVbaStyle::getOOoStyleTypeFromMSWord( sal_Int32 _wdStyleType ) @@ -129,6 +154,115 @@ rtl::OUString SwVbaStyle::getOOoStyleTypeFromMSWord( sal_Int32 _wdStyleType ) return aStyleType; } +::rtl::OUString SAL_CALL SwVbaStyle::getNameLocal() throw (uno::RuntimeException) +{ + rtl::OUString sNameLocal; + mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DisplayName") ) ) >>= sNameLocal; + return sNameLocal; +} + +void SAL_CALL SwVbaStyle::setNameLocal( const ::rtl::OUString& _namelocal ) throw (uno::RuntimeException) +{ + mxStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DisplayName") ), uno::makeAny( _namelocal ) ); +} + +uno::Reference< word::XParagraphFormat > SAL_CALL SwVbaStyle::getParagraphFormat() throw (uno::RuntimeException) +{ + if( word::WdStyleType::wdStyleTypeParagraph == getType() ) + { + uno::Reference< text::XTextDocument > xTextDocument( mxModel, uno::UNO_QUERY_THROW ); + return uno::Reference< word::XParagraphFormat >( new SwVbaParagraphFormat( this, mxContext, xTextDocument, mxStyleProps ) ); + } + else + { + throw uno::RuntimeException(); + } + return uno::Reference< word::XParagraphFormat >(); +} + +::sal_Bool SAL_CALL SwVbaStyle::getAutomaticallyUpdate() throw (uno::RuntimeException) +{ + sal_Bool isAutoUpdate = sal_False; + mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsAutoUpdate") ) ) >>= isAutoUpdate; + return isAutoUpdate; +} + +void SAL_CALL SwVbaStyle::setAutomaticallyUpdate( ::sal_Bool _automaticallyupdate ) throw (uno::RuntimeException) +{ + mxStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsAutoUpdate") ), uno::makeAny( _automaticallyupdate ) ); +} + +uno::Any SAL_CALL SwVbaStyle::getBaseStyle() throw (uno::RuntimeException) +{ + // ParentStyle + rtl::OUString sBaseStyle; + mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParentStyle") ) ) >>= sBaseStyle; + if( sBaseStyle.getLength() > 0 ) + { + uno::Reference< XCollection > xCol( new SwVbaStyles( this, mxContext, mxModel ) ); + return xCol->Item( uno::makeAny( sBaseStyle ), uno::Any() ); + } + else + { + throw uno::RuntimeException(); + } + return uno::Any(); +} + +void SAL_CALL SwVbaStyle::setBaseStyle( const uno::Any& _basestyle ) throw (uno::RuntimeException) +{ + uno::Reference< word::XStyle > xStyle; + _basestyle >>= xStyle; + if( xStyle.is() ) + { + rtl::OUString sBaseStyle = xStyle->getName(); + mxStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParentStyle") ), uno::makeAny( sBaseStyle ) ); + } + else + { + throw uno::RuntimeException(); + } +} + +uno::Any SAL_CALL SwVbaStyle::getNextParagraphStyle() throw (uno::RuntimeException) +{ + //FollowStyle + rtl::OUString sFollowStyle; + mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FollowStyle") ) ) >>= sFollowStyle; + if( sFollowStyle.getLength() > 0 ) + { + uno::Reference< XCollection > xCol( new SwVbaStyles( this, mxContext, mxModel ) ); + return xCol->Item( uno::makeAny( sFollowStyle ), uno::Any() ); + } + else + { + throw uno::RuntimeException(); + } + return uno::Any(); +} + +void SAL_CALL SwVbaStyle::setNextParagraphStyle( const uno::Any& _nextparagraphstyle ) throw (uno::RuntimeException) +{ + uno::Reference< word::XStyle > xStyle; + _nextparagraphstyle >>= xStyle; + if( xStyle.is() ) + { + rtl::OUString sFollowStyle = xStyle->getName(); + mxStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FollowStyle") ), uno::makeAny( sFollowStyle ) ); + } + else + { + throw uno::RuntimeException(); + } +} + +::sal_Int32 SAL_CALL SwVbaStyle::getListLevelNumber() throw (uno::RuntimeException) +{ + sal_Int16 nNumberingLevel = 0; + mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingLevel") ) ) >>= nNumberingLevel; + return nNumberingLevel; +} + rtl::OUString& SwVbaStyle::getServiceImplName() { @@ -147,3 +281,5 @@ SwVbaStyle::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbastyle.hxx b/sw/source/ui/vba/vbastyle.hxx index bfa12e0caa..0af922d174 100644 --- a/sw/source/ui/vba/vbastyle.hxx +++ b/sw/source/ui/vba/vbastyle.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,6 +34,7 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/style/XStyle.hpp> #include <ooo/vba/word/XFont.hpp> +#include <ooo/vba/word/XListTemplate.hpp> typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XStyle > SwVbaStyle_BASE; @@ -40,13 +42,14 @@ typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XStyle > SwVbaStyle_BASE; class SwVbaStyle : public SwVbaStyle_BASE { private: + css::uno::Reference< css::frame::XModel > mxModel; css::uno::Reference< css::beans::XPropertySet > mxStyleProps; css::uno::Reference< css::style::XStyle > mxStyle; public: - SwVbaStyle( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet ) throw ( css::script::BasicErrorException, css::uno::RuntimeException ); + SwVbaStyle( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet ) throw ( css::script::BasicErrorException, css::uno::RuntimeException ); virtual ~SwVbaStyle(){} - static void setStyle( const css::uno::Reference< css::beans::XPropertySet >& xTCProps, const css::uno::Reference< ooo::vba::word::XStyle >& xStyle ) throw (css::uno::RuntimeException); + static void setStyle( const css::uno::Reference< css::beans::XPropertySet >& xParaProps, const css::uno::Any& xStyle ) throw (css::uno::RuntimeException); static rtl::OUString getOOoStyleTypeFromMSWord( sal_Int32 _wdStyleType ); static sal_Int32 getLanguageID( const css::uno::Reference< css::beans::XPropertySet >& xTCProps ) throw (css::uno::RuntimeException); static void setLanguageID( const css::uno::Reference< css::beans::XPropertySet >& xTCProps, sal_Int32 _languageid ) throw (css::uno::RuntimeException); @@ -58,6 +61,20 @@ public: virtual void SAL_CALL setLanguageID( ::sal_Int32 _languageid ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException); virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() throw (css::uno::RuntimeException); + virtual void SAL_CALL LinkToListTemplate( const css::uno::Reference< ooo::vba::word::XListTemplate >& ListTemplate, const css::uno::Any& ListLevelNumber ) throw (css::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getNameLocal() throw (css::uno::RuntimeException); + virtual void SAL_CALL setNameLocal( const ::rtl::OUString& _namelocal ) throw (css::uno::RuntimeException); + virtual css::uno::Reference< ::ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() throw (css::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getAutomaticallyUpdate() throw (css::uno::RuntimeException); + virtual void SAL_CALL setAutomaticallyUpdate( ::sal_Bool _automaticallyupdate ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getBaseStyle() throw (css::uno::RuntimeException); + virtual void SAL_CALL setBaseStyle( const css::uno::Any& _basestyle ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getNextParagraphStyle() throw (css::uno::RuntimeException); + virtual void SAL_CALL setNextParagraphStyle( const css::uno::Any& _nextparagraphstyle ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getListLevelNumber() throw (css::uno::RuntimeException); + + //XDefaultProperty + virtual ::rtl::OUString SAL_CALL getDefaultPropertyName( ) throw (css::uno::RuntimeException) { return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); } // XHelperInterface virtual rtl::OUString& getServiceImplName(); @@ -65,3 +82,5 @@ public: }; #endif //SW_VBA_AXIS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbastyles.cxx b/sw/source/ui/vba/vbastyles.cxx index 58a88e2e79..725569e39a 100644 --- a/sw/source/ui/vba/vbastyles.cxx +++ b/sw/source/ui/vba/vbastyles.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,7 +45,7 @@ struct BuiltinStyleTable sal_Int32 wdStyleType; }; -const BuiltinStyleTable aBuiltinStyleTable[] = +static const BuiltinStyleTable aBuiltinStyleTable[] = { { word::WdBuiltinStyle::wdStyleBlockQuotation, "", word::WdStyleType::wdStyleTypeParagraph }, { word::WdBuiltinStyle::wdStyleBodyText, "Text body", word::WdStyleType::wdStyleTypeParagraph }, @@ -152,51 +153,36 @@ const BuiltinStyleTable aBuiltinStyleTable[] = { 0, 0, 0 } }; +struct MSOStyleNameTable +{ + const sal_Char* pMSOStyleName; + const sal_Char* pOOoStyleName; + const sal_Char* pOOoStyleType; +}; -static uno::Sequence< rtl::OUString > getStyleTypes() +static const MSOStyleNameTable aMSOStyleNameTable[] = { - uno::Sequence< rtl::OUString > aRet(3); - rtl::OUString* pArray = aRet.getArray(); - pArray[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParagraphStyles") ); - pArray[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CharacterStyles") ); - pArray[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingStyles") ); - return aRet; -} + { "Normal", "Default", "ParagraphStyles" }, + { 0, 0, 0 } +}; typedef ::cppu::WeakImplHelper1< container::XEnumeration > StyleEnumeration_BASE; typedef ::cppu::WeakImplHelper3< container::XNameAccess, container::XIndexAccess, container::XEnumerationAccess > StyleCollectionHelper_BASE; -/* -class StylesEnumeration : public StyleEnumeration_BASE -{ -public: - StylesEnumeration( const SheetMap& sMap ) : mSheetMap( sMap ), mIt( mSheetMap.begin() ) {} - virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) - { - return ( mIt != mSheetMap.end() ); - } - virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) - { - if ( !hasMoreElements() ) - throw container::NoSuchElementException(); - uno::Reference< sheet::XSpreadsheet > xSheet( *mIt++ ); - return uno::makeAny( xSheet ) ; - } -}; -*/ + class StyleCollectionHelper : public StyleCollectionHelper_BASE { private: uno::Reference< frame::XModel > mxModel; - uno::Reference< container::XNameAccess > mxStyleFamilies; - uno::Reference< container::XNameContainer > mxCurrentStyleFamily; + uno::Reference< container::XNameAccess > mxParaStyles; uno::Any cachePos; public: StyleCollectionHelper( const uno::Reference< frame::XModel >& _xModel ) : mxModel( _xModel ) { + // we only concern about the Paragraph styles uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( _xModel, uno::UNO_QUERY_THROW); - mxStyleFamilies = xStyleSupplier->getStyleFamilies(); + uno::Reference< container::XNameAccess > xStyleFamilies = xStyleSupplier->getStyleFamilies(); + mxParaStyles.set( xStyleFamilies->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParagraphStyles") ) ), uno::UNO_QUERY_THROW ); } - uno::Reference< container::XNameContainer > getCurrentStyleFamily(){ return mxCurrentStyleFamily; } // XElementAccess virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { return style::XStyle::static_type(0); } virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { return getCount() > 0; } @@ -209,32 +195,42 @@ public: } virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException) { - uno::Sequence< rtl::OUString > sNames( getCount() ); - rtl::OUString* pString = sNames.getArray(); - uno::Sequence< rtl::OUString > aStyleTypes = getStyleTypes(); - sal_Int32 nCount = 0; - for( sal_Int32 i = 0; i < aStyleTypes.getLength(); i++ ) + return mxParaStyles->getElementNames(); + } + virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException) + { + // search in the MSOStyleName table first + for( const MSOStyleNameTable* pTable = aMSOStyleNameTable; pTable->pMSOStyleName != NULL; pTable++ ) { - uno::Reference< container::XNameAccess > xNameAccess( mxStyleFamilies->getByName( aStyleTypes[i] ), uno::UNO_QUERY_THROW ); - uno::Sequence< rtl::OUString > sElementNames = xNameAccess->getElementNames(); - for( sal_Int32 j = 0; j < sElementNames.getLength(); j++ ) + if( aName.equalsIgnoreAsciiCaseAscii( pTable->pMSOStyleName ) ) { - pString[nCount++] = sElementNames[j]; + //Found it + rtl::OUString sStyleName = rtl::OUString::createFromAscii( pTable->pOOoStyleName ); + if( mxParaStyles->hasByName( sStyleName ) ) + { + cachePos = mxParaStyles->getByName( sStyleName ); + return sal_True; + } + return sal_False; } } - return sNames; - } - virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException) - { - uno::Sequence< rtl::OUString > aStyleTypes = getStyleTypes(); - for( sal_Int32 i = 0; i < aStyleTypes.getLength(); i++ ) + + if( mxParaStyles->hasByName( aName ) ) { - uno::Reference< container::XNameAccess > xNameAccess( mxStyleFamilies->getByName( aStyleTypes[i] ), uno::UNO_QUERY_THROW ); - if( xNameAccess->hasByName( aName ) ) + cachePos = mxParaStyles->getByName( aName ); + return sal_True; + } + else + { + uno::Sequence< rtl::OUString > sElementNames = mxParaStyles->getElementNames(); + for( sal_Int32 j = 0; j < sElementNames.getLength(); j++ ) { - cachePos = xNameAccess->getByName( aName ); - mxCurrentStyleFamily.set( xNameAccess, uno::UNO_QUERY_THROW ); - return sal_True; + rtl::OUString aStyleName = sElementNames[j]; + if( aStyleName.equalsIgnoreAsciiCase( aName ) ) + { + cachePos = mxParaStyles->getByName( aStyleName ); + return sal_True; + } } } return sal_False; @@ -243,44 +239,43 @@ public: // XIndexAccess virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) { - uno::Sequence< rtl::OUString > aStyleTypes = getStyleTypes(); - sal_Int32 nCount = 0; - for( sal_Int32 i = 0; i < aStyleTypes.getLength(); i++ ) - { - uno::Reference< container::XIndexAccess > xIndexAccess( mxStyleFamilies->getByName( aStyleTypes[i] ), uno::UNO_QUERY_THROW ); - nCount += xIndexAccess->getCount(); - } - return nCount; + uno::Reference< container::XIndexAccess > xIndexAccess( mxParaStyles, uno::UNO_QUERY_THROW ); + return xIndexAccess->getCount(); } virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) { if ( Index < 0 || Index >= getCount() ) throw lang::IndexOutOfBoundsException(); - // FIXME: need to make a alphabetically sorted list of style names - uno::Sequence< rtl::OUString > aStyleTypes = getStyleTypes(); - for( sal_Int32 i = 0; i < aStyleTypes.getLength(); i++ ) - { - uno::Reference< container::XIndexAccess > xIndexAccess( mxStyleFamilies->getByName( aStyleTypes[i] ), uno::UNO_QUERY_THROW ); - sal_Int32 nCount = xIndexAccess->getCount(); - if( Index >= nCount ) - Index -= nCount; - else - { - mxCurrentStyleFamily.set( xIndexAccess, uno::UNO_QUERY_THROW ); - return xIndexAccess->getByIndex( Index ); - } - } - throw lang::IndexOutOfBoundsException(); + uno::Reference< container::XIndexAccess > xIndexAccess( mxParaStyles, uno::UNO_QUERY_THROW ); + return xIndexAccess->getByIndex( Index ); } // XEnumerationAccess virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException) { - // FIXME: throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); } }; +class StylesEnumWrapper : public EnumerationHelper_BASE +{ + SwVbaStyles* pStyles; + sal_Int32 nIndex; +public: + StylesEnumWrapper( SwVbaStyles* _pStyles ) : pStyles( _pStyles ), nIndex( 1 ) {} + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { + return ( nIndex <= pStyles->getCount() ); + } + + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( nIndex <= pStyles->getCount() ) + return pStyles->Item( uno::makeAny( nIndex++ ), uno::Any() ); + throw container::NoSuchElementException(); + } +}; + SwVbaStyles::SwVbaStyles( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< css::uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel ) throw ( script::BasicErrorException ) : SwVbaStyles_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new StyleCollectionHelper( xModel ) ) ), mxModel( xModel ) { mxMSF.set( mxModel, uno::UNO_QUERY_THROW ); @@ -290,7 +285,7 @@ uno::Any SwVbaStyles::createCollectionObject(const uno::Any& aObject) { uno::Reference< beans::XPropertySet > xStyleProp( aObject, uno::UNO_QUERY_THROW ); - return uno::makeAny( uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, xStyleProp ) ) ); + return uno::makeAny( uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, mxModel, xStyleProp ) ) ); } uno::Type SAL_CALL @@ -302,7 +297,7 @@ SwVbaStyles::getElementType() throw (uno::RuntimeException) uno::Reference< container::XEnumeration > SAL_CALL SwVbaStyles::createEnumeration() throw (uno::RuntimeException) { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + return new StylesEnumWrapper( this ); } uno::Any SAL_CALL @@ -319,7 +314,7 @@ SwVbaStyles::Item( const uno::Any& Index1, const uno::Any& Index2 ) throw (uno:: rtl::OUString aStyleName = rtl::OUString::createFromAscii( pTable->pOOoStyleName ); if( aStyleName.getLength() > 0 ) { - rtl::OUString aStyleType = SwVbaStyle::getOOoStyleTypeFromMSWord( pTable->wdStyleType ); + rtl::OUString aStyleType; switch( pTable->wdStyleType ) { case word::WdStyleType::wdStyleTypeParagraph: @@ -335,7 +330,8 @@ SwVbaStyles::Item( const uno::Any& Index1, const uno::Any& Index2 ) throw (uno:: } case word::WdStyleType::wdStyleTypeList: { - aStyleType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingStyles") ); + // should use Paragraph style and set the property "NumberingStyleName" + aStyleType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParagraphStyles") ); break; } default: @@ -344,7 +340,12 @@ SwVbaStyles::Item( const uno::Any& Index1, const uno::Any& Index2 ) throw (uno:: uno::Reference< style::XStyleFamiliesSupplier > xStyleSupplier( mxModel, uno::UNO_QUERY_THROW); uno::Reference< container::XNameAccess > xStylesAccess( xStyleSupplier->getStyleFamilies()->getByName( aStyleType ), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xStyleProps( xStylesAccess->getByName( aStyleName ), uno::UNO_QUERY_THROW ); - return uno::makeAny( uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, xStyleProps ) ) ); + // set the property "NumberingStyleName" if it is a listbullet + if( pTable->wdStyleType == word::WdStyleType::wdStyleTypeList ) + { + xStyleProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingStyleName") ), uno::makeAny( aStyleName ) ); + } + return uno::makeAny( uno::Reference< word::XStyle >( new SwVbaStyle( this, mxContext, mxModel, xStyleProps ) ) ); } else { @@ -375,3 +376,5 @@ SwVbaStyles::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbastyles.hxx b/sw/source/ui/vba/vbastyles.hxx index 76e08c6ba2..a3c2fd1bf0 100644 --- a/sw/source/ui/vba/vbastyles.hxx +++ b/sw/source/ui/vba/vbastyles.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,3 +50,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx index 66e5d1fd4c..baac088c14 100644 --- a/sw/source/ui/vba/vbasystem.cxx +++ b/sw/source/ui/vba/vbasystem.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -32,7 +33,12 @@ #include <tools/string.hxx> #include <osl/file.hxx> #include <tools/urlobj.hxx> -#include <tools/string.hxx> + +#ifdef WNT +#include <prewin.h> +#include <postwin.h> +#include <tchar.h> +#endif using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -47,13 +53,79 @@ void PrivateProfileStringListener::Initialize( const rtl::OUString& rFileName, c maGroupName = rGroupName; maKey = rKey; } +#ifdef WNT +void lcl_getRegKeyInfo( const ByteString& sKeyInfo, HKEY& hBaseKey, ByteString& sSubKey ) +{ + sal_Int32 nBaseKeyIndex = sKeyInfo.Search('\\'); + if( nBaseKeyIndex > 0 ) + { + ByteString sBaseKey = sKeyInfo.Copy( 0, nBaseKeyIndex ); + sSubKey = sKeyInfo.Copy( nBaseKeyIndex + 1 ); + if( sBaseKey.Equals("HKEY_CURRENT_USER") ) + { + hBaseKey = HKEY_CURRENT_USER; + } + else if( sBaseKey.Equals("HKEY_LOCAL_MACHINE") ) + { + hBaseKey = HKEY_LOCAL_MACHINE; + } + else if( sBaseKey.Equals("HKEY_CLASSES_ROOT") ) + { + hBaseKey = HKEY_CLASSES_ROOT; + } + else if( sBaseKey.Equals("HKEY_USERS") ) + { + hBaseKey = HKEY_USERS; + } + else if( sBaseKey.Equals("HKEY_CURRENT_CONFIG") ) + { + hBaseKey = HKEY_CURRENT_CONFIG; + } + } +} +#endif uno::Any PrivateProfileStringListener::getValueEvent() { // get the private profile string - Config aCfg( maFileName ); - aCfg.SetGroup( maGroupName ); - rtl::OUString sValue = String( aCfg.ReadKey( maKey ), RTL_TEXTENCODING_DONTKNOW ); + rtl::OUString sValue; + if(maFileName.getLength()) + { + // get key/value from a file + Config aCfg( maFileName ); + aCfg.SetGroup( maGroupName ); + sValue = String( aCfg.ReadKey( maKey ), RTL_TEXTENCODING_DONTKNOW ); + } + else + { + // get key/value from windows register +#ifdef WNT + HKEY hBaseKey = NULL; + ByteString sSubKey; + sal_Int32 nBaseKeyIndex = maGroupName.Search('\\'); + lcl_getRegKeyInfo( maGroupName, hBaseKey, sSubKey ); + if( hBaseKey != NULL ) + { + HKEY hKey = NULL; + LONG lResult; + LPCTSTR lpSubKey = TEXT( sSubKey.GetBuffer()); + TCHAR szBuffer[1024]; + DWORD cbData = sizeof( szBuffer ); + lResult = RegOpenKeyEx( hBaseKey, lpSubKey, 0, KEY_QUERY_VALUE, &hKey ); + if( ERROR_SUCCESS == lResult ) + { + LPCTSTR lpValueName = TEXT(maKey.GetBuffer()); + lResult = RegQueryValueEx( hKey, lpValueName, NULL, NULL, (LPBYTE)szBuffer, &cbData ); + RegCloseKey( hKey ); + sValue = rtl::OUString::createFromAscii(szBuffer); + } + } + + return uno::makeAny( sValue ); +#endif + throw uno::RuntimeException( rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Only support on Windows")), uno::Reference< uno::XInterface >() ); + } return uno::makeAny( sValue ); } @@ -61,12 +133,44 @@ uno::Any PrivateProfileStringListener::getValueEvent() void PrivateProfileStringListener::setValueEvent( const css::uno::Any& value ) { // set the private profile string - Config aCfg( maFileName ); - aCfg.SetGroup( maGroupName ); - rtl::OUString aValue; value >>= aValue; - aCfg.WriteKey( maKey, ByteString( aValue.getStr(), RTL_TEXTENCODING_DONTKNOW ) ); + if(maFileName.getLength()) + { + // set value into a file + Config aCfg( maFileName ); + aCfg.SetGroup( maGroupName ); + aCfg.WriteKey( maKey, ByteString( aValue.getStr(), RTL_TEXTENCODING_DONTKNOW ) ); + } + else + { + //set value into windows register +#ifdef WNT + HKEY hBaseKey = NULL; + ByteString sSubKey; + sal_Int32 nBaseKeyIndex = maGroupName.Search('\\'); + lcl_getRegKeyInfo( maGroupName, hBaseKey, sSubKey ); + if( hBaseKey != NULL ) + { + HKEY hKey = NULL; + LONG lResult; + LPCTSTR lpSubKey = TEXT( sSubKey.GetBuffer()); + lResult = RegCreateKeyEx( hBaseKey, lpSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL ); + if( ERROR_SUCCESS == lResult ) + { + LPCTSTR szValue = TEXT( rtl::OUStringToOString( aValue, RTL_TEXTENCODING_UTF8 ).getStr() ); + DWORD cbData = sizeof(TCHAR) * (_tcslen(szValue) + 1); + LPCTSTR lpValueName = TEXT(maKey.GetBuffer()); + lResult = RegSetValueEx( hKey, lpValueName, NULL, REG_SZ, (LPBYTE)szValue, cbData ); + RegCloseKey( hKey ); + } + } + return; +#endif + throw uno::RuntimeException( rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Not implemented")), uno::Reference< uno::XInterface >() ); + } + } SwVbaSystem::SwVbaSystem( uno::Reference<uno::XComponentContext >& xContext ): SwVbaSystem_BASE( uno::Reference< XHelperInterface >(), xContext ) @@ -97,7 +201,7 @@ SwVbaSystem::getCursor() throw (uno::RuntimeException) } } -void SAL_CALL +void SAL_CALL SwVbaSystem::setCursor( sal_Int32 _cursor ) throw (uno::RuntimeException) { try @@ -131,11 +235,11 @@ SwVbaSystem::setCursor( sal_Int32 _cursor ) throw (uno::RuntimeException) break; } default: - throw uno::RuntimeException( rtl::OUString( + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Unknown value for Cursor pointer")), uno::Reference< uno::XInterface >() ); // TODO: isn't this a flaw in the API? It should be allowed to throw an // IllegalArgumentException, or so - } + } } catch( const uno::Exception& ) { @@ -143,22 +247,22 @@ SwVbaSystem::setCursor( sal_Int32 _cursor ) throw (uno::RuntimeException) } } -uno::Any SAL_CALL +uno::Any SAL_CALL SwVbaSystem::PrivateProfileString( const rtl::OUString& rFilename, const rtl::OUString& rSection, const rtl::OUString& rKey ) throw ( uno::RuntimeException ) { - if( rFilename.getLength() == 0 ) - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from shell" ) ), uno::Reference< uno::XInterface >() ); - // FIXME: need to detect whether it is a relative file path // we need to detect if this is a URL, if not then assume its a file path rtl::OUString sFileUrl; - INetURLObject aObj; - aObj.SetURL( rFilename ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; - if ( bIsURL ) - sFileUrl = rFilename; - else - osl::FileBase::getFileURLFromSystemPath( rFilename, sFileUrl); + if( rFilename.getLength() ) + { + INetURLObject aObj; + aObj.SetURL( rFilename ); + bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + if ( bIsURL ) + sFileUrl = rFilename; + else + osl::FileBase::getFileURLFromSystemPath( rFilename, sFileUrl); + } ByteString aGroupName = ByteString( rSection.getStr(), RTL_TEXTENCODING_DONTKNOW); ByteString aKey = ByteString( rKey.getStr(), RTL_TEXTENCODING_DONTKNOW); @@ -167,14 +271,14 @@ SwVbaSystem::PrivateProfileString( const rtl::OUString& rFilename, const rtl::OU return uno::makeAny( uno::Reference< XPropValue > ( new ScVbaPropValue( &maPrivateProfileStringListener ) ) ); } -rtl::OUString& +rtl::OUString& SwVbaSystem::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaSystem") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > SwVbaSystem::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -185,3 +289,5 @@ SwVbaSystem::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbasystem.hxx b/sw/source/ui/vba/vbasystem.hxx index df548a76a5..82db6a5f71 100644 --- a/sw/source/ui/vba/vbasystem.hxx +++ b/sw/source/ui/vba/vbasystem.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -69,3 +70,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_SYSTEM_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatable.cxx b/sw/source/ui/vba/vbatable.cxx index 7598dfc6cf..6809e4b0e4 100644 --- a/sw/source/ui/vba/vbatable.cxx +++ b/sw/source/ui/vba/vbatable.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "vbatable.hxx" #include "vbarange.hxx" #include <com/sun/star/frame/XModel.hpp> @@ -9,11 +10,13 @@ #include <com/sun/star/container/XNamed.hpp> #include "vbaborders.hxx" #include "vbapalette.hxx" +#include "vbarows.hxx" +#include "vbacolumns.hxx" using namespace ::ooo::vba; using namespace ::com::sun::star; -SwVbaTable::SwVbaTable( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rDocument, const uno::Reference< css::text::XTextTable >& xTextTable) throw ( uno::RuntimeException ) : SwVbaTable_BASE( rParent, rContext ), mxTextDocument( rDocument ) +SwVbaTable::SwVbaTable( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextDocument >& rDocument, const uno::Reference< text::XTextTable >& xTextTable) throw ( uno::RuntimeException ) : SwVbaTable_BASE( rParent, rContext ), mxTextDocument( rDocument ) { mxTextTable.set( xTextTable, uno::UNO_QUERY_THROW ); } @@ -75,6 +78,26 @@ SwVbaTable::Borders( const uno::Any& index ) throw (uno::RuntimeException) return uno::makeAny( xCol ); } +uno::Any SAL_CALL +SwVbaTable::Rows( const uno::Any& index ) throw (uno::RuntimeException) +{ + uno::Reference< table::XTableRows > xTableRows( mxTextTable->getRows(), uno::UNO_QUERY_THROW ); + uno::Reference< XCollection > xCol( new SwVbaRows( this, mxContext, mxTextTable, xTableRows ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} + +uno::Any SAL_CALL +SwVbaTable::Columns( const uno::Any& index ) throw (uno::RuntimeException) +{ + uno::Reference< table::XTableColumns > xTableColumns( mxTextTable->getColumns(), uno::UNO_QUERY_THROW ); + uno::Reference< XCollection > xCol( new SwVbaColumns( this, mxContext, mxTextTable, xTableColumns ) ); + if ( index.hasValue() ) + return xCol->Item( index, uno::Any() ); + return uno::makeAny( xCol ); +} + // XHelperInterface rtl::OUString& SwVbaTable::getServiceImplName() @@ -95,3 +118,4 @@ SwVbaTable::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatable.hxx b/sw/source/ui/vba/vbatable.hxx index c28a3cdaf3..2e95d0ca41 100644 --- a/sw/source/ui/vba/vbatable.hxx +++ b/sw/source/ui/vba/vbatable.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #ifndef SW_VBA_TABLE_HXX #define SW_VBA_TABLE_HXX #include <vbahelper/vbahelperinterface.hxx> @@ -14,15 +15,20 @@ class SwVbaTable : public SwVbaTable_BASE css::uno::Reference< css::text::XTextTable > mxTextTable; public: SwVbaTable( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rDocument, const css::uno::Reference< css::text::XTextTable >& xTextTable) throw ( css::uno::RuntimeException); - css::uno::Reference< css::text::XTextDocument > getDocument() { return mxTextDocument; }; + css::uno::Reference< css::text::XTextDocument > getDocument() const { return mxTextDocument; }; virtual css::uno::Reference< ::ooo::vba::word::XRange > SAL_CALL Range( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual void SAL_CALL Select( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Reference< ::ooo::vba::word::XRange > SAL_CALL ConvertToText( const css::uno::Any& Separator, const css::uno::Any& NestedTables ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual rtl::OUString SAL_CALL getName( ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Borders( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Rows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Columns( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx new file mode 100644 index 0000000000..072c39485a --- /dev/null +++ b/sw/source/ui/vba/vbatablehelper.cxx @@ -0,0 +1,295 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbatablehelper.hxx" +#include <swtable.hxx> +#include <unotbl.hxx> +#include <docsh.hxx> + +using namespace ::com::sun::star; +using namespace ::ooo::vba; + +#define UNO_TABLE_COLUMN_SUM 10000 + +SwVbaTableHelper::SwVbaTableHelper( const uno::Reference< text::XTextTable >& xTextTable ) throw (uno::RuntimeException) : mxTextTable( xTextTable ), pDoc( NULL ) +{ + pTable = GetSwTable( mxTextTable ); +} + +SwTable* SwVbaTableHelper::GetSwTable( const uno::Reference< text::XTextTable >& xTextTable ) throw (uno::RuntimeException) +{ + uno::Reference< lang::XUnoTunnel > xTunnel( xTextTable, uno::UNO_QUERY_THROW ); + SwXTextTable* pXTextTable = reinterpret_cast< SwXTextTable * >( sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(SwXTextTable::getUnoTunnelId()))); + if( !pXTextTable ) + throw uno::RuntimeException(); + + SwFrmFmt* pFrmFmt = pXTextTable->GetFrmFmt(); + if( !pFrmFmt ) + throw uno::RuntimeException(); + + SwTable* pTable = SwTable::FindTable( pFrmFmt ); + return pTable; +} + +sal_Int32 SwVbaTableHelper::getTabColumnsCount( sal_Int32 nRowIndex ) throw (uno::RuntimeException) +{ + sal_Int32 nRet = 0; + if(!pTable->IsTblComplex()) + { + SwTableLines& rLines = pTable->GetTabLines(); + SwTableLine* pLine = rLines.GetObject( nRowIndex ); + nRet = pLine->GetTabBoxes().Count(); + } + return nRet; +} + +sal_Int32 SwVbaTableHelper::getTabColumnsMaxCount( ) throw (uno::RuntimeException) +{ + sal_Int32 nRet = 0; + //sal_Int32 nRowCount = mxTextTable->getRows()->getCount(); + sal_Int32 nRowCount = pTable->GetTabLines().Count(); + for( sal_Int32 index = 0; index < nRowCount; index++ ) + { + sal_Int32 nColCount = getTabColumnsCount( index ); + if( nRet < nColCount ) + nRet = nColCount; + } + return nRet; +} + +sal_Int32 SwVbaTableHelper::getTabRowIndex( const rtl::OUString& CellName ) throw (uno::RuntimeException) +{ + sal_Int32 nRet = 0; + String sCellName(CellName); + SwTableBox* pBox = (SwTableBox*)pTable->GetTblBox( sCellName ); + if( !pBox ) + throw uno::RuntimeException(); + + const SwTableLine* pLine = pBox->GetUpper(); + const SwTableLines* pLines = pLine->GetUpper() + ? &pLine->GetUpper()->GetTabLines() : &pTable->GetTabLines(); + nRet = pLines->GetPos( pLine ); + return nRet; +} + +sal_Int32 SwVbaTableHelper::getTabColIndex( const rtl::OUString& CellName ) throw (uno::RuntimeException) +{ + sal_Int32 nRet = 0; + String sCellName(CellName); + const SwTableBox* pBox = (SwTableBox*)pTable->GetTblBox( sCellName ); + if( !pBox ) + throw uno::RuntimeException(); + const SwTableBoxes* pBoxes = &pBox->GetUpper()->GetTabBoxes(); + nRet = pBoxes->GetPos( pBox ); + return nRet; +} + +rtl::OUString SwVbaTableHelper::getColumnStr( sal_Int32 nCol ) +{ + const sal_Int32 coDiff = 52; // 'A'-'Z' 'a' - 'z' + sal_Int32 nCalc = 0; + + String sRet; + do{ + nCalc = nCol % coDiff; + if( nCalc >= 26 ) + sRet.Insert( sal_Unicode('a' - 26 + nCalc ), 0 ); + else + sRet.Insert( sal_Unicode('A' + nCalc ), 0 ); + + if( 0 == ( nCol = nCol - nCalc ) ) + break; + nCol /= coDiff; + --nCol; + }while(1); + return sRet; +} + +sal_Int32 SwVbaTableHelper::getTableWidth( ) throw (uno::RuntimeException) +{ + sal_Int32 nWidth = 0; + sal_Bool isWidthRelatvie = sal_False; + uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW ); + xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsWidthRelative") ) ) >>= isWidthRelatvie; + if( isWidthRelatvie ) + { + xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RelativeWidth") ) ) >>= nWidth; + } + else + { + xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ) ) >>= nWidth; + } + return nWidth; +} + +void SwVbaTableHelper::setTableWidth( sal_Int32 _width ) throw (uno::RuntimeException) +{ + sal_Bool isWidthRelatvie = sal_False; + uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW ); + xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsWidthRelative") ) ) >>= isWidthRelatvie; + if( isWidthRelatvie ) + { + xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RelativeWidth") ), uno::makeAny( _width )); + } + else + { + xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ), uno::makeAny( _width ) ); + } +} + +SwTableBox* SwVbaTableHelper::GetTabBox( sal_Int32 nCol, sal_Int32 nRow ) throw (css::uno::RuntimeException) +{ + SwTableLines& rLines = pTable->GetTabLines(); + sal_Int32 nRowCount = rLines.Count(); + if( nRowCount < nRow ) + throw uno::RuntimeException(); + + SwTableBox* pStart = NULL; + SwTableLine* pLine = rLines.GetObject( nRow ); + if( pLine->GetTabBoxes().Count() < nCol ) + throw uno::RuntimeException(); + + pStart = pLine->GetTabBoxes()[ nCol ]; + + if( !pStart ) + throw uno::RuntimeException(); + + return pStart; +} + +void SwVbaTableHelper::InitTabCols( SwTabCols& rCols, const SwTableBox *pStart, sal_Bool /*bCurRowOnly*/ ) +{ + rCols.SetLeftMin ( 0 ); + rCols.SetLeft ( 0 ); + rCols.SetRight ( UNO_TABLE_COLUMN_SUM ); + rCols.SetRightMax( UNO_TABLE_COLUMN_SUM ); + pTable->GetTabCols( rCols, pStart, sal_False, sal_False ); +} + +sal_Int32 SwVbaTableHelper::GetColCount( SwTabCols& rCols ) const +{ + sal_Int32 nCount = 0; + for(sal_Int32 i = 0; i < rCols.Count(); i++ ) + if(rCols.IsHidden(i)) + nCount ++; + return rCols.Count() - nCount; +} + +sal_Int32 SwVbaTableHelper::GetRightSeparator( SwTabCols& rCols, sal_Int32 nNum) const +{ + OSL_ENSURE( nNum < (sal_Int32)GetColCount( rCols ) ,"Index out of range"); + sal_Int32 i = 0; + while( nNum >= 0 ) + { + if( !rCols.IsHidden( static_cast< sal_uInt16 >(i)) ) + nNum--; + i++; + } + return i - 1; +} + +sal_Int32 SwVbaTableHelper::GetColWidth( sal_Int32 nCol, sal_Int32 nRow, sal_Bool bCurRowOnly ) throw (uno::RuntimeException) +{ + SwTableBox* pStart = GetTabBox( nCol, nRow ); + SwTabCols aCols; + InitTabCols( aCols, pStart, bCurRowOnly ); + sal_Int32 nWidth = GetColWidth( aCols, nCol ); + + sal_Int32 nTableWidth = getTableWidth( ); + double dAbsWidth = ( (double)nWidth / UNO_TABLE_COLUMN_SUM ) * (double) nTableWidth; + return ( sal_Int32 )Millimeter::getInPoints( dAbsWidth ); +} + +sal_Int32 SwVbaTableHelper::GetColWidth( SwTabCols& rCols, sal_Int32 nNum ) throw (uno::RuntimeException) +{ + SwTwips nWidth = 0; + + if( rCols.Count() > 0 ) + { + if(rCols.Count() == GetColCount( rCols )) + { + nWidth = (SwTwips)((nNum == rCols.Count()) ? + rCols.GetRight() - rCols[nNum-1] : + nNum == 0 ? rCols[nNum] - rCols.GetLeft() : + rCols[nNum] - rCols[nNum-1]); + } + else + { + SwTwips nRValid = nNum < GetColCount( rCols ) ? + rCols[(sal_uInt16)GetRightSeparator( rCols, nNum)]: + rCols.GetRight(); + SwTwips nLValid = nNum ? + rCols[(sal_uInt16)GetRightSeparator( rCols, nNum - 1)]: + rCols.GetLeft(); + nWidth = nRValid - nLValid; + } + } + else + nWidth = rCols.GetRight(); + + return nWidth; +} + +void SwVbaTableHelper::SetColWidth( sal_Int32 _width, sal_Int32 nCol, sal_Int32 nRow, sal_Bool bCurRowOnly ) throw (css::uno::RuntimeException) +{ + double dAbsWidth = Millimeter::getInHundredthsOfOneMillimeter( _width ); + sal_Int32 nTableWidth = getTableWidth( ); + sal_Int32 nNewWidth = (sal_Int32)( dAbsWidth/nTableWidth * UNO_TABLE_COLUMN_SUM ); + + SwTableBox* pStart = GetTabBox( nCol, nRow ); + SwTabCols aOldCols; + InitTabCols( aOldCols, pStart, bCurRowOnly ); + + SwTabCols aCols( aOldCols ); + if ( aCols.Count() > 0 ) + { + SwTwips nWidth = GetColWidth( aCols, nCol); + + int nDiff = (int)(nNewWidth - nWidth); + if( !nCol ) + aCols[ static_cast< sal_uInt16 >(GetRightSeparator(aCols, 0)) ] += nDiff; + else if( nCol < GetColCount( aCols ) ) + { + if(nDiff < GetColWidth( aCols, nCol + 1) - MINLAY) + aCols[ static_cast< sal_uInt16 >(GetRightSeparator( aCols, nCol)) ] += nDiff; + else + { + int nDiffLeft = nDiff - (int)GetColWidth( aCols, nCol + 1) + (int)MINLAY; + aCols[ static_cast< sal_uInt16 >(GetRightSeparator( aCols, nCol)) ] += (nDiff - nDiffLeft); + aCols[ static_cast< sal_uInt16 >(GetRightSeparator( aCols, nCol - 1)) ] -= nDiffLeft; + } + } + else + aCols[ static_cast< sal_uInt16 >(GetRightSeparator( aCols, nCol-1)) ] -= nDiff; + } + else + aCols.SetRight( Min( (long)nNewWidth, aCols.GetRightMax()) ); + + pTable->SetTabCols(aCols, aOldCols, pStart, bCurRowOnly ); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatablehelper.hxx b/sw/source/ui/vba/vbatablehelper.hxx new file mode 100644 index 0000000000..0dcd630d07 --- /dev/null +++ b/sw/source/ui/vba/vbatablehelper.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_WORD_VBA_TABLEHELPER_HXX +#define SW_WORD_VBA_TABLEHELPER_HXX + +#include <com/sun/star/text/XTextTable.hpp> +#include "wordvbahelper.hxx" +#include <swtable.hxx> +#include <tabcol.hxx> +#include <doc.hxx> + +class SwVbaTableHelper +{ +private: + css::uno::Reference< css::text::XTextTable > mxTextTable; + SwTable* pTable; + SwDoc* pDoc; + +private: + SwTableBox* GetTabBox( sal_Int32 nCol, sal_Int32 nRow ) throw (css::uno::RuntimeException); + void InitTabCols( SwTabCols& rCols, const SwTableBox *pStart, sal_Bool bCurRowOnly = sal_False ); + sal_Int32 GetRightSeparator( SwTabCols& rCols, sal_Int32 nNum) const; + sal_Int32 GetColCount( SwTabCols& rCols ) const; + sal_Int32 GetColWidth( SwTabCols& rCols, sal_Int32 nNum ) throw (css::uno::RuntimeException); + +public: + SwVbaTableHelper( const css::uno::Reference< css::text::XTextTable >& xTextTable ) throw (css::uno::RuntimeException); + ~SwVbaTableHelper() {} + sal_Int32 getTabColumnsCount( sal_Int32 nRowIndex ) throw (css::uno::RuntimeException); + sal_Int32 getTabColumnsMaxCount( ) throw (css::uno::RuntimeException); + sal_Int32 getTabRowIndex( const rtl::OUString& sCellName ) throw (css::uno::RuntimeException); + sal_Int32 getTabColIndex( const rtl::OUString& sCellName ) throw (css::uno::RuntimeException); + sal_Int32 getTableWidth( ) throw (css::uno::RuntimeException); + void setTableWidth( sal_Int32 _width ) throw (css::uno::RuntimeException); + + sal_Int32 GetColWidth( sal_Int32 nCol, sal_Int32 nRow = 0, sal_Bool bCurRowOnly = sal_False ) throw (css::uno::RuntimeException); + void SetColWidth( sal_Int32 _width, sal_Int32 nCol, sal_Int32 nRow = 0, sal_Bool bCurRowOnly = sal_False ) throw (css::uno::RuntimeException); + + static SwTable* GetSwTable( const css::uno::Reference< css::text::XTextTable >& xTextTable ) throw (css::uno::RuntimeException); + static rtl::OUString getColumnStr( sal_Int32 nCol ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatableofcontents.cxx b/sw/source/ui/vba/vbatableofcontents.cxx new file mode 100644 index 0000000000..09a29238ba --- /dev/null +++ b/sw/source/ui/vba/vbatableofcontents.cxx @@ -0,0 +1,124 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbatableofcontents.hxx" +#include <vbahelper/vbahelper.hxx> +#include <tools/diagnose_ex.h> +#include <ooo/vba/word/WdTabLeader.hpp> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +SwVbaTableOfContents::SwVbaTableOfContents( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< text::XTextDocument >& xDoc, const uno::Reference< text::XDocumentIndex >& xDocumentIndex ) throw ( uno::RuntimeException ) : + SwVbaTableOfContents_BASE( rParent, rContext ), mxTextDocument( xDoc ), mxDocumentIndex( xDocumentIndex ) +{ + mxTocProps.set( mxDocumentIndex, uno::UNO_QUERY_THROW ); +} + + +SwVbaTableOfContents::~SwVbaTableOfContents() +{ +} + +::sal_Int32 SAL_CALL SwVbaTableOfContents::getLowerHeadingLevel() throw (uno::RuntimeException) +{ + sal_Int16 nLevel = 0; + mxTocProps->getPropertyValue(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Level") ) ) >>= nLevel; + return nLevel; +} + +void SAL_CALL SwVbaTableOfContents::setLowerHeadingLevel( ::sal_Int32 _lowerheadinglevel ) throw (uno::RuntimeException) +{ + mxTocProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Level") ), uno::makeAny( sal_Int8( _lowerheadinglevel ) ) ); +} + +::sal_Int32 SAL_CALL SwVbaTableOfContents::getTabLeader() throw (uno::RuntimeException) +{ + // not support in Writer + return word::WdTabLeader::wdTabLeaderDots; +} + +void SAL_CALL SwVbaTableOfContents::setTabLeader( ::sal_Int32 /*_tableader*/ ) throw (uno::RuntimeException) +{ + // not support in Writer +} + +::sal_Bool SAL_CALL SwVbaTableOfContents::getUseFields() throw (css::uno::RuntimeException) +{ + sal_Bool bUseFields = sal_False; + mxTocProps->getPropertyValue(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CreateFromMarks") ) ) >>= bUseFields; + return bUseFields; +} + +void SAL_CALL SwVbaTableOfContents::setUseFields( ::sal_Bool _useFields ) throw (css::uno::RuntimeException) +{ + mxTocProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CreateFromMarks") ), uno::makeAny( _useFields ) ); +} + +::sal_Bool SAL_CALL SwVbaTableOfContents::getUseOutlineLevels() throw (css::uno::RuntimeException) +{ + sal_Bool bUseOutlineLevels = sal_False; + mxTocProps->getPropertyValue(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CreateFromOutline") ) ) >>= bUseOutlineLevels; + return bUseOutlineLevels; +} + +void SAL_CALL SwVbaTableOfContents::setUseOutlineLevels( ::sal_Bool _useOutlineLevels ) throw (css::uno::RuntimeException) +{ + mxTocProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CreateFromOutline") ), uno::makeAny( _useOutlineLevels ) ); +} + +void SAL_CALL SwVbaTableOfContents::Delete( ) throw (uno::RuntimeException) +{ + uno::Reference< text::XTextContent > xTextContent( mxDocumentIndex, uno::UNO_QUERY_THROW ); + mxTextDocument->getText()->removeTextContent( xTextContent ); +} + +void SAL_CALL SwVbaTableOfContents::Update( ) throw (uno::RuntimeException) +{ + mxDocumentIndex->update(); +} + +rtl::OUString& +SwVbaTableOfContents::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaTableOfContents") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +SwVbaTableOfContents::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.TableOfContents" ) ); + } + return aServiceNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatableofcontents.hxx b/sw/source/ui/vba/vbatableofcontents.hxx new file mode 100644 index 0000000000..27b39a5da2 --- /dev/null +++ b/sw/source/ui/vba/vbatableofcontents.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_TABLEOFCONTENTS_HXX +#define SW_VBA_TABLEOFCONTENTS_HXX + +#include <ooo/vba/word/XTableOfContents.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/text/XTextDocument.hpp> +#include <com/sun/star/text/XDocumentIndex.hpp> + +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XTableOfContents > SwVbaTableOfContents_BASE; + +class SwVbaTableOfContents : public SwVbaTableOfContents_BASE +{ +private: + css::uno::Reference< css::text::XTextDocument > mxTextDocument; + css::uno::Reference< css::text::XDocumentIndex > mxDocumentIndex; + css::uno::Reference< css::beans::XPropertySet > mxTocProps; + +public: + SwVbaTableOfContents( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& xDoc, const css::uno::Reference< css::text::XDocumentIndex >& xDocumentIndex ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaTableOfContents(); + + // Attributes + virtual ::sal_Int32 SAL_CALL getLowerHeadingLevel() throw (css::uno::RuntimeException); + virtual void SAL_CALL setLowerHeadingLevel( ::sal_Int32 _lowerheadinglevel ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getTabLeader() throw (css::uno::RuntimeException); + virtual void SAL_CALL setTabLeader( ::sal_Int32 _tableader ) throw (css::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getUseFields() throw (css::uno::RuntimeException); + virtual void SAL_CALL setUseFields( ::sal_Bool _useFields ) throw (css::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getUseOutlineLevels() throw (css::uno::RuntimeException); + virtual void SAL_CALL setUseOutlineLevels( ::sal_Bool _useOutlineLevels ) throw (css::uno::RuntimeException); + + // Methods + virtual void SAL_CALL Delete( ) throw (css::uno::RuntimeException); + virtual void SAL_CALL Update( ) throw (css::uno::RuntimeException); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif /* SW_VBA_TABLEOFCONTENTS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatables.cxx b/sw/source/ui/vba/vbatables.cxx index 53178d1c79..b35624c3d1 100644 --- a/sw/source/ui/vba/vbatables.cxx +++ b/sw/source/ui/vba/vbatables.cxx @@ -1,9 +1,13 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "vbatables.hxx" #include "vbatable.hxx" #include "vbarange.hxx" #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/text/XTextTablesSupplier.hpp> #include <com/sun/star/text/XTextDocument.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/text/XText.hpp> +#include <com/sun/star/table/XCellRange.hpp> #include <comphelper/componentcontext.hxx> using namespace ::ooo::vba; @@ -26,7 +30,89 @@ uno::Any lcl_createTable( const uno::Reference< XHelperInterface >& xParent, con return uno::makeAny( xTable ); } +sal_Bool lcl_isInHeaderFooter( const uno::Reference< text::XTextTable >& xTable ) +{ + uno::Reference< text::XTextContent > xTextContent( xTable, uno::UNO_QUERY_THROW ); + uno::Reference< text::XText > xText = xTextContent->getAnchor()->getText(); + uno::Reference< lang::XServiceInfo > xServiceInfo( xText, uno::UNO_QUERY_THROW ); + rtl::OUString aImplName = xServiceInfo->getImplementationName(); + if( aImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SwXHeadFootText")) ) + return sal_True; + return sal_False; +} + typedef ::cppu::WeakImplHelper1< css::container::XEnumeration > EnumBase; +typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XNameAccess > TableCollectionHelper_Base; +typedef std::vector< uno::Reference< text::XTextTable > > XTextTableVec; + +class TableCollectionHelper : public TableCollectionHelper_Base +{ + XTextTableVec mxTables; + XTextTableVec::iterator cachePos; + +public: + TableCollectionHelper( const uno::Reference< frame::XModel >& xDocument ) + { + // only count the tables in the body text, not in the header/footer + uno::Reference< container::XIndexAccess > xTables = lcl_getTables( xDocument ); + sal_Int32 nCount = xTables->getCount(); + for( sal_Int32 i = 0; i < nCount; i++ ) + { + uno::Reference< text::XTextTable > xTable( xTables->getByIndex( i ) , uno::UNO_QUERY_THROW ); + if( !lcl_isInHeaderFooter( xTable ) ) + mxTables.push_back( xTable ); + } + cachePos = mxTables.begin(); + } + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) + { + return mxTables.size(); + } + virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( Index < 0 || Index >= getCount() ) + throw lang::IndexOutOfBoundsException(); + uno::Reference< text::XTextTable > xTable( mxTables[ Index ], uno::UNO_QUERY_THROW ); + return uno::makeAny( xTable ); + } + // XElementAccess + virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { return text::XTextTable::static_type(0); } + virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { return getCount() > 0 ; } + // XNameAcess + virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( !hasByName(aName) ) + throw container::NoSuchElementException(); + uno::Reference< text::XTextTable > xTable( *cachePos, uno::UNO_QUERY_THROW ); + return uno::makeAny( xTable ); + } + virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException) + { + uno::Sequence< rtl::OUString > sNames( mxTables.size() ); + rtl::OUString* pString = sNames.getArray(); + XTextTableVec::iterator it = mxTables.begin(); + XTextTableVec::iterator it_end = mxTables.end(); + for ( ; it != it_end; ++it, ++pString ) + { + uno::Reference< container::XNamed > xName( *it, uno::UNO_QUERY_THROW ); + *pString = xName->getName(); + } + return sNames; + } + virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (uno::RuntimeException) + { + cachePos = mxTables.begin(); + XTextTableVec::iterator it_end = mxTables.end(); + for ( ; cachePos != it_end; ++cachePos ) + { + uno::Reference< container::XNamed > xName( *cachePos, uno::UNO_QUERY_THROW ); + if ( aName.equalsIgnoreAsciiCase( xName->getName() ) ) + break; + } + return ( cachePos != it_end ); + } +}; class TableEnumerationImpl : public EnumBase { @@ -39,8 +125,8 @@ public: TableEnumerationImpl( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xDocument, const uno::Reference< container::XIndexAccess >& xIndexAccess ) : mxParent( xParent ), mxContext( xContext ), mxDocument( xDocument ), mxIndexAccess( xIndexAccess ), mnCurIndex(0) { } - virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) - { + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { return ( mnCurIndex < mxIndexAccess->getCount() ); } virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) @@ -49,15 +135,15 @@ public: throw container::NoSuchElementException(); return lcl_createTable( mxParent, mxContext, mxDocument, mxIndexAccess->getByIndex( mnCurIndex++ ) ); } - + }; - -SwVbaTables::SwVbaTables( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xDocument ) : SwVbaTables_BASE( xParent, xContext , lcl_getTables( xDocument ) ), mxDocument( xDocument ) + +SwVbaTables::SwVbaTables( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xDocument ) : SwVbaTables_BASE( xParent, xContext , uno::Reference< container::XIndexAccess >( new TableCollectionHelper( xDocument ) ) ), mxDocument( xDocument ) { } -uno::Reference< word::XTable > SAL_CALL +uno::Reference< word::XTable > SAL_CALL SwVbaTables::Add( const uno::Reference< word::XRange >& Range, const uno::Any& NumRows, const uno::Any& NumColumns, const uno::Any& /*DefaultTableBehavior*/, const uno::Any& /*AutoFitBehavior*/ ) throw (script::BasicErrorException, uno::RuntimeException) { sal_Int32 nCols = 0; @@ -66,7 +152,7 @@ SwVbaTables::Add( const uno::Reference< word::XRange >& Range, const uno::Any& N // Preconditions if ( !( pVbaRange && ( NumRows >>= nRows ) && ( NumColumns >>= nCols ) ) ) throw uno::RuntimeException(); // #FIXME better exception?? - if ( nCols <= 0 || nRows <= 0 ) + if ( nCols <= 0 || nRows <= 0 ) throw uno::RuntimeException(); // #FIXME better exception?? uno::Reference< frame::XModel > xModel( pVbaRange->getDocument(), uno::UNO_QUERY_THROW ); @@ -74,50 +160,52 @@ SwVbaTables::Add( const uno::Reference< word::XRange >& Range, const uno::Any& N uno::Reference< text::XTextRange > xTextRange = pVbaRange->getXTextRange(); uno::Reference< text::XTextTable > xTable; - xTable.set( xMsf->createInstance( rtl::OUString::createFromAscii("com.sun.star.text.TextTable") ), uno::UNO_QUERY_THROW ); -/* - comphelper::ComponentContext aCtx( xMsf ); - if ( !aCtx.createComponent( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextTable") ), xTable ) ); - throw uno::RuntimeException(); // #FIXME better exception?? -*/ + xTable.set( xMsf->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextTable")) ), uno::UNO_QUERY_THROW ); + xTable->initialize( nRows, nCols ); uno::Reference< text::XText > xText = xTextRange->getText(); - uno::Reference< text::XTextContent > xContext( xTable, uno::UNO_QUERY_THROW ); - + uno::Reference< text::XTextContent > xContext( xTable, uno::UNO_QUERY_THROW ); + xText->insertTextContent( xTextRange, xContext, true ); + + // move the current cursor to the first table cell + uno::Reference< table::XCellRange > xCellRange( xTable, uno::UNO_QUERY_THROW ); + uno::Reference< text::XText> xFirstCellText( xCellRange->getCellByPosition(0, 0), uno::UNO_QUERY_THROW ); + word::getXTextViewCursor( mxDocument )->gotoRange( xFirstCellText->getStart(), sal_False ); + uno::Reference< word::XTable > xVBATable( new SwVbaTable( mxParent, mxContext, pVbaRange->getDocument(), xTable ) ); return xVBATable; } -uno::Reference< container::XEnumeration > SAL_CALL +uno::Reference< container::XEnumeration > SAL_CALL SwVbaTables::createEnumeration() throw (uno::RuntimeException) { return new TableEnumerationImpl( mxParent, mxContext, mxDocument, m_xIndexAccess ); } -// ScVbaCollectionBaseImpl -uno::Any +// ScVbaCollectionBaseImpl +uno::Any SwVbaTables::createCollectionObject( const uno::Any& aSource ) { return lcl_createTable( mxParent, mxContext, mxDocument, aSource ); -} +} // XHelperInterface -rtl::OUString& +rtl::OUString& SwVbaTables::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaTables") ); - return sImplName; + return sImplName; } // XEnumerationAccess -uno::Type SAL_CALL +uno::Type SAL_CALL SwVbaTables::getElementType() throw (uno::RuntimeException) { - return word::XTable::static_type(0); + return word::XTable::static_type(0); } -uno::Sequence<rtl::OUString> +uno::Sequence<rtl::OUString> SwVbaTables::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -129,3 +217,4 @@ SwVbaTables::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatables.hxx b/sw/source/ui/vba/vbatables.hxx index 79df2f90b7..00e1a9037d 100644 --- a/sw/source/ui/vba/vbatables.hxx +++ b/sw/source/ui/vba/vbatables.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #ifndef SW_VBA_TABLES_HXX #define SW_VBA_TABLES_HXX @@ -26,3 +27,5 @@ public: }; #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatablesofcontents.cxx b/sw/source/ui/vba/vbatablesofcontents.cxx new file mode 100644 index 0000000000..0401e8add5 --- /dev/null +++ b/sw/source/ui/vba/vbatablesofcontents.cxx @@ -0,0 +1,195 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbatablesofcontents.hxx" +#include "vbatableofcontents.hxx" +#include "vbarange.hxx" +#include <com/sun/star/text/XDocumentIndexesSupplier.hpp> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XEnumerationAccess > TableOfContentsCollectionHelper_Base; +typedef std::vector< uno::Reference< text::XDocumentIndex > > XTocVec; + +class TablesOfContentsEnumWrapper : public EnumerationHelper_BASE +{ + uno::Reference< container::XIndexAccess > mxIndexAccess; + sal_Int32 nIndex; + +public: + TablesOfContentsEnumWrapper( const uno::Reference< container::XIndexAccess >& xIndexAccess ) : mxIndexAccess( xIndexAccess ), nIndex( 0 ) + { + } + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { + return ( nIndex < mxIndexAccess->getCount() ); + } + + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if( nIndex < mxIndexAccess->getCount() ) + { + return mxIndexAccess->getByIndex( nIndex++ ); + } + throw container::NoSuchElementException(); + } +}; + +class TableOfContentsCollectionHelper : public TableOfContentsCollectionHelper_Base +{ +private: + uno::Reference< XHelperInterface > mxParent; + uno::Reference< uno::XComponentContext > mxContext; + uno::Reference< text::XTextDocument > mxTextDocument; + XTocVec maToc; + +public: + TableOfContentsCollectionHelper( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextDocument >& xDoc ) throw ( uno::RuntimeException ): mxParent( xParent ), mxContext( xContext ), mxTextDocument( xDoc ) + { + uno::Reference< text::XDocumentIndexesSupplier > xDocIndexSupp( mxTextDocument, uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xDocIndexes = xDocIndexSupp->getDocumentIndexes(); + sal_Int32 nCount = xDocIndexes->getCount(); + for( sal_Int32 i = 0; i < nCount; i++ ) + { + uno::Reference< text::XDocumentIndex > xToc( xDocIndexes->getByIndex(i), uno::UNO_QUERY_THROW ); + if( xToc->getServiceName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.ContentIndex")) ) + { + maToc.push_back( xToc ); + } + } + } + + virtual ~TableOfContentsCollectionHelper() {} + + virtual sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) + { + return maToc.size(); + } + virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( Index < 0 || Index >= getCount() ) + throw lang::IndexOutOfBoundsException(); + + uno::Reference< text::XDocumentIndex > xToc( maToc[Index], uno::UNO_QUERY_THROW ); + return uno::makeAny( uno::Reference< word::XTableOfContents >( new SwVbaTableOfContents( mxParent, mxContext, mxTextDocument, xToc ) ) ); + } + virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) + { + return word::XTableOfContents::static_type(0); + } + virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) + { + return sal_True; + } + // XEnumerationAccess + virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException) + { + return new TablesOfContentsEnumWrapper( this ); + } +}; + +SwVbaTablesOfContents::SwVbaTablesOfContents( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextDocument >& xDoc ) throw (uno::RuntimeException) : SwVbaTablesOfContents_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new TableOfContentsCollectionHelper( xParent, xContext, xDoc ) ) ), mxTextDocument( xDoc ) +{ +} + +uno::Reference< word::XTableOfContents > SAL_CALL +SwVbaTablesOfContents::Add( const uno::Reference< word::XRange >& Range, const uno::Any& /*UseHeadingStyles*/, const uno::Any& /*UpperHeadingLevel*/, const uno::Any& LowerHeadingLevel, const uno::Any& UseFields, const uno::Any& /*TableID*/, const uno::Any& /*RightAlignPageNumbers*/, const uno::Any& /*IncludePageNumbers*/, const uno::Any& /*AddedStyles*/, const uno::Any& /*UseHyperlinks*/, const uno::Any& /*HidePageNumbersInWeb*/, const uno::Any& /*UseOutlineLevels*/ ) throw (uno::RuntimeException) +{ + uno::Reference< lang::XMultiServiceFactory > xDocMSF( mxTextDocument, uno::UNO_QUERY_THROW ); + uno::Reference< text::XDocumentIndex > xDocumentIndex( xDocMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.ContentIndex")) ), uno::UNO_QUERY_THROW ); + + uno::Reference< beans::XPropertySet > xTocProps( xDocumentIndex, uno::UNO_QUERY_THROW ); + sal_Bool isProtected = sal_False; + xTocProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsProtected") ), uno::makeAny( isProtected ) ); + + uno::Reference< word::XTableOfContents > xToc( new SwVbaTableOfContents( this, mxContext, mxTextDocument, xDocumentIndex ) ); + + sal_Int32 nLowerHeadingLevel = 9; + if( LowerHeadingLevel.hasValue() ) + LowerHeadingLevel >>= nLowerHeadingLevel; + xToc->setLowerHeadingLevel( nLowerHeadingLevel ); + + sal_Bool bUseFields = sal_False; + if( UseFields.hasValue() ) + UseFields >>= bUseFields; + xToc->setUseFields( bUseFields ); + + sal_Bool bUseOutlineLevels = sal_True; + xToc->setUseOutlineLevels( bUseOutlineLevels ); + + SwVbaRange* pVbaRange = dynamic_cast<SwVbaRange*>( Range.get() ); + if( !pVbaRange ) + throw uno::RuntimeException(); + + uno::Reference< text::XTextRange > xTextRange = pVbaRange->getXTextRange(); + uno::Reference< text::XText > xText = pVbaRange->getXText(); + uno::Reference< text::XTextContent > xTextContent( xDocumentIndex, uno::UNO_QUERY_THROW ); + xText->insertTextContent( xTextRange, xTextContent, sal_False ); + xToc->Update(); + + return xToc; +} + +// XEnumerationAccess +uno::Type +SwVbaTablesOfContents::getElementType() throw (uno::RuntimeException) +{ + return word::XTableOfContents::static_type(0); +} +uno::Reference< container::XEnumeration > +SwVbaTablesOfContents::createEnumeration() throw (uno::RuntimeException) +{ + return new TablesOfContentsEnumWrapper( m_xIndexAccess ); +} + +uno::Any +SwVbaTablesOfContents::createCollectionObject( const uno::Any& aSource ) +{ + return aSource; +} + +rtl::OUString& +SwVbaTablesOfContents::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaTablesOfContents") ); + return sImplName; +} + +uno::Sequence<rtl::OUString> +SwVbaTablesOfContents::getServiceNames() +{ + static uno::Sequence< rtl::OUString > sNames; + if ( sNames.getLength() == 0 ) + { + sNames.realloc( 1 ); + sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.TablesOfContents") ); + } + return sNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatablesofcontents.hxx b/sw/source/ui/vba/vbatablesofcontents.hxx new file mode 100644 index 0000000000..04b30d0b12 --- /dev/null +++ b/sw/source/ui/vba/vbatablesofcontents.hxx @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_TABLESOFCONTENTS_HXX +#define SW_VBA_TABLESOFCONTENTS_HXX + +#include <vbahelper/vbacollectionimpl.hxx> +#include <ooo/vba/word/XTablesOfContents.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <com/sun/star/text/XTextDocument.hpp> +#include <ooo/vba/word/XTableOfContents.hpp> +#include <ooo/vba/word/XRange.hpp> + +typedef CollTestImplHelper< ooo::vba::word::XTablesOfContents > SwVbaTablesOfContents_BASE; + +class SwVbaTablesOfContents : public SwVbaTablesOfContents_BASE +{ +private: + css::uno::Reference< css::text::XTextDocument > mxTextDocument; + +public: + SwVbaTablesOfContents( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::text::XTextDocument >& xDoc ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaTablesOfContents() {} + + // Methods + virtual css::uno::Reference< ::ooo::vba::word::XTableOfContents > SAL_CALL Add( const css::uno::Reference< ::ooo::vba::word::XRange >& Range, const css::uno::Any& UseHeadingStyles, const css::uno::Any& UpperHeadingLevel, const css::uno::Any& LowerHeadingLevel, const css::uno::Any& UseFields, const css::uno::Any& TableID, const css::uno::Any& RightAlignPageNumbers, const css::uno::Any& IncludePageNumbers, const css::uno::Any& AddedStyles, const css::uno::Any& UseHyperlinks, const css::uno::Any& HidePageNumbersInWeb, const css::uno::Any& UseOutlineLevels ) throw (css::uno::RuntimeException); + + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + + // SwVbaTablesOfContents_BASE + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif /* SW_VBA_TABLESOFCONTENTS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatabstop.cxx b/sw/source/ui/vba/vbatabstop.cxx new file mode 100644 index 0000000000..4ed72202bc --- /dev/null +++ b/sw/source/ui/vba/vbatabstop.cxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbatabstop.hxx" +#include <vbahelper/vbahelper.hxx> +#include <tools/diagnose_ex.h> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +SwVbaTabStop::SwVbaTabStop( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< beans::XPropertySet >& xParaProps, const style::TabStop& aTabStop ) throw ( uno::RuntimeException ) : SwVbaTabStop_BASE( rParent, rContext ), mxParaProps( xParaProps ), maTabStop( aTabStop ) +{ +} + +SwVbaTabStop::~SwVbaTabStop() +{ +} + +rtl::OUString& +SwVbaTabStop::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaTabStop") ); + return sImplName; +} + +uno::Sequence< rtl::OUString > +SwVbaTabStop::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.TabStop" ) ); + } + return aServiceNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatabstop.hxx b/sw/source/ui/vba/vbatabstop.hxx new file mode 100644 index 0000000000..0de7c0d7e4 --- /dev/null +++ b/sw/source/ui/vba/vbatabstop.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_TABSTOP_HXX +#define SW_VBA_TABSTOP_HXX + +#include <ooo/vba/word/XTabStop.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/style/TabStop.hpp> + +typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XTabStop > SwVbaTabStop_BASE; + +class SwVbaTabStop : public SwVbaTabStop_BASE +{ +private: + css::uno::Reference< css::beans::XPropertySet > mxParaProps; + css::style::TabStop maTabStop; + +public: + SwVbaTabStop( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::beans::XPropertySet >& xParaProps, const css::style::TabStop& aTabStop ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaTabStop(); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif /* SW_VBA_TABSTOP_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatabstops.cxx b/sw/source/ui/vba/vbatabstops.cxx new file mode 100644 index 0000000000..a8b0abd5cb --- /dev/null +++ b/sw/source/ui/vba/vbatabstops.cxx @@ -0,0 +1,280 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#include "vbatabstops.hxx" +#include "vbatabstop.hxx" +#include <com/sun/star/style/TabAlign.hpp> +#include <ooo/vba/word/WdTabLeader.hpp> +#include <ooo/vba/word/WdTabAlignment.hpp> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; + +uno::Sequence< style::TabStop > lcl_getTabStops( const uno::Reference< beans::XPropertySet >& xParaProps ) throw (uno::RuntimeException) +{ + uno::Sequence< style::TabStop > aSeq; + xParaProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaTabStops") ) ) >>= aSeq; + return aSeq; +} + +void lcl_setTabStops( const uno::Reference< beans::XPropertySet >& xParaProps, const uno::Sequence< style::TabStop >& aSeq ) throw (uno::RuntimeException) +{ + xParaProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParaTabStops") ), uno::makeAny( aSeq ) ); +} + +typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XEnumerationAccess > TabStopCollectionHelper_Base; + +class TabStopsEnumWrapper : public EnumerationHelper_BASE +{ + uno::Reference< container::XIndexAccess > mxIndexAccess; + sal_Int32 nIndex; + +public: + TabStopsEnumWrapper( const uno::Reference< container::XIndexAccess >& xIndexAccess ) : mxIndexAccess( xIndexAccess ), nIndex( 0 ) + { + } + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException) + { + return ( nIndex < mxIndexAccess->getCount() ); + } + + virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) + { + if( nIndex < mxIndexAccess->getCount() ) + { + return mxIndexAccess->getByIndex( nIndex++ ); + } + throw container::NoSuchElementException(); + } +}; + +class TabStopCollectionHelper : public TabStopCollectionHelper_Base +{ +private: + uno::Reference< XHelperInterface > mxParent; + uno::Reference< uno::XComponentContext > mxContext; + uno::Reference< beans::XPropertySet > mxParaProps; + uno::Sequence< style::TabStop > maTabStops; + +public: + TabStopCollectionHelper( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::beans::XPropertySet >& xParaProps ) throw ( css::uno::RuntimeException ): mxParent( xParent ), mxContext( xContext ), mxParaProps( xParaProps ) + { + maTabStops = lcl_getTabStops( xParaProps ); + } + + virtual ~TabStopCollectionHelper() {} + + virtual sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) + { + return maTabStops.getLength(); + } + virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) + { + if ( Index < 0 || Index >= getCount() ) + throw css::lang::IndexOutOfBoundsException(); + + const style::TabStop* pTabs = maTabStops.getConstArray(); + return uno::makeAny( uno::Reference< word::XTabStop >( new SwVbaTabStop( mxParent, mxContext, mxParaProps, pTabs[ Index ] ) ) ); + } + virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) + { + return word::XTabStop::static_type(0); + } + virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) + { + return sal_True; + } + // XEnumerationAccess + virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException) + { + return new TabStopsEnumWrapper( this ); + } +}; + +SwVbaTabStops::SwVbaTabStops( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& xParaProps ) throw (uno::RuntimeException) : SwVbaTabStops_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( new TabStopCollectionHelper( xParent, xContext, xParaProps ) ) ), mxParaProps( xParaProps ) +{ +} + +uno::Reference< word::XTabStop > SAL_CALL SwVbaTabStops::Add( float Position, const uno::Any& Alignment, const uno::Any& Leader ) throw (uno::RuntimeException) +{ + sal_Int32 nPosition = Millimeter::getInHundredthsOfOneMillimeter( Position ); + + style::TabAlign nAlign = style::TabAlign_LEFT; + if( Alignment.hasValue() ) + { + sal_Int32 wdAlign = word::WdTabAlignment::wdAlignTabLeft; + Alignment >>= wdAlign; + switch( wdAlign ) + { + case word::WdTabAlignment::wdAlignTabLeft: + { + nAlign = style::TabAlign_LEFT; + break; + } + case word::WdTabAlignment::wdAlignTabRight: + { + nAlign = style::TabAlign_RIGHT; + break; + } + case word::WdTabAlignment::wdAlignTabCenter: + { + nAlign = style::TabAlign_CENTER; + break; + } + case word::WdTabAlignment::wdAlignTabDecimal: + { + nAlign = style::TabAlign_DECIMAL; + break; + } + case word::WdTabAlignment::wdAlignTabBar: + case word::WdTabAlignment::wdAlignTabList: + { + DebugHelper::exception( SbERR_NOT_IMPLEMENTED, rtl::OUString() ); + break; + } + default: + { + //left + } + } + } + + sal_Char cLeader = ' '; // default is space + if( Leader.hasValue() ) + { + sal_Int32 wdLeader = word::WdTabLeader::wdTabLeaderSpaces; + Leader >>= wdLeader; + switch( wdLeader ) + { + case word::WdTabLeader::wdTabLeaderSpaces: + { + cLeader = ' '; + break; + } + case word::WdTabLeader::wdTabLeaderMiddleDot: + { + cLeader = 183; + break; + } + case word::WdTabLeader::wdTabLeaderDots: + { + cLeader = '.'; + break; + } + case word::WdTabLeader::wdTabLeaderDashes: + case word::WdTabLeader::wdTabLeaderHeavy: + case word::WdTabLeader::wdTabLeaderLines: + { + cLeader = '_'; + break; + } + default: + { + //left + } + } + } + + sal_Char cDecimal = '.'; // default value + + style::TabStop aTab; + aTab.Position = nPosition; + aTab.Alignment = nAlign; + aTab.DecimalChar = cDecimal; + aTab.FillChar = cLeader; + + uno::Sequence< style::TabStop > aOldTabs = lcl_getTabStops( mxParaProps ); + sal_Bool bOverWriter = sal_False; + + sal_Int32 nTabs = aOldTabs.getLength(); + uno::Sequence< style::TabStop > aNewTabs( nTabs + 1 ); + + style::TabStop* pOldTab = aOldTabs.getArray(); + style::TabStop* pNewTab = aNewTabs.getArray(); + pNewTab[0] = aTab; + for( sal_Int32 nIndex = 0; nIndex < nTabs && !bOverWriter; nIndex++ ) + { + if( pOldTab[nIndex].Position == nPosition ) + { + bOverWriter = sal_True; + pOldTab[nIndex] = aTab; + break; + } + pNewTab[ nIndex+1 ] = pOldTab[ nIndex ]; + } + if( bOverWriter ) + lcl_setTabStops( mxParaProps, aOldTabs ); + else + lcl_setTabStops( mxParaProps, aNewTabs ); + + return uno::Reference< word::XTabStop >( new SwVbaTabStop( this, mxContext, mxParaProps, aTab ) ); +} + +void SAL_CALL SwVbaTabStops::ClearAll() throw (uno::RuntimeException) +{ + uno::Sequence< style::TabStop > aSeq; + lcl_setTabStops( mxParaProps, aSeq ); +} + +// XEnumerationAccess +uno::Type +SwVbaTabStops::getElementType() throw (uno::RuntimeException) +{ + return word::XTabStop::static_type(0); +} +uno::Reference< container::XEnumeration > +SwVbaTabStops::createEnumeration() throw (uno::RuntimeException) +{ + return new TabStopsEnumWrapper( m_xIndexAccess ); +} + +uno::Any +SwVbaTabStops::createCollectionObject( const css::uno::Any& aSource ) +{ + return aSource; +} + +rtl::OUString& +SwVbaTabStops::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaTabStops") ); + return sImplName; +} + +css::uno::Sequence<rtl::OUString> +SwVbaTabStops::getServiceNames() +{ + static uno::Sequence< rtl::OUString > sNames; + if ( sNames.getLength() == 0 ) + { + sNames.realloc( 1 ); + sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.TabStops") ); + } + return sNames; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatabstops.hxx b/sw/source/ui/vba/vbatabstops.hxx new file mode 100644 index 0000000000..f5b000131e --- /dev/null +++ b/sw/source/ui/vba/vbatabstops.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * 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. + * + ************************************************************************/ +#ifndef SW_VBA_TABSTOPS_HXX +#define SW_VBA_TABSTOPS_HXX + +#include <vbahelper/vbacollectionimpl.hxx> +#include <ooo/vba/word/XTabStops.hpp> +#include <ooo/vba/word/XTabStop.hpp> +#include <com/sun/star/container/XEnumerationAccess.hpp> +#include <com/sun/star/container/XIndexAccess.hpp> +#include <vbahelper/vbahelperinterface.hxx> + +typedef CollTestImplHelper< ooo::vba::word::XTabStops > SwVbaTabStops_BASE; + +class SwVbaTabStops : public SwVbaTabStops_BASE +{ +private: + css::uno::Reference< css::beans::XPropertySet > mxParaProps; + +public: + SwVbaTabStops( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::beans::XPropertySet >& xParaProps ) throw ( css::uno::RuntimeException ); + virtual ~SwVbaTabStops() {} + + // Methods + virtual css::uno::Reference< ::ooo::vba::word::XTabStop > SAL_CALL Add( float Position, const css::uno::Any& Alignment, const css::uno::Any& Leader ) throw (css::uno::RuntimeException); + virtual void SAL_CALL ClearAll( ) throw (css::uno::RuntimeException); + + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + + // SwVbaTabStops_BASE + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif /* SW_VBA_TABSTOPS_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatemplate.cxx b/sw/source/ui/vba/vbatemplate.cxx index 71dc7acd85..d63e003786 100644 --- a/sw/source/ui/vba/vbatemplate.cxx +++ b/sw/source/ui/vba/vbatemplate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,12 +31,35 @@ #include "vbaautotextentry.hxx" #include <comphelper/processfactory.hxx> #include <com/sun/star/text/XAutoTextContainer.hpp> +#include <tools/urlobj.hxx> +#include <osl/file.hxx> using namespace ::ooo::vba; using namespace ::com::sun::star; -SwVbaTemplate::SwVbaTemplate( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const rtl::OUString& rName ) - : SwVbaTemplate_BASE( rParent, rContext ), mxModel( rModel ), msName( rName ) +String lcl_CheckGroupName( const String& rGroupName ) +{ + String sRet; + //group name should contain only A-Z and a-z and spaces + for( xub_StrLen i = 0; i < rGroupName.Len(); i++ ) + { + sal_Unicode cChar = rGroupName.GetChar(i); + if( (cChar >= 'A' && cChar <= 'Z') || + (cChar >= 'a' && cChar <= 'z') || + (cChar >= '0' && cChar <= '9') || + cChar == '_' || cChar == 0x20 ) + { + sRet += cChar; + } + } + sRet.EraseLeadingChars(); + sRet.EraseTrailingChars(); + return sRet; +} + + +SwVbaTemplate::SwVbaTemplate( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const rtl::OUString& rFullUrl ) + : SwVbaTemplate_BASE( rParent, rContext ), mxModel( rModel ), msFullUrl( rFullUrl ) { } @@ -47,7 +71,27 @@ SwVbaTemplate::~SwVbaTemplate() rtl::OUString SwVbaTemplate::getName() throw ( css::uno::RuntimeException ) { - return msName; + rtl::OUString sName; + if( msFullUrl.getLength() ) + { + INetURLObject aURL( msFullUrl ); + ::osl::File::getSystemPathFromFileURL( aURL.GetLastName(), sName ); + } + return sName; +} + +rtl::OUString +SwVbaTemplate::getPath() throw ( css::uno::RuntimeException ) +{ + rtl::OUString sPath; + if( msFullUrl.getLength() ) + { + INetURLObject aURL( msFullUrl ); + rtl::OUString sURL( aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); + sURL = sURL.copy( 0, sURL.getLength() - aURL.GetLastName().getLength() - 1 ); + ::osl::File::getSystemPathFromFileURL( sURL, sPath ); + } + return sPath; } uno::Any SAL_CALL @@ -58,22 +102,22 @@ SwVbaTemplate::AutoTextEntries( const uno::Any& index ) throw (uno::RuntimeExcep // the default template is "Normal.dot" in Word. rtl::OUString sGroup( RTL_CONSTASCII_USTRINGPARAM("Normal") ); - sal_Int32 nIndex = msName.lastIndexOf( sal_Unicode('.') ); + rtl::OUString sName = getName(); + sal_Int32 nIndex = sName.lastIndexOf( sal_Unicode('.') ); if( nIndex > 0 ) { - sGroup = msName.copy( 0, msName.lastIndexOf( sal_Unicode('.') ) ); - // OSL_TRACE("SwVbaTemplate::AutoTextEntries: %s", rtl::OUStringToOString( sGroup, RTL_TEXTENCODING_UTF8 ).getStr() ); + sGroup = sName.copy( 0, sName.lastIndexOf( sal_Unicode('.') ) ); } - + String sNewGroup = lcl_CheckGroupName( sGroup ); + uno::Reference< container::XIndexAccess > xGroup; - if( xAutoTextContainer->hasByName( sGroup ) ) + if( xAutoTextContainer->hasByName( sNewGroup ) ) { - xGroup.set( xAutoTextContainer->getByName( sGroup ), uno::UNO_QUERY_THROW ); + xGroup.set( xAutoTextContainer->getByName( sNewGroup ), uno::UNO_QUERY_THROW ); } else { throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Auto Text Entry doesn't exist") ), uno::Reference< uno::XInterface >() ); - //xGroup.set( xAutoTextContainer->insertNewByName( sGroup ), uno::UNO_QUERY_THROW ); } uno::Reference< XCollection > xCol( new SwVbaAutoTextEntries( this, mxContext, xGroup ) ); @@ -101,3 +145,4 @@ SwVbaTemplate::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbatemplate.hxx b/sw/source/ui/vba/vbatemplate.hxx index 4e33599604..2bfe75d2d3 100644 --- a/sw/source/ui/vba/vbatemplate.hxx +++ b/sw/source/ui/vba/vbatemplate.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,7 +37,7 @@ class SwVbaTemplate : public SwVbaTemplate_BASE { private: css::uno::Reference< css::frame::XModel > mxModel; - rtl::OUString msName; + rtl::OUString msFullUrl; public: SwVbaTemplate( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const rtl::OUString& ); @@ -44,9 +45,12 @@ public: // XTemplate virtual rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); + virtual rtl::OUString SAL_CALL getPath() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL AutoTextEntries( const css::uno::Any& index ) throw (css::uno::RuntimeException); // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_TEMPLATE_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbavariable.cxx b/sw/source/ui/vba/vbavariable.cxx index 1799c7b505..e10d873bdb 100644 --- a/sw/source/ui/vba/vbavariable.cxx +++ b/sw/source/ui/vba/vbavariable.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -103,3 +104,4 @@ SwVbaVariable::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbavariable.hxx b/sw/source/ui/vba/vbavariable.hxx index 868597915d..f701c66a3a 100644 --- a/sw/source/ui/vba/vbavariable.hxx +++ b/sw/source/ui/vba/vbavariable.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,3 +58,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_VARIABLE_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbavariables.cxx b/sw/source/ui/vba/vbavariables.cxx index 85b64f6542..c6a4ef2edc 100644 --- a/sw/source/ui/vba/vbavariables.cxx +++ b/sw/source/ui/vba/vbavariables.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -100,3 +101,5 @@ SwVbaVariables::getServiceNames() } return sNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbavariables.hxx b/sw/source/ui/vba/vbavariables.hxx index 739c875571..5b562b776f 100644 --- a/sw/source/ui/vba/vbavariables.hxx +++ b/sw/source/ui/vba/vbavariables.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -59,3 +60,5 @@ public: }; #endif /* SW_VBA_VARIABLES_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaview.cxx b/sw/source/ui/vba/vbaview.cxx index 2cf6194454..7ce8f8818e 100644 --- a/sw/source/ui/vba/vbaview.cxx +++ b/sw/source/ui/vba/vbaview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -86,32 +87,32 @@ SwVbaView::getSeekView() throw (css::uno::RuntimeException) } uno::Reference< lang::XServiceInfo > xServiceInfo( xCurrentText, uno::UNO_QUERY_THROW ); rtl::OUString aImplName = xServiceInfo->getImplementationName(); - if( aImplName.equalsAscii("SwXBodyText") ) + if( aImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SwXBodyText")) ) { return word::WdSeekView::wdSeekMainDocument; } - else if( aImplName.equalsAscii("SwXHeadFootText") ) + else if( aImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SwXHeadFootText")) ) { - if( HeaderFooterHelper::isHeader( mxModel, xCurrentText ) ) + if( HeaderFooterHelper::isHeader( mxModel ) ) { - if( HeaderFooterHelper::isFirstPageHeader( mxModel, xCurrentText ) ) + if( HeaderFooterHelper::isFirstPageHeader( mxModel ) ) return word::WdSeekView::wdSeekFirstPageHeader; - else if( HeaderFooterHelper::isEvenPagesHeader( mxModel, xCurrentText ) ) + else if( HeaderFooterHelper::isEvenPagesHeader( mxModel ) ) return word::WdSeekView::wdSeekEvenPagesHeader; else return word::WdSeekView::wdSeekPrimaryHeader; } else { - if( HeaderFooterHelper::isFirstPageFooter( mxModel, xCurrentText ) ) + if( HeaderFooterHelper::isFirstPageFooter( mxModel ) ) return word::WdSeekView::wdSeekFirstPageFooter; - else if( HeaderFooterHelper::isEvenPagesFooter( mxModel, xCurrentText ) ) + else if( HeaderFooterHelper::isEvenPagesFooter( mxModel ) ) return word::WdSeekView::wdSeekEvenPagesFooter; else return word::WdSeekView::wdSeekPrimaryFooter; } } - else if( aImplName.equalsAscii("SwXFootnote") ) + else if( aImplName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SwXFootnote")) ) { if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.Endnote") ) ) ) return word::WdSeekView::wdSeekEndnotes; @@ -129,9 +130,7 @@ SwVbaView::setSeekView( ::sal_Int32 _seekview ) throw (css::uno::RuntimeExceptio // document, so we can jump back to this position, if the macro sets // the ViewMode back to wdSeekMainDocument - // if( _seekview == getSeekView() ) - // return; - + word::gotoSelectedObjectAnchor( mxModel ); switch( _seekview ) { case word::WdSeekView::wdSeekFirstPageFooter: @@ -181,7 +180,7 @@ SwVbaView::setSeekView( ::sal_Int32 _seekview ) throw (css::uno::RuntimeExceptio { uno::Reference< text::XTextDocument > xTextDocument( mxModel, uno::UNO_QUERY_THROW ); uno::Reference< text::XText > xText = xTextDocument->getText(); - mxViewCursor->gotoRange( getFirstObjectPosition( xText ), sal_False ); + mxViewCursor->gotoRange( word::getFirstObjectPosition( xText ), sal_False ); break; } } @@ -314,7 +313,7 @@ uno::Reference< text::XTextRange > SwVbaView::getHFTextRange( sal_Int32 nType ) uno::Reference< beans::XPropertySet > xCursorProps( mxViewCursor, uno::UNO_QUERY_THROW ); rtl::OUString aPageStyleName; xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageStyleName"))) >>= aPageStyleName; - if( aPageStyleName.equalsAscii("First Page") ) + if( aPageStyleName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("First Page")) ) { // go to the beginning of where the next style is used sal_Bool hasNextPage = sal_False; @@ -376,28 +375,7 @@ uno::Reference< text::XTextRange > SwVbaView::getHFTextRange( sal_Int32 nType ) { DebugHelper::exception( SbERR_INTERNAL_ERROR, rtl::OUString() ); } - uno::Reference< text::XTextRange > xTextRange = getFirstObjectPosition( xText ); - return xTextRange; -} - -uno::Reference< text::XTextRange > SwVbaView::getFirstObjectPosition( const uno::Reference< text::XText >& xText ) throw (uno::RuntimeException) -{ - // if the first object is table, get the position of first cell - uno::Reference< text::XTextRange > xTextRange; - uno::Reference< container::XEnumerationAccess > xParaAccess( xText, uno::UNO_QUERY_THROW ); - uno::Reference< container::XEnumeration> xParaEnum = xParaAccess->createEnumeration(); - if( xParaEnum->hasMoreElements() ) - { - uno::Reference< lang::XServiceInfo > xServiceInfo( xParaEnum->nextElement(), uno::UNO_QUERY_THROW ); - if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextTable") ) ) ) - { - uno::Reference< table::XCellRange > xCellRange( xServiceInfo, uno::UNO_QUERY_THROW ); - uno::Reference< text::XText> xFirstCellText( xCellRange->getCellByPosition(0, 0), uno::UNO_QUERY_THROW ); - xTextRange = xFirstCellText->getStart(); - } - } - if( !xTextRange.is() ) - xTextRange = xText->getStart(); + uno::Reference< text::XTextRange > xTextRange = word::getFirstObjectPosition( xText ); return xTextRange; } @@ -420,3 +398,4 @@ SwVbaView::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbaview.hxx b/sw/source/ui/vba/vbaview.hxx index ebb89ac700..8131a8fad6 100644 --- a/sw/source/ui/vba/vbaview.hxx +++ b/sw/source/ui/vba/vbaview.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -66,3 +67,5 @@ public: virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif /* SW_VBA_VIEW_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbawindow.cxx b/sw/source/ui/vba/vbawindow.cxx index dc5913aaa1..cb245e9b2a 100644 --- a/sw/source/ui/vba/vbawindow.cxx +++ b/sw/source/ui/vba/vbawindow.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -25,12 +26,17 @@ * ************************************************************************/ #include <vbahelper/helperdecl.hxx> +#include <ooo/vba/word/WdWindowState.hpp> +#include <vcl/wrkwin.hxx> + #include "vbawindow.hxx" #include "vbaglobals.hxx" #include "vbadocument.hxx" #include "vbaview.hxx" #include "vbapanes.hxx" #include "vbapane.hxx" +#include "wordvbahelper.hxx" +#include <view.hxx> using namespace ::com::sun::star; using namespace ::ooo::vba; @@ -56,10 +62,10 @@ SwVbaWindow::Close( const uno::Any& SaveChanges, const uno::Any& RouteDocument ) document.Close(SaveChanges, FileName, RouteDocument ); } -uno::Any SAL_CALL +uno::Any SAL_CALL SwVbaWindow::getView() throw (uno::RuntimeException) { - return uno::makeAny( uno::Reference< word::XView >( new SwVbaView( this, mxContext, m_xModel ) ) ); + return uno::makeAny( uno::Reference< word::XView >( new SwVbaView( this, mxContext, m_xModel ) ) ); } void SAL_CALL SwVbaWindow::setView( const uno::Any& _view ) throw (uno::RuntimeException) @@ -69,33 +75,71 @@ void SAL_CALL SwVbaWindow::setView( const uno::Any& _view ) throw (uno::RuntimeE { SwVbaView view( this, mxContext, m_xModel ); view.setType( nType ); - } + } +} + +uno::Any SAL_CALL +SwVbaWindow::getWindowState() throw (uno::RuntimeException) +{ + sal_Int32 nwindowState = word::WdWindowState::wdWindowStateNormal; + SwView* pView = word::getView( m_xModel ); + SfxViewFrame* pViewFrame = pView -> GetViewFrame(); + WorkWindow* pWork = (WorkWindow*) pViewFrame->GetFrame().GetSystemWindow(); + if ( pWork ) + { + if ( pWork -> IsMaximized()) + nwindowState = word::WdWindowState::wdWindowStateMaximize; + else if (pWork -> IsMinimized()) + nwindowState = word::WdWindowState::wdWindowStateMinimize; + } + return uno::makeAny( nwindowState ); } -uno::Any SAL_CALL +void SAL_CALL +SwVbaWindow::setWindowState( const uno::Any& _windowstate ) throw (uno::RuntimeException) +{ + sal_Int32 nwindowState = word::WdWindowState::wdWindowStateMaximize; + _windowstate >>= nwindowState; + SwView* pView = word::getView( m_xModel ); + SfxViewFrame* pViewFrame = pView -> GetViewFrame(); + WorkWindow* pWork = (WorkWindow*) pViewFrame->GetFrame().GetSystemWindow(); + if ( pWork ) + { + if ( nwindowState == word::WdWindowState::wdWindowStateMaximize ) + pWork -> Maximize(); + else if (nwindowState == word::WdWindowState::wdWindowStateMinimize) + pWork -> Minimize(); + else if (nwindowState == word::WdWindowState::wdWindowStateNormal) + pWork -> Restore(); + else + throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Invalid Parameter" ) ), uno::Reference< uno::XInterface >() ); + } +} + +uno::Any SAL_CALL SwVbaWindow::Panes( const uno::Any& aIndex ) throw (uno::RuntimeException) { uno::Reference< XCollection > xPanes( new SwVbaPanes( this, mxContext, m_xModel ) ); if( aIndex.getValueTypeClass() == uno::TypeClass_VOID ) return uno::makeAny( xPanes ); - return uno::Any( xPanes->Item( aIndex, uno::Any() ) ); + return uno::Any( xPanes->Item( aIndex, uno::Any() ) ); } -uno::Any SAL_CALL +uno::Any SAL_CALL SwVbaWindow::ActivePane() throw (uno::RuntimeException) { - return uno::makeAny( uno::Reference< word::XPane >( new SwVbaPane( this, mxContext, m_xModel ) ) ); + return uno::makeAny( uno::Reference< word::XPane >( new SwVbaPane( this, mxContext, m_xModel ) ) ); } -rtl::OUString& +rtl::OUString& SwVbaWindow::getServiceImplName() { static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaWindow") ); return sImplName; } -uno::Sequence< rtl::OUString > +uno::Sequence< rtl::OUString > SwVbaWindow::getServiceNames() { static uno::Sequence< rtl::OUString > aServiceNames; @@ -106,3 +150,5 @@ SwVbaWindow::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbawindow.hxx b/sw/source/ui/vba/vbawindow.hxx index 1ef1ff9141..6490b48094 100644 --- a/sw/source/ui/vba/vbawindow.hxx +++ b/sw/source/ui/vba/vbawindow.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,6 +45,8 @@ public: // Attributes virtual css::uno::Any SAL_CALL getView() throw (css::uno::RuntimeException); virtual void SAL_CALL setView( const css::uno::Any& _view ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getWindowState() throw (css::uno::RuntimeException); + virtual void SAL_CALL setWindowState( const css::uno::Any& _windowstate ) throw (css::uno::RuntimeException); // Methods virtual void SAL_CALL Activate( ) throw (css::uno::RuntimeException); virtual void SAL_CALL Close( const css::uno::Any& SaveChanges, const css::uno::Any& RouteDocument ) throw (css::uno::RuntimeException); @@ -55,3 +58,5 @@ public: }; #endif //SW_VBA_WINDOW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbawrapformat.cxx b/sw/source/ui/vba/vbawrapformat.cxx index 84cef6c251..a6c2e7c43a 100644 --- a/sw/source/ui/vba/vbawrapformat.cxx +++ b/sw/source/ui/vba/vbawrapformat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -250,3 +251,4 @@ extern sdecl::ServiceDecl const serviceDecl( } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/vbawrapformat.hxx b/sw/source/ui/vba/vbawrapformat.hxx index 1ee8eb7a4c..024498c8e8 100644 --- a/sw/source/ui/vba/vbawrapformat.hxx +++ b/sw/source/ui/vba/vbawrapformat.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,3 +68,5 @@ public: }; #endif//SW_VBA_XWRAPFORMAT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/wordvbahelper.cxx b/sw/source/ui/vba/wordvbahelper.cxx index e489b0b69d..aa63b8b217 100644 --- a/sw/source/ui/vba/wordvbahelper.cxx +++ b/sw/source/ui/vba/wordvbahelper.cxx @@ -1,7 +1,8 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * 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 @@ -29,11 +30,16 @@ #include <comphelper/processfactory.hxx> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <com/sun/star/text/XTextTable.hpp> +#include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> #include <unotxdoc.hxx> #include <doc.hxx> +#include <view.hxx> using namespace ::com::sun::star; using namespace ::ooo::vba; @@ -47,7 +53,7 @@ namespace vba namespace word { -SwDocShell* getDocShell( const uno::Reference< frame::XModel>& xModel ) +SwDocShell* getDocShell( const uno::Reference< frame::XModel>& xModel ) { uno::Reference< lang::XUnoTunnel > xTunnel( xModel, uno::UNO_QUERY_THROW ); SwXTextDocument* pXDoc = reinterpret_cast< SwXTextDocument * >( sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(SwXTextDocument::getUnoTunnelId()))); @@ -71,8 +77,13 @@ uno::Reference< text::XTextViewCursor > getXTextViewCursor( const uno::Reference uno::Reference< style::XStyle > getCurrentPageStyle( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xCursorProps( getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW ); + return getCurrentPageStyle( xModel, xCursorProps ); +} + +uno::Reference< style::XStyle > getCurrentPageStyle( const uno::Reference< frame::XModel >& xModel, const uno::Reference< beans::XPropertySet >& xProps ) throw (uno::RuntimeException) +{ rtl::OUString aPageStyleName; - xCursorProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageStyleName"))) >>= aPageStyleName; + xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageStyleName"))) >>= aPageStyleName; uno::Reference< style::XStyleFamiliesSupplier > xSytleFamSupp( xModel, uno::UNO_QUERY_THROW ); uno::Reference< container::XNameAccess > xSytleFamNames( xSytleFamSupp->getStyleFamilies(), uno::UNO_QUERY_THROW ); uno::Reference< container::XNameAccess > xPageStyles( xSytleFamNames->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageStyles") ) ), uno::UNO_QUERY_THROW ); @@ -87,6 +98,94 @@ sal_Int32 getPageCount( const uno::Reference< frame::XModel>& xModel ) throw (un return pDocShell ? pDocShell->GetDoc()->GetPageCount() : 0; } +uno::Reference< style::XStyle > getDefaultParagraphStyle( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) +{ + uno::Reference< style::XStyleFamiliesSupplier > xSytleFamSupp( xModel, uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameAccess > xSytleFamNames( xSytleFamSupp->getStyleFamilies(), uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameAccess > xParaStyles( xSytleFamNames->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ParagraphStyles") ) ), uno::UNO_QUERY_THROW ); + uno::Reference< style::XStyle > xStyle( xParaStyles->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") ) ), uno::UNO_QUERY_THROW ); + + return xStyle; +} + +uno::Reference< text::XTextRange > getFirstObjectPosition( const uno::Reference< text::XText >& xText ) throw (uno::RuntimeException) +{ + // if the first object is table, get the position of first cell + uno::Reference< text::XTextRange > xTextRange; + uno::Reference< container::XEnumerationAccess > xParaAccess( xText, uno::UNO_QUERY_THROW ); + uno::Reference< container::XEnumeration> xParaEnum = xParaAccess->createEnumeration(); + if( xParaEnum->hasMoreElements() ) + { + uno::Reference< lang::XServiceInfo > xServiceInfo( xParaEnum->nextElement(), uno::UNO_QUERY_THROW ); + if( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextTable") ) ) ) + { + uno::Reference< table::XCellRange > xCellRange( xServiceInfo, uno::UNO_QUERY_THROW ); + uno::Reference< text::XText> xFirstCellText( xCellRange->getCellByPosition(0, 0), uno::UNO_QUERY_THROW ); + xTextRange = xFirstCellText->getStart(); + } + } + if( !xTextRange.is() ) + xTextRange = xText->getStart(); + return xTextRange; +} + +uno::Reference< text::XText > getCurrentXText( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) +{ + uno::Reference< text::XTextRange > xTextRange; + uno::Reference< text::XTextContent > xTextContent( xModel->getCurrentSelection(), uno::UNO_QUERY ); + if( !xTextContent.is() ) + { + uno::Reference< container::XIndexAccess > xIndexAccess( xModel->getCurrentSelection(), uno::UNO_QUERY ); + if( xIndexAccess.is() ) + { + xTextContent.set( xIndexAccess->getByIndex(0), uno::UNO_QUERY ); + } + } + + if( xTextContent.is() ) + xTextRange.set( xTextContent->getAnchor(), uno::UNO_QUERY ); + + if( !xTextRange.is() ) + xTextRange.set( getXTextViewCursor( xModel ), uno::UNO_QUERY_THROW ); + + uno::Reference< text::XText > xText; + try + { + xText.set( xTextRange->getText(), uno::UNO_QUERY ); + } + catch( uno::RuntimeException& ) + { + //catch exception "no text selection" + } + uno::Reference< beans::XPropertySet > xVCProps( xTextRange, uno::UNO_QUERY_THROW ); + while( xVCProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TextTable") ) ) >>= xTextContent ) + { + xText = xTextContent->getAnchor()->getText(); + xVCProps.set( xText->createTextCursor(), uno::UNO_QUERY_THROW ); + } + + if( !xText.is() ) + throw uno::RuntimeException( rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), uno::Reference< uno::XInterface >() ); + + return xText; +} + +sal_Bool gotoSelectedObjectAnchor( const uno::Reference< frame::XModel>& xModel ) throw (uno::RuntimeException) +{ + sal_Bool isObjectSelected = sal_False; + uno::Reference< text::XTextContent > xTextContent( xModel->getCurrentSelection(), uno::UNO_QUERY ); + if( xTextContent.is() ) + { + uno::Reference< text::XTextRange > xTextRange( xTextContent->getAnchor(), uno::UNO_QUERY_THROW ); + uno::Reference< view::XSelectionSupplier > xSelectSupp( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); + xSelectSupp->select( uno::makeAny( xTextRange ) ); + isObjectSelected = sal_True; + } + return isObjectSelected; +} + } // word -} // } // +} // + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/vba/wordvbahelper.hxx b/sw/source/ui/vba/wordvbahelper.hxx index 489cf25ea3..becdce534a 100644 --- a/sw/source/ui/vba/wordvbahelper.hxx +++ b/sw/source/ui/vba/wordvbahelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,6 +33,8 @@ #include <com/sun/star/text/XTextViewCursor.hpp> #include <com/sun/star/text/XPageCursor.hpp> #include <com/sun/star/style/XStyle.hpp> +#include <com/sun/star/text/XTextTable.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> class SwDocShell; class SwView; @@ -46,9 +49,24 @@ namespace ooo SwView* getView( const css::uno::Reference< css::frame::XModel>& xModel ); css::uno::Reference< css::text::XTextViewCursor > getXTextViewCursor( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException); css::uno::Reference< css::style::XStyle > getCurrentPageStyle( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException); + css::uno::Reference< css::style::XStyle > getCurrentPageStyle( const css::uno::Reference< css::frame::XModel>& xModel, const css::uno::Reference< css::beans::XPropertySet >& xProps ) throw (css::uno::RuntimeException); sal_Int32 getPageCount( const css::uno::Reference< css::frame::XModel>& xModel ) throw (css::uno::RuntimeException); + css::uno::Reference< css::style::XStyle > getDefaultParagraphStyle( const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException); + css::uno::Reference< css::text::XTextRange > getFirstObjectPosition( const css::uno::Reference< css::text::XText >& xText ) throw (css::uno::RuntimeException); + css::uno::Reference< css::text::XText > getCurrentXText( const css::uno::Reference< css::frame::XModel>& xModel ) throw (css::uno::RuntimeException); + sal_Bool gotoSelectedObjectAnchor( const css::uno::Reference< css::frame::XModel>& xModel ) throw (css::uno::RuntimeException); + + enum E_DIRECTION + { + MOVE_LEFT = 1, + MOVE_RIGHT, + MOVE_UP, + MOVE_DOWN + }; } // word } // vba } // ooo #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/web/wdocsh.cxx b/sw/source/ui/web/wdocsh.cxx index 2ecbc40874..b7ec7935ea 100644 --- a/sw/source/ui/web/wdocsh.cxx +++ b/sw/source/ui/web/wdocsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,9 +34,7 @@ #include <svl/srchitem.hxx> #include <sfx2/app.hxx> -#ifndef _SVX_SVXIDS_HRC //autogen #include <svx/svxids.hrc> -#endif #include <sot/clsids.hxx> #include <sfx2/objface.hxx> @@ -64,20 +63,12 @@ TYPEINIT1(SwWebDocShell, SwDocShell); SFX_IMPL_OBJECTFACTORY(SwWebDocShell, SvGlobalName(SO3_SWWEB_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter/web" ) -/*-----------------22.01.97 09.29------------------- - ---------------------------------------------------*/ - SwWebDocShell::SwWebDocShell(SfxObjectCreateMode eMode ) : SwDocShell(eMode), nSourcePara(0) { } -/*-----------------22.01.97 09.29------------------- - ---------------------------------------------------*/ - SwWebDocShell::~SwWebDocShell() { } @@ -93,7 +84,7 @@ void SwWebDocShell::FillClass( SvGlobalName * pClassName, sal_Bool bTemplate /* = sal_False */) const { (void)bTemplate; - DBG_ASSERT( bTemplate == sal_False, "No template for Writer Web" ); + OSL_ENSURE( bTemplate == sal_False, "No template for Writer Web" ); if (nVersion == SOFFICE_FILEFORMAT_60) { @@ -112,3 +103,4 @@ void SwWebDocShell::FillClass( SvGlobalName * pClassName, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/web/wformsh.cxx b/sw/source/ui/web/wformsh.cxx index b9e919f51d..186a58a8f1 100644 --- a/sw/source/ui/web/wformsh.cxx +++ b/sw/source/ui/web/wformsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,9 +33,7 @@ #include <sfx2/msg.hxx> -#ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> -#endif #include <svl/srchitem.hxx> #include <sfx2/objface.hxx> #include <tools/globname.hxx> @@ -64,8 +63,9 @@ SwWebDrawFormShell::SwWebDrawFormShell(SwView& rVw) : { } -__EXPORT SwWebDrawFormShell::~SwWebDrawFormShell() +SwWebDrawFormShell::~SwWebDrawFormShell() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/web/wfrmsh.cxx b/sw/source/ui/web/wfrmsh.cxx index 41001f3fca..d85134e464 100644 --- a/sw/source/ui/web/wfrmsh.cxx +++ b/sw/source/ui/web/wfrmsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,11 +51,6 @@ #include <sfx2/msg.hxx> #include "swslots.hxx" - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SFX_IMPL_INTERFACE(SwWebFrameShell, SwFrameShell, SW_RES(STR_SHELLNAME_WEBFRAME)) { SFX_POPUPMENU_REGISTRATION(SW_RES(MN_FRM_POPUPMENU)); @@ -65,24 +61,12 @@ SFX_IMPL_INTERFACE(SwWebFrameShell, SwFrameShell, SW_RES(STR_SHELLNAME_WEBFRAME) TYPEINIT1(SwWebFrameShell, SwFrameShell) -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - SwWebFrameShell::SwWebFrameShell(SwView &_rView) : SwFrameShell(_rView) { SetHelpId(SW_WEBFRAMESHELL); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - - SwWebFrameShell::~SwWebFrameShell() { } @@ -93,3 +77,4 @@ SwWebFrameShell::~SwWebFrameShell() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/web/wgrfsh.cxx b/sw/source/ui/web/wgrfsh.cxx index e6d6bfa7f1..c4ac8a06bd 100644 --- a/sw/source/ui/web/wgrfsh.cxx +++ b/sw/source/ui/web/wgrfsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -72,3 +73,4 @@ SwWebGrfShell::~SwWebGrfShell() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/web/wlistsh.cxx b/sw/source/ui/web/wlistsh.cxx index 12095134ad..795f157933 100644 --- a/sw/source/ui/web/wlistsh.cxx +++ b/sw/source/ui/web/wlistsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -60,8 +61,9 @@ SwWebListShell::SwWebListShell(SwView &_rView) : SetHelpId(SW_LISTSHELL); } -__EXPORT SwWebListShell::~SwWebListShell() +SwWebListShell::~SwWebListShell() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/web/wolesh.cxx b/sw/source/ui/web/wolesh.cxx index 3b8c84a2b9..791185f800 100644 --- a/sw/source/ui/web/wolesh.cxx +++ b/sw/source/ui/web/wolesh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,8 +62,9 @@ SwWebOleShell::SwWebOleShell(SwView &_rView) : SetHelpId(SW_OLESHELL); } -__EXPORT SwWebOleShell::~SwWebOleShell() +SwWebOleShell::~SwWebOleShell() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/web/wtabsh.cxx b/sw/source/ui/web/wtabsh.cxx index 2ecab1b10c..a1e14aa82d 100644 --- a/sw/source/ui/web/wtabsh.cxx +++ b/sw/source/ui/web/wtabsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -68,9 +69,10 @@ SwWebTableShell::SwWebTableShell(SwView &_rView) : SetHelpId(SW_TABSHELL); } -__EXPORT SwWebTableShell::~SwWebTableShell() +SwWebTableShell::~SwWebTableShell() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/web/wtextsh.cxx b/sw/source/ui/web/wtextsh.cxx index 9da051913d..650afb1b69 100644 --- a/sw/source/ui/web/wtextsh.cxx +++ b/sw/source/ui/web/wtextsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,9 +36,7 @@ #include <sfx2/app.hxx> #include <svl/srchitem.hxx> //*** #include <basic/sbxvar.hxx> -#ifndef _SVX_SVXIDS_HRC //autogen #include <svx/svxids.hrc> -#endif #include "swtypes.hxx" #include "cmdid.h" @@ -61,11 +60,6 @@ #include <sfx2/msg.hxx> #include "swslots.hxx" - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SFX_IMPL_INTERFACE(SwWebTextShell, SwBaseShell, SW_RES(STR_SHELLNAME_WEBTEXT)) { SFX_POPUPMENU_REGISTRATION(SW_RES(MN_TEXT_POPUPMENU)); @@ -76,24 +70,16 @@ SFX_IMPL_INTERFACE(SwWebTextShell, SwBaseShell, SW_RES(STR_SHELLNAME_WEBTEXT)) TYPEINIT1(SwWebTextShell, SwTextShell) -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - SwWebTextShell::SwWebTextShell(SwView &_rView) : SwTextShell(_rView) { SetHelpId(SW_WEBTEXTSHELL); } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - - SwWebTextShell::~SwWebTextShell() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/web/wview.cxx b/sw/source/ui/web/wview.cxx index 10dbbcc29f..2c4c3bc927 100644 --- a/sw/source/ui/web/wview.cxx +++ b/sw/source/ui/web/wview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -103,30 +104,15 @@ SFX_IMPL_INTERFACE( SwWebView, SwView, SW_RES(RID_WEBTOOLS_TOOLBOX) ) TYPEINIT1(SwWebView,SwView) -/*-----------------22.01.97 14.27------------------- - ---------------------------------------------------*/ - - SwWebView::SwWebView(SfxViewFrame* _pFrame, SfxViewShell* _pShell) : SwView(_pFrame, _pShell) { } -/*-----------------22.01.97 14.27------------------- - ---------------------------------------------------*/ - - SwWebView::~SwWebView() { } -/*-----------------23.01.97 09.01------------------- - ---------------------------------------------------*/ - - void SwWebView::SelectShell() { // Entscheidung, ob UpdateTable gerufen werden muss @@ -152,8 +138,6 @@ void SwWebView::SelectShell() } else { - - // DELETEZ(pxSelectionObj); //Selektionsobjekt loeschen SfxDispatcher &rDispatcher = *GetViewFrame()->GetDispatcher(); SwToolbarConfigItem *pBarCfg = SW_MOD()->GetWebToolbarConfig(); @@ -176,7 +160,7 @@ void SwWebView::SelectShell() break; } pSfxShell = rDispatcher.GetShell( --i ); - ASSERT( pSfxShell, "My Shell ist lost in space" ); + OSL_ENSURE( pSfxShell, "My Shell ist lost in space" ); rDispatcher.Pop( *pSfxShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE); } @@ -328,3 +312,4 @@ void SwWebView::SelectShell() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx index a376151fab..44385b000d 100644 --- a/sw/source/ui/wrtsh/delete.cxx +++ b/sw/source/ui/wrtsh/delete.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,12 +35,8 @@ #include <swcrsr.hxx> #include <editeng/lrspitem.hxx> // #i23725# // --> OD 2006-07-10 #134369# -#ifndef _VIEW_HXX #include <view.hxx> -#endif -#ifndef _DRAWBASE_HXX #include <drawbase.hxx> -#endif // <-- inline void SwWrtShell::OpenMark() @@ -115,9 +112,7 @@ long SwWrtShell::DelLine() SwCrsrShell::LeftMargin(); SetMark(); SwCrsrShell::RightMargin(); -//Warum soll hier noch ein Zeichen in der naechsten Zeile geloescht werden? -// if(!IsEndOfPara()) -// SwCrsrShell::Right(); + long nRet = Delete(); Pop(sal_False); if( nRet ) @@ -391,8 +386,8 @@ long SwWrtShell::DelRight() LeaveSelFrmMode(); UnSelectFrm(); // --> OD 2006-07-06 #134369# - ASSERT( !IsFrmSelected(), - "<SwWrtShell::DelRight(..)> - <SwWrtShell::UnSelectFrm()> should unmark all objects" ) + OSL_ENSURE( !IsFrmSelected(), + "<SwWrtShell::DelRight(..)> - <SwWrtShell::UnSelectFrm()> should unmark all objects" ); // <-- // --> OD 2006-07-10 #134369# // leave draw mode, if necessary. @@ -568,3 +563,4 @@ long SwWrtShell::DelPrvWord() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/wrtsh/move.cxx b/sw/source/ui/wrtsh/move.cxx index 89472a1316..f7776f228a 100644 --- a/sw/source/ui/wrtsh/move.cxx +++ b/sw/source/ui/wrtsh/move.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,9 +32,7 @@ #include <sfx2/bindings.hxx> #include <wrtsh.hxx> -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <viewopt.hxx> #include <crsskip.hxx> @@ -523,7 +522,6 @@ sal_Bool SwWrtShell::PushCrsr(SwTwips lOffset, sal_Bool bSelect) if( bIsFrmSel ) { -// CallChgLnk(); // bei Frames immer nur die obere Ecke nehmen, damit dieser // wieder selektiert werden kann aOldRect.SSize( 5, 5 ); @@ -670,7 +668,97 @@ sal_Bool SwWrtShell::GotoPage(sal_uInt16 nPage, sal_Bool bRecord) sal_Bool SwWrtShell::GotoMark( const ::sw::mark::IMark* const pMark, sal_Bool bSelect, sal_Bool bStart ) { ShellMoveCrsr aTmp( this, bSelect ); - return SwCrsrShell::GotoMark( pMark, bStart ); + SwPosition aPos = *GetCrsr()->GetPoint(); + bool bRet = SwCrsrShell::GotoMark( pMark, bStart ); + if (bRet) + aNavigationMgr.addEntry(aPos); + return bRet; +} + +sal_Bool SwWrtShell::GotoFly( const String& rName, FlyCntType eType, sal_Bool bSelFrame ) +{ + SwPosition aPos = *GetCrsr()->GetPoint(); + bool bRet = SwFEShell::GotoFly(rName, eType, bSelFrame); + if (bRet) + aNavigationMgr.addEntry(aPos); + return bRet; +} + +sal_Bool SwWrtShell::GotoINetAttr( const SwTxtINetFmt& rAttr ) +{ + SwPosition aPos = *GetCrsr()->GetPoint(); + bool bRet = SwCrsrShell::GotoINetAttr(rAttr); + if (bRet) + aNavigationMgr.addEntry(aPos); + return bRet; +} + +void SwWrtShell::GotoOutline( sal_uInt16 nIdx ) +{ + addCurrentPosition(); + return SwCrsrShell::GotoOutline (nIdx); +} + +sal_Bool SwWrtShell::GotoOutline( const String& rName ) +{ + SwPosition aPos = *GetCrsr()->GetPoint(); + bool bRet = SwCrsrShell::GotoOutline (rName); + if (bRet) + aNavigationMgr.addEntry(aPos); + return bRet; +} + +sal_Bool SwWrtShell::GotoRegion( const String& rName ) +{ + SwPosition aPos = *GetCrsr()->GetPoint(); + bool bRet = SwCrsrShell::GotoRegion (rName); + if (bRet) + aNavigationMgr.addEntry(aPos); + return bRet; + } + +sal_Bool SwWrtShell::GotoRefMark( const String& rRefMark, sal_uInt16 nSubType, + sal_uInt16 nSeqNo ) +{ + SwPosition aPos = *GetCrsr()->GetPoint(); + bool bRet = SwCrsrShell::GotoRefMark(rRefMark, nSubType, nSeqNo); + if (bRet) + aNavigationMgr.addEntry(aPos); + return bRet; +} + +sal_Bool SwWrtShell::GotoNextTOXBase( const String* pName ) +{ + SwPosition aPos = *GetCrsr()->GetPoint(); + bool bRet = SwCrsrShell::GotoNextTOXBase(pName); + if (bRet) + aNavigationMgr.addEntry(aPos); + return bRet; +} + +sal_Bool SwWrtShell::GotoTable( const String& rName ) +{ + SwPosition aPos = *GetCrsr()->GetPoint(); + bool bRet = SwCrsrShell::GotoTable(rName); + if (bRet) + aNavigationMgr.addEntry(aPos); + return bRet; +} + +sal_Bool SwWrtShell::GotoFld( const SwFmtFld& rFld ) { + SwPosition aPos = *GetCrsr()->GetPoint(); + bool bRet = SwCrsrShell::GotoFld(rFld); + if (bRet) + aNavigationMgr.addEntry(aPos); + return bRet; +} + +const SwRedline* SwWrtShell::GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect ) { + SwPosition aPos = *GetCrsr()->GetPoint(); + const SwRedline *pRedline = SwCrsrShell::GotoRedline(nArrPos, bSelect); + if (pRedline) + aNavigationMgr.addEntry(aPos); + return pRedline; } @@ -689,3 +777,4 @@ sal_Bool SwWrtShell::SelectTxtAttr( sal_uInt16 nWhich, const SwTxtAttr* pAttr ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/wrtsh/navmgr.cxx b/sw/source/ui/wrtsh/navmgr.cxx new file mode 100644 index 0000000000..2ef5b17d5e --- /dev/null +++ b/sw/source/ui/wrtsh/navmgr.cxx @@ -0,0 +1,224 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * [ Maja Djordjevic < ovcica@gmail.com > ] + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Cédric Bosdonnat <cbosdonnat@novell.com> + * Caolan McNamara <caolanm@redhat.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#include "precompiled_sw.hxx" + +#include "navmgr.hxx" +#include "wrtsh.hxx" +#include <sfx2/bindings.hxx> +#include <sfx2/viewfrm.hxx> +#include <cmdid.h> +#include <view.hxx> + +/** + * If SMART is defined, the navigation history has recency with temporal ordering enhancement, + * as described on http://zing.ncsl.nist.gov/hfweb/proceedings/greenberg/ + */ +#define SMART 1 + +/* + * This method positions the cursor to the position rPos + */ +void SwNavigationMgr::GotoSwPosition(const SwPosition &rPos) { + SwWrtShell& rSh = *_pMyShell; + /* EnterStdMode() prevents the cursor to 'block' the current shell when it should move from the image back to the normal shell */ + rSh.EnterStdMode(); + rSh.StartAllAction(); + /* + * cursor consists of two SwPositions: Point and Mark. + * Such a pair is called a PaM. SwPaM is derived from SwRing. + * The Ring contains the single regions of a multi-selection. + */ + SwPaM* pPaM = rSh.GetCrsr(); + + if(pPaM->HasMark()) + pPaM->DeleteMark(); // If there was a selection, get rid of it + *pPaM->GetPoint() = rPos; // Position Cursor + + rSh.EndAllAction(); +} +/* + * Ctor for the SwNavigationMgr class + * Sets the shell to the current shell + * and the index of the current position to 0 + */ + +SwNavigationMgr::SwNavigationMgr(SwWrtShell* pShell) + : _nCurrent(0), _pMyShell(pShell) { +} +/* + * This method is used by the navigation shell - defined in sw/source/ui/inc/navsh.hxx + * and implemented in sw/source/ui/shells/navsh.cxx + * It is called when we want to check if the back button should be enabled or not. + * The back button should be enabled only if there are some entries in the navigation history + */ +sal_Bool SwNavigationMgr::backEnabled() { + return (_nCurrent > 0); +} +/* + * Similar to backEnabled() method. + * The forward button should be enabled if we ever clicked back + * Due to the implementation of the navigation class, this is when the + * current position within the navigation history entries in not the last one + * i.e. when the _nCurrent index is not at the end of the _entries vector + */ +sal_Bool SwNavigationMgr::forwardEnabled() { + return _nCurrent+1 < _entries.size(); +} + + +/* + * The goBack() method positions the cursor to the previous entry in the navigation history + * If there was no history to go forward to, it adds the current position of the cursor + * to the history so we could go forward to where we came from + */ +void SwNavigationMgr::goBack() { + /* + * Although the button should be disabled whenever the backEnabled() returns false, + * the UI is sometimes not as responsive as we would like it to be :) + * this check prevents segmentation faults and in this way the class is not relying on the UI + */ + if (backEnabled()) { + SwWrtShell& rSh = *_pMyShell; + /* Trying to get the current cursor */ + SwPaM* pPaM = rSh.GetCrsr(); + if (!pPaM) { + return; + } + + /* This flag will be used to manually refresh the buttons */ + bool bForwardWasDisabled = !forwardEnabled(); + /* + * If we're going backwards in our history, but the current location is not + * in the history then we need to add *here* to it so that we can "go + * forward" to here again. + */ + + if (bForwardWasDisabled) { + /* + * the cursor consists of two SwPositions: Point and Mark. + * We are adding the current Point to the navigation history + * so we could later navigate forward to it + */ + /* The addEntry() method returns true iff we should decrement the index before navigating back */ + if (addEntry(*pPaM->GetPoint()) ) { + _nCurrent--; + } + } + _nCurrent--; + /* Position cursor to appropriate navigation history entry */ + GotoSwPosition(_entries[_nCurrent]); + /* Refresh the buttons */ + if (bForwardWasDisabled) + _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_FORWARD); + if (!backEnabled()) + _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_BACK); + } +} +/* + * The goForward() method positions the cursor to the next entry in the navigation history + */ + +void SwNavigationMgr::goForward() { + /* + * Although the button should be disabled whenever the backForward() returns false, + * the UI is sometimes not as responsive as we would like it to be :) + * this check prevents segmentation faults and in this way the class is not relying on the UI + */ + + if (forwardEnabled()) { + /* This flag will be used to manually refresh the buttons */ + bool bBackWasDisabled = !backEnabled(); + /* + * The current index is positioned at the current entry in the navigation history + * We have to increment it to go to the next entry + */ + _nCurrent++; + GotoSwPosition(_entries[_nCurrent]); + /* Refresh the buttons */ + if (bBackWasDisabled) + _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_BACK); + if (!forwardEnabled()) + _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_FORWARD); + } +} +/* + * This method adds the SwPosition rPos to the navigation history + * rPos is usually the current position of the cursor in the document + */ +bool SwNavigationMgr::addEntry(const SwPosition& rPos) { + /* Flags that will be used for refreshing the buttons */ + bool bBackWasDisabled = !backEnabled(); + bool bForwardWasEnabled = forwardEnabled(); + + bool bRet = false; // return value of the function. + // Indicates weather the index should be decremented before jumping back or not +#if SMART + /* If any forward history exists, twist the tail of the list from the current position to the end */ + if (bForwardWasEnabled) { + + size_t number_of_entries = _entries.size(); /* To avoid calling _entries.size() multiple times */ + int curr = _nCurrent; /* Index from which we'll twist the tail. */ + int n = (number_of_entries - curr) / 2; /* Number of entries that will swap places */ + for (int i = 0; i < n; i++) { + SwPosition temp = _entries[curr + i]; + _entries[curr + i] = _entries[number_of_entries -1 - i]; + _entries[number_of_entries -1 - i] = temp; + } + + if (_entries.back() != rPos) + _entries.push_back(rPos); + + + bRet = true; + } + else { + if ( (_entries.size() > 0 && _entries.back() != rPos) || (_entries.size() == 0) ) { + _entries.push_back(rPos); + bRet = true; + } + if (_entries.size() > 1 && _entries.back() == rPos) + bRet = true; + if (_entries.size() == 1 && _entries.back() == rPos) + bRet = false; + } +#else + _entries.erase(_entries.begin() + _nCurrent, _entries.end()); + _entries.push_back(rPos); + bRet = true; +#endif + _nCurrent = _entries.size(); + + /* Refresh buttons */ + if (bBackWasDisabled) + _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_BACK); + if (bForwardWasEnabled) + _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_FORWARD); + return bRet; +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx index 0473d1f70a..6647dc061d 100644 --- a/sw/source/ui/wrtsh/select.cxx +++ b/sw/source/ui/wrtsh/select.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -619,7 +620,6 @@ long SwWrtShell::SttLeaveSelect(const Point *, sal_Bool ) if(SwCrsrShell::HasSelection() && !IsSelTblCells() && bClearMark) { return 0; } -// if( IsSelTblCells() ) aSelTblLink.Call(this); ClearMark(); return 1; } @@ -773,7 +773,7 @@ void SwWrtShell::LeaveSelFrmMode() IMPL_LINK( SwWrtShell, ExecFlyMac, void *, pFlyFmt ) { const SwFrmFmt *pFmt = pFlyFmt ? (SwFrmFmt*)pFlyFmt : GetFlyFrmFmt(); - ASSERT(pFmt, kein FrameFormat.); + OSL_ENSURE(pFmt, "no frame format"); const SvxMacroItem &rFmtMac = pFmt->GetMacro(); if(rFmtMac.HasMacro(SW_EVENT_OBJECT_SELECT)) @@ -1070,3 +1070,4 @@ sal_Bool SwWrtShell::SelectNextPrevHyperlink( sal_Bool bNext ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index d446d0a6b5..0b33cf6bb5 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,9 +38,7 @@ #include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/util/XModifiable.hpp> -#if STLPORT_VERSION>=321 -#include <math.h> // prevent conflict between exception and std::exception -#endif +#include <math.h> #include <hintids.hxx> #include <svx/svdview.hxx> #include <sot/factory.hxx> @@ -107,8 +106,6 @@ #include <toolkit/helper/vclunohelper.hxx> #include <sfx2/viewfrm.hxx> -#include <editeng/acorrcfg.hxx> - #include "PostItMgr.hxx" #include <sfx2/msgpool.hxx> @@ -124,6 +121,7 @@ using namespace com::sun::star; ePageMove(MV_NO),\ pCrsrStack(0), \ rView(rShell),\ + aNavigationMgr(this), \ bDestOnStack(sal_False), \ fnLeaveSelect(&SwWrtShell::SttLeaveSelect) @@ -258,18 +256,6 @@ void SwWrtShell::Insert( const String &rStr ) bDeleted = DelRight() != 0; } - /* -JP 21.01.98: Ueberschreiben ueberschreibt nur die Selektion, nicht das - naechste Zeichen. - if( bHasSel && !bIns && 1 < rStr.Len() ) - { - // falls mehrere Zeichen anstehen, nur das erste einfuegen, - // der Rest muss dann aber Ueberschrieben werden. - SwEditShell::Insert( rStr.GetChar( 0 ) ); - SwEditShell::Overwrite( rStr.Copy( 1 ) ); - } - else -*/ bCallIns ? SwEditShell::Insert2( rStr, bDeleted ) : SwEditShell::Overwrite( rStr ); @@ -279,7 +265,6 @@ JP 21.01.98: Ueberschreiben ueberschreibt nur die Selektion, nicht das EndAllAction(); EndUndo(); } -// delete pChgFlg; } /* Begrenzung auf maximale Hoehe geht nicht, da die maximale Hoehe @@ -422,27 +407,7 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName // TODO/LATER: recording! Convert properties to items case SID_INSERT_PLUGIN: - /* - if(pReq) - { - INetURLObject* pURL = aDlg.GetURL(); - if(pURL) - pReq->AppendItem(SfxStringItem(FN_PARAM_2, pURL->GetMainURL(INetURLObject::NO_DECODE))); - pReq->AppendItem(SfxStringItem(FN_PARAM_3 , aDlg.GetCommands())); - } */ case SID_INSERT_FLOATINGFRAME: - /* - if(pReq && xFloatingFrame.Is()) - { - const SfxFrameDescriptor* pDescriptor = xFloatingFrame->GetFrameDescriptor(); - pReq->AppendItem(SfxStringItem(FN_PARAM_1, pDescriptor->GetName())); - pReq->AppendItem( - SfxStringItem( FN_PARAM_2, - pDescriptor->GetURL().GetMainURL(INetURLObject::NO_DECODE))); - pReq->AppendItem(SvxSizeItem(FN_PARAM_3, pDescriptor->GetMargin())); - pReq->AppendItem(SfxByteItem(FN_PARAM_4, pDescriptor->GetScrollingMode())); - pReq->AppendItem(SfxBoolItem(FN_PARAM_5, pDescriptor->HasFrameBorder())); - }*/ { SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool(); const SfxSlot* pSlot = pSlotPool->GetSlot(nSlotId); @@ -502,8 +467,6 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName pClient->DoVerb( SVVERB_SHOW ); // TODO/LATER: set document name - should be done in Client - //if ( !ERRCODE_TOERROR( nErr ) ) - // xIPObj->SetDocumentName( GetView().GetDocShell()->GetTitle() ); } } } @@ -559,7 +522,7 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF { try { - xSet->setPropertyValue( ::rtl::OUString::createFromAscii("Formula"), uno::makeAny( ::rtl::OUString( aMathData ) ) ); + xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Formula")), uno::makeAny( ::rtl::OUString( aMathData ) ) ); bActivate = sal_False; } catch ( uno::Exception& ) @@ -659,7 +622,7 @@ void SwWrtShell::LaunchOLEObj( long nVerb ) !GetView().GetViewFrame()->GetFrame().IsInPlace() ) { svt::EmbeddedObjectRef& xRef = GetOLEObject(); - ASSERT( xRef.is(), "OLE not found" ); + OSL_ENSURE( xRef.is(), "OLE not found" ); SfxInPlaceClient* pCli=0; pCli = GetView().FindIPClient( xRef.GetObject(), &GetView().GetEditWin() ); @@ -705,7 +668,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, { //Einstellen der Skalierung am Client. Diese ergibt sich aus der Differenz //zwischen der VisArea des Objektes und der ObjArea. - ASSERT( xObj.is(), "ObjectRef not valid" ); + OSL_ENSURE( xObj.is(), "ObjectRef not valid" ); sal_Int64 nAspect = xObj.GetViewAspect(); if ( nAspect == embed::Aspects::MSOLE_ICON ) @@ -806,13 +769,13 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, } catch( embed::NoVisualAreaSizeException& ) { - DBG_ERROR( "Can't get visual area size!\n" ); + OSL_ENSURE(false, "Can't get visual area size!\n" ); // the scaling will not be done } catch( uno::Exception& ) { // TODO/LATER: handle the error - DBG_ERROR( "Can't get visual area size!\n" ); + OSL_ENSURE(false, "Can't get visual area size!\n" ); return; } @@ -900,7 +863,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, { // --> this moves non-resizable object so that when adding borders the baseline remains the same const SwFlyFrmFmt *pFlyFrmFmt = dynamic_cast< const SwFlyFrmFmt * >( GetFlyFrmFmt() ); - ASSERT( pFlyFrmFmt, "Could not find fly frame." ); + OSL_ENSURE( pFlyFrmFmt, "Could not find fly frame." ); if ( pFlyFrmFmt ) { const Point &rPoint = pFlyFrmFmt->GetLastFlyFrmPrtRectPos(); @@ -953,6 +916,8 @@ void SwWrtShell::InsertPageBreak(const String *pPageDesc, sal_uInt16 nPgNum ) if(HasSelection()) DelRight(); SwFEShell::SplitNode(); + // delete the numbered attribute of the last line if the last line is empty + GetDoc()->ClearLineNumAttrs( *GetCrsr()->GetPoint() ); } const SwPageDesc *pDesc = pPageDesc @@ -1034,7 +999,7 @@ void SwWrtShell::InsertFootnote(const String &rStr, sal_Bool bEndNote, sal_Bool SwapPam(); ClearMark(); } - + SwPosition aPos = *GetCrsr()->GetPoint(); SwFmtFtn aFootNote( bEndNote ); if(rStr.Len()) aFootNote.SetNumStr( rStr ); @@ -1047,6 +1012,7 @@ void SwWrtShell::InsertFootnote(const String &rStr, sal_Bool bEndNote, sal_Bool Left(CRSR_SKIP_CHARS, sal_False, 1, sal_False ); GotoFtnTxt(); } + aNavigationMgr.addEntry(aPos); } } /*------------------------------------------------------------------------ @@ -1089,7 +1055,6 @@ void SwWrtShell::SplitNode( sal_Bool bAutoFmt, sal_Bool bCheckTableStart ) // extern void SetNumChrFmt( SwWrtShell*, SwNumRules& ); // -> #i40041# -// --> OD 2005-10-25 #b6340308# // Preconditions (as far as OD has figured out): // - <SwEditShell::HasNumber()> is sal_False, if <bNum> is sal_True // - <SwEditShell::HasBullet()> is sal_False, if <bNum> is sal_False @@ -1104,7 +1069,6 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum) const SwNumRule * pNumRule = pCurRule; - // --> OD 2005-10-25 #b6340308# // - activate outline rule respectively turning on outline rule for // current text node. But, only for turning on a numbering (<bNum> == sal_True). // - overwrite found numbering rule at current cursor position, if @@ -1115,7 +1079,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum) SwTxtFmtColl * pColl = GetCurTxtFmtColl(); if ( pColl ) { - // --> OD 2005-10-25 #b6340308# - retrieve numbering rule at paragraph + // retrieve numbering rule at paragraph // style, which is found at current cursor position in the document. SwNumRule* pCollRule = pDoc->FindNumRulePtr(pColl->GetNumRule().GetValue()); // --> OD 2005-10-25 #125993# - The outline numbering rule isn't allowed @@ -1131,29 +1095,15 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum) pCollRule = 0; } } - // --> OD 2006-11-20 #i71764# - // Document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE has no influence - // any more. -// if ( pCollRule == NULL && -// NO_NUMBERING != pColl->GetOutlineLevel() && -// GetDoc()->get(IDocumentSettingAccess::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE) ) -// { -// pCollRule = GetDoc()->GetOutlineNumRule(); -// } - // <-- - // <-- - // --> OD 2005-10-25 #b6340308# if ( !pCollRule ) { pNumRule = pCollRule; } - // --> OD 2006-06-12 #b6435904# // no activation or continuation of outline numbering in Writer/Web document else if ( bNum && !dynamic_cast<SwWebDocShell*>(GetDoc()->GetDocShell()) && pCollRule == GetDoc()->GetOutlineNumRule() ) - // <-- { if ( pNumRule == pCollRule ) { @@ -1167,9 +1117,9 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum) // check, if numbering of the outline level of the pararaph // style is active. If not, activate this outline level. nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel(); - ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(), //<-end,zhaojianwei + OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(), "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" ); - if ( pColl->IsAssignedToListLevelOfOutlineStyle() && //<-end,zhaojianwei + if ( pColl->IsAssignedToListLevelOfOutlineStyle() && pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType() == SVX_NUM_NUMBER_NONE ) { @@ -1215,10 +1165,10 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum) { // check, if numbering of the outline level of the pararaph // style is active. If not, activate this outline level. - nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//#outline level,zhaojianwei - ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(),//#outline level,zhaojianwei + nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel(); + OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(), "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" ); - if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&//#outline level,zhaojianwei + if ( pColl->IsAssignedToListLevelOfOutlineStyle() && pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType() == SVX_NUM_NUMBER_NONE ) { @@ -1235,7 +1185,6 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum) } } - // --> OD 2005-10-25 #b6340308# // Only automatic numbering/bullet rules should be changed. // Note: The outline numbering rule is also an automatic one. It's only // changed, if it has to be activated. @@ -1251,11 +1200,8 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum) pNumRule = 0; } } - // <-- - // --> OD 2005-10-25 #b6340308# // Search for a previous numbering/bullet rule to continue it. - // --> OD 2008-03-18 #refactorlists# String sContinuedListId; if ( !pNumRule ) { @@ -1264,13 +1210,11 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum) sContinuedListId ); bContinueFoundNumRule = pNumRule != 0; } - // <-- if (pNumRule) { SwNumRule aNumRule(*pNumRule); - // --> OD 2005-10-25 #b6340308# // do not change found numbering/bullet rule, if it should only be continued. if ( !bContinueFoundNumRule ) { @@ -1278,12 +1222,10 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum) if (pTxtNode) { - // --> OD 2005-10-26 #b6340308# - use above retrieve outline - // level, if outline numbering has to be activated. - int nLevel = bActivateOutlineRule ////#outline level,zhaojianwei,need more consideration + // use above retrieve outline level, if outline numbering has to be activated. + int nLevel = bActivateOutlineRule ? nActivateOutlineLvl : pTxtNode->GetActualListLevel(); - // <-- if (nLevel < 0) nLevel = 0; @@ -1297,37 +1239,29 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum) aFmt.SetNumberingType(SVX_NUM_ARABIC); else { - // --> OD 2008-06-03 #i63395# - // Only apply user defined default bullet font + // #i63395# Only apply user defined default bullet font if ( numfunc::IsDefBulletFontUserDefined() ) { const Font* pFnt = &numfunc::GetDefBulletFont(); aFmt.SetBulletFont( pFnt ); } - // <-- aFmt.SetBulletChar( numfunc::GetBulletChar(static_cast<sal_uInt8>(nLevel))); aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); } aNumRule.Set(static_cast<sal_uInt16>(nLevel), aFmt); } } - // <-- - // --> OD 2008-02-08 #newlistlevelattrs# // reset indent attribute on applying list style - // --> OD 2008-03-27 #refactorlists# SetCurNumRule( aNumRule, false, sContinuedListId, true ); - // <-- } else { // --> OD 2009-08-27 #i95907# const SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode( numfunc::GetDefaultPositionAndSpaceMode() ); - // --> OD 2008-02-11 #newlistlevelattrs# SwNumRule aNumRule( GetUniqueNumRuleName(), ePosAndSpaceMode ); // <-- - // <-- // Zeichenvorlage an die Numerierung haengen SwCharFmt* pChrFmt; SwDocShell* pDocSh = GetView().GetDocShell(); @@ -1403,11 +1337,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum) if ( pTxtNode && ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) { - // --> OD 2010-01-05 #b6884103# -// short nTxtNodeFirstLineOffset( 0 ); -// pTxtNode->GetFirstLineOfsWithNum( nTxtNodeFirstLineOffset ); -// const SwTwips nTxtNodeIndent = pTxtNode->GetLeftMarginForTabCalculation() + -// nTxtNodeFirstLineOffset; + const SwTwips nTxtNodeIndent = pTxtNode->GetAdditionalIndentForStartingNewList(); // <-- if ( ( nTxtNodeIndent + nWidthOfTabs ) != 0 ) @@ -1430,12 +1360,9 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum) } } // <-- - // --> OD 2008-02-08 #newlistlevelattrs# // reset indent attribute on applying list style - // --> OD 2008-03-17 #refactorlists# // start new list SetCurNumRule( aNumRule, true, String(), true ); - // <-- } EndUndo(UNDO_NUMORNONUM); @@ -1468,10 +1395,8 @@ void SwWrtShell::NumOrBulletOff() aFmt.SetNumberingType(SVX_NUM_NUMBER_NONE); aNumRule.Set(nLevel, aFmt); - // --> OD 2008-03-17 #refactorlists# // no start or continuation of a list - the outline style is only changed. SetCurNumRule( aNumRule, false ); - // <-- } } else @@ -1510,9 +1435,6 @@ SelectionType SwWrtShell::GetSelectionType() const if ( BasicActionPend() ) return IsSelFrmMode() ? nsSelectionType::SEL_FRM : nsSelectionType::SEL_TXT; -// if ( IsTableMode() ) -// return nsSelectionType::SEL_TBL | nsSelectionType::SEL_TBL_CELLS; - SwView &_rView = ((SwView&)GetView()); if (_rView.GetPostItMgr() && _rView.GetPostItMgr()->HasActiveSidebarWin() ) return nsSelectionType::SEL_POSTIT; @@ -1578,9 +1500,7 @@ SelectionType SwWrtShell::GetSelectionType() const const SwTxtNode* pTxtNd = GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode(); - // --> OD 2008-03-19 #refactorlists# if ( pTxtNd && pTxtNd->IsInList() ) - // <-- { const SwNumFmt& rFmt = pNumRule->Get(sal::static_int_cast< sal_uInt8, sal_Int32>(pTxtNd->GetActualListLevel())); if ( SVX_NUM_NUMBER_NONE != rFmt.GetNumberingType() ) @@ -1651,7 +1571,14 @@ SwFrmFmt *SwWrtShell::GetTblStyle(const String &rFmtName) return 0; } +SwNavigationMgr& SwWrtShell::GetNavigationMgr() { + return aNavigationMgr; +} +void SwWrtShell::addCurrentPosition() { + SwPaM* pPaM = GetCrsr(); + aNavigationMgr.addEntry(*pPaM->GetPoint()); +} /*------------------------------------------------------------------------ Beschreibung: Anwenden der Vorlagen ------------------------------------------------------------------------*/ @@ -1740,10 +1667,6 @@ void SwWrtShell::AutoUpdatePara(SwTxtFmtColl* pColl, const SfxItemSet& rStyleSet EndAction(); } -/*-----------------12.03.97 12.24------------------- - ---------------------------------------------------*/ - void SwWrtShell::AutoUpdateFrame( SwFrmFmt* pFmt, const SfxItemSet& rStyleSet ) { StartAction(); @@ -1812,6 +1735,12 @@ SwWrtShell::SwWrtShell( SwDoc& rDoc, Window *_pWin, SwView &rShell, SET_CURR_SHELL( this ); SetSfxViewShell( (SfxViewShell *)&rShell ); SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) ); + + // place the cursor on the first field... + IFieldmark *pBM = NULL; + if ( IsFormProtected() && ( pBM = GetFieldmarkAfter( ) ) !=NULL ) { + GotoFieldmark(pBM); + } } /* @@ -1841,9 +1770,6 @@ sal_Bool SwWrtShell::Pop( sal_Bool bOldCrsr ) return bRet; } -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ sal_Bool SwWrtShell::CanInsert() { return (!(IsSelFrmMode() | IsObjSelected() | (GetView().GetDrawFuncPtr() != NULL) | (GetView().GetPostItMgr()->GetActiveSidebarWin()!= NULL))); @@ -1895,3 +1821,4 @@ String SwWrtShell::GetSelDescr() const return aResult; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx index 887359c327..34e5012a3e 100644 --- a/sw/source/ui/wrtsh/wrtsh2.cxx +++ b/sw/source/ui/wrtsh/wrtsh2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,11 +74,6 @@ #include <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> - -/*------------------------------------------------------------------------ - Beschreibung: -------------------------------------------------------------------------*/ - void SwWrtShell::Insert(SwField &rFld) { ResetCursorStack(); @@ -153,15 +149,12 @@ void SwWrtShell::UpdateInputFlds( SwInputFieldList* pLst, sal_Bool bOnlyInSel ) sal_Bool SwWrtShell::StartInputFldDlg( SwField* pFld, sal_Bool bNextButton, Window* pParentWin, ByteString* pWindowState ) { -//JP 14.08.96: Bug 30332 - nach Umbau der modularietaet im SFX, muss jetzt -// das TopWindow der Application benutzt werden. -// SwFldInputDlg* pDlg = new SwFldInputDlg( GetWin(), *this, pFld ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); AbstractFldInputDlg* pDlg = pFact->CreateFldInputDlg( DLG_FLD_INPUT, pParentWin, *this, pFld, bNextButton); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(pWindowState && pWindowState->Len()) pDlg->SetWindowState(*pWindowState); sal_Bool bRet = RET_CANCEL == pDlg->Execute(); @@ -172,16 +165,14 @@ sal_Bool SwWrtShell::StartInputFldDlg( SwField* pFld, sal_Bool bNextButton, GetWin()->Update(); return bRet; } -/* -----------------17.06.2003 10:18----------------- - --------------------------------------------------*/ sal_Bool SwWrtShell::StartDropDownFldDlg(SwField* pFld, sal_Bool bNextButton, ByteString* pWindowState) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractDropDownFieldDialog* pDlg = pFact->CreateDropDownFieldDialog( NULL, *this, pFld, DLG_FLD_DROPDOWN ,bNextButton ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(pWindowState && pWindowState->Len()) pDlg->SetWindowState(*pWindowState); sal_uInt16 nRet = pDlg->Execute(); @@ -265,7 +256,6 @@ void SwWrtShell::ClickToField( const SwField& rFld ) case JE_FMT_GRAPHIC: nSlotId = SID_INSERT_GRAPHIC; break; case JE_FMT_OLE: nSlotId = SID_INSERT_OBJECT; break; -// case JE_FMT_TEXT: } Right( CRSR_SKIP_CHARS, sal_True, 1, sal_False ); // Feld selektieren @@ -383,7 +373,7 @@ sal_Bool SwWrtShell::ClickToINetGrf( const Point& rDocPt, sal_uInt16 nFilter ) void LoadURL( const String& rURL, ViewShell* pVSh, sal_uInt16 nFilter, const String *pTargetFrameName ) { - ASSERT( rURL.Len() && pVSh, "was soll hier geladen werden?" ); + OSL_ENSURE( rURL.Len() && pVSh, "what should be loaded here?" ); if( !rURL.Len() || !pVSh ) return ; @@ -398,7 +388,7 @@ void LoadURL( const String& rURL, ViewShell* pVSh, sal_uInt16 nFilter, return; SwDocShell* pDShell = pSh->GetView().GetDocShell(); - DBG_ASSERT( pDShell, "No DocShell?!"); + OSL_ENSURE( pDShell, "No DocShell?!"); String sTargetFrame; if( pTargetFrameName && pTargetFrameName->Len() ) sTargetFrame = *pTargetFrameName; @@ -422,7 +412,6 @@ void LoadURL( const String& rURL, ViewShell* pVSh, sal_uInt16 nFilter, SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, sal_False ); //#39076# Silent kann lt. SFX entfernt werden. -// SfxBoolItem aSilent( SID_SILENT, sal_True ); SfxBoolItem aBrowse( SID_BROWSE, sal_True ); if( nFilter & URLLOAD_NEWVIEW ) @@ -496,3 +485,4 @@ void SwWrtShell::NavigatorPaste( const NaviContentBookmark& rBkmk, } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/wrtsh/wrtsh3.cxx b/sw/source/ui/wrtsh/wrtsh3.cxx index b808989778..1fcc75ffb5 100644 --- a/sw/source/ui/wrtsh/wrtsh3.cxx +++ b/sw/source/ui/wrtsh/wrtsh3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,9 +30,7 @@ #include "precompiled_sw.hxx" -#ifndef _SVX_SVXIDS_HRC //autogen #include <svx/svxids.hrc> -#endif #include <sfx2/app.hxx> #include <sfx2/childwin.hxx> #include <sfx2/bindings.hxx> @@ -59,8 +58,7 @@ extern sal_Bool bNoInterrupt; // in mainwn.cxx sal_Bool SwWrtShell::MoveBookMark( BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark) { -//JP 08.03.96: die Wizards brauchen die Selektion !! -// EndSelect(); + addCurrentPosition(); (this->*fnKillSel)( 0, sal_False ); sal_Bool bRet = sal_True; @@ -129,7 +127,7 @@ bool SwWrtShell::GotoFieldmark(::sw::mark::IFieldmark const * const pMark) void SwWrtShell::DrawSelChanged( ) { - static sal_uInt16 __READONLY_DATA aInval[] = + static sal_uInt16 const aInval[] = { SID_ATTR_FILL_STYLE, SID_ATTR_FILL_COLOR, SID_ATTR_LINE_STYLE, SID_ATTR_LINE_WIDTH, SID_ATTR_LINE_COLOR, 0 @@ -205,7 +203,7 @@ sal_Bool SwWrtShell::GetURLFromButton( String& rURL, String& rDescr ) const { uno::Reference< awt::XControlModel > xControlModel = pUnoCtrl->GetUnoControlModel(); - ASSERT( xControlModel.is(), "UNO-Control ohne Model" ); + OSL_ENSURE( xControlModel.is(), "UNO-Control without Model" ); if( !xControlModel.is() ) return bRet; @@ -245,3 +243,5 @@ sal_Bool SwWrtShell::GetURLFromButton( String& rURL, String& rDescr ) const return bRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/wrtsh/wrtsh4.cxx b/sw/source/ui/wrtsh/wrtsh4.cxx index 34629c6541..9469ff2245 100644 --- a/sw/source/ui/wrtsh/wrtsh4.cxx +++ b/sw/source/ui/wrtsh/wrtsh4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -247,16 +248,6 @@ sal_Bool SwWrtShell::_FwdPara() { Push(); ClearMark(); - // --> OD 2009-01-06 #i81824# - // going right and back again left not needed and causes too much - // accessibility events due to the cursor movements. -// if(!SwCrsrShell::Right(1,CRSR_SKIP_CHARS)) -// { -// Pop(sal_False); -// return 0; -// } -// SwCrsrShell::Left(1,CRSR_SKIP_CHARS); - // <-- sal_Bool bRet = SwCrsrShell::MovePara(fnParaNext, fnParaStart); ClearMark(); @@ -269,22 +260,7 @@ sal_Bool SwWrtShell::_BwdPara() { Push(); ClearMark(); - // --> OD 2009-01-06 #i81824# - // going left and back again right not needed and causes too much - // accessibility events due to the cursor movements. -// if(!SwCrsrShell::Left(1,CRSR_SKIP_CHARS)) -// { -// Pop(sal_False); -// return 0; -// } -// SwCrsrShell::Right(1,CRSR_SKIP_CHARS); - // <-- - // --> OD 2009-01-06 #i81824# - // going to start of paragraph only needed, if move to previous paragraph - // does not happen. Otherwise, useless accessibility events are triggered - // due to cursor movements. -// if(!IsSttOfPara()) -// SttPara(); + sal_Bool bRet = SwCrsrShell::MovePara(fnParaPrev, fnParaStart); if ( !bRet && !IsSttOfPara() ) { @@ -298,3 +274,4 @@ sal_Bool SwWrtShell::_BwdPara() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/wrtsh/wrtundo.cxx b/sw/source/ui/wrtsh/wrtundo.cxx index 35fdb4dcf2..bbd1d06052 100644 --- a/sw/source/ui/wrtsh/wrtundo.cxx +++ b/sw/source/ui/wrtsh/wrtundo.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -155,6 +156,7 @@ sal_uInt16 SwWrtShell::GetDoStrings( DoType eDoType, SfxStringListItem& rStrs ) OSL_ENSURE(comments[i].getLength(), "no Undo/Redo Text set"); buf.append(comments[i]); buf.append(sal_Unicode('\n')); + OSL_ENSURE( !this, "no Undo/Redo Test set" ); } rStrs.SetString(buf.makeStringAndClear()); return static_cast<sal_uInt16>(comments.size()); @@ -177,3 +179,4 @@ String SwWrtShell::GetRepeatString() const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |