diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-01-09 15:40:22 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-01-09 15:40:22 +0100 |
commit | 28a42c1b7273557971f3c17646810c09b585b4b1 (patch) | |
tree | 6819bae14d16a5229b4d61e8aead08f929526aa8 /sw | |
parent | d5595090eb335e574e901c805c4c1e2265ed75d2 (diff) |
New loplugin:externvar: sw
Change-Id: If850989ee513d29ed373df0c6dd9905ec694026c
Diffstat (limited to 'sw')
58 files changed, 327 insertions, 255 deletions
diff --git a/sw/inc/init.hxx b/sw/inc/init.hxx index dcbbe5cffd9c..4047d6bb0fb7 100644 --- a/sw/inc/init.hxx +++ b/sw/inc/init.hxx @@ -21,9 +21,12 @@ #include <sal/config.h> +#include <vector> + #include <osl/module.h> #include <osl/module.hxx> +class SvGlobalName; class SwViewShell; void InitCore(); // bastyp/init.cxx @@ -61,6 +64,12 @@ void SetShell( SwViewShell *pSh ); void TextInit_(); void TextFinit(); +// We collect the GlobalNames of the servers at runtime, who don't want to be notified +// about printer changes. Thereby saving loading a lot of objects (luckily all foreign +// objects are mapped to one ID). +// Initialisation and deinitialisation can be found in init.cxx +extern std::vector<SvGlobalName*> *pGlobalOLEExcludeList; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index 669950f9752e..047814d3b1ac 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -260,6 +260,8 @@ namespace sw SW_DLLPUBLIC Color* GetActiveRetoucheColor(); } +extern bool g_bNoInterrupt; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index a2321ce13531..ef1d46dd81a3 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -665,6 +665,8 @@ VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions, bool bPreview); +extern bool bDocSzUpdated; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/core/Test-BigPtrArray.cxx b/sw/qa/core/Test-BigPtrArray.cxx index d22daa6c93b4..89fe504da89a 100644 --- a/sw/qa/core/Test-BigPtrArray.cxx +++ b/sw/qa/core/Test-BigPtrArray.cxx @@ -597,11 +597,11 @@ public: CPPUNIT_TEST_SUITE_END(); }; -const char* START = "START: "; -const char* END = "END: "; - #if defined TIMELOG +const char* const START = "START: "; +const char* const END = "END: "; + class PerformanceTracer { public: diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 81803830850c..675073ca072b 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -40,7 +40,7 @@ * Maps database URIs to the registered database names for quick lookups */ typedef std::map<OUString, OUString> DBuriMap; -DBuriMap aDBuriMap; +static DBuriMap aDBuriMap; class MMTest : public SwModelTestBase { diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 09768730a6de..44c935c6deac 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -445,9 +445,9 @@ std::vector<SvGlobalName*> *pGlobalOLEExcludeList = nullptr; SwAutoCompleteWord* SwDoc::mpACmpltWords = nullptr; SwCheckIt* pCheckIt = nullptr; -CharClass* pAppCharClass = nullptr; +static CharClass* pAppCharClass = nullptr; -CollatorWrapper* pCollator = nullptr, +static CollatorWrapper* pCollator = nullptr, *pCaseCollator = nullptr; salhelper::SingletonRef<SwCalendarWrapper>* s_getCalendarWrapper() diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index bb0c9af57533..ea21991763c2 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -317,7 +317,8 @@ struct CmpOptionsContainer SwCompareMode eCmpMode; int nIgnoreLen; bool bUseRsid; -} CmpOptions; +}; +static CmpOptionsContainer CmpOptions; class CommonSubseq { diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 5472e05dac62..67628bfe5055 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -18,6 +18,7 @@ */ #include <cmdid.h> +#include <init.hxx> #include <svx/svdmodel.hxx> #include <editeng/ulspitem.hxx> #include <editeng/paperinf.hxx> @@ -683,12 +684,6 @@ SwPageDesc* SwDoc::MakePageDesc(const OUString &rName, const SwPageDesc *pCpy, return pNew; } -// We collect the GlobalNames of the servers at runtime, who don't want to be notified -// about printer changes. Thereby saving loading a lot of objects (luckily all foreign -// objects are mapped to one ID). -// Initialisation and deinitialisation can be found in init.cxx -extern std::vector<SvGlobalName*> *pGlobalOLEExcludeList; - void SwDoc::PrtOLENotify( bool bAll ) { SwFEShell *pShell = nullptr; diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index a2ce70de6b28..de3e7af81986 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -595,7 +595,7 @@ OUString SwAuthorityField::GetDescription() const return SW_RES(STR_AUTHORITY_ENTRY); } -const char* aFieldNames[] = +const char* const aFieldNames[] = { "Identifier", "BibiliographicType", diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 06f1a4bd7e59..d8cc238366c3 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -64,6 +64,7 @@ #include <fmtcnct.hxx> #include <docary.hxx> #include <tblsel.hxx> +#include <swmodule.hxx> #include <swtable.hxx> #include <flyfrms.hxx> #include "fesh.hxx" @@ -157,7 +158,6 @@ static void lcl_GrabCursor( SwFEShell* pSh, SwFlyFrame* pOldSelFly) { // now call set macro if applicable pSh->GetFlyMacroLnk().Call( static_cast<const SwFlyFrameFormat*>(pFlyFormat) ); -extern bool g_bNoInterrupt; // in swmodule.cxx // if a dialog was started inside a macro, then // MouseButtonUp arrives at macro and not to us. Therefore // flag is always set here and will never be switched to diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 417ec4ac8f24..86c4fd7e3861 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -28,6 +28,7 @@ #include <editeng/brushitem.hxx> #include <editeng/frmdiritem.hxx> #include <svtools/ruler.hxx> +#include <fetab.hxx> #include <swwait.hxx> #include <fmtfsize.hxx> #include <fmtornt.hxx> @@ -72,13 +73,13 @@ using namespace ::com::sun::star; inline bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; } // table column cache -SwTabCols *pLastCols = nullptr; +static SwTabCols *pLastCols = nullptr; const SwTable *g_pColumnCacheLastTable = nullptr; const SwTabFrame *g_pColumnCacheLastTabFrame = nullptr; const SwFrame *g_pColumnCacheLastCellFrame = nullptr; // table row cache -SwTabCols *pLastRows = nullptr; +static SwTabCols *pLastRows = nullptr; const SwTable *g_pRowCacheLastTable = nullptr; const SwTabFrame *g_pRowCacheLastTabFrame = nullptr; const SwFrame *g_pRowCacheLastCellFrame = nullptr; diff --git a/sw/source/core/inc/fetab.hxx b/sw/source/core/inc/fetab.hxx new file mode 100644 index 000000000000..02a205b09089 --- /dev/null +++ b/sw/source/core/inc/fetab.hxx @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_SW_SOURCE_CORE_INC_FETAB_HXX +#define INCLUDED_SW_SOURCE_CORE_INC_FETAB_HXX + +#include <sal/config.h> + +class SwFrame; +class SwTabFrame; +class SwTable; + +extern SwFrame const * g_pColumnCacheLastCellFrame; +extern SwTabFrame const * g_pColumnCacheLastTabFrame; +extern SwTable const * g_pColumnCacheLastTable; +extern SwFrame const * g_pRowCacheLastCellFrame; +extern SwTabFrame const * g_pRowCacheLastTabFrame; +extern SwTable const * g_pRowCacheLastTable; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index c99bf110a1fb..ed803b300ac5 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -112,6 +112,8 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, sal_uLong nIndex, void MakeFrames( SwDoc *pDoc, const SwNodeIndex &rSttIdx, const SwNodeIndex &rEndIdx ); +extern bool bObjsDirect; + // prevent creation of Flys in InsertCnt_, e.g. for table headlines extern bool bDontCreateObjects; diff --git a/sw/source/core/inc/paintfrm.hxx b/sw/source/core/inc/paintfrm.hxx index 941b60c29300..b7d6097fd5a5 100644 --- a/sw/source/core/inc/paintfrm.hxx +++ b/sw/source/core/inc/paintfrm.hxx @@ -20,6 +20,8 @@ #ifndef INCLUDED_SW_SOURCE_CORE_INC_PAINTFRM_HXX #define INCLUDED_SW_SOURCE_CORE_INC_PAINTFRM_HXX +extern Color aGlobalRetoucheColor; + void SwCalcPixStatics( OutputDevice *pOut ); #endif // INCLUDED_SW_SOURCE_CORE_INC_PAINTFRM_HXX diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx index f443036a77fe..28a932af1951 100644 --- a/sw/source/core/layout/hffrm.cxx +++ b/sw/source/core/layout/hffrm.cxx @@ -33,8 +33,6 @@ #include <objectformatter.hxx> #include <o3tl/make_unique.hxx> -extern bool bObjsDirect; //frmtool.cxx - static SwTwips lcl_GetFrameMinHeight(const SwLayoutFrame & rFrame) { const SwFormatFrameSize &rSz = rFrame.GetFormat()->GetFrameSize(); diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 4583a5db0219..0a501a40ae08 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -24,6 +24,7 @@ #include "swtable.hxx" #include "dflyobj.hxx" #include <anchoreddrawobject.hxx> +#include <fetab.hxx> #include <fmtanchr.hxx> #include "viewopt.hxx" #include "hints.hxx" @@ -122,13 +123,6 @@ SwTabFrame::SwTabFrame( SwTabFrame &rTab ) rTab.SetFollow( this ); } -extern const SwTable *g_pColumnCacheLastTable; -extern const SwTabFrame *g_pColumnCacheLastTabFrame; -extern const SwFrame *g_pColumnCacheLastCellFrame; -extern const SwTable *g_pRowCacheLastTable; -extern const SwTabFrame *g_pRowCacheLastTabFrame; -extern const SwFrame *g_pRowCacheLastCellFrame; - void SwTabFrame::DestroyImpl() { // There is some terrible code in fetab.cxx, that diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index a69d2e6535ec..6e731a889cdd 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -83,7 +83,7 @@ public: void RemoveObj( SwOLEObj& rObj ); }; -std::shared_ptr<SwOLELRUCache> g_pOLELRU_Cache; +static std::shared_ptr<SwOLELRUCache> g_pOLELRU_Cache; class SwOLEListener_Impl : public ::cppu::WeakImplHelper< embed::XStateChangeListener > { diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index d12cdb735e64..855d4d4cd096 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -37,6 +37,7 @@ #include <editeng/unolingu.hxx> #include <breakit.hxx> #include <editeng/forbiddenruleitem.hxx> +#include <paintfrm.hxx> #include <txatbase.hxx> #include <fmtinfmt.hxx> #include <swmodule.hxx> @@ -528,8 +529,6 @@ SwTextPaintInfo::SwTextPaintInfo( SwTextFrame *pFrame, const SwRect &rPaint ) CtorInitTextPaintInfo( pFrame->getRootFrame()->GetCurrShell()->GetOut(), pFrame, rPaint ); } -extern Color aGlobalRetoucheColor; - /// Returns if the current background color is dark. static bool lcl_IsDarkBackground( const SwTextPaintInfo& rInf ) { diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index e89a7628027b..152e92c81d14 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -32,6 +32,7 @@ #include <com/sun/star/i18n/CharacterIteratorMode.hpp> #include <com/sun/star/i18n/WordType.hpp> #include <breakit.hxx> +#include <paintfrm.hxx> #include <viewsh.hxx> #include <viewopt.hxx> #include <fntcache.hxx> @@ -2492,8 +2493,6 @@ sal_Int32 SwFont::GetTextBreak( SwDrawTextInfo& rInf, long nTextWidth ) return nTextBreak2; } -extern Color aGlobalRetoucheColor; - bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont ) { const vcl::Font& rFnt = pFont ? *pFont : GetOut().GetFont(); diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 9e7723c9297c..bd8aa85061c9 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -209,7 +209,7 @@ private: }; -sal_uInt16 aSave_BoxContentSet[] = { +sal_uInt16 const aSave_BoxContentSet[] = { RES_CHRATR_COLOR, RES_CHRATR_CROSSEDOUT, RES_CHRATR_FONT, RES_CHRATR_FONTSIZE, RES_CHRATR_POSTURE, RES_CHRATR_POSTURE, @@ -1276,7 +1276,7 @@ void SaveBox::RestoreAttr( SwTableBox& rBox, SaveTable& rSTable ) std::shared_ptr<SfxItemSet> pSet( (*Ptrs.pContentAttrs)[ nSet++ ] ); if( pSet ) { - sal_uInt16 *pRstAttr = aSave_BoxContentSet; + sal_uInt16 const *pRstAttr = aSave_BoxContentSet; while( *pRstAttr ) { pCNd->ResetAttr( *pRstAttr, *(pRstAttr+1) ); diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 2d362a24a313..5a5b1adef23b 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -90,7 +90,7 @@ bool SwViewShell::mbLstAct = false; ShellResource *SwViewShell::mpShellRes = nullptr; vcl::DeleteOnDeinit< VclPtr<vcl::Window> > SwViewShell::mpCareWindow(new VclPtr<vcl::Window>); -bool bInSizeNotify = false; +static bool bInSizeNotify = false; using namespace ::com::sun::star; diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 3b896eb32953..707ffd3bfba5 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -67,7 +67,7 @@ Reader* GetWW8Reader(); // Note: if editing, please don't forget to modify also the enum // ReaderWriterEnum and aFilterDetect in shellio.hxx -SwReaderWriterEntry aReaderWriter[] = +static SwReaderWriterEntry aReaderWriter[] = { SwReaderWriterEntry( &::GetRTFReader, &::GetRTFWriter, true ), SwReaderWriterEntry( nullptr, &::GetASCWriter, false ), diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 32eebd796318..15c4ce8d51f2 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -123,8 +123,6 @@ namespace o3tl { #define DOT_LEADERS_MAX_WIDTH 18 -extern SwAttrFnTab aCSS1AttrFnTab; - static Writer& OutCSS1_SwFormat( Writer& rWrt, const SwFormat& rFormat, IDocumentStylePoolAccess /*SwDoc*/ *pDoc, SwDoc *pTemplate ); static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rFormat, @@ -482,68 +480,6 @@ void SwHTMLWriter::OutCSS1_PixelProperty( const sal_Char *pProp, long nVal, OutCSS1_PropertyAscii(pProp, sOut); } -void SwHTMLWriter::OutCSS1_SfxItemSet( const SfxItemSet& rItemSet, - bool bDeep ) -{ - // print ItemSet, including all attributes - Out_SfxItemSet( aCSS1AttrFnTab, *this, rItemSet, bDeep ); - - // some Attributes require special treatment - const SfxPoolItem *pItem = nullptr; - - // Underline, Overline, CrossedOut and Blink form together a CSS1-Property - // (doesn't work of course for Hints) - if( !IsCSS1Source(CSS1_OUTMODE_HINT) ) - { - const SvxUnderlineItem *pUnderlineItem = nullptr; - if( SfxItemState::SET==rItemSet.GetItemState( RES_CHRATR_UNDERLINE, bDeep, &pItem )) - pUnderlineItem = static_cast<const SvxUnderlineItem *>(pItem); - - const SvxOverlineItem *pOverlineItem = nullptr; - if( SfxItemState::SET==rItemSet.GetItemState( RES_CHRATR_OVERLINE, bDeep, &pItem )) - pOverlineItem = static_cast<const SvxOverlineItem *>(pItem); - - const SvxCrossedOutItem *pCrossedOutItem = nullptr; - if( SfxItemState::SET==rItemSet.GetItemState( RES_CHRATR_CROSSEDOUT, bDeep, &pItem )) - pCrossedOutItem = static_cast<const SvxCrossedOutItem *>(pItem); - - const SvxBlinkItem *pBlinkItem = nullptr; - if( SfxItemState::SET==rItemSet.GetItemState( RES_CHRATR_BLINK, bDeep, &pItem )) - pBlinkItem = static_cast<const SvxBlinkItem *>(pItem); - - if( pUnderlineItem || pOverlineItem || pCrossedOutItem || pBlinkItem ) - OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( *this, pUnderlineItem, - pOverlineItem, - pCrossedOutItem, - pBlinkItem ); - - OutCSS1_SvxFormatBreak_SwFormatPDesc_SvxFormatKeep( *this, rItemSet, bDeep ); - } - - if( !m_bFirstCSS1Property ) - { - // if a Property was exported as part of a Style-Option, - // the Option still needs to be finished - OStringBuffer sOut; - switch( m_nCSS1OutMode & CSS1_OUTMODE_ANY_OFF ) - { - case CSS1_OUTMODE_SPAN_TAG_OFF: - sOut.append(sCSS1_span_tag_end); - break; - - case CSS1_OUTMODE_STYLE_OPT_OFF: - sOut.append(cCSS1_style_opt_end); - break; - - case CSS1_OUTMODE_RULE_OFF: - sOut.append(sCSS1_rule_end); - break; - } - if (!sOut.isEmpty()) - Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); - } -} - void SwHTMLWriter::OutStyleSheet( const SwPageDesc& rPageDesc ) { m_bFirstCSS1Rule = true; @@ -1887,37 +1823,6 @@ Writer& OutCSS1_ParaTagStyleOpt( Writer& rWrt, const SfxItemSet& rItemSet ) return rWrt; } -Writer& OutCSS1_HintSpanTag( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); - - SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_SPAN_TAG | - CSS1_OUTMODE_ENCODE|CSS1_OUTMODE_HINT, nullptr ); - - Out( aCSS1AttrFnTab, rHt, rWrt ); - - if( !rHTMLWrt.m_bFirstCSS1Property && rHTMLWrt.m_bTagOn ) - rWrt.Strm().WriteCharPtr( sCSS1_span_tag_end ); - - return rWrt; -} - -Writer& OutCSS1_HintStyleOpt( Writer& rWrt, const SfxPoolItem& rHt ) -{ - SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); - - SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_STYLE_OPT_ON | - CSS1_OUTMODE_ENCODE| - CSS1_OUTMODE_HINT, nullptr ); - - Out( aCSS1AttrFnTab, rHt, rWrt ); - - if( !rHTMLWrt.m_bFirstCSS1Property ) - rWrt.Strm().WriteChar( '\"' ); - - return rWrt; -} - // Wrapper for Table background Writer& OutCSS1_TableBGStyleOpt( Writer& rWrt, const SfxPoolItem& rHt ) { @@ -3580,7 +3485,7 @@ static Writer& OutCSS1_SvxFrameDirection( Writer& rWrt, const SfxPoolItem& rHt ) * They are local structures, only needed within the HTML-DLL. */ -SwAttrFnTab aCSS1AttrFnTab = { +static SwAttrFnTab const aCSS1AttrFnTab = { /* RES_CHRATR_CASEMAP */ OutCSS1_SvxCaseMap, /* RES_CHRATR_CHARSETCOLOR */ nullptr, /* RES_CHRATR_COLOR */ OutCSS1_SvxColor, @@ -3739,4 +3644,97 @@ SwAttrFnTab aCSS1AttrFnTab = { /* RES_BOXATR_VALUE */ nullptr }; +void SwHTMLWriter::OutCSS1_SfxItemSet( const SfxItemSet& rItemSet, + bool bDeep ) +{ + // print ItemSet, including all attributes + Out_SfxItemSet( aCSS1AttrFnTab, *this, rItemSet, bDeep ); + + // some Attributes require special treatment + const SfxPoolItem *pItem = nullptr; + + // Underline, Overline, CrossedOut and Blink form together a CSS1-Property + // (doesn't work of course for Hints) + if( !IsCSS1Source(CSS1_OUTMODE_HINT) ) + { + const SvxUnderlineItem *pUnderlineItem = nullptr; + if( SfxItemState::SET==rItemSet.GetItemState( RES_CHRATR_UNDERLINE, bDeep, &pItem )) + pUnderlineItem = static_cast<const SvxUnderlineItem *>(pItem); + + const SvxOverlineItem *pOverlineItem = nullptr; + if( SfxItemState::SET==rItemSet.GetItemState( RES_CHRATR_OVERLINE, bDeep, &pItem )) + pOverlineItem = static_cast<const SvxOverlineItem *>(pItem); + + const SvxCrossedOutItem *pCrossedOutItem = nullptr; + if( SfxItemState::SET==rItemSet.GetItemState( RES_CHRATR_CROSSEDOUT, bDeep, &pItem )) + pCrossedOutItem = static_cast<const SvxCrossedOutItem *>(pItem); + + const SvxBlinkItem *pBlinkItem = nullptr; + if( SfxItemState::SET==rItemSet.GetItemState( RES_CHRATR_BLINK, bDeep, &pItem )) + pBlinkItem = static_cast<const SvxBlinkItem *>(pItem); + + if( pUnderlineItem || pOverlineItem || pCrossedOutItem || pBlinkItem ) + OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( *this, pUnderlineItem, + pOverlineItem, + pCrossedOutItem, + pBlinkItem ); + + OutCSS1_SvxFormatBreak_SwFormatPDesc_SvxFormatKeep( *this, rItemSet, bDeep ); + } + + if( !m_bFirstCSS1Property ) + { + // if a Property was exported as part of a Style-Option, + // the Option still needs to be finished + OStringBuffer sOut; + switch( m_nCSS1OutMode & CSS1_OUTMODE_ANY_OFF ) + { + case CSS1_OUTMODE_SPAN_TAG_OFF: + sOut.append(sCSS1_span_tag_end); + break; + + case CSS1_OUTMODE_STYLE_OPT_OFF: + sOut.append(cCSS1_style_opt_end); + break; + + case CSS1_OUTMODE_RULE_OFF: + sOut.append(sCSS1_rule_end); + break; + } + if (!sOut.isEmpty()) + Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); + } +} + +Writer& OutCSS1_HintSpanTag( Writer& rWrt, const SfxPoolItem& rHt ) +{ + SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); + + SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_SPAN_TAG | + CSS1_OUTMODE_ENCODE|CSS1_OUTMODE_HINT, nullptr ); + + Out( aCSS1AttrFnTab, rHt, rWrt ); + + if( !rHTMLWrt.m_bFirstCSS1Property && rHTMLWrt.m_bTagOn ) + rWrt.Strm().WriteCharPtr( sCSS1_span_tag_end ); + + return rWrt; +} + +Writer& OutCSS1_HintStyleOpt( Writer& rWrt, const SfxPoolItem& rHt ) +{ + SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt); + + SwCSS1OutMode aMode( rHTMLWrt, CSS1_OUTMODE_STYLE_OPT_ON | + CSS1_OUTMODE_ENCODE| + CSS1_OUTMODE_HINT, nullptr ); + + Out( aCSS1AttrFnTab, rHt, rWrt ); + + if( !rHTMLWrt.m_bFirstCSS1Property ) + rWrt.Strm().WriteChar( '\"' ); + + return rWrt; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 6c40de25126b..286c0b19b415 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -69,6 +69,7 @@ #include <swtable.hxx> #include "fldbas.hxx" #include <breakit.hxx> +#include <htmlatr.hxx> #include <htmlnum.hxx> #include <wrthtml.hxx> #include <htmlfly.hxx> @@ -82,7 +83,7 @@ using namespace css; -HTMLOutEvent aAnchorEventTable[] = +HTMLOutEvent const aAnchorEventTable[] = { { OOO_STRING_SVTOOLS_HTML_O_SDonclick, OOO_STRING_SVTOOLS_HTML_O_onclick, SFX_EVENT_MOUSECLICK_OBJECT }, { OOO_STRING_SVTOOLS_HTML_O_SDonmouseover, OOO_STRING_SVTOOLS_HTML_O_onmouseover, SFX_EVENT_MOUSEOVER_OBJECT }, diff --git a/sw/source/filter/html/htmlatr.hxx b/sw/source/filter/html/htmlatr.hxx new file mode 100644 index 000000000000..642a7c048ea2 --- /dev/null +++ b/sw/source/filter/html/htmlatr.hxx @@ -0,0 +1,21 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_SW_SOURCE_FILTER_HTML_HTMLATR_HXX +#define INCLUDED_SW_SOURCE_FILTER_HTML_HTMLATR_HXX + +#include <sal/config.h> + +struct HTMLOutEvent; + +extern HTMLOutEvent const aAnchorEventTable[]; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index a70d868ecfd0..175d4d43eca6 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -61,6 +61,7 @@ #include "frmfmt.hxx" #include "wrthtml.hxx" #include "css1kywd.hxx" +#include "htmlatr.hxx" #include "htmlfly.hxx" using namespace css; @@ -141,8 +142,6 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF static Writer& OutHTML_FrameFormatAsMarquee( Writer& rWrt, const SwFrameFormat& rFrameFormat, const SdrObject& rSdrObj ); -extern HTMLOutEvent aAnchorEventTable[]; - static HTMLOutEvent aImageEventTable[] = { { OOO_STRING_SVTOOLS_HTML_O_SDonload, OOO_STRING_SVTOOLS_HTML_O_onload, SVX_EVENT_IMAGE_LOAD }, diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx index 503b5c68c26c..cf4acf222c63 100644 --- a/sw/source/filter/ww8/docxexportfilter.cxx +++ b/sw/source/filter/ww8/docxexportfilter.cxx @@ -107,7 +107,7 @@ uno::Reference< uno::XInterface > SAL_CALL DocxExport_createInstance(const uno:: extern "C" { -::cppu::ImplementationEntry entries [] = +::cppu::ImplementationEntry const entries [] = { { DocxExport_createInstance, DocxExport_getImplementationName, diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index cad9ce17ea9d..6451c5ba4160 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -72,7 +72,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport, while( nIndex < nCount ) { - SvXMLItemMapEntry& rEntry = mrMapEntries->getByIndex( nIndex ); + SvXMLItemMapEntry const & rEntry = mrMapEntries->getByIndex( nIndex ); // we have a valid map entry here, so lets use it... if( 0 == (rEntry.nMemberId & MID_SW_FLAG_NO_ITEM_EXPORT) ) @@ -228,7 +228,7 @@ void SvXMLExportItemMapper::exportElementItems( for( size_t nIndex = 0; nIndex < nCount; ++nIndex ) { const sal_uInt16 nElement = rIndexArray[ nIndex ]; - SvXMLItemMapEntry& rEntry = mrMapEntries->getByIndex( nElement ); + SvXMLItemMapEntry const & rEntry = mrMapEntries->getByIndex( nElement ); OSL_ENSURE( 0 != (rEntry.nMemberId & MID_SW_FLAG_ELEMENT_ITEM_EXPORT), "wrong mid flag!" ); diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index bb0f51e7b596..1dc92acb65b7 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -95,7 +95,7 @@ void SvXMLImportItemMapper::importXML( SfxItemSet& rSet, const OUString& rValue = xAttrList->getValueByIndex( i ); // find a map entry for this attribute - SvXMLItemMapEntry* pEntry = mrMapEntries->getByName( nPrefix, aLocalName ); + SvXMLItemMapEntry const * pEntry = mrMapEntries->getByName( nPrefix, aLocalName ); if( pEntry ) { diff --git a/sw/source/filter/xml/xmlitem.cxx b/sw/source/filter/xml/xmlitem.cxx index 7e674ac05944..bc5fdca40e03 100644 --- a/sw/source/filter/xml/xmlitem.cxx +++ b/sw/source/filter/xml/xmlitem.cxx @@ -47,7 +47,7 @@ SvXMLImportContext *SvXMLItemSetContext::CreateChildContext( sal_uInt16 nPrefix, const uno::Reference< xml::sax::XAttributeList >& xAttrList ) { SvXMLItemMapEntriesRef xMapEntries = rIMapper.getMapEntries(); - SvXMLItemMapEntry* pEntry = xMapEntries->getByName( nPrefix, rLocalName ); + SvXMLItemMapEntry const * pEntry = xMapEntries->getByName( nPrefix, rLocalName ); if( pEntry && 0 != (pEntry->nMemberId & MID_SW_FLAG_ELEMENT_ITEM_IMPORT) ) { diff --git a/sw/source/filter/xml/xmliteme.cxx b/sw/source/filter/xml/xmliteme.cxx index 5db0f19592c4..f9f22ca9e21b 100644 --- a/sw/source/filter/xml/xmliteme.cxx +++ b/sw/source/filter/xml/xmliteme.cxx @@ -45,10 +45,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::xmloff::token; -extern SvXMLItemMapEntry aXMLTableItemMap[]; -extern SvXMLItemMapEntry aXMLTableRowItemMap[]; -extern SvXMLItemMapEntry aXMLTableCellItemMap[]; - class SwXMLTableItemMapper_Impl: public SvXMLExportItemMapper { SwXMLBrushItemExport aBrushItemExport; diff --git a/sw/source/filter/xml/xmlitemi.cxx b/sw/source/filter/xml/xmlitemi.cxx index c03be01fd940..fe218c4c1627 100644 --- a/sw/source/filter/xml/xmlitemi.cxx +++ b/sw/source/filter/xml/xmlitemi.cxx @@ -52,11 +52,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -extern SvXMLItemMapEntry aXMLTableItemMap[]; -extern SvXMLItemMapEntry aXMLTableColItemMap[]; -extern SvXMLItemMapEntry aXMLTableRowItemMap[]; -extern SvXMLItemMapEntry aXMLTableCellItemMap[]; - class SwXMLImportTableItemMapper_Impl: public SvXMLImportItemMapper { diff --git a/sw/source/filter/xml/xmlitemm.cxx b/sw/source/filter/xml/xmlitemm.cxx index f9eca77615ae..2cb294ac85d6 100644 --- a/sw/source/filter/xml/xmlitemm.cxx +++ b/sw/source/filter/xml/xmlitemm.cxx @@ -39,7 +39,7 @@ using namespace ::xmloff::token; #define M_END { 0, XML_TOKEN_INVALID, 0, 0 } -SvXMLItemMapEntry aXMLTableItemMap[] = +SvXMLItemMapEntry const aXMLTableItemMap[] = { // RES_FILL_ORDER // not required @@ -119,14 +119,14 @@ SvXMLItemMapEntry aXMLTableItemMap[] = M_END }; -SvXMLItemMapEntry aXMLTableColItemMap[] = +SvXMLItemMapEntry const aXMLTableColItemMap[] = { M_E_SI( STYLE, COLUMN_WIDTH, RES_FRM_SIZE, MID_FRMSIZE_COL_WIDTH ), MAP_ENTRY( STYLE, REL_COLUMN_WIDTH, RES_FRM_SIZE, MID_FRMSIZE_REL_COL_WIDTH ), M_END }; -SvXMLItemMapEntry aXMLTableRowItemMap[] = +SvXMLItemMapEntry const aXMLTableRowItemMap[] = { // RES_FILL_ORDER // not required @@ -198,7 +198,7 @@ SvXMLItemMapEntry aXMLTableRowItemMap[] = M_END }; -SvXMLItemMapEntry aXMLTableCellItemMap[] = +SvXMLItemMapEntry const aXMLTableCellItemMap[] = { // RES_FILL_ORDER // not required diff --git a/sw/source/filter/xml/xmlitmap.hxx b/sw/source/filter/xml/xmlitmap.hxx index abba74e887c5..bfb38e9f5218 100644 --- a/sw/source/filter/xml/xmlitmap.hxx +++ b/sw/source/filter/xml/xmlitmap.hxx @@ -62,18 +62,23 @@ protected: std::unique_ptr<SvXMLItemMapEntries_impl> mpImpl; public: - explicit SvXMLItemMapEntries(SvXMLItemMapEntry* pEntrys); + explicit SvXMLItemMapEntries(SvXMLItemMapEntry const * pEntrys); virtual ~SvXMLItemMapEntries() override; - SvXMLItemMapEntry* getByName( sal_uInt16 nNameSpace, + SvXMLItemMapEntry const * getByName( sal_uInt16 nNameSpace, const OUString& rString ) const; - SvXMLItemMapEntry& getByIndex( sal_uInt16 nIndex ) const; + SvXMLItemMapEntry const & getByIndex( sal_uInt16 nIndex ) const; sal_uInt16 getCount() const; }; typedef tools::SvRef<SvXMLItemMapEntries> SvXMLItemMapEntriesRef; +extern SvXMLItemMapEntry const aXMLTableItemMap[]; +extern SvXMLItemMapEntry const aXMLTableColItemMap[]; +extern SvXMLItemMapEntry const aXMLTableRowItemMap[]; +extern SvXMLItemMapEntry const aXMLTableCellItemMap[]; + #endif // INCLUDED_SW_SOURCE_FILTER_XML_XMLITMAP_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/xml/xmlitmpr.cxx b/sw/source/filter/xml/xmlitmpr.cxx index bd4f10922c1b..100fc7636564 100644 --- a/sw/source/filter/xml/xmlitmpr.cxx +++ b/sw/source/filter/xml/xmlitmpr.cxx @@ -27,11 +27,11 @@ using ::xmloff::token::XML_TOKEN_INVALID; class SvXMLItemMapEntries_impl { public: - SvXMLItemMapEntry* mpEntries; + SvXMLItemMapEntry const * mpEntries; sal_uInt16 mnCount; }; -SvXMLItemMapEntries::SvXMLItemMapEntries( SvXMLItemMapEntry* pEntries ) +SvXMLItemMapEntries::SvXMLItemMapEntries( SvXMLItemMapEntry const * pEntries ) : mpImpl( new SvXMLItemMapEntries_impl ) { mpImpl->mpEntries = pEntries; @@ -48,10 +48,10 @@ SvXMLItemMapEntries::~SvXMLItemMapEntries() { } -SvXMLItemMapEntry* SvXMLItemMapEntries::getByName( sal_uInt16 nNameSpace, +SvXMLItemMapEntry const * SvXMLItemMapEntries::getByName( sal_uInt16 nNameSpace, const OUString& rString ) const { - SvXMLItemMapEntry* pMap = mpImpl->mpEntries; + SvXMLItemMapEntry const * pMap = mpImpl->mpEntries; while( pMap && (pMap->eLocalName != XML_TOKEN_INVALID) ) { if( pMap->nNameSpace == nNameSpace && @@ -63,7 +63,7 @@ SvXMLItemMapEntry* SvXMLItemMapEntries::getByName( sal_uInt16 nNameSpace, return (pMap && (pMap->eLocalName != XML_TOKEN_INVALID)) ? pMap : nullptr; } -SvXMLItemMapEntry& SvXMLItemMapEntries::getByIndex( sal_uInt16 nIndex ) const +SvXMLItemMapEntry const & SvXMLItemMapEntries::getByIndex( sal_uInt16 nIndex ) const { return mpImpl->mpEntries[nIndex]; } diff --git a/sw/source/ui/dialog/swdialmgr.cxx b/sw/source/ui/dialog/swdialmgr.cxx index 16f11e0ca3c6..d9c86575cb6e 100644 --- a/sw/source/ui/dialog/swdialmgr.cxx +++ b/sw/source/ui/dialog/swdialmgr.cxx @@ -18,6 +18,7 @@ */ #include "dialmgr.hxx" +#include "swtypes.hxx" #include <tools/resmgr.hxx> #ifndef DISABLE_DYNLOADING diff --git a/sw/source/ui/vba/service.cxx b/sw/source/ui/vba/service.cxx index f40660b5264f..3f45eb0563ff 100644 --- a/sw/source/ui/vba/service.cxx +++ b/sw/source/ui/vba/service.cxx @@ -20,35 +20,12 @@ #include <osl/diagnose.h> #include <comphelper/servicedecl.hxx> +#include <service.hxx> + // component exports namespace sdecl = comphelper::service_decl; -namespace globals -{ -extern sdecl::ServiceDecl const serviceDecl; -} - -namespace document -{ -extern sdecl::ServiceDecl const serviceDecl; -} - -namespace wrapformat -{ -extern sdecl::ServiceDecl const serviceDecl; -} - -namespace vbaeventshelper -{ -extern sdecl::ServiceDecl const serviceDecl; -} - -namespace vbaeventshelper -{ -extern sdecl::ServiceDecl const serviceDecl; -} - extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL vbaswobj_component_getFactory( const sal_Char * pImplName, void *, void *) { diff --git a/sw/source/ui/vba/service.hxx b/sw/source/ui/vba/service.hxx new file mode 100644 index 000000000000..eee1f816410d --- /dev/null +++ b/sw/source/ui/vba/service.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_SW_SOURCE_UI_VBA_SERVICE_HXX +#define INCLUDED_SW_SOURCE_UI_VBA_SERVICE_HXX + +#include <sal/config.h> + +namespace comphelper { namespace service_decl { class ServiceDecl; } } + +namespace document { +extern comphelper::service_decl::ServiceDecl const serviceDecl; +} + +namespace globals { +extern comphelper::service_decl::ServiceDecl const serviceDecl; +} + +namespace vbaeventshelper { +extern comphelper::service_decl::ServiceDecl const serviceDecl; +} + +namespace wrapformat { +extern comphelper::service_decl::ServiceDecl const serviceDecl; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx index 56b2fad83bfa..b70c9623e6d8 100644 --- a/sw/source/ui/vba/vbadocument.cxx +++ b/sw/source/ui/vba/vbadocument.cxx @@ -16,6 +16,10 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + +#include <sal/config.h> + +#include "service.hxx" #include "vbadocument.hxx" #include "vbarange.hxx" #include "vbarangehelper.hxx" @@ -158,8 +162,8 @@ SwVbaDocument::Bookmarks( const uno::Any& rIndex ) throw ( uno::RuntimeException uno::Any SAL_CALL SwVbaDocument::Variables( const uno::Any& rIndex ) throw ( uno::RuntimeException, std::exception ) { - uno::Reference< document::XDocumentPropertiesSupplier > xDocumentPropertiesSupplier( getModel(),uno::UNO_QUERY_THROW ); - uno::Reference< document::XDocumentProperties > xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties(); + uno::Reference< css::document::XDocumentPropertiesSupplier > xDocumentPropertiesSupplier( getModel(),uno::UNO_QUERY_THROW ); + uno::Reference< css::document::XDocumentProperties > xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties(); uno::Reference< beans::XPropertyAccess > xUserDefined( xDocumentProperties->getUserDefinedProperties(), uno::UNO_QUERY_THROW ); uno::Reference< XCollection > xVariables( new SwVbaVariables( this, mxContext, xUserDefined ) ); @@ -251,9 +255,9 @@ uno::Any SAL_CALL SwVbaDocument::getAttachedTemplate() throw (uno::RuntimeException, std::exception) { uno::Reference< word::XTemplate > xTemplate; - uno::Reference<document::XDocumentPropertiesSupplier> const xDocPropSupp( + uno::Reference<css::document::XDocumentPropertiesSupplier> const xDocPropSupp( getModel(), uno::UNO_QUERY_THROW); - uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW ); + uno::Reference< css::document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW ); OUString sTemplateUrl = xDocProps->getTemplateURL(); xTemplate = new SwVbaTemplate( this, mxContext, sTemplateUrl ); @@ -278,9 +282,9 @@ SwVbaDocument::setAttachedTemplate( const css::uno::Any& _attachedtemplate ) thr osl::FileBase::getFileURLFromSystemPath( sTemplate, aURL ); uno::Reference< word::XTemplate > xTemplate; - uno::Reference<document::XDocumentPropertiesSupplier> const xDocPropSupp( + uno::Reference<css::document::XDocumentPropertiesSupplier> const xDocPropSupp( getModel(), uno::UNO_QUERY_THROW ); - uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW ); + uno::Reference< css::document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW ); xDocProps->setTemplateURL( aURL ); } @@ -391,7 +395,7 @@ void SAL_CALL SwVbaDocument::ClosePrintPreview( ) throw (uno::RuntimeException, uno::Any SAL_CALL SwVbaDocument::Revisions( const uno::Any& index ) throw (uno::RuntimeException, std::exception) { - uno::Reference< document::XRedlinesSupplier > xRedlinesSupp( mxTextDocument, uno::UNO_QUERY_THROW ); + uno::Reference< css::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() ) @@ -513,8 +517,8 @@ SwVbaDocument::getServiceNames() namespace document { namespace sdecl = comphelper::service_decl; -sdecl::vba_service_class_<SwVbaDocument, sdecl::with_args<true> > serviceImpl; -extern sdecl::ServiceDecl const serviceDecl( +sdecl::vba_service_class_<SwVbaDocument, sdecl::with_args<true> > const serviceImpl; +sdecl::ServiceDecl const serviceDecl( serviceImpl, "SwVbaDocument", "ooo.vba.word.Document" ); diff --git a/sw/source/ui/vba/vbaeventshelper.cxx b/sw/source/ui/vba/vbaeventshelper.cxx index 3af50f7b4087..04f3d5b1e53b 100644 --- a/sw/source/ui/vba/vbaeventshelper.cxx +++ b/sw/source/ui/vba/vbaeventshelper.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include "service.hxx" #include "vbaeventshelper.hxx" #include <com/sun/star/script/ModuleType.hpp> #include <com/sun/star/script/vba/VBAEventId.hpp> @@ -82,8 +85,8 @@ OUString SwVbaEventsHelper::implGetDocumentModuleName( const EventHandlerInfo& / namespace vbaeventshelper { namespace sdecl = comphelper::service_decl; -sdecl::inheritingClass_<SwVbaEventsHelper, sdecl::with_args<true> > serviceImpl; -extern sdecl::ServiceDecl const serviceDecl( +sdecl::inheritingClass_<SwVbaEventsHelper, sdecl::with_args<true> > const serviceImpl; +sdecl::ServiceDecl const serviceDecl( serviceImpl, "SwVbaEventsHelper", "com.sun.star.document.vba.VBATextEventProcessor" ); diff --git a/sw/source/ui/vba/vbaglobals.cxx b/sw/source/ui/vba/vbaglobals.cxx index 4b3310c2391f..a37eb5831b67 100644 --- a/sw/source/ui/vba/vbaglobals.cxx +++ b/sw/source/ui/vba/vbaglobals.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include <vbahelper/helperdecl.hxx> +#include "service.hxx" #include "vbaglobals.hxx" #include <osl/diagnose.h> #include <sal/macros.h> @@ -176,8 +177,8 @@ SwVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException, std::ex namespace globals { namespace sdecl = comphelper::service_decl; -sdecl::vba_service_class_<SwVbaGlobals, sdecl::with_args<true> > serviceImpl; -extern sdecl::ServiceDecl const serviceDecl( +sdecl::vba_service_class_<SwVbaGlobals, sdecl::with_args<true> > const serviceImpl; +sdecl::ServiceDecl const serviceDecl( serviceImpl, "SwVbaGlobals", "ooo.vba.word.Globals" ); diff --git a/sw/source/ui/vba/vbawrapformat.cxx b/sw/source/ui/vba/vbawrapformat.cxx index 0481f4053e80..2d411778d446 100644 --- a/sw/source/ui/vba/vbawrapformat.cxx +++ b/sw/source/ui/vba/vbawrapformat.cxx @@ -16,6 +16,10 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + +#include <sal/config.h> + +#include "service.hxx" #include "vbawrapformat.hxx" #include <ooo/vba/word/WdWrapSideType.hpp> #include <ooo/vba/word/WdWrapType.hpp> @@ -235,8 +239,8 @@ SwVbaWrapFormat::getServiceNames() namespace wrapformat { namespace sdecl = comphelper::service_decl; -sdecl::vba_service_class_<SwVbaWrapFormat, sdecl::with_args<true> > serviceImpl; -extern sdecl::ServiceDecl const serviceDecl( +sdecl::vba_service_class_<SwVbaWrapFormat, sdecl::with_args<true> > const serviceImpl; +sdecl::ServiceDecl const serviceDecl( serviceImpl, "SwVbaWrapFormat", "ooo.vba.word.WrapFormat" ); diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 2172c86653ce..a624f1bf7aa3 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -86,8 +86,6 @@ #include <paratr.hxx> #include <tblafmt.hxx> -extern bool g_bNoInterrupt; // in swmodule.cxx - using namespace ::com::sun::star; void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) diff --git a/sw/source/uibase/chrdlg/ccoll.cxx b/sw/source/uibase/chrdlg/ccoll.cxx index f3b13d03602f..5bcac8fdb9c2 100644 --- a/sw/source/uibase/chrdlg/ccoll.cxx +++ b/sw/source/uibase/chrdlg/ccoll.cxx @@ -42,7 +42,7 @@ //!! order of entries has to be the same as in //!! CommandStruct SwCondCollItem::aCmds[] -const char *aCommandContext[COND_COMMAND_COUNT] = +const char * const aCommandContext[COND_COMMAND_COUNT] = { "TableHeader", "Table", diff --git a/sw/source/uibase/dbui/mmconfigitem.cxx b/sw/source/uibase/dbui/mmconfigitem.cxx index 8ec681536569..e005507a50a3 100644 --- a/sw/source/uibase/dbui/mmconfigitem.cxx +++ b/sw/source/uibase/dbui/mmconfigitem.cxx @@ -55,11 +55,11 @@ using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; -const char* cAddressDataAssignments = "AddressDataAssignments"; -const char* cDBColumnAssignments = "DBColumnAssignments"; -const char* cDataSourceName = "DataSource/DataSourceName"; -const char* cDataTableName = "DataSource/DataTableName" ; -const char* cDataCommandType = "DataSource/DataCommandType"; +const char cAddressDataAssignments[] = "AddressDataAssignments"; +const char cDBColumnAssignments[] = "DBColumnAssignments"; +const char cDataSourceName[] = "DataSource/DataSourceName"; +const char cDataTableName[] = "DataSource/DataTableName" ; +const char cDataCommandType[] = "DataSource/DataCommandType"; #define SECURE_PORT 465 #define DEFAULT_PORT 25 @@ -284,7 +284,7 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() : } } //read the list of data base assignments - Sequence<OUString> aAssignments = GetNodeNames(OUString::createFromAscii(cAddressDataAssignments)); + Sequence<OUString> aAssignments = GetNodeNames(cAddressDataAssignments); if(aAssignments.getLength()) { //create a list of property names to load the URLs of all data bases @@ -294,18 +294,18 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() : sal_Int32 nAssign; for(nAssign = 0; nAssign < aAssignProperties.getLength(); nAssign += 4) { - OUString sAssignPath = OUString::createFromAscii(cAddressDataAssignments); + OUString sAssignPath = cAddressDataAssignments; sAssignPath += "/"; sAssignPath += pAssignments[nAssign / 4]; sAssignPath += "/"; pAssignProperties[nAssign] = sAssignPath; - pAssignProperties[nAssign] += OUString::createFromAscii(cDataSourceName); + pAssignProperties[nAssign] += cDataSourceName; pAssignProperties[nAssign + 1] = sAssignPath; - pAssignProperties[nAssign + 1] += OUString::createFromAscii(cDataTableName); + pAssignProperties[nAssign + 1] += cDataTableName; pAssignProperties[nAssign + 2] = sAssignPath; - pAssignProperties[nAssign + 2] += OUString::createFromAscii(cDataCommandType); + pAssignProperties[nAssign + 2] += cDataCommandType; pAssignProperties[nAssign + 3] = sAssignPath; - pAssignProperties[nAssign + 3] += OUString::createFromAscii(cDBColumnAssignments); + pAssignProperties[nAssign + 3] += cDBColumnAssignments; } Sequence<Any> aAssignValues = GetProperties(aAssignProperties); const Any* pAssignValues = aAssignValues.getConstArray(); @@ -569,7 +569,7 @@ void SwMailMergeConfigItem_Impl::ImplCommit() //store the changed / new assignments //load the existing node names to find new names - Sequence<OUString> aAssignments = GetNodeNames(OUString::createFromAscii(cAddressDataAssignments)); + Sequence<OUString> aAssignments = GetNodeNames(cAddressDataAssignments); std::vector<DBAddressDataAssignment>::iterator aAssignIter; for(aAssignIter = m_aAddressDataAssignments.begin(); @@ -582,7 +582,7 @@ void SwMailMergeConfigItem_Impl::ImplCommit() aAssignIter->sConfigNodeName : lcl_CreateNodeName(aAssignments); OUString sSlash = "/"; - OUString sNodePath = OUString::createFromAscii(cAddressDataAssignments); + OUString sNodePath = cAddressDataAssignments; sNodePath += sSlash; sNodePath += sNewNode; sNodePath += sSlash; @@ -590,19 +590,19 @@ void SwMailMergeConfigItem_Impl::ImplCommit() Sequence< PropertyValue > aNewValues(4); PropertyValue* pNewValues = aNewValues.getArray(); pNewValues[0].Name = sNodePath; - pNewValues[0].Name += OUString::createFromAscii(cDataSourceName); + pNewValues[0].Name += cDataSourceName; pNewValues[0].Value <<= aAssignIter->aDBData.sDataSource; pNewValues[1].Name = sNodePath; - pNewValues[1].Name += OUString::createFromAscii(cDataTableName); + pNewValues[1].Name += cDataTableName; pNewValues[1].Value <<= aAssignIter->aDBData.sCommand; pNewValues[2].Name = sNodePath; - pNewValues[2].Name += OUString::createFromAscii(cDataCommandType); + pNewValues[2].Name += cDataCommandType; pNewValues[2].Value <<= aAssignIter->aDBData.nCommandType; pNewValues[3].Name = sNodePath; - pNewValues[3].Name += OUString::createFromAscii(cDBColumnAssignments); + pNewValues[3].Name += cDBColumnAssignments; pNewValues[3].Value <<= aAssignIter->aDBColumnAssignments; - SetSetProperties(OUString::createFromAscii(cAddressDataAssignments), aNewValues); + SetSetProperties(cAddressDataAssignments, aNewValues); } } diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index da6633d4e7bb..de70f27006b9 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -89,6 +89,7 @@ #include <docary.hxx> #include <section.hxx> #include <ndtxt.hxx> +#include <edtdd.hxx> #include <edtwin.hxx> #include <navicont.hxx> #include <swcont.hxx> @@ -132,10 +133,6 @@ #include <memory> -extern bool g_bFrameDrag; -extern bool g_bDDINetAttr; -extern bool g_bExecuteDrag; - #define OLESIZE 11905 - 2 * lMinBorder, 6 * MM50 #define SWTRANSFER_OBJECTTYPE_DRAWMODEL static_cast<SotClipboardFormatId>(0x00000001) diff --git a/sw/source/uibase/docvw/edtdd.cxx b/sw/source/uibase/docvw/edtdd.cxx index 4a496dacba7d..63df592cd612 100644 --- a/sw/source/uibase/docvw/edtdd.cxx +++ b/sw/source/uibase/docvw/edtdd.cxx @@ -30,6 +30,7 @@ #include <fmturl.hxx> #include <frmfmt.hxx> #include <wrtsh.hxx> +#include <edtdd.hxx> #include <edtwin.hxx> #include <view.hxx> #include <viewopt.hxx> @@ -43,10 +44,6 @@ using namespace ::com::sun::star; // no include "dbgoutsw.hxx" here!!!!!! -extern bool g_bNoInterrupt; -extern bool g_bFrameDrag; -extern bool g_bDDTimerStarted; - bool g_bExecuteDrag = false; void SwEditWin::StartDDTimer() diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 17b60d9898d1..4e415ec65f8a 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -75,6 +75,7 @@ #include <editeng/acorrcfg.hxx> #include <SwSmartTagMgr.hxx> +#include <edtdd.hxx> #include <edtwin.hxx> #include <view.hxx> #include <wrtsh.hxx> @@ -164,7 +165,6 @@ using namespace ::com::sun::star; * Globals */ static bool g_bInputLanguageSwitched = false; -extern bool g_bNoInterrupt; // in mainwn.cxx // Usually in MouseButtonUp a selection is revoked when the selection is // not currently being pulled open. Unfortunately in MouseButtonDown there @@ -174,20 +174,18 @@ extern bool g_bNoInterrupt; // in mainwn.cxx static bool g_bHoldSelection = false; bool g_bFrameDrag = false; -bool g_bValidCursorPos = false; -bool g_bModePushed = false; +static bool g_bValidCursorPos = false; +static bool g_bModePushed = false; bool g_bDDTimerStarted = false; bool g_bFlushCharBuffer = false; bool g_bDDINetAttr = false; -SdrHdlKind g_eSdrMoveHdl = SdrHdlKind::User; +static SdrHdlKind g_eSdrMoveHdl = SdrHdlKind::User; QuickHelpData* SwEditWin::m_pQuickHlpData = nullptr; long SwEditWin::m_nDDStartPosY = 0; long SwEditWin::m_nDDStartPosX = 0; -extern bool g_bExecuteDrag; - static SfxShell* lcl_GetTextShellFromDispatcher( SwView& rView ); /// Check if the selected shape has a TextBox: if so, go into that instead. diff --git a/sw/source/uibase/inc/edtdd.hxx b/sw/source/uibase/inc/edtdd.hxx new file mode 100644 index 000000000000..4416bc73cce9 --- /dev/null +++ b/sw/source/uibase/inc/edtdd.hxx @@ -0,0 +1,19 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_EDTDD_HXX +#define INCLUDED_SW_SOURCE_UIBASE_INC_EDTDD_HXX + +#include <sal/config.h> + +extern bool g_bExecuteDrag; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx index a6596b91c3ff..474d0417b5ac 100644 --- a/sw/source/uibase/inc/edtwin.hxx +++ b/sw/source/uibase/inc/edtwin.hxx @@ -310,6 +310,11 @@ public: virtual FactoryFunction GetUITestFactory() const override; }; +extern bool g_bFrameDrag; +extern bool g_bDDTimerStarted; +extern bool g_bFlushCharBuffer; +extern bool g_bDDINetAttr; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/ribbar/conform.cxx b/sw/source/uibase/ribbar/conform.cxx index 7b4d9a87007f..a94de2c32d7c 100644 --- a/sw/source/uibase/ribbar/conform.cxx +++ b/sw/source/uibase/ribbar/conform.cxx @@ -21,14 +21,13 @@ #include <svx/svdview.hxx> #include <svx/fmshell.hxx> +#include "swmodule.hxx" #include "view.hxx" #include "edtwin.hxx" #include "wrtsh.hxx" #include "drawbase.hxx" #include "conform.hxx" -extern bool g_bNoInterrupt; // in swmodule.cxx - ConstFormControl::ConstFormControl(SwWrtShell* pWrtShell, SwEditWin* pEditWin, SwView* pSwView) : SwDrawBase(pWrtShell, pEditWin, pSwView) { diff --git a/sw/source/uibase/ribbar/drawbase.cxx b/sw/source/uibase/ribbar/drawbase.cxx index fbcb2589e236..b089ddc3dff9 100644 --- a/sw/source/uibase/ribbar/drawbase.cxx +++ b/sw/source/uibase/ribbar/drawbase.cxx @@ -33,14 +33,13 @@ #include "drawbase.hxx" #include "edtwin.hxx" #include "caption.hxx" +#include "swmodule.hxx" #include "swundo.hxx" #include <SwRewriter.hxx> #include "comcore.hrc" using namespace ::com::sun::star; -extern bool g_bNoInterrupt; // in swmodule.cxx - SwDrawBase::SwDrawBase(SwWrtShell* pSwWrtShell, SwEditWin* pWindow, SwView* pSwView) : m_pView(pSwView), m_pSh(pSwWrtShell), diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index d84b9e437eaa..434717a16903 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -74,8 +74,6 @@ using namespace nsSwDocInfoSubType; -extern bool g_bNoInterrupt; // in swmodule.cxx - static OUString lcl_BuildTitleWithRedline( const SwRangeRedline *pRedline ) { const OUString sTitle(SW_RESSTR(STR_REDLINE_COMMENT)); diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index fb86d2776306..305c4f400f53 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -122,8 +122,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::scanner; -extern bool g_bNoInterrupt; // in swmodule.cxx - #define SWVIEWFLAGS ( SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::HAS_PRINTOPTIONS) // Statics. OMG. diff --git a/sw/source/uibase/uiview/view1.cxx b/sw/source/uibase/uiview/view1.cxx index 3cd556020c41..98a4be6e7cb5 100644 --- a/sw/source/uibase/uiview/view1.cxx +++ b/sw/source/uibase/uiview/view1.cxx @@ -38,8 +38,6 @@ #include <sfx2/viewfrm.hxx> #include <wordcountdialog.hxx> -extern bool bDocSzUpdated; - void SwView::Activate(bool bMDIActivate) { // fdo#40438 Update the layout to make sure everything is correct before showing the content @@ -115,9 +113,7 @@ void SwView::Activate(bool bMDIActivate) void SwView::Deactivate(bool bMDIActivate) { - extern bool g_bFlushCharBuffer ; - // Are Characters still in the input buffer? - if( g_bFlushCharBuffer ) + if( g_bFlushCharBuffer ) // Are Characters still in the input buffer? GetEditWin().FlushInBuffer(); if( bMDIActivate ) diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx index 7cfd3dd45539..108df3dce08f 100644 --- a/sw/source/uibase/uiview/viewport.cxx +++ b/sw/source/uibase/uiview/viewport.cxx @@ -165,9 +165,6 @@ Point SwView::AlignToPixel(const Point &rPt) const void SwView::DocSzChgd(const Size &rSz) { - -extern bool bDocSzUpdated; - m_aDocSz = rSz; if( !m_pWrtShell || m_aVisArea.IsEmpty() ) // no shell -> no change diff --git a/sw/source/uibase/utlui/initui.cxx b/sw/source/uibase/utlui/initui.cxx index 5829a7a9bedc..eaea5300ec27 100644 --- a/sw/source/uibase/utlui/initui.cxx +++ b/sw/source/uibase/utlui/initui.cxx @@ -39,10 +39,10 @@ // Global Pointer -SwGlossaries* pGlossaries = nullptr; +static SwGlossaries* pGlossaries = nullptr; // Provides all needed paths. Is initialized by UI. -SwGlossaryList* pGlossaryList = nullptr; +static SwGlossaryList* pGlossaryList = nullptr; namespace { diff --git a/sw/source/uibase/wrtsh/wrtsh3.cxx b/sw/source/uibase/wrtsh/wrtsh3.cxx index c154df4cd7b5..5773a060253e 100644 --- a/sw/source/uibase/wrtsh/wrtsh3.cxx +++ b/sw/source/uibase/wrtsh/wrtsh3.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/form/FormButtonType.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <sfx2/htmlmode.hxx> +#include "swmodule.hxx" #include "wrtsh.hxx" #include "view.hxx" #include "IMark.hxx" @@ -38,8 +39,6 @@ using namespace ::com::sun::star; -extern bool g_bNoInterrupt; // in swmodule.cxx - bool SwWrtShell::MoveBookMark( BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark) { addCurrentPosition(); |