diff options
Diffstat (limited to 'sw/source')
35 files changed, 128 insertions, 255 deletions
diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx index df38c74d33f3..f5e3166445ab 100644 --- a/sw/source/core/bastyp/bparr.cxx +++ b/sw/source/core/bastyp/bparr.cxx @@ -397,7 +397,7 @@ void BigPtrArray::Replace( sal_uLong idx, const ElementPtr& rElem) } /** Compress the array */ -sal_uInt16 BigPtrArray::Compress( short nMax ) +sal_uInt16 BigPtrArray::Compress() { CHECKIDX( ppInf, nBlock, nSize, nCur ); @@ -412,7 +412,7 @@ sal_uInt16 BigPtrArray::Compress( short nMax ) sal_uInt16 nFirstChgPos = USHRT_MAX; // at which position was the 1st change? // convert fill percentage into number of remaining elements - nMax = MAXENTRY - (long) MAXENTRY * nMax / 100; + short nMax = MAXENTRY - (long) MAXENTRY * COMPRESSLVL / 100; for( sal_uInt16 cur = 0; cur < nBlock; ++cur ) { diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 69c6e0a417b5..6e969d5e2a3f 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -396,23 +396,13 @@ SwSbxValue SwCalc::Calculate( const OUString& rStr ) return nResult; } -//TODO: provide documentation -/** ??? - - @param rVal ??? - @param bRound In previous times <bRound> had a default value of <true>. - There it should be only changed when calculating table cells, - so that no rounding errors would occur while composing a formula. - Now this parameter is ignored. - @return ??? -*/ -OUString SwCalc::GetStrResult( const SwSbxValue& rVal, bool bRound ) +OUString SwCalc::GetStrResult( const SwSbxValue& rVal ) { if( !rVal.IsDouble() ) { return rVal.GetOUString(); } - return GetStrResult( rVal.GetDouble(), bRound ); + return GetStrResult( rVal.GetDouble() ); } OUString SwCalc::GetStrResult( double nValue, bool ) @@ -1534,11 +1524,10 @@ namespace } bool SwCalc::Str2Double( const OUString& rCommand, sal_Int32& rCommandPos, - double& rVal, const LocaleDataWrapper* const pLclData ) + double& rVal ) { const SvtSysLocale aSysLocale; - return lcl_Str2Double( rCommand, rCommandPos, rVal, - pLclData ? pLclData : aSysLocale.GetLocaleDataPtr() ); + return lcl_Str2Double( rCommand, rCommandPos, rVal, aSysLocale.GetLocaleDataPtr() ); } bool SwCalc::Str2Double( const OUString& rCommand, sal_Int32& rCommandPos, diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 88f7fe26727b..9cc500f81700 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -3127,9 +3127,9 @@ bool SwCursorShell::IsInVerticalText( const Point* pPt ) const return FRMDIR_VERT_TOP_RIGHT == nDir || FRMDIR_VERT_TOP_LEFT == nDir; } -bool SwCursorShell::IsInRightToLeftText( const Point* pPt ) const +bool SwCursorShell::IsInRightToLeftText() const { - const short nDir = GetTextDirection( pPt ); + const short nDir = GetTextDirection(); // GetTextDirection uses FRMDIR_VERT_TOP_LEFT to indicate RTL in // vertical environment return FRMDIR_VERT_TOP_LEFT == nDir || FRMDIR_HORI_RIGHT_TOP == nDir; diff --git a/sw/source/core/doc/DocumentStateManager.cxx b/sw/source/core/doc/DocumentStateManager.cxx index 80869a6a68ad..22751c6e8453 100644 --- a/sw/source/core/doc/DocumentStateManager.cxx +++ b/sw/source/core/doc/DocumentStateManager.cxx @@ -100,9 +100,9 @@ void DocumentStateManager::SetUpdateExpFieldStat(bool b) mbUpdateExpField = b; } -void DocumentStateManager::SetLoaded(bool b) +void DocumentStateManager::SetLoaded() { - mbLoaded = b; + mbLoaded = true; } } diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 30f3f8872c0a..cb7c8c170e50 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -1632,9 +1632,9 @@ short SwDoc::GetTextDirection( const SwPosition& rPos, return nRet; } -bool SwDoc::IsInVerticalText( const SwPosition& rPos, const Point* pPt ) const +bool SwDoc::IsInVerticalText( const SwPosition& rPos ) const { - const short nDir = GetTextDirection( rPos, pPt ); + const short nDir = GetTextDirection( rPos ); return FRMDIR_VERT_TOP_RIGHT == nDir || FRMDIR_VERT_TOP_LEFT == nDir; } diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index d78208475e06..9b7dc906f8f8 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -291,7 +291,7 @@ bool SwExtraRedlineTable::DeleteTableCellRedline( SwDoc* pDoc, const SwTableBox& return bChg; } -bool SwRedlineTable::Insert( SwRangeRedline* p, bool bIns ) +bool SwRedlineTable::Insert( SwRangeRedline* p ) { if( p->HasValidRange() ) { @@ -300,14 +300,10 @@ bool SwRedlineTable::Insert( SwRangeRedline* p, bool bIns ) p->CallDisplayFunc(0, nP); return rv.second; } - if( bIns ) - return InsertWithValidRanges( p ); - - OSL_ENSURE( false, "Redline: wrong range" ); - return false; + return InsertWithValidRanges( p ); } -bool SwRedlineTable::Insert( SwRangeRedline* p, sal_uInt16& rP, bool bIns ) +bool SwRedlineTable::Insert( SwRangeRedline* p, sal_uInt16& rP ) { if( p->HasValidRange() ) { @@ -316,11 +312,7 @@ bool SwRedlineTable::Insert( SwRangeRedline* p, sal_uInt16& rP, bool bIns ) p->CallDisplayFunc(0, rP); return rv.second; } - if( bIns ) - return InsertWithValidRanges( p, &rP ); - - OSL_ENSURE( false, "Redline: wrong range" ); - return false; + return InsertWithValidRanges( p, &rP ); } bool SwRedlineTable::InsertWithValidRanges( SwRangeRedline* p, sal_uInt16* pInsPos ) @@ -512,20 +504,17 @@ sal_uInt16 SwRedlineTable::FindPrevOfSeqNo( sal_uInt16 nSttPos ) const /// Find the next or preceding Redline with the same seq.no. /// We can limit the search using look ahead (0 searches the whole array). -sal_uInt16 SwRedlineTable::FindNextSeqNo( sal_uInt16 nSeqNo, sal_uInt16 nSttPos, - sal_uInt16 nLookahead ) const +sal_uInt16 SwRedlineTable::FindNextSeqNo( sal_uInt16 nSeqNo, sal_uInt16 nSttPos ) const { + sal_uInt16 nLookahead = 20; sal_uInt16 nRet = USHRT_MAX; if( nSeqNo && nSttPos < size() ) { size_t nEnd = size(); - if( nLookahead ) + const size_t nTmp = static_cast<size_t>(nSttPos)+ static_cast<size_t>(nLookahead); + if (nTmp < nEnd) { - const size_t nTmp = static_cast<size_t>(nSttPos)+ static_cast<size_t>(nLookahead); - if (nTmp < nEnd) - { - nEnd = nTmp; - } + nEnd = nTmp; } for( ; nSttPos < nEnd; ++nSttPos ) @@ -538,14 +527,14 @@ sal_uInt16 SwRedlineTable::FindNextSeqNo( sal_uInt16 nSeqNo, sal_uInt16 nSttPos, return nRet; } -sal_uInt16 SwRedlineTable::FindPrevSeqNo( sal_uInt16 nSeqNo, sal_uInt16 nSttPos, - sal_uInt16 nLookahead ) const +sal_uInt16 SwRedlineTable::FindPrevSeqNo( sal_uInt16 nSeqNo, sal_uInt16 nSttPos ) const { + sal_uInt16 nLookahead = 20; sal_uInt16 nRet = USHRT_MAX; if( nSeqNo && nSttPos < size() ) { size_t nEnd = 0; - if( nLookahead && nSttPos > nLookahead ) + if( nSttPos > nLookahead ) nEnd = nSttPos - nLookahead; ++nSttPos; @@ -1581,10 +1570,10 @@ const SwRedlineData & SwRangeRedline::GetRedlineData(sal_uInt16 nPos) const return *pCur; } -OUString SwRangeRedline::GetDescr(sal_uInt16 nPos) +OUString SwRangeRedline::GetDescr() { // get description of redline data (e.g.: "insert $1") - OUString aResult = GetRedlineData(nPos).GetDescr(); + OUString aResult = GetRedlineData().GetDescr(); SwPaM * pPaM = nullptr; bool bDeletePaM = false; diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx index 1c4673fa637a..b156c4d3d066 100644 --- a/sw/source/core/docnode/ndnotxt.cxx +++ b/sw/source/core/docnode/ndnotxt.cxx @@ -260,7 +260,7 @@ Graphic SwNoTextNode::GetGraphic() const } // #i73249# -void SwNoTextNode::SetTitle( const OUString& rTitle, bool bBroadcast ) +void SwNoTextNode::SetTitle( const OUString& rTitle ) { // Title attribute of <SdrObject> replaces own AlternateText attribute SwFlyFrameFormat* pFlyFormat = dynamic_cast<SwFlyFrameFormat*>(GetFlyFormat()); @@ -270,7 +270,7 @@ void SwNoTextNode::SetTitle( const OUString& rTitle, bool bBroadcast ) return; } - pFlyFormat->SetObjTitle( rTitle, bBroadcast ); + pFlyFormat->SetObjTitle( rTitle ); } OUString SwNoTextNode::GetTitle() const @@ -285,7 +285,7 @@ OUString SwNoTextNode::GetTitle() const return pFlyFormat->GetObjTitle(); } -void SwNoTextNode::SetDescription( const OUString& rDescription, bool bBroadcast ) +void SwNoTextNode::SetDescription( const OUString& rDescription ) { SwFlyFrameFormat* pFlyFormat = dynamic_cast<SwFlyFrameFormat*>(GetFlyFormat()); OSL_ENSURE( pFlyFormat, "<SwNoTextNode::SetDescription(..)> - missing <SwFlyFrameFormat> instance" ); @@ -294,7 +294,7 @@ void SwNoTextNode::SetDescription( const OUString& rDescription, bool bBroadcast return; } - pFlyFormat->SetObjDescription( rDescription, bBroadcast ); + pFlyFormat->SetObjDescription( rDescription ); } OUString SwNoTextNode::GetDescription() const diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 544ee124962a..cbd04e4ed8dc 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1124,12 +1124,11 @@ SwRect SwContentNode::FindLayoutRect( const bool bPrtArea, const Point* pPoint, return aRet; } -SwRect SwContentNode::FindPageFrameRect( const bool bPrtArea, const Point* pPoint, - const bool bCalcFrame ) const +SwRect SwContentNode::FindPageFrameRect( const bool bPrtArea, const Point* pPoint ) const { SwRect aRet; SwFrame* pFrame = ::GetFrameOfModify( nullptr, *const_cast<SwModify*>(static_cast<SwModify const *>(this)), - FRM_CNTNT, pPoint, nullptr, bCalcFrame ); + FRM_CNTNT, pPoint ); if( pFrame && nullptr != ( pFrame = pFrame->FindPageFrame() )) aRet = bPrtArea ? pFrame->Prt() : pFrame->Frame(); return aRet; @@ -1658,17 +1657,13 @@ sal_uInt16 SwContentNode::ResetAllAttr() return aNew.Count(); } -bool SwContentNode::GetAttr( SfxItemSet& rSet, bool bInParent ) const +bool SwContentNode::GetAttr( SfxItemSet& rSet ) const { if( rSet.Count() ) rSet.ClearItem(); const SwAttrSet& rAttrSet = GetSwAttrSet(); - if( bInParent ) - return rSet.Set( rAttrSet ); - - rSet.Put( rAttrSet ); - return rSet.Count() != 0; + return rSet.Set( rAttrSet ); } sal_uInt16 SwContentNode::ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rWhichIds ) diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 8fe1bc0c1d27..d28606e7d0d2 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -1906,12 +1906,11 @@ SwStartNode* SwNodes::MakeEmptySection( const SwNodeIndex& rIdx, SwStartNode* SwNodes::MakeTextSection( const SwNodeIndex & rWhere, SwStartNodeType eSttNdTyp, - SwTextFormatColl *pColl, - SwAttrSet* pAutoAttr ) + SwTextFormatColl *pColl ) { SwStartNode* pSttNd = new SwStartNode( rWhere, ND_STARTNODE, eSttNdTyp ); new SwEndNode( rWhere, *pSttNd ); - MakeTextNode( SwNodeIndex( rWhere, - 1 ), pColl, pAutoAttr ); + MakeTextNode( SwNodeIndex( rWhere, - 1 ), pColl ); return pSttNd; } diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 74fd835a7fc0..fd849ccf7d24 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -581,17 +581,13 @@ OUString SwSection::GetLinkFileName() const return m_Data.GetLinkFileName(); } -void SwSection::SetLinkFileName(const OUString& rNew, OUString const*const pPassWd) +void SwSection::SetLinkFileName(const OUString& rNew) { if (m_RefLink.Is()) { m_RefLink->SetLinkSourceName( rNew ); } m_Data.SetLinkFileName(rNew); - if( pPassWd ) - { - SetLinkFilePassword( *pPassWd ); - } } // If it was a Linked Section, we need to make all Child Links visible diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 5f38a96d4532..c5cadf9b73c3 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -421,13 +421,8 @@ SwTextFormatColl* SwEditShell::MakeTextFormatColl(const OUString& rFormatCollNam } -void SwEditShell::FillByEx(SwTextFormatColl* pColl, bool bReset) +void SwEditShell::FillByEx(SwTextFormatColl* pColl) { - if( bReset ) - { - pColl->ResetAllFormatAttr(); - } - SwPaM * pCursor = GetCursor(); SwContentNode * pCnt = pCursor->GetContentNode(); const SfxItemSet* pSet = pCnt->GetpSwAttrSet(); diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index 7bb4aa7acdfd..a2d5e0d80bdc 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -118,24 +118,9 @@ SwFieldType* SwEditShell::GetFieldType(sal_uInt16 nResId, const OUString& rName) } /// delete field type -void SwEditShell::RemoveFieldType(size_t nField, sal_uInt16 nResId) +void SwEditShell::RemoveFieldType(size_t nField) { - if( USHRT_MAX == nResId ) - { - GetDoc()->getIDocumentFieldsAccess().RemoveFieldType(nField); - return; - } - - const SwFieldTypes* pFieldTypes = GetDoc()->getIDocumentFieldsAccess().GetFieldTypes(); - size_t nIdx = 0; - const SwFieldTypes::size_type nSize = pFieldTypes->size(); - for( SwFieldTypes::size_type i = 0; i < nSize; ++i ) - // Gleiche ResId -> Index erhoehen - if( (*pFieldTypes)[i]->Which() == nResId && nIdx++ == nField ) - { - GetDoc()->getIDocumentFieldsAccess().RemoveFieldType( i ); - return; - } + GetDoc()->getIDocumentFieldsAccess().RemoveFieldType(nField); } /// delete field type based on its name diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx index d65fe3b3eb32..40d716e6cc17 100644 --- a/sw/source/core/edit/edfmt.cxx +++ b/sw/source/core/edit/edfmt.cxx @@ -52,13 +52,8 @@ SwCharFormat* SwEditShell::GetCurCharFormat() const return pFormat; } -void SwEditShell::FillByEx(SwCharFormat* pCharFormat, bool bReset) +void SwEditShell::FillByEx(SwCharFormat* pCharFormat) { - if ( bReset ) - { - pCharFormat->ResetAllFormatAttr(); - } - SwPaM* pPam = GetCursor(); const SwContentNode* pCNd = pPam->GetContentNode(); if( pCNd->IsTextNode() ) @@ -120,11 +115,9 @@ OUString SwEditShell::GetUniqueTableName() const return GetDoc()->GetUniqueTableName(); } -SwCharFormat* SwEditShell::MakeCharFormat( const OUString& rName, - SwCharFormat* pDerivedFrom ) +SwCharFormat* SwEditShell::MakeCharFormat( const OUString& rName ) { - if( !pDerivedFrom ) - pDerivedFrom = GetDoc()->GetDfltCharFormat(); + SwCharFormat* pDerivedFrom = GetDoc()->GetDfltCharFormat(); return GetDoc()->MakeCharFormat( rName, pDerivedFrom ); } @@ -150,9 +143,9 @@ bool SwEditShell::IsUsed( const SwModify& rModify ) const return mpDoc->IsUsed( rModify ); } -const SwFlyFrameFormat* SwEditShell::FindFlyByName( const OUString& rName, sal_uInt8 nNdTyp ) const +const SwFlyFrameFormat* SwEditShell::FindFlyByName( const OUString& rName ) const { - return mpDoc->FindFlyByName(rName, nNdTyp); + return mpDoc->FindFlyByName(rName); } SwCharFormat* SwEditShell::FindCharFormatByName( const OUString& rName ) const diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx index 1e3ccacc2bf9..325888b2bc3e 100644 --- a/sw/source/core/edit/edglss.cxx +++ b/sw/source/core/edit/edglss.cxx @@ -150,7 +150,7 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock, } /// copy all selections to the doc -bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) +bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc ) { OSL_ENSURE( pInsDoc, "no Ins.Document" ); @@ -161,13 +161,6 @@ bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) SwPosition aPos( aIdx, SwIndex(pContentNode, (pContentNode) ? pContentNode->Len() : 0)); - // Should the index be reset to start? - if( pSttNd ) - { - *pSttNd = aPos.nNode; - --(*pSttNd); - } - bool bRet = false; SET_CURR_SHELL( this ); @@ -250,10 +243,6 @@ bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) if( !pInsDoc->getIDocumentFieldsAccess().IsExpFieldsLocked() ) pInsDoc->getIDocumentFieldsAccess().UpdateExpFields(nullptr, true); - // set the saved Node position back to the correct Node - if( bRet && pSttNd ) - ++(*pSttNd); - return bRet; } diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index 7a585db7bd58..1ab81d874102 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -775,9 +775,9 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, EndAllAction(); } -OUString SwEditShell::GetUniqueNumRuleName( const OUString* pChkStr, bool bAutoNum ) const +OUString SwEditShell::GetUniqueNumRuleName( const OUString* pChkStr ) const { - return GetDoc()->GetUniqueNumRuleName( pChkStr, bAutoNum ); + return GetDoc()->GetUniqueNumRuleName( pChkStr ); } void SwEditShell::ChgNumRuleFormats( const SwNumRule& rRule ) @@ -821,11 +821,11 @@ bool SwEditShell::IsNumRuleStart( SwPaM* pPaM ) const return pTextNd && pTextNd->IsListRestart(); } -void SwEditShell::SetNodeNumStart( sal_uInt16 nStt, SwPaM* pPaM ) +void SwEditShell::SetNodeNumStart( sal_uInt16 nStt ) { StartAllAction(); - SwPaM* pCursor = pPaM ? pPaM : GetCursor(); + SwPaM* pCursor = GetCursor(); if( pCursor->IsMultiSelection() ) // multiple selection ? { GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr ); diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx index f26d5484fd34..252cd2678a1b 100644 --- a/sw/source/core/edit/edsect.cxx +++ b/sw/source/core/edit/edsect.cxx @@ -115,7 +115,7 @@ size_t SwEditShell::GetSectionFormatCount() const return GetDoc()->GetSections().size(); } -bool SwEditShell::IsAnySectionInDoc( bool bChkReadOnly, bool bChkHidden, bool bChkTOX ) const +bool SwEditShell::IsAnySectionInDoc( bool bChkReadOnly, bool bChkHidden ) const { const SwSectionFormats& rFormats = GetDoc()->GetSections(); @@ -123,9 +123,8 @@ bool SwEditShell::IsAnySectionInDoc( bool bChkReadOnly, bool bChkHidden, bool bC { SectionType eTmpType; if( pFormat->IsInNodesArr() && - (bChkTOX || - ( (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION - && TOX_HEADER_SECTION != eTmpType ) ) ) + ( (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION + && TOX_HEADER_SECTION != eTmpType ) ) { const SwSection& rSect = *pFormat->GetSection(); if( (!bChkReadOnly && !bChkHidden ) || diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx index 531e51fd5e09..5d0113a16a3a 100644 --- a/sw/source/core/edit/edtab.cxx +++ b/sw/source/core/edit/edtab.cxx @@ -214,8 +214,7 @@ bool SwEditShell::IsTextToTableAvailable() const void SwEditShell::InsertDDETable( const SwInsertTableOptions& rInsTableOpts, SwDDEFieldType* pDDEType, - sal_uInt16 nRows, sal_uInt16 nCols, - sal_Int16 eAdj ) + sal_uInt16 nRows, sal_uInt16 nCols ) { SwPosition* pPos = GetCursor()->GetPoint(); @@ -231,7 +230,7 @@ void SwEditShell::InsertDDETable( const SwInsertTableOptions& rInsTableOpts, const SwInsertTableOptions aInsTableOpts( rInsTableOpts.mnInsMode | tabopts::DEFAULT_BORDER, rInsTableOpts.mnRowsToRepeat ); SwTable* pTable = const_cast<SwTable*>(GetDoc()->InsertTable( aInsTableOpts, *pPos, - nRows, nCols, eAdj )); + nRows, nCols, css::text::HoriOrientation::FULL )); SwTableNode* pTableNode = const_cast<SwTableNode*>(pTable->GetTabSortBoxes()[ 0 ]-> GetSttNd()->FindTableNode()); diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx index e2376eaf02bf..ae5c6815bdf1 100644 --- a/sw/source/core/edit/edws.cxx +++ b/sw/source/core/edit/edws.cxx @@ -255,9 +255,9 @@ void SwEditShell::AutoCorrect( SvxAutoCorrect& rACorr, bool bInsert, EndAllAction(); } -void SwEditShell::SetNewDoc(bool bNew) +void SwEditShell::SetNewDoc() { - GetDoc()->getIDocumentState().SetNewDoc(bNew); + GetDoc()->getIDocumentState().SetNewDoc(true); } bool SwEditShell::GetPrevAutoCorrWord( SvxAutoCorrect& rACorr, OUString& rWord ) diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index f0608d24db5d..979a71e30abb 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -399,7 +399,7 @@ bool SwField::IsFixed() const return bRet; } -OUString SwField::ExpandField(bool const bCached, ToxAuthorityField eField) const +OUString SwField::ExpandField(bool const bCached) const { if ( m_bUseFieldValueCache ) { @@ -408,7 +408,7 @@ OUString SwField::ExpandField(bool const bCached, ToxAuthorityField eField) cons if (GetTypeId() == TYP_AUTHORITY) { const SwAuthorityField* pAuthorityField = static_cast<const SwAuthorityField*>(this); - m_Cache = pAuthorityField->ConditionalExpand(eField); + m_Cache = pAuthorityField->ConditionalExpand(AUTH_FIELD_IDENTIFIER); } else m_Cache = Expand(); diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx index 42d14a21e3d1..6ff7f5657279 100644 --- a/sw/source/core/fields/flddat.cxx +++ b/sw/source/core/fields/flddat.cxx @@ -133,29 +133,24 @@ double SwDateTimeField::GetValue() const return GetDateTime(GetDoc(), DateTime( DateTime::SYSTEM )); } -Date SwDateTimeField::GetDate(bool bUseOffset) const +Date SwDateTimeField::GetDate() const { SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter(); Date* pNullDate = pFormatter->GetNullDate(); long nVal = static_cast<long>( GetValue() ); - if (bUseOffset && nOffset) - nVal += nOffset / 60 / 24; - Date aDate = *pNullDate + nVal; return aDate; } -tools::Time SwDateTimeField::GetTime(bool bUseOffset) const +tools::Time SwDateTimeField::GetTime() const { double fDummy; double fFract = modf(GetValue(), &fDummy); DateTime aDT((long)fDummy, 0); aDT += fFract; - if (bUseOffset) - aDT += tools::Time(0, nOffset); return static_cast<tools::Time>(aDT); } diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 5c95c4d43e6c..1fdc283b6052 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -683,11 +683,10 @@ namespace { } } -bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames ) +bool SwFEShell::Paste( SwDoc* pClpDoc ) { SET_CURR_SHELL( this ); OSL_ENSURE( pClpDoc, "no clipboard document" ); - const sal_uInt16 nStartPageNumber = GetPhyPageNum(); // then till end of the nodes array SwNodeIndex aIdx( pClpDoc->GetNodes().GetEndOfExtras(), 2 ); SwPaM aCpyPam( aIdx ); //DocStart @@ -1052,8 +1051,6 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames ) // ** Update SwDoc::Append, if you change the following code ** // ** - // find out if the clipboard document starts with a table - bool bStartWithTable = nullptr != aCpyPam.Start()->nNode.GetNode().FindTableNode(); SwPosition aInsertPosition( rInsPos ); { @@ -1086,28 +1083,6 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames ) } SaveTableBoxContent( &rInsPos ); - if(bIncludingPageFrames && bStartWithTable) - { - //remove the paragraph in front of the table - SwPaM aPara(aInsertPosition); - GetDoc()->getIDocumentContentOperations().DelFullPara(aPara); - } - //additionally copy page bound frames - if( bIncludingPageFrames && pClpDoc->GetSpzFrameFormats()->size() ) - { - // create a draw view if necessary - if( !Imp()->GetDrawView() ) - MakeDrawView(); - - for ( auto pCpyFormat : *pClpDoc->GetSpzFrameFormats() ) - { - SwFormatAnchor aAnchor( pCpyFormat->GetAnchor() ); - if ( FLY_AT_PAGE != aAnchor.GetAnchorId() ) - continue; - aAnchor.SetPageNum( aAnchor.GetPageNum() + nStartPageNumber - 1 ); - GetDoc()->getIDocumentLayoutAccess().CopyLayoutFormat( *pCpyFormat, aAnchor, true, true ); - } - } } } } diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index a082fba7ed58..538805fa65fe 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -282,12 +282,12 @@ SwFlyFrame* SwFEShell::GetCurrFlyFrame(const bool bCalcFrame) const } // Get selected fly, but if none Get current fly in which the cursor is positioned -SwFlyFrame* SwFEShell::GetSelectedOrCurrFlyFrame(const bool bCalcFrame) const +SwFlyFrame* SwFEShell::GetSelectedOrCurrFlyFrame() const { SwFlyFrame *pFly = GetSelectedFlyFrame(); if (pFly) return pFly; - return GetCurrFlyFrame(bCalcFrame); + return GetCurrFlyFrame(); } // Returns non-null pointer, if the current Fly could be anchored to another one (so it is inside) @@ -934,9 +934,9 @@ void SwFEShell::GetPageObjs( std::vector<SwFrameFormat*>& rFillArr ) } } -void SwFEShell::SetPageObjsNewPage( std::vector<SwFrameFormat*>& rFillArr, int nOffset ) +void SwFEShell::SetPageObjsNewPage( std::vector<SwFrameFormat*>& rFillArr ) { - if( rFillArr.empty() || !nOffset ) + if( rFillArr.empty() ) return; StartAllAction(); @@ -954,7 +954,7 @@ void SwFEShell::SetPageObjsNewPage( std::vector<SwFrameFormat*>& rFillArr, int n SwFormatAnchor aNewAnchor( pFormat->GetAnchor() ); if ((FLY_AT_PAGE != aNewAnchor.GetAnchorId()) || - 0 >= ( nNewPage = aNewAnchor.GetPageNum() + nOffset ) ) + 0 >= ( nNewPage = aNewAnchor.GetPageNum() + 1 ) ) // chaos::Anchor has been changed or invalid page number, // therefore: do not change! continue; @@ -1717,7 +1717,7 @@ ObjCntType SwFEShell::GetObjCntType( const Point &rPt, SdrObject *&rpObj ) const return eType; } -ObjCntType SwFEShell::GetObjCntTypeOfSelection( SdrObject** ppObj ) const +ObjCntType SwFEShell::GetObjCntTypeOfSelection() const { ObjCntType eType = OBJCNT_NONE; @@ -1733,7 +1733,6 @@ ObjCntType SwFEShell::GetObjCntTypeOfSelection( SdrObject** ppObj ) const if( !i ) { eType = eTmp; - if( ppObj ) *ppObj = pObj; } else if( eTmp != eType ) { @@ -2004,7 +2003,7 @@ void SwFEShell::SetObjDescription( const OUString& rDescription ) } } -void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedObject >& xObj, SwFlyFrame * pFly ) +void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedObject >& xObj ) { #if OSL_DEBUG_LEVEL > 0 SvGlobalName aCLSID( xObj->getClassID() ); @@ -2015,8 +2014,7 @@ void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedO return; #endif - if (!pFly) - pFly = FindFlyFrame( xObj ); + SwFlyFrame * pFly = FindFlyFrame( xObj ); OSL_ENSURE( pFly , "No fly frame!" ); SwFrameFormat * pFrameFormat = pFly ? pFly->GetFormat() : nullptr; diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 41a1c060899b..e745ef883b2b 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -2034,10 +2034,9 @@ void SwFEShell::SetMouseTabCols( const SwTabCols &rNew, bool bCurRowOnly, } } -sal_uInt16 SwFEShell::GetCurMouseColNum( const Point &rPt, - SwGetCurColNumPara* pPara ) const +sal_uInt16 SwFEShell::GetCurMouseColNum( const Point &rPt ) const { - return _GetCurColNum( GetBox( rPt ), pPara ); + return _GetCurColNum( GetBox( rPt ), nullptr ); } size_t SwFEShell::GetCurMouseTabColNum( const Point &rPt ) const diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 658b0bb174d9..01dc5203a423 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -307,9 +307,9 @@ sal_uInt16 SwFEShell::GetPhyPageNum() return 0; } -sal_uInt16 SwFEShell::GetVirtPageNum( const bool bCalcFrame ) +sal_uInt16 SwFEShell::GetVirtPageNum() { - SwFrame *pFrame = GetCurrFrame( bCalcFrame ); + SwFrame *pFrame = GetCurrFrame(); if ( pFrame ) return pFrame->GetVirtPageNum(); return 0; @@ -641,7 +641,7 @@ sal_uInt16 SwFEShell::GetCurColNum( SwGetCurColNumPara* pPara ) const return _GetCurColNum( GetCurrFrame(), pPara ); } -sal_uInt16 SwFEShell::GetCurOutColNum( SwGetCurColNumPara* pPara ) const +sal_uInt16 SwFEShell::GetCurOutColNum() const { sal_uInt16 nRet = 0; SwFrame* pFrame = GetCurrFrame(); @@ -652,7 +652,7 @@ sal_uInt16 SwFEShell::GetCurOutColNum( SwGetCurColNumPara* pPara ) const : static_cast<SwFrame*>(pFrame->FindSctFrame()); OSL_ENSURE( pFrame, "No Tab, no Sect" ); if( pFrame ) - nRet = _GetCurColNum( pFrame, pPara ); + nRet = _GetCurColNum( pFrame, nullptr ); } return nRet; } diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 98469537cc82..cdf1fc1829e8 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -434,11 +434,10 @@ SwGrfNode * SwNodes::MakeGrfNode( const SwNodeIndex & rWhere, SwGrfNode * SwNodes::MakeGrfNode( const SwNodeIndex & rWhere, const GraphicObject& rGrfObj, - SwGrfFormatColl* pGrfColl, - SwAttrSet* pAutoAttr ) + SwGrfFormatColl* pGrfColl ) { OSL_ENSURE( pGrfColl, "MakeGrfNode: Formatpointer ist 0." ); - return new SwGrfNode( rWhere, rGrfObj, pGrfColl, pAutoAttr ); + return new SwGrfNode( rWhere, rGrfObj, pGrfColl, nullptr ); } Size SwGrfNode::GetTwipSize() const diff --git a/sw/source/core/inc/DocumentStateManager.hxx b/sw/source/core/inc/DocumentStateManager.hxx index 6d2f831c569f..ae765bdd74b9 100644 --- a/sw/source/core/inc/DocumentStateManager.hxx +++ b/sw/source/core/inc/DocumentStateManager.hxx @@ -43,7 +43,7 @@ public: bool IsNewDoc() const override; void SetNewDoc(bool b) override; void SetUpdateExpFieldStat(bool b) override; - void SetLoaded(bool b) override; + void SetLoaded() override; private: SwDoc& m_rDoc; diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index e0f9418d7ab0..de8bdd84583f 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -3041,9 +3041,9 @@ SwFlyFrame* SwFlyFrameFormat::GetFrame( const Point* pPoint, const bool bCalcFra pPoint, nullptr, bCalcFrame )); } -SwAnchoredObject* SwFlyFrameFormat::GetAnchoredObj( const Point* pPoint, const bool bCalcFrame ) const +SwAnchoredObject* SwFlyFrameFormat::GetAnchoredObj( const Point* pPoint ) const { - SwFlyFrame* pFlyFrame( GetFrame( pPoint, bCalcFrame ) ); + SwFlyFrame* pFlyFrame( GetFrame( pPoint ) ); if ( pFlyFrame ) { return dynamic_cast<SwAnchoredObject*>(pFlyFrame); diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index 2f3b75a8aab4..7358a69e8590 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -370,13 +370,12 @@ bool SwOLENode::SavePersistentData() SwOLENode * SwNodes::MakeOLENode( const SwNodeIndex & rWhere, const svt::EmbeddedObjectRef& xObj, - SwGrfFormatColl* pGrfColl, - SwAttrSet* pAutoAttr ) + SwGrfFormatColl* pGrfColl ) { OSL_ENSURE( pGrfColl,"SwNodes::MakeOLENode: Formatpointer is 0." ); SwOLENode *pNode = - new SwOLENode( rWhere, xObj, pGrfColl, pAutoAttr ); + new SwOLENode( rWhere, xObj, pGrfColl, nullptr ); // set parent if XChild is supported //!! needed to supply Math objects with a valid reference device diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 5a413efa353f..38d970204278 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -555,16 +555,14 @@ static void lcl_MinMaxNode( SwFrameFormat* pNd, SwMinMaxNodeArgs* pIn ) * Changing this method very likely requires changing of GetScalingOfSelectedText */ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMax, - sal_uLong& rAbsMin, OutputDevice* pOut ) const + sal_uLong& rAbsMin ) const { SwViewShell const * pSh = GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); + OutputDevice* pOut = nullptr; + if( pSh ) + pOut = pSh->GetWin(); if( !pOut ) - { - if( pSh ) - pOut = pSh->GetWin(); - if( !pOut ) - pOut = Application::GetDefaultDevice(); - } + pOut = Application::GetDefaultDevice(); MapMode aOldMap( pOut->GetMapMode() ); pOut->SetMapMode( MapMode( MAP_TWIP ) ); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index fb4235c0f1df..b0d349c753ee 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1340,11 +1340,10 @@ lcl_GetTextAttrs( } ::std::vector<SwTextAttr *> -SwTextNode::GetTextAttrsAt(sal_Int32 const nIndex, RES_TXTATR const nWhich, - enum GetTextAttrMode const eMode) const +SwTextNode::GetTextAttrsAt(sal_Int32 const nIndex, RES_TXTATR const nWhich) const { ::std::vector<SwTextAttr *> ret; - lcl_GetTextAttrs(& ret, nullptr, m_pSwpHints, nIndex, nWhich, eMode); + lcl_GetTextAttrs(& ret, nullptr, m_pSwpHints, nIndex, nWhich, DEFAULT); return ret; } @@ -3214,7 +3213,7 @@ bool SwTextNode::GetExpandText( SwTextNode& rDestNd, const SwIndex* pDestIdx, } OUString SwTextNode::GetRedlineText( sal_Int32 nIdx, sal_Int32 nLen, - bool bExpandFields, bool bWithNum ) const + bool bExpandFields ) const { std::vector<sal_Int32> aRedlArr; const SwDoc* pDoc = GetDoc(); @@ -3284,8 +3283,6 @@ OUString SwTextNode::GetRedlineText( sal_Int32 nIdx, sal_Int32 nLen, } Replace0xFF(*this, aText, nTextStt, aText.getLength(), bExpandFields); - if( bWithNum ) - aText.insert(0, GetNumString()); return aText.makeStringAndClear(); } @@ -4896,11 +4893,11 @@ bool SwTextNode::CompareParRsid( const SwTextNode &rTextNode ) const } bool SwTextNode::CompareRsid( const SwTextNode &rTextNode, sal_Int32 nStt1, sal_Int32 nStt2, - sal_Int32 nEnd1, sal_Int32 nEnd2 ) const + sal_Int32 nEnd1 ) const { sal_uInt32 nThisRsid = GetRsid( nStt1, nEnd1 ? nEnd1 : nStt1 ); - sal_uInt32 nRsid = rTextNode.GetRsid( nStt2, nEnd2 ? nEnd2 : nStt2 ); + sal_uInt32 nRsid = rTextNode.GetRsid( nStt2, nStt2 ); return nThisRsid == nRsid; } diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index f60c16ad743e..fb22f18b742f 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -337,17 +337,14 @@ void Writer::PutNumFormatFontsInAttrPool() } } -void Writer::PutEditEngFontsInAttrPool( bool bIncl_CJK_CTL ) +void Writer::PutEditEngFontsInAttrPool() { SfxItemPool& rPool = pDoc->GetAttrPool(); if( rPool.GetSecondaryPool() ) { _AddFontItems( rPool, EE_CHAR_FONTINFO ); - if( bIncl_CJK_CTL ) - { - _AddFontItems( rPool, EE_CHAR_FONTINFO_CJK ); - _AddFontItems( rPool, EE_CHAR_FONTINFO_CTL ); - } + _AddFontItems( rPool, EE_CHAR_FONTINFO_CJK ); + _AddFontItems( rPool, EE_CHAR_FONTINFO_CTL ); } } diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index a097e030c326..a64a3bdfd926 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -237,9 +237,9 @@ void AbstractSwInsertDBColAutoPilot_Impl::DataToDoc( const uno::Sequence< uno::A pDlg->DataToDoc(rSelection, rxSource, xConnection, xResultSet); } -OString AbstractDropDownFieldDialog_Impl::GetWindowState( sal_uLong nMask ) const +OString AbstractDropDownFieldDialog_Impl::GetWindowState() const { - return pDlg->GetWindowState(nMask); + return pDlg->GetWindowState(); } void AbstractDropDownFieldDialog_Impl::SetWindowState( const OString& rStr ) @@ -347,9 +347,9 @@ OUString AbstractSwFieldDlg_Impl::GetText() const return pDlg->GetText(); } -void AbstractSwFieldDlg_Impl::Start( bool bShowl ) +void AbstractSwFieldDlg_Impl::Start() { - pDlg->Start( bShowl ); + pDlg->Start(); } void AbstractSwFieldDlg_Impl::Initialize(SfxChildWinInfo *pInfo) @@ -409,9 +409,9 @@ void AbstractFieldInputDlg_Impl::SetWindowState( const OString& rStr ) pDlg->SetWindowState( rStr ); } -OString AbstractFieldInputDlg_Impl::GetWindowState( sal_uLong nMask ) const +OString AbstractFieldInputDlg_Impl::GetWindowState() const { - return pDlg->GetWindowState( nMask ); + return pDlg->GetWindowState(); } void AbstractFieldInputDlg_Impl::EndDialog(long n) @@ -1085,10 +1085,9 @@ AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateIndexMarkFloatDlg( SfxBindings* pBindings, SfxChildWindow* pChild, vcl::Window *pParent, - SfxChildWinInfo* pInfo, - bool bNew ) + SfxChildWinInfo* pInfo ) { - VclPtr<SwIndexMarkFloatDlg> pDlg = VclPtr<SwIndexMarkFloatDlg>::Create(pBindings, pChild, pParent, pInfo, bNew); + VclPtr<SwIndexMarkFloatDlg> pDlg = VclPtr<SwIndexMarkFloatDlg>::Create(pBindings, pChild, pParent, pInfo, true/*bNew*/); return new AbstractIndexMarkFloatDlg_Impl(pDlg); } @@ -1096,10 +1095,9 @@ AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDlg( SfxBindings* pBindings, SfxChildWindow* pChild, vcl::Window *pParent, - SfxChildWinInfo* pInfo, - bool bNew) + SfxChildWinInfo* pInfo) { - VclPtr<SwAuthMarkFloatDlg> pDlg = VclPtr<SwAuthMarkFloatDlg>::Create( pBindings, pChild, pParent, pInfo, bNew ); + VclPtr<SwAuthMarkFloatDlg> pDlg = VclPtr<SwAuthMarkFloatDlg>::Create( pBindings, pChild, pParent, pInfo, true/*bNew*/ ); return new AbstractAuthMarkFloatDlg_Impl( pDlg ); } diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 45690ebd831b..47d27b36130b 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -156,8 +156,8 @@ class AbstractSwInsertDBColAutoPilot_Impl : public AbstractSwInsertDBColAutoPil class AbstractDropDownFieldDialog_Impl : public AbstractDropDownFieldDialog { DECL_ABSTDLG_BASE(AbstractDropDownFieldDialog_Impl, sw::DropDownFieldDialog) - virtual OString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const override; //this method inherit from SystemWindow - virtual void SetWindowState( const OString& rStr ) override;//this method inherit from SystemWindow + virtual OString GetWindowState() const override; //this method inherit from SystemWindow + virtual void SetWindowState( const OString& rStr ) override; //this method inherit from SystemWindow }; class AbstractSwLabDlg_Impl : public AbstractSwLabDlg @@ -200,7 +200,7 @@ class AbstractSwFieldDlg_Impl : public AbstractSwFieldDlg //From class Window. virtual void SetText( const OUString& rStr ) override; virtual OUString GetText() const override; - virtual void Start( bool bShow = true ) override; //this method from SfxTabDialog + virtual void Start() override; //this method from SfxTabDialog virtual void ShowReferencePage() override; virtual void Initialize(SfxChildWinInfo *pInfo) override; virtual void ReInitDlg() override; @@ -236,9 +236,9 @@ class AbstractFieldInputDlg_Impl : public AbstractFieldInputDlg { DECL_ABSTDLG_BASE(AbstractFieldInputDlg_Impl,SwFieldInputDlg) //from class SalFrame - virtual void SetWindowState( const OString & rStr ) override ; - virtual OString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const override ; - virtual void EndDialog(long) override; + virtual void SetWindowState( const OString & rStr ) override; + virtual OString GetWindowState() const override; + virtual void EndDialog(long) override; }; class SwInsFootNoteDlg; @@ -480,14 +480,12 @@ public: SfxBindings* pBindings, SfxChildWindow* pChild, vcl::Window *pParent, - SfxChildWinInfo* pInfo, - bool bNew=true) override; + SfxChildWinInfo* pInfo) override; virtual AbstractMarkFloatDlg* CreateAuthMarkFloatDlg( SfxBindings* pBindings, SfxChildWindow* pChild, vcl::Window *pParent, - SfxChildWinInfo* pInfo, - bool bNew=true) override; + SfxChildWinInfo* pInfo) override; virtual VclAbstractDialog * CreateIndexMarkModalDlg( vcl::Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark ) override; diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index b583923e836c..85c283c3c1dc 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -715,10 +715,9 @@ bool SwDBManager::GetTableNames(ListBox* pListBox, const OUString& rDBName) // fill Listbox with column names of a database void SwDBManager::GetColumnNames(ListBox* pListBox, - const OUString& rDBName, const OUString& rTableName, bool bAppend) + const OUString& rDBName, const OUString& rTableName) { - if (!bAppend) - pListBox->Clear(); + pListBox->Clear(); SwDBData aData; aData.sDataSource = rDBName; aData.sCommand = rTableName; @@ -733,7 +732,7 @@ void SwDBManager::GetColumnNames(ListBox* pListBox, xConnection = RegisterConnection( sDBName ); } - GetColumnNames(pListBox, xConnection, rTableName, bAppend); + GetColumnNames(pListBox, xConnection, rTableName); } void SwDBManager::GetColumnNames(ListBox* pListBox, @@ -2250,7 +2249,7 @@ bool SwDBManager::FillCalcWithMergeData( SvNumberFormatter *pDocFormatter, } bool SwDBManager::ToNextRecord( - const OUString& rDataSource, const OUString& rCommand, sal_Int32 /*nCommandType*/) + const OUString& rDataSource, const OUString& rCommand) { SwDSParam* pFound = nullptr; if(pImpl->pMergeData && @@ -2370,7 +2369,7 @@ bool SwDBManager::ToRecordId(sal_Int32 nSet) } bool SwDBManager::OpenDataSource(const OUString& rDataSource, const OUString& rTableOrQuery, - sal_Int32 nCommandType, bool bCreate) + sal_Int32 nCommandType) { SwDBData aData; aData.sDataSource = rDataSource; @@ -2385,11 +2384,6 @@ bool SwDBManager::OpenDataSource(const OUString& rDataSource, const OUString& rT uno::Reference< sdbc::XConnection> xConnection; if(pParam && pParam->xConnection.is()) pFound->xConnection = pParam->xConnection; - else if(bCreate) - { - OUString sDataSource(rDataSource); - pFound->xConnection = RegisterConnection( sDataSource ); - } if(pFound->xConnection.is()) { try diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index a09c6c9a89ed..0f28c5de41ab 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -965,22 +965,20 @@ void SwPostItMgr::AutoScroll(const SwSidebarWin* pPostIt,const unsigned long aPa } } -void SwPostItMgr::MakeVisible(const SwSidebarWin* pPostIt,long aPage ) +void SwPostItMgr::MakeVisible(const SwSidebarWin* pPostIt ) { - if (aPage == -1) + long aPage = -1; + // we don't know the page yet, lets find it ourselves + for (unsigned long n=0;n<mPages.size();n++) { - // we don't know the page yet, lets find it ourselves - for (unsigned long n=0;n<mPages.size();n++) + if (mPages[n]->mList->size()>0) { - if (mPages[n]->mList->size()>0) + for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i != mPages[n]->mList->end(); ++i) { - for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i != mPages[n]->mList->end(); ++i) + if ((*i)->pPostIt==pPostIt) { - if ((*i)->pPostIt==pPostIt) - { - aPage = n+1; - break; - } + aPage = n+1; + break; } } } |