From 5f41f7b33e2f85be4c9d7380822916a7469cf39b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 27 Oct 2017 16:17:13 +0200 Subject: loplugin:constantparam in sw Change-Id: Ia477de0fb910f6a8fbb0a5054f4bdb43dd9ff381 Reviewed-on: https://gerrit.libreoffice.org/43951 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/inc/SwStyleNameMapper.hxx | 4 +- sw/inc/dbmgr.hxx | 3 +- sw/inc/doc.hxx | 6 +-- sw/inc/undobj.hxx | 4 +- sw/inc/unocrsrhelper.hxx | 8 +-- sw/qa/extras/mailmerge/mailmerge.cxx | 2 +- sw/source/core/doc/SwStyleNameMapper.cxx | 8 +-- sw/source/core/doc/docnum.cxx | 5 +- sw/source/core/docnode/ndnotxt.cxx | 2 +- sw/source/core/docnode/ndtbl.cxx | 40 +++----------- sw/source/core/docnode/ndtbl1.cxx | 2 +- sw/source/core/docnode/node.cxx | 4 +- sw/source/core/frmedt/fetab.cxx | 2 +- sw/source/core/inc/objectformatter.hxx | 3 +- sw/source/core/layout/atrfrm.cxx | 2 +- sw/source/core/layout/objectformatter.cxx | 5 +- sw/source/core/layout/paintfrm.cxx | 6 +-- sw/source/core/text/EnhancedPDFExportHelper.cxx | 8 +-- sw/source/core/txtnode/fmtatr2.cxx | 12 ++--- sw/source/core/txtnode/ndtxt.cxx | 37 ++----------- sw/source/core/undo/undobj.cxx | 9 +--- sw/source/core/unocore/SwXTextDefaults.cxx | 2 +- sw/source/core/unocore/unocrsrhelper.cxx | 4 +- sw/source/core/unocore/unoframe.cxx | 6 +-- sw/source/core/unocore/unoidx.cxx | 30 +++++------ sw/source/core/unocore/unoobj.cxx | 19 ++++--- sw/source/core/unocore/unosett.cxx | 40 ++++++-------- sw/source/core/unocore/unostyle.cxx | 40 +++++++------- sw/source/core/unocore/unotbl.cxx | 4 +- sw/source/filter/basflt/fltshell.cxx | 11 ++-- sw/source/filter/html/css1atr.cxx | 12 ++--- sw/source/filter/html/htmlatr.cxx | 2 +- sw/source/filter/html/htmldrawwriter.cxx | 70 ++++++++++++------------- sw/source/filter/html/htmlflywriter.cxx | 2 +- sw/source/filter/html/wrthtml.hxx | 3 +- sw/source/filter/ww8/ww8par.cxx | 13 ++--- sw/source/filter/xml/xmlfmt.cxx | 3 +- sw/source/filter/xml/xmlfmte.cxx | 3 +- sw/source/ui/chrdlg/numpara.cxx | 6 +-- sw/source/uibase/app/docstyle.cxx | 4 +- sw/source/uibase/dbui/dbmgr.cxx | 15 ++---- sw/source/uibase/inc/numpara.hxx | 2 +- sw/source/uibase/uno/unotxvw.cxx | 4 +- 43 files changed, 180 insertions(+), 287 deletions(-) diff --git a/sw/inc/SwStyleNameMapper.hxx b/sw/inc/SwStyleNameMapper.hxx index 2ed5d2cdd08c..ee976470c714 100644 --- a/sw/inc/SwStyleNameMapper.hxx +++ b/sw/inc/SwStyleNameMapper.hxx @@ -137,13 +137,13 @@ public: // This gets the UI Name from the programmatic name static const OUString& GetUIName(const OUString& rName, SwGetPoolIdFromName); static void FillUIName(const OUString& rName, OUString& rFillName, - SwGetPoolIdFromName, bool bDisambiguate); + SwGetPoolIdFromName); // Get the programmatic Name from the UI name static const OUString& GetProgName(const OUString& rName, SwGetPoolIdFromName); static void FillProgName(const OUString& rName, OUString& rFillName, - SwGetPoolIdFromName, bool bDisambiguate); + SwGetPoolIdFromName); // This gets the UI Name from the Pool ID SW_DLLPUBLIC static void FillUIName(sal_uInt16 nId, OUString& rFillName); diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx index c78907987266..8d709cfb7431 100644 --- a/sw/inc/dbmgr.hxx +++ b/sw/inc/dbmgr.hxx @@ -433,8 +433,7 @@ public: Convenience function, which calls GetDBunoURI and has just one mandatory parameter. In case of success it returns the registered name, otherwise an empty string. */ - static OUString LoadAndRegisterDataSource(const OUString& rURI, const OUString *pPrefix, const OUString *pDestDir, - const css::uno::Reference < css::beans::XPropertySet > *pSettings = nullptr); + static OUString LoadAndRegisterDataSource(const OUString& rURI, const OUString *pDestDir); /// Load the embedded data source of the document and also register it. void LoadAndRegisterEmbeddedDataSource(const SwDBData& rData, const SwDocShell& rDocShell); diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 5698a92ceb69..ac793aa2f924 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1103,8 +1103,7 @@ public: // Goto next/previous on same level. static bool GotoNextNum( SwPosition&, bool bOverUpper = true, sal_uInt8* pUpper = nullptr, sal_uInt8* pLower = nullptr ); - static bool GotoPrevNum( SwPosition&, bool bOverUpper = true, - sal_uInt8* pUpper = nullptr, sal_uInt8* pLower = nullptr ); + static bool GotoPrevNum( SwPosition&, bool bOverUpper = true ); /** Searches for a text node with a numbering rule. @@ -1215,8 +1214,7 @@ public: bool IsInsTableAlignNum() const; // From FEShell (for Undo and BModified). - static void GetTabCols( SwTabCols &rFill, const SwCursor* pCursor, - const SwCellFrame* pBoxFrame ); + static void GetTabCols( SwTabCols &rFill, const SwCellFrame* pBoxFrame ); void SetTabCols( const SwTabCols &rNew, bool bCurRowOnly, const SwCellFrame* pBoxFrame ); static void GetTabRows( SwTabCols &rFill, const SwCellFrame* pBoxFrame ); diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 1c210cf45e75..b413bfd5b25b 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -160,10 +160,10 @@ protected: // MoveFrom: moves from the UndoNodesArray into the NodesArray. static void MoveToUndoNds( SwPaM& rPam, SwNodeIndex* pNodeIdx, - sal_uLong* pEndNdIdx = nullptr, sal_Int32 * pEndCntIdx = nullptr ); + sal_uLong* pEndNdIdx = nullptr ); static void MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx, SwPosition& rInsPos, - const sal_uLong* pEndNdIdx = nullptr, const sal_Int32 * pEndCntIdx = nullptr ); + const sal_uLong* pEndNdIdx = nullptr ); // These two methods move the SPoint back/forth from PaM. With it // a range can be spanned for Undo/Redo. (In this case the SPoint diff --git a/sw/inc/unocrsrhelper.hxx b/sw/inc/unocrsrhelper.hxx index b563b302b84b..f1bd8bd20ee1 100644 --- a/sw/inc/unocrsrhelper.hxx +++ b/sw/inc/unocrsrhelper.hxx @@ -153,7 +153,6 @@ namespace SwUnoCursorHelper const css::uno::Sequence< css::beans::PropertyValue >& rDescriptor, SwSortOptions & rSortOpt); - /// @param bTableMode: attributes should be applied to a table selection /// @throws css::beans::UnknownPropertyException /// @throws css::beans::PropertyVetoException /// @throws css::lang::IllegalArgumentException @@ -163,9 +162,7 @@ namespace SwUnoCursorHelper SwPaM& rPaM, const SfxItemPropertySet & rPropSet, const OUString & rPropertyName, - const css::uno::Any & rValue, - const SetAttrMode nAttrMode = SetAttrMode::DEFAULT); - /// @param bTableMode: attributes should be applied to a table selection + const css::uno::Any & rValue); /// @throws css::beans::UnknownPropertyException /// @throws css::beans::PropertyVetoException /// @throws css::lang::IllegalArgumentException @@ -176,8 +173,7 @@ namespace SwUnoCursorHelper const SfxItemPropertySet & rPropSet, const css::uno::Sequence< css::beans::PropertyValue > & rPropertyValues, - const SetAttrMode nAttrMode = SetAttrMode::DEFAULT, - const bool bTableMode = false); + const SetAttrMode nAttrMode = SetAttrMode::DEFAULT); /// @throws css::beans::UnknownPropertyException /// @throws css::lang::WrappedTargetException /// @throws css::uno::RuntimeException diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 3e29b7a9b01e..0a0f40bb4cf3 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -104,7 +104,7 @@ public: DBuriMap::const_iterator pos = aDBuriMap.find( aURI ); if (pos == aDBuriMap.end()) { - aDBName = SwDBManager::LoadAndRegisterDataSource( aURI, nullptr, &aWorkDir ); + aDBName = SwDBManager::LoadAndRegisterDataSource( aURI, &aWorkDir ); aDBuriMap.insert( std::pair< OUString, OUString >( aURI, aDBName ) ); std::cout << "New datasource name: '" << aDBName << "'" << std::endl; } diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx index 9b71bdd514b2..56f3f6934f1a 100644 --- a/sw/source/core/doc/SwStyleNameMapper.cxx +++ b/sw/source/core/doc/SwStyleNameMapper.cxx @@ -546,10 +546,10 @@ const OUString& SwStyleNameMapper::GetProgName( // Get the programmatic name from the UI name in rName and put it into rFillName void SwStyleNameMapper::FillProgName( const OUString& rName, OUString& rFillName, - SwGetPoolIdFromName const eFlags, bool const bDisambiguate) + SwGetPoolIdFromName const eFlags) { sal_uInt16 nId = GetPoolIdFromUIName ( rName, eFlags ); - if ( bDisambiguate && nId == USHRT_MAX ) + if ( nId == USHRT_MAX ) { // rName isn't in our UI name table...check if it's in the programmatic one nId = GetPoolIdFromProgName ( rName, eFlags ); @@ -578,10 +578,10 @@ void SwStyleNameMapper::FillProgName( // Get the UI name from the programmatic name in rName and put it into rFillName void SwStyleNameMapper::FillUIName( const OUString& rName, OUString& rFillName, - SwGetPoolIdFromName const eFlags, bool const bDisambiguate) + SwGetPoolIdFromName const eFlags) { sal_uInt16 nId = GetPoolIdFromProgName ( rName, eFlags ); - if ( bDisambiguate && nId == USHRT_MAX ) + if ( nId == USHRT_MAX ) { rFillName = rName; // rName isn't in our Prog name table...check if it has a " (user)" suffix, if so remove it diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index f2ef5223918e..b0ebf2254b48 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -1593,10 +1593,9 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos, return pResult; } -bool SwDoc::GotoPrevNum( SwPosition& rPos, bool bOverUpper, - sal_uInt8* pUpper, sal_uInt8* pLower ) +bool SwDoc::GotoPrevNum( SwPosition& rPos, bool bOverUpper ) { - return ::lcl_GotoNextPrevNum( rPos, false, bOverUpper, pUpper, pLower ); + return ::lcl_GotoNextPrevNum( rPos, false, bOverUpper, nullptr, nullptr ); } bool SwDoc::NumUpDown( const SwPaM& rPam, bool bDown ) diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx index 8cf1d1c399ba..8d033dad4734 100644 --- a/sw/source/core/docnode/ndnotxt.cxx +++ b/sw/source/core/docnode/ndnotxt.cxx @@ -65,7 +65,7 @@ void SwNoTextNode::NewAttrSet( SwAttrPool& rPool ) // put names of parent style and conditional style: const SwFormatColl* pFormatColl = GetFormatColl(); OUString sVal; - SwStyleNameMapper::FillProgName( pFormatColl->GetName(), sVal, SwGetPoolIdFromName::TxtColl, true ); + SwStyleNameMapper::FillProgName( pFormatColl->GetName(), sVal, SwGetPoolIdFromName::TxtColl ); SfxStringItem aFormatColl( RES_FRMATR_STYLE_NAME, sVal ); aNewAttrSet.Put( aFormatColl ); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index b0c5102a5df8..2b03155cce3a 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -2499,42 +2499,14 @@ void SwTableNode::RemoveRedlines() } } -void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCursor, - const SwCellFrame* pBoxFrame ) +void SwDoc::GetTabCols( SwTabCols &rFill, const SwCellFrame* pBoxFrame ) { - const SwTableBox* pBox = nullptr; - SwTabFrame *pTab = nullptr; - - if( pBoxFrame ) - { - pTab = const_cast(static_cast(pBoxFrame))->ImplFindTabFrame(); - pBox = pBoxFrame->GetTabBox(); - } - else if( pCursor ) - { - const SwContentNode* pCNd = pCursor->GetContentNode(); - if( !pCNd ) - return ; - - Point aPt; - const SwShellCursor *pShCursor = dynamic_cast(pCursor); - if( pShCursor ) - aPt = pShCursor->GetPtPos(); - - const SwFrame* pTmpFrame = pCNd->getLayoutFrame( pCNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, nullptr, false ); - do { - pTmpFrame = pTmpFrame->GetUpper(); - } while ( !pTmpFrame->IsCellFrame() ); + OSL_ENSURE( pBoxFrame, "pBoxFrame needs to be specified!" ); + if( !pBoxFrame ) + return; - pBoxFrame = static_cast(pTmpFrame); - pTab = const_cast(static_cast(pBoxFrame))->ImplFindTabFrame(); - pBox = pBoxFrame->GetTabBox(); - } - else if( !pCursor && !pBoxFrame ) - { - OSL_ENSURE( false, "One of them needs to be specified!" ); - return ; - } + SwTabFrame *pTab = const_cast(static_cast(pBoxFrame))->ImplFindTabFrame(); + const SwTableBox* pBox = pBoxFrame->GetTabBox(); // Set fixed points, LeftMin in Document coordinates, all others relative SwRectFnSet aRectFnSet(pTab); diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index eff7995de2a5..02390f41dff3 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -1475,7 +1475,7 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, bool bBalance ) return; // Robust SwTabCols aTabCols; - GetTabCols( aTabCols, nullptr, static_cast(pBoxFrame) ); + GetTabCols( aTabCols, static_cast(pBoxFrame) ); if ( ! aTabCols.Count() ) return; diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 0178d986c8ad..d92c1d86da44 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -118,12 +118,12 @@ void SetParent( std::shared_ptr& rpAttrSet, if ( pParentFormat ) { - SwStyleNameMapper::FillProgName( pParentFormat->GetName(), sVal, SwGetPoolIdFromName::TxtColl, true ); + SwStyleNameMapper::FillProgName( pParentFormat->GetName(), sVal, SwGetPoolIdFromName::TxtColl ); const SfxStringItem aAnyFormatColl( RES_FRMATR_STYLE_NAME, sVal ); aNewSet.Put( aAnyFormatColl ); if ( pConditionalFormat != pParentFormat ) - SwStyleNameMapper::FillProgName( pConditionalFormat->GetName(), sVal, SwGetPoolIdFromName::TxtColl, true ); + SwStyleNameMapper::FillProgName( pConditionalFormat->GetName(), sVal, SwGetPoolIdFromName::TxtColl ); const SfxStringItem aFormatColl( RES_FRMATR_CONDITIONAL_STYLE_NAME, sVal ); aNewSet.Put( aFormatColl ); diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 89836edd94f1..6d2ef198ac40 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -575,7 +575,7 @@ void SwFEShell::GetTabCols_( SwTabCols &rToFill, const SwFrame *pBox ) } if ( !pLastCols ) { - SwDoc::GetTabCols( rToFill, nullptr, static_cast(pBox) ); + SwDoc::GetTabCols( rToFill, static_cast(pBox) ); pLastCols = new SwTabCols( rToFill ); g_pColumnCacheLastTable = pTab->GetTable(); diff --git a/sw/source/core/inc/objectformatter.hxx b/sw/source/core/inc/objectformatter.hxx index e28839310e83..1cee180afbfe 100644 --- a/sw/source/core/inc/objectformatter.hxx +++ b/sw/source/core/inc/objectformatter.hxx @@ -166,8 +166,7 @@ class SwObjectFormatter */ static bool FormatObj( SwAnchoredObject& _rAnchoredObj, SwFrame* _pAnchorFrame = nullptr, - const SwPageFrame* _pPageFrame = nullptr, - SwLayAction* _pLayAction = nullptr ); + const SwPageFrame* _pPageFrame = nullptr ); }; #endif diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 1c806bb9527b..7b994dbfb138 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -710,7 +710,7 @@ bool SwFormatPageDesc::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const if( pDesc ) { OUString aString; - SwStyleNameMapper::FillProgName(pDesc->GetName(), aString, SwGetPoolIdFromName::PageDesc, true ); + SwStyleNameMapper::FillProgName(pDesc->GetName(), aString, SwGetPoolIdFromName::PageDesc); rVal <<= aString; } else diff --git a/sw/source/core/layout/objectformatter.cxx b/sw/source/core/layout/objectformatter.cxx index 357a261aea5c..c4f0c73ab3b0 100644 --- a/sw/source/core/layout/objectformatter.cxx +++ b/sw/source/core/layout/objectformatter.cxx @@ -199,8 +199,7 @@ bool SwObjectFormatter::FormatObjsAtFrame( SwFrame& _rAnchorFrame, */ bool SwObjectFormatter::FormatObj( SwAnchoredObject& _rAnchoredObj, SwFrame* _pAnchorFrame, - const SwPageFrame* _pPageFrame, - SwLayAction* _pLayAction ) + const SwPageFrame* _pPageFrame ) { bool bSuccess( true ); @@ -214,7 +213,7 @@ bool SwObjectFormatter::FormatObj( SwAnchoredObject& _rAnchoredObj, // create corresponding object formatter SwObjectFormatter* pObjFormatter = - SwObjectFormatter::CreateObjFormatter( rAnchorFrame, rPageFrame, _pLayAction ); + SwObjectFormatter::CreateObjFormatter( rAnchorFrame, rPageFrame, nullptr/*_pLayAction*/ ); if ( pObjFormatter ) { diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 022a56a26d93..873b2c67880e 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1695,7 +1695,7 @@ static inline void lcl_DrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush, */ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, vcl::RenderContext *pOut, SwViewShell &rSh, const SwRect &rGrf, const SwRect &rOut, - bool bClip, bool bGrfNum, + bool bGrfNum, SwPaintProperties const & properties, bool bBackgrdAlreadyDrawn ) // add parameter to indicate @@ -1707,7 +1707,7 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, vcl::RenderContext *pOu ::SwAlignRect( aAlignedGrfRect, &rSh, pOut ); // Change type from to . - const bool bNotInside = bClip && !rOut.IsInside( aAlignedGrfRect ); + const bool bNotInside = !rOut.IsInside( aAlignedGrfRect ); if ( bNotInside ) { pOut->Push( PushFlags::CLIPREGION ); @@ -2158,7 +2158,7 @@ void DrawGraphic( if( bDraw && aGrf.IsOver( rOut ) ) // OD 02.09.2002 #99657# // add parameter - lcl_DrawGraphic( *pBrush, pOutDev, rSh, aGrf, rOut, true, bGrfNum, gProp, + lcl_DrawGraphic( *pBrush, pOutDev, rSh, aGrf, rOut, bGrfNum, gProp, bGrfBackgrdAlreadyDrawn ); if( bReplaceGrfNum ) diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 530f79163453..152738ca1a47 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -173,7 +173,7 @@ bool lcl_IsHeadlineCell( const SwCellFrame& rCellFrame ) const SwFormat* pTextFormat = pTextNode->GetFormatColl(); OUString sStyleName; - SwStyleNameMapper::FillProgName( pTextFormat->GetName(), sStyleName, SwGetPoolIdFromName::TxtColl, true ); + SwStyleNameMapper::FillProgName( pTextFormat->GetName(), sStyleName, SwGetPoolIdFromName::TxtColl ); bRet = sStyleName == aTableHeadingName; } @@ -1067,9 +1067,9 @@ void SwTaggedPDFHelper::BeginBlockStructureElements() OUString sParentStyleName; if ( pTextFormat) - SwStyleNameMapper::FillProgName( pTextFormat->GetName(), sStyleName, SwGetPoolIdFromName::TxtColl, true ); + SwStyleNameMapper::FillProgName( pTextFormat->GetName(), sStyleName, SwGetPoolIdFromName::TxtColl ); if ( pParentTextFormat) - SwStyleNameMapper::FillProgName( pParentTextFormat->GetName(), sParentStyleName, SwGetPoolIdFromName::TxtColl, true ); + SwStyleNameMapper::FillProgName( pParentTextFormat->GetName(), sParentStyleName, SwGetPoolIdFromName::TxtColl ); // This is the default. If the paragraph could not be mapped to // any of the standard pdf tags, we write a user defined tag @@ -1352,7 +1352,7 @@ void SwTaggedPDFHelper::BeginInlineStructureElements() const SwCharFormat* pCharFormat = (charAttrs.size()) ? (*charAttrs.begin())->GetCharFormat().GetCharFormat() : nullptr; if ( pCharFormat ) - SwStyleNameMapper::FillProgName( pCharFormat->GetName(), sStyleName, SwGetPoolIdFromName::TxtColl, true ); + SwStyleNameMapper::FillProgName( pCharFormat->GetName(), sStyleName, SwGetPoolIdFromName::TxtColl ); } // Check for Link: diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index 577ad6584321..e0a46bff1e22 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -101,7 +101,7 @@ bool SwFormatCharFormat::QueryValue( uno::Any& rVal, sal_uInt8 ) const { OUString sCharFormatName; if(GetCharFormat()) - SwStyleNameMapper::FillProgName(GetCharFormat()->GetName(), sCharFormatName, SwGetPoolIdFromName::ChrFmt, true ); + SwStyleNameMapper::FillProgName(GetCharFormat()->GetName(), sCharFormatName, SwGetPoolIdFromName::ChrFmt ); rVal <<= sCharFormatName; return true; } @@ -290,7 +290,7 @@ bool SwFormatINetFormat::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const SwStyleNameMapper::FillUIName(mnVisitedFormatId, sVal); if (!sVal.isEmpty()) SwStyleNameMapper::FillProgName(sVal, sVal, - SwGetPoolIdFromName::ChrFmt, true); + SwGetPoolIdFromName::ChrFmt); rVal <<= sVal; } break; @@ -301,7 +301,7 @@ bool SwFormatINetFormat::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const SwStyleNameMapper::FillUIName(mnINetFormatId, sVal); if (!sVal.isEmpty()) SwStyleNameMapper::FillProgName(sVal, sVal, - SwGetPoolIdFromName::ChrFmt, true); + SwGetPoolIdFromName::ChrFmt); rVal <<= sVal; } break; @@ -371,7 +371,7 @@ bool SwFormatINetFormat::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) OUString sVal; rVal >>= sVal; OUString aString; - SwStyleNameMapper::FillUIName( sVal, aString, SwGetPoolIdFromName::ChrFmt, true ); + SwStyleNameMapper::FillUIName( sVal, aString, SwGetPoolIdFromName::ChrFmt ); msVisitedFormatName = aString; mnVisitedFormatId = SwStyleNameMapper::GetPoolIdFromUIName( msVisitedFormatName, SwGetPoolIdFromName::ChrFmt ); @@ -382,7 +382,7 @@ bool SwFormatINetFormat::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) OUString sVal; rVal >>= sVal; OUString aString; - SwStyleNameMapper::FillUIName( sVal, aString, SwGetPoolIdFromName::ChrFmt, true ); + SwStyleNameMapper::FillUIName( sVal, aString, SwGetPoolIdFromName::ChrFmt ); msINetFormatName = aString; mnINetFormatId = SwStyleNameMapper::GetPoolIdFromUIName( msINetFormatName, SwGetPoolIdFromName::ChrFmt ); } @@ -457,7 +457,7 @@ bool SwFormatRuby::QueryValue( uno::Any& rVal, case MID_RUBY_CHARSTYLE: { OUString aString; - SwStyleNameMapper::FillProgName(m_sCharFormatName, aString, SwGetPoolIdFromName::ChrFmt, true ); + SwStyleNameMapper::FillProgName(m_sCharFormatName, aString, SwGetPoolIdFromName::ChrFmt ); rVal <<= aString; } break; diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index c50dbc1630a9..666f8a05e1ca 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -825,10 +825,10 @@ void SwTextNode::NewAttrSet( SwAttrPool& rPool ) const SwFormatColl* pAnyFormatColl = &GetAnyFormatColl(); const SwFormatColl* pFormatColl = GetFormatColl(); OUString sVal; - SwStyleNameMapper::FillProgName( pAnyFormatColl->GetName(), sVal, SwGetPoolIdFromName::TxtColl, true ); + SwStyleNameMapper::FillProgName( pAnyFormatColl->GetName(), sVal, SwGetPoolIdFromName::TxtColl ); SfxStringItem aAnyFormatColl( RES_FRMATR_STYLE_NAME, sVal ); if ( pFormatColl != pAnyFormatColl ) - SwStyleNameMapper::FillProgName( pFormatColl->GetName(), sVal, SwGetPoolIdFromName::TxtColl, true ); + SwStyleNameMapper::FillProgName( pFormatColl->GetName(), sVal, SwGetPoolIdFromName::TxtColl ); SfxStringItem aFormatColl( RES_FRMATR_CONDITIONAL_STYLE_NAME, sVal ); aNewAttrSet.Put( aAnyFormatColl ); aNewAttrSet.Put( aFormatColl ); @@ -2944,8 +2944,7 @@ static void Replace0xFF( SwTextNode const& rNode, OUStringBuffer & rText, sal_Int32 & rTextStt, - sal_Int32 nEndPos, - bool const bExpandFields ) + sal_Int32 nEndPos ) { if (rNode.GetpSwpHints()) { @@ -2964,37 +2963,11 @@ static void Replace0xFF( case RES_TXTATR_FIELD: case RES_TXTATR_ANNOTATION: rText.remove(nPos, 1); - if( bExpandFields ) - { - const OUString aExpand( - static_txtattr_cast(pAttr)->GetFormatField().GetField()->ExpandField(true)); - rText.insert(nPos, aExpand); - nPos = nPos + aExpand.getLength(); - nEndPos = nEndPos + aExpand.getLength(); - rTextStt = rTextStt - aExpand.getLength(); - } ++rTextStt; break; case RES_TXTATR_FTN: rText.remove(nPos, 1); - if( bExpandFields ) - { - const SwFormatFootnote& rFootnote = pAttr->GetFootnote(); - OUString sExpand; - if( !rFootnote.GetNumStr().isEmpty() ) - sExpand = rFootnote.GetNumStr(); - else if( rFootnote.IsEndNote() ) - sExpand = rNode.GetDoc()->GetEndNoteInfo().aFormat. - GetNumStr( rFootnote.GetNumber() ); - else - sExpand = rNode.GetDoc()->GetFootnoteInfo().aFormat. - GetNumStr( rFootnote.GetNumber() ); - rText.insert(nPos, sExpand); - nPos = nPos + sExpand.getLength(); - nEndPos = nEndPos + sExpand.getLength(); - rTextStt = rTextStt - sExpand.getLength(); - } ++rTextStt; break; @@ -3299,13 +3272,13 @@ OUString SwTextNode::GetRedlineText() const if( nIdxEnd < nEnd ) nEnd = nIdxEnd; const sal_Int32 nDelCnt = nEnd - nStt; aText.remove(nStt - nTextStt, nDelCnt); - Replace0xFF(*this, aText, nTextStt, nStt - nTextStt, false/*bExpandFields*/); + Replace0xFF(*this, aText, nTextStt, nStt - nTextStt); nTextStt += nDelCnt; } else if( nStt >= nIdxEnd ) break; } - Replace0xFF(*this, aText, nTextStt, aText.getLength(), false/*bExpandFields*/); + Replace0xFF(*this, aText, nTextStt, aText.getLength()); return aText.makeStringAndClear(); } diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 0f62c97737cb..51941c8f3ea8 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -705,7 +705,7 @@ SwUndoSaveContent::~SwUndoSaveContent() // If pEndNdIdx is given, Undo/Redo calls -Ins/DelFly. In that case the whole // section should be moved. void SwUndoSaveContent::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx, - sal_uLong* pEndNdIdx, sal_Int32* pEndCntIdx ) + sal_uLong* pEndNdIdx ) { SwDoc& rDoc = *rPaM.GetDoc(); ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo()); @@ -734,8 +734,6 @@ void SwUndoSaveContent::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx, } if( pEndNdIdx ) *pEndNdIdx = aPos.nNode.GetIndex(); - if( pEndCntIdx ) - *pEndCntIdx = aPos.nContent.GetIndex(); // old position aPos.nNode = nTmpMvNode; @@ -745,7 +743,7 @@ void SwUndoSaveContent::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx, void SwUndoSaveContent::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx, SwPosition& rInsPos, - const sal_uLong* pEndNdIdx, const sal_Int32* pEndCntIdx ) + const sal_uLong* pEndNdIdx ) { // here comes the recovery SwNodes & rNds = rDoc.GetUndoManager().GetUndoNodes(); @@ -766,9 +764,6 @@ void SwUndoSaveContent::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx, SwTextNode* pTextNd = aPaM.GetNode().GetTextNode(); if (!pEndNdIdx && pTextNd) { - if( pEndCntIdx ) - aPaM.GetPoint()->nContent.Assign( pTextNd, *pEndCntIdx ); - aPaM.SetMark(); aPaM.GetPoint()->nNode = nNodeIdx; aPaM.GetPoint()->nContent.Assign(aPaM.GetContentNode(), 0); diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx index 4cc17c2ab7cd..82e64091d08e 100644 --- a/sw/source/core/unocore/SwXTextDefaults.cxx +++ b/sw/source/core/unocore/SwXTextDefaults.cxx @@ -84,7 +84,7 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName, throw lang::IllegalArgumentException(); OUString sStyle; - SwStyleNameMapper::FillUIName(uStyle, sStyle, SwGetPoolIdFromName::ChrFmt, true ); + SwStyleNameMapper::FillUIName(uStyle, sStyle, SwGetPoolIdFromName::ChrFmt ); SwDocStyleSheet* pStyle = static_cast(m_pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SfxStyleFamily::Char)); SwFormatDrop* pDrop = nullptr; diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 4b1925eb70cb..a6dd3ecf1788 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -380,7 +380,7 @@ bool getCursorPropertyValue(const SfxItemPropertySimpleEntry& rEntry if( pAny ) { OUString sVal; - SwStyleNameMapper::FillProgName(pFormat->GetName(), sVal, SwGetPoolIdFromName::TxtColl, true ); + SwStyleNameMapper::FillProgName(pFormat->GetName(), sVal, SwGetPoolIdFromName::TxtColl ); *pAny <<= sVal; } } @@ -917,7 +917,7 @@ void GetCurPageStyle(SwPaM const & rPaM, OUString &rString) if(pPage) { SwStyleNameMapper::FillProgName(pPage->GetPageDesc()->GetName(), - rString, SwGetPoolIdFromName::PageDesc, true); + rString, SwGetPoolIdFromName::PageDesc); } } } diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 5f54e2daf937..b663f5d836b1 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -987,7 +987,7 @@ bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet& rSet, SfxItem { OUString sStyle; *pStyleName >>= sStyle; - SwStyleNameMapper::FillUIName(sStyle, sStyle, SwGetPoolIdFromName::FrmFmt, true); + SwStyleNameMapper::FillUIName(sStyle, sStyle, SwGetPoolIdFromName::FrmFmt); pStyle = static_cast(pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SfxStyleFamily::Frame)); } @@ -1060,7 +1060,7 @@ bool SwGraphicProperties_Impl::AnyToItemSet( { OUString sStyle; *pStyleName >>= sStyle; - SwStyleNameMapper::FillUIName(sStyle, sStyle, SwGetPoolIdFromName::FrmFmt, true); + SwStyleNameMapper::FillUIName(sStyle, sStyle, SwGetPoolIdFromName::FrmFmt); pStyle = static_cast(pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SfxStyleFamily::Frame)); } @@ -1390,7 +1390,7 @@ static SwFrameFormat *lcl_GetFrameFormat( const ::uno::Any& rValue, SwDoc *pDoc rValue >>= uTemp; OUString sStyle; SwStyleNameMapper::FillUIName(uTemp, sStyle, - SwGetPoolIdFromName::FrmFmt, true); + SwGetPoolIdFromName::FrmFmt); SwDocStyleSheet* pStyle = static_cast(pDocSh->GetStyleSheetPool()->Find(sStyle, SfxStyleFamily::Frame)); diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 3df28474d49d..f9fe2b6f4895 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -757,7 +757,7 @@ SwXDocumentIndex::setPropertyValue( { OUString aString; SwStyleNameMapper::FillUIName(lcl_AnyToString(rValue), - aString, SwGetPoolIdFromName::ChrFmt, true); + aString, SwGetPoolIdFromName::ChrFmt); rTOXBase.SetMainEntryCharStyle( aString ); } break; @@ -793,7 +793,7 @@ SwXDocumentIndex::setPropertyValue( { OUString aString; SwStyleNameMapper::FillUIName( lcl_AnyToString(rValue), - aString, SwGetPoolIdFromName::TxtColl, true); + aString, SwGetPoolIdFromName::TxtColl); bForm = true; // Header is on Pos 0 aForm.SetTemplate( 0, aString ); @@ -808,7 +808,7 @@ SwXDocumentIndex::setPropertyValue( OUString aString; bForm = true; SwStyleNameMapper::FillUIName( lcl_AnyToString(rValue), - aString, SwGetPoolIdFromName::TxtColl, true); + aString, SwGetPoolIdFromName::TxtColl); aForm.SetTemplate( 1, aString ); } break; @@ -832,7 +832,7 @@ SwXDocumentIndex::setPropertyValue( const sal_uInt16 nLPos = rTOXBase.GetType() == TOX_INDEX ? 2 : 1; OUString aString; SwStyleNameMapper::FillUIName( lcl_AnyToString(rValue), - aString, SwGetPoolIdFromName::TxtColl, true); + aString, SwGetPoolIdFromName::TxtColl); aForm.SetTemplate(nLPos + pEntry->nWID - WID_PARA_LEV1, aString ); } break; @@ -1087,8 +1087,7 @@ SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) SwStyleNameMapper::FillProgName( pTOXBase->GetMainEntryCharStyle(), aString, - SwGetPoolIdFromName::ChrFmt, - true); + SwGetPoolIdFromName::ChrFmt); aRet <<= aString; } break; @@ -1128,7 +1127,7 @@ SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) //Header steht an Pos 0 OUString aString; SwStyleNameMapper::FillProgName(rForm.GetTemplate( 0 ), aString, - SwGetPoolIdFromName::TxtColl, true ); + SwGetPoolIdFromName::TxtColl ); aRet <<= aString; } break; @@ -1138,8 +1137,7 @@ SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) SwStyleNameMapper::FillProgName( rForm.GetTemplate( 1 ), aString, - SwGetPoolIdFromName::TxtColl, - true); + SwGetPoolIdFromName::TxtColl); aRet <<= aString; } break; @@ -1160,8 +1158,7 @@ SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) SwStyleNameMapper::FillProgName( rForm.GetTemplate(nLPos + pEntry->nWID - WID_PARA_LEV1), aString, - SwGetPoolIdFromName::TxtColl, - true); + SwGetPoolIdFromName::TxtColl); aRet <<= aString; } break; @@ -2625,7 +2622,7 @@ SwXDocumentIndex::StyleAccess_Impl::replaceByIndex( sSetStyles += OUStringLiteral1(TOX_STYLE_DELIMITER); } SwStyleNameMapper::FillUIName(pStyles[i], aString, - SwGetPoolIdFromName::TxtColl, true); + SwGetPoolIdFromName::TxtColl); sSetStyles += aString; } rTOXBase.SetStyleNames(sSetStyles, static_cast(nIndex)); @@ -2661,8 +2658,7 @@ SwXDocumentIndex::StyleAccess_Impl::getByIndex(sal_Int32 nIndex) SwStyleNameMapper::FillProgName( rStyles.getToken(0, TOX_STYLE_DELIMITER, nPos), aString, - SwGetPoolIdFromName::TxtColl, - true); + SwGetPoolIdFromName::TxtColl); pStyles[i] = aString; } uno::Any aRet(&aStyles, cppu::UnoType>::get()); @@ -2785,8 +2781,7 @@ SwXDocumentIndex::TokenAccess_Impl::replaceByIndex( SwStyleNameMapper::FillUIName( lcl_AnyToString(pProperties[j].Value), sCharStyleName, - SwGetPoolIdFromName::ChrFmt, - true); + SwGetPoolIdFromName::ChrFmt); aToken.sCharStyleName = sCharStyleName; aToken.nPoolId = SwStyleNameMapper::GetPoolIdFromUIName ( sCharStyleName, SwGetPoolIdFromName::ChrFmt ); @@ -2956,8 +2951,7 @@ SwXDocumentIndex::TokenAccess_Impl::getByIndex(sal_Int32 nIndex) SwStyleNameMapper::FillProgName( aToken.sCharStyleName, aProgCharStyle, - SwGetPoolIdFromName::ChrFmt, - true ); + SwGetPoolIdFromName::ChrFmt); switch(aToken.eTokenType) { case TOKEN_ENTRY_NO: diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index ed6cf2ded70b..515c5280362e 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -221,7 +221,7 @@ lcl_setCharStyle(SwDoc *const pDoc, const uno::Any & rValue, SfxItemSet & rSet) } OUString sStyle; SwStyleNameMapper::FillUIName(uStyle, sStyle, - SwGetPoolIdFromName::ChrFmt, true); + SwGetPoolIdFromName::ChrFmt); SwDocStyleSheet *const pStyle = static_cast( pDocSh->GetStyleSheetPool()->Find(sStyle, SfxStyleFamily::Char)); if (!pStyle) @@ -269,7 +269,7 @@ SwUnoCursorHelper::SetTextFormatColl(const uno::Any & rAny, SwPaM & rPaM) rAny >>= uStyle; OUString sStyle; SwStyleNameMapper::FillUIName(uStyle, sStyle, - SwGetPoolIdFromName::TxtColl, true ); + SwGetPoolIdFromName::TxtColl ); SwDocStyleSheet *const pStyle = static_cast( pDocSh->GetStyleSheetPool()->Find(sStyle, SfxStyleFamily::Para)); if (!pStyle) @@ -310,7 +310,7 @@ SwUnoCursorHelper::SetPageDesc( } OUString sDescName; SwStyleNameMapper::FillUIName(uDescName, sDescName, - SwGetPoolIdFromName::PageDesc, true); + SwGetPoolIdFromName::PageDesc); if (!pNewDesc->GetPageDesc() || (pNewDesc->GetPageDesc()->GetName() != sDescName)) { @@ -406,7 +406,7 @@ lcl_setDropcapCharStyle(SwPaM const & rPam, SfxItemSet & rItemSet, } OUString sStyle; SwStyleNameMapper::FillUIName(uStyle, sStyle, - SwGetPoolIdFromName::ChrFmt, true); + SwGetPoolIdFromName::ChrFmt); SwDoc *const pDoc = rPam.GetDoc(); //default character style must not be set as default format SwDocStyleSheet *const pStyle = static_cast( @@ -454,7 +454,7 @@ lcl_setRubyCharstyle(SfxItemSet & rItemSet, uno::Any const& rValue) } OUString sStyle; SwStyleNameMapper::FillUIName(sTmp, sStyle, - SwGetPoolIdFromName::ChrFmt, true ); + SwGetPoolIdFromName::ChrFmt); pRuby->SetCharFormatName(sStyle); pRuby->SetCharFormatId(0); if (!sStyle.isEmpty()) @@ -1749,13 +1749,12 @@ uno::Any SwUnoCursorHelper::GetPropertyValue( void SwUnoCursorHelper::SetPropertyValue( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const OUString& rPropertyName, - const uno::Any& rValue, - const SetAttrMode nAttrMode) + const uno::Any& rValue) { uno::Sequence< beans::PropertyValue > aValues(1); aValues[0].Name = rPropertyName; aValues[0].Value = rValue; - SetPropertyValues(rPaM, rPropSet, aValues, nAttrMode); + SetPropertyValues(rPaM, rPropSet, aValues, SetAttrMode::DEFAULT); } // FN_UNO_PARA_STYLE is known to set attributes for nodes, inside @@ -1773,7 +1772,7 @@ inline bool propertyCausesSideEffectsInNodes(sal_uInt16 nWID) void SwUnoCursorHelper::SetPropertyValues( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const uno::Sequence< beans::PropertyValue > &rPropertyValues, - const SetAttrMode nAttrMode, const bool bTableMode) + const SetAttrMode nAttrMode) { if (!rPropertyValues.getLength()) return; @@ -1834,7 +1833,7 @@ void SwUnoCursorHelper::SetPropertyValues( rPropSet.setPropertyValue(*pEntry, rValue, aItemSet); if (i + 1 == aEntries.size() || bPropertyCausesSideEffectsInNodes) - SwUnoCursorHelper::SetCursorAttr(rPaM, aItemSet, nAttrMode, bTableMode); + SwUnoCursorHelper::SetCursorAttr(rPaM, aItemSet, nAttrMode, false/*bTableMode*/); bPreviousPropertyCausesSideEffectsInNodes = bPropertyCausesSideEffectsInNodes; } diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 1abc80765813..03b982f7d615 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -192,7 +192,7 @@ static SwCharFormat* lcl_getCharFormat(SwDoc* pDoc, const uno::Any& aValue) OUString uTmp; aValue >>= uTmp; OUString sCharFormat; - SwStyleNameMapper::FillUIName(uTmp, sCharFormat, SwGetPoolIdFromName::ChrFmt, true); + SwStyleNameMapper::FillUIName(uTmp, sCharFormat, SwGetPoolIdFromName::ChrFmt); if (sCharFormat != SwResId(STR_POOLCOLL_STANDARD)) { pRet = pDoc->FindCharFormatByName( sCharFormat ); @@ -211,7 +211,7 @@ static SwTextFormatColl* lcl_GetParaStyle(SwDoc* pDoc, const uno::Any& aValue) OUString uTmp; aValue >>= uTmp; OUString sParaStyle; - SwStyleNameMapper::FillUIName(uTmp, sParaStyle, SwGetPoolIdFromName::TxtColl, true ); + SwStyleNameMapper::FillUIName(uTmp, sParaStyle, SwGetPoolIdFromName::TxtColl ); SwTextFormatColl* pRet = pDoc->FindTextFormatCollByName( sParaStyle ); if( !pRet ) { @@ -227,7 +227,7 @@ static SwPageDesc* lcl_GetPageDesc(SwDoc* pDoc, const uno::Any& aValue) OUString uTmp; aValue >>= uTmp; OUString sPageDesc; - SwStyleNameMapper::FillUIName(uTmp, sPageDesc, SwGetPoolIdFromName::PageDesc, true ); + SwStyleNameMapper::FillUIName(uTmp, sPageDesc, SwGetPoolIdFromName::PageDesc ); SwPageDesc* pRet = pDoc->FindPageDesc( sPageDesc ); if(!pRet) { @@ -468,7 +468,7 @@ uno::Any SwXFootnoteProperties::getPropertyValue(const OUString& rPropertyName) OUString aString; if(pColl) aString = pColl->GetName(); - SwStyleNameMapper::FillProgName(aString, aString, SwGetPoolIdFromName::TxtColl, true); + SwStyleNameMapper::FillProgName(aString, aString, SwGetPoolIdFromName::TxtColl); aRet <<= aString; } break; @@ -480,8 +480,7 @@ uno::Any SwXFootnoteProperties::getPropertyValue(const OUString& rPropertyName) SwStyleNameMapper::FillProgName( rFootnoteInfo.GetPageDesc( *pDoc )->GetName(), aString, - SwGetPoolIdFromName::PageDesc, - true); + SwGetPoolIdFromName::PageDesc); } aRet <<= aString; } @@ -506,8 +505,7 @@ uno::Any SwXFootnoteProperties::getPropertyValue(const OUString& rPropertyName) SwStyleNameMapper::FillProgName( pCharFormat->GetName(), aString, - SwGetPoolIdFromName::ChrFmt, - true); + SwGetPoolIdFromName::ChrFmt); } aRet <<= aString; } @@ -692,8 +690,7 @@ uno::Any SwXEndnoteProperties::getPropertyValue(const OUString& rPropertyName) SwStyleNameMapper::FillProgName( aString, aString, - SwGetPoolIdFromName::TxtColl, - true); + SwGetPoolIdFromName::TxtColl); aRet <<= aString; } @@ -706,8 +703,7 @@ uno::Any SwXEndnoteProperties::getPropertyValue(const OUString& rPropertyName) SwStyleNameMapper::FillProgName( rEndInfo.GetPageDesc( *pDoc )->GetName(), aString, - SwGetPoolIdFromName::PageDesc, - true ); + SwGetPoolIdFromName::PageDesc); } aRet <<= aString; } @@ -732,8 +728,7 @@ uno::Any SwXEndnoteProperties::getPropertyValue(const OUString& rPropertyName) SwStyleNameMapper::FillProgName( pCharFormat->GetName(), aString, - SwGetPoolIdFromName::ChrFmt, - true ); + SwGetPoolIdFromName::ChrFmt); } aRet <<= aString; } @@ -940,8 +935,7 @@ Any SwXLineNumberingProperties::getPropertyValue(const OUString& rPropertyName) SwStyleNameMapper::FillProgName( rInfo.GetCharFormat(pDoc->getIDocumentStylePoolAccess())->GetName(), aString, - SwGetPoolIdFromName::ChrFmt, - true); + SwGetPoolIdFromName::ChrFmt); } aRet <<= aString; } @@ -1319,7 +1313,7 @@ uno::Sequence SwXNumberingRules::GetNumberingRuleByIndex( sValue.clear(); } } - SwStyleNameMapper::FillProgName(sValue, aUString, SwGetPoolIdFromName::TxtColl, true); + SwStyleNameMapper::FillProgName(sValue, aUString, SwGetPoolIdFromName::TxtColl); } return GetPropertiesForNumFormat(rFormat, CharStyleName, (pDocShell) ? & aUString : nullptr); @@ -1356,7 +1350,7 @@ uno::Sequence SwXNumberingRules::GetPropertiesForNumFormat //char style name aUString.clear(); - SwStyleNameMapper::FillProgName( rCharFormatName, aUString, SwGetPoolIdFromName::ChrFmt, true ); + SwStyleNameMapper::FillProgName( rCharFormatName, aUString, SwGetPoolIdFromName::ChrFmt); aPropertyValues.push_back(comphelper::makePropertyValue("CharStyleName", aUString)); //startvalue @@ -1694,7 +1688,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat( OUString uTmp; pProp->Value >>= uTmp; OUString sCharFormatName; - SwStyleNameMapper::FillUIName( uTmp, sCharFormatName, SwGetPoolIdFromName::ChrFmt, true ); + SwStyleNameMapper::FillUIName( uTmp, sCharFormatName, SwGetPoolIdFromName::ChrFmt ); if (sCharFormatName == UNO_NAME_CHARACTER_FORMAT_NONE) { rCharStyleName = aInvalidStyle; @@ -1861,7 +1855,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat( OUString uTmp; pProp->Value >>= uTmp; OUString sStyleName; - SwStyleNameMapper::FillUIName(uTmp, sStyleName, SwGetPoolIdFromName::TxtColl, true ); + SwStyleNameMapper::FillUIName(uTmp, sStyleName, SwGetPoolIdFromName::TxtColl ); *pParagraphStyleName = sStyleName; } } @@ -2016,7 +2010,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat( OUString uTmp; pProp->Value >>= uTmp; OUString sStyleName; - SwStyleNameMapper::FillUIName(uTmp, sStyleName, SwGetPoolIdFromName::TxtColl, true ); + SwStyleNameMapper::FillUIName(uTmp, sStyleName, SwGetPoolIdFromName::TxtColl ); *pHeadingStyleName = sStyleName; } } @@ -2212,7 +2206,7 @@ OUString SwXNumberingRules::getName() if(pNumRule) { OUString aString; - SwStyleNameMapper::FillProgName(pNumRule->GetName(), aString, SwGetPoolIdFromName::NumRule, true ); + SwStyleNameMapper::FillProgName(pNumRule->GetName(), aString, SwGetPoolIdFromName::NumRule ); return aString; } // consider chapter numbering @@ -2220,7 +2214,7 @@ OUString SwXNumberingRules::getName() { OUString aString; SwStyleNameMapper::FillProgName( pDocShell->GetDoc()->GetOutlineNumRule()->GetName(), - aString, SwGetPoolIdFromName::NumRule, true ); + aString, SwGetPoolIdFromName::NumRule ); return aString; } return m_sCreatedNumRuleName; diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index b97b166b34a2..e154f7bd2140 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -836,7 +836,7 @@ uno::Any XStyleFamily::getByName(const OUString& rName) { SolarMutexGuard aGuard; OUString sStyleName; - SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.m_aPoolId, true); + SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.m_aPoolId); if(!m_pBasePool) throw uno::RuntimeException(); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); @@ -859,7 +859,7 @@ uno::Sequence XStyleFamily::getElementNames() for (SfxStyleSheetBase* pStyle = pIt->First(); pStyle; pStyle = pIt->Next()) { OUString sName; - SwStyleNameMapper::FillProgName(pStyle->GetName(), sName, m_rEntry.m_aPoolId, true); + SwStyleNameMapper::FillProgName(pStyle->GetName(), sName, m_rEntry.m_aPoolId); vRet.push_back(sName); } return comphelper::containerToSequence(vRet); @@ -871,7 +871,7 @@ sal_Bool XStyleFamily::hasByName(const OUString& rName) if(!m_pBasePool) throw uno::RuntimeException(); OUString sStyleName; - SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.m_aPoolId, true); + SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.m_aPoolId); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName); return nullptr != pBase; @@ -884,7 +884,7 @@ void XStyleFamily::insertByName(const OUString& rName, const uno::Any& rElement) if(!m_pBasePool) throw uno::RuntimeException(); OUString sStyleName; - SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.m_aPoolId, true); + SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.m_aPoolId); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName); SfxStyleSheetBase* pUINameBase = m_pBasePool->Find( sStyleName ); @@ -1020,7 +1020,7 @@ void XStyleFamily::removeByName(const OUString& rName) throw uno::RuntimeException(); m_pBasePool->SetSearchMask(m_rEntry.m_eFamily); OUString sName; - SwStyleNameMapper::FillUIName(rName, sName, m_rEntry.m_aPoolId, true); + SwStyleNameMapper::FillUIName(rName, sName, m_rEntry.m_aPoolId); SfxStyleSheetBase* pBase = m_pBasePool->Find( sName ); if(!pBase) throw container::NoSuchElementException(); @@ -1332,7 +1332,7 @@ OUString SwXStyle::getName() if(!pBase) throw uno::RuntimeException(); OUString aString; - SwStyleNameMapper::FillProgName(pBase->GetName(), aString, lcl_GetSwEnumFromSfxEnum ( m_rEntry.m_eFamily ), true); + SwStyleNameMapper::FillProgName(pBase->GetName(), aString, lcl_GetSwEnumFromSfxEnum ( m_rEntry.m_eFamily )); return aString; } @@ -1390,7 +1390,7 @@ OUString SwXStyle::getParentStyle() OUString aString; if(pBase) aString = pBase->GetParent(); - SwStyleNameMapper::FillProgName(aString, aString, lcl_GetSwEnumFromSfxEnum(m_rEntry.m_eFamily), true); + SwStyleNameMapper::FillProgName(aString, aString, lcl_GetSwEnumFromSfxEnum(m_rEntry.m_eFamily)); return aString; } @@ -1398,7 +1398,7 @@ void SwXStyle::setParentStyle(const OUString& rParentStyle) { SolarMutexGuard aGuard; OUString sParentStyle; - SwStyleNameMapper::FillUIName(rParentStyle, sParentStyle, lcl_GetSwEnumFromSfxEnum ( m_rEntry.m_eFamily ), true ); + SwStyleNameMapper::FillUIName(rParentStyle, sParentStyle, lcl_GetSwEnumFromSfxEnum ( m_rEntry.m_eFamily ) ); if(!m_pBasePool) { if(!m_bIsDescriptor) @@ -1763,7 +1763,7 @@ void SwXStyle::SetPropertyValue(const SfxItemPropertySimple return; const auto sValue(rValue.get()); OUString aString; - SwStyleNameMapper::FillUIName(sValue, aString, m_rEntry.m_aPoolId, true); + SwStyleNameMapper::FillUIName(sValue, aString, m_rEntry.m_aPoolId); o_rStyleBase.getNewBase()->SetFollow(aString); } template<> @@ -1786,7 +1786,7 @@ void SwXStyle::SetPropertyValue(const SfxItemPropertySimpleEntry& pNewDesc.reset(new SwFormatPageDesc); const auto sValue(rValue.get()); OUString sDescName; - SwStyleNameMapper::FillUIName(sValue, sDescName, SwGetPoolIdFromName::PageDesc, true); + SwStyleNameMapper::FillUIName(sValue, sDescName, SwGetPoolIdFromName::PageDesc); if(pNewDesc->GetPageDesc() && pNewDesc->GetPageDesc()->GetName() == sDescName) return; if(sDescName.isEmpty()) @@ -1844,7 +1844,7 @@ void SwXStyle::SetPropertyValue(const SfxItemPrope const OUString sValue(rNamedValue.Value.get()); // get UI style name from programmatic style name OUString aStyleName; - SwStyleNameMapper::FillUIName(sValue, aStyleName, lcl_GetSwEnumFromSfxEnum(m_rEntry.m_eFamily), true); + SwStyleNameMapper::FillUIName(sValue, aStyleName, lcl_GetSwEnumFromSfxEnum(m_rEntry.m_eFamily)); // check for correct context and style name const auto nIdx(GetCommandContextIndex(rNamedValue.Name)); @@ -1891,7 +1891,7 @@ void SwXStyle::SetPropertyValue(const SfxItemProperty aReg.SetWhich(SID_SWREGISTER_MODE); o_rStyleBase.GetItemSet().Put(aReg); OUString aString; - SwStyleNameMapper::FillUIName(sName, aString, SwGetPoolIdFromName::TxtColl, true); + SwStyleNameMapper::FillUIName(sName, aString, SwGetPoolIdFromName::TxtColl); o_rStyleBase.GetItemSet().Put(SfxStringItem(SID_SWREGISTER_COLLECTION, aString ) ); } template<> @@ -1910,7 +1910,7 @@ void SwXStyle::SetPropertyValue(const SfxItemPropertySimple else pRuby.reset(new SwFormatRuby(OUString())); OUString sStyle; - SwStyleNameMapper::FillUIName(sValue, sStyle, SwGetPoolIdFromName::ChrFmt, true); + SwStyleNameMapper::FillUIName(sValue, sStyle, SwGetPoolIdFromName::ChrFmt); pRuby->SetCharFormatName(sValue); pRuby->SetCharFormatId(0); if(!sValue.isEmpty()) @@ -1940,7 +1940,7 @@ void SwXStyle::SetPropertyValue(const SfxItemPropertySimpleEntr pDrop.reset(new SwFormatDrop); const auto sValue(rValue.get()); OUString sStyle; - SwStyleNameMapper::FillUIName(sValue, sStyle, SwGetPoolIdFromName::ChrFmt, true); + SwStyleNameMapper::FillUIName(sValue, sStyle, SwGetPoolIdFromName::ChrFmt); auto pStyle(static_cast(m_pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SfxStyleFamily::Char))); //default character style must not be set as default format if(!pStyle || pStyle->GetCharFormat() == m_pDoc->GetDfltCharFormat() ) @@ -2167,7 +2167,7 @@ uno::Any SwXStyle::GetStyleProperty(const SfxItemPropertySi { PrepareStyleBase(rBase); OUString aString; - SwStyleNameMapper::FillProgName(rBase.getNewBase()->GetFollow(), aString, lcl_GetSwEnumFromSfxEnum(GetFamily()), true); + SwStyleNameMapper::FillProgName(rBase.getNewBase()->GetFollow(), aString, lcl_GetSwEnumFromSfxEnum(GetFamily())); return uno::makeAny(aString); } template<> @@ -2185,7 +2185,7 @@ uno::Any SwXStyle::GetStyleProperty(const SfxItemPropertySimpleEnt if(!pDesc) return uno::Any(); OUString aString; - SwStyleNameMapper::FillProgName(pDesc->GetName(), aString, SwGetPoolIdFromName::PageDesc, true); + SwStyleNameMapper::FillProgName(pDesc->GetName(), aString, SwGetPoolIdFromName::PageDesc); return uno::makeAny(aString); } template<> @@ -2229,7 +2229,7 @@ uno::Any SwXStyle::GetStyleProperty(const SfxItemP continue; // get programmatic style name from UI style name OUString aStyleName = pCond->GetTextFormatColl()->GetName(); - SwStyleNameMapper::FillProgName(aStyleName, aStyleName, lcl_GetSwEnumFromSfxEnum(GetFamily()), true); + SwStyleNameMapper::FillProgName(aStyleName, aStyleName, lcl_GetSwEnumFromSfxEnum(GetFamily())); pSeq[n].Value <<= aStyleName; } } @@ -2264,7 +2264,7 @@ uno::Any SwXStyle::GetStyleProperty(const SfxItemProp if(!pCol) return uno::makeAny(OUString()); OUString aName; - SwStyleNameMapper::FillProgName(pCol->GetName(), aName, SwGetPoolIdFromName::TxtColl, true); + SwStyleNameMapper::FillProgName(pCol->GetName(), aName, SwGetPoolIdFromName::TxtColl); return uno::makeAny(aName); } template<> @@ -4456,7 +4456,7 @@ OUString SAL_CALL SwXTextTableStyle::getName() { SolarMutexGuard aGuard; OUString sProgName; - SwStyleNameMapper::FillProgName(m_pTableAutoFormat->GetName(), sProgName, SwGetPoolIdFromName::TabStyle, true); + SwStyleNameMapper::FillProgName(m_pTableAutoFormat->GetName(), sProgName, SwGetPoolIdFromName::TabStyle); return sProgName; } @@ -4801,7 +4801,7 @@ OUString SAL_CALL SwXTextCellStyle::getName() if (m_bPhysical) { OUString sParentStyle; - SwStyleNameMapper::FillUIName(m_sParentStyle, sParentStyle, SwGetPoolIdFromName::TabStyle, true); + SwStyleNameMapper::FillUIName(m_sParentStyle, sParentStyle, SwGetPoolIdFromName::TabStyle); SwTableAutoFormat* pTableFormat = m_pDocShell->GetDoc()->GetTableStyles().FindAutoFormat(sParentStyle); if (!pTableFormat) { diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 39bd373e490c..614625392a54 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -278,7 +278,7 @@ static void lcl_SetSpecialProperty(SwFrameFormat* pFormat, const SwPageDesc* pDesc = nullptr; if (!sPageStyle.isEmpty()) { - SwStyleNameMapper::FillUIName(sPageStyle, sPageStyle, SwGetPoolIdFromName::PageDesc, true ); + SwStyleNameMapper::FillUIName(sPageStyle, sPageStyle, SwGetPoolIdFromName::PageDesc); pDesc = SwPageDesc::GetByName(*pFormat->GetDoc(), sPageStyle); } SwFormatPageDesc aDesc( pDesc ); @@ -1852,7 +1852,7 @@ void SwTableProperties_Impl::ApplyTableAttr(const SwTable& rTable, SwDoc& rDoc) OUString sPageStyle = pPage->get(); if(!sPageStyle.isEmpty()) { - SwStyleNameMapper::FillUIName(sPageStyle, sPageStyle, SwGetPoolIdFromName::PageDesc, true); + SwStyleNameMapper::FillUIName(sPageStyle, sPageStyle, SwGetPoolIdFromName::PageDesc); const SwPageDesc* pDesc = SwPageDesc::GetByName(rDoc, sPageStyle); if(pDesc) { diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index a2110025381c..bcfa1e5b61b9 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -484,11 +484,10 @@ static bool MakePoint(const SwFltStackEntry& rEntry, SwDoc* pDoc, // it adheres to certain restrictions on bookmarks in tables (cannot // span more than one cell) static bool MakeBookRegionOrPoint(const SwFltStackEntry& rEntry, SwDoc* pDoc, - SwPaM& rRegion, bool bCheck ) + SwPaM& rRegion ) { - if (rEntry.MakeRegion(pDoc, rRegion, bCheck )) + if (rEntry.MakeRegion(pDoc, rRegion, true/*bCheck*/ )) { - // sal_Bool b1 = rNds[rRegion.GetPoint()->nNode]->FindTableNode() != 0; if (rRegion.GetPoint()->nNode.GetNode().FindTableBoxStartNode() != rRegion.GetMark()->nNode.GetNode().FindTableBoxStartNode()) { @@ -633,7 +632,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, if ( ( !IsFlagSet(HYPO) || IsFlagSet(BOOK_AND_REF) ) && !rEntry.bConsumedByField ) { - MakeBookRegionOrPoint(rEntry, pDoc, aRegion, true); + MakeBookRegionOrPoint(rEntry, pDoc, aRegion); // #i120879# - create a cross reference heading bookmark if appropriate. const IDocumentMarkAccess::MarkType eBookmarkType = ( pB->IsTOCBookmark() && @@ -646,7 +645,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, break; case RES_FLTR_ANNOTATIONMARK: { - if (MakeBookRegionOrPoint(rEntry, pDoc, aRegion, true)) + if (MakeBookRegionOrPoint(rEntry, pDoc, aRegion)) { SwTextNode const*const pTextNode( aRegion.End()->nNode.GetNode().GetTextNode()); @@ -678,7 +677,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, break; case RES_FLTR_RDFMARK: { - if (MakeBookRegionOrPoint(rEntry, pDoc, aRegion, true)) + if (MakeBookRegionOrPoint(rEntry, pDoc, aRegion)) { SwFltRDFMark* pMark = static_cast(rEntry.pAttr.get()); if (aRegion.GetNode().IsTextNode()) diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 69fe4a3a99d8..aeaac6d5af73 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -147,8 +147,7 @@ static Writer& OutCSS1_SvxULSpace_SvxLRSpace( Writer& rWrt, const SvxULSpaceItem *pULSpace, const SvxLRSpaceItem *pLRSpace ); static Writer& OutCSS1_SvxULSpace_SvxLRSpace( Writer& rWrt, - const SfxItemSet& rItemSet, - bool bDeep ); + const SfxItemSet& rItemSet ); static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt, Css1Background nMode, const OUString *pGraphicName ); @@ -1702,7 +1701,7 @@ static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rPageDesc, true ); } - OutCSS1_SvxULSpace_SvxLRSpace( rWrt, aItemSet, false ); + OutCSS1_SvxULSpace_SvxLRSpace( rWrt, aItemSet ); // If for a Pseudo-Selector no Property had been set, we still // have to export something, so that the corresponding template is @@ -2988,16 +2987,15 @@ static Writer& OutCSS1_SvxULSpace_SvxLRSpace( Writer& rWrt, } static Writer& OutCSS1_SvxULSpace_SvxLRSpace( Writer& rWrt, - const SfxItemSet& rItemSet, - bool bDeep ) + const SfxItemSet& rItemSet ) { const SvxULSpaceItem *pULSpace = nullptr; const SvxLRSpaceItem *pLRSpace = nullptr; const SfxPoolItem *pItem; - if( SfxItemState::SET == rItemSet.GetItemState( RES_LR_SPACE, bDeep, &pItem ) ) + if( SfxItemState::SET == rItemSet.GetItemState( RES_LR_SPACE, false/*bDeep*/, &pItem ) ) pLRSpace = static_cast(pItem); - if( SfxItemState::SET == rItemSet.GetItemState( RES_UL_SPACE, bDeep, &pItem ) ) + if( SfxItemState::SET == rItemSet.GetItemState( RES_UL_SPACE, false/*bDeep*/, &pItem ) ) pULSpace = static_cast(pItem); if( pLRSpace || pULSpace ) diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index ee63d5a3ddec..deffa526c817 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -1837,7 +1837,7 @@ void HTMLEndPosLst::Insert( const SwDrawFrameFormat& rFormat, sal_Int32 nPos, const SfxItemSet& rFormatItemSet = rFormat.GetAttrSet(); SfxItemSet aItemSet( *rFormatItemSet.GetPool(), svl::Items{} ); - SwHTMLWriter::GetEEAttrsFromDrwObj( aItemSet, pTextObj, true ); + SwHTMLWriter::GetEEAttrsFromDrwObj( aItemSet, pTextObj ); bool bOutStylesOld = bOutStyles; bOutStyles = false; Insert( aItemSet, nPos, nPos+1, rFormatInfos, false ); diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx index e6667fddc1d6..3df710abde87 100644 --- a/sw/source/filter/html/htmldrawwriter.cxx +++ b/sw/source/filter/html/htmldrawwriter.cxx @@ -70,8 +70,7 @@ const SdrObject *SwHTMLWriter::GetMarqueeTextObj( const SwDrawFrameFormat& rForm } void SwHTMLWriter::GetEEAttrsFromDrwObj( SfxItemSet& rItemSet, - const SdrObject *pObj, - bool bSetDefaults ) + const SdrObject *pObj ) { // get the edit script::Engine attributes from object SfxItemSet rObjItemSet = pObj->GetMergedItemSet(); @@ -86,42 +85,39 @@ void SwHTMLWriter::GetEEAttrsFromDrwObj( SfxItemSet& rItemSet, bool bSet = SfxItemState::SET == rObjItemSet.GetItemState( nEEWhich, false, &pEEItem ); - if( bSet || bSetDefaults ) + sal_uInt16 nSwWhich = 0; + switch( nEEWhich ) { - sal_uInt16 nSwWhich = 0; - switch( nEEWhich ) - { - case EE_CHAR_COLOR: nSwWhich = RES_CHRATR_COLOR; break; - case EE_CHAR_STRIKEOUT: nSwWhich = RES_CHRATR_CROSSEDOUT; break; - case EE_CHAR_ESCAPEMENT: nSwWhich = RES_CHRATR_ESCAPEMENT; break; - case EE_CHAR_FONTINFO: nSwWhich = RES_CHRATR_FONT; break; - case EE_CHAR_FONTINFO_CJK: nSwWhich = RES_CHRATR_CJK_FONT; break; - case EE_CHAR_FONTINFO_CTL: nSwWhich = RES_CHRATR_CTL_FONT; break; - case EE_CHAR_FONTHEIGHT: nSwWhich = RES_CHRATR_FONTSIZE; break; - case EE_CHAR_FONTHEIGHT_CJK:nSwWhich = RES_CHRATR_CJK_FONTSIZE; break; - case EE_CHAR_FONTHEIGHT_CTL:nSwWhich = RES_CHRATR_CTL_FONTSIZE; break; - case EE_CHAR_KERNING: nSwWhich = RES_CHRATR_KERNING; break; - case EE_CHAR_ITALIC: nSwWhich = RES_CHRATR_POSTURE; break; - case EE_CHAR_ITALIC_CJK: nSwWhich = RES_CHRATR_CJK_POSTURE; break; - case EE_CHAR_ITALIC_CTL: nSwWhich = RES_CHRATR_CTL_POSTURE; break; - case EE_CHAR_UNDERLINE: nSwWhich = RES_CHRATR_UNDERLINE; break; - case EE_CHAR_WEIGHT: nSwWhich = RES_CHRATR_WEIGHT; break; - case EE_CHAR_WEIGHT_CJK: nSwWhich = RES_CHRATR_CJK_WEIGHT; break; - case EE_CHAR_WEIGHT_CTL: nSwWhich = RES_CHRATR_CTL_WEIGHT; break; - } - - if( nSwWhich ) - { - // if the item isn't set we maybe take the default item - if( !bSet ) - pEEItem = &rObjItemSet.GetPool()->GetDefaultItem(nEEWhich); - - // now we clone the item with the which id of the writer - SfxPoolItem *pSwItem = pEEItem->Clone(); - pSwItem->SetWhich( nSwWhich ); - rItemSet.Put( *pSwItem ); - delete pSwItem; - } + case EE_CHAR_COLOR: nSwWhich = RES_CHRATR_COLOR; break; + case EE_CHAR_STRIKEOUT: nSwWhich = RES_CHRATR_CROSSEDOUT; break; + case EE_CHAR_ESCAPEMENT: nSwWhich = RES_CHRATR_ESCAPEMENT; break; + case EE_CHAR_FONTINFO: nSwWhich = RES_CHRATR_FONT; break; + case EE_CHAR_FONTINFO_CJK: nSwWhich = RES_CHRATR_CJK_FONT; break; + case EE_CHAR_FONTINFO_CTL: nSwWhich = RES_CHRATR_CTL_FONT; break; + case EE_CHAR_FONTHEIGHT: nSwWhich = RES_CHRATR_FONTSIZE; break; + case EE_CHAR_FONTHEIGHT_CJK:nSwWhich = RES_CHRATR_CJK_FONTSIZE; break; + case EE_CHAR_FONTHEIGHT_CTL:nSwWhich = RES_CHRATR_CTL_FONTSIZE; break; + case EE_CHAR_KERNING: nSwWhich = RES_CHRATR_KERNING; break; + case EE_CHAR_ITALIC: nSwWhich = RES_CHRATR_POSTURE; break; + case EE_CHAR_ITALIC_CJK: nSwWhich = RES_CHRATR_CJK_POSTURE; break; + case EE_CHAR_ITALIC_CTL: nSwWhich = RES_CHRATR_CTL_POSTURE; break; + case EE_CHAR_UNDERLINE: nSwWhich = RES_CHRATR_UNDERLINE; break; + case EE_CHAR_WEIGHT: nSwWhich = RES_CHRATR_WEIGHT; break; + case EE_CHAR_WEIGHT_CJK: nSwWhich = RES_CHRATR_CJK_WEIGHT; break; + case EE_CHAR_WEIGHT_CTL: nSwWhich = RES_CHRATR_CTL_WEIGHT; break; + } + + if( nSwWhich ) + { + // if the item isn't set we maybe take the default item + if( !bSet ) + pEEItem = &rObjItemSet.GetPool()->GetDefaultItem(nEEWhich); + + // now we clone the item with the which id of the writer + SfxPoolItem *pSwItem = pEEItem->Clone(); + pSwItem->SetWhich( nSwWhich ); + rItemSet.Put( *pSwItem ); + delete pSwItem; } nEEWhich = aIter.NextWhich(); diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 90a3ebecd7cc..07adc94c39b6 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -1832,7 +1832,7 @@ static Writer& OutHTML_FrameFormatAsMarquee( Writer& rWrt, const SwFrameFormat& const SfxItemSet& rFormatItemSet = rFrameFormat.GetAttrSet(); SfxItemSet aItemSet( *rFormatItemSet.GetPool(), svl::Items{} ); - SwHTMLWriter::GetEEAttrsFromDrwObj( aItemSet, &rSdrObj, true ); + SwHTMLWriter::GetEEAttrsFromDrwObj( aItemSet, &rSdrObj ); bool bCfgOutStylesOld = rHTMLWrt.m_bCfgOutStyles; rHTMLWrt.m_bCfgOutStyles = false; rHTMLWrt.m_bTextAttr = true; diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index 6ded81694981..bacea748f300 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -541,8 +541,7 @@ public: bool bCheckDropCap ); static void GetEEAttrsFromDrwObj( SfxItemSet& rItemSet, - const SdrObject *pObj, - bool bSetDefaults ); + const SdrObject *pObj ); static sal_uInt16 GetDefListLvl( const OUString& rNm, sal_uInt16 nPoolId ); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index bb961c9a1462..52862a07d17d 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -149,7 +149,7 @@ using namespace nsHdFtFlags; #include #include -SwMacroInfo* GetMacroInfo( SdrObject* pObj, bool bCreate ) // static +static SwMacroInfo* GetMacroInfo( SdrObject* pObj ) { if ( pObj ) { @@ -163,12 +163,9 @@ SwMacroInfo* GetMacroInfo( SdrObject* pObj, bool bCreate ) // static return dynamic_cast(pData); } } - if ( bCreate ) - { - SwMacroInfo* pData = new SwMacroInfo; - pObj->AppendUserData(pData); - return pData; - } + SwMacroInfo* pData = new SwMacroInfo; + pObj->AppendUserData(pData); + return pData; } return nullptr; @@ -1098,7 +1095,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, if (pObj && !hlStr.hLinkAddr.isEmpty()) { - SwMacroInfo* pInfo = GetMacroInfo( pObj, true ); + SwMacroInfo* pInfo = GetMacroInfo( pObj ); if( pInfo ) { pInfo->SetShapeId( rObjData.nShapeId ); diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index c918f9899eb0..ec75d3b00951 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -593,8 +593,7 @@ void SwXMLItemSetStyleContext_Impl::ConnectPageDesc() sMasterPageName ); SwStyleNameMapper::FillUIName( sName, sName, - SwGetPoolIdFromName::PageDesc, - true); + SwGetPoolIdFromName::PageDesc); SwPageDesc *pPageDesc = pDoc->FindPageDesc(sName); if( !pPageDesc ) { diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index 7ee76a429f9f..deb42e5cdcc5 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -91,8 +91,7 @@ void SwXMLExport::ExportFormat( const SwFormat& rFormat, enum XMLTokenEnum eFami SwStyleNameMapper::FillProgName( pPageDesc->GetName(), sName, - SwGetPoolIdFromName::PageDesc, - true); + SwGetPoolIdFromName::PageDesc); AddAttribute( XML_NAMESPACE_STYLE, XML_MASTER_PAGE_NAME, EncodeStyleName( sName ) ); } diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index 7138654d1291..ab3ab8889aa7 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -345,22 +345,18 @@ IMPL_LINK_NOARG(SwParagraphNumTabPage, EditNumStyleHdl_Impl, Button*, void) // Internal: Perform functions through the Dispatcher bool SwParagraphNumTabPage::ExecuteEditNumStyle_Impl( - sal_uInt16 nId, const OUString &rStr, const OUString& rRefStr, SfxStyleFamily nFamily, - sal_uInt16 nMask) + sal_uInt16 nId, const OUString &rStr, const OUString& rRefStr, SfxStyleFamily nFamily) { SfxDispatcher &rDispatcher = *SfxViewShell::Current()->GetDispatcher(); SfxStringItem aItem(nId, rStr); SfxUInt16Item aFamily(SID_STYLE_FAMILY, (sal_uInt16)nFamily); - SfxUInt16Item aMask( SID_STYLE_MASK, nMask ); SfxStringItem aRefName( SID_STYLE_REFERENCE, rRefStr ); const SfxPoolItem* pItems[ 6 ]; sal_uInt16 nCount = 0; if( !rStr.isEmpty() ) pItems[ nCount++ ] = &aItem; pItems[ nCount++ ] = &aFamily; - if( nMask ) - pItems[ nCount++ ] = &aMask; if( !rRefStr.isEmpty() ) pItems[ nCount++ ] = &aRefName; diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index 084d989ef819..adb438cab7c7 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -347,7 +347,7 @@ static const SwBoxAutoFormat* lcl_FindCellStyle(SwDoc& rDoc, const OUString& rNa const sal_uInt32 nBoxIndex = aTableTemplateMap[nBoxFormat]; const SwBoxAutoFormat& rBoxFormat = rTableStyle.GetBoxFormat(nBoxIndex); OUString sBoxFormatName; - SwStyleNameMapper::FillProgName(rTableStyle.GetName(), sBoxFormatName, SwGetPoolIdFromName::CellStyle, true); + SwStyleNameMapper::FillProgName(rTableStyle.GetName(), sBoxFormatName, SwGetPoolIdFromName::CellStyle); sBoxFormatName += rTableStyle.GetTableTemplateCellSubName(rBoxFormat); if (rName == sBoxFormatName) pFormat = &rBoxFormat; @@ -3063,7 +3063,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() const sal_uInt32 nBoxIndex = aTableTemplateMap[nBoxFormat]; const SwBoxAutoFormat& rBoxFormat = rTableStyle.GetBoxFormat(nBoxIndex); OUString sBoxFormatName; - SwStyleNameMapper::FillProgName(rTableStyle.GetName(), sBoxFormatName, SwGetPoolIdFromName::CellStyle, true); + SwStyleNameMapper::FillProgName(rTableStyle.GetName(), sBoxFormatName, SwGetPoolIdFromName::CellStyle); sBoxFormatName += rTableStyle.GetTableTemplateCellSubName(rBoxFormat); aLst.Append( cCELLSTYLE, sBoxFormatName ); } diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 241cfaa52730..5cf02afffd2d 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -924,21 +924,15 @@ static bool lcl_SaveDoc( static void lcl_PreparePrinterOptions( const uno::Sequence< beans::PropertyValue >& rInPrintOptions, - const bool bVisibleMonitor, uno::Sequence< beans::PropertyValue >& rOutPrintOptions) { // printing should be done synchronously otherwise the document // might already become invalid during the process - const sal_Int32 nOffset = !bVisibleMonitor ? 2 : 1; + const sal_Int32 nOffset = 1; rOutPrintOptions.realloc( nOffset ); rOutPrintOptions[ 0 ].Name = "Wait"; rOutPrintOptions[ 0 ].Value <<= true; - if( !bVisibleMonitor ) - { - rOutPrintOptions[ 1 ].Name = "MonitorVisible"; - rOutPrintOptions[ 1 ].Value <<= false; - } // copy print options const beans::PropertyValue* pOptions = rInPrintOptions.getConstArray(); @@ -1613,7 +1607,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, { // print the target document uno::Sequence< beans::PropertyValue > aOptions( rMergeDescriptor.aPrintOptions ); - lcl_PreparePrinterOptions( rMergeDescriptor.aPrintOptions, true, aOptions ); + lcl_PreparePrinterOptions( rMergeDescriptor.aPrintOptions, aOptions ); pTargetView->ExecPrint( aOptions, bIsMergeSilent, false/*bPrintAsync*/ ); } } @@ -2836,12 +2830,11 @@ void SwDBManager::StoreEmbeddedDataSource(const uno::Reference xStorable->storeAsURL(sTmpName, aSequence); } -OUString SwDBManager::LoadAndRegisterDataSource(const OUString &rURI, const OUString *pPrefix, const OUString *pDestDir, - const uno::Reference< beans::XPropertySet > *pSettings) +OUString SwDBManager::LoadAndRegisterDataSource(const OUString &rURI, const OUString *pDestDir) { uno::Any aURLAny; DBConnURITypes type = GetDBunoURI( rURI, aURLAny ); - return LoadAndRegisterDataSource( type, aURLAny, pSettings, rURI, pPrefix, pDestDir ); + return LoadAndRegisterDataSource( type, aURLAny, nullptr, rURI, nullptr, pDestDir ); } void SwDBManager::RevokeDataSource(const OUString& rName) diff --git a/sw/source/uibase/inc/numpara.hxx b/sw/source/uibase/inc/numpara.hxx index 8641a6ddc1bb..5c4785f33b61 100644 --- a/sw/source/uibase/inc/numpara.hxx +++ b/sw/source/uibase/inc/numpara.hxx @@ -62,7 +62,7 @@ class SwParagraphNumTabPage final : public SfxTabPage static const sal_uInt16 aPageRg[]; static bool ExecuteEditNumStyle_Impl( sal_uInt16 nId, const OUString& rStr, const OUString& rRefStr, - SfxStyleFamily nFamily, sal_uInt16 nMask = 0 ); + SfxStyleFamily nFamily ); public: SwParagraphNumTabPage(vcl::Window* pParent, const SfxItemSet& rSet ); diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index 97356cf7b75c..ffb464c5b20a 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -540,7 +540,7 @@ Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAuto pValues[1].Name = UNO_NAME_RUBY_TEXT; pValues[1].Value <<= rAttr.GetText(); pValues[2].Name = UNO_NAME_RUBY_CHAR_STYLE_NAME; - SwStyleNameMapper::FillProgName(rAttr.GetCharFormatName(), aString, SwGetPoolIdFromName::ChrFmt, true ); + SwStyleNameMapper::FillProgName(rAttr.GetCharFormatName(), aString, SwGetPoolIdFromName::ChrFmt ); pValues[2].Value <<= aString; pValues[3].Name = UNO_NAME_RUBY_ADJUST; pValues[3].Value <<= (sal_Int16)rAttr.GetAdjustment(); @@ -590,7 +590,7 @@ void SAL_CALL SwXTextView::setRubyList( if(pProperties[nProp].Value >>= sTmp) { OUString sName; - SwStyleNameMapper::FillUIName(sTmp, sName, SwGetPoolIdFromName::ChrFmt, true ); + SwStyleNameMapper::FillUIName(sTmp, sName, SwGetPoolIdFromName::ChrFmt ); const sal_uInt16 nPoolId = sName.isEmpty() ? 0 : SwStyleNameMapper::GetPoolIdFromUIName(sName, SwGetPoolIdFromName::ChrFmt ); -- cgit