summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/app/appenv.cxx8
-rw-r--r--sw/source/uibase/app/applab.cxx7
-rw-r--r--sw/source/uibase/app/appopt.cxx67
-rw-r--r--sw/source/uibase/app/docsh2.cxx7
-rw-r--r--sw/source/uibase/app/docshini.cxx2
-rw-r--r--sw/source/uibase/app/docst.cxx39
-rw-r--r--sw/source/uibase/app/docstyle.cxx141
-rw-r--r--sw/source/uibase/app/swmodul1.cxx2
-rw-r--r--sw/source/uibase/app/swmodule.cxx26
-rw-r--r--sw/source/uibase/config/StoredChapterNumbering.cxx2
-rw-r--r--sw/source/uibase/config/modcfg.cxx8
-rw-r--r--sw/source/uibase/config/usrpref.cxx2
-rw-r--r--sw/source/uibase/config/viewopt.cxx2
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx7
-rw-r--r--sw/source/uibase/dbui/dbtree.cxx2
-rw-r--r--sw/source/uibase/dbui/mailmergehelper.cxx12
-rw-r--r--sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx6
-rw-r--r--sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx12
-rw-r--r--sw/source/uibase/dochdl/gloshdl.cxx14
-rw-r--r--sw/source/uibase/docvw/AnchorOverlayObject.cxx5
-rw-r--r--sw/source/uibase/docvw/AnnotationMenuButton.cxx2
-rw-r--r--sw/source/uibase/docvw/AnnotationWin.cxx4
-rw-r--r--sw/source/uibase/docvw/AnnotationWin2.cxx35
-rw-r--r--sw/source/uibase/docvw/FrameControlsManager.cxx100
-rw-r--r--sw/source/uibase/docvw/HeaderFooterWin.cxx1
-rw-r--r--sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx78
-rw-r--r--sw/source/uibase/docvw/PageBreakWin.cxx6
-rw-r--r--sw/source/uibase/docvw/ShadowOverlayObject.cxx5
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.cxx2
-rw-r--r--sw/source/uibase/docvw/SidebarWinAcc.cxx2
-rw-r--r--sw/source/uibase/docvw/UnfloatTableButton.cxx1
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx178
-rw-r--r--sw/source/uibase/docvw/edtwin2.cxx5
-rw-r--r--sw/source/uibase/docvw/srcedtw.cxx15
-rw-r--r--sw/source/uibase/envelp/labelcfg.cxx8
-rw-r--r--sw/source/uibase/fldui/fldmgr.cxx12
-rw-r--r--sw/source/uibase/frmdlg/colex.cxx8
-rw-r--r--sw/source/uibase/frmdlg/colmgr.cxx6
-rw-r--r--sw/source/uibase/frmdlg/frmmgr.cxx14
-rw-r--r--sw/source/uibase/inc/DateFormFieldDialog.hxx2
-rw-r--r--sw/source/uibase/inc/DropDownFieldDialog.hxx2
-rw-r--r--sw/source/uibase/inc/DropDownFormFieldDialog.hxx2
-rw-r--r--sw/source/uibase/inc/FrameControl.hxx5
-rw-r--r--sw/source/uibase/inc/FrameControlsManager.hxx6
-rw-r--r--sw/source/uibase/inc/HeaderFooterWin.hxx2
-rw-r--r--sw/source/uibase/inc/OutlineContentVisibilityWin.hxx5
-rw-r--r--sw/source/uibase/inc/PageBreakWin.hxx4
-rw-r--r--sw/source/uibase/inc/SwSpellDialogChildWindow.hxx3
-rw-r--r--sw/source/uibase/inc/SwXFilterOptions.hxx2
-rw-r--r--sw/source/uibase/inc/UnfloatTableButton.hxx2
-rw-r--r--sw/source/uibase/inc/abstract.hxx2
-rw-r--r--sw/source/uibase/inc/addrdlg.hxx2
-rw-r--r--sw/source/uibase/inc/ascfldlg.hxx4
-rw-r--r--sw/source/uibase/inc/autoformatpreview.hxx2
-rw-r--r--sw/source/uibase/inc/barcfg.hxx2
-rw-r--r--sw/source/uibase/inc/bmpwin.hxx2
-rw-r--r--sw/source/uibase/inc/bookctrl.hxx6
-rw-r--r--sw/source/uibase/inc/bookmark.hxx4
-rw-r--r--sw/source/uibase/inc/break.hxx6
-rw-r--r--sw/source/uibase/inc/cfgitems.hxx10
-rw-r--r--sw/source/uibase/inc/changedb.hxx2
-rw-r--r--sw/source/uibase/inc/chrdlg.hxx4
-rw-r--r--sw/source/uibase/inc/colex.hxx10
-rw-r--r--sw/source/uibase/inc/column.hxx6
-rw-r--r--sw/source/uibase/inc/condedit.hxx2
-rw-r--r--sw/source/uibase/inc/content.hxx4
-rw-r--r--sw/source/uibase/inc/conttree.hxx4
-rw-r--r--sw/source/uibase/inc/convert.hxx8
-rw-r--r--sw/source/uibase/inc/cption.hxx2
-rw-r--r--sw/source/uibase/inc/dbconfig.hxx2
-rw-r--r--sw/source/uibase/inc/dbinsdlg.hxx8
-rw-r--r--sw/source/uibase/inc/dbui.hxx6
-rw-r--r--sw/source/uibase/inc/docfnote.hxx2
-rw-r--r--sw/source/uibase/inc/drpcps.hxx10
-rw-r--r--sw/source/uibase/inc/dselect.hxx2
-rw-r--r--sw/source/uibase/inc/edtwin.hxx1
-rw-r--r--sw/source/uibase/inc/envimg.hxx4
-rw-r--r--sw/source/uibase/inc/envlop.hxx8
-rw-r--r--sw/source/uibase/inc/fldedt.hxx2
-rw-r--r--sw/source/uibase/inc/fldtdlg.hxx5
-rw-r--r--sw/source/uibase/inc/fldwrap.hxx4
-rw-r--r--sw/source/uibase/inc/fontcfg.hxx2
-rw-r--r--sw/source/uibase/inc/frmdlg.hxx2
-rw-r--r--sw/source/uibase/inc/frmpage.hxx22
-rw-r--r--sw/source/uibase/inc/gloslst.hxx2
-rw-r--r--sw/source/uibase/inc/glossary.hxx6
-rw-r--r--sw/source/uibase/inc/hyp.hxx3
-rw-r--r--sw/source/uibase/inc/inpdlg.hxx2
-rw-r--r--sw/source/uibase/inc/inputwin.hxx2
-rw-r--r--sw/source/uibase/inc/insfnote.hxx5
-rw-r--r--sw/source/uibase/inc/instable.hxx11
-rw-r--r--sw/source/uibase/inc/javaedit.hxx5
-rw-r--r--sw/source/uibase/inc/label.hxx2
-rw-r--r--sw/source/uibase/inc/labelcfg.hxx2
-rw-r--r--sw/source/uibase/inc/labimg.hxx4
-rw-r--r--sw/source/uibase/inc/linenum.hxx4
-rw-r--r--sw/source/uibase/inc/mailconfigpage.hxx8
-rw-r--r--sw/source/uibase/inc/maildispatcher.hxx7
-rw-r--r--sw/source/uibase/inc/mailmergehelper.hxx12
-rw-r--r--sw/source/uibase/inc/mailmergewizard.hxx3
-rw-r--r--sw/source/uibase/inc/mailmrge.hxx12
-rw-r--r--sw/source/uibase/inc/mergetbl.hxx2
-rw-r--r--sw/source/uibase/inc/multmrk.hxx2
-rw-r--r--sw/source/uibase/inc/navicfg.hxx2
-rw-r--r--sw/source/uibase/inc/navipi.hxx4
-rw-r--r--sw/source/uibase/inc/num.hxx4
-rw-r--r--sw/source/uibase/inc/numfmtlb.hxx4
-rw-r--r--sw/source/uibase/inc/numpara.hxx4
-rw-r--r--sw/source/uibase/inc/numprevw.hxx2
-rw-r--r--sw/source/uibase/inc/optcomp.hxx2
-rw-r--r--sw/source/uibase/inc/optload.hxx12
-rw-r--r--sw/source/uibase/inc/optpage.hxx32
-rw-r--r--sw/source/uibase/inc/outline.hxx4
-rw-r--r--sw/source/uibase/inc/pattern.hxx2
-rw-r--r--sw/source/uibase/inc/pgfnote.hxx6
-rw-r--r--sw/source/uibase/inc/pggrid.hxx8
-rw-r--r--sw/source/uibase/inc/pview.hxx5
-rw-r--r--sw/source/uibase/inc/redlndlg.hxx9
-rw-r--r--sw/source/uibase/inc/regionsw.hxx38
-rw-r--r--sw/source/uibase/inc/rowht.hxx2
-rw-r--r--sw/source/uibase/inc/scroll.hxx2
-rw-r--r--sw/source/uibase/inc/splittbl.hxx2
-rw-r--r--sw/source/uibase/inc/srcedtw.hxx8
-rw-r--r--sw/source/uibase/inc/srcview.hxx3
-rw-r--r--sw/source/uibase/inc/srtdlg.hxx6
-rw-r--r--sw/source/uibase/inc/swdtflvr.hxx3
-rw-r--r--sw/source/uibase/inc/swmodalredlineacceptdlg.hxx2
-rw-r--r--sw/source/uibase/inc/swrenamexnameddlg.hxx2
-rw-r--r--sw/source/uibase/inc/swuiccoll.hxx2
-rw-r--r--sw/source/uibase/inc/swuicnttab.hxx22
-rw-r--r--sw/source/uibase/inc/swuiidxmrk.hxx12
-rw-r--r--sw/source/uibase/inc/swuipardlg.hxx2
-rw-r--r--sw/source/uibase/inc/swwrtshitem.hxx2
-rw-r--r--sw/source/uibase/inc/syncbtn.hxx4
-rw-r--r--sw/source/uibase/inc/tabledlg.hxx2
-rw-r--r--sw/source/uibase/inc/tautofmt.hxx4
-rw-r--r--sw/source/uibase/inc/tblnumfm.hxx2
-rw-r--r--sw/source/uibase/inc/titlepage.hxx8
-rw-r--r--sw/source/uibase/inc/tmpdlg.hxx2
-rw-r--r--sw/source/uibase/inc/tmplctrl.hxx7
-rw-r--r--sw/source/uibase/inc/uiborder.hxx2
-rw-r--r--sw/source/uibase/inc/uiitems.hxx8
-rw-r--r--sw/source/uibase/inc/uiobject.hxx14
-rw-r--r--sw/source/uibase/inc/uivwimp.hxx4
-rw-r--r--sw/source/uibase/inc/unoatxt.hxx10
-rw-r--r--sw/source/uibase/inc/unomailmerge.hxx4
-rw-r--r--sw/source/uibase/inc/unotools.hxx2
-rw-r--r--sw/source/uibase/inc/usrpref.hxx10
-rw-r--r--sw/source/uibase/inc/viewlayoutctrl.hxx4
-rw-r--r--sw/source/uibase/inc/watermarkdialog.hxx2
-rw-r--r--sw/source/uibase/inc/wordcountctrl.hxx6
-rw-r--r--sw/source/uibase/inc/wordcountdialog.hxx2
-rw-r--r--sw/source/uibase/inc/workctrl.hxx10
-rw-r--r--sw/source/uibase/inc/wrap.hxx14
-rw-r--r--sw/source/uibase/inc/wrtsh.hxx53
-rw-r--r--sw/source/uibase/inc/zoomctrl.hxx6
-rw-r--r--sw/source/uibase/lingu/hhcwrp.cxx13
-rw-r--r--sw/source/uibase/lingu/sdrhhcwrap.cxx2
-rw-r--r--sw/source/uibase/misc/glosdoc.cxx14
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx7
-rw-r--r--sw/source/uibase/misc/swruler.cxx6
-rw-r--r--sw/source/uibase/ribbar/drawbase.cxx12
-rw-r--r--sw/source/uibase/ribbar/inputwin.cxx10
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx31
-rw-r--r--sw/source/uibase/shells/basesh.cxx67
-rw-r--r--sw/source/uibase/shells/drawdlg.cxx19
-rw-r--r--sw/source/uibase/shells/drawsh.cxx14
-rw-r--r--sw/source/uibase/shells/drwtxtex.cxx2
-rw-r--r--sw/source/uibase/shells/mediash.cxx112
-rw-r--r--sw/source/uibase/shells/tabsh.cxx46
-rw-r--r--sw/source/uibase/shells/textfld.cxx2
-rw-r--r--sw/source/uibase/shells/textsh.cxx15
-rw-r--r--sw/source/uibase/shells/textsh1.cxx6
-rw-r--r--sw/source/uibase/shells/txtcrsr.cxx4
-rw-r--r--sw/source/uibase/shells/txtnum.cxx10
-rw-r--r--sw/source/uibase/sidebar/PageColumnControl.cxx6
-rw-r--r--sw/source/uibase/sidebar/PageFooterPanel.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageFooterPanel.hxx2
-rw-r--r--sw/source/uibase/sidebar/PageHeaderPanel.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageHeaderPanel.hxx2
-rw-r--r--sw/source/uibase/sidebar/PageMarginControl.cxx25
-rw-r--r--sw/source/uibase/sidebar/PageSizeControl.cxx6
-rw-r--r--sw/source/uibase/table/tablepg.hxx20
-rw-r--r--sw/source/uibase/uiview/pview.cxx32
-rw-r--r--sw/source/uibase/uiview/view.cxx64
-rw-r--r--sw/source/uibase/uiview/view0.cxx39
-rw-r--r--sw/source/uibase/uiview/view2.cxx29
-rw-r--r--sw/source/uibase/uiview/viewdraw.cxx4
-rw-r--r--sw/source/uibase/uiview/viewmdi.cxx2
-rw-r--r--sw/source/uibase/uiview/viewport.cxx11
-rw-r--r--sw/source/uibase/uiview/viewsrch.cxx4
-rw-r--r--sw/source/uibase/uiview/viewstat.cxx6
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx44
-rw-r--r--sw/source/uibase/uno/SwXDocumentSettings.cxx23
-rw-r--r--sw/source/uibase/uno/unoatxt.cxx6
-rw-r--r--sw/source/uibase/uno/unomod.cxx2
-rw-r--r--sw/source/uibase/uno/unotxvw.cxx6
-rw-r--r--sw/source/uibase/utlui/attrdesc.cxx3
-rw-r--r--sw/source/uibase/utlui/bookctrl.cxx4
-rw-r--r--sw/source/uibase/utlui/content.cxx140
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx22
-rw-r--r--sw/source/uibase/utlui/gloslst.cxx2
-rw-r--r--sw/source/uibase/utlui/initui.cxx8
-rw-r--r--sw/source/uibase/utlui/shdwcrsr.cxx12
-rw-r--r--sw/source/uibase/utlui/tmplctrl.cxx2
-rw-r--r--sw/source/uibase/utlui/uitool.cxx35
-rw-r--r--sw/source/uibase/utlui/viewlayoutctrl.cxx2
-rw-r--r--sw/source/uibase/utlui/wordcountctrl.cxx2
-rw-r--r--sw/source/uibase/utlui/zoomctrl.cxx4
-rw-r--r--sw/source/uibase/wrtsh/select.cxx6
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx309
211 files changed, 1408 insertions, 1404 deletions
diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx
index 02ce718915ae..5e295b22a46a 100644
--- a/sw/source/uibase/app/appenv.cxx
+++ b/sw/source/uibase/app/appenv.cxx
@@ -334,8 +334,8 @@ void SwModule::InsertEnv( SfxRequest& rReq )
tools::Long lLeft = rItem.m_nShiftRight,
lUpper = rItem.m_nShiftDown;
- sal_uInt16 nPageW = static_cast<sal_uInt16>(std::max(rItem.m_nWidth, rItem.m_nHeight)),
- nPageH = static_cast<sal_uInt16>(std::min(rItem.m_nWidth, rItem.m_nHeight));
+ sal_uInt16 nPageW = o3tl::narrowing<sal_uInt16>(std::max(rItem.m_nWidth, rItem.m_nHeight)),
+ nPageH = o3tl::narrowing<sal_uInt16>(std::min(rItem.m_nWidth, rItem.m_nHeight));
switch (rItem.m_eAlign)
{
@@ -352,8 +352,8 @@ void SwModule::InsertEnv( SfxRequest& rReq )
}
SvxLRSpaceItem aLRMargin( RES_LR_SPACE );
SvxULSpaceItem aULMargin( RES_UL_SPACE );
- aLRMargin.SetLeft (static_cast<sal_uInt16>(lLeft) );
- aULMargin.SetUpper(static_cast<sal_uInt16>(lUpper));
+ aLRMargin.SetLeft (o3tl::narrowing<sal_uInt16>(lLeft) );
+ aULMargin.SetUpper(o3tl::narrowing<sal_uInt16>(lUpper));
aLRMargin.SetRight(0);
aULMargin.SetLower(0);
rFormat.SetFormatAttr(aLRMargin);
diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx
index 705bdee9e37a..8c6a450737de 100644
--- a/sw/source/uibase/app/applab.cxx
+++ b/sw/source/uibase/app/applab.cxx
@@ -224,8 +224,8 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel)
// Borders
SvxLRSpaceItem aLRMargin( RES_LR_SPACE );
SvxULSpaceItem aULMargin( RES_UL_SPACE );
- aLRMargin.SetLeft (static_cast<sal_uInt16>(rItem.m_lLeft) );
- aULMargin.SetUpper(static_cast<sal_uInt16>(rItem.m_lUpper));
+ aLRMargin.SetLeft (o3tl::narrowing<sal_uInt16>(rItem.m_lLeft) );
+ aULMargin.SetUpper(o3tl::narrowing<sal_uInt16>(rItem.m_lUpper));
aLRMargin.SetRight( 0 );
aULMargin.SetLower( 0 );
rFormat.SetFormatAttr(aLRMargin);
@@ -264,7 +264,8 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel)
pSh->ChgPageDesc( 0, aDesc );
// Insert frame
- std::unique_ptr<SwFieldMgr> pFieldMgr(new SwFieldMgr);
+ std::optional<SwFieldMgr> pFieldMgr;
+ pFieldMgr.emplace();
pFieldMgr->SetEvalExpFields(false);
// Prepare border template
diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx
index 9862da388021..ff3c5eb6da80 100644
--- a/sw/source/uibase/app/appopt.cxx
+++ b/sw/source/uibase/app/appopt.cxx
@@ -175,10 +175,10 @@ std::unique_ptr<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId )
{
const SvxTabStopItem& rDefTabs =
pAppView->GetWrtShell().GetDefault(RES_PARATR_TABSTOP);
- pRet->Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, static_cast<sal_uInt16>(::GetTabDist(rDefTabs))));
+ pRet->Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, o3tl::narrowing<sal_uInt16>(::GetTabDist(rDefTabs))));
}
else
- pRet->Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, static_cast<sal_uInt16>(convertMm100ToTwip(pPref->GetDefTabInMm100()))));
+ pRet->Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, o3tl::narrowing<sal_uInt16>(convertMm100ToTwip(pPref->GetDefTabInMm100()))));
}
// Options for GridTabPage
@@ -189,8 +189,8 @@ std::unique_ptr<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId )
aGridItem.SetGridVisible( aViewOpt.IsGridVisible());
const Size& rSnapSize = aViewOpt.GetSnapSize();
- aGridItem.SetFieldDrawX( static_cast<sal_uInt16>(rSnapSize.Width() ));
- aGridItem.SetFieldDrawY( static_cast<sal_uInt16>(rSnapSize.Height()));
+ aGridItem.SetFieldDrawX( o3tl::narrowing<sal_uInt16>(rSnapSize.Width() ));
+ aGridItem.SetFieldDrawY( o3tl::narrowing<sal_uInt16>(rSnapSize.Height()));
aGridItem.SetFieldDivisionX( aViewOpt.GetDivisionX());
aGridItem.SetFieldDivisionY( aViewOpt.GetDivisionY());
@@ -261,51 +261,23 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
}
// Elements - interpret Item
- std::vector<SwNode*> aFoldedOutlineNdsArray;
- bool bShow = false;
+ bool bFlag = true;
if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_ELEM, false, &pItem ) )
{
const SwElemItem* pElemItem = static_cast<const SwElemItem*>(pItem);
pElemItem->FillViewOptions( aViewOpt );
SwWrtShell* pWrtShell = GetActiveWrtShell();
- bShow = pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton();
+ bFlag = pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton();
bool bTreatSubsChanged = aViewOpt.IsTreatSubOutlineLevelsAsContent()
!= pWrtShell->GetViewOptions()->IsTreatSubOutlineLevelsAsContent();
-
- // move cursor to top if something with the outline mode changed
- if ((bShow != aViewOpt.IsShowOutlineContentVisibilityButton()) ||
- (pWrtShell->GetViewOptions()->IsTreatSubOutlineLevelsAsContent() !=
- aViewOpt.IsTreatSubOutlineLevelsAsContent()))
- {
- // move cursor to top of document
- if (pWrtShell->IsSelFrameMode())
- {
- pWrtShell->UnSelectFrame();
- pWrtShell->LeaveSelFrameMode();
- }
- pWrtShell->EnterStdMode();
- pWrtShell->SttEndDoc(true);
- }
-
- if (bShow && (!aViewOpt.IsShowOutlineContentVisibilityButton() || bTreatSubsChanged))
+ if (bFlag && (!aViewOpt.IsShowOutlineContentVisibilityButton() || bTreatSubsChanged))
{
// outline mode options have change which require to show all content
- const SwOutlineNodes& rOutlineNds = pWrtShell->GetNodes().GetOutLineNds();
- for (SwOutlineNodes::size_type nPos = 0; nPos < rOutlineNds.size(); ++nPos)
- {
- SwNode* pNd = rOutlineNds[nPos];
- if (pNd->IsTextNode()) // should always be true
- {
- bool bOutlineContentVisibleAttr = true;
- pNd->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
- if (!bOutlineContentVisibleAttr)
- {
- aFoldedOutlineNdsArray.push_back(pNd);
- pWrtShell->ToggleOutlineContentVisibility(nPos);
- }
- }
- }
+ pWrtShell->MakeAllFoldedOutlineContentVisible();
+
+ if (bTreatSubsChanged)
+ bFlag = false; // folding method changed, set bFlag false to refold below
}
}
@@ -429,21 +401,8 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
if (SfxItemState::SET != rSet.GetItemState(FN_PARAM_ELEM, false))
return;
- if (!GetActiveWrtShell()->GetViewOptions()->IsShowOutlineContentVisibilityButton())
- {
- // outline mode is no longer active
- // set outline content visible attribute to false for nodes in the array
- for (SwNode* pNd : aFoldedOutlineNdsArray)
- pNd->GetTextNode()->SetAttrOutlineContentVisible(false);
- }
- else if (bShow)
- {
- // outline mode remained active
- // sub level treatment might have changed
- // ToggleOutlineContentVisibility only knows sub level treatment after ApplyUserPref
- for (SwNode* pNd : aFoldedOutlineNdsArray)
- GetActiveWrtShell()->ToggleOutlineContentVisibility(pNd, true);
- }
+ if (!bFlag)
+ GetActiveWrtShell()->MakeAllFoldedOutlineContentVisible(false);
}
std::unique_ptr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet )
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 893872b66118..30b31f90cdc7 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -540,7 +540,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
aFileName = pTemplateItem->GetValue();
const SfxInt32Item* pFlagsItem = rReq.GetArg<SfxInt32Item>(SID_TEMPLATE_LOAD);
if ( pFlagsItem )
- nFlags = static_cast<SfxTemplateFlags>(static_cast<sal_uInt16>(pFlagsItem->GetValue()));
+ nFlags = static_cast<SfxTemplateFlags>(o3tl::narrowing<sal_uInt16>(pFlagsItem->GetValue()));
}
}
@@ -1125,12 +1125,11 @@ void SwDocShell::Execute(SfxRequest& rReq)
//search for the view that created the call
if(pViewShell->GetObjectShell() == this && pViewShell->GetDispatcher())
{
- std::unique_ptr<SfxFrameItem> pFrameItem(new SfxFrameItem( SID_DOCFRAME,
- pViewShell->GetViewFrame() ));
+ SfxFrameItem aFrameItem( SID_DOCFRAME, pViewShell->GetViewFrame() );
SfxDispatcher* pDispatch = pViewShell->GetDispatcher();
pDispatch->ExecuteList(SID_OPENDOC,
SfxCallMode::ASYNCHRON,
- { &aName, &aReferer, pFrameItem.get() });
+ { &aName, &aReferer, &aFrameItem });
break;
}
pViewShell = SfxViewShell::GetNext(*pViewShell);
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index e5d43853e938..284d4a84afdd 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -621,11 +621,11 @@ void SwDocShell::SubInitNew()
bool bWeb = dynamic_cast< const SwWebDocShell *>( this ) != nullptr;
sal_uInt16 nRange[] = {
- RES_PARATR_ADJUST, RES_PARATR_ADJUST,
RES_CHRATR_COLOR, RES_CHRATR_COLOR,
RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE,
RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE,
RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE,
+ RES_PARATR_ADJUST, RES_PARATR_ADJUST,
0, 0, 0 };
if(!bWeb)
{
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 43cebe917a2a..0f196fcdf0a7 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -150,11 +150,16 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
case SID_STYLE_FAMILY2:
if(!pShell->IsFrameSelected())
{
+ OUString aProgName;
SwTextFormatColl* pColl = pShell->GetCurTextFormatColl();
if(pColl)
+ {
aName = pColl->GetName();
+ sal_uInt16 nId = pColl->GetPoolFormatId();
+ SwStyleNameMapper::FillProgName(nId, aProgName);
+ }
- SfxTemplateItem aItem(nWhich, aName);
+ SfxTemplateItem aItem(nWhich, aName, aProgName);
SfxStyleSearchBits nMask = SfxStyleSearchBits::Auto;
if (m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE))
@@ -637,6 +642,22 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void)
}
}
}
+
+ if (m_nFamily == SfxStyleFamily::Frame)
+ {
+ const SfxPoolItem* pItem = nullptr;
+ if (aTmpSet.HasItem(FN_KEEP_ASPECT_RATIO, &pItem))
+ {
+ const auto& rBoolItem = static_cast<const SfxBoolItem&>(*pItem);
+ const SwViewOption* pVOpt = pWrtShell->GetViewOptions();
+ SwViewOption aUsrPref(*pVOpt);
+ aUsrPref.SetKeepRatio(rBoolItem.GetValue());
+ if (rBoolItem.GetValue() != pVOpt->IsKeepRatio())
+ {
+ SW_MOD()->ApplyUsrPref(aUsrPref, &pWrtShell->GetView());
+ }
+ }
+ }
}
if(m_bNew)
@@ -908,6 +929,14 @@ void SwDocShell::Edit(
rSet.Put(*oGrabBag);
}
+ SwWrtShell* pCurrShell = pActShell ? pActShell : m_pWrtShell;
+ if (nFamily == SfxStyleFamily::Frame)
+ {
+ SfxItemSet& rSet = xTmp->GetItemSet();
+ const SwViewOption* pVOpt = pCurrShell->GetViewOptions();
+ rSet.Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, pVOpt->IsKeepRatio()));
+ }
+
if (!bBasic)
{
// prior to the dialog the HtmlMode at the DocShell is being sunk
@@ -916,7 +945,6 @@ void SwDocShell::Edit(
// In HTML mode, we do not always have a printer. In order to show
// the correct page size in the Format - Page dialog, we have to
// get one here.
- SwWrtShell* pCurrShell = pActShell ? pActShell : m_pWrtShell;
if( ( HTMLMODE_ON & nHtmlMode ) &&
!pCurrShell->getIDocumentDeviceAccess().getPrinter( false ) )
pCurrShell->InitPrt( pCurrShell->getIDocumentDeviceAccess().getPrinter( true ) );
@@ -1103,6 +1131,8 @@ void SwDocShell::Hide(const OUString &rName, SfxStyleFamily nFamily, bool bHidde
SfxStyleFamily SwDocShell::ApplyStyles(const OUString &rName, SfxStyleFamily nFamily,
SwWrtShell* pShell, const sal_uInt16 nMode )
{
+ MakeAllOutlineContentTemporarilyVisible a(GetDoc());
+
SwDocStyleSheet* pStyle = static_cast<SwDocStyleSheet*>( m_xBasePool->Find( rName, nFamily ) );
SAL_WARN_IF( !pStyle, "sw.ui", "Style not found" );
@@ -1308,7 +1338,10 @@ void SwDocShell::UpdateStyle(const OUString &rName, SfxStyleFamily nFamily, SwWr
break;
case SfxStyleFamily::Table:
{
-
+ if(GetFEShell()->IsTableMode())
+ {
+ GetFEShell()->TableCursorToCursor();
+ }
SwTableAutoFormat aFormat(rName);
if (pCurrWrtShell->GetTableAutoFormat(aFormat))
{
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 015812df184e..2a0427e0f30f 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -68,17 +68,6 @@
#include <svx/drawitem.hxx>
#include <editeng/eeitem.hxx>
-// The Format names in the list of all names have the
-// following family as their first character:
-
-#define cCHAR u'c'
-#define cPARA u'p'
-#define cFRAME u'f'
-#define cPAGE u'g'
-#define cNUMRULE u'n'
-#define cTABSTYLE u't'
-#define cCELLSTYLE u'b'
-
using namespace com::sun::star;
// At the names' publication, this character is removed again and the
@@ -370,41 +359,11 @@ static const SwBoxAutoFormat* lcl_FindCellStyle(SwDoc& rDoc, std::u16string_view
}
sal_uInt32 SwStyleSheetIterator::SwPoolFormatList::FindName(SfxStyleFamily eFam,
- std::u16string_view rName)
+ const OUString& rName)
{
if(!maImpl.empty())
{
- sal_Unicode cStyle(0);
- switch( eFam )
- {
- case SfxStyleFamily::Char:
- cStyle = cCHAR;
- break;
- case SfxStyleFamily::Para:
- cStyle = cPARA;
- break;
- case SfxStyleFamily::Frame:
- cStyle = cFRAME;
- break;
- case SfxStyleFamily::Page:
- cStyle = cPAGE;
- break;
- case SfxStyleFamily::Pseudo:
- cStyle = cNUMRULE;
- break;
- case SfxStyleFamily::Table:
- cStyle = cTABSTYLE;
- break;
- case SfxStyleFamily::Cell:
- cStyle = cCELLSTYLE;
- break;
- default:
- cStyle = ' ';
- break;
- }
- const OUString sSrch = OUStringChar(cStyle) + rName;
-
- UniqueHash::const_iterator it = maUnique.find(sSrch);
+ UniqueHash::const_iterator it = maUnique.find(std::pair<SfxStyleFamily,OUString>{eFam, rName});
if (it != maUnique.end())
{
sal_uInt32 nIdx = it->second;
@@ -425,7 +384,7 @@ void SwStyleSheetIterator::SwPoolFormatList::rehash()
}
void SwStyleSheetIterator::SwPoolFormatList::RemoveName(SfxStyleFamily eFam,
- std::u16string_view rName)
+ const OUString& rName)
{
sal_uInt32 nTmpPos = FindName( eFam, rName );
if( nTmpPos < maImpl.size() )
@@ -437,16 +396,14 @@ void SwStyleSheetIterator::SwPoolFormatList::RemoveName(SfxStyleFamily eFam,
}
// Add Strings to the list of templates
-void SwStyleSheetIterator::SwPoolFormatList::Append( char cChar, std::u16string_view rStr )
+void SwStyleSheetIterator::SwPoolFormatList::Append( SfxStyleFamily eFam, const OUString& rStr )
{
- const OUString aStr = OUStringChar(cChar) + rStr;
-
- UniqueHash::const_iterator it = maUnique.find(aStr);
+ UniqueHash::const_iterator it = maUnique.find(std::pair<SfxStyleFamily,OUString>{eFam, rStr});
if (it != maUnique.end())
return;
- maUnique[aStr] = static_cast<sal_uInt32>(maImpl.size());
- maImpl.push_back(aStr);
+ maUnique.emplace(std::pair<SfxStyleFamily,OUString>{eFam, rStr}, static_cast<sal_uInt32>(maImpl.size()));
+ maImpl.push_back(std::pair<SfxStyleFamily,OUString>{eFam, rStr});
}
// UI-sided implementation of StyleSheets
@@ -486,6 +443,7 @@ SwDocStyleSheet::SwDocStyleSheet( SwDoc& rDocument,
SID_ATTR_CHAR_GRABBAG, SID_ATTR_CHAR_GRABBAG,
SID_ATTR_AUTO_STYLE_UPDATE, SID_ATTR_AUTO_STYLE_UPDATE,
FN_PARAM_FTN_INFO, FN_PARAM_FTN_INFO,
+ FN_KEEP_ASPECT_RATIO, FN_KEEP_ASPECT_RATIO,
FN_COND_COLL, FN_COND_COLL>{}),
m_bPhysical(false)
{
@@ -1640,10 +1598,10 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
{
case SfxItemState::SET:
{
- SvxNumRule* pSetRule = static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule();
- pSetRule->UnLinkGraphics();
+ SvxNumRule& rSetRule = const_cast<SvxNumRule&>(static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
+ rSetRule.UnLinkGraphics();
SwNumRule aSetRule(*m_pNumRule);
- aSetRule.SetSvxRule(*pSetRule, &m_rDoc);
+ aSetRule.SetSvxRule(rSetRule, &m_rDoc);
m_rDoc.ChgNumRuleFormats( aSetRule );
}
break;
@@ -2198,18 +2156,10 @@ SwTableAutoFormat* SwDocStyleSheet::GetTableFormat()
// re-generate Name AND Family from String
// First() and Next() (see below) insert an identification letter at Pos.1
-void SwDocStyleSheet::PresetNameAndFamily(const OUString& rName)
+void SwDocStyleSheet::PresetNameAndFamily(SfxStyleFamily eFamily, const OUString& rName)
{
- switch( rName[0] )
- {
- case cPARA: nFamily = SfxStyleFamily::Para; break;
- case cFRAME: nFamily = SfxStyleFamily::Frame; break;
- case cPAGE: nFamily = SfxStyleFamily::Page; break;
- case cNUMRULE: nFamily = SfxStyleFamily::Pseudo; break;
- case cTABSTYLE: nFamily = SfxStyleFamily::Table; break;
- default: nFamily = SfxStyleFamily::Char; break;
- }
- aName = rName.copy(1);
+ this->nFamily = eFamily;
+ this->aName = rName;
}
// Is the format physically present yet
@@ -2678,7 +2628,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::operator[]( sal_Int32 nIdx )
// found
if( !m_bFirstCalled )
First();
- mxStyleSheet->PresetNameAndFamily( m_aLst[ nIdx ] );
+ auto const & rEntry = m_aLst[ nIdx ];
+ mxStyleSheet->PresetNameAndFamily( rEntry.first, rEntry.second );
mxStyleSheet->SetPhysical( false );
mxStyleSheet->FillStyleSheet( SwDocStyleSheet::FillOnlyName );
@@ -2743,7 +2694,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
continue;
}
- m_aLst.Append( cCHAR, pFormat == rDoc.GetDfltCharFormat()
+ m_aLst.Append( SfxStyleFamily::Char, pFormat == rDoc.GetDfltCharFormat()
? SwResId(STR_POOLCHR_STANDARD)
: pFormat->GetName() );
}
@@ -2754,21 +2705,21 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
if( ! rDoc.getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE) )
AppendStyleList(SwStyleNameMapper::GetChrFormatUINameArray(),
bIsSearchUsed, bSearchHidden, bOnlyHidden,
- SwGetPoolIdFromName::ChrFmt, cCHAR);
+ SwGetPoolIdFromName::ChrFmt, SfxStyleFamily::Char);
else
{
- m_aLst.Append( cCHAR, SwStyleNameMapper::GetChrFormatUINameArray()[
+ m_aLst.Append( SfxStyleFamily::Char, SwStyleNameMapper::GetChrFormatUINameArray()[
RES_POOLCHR_INET_NORMAL - RES_POOLCHR_BEGIN ] );
- m_aLst.Append( cCHAR, SwStyleNameMapper::GetChrFormatUINameArray()[
+ m_aLst.Append( SfxStyleFamily::Char, SwStyleNameMapper::GetChrFormatUINameArray()[
RES_POOLCHR_INET_VISIT - RES_POOLCHR_BEGIN ] );
- m_aLst.Append( cCHAR, SwStyleNameMapper::GetChrFormatUINameArray()[
+ m_aLst.Append( SfxStyleFamily::Char, SwStyleNameMapper::GetChrFormatUINameArray()[
RES_POOLCHR_ENDNOTE - RES_POOLCHR_BEGIN ] );
- m_aLst.Append( cCHAR, SwStyleNameMapper::GetChrFormatUINameArray()[
+ m_aLst.Append( SfxStyleFamily::Char, SwStyleNameMapper::GetChrFormatUINameArray()[
RES_POOLCHR_FOOTNOTE - RES_POOLCHR_BEGIN ] );
}
AppendStyleList(SwStyleNameMapper::GetHTMLChrFormatUINameArray(),
bIsSearchUsed, bSearchHidden, bOnlyHidden,
- SwGetPoolIdFromName::ChrFmt, cCHAR);
+ SwGetPoolIdFromName::ChrFmt, SfxStyleFamily::Char);
}
}
@@ -2872,30 +2823,30 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
continue;
}
}
- m_aLst.Append( cPARA, pColl->GetName() );
+ m_aLst.Append( SfxStyleFamily::Para, pColl->GetName() );
}
bAll = ( nSMask & SfxStyleSearchBits::AllVisible ) == SfxStyleSearchBits::AllVisible;
if ( bAll || (nSMask & ~SfxStyleSearchBits::Used) == SfxStyleSearchBits::SwText )
AppendStyleList(SwStyleNameMapper::GetTextUINameArray(),
- bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::TxtColl, cPARA );
+ bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::TxtColl, SfxStyleFamily::Para );
if ( bAll || (nSMask & ~SfxStyleSearchBits::Used) == SfxStyleSearchBits::SwChapter )
AppendStyleList(SwStyleNameMapper::GetDocUINameArray(),
- bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::TxtColl, cPARA ) ;
+ bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::TxtColl, SfxStyleFamily::Para ) ;
if ( bAll || (nSMask & ~SfxStyleSearchBits::Used) == SfxStyleSearchBits::SwList )
AppendStyleList(SwStyleNameMapper::GetListsUINameArray(),
- bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::TxtColl, cPARA ) ;
+ bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::TxtColl, SfxStyleFamily::Para ) ;
if ( bAll || (nSMask & ~SfxStyleSearchBits::Used) == SfxStyleSearchBits::SwIndex )
AppendStyleList(SwStyleNameMapper::GetRegisterUINameArray(),
- bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::TxtColl, cPARA ) ;
+ bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::TxtColl, SfxStyleFamily::Para ) ;
if ( bAll || (nSMask & ~SfxStyleSearchBits::Used) == SfxStyleSearchBits::SwExtra )
AppendStyleList(SwStyleNameMapper::GetExtraUINameArray(),
- bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::TxtColl, cPARA ) ;
+ bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::TxtColl, SfxStyleFamily::Para ) ;
if ( bAll || (nSMask & ~SfxStyleSearchBits::Used) == SfxStyleSearchBits::SwCondColl )
{
if( !bIsSearchUsed ||
rDoc.getIDocumentStylePoolAccess().IsPoolTextCollUsed( RES_POOLCOLL_TEXT ))
- m_aLst.Append( cPARA, SwStyleNameMapper::GetTextUINameArray()[
+ m_aLst.Append( SfxStyleFamily::Para, SwStyleNameMapper::GetTextUINameArray()[
RES_POOLCOLL_TEXT - RES_POOLCOLL_TEXT_BEGIN ] );
}
if ( bAll ||
@@ -2904,7 +2855,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
(SfxStyleSearchBits::SwHtml | SfxStyleSearchBits::UserDefined) )
{
AppendStyleList(SwStyleNameMapper::GetHTMLUINameArray(),
- bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::TxtColl, cPARA ) ;
+ bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::TxtColl, SfxStyleFamily::Para ) ;
if( !bAll )
{
// then also the ones, that we are mapping:
@@ -2933,7 +2884,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
if( !bIsSearchUsed || rDoc.getIDocumentStylePoolAccess().IsPoolTextCollUsed( *pPoolIds ) )
{
s = SwStyleNameMapper::GetUIName( *pPoolIds, s );
- m_aLst.Append( cPARA, s);
+ m_aLst.Append( SfxStyleFamily::Para, s);
}
++pPoolIds;
}
@@ -2968,13 +2919,13 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
}
}
- m_aLst.Append( cFRAME, pFormat->GetName() );
+ m_aLst.Append( SfxStyleFamily::Frame, pFormat->GetName() );
}
// PoolFormat
if ( bAll )
AppendStyleList(SwStyleNameMapper::GetFrameFormatUINameArray(),
- bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::FrmFmt, cFRAME);
+ bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::FrmFmt, SfxStyleFamily::Frame);
}
if( nSearchFamily == SfxStyleFamily::Page ||
@@ -2999,11 +2950,11 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
if ( nSrchMask == SfxStyleSearchBits::Hidden && !rDesc.IsHidden( ) )
continue;
- m_aLst.Append( cPAGE, rDesc.GetName() );
+ m_aLst.Append( SfxStyleFamily::Page, rDesc.GetName() );
}
if ( bAll )
AppendStyleList(SwStyleNameMapper::GetPageDescUINameArray(),
- bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::PageDesc, cPAGE);
+ bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::PageDesc, SfxStyleFamily::Page);
}
if( nSearchFamily == SfxStyleFamily::Pseudo ||
@@ -3029,12 +2980,12 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
continue;
}
- m_aLst.Append( cNUMRULE, rRule.GetName() );
+ m_aLst.Append( SfxStyleFamily::Pseudo, rRule.GetName() );
}
}
if ( bAll )
AppendStyleList(SwStyleNameMapper::GetNumRuleUINameArray(),
- bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::NumRule, cNUMRULE);
+ bIsSearchUsed, bSearchHidden, bOnlyHidden, SwGetPoolIdFromName::NumRule, SfxStyleFamily::Pseudo);
}
if( nSearchFamily == SfxStyleFamily::Table ||
@@ -3059,7 +3010,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
continue;
}
- m_aLst.Append( cTABSTYLE, rTableStyle.GetName() );
+ m_aLst.Append( SfxStyleFamily::Table, rTableStyle.GetName() );
}
}
@@ -3080,13 +3031,13 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
OUString sBoxFormatName;
SwStyleNameMapper::FillProgName(rTableStyle.GetName(), sBoxFormatName, SwGetPoolIdFromName::TabStyle);
sBoxFormatName += rTableStyle.GetTableTemplateCellSubName(rBoxFormat);
- m_aLst.Append( cCELLSTYLE, sBoxFormatName );
+ m_aLst.Append( SfxStyleFamily::Cell, sBoxFormatName );
}
}
}
const SwCellStyleTable& rCellStyles = rDoc.GetCellStyles();
for(size_t i = 0; i < rCellStyles.size(); ++i)
- m_aLst.Append( cCELLSTYLE, rCellStyles[i].GetName() );
+ m_aLst.Append( SfxStyleFamily::Cell, rCellStyles[i].GetName() );
}
if(!m_aLst.empty())
@@ -3103,7 +3054,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::Next()
++m_nLastPos;
if(m_nLastPos < m_aLst.size())
{
- mxIterSheet->PresetNameAndFamily(m_aLst[m_nLastPos]);
+ auto const & rEntry = m_aLst[m_nLastPos];
+ mxIterSheet->PresetNameAndFamily(rEntry.first, rEntry.second);
mxIterSheet->SetPhysical( false );
mxIterSheet->SetMask( nMask );
if(mxIterSheet->pSet)
@@ -3126,7 +3078,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::Find(const OUString& rName)
if( SAL_MAX_UINT32 != m_nLastPos )
{
// found
- mxStyleSheet->PresetNameAndFamily(m_aLst[m_nLastPos]);
+ auto const & rEntry = m_aLst[m_nLastPos];
+ mxStyleSheet->PresetNameAndFamily(rEntry.first, rEntry.second);
// new name is set, so determine its Data
mxStyleSheet->FillStyleSheet( SwDocStyleSheet::FillOnlyName );
if( !mxStyleSheet->IsPhysical() )
@@ -3139,7 +3092,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::Find(const OUString& rName)
void SwStyleSheetIterator::AppendStyleList(const std::vector<OUString>& rList,
bool bTestUsed, bool bTestHidden, bool bOnlyHidden,
- SwGetPoolIdFromName nSection, char cType )
+ SwGetPoolIdFromName nSection, SfxStyleFamily eFamily )
{
SwDoc& rDoc = static_cast<SwDocStyleSheetPool*>(pBasePool)->GetDoc();
bool bUsed = false;
@@ -3190,7 +3143,7 @@ void SwStyleSheetIterator::AppendStyleList(const std::vector<OUString>& rList,
bool bMatchHidden = ( bTestHidden && ( bHidden || !bOnlyHidden ) ) || ( !bTestHidden && ( !bHidden || bUsed ) );
if ( ( !bTestUsed && bMatchHidden ) || ( bTestUsed && bUsed ) )
- m_aLst.Append( cType, i );
+ m_aLst.Append( eFamily, i );
}
}
diff --git a/sw/source/uibase/app/swmodul1.cxx b/sw/source/uibase/app/swmodul1.cxx
index 0e103f2282bc..c396d437fd0f 100644
--- a/sw/source/uibase/app/swmodul1.cxx
+++ b/sw/source/uibase/app/swmodul1.cxx
@@ -604,7 +604,7 @@ sal_uInt16 SwModule::GetLinkUpdMode() const
{
if(!m_pUsrPref)
GetUsrPref(false);
- return static_cast<sal_uInt16>(m_pUsrPref->GetUpdateLinkMode());
+ return o3tl::narrowing<sal_uInt16>(m_pUsrPref->GetUpdateLinkMode());
}
SwFieldUpdateFlags SwModule::GetFieldUpdateFlags() const
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index 485bb7a52d41..b0c68b7d72c0 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -162,14 +162,14 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
}
}
-OUString SwResId(const char* pId)
+OUString SwResId(std::string_view aId)
{
- return Translate::get(pId, SW_MOD()->GetResLocale());
+ return Translate::get(aId, SW_MOD()->GetResLocale());
}
-OUString SwResId(const char* pId, int nCardinality)
+OUString SwResId(std::string_view aId, int nCardinality)
{
- return Translate::nget(pId, nCardinality, SW_MOD()->GetResLocale());
+ return Translate::nget(aId, nCardinality, SW_MOD()->GetResLocale());
}
uno::Reference< scanner::XScannerManager2 > const &
@@ -341,41 +341,41 @@ void SwModule::RemoveAttrPool()
m_pAttrPool.clear();
}
-std::unique_ptr<SfxStyleFamilies> SwModule::CreateStyleFamilies()
+std::optional<SfxStyleFamilies> SwModule::CreateStyleFamilies()
{
- std::unique_ptr<SfxStyleFamilies> pStyleFamilies(new SfxStyleFamilies);
+ SfxStyleFamilies aStyleFamilies;
- pStyleFamilies->emplace_back(SfxStyleFamily::Para,
+ aStyleFamilies.emplace_back(SfxStyleFamily::Para,
SwResId(STR_PARAGRAPHSTYLEFAMILY),
BMP_STYLES_FAMILY_PARA,
RID_PARAGRAPHSTYLEFAMILY, GetResLocale());
- pStyleFamilies->emplace_back(SfxStyleFamily::Char,
+ aStyleFamilies.emplace_back(SfxStyleFamily::Char,
SwResId(STR_CHARACTERSTYLEFAMILY),
BMP_STYLES_FAMILY_CHAR,
RID_CHARACTERSTYLEFAMILY, GetResLocale());
- pStyleFamilies->emplace_back(SfxStyleFamily::Frame,
+ aStyleFamilies.emplace_back(SfxStyleFamily::Frame,
SwResId(STR_FRAMESTYLEFAMILY),
BMP_STYLES_FAMILY_FRAME,
RID_FRAMESTYLEFAMILY, GetResLocale());
- pStyleFamilies->emplace_back(SfxStyleFamily::Page,
+ aStyleFamilies.emplace_back(SfxStyleFamily::Page,
SwResId(STR_PAGESTYLEFAMILY),
BMP_STYLES_FAMILY_PAGE,
RID_PAGESTYLEFAMILY, GetResLocale());
- pStyleFamilies->emplace_back(SfxStyleFamily::Pseudo,
+ aStyleFamilies.emplace_back(SfxStyleFamily::Pseudo,
SwResId(STR_LISTSTYLEFAMILY),
BMP_STYLES_FAMILY_LIST,
RID_LISTSTYLEFAMILY, GetResLocale());
- pStyleFamilies->emplace_back(SfxStyleFamily::Table,
+ aStyleFamilies.emplace_back(SfxStyleFamily::Table,
SwResId(STR_TABLESTYLEFAMILY),
BMP_STYLES_FAMILY_TABLE,
RID_TABLESTYLEFAMILY, GetResLocale());
- return pStyleFamilies;
+ return aStyleFamilies;
}
void SwModule::RegisterAutomationApplicationEventsCaller(css::uno::Reference< ooo::vba::XSinkCaller > const& xCaller)
diff --git a/sw/source/uibase/config/StoredChapterNumbering.cxx b/sw/source/uibase/config/StoredChapterNumbering.cxx
index 07e68841ed93..4833a6af0b7b 100644
--- a/sw/source/uibase/config/StoredChapterNumbering.cxx
+++ b/sw/source/uibase/config/StoredChapterNumbering.cxx
@@ -149,7 +149,7 @@ public:
SwXNumberingRules::SetPropertiesToNumFormat(
aNumberFormat,
charStyleName,
- nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr, nullptr,
props);
SwNumRulesWithName *const pRules(GetOrCreateRules());
pRules->SetNumFormat(nIndex, aNumberFormat, charStyleName);
diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx
index ef51d6e6ba95..4733727e7043 100644
--- a/sw/source/uibase/config/modcfg.cxx
+++ b/sw/source/uibase/config/modcfg.cxx
@@ -1139,10 +1139,10 @@ void SwTableConfig::Load()
sal_Int32 nTemp = 0;
switch (nProp)
{
- case 0 : pValues[nProp] >>= nTemp; m_nTableHMove = static_cast<sal_uInt16>(convertMm100ToTwip(nTemp)); break; //"Shift/Row",
- case 1 : pValues[nProp] >>= nTemp; m_nTableVMove = static_cast<sal_uInt16>(convertMm100ToTwip(nTemp)); break; //"Shift/Column",
- case 2 : pValues[nProp] >>= nTemp; m_nTableHInsert = static_cast<sal_uInt16>(convertMm100ToTwip(nTemp)); break; //"Insert/Row",
- case 3 : pValues[nProp] >>= nTemp; m_nTableVInsert = static_cast<sal_uInt16>(convertMm100ToTwip(nTemp)); break; //"Insert/Column",
+ case 0 : pValues[nProp] >>= nTemp; m_nTableHMove = o3tl::narrowing<sal_uInt16>(convertMm100ToTwip(nTemp)); break; //"Shift/Row",
+ case 1 : pValues[nProp] >>= nTemp; m_nTableVMove = o3tl::narrowing<sal_uInt16>(convertMm100ToTwip(nTemp)); break; //"Shift/Column",
+ case 2 : pValues[nProp] >>= nTemp; m_nTableHInsert = o3tl::narrowing<sal_uInt16>(convertMm100ToTwip(nTemp)); break; //"Insert/Row",
+ case 3 : pValues[nProp] >>= nTemp; m_nTableVInsert = o3tl::narrowing<sal_uInt16>(convertMm100ToTwip(nTemp)); break; //"Insert/Column",
case 4 : pValues[nProp] >>= nTemp; m_eTableChgMode = static_cast<TableChgMode>(nTemp); break; //"Change/Effect",
case 5 : m_bInsTableFormatNum = *o3tl::doAccess<bool>(pValues[nProp]); break; //"Input/NumberRecognition",
case 6 : m_bInsTableChangeNumFormat = *o3tl::doAccess<bool>(pValues[nProp]); break; //"Input/NumberFormatRecognition",
diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx
index 2dbc4b74d966..7f85d5a78940 100644
--- a/sw/source/uibase/config/usrpref.cxx
+++ b/sw/source/uibase/config/usrpref.cxx
@@ -384,7 +384,7 @@ void SwLayoutViewConfig::Load()
case 12: m_rParent.SetMetric(static_cast<FieldUnit>(nInt32Val), true); break;// "Other/MeasureUnit",
case 13: m_rParent.SetDefTabInMm100(nInt32Val, true); break;// "Other/TabStop",
case 14: m_rParent.SetVRulerRight(bSet); break;// "Window/IsVerticalRulerRight",
- case 15: m_rParent.SetViewLayoutColumns( static_cast<sal_uInt16>(nInt32Val) ); break;// "ViewLayout/Columns",
+ case 15: m_rParent.SetViewLayoutColumns( o3tl::narrowing<sal_uInt16>(nInt32Val) ); break;// "ViewLayout/Columns",
case 16: m_rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode",
case 17: m_rParent.SetDefaultPageMode(bSet,true); break;// "Other/IsSquaredPageMode",
case 18: m_rParent.SetApplyCharUnit(bSet, true); break;// "Other/ApplyUserChar"
diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx
index 77e65e1f6604..f36530c355ad 100644
--- a/sw/source/uibase/config/viewopt.cxx
+++ b/sw/source/uibase/config/viewopt.cxx
@@ -326,7 +326,7 @@ void SwViewOption::Init(const OutputDevice* pWin)
{
if( !s_nPixelTwips && pWin )
{
- s_nPixelTwips = static_cast<sal_uInt16>(pWin->PixelToLogic( Size(1,1) ).Height());
+ s_nPixelTwips = o3tl::narrowing<sal_uInt16>(pWin->PixelToLogic( Size(1,1) ).Height());
}
}
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 367647037e4c..475388d2134e 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -2654,7 +2654,6 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType type, const uno::Reference
uno::Any aInfoAny;
bool bStore = true;
OUString sFind;
- uno::Sequence<OUString> aFilters(1);
uno::Any aURLAny = GetDBunoURI(rURL, type);
switch (type) {
@@ -2668,8 +2667,10 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType type, const uno::Reference
case DBConnURIType::FLAT:
case DBConnURIType::DBASE:
//set the filter to the file name without extension
- aFilters[0] = rURL.getBase(INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset);
- aTableFilterAny <<= aFilters;
+ {
+ uno::Sequence<OUString> aFilters { rURL.getBase(INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset) };
+ aTableFilterAny <<= aFilters;
+ }
break;
case DBConnURIType::MSJET:
case DBConnURIType::MSACE:
diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx
index 469a69968d74..8b3692f8da31 100644
--- a/sw/source/uibase/dbui/dbtree.cxx
+++ b/sw/source/uibase/dbui/dbtree.cxx
@@ -342,6 +342,7 @@ void SwDBTreeList::Select(std::u16string_view rDBName, std::u16string_view rTabl
}
if (!m_xTreeView->iter_has_child(*xParent))
{
+ m_xTreeView->set_children_on_demand(*xParent, false); // tdf#142294 drop placeholder on-demand node
RequestingChildrenHdl(*xParent);
// If successful, it will be expanded in a call to scroll_to_row for its children
}
@@ -363,6 +364,7 @@ void SwDBTreeList::Select(std::u16string_view rDBName, std::u16string_view rTabl
{
if (!m_xTreeView->iter_has_child(*xParent))
{
+ m_xTreeView->set_children_on_demand(*xParent, false); // tdf#142294 drop placeholder on-demand node
RequestingChildrenHdl(*xParent);
m_xTreeView->expand_row(*xParent);
}
diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx
index 762956faba57..17abf70db7c4 100644
--- a/sw/source/uibase/dbui/mailmergehelper.cxx
+++ b/sw/source/uibase/dbui/mailmergehelper.cxx
@@ -360,7 +360,7 @@ void SwAddressPreview::UpdateScrollBar()
{
if (pImpl->nColumns)
{
- sal_uInt16 nResultingRows = static_cast<sal_uInt16>(pImpl->aAddresses.size() + pImpl->nColumns - 1) / pImpl->nColumns;
+ sal_uInt16 nResultingRows = o3tl::narrowing<sal_uInt16>(pImpl->aAddresses.size() + pImpl->nColumns - 1) / pImpl->nColumns;
++nResultingRows;
auto nValue = m_xVScrollBar->vadjustment_get_value();
if (nValue > nResultingRows)
@@ -397,7 +397,7 @@ void SwAddressPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
aPartSize.AdjustHeight( -2 );
sal_uInt16 nAddress = nStartRow * pImpl->nColumns;
- const sal_uInt16 nNumAddresses = static_cast<sal_uInt16>(pImpl->aAddresses.size());
+ const sal_uInt16 nNumAddresses = o3tl::narrowing<sal_uInt16>(pImpl->aAddresses.size());
for (sal_uInt16 nRow = 0; nRow < pImpl->nRows ; ++nRow)
{
for (sal_uInt16 nCol = 0; nCol < pImpl->nColumns; ++nCol)
@@ -435,9 +435,9 @@ bool SwAddressPreview::MouseButtonDown( const MouseEvent& rMEvt )
sal_uInt32 nSelect = nRow * pImpl->nColumns + nCol;
if( nSelect < pImpl->aAddresses.size() &&
- pImpl->nSelectedAddress != static_cast<sal_uInt16>(nSelect))
+ pImpl->nSelectedAddress != o3tl::narrowing<sal_uInt16>(nSelect))
{
- pImpl->nSelectedAddress = static_cast<sal_uInt16>(nSelect);
+ pImpl->nSelectedAddress = o3tl::narrowing<sal_uInt16>(nSelect);
m_aSelectHdl.Call(nullptr);
}
Invalidate();
@@ -479,9 +479,9 @@ bool SwAddressPreview::KeyInput( const KeyEvent& rKEvt )
}
sal_uInt32 nSelect = nSelectedRow * pImpl->nColumns + nSelectedColumn;
if( nSelect < pImpl->aAddresses.size() &&
- pImpl->nSelectedAddress != static_cast<sal_uInt16>(nSelect))
+ pImpl->nSelectedAddress != o3tl::narrowing<sal_uInt16>(nSelect))
{
- pImpl->nSelectedAddress = static_cast<sal_uInt16>(nSelect);
+ pImpl->nSelectedAddress = o3tl::narrowing<sal_uInt16>(nSelect);
m_aSelectHdl.Call(nullptr);
Invalidate();
}
diff --git a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
index 482b1216f753..3f3ace7d801a 100644
--- a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
+++ b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
@@ -191,7 +191,7 @@ public:
m_xWidget->set_active(bActive);
}
- void connect_toggled(const Link<weld::ToggleButton&, void>& rLink)
+ void connect_toggled(const Link<weld::Toggleable&, void>& rLink)
{
m_xWidget->connect_toggled(rLink);
}
@@ -212,7 +212,7 @@ class MMExcludeEntryController : public svt::ToolboxController, public lang::XSe
{
VclPtr<ExcludeCheckBox> m_xExcludeCheckbox;
- DECL_STATIC_LINK(MMExcludeEntryController, ExcludeHdl, weld::ToggleButton&, void);
+ DECL_STATIC_LINK(MMExcludeEntryController, ExcludeHdl, weld::Toggleable&, void);
public:
explicit MMExcludeEntryController(const uno::Reference<uno::XComponentContext>& rContext)
@@ -358,7 +358,7 @@ uno::Reference<awt::XWindow> MMExcludeEntryController::createItemWindow(const un
return VCLUnoHelper::GetInterface(m_xExcludeCheckbox);
}
-IMPL_STATIC_LINK(MMExcludeEntryController, ExcludeHdl, weld::ToggleButton&, rCheckbox, void)
+IMPL_STATIC_LINK(MMExcludeEntryController, ExcludeHdl, weld::Toggleable&, rCheckbox, void)
{
SwView* pView = ::GetActiveView();
std::shared_ptr<SwMailMergeConfigItem> xConfigItem;
diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
index 38ad0d75b5a7..bf3e24cb00a9 100644
--- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
@@ -761,16 +761,16 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
aTmpOutliner.SetPaperSize( pTextObj->GetLogicRect().GetSize() );
aTmpOutliner.SetSpeller( xSpell );
- std::unique_ptr<OutlinerView> pOutlView( new OutlinerView( &aTmpOutliner, &(rView.GetEditWin()) ) );
- pOutlView->GetOutliner()->SetRefDevice( rSh.getIDocumentDeviceAccess().getPrinter( false ) );
- aTmpOutliner.InsertView( pOutlView.get() );
+ OutlinerView aOutlView( &aTmpOutliner, &(rView.GetEditWin()) );
+ aOutlView.GetOutliner()->SetRefDevice( rSh.getIDocumentDeviceAccess().getPrinter( false ) );
+ aTmpOutliner.InsertView( &aOutlView );
Size aSize(1,1);
tools::Rectangle aRect( Point(), aSize );
- pOutlView->SetOutputArea( aRect );
+ aOutlView.SetOutputArea( aRect );
aTmpOutliner.SetText( *pParaObj );
aTmpOutliner.ClearModifyFlag();
bHasSpellError = EESpellState::Ok != aTmpOutliner.HasSpellErrors();
- aTmpOutliner.RemoveView( pOutlView.get() );
+ aTmpOutliner.RemoveView( &aOutlView );
}
if(bHasSpellError)
{
@@ -778,7 +778,7 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
if(pCurrentTextObj)
pDrView->SdrEndTextEdit( true );
// and the found one should be activated
- rSh.MakeVisible(pTextObj->GetLogicRect());
+ rSh.MakeVisible(SwRect(pTextObj->GetLogicRect()));
Point aTmp( 0,0 );
rSh.SelectObj( aTmp, 0, pTextObj );
SdrPageView* pPV = pDrView->GetSdrPageView();
diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx
index 41f1aad97a79..4c2bc57a192b 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -112,12 +112,12 @@ void SwGlossaryHdl::SetCurGroup(const OUString &rGrp, bool bApi, bool bAlwaysCre
{
if (sCurEntryPath == rPathArr[nPath])
{
- nCurrentPath = static_cast<sal_uInt16>(nPath);
+ nCurrentPath = o3tl::narrowing<sal_uInt16>(nPath);
break;
}
}
const OUString sPath = sGroup.getToken(1, GLOS_DELIM);
- sal_uInt16 nComparePath = static_cast<sal_uInt16>(sPath.toInt32());
+ sal_uInt16 nComparePath = o3tl::narrowing<sal_uInt16>(sPath.toInt32());
if(nCurrentPath == nComparePath &&
sGroup.getToken(0, GLOS_DELIM) == sCurBase)
bPathEqual = true;
@@ -670,18 +670,18 @@ bool SwGlossaryHdl::ImportGlossaries( const OUString& rName )
if( !rName.isEmpty() )
{
std::shared_ptr<const SfxFilter> pFilter;
- std::unique_ptr<SfxMedium> pMed(new SfxMedium( rName, StreamMode::READ, nullptr, nullptr ));
+ SfxMedium aMed( rName, StreamMode::READ, nullptr, nullptr );
SfxFilterMatcher aMatcher( "swriter" );
- pMed->UseInteractionHandler( true );
- if (!aMatcher.GuessFilter(*pMed, pFilter, SfxFilterFlags::NONE))
+ aMed.UseInteractionHandler( true );
+ if (!aMatcher.GuessFilter(aMed, pFilter, SfxFilterFlags::NONE))
{
SwTextBlocks *pGlossary = nullptr;
- pMed->SetFilter( pFilter );
+ aMed.SetFilter( pFilter );
Reader* pR = SwReaderWriter::GetReader( pFilter->GetUserData() );
if( pR && nullptr != ( pGlossary = pCurGrp ? pCurGrp.get()
: rStatGlossaries.GetGroupDoc(aCurGrp).release()) )
{
- SwReader aReader( *pMed, rName );
+ SwReader aReader( aMed, rName );
if( aReader.HasGlossaries( *pR ) )
{
const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
diff --git a/sw/source/uibase/docvw/AnchorOverlayObject.cxx b/sw/source/uibase/docvw/AnchorOverlayObject.cxx
index 69c8ce3ad758..804628cc0b7b 100644
--- a/sw/source/uibase/docvw/AnchorOverlayObject.cxx
+++ b/sw/source/uibase/docvw/AnchorOverlayObject.cxx
@@ -174,7 +174,10 @@ bool AnchorPrimitive::operator==( const drawinglayer::primitive2d::BasePrimitive
return false;
}
-ImplPrimitive2DIDBlock(AnchorPrimitive, PRIMITIVE2D_ID_SWSIDEBARANCHORPRIMITIVE)
+sal_uInt32 AnchorPrimitive::getPrimitive2DID() const
+{
+ return PRIMITIVE2D_ID_SWSIDEBARANCHORPRIMITIVE;
+}
/*static*/ std::unique_ptr<AnchorOverlayObject> AnchorOverlayObject::CreateAnchorOverlayObject(
SwView const & rDocView,
diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
index 48f848416ec6..1696f7e6d338 100644
--- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
@@ -61,7 +61,7 @@ IMPL_LINK(SwAnnotationWin, SelectHdl, const OString&, rIdent, void)
GrabFocusToDocument();
}
-IMPL_LINK_NOARG(SwAnnotationWin, ToggleHdl, weld::ToggleButton&, void)
+IMPL_LINK_NOARG(SwAnnotationWin, ToggleHdl, weld::Toggleable&, void)
{
if (!mxMenuButton->get_active())
return;
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx
index 49ea845944b8..01d12affedad 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -62,6 +62,7 @@
#include "AnchorOverlayObject.hxx"
#include "OverlayRanges.hxx"
#include "SidebarTxtControl.hxx"
+#include "SidebarWinAcc.hxx"
#include <memory>
@@ -137,9 +138,6 @@ SwAnnotationWin::~SwAnnotationWin()
void SwAnnotationWin::dispose()
{
- if (IsDisposed())
- return;
-
mrMgr.DisconnectSidebarWinFromFrame( *(mrSidebarItem.maLayoutInfo.mpAnchorFrame),
*this );
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index f463bf7597f1..71a78d6fae0e 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -461,11 +461,27 @@ void SwAnnotationWin::SetMenuButtonColors()
ColorFromAlphaColor(80, mColorAnchor, mColorDark));
xVirDev->DrawGradient(aRect, aGradient);
+ //draw rect around button
+ xVirDev->SetFillColor();
+ xVirDev->SetLineColor(ColorFromAlphaColor(90, mColorAnchor, mColorDark));
+ xVirDev->DrawRect(aRect);
+
+ tools::Rectangle aSymbolRect(aRect);
+ // 25% distance to the left and right button border
+ const tools::Long nBorderDistanceLeftAndRight = ((aSymbolRect.GetWidth() * 250) + 500) / 1000;
+ aSymbolRect.AdjustLeft(nBorderDistanceLeftAndRight );
+ aSymbolRect.AdjustRight( -nBorderDistanceLeftAndRight );
+ // 40% distance to the top button border
+ const tools::Long nBorderDistanceTop = ((aSymbolRect.GetHeight() * 400) + 500) / 1000;
+ aSymbolRect.AdjustTop(nBorderDistanceTop );
+ // 15% distance to the bottom button border
+ const tools::Long nBorderDistanceBottom = ((aSymbolRect.GetHeight() * 150) + 500) / 1000;
+ aSymbolRect.AdjustBottom( -nBorderDistanceBottom );
DecorationView aDecoView(xVirDev.get());
- aDecoView.DrawSymbol(aRect, SymbolType::SPIN_DOWN, GetTextColor(),
+ aDecoView.DrawSymbol(aSymbolRect, SymbolType::SPIN_DOWN, GetTextColor(),
DrawSymbolFlags::NONE);
mxMenuButton->set_image(xVirDev);
- mxMenuButton->set_size_request(aSize.Width() + 4, aSize.Height());
+ mxMenuButton->set_size_request(aSize.Width() + 4, aSize.Height() + 4);
}
void SwAnnotationWin::Rescale()
@@ -1376,8 +1392,8 @@ void SwAnnotationWin::ChangeSidebarItem( SwSidebarItem const & rSidebarItem )
mrSidebarItem = rSidebarItem;
mpAnchorFrame = mrSidebarItem.maLayoutInfo.mpAnchorFrame;
- if (SidebarWinAccessible* pAcc = dynamic_cast<SidebarWinAccessible*>(GetWindowPeer()))
- pAcc->ChangeSidebarItem( mrSidebarItem );
+ if (mxSidebarWinAccessible)
+ mxSidebarWinAccessible->ChangeSidebarItem( mrSidebarItem );
if ( bAnchorChanged )
{
@@ -1389,11 +1405,14 @@ void SwAnnotationWin::ChangeSidebarItem( SwSidebarItem const & rSidebarItem )
css::uno::Reference< css::accessibility::XAccessible > SwAnnotationWin::CreateAccessible()
{
- rtl::Reference<SidebarWinAccessible> pAcc( new SidebarWinAccessible( *this,
+ // This is rather dodgy code. Normally in CreateAccessible, if we want a custom
+ // object, we return a custom object, but we do no override the default toolkit
+ // window peer.
+ if (!mxSidebarWinAccessible)
+ mxSidebarWinAccessible = new SidebarWinAccessible( *this,
mrView.GetWrtShell(),
- mrSidebarItem ) );
- SetWindowPeer( pAcc, pAcc.get() );
- return pAcc;
+ mrSidebarItem );
+ return mxSidebarWinAccessible;
}
} // eof of namespace sw::sidebarwindows
diff --git a/sw/source/uibase/docvw/FrameControlsManager.cxx b/sw/source/uibase/docvw/FrameControlsManager.cxx
index 622d5fced30b..1da032330d57 100644
--- a/sw/source/uibase/docvw/FrameControlsManager.cxx
+++ b/sw/source/uibase/docvw/FrameControlsManager.cxx
@@ -40,7 +40,6 @@ SwFrameControlsManager::~SwFrameControlsManager()
void SwFrameControlsManager::dispose()
{
m_aControls.clear();
- m_aTextNodeContentFrameMap.clear();
}
SwFrameControlPtr SwFrameControlsManager::GetControl( FrameControlType eType, const SwFrame* pFrame )
@@ -188,64 +187,8 @@ SwFrameMenuButtonBase::SwFrameMenuButtonBase(SwEditWin* pEditWin, const SwFrame*
{
}
-void SwFrameControlsManager::SetOutlineContentVisibilityButtons()
+void SwFrameControlsManager::SetOutlineContentVisibilityButton(const SwContentFrame* pContentFrame)
{
- // remove entries with outline node keys that are not in the outline nodes list
- IDocumentOutlineNodes::tSortedOutlineNodeList aOutlineNodes;
- m_pEditWin->GetView().GetWrtShell().getIDocumentOutlineNodesAccess()->getOutlineNodes(aOutlineNodes);
- std::map<const SwTextNode*, const SwContentFrame*>::iterator it = m_aTextNodeContentFrameMap.begin();
- while(it != m_aTextNodeContentFrameMap.end())
- {
- const SwNode* pNd = it->first;
- IDocumentOutlineNodes::tSortedOutlineNodeList::iterator i = std::find(aOutlineNodes.begin(), aOutlineNodes.end(), pNd);
- if (i == aOutlineNodes.end())
- {
- RemoveControlsByType(FrameControlType::Outline, it->second);
- it = m_aTextNodeContentFrameMap.erase(it);
- }
- else
- ++it;
- }
- for (SwNode* pNd : m_pEditWin->GetView().GetWrtShell().GetNodes().GetOutLineNds())
- {
- bool bOutlineContentVisibleAttr = true;
- pNd->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
- if (!bOutlineContentVisibleAttr)
- SetOutlineContentVisibilityButton(pNd->GetTextNode());
- }
-}
-
-void SwFrameControlsManager::SetOutlineContentVisibilityButton(const SwTextNode* pTextNd)
-{
- const SwContentFrame* pContentFrame = pTextNd->getLayoutFrame(nullptr);
-
- // has node frame changed or been deleted?
- std::map<const SwTextNode*, const SwContentFrame*>::iterator iter = m_aTextNodeContentFrameMap.find(pTextNd);
- if (iter != m_aTextNodeContentFrameMap.end())
- {
- const SwContentFrame* pFrameWas = iter->second;
- if (pContentFrame != pFrameWas)
- {
- // frame does not match frame in map for node
- RemoveControlsByType(FrameControlType::Outline, pFrameWas);
- m_aTextNodeContentFrameMap.erase(iter);
- }
- }
- if (pContentFrame && !pContentFrame->IsInDtor())
- {
- // frame is not being destroyed and isn't in map
- m_aTextNodeContentFrameMap.insert(make_pair(pTextNd, pContentFrame));
- }
- else
- {
- if (pContentFrame)
- {
- // frame is being destroyed
- RemoveControlsByType(FrameControlType::Outline, pContentFrame);
- }
- return;
- }
-
// Check if we already have the control
SwFrameControlPtr pControl;
@@ -266,48 +209,11 @@ void SwFrameControlsManager::SetOutlineContentVisibilityButton(const SwTextNode*
}
SwOutlineContentVisibilityWin* pWin = dynamic_cast<SwOutlineContentVisibilityWin *>(pControl->GetWindow());
- assert(pWin != nullptr) ;
+ assert(pWin != nullptr);
pWin->Set();
if (pWin->GetSymbol() == ButtonSymbol::SHOW)
- {
- // show expand button immediately
- pWin->Show();
- /*
- The outline content might be visible here. This happens on document load,
- undo outline moves, and show of outline content that itself has outline nodes
- having outline content visibility attribute false, for example tables and text
- frames containing outline nodes.
- */
- SwOutlineNodes::size_type nPos;
- SwOutlineNodes rOutlineNds = m_pEditWin->GetView().GetWrtShell().GetNodes().GetOutLineNds();
- if (rOutlineNds.Seek_Entry(const_cast<SwTextNode*>(pTextNd), &nPos))
- {
- SwNodeIndex aIdx(*pTextNd, +1);
- // there shouldn't be a layout frame
- // if there is then force visibility false
- if (!m_pEditWin->GetView().GetWrtShell().GetViewOptions()->IsTreatSubOutlineLevelsAsContent())
- {
- if (!(aIdx.GetNode().IsEndNode() ||
- (nPos + 1 < rOutlineNds.size() && &aIdx.GetNode() == rOutlineNds[nPos +1]))
- && aIdx.GetNode().IsContentNode()
- // this determines if the content is really visible
- && aIdx.GetNode().GetContentNode()->getLayoutFrame(nullptr))
- {
- // force outline content visibility false
- m_pEditWin->GetView().GetWrtShell().ToggleOutlineContentVisibility(nPos, true);
- }
- }
- else if (!aIdx.GetNode().IsEndNode()
- && aIdx.GetNode().IsContentNode()
- // this determines if the content is really visible
- && aIdx.GetNode().GetContentNode()->getLayoutFrame(nullptr))
- {
- // force outline content visibility false
- m_pEditWin->GetView().GetWrtShell().ToggleOutlineContentVisibility(nPos, true);
- }
- }
- }
+ pWin->Show(); // show the SHOW button immediately
else if (!pWin->IsVisible() && pWin->GetSymbol() == ButtonSymbol::HIDE)
pWin->ShowAll(true);
}
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 2232c7b8d4cd..d8ae3e80d062 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -207,6 +207,7 @@ void SwHeaderFooterWin::dispose()
m_pLine.disposeAndClear();
m_xPushButton.reset();
m_xMenuButton.reset();
+ m_xVirDev.disposeAndClear();
SwFrameMenuButtonBase::dispose();
}
diff --git a/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx b/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx
index a50832c3385f..23e836a96a24 100644
--- a/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx
+++ b/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx
@@ -107,28 +107,17 @@ void SwOutlineContentVisibilityWin::SetSymbol(ButtonSymbol eStyle)
void SwOutlineContentVisibilityWin::Set()
{
const SwTextFrame* pTextFrame = static_cast<const SwTextFrame*>(GetFrame());
-
- // outline node frame containing folded outline node content might be folded so need to hide it
- if (!pTextFrame || pTextFrame->IsInDtor())
- {
- SetSymbol(ButtonSymbol::NONE);
- Hide();
- return;
- }
const SwTextNode* pTextNode = pTextFrame->GetTextNodeFirst();
SwWrtShell& rSh = GetEditWin()->GetView().GetWrtShell();
const SwOutlineNodes& rOutlineNodes = rSh.GetNodes().GetOutLineNds();
- if (!pTextNode
- || !rOutlineNodes.Seek_Entry(static_cast<SwNode*>(const_cast<SwTextNode*>(pTextNode)),
- &m_nOutlinePos)
- || m_nOutlinePos == SwOutlineNodes::npos)
- {
- assert(false); // should never get here
- return;
- }
+
+ (void)rOutlineNodes.Seek_Entry(static_cast<SwNode*>(const_cast<SwTextNode*>(pTextNode)),
+ &m_nOutlinePos);
// set symbol displayed on button
- SetSymbol(rSh.IsOutlineContentVisible(m_nOutlinePos) ? ButtonSymbol::HIDE : ButtonSymbol::SHOW);
+ bool bVisible = true;
+ const_cast<SwTextNode*>(pTextNode)->GetAttrOutlineContentVisible(bVisible);
+ SetSymbol(bVisible ? ButtonSymbol::HIDE : ButtonSymbol::SHOW);
// set quick help
SwOutlineNodes::size_type nOutlineNodesCount
@@ -147,11 +136,11 @@ void SwOutlineContentVisibilityWin::Set()
SwRect aCharRect;
GetFrame()->GetCharRect(aCharRect, SwPosition(*pTextNode));
Point aPxPt(GetEditWin()->GetOutDev()->LogicToPixel(
- Point(aCharRect.Right(), aFrameAreaRect.Center().getY())));
+ Point(aCharRect.Left(), aFrameAreaRect.Center().getY())));
if (GetFrame()->IsRightToLeft())
- aPxPt.AdjustX(5);
+ aPxPt.AdjustX(2);
else
- aPxPt.AdjustX(-(GetSizePixel().getWidth() + 5));
+ aPxPt.AdjustX(-(GetSizePixel().getWidth() + 2));
aPxPt.AdjustY(-GetSizePixel().getHeight() / 2);
SetPosPixel(aPxPt);
}
@@ -178,39 +167,6 @@ bool SwOutlineContentVisibilityWin::Contains(const Point& rDocPt) const
return false;
}
-void SwOutlineContentVisibilityWin::ToggleOutlineContentVisibility(const bool bSubs)
-{
- SwWrtShell& rSh = GetEditWin()->GetView().GetWrtShell();
- rSh.LockView(true);
- if (GetEditWin()->GetView().GetDrawView()->IsTextEdit())
- rSh.EndTextEdit();
- if (GetEditWin()->GetView().IsDrawMode())
- GetEditWin()->GetView().LeaveDrawCreate();
- rSh.EnterStdMode();
- if (rSh.GetViewOptions()->IsTreatSubOutlineLevelsAsContent())
- rSh.ToggleOutlineContentVisibility(m_nOutlinePos);
- else if (bSubs)
- {
- // toggle including sub levels
- SwOutlineNodes::size_type nPos = m_nOutlinePos;
- SwOutlineNodes::size_type nOutlineNodesCount
- = rSh.getIDocumentOutlineNodesAccess()->getOutlineNodesCount();
- int nLevel = rSh.getIDocumentOutlineNodesAccess()->getOutlineLevel(m_nOutlinePos);
- bool bVisible = rSh.IsOutlineContentVisible(m_nOutlinePos);
- do
- {
- if (rSh.IsOutlineContentVisible(nPos) == bVisible)
- rSh.ToggleOutlineContentVisibility(nPos);
- } while (++nPos < nOutlineNodesCount
- && rSh.getIDocumentOutlineNodesAccess()->getOutlineLevel(nPos) > nLevel);
- }
- else
- rSh.ToggleOutlineContentVisibility(m_nOutlinePos);
- // set cursor position to the toggled outline node
- rSh.GotoOutline(m_nOutlinePos);
- rSh.LockView(false);
-}
-
IMPL_LINK(SwOutlineContentVisibilityWin, MouseMoveHdl, const MouseEvent&, rMEvt, bool)
{
if (rMEvt.IsLeaveWindow())
@@ -264,27 +220,17 @@ IMPL_LINK(SwOutlineContentVisibilityWin, MouseMoveHdl, const MouseEvent&, rMEvt,
return false;
}
+// Toggle the outline content visibility on mouse press
IMPL_LINK(SwOutlineContentVisibilityWin, MousePressHdl, const MouseEvent&, rMEvt, bool)
{
Hide();
- // Crash occurs if control does not have focus when toggling from hidden to shown.
- // Seems to happen due to the control being disposed in the toggle process.
- // Does NOT crash in debugger with GrabFocus and GrabFocusToDocument commented out.
- // DOES crash in debugger on GrabFocusToDocument when GrabFocus is commented out.
- // Until light is shed on why this happens, prevent crash by doing the following:
- // 1) grab focus to the control
- // 2) toggle content visibility
- // 3) grab focus to the document
- if (!ControlHasFocus())
- GrabFocus();
- ToggleOutlineContentVisibility(rMEvt.IsRight());
- GrabFocusToDocument();
+ GetEditWin()->ToggleOutlineContentVisibility(m_nOutlinePos, rMEvt.IsRight());
return false;
}
IMPL_LINK_NOARG(SwOutlineContentVisibilityWin, DelayAppearHandler, Timer*, void)
{
- const int TICKS_BEFORE_WE_APPEAR = 5;
+ const int TICKS_BEFORE_WE_APPEAR = 3;
if (m_nDelayAppearing < TICKS_BEFORE_WE_APPEAR)
{
++m_nDelayAppearing;
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index 535f02b85a25..6223d56057ae 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -134,7 +134,7 @@ void SwPageBreakWin::dispose()
{
m_bDestroyed = true;
m_aFadeTimer.Stop();
-
+ m_xVirDev.disposeAndClear();
m_pLine.disposeAndClear();
m_xMenuButton.reset();
@@ -364,7 +364,7 @@ void SwPageBreakWin::UpdatePosition(const std::optional<Point>& xEvtPt)
while ( pPrevPage && ( ( pPrevPage->getFrameArea().Top( ) == pPageFrame->getFrameArea().Top( ) )
|| static_cast< const SwPageFrame* >( pPrevPage )->IsEmptyPage( ) ) );
- ::tools::Rectangle aBoundRect = GetEditWin()->LogicToPixel( pPageFrame->GetBoundRect(GetEditWin()).SVRect() );
+ ::tools::Rectangle aBoundRect = GetEditWin()->LogicToPixel( pPageFrame->GetBoundRect(GetEditWin()->GetOutDev()).SVRect() );
::tools::Rectangle aFrameRect = GetEditWin()->LogicToPixel( pPageFrame->getFrameArea().SVRect() );
tools::Long nYLineOffset = ( aBoundRect.Top() + aFrameRect.Top() ) / 2;
@@ -450,7 +450,7 @@ void SwPageBreakWin::Fade( bool bFadeIn )
m_aFadeTimer.Start( );
}
-IMPL_LINK(SwPageBreakWin, ToggleHdl, weld::ToggleButton&, rMenuButton, void)
+IMPL_LINK(SwPageBreakWin, ToggleHdl, weld::Toggleable&, rMenuButton, void)
{
// hide on dropdown, draw fully unfaded if dropdown before fully faded in
Fade(rMenuButton.get_active());
diff --git a/sw/source/uibase/docvw/ShadowOverlayObject.cxx b/sw/source/uibase/docvw/ShadowOverlayObject.cxx
index ed247eb4b7ea..0e51635aecde 100644
--- a/sw/source/uibase/docvw/ShadowOverlayObject.cxx
+++ b/sw/source/uibase/docvw/ShadowOverlayObject.cxx
@@ -155,7 +155,10 @@ bool ShadowPrimitive::operator==( const drawinglayer::primitive2d::BasePrimitive
return false;
}
-ImplPrimitive2DIDBlock(ShadowPrimitive, PRIMITIVE2D_ID_SWSIDEBARSHADOWPRIMITIVE)
+sal_uInt32 ShadowPrimitive::getPrimitive2DID() const
+{
+ return PRIMITIVE2D_ID_SWSIDEBARSHADOWPRIMITIVE;
+}
/* static */ std::unique_ptr<ShadowOverlayObject> ShadowOverlayObject::CreateShadowOverlayObject( SwView const & rDocView )
{
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index e9ce19243225..342f52086fc8 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -204,7 +204,7 @@ void SidebarTextControl::DrawForPage(OutputDevice* pDev, const Point& rPt)
if (OutlinerView* pOutlinerView = mrSidebarWin.GetOutlinerView())
{
- pOutlinerView->GetOutliner()->Draw(pDev, tools::Rectangle(rPt, aSize));
+ pOutlinerView->GetOutliner()->Draw(*pDev, tools::Rectangle(rPt, aSize));
}
if ( mrSidebarWin.GetLayoutStatus()!=SwPostItHelper::DELETED )
diff --git a/sw/source/uibase/docvw/SidebarWinAcc.cxx b/sw/source/uibase/docvw/SidebarWinAcc.cxx
index 4e52b471aa4b..82046d7426dd 100644
--- a/sw/source/uibase/docvw/SidebarWinAcc.cxx
+++ b/sw/source/uibase/docvw/SidebarWinAcc.cxx
@@ -37,7 +37,7 @@ class SidebarWinAccessibleContext : public VCLXAccessibleComponent
explicit SidebarWinAccessibleContext( sw::annotation::SwAnnotationWin& rSidebarWin,
SwViewShell& rViewShell,
const SwFrame* pAnchorFrame )
- : VCLXAccessibleComponent( rSidebarWin.GetWindowPeer() )
+ : VCLXAccessibleComponent( dynamic_cast<VCLXWindow*>(rSidebarWin.CreateAccessible().get()) )
, mrViewShell( rViewShell )
, mpAnchorFrame( pAnchorFrame )
, maMutex()
diff --git a/sw/source/uibase/docvw/UnfloatTableButton.cxx b/sw/source/uibase/docvw/UnfloatTableButton.cxx
index 24e6780e1ed2..803c851a5dbb 100644
--- a/sw/source/uibase/docvw/UnfloatTableButton.cxx
+++ b/sw/source/uibase/docvw/UnfloatTableButton.cxx
@@ -61,6 +61,7 @@ UnfloatTableButton::~UnfloatTableButton() { disposeOnce(); }
void UnfloatTableButton::dispose()
{
m_xPushButton.reset();
+ m_xVirDev.disposeAndClear();
SwFrameMenuButtonBase::dispose();
}
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index ea0cf5c23e0f..22c1c3f55e1d 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -1366,32 +1366,6 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
}
}
- if (rSh.GetViewOptions()->IsShowOutlineContentVisibilityButton())
- {
- // not allowed if outline content visibility is false
- sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode();
- if ((rSh.IsSttPara() && (nKey == KEY_BACKSPACE || nKey == KEY_LEFT))
- || (rSh.IsEndOfPara() && (nKey == KEY_DELETE || nKey == KEY_RETURN || nKey == KEY_RIGHT)))
- {
- SwContentNode* pContentNode = rSh.GetCurrentShellCursor().GetContentNode();
- SwOutlineNodes::size_type nPos;
- if (rSh.GetDoc()->GetNodes().GetOutLineNds().Seek_Entry(pContentNode, &nPos))
- {
- bool bOutlineContentVisibleAttr = true;
- pContentNode->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
- if (!bOutlineContentVisibleAttr)
- return; // outline content visibility is false
- if (rSh.IsSttPara() && (nKey == KEY_BACKSPACE || nKey == KEY_LEFT) && (nPos-1 != SwOutlineNodes::npos))
- {
- bOutlineContentVisibleAttr = true;
- rSh.GetDoc()->GetNodes().GetOutLineNds()[nPos-1]->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
- if (!bOutlineContentVisibleAttr)
- return; // previous outline node has content visibility false
- }
- }
- }
- }
-
if( rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE &&
m_pApplyTempl && m_pApplyTempl->m_pFormatClipboard )
{
@@ -2704,10 +2678,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
}
}
- // x11 backend doesn't like not having this
- if (rSh.GetViewOptions()->IsShowOutlineContentVisibilityButton())
- GetFrameControlsManager().SetOutlineContentVisibilityButtons();
-
// update the page number in the statusbar
sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode();
if( KEY_UP == nKey || KEY_DOWN == nKey || KEY_PAGEUP == nKey || KEY_PAGEDOWN == nKey )
@@ -2988,7 +2958,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
SdrView *pSdrView = rSh.GetDrawView();
if ( pSdrView )
{
- if (pSdrView->MouseButtonDown(aMEvt, this))
+ if (pSdrView->MouseButtonDown(aMEvt, GetOutDev()))
{
rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll(false);
return; // SdrView's event evaluated
@@ -3195,7 +3165,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
SdrViewEvent aVEvt;
pSdrView->PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
- if (aVEvt.eEvent == SdrEventKind::ExecuteUrl)
+ if (aVEvt.meEvent == SdrEventKind::ExecuteUrl)
bExecDrawTextLink = true;
}
}
@@ -3536,16 +3506,16 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
{
if (rSh.GetViewOptions()->IsShowOutlineContentVisibilityButton())
{
+ // ctrl+left-click on outline node frame
SwContentAtPos aContentAtPos(IsAttrAtPos::Outline);
if(rSh.GetContentAtPos(aDocPos, aContentAtPos))
{
- // move cursor to outline para start and toggle outline content visibility
- MoveCursor(rSh, aDocPos, bOnlyText, bLockView);
- SwPaM aPam(*rSh.GetCurrentShellCursor().GetPoint());
SwOutlineNodes::size_type nPos;
- if (rSh.GetNodes().GetOutLineNds().Seek_Entry(&aPam.GetPoint()->nNode.GetNode(), &nPos))
- rSh.ToggleOutlineContentVisibility(nPos);
- return;
+ if (rSh.GetNodes().GetOutLineNds().Seek_Entry(aContentAtPos.aFnd.pNode, &nPos))
+ {
+ ToggleOutlineContentVisibility(nPos, false);
+ return;
+ }
}
}
if ( !m_bInsDraw && IsDrawObjSelectable( rSh, aDocPos ) && !lcl_urlOverBackground( rSh, aDocPos ) )
@@ -3784,29 +3754,14 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
if (rSh.GetViewOptions()->IsShowOutlineContentVisibilityButton()
&& aMEvt.GetModifier() == KEY_MOD1)
{
+ // ctrl+right-click on outline node frame
SwContentAtPos aContentAtPos(IsAttrAtPos::Outline);
if(rSh.GetContentAtPos(aDocPos, aContentAtPos))
{
- // move cursor to para start toggle outline content visibility and set the same visibility for subs
- MoveCursor(rSh, aDocPos, false, true);
- SwPaM aPam(*rSh.GetCurrentShellCursor().GetPoint());
SwOutlineNodes::size_type nPos;
- if (rSh.GetNodes().GetOutLineNds().Seek_Entry(&aPam.GetPoint()->nNode.GetNode(), &nPos))
+ if (rSh.GetNodes().GetOutLineNds().Seek_Entry(aContentAtPos.aFnd.pNode, &nPos))
{
- if (rSh.GetViewOptions()->IsTreatSubOutlineLevelsAsContent())
- rSh.ToggleOutlineContentVisibility(nPos);
- else
- {
- SwOutlineNodes::size_type nOutlineNodesCount = rSh.getIDocumentOutlineNodesAccess()->getOutlineNodesCount();
- int nLevel = rSh.getIDocumentOutlineNodesAccess()->getOutlineLevel(nPos);
- bool bVisible = rSh.IsOutlineContentVisible(nPos);
- do
- {
- if (rSh.IsOutlineContentVisible(nPos) == bVisible)
- rSh.ToggleOutlineContentVisibility(nPos);
- } while (++nPos < nOutlineNodesCount
- && rSh.getIDocumentOutlineNodesAccess()->getOutlineLevel(nPos) > nLevel);
- }
+ ToggleOutlineContentVisibility(nPos, !rSh.GetViewOptions()->IsTreatSubOutlineLevelsAsContent());
return;
}
}
@@ -3940,48 +3895,37 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
if (rSh.GetViewOptions()->IsShowOutlineContentVisibilityButton())
{
- // add/remove outline collapse button
+ // add/remove outline content hide button
+ const SwNodes& rNds = rSh.GetDoc()->GetNodes();
+ SwOutlineNodes::size_type nPos;
SwContentAtPos aSwContentAtPos(IsAttrAtPos::Outline);
if (rSh.GetContentAtPos(PixelToLogic(rMEvt.GetPosPixel()), aSwContentAtPos))
{
if(aSwContentAtPos.aFnd.pNode && aSwContentAtPos.aFnd.pNode->IsTextNode())
{
- const SwNodes& rNds = rSh.GetDoc()->GetNodes();
- SwOutlineNodes::size_type nPos;
SwContentFrame* pContentFrame = aSwContentAtPos.aFnd.pNode->GetTextNode()->getLayoutFrame(nullptr);
if (pContentFrame != m_pSavedOutlineFrame)
{
- // remove collapse button when saved frame is not frame at mouse position
- if (m_pSavedOutlineFrame && /* is it possible that m_pSavedOutlineFrame is removed? */ !m_pSavedOutlineFrame->IsInDtor() &&
+ if (m_pSavedOutlineFrame && !m_pSavedOutlineFrame->IsInDtor() &&
rNds.GetOutLineNds().Seek_Entry(static_cast<SwTextFrame*>(m_pSavedOutlineFrame)->GetTextNodeFirst(), &nPos) &&
- rSh.IsOutlineContentVisible(nPos))
- {
+ rSh.GetAttrOutlineContentVisible(nPos))
GetFrameControlsManager().RemoveControlsByType(FrameControlType::Outline, m_pSavedOutlineFrame);
- }
m_pSavedOutlineFrame = pContentFrame;
}
- // show collapse button
- if (rNds.GetOutLineNds().Seek_Entry(aSwContentAtPos.aFnd.pNode->GetTextNode(),
- &nPos) && rSh.IsOutlineContentVisible(nPos))
- {
- GetFrameControlsManager().SetOutlineContentVisibilityButton(aSwContentAtPos.aFnd.pNode->GetTextNode());
- }
+ // show button
+ if (rNds.GetOutLineNds().Seek_Entry(aSwContentAtPos.aFnd.pNode->GetTextNode(), &nPos) &&
+ rSh.GetAttrOutlineContentVisible(nPos))
+ GetFrameControlsManager().SetOutlineContentVisibilityButton(pContentFrame);
}
}
else if (m_pSavedOutlineFrame && !m_pSavedOutlineFrame->IsInDtor())
{
// current pointer pos is not over an outline frame
// previous frame was an outline frame
- // remove collapse button if showing
- const SwNodes& rNds = rSh.GetDoc()->GetNodes();
- SwOutlineNodes::size_type nPos;
- if (rNds.GetOutLineNds().Seek_Entry(static_cast<SwTextFrame*>(m_pSavedOutlineFrame)->
- GetTextNodeFirst(), &nPos) &&
- rSh.IsOutlineContentVisible(nPos))
- {
- GetFrameControlsManager().RemoveControlsByType(FrameControlType::Outline,
- m_pSavedOutlineFrame);
- }
+ // remove outline content visibility button if showing
+ if (rNds.GetOutLineNds().Seek_Entry(static_cast<SwTextFrame*>(m_pSavedOutlineFrame)->GetTextNodeFirst(), &nPos) &&
+ rSh.GetAttrOutlineContentVisible(nPos))
+ GetFrameControlsManager().RemoveControlsByType(FrameControlType::Outline, m_pSavedOutlineFrame);
m_pSavedOutlineFrame = nullptr;
}
}
@@ -4011,7 +3955,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
const SwCallMouseEvent aLastCallEvent( m_aSaveCallEvent );
m_aSaveCallEvent.Clear();
- if ( !bIsDocReadOnly && pSdrView && pSdrView->MouseMove(rMEvt,this) )
+ if ( !bIsDocReadOnly && pSdrView && pSdrView->MouseMove(rMEvt,GetOutDev()) )
{
SetPointer( PointerStyle::Text );
return; // evaluate SdrView's event
@@ -4025,11 +3969,11 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
if (m_pSavedOutlineFrame && !bInsWin)
{
// the mouse pointer has left the building
- // 86 the collapse button if showing
+ // remove the outline content visibility button if showing
const SwNodes& rNds = rSh.GetDoc()->GetNodes();
SwOutlineNodes::size_type nPos;
- rNds.GetOutLineNds().Seek_Entry(static_cast<SwTextFrame*>(m_pSavedOutlineFrame)->GetTextNodeFirst(), &nPos);
- if (rSh.IsOutlineContentVisible(nPos))
+ if (rNds.GetOutLineNds().Seek_Entry(static_cast<SwTextFrame*>(m_pSavedOutlineFrame)->GetTextNodeFirst(), &nPos) &&
+ rSh.GetAttrOutlineContentVisible(nPos))
GetFrameControlsManager().RemoveControlsByType(FrameControlType::Outline, m_pSavedOutlineFrame);
m_pSavedOutlineFrame = nullptr;
}
@@ -4405,7 +4349,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
!rSh.GetViewOptions()->getBrowseMode() &&
rSh.GetViewOptions()->IsShadowCursor() &&
!(rMEvt.GetModifier() + rMEvt.GetButtons()) &&
- !rSh.HasSelection() && !GetConnectMetaFile() )
+ !rSh.HasSelection() && !GetOutDev()->GetConnectMetaFile() )
{
SwRect aRect;
sal_Int16 eOrient;
@@ -4482,7 +4426,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if (pSdrView->GetDragMode() != SdrDragMode::Crop && !rMEvt.IsShift())
pSdrView->SetOrtho(false);
- if ( pSdrView->MouseButtonUp( rMEvt,this ) )
+ if ( pSdrView->MouseButtonUp( rMEvt,GetOutDev() ) )
{
rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll(false);
return; // SdrView's event evaluated
@@ -4837,7 +4781,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
ICheckboxFieldmark& rCheckboxFm = dynamic_cast<ICheckboxFieldmark&>(*fieldBM);
rCheckboxFm.SetChecked(!rCheckboxFm.IsChecked());
rCheckboxFm.Invalidate();
- rSh.InvalidateWindows( m_rView.GetVisArea() );
+ rSh.InvalidateWindows( SwRect(m_rView.GetVisArea()) );
}
}
}
@@ -4866,10 +4810,10 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if (pSdrView)
pSdrView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
- if (pSdrView && aVEvt.eEvent == SdrEventKind::ExecuteUrl)
+ if (pSdrView && aVEvt.meEvent == SdrEventKind::ExecuteUrl)
{
// hit URL field
- const SvxURLField *pField = aVEvt.pURLField;
+ const SvxURLField *pField = aVEvt.mpURLField;
if (pField)
{
const OUString& sURL(pField->GetURL());
@@ -4892,7 +4836,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
rSh.GetViewOptions()->IsShadowCursor() &&
MOUSE_LEFT == (rMEvt.GetModifier() + rMEvt.GetButtons()) &&
!rSh.HasSelection() &&
- !GetConnectMetaFile() &&
+ !GetOutDev()->GetConnectMetaFile() &&
rSh.VisArea().IsInside( aDocPt ))
{
SwUndoId nLastUndoId(SwUndoId::EMPTY);
@@ -5833,9 +5777,9 @@ void SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
}
- if (pSdrView->MouseButtonDown( aMEvt, this ) )
+ if (pSdrView->MouseButtonDown( aMEvt, GetOutDev() ) )
{
- pSdrView->MouseButtonUp( aMEvt, this );
+ pSdrView->MouseButtonUp( aMEvt, GetOutDev() );
rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll(false);
return;
}
@@ -6453,8 +6397,12 @@ void SwEditWin::SetUseInputLanguage( bool bNew )
OUString SwEditWin::GetSurroundingText() const
{
- OUString sReturn;
SwWrtShell& rSh = m_rView.GetWrtShell();
+
+ if (rSh.HasDrawView() && rSh.GetDrawView()->IsTextEdit())
+ return rSh.GetDrawView()->GetTextEditOutlinerView()->GetSurroundingText();
+
+ OUString sReturn;
if( rSh.HasSelection() && !rSh.IsMultiSelection() && rSh.IsSelOnePara() )
rSh.GetSelectedText( sReturn, ParaBreakType::ToOnlyCR );
else if( !rSh.HasSelection() )
@@ -6486,6 +6434,10 @@ OUString SwEditWin::GetSurroundingText() const
Selection SwEditWin::GetSurroundingTextSelection() const
{
SwWrtShell& rSh = m_rView.GetWrtShell();
+
+ if (rSh.HasDrawView() && rSh.GetDrawView()->IsTextEdit())
+ return rSh.GetDrawView()->GetTextEditOutlinerView()->GetSurroundingTextSelection();
+
if( rSh.HasSelection() )
{
OUString sReturn;
@@ -6521,6 +6473,9 @@ bool SwEditWin::DeleteSurroundingText(const Selection& rSelection)
{
SwWrtShell& rSh = m_rView.GetWrtShell();
+ if (rSh.HasDrawView() && rSh.GetDrawView()->IsTextEdit())
+ return rSh.GetDrawView()->GetTextEditOutlinerView()->DeleteSurroundingText(rSelection);
+
if (rSh.HasSelection())
return false;
@@ -6668,4 +6623,41 @@ SwFrameControlsManager& SwEditWin::GetFrameControlsManager()
return *m_pFrameControlsManager;
}
+void SwEditWin::ToggleOutlineContentVisibility(const size_t nOutlinePos, const bool bSubs)
+{
+ SwWrtShell& rSh = GetView().GetWrtShell();
+
+ if (GetView().GetDrawView()->IsTextEdit())
+ rSh.EndTextEdit();
+ if (GetView().IsDrawMode())
+ GetView().LeaveDrawCreate();
+ rSh.EnterStdMode();
+
+ if (!bSubs || rSh.GetViewOptions()->IsTreatSubOutlineLevelsAsContent())
+ {
+ SwNode* pNode = rSh.GetNodes().GetOutLineNds()[nOutlinePos];
+ bool bVisible = true;
+ pNode->GetTextNode()->GetAttrOutlineContentVisible(bVisible);
+ pNode->GetTextNode()->SetAttrOutlineContentVisible(!bVisible);
+ }
+ else if (bSubs)
+ {
+ // toggle including sub levels
+ SwOutlineNodes::size_type nPos = nOutlinePos;
+ SwOutlineNodes::size_type nOutlineNodesCount
+ = rSh.getIDocumentOutlineNodesAccess()->getOutlineNodesCount();
+ int nLevel = rSh.getIDocumentOutlineNodesAccess()->getOutlineLevel(nOutlinePos);
+ bool bVisible = rSh.IsOutlineContentVisible(nOutlinePos);
+ do
+ {
+ if (rSh.IsOutlineContentVisible(nPos) == bVisible)
+ rSh.GetNodes().GetOutLineNds()[nPos]->GetTextNode()->SetAttrOutlineContentVisible(!bVisible);
+ } while (++nPos < nOutlineNodesCount
+ && rSh.getIDocumentOutlineNodesAccess()->getOutlineLevel(nPos) > nLevel);
+ }
+
+ rSh.InvalidateOutlineContentVisibility();
+ rSh.GotoOutline(nOutlinePos);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx
index a72554202f2e..c2c196c329b8 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -94,7 +94,7 @@ OUString SwEditWin::ClipLongToolTip(const OUString& rText)
tools::Long nMaxWidth = GetDesktopRectPixel().GetWidth() * 2 / 3;
nMaxWidth = PixelToLogic(Size(nMaxWidth, 0)).Width();
if (nTextWidth > nMaxWidth)
- sDisplayText = GetEllipsisString(sDisplayText, nMaxWidth, DrawTextFlags::CenterEllipsis);
+ sDisplayText = GetOutDev()->GetEllipsisString(sDisplayText, nMaxWidth, DrawTextFlags::CenterEllipsis);
return sDisplayText;
}
@@ -467,9 +467,6 @@ void SwEditWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle
if( bPaintShadowCursor )
m_pShadCursor->Paint();
-
- if (pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton())
- GetFrameControlsManager().SetOutlineContentVisibilityButtons();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx
index 042dcc727eaa..55c6753c6023 100644
--- a/sw/source/uibase/docvw/srcedtw.cxx
+++ b/sw/source/uibase/docvw/srcedtw.cxx
@@ -260,10 +260,7 @@ SwSrcEditWindow::SwSrcEditWindow( vcl::Window* pParent, SwSrcView* pParentView )
osl::MutexGuard g(mutex_);
m_xNotifier = n;
}
- css::uno::Sequence< OUString > s(2);
- s[0] = "FontHeight";
- s[1] = "FontName";
- n->addPropertiesChangeListener(s, m_xListener);
+ n->addPropertiesChangeListener({ "FontHeight", "FontName" }, m_xListener);
}
SwSrcEditWindow::~SwSrcEditWindow()
@@ -523,7 +520,7 @@ void SwSrcEditWindow::CreateTextEngine()
vcl::Font aFont;
aFont.SetTransparent( false );
aFont.SetFillColor( rCol );
- SetPointFont(*this, aFont);
+ SetPointFont(*GetOutDev(), aFont);
aFont = GetFont();
aFont.SetFillColor( rCol );
m_pOutWin->SetFont( aFont );
@@ -594,7 +591,7 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer*, pIdle, void )
sal_uInt16 nCount = 0;
// at first the region around the cursor is processed
TextSelection aSel = m_pTextView->GetSelection();
- sal_uInt16 nCur = static_cast<sal_uInt16>(aSel.GetStart().GetPara());
+ sal_uInt16 nCur = o3tl::narrowing<sal_uInt16>(aSel.GetStart().GetPara());
if(nCur > 40)
nCur -= 40;
else
@@ -745,7 +742,7 @@ void SwSrcEditWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
case SfxHintId::TextParaContentChanged:
if ( !m_bHighlighting )
{
- m_aSyntaxLineTable.insert( static_cast<sal_uInt16>(pTextHint->GetValue()) );
+ m_aSyntaxLineTable.insert( o3tl::narrowing<sal_uInt16>(pTextHint->GetValue()) );
m_aSyntaxIdle.Start();
}
break;
@@ -963,11 +960,11 @@ void SwSrcEditWindow::SetFont()
if(lcl_GetLanguagesForEncoding(m_eSourceEncoding, aLanguages))
{
//TODO: check for multiple languages
- aFont = OutputDevice::GetDefaultFont(DefaultFontType::FIXED, aLanguages[0], GetDefaultFontFlags::NONE, this);
+ aFont = OutputDevice::GetDefaultFont(DefaultFontType::FIXED, aLanguages[0], GetDefaultFontFlags::NONE, GetOutDev());
}
else
aFont = OutputDevice::GetDefaultFont(DefaultFontType::SANS_UNICODE,
- Application::GetSettings().GetLanguageTag().getLanguageType(), GetDefaultFontFlags::NONE, this);
+ Application::GetSettings().GetLanguageTag().getLanguageType(), GetDefaultFontFlags::NONE, GetOutDev());
sFontName = aFont.GetFamilyName();
}
const SvxFontListItem* pFontListItem =
diff --git a/sw/source/uibase/envelp/labelcfg.cxx b/sw/source/uibase/envelp/labelcfg.cxx
index ee5ac99f25e4..e0fbe142f688 100644
--- a/sw/source/uibase/envelp/labelcfg.cxx
+++ b/sw/source/uibase/envelp/labelcfg.cxx
@@ -63,13 +63,7 @@ static OUString lcl_getValue(xmlreader::XmlReader& reader,
static Sequence<OUString> lcl_CreatePropertyNames(const OUString& rPrefix)
{
- Sequence<OUString> aProperties(2);
- OUString* pProperties = aProperties.getArray();
- std::fill(aProperties.begin(), aProperties.end(), rPrefix);
-
- pProperties[ 0] += "Name";
- pProperties[ 1] += "Measure";
- return aProperties;
+ return { OUString::Concat(rPrefix) + "Name", OUString::Concat(rPrefix) + "Measure" };
}
SwLabelConfig::SwLabelConfig() :
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx
index 90b12e34c32d..df3bcf4a6ba3 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -769,7 +769,7 @@ OUString SwFieldMgr::GetFormatStr(SwFieldTypesEnum nTypeId, sal_uInt32 nFormatId
// determine FormatId from Pseudo-ID
sal_uInt16 SwFieldMgr::GetFormatId(SwFieldTypesEnum nTypeId, sal_uInt32 nFormatId) const
{
- sal_uInt16 nId = static_cast<sal_uInt16>(nFormatId);
+ sal_uInt16 nId = o3tl::narrowing<sal_uInt16>(nFormatId);
switch( nTypeId )
{
case SwFieldTypesEnum::DocumentInfo:
@@ -983,7 +983,7 @@ bool SwFieldMgr::InsertField(
case SwFieldTypesEnum::Chapter:
{
- sal_uInt16 nByte = static_cast<sal_uInt16>(rData.m_sPar2.toInt32());
+ sal_uInt16 nByte = o3tl::narrowing<sal_uInt16>(rData.m_sPar2.toInt32());
SwChapterFieldType* pTyp =
static_cast<SwChapterFieldType*>( pCurShell->GetFieldType(0, SwFieldIds::Chapter) );
pField.reset(new SwChapterField(pTyp, nFormatId));
@@ -1078,7 +1078,7 @@ bool SwFieldMgr::InsertField(
{
SwGetRefFieldType* pTyp =
static_cast<SwGetRefFieldType*>( pCurShell->GetFieldType(0, SwFieldIds::GetRef) );
- sal_uInt16 nSeqNo = static_cast<sal_uInt16>(rData.m_sPar2.toInt32());
+ sal_uInt16 nSeqNo = o3tl::narrowing<sal_uInt16>(rData.m_sPar2.toInt32());
OUString sReferenceLanguage;
// handle language-variant formats
if (nFormatId >= SAL_N_ELEMENTS(FMT_REF_ARY))
@@ -1564,7 +1564,7 @@ void SwFieldMgr::UpdateCurField(sal_uInt32 nFormat,
case SwFieldTypesEnum::Chapter:
{
- sal_uInt16 nByte = static_cast<sal_uInt16>(rPar2.toInt32());
+ sal_uInt16 nByte = o3tl::narrowing<sal_uInt16>(rPar2.toInt32());
nByte = std::max(sal_uInt16(1), nByte);
nByte = std::min(nByte, sal_uInt16(MAXLEVEL));
nByte -= 1;
@@ -1618,10 +1618,10 @@ void SwFieldMgr::UpdateCurField(sal_uInt32 nFormat,
case SwFieldTypesEnum::GetRef:
{
bSetPar2 = false;
- static_cast<SwGetRefField*>(pTmpField.get())->SetSubType( static_cast<sal_uInt16>(rPar2.toInt32()) );
+ static_cast<SwGetRefField*>(pTmpField.get())->SetSubType( o3tl::narrowing<sal_uInt16>(rPar2.toInt32()) );
const sal_Int32 nPos = rPar2.indexOf( '|' );
if( nPos>=0 )
- static_cast<SwGetRefField*>(pTmpField.get())->SetSeqNo( static_cast<sal_uInt16>(rPar2.copy( nPos + 1 ).toInt32()));
+ static_cast<SwGetRefField*>(pTmpField.get())->SetSeqNo( o3tl::narrowing<sal_uInt16>(rPar2.copy( nPos + 1 ).toInt32()));
}
break;
case SwFieldTypesEnum::Dropdown:
diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx
index 479311332f75..7fee7182ebb1 100644
--- a/sw/source/uibase/frmdlg/colex.cxx
+++ b/sw/source/uibase/frmdlg/colex.cxx
@@ -325,7 +325,7 @@ void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOr
SwColumnOnlyExample::SwColumnOnlyExample()
: m_aFrameSize(SvxPaperInfo::GetPaperSize(PAPER_A4)) // DIN A4
{
- ::FitToActualSize(m_aCols, static_cast<sal_uInt16>(m_aFrameSize.Width()));
+ ::FitToActualSize(m_aCols, o3tl::narrowing<sal_uInt16>(m_aFrameSize.Width()));
}
void SwColumnOnlyExample::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/)
@@ -440,15 +440,15 @@ void SwColumnOnlyExample::SetColumns(const SwFormatCol& rCol)
tools::Long nWish = pCol->GetWishWidth();
nWish *= nFrameWidth;
nWish /= nWishSum;
- pCol->SetWishWidth(static_cast<sal_uInt16>(nWish));
+ pCol->SetWishWidth(o3tl::narrowing<sal_uInt16>(nWish));
tools::Long nLeft = pCol->GetLeft();
nLeft *= nFrameWidth;
nLeft /= nWishSum;
- pCol->SetLeft(static_cast<sal_uInt16>(nLeft));
+ pCol->SetLeft(o3tl::narrowing<sal_uInt16>(nLeft));
tools::Long nRight = pCol->GetRight();
nRight *= nFrameWidth;
nRight /= nWishSum;
- pCol->SetRight(static_cast<sal_uInt16>(nRight));
+ pCol->SetRight(o3tl::narrowing<sal_uInt16>(nRight));
}
// #97495# make sure that the automatic column width's are always equal
if(!(nColCount && m_aCols.IsOrtho()))
diff --git a/sw/source/uibase/frmdlg/colmgr.cxx b/sw/source/uibase/frmdlg/colmgr.cxx
index 32d777713fda..928b01c357e6 100644
--- a/sw/source/uibase/frmdlg/colmgr.cxx
+++ b/sw/source/uibase/frmdlg/colmgr.cxx
@@ -137,12 +137,12 @@ void SwColMgr::SetActualWidth(sal_uInt16 nW)
SwColMgr::SwColMgr(const SfxItemSet& rSet)
: aFormatCol(rSet.Get(RES_COL))
{
- nWidth = static_cast<sal_uInt16>(rSet.Get(RES_FRM_SIZE).GetWidth());
+ nWidth = o3tl::narrowing<sal_uInt16>(rSet.Get(RES_FRM_SIZE).GetWidth());
if (nWidth < MINLAY)
nWidth = USHRT_MAX;
const SvxLRSpaceItem& rLR = rSet.Get(RES_LR_SPACE);
- nWidth = nWidth - static_cast<sal_uInt16>(rLR.GetLeft());
- nWidth = nWidth - static_cast<sal_uInt16>(rLR.GetRight());
+ nWidth = nWidth - o3tl::narrowing<sal_uInt16>(rLR.GetLeft());
+ nWidth = nWidth - o3tl::narrowing<sal_uInt16>(rLR.GetRight());
::FitToActualSize(aFormatCol, nWidth);
}
diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx
index fa5991baac56..2146b05d44e9 100644
--- a/sw/source/uibase/frmdlg/frmmgr.cxx
+++ b/sw/source/uibase/frmdlg/frmmgr.cxx
@@ -92,7 +92,19 @@ SwFlyFrameAttrMgr::SwFlyFrameAttrMgr( bool bNew, SwWrtShell* pSh, Frmmgr_Type nT
{
// Default anchor for new graphics and objects is at-char, except for Math objects.
SwViewOption aViewOpt(*pSh->GetViewOptions());
- m_aSet.Put(SwFormatAnchor(aViewOpt.GetDefaultAnchorType()));//RndStdIds::FLY_AT_CHAR
+
+ RndStdIds eAnchorType = aViewOpt.GetDefaultAnchorType();
+
+ const SwFormatAnchor rStyleAnchor
+ = m_pOwnSh->GetFormatFromPool(nId)->GetAttrSet().GetAnchor();
+ if (rStyleAnchor.GetAnchorId() != RndStdIds::FLY_AT_PARA)
+ {
+ // The style has a custom anchor type, prefer that over the user profile
+ // default.
+ eAnchorType = rStyleAnchor.GetAnchorId();
+ }
+
+ m_aSet.Put(SwFormatAnchor(eAnchorType));
}
}
}
diff --git a/sw/source/uibase/inc/DateFormFieldDialog.hxx b/sw/source/uibase/inc/DateFormFieldDialog.hxx
index f56626aac2a9..2b4573af7dea 100644
--- a/sw/source/uibase/inc/DateFormFieldDialog.hxx
+++ b/sw/source/uibase/inc/DateFormFieldDialog.hxx
@@ -23,7 +23,7 @@ class IDateFieldmark;
/// Dialog to specify the properties of date form field
namespace sw
{
-class DateFormFieldDialog : public weld::GenericDialogController
+class DateFormFieldDialog final : public weld::GenericDialogController
{
private:
sw::mark::IDateFieldmark* m_pDateField;
diff --git a/sw/source/uibase/inc/DropDownFieldDialog.hxx b/sw/source/uibase/inc/DropDownFieldDialog.hxx
index 59510d37b751..b8b60f20c293 100644
--- a/sw/source/uibase/inc/DropDownFieldDialog.hxx
+++ b/sw/source/uibase/inc/DropDownFieldDialog.hxx
@@ -28,7 +28,7 @@ class SwWrtShell;
// Dialog to edit drop down field selection
namespace sw
{
-class DropDownFieldDialog : public weld::GenericDialogController
+class DropDownFieldDialog final : public weld::GenericDialogController
{
SwWrtShell &m_rSh;
SwDropDownField* m_pDropField;
diff --git a/sw/source/uibase/inc/DropDownFormFieldDialog.hxx b/sw/source/uibase/inc/DropDownFormFieldDialog.hxx
index 0719b740163a..c6bcc9837304 100644
--- a/sw/source/uibase/inc/DropDownFormFieldDialog.hxx
+++ b/sw/source/uibase/inc/DropDownFormFieldDialog.hxx
@@ -20,7 +20,7 @@ class IFieldmark;
/// Dialog to specify the properties of drop-down form field
namespace sw
{
-class DropDownFormFieldDialog : public weld::GenericDialogController
+class DropDownFormFieldDialog final : public weld::GenericDialogController
{
private:
mark::IFieldmark* m_pDropDownField;
diff --git a/sw/source/uibase/inc/FrameControl.hxx b/sw/source/uibase/inc/FrameControl.hxx
index 9efce9cf699e..e53c765bf831 100644
--- a/sw/source/uibase/inc/FrameControl.hxx
+++ b/sw/source/uibase/inc/FrameControl.hxx
@@ -30,9 +30,6 @@ public:
/// Returns true if the point is inside the control.
virtual bool Contains( const Point &rDocPt ) const = 0;
- /// Returns true if the control has focus
- virtual bool IsFocused() const = 0;
-
virtual const SwFrame* GetFrame() = 0;
virtual SwEditWin* GetEditWin() = 0;
};
@@ -51,7 +48,6 @@ public:
void SetReadonly( bool bReadonly ) { mpIFace->SetReadonly( bReadonly ); }
void ShowAll( bool bShow ) { mpIFace->ShowAll( bShow ); }
bool Contains( const Point &rDocPt ) const { return mpIFace->Contains( rDocPt ); }
- bool HasFocus() const { return mpIFace->IsFocused(); }
};
/** Class sharing some MenuButton code
@@ -76,7 +72,6 @@ public:
virtual const SwFrame* GetFrame() override { return m_pFrame; }
virtual SwEditWin* GetEditWin() override { return m_pEditWin; }
- virtual bool IsFocused() const override { return ControlHasFocus(); }
const SwPageFrame* GetPageFrame() const;
};
diff --git a/sw/source/uibase/inc/FrameControlsManager.hxx b/sw/source/uibase/inc/FrameControlsManager.hxx
index cb51be62f860..f73f226b36d7 100644
--- a/sw/source/uibase/inc/FrameControlsManager.hxx
+++ b/sw/source/uibase/inc/FrameControlsManager.hxx
@@ -25,14 +25,13 @@ typedef std::shared_ptr< SwFrameControl > SwFrameControlPtr;
typedef std::map<const SwFrame*, SwFrameControlPtr> SwFrameControlPtrMap;
-/** A container for the Header/Footer, or PageBreak controls.
+/** A container for the Header/Footer, PageBreak, and Outline Content Visibility controls.
*/
class SwFrameControlsManager
{
private:
VclPtr<SwEditWin> m_pEditWin;
std::map< FrameControlType, SwFrameControlPtrMap > m_aControls;
- std::map<const SwTextNode*, const SwContentFrame*> m_aTextNodeContentFrameMap;
public:
SwFrameControlsManager( SwEditWin* pEditWin );
@@ -49,8 +48,7 @@ class SwFrameControlsManager
void SetHeaderFooterControl( const SwPageFrame* pPageFrame, FrameControlType eType, Point aOffset );
void SetPageBreakControl( const SwPageFrame* pPageFrame );
void SetUnfloatTableButton( const SwFlyFrame* pFlyFrame, bool bShow, Point aTopRightPixel = Point() );
- void SetOutlineContentVisibilityButton(const SwTextNode* pTextNd);
- void SetOutlineContentVisibilityButtons();
+ void SetOutlineContentVisibilityButton(const SwContentFrame* pContentFrame);
};
#endif
diff --git a/sw/source/uibase/inc/HeaderFooterWin.hxx b/sw/source/uibase/inc/HeaderFooterWin.hxx
index 5b83bbc79548..95dcbd243d55 100644
--- a/sw/source/uibase/inc/HeaderFooterWin.hxx
+++ b/sw/source/uibase/inc/HeaderFooterWin.hxx
@@ -32,7 +32,7 @@ public:
This control is showing the header / footer style name and provides
a few useful actions to the user.
*/
-class SwHeaderFooterWin : public SwFrameMenuButtonBase
+class SwHeaderFooterWin final : public SwFrameMenuButtonBase
{
std::unique_ptr<weld::MenuButton> m_xMenuButton;
std::unique_ptr<weld::Button> m_xPushButton;
diff --git a/sw/source/uibase/inc/OutlineContentVisibilityWin.hxx b/sw/source/uibase/inc/OutlineContentVisibilityWin.hxx
index 96c0c0500ac4..a03c3c1f1e2c 100644
--- a/sw/source/uibase/inc/OutlineContentVisibilityWin.hxx
+++ b/sw/source/uibase/inc/OutlineContentVisibilityWin.hxx
@@ -19,7 +19,7 @@ enum class ButtonSymbol
NONE
};
-class SwOutlineContentVisibilityWin : public InterimItemWindow, public ISwFrameControl
+class SwOutlineContentVisibilityWin final : public InterimItemWindow, public ISwFrameControl
{
private:
std::unique_ptr<weld::Button> m_xShowBtn;
@@ -32,8 +32,6 @@ private:
bool m_bDestroyed;
size_t m_nOutlinePos;
- void ToggleOutlineContentVisibility(const bool bSubs);
-
public:
SwOutlineContentVisibilityWin(SwEditWin* pEditWin, const SwFrame* pFrame);
virtual ~SwOutlineContentVisibilityWin() override { disposeOnce(); }
@@ -42,7 +40,6 @@ public:
virtual void ShowAll(bool bShow) override;
virtual bool Contains(const Point& rDocPt) const override;
virtual void SetReadonly(bool /*bReadonly*/) override {}
- virtual bool IsFocused() const override { return ControlHasFocus(); }
virtual const SwFrame* GetFrame() override { return m_pFrame; }
virtual SwEditWin* GetEditWin() override { return m_pEditWin; }
diff --git a/sw/source/uibase/inc/PageBreakWin.hxx b/sw/source/uibase/inc/PageBreakWin.hxx
index c5cc9cd7774e..53d2eec4c1a9 100644
--- a/sw/source/uibase/inc/PageBreakWin.hxx
+++ b/sw/source/uibase/inc/PageBreakWin.hxx
@@ -22,7 +22,7 @@ class SwPageFrame;
This control shows a line indicating a manual page break and a
button providing a few actions on that page break.
*/
-class SwPageBreakWin : public SwFrameMenuButtonBase
+class SwPageBreakWin final : public SwFrameMenuButtonBase
{
std::unique_ptr<weld::MenuButton> m_xMenuButton;
VclPtr<vcl::Window> m_pLine;
@@ -54,7 +54,7 @@ public:
private:
DECL_LINK( FadeHandler, Timer *, void );
/// Hide the button when the menu is toggled closed, e.g by clicking outside
- DECL_LINK(ToggleHdl, weld::ToggleButton&, void);
+ DECL_LINK(ToggleHdl, weld::Toggleable&, void);
DECL_LINK(SelectHdl, const OString&, void);
void PaintButton();
};
diff --git a/sw/source/uibase/inc/SwSpellDialogChildWindow.hxx b/sw/source/uibase/inc/SwSpellDialogChildWindow.hxx
index 82cd29204457..8599256da21c 100644
--- a/sw/source/uibase/inc/SwSpellDialogChildWindow.hxx
+++ b/sw/source/uibase/inc/SwSpellDialogChildWindow.hxx
@@ -25,7 +25,7 @@
class SwWrtShell;
struct SpellState;
-class SwSpellDialogChildWindow
+class SwSpellDialogChildWindow final
: public svx::SpellDialogChildWindow
{
bool m_bIsGrammarCheckingOn;
@@ -37,7 +37,6 @@ class SwSpellDialogChildWindow
bool SpellDrawText_Impl(SwWrtShell& rSh, svx::SpellPortions& rPortions);
void LockFocusNotification(bool bLock);
-protected:
virtual svx::SpellPortions GetNextWrongSentence(bool bRecheck) override;
virtual void ApplyChangedSentence(const svx::SpellPortions& rChanged, bool bRecheck) override;
virtual void AddAutoCorrection(const OUString& rOld, const OUString& rNew, LanguageType eLanguage) override;
diff --git a/sw/source/uibase/inc/SwXFilterOptions.hxx b/sw/source/uibase/inc/SwXFilterOptions.hxx
index e9e036b5f193..ce1f991465ba 100644
--- a/sw/source/uibase/inc/SwXFilterOptions.hxx
+++ b/sw/source/uibase/inc/SwXFilterOptions.hxx
@@ -30,7 +30,7 @@
namespace com::sun::star::io { class XInputStream; }
-class SwXFilterOptions : public ::cppu::WeakImplHelper<
+class SwXFilterOptions final : public ::cppu::WeakImplHelper<
css::beans::XPropertyAccess,
css::ui::dialogs::XExecutableDialog,
css::document::XImporter,
diff --git a/sw/source/uibase/inc/UnfloatTableButton.hxx b/sw/source/uibase/inc/UnfloatTableButton.hxx
index 99598bcc2a15..164b240f28b1 100644
--- a/sw/source/uibase/inc/UnfloatTableButton.hxx
+++ b/sw/source/uibase/inc/UnfloatTableButton.hxx
@@ -22,7 +22,7 @@
* floating properties.
*
*/
-class UnfloatTableButton : public SwFrameMenuButtonBase
+class UnfloatTableButton final : public SwFrameMenuButtonBase
{
std::unique_ptr<weld::Button> m_xPushButton;
OUString m_sLabel;
diff --git a/sw/source/uibase/inc/abstract.hxx b/sw/source/uibase/inc/abstract.hxx
index 3a9e16f9888e..ded62f0ff598 100644
--- a/sw/source/uibase/inc/abstract.hxx
+++ b/sw/source/uibase/inc/abstract.hxx
@@ -20,7 +20,7 @@
#include <sfx2/basedlgs.hxx>
-class SwInsertAbstractDlg : public SfxDialogController
+class SwInsertAbstractDlg final : public SfxDialogController
{
std::unique_ptr<weld::SpinButton> m_xLevelNF;
std::unique_ptr<weld::SpinButton> m_xParaNF;
diff --git a/sw/source/uibase/inc/addrdlg.hxx b/sw/source/uibase/inc/addrdlg.hxx
index feb839afdd51..66706915aa6c 100644
--- a/sw/source/uibase/inc/addrdlg.hxx
+++ b/sw/source/uibase/inc/addrdlg.hxx
@@ -21,7 +21,7 @@
#include <sfx2/basedlgs.hxx>
-class SwAddrDlg : public SfxSingleTabDialogController
+class SwAddrDlg final : public SfxSingleTabDialogController
{
public:
SwAddrDlg(weld::Window* pParent, const SfxItemSet& rSet);
diff --git a/sw/source/uibase/inc/ascfldlg.hxx b/sw/source/uibase/inc/ascfldlg.hxx
index c50d51956cd7..f62e6574f2c8 100644
--- a/sw/source/uibase/inc/ascfldlg.hxx
+++ b/sw/source/uibase/inc/ascfldlg.hxx
@@ -28,7 +28,7 @@ class SwAsciiOptions;
class SvStream;
class SwDocShell;
-class SwAsciiFilterDlg : public SfxDialogController
+class SwAsciiFilterDlg final : public SfxDialogController
{
bool m_bSaveLineStatus;
OUString m_sExtraData;
@@ -44,7 +44,7 @@ class SwAsciiFilterDlg : public SfxDialogController
std::unique_ptr<weld::CheckButton> m_xIncludeBOM_CB;
DECL_LINK(CharSetSelHdl, weld::ComboBox&, void);
- DECL_LINK(LineEndHdl, weld::ToggleButton&, void);
+ DECL_LINK(LineEndHdl, weld::Toggleable&, void);
void SetCRLF(LineEnd eEnd);
LineEnd GetCRLF() const;
void SetIncludeBOM(bool bIncludeBOM);
diff --git a/sw/source/uibase/inc/autoformatpreview.hxx b/sw/source/uibase/inc/autoformatpreview.hxx
index 8617e35e02f8..f9825bc91951 100644
--- a/sw/source/uibase/inc/autoformatpreview.hxx
+++ b/sw/source/uibase/inc/autoformatpreview.hxx
@@ -31,7 +31,7 @@
#include "wrtsh.hxx"
#include <tblafmt.hxx>
-class AutoFormatPreview : public weld::CustomWidgetController
+class AutoFormatPreview final : public weld::CustomWidgetController
{
public:
AutoFormatPreview();
diff --git a/sw/source/uibase/inc/barcfg.hxx b/sw/source/uibase/inc/barcfg.hxx
index a980cbc064e9..f194c431ccd0 100644
--- a/sw/source/uibase/inc/barcfg.hxx
+++ b/sw/source/uibase/inc/barcfg.hxx
@@ -24,7 +24,7 @@
enum class SelectionType : sal_Int32;
-class SwToolbarConfigItem : public utl::ConfigItem
+class SwToolbarConfigItem final : public utl::ConfigItem
{
sal_Int32 aTbxIdArray[5];
diff --git a/sw/source/uibase/inc/bmpwin.hxx b/sw/source/uibase/inc/bmpwin.hxx
index 46d9544b7cbd..20d31100b83b 100644
--- a/sw/source/uibase/inc/bmpwin.hxx
+++ b/sw/source/uibase/inc/bmpwin.hxx
@@ -25,7 +25,7 @@
#include <vcl/graph.hxx>
// extended page for graphics
-class BmpWindow : public weld::CustomWidgetController
+class BmpWindow final : public weld::CustomWidgetController
{
private:
Graphic aGraphic;
diff --git a/sw/source/uibase/inc/bookctrl.hxx b/sw/source/uibase/inc/bookctrl.hxx
index f87395e516a3..3b064a1daa22 100644
--- a/sw/source/uibase/inc/bookctrl.hxx
+++ b/sw/source/uibase/inc/bookctrl.hxx
@@ -22,13 +22,13 @@
#include <rtl/ustring.hxx>
#include <sfx2/stbitem.hxx>
-class SwBookmarkControl : public SfxStatusBarControl
+class SwBookmarkControl final : public SfxStatusBarControl
{
virtual void Command(const CommandEvent& rCEvt) override;
public:
- virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
- const SfxPoolItem* pState) override;
+ virtual void StateChangedAtStatusBarControl(sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState) override;
virtual void Paint(const UserDrawEvent& rEvt) override;
SFX_DECL_STATUSBAR_CONTROL();
diff --git a/sw/source/uibase/inc/bookmark.hxx b/sw/source/uibase/inc/bookmark.hxx
index 85f67e9c2981..6441a5f16f63 100644
--- a/sw/source/uibase/inc/bookmark.hxx
+++ b/sw/source/uibase/inc/bookmark.hxx
@@ -60,7 +60,7 @@ public:
static const char cSeparator;
};
-class SwInsertBookmarkDlg : public SfxDialogController
+class SwInsertBookmarkDlg final : public SfxDialogController
{
SwWrtShell& rSh;
std::vector<std::pair<sw::mark::IMark*, OUString>> aTableBookmarks;
@@ -87,7 +87,7 @@ class SwInsertBookmarkDlg : public SfxDialogController
DECL_LINK(SelectionChangedHdl, weld::TreeView&, void);
DECL_LINK(DoubleClickHdl, weld::TreeView&, bool);
DECL_LINK(HeaderBarClick, int, void);
- DECL_LINK(ChangeHideHdl, weld::ToggleButton&, void);
+ DECL_LINK(ChangeHideHdl, weld::Toggleable&, void);
// Fill table with bookmarks
void PopulateTable();
diff --git a/sw/source/uibase/inc/break.hxx b/sw/source/uibase/inc/break.hxx
index 9de8a9f4a366..928761305027 100644
--- a/sw/source/uibase/inc/break.hxx
+++ b/sw/source/uibase/inc/break.hxx
@@ -25,7 +25,7 @@
class SwWrtShell;
-class SwBreakDlg : public weld::GenericDialogController
+class SwBreakDlg final : public weld::GenericDialogController
{
std::unique_ptr<weld::RadioButton> m_xLineBtn;
std::unique_ptr<weld::RadioButton> m_xColumnBtn;
@@ -43,9 +43,9 @@ class SwBreakDlg : public weld::GenericDialogController
bool bHtmlMode;
- DECL_LINK(ToggleHdl, weld::ToggleButton&, void);
+ DECL_LINK(ToggleHdl, weld::Toggleable&, void);
DECL_LINK(ChangeHdl, weld::ComboBox&, void);
- DECL_LINK(PageNumHdl, weld::ToggleButton&, void);
+ DECL_LINK(PageNumHdl, weld::Toggleable&, void);
DECL_LINK(PageNumModifyHdl, weld::SpinButton&, void);
DECL_LINK(OkHdl, weld::Button&, void);
diff --git a/sw/source/uibase/inc/cfgitems.hxx b/sw/source/uibase/inc/cfgitems.hxx
index 0aa6c2c8d135..34ffa2d24e12 100644
--- a/sw/source/uibase/inc/cfgitems.hxx
+++ b/sw/source/uibase/inc/cfgitems.hxx
@@ -38,7 +38,7 @@ class SwShdwCursorOptionsTabPage;
enum class SwFillMode;
/// Item for settings dialog - document view
-class SW_DLLPUBLIC SwDocDisplayItem : public SfxPoolItem
+class SW_DLLPUBLIC SwDocDisplayItem final : public SfxPoolItem
{
friend class SwShdwCursorOptionsTabPage;
friend class SwModule;
@@ -64,7 +64,7 @@ public:
// OS 12.01.95
// Item for settings dialog, element page
-class SW_DLLPUBLIC SwElemItem : public SfxPoolItem
+class SW_DLLPUBLIC SwElemItem final : public SfxPoolItem
{
//view
bool m_bVertRuler :1;
@@ -99,7 +99,7 @@ public:
// OS 12.01.95
// Item for settings dialog - printer/add-ons
-class SW_DLLPUBLIC SwAddPrinterItem : public SfxPoolItem, public SwPrintData
+class SW_DLLPUBLIC SwAddPrinterItem final : public SfxPoolItem, public SwPrintData
{
using SwPrintData::operator ==;
@@ -113,7 +113,7 @@ public:
};
/// Item for settings dialog, ShadowCursorPage
-class SW_DLLPUBLIC SwShadowCursorItem : public SfxPoolItem
+class SW_DLLPUBLIC SwShadowCursorItem final : public SfxPoolItem
{
SwFillMode m_eMode;
bool m_bOn;
@@ -136,7 +136,7 @@ public:
#ifdef DBG_UTIL
// Item for settings dialog - test settings
-class SW_DLLPUBLIC SwTestItem : public SfxPoolItem
+class SW_DLLPUBLIC SwTestItem final : public SfxPoolItem
{
friend class SwModule;
friend class SwTestTabPage;
diff --git a/sw/source/uibase/inc/changedb.hxx b/sw/source/uibase/inc/changedb.hxx
index a56144bd995d..a928a5d3074f 100644
--- a/sw/source/uibase/inc/changedb.hxx
+++ b/sw/source/uibase/inc/changedb.hxx
@@ -28,7 +28,7 @@ class SwWrtShell;
struct SwDBData;
// exchange database at fields
-class SwChangeDBDlg : public SfxDialogController
+class SwChangeDBDlg final : public SfxDialogController
{
SwWrtShell *pSh;
diff --git a/sw/source/uibase/inc/chrdlg.hxx b/sw/source/uibase/inc/chrdlg.hxx
index 09138b5ccb51..8527f15e2693 100644
--- a/sw/source/uibase/inc/chrdlg.hxx
+++ b/sw/source/uibase/inc/chrdlg.hxx
@@ -25,7 +25,7 @@
class SwView;
class SvxMacroItem;
-class SwCharDlg : public SfxTabDialogController
+class SwCharDlg final : public SfxTabDialogController
{
SwView& m_rView;
SwCharDlgMode m_nDialogMode;
@@ -39,7 +39,7 @@ public:
virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
};
-class SwCharURLPage : public SfxTabPage
+class SwCharURLPage final : public SfxTabPage
{
std::unique_ptr<SvxMacroItem> pINetItem;
bool bModified;
diff --git a/sw/source/uibase/inc/colex.hxx b/sw/source/uibase/inc/colex.hxx
index 41f7e4143a71..07c007465da2 100644
--- a/sw/source/uibase/inc/colex.hxx
+++ b/sw/source/uibase/inc/colex.hxx
@@ -42,10 +42,10 @@ public:
void UpdateExample( const SfxItemSet& rSet );
};
-class SW_DLLPUBLIC SwPageGridExample : public SwPageExample
+class SW_DLLPUBLIC SwPageGridExample final : public SwPageExample
{
std::unique_ptr<SwTextGridItem> pGridItem;
-protected:
+
virtual void DrawPage(vcl::RenderContext& rRenderContext,
const Point& rPoint,
const bool bSecond,
@@ -57,13 +57,12 @@ public:
};
-class SW_DLLPUBLIC SwColExample : public SwPageExample
+class SW_DLLPUBLIC SwColExample final : public SwPageExample
{
SwColMgr* pColMgr;
using SwPageExample::UpdateExample;
-protected:
virtual void DrawPage(vcl::RenderContext& rRenderContext,
const Point& rPoint,
const bool bSecond,
@@ -82,7 +81,7 @@ public:
}
};
-class SW_DLLPUBLIC SwColumnOnlyExample : public weld::CustomWidgetController
+class SW_DLLPUBLIC SwColumnOnlyExample final : public weld::CustomWidgetController
{
private:
Size m_aWinSize;
@@ -90,7 +89,6 @@ private:
Size m_aFrameSize;
SwFormatCol m_aCols;
-protected:
virtual void Resize() override;
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
diff --git a/sw/source/uibase/inc/column.hxx b/sw/source/uibase/inc/column.hxx
index 2d883c2b4d17..133757a77d52 100644
--- a/sw/source/uibase/inc/column.hxx
+++ b/sw/source/uibase/inc/column.hxx
@@ -33,7 +33,7 @@ class SwColMgr;
class SwWrtShell;
class SwColumnPage;
-class SwColumnDlg : public SfxDialogController
+class SwColumnDlg final : public SfxDialogController
{
SwWrtShell& m_rWrtShell;
std::unique_ptr<SwColumnPage> m_xTabPage;
@@ -81,7 +81,7 @@ public:
};
// column dialog now as TabPage
-class SwColumnPage : public SfxTabPage
+class SwColumnPage final : public SfxTabPage
{
std::unique_ptr<SwColMgr> m_xColMgr;
@@ -140,7 +140,7 @@ class SwColumnPage : public SfxTabPage
void ColModify(bool bForceColReset);
DECL_LINK(GapModify, weld::MetricSpinButton&, void);
DECL_LINK(EdModify, weld::MetricSpinButton&, void);
- DECL_LINK(AutoWidthHdl, weld::ToggleButton&, void );
+ DECL_LINK(AutoWidthHdl, weld::Toggleable&, void );
DECL_LINK(SetDefaultsHdl, ValueSet *, void);
DECL_LINK(Up, weld::Button&, void);
diff --git a/sw/source/uibase/inc/condedit.hxx b/sw/source/uibase/inc/condedit.hxx
index 1c4df0086b55..a4599508c000 100644
--- a/sw/source/uibase/inc/condedit.hxx
+++ b/sw/source/uibase/inc/condedit.hxx
@@ -25,7 +25,7 @@
class ConditionEdit;
-class SW_DLLPUBLIC ConditionEditDropTarget : public DropTargetHelper
+class SW_DLLPUBLIC ConditionEditDropTarget final : public DropTargetHelper
{
private:
ConditionEdit& m_rEdit;
diff --git a/sw/source/uibase/inc/content.hxx b/sw/source/uibase/inc/content.hxx
index 69f9696158ee..64b1e265f10b 100644
--- a/sw/source/uibase/inc/content.hxx
+++ b/sw/source/uibase/inc/content.hxx
@@ -152,7 +152,7 @@ public:
* GetMember. It is reloaded after Invalidate() only if the content
* should be read again.
*/
-class SwContentType : public SwTypeNumber
+class SwContentType final : public SwTypeNumber
{
SwWrtShell* m_pWrtShell;
std::unique_ptr<SwContentArr>
@@ -166,7 +166,7 @@ class SwContentType : public SwTypeNumber
bool m_bDataValid : 1;
bool m_bEdit: 1; // can this type be edited?
bool m_bDelete: 1; // can this type be deleted?
-protected:
+
static OUString RemoveNewline(const OUString&);
public:
SwContentType(SwWrtShell* pParent, ContentTypeId nType, sal_uInt8 nLevel );
diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx
index f572bc76a983..4ac942e9ecd7 100644
--- a/sw/source/uibase/inc/conttree.hxx
+++ b/sw/source/uibase/inc/conttree.hxx
@@ -71,7 +71,7 @@ namespace o3tl {
class SwContentTree;
-class SwContentTreeDropTarget : public DropTargetHelper
+class SwContentTreeDropTarget final : public DropTargetHelper
{
private:
SwContentTree& m_rTreeView;
@@ -270,7 +270,7 @@ namespace sfx2 { class FileDialogHelper; }
class SwGlobalTree;
-class SwGlobalTreeDropTarget : public DropTargetHelper
+class SwGlobalTreeDropTarget final : public DropTargetHelper
{
private:
SwGlobalTree& m_rTreeView;
diff --git a/sw/source/uibase/inc/convert.hxx b/sw/source/uibase/inc/convert.hxx
index cc7929e9fb64..fabfeca26a53 100644
--- a/sw/source/uibase/inc/convert.hxx
+++ b/sw/source/uibase/inc/convert.hxx
@@ -28,7 +28,7 @@ class SwView;
class SwWrtShell;
struct SwInsertTableOptions;
-class SwConvertTableDlg : public SfxDialogController
+class SwConvertTableDlg final : public SfxDialogController
{
std::unique_ptr<weld::RadioButton> m_xTabBtn;
std::unique_ptr<weld::RadioButton> m_xSemiBtn;
@@ -52,9 +52,9 @@ class SwConvertTableDlg : public SfxDialogController
SwWrtShell* pShell;
DECL_LINK(AutoFormatHdl, weld::Button&, void);
- DECL_LINK(BtnHdl, weld::Button&, void);
- DECL_LINK(CheckBoxHdl, weld::Button&, void);
- DECL_LINK(RepeatHeaderCheckBoxHdl, weld::Button&, void);
+ DECL_LINK(BtnHdl, weld::Toggleable&, void);
+ DECL_LINK(CheckBoxHdl, weld::Toggleable&, void);
+ DECL_LINK(RepeatHeaderCheckBoxHdl, weld::Toggleable&, void);
public:
SwConvertTableDlg(SwView& rView, bool bToTable);
diff --git a/sw/source/uibase/inc/cption.hxx b/sw/source/uibase/inc/cption.hxx
index b26a1fb2178f..b442857a44b8 100644
--- a/sw/source/uibase/inc/cption.hxx
+++ b/sw/source/uibase/inc/cption.hxx
@@ -29,7 +29,7 @@
class SwFieldMgr;
class SwView;
-class SwCaptionDialog : public SfxDialogController
+class SwCaptionDialog final : public SfxDialogController
{
OUString m_sNone;
TextFilterAutoConvert m_aTextFilter;
diff --git a/sw/source/uibase/inc/dbconfig.hxx b/sw/source/uibase/inc/dbconfig.hxx
index 5a611f5d8be0..a21319690a9a 100644
--- a/sw/source/uibase/inc/dbconfig.hxx
+++ b/sw/source/uibase/inc/dbconfig.hxx
@@ -24,7 +24,7 @@
struct SwDBData;
-class SW_DLLPUBLIC SwDBConfig : public utl::ConfigItem
+class SW_DLLPUBLIC SwDBConfig final : public utl::ConfigItem
{
private:
SAL_DLLPRIVATE static const css::uno::Sequence<OUString>& GetPropertyNames();
diff --git a/sw/source/uibase/inc/dbinsdlg.hxx b/sw/source/uibase/inc/dbinsdlg.hxx
index 0dc715d1c6fd..be1496229f91 100644
--- a/sw/source/uibase/inc/dbinsdlg.hxx
+++ b/sw/source/uibase/inc/dbinsdlg.hxx
@@ -76,7 +76,7 @@ class SwInsDBColumns : public o3tl::sorted_vector<std::unique_ptr<SwInsDBColumn>
{
};
-class SwInsertDBColAutoPilot : public SfxDialogController, public utl::ConfigItem
+class SwInsertDBColAutoPilot final : public SfxDialogController, public utl::ConfigItem
{
SwInsDBColumns aDBColumns;
const SwDBData aDBData;
@@ -123,15 +123,15 @@ class SwInsertDBColAutoPilot : public SfxDialogController, public utl::ConfigIte
std::unique_ptr<weld::Button> m_xPbTableFormat;
std::unique_ptr<weld::Button> m_xPbTableAutofmt;
- DECL_LINK( PageHdl, weld::Button&, void );
+ DECL_LINK( PageHdl, weld::Toggleable&, void );
DECL_LINK( AutoFormatHdl, weld::Button&, void );
DECL_LINK( TableFormatHdl, weld::Button&, void );
- DECL_LINK( DBFormatHdl, weld::Button&, void );
+ DECL_LINK( DBFormatHdl, weld::Toggleable&, void );
DECL_LINK( TableToFromHdl, weld::Button&, void );
DECL_LINK( TVSelectHdl, weld::TreeView&, void );
DECL_LINK( CBSelectHdl, weld::ComboBox&, void );
DECL_LINK( DblClickHdl, weld::TreeView&, bool );
- DECL_LINK( HeaderHdl, weld::Button&, void );
+ DECL_LINK( HeaderHdl, weld::Toggleable&, void );
bool SplitTextToColArr( const OUString& rText, DB_Columns& rColArr, bool bInsField );
virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
diff --git a/sw/source/uibase/inc/dbui.hxx b/sw/source/uibase/inc/dbui.hxx
index ea42bb44da13..b58b2abed951 100644
--- a/sw/source/uibase/inc/dbui.hxx
+++ b/sw/source/uibase/inc/dbui.hxx
@@ -23,7 +23,7 @@
#include <swdllapi.h>
-class PrintMonitor : public weld::GenericDialogController
+class PrintMonitor final : public weld::GenericDialogController
{
public:
std::unique_ptr<weld::Label> m_xDocName;
@@ -34,7 +34,7 @@ public:
virtual ~PrintMonitor() override;
};
-class SW_DLLPUBLIC SaveMonitor : public weld::GenericDialogController
+class SW_DLLPUBLIC SaveMonitor final : public weld::GenericDialogController
{
public:
std::unique_ptr<weld::Label> m_xDocName;
@@ -45,7 +45,7 @@ public:
virtual ~SaveMonitor() override;
};
-class CreateMonitor : public weld::GenericDialogController
+class CreateMonitor final : public weld::GenericDialogController
{
public:
CreateMonitor(weld::Window* pParent);
diff --git a/sw/source/uibase/inc/docfnote.hxx b/sw/source/uibase/inc/docfnote.hxx
index 6e232c85ac63..1719349ab5ef 100644
--- a/sw/source/uibase/inc/docfnote.hxx
+++ b/sw/source/uibase/inc/docfnote.hxx
@@ -23,7 +23,7 @@
class SwWrtShell;
-class SwFootNoteOptionDlg : public SfxTabDialogController
+class SwFootNoteOptionDlg final : public SfxTabDialogController
{
SwWrtShell& rSh;
diff --git a/sw/source/uibase/inc/drpcps.hxx b/sw/source/uibase/inc/drpcps.hxx
index 39479738cde8..d07746a0386a 100644
--- a/sw/source/uibase/inc/drpcps.hxx
+++ b/sw/source/uibase/inc/drpcps.hxx
@@ -28,7 +28,7 @@
class SwWrtShell;
-class SwDropCapsDlg : public SfxSingleTabDialogController
+class SwDropCapsDlg final : public SfxSingleTabDialogController
{
public:
SwDropCapsDlg(weld::Window *pParent, const SfxItemSet &rSet);
@@ -36,7 +36,7 @@ public:
class SwDropCapsPage;
-class SwDropCapsPict : public weld::CustomWidgetController
+class SwDropCapsPict final : public weld::CustomWidgetController
{
SwDropCapsPage* mpPage;
OUString maText;
@@ -107,7 +107,7 @@ public:
void DrawPrev(vcl::RenderContext& rRenderContext, const Point& rPt);
};
-class SwDropCapsPage : public SfxTabPage
+class SwDropCapsPage final : public SfxTabPage
{
friend class SwDropCapsPict;
SwDropCapsPict m_aPict;
@@ -137,12 +137,12 @@ friend class SwDropCapsPict;
void ModifyEntry(weld::Entry& rEdit);
- DECL_LINK(ClickHdl, weld::ToggleButton&, void);
+ DECL_LINK(ClickHdl, weld::Toggleable&, void);
DECL_LINK(MetricValueChangedHdl, weld::MetricSpinButton&, void);
DECL_LINK(ValueChangedHdl, weld::SpinButton&, void);
DECL_LINK(ModifyHdl, weld::Entry&, void);
DECL_LINK(SelectHdl, weld::ComboBox&, void);
- DECL_LINK(WholeWordHdl, weld::ToggleButton&, void);
+ DECL_LINK(WholeWordHdl, weld::Toggleable&, void);
static const sal_uInt16 aPageRg[];
diff --git a/sw/source/uibase/inc/dselect.hxx b/sw/source/uibase/inc/dselect.hxx
index e6002e1d6107..4f53feb31006 100644
--- a/sw/source/uibase/inc/dselect.hxx
+++ b/sw/source/uibase/inc/dselect.hxx
@@ -22,7 +22,7 @@
#include "drawbase.hxx"
// draw rectangle
-class DrawSelection : public SwDrawBase
+class DrawSelection final : public SwDrawBase
{
public:
DrawSelection(SwWrtShell* pSh, SwEditWin* pWin, SwView* pView);
diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx
index cb736bdf562f..44985f903c86 100644
--- a/sw/source/uibase/inc/edtwin.hxx
+++ b/sw/source/uibase/inc/edtwin.hxx
@@ -293,6 +293,7 @@ public:
const SwFrame* GetSavedOutlineFrame() const { return m_pSavedOutlineFrame; }
void SetSavedOutlineFrame(SwFrame* pFrame) { m_pSavedOutlineFrame = pFrame; }
+ void ToggleOutlineContentVisibility(const size_t nOutlinePos, const bool bSubs);
virtual FactoryFunction GetUITestFactory() const override;
};
diff --git a/sw/source/uibase/inc/envimg.hxx b/sw/source/uibase/inc/envimg.hxx
index b63d6b0a5d15..15c2560b9b00 100644
--- a/sw/source/uibase/inc/envimg.hxx
+++ b/sw/source/uibase/inc/envimg.hxx
@@ -35,7 +35,7 @@ enum SwEnvAlign
ENV_VER_RGHT
};
-class SW_DLLPUBLIC SwEnvItem : public SfxPoolItem
+class SW_DLLPUBLIC SwEnvItem final : public SfxPoolItem
{
public:
@@ -66,7 +66,7 @@ public:
virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
};
-class SwEnvCfgItem : public utl::ConfigItem
+class SwEnvCfgItem final : public utl::ConfigItem
{
private:
SwEnvItem m_aEnvItem;
diff --git a/sw/source/uibase/inc/envlop.hxx b/sw/source/uibase/inc/envlop.hxx
index a851aa3880e1..49a1d9429578 100644
--- a/sw/source/uibase/inc/envlop.hxx
+++ b/sw/source/uibase/inc/envlop.hxx
@@ -43,7 +43,7 @@ class SwEnvFormatPage;
class SwWrtShell;
class Printer;
-class SwEnvPreview : public weld::CustomWidgetController
+class SwEnvPreview final : public weld::CustomWidgetController
{
private:
SwEnvDlg* m_pDialog;
@@ -56,7 +56,7 @@ public:
void SetDialog(SwEnvDlg* pDialog) { m_pDialog = pDialog; }
};
-class SwEnvDlg : public SfxTabDialogController
+class SwEnvDlg final : public SfxTabDialogController
{
friend class SwEnvPage;
friend class SwEnvFormatPage;
@@ -80,7 +80,7 @@ public:
virtual ~SwEnvDlg() override;
};
-class SwEnvPage : public SfxTabPage
+class SwEnvPage final : public SfxTabPage
{
SwEnvDlg* m_pDialog;
SwWrtShell* m_pSh;
@@ -98,7 +98,7 @@ class SwEnvPage : public SfxTabPage
DECL_LINK(DatabaseHdl, weld::ComboBox&, void);
DECL_LINK(FieldHdl, weld::Button&, void);
- DECL_LINK(SenderHdl, weld::Button&, void);
+ DECL_LINK(SenderHdl, weld::Toggleable&, void);
void InitDatabaseBox();
diff --git a/sw/source/uibase/inc/fldedt.hxx b/sw/source/uibase/inc/fldedt.hxx
index 9f512ea3f7b8..ecb2ff04abf3 100644
--- a/sw/source/uibase/inc/fldedt.hxx
+++ b/sw/source/uibase/inc/fldedt.hxx
@@ -27,7 +27,7 @@ class SwView;
class SwWrtShell;
class SwFieldMgr;
-class SwFieldEditDlg : public SfxSingleTabDialogController
+class SwFieldEditDlg final : public SfxSingleTabDialogController
{
SwWrtShell* pSh;
std::unique_ptr<weld::Button> m_xPrevBT;
diff --git a/sw/source/uibase/inc/fldtdlg.hxx b/sw/source/uibase/inc/fldtdlg.hxx
index 8f690bb25f9e..b2cd767e41f1 100644
--- a/sw/source/uibase/inc/fldtdlg.hxx
+++ b/sw/source/uibase/inc/fldtdlg.hxx
@@ -22,7 +22,7 @@
#include <sal/config.h>
#include <string_view>
-
+#include <memory>
#include <sfx2/tabdlg.hxx>
class SfxBindings;
@@ -30,13 +30,14 @@ class SfxTabPage;
class SwChildWinWrapper;
struct SfxChildWinInfo;
-class SwFieldDlg : public SfxTabDialogController
+class SwFieldDlg final : public SfxTabDialogController
{
SwChildWinWrapper* m_pChildWin;
SfxBindings* m_pBindings;
bool m_bHtmlMode;
bool m_bDataBaseMode;
bool m_bClosing;
+ std::unique_ptr<SfxItemSet> mxInputItemSet;
virtual SfxItemSet* CreateInputItemSet(const OString& rId) override;
virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override;
diff --git a/sw/source/uibase/inc/fldwrap.hxx b/sw/source/uibase/inc/fldwrap.hxx
index 6532ff7db891..a0d0b9d9dfbc 100644
--- a/sw/source/uibase/inc/fldwrap.hxx
+++ b/sw/source/uibase/inc/fldwrap.hxx
@@ -26,7 +26,7 @@
#include "chldwrap.hxx"
class AbstractSwFieldDlg;
-class SwFieldDlgWrapper : public SwChildWinWrapper
+class SwFieldDlgWrapper final : public SwChildWinWrapper
{
ScopedVclPtr<AbstractSwFieldDlg> pDlgInterface;
public:
@@ -40,7 +40,7 @@ public:
};
// field dialog only showing database page to support mail merge
-class SwFieldDataOnlyDlgWrapper : public SwChildWinWrapper
+class SwFieldDataOnlyDlgWrapper final : public SwChildWinWrapper
{
ScopedVclPtr<AbstractSwFieldDlg> pDlgInterface;
public:
diff --git a/sw/source/uibase/inc/fontcfg.hxx b/sw/source/uibase/inc/fontcfg.hxx
index 388f16d81c2b..e752d90f08f6 100644
--- a/sw/source/uibase/inc/fontcfg.hxx
+++ b/sw/source/uibase/inc/fontcfg.hxx
@@ -52,7 +52,7 @@
#define FONTSIZE_CJK_DEFAULT 210
#define FONTSIZE_OUTLINE 280
-class SW_DLLPUBLIC SwStdFontConfig : public utl::ConfigItem
+class SW_DLLPUBLIC SwStdFontConfig final : public utl::ConfigItem
{
OUString sDefaultFonts[DEF_FONT_COUNT];
sal_Int32 nDefaultFontHeight[DEF_FONT_COUNT];
diff --git a/sw/source/uibase/inc/frmdlg.hxx b/sw/source/uibase/inc/frmdlg.hxx
index e3c079a2228f..87f03d8cc97a 100644
--- a/sw/source/uibase/inc/frmdlg.hxx
+++ b/sw/source/uibase/inc/frmdlg.hxx
@@ -26,7 +26,7 @@
class SwWrtShell;
// frame dialog
-class SwFrameDlg : public SfxTabDialogController
+class SwFrameDlg final : public SfxTabDialogController
{
bool m_bFormat;
bool m_bNew;
diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx
index 63d6e5bf1e78..a555440622ad 100644
--- a/sw/source/uibase/inc/frmpage.hxx
+++ b/sw/source/uibase/inc/frmpage.hxx
@@ -35,7 +35,7 @@ struct FrameMap;
struct SwPosition;
// frame dialog
-class SwFramePage: public SfxTabPage
+class SwFramePage final : public SfxTabPage
{
bool m_bAtHorzPosModified;
bool m_bAtVertPosModified;
@@ -126,9 +126,9 @@ class SwFramePage: public SfxTabPage
virtual void ActivatePage(const SfxItemSet& rSet) override;
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override;
- DECL_LINK(RangeModifyClickHdl, weld::ToggleButton&, void);
+ DECL_LINK(RangeModifyClickHdl, weld::Toggleable&, void);
void RangeModifyHdl();
- DECL_LINK(AnchorTypeHdl, weld::ToggleButton&, void);
+ DECL_LINK(AnchorTypeHdl, weld::Toggleable&, void);
DECL_LINK(PosHdl, weld::ComboBox&, void);
DECL_LINK(RelHdl, weld::ComboBox&, void);
void InitPos(RndStdIds eId, sal_Int16 nH, sal_Int16 nHRel,
@@ -136,11 +136,11 @@ class SwFramePage: public SfxTabPage
tools::Long nX, tools::Long nY);
DECL_LINK(RealSizeHdl, weld::Button&, void);
- DECL_LINK(RelSizeClickHdl, weld::ToggleButton&, void);
- DECL_LINK(MirrorHdl, weld::ToggleButton&, void);
+ DECL_LINK(RelSizeClickHdl, weld::Toggleable&, void);
+ DECL_LINK(MirrorHdl, weld::Toggleable&, void);
- DECL_LINK(AutoWidthClickHdl, weld::ToggleButton&, void);
- DECL_LINK(AutoHeightClickHdl, weld::ToggleButton&, void);
+ DECL_LINK(AutoWidthClickHdl, weld::Toggleable&, void);
+ DECL_LINK(AutoHeightClickHdl, weld::Toggleable&, void);
// update example
void UpdateExample();
@@ -192,7 +192,7 @@ public:
void EnableVerticalPositioning( bool bEnable );
};
-class SwGrfExtPage : public SfxTabPage
+class SwGrfExtPage final : public SfxTabPage
{
OUString aFilterName;
OUString aGrfName, aNewGrfName;
@@ -225,7 +225,7 @@ class SwGrfExtPage : public SfxTabPage
std::unique_ptr<weld::Label> m_xLabelGraphicType;
// handler for mirroring
- DECL_LINK(MirrorHdl, weld::ToggleButton&, void);
+ DECL_LINK(MirrorHdl, weld::Toggleable&, void);
DECL_LINK(BrowseHdl, weld::Button&, void);
virtual void ActivatePage(const SfxItemSet& rSet) override;
@@ -240,7 +240,7 @@ public:
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override;
};
-class SwFrameURLPage : public SfxTabPage
+class SwFrameURLPage final : public SfxTabPage
{
// hyperlink
std::unique_ptr<weld::Entry> m_xURLED;
@@ -264,7 +264,7 @@ public:
virtual void Reset(const SfxItemSet *rSet) override;
};
-class SwFrameAddPage : public SfxTabPage
+class SwFrameAddPage final : public SfxTabPage
{
SwWrtShell* m_pWrtSh;
diff --git a/sw/source/uibase/inc/gloslst.hxx b/sw/source/uibase/inc/gloslst.hxx
index 11192ecd6234..bd6954bfa2ff 100644
--- a/sw/source/uibase/inc/gloslst.hxx
+++ b/sw/source/uibase/inc/gloslst.hxx
@@ -44,7 +44,7 @@ struct AutoTextGroup
}
};
-class SwGlossaryList : public AutoTimer
+class SwGlossaryList final : public AutoTimer
{
std::vector<std::unique_ptr<AutoTextGroup>> aGroupArr;
OUString sPath;
diff --git a/sw/source/uibase/inc/glossary.hxx b/sw/source/uibase/inc/glossary.hxx
index 4ac5b6c8e4ec..ada07976450f 100644
--- a/sw/source/uibase/inc/glossary.hxx
+++ b/sw/source/uibase/inc/glossary.hxx
@@ -39,7 +39,7 @@ class SwOneExampleFrame;
const short RET_EDIT = 100;
-class SwGlossaryDlg : public SfxDialogController
+class SwGlossaryDlg final : public SfxDialogController
{
friend class SwNewGlosNameDlg;
@@ -84,11 +84,11 @@ class SwGlossaryDlg : public SfxDialogController
DECL_LINK( NameDoubleClick, weld::TreeView&, bool );
DECL_LINK( GrpSelect, weld::TreeView&, void );
DECL_LINK( MenuHdl, const OString&, void );
- DECL_LINK( EnableHdl, weld::ToggleButton&, void );
+ DECL_LINK( EnableHdl, weld::Toggleable&, void );
DECL_LINK( BibHdl, weld::Button&, void );
DECL_LINK( InsertHdl, weld::Button&, void );
DECL_LINK( PathHdl, weld::Button&, void );
- DECL_LINK( CheckBoxHdl, weld::ToggleButton&, void );
+ DECL_LINK( CheckBoxHdl, weld::Toggleable&, void );
DECL_LINK( PreviewLoadedHdl, SwOneExampleFrame&, void );
DECL_LINK( KeyInputHdl, const KeyEvent&, bool );
DECL_LINK( TextFilterHdl, OUString&, bool );
diff --git a/sw/source/uibase/inc/hyp.hxx b/sw/source/uibase/inc/hyp.hxx
index 9b2d26d1216e..acec1b25f163 100644
--- a/sw/source/uibase/inc/hyp.hxx
+++ b/sw/source/uibase/inc/hyp.hxx
@@ -26,7 +26,7 @@
class SwView;
-class SW_DLLPUBLIC SwHyphWrapper : public SvxSpellWrapper {
+class SW_DLLPUBLIC SwHyphWrapper final : public SvxSpellWrapper {
private:
SwView* pView;
sal_uInt16 nPageCount; // page count for progress view
@@ -35,7 +35,6 @@ private:
bool bAutomatic : 1; // insert separators without further inquiry
bool bInfoBox : 1; // display info-box when ending
-protected:
virtual void SpellStart( SvxSpellArea eSpell ) override;
virtual void SpellContinue() override;
virtual void SpellEnd( ) override;
diff --git a/sw/source/uibase/inc/inpdlg.hxx b/sw/source/uibase/inc/inpdlg.hxx
index f1dfc725dc33..c724e3b76bd6 100644
--- a/sw/source/uibase/inc/inpdlg.hxx
+++ b/sw/source/uibase/inc/inpdlg.hxx
@@ -29,7 +29,7 @@ class SwWrtShell;
class SwFieldMgr;
// insert fields
-class SwFieldInputDlg : public weld::GenericDialogController
+class SwFieldInputDlg final : public weld::GenericDialogController
{
void Apply();
diff --git a/sw/source/uibase/inc/inputwin.hxx b/sw/source/uibase/inc/inputwin.hxx
index f4cd41508572..6f2a47a31a30 100644
--- a/sw/source/uibase/inc/inputwin.hxx
+++ b/sw/source/uibase/inc/inputwin.hxx
@@ -189,7 +189,7 @@ public:
const SwView* GetView() const{return pView;}
};
-class SwInputChild : public SfxChildWindow
+class SwInputChild final : public SfxChildWindow
{
SfxDispatcher* pDispatch;
public:
diff --git a/sw/source/uibase/inc/insfnote.hxx b/sw/source/uibase/inc/insfnote.hxx
index 6ea4cc339108..396e87404644 100644
--- a/sw/source/uibase/inc/insfnote.hxx
+++ b/sw/source/uibase/inc/insfnote.hxx
@@ -25,7 +25,7 @@ class SwWrtShell;
class VclFrame;
-class SwInsFootNoteDlg: public weld::GenericDialogController
+class SwInsFootNoteDlg final : public weld::GenericDialogController
{
SwWrtShell &m_rSh;
@@ -49,9 +49,8 @@ class SwInsFootNoteDlg: public weld::GenericDialogController
std::unique_ptr<weld::Button> m_xPrevBT;
std::unique_ptr<weld::Button> m_xNextBT;
- DECL_LINK(NumberCharHdl, weld::Button&, void);
+ DECL_LINK(NumberToggleHdl, weld::Toggleable&, void);
DECL_LINK(NumberEditHdl, weld::Entry&, void);
- DECL_LINK(NumberAutoBtnHdl, weld::Button&, void);
DECL_LINK(NumberExtCharHdl, weld::Button&, void);
DECL_LINK(NextPrevHdl, weld::Button&, void);
diff --git a/sw/source/uibase/inc/instable.hxx b/sw/source/uibase/inc/instable.hxx
index 3070dcccbd54..cc3fd0204ccb 100644
--- a/sw/source/uibase/inc/instable.hxx
+++ b/sw/source/uibase/inc/instable.hxx
@@ -30,14 +30,15 @@
#include <view.hxx>
#include <tblafmt.hxx>
#include <itabenum.hxx>
+#include <memory>
-class SwInsTableDlg : public SfxDialogController
+class SwInsTableDlg final : public SfxDialogController
{
TextFilter m_aTextFilter;
SwWrtShell* pShell;
- SwTableAutoFormatTable* pTableTable;
- SwTableAutoFormat* pTAutoFormat;
+ std::unique_ptr<SwTableAutoFormatTable> m_xTableTable;
+ std::unique_ptr<SwTableAutoFormat> m_xTAutoFormat;
sal_uInt8 lbIndex;
sal_uInt8 tbIndex;
@@ -71,8 +72,8 @@ class SwInsTableDlg : public SfxDialogController
DECL_LINK(ModifyName, weld::Entry&, void);
DECL_LINK(ModifyRowCol, weld::Entry&, void);
DECL_LINK(OKHdl, weld::Button&, void);
- DECL_LINK(CheckBoxHdl, weld::ToggleButton&, void);
- DECL_LINK(RepeatHeaderCheckBoxHdl, weld::ToggleButton&, void);
+ DECL_LINK(CheckBoxHdl, weld::Toggleable&, void);
+ DECL_LINK(RepeatHeaderCheckBoxHdl, weld::Toggleable&, void);
DECL_LINK(ModifyRepeatHeaderNF_Hdl, weld::SpinButton&, void);
public:
diff --git a/sw/source/uibase/inc/javaedit.hxx b/sw/source/uibase/inc/javaedit.hxx
index ece6743377ac..0b4ca37cab07 100644
--- a/sw/source/uibase/inc/javaedit.hxx
+++ b/sw/source/uibase/inc/javaedit.hxx
@@ -26,7 +26,7 @@ class SwScriptField;
namespace sfx2 { class FileDialogHelper; }
-class SwJavaEditDialog : public weld::GenericDialogController
+class SwJavaEditDialog final : public weld::GenericDialogController
{
private:
OUString m_aText;
@@ -53,10 +53,11 @@ private:
DECL_LINK(OKHdl, weld::Button&, void);
DECL_LINK(PrevHdl, weld::Button&, void);
DECL_LINK(NextHdl, weld::Button&, void);
- DECL_LINK(RadioButtonHdl, weld::Button&, void);
+ DECL_LINK(RadioButtonHdl, weld::Toggleable&, void);
DECL_LINK(InsertFileHdl, weld::Button&, void);
DECL_LINK(DlgClosedHdl, sfx2::FileDialogHelper *, void);
+ void UpdateFromRadioButtons();
void CheckTravel();
void SetField();
diff --git a/sw/source/uibase/inc/label.hxx b/sw/source/uibase/inc/label.hxx
index a7a1c66412c6..5914423697d1 100644
--- a/sw/source/uibase/inc/label.hxx
+++ b/sw/source/uibase/inc/label.hxx
@@ -29,7 +29,7 @@ class SwLabPrtPage;
class SwDBManager;
class Printer;
-class SwLabDlg : public SfxTabDialogController
+class SwLabDlg final : public SfxTabDialogController
{
SwLabelConfig aLabelsCfg;
SwDBManager* pDBManager;
diff --git a/sw/source/uibase/inc/labelcfg.hxx b/sw/source/uibase/inc/labelcfg.hxx
index c206f67de809..2a88d590215e 100644
--- a/sw/source/uibase/inc/labelcfg.hxx
+++ b/sw/source/uibase/inc/labelcfg.hxx
@@ -32,7 +32,7 @@ struct SwLabelMeasure
bool m_bPredefined; // used to distinguish predefined from user-defined labels
};
-class SW_DLLPUBLIC SwLabelConfig : public utl::ConfigItem
+class SW_DLLPUBLIC SwLabelConfig final : public utl::ConfigItem
{
private:
std::vector<OUString> m_aManufacturers;
diff --git a/sw/source/uibase/inc/labimg.hxx b/sw/source/uibase/inc/labimg.hxx
index ec01bf38ffcc..47255d37c078 100644
--- a/sw/source/uibase/inc/labimg.hxx
+++ b/sw/source/uibase/inc/labimg.hxx
@@ -26,7 +26,7 @@
class SwLabCfgItem;
-class SW_DLLPUBLIC SwLabItem : public SfxPoolItem
+class SW_DLLPUBLIC SwLabItem final : public SfxPoolItem
{
public:
@@ -102,7 +102,7 @@ public:
OUString m_sGlossaryBlockName;
};
-class SwLabCfgItem : public utl::ConfigItem
+class SwLabCfgItem final : public utl::ConfigItem
{
private:
SwLabItem aItem;
diff --git a/sw/source/uibase/inc/linenum.hxx b/sw/source/uibase/inc/linenum.hxx
index 21f4d78864ca..eaed16129626 100644
--- a/sw/source/uibase/inc/linenum.hxx
+++ b/sw/source/uibase/inc/linenum.hxx
@@ -25,7 +25,7 @@
class SwView;
class SwWrtShell;
-class SwLineNumberingDlg : public SfxDialogController
+class SwLineNumberingDlg final : public SfxDialogController
{
private:
SwWrtShell* m_pSh;
@@ -48,7 +48,7 @@ private:
std::unique_ptr<weld::Widget> m_xNumIntervalFT;
std::unique_ptr<weld::Widget> m_xNumRowsFT;
DECL_LINK(OKHdl, weld::Button&, void);
- DECL_LINK(LineOnOffHdl, weld::Button&, void);
+ DECL_LINK(LineOnOffHdl, weld::Toggleable&, void);
DECL_LINK(ModifyHdl, weld::Entry&, void);
public:
diff --git a/sw/source/uibase/inc/mailconfigpage.hxx b/sw/source/uibase/inc/mailconfigpage.hxx
index be6dfe137c15..47c1f8bdaaa5 100644
--- a/sw/source/uibase/inc/mailconfigpage.hxx
+++ b/sw/source/uibase/inc/mailconfigpage.hxx
@@ -25,7 +25,7 @@
class SwTestAccountSettingsDialog;
class SwMailMergeConfigItem;
-class SwMailConfigPage : public SfxTabPage
+class SwMailConfigPage final : public SfxTabPage
{
friend class SwTestAccountSettingsDialog;
@@ -42,10 +42,10 @@ class SwMailConfigPage : public SfxTabPage
std::unique_ptr<weld::Button> m_xServerAuthenticationPB;
std::unique_ptr<weld::Button> m_xTestPB;
- DECL_LINK(ReplyToHdl, weld::ToggleButton&, void);
+ DECL_LINK(ReplyToHdl, weld::Toggleable&, void);
DECL_LINK(AuthenticationHdl, weld::Button&, void);
DECL_LINK(TestHdl, weld::Button&, void);
- DECL_LINK(SecureHdl, weld::ToggleButton&, void);
+ DECL_LINK(SecureHdl, weld::Toggleable&, void);
public:
SwMailConfigPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
@@ -58,7 +58,7 @@ public:
virtual void Reset( const SfxItemSet* rSet ) override;
};
-class SwMailConfigDlg : public SfxSingleTabDialogController
+class SwMailConfigDlg final : public SfxSingleTabDialogController
{
public:
SwMailConfigDlg(weld::Window* pParent, SfxItemSet& rSet);
diff --git a/sw/source/uibase/inc/maildispatcher.hxx b/sw/source/uibase/inc/maildispatcher.hxx
index e6f9f0cc7888..5fd862d36331 100644
--- a/sw/source/uibase/inc/maildispatcher.hxx
+++ b/sw/source/uibase/inc/maildispatcher.hxx
@@ -41,7 +41,8 @@ class IMailDispatcherListener;
must not be shared among different client threads. Instead each client
thread should create an own instance of this class.
*/
-class SW_DLLPUBLIC MailDispatcher : public salhelper::SimpleReferenceObject, private ::osl::Thread
+class SW_DLLPUBLIC MailDispatcher final : public salhelper::SimpleReferenceObject,
+ private ::osl::Thread
{
public:
// bringing operator new/delete into scope
@@ -130,15 +131,13 @@ public:
*/
void addListener(::rtl::Reference<IMailDispatcherListener> const& listener);
-protected:
+private:
virtual void SAL_CALL run() override;
virtual void SAL_CALL onTerminated() override;
-private:
std::vector<::rtl::Reference<IMailDispatcherListener>> cloneListener();
void sendMailMessageNotifyListener(css::uno::Reference<css::mail::XMailMessage> const& message);
-private:
css::uno::Reference<css::mail::XSmtpService> m_xMailserver;
std::list<css::uno::Reference<css::mail::XMailMessage>> m_aXMessageList;
std::vector<::rtl::Reference<IMailDispatcherListener>> m_aListenerVector;
diff --git a/sw/source/uibase/inc/mailmergehelper.hxx b/sw/source/uibase/inc/mailmergehelper.hxx
index 3b476a5245bf..60882df8aba5 100644
--- a/sw/source/uibase/inc/mailmergehelper.hxx
+++ b/sw/source/uibase/inc/mailmergehelper.hxx
@@ -56,7 +56,7 @@ struct SwAddressPreview_Impl;
// Preview window used to show the possible selection of address blocks
// and also the resulting address filled with database data
-class SW_DLLPUBLIC SwAddressPreview : public weld::CustomWidgetController
+class SW_DLLPUBLIC SwAddressPreview final : public weld::CustomWidgetController
{
std::unique_ptr<SwAddressPreview_Impl> pImpl;
std::unique_ptr<weld::ScrolledWindow> m_xVScrollBar;
@@ -133,7 +133,7 @@ public:
bool HasMore() const { return !sAddress.isEmpty(); }
};
-class SW_DLLPUBLIC SwAuthenticator :
+class SW_DLLPUBLIC SwAuthenticator final :
public cppu::WeakImplHelper<css::mail::XAuthenticator>
{
OUString m_aUserName;
@@ -155,7 +155,7 @@ public:
};
-class SW_DLLPUBLIC SwConnectionContext : public cppu::WeakImplHelper<css::uno::XCurrentContext>
+class SW_DLLPUBLIC SwConnectionContext final : public cppu::WeakImplHelper<css::uno::XCurrentContext>
{
OUString m_sMailServer;
sal_Int16 m_nPort;
@@ -174,7 +174,7 @@ public:
osl::Mutex m_aMutex;
};
-class SW_DLLPUBLIC SwConnectionListener :
+class SW_DLLPUBLIC SwConnectionListener final :
public SwMutexBase,
public cppu::WeakComponentImplHelper<css::mail::XConnectionListener>
{
@@ -193,7 +193,7 @@ public:
virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) override;
};
-class SW_DLLPUBLIC SwMailTransferable :
+class SW_DLLPUBLIC SwMailTransferable final :
public SwMutexBase,
public cppu::WeakComponentImplHelper<css::datatransfer::XTransferable, css::beans::XPropertySet>
{
@@ -228,7 +228,7 @@ class SW_DLLPUBLIC SwMailTransferable :
};
-class SW_DLLPUBLIC SwMailMessage :
+class SW_DLLPUBLIC SwMailMessage final :
public SwMutexBase,
public cppu::WeakComponentImplHelper<css::mail::XMailMessage>
{
diff --git a/sw/source/uibase/inc/mailmergewizard.hxx b/sw/source/uibase/inc/mailmergewizard.hxx
index 0ab3c8dce8aa..657341cf307c 100644
--- a/sw/source/uibase/inc/mailmergewizard.hxx
+++ b/sw/source/uibase/inc/mailmergewizard.hxx
@@ -34,7 +34,7 @@ using vcl::WizardTypes::CommitPageReason;
#define MM_GREETINGSPAGE 3
#define MM_LAYOUTPAGE 4
-class SwMailMergeWizard : public ::vcl::RoadmapWizardMachine
+class SwMailMergeWizard final : public ::vcl::RoadmapWizardMachine
{
SwView* m_pSwView;
OUString sDocumentURL;
@@ -53,7 +53,6 @@ class SwMailMergeWizard : public ::vcl::RoadmapWizardMachine
using vcl::WizardMachine::skipUntil;
-protected:
virtual std::unique_ptr<BuilderPage> createPage( WizardState _nState ) override;
virtual void enterState( WizardState _nState ) override;
diff --git a/sw/source/uibase/inc/mailmrge.hxx b/sw/source/uibase/inc/mailmrge.hxx
index f409c664ffe9..c141029e3122 100644
--- a/sw/source/uibase/inc/mailmrge.hxx
+++ b/sw/source/uibase/inc/mailmrge.hxx
@@ -41,7 +41,7 @@ namespace com::sun::star{
}
}
-class SwMailMergeDlg : public SfxDialogController
+class SwMailMergeDlg final : public SfxDialogController
{
friend class SwXSelChgLstnr_Impl;
@@ -103,10 +103,10 @@ class SwMailMergeDlg : public SfxDialogController
DECL_LINK( ButtonHdl, weld::Button&, void );
DECL_LINK( InsertPathHdl, weld::Button&, void );
- DECL_LINK( OutputTypeHdl, weld::ToggleButton&, void );
- DECL_LINK( FilenameHdl, weld::ToggleButton&, void );
+ DECL_LINK( OutputTypeHdl, weld::Toggleable&, void );
+ DECL_LINK( FilenameHdl, weld::Toggleable&, void );
DECL_LINK( ModifyHdl, weld::SpinButton&, void );
- DECL_LINK( SaveTypeHdl, weld::ToggleButton&, void );
+ DECL_LINK( SaveTypeHdl, weld::Toggleable&, void );
DECL_LINK( FileFormatHdl, weld::ComboBox&, void );
bool ExecQryShell();
@@ -137,7 +137,7 @@ public:
};
-class SwMailMergeCreateFromDlg : public weld::GenericDialogController
+class SwMailMergeCreateFromDlg final : public weld::GenericDialogController
{
std::unique_ptr<weld::RadioButton> m_xThisDocRB;
public:
@@ -149,7 +149,7 @@ public:
}
};
-class SwMailMergeFieldConnectionsDlg : public weld::GenericDialogController
+class SwMailMergeFieldConnectionsDlg final : public weld::GenericDialogController
{
std::unique_ptr<weld::RadioButton> m_xUseExistingRB;
public:
diff --git a/sw/source/uibase/inc/mergetbl.hxx b/sw/source/uibase/inc/mergetbl.hxx
index 765c3d603947..5b4ef970ef8a 100644
--- a/sw/source/uibase/inc/mergetbl.hxx
+++ b/sw/source/uibase/inc/mergetbl.hxx
@@ -21,7 +21,7 @@
#include <vcl/weld.hxx>
-class SwMergeTableDlg : public weld::GenericDialogController
+class SwMergeTableDlg final : public weld::GenericDialogController
{
bool& m_rMergePrev;
diff --git a/sw/source/uibase/inc/multmrk.hxx b/sw/source/uibase/inc/multmrk.hxx
index 5027e216e5e8..7e2fead65048 100644
--- a/sw/source/uibase/inc/multmrk.hxx
+++ b/sw/source/uibase/inc/multmrk.hxx
@@ -25,7 +25,7 @@
class SwTOXMgr;
// insert mark for index entry
-class SwMultiTOXMarkDlg : public weld::GenericDialogController
+class SwMultiTOXMarkDlg final : public weld::GenericDialogController
{
DECL_LINK(SelectHdl, weld::TreeView&, void);
SwTOXMgr& m_rMgr;
diff --git a/sw/source/uibase/inc/navicfg.hxx b/sw/source/uibase/inc/navicfg.hxx
index a9b562493623..43bf52b3d7ed 100644
--- a/sw/source/uibase/inc/navicfg.hxx
+++ b/sw/source/uibase/inc/navicfg.hxx
@@ -24,7 +24,7 @@
enum class RegionMode;
enum class ContentTypeId;
-class SwNavigationConfig : public utl::ConfigItem
+class SwNavigationConfig final : public utl::ConfigItem
{
ContentTypeId nRootType; //RootType
sal_Int32 nSelectedPos; //SelectedPosition
diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx
index c203284ca500..85eacaf826e5 100644
--- a/sw/source/uibase/inc/navipi.hxx
+++ b/sw/source/uibase/inc/navipi.hxx
@@ -39,7 +39,7 @@ class SfxObjectShellLock;
enum class RegionMode;
class SpinField;
-class SwNavigationPI : public PanelLayout
+class SwNavigationPI final : public PanelLayout
, public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
, public SfxListener
{
@@ -115,8 +115,6 @@ class SwNavigationPI : public PanelLayout
void UpdateInitShow();
-protected:
-
// release ObjectShellLock early enough for app end
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
diff --git a/sw/source/uibase/inc/num.hxx b/sw/source/uibase/inc/num.hxx
index 9d536066915c..781023f0a949 100644
--- a/sw/source/uibase/inc/num.hxx
+++ b/sw/source/uibase/inc/num.hxx
@@ -27,7 +27,7 @@ class SwWrtShell;
class SvxBrushItem;
class SwOutlineTabDialog;
-class SwNumPositionTabPage : public SfxTabPage
+class SwNumPositionTabPage final : public SfxTabPage
{
std::unique_ptr<SwNumRule> pActNum;
SwNumRule* pSaveNum;
@@ -79,7 +79,7 @@ class SwNumPositionTabPage : public SfxTabPage
DECL_LINK(LevelHdl, weld::TreeView&, void);
DECL_LINK(EditModifyHdl, weld::ComboBox&, void);
DECL_LINK(DistanceHdl, weld::MetricSpinButton&, void);
- DECL_LINK(RelativeHdl, weld::ToggleButton&, void);
+ DECL_LINK(RelativeHdl, weld::Toggleable&, void);
DECL_LINK(StandardHdl, weld::Button&, void);
void InitPosAndSpaceMode();
diff --git a/sw/source/uibase/inc/numfmtlb.hxx b/sw/source/uibase/inc/numfmtlb.hxx
index a5776659130a..437537307d7d 100644
--- a/sw/source/uibase/inc/numfmtlb.hxx
+++ b/sw/source/uibase/inc/numfmtlb.hxx
@@ -70,7 +70,7 @@ public:
virtual ~SwNumFormatBase() {}
};
-class SW_DLLPUBLIC NumFormatListBox : public SwNumFormatBase
+class SW_DLLPUBLIC NumFormatListBox final : public SwNumFormatBase
{
std::unique_ptr<weld::ComboBox> mxControl;
@@ -101,7 +101,7 @@ public:
void connect_changed(const Link<weld::ComboBox&, void>& rLink) { mxControl->connect_changed(rLink); }
};
-class SW_DLLPUBLIC SwNumFormatTreeView : public SwNumFormatBase
+class SW_DLLPUBLIC SwNumFormatTreeView final : public SwNumFormatBase
{
std::unique_ptr<weld::TreeView> mxControl;
diff --git a/sw/source/uibase/inc/numpara.hxx b/sw/source/uibase/inc/numpara.hxx
index 1589220e6b8b..db67c1358ab2 100644
--- a/sw/source/uibase/inc/numpara.hxx
+++ b/sw/source/uibase/inc/numpara.hxx
@@ -50,9 +50,9 @@ class SwParagraphNumTabPage final : public SfxTabPage
std::unique_ptr<weld::Widget> m_xRestartBX;
std::unique_ptr<weld::SpinButton> m_xRestartNF;
- DECL_LINK(NewStartHdl_Impl, weld::ToggleButton&, void);
+ DECL_LINK(NewStartHdl_Impl, weld::Toggleable&, void);
DECL_LINK(StyleHdl_Impl, weld::ComboBox&,void);
- DECL_LINK(LineCountHdl_Impl, weld::ToggleButton&, void);
+ DECL_LINK(LineCountHdl_Impl, weld::Toggleable&, void);
DECL_LINK(EditNumStyleHdl_Impl, weld::Button&, void);
DECL_LINK(EditNumStyleSelectHdl_Impl, weld::ComboBox&, void);
diff --git a/sw/source/uibase/inc/numprevw.hxx b/sw/source/uibase/inc/numprevw.hxx
index af86246d6a46..3c9059c06cec 100644
--- a/sw/source/uibase/inc/numprevw.hxx
+++ b/sw/source/uibase/inc/numprevw.hxx
@@ -25,7 +25,7 @@
class SwNumRule;
namespace rtl { class OUString; }
-class NumberingPreview : public weld::CustomWidgetController
+class NumberingPreview final : public weld::CustomWidgetController
{
const SwNumRule* pActNum;
vcl::Font aStdFont;
diff --git a/sw/source/uibase/inc/optcomp.hxx b/sw/source/uibase/inc/optcomp.hxx
index c6d907656e67..42ebc49d1c04 100644
--- a/sw/source/uibase/inc/optcomp.hxx
+++ b/sw/source/uibase/inc/optcomp.hxx
@@ -27,7 +27,7 @@
class SwWrtShell;
struct SwCompatibilityOptPage_Impl;
-class SwCompatibilityOptPage : public SfxTabPage
+class SwCompatibilityOptPage final : public SfxTabPage
{
private:
// config item
diff --git a/sw/source/uibase/inc/optload.hxx b/sw/source/uibase/inc/optload.hxx
index 0bb020800765..6dee914d89c8 100644
--- a/sw/source/uibase/inc/optload.hxx
+++ b/sw/source/uibase/inc/optload.hxx
@@ -40,7 +40,7 @@ public:
static FieldUnit GetValue(sal_uInt32 i);
};
-class TextFilterAutoConvert : public TextFilter
+class TextFilterAutoConvert final : public TextFilter
{
private:
OUString m_sLastGoodText;
@@ -53,7 +53,7 @@ public:
virtual OUString filter(const OUString &rText) override;
};
-class SwLoadOptPage : public SfxTabPage
+class SwLoadOptPage final : public SfxTabPage
{
private:
SwWrtShell* m_pWrtShell;
@@ -77,7 +77,7 @@ private:
std::unique_ptr<weld::SpinButton> m_xStandardizedPageSizeNF;
DECL_LINK(MetricHdl, weld::ComboBox&, void);
- DECL_LINK(StandardizedPageCountCheckHdl, weld::Button&, void);
+ DECL_LINK(StandardizedPageCountCheckHdl, weld::Toggleable&, void);
public:
SwLoadOptPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
@@ -90,13 +90,13 @@ public:
virtual void Reset( const SfxItemSet* rSet ) override;
};
-class SwCaptionOptDlg : public SfxSingleTabDialogController
+class SwCaptionOptDlg final : public SfxSingleTabDialogController
{
public:
SwCaptionOptDlg(weld::Window* pParent, const SfxItemSet& rSet);
};
-class SwCaptionPreview : public weld::CustomWidgetController
+class SwCaptionPreview final : public weld::CustomWidgetController
{
private:
OUString maText;
@@ -112,7 +112,7 @@ public:
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
};
-class SwCaptionOptPage : public SfxTabPage
+class SwCaptionOptPage final : public SfxTabPage
{
private:
OUString m_sSWTable;
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index eebacf51ef53..99e24ed7f487 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -33,7 +33,7 @@ class FontList;
// Tools->Options->Writer->View
// Tools->Options->Writer/Web->View
-class SwContentOptPage : public SfxTabPage
+class SwContentOptPage final : public SfxTabPage
{
std::unique_ptr<weld::CheckButton> m_xCrossCB;
@@ -61,8 +61,8 @@ class SwContentOptPage : public SfxTabPage
std::unique_ptr<weld::CheckButton> m_xFieldHiddenCB;
std::unique_ptr<weld::CheckButton> m_xFieldHiddenParaCB;
- DECL_LINK(VertRulerHdl, weld::ToggleButton&, void);
- DECL_LINK(ShowOutlineContentVisibilityButtonHdl, weld::ToggleButton&, void);
+ DECL_LINK(VertRulerHdl, weld::Toggleable&, void);
+ DECL_LINK(ShowOutlineContentVisibilityButtonHdl, weld::Toggleable&, void);
public:
SwContentOptPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
virtual ~SwContentOptPage() override;
@@ -74,7 +74,7 @@ public:
};
// TabPage printer settings additions
-class SwAddPrinterTabPage : public SfxTabPage
+class SwAddPrinterTabPage final : public SfxTabPage
{
OUString sNone;
bool bAttrModified;
@@ -104,7 +104,7 @@ class SwAddPrinterTabPage : public SfxTabPage
std::unique_ptr<weld::CheckButton> m_xPaperFromSetupCB;
std::unique_ptr<weld::ComboBox> m_xFaxLB;
- DECL_LINK(AutoClickHdl, weld::ToggleButton&, void);
+ DECL_LINK(AutoClickHdl, weld::Toggleable&, void);
DECL_LINK(SelectHdl, weld::ComboBox&, void);
public:
@@ -120,7 +120,7 @@ public:
virtual void PageCreated(const SfxAllItemSet& aSet) override;
};
-class SwStdFontTabPage : public SfxTabPage
+class SwStdFontTabPage final : public SfxTabPage
{
OUString m_sShellStd;
OUString m_sShellTitle;
@@ -181,7 +181,7 @@ public:
virtual void PageCreated(const SfxAllItemSet& aSet) override;
};
-class SwTableOptionsTabPage : public SfxTabPage
+class SwTableOptionsTabPage final : public SfxTabPage
{
SwWrtShell* m_pWrtShell;
bool m_bHTMLMode;
@@ -205,7 +205,7 @@ class SwTableOptionsTabPage : public SfxTabPage
std::unique_ptr<weld::RadioButton> m_xFixPropRB;
std::unique_ptr<weld::RadioButton> m_xVarRB;
- DECL_LINK(CheckBoxHdl, weld::Button&, void);
+ DECL_LINK(CheckBoxHdl, weld::Toggleable&, void);
public:
SwTableOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
@@ -221,7 +221,7 @@ public:
};
// TabPage for ShadowCursor
-class SwShdwCursorOptionsTabPage : public SfxTabPage
+class SwShdwCursorOptionsTabPage final : public SfxTabPage
{
SwWrtShell * m_pWrtShell;
@@ -262,7 +262,7 @@ public:
};
// mark preview
-class SwMarkPreview : public weld::CustomWidgetController
+class SwMarkPreview final : public weld::CustomWidgetController
{
Color m_aBgCol; // background
Color m_aTransCol; // transparency
@@ -292,7 +292,7 @@ public:
};
// redlining options
-class SwRedlineOptionsTabPage : public SfxTabPage
+class SwRedlineOptionsTabPage final : public SfxTabPage
{
std::unique_ptr<weld::ComboBox> m_xInsertLB;
std::unique_ptr<ColorListBox> m_xInsertColorLB;
@@ -336,7 +336,7 @@ public:
#ifdef DBG_UTIL
-class SwTestTabPage : public SfxTabPage
+class SwTestTabPage final : public SfxTabPage
{
public:
SwTestTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
@@ -362,11 +362,11 @@ private:
std::unique_ptr<weld::CheckButton> m_xTest10CBox;
void Init();
- DECL_LINK(AutoClickHdl, weld::Button&, void);
+ DECL_LINK(AutoClickHdl, weld::Toggleable&, void);
};
#endif // DBG_UTIL
-class SwCompareOptionsTabPage : public SfxTabPage
+class SwCompareOptionsTabPage final : public SfxTabPage
{
std::unique_ptr<weld::RadioButton> m_xAutoRB;
std::unique_ptr<weld::RadioButton> m_xWordRB;
@@ -376,8 +376,8 @@ class SwCompareOptionsTabPage : public SfxTabPage
std::unique_ptr<weld::SpinButton> m_xLenNF;
std::unique_ptr<weld::CheckButton> m_xStoreRsidCB;
- DECL_LINK(ComparisonHdl, weld::Button&, void);
- DECL_LINK(IgnoreHdl, weld::Button&, void);
+ DECL_LINK(ComparisonHdl, weld::Toggleable&, void);
+ DECL_LINK(IgnoreHdl, weld::Toggleable&, void);
public:
SwCompareOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
diff --git a/sw/source/uibase/inc/outline.hxx b/sw/source/uibase/inc/outline.hxx
index d1e1b2915b7d..6d9a23ab506a 100644
--- a/sw/source/uibase/inc/outline.hxx
+++ b/sw/source/uibase/inc/outline.hxx
@@ -45,7 +45,7 @@ class SwOutlineTabDialog final : public SfxTabDialogController
std::unique_ptr<weld::MenuButton> m_xMenuButton;
DECL_LINK(CancelHdl, weld::Button&, void);
- DECL_LINK(FormHdl, weld::ToggleButton&, void);
+ DECL_LINK(FormHdl, weld::Toggleable&, void);
DECL_LINK(MenuSelectHdl, const OString&, void);
virtual void PageCreated(const OString& rPageId, SfxTabPage& rPage) override;
@@ -63,7 +63,7 @@ public:
static void SetActNumLevel(sal_uInt16 nSet) {nNumLevel = nSet;}
};
-class SwOutlineSettingsTabPage : public SfxTabPage
+class SwOutlineSettingsTabPage final : public SfxTabPage
{
OUString aNoFormatName;
OUString aSaveCollNames[MAXLEVEL];
diff --git a/sw/source/uibase/inc/pattern.hxx b/sw/source/uibase/inc/pattern.hxx
index 4be18c6342a8..06bb5bb06e71 100644
--- a/sw/source/uibase/inc/pattern.hxx
+++ b/sw/source/uibase/inc/pattern.hxx
@@ -22,7 +22,7 @@
#include <sfx2/basedlgs.hxx>
-class SwBackgroundDlg : public SfxSingleTabDialogController
+class SwBackgroundDlg final : public SfxSingleTabDialogController
{
public:
SwBackgroundDlg(weld::Window* pParent, const SfxItemSet& rSet);
diff --git a/sw/source/uibase/inc/pgfnote.hxx b/sw/source/uibase/inc/pgfnote.hxx
index c67c2f6a5b62..6fc8196161b1 100644
--- a/sw/source/uibase/inc/pgfnote.hxx
+++ b/sw/source/uibase/inc/pgfnote.hxx
@@ -24,7 +24,7 @@
#include <svx/colorbox.hxx>
// footnote settings TabPage
-class SwFootNotePage: public SfxTabPage
+class SwFootNotePage final : public SfxTabPage
{
static const sal_uInt16 aPageRg[];
public:
@@ -52,8 +52,8 @@ private:
std::unique_ptr<weld::MetricSpinButton> m_xLineLengthEdit;
std::unique_ptr<weld::MetricSpinButton> m_xLineDistEdit;
- DECL_LINK(HeightPage, weld::ToggleButton&, void);
- DECL_LINK(HeightMetric, weld::ToggleButton&, void);
+ DECL_LINK(HeightPage, weld::Toggleable&, void);
+ DECL_LINK(HeightMetric, weld::Toggleable&, void);
DECL_LINK(HeightModify, weld::MetricSpinButton&, void);
DECL_LINK(LineWidthChanged_Impl, weld::MetricSpinButton&, void);
DECL_LINK(LineColorSelected_Impl, ColorListBox&, void);
diff --git a/sw/source/uibase/inc/pggrid.hxx b/sw/source/uibase/inc/pggrid.hxx
index a43aee7b4686..be53c1a6721a 100644
--- a/sw/source/uibase/inc/pggrid.hxx
+++ b/sw/source/uibase/inc/pggrid.hxx
@@ -26,7 +26,7 @@
#include <svx/colorbox.hxx>
// TabPage Format/(Styles/)Page/Text grid
-class SwTextGridPage: public SfxTabPage
+class SwTextGridPage final : public SfxTabPage
{
sal_Int32 m_nRubyUserValue;
bool m_bRubyUserValue;
@@ -65,12 +65,12 @@ class SwTextGridPage: public SfxTabPage
void GridModifyHdl();
- DECL_LINK(GridTypeHdl, weld::ToggleButton&, void);
+ DECL_LINK(GridTypeHdl, weld::Toggleable&, void);
DECL_LINK(CharorLineChangedHdl, weld::SpinButton&, void);
DECL_LINK(TextSizeChangedHdl, weld::MetricSpinButton&, void);
DECL_LINK(ColorModifyHdl, ColorListBox&, void);
- DECL_LINK(GridModifyClickHdl, weld::ToggleButton&, void);
- DECL_LINK(DisplayGridHdl, weld::ToggleButton&, void);
+ DECL_LINK(GridModifyClickHdl, weld::Toggleable&, void);
+ DECL_LINK(DisplayGridHdl, weld::Toggleable&, void);
public:
SwTextGridPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rSet);
diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx
index 6a2c898069f0..ec573024d206 100644
--- a/sw/source/uibase/inc/pview.hxx
+++ b/sw/source/uibase/inc/pview.hxx
@@ -43,7 +43,7 @@ class SvtAccessibilityOptions;
class SwPagePreviewLayout;
// Delete member <mnVirtPage> and its accessor
-class SAL_DLLPUBLIC_RTTI SwPagePreviewWin : public vcl::Window
+class SAL_DLLPUBLIC_RTTI SwPagePreviewWin final : public vcl::Window
{
SwViewShell* mpViewShell;
sal_uInt16 mnSttPage;
@@ -158,7 +158,7 @@ public:
/**
* View of a document
*/
-class SW_DLLPUBLIC SwPagePreview: public SfxViewShell
+class SW_DLLPUBLIC SwPagePreview final : public SfxViewShell
{
// ViewWindow and handle to core
// current dispatcher shell
@@ -217,7 +217,6 @@ class SW_DLLPUBLIC SwPagePreview: public SfxViewShell
SAL_DLLPRIVATE void ExecPgUpAndPgDown( const bool _bPgUp,
SfxRequest* _pReq );
-protected:
virtual void InnerResizePixel( const Point &rOfs, const Size &rSize, bool inplaceEditModeChange ) override;
virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ) override;
diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx
index 63cfca9d9409..0e38dd83764e 100644
--- a/sw/source/uibase/inc/redlndlg.hxx
+++ b/sw/source/uibase/inc/redlndlg.hxx
@@ -59,6 +59,9 @@ class SW_DLLPUBLIC SwRedlineAcceptDlg final
std::vector<std::unique_ptr<SwRedlineDataParent>> m_RedlineParents;
std::vector<std::unique_ptr<SwRedlineDataChild>>
m_RedlineChildren;
+ // purely here so we don't leak
+ std::vector<std::unique_ptr<RedlinData>>
+ m_RedlinData;
SwRedlineDataParentSortArr m_aUsedSeqNo;
Timer m_aSelectTimer;
OUString m_sInserted;
@@ -119,7 +122,7 @@ public:
void Activate();
};
-class SwModelessRedlineAcceptDlg : public SfxModelessDialogController
+class SwModelessRedlineAcceptDlg final : public SfxModelessDialogController
{
std::unique_ptr<weld::Container> m_xContentArea;
std::unique_ptr<SwRedlineAcceptDlg> m_xImplDlg;
@@ -134,7 +137,7 @@ public:
void Initialize(SfxChildWinInfo * pInfo);
};
-class SwRedlineAcceptChild : public SwChildWinWrapper
+class SwRedlineAcceptChild final : public SwChildWinWrapper
{
public:
SwRedlineAcceptChild(vcl::Window* ,
@@ -148,7 +151,7 @@ public:
};
/// Redline (Manage Changes) panel for the sidebar.
-class SwRedlineAcceptPanel : public PanelLayout, public SfxListener
+class SwRedlineAcceptPanel final : public PanelLayout, public SfxListener
{
std::unique_ptr<SwRedlineAcceptDlg> mpImplDlg;
std::unique_ptr<weld::Container> mxContentArea;
diff --git a/sw/source/uibase/inc/regionsw.hxx b/sw/source/uibase/inc/regionsw.hxx
index a16fc1b93f5e..b9e1165e3197 100644
--- a/sw/source/uibase/inc/regionsw.hxx
+++ b/sw/source/uibase/inc/regionsw.hxx
@@ -43,7 +43,7 @@ namespace sfx2
class SectRepr;
typedef std::map<size_t, std::unique_ptr<SectRepr>> SectReprs_t;
-class SwEditRegionDlg : public SfxDialogController
+class SwEditRegionDlg final : public SfxDialogController
{
bool m_bSubRegionsFilled;
@@ -88,23 +88,23 @@ class SwEditRegionDlg : public SfxDialogController
DECL_LINK( ConditionEditHdl, weld::Entry&, void );
void ChangePasswd(bool bChange);
- DECL_LINK( TogglePasswdHdl, weld::ToggleButton&, void );
+ DECL_LINK( TogglePasswdHdl, weld::Toggleable&, void );
DECL_LINK( ChangePasswdHdl, weld::Button&, void );
- DECL_LINK( ChangeProtectHdl, weld::ToggleButton&, void );
- DECL_LINK( ChangeHideHdl, weld::ToggleButton&, void );
+ DECL_LINK( ChangeProtectHdl, weld::Toggleable&, void );
+ DECL_LINK( ChangeHideHdl, weld::Toggleable&, void );
// #114856# edit in readonly sections
- DECL_LINK( ChangeEditInReadonlyHdl, weld::ToggleButton&, void );
+ DECL_LINK( ChangeEditInReadonlyHdl, weld::Toggleable&, void );
DECL_LINK( ChangeDismissHdl, weld::Button&, void);
- DECL_LINK( UseFileHdl, weld::ToggleButton&, void );
+ DECL_LINK( UseFileHdl, weld::Toggleable&, void );
DECL_LINK( FileSearchHdl, weld::Button&, void );
DECL_LINK( OptionsHdl, weld::Button&, void );
DECL_LINK( FileNameComboBoxHdl, weld::ComboBox&, void );
DECL_LINK( FileNameEntryHdl, weld::Entry&, void );
- DECL_LINK( DDEHdl, weld::ToggleButton&, void );
+ DECL_LINK( DDEHdl, weld::Toggleable&, void );
DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper*, void );
DECL_LINK( SubRegionEventHdl, weld::ComboBox&, void );
- bool CheckPasswd(weld::ToggleButton* pBox = nullptr);
+ bool CheckPasswd(weld::Toggleable* pBox = nullptr);
public:
SwEditRegionDlg(weld::Window* pParent, SwWrtShell& rWrtSh);
@@ -115,7 +115,7 @@ public:
};
// dialog "insert region"
-class SwInsertSectionTabPage : public SfxTabPage
+class SwInsertSectionTabPage final : public SfxTabPage
{
OUString m_sFileName;
OUString m_sFilterName;
@@ -145,14 +145,14 @@ class SwInsertSectionTabPage : public SfxTabPage
void ChangePasswd(bool bChange);
- DECL_LINK( ChangeHideHdl, weld::ToggleButton&, void );
- DECL_LINK( ChangeProtectHdl, weld::ToggleButton&, void );
+ DECL_LINK( ChangeHideHdl, weld::Toggleable&, void );
+ DECL_LINK( ChangeProtectHdl, weld::Toggleable&, void );
DECL_LINK( ChangePasswdHdl, weld::Button&, void );
- DECL_LINK( TogglePasswdHdl, weld::ToggleButton&, void );
+ DECL_LINK( TogglePasswdHdl, weld::Toggleable&, void );
DECL_LINK( NameEditHdl, weld::ComboBox&, void );
- DECL_LINK( UseFileHdl, weld::ToggleButton&, void );
+ DECL_LINK( UseFileHdl, weld::Toggleable&, void );
DECL_LINK( FileSearchHdl, weld::Button&, void );
- DECL_LINK( DDEHdl, weld::ToggleButton&, void );
+ DECL_LINK( DDEHdl, weld::Toggleable&, void );
DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper*, void );
public:
@@ -191,7 +191,7 @@ class SwSectionFootnoteEndTabPage : public SfxTabPage
std::unique_ptr<weld::Label> m_xEndSuffixFT;
std::unique_ptr<weld::Entry> m_xEndSuffixED;
- DECL_LINK(FootEndHdl, weld::ToggleButton&, void);
+ DECL_LINK(FootEndHdl, weld::Toggleable&, void);
void ResetState( bool bFootnote, const SwFormatFootnoteEndAtTextEnd& );
public:
@@ -205,7 +205,7 @@ public:
const SfxItemSet* rAttrSet);
};
-class SwSectionIndentTabPage : public SfxTabPage
+class SwSectionIndentTabPage final : public SfxTabPage
{
SvxParaPrevWindow m_aPreviewWin;
std::unique_ptr<weld::MetricSpinButton> m_xBeforeMF;
@@ -225,12 +225,11 @@ public:
void SetWrtShell(SwWrtShell const & rSh);
};
-class SwInsertSectionTabDialog : public SfxTabDialogController
+class SwInsertSectionTabDialog final : public SfxTabDialogController
{
SwWrtShell& rWrtSh;
std::unique_ptr<SwSectionData> m_pSectionData;
-protected:
virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
virtual short Ok() override;
public:
@@ -241,11 +240,10 @@ public:
SwSectionData * GetSectionData() { return m_pSectionData.get(); }
};
-class SwSectionPropertyTabDialog : public SfxTabDialogController
+class SwSectionPropertyTabDialog final : public SfxTabDialogController
{
SwWrtShell& rWrtSh;
-protected:
virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
public:
SwSectionPropertyTabDialog(weld::Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh);
diff --git a/sw/source/uibase/inc/rowht.hxx b/sw/source/uibase/inc/rowht.hxx
index f1d66dbab63f..659b9ac6331a 100644
--- a/sw/source/uibase/inc/rowht.hxx
+++ b/sw/source/uibase/inc/rowht.hxx
@@ -23,7 +23,7 @@
class SwWrtShell;
-class SwTableHeightDlg : public weld::GenericDialogController
+class SwTableHeightDlg final : public weld::GenericDialogController
{
SwWrtShell& m_rSh;
diff --git a/sw/source/uibase/inc/scroll.hxx b/sw/source/uibase/inc/scroll.hxx
index 883b896a2c63..6a532b0ed28d 100644
--- a/sw/source/uibase/inc/scroll.hxx
+++ b/sw/source/uibase/inc/scroll.hxx
@@ -20,7 +20,7 @@
#include <vcl/scrbar.hxx>
-class SwScrollbar: public ScrollBar
+class SwScrollbar final : public ScrollBar
{
Size aDocSz;
bool bHori :1; // horizontal = salTrue, otherwise vertical
diff --git a/sw/source/uibase/inc/splittbl.hxx b/sw/source/uibase/inc/splittbl.hxx
index 523632ef8045..99e61f7d4075 100644
--- a/sw/source/uibase/inc/splittbl.hxx
+++ b/sw/source/uibase/inc/splittbl.hxx
@@ -24,7 +24,7 @@
class SwWrtShell;
-class SwSplitTableDlg : public weld::GenericDialogController
+class SwSplitTableDlg final : public weld::GenericDialogController
{
private:
std::unique_ptr<weld::RadioButton> m_xHorzBox;
diff --git a/sw/source/uibase/inc/srcedtw.hxx b/sw/source/uibase/inc/srcedtw.hxx
index 2cdefb908f41..51457cd7c97f 100644
--- a/sw/source/uibase/inc/srcedtw.hxx
+++ b/sw/source/uibase/inc/srcedtw.hxx
@@ -35,11 +35,10 @@ class TextEngine;
class TextView;
class DataChangedEvent;
-class TextViewOutWin : public vcl::Window
+class TextViewOutWin final : public vcl::Window
{
TextView* pTextView;
-protected:
virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) override;
virtual void KeyInput( const KeyEvent& rKeyEvt ) override;
virtual void MouseMove( const MouseEvent& rMEvt ) override;
@@ -56,7 +55,7 @@ public:
};
-class SwSrcEditWindow : public vcl::Window, public SfxListener
+class SwSrcEditWindow final : public vcl::Window, public SfxListener
{
private:
class ChangesListener;
@@ -86,15 +85,12 @@ private:
void ImpDoHighlight( const OUString& rSource, sal_uInt16 nLineOff );
- using OutputDevice::SetFont;
void SetFont();
DECL_LINK( SyntaxTimerHdl, Timer *, void );
using Window::Invalidate;
-protected:
-
virtual void Resize() override;
virtual void DataChanged( const DataChangedEvent& ) override;
virtual void GetFocus() override;
diff --git a/sw/source/uibase/inc/srcview.hxx b/sw/source/uibase/inc/srcview.hxx
index a2e8277b9892..f58712b57e59 100644
--- a/sw/source/uibase/inc/srcview.hxx
+++ b/sw/source/uibase/inc/srcview.hxx
@@ -30,7 +30,7 @@ class SwDocShell;
class SvxSearchItem;
class SfxMedium;
-class SwSrcView: public SfxViewShell
+class SwSrcView final : public SfxViewShell
{
VclPtr<SwSrcEditWindow> aEditWin;
@@ -43,7 +43,6 @@ class SwSrcView: public SfxViewShell
// for read-only switching
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
-protected:
void StartSearchAndReplace(const SvxSearchItem& rItem,
bool bApi,
bool bRecursive = false);
diff --git a/sw/source/uibase/inc/srtdlg.hxx b/sw/source/uibase/inc/srtdlg.hxx
index e47a974e40ee..2b6a39092f5b 100644
--- a/sw/source/uibase/inc/srtdlg.hxx
+++ b/sw/source/uibase/inc/srtdlg.hxx
@@ -25,7 +25,7 @@
class SwWrtShell;
-class SwSortDlg : public weld::GenericDialogController
+class SwSortDlg final : public weld::GenericDialogController
{
weld::Window* m_pParent;
std::unique_ptr<weld::Label> m_xColLbl;
@@ -73,8 +73,8 @@ class SwSortDlg : public weld::GenericDialogController
void Apply();
sal_Unicode GetDelimChar() const;
- DECL_LINK(CheckHdl, weld::ToggleButton&, void);
- DECL_LINK(DelimHdl, weld::ToggleButton&, void);
+ DECL_LINK(CheckHdl, weld::Toggleable&, void);
+ DECL_LINK(DelimHdl, weld::Toggleable&, void);
DECL_LINK(LanguageListBoxHdl, weld::ComboBox&, void);
void LanguageHdl(weld::ComboBox const*);
DECL_LINK(DelimCharHdl, weld::Button&, void);
diff --git a/sw/source/uibase/inc/swdtflvr.hxx b/sw/source/uibase/inc/swdtflvr.hxx
index e4575ad4796e..7f410739f079 100644
--- a/sw/source/uibase/inc/swdtflvr.hxx
+++ b/sw/source/uibase/inc/swdtflvr.hxx
@@ -72,7 +72,7 @@ enum class PasteTableType
PASTE_TABLE // paste table as nested table
};
-class SW_DLLPUBLIC SwTransferable : public TransferableHelper
+class SW_DLLPUBLIC SwTransferable final : public TransferableHelper
{
friend class SwView_Impl;
SfxObjectShellLock m_aDocShellRef;
@@ -155,7 +155,6 @@ class SW_DLLPUBLIC SwTransferable : public TransferableHelper
SwTransferable( const SwTransferable& ) = delete;
SwTransferable& operator=( const SwTransferable& ) = delete;
-protected:
virtual void AddSupportedFormats() override;
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
virtual bool WriteObject( tools::SvRef<SotTempStream>& rxOStm,
diff --git a/sw/source/uibase/inc/swmodalredlineacceptdlg.hxx b/sw/source/uibase/inc/swmodalredlineacceptdlg.hxx
index 450380b33c2c..00d4e1e028f1 100644
--- a/sw/source/uibase/inc/swmodalredlineacceptdlg.hxx
+++ b/sw/source/uibase/inc/swmodalredlineacceptdlg.hxx
@@ -22,7 +22,7 @@
class SwRedlineAcceptDlg;
-class SwModalRedlineAcceptDlg : public SfxDialogController
+class SwModalRedlineAcceptDlg final : public SfxDialogController
{
std::unique_ptr<weld::Container> m_xContentArea;
std::unique_ptr<SwRedlineAcceptDlg> m_xImplDlg;
diff --git a/sw/source/uibase/inc/swrenamexnameddlg.hxx b/sw/source/uibase/inc/swrenamexnameddlg.hxx
index fee64c7d6681..bb8333d3fb7e 100644
--- a/sw/source/uibase/inc/swrenamexnameddlg.hxx
+++ b/sw/source/uibase/inc/swrenamexnameddlg.hxx
@@ -23,7 +23,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNamed.hpp>
-class SwRenameXNamedDlg : public weld::GenericDialogController
+class SwRenameXNamedDlg final : public weld::GenericDialogController
{
css::uno::Reference< css::container::XNamed > & xNamed;
css::uno::Reference< css::container::XNameAccess > & xNameAccess;
diff --git a/sw/source/uibase/inc/swuiccoll.hxx b/sw/source/uibase/inc/swuiccoll.hxx
index 86d24b9138c2..80adad95fe73 100644
--- a/sw/source/uibase/inc/swuiccoll.hxx
+++ b/sw/source/uibase/inc/swuiccoll.hxx
@@ -26,7 +26,7 @@
class SwWrtShell;
class SwFormat;
-class SwCondCollPage : public SfxTabPage
+class SwCondCollPage final : public SfxTabPage
{
std::vector<OUString> m_aStrArr;
diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx
index 16756594f82b..8d3fc168da2f 100644
--- a/sw/source/uibase/inc/swuicnttab.hxx
+++ b/sw/source/uibase/inc/swuicnttab.hxx
@@ -52,7 +52,7 @@ struct SwIndexSections_Impl
css::uno::Reference< css::text::XDocumentIndex > xDocumentIndex;
};
-class SwMultiTOXTabDialog : public SfxTabDialogController
+class SwMultiTOXTabDialog final : public SfxTabDialogController
{
std::unique_ptr<SwTOXMgr> m_pMgr;
SwWrtShell& m_rWrtShell;
@@ -84,7 +84,7 @@ class SwMultiTOXTabDialog : public SfxTabDialogController
std::unique_ptr<SwTOXDescription> CreateTOXDescFromTOXBase(const SwTOXBase*pCurTOX);
DECL_LINK(CreateExample_Hdl, SwOneExampleFrame&, void);
- DECL_LINK(ShowPreviewHdl, weld::ToggleButton&, void);
+ DECL_LINK(ShowPreviewHdl, weld::Toggleable&, void);
public:
SwMultiTOXTabDialog(weld::Widget* pParent, const SfxItemSet& rSet,
@@ -114,7 +114,7 @@ public:
static bool IsNoNum(SwWrtShell& rSh, const OUString& rName);
};
-class SwTOXSelectTabPage : public SfxTabPage
+class SwTOXSelectTabPage final : public SfxTabPage
{
std::unique_ptr<IndexEntryResource> pIndexRes;
@@ -190,12 +190,12 @@ class SwTOXSelectTabPage : public SfxTabPage
DECL_LINK(TOXTypeHdl, weld::ComboBox&, void );
DECL_LINK(AddStylesHdl, weld::Button&, void );
- DECL_LINK(MenuEnableHdl, weld::ToggleButton&, void);
+ DECL_LINK(MenuEnableHdl, weld::Toggleable&, void);
DECL_LINK(MenuExecuteHdl, const OString&, void);
DECL_LINK(LanguageListBoxHdl, weld::ComboBox&, void);
void LanguageHdl(const weld::ComboBox*);
- DECL_LINK(CheckBoxHdl, weld::ToggleButton&, void );
- DECL_LINK(RadioButtonHdl, weld::ToggleButton&, void);
+ DECL_LINK(CheckBoxHdl, weld::Toggleable&, void );
+ DECL_LINK(RadioButtonHdl, weld::Toggleable&, void);
DECL_LINK(ModifyEntryHdl, weld::Entry&, void);
DECL_LINK(ModifySpinHdl, weld::SpinButton&, void);
DECL_LINK(ModifyListBoxHdl, weld::ComboBox&, void);
@@ -301,7 +301,7 @@ private:
sal_uInt32 GetControlIndex(FormTokenType eType) const;
};
-class SwTOXEntryTabPage : public SfxTabPage
+class SwTOXEntryTabPage final : public SfxTabPage
{
OUString sDelimStr;
OUString sLevelStr;
@@ -364,12 +364,12 @@ class SwTOXEntryTabPage : public SfxTabPage
DECL_LINK(EditStyleHdl, weld::Button&, void);
DECL_LINK(InsertTokenHdl, weld::Button&, void);
DECL_LINK(LevelHdl, weld::TreeView&, void);
- DECL_LINK(AutoRightHdl, weld::ToggleButton&, void);
+ DECL_LINK(AutoRightHdl, weld::Toggleable&, void);
DECL_LINK(TokenSelectedHdl, SwFormToken&, void);
DECL_LINK(TabPosHdl, weld::MetricSpinButton&, void);
DECL_LINK(FillCharHdl, weld::ComboBox&, void);
DECL_LINK(RemoveInsertAuthHdl, weld::Button&, void);
- DECL_LINK(SortKeyHdl, weld::ToggleButton&, void);
+ DECL_LINK(SortKeyHdl, weld::Toggleable&, void);
DECL_LINK(ChapterInfoHdl, weld::ComboBox&, void);
DECL_LINK(ChapterInfoOutlineHdl, weld::SpinButton&, void);
DECL_LINK(NumberFormatHdl, weld::ComboBox&, void);
@@ -380,7 +380,7 @@ class SwTOXEntryTabPage : public SfxTabPage
void UpdateDescriptor();
DECL_LINK(ModifyHdl, LinkParamNone*, void);
void OnModify(bool bAllLevels);
- DECL_LINK(ModifyClickHdl, weld::ToggleButton&, void);
+ DECL_LINK(ModifyClickHdl, weld::Toggleable&, void);
public:
SwTOXEntryTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rAttrSet);
@@ -399,7 +399,7 @@ public:
void SetFocus2theAllBtn();
};
-class SwTOXStylesTabPage : public SfxTabPage
+class SwTOXStylesTabPage final : public SfxTabPage
{
std::unique_ptr<SwForm> m_pCurrentForm;
diff --git a/sw/source/uibase/inc/swuiidxmrk.hxx b/sw/source/uibase/inc/swuiidxmrk.hxx
index ee738021fc13..1c4a38e0fcf3 100644
--- a/sw/source/uibase/inc/swuiidxmrk.hxx
+++ b/sw/source/uibase/inc/swuiidxmrk.hxx
@@ -106,7 +106,7 @@ class SwIndexMarkPane
void ModifyHdl(const weld::Widget& rWidget);
DECL_LINK( KeyDCBModifyHdl, weld::ComboBox&, void );
DECL_LINK( NewUserIdxHdl, weld::Button&, void );
- DECL_LINK( SearchTypeHdl, weld::ToggleButton&, void );
+ DECL_LINK( SearchTypeHdl, weld::Toggleable&, void );
DECL_LINK( PhoneticEDModifyHdl, weld::Entry&, void );
//this method updates the values from 'nLangForPhoneticReading' and 'bIsPhoneticReadingEnabled'
@@ -133,7 +133,7 @@ public:
bool IsTOXType(const OUString& rName) { return m_xTypeDCB->find_text(rName) != -1; }
};
-class SwIndexMarkFloatDlg : public SfxModelessDialogController
+class SwIndexMarkFloatDlg final : public SfxModelessDialogController
{
SwIndexMarkPane m_aContent;
@@ -147,7 +147,7 @@ public:
void ReInitDlg(SwWrtShell& rWrtShell);
};
-class SwIndexMarkModalDlg : public SfxDialogController
+class SwIndexMarkModalDlg final : public SfxDialogController
{
SwIndexMarkPane m_aContent;
public:
@@ -194,7 +194,7 @@ class SwAuthorMarkPane
DECL_LINK(CloseHdl, weld::Button&, void);
DECL_LINK(CreateEntryHdl, weld::Button&, void);
DECL_LINK(CompEntryHdl, weld::ComboBox&, void);
- DECL_LINK(ChangeSourceHdl, weld::ToggleButton&, void);
+ DECL_LINK(ChangeSourceHdl, weld::Toggleable&, void);
DECL_LINK(IsEditAllowedHdl, weld::Entry&, bool);
DECL_LINK(IsEntryAllowedHdl, weld::Entry&, bool);
DECL_LINK(EditModifyHdl, weld::Entry&, void);
@@ -207,7 +207,7 @@ public:
void ReInitDlg(SwWrtShell& rWrtShell);
};
-class SwAuthMarkFloatDlg : public SfxModelessDialogController
+class SwAuthMarkFloatDlg final : public SfxModelessDialogController
{
SwAuthorMarkPane m_aContent;
virtual void Activate() override;
@@ -220,7 +220,7 @@ public:
void ReInitDlg(SwWrtShell& rWrtShell);
};
-class SwAuthMarkModalDlg : public SfxDialogController
+class SwAuthMarkModalDlg final : public SfxDialogController
{
SwAuthorMarkPane m_aContent;
diff --git a/sw/source/uibase/inc/swuipardlg.hxx b/sw/source/uibase/inc/swuipardlg.hxx
index bd282a470b20..de5e83828a91 100644
--- a/sw/source/uibase/inc/swuipardlg.hxx
+++ b/sw/source/uibase/inc/swuipardlg.hxx
@@ -23,7 +23,7 @@
#include <sfx2/tabdlg.hxx>
-class SwParaDlg: public SfxTabDialogController
+class SwParaDlg final : public SfxTabDialogController
{
SwView& rView;
bool bDrawParaDlg;
diff --git a/sw/source/uibase/inc/swwrtshitem.hxx b/sw/source/uibase/inc/swwrtshitem.hxx
index 45be074db906..cae378413ded 100644
--- a/sw/source/uibase/inc/swwrtshitem.hxx
+++ b/sw/source/uibase/inc/swwrtshitem.hxx
@@ -23,7 +23,7 @@
class SwWrtShell;
-class SW_DLLPUBLIC SwWrtShellItem: public SfxPoolItem
+class SW_DLLPUBLIC SwWrtShellItem final : public SfxPoolItem
{
SwWrtShell* pWrtSh;
diff --git a/sw/source/uibase/inc/syncbtn.hxx b/sw/source/uibase/inc/syncbtn.hxx
index 43ae7ac43f34..e100edc2eff1 100644
--- a/sw/source/uibase/inc/syncbtn.hxx
+++ b/sw/source/uibase/inc/syncbtn.hxx
@@ -22,7 +22,7 @@
#include <sfx2/basedlgs.hxx>
#include <sfx2/childwin.hxx>
-class SwSyncBtnDlg : public SfxModelessDialogController
+class SwSyncBtnDlg final : public SfxModelessDialogController
{
std::unique_ptr<weld::Button> m_xSyncBtn;
@@ -33,7 +33,7 @@ public:
virtual ~SwSyncBtnDlg() override;
};
-class SwSyncChildWin : public SfxChildWindow
+class SwSyncChildWin final : public SfxChildWindow
{
public:
SwSyncChildWin(vcl::Window*,
diff --git a/sw/source/uibase/inc/tabledlg.hxx b/sw/source/uibase/inc/tabledlg.hxx
index 1b0dd0917b18..0edb8efed3cb 100644
--- a/sw/source/uibase/inc/tabledlg.hxx
+++ b/sw/source/uibase/inc/tabledlg.hxx
@@ -25,7 +25,7 @@ class SwWrtShell;
struct TColumn;
// table dialog
-class SwTableTabDlg : public SfxTabDialogController
+class SwTableTabDlg final : public SfxTabDialogController
{
SwWrtShell* pShell;
diff --git a/sw/source/uibase/inc/tautofmt.hxx b/sw/source/uibase/inc/tautofmt.hxx
index 8438e5701049..4c03bd981d92 100644
--- a/sw/source/uibase/inc/tautofmt.hxx
+++ b/sw/source/uibase/inc/tautofmt.hxx
@@ -33,7 +33,7 @@ class SwTableAutoFormat;
class SwTableAutoFormatTable;
class SwWrtShell;
-class SwAutoFormatDlg : public SfxDialogController
+class SwAutoFormatDlg final : public SfxDialogController
{
OUString m_aStrTitle;
OUString m_aStrLabel;
@@ -67,7 +67,7 @@ class SwAutoFormatDlg : public SfxDialogController
void Init( const SwTableAutoFormat* pSelFormat );
void UpdateChecks( const SwTableAutoFormat&, bool bEnableBtn );
- DECL_LINK(CheckHdl, weld::ToggleButton&, void);
+ DECL_LINK(CheckHdl, weld::Toggleable&, void);
DECL_LINK(AddHdl, weld::Button&, void);
DECL_LINK(RemoveHdl, weld::Button&, void);
DECL_LINK(RenameHdl, weld::Button&, void);
diff --git a/sw/source/uibase/inc/tblnumfm.hxx b/sw/source/uibase/inc/tblnumfm.hxx
index 3d0eee08c6ea..8e0f32f3eabb 100644
--- a/sw/source/uibase/inc/tblnumfm.hxx
+++ b/sw/source/uibase/inc/tblnumfm.hxx
@@ -27,7 +27,7 @@ class Window;
}
class SfxItemSet;
-class SwNumFormatDlg : public SfxSingleTabDialogController
+class SwNumFormatDlg final : public SfxSingleTabDialogController
{
public:
SwNumFormatDlg(weld::Widget* pParent, const SfxItemSet& rSet);
diff --git a/sw/source/uibase/inc/titlepage.hxx b/sw/source/uibase/inc/titlepage.hxx
index f6b1456a01a0..35a97c13041f 100644
--- a/sw/source/uibase/inc/titlepage.hxx
+++ b/sw/source/uibase/inc/titlepage.hxx
@@ -21,7 +21,7 @@ class Window;
class SwWrtShell;
class SwPageDesc;
-class SwTitlePageDlg : public SfxDialogController
+class SwTitlePageDlg final : public SfxDialogController
{
private:
SwWrtShell& mrSh;
@@ -51,10 +51,10 @@ private:
DECL_LINK(OKHdl, weld::Button&, void);
DECL_LINK(EditHdl, weld::Button&, void);
- DECL_LINK(RestartNumberingHdl, weld::ToggleButton&, void);
- DECL_LINK(SetPageNumberHdl, weld::ToggleButton&, void);
+ DECL_LINK(RestartNumberingHdl, weld::Toggleable&, void);
+ DECL_LINK(SetPageNumberHdl, weld::Toggleable&, void);
DECL_LINK(ValueChangeHdl, weld::SpinButton&, void);
- DECL_LINK(StartPageHdl, weld::ToggleButton&, void);
+ DECL_LINK(StartPageHdl, weld::Toggleable&, void);
public:
SwTitlePageDlg(weld::Window* pParent);
diff --git a/sw/source/uibase/inc/tmpdlg.hxx b/sw/source/uibase/inc/tmpdlg.hxx
index 95682aaa07e5..e77b928bff19 100644
--- a/sw/source/uibase/inc/tmpdlg.hxx
+++ b/sw/source/uibase/inc/tmpdlg.hxx
@@ -26,7 +26,7 @@ class SfxItemSet;
class SwWrtShell;
// the tab dialog carrier of TabPages
-class SwTemplateDlgController : public SfxStyleDialogController
+class SwTemplateDlgController final : public SfxStyleDialogController
{
SfxStyleFamily nType;
diff --git a/sw/source/uibase/inc/tmplctrl.hxx b/sw/source/uibase/inc/tmplctrl.hxx
index cf089fae618d..df8ed5170b04 100644
--- a/sw/source/uibase/inc/tmplctrl.hxx
+++ b/sw/source/uibase/inc/tmplctrl.hxx
@@ -21,14 +21,13 @@
#include <sfx2/stbitem.hxx>
-class SwTemplateControl : public SfxStatusBarControl
+class SwTemplateControl final : public SfxStatusBarControl
{
-protected:
virtual void Command(const CommandEvent& rCEvt) override;
public:
- virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
- const SfxPoolItem* pState) override;
+ virtual void StateChangedAtStatusBarControl(sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState) override;
virtual void Paint(const UserDrawEvent& rEvt) override;
SFX_DECL_STATUSBAR_CONTROL();
diff --git a/sw/source/uibase/inc/uiborder.hxx b/sw/source/uibase/inc/uiborder.hxx
index 8820a769b5c9..e0b98570dc26 100644
--- a/sw/source/uibase/inc/uiborder.hxx
+++ b/sw/source/uibase/inc/uiborder.hxx
@@ -22,7 +22,7 @@
#include <sfx2/basedlgs.hxx>
#include <svx/flagsdef.hxx>
-class SwBorderDlg : public SfxSingleTabDialogController
+class SwBorderDlg final : public SfxSingleTabDialogController
{
public:
// nType may be:
diff --git a/sw/source/uibase/inc/uiitems.hxx b/sw/source/uibase/inc/uiitems.hxx
index 629013cf32b8..c108c9e915c3 100644
--- a/sw/source/uibase/inc/uiitems.hxx
+++ b/sw/source/uibase/inc/uiitems.hxx
@@ -29,7 +29,7 @@ class IntlWrapper;
class SwPaM;
// container for FootNote
-class SW_DLLPUBLIC SwPageFootnoteInfoItem : public SfxPoolItem
+class SW_DLLPUBLIC SwPageFootnoteInfoItem final : public SfxPoolItem
{
SwPageFootnoteInfo aFootnoteInfo;
@@ -58,7 +58,7 @@ public:
const SwPageFootnoteInfo& GetPageFootnoteInfo() const { return aFootnoteInfo; }
};
-class SW_DLLPUBLIC SwPtrItem : public SfxPoolItem
+class SW_DLLPUBLIC SwPtrItem final : public SfxPoolItem
{
void* pMisc;
@@ -71,7 +71,7 @@ public:
void* GetValue() const { return pMisc; }
};
-class SW_DLLPUBLIC SwUINumRuleItem : public SfxPoolItem
+class SW_DLLPUBLIC SwUINumRuleItem final : public SfxPoolItem
{
std::unique_ptr<SwNumRule> pRule;
@@ -90,7 +90,7 @@ public:
SwNumRule* GetNumRule() { return pRule.get(); }
};
-class SwPaMItem : public SfxPoolItem
+class SwPaMItem final : public SfxPoolItem
{
SwPaM* m_pPaM;
diff --git a/sw/source/uibase/inc/uiobject.hxx b/sw/source/uibase/inc/uiobject.hxx
index 7f6ff239be6b..248654023e32 100644
--- a/sw/source/uibase/inc/uiobject.hxx
+++ b/sw/source/uibase/inc/uiobject.hxx
@@ -19,7 +19,7 @@
#include <AnnotationWin.hxx>
-class SwEditWinUIObject : public WindowUIObject
+class SwEditWinUIObject final : public WindowUIObject
{
public:
@@ -32,8 +32,6 @@ public:
static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
-protected:
-
virtual OUString get_name() const override;
private:
@@ -43,7 +41,7 @@ private:
};
// This class handles the Comments as a UIObject to be used in UITest Framework
-class CommentUIObject : public WindowUIObject
+class CommentUIObject final : public WindowUIObject
{
VclPtr<sw::annotation::SwAnnotationWin> mxCommentUIObject;
@@ -58,13 +56,13 @@ public:
static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
-protected:
+private:
OUString get_name() const override;
};
-class PageBreakUIObject : public WindowUIObject
+class PageBreakUIObject final : public WindowUIObject
{
public:
@@ -75,12 +73,10 @@ public:
static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
-protected:
+private:
virtual OUString get_name() const override;
-private:
-
VclPtr<SwPageBreakWin> mxPageBreakUIObject;
};
diff --git a/sw/source/uibase/inc/uivwimp.hxx b/sw/source/uibase/inc/uivwimp.hxx
index ae9f3d7b3693..1b407b73e2dd 100644
--- a/sw/source/uibase/inc/uivwimp.hxx
+++ b/sw/source/uibase/inc/uivwimp.hxx
@@ -42,7 +42,7 @@ namespace com::sun::star {
}
}
-class SwScannerEventListener : public ::cppu::WeakImplHelper<
+class SwScannerEventListener final : public ::cppu::WeakImplHelper<
css::lang::XEventListener >
{
SwView* pView;
@@ -60,7 +60,7 @@ public:
};
// Clipboard EventListener
-class SwClipboardChangeListener : public ::cppu::WeakImplHelper<
+class SwClipboardChangeListener final : public ::cppu::WeakImplHelper<
css::datatransfer::clipboard::XClipboardListener >
{
SwView* pView;
diff --git a/sw/source/uibase/inc/unoatxt.hxx b/sw/source/uibase/inc/unoatxt.hxx
index dba379b2c43e..376b1dced7c5 100644
--- a/sw/source/uibase/inc/unoatxt.hxx
+++ b/sw/source/uibase/inc/unoatxt.hxx
@@ -48,7 +48,7 @@ class SwXBodyText;
typedef tools::SvRef<SwDocShell> SwDocShellRef;
#endif
-class SwXAutoTextContainer : public cppu::WeakImplHelper
+class SwXAutoTextContainer final : public cppu::WeakImplHelper
<
css::text::XAutoTextContainer2,
css::lang::XServiceInfo
@@ -56,7 +56,6 @@ class SwXAutoTextContainer : public cppu::WeakImplHelper
{
SwGlossaries *pGlossaries;
-protected:
virtual ~SwXAutoTextContainer() override; // ref-counted objects are not to be deleted from outside -> protected dtor
public:
@@ -86,7 +85,7 @@ public:
};
-class SwXAutoTextGroup : public cppu::WeakImplHelper
+class SwXAutoTextGroup final : public cppu::WeakImplHelper
<
css::text::XAutoTextGroup,
css::beans::XPropertySet,
@@ -101,7 +100,6 @@ class SwXAutoTextGroup : public cppu::WeakImplHelper
OUString sName;
OUString m_sGroupName; // prefix m_ to disambiguate from some local vars in the implementation
-protected:
virtual ~SwXAutoTextGroup() override; // ref-counted objects are not to be deleted from outside -> protected dtor
public:
@@ -239,7 +237,7 @@ public:
};
/** Implement the XNameAccess for the AutoText events */
-class SwAutoTextEventDescriptor : public SvBaseEventDescriptor
+class SwAutoTextEventDescriptor final : public SvBaseEventDescriptor
{
SwXAutoTextEntry& rAutoTextEntry;
@@ -253,7 +251,7 @@ public:
virtual OUString SAL_CALL getImplementationName() override;
-protected:
+private:
virtual void replaceByName(
const SvMacroItemId nEvent, /// item ID of event
diff --git a/sw/source/uibase/inc/unomailmerge.hxx b/sw/source/uibase/inc/unomailmerge.hxx
index 2b35f7cd3a13..325c992e43fd 100644
--- a/sw/source/uibase/inc/unomailmerge.hxx
+++ b/sw/source/uibase/inc/unomailmerge.hxx
@@ -62,7 +62,7 @@ typedef cppu::OMultiTypeInterfaceContainerHelperVar<sal_Int32>
class SwDBManager;
class MailMergeExecuteFinalizer;
-class SwXMailMerge :
+class SwXMailMerge final :
public cppu::WeakImplHelper
<
css::task::XJob,
@@ -128,7 +128,7 @@ class SwXMailMerge :
SwXMailMerge( const SwXMailMerge & ) = delete;
SwXMailMerge & operator = ( const SwXMailMerge & ) = delete;
-protected:
+
virtual ~SwXMailMerge() override;
public:
SwXMailMerge();
diff --git a/sw/source/uibase/inc/unotools.hxx b/sw/source/uibase/inc/unotools.hxx
index c5d45ed3a6ef..4e56f9f8be5f 100644
--- a/sw/source/uibase/inc/unotools.hxx
+++ b/sw/source/uibase/inc/unotools.hxx
@@ -36,7 +36,7 @@
class SwView;
-class SW_DLLPUBLIC SwOneExampleFrame : public weld::CustomWidgetController
+class SW_DLLPUBLIC SwOneExampleFrame final : public weld::CustomWidgetController
{
ScopedVclPtr<VirtualDevice> m_xVirDev;
css::uno::Reference< css::frame::XModel > m_xModel;
diff --git a/sw/source/uibase/inc/usrpref.hxx b/sw/source/uibase/inc/usrpref.hxx
index 41ba99b6c988..e93d6a050d06 100644
--- a/sw/source/uibase/inc/usrpref.hxx
+++ b/sw/source/uibase/inc/usrpref.hxx
@@ -27,7 +27,7 @@
class SwMasterUsrPref;
-class SwContentViewConfig : public utl::ConfigItem
+class SwContentViewConfig final : public utl::ConfigItem
{
private:
SwMasterUsrPref& m_rParent;
@@ -48,7 +48,7 @@ public:
using ConfigItem::SetModified;
};
-class SwLayoutViewConfig : public utl::ConfigItem
+class SwLayoutViewConfig final : public utl::ConfigItem
{
private:
SwMasterUsrPref& m_rParent;
@@ -67,7 +67,7 @@ public:
using ConfigItem::SetModified;
};
-class SwGridConfig : public utl::ConfigItem
+class SwGridConfig final : public utl::ConfigItem
{
private:
SwMasterUsrPref& m_rParent;
@@ -85,7 +85,7 @@ public:
using ConfigItem::SetModified;
};
-class SwCursorConfig : public utl::ConfigItem
+class SwCursorConfig final : public utl::ConfigItem
{
private:
SwMasterUsrPref& m_rParent;
@@ -103,7 +103,7 @@ public:
using ConfigItem::SetModified;
};
-class SwWebColorConfig : public utl::ConfigItem
+class SwWebColorConfig final : public utl::ConfigItem
{
private:
SwMasterUsrPref& m_rParent;
diff --git a/sw/source/uibase/inc/viewlayoutctrl.hxx b/sw/source/uibase/inc/viewlayoutctrl.hxx
index b531ef4f21ae..a13f9ff52b2c 100644
--- a/sw/source/uibase/inc/viewlayoutctrl.hxx
+++ b/sw/source/uibase/inc/viewlayoutctrl.hxx
@@ -22,7 +22,7 @@
#include <sfx2/stbitem.hxx>
#include <memory>
-class SwViewLayoutControl : public SfxStatusBarControl
+class SwViewLayoutControl final : public SfxStatusBarControl
{
private:
@@ -36,7 +36,7 @@ public:
SwViewLayoutControl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb );
virtual ~SwViewLayoutControl() override;
- virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override;
+ virtual void StateChangedAtStatusBarControl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override;
virtual void Paint( const UserDrawEvent& rEvt ) override;
virtual bool MouseButtonDown( const MouseEvent & ) override;
virtual bool MouseMove( const MouseEvent & ) override;
diff --git a/sw/source/uibase/inc/watermarkdialog.hxx b/sw/source/uibase/inc/watermarkdialog.hxx
index dff87a792a57..57281a4d3faa 100644
--- a/sw/source/uibase/inc/watermarkdialog.hxx
+++ b/sw/source/uibase/inc/watermarkdialog.hxx
@@ -14,7 +14,7 @@
#include <svx/colorbox.hxx>
#include <sfx2/basedlgs.hxx>
-class SwWatermarkDialog : public SfxDialogController
+class SwWatermarkDialog final : public SfxDialogController
{
public:
SwWatermarkDialog(weld::Window* pParent, SfxBindings& rBindings);
diff --git a/sw/source/uibase/inc/wordcountctrl.hxx b/sw/source/uibase/inc/wordcountctrl.hxx
index d8ecc4a5963d..8074253b3645 100644
--- a/sw/source/uibase/inc/wordcountctrl.hxx
+++ b/sw/source/uibase/inc/wordcountctrl.hxx
@@ -19,7 +19,7 @@ Word count status bar control for Writer.
logic whatsoever. The actual updating of the word count string happens in
SwView::StateStatusLine (see sw/source/ui/uiview/view2.cxx).
*/
-class SwWordCountStatusBarControl : public SfxStatusBarControl
+class SwWordCountStatusBarControl final : public SfxStatusBarControl
{
public:
SFX_DECL_STATUSBAR_CONTROL();
@@ -27,8 +27,8 @@ public:
SwWordCountStatusBarControl(sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb);
virtual ~SwWordCountStatusBarControl() override;
- virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
- const SfxPoolItem* pState) override;
+ virtual void StateChangedAtStatusBarControl(sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState) override;
};
#endif
diff --git a/sw/source/uibase/inc/wordcountdialog.hxx b/sw/source/uibase/inc/wordcountdialog.hxx
index dafc87ea0913..653a04e6bfeb 100644
--- a/sw/source/uibase/inc/wordcountdialog.hxx
+++ b/sw/source/uibase/inc/wordcountdialog.hxx
@@ -23,7 +23,7 @@ struct SwDocStat;
#include <sfx2/childwin.hxx>
#include <swabstdlg.hxx>
-class SwWordCountFloatDlg : public SfxModelessDialogController
+class SwWordCountFloatDlg final : public SfxModelessDialogController
{
void SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc);
void showCJK(bool bShowCJK);
diff --git a/sw/source/uibase/inc/workctrl.hxx b/sw/source/uibase/inc/workctrl.hxx
index 7f4d93a4afae..d478f6ba997a 100644
--- a/sw/source/uibase/inc/workctrl.hxx
+++ b/sw/source/uibase/inc/workctrl.hxx
@@ -51,7 +51,7 @@ class SwView;
#define NID_FIELD_BYTYPE 20020
#define NID_COUNT 21
-class SwTbxAutoTextCtrl : public SfxToolBoxControl
+class SwTbxAutoTextCtrl final : public SfxToolBoxControl
{
public:
SFX_DECL_TOOLBOX_CONTROL();
@@ -60,14 +60,14 @@ public:
virtual ~SwTbxAutoTextCtrl() override;
virtual void CreatePopupWindow() override;
- virtual void StateChanged( sal_uInt16 nSID,
+ virtual void StateChangedAtToolBoxControl( sal_uInt16 nSID,
SfxItemState eState,
const SfxPoolItem* pState ) override;
DECL_STATIC_LINK(SwTbxAutoTextCtrl, PopupHdl, Menu*, bool);
};
-class SwPreviewZoomControl : public SfxToolBoxControl
+class SwPreviewZoomControl final : public SfxToolBoxControl
{
public:
SFX_DECL_TOOLBOX_CONTROL();
@@ -75,14 +75,14 @@ public:
SwPreviewZoomControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
virtual ~SwPreviewZoomControl() override;
- virtual void StateChanged( sal_uInt16 nSID,
+ virtual void StateChangedAtToolBoxControl( sal_uInt16 nSID,
SfxItemState eState,
const SfxPoolItem* pState ) override;
virtual VclPtr<InterimItemWindow> CreateItemWindow( vcl::Window *pParent ) override;
};
-class SwJumpToSpecificPageControl : public SfxToolBoxControl
+class SwJumpToSpecificPageControl final : public SfxToolBoxControl
{
public:
SFX_DECL_TOOLBOX_CONTROL();
diff --git a/sw/source/uibase/inc/wrap.hxx b/sw/source/uibase/inc/wrap.hxx
index 3a69e43ff210..7ce99b1696d3 100644
--- a/sw/source/uibase/inc/wrap.hxx
+++ b/sw/source/uibase/inc/wrap.hxx
@@ -27,14 +27,14 @@ namespace vcl { class Window; }
class SfxItemSet;
class SwWrtShell;
-class SwWrapDlg : public SfxSingleTabDialogController
+class SwWrapDlg final : public SfxSingleTabDialogController
{
public:
SwWrapDlg(weld::Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, bool bDrawMode);
};
// circulation TabPage
-class SwWrapTabPage: public SfxTabPage
+class SwWrapTabPage final : public SfxTabPage
{
RndStdIds m_nAnchorId;
sal_uInt16 m_nHtmlMode;
@@ -48,11 +48,17 @@ class SwWrapTabPage: public SfxTabPage
bool m_bContourImage;
// WRAPPING
+ std::unique_ptr<weld::Image> m_xNoWrapImg;
std::unique_ptr<weld::RadioButton> m_xNoWrapRB;
+ std::unique_ptr<weld::Image> m_xWrapLeftImg;
std::unique_ptr<weld::RadioButton> m_xWrapLeftRB;
+ std::unique_ptr<weld::Image> m_xWrapRightImg;
std::unique_ptr<weld::RadioButton> m_xWrapRightRB;
+ std::unique_ptr<weld::Image> m_xWrapParallelImg;
std::unique_ptr<weld::RadioButton> m_xWrapParallelRB;
+ std::unique_ptr<weld::Image> m_xWrapThroughImg;
std::unique_ptr<weld::RadioButton> m_xWrapThroughRB;
+ std::unique_ptr<weld::Image> m_xIdealWrapImg;
std::unique_ptr<weld::RadioButton> m_xIdealWrapRB;
// MARGIN
@@ -73,8 +79,8 @@ class SwWrapTabPage: public SfxTabPage
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override;
DECL_LINK(RangeModifyHdl, weld::MetricSpinButton&, void);
- DECL_LINK(WrapTypeHdl, weld::ToggleButton&, void);
- DECL_LINK(ContourHdl, weld::ToggleButton&, void);
+ DECL_LINK(WrapTypeHdl, weld::Toggleable&, void);
+ DECL_LINK(ContourHdl, weld::Toggleable&, void);
static const sal_uInt16 m_aWrapPageRg[];
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index 67b626dc70bc..727d4cfb64c9 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -30,10 +30,12 @@
#include <svx/swframetypes.hxx>
#include <vcl/weld.hxx>
+#include <doc.hxx>
+#include <docsh.hxx>
+#include <viewopt.hxx>
+
namespace vcl { class Window; }
class SbxArray;
-class SwDoc;
-class SwViewOption;
class SwFlyFrameAttrMgr;
class SwField;
class SwTOXBase;
@@ -88,7 +90,7 @@ namespace o3tl {
Eg. the Insert() method will take the current cursor position, insert the
string, and take care of undo etc.
*/
-class SW_DLLPUBLIC SwWrtShell: public SwFEShell
+class SW_DLLPUBLIC SwWrtShell final : public SwFEShell
{
private:
using SwCursorShell::Left;
@@ -148,7 +150,7 @@ public:
void EnterExtMode();
void LeaveExtMode();
- bool ToggleExtMode();
+ void ToggleExtMode();
bool IsExtMode() const { return m_bExtMode; }
void EnterAddMode();
@@ -158,7 +160,7 @@ public:
void EnterBlockMode();
void LeaveBlockMode();
- bool ToggleBlockMode();
+ void ToggleBlockMode();
bool IsBlockMode() const { return m_bBlockMode; }
void SetInsMode( bool bOn = true );
@@ -492,8 +494,10 @@ typedef bool (SwWrtShell::*FNSimpleMove)();
void InsertPostIt(SwFieldMgr& rFieldMgr, const SfxRequest& rReq);
bool IsOutlineContentVisible(const size_t nPos);
- void ToggleOutlineContentVisibility(SwNode* pNd, const bool bForceNotVisible = false);
- void ToggleOutlineContentVisibility(const size_t nPos, const bool bForceNotVisible = false);
+ void MakeOutlineContentVisible(const size_t nPos, bool bMakeVisible = true);
+ void MakeAllFoldedOutlineContentVisible(bool bMakeVisible = true);
+ void InvalidateOutlineContentVisibility();
+ bool GetAttrOutlineContentVisible(const size_t nPos);
private:
@@ -653,4 +657,39 @@ inline bool SwWrtShell::Is_FnDragEQBeginDrag() const
#endif
}
+class MakeAllOutlineContentTemporarilyVisible
+{
+private:
+ SwWrtShell* m_pWrtSh = nullptr;
+ bool m_bDone = false;
+public:
+ static sal_uInt32 nLock;
+ MakeAllOutlineContentTemporarilyVisible(SwDoc* pDoc)
+ {
+ ++nLock;
+ if (nLock > 1)
+ return;
+ if (SwDocShell* pDocSh = pDoc->GetDocShell())
+ if ((m_pWrtSh = pDocSh->GetWrtShell()) && m_pWrtSh->GetViewOptions() &&
+ m_pWrtSh->GetViewOptions()->IsShowOutlineContentVisibilityButton())
+ {
+ m_pWrtSh->StartAllAction();
+ m_pWrtSh->MakeAllFoldedOutlineContentVisible();
+ m_bDone = true;
+ }
+ }
+
+ ~MakeAllOutlineContentTemporarilyVisible() COVERITY_NOEXCEPT_FALSE
+ {
+ --nLock;
+ if (nLock > 0)
+ return;
+ if (m_bDone && m_pWrtSh)
+ {
+ m_pWrtSh->MakeAllFoldedOutlineContentVisible(false);
+ m_pWrtSh->EndAllAction();
+ }
+ }
+};
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/zoomctrl.hxx b/sw/source/uibase/inc/zoomctrl.hxx
index 02d89b0dc5bb..58dccbcbdbb4 100644
--- a/sw/source/uibase/inc/zoomctrl.hxx
+++ b/sw/source/uibase/inc/zoomctrl.hxx
@@ -21,15 +21,15 @@
#include <svx/zoomctrl.hxx>
-class SwZoomControl : public SvxZoomStatusBarControl
+class SwZoomControl final : public SvxZoomStatusBarControl
{
private:
OUString sPreviewZoom;
public:
virtual void Command(const CommandEvent& rCEvt) override;
- virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
- const SfxPoolItem* pState) override;
+ virtual void StateChangedAtStatusBarControl(sal_uInt16 nSID, SfxItemState eState,
+ const SfxPoolItem* pState) override;
virtual void Paint(const UserDrawEvent& rEvt) override;
SFX_DECL_STATUSBAR_CONTROL();
diff --git a/sw/source/uibase/lingu/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx
index 5e4a7ef35273..372737149744 100644
--- a/sw/source/uibase/lingu/hhcwrp.cxx
+++ b/sw/source/uibase/lingu/hhcwrp.cxx
@@ -180,10 +180,10 @@ void SwHHCWrapper::SelectNewUnit_impl( sal_Int32 nUnitStart, sal_Int32 nUnitEnd
pCursor->DeleteMark();
m_rWrtShell.Right( CRSR_SKIP_CHARS, /*bExpand*/ false,
- static_cast<sal_uInt16>(m_nUnitOffset + nUnitStart), true );
+ o3tl::narrowing<sal_uInt16>(m_nUnitOffset + nUnitStart), true );
pCursor->SetMark();
m_rWrtShell.Right( CRSR_SKIP_CHARS, /*bExpand*/ true,
- static_cast<sal_uInt16>(nUnitEnd - nUnitStart), true );
+ o3tl::narrowing<sal_uInt16>(nUnitEnd - nUnitStart), true );
// end selection now. Otherwise SHIFT+HOME (extending the selection)
// won't work when the dialog is closed without any replacement.
// (see #116346#)
@@ -438,7 +438,7 @@ void SwHHCWrapper::ReplaceUnit(
m_rWrtShell.Left( 0, true, aNewOrigText.getLength(), true, true );
}
- pRuby->SetPosition( static_cast<sal_uInt16>(bRubyBelow) );
+ pRuby->SetPosition( o3tl::narrowing<sal_uInt16>(bRubyBelow) );
pRuby->SetAdjustment( RubyAdjust_CENTER );
m_rWrtShell.SetAttrItem(*pRuby);
@@ -467,12 +467,9 @@ void SwHHCWrapper::ReplaceUnit(
OSL_ENSURE( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL,
"SwHHCWrapper::ReplaceUnit : unexpected target language" );
- sal_uInt16 const aRanges[] {
- RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE,
+ SfxItemSet aSet( m_rWrtShell.GetAttrPool(), svl::Items<
RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT,
- 0, 0, 0 };
-
- SfxItemSet aSet( m_rWrtShell.GetAttrPool(), aRanges );
+ RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE>{} );
if (pNewUnitLanguage)
{
aSet.Put( SvxLanguageItem( *pNewUnitLanguage, RES_CHRATR_CJK_LANGUAGE ) );
diff --git a/sw/source/uibase/lingu/sdrhhcwrap.cxx b/sw/source/uibase/lingu/sdrhhcwrap.cxx
index a626be95da3e..939890805425 100644
--- a/sw/source/uibase/lingu/sdrhhcwrap.cxx
+++ b/sw/source/uibase/lingu/sdrhhcwrap.cxx
@@ -142,7 +142,7 @@ bool SdrHHCWrapper::ConvertNextDocument()
pOutlView->SetOutputArea( tools::Rectangle( Point(), Size(1,1)));
SetPaperSize( pTextObj->GetLogicRect().GetSize() );
SetUpdateMode(true);
- pView->GetWrtShell().MakeVisible(pTextObj->GetLogicRect());
+ pView->GetWrtShell().MakeVisible(SwRect(pTextObj->GetLogicRect()));
pSdrView->SdrBeginTextEdit(pTextObj, pPV, &pView->GetEditWin(), false, this, pOutlView.get(), true, true);
}
diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx
index 9d7b95aae140..273c5c0ae870 100644
--- a/sw/source/uibase/misc/glosdoc.cxx
+++ b/sw/source/uibase/misc/glosdoc.cxx
@@ -175,7 +175,7 @@ std::unique_ptr<SwTextBlocks> SwGlossaries::GetGroupDoc(const OUString &rName,
bool SwGlossaries::NewGroupDoc(OUString& rGroupName, const OUString& rTitle)
{
const OUString sNewPath(rGroupName.getToken(1, GLOS_DELIM));
- sal_uInt16 nNewPath = static_cast<sal_uInt16>(sNewPath.toInt32());
+ sal_uInt16 nNewPath = o3tl::narrowing<sal_uInt16>(sNewPath.toInt32());
if (static_cast<size_t>(nNewPath) >= m_PathArr.size())
return false;
const OUString sNewFilePath(m_PathArr[nNewPath]);
@@ -195,7 +195,7 @@ bool SwGlossaries::NewGroupDoc(OUString& rGroupName, const OUString& rTitle)
bool SwGlossaries::RenameGroupDoc(
const OUString& rOldGroup, OUString& rNewGroup, const OUString& rNewTitle )
{
- sal_uInt16 nOldPath = static_cast<sal_uInt16>(rOldGroup.getToken(1, GLOS_DELIM).toInt32());
+ sal_uInt16 nOldPath = o3tl::narrowing<sal_uInt16>(rOldGroup.getToken(1, GLOS_DELIM).toInt32());
if (static_cast<size_t>(nOldPath) >= m_PathArr.size())
return false;
@@ -208,7 +208,7 @@ bool SwGlossaries::RenameGroupDoc(
return false;
}
- sal_uInt16 nNewPath = static_cast<sal_uInt16>(rNewGroup.getToken(1, GLOS_DELIM).toInt32());
+ sal_uInt16 nNewPath = o3tl::narrowing<sal_uInt16>(rNewGroup.getToken(1, GLOS_DELIM).toInt32());
if (static_cast<size_t>(nNewPath) >= m_PathArr.size())
return false;
@@ -237,8 +237,8 @@ bool SwGlossaries::RenameGroupDoc(
m_GlosArr.push_back(rNewGroup);
}
- std::unique_ptr<SwTextBlocks> pNewBlock(new SwTextBlocks( sNewFileURL ));
- pNewBlock->SetName(rNewTitle);
+ SwTextBlocks aNewBlock( sNewFileURL );
+ aNewBlock.SetName(rNewTitle);
return true;
}
@@ -246,7 +246,7 @@ bool SwGlossaries::RenameGroupDoc(
// Deletes a text block group
bool SwGlossaries::DelGroupDoc(const OUString &rName)
{
- sal_uInt16 nPath = static_cast<sal_uInt16>(rName.getToken(1, GLOS_DELIM).toInt32());
+ sal_uInt16 nPath = o3tl::narrowing<sal_uInt16>(rName.getToken(1, GLOS_DELIM).toInt32());
if (static_cast<size_t>(nPath) >= m_PathArr.size())
return false;
const OUString sBaseName(rName.getToken(0, GLOS_DELIM));
@@ -269,7 +269,7 @@ SwGlossaries::~SwGlossaries()
// read a block document
std::unique_ptr<SwTextBlocks> SwGlossaries::GetGlosDoc( const OUString &rName, bool bCreate ) const
{
- sal_uInt16 nPath = static_cast<sal_uInt16>(rName.getToken(1, GLOS_DELIM).toInt32());
+ sal_uInt16 nPath = o3tl::narrowing<sal_uInt16>(rName.getToken(1, GLOS_DELIM).toInt32());
std::unique_ptr<SwTextBlocks> pTmp;
if (static_cast<size_t>(nPath) < m_PathArr.size())
{
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index a6503b588549..bc334e1303ac 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -215,6 +215,7 @@ void SwRedlineAcceptDlg::Init(SwRedlineTable::size_type nStart)
else
{
rTreeView.clear();
+ m_RedlinData.clear();
m_RedlineChildren.clear();
m_RedlineParents.erase(m_RedlineParents.begin() + nStart, m_RedlineParents.end());
}
@@ -585,9 +586,10 @@ void SwRedlineAcceptDlg::InsertChildren(SwRedlineDataParent *pParent, const SwRa
OUString sComment = rRedln.GetComment(nStack);
std::unique_ptr<weld::TreeIter> xChild(rTreeView.make_iterator());
- OUString sId(OUString::number(reinterpret_cast<sal_Int64>(pData.release())));
+ OUString sId(OUString::number(reinterpret_cast<sal_Int64>(pData.get())));
rTreeView.insert(pParent->xTLBParent.get(), -1, nullptr, &sId, nullptr, nullptr,
false, xChild.get());
+ m_RedlinData.push_back(std::move(pData));
rTreeView.set_image(*xChild, sImage, -1);
rTreeView.set_text(*xChild, sAuthor, 1);
@@ -756,9 +758,10 @@ void SwRedlineAcceptDlg::InsertParents(SwRedlineTable::size_type nStart, SwRedli
pData->eType = rRedln.GetType(0);
OUString sDateEntry = GetAppLangDateTimeString(pData->aDateTime);
- OUString sId = OUString::number(reinterpret_cast<sal_Int64>(pData.release()));
+ OUString sId = OUString::number(reinterpret_cast<sal_Int64>(pData.get()));
std::unique_ptr<weld::TreeIter> xParent(rTreeView.make_iterator());
rTreeView.insert(nullptr, i, nullptr, &sId, nullptr, nullptr, false, xParent.get());
+ m_RedlinData.push_back(std::move(pData));
rTreeView.set_image(*xParent, sImage, -1);
rTreeView.set_text(*xParent, sAuthor, 1);
diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx
index ca3c19239011..b53987593c4f 100644
--- a/sw/source/uibase/misc/swruler.cxx
+++ b/sw/source/uibase/misc/swruler.cxx
@@ -85,7 +85,7 @@ SwCommentRuler::SwCommentRuler(SwViewShell* pViewSh, vcl::Window* pParent, SwEdi
, mpSwWin(pWin)
, mbIsHighlighted(false)
, mnFadeRate(0)
- , maVirDev(VclPtr<VirtualDevice>::Create(*this))
+ , maVirDev(VclPtr<VirtualDevice>::Create(*GetOutDev()))
{
// Set fading timeout: 5 x 40ms = 200ms
maFadeTimer.SetTimeout(40);
@@ -284,8 +284,10 @@ void SwCommentRuler::NotifyKit()
tools::JsonWriter aJsonWriter;
CreateJsonNotification(aJsonWriter);
+ char* pJsonData = aJsonWriter.extractData();
mpViewShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_RULER_UPDATE,
- aJsonWriter.extractData());
+ pJsonData);
+ free(pJsonData);
}
void SwCommentRuler::Update()
diff --git a/sw/source/uibase/ribbar/drawbase.cxx b/sw/source/uibase/ribbar/drawbase.cxx
index c35563f167dc..e7c176e72bc7 100644
--- a/sw/source/uibase/ribbar/drawbase.cxx
+++ b/sw/source/uibase/ribbar/drawbase.cxx
@@ -107,11 +107,11 @@ bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
m_aStartPos = m_pWin->PixelToLogic(rMEvt.GetPosPixel());
sal_uInt16 nEditMode = m_pWin->GetBezierMode();
- if (eHit == SdrHitKind::Handle && aVEvt.pHdl->GetKind() == SdrHdlKind::BezierWeight)
+ if (eHit == SdrHitKind::Handle && aVEvt.mpHdl->GetKind() == SdrHdlKind::BezierWeight)
{
// Drag handle
g_bNoInterrupt = true;
- bReturn = pSdrView->BegDragObj(m_aStartPos, nullptr, aVEvt.pHdl);
+ bReturn = pSdrView->BegDragObj(m_aStartPos, nullptr, aVEvt.mpHdl);
m_pWin->SetDrawAction(true);
}
else if (eHit == SdrHitKind::MarkedObject && nEditMode == SID_BEZIER_INSERT)
@@ -138,7 +138,7 @@ bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
else if (eHit == SdrHitKind::Handle)
{
// Select gluepoint
- if (pSdrView->HasMarkablePoints() && (!pSdrView->IsPointMarked(*aVEvt.pHdl) || rMEvt.IsShift()))
+ if (pSdrView->HasMarkablePoints() && (!pSdrView->IsPointMarked(*aVEvt.mpHdl) || rMEvt.IsShift()))
{
SdrHdl* pHdl = nullptr;
@@ -149,9 +149,9 @@ bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt)
}
else
{
- if (pSdrView->IsPointMarked(*aVEvt.pHdl))
+ if (pSdrView->IsPointMarked(*aVEvt.mpHdl))
{
- bReturn = pSdrView->UnmarkPoint(*aVEvt.pHdl);
+ bReturn = pSdrView->UnmarkPoint(*aVEvt.mpHdl);
pHdl = nullptr;
}
else
@@ -528,7 +528,7 @@ Point SwDrawBase::GetDefaultCenterPos() const
SwRect aVisArea(m_pSh->VisArea());
if (comphelper::LibreOfficeKit::isActive())
{
- aVisArea = m_pSh->getLOKVisibleArea();
+ aVisArea = SwRect(m_pSh->getLOKVisibleArea());
aVisArea.Intersection(SwRect(Point(), aDocSz));
}
diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx
index 5ba12dec0e76..1032f5e68072 100644
--- a/sw/source/uibase/ribbar/inputwin.cxx
+++ b/sw/source/uibase/ribbar/inputwin.cxx
@@ -515,11 +515,11 @@ void InputEdit::UpdateRange(std::u16string_view rBoxes,
m_xWidget->get_selection_bounds(nSelStartPos, nSelEndPos);
Selection aSelection(nSelStartPos, nSelEndPos);
- sal_uInt16 nSel = static_cast<sal_uInt16>(aSelection.Len());
+ sal_uInt16 nSel = o3tl::narrowing<sal_uInt16>(aSelection.Len());
// OS: The following expression ensures that in the overwrite mode,
// the selected closing parenthesis will be not deleted.
if( nSel && ( nSel > 1 ||
- m_xWidget->get_text()[ static_cast<sal_uInt16>(aSelection.Min()) ] != cClose ))
+ m_xWidget->get_text()[ o3tl::narrowing<sal_uInt16>(aSelection.Min()) ] != cClose ))
m_xWidget->cut_clipboard();
else
aSelection.Max() = aSelection.Min();
@@ -538,7 +538,7 @@ void InputEdit::UpdateRange(std::u16string_view rBoxes,
{
bool bFound = false;
sal_Unicode cCh;
- sal_uInt16 nPos, nEndPos = 0, nStartPos = static_cast<sal_uInt16>(aSelection.Min());
+ sal_uInt16 nPos, nEndPos = 0, nStartPos = o3tl::narrowing<sal_uInt16>(aSelection.Min());
if( nStartPos-- )
{
do {
@@ -565,7 +565,7 @@ void InputEdit::UpdateRange(std::u16string_view rBoxes,
}
// Only if the current position lies in the range or right behind.
if( bFound && ( nStartPos >= o3tl::make_unsigned(aSelection.Max()) ||
- static_cast<sal_uInt16>(aSelection.Max()) > nEndPos + 1 ))
+ o3tl::narrowing<sal_uInt16>(aSelection.Max()) > nEndPos + 1 ))
bFound = false;
}
if( bFound )
@@ -577,7 +577,7 @@ void InputEdit::UpdateRange(std::u16string_view rBoxes,
else
{
OUString aTmp = OUStringChar(cOpen) + aBoxes + OUStringChar(cClose);
- nPos = static_cast<sal_uInt16>(aSelection.Min());
+ nPos = o3tl::narrowing<sal_uInt16>(aSelection.Min());
aActText = aActText.replaceAt( nPos, 0, aTmp );
nPos = nPos + aTmp.getLength();
}
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index fb2f4f25790c..2c7e08c23a56 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -98,7 +98,7 @@ void SwTbxAutoTextCtrl::CreatePopupWindow()
const sal_uInt16 nBlockCount = pGlossaryList->GetBlockCount(i -1);
if(nBlockCount)
{
- sal_uInt16 nIndex = static_cast<sal_uInt16>(100*i);
+ sal_uInt16 nIndex = o3tl::narrowing<sal_uInt16>(100*i);
// but insert without extension
pPopup->InsertItem( i, sTitle);
VclPtrInstance<PopupMenu> pSub;
@@ -128,7 +128,7 @@ void SwTbxAutoTextCtrl::CreatePopupWindow()
GetToolBox().EndSelection();
}
-void SwTbxAutoTextCtrl::StateChanged( sal_uInt16,
+void SwTbxAutoTextCtrl::StateChangedAtToolBoxControl( sal_uInt16,
SfxItemState,
const SfxPoolItem* pState )
{
@@ -284,10 +284,23 @@ static const char* STR_IMGBTN_ARY[] =
static OUString lcl_GetScrollToolTip(bool bNext)
{
sal_uInt16 nResId = SwView::GetMoveType();
- if (!bNext)
- nResId += NID_COUNT;
- const char* id = STR_IMGBTN_ARY[nResId - NID_START];
- return id ? SwResId(id): OUString();
+ OUString sToolTip = SwResId(STR_IMGBTN_ARY[(!bNext ? NID_COUNT : 0) + nResId - NID_START]);
+ if (nResId == NID_FIELD_BYTYPE)
+ {
+ OUString sFieldType;
+ SwWrtShell* pWrtSh = GetActiveWrtShell();
+ if (pWrtSh)
+ {
+ SwField* pCurField = pWrtSh->GetCurField(true);
+ if (pCurField)
+ sFieldType = SwFieldType::GetTypeStr(pCurField->GetTypeId());
+ }
+ if (!sFieldType.isEmpty())
+ sToolTip = sToolTip.replaceFirst(u"%FIELDTYPE", sFieldType);
+ else
+ sToolTip = SwResId(SW_STR_NONE);
+ }
+ return sToolTip;
}
namespace {
@@ -397,7 +410,7 @@ void SwZoomBox_Impl::Select()
{
bNonNumeric = false;
- sal_uInt16 nZoom = static_cast<sal_uInt16>(sEntry.toInt32());
+ sal_uInt16 nZoom = o3tl::narrowing<sal_uInt16>(sEntry.toInt32());
if(nZoom < MINZOOM)
nZoom = MINZOOM;
if(nZoom > MAXZOOM)
@@ -482,7 +495,7 @@ SwPreviewZoomControl::~SwPreviewZoomControl()
{
}
-void SwPreviewZoomControl::StateChanged( sal_uInt16 /*nSID*/,
+void SwPreviewZoomControl::StateChangedAtToolBoxControl( sal_uInt16 /*nSID*/,
SfxItemState eState,
const SfxPoolItem* pState )
{
@@ -551,7 +564,7 @@ IMPL_LINK_NOARG(SwJumpToSpecificBox_Impl, SelectHdl, weld::Entry&, bool)
{
OUString sEntry(m_xWidget->get_text());
SfxUInt16Item aPageNum(nSlotId);
- aPageNum.SetValue(static_cast<sal_uInt16>(sEntry.toInt32()));
+ aPageNum.SetValue(o3tl::narrowing<sal_uInt16>(sEntry.toInt32()));
SfxObjectShell* pCurrentShell = SfxObjectShell::Current();
pCurrentShell->GetDispatcher()->ExecuteList(nSlotId, SfxCallMode::ASYNCHRON,
{ &aPageNum });
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index 78e37c09c756..a81ae435829c 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -99,6 +99,8 @@
#include <shellres.hxx>
#include <UndoTable.hxx>
+#include <ndtxt.hxx>
+
FlyMode SwBaseShell::eFrameMode = FLY_DRAG_END;
// These variables keep the state of Gallery (slot SID_GALLERY_BG_BRUSH)
@@ -157,14 +159,14 @@ static void lcl_UpdateIMapDlg( SwWrtShell& rSh )
GraphicType nGrfType = aGrf.GetType();
void* pEditObj = GraphicType::NONE != nGrfType && GraphicType::Default != nGrfType
? rSh.GetIMapInventor() : nullptr;
- std::unique_ptr<TargetList> pList(new TargetList);
- SfxFrame::GetDefaultTargetList(*pList);
+ TargetList aList;
+ SfxFrame::GetDefaultTargetList(aList);
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
rSh.GetFlyFrameAttr( aSet );
const SwFormatURL &rURL = aSet.Get( RES_URL );
SvxIMapDlgChildWindow::UpdateIMapDlg(
- aGrf, rURL.GetMap(), pList.get(), pEditObj );
+ aGrf, rURL.GetMap(), &aList, pEditObj );
}
static bool lcl_UpdateContourDlg( SwWrtShell &rSh, SelectionType nSel )
@@ -195,11 +197,53 @@ void SwBaseShell::ExecDelete(SfxRequest &rReq)
switch(rReq.GetSlot())
{
case SID_DELETE:
+ if (rSh.GetViewOptions()->IsShowOutlineContentVisibilityButton())
+ {
+ if (rSh.IsEndPara())
+ {
+ SwNodeIndex aIdx(rSh.GetCursor()->GetNode());
+ // disallow if this is an outline node having folded content
+ bool bVisible = true;
+ aIdx.GetNode().GetTextNode()->GetAttrOutlineContentVisible(bVisible);
+ if (!bVisible)
+ return;
+ // disallow if the next text node is an outline node having folded content
+ ++aIdx;
+ SwNodeType aNodeType;
+ while ((aNodeType = aIdx.GetNode().GetNodeType()) != SwNodeType::Text)
+ ++aIdx;
+ if (aIdx.GetNode().IsTextNode())
+ {
+ bVisible = true;
+ aIdx.GetNode().GetTextNode()->GetAttrOutlineContentVisible(bVisible);
+ if (!bVisible)
+ return;
+ }
+ }
+ }
rSh.DelRight();
break;
case FN_BACKSPACE:
-
+ if (rSh.GetViewOptions()->IsShowOutlineContentVisibilityButton())
+ {
+ if (rSh.IsSttPara())
+ {
+ SwNodeIndex aIdx(rSh.GetCursor()->GetNode());
+ // disallow if this is a folded outline node
+ bool bVisible = true;
+ aIdx.GetNode().GetTextNode()->GetAttrOutlineContentVisible(bVisible);
+ if (!bVisible)
+ return;
+ // disallow if previous text node does not have a layout frame
+ --aIdx;
+ SwNodeType aNodeType;
+ while ((aNodeType = aIdx.GetNode().GetNodeType()) != SwNodeType::Text)
+ --aIdx;
+ if (aIdx.GetNode().IsContentNode() && !aIdx.GetNode().GetContentNode()->getLayoutFrame(nullptr))
+ return;
+ }
+ }
if( rSh.IsNoNum() )
{
rSh.SttCursorMove();
@@ -234,6 +278,8 @@ void SwBaseShell::ExecDelete(SfxRequest &rReq)
void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
{
+ MakeAllOutlineContentTemporarilyVisible a(GetShell().GetDoc());
+
// Attention: At risk of suicide!
// After paste, paste special the shell can be destroy.
@@ -523,6 +569,8 @@ void SwBaseShell::StateClpbrd(SfxItemSet &rSet)
void SwBaseShell::ExecUndo(SfxRequest &rReq)
{
+ MakeAllOutlineContentTemporarilyVisible a(GetShell().GetDoc());
+
SwWrtShell &rWrtShell = GetShell();
SwUndoId nUndoId(SwUndoId::EMPTY);
@@ -559,6 +607,12 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq)
rWrtShell.Do( SwWrtShell::UNDO, nCnt );
for (SwViewShell& rShell : rWrtShell.GetRingContainer())
rShell.UnlockPaint();
+
+ // tdf#141613 FIXME: Disable redoing header/footer changes for now.
+ // The proper solution would be to write a SwUndoHeaderFooter class
+ // to represent the addition of a header or footer to the current page.
+ if (nUndoId == SwUndoId::HEADER_FOOTER)
+ rUndoRedo.ClearRedo();
}
break;
@@ -918,7 +972,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
// RepeatHeaderLines
if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_4, true, &pItem))
aInsTableOpts.mnRowsToRepeat =
- static_cast<sal_uInt16>(static_cast< const SfxInt16Item* >(pItem)->GetValue());
+ o3tl::narrowing<sal_uInt16>(static_cast< const SfxInt16Item* >(pItem)->GetValue());
//WithBorder
if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_5, true, &pItem) &&
static_cast< const SfxBoolItem* >(pItem)->GetValue())
@@ -1725,8 +1779,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
if (comphelper::LibreOfficeKit::isActive())
{
- if (nWhich == FN_TOOL_ANCHOR_PAGE || nWhich == FN_TOOL_ANCHOR_PARAGRAPH
- || nWhich == FN_TOOL_ANCHOR_FRAME)
+ if (nWhich == FN_TOOL_ANCHOR_PAGE || nWhich == FN_TOOL_ANCHOR_FRAME)
{
rSet.DisableItem(nWhich);
}
diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx
index 47b4064642e0..b18ce9327b68 100644
--- a/sw/source/uibase/shells/drawdlg.cxx
+++ b/sw/source/uibase/shells/drawdlg.cxx
@@ -368,7 +368,24 @@ void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet)
if( !bDisable )
{
- pSdrView->GetAttributes( rSet );
+ SfxItemSet aSet(rSet);
+ aSet.MergeRange(SDRATTR_TEXTCOLUMNS_NUMBER, SDRATTR_TEXTCOLUMNS_SPACING);
+ pSdrView->GetAttributes(aSet);
+ if (const SfxPoolItem * pItem;
+ aSet.GetItemState(SDRATTR_TEXTCOLUMNS_NUMBER, false, &pItem)
+ >= SfxItemState::DEFAULT
+ && pItem)
+ {
+ aSet.Put(pItem->CloneSetWhich(SID_ATTR_TEXTCOLUMNS_NUMBER));
+ }
+ if (const SfxPoolItem * pItem;
+ aSet.GetItemState(SDRATTR_TEXTCOLUMNS_SPACING, false, &pItem)
+ >= SfxItemState::DEFAULT
+ && pItem)
+ {
+ aSet.Put(pItem->CloneSetWhich(SID_ATTR_TEXTCOLUMNS_SPACING));
+ }
+ rSet.Put(aSet, false);
if (comphelper::LibreOfficeKit::isActive())
lcl_unifyFillTransparencyItems(rSet);
}
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx
index 9f0de0c2a0f1..80b8c1eee379 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -210,7 +210,15 @@ void SwDrawShell::Execute(SfxRequest &rReq)
const sal_uLong handleNum = handleNumItem->GetValue();
const sal_uLong newPosX = newPosXTwips->GetValue();
const sal_uLong newPosY = newPosYTwips->GetValue();
- pSdrView->MoveShapeHandle(handleNum, Point(newPosX, newPosY), OrdNum ? OrdNum->GetValue() : -1);
+ const Point mPoint(newPosX, newPosY);
+ const SdrHdl* handle = pSdrView->GetHdlList().GetHdl(handleNum);
+ if (handle->GetKind() == SdrHdlKind::Anchor || handle->GetKind() == SdrHdlKind::Anchor_TR)
+ {
+ rSh.FindAnchorPos(mPoint, /*bMoveIt=*/true);
+ pSdrView->ModelHasChanged();
+ }
+ else
+ pSdrView->MoveShapeHandle(handleNum, mPoint, OrdNum ? OrdNum->GetValue() : -1);
}
}
break;
@@ -537,8 +545,8 @@ SwDrawShell::SwDrawShell(SwView &_rView) :
SwWrtShell &rSh = GetShell();
SdrView* pDrView = rSh.GetDrawView();
- sal_uInt32 nCheckStatus = 0;
- if (pDrView && svx::checkForSelectedFontWork(pDrView, nCheckStatus))
+
+ if (pDrView && svx::checkForSelectedFontWork(pDrView))
eContext = vcl::EnumContext::Context::DrawFontwork;
SfxShell::SetContextName(vcl::EnumContext::GetContextName(eContext));
diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx
index da358b617d17..770b46d7e7ba 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -112,7 +112,7 @@ namespace
case SID_ATTR_CHAR_BACK_COLOR:
{
- SvxBackgroundColorItem pBackgroundItem(aColor, EE_CHAR_BKGCOLOR);
+ SvxColorItem pBackgroundItem(aColor, EE_CHAR_BKGCOLOR);
pArgs->Put(pBackgroundItem);
break;
}
diff --git a/sw/source/uibase/shells/mediash.cxx b/sw/source/uibase/shells/mediash.cxx
index 7aaabc817c08..2eeffe659989 100644
--- a/sw/source/uibase/shells/mediash.cxx
+++ b/sw/source/uibase/shells/mediash.cxx
@@ -18,7 +18,6 @@
*/
#include <cmdid.h>
-#include <svl/whiter.hxx>
#include <sfx2/request.hxx>
#include <svx/svdview.hxx>
#include <view.hxx>
@@ -27,135 +26,72 @@
#include <sfx2/objface.hxx>
#include <vcl/EnumContext.hxx>
-#include <svx/svdomedia.hxx>
-#include <svx/sdr/contact/viewcontactofsdrmediaobj.hxx>
-#include <avmedia/mediaitem.hxx>
+#include <svx/MediaShellHelpers.hxx>
#define ShellClass_SwMediaShell
-#include <sfx2/msg.hxx>
#include <swslots.hxx>
#include <memory>
+using namespace svx;
+
SFX_IMPL_INTERFACE(SwMediaShell, SwBaseShell)
void SwMediaShell::InitInterface_Impl()
{
GetStaticInterface()->RegisterPopupMenu("media");
- GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, ToolbarId::Media_Toolbox);
+ GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible,
+ ToolbarId::Media_Toolbox);
}
-void SwMediaShell::ExecMedia(SfxRequest const &rReq)
+void SwMediaShell::ExecMedia(SfxRequest const& rReq)
{
SwWrtShell* pSh = &GetShell();
- SdrView* pSdrView = pSh->GetDrawView();
+ SdrView* pSdrView = pSh->GetDrawView();
- if( !pSdrView )
+ if (!pSdrView)
return;
- const SfxItemSet* pArgs = rReq.GetArgs();
- bool bChanged = pSdrView->GetModel()->IsChanged();
-
- pSdrView->GetModel()->SetChanged( false );
+ const bool bChanged = pSdrView->GetModel()->IsChanged();
+ pSdrView->GetModel()->SetChanged(false);
- switch( rReq.GetSlot() )
+ switch (rReq.GetSlot())
{
case SID_DELETE:
- {
- if( pSh->IsObjSelected() )
+ if (pSh->IsObjSelected())
{
pSh->SetModified();
pSh->DelSelectedObj();
- if( pSh->IsSelFrameMode() )
+ if (pSh->IsSelFrameMode())
pSh->LeaveSelFrameMode();
GetView().AttrChangedNotify(nullptr);
}
- }
- break;
+ break;
case SID_AVMEDIA_TOOLBOX:
- {
- if( pSh->IsObjSelected() )
- {
- const SfxPoolItem* pItem;
-
- if( !pArgs || ( SfxItemState::SET != pArgs->GetItemState( SID_AVMEDIA_TOOLBOX, false, &pItem ) ) )
- pItem = nullptr;
-
- if( pItem )
- {
- std::unique_ptr<SdrMarkList> pMarkList(new SdrMarkList( pSdrView->GetMarkedObjectList() ));
-
- if( 1 == pMarkList->GetMarkCount() )
- {
- SdrObject* pObj = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
-
- if( dynamic_cast< const SdrMediaObj *>( pObj ) )
- {
- static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( pObj->GetViewContact() ).executeMediaItem(
- static_cast< const ::avmedia::MediaItem& >( *pItem ) );
- }
- }
- }
- }
- }
- break;
+ if (pSh->IsObjSelected())
+ MediaShellHelpers::Execute(pSdrView, rReq);
+ break;
default:
- break;
+ break;
}
- if( pSdrView->GetModel()->IsChanged() )
+ if (pSdrView->GetModel()->IsChanged())
GetShell().SetModified();
- else if( bChanged )
+ else if (bChanged)
pSdrView->GetModel()->SetChanged();
}
-void SwMediaShell::GetMediaState(SfxItemSet &rSet)
+void SwMediaShell::GetMediaState(SfxItemSet& rSet)
{
- SfxWhichIter aIter( rSet );
- sal_uInt16 nWhich = aIter.FirstWhich();
-
- while( nWhich )
- {
- if( SID_AVMEDIA_TOOLBOX == nWhich )
- {
- SwWrtShell& rSh = GetShell();
- SdrView* pView = rSh.GetDrawView();
-
- if( pView )
- {
- bool bDisable = true;
- std::unique_ptr<SdrMarkList> pMarkList(new SdrMarkList( pView->GetMarkedObjectList() ));
-
- if( 1 == pMarkList->GetMarkCount() )
- {
- SdrObject* pObj = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
-
- if( dynamic_cast< const SdrMediaObj *>( pObj ) )
- {
- ::avmedia::MediaItem aItem( SID_AVMEDIA_TOOLBOX );
-
- static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( pObj->GetViewContact() ).updateMediaItem( aItem );
- rSet.Put( aItem );
- bDisable = false;
- }
- }
-
- if( bDisable )
- rSet.DisableItem( SID_AVMEDIA_TOOLBOX );
- }
- }
-
- nWhich = aIter.NextWhich();
- }
+ MediaShellHelpers::GetState(GetShell().GetDrawView(), rSet);
}
-SwMediaShell::SwMediaShell(SwView &_rView) :
- SwBaseShell(_rView)
-
+SwMediaShell::SwMediaShell(SwView& _rView)
+ : SwBaseShell(_rView)
{
SetName("Media Playback");
SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Media));
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 9c73c9923a2d..cd231be93192 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -96,29 +96,29 @@ void SwTableShell::InitInterface_Impl()
const sal_uInt16 aUITableAttrRange[] =
{
- XATTR_FILL_FIRST, XATTR_FILL_LAST,
- FN_PARAM_TABLE_NAME, FN_PARAM_TABLE_NAME,
- FN_PARAM_TABLE_HEADLINE, FN_PARAM_TABLE_HEADLINE,
- FN_PARAM_TABLE_SPACE, FN_PARAM_TABLE_SPACE,
- FN_TABLE_REP, FN_TABLE_REP,
- SID_RULER_BORDERS, SID_RULER_BORDERS,
RES_LR_SPACE, RES_UL_SPACE,
- SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_SHADOW,
- RES_BOX, RES_SHADOW,
- RES_BACKGROUND, RES_BACKGROUND,
- SID_BACKGRND_DESTINATION, SID_BACKGRND_DESTINATION,
- SID_HTML_MODE, SID_HTML_MODE,
- SID_ATTR_BRUSH_ROW, SID_ATTR_BRUSH_TABLE,
RES_PAGEDESC, RES_BREAK,
+ RES_BACKGROUND, RES_BACKGROUND,
+ RES_BOX, RES_SHADOW,
RES_KEEP, RES_KEEP,
RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT,
- FN_TABLE_SET_VERT_ALIGN, FN_TABLE_SET_VERT_ALIGN,
RES_FRAMEDIR, RES_FRAMEDIR,
RES_ROW_SPLIT, RES_ROW_SPLIT,
- FN_TABLE_BOX_TEXTORIENTATION, FN_TABLE_BOX_TEXTORIENTATION,
// #i29550#
RES_COLLAPSING_BORDERS, RES_COLLAPSING_BORDERS,
// <-- collapsing borders
+ XATTR_FILL_FIRST, XATTR_FILL_LAST,
+ SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_SHADOW,
+ SID_RULER_BORDERS, SID_RULER_BORDERS,
+ SID_ATTR_BRUSH_ROW, SID_ATTR_BRUSH_TABLE, // ??? This is very strange range
+// SID_BACKGRND_DESTINATION, SID_BACKGRND_DESTINATION, // included into above
+// SID_HTML_MODE, SID_HTML_MODE, // included into above
+ FN_TABLE_REP, FN_TABLE_REP,
+ FN_TABLE_SET_VERT_ALIGN, FN_TABLE_SET_VERT_ALIGN,
+ FN_TABLE_BOX_TEXTORIENTATION, FN_TABLE_BOX_TEXTORIENTATION,
+ FN_PARAM_TABLE_NAME, FN_PARAM_TABLE_NAME,
+ FN_PARAM_TABLE_HEADLINE, FN_PARAM_TABLE_HEADLINE,
+ FN_PARAM_TABLE_SPACE, FN_PARAM_TABLE_SPACE,
0
};
@@ -597,14 +597,22 @@ void SwTableShell::Execute(SfxRequest &rReq)
auto pRequest = std::make_shared<SfxRequest>(rReq);
rReq.Ignore(); // the 'old' request is not relevant any more
- auto vCursors = CopyPaMRing(*rSh.GetCursor()); // tdf#135636 make a copy to use at later apply
- pDlg->StartExecuteAsync([pDlg, pRequest, pTableRep, &rBindings, &rSh, vCursors](sal_Int32 nResult){
+ const bool bTableMode = rSh.IsTableMode();
+ SwPaM* pCursor = bTableMode ? rSh.GetTableCrs() : rSh.GetCursor(); // tdf#142165 use table cursor if in table mode
+ auto vCursors = CopyPaMRing(*pCursor); // tdf#135636 make a copy to use at later apply
+ pDlg->StartExecuteAsync([pDlg, pRequest, pTableRep, &rBindings, &rSh, vCursors, bTableMode](sal_Int32 nResult){
if (RET_OK == nResult)
{
- if (rSh.IsTableMode()) // tdf#140977 drop possible table-cursor before setting the new one
- rSh.TableCursorToCursor();
+ if (!bTableMode && rSh.IsTableMode()) // tdf#140977 drop current table-cursor if setting a replacement
+ rSh.TableCursorToCursor(); // non-table one
+
+ // tdf#135636 set the selection at dialog launch as current selection
+ rSh.SetSelection(*vCursors->front()); // UpdateCursor() will be called which in the case
+ // of a table selection should recreate a
+ // SwShellTableCursor if the selection is more than a single cell
- rSh.SetSelection(*vCursors->front()); // tdf#135636 set the table selected at dialog launch as current selection
+ if (bTableMode && !rSh.IsTableMode()) // tdf#142721 ensure the new selection is a SwShellTableCursor in
+ rSh.SelTableBox(); // the case of a single cell
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index 158ba5626915..905471f4e869 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -975,7 +975,7 @@ void SwTextShell::InsertHyperlink(const SvxHyperlinkItem& rHlnkItem)
const OUString& rName = rHlnkItem.GetName();
const OUString& rURL = rHlnkItem.GetURL();
const OUString& rTarget = rHlnkItem.GetTargetFrame();
- sal_uInt16 nType = static_cast<sal_uInt16>(rHlnkItem.GetInsertMode());
+ sal_uInt16 nType = o3tl::narrowing<sal_uInt16>(rHlnkItem.GetInsertMode());
nType &= ~HLINK_HTMLMODE;
const SvxMacroTableDtor* pMacroTable = rHlnkItem.GetMacroTable();
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index 8300a91295ca..12f6f8d9bdad 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -837,20 +837,15 @@ SwTextShell::~SwTextShell()
SfxItemSet SwTextShell::CreateInsertFrameItemSet(SwFlyFrameAttrMgr& rMgr)
{
- static const sal_uInt16 aFrameAttrRange[] =
- {
+ SfxItemSet aSet(GetPool(), svl::Items<
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
+ XATTR_FILL_FIRST, XATTR_FILL_LAST, // tdf#95003
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
- FN_GET_PRINT_AREA, FN_GET_PRINT_AREA,
SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
- FN_SET_FRM_NAME, FN_SET_FRM_NAME,
- SID_HTML_MODE, SID_HTML_MODE,
SID_COLOR_TABLE, SID_PATTERN_LIST,
- XATTR_FILL_FIRST, XATTR_FILL_LAST, // tdf#95003
- 0
- };
-
- SfxItemSet aSet(GetPool(), aFrameAttrRange );
+ SID_HTML_MODE, SID_HTML_MODE,
+ FN_GET_PRINT_AREA, FN_GET_PRINT_AREA,
+ FN_SET_FRM_NAME, FN_SET_FRM_NAME>{});
aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
// For the Area tab page.
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 93a9bc35b522..0c11a9395a40 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1013,7 +1013,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
const SvxTabStopItem& rDefTabs =
GetPool().GetDefaultItem(RES_PARATR_TABSTOP);
- const sal_uInt16 nDefDist = static_cast<sal_uInt16>(::GetTabDist( rDefTabs ));
+ const sal_uInt16 nDefDist = o3tl::narrowing<sal_uInt16>(::GetTabDist( rDefTabs ));
SfxUInt16Item aDefDistItem( SID_ATTR_TABSTOP_DEFAULTS, nDefDist );
aCoreSet.Put( aDefDistItem );
@@ -1430,7 +1430,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
if (pDlg->Execute() == RET_OK)
{
pFieldBM->Invalidate();
- rWrtSh.InvalidateWindows( rWrtSh.GetView().GetVisArea() );
+ rWrtSh.InvalidateWindows( SwRect(rWrtSh.GetView().GetVisArea()) );
rWrtSh.UpdateCursor(); // cursor position might be invalid
}
}
@@ -1442,7 +1442,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
if (pDlg->Execute() == RET_OK)
{
rDateField.Invalidate();
- rWrtSh.InvalidateWindows( rWrtSh.GetView().GetVisArea() );
+ rWrtSh.InvalidateWindows( SwRect(rWrtSh.GetView().GetVisArea()) );
rWrtSh.UpdateCursor(); // cursor position might be invalid
}
}
diff --git a/sw/source/uibase/shells/txtcrsr.cxx b/sw/source/uibase/shells/txtcrsr.cxx
index d49d3d1433ef..bc1c86fe1a2b 100644
--- a/sw/source/uibase/shells/txtcrsr.cxx
+++ b/sw/source/uibase/shells/txtcrsr.cxx
@@ -335,7 +335,7 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq)
break;
std::unique_ptr< svx::ISdrObjectFilter > pFilter( FmFormShell::CreateFocusableControlFilter(
- *pDrawView, *pWindow ) );
+ *pDrawView, *pWindow->GetOutDev() ) );
if (!pFilter)
break;
@@ -348,7 +348,7 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq)
if ( !pUnoObject )
break;
- pFormShell->ToggleControlFocus( *pUnoObject, *pDrawView, *pWindow );
+ pFormShell->ToggleControlFocus( *pUnoObject, *pDrawView, *pWindow->GetOutDev() );
}
break;
case FN_CNTNT_TO_NEXT_FRAME:
diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx
index b75cc1c7dcbd..e1890bbd6f34 100644
--- a/sw/source/uibase/shells/txtnum.cxx
+++ b/sw/source/uibase/shells/txtnum.cxx
@@ -209,13 +209,13 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
{
pRequest->AppendItem(*pItem);
pRequest->Done();
- SvxNumRule* pSetRule = static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule();
- pSetRule->UnLinkGraphics();
+ SvxNumRule& rSetRule = const_cast<SvxNumRule&>(static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule());
+ rSetRule.UnLinkGraphics();
SwNumRule aSetRule(pNumRuleAtCurrentSelection != nullptr
? pNumRuleAtCurrentSelection->GetName()
: GetShell().GetUniqueNumRuleName(),
numfunc::GetDefaultPositionAndSpaceMode());
- aSetRule.SetSvxRule(*pSetRule, GetShell().GetDoc());
+ aSetRule.SetSvxRule(rSetRule, GetShell().GetDoc());
aSetRule.SetAutoRule(true);
// No start of new list, if an existing list style is edited.
// Otherwise start a new list.
@@ -229,11 +229,11 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
{
pRequest->AppendItem(*pItem);
pRequest->Done();
- SvxNumRule* pSetRule = static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule();
+ const SvxNumRule& rSetRule = static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule();
SwNumRule aSetRule(
GetShell().GetUniqueNumRuleName(),
numfunc::GetDefaultPositionAndSpaceMode());
- aSetRule.SetSvxRule(*pSetRule, GetShell().GetDoc());
+ aSetRule.SetSvxRule(rSetRule, GetShell().GetDoc());
aSetRule.SetAutoRule(true);
// start new list
GetShell().SetCurNumRule(aSetRule, true);
diff --git a/sw/source/uibase/sidebar/PageColumnControl.cxx b/sw/source/uibase/sidebar/PageColumnControl.cxx
index 8b979af19668..adf10c4af58e 100644
--- a/sw/source/uibase/sidebar/PageColumnControl.cxx
+++ b/sw/source/uibase/sidebar/PageColumnControl.cxx
@@ -87,11 +87,11 @@ PageColumnControl::~PageColumnControl()
void PageColumnControl::ExecuteColumnChange( const sal_uInt16 nColumnType )
{
- std::unique_ptr<SfxInt16Item> mpPageColumnTypeItem( new SfxInt16Item(SID_ATTR_PAGE_COLUMN) );
- mpPageColumnTypeItem->SetValue( nColumnType );
+ SfxInt16Item aPageColumnTypeItem(SID_ATTR_PAGE_COLUMN);
+ aPageColumnTypeItem.SetValue( nColumnType );
if ( SfxViewFrame::Current() )
SfxViewFrame::Current()->GetBindings().GetDispatcher()->ExecuteList(SID_ATTR_PAGE_COLUMN,
- SfxCallMode::RECORD, { mpPageColumnTypeItem.get() });
+ SfxCallMode::RECORD, { &aPageColumnTypeItem });
}
IMPL_LINK( PageColumnControl, ColumnButtonClickHdl_Impl, weld::Button&, rButton, void )
diff --git a/sw/source/uibase/sidebar/PageFooterPanel.cxx b/sw/source/uibase/sidebar/PageFooterPanel.cxx
index c85969e29168..fe039942d5b9 100644
--- a/sw/source/uibase/sidebar/PageFooterPanel.cxx
+++ b/sw/source/uibase/sidebar/PageFooterPanel.cxx
@@ -246,7 +246,7 @@ void PageFooterPanel::NotifyItemUpdate(
}
}
-IMPL_LINK_NOARG( PageFooterPanel, FooterToggleHdl, weld::ToggleButton&, void )
+IMPL_LINK_NOARG( PageFooterPanel, FooterToggleHdl, weld::Toggleable&, void )
{
bool IsChecked = mxFooterToggle->get_active();
mpFooterItem->SetValue(IsChecked);
diff --git a/sw/source/uibase/sidebar/PageFooterPanel.hxx b/sw/source/uibase/sidebar/PageFooterPanel.hxx
index aa67de6e760d..33294bf5fbb5 100644
--- a/sw/source/uibase/sidebar/PageFooterPanel.hxx
+++ b/sw/source/uibase/sidebar/PageFooterPanel.hxx
@@ -88,7 +88,7 @@ private:
static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem* pState);
- DECL_LINK( FooterToggleHdl, weld::ToggleButton&, void );
+ DECL_LINK( FooterToggleHdl, weld::Toggleable&, void );
DECL_LINK( FooterLRMarginHdl, weld::ComboBox&, void);
DECL_LINK( FooterSpacingHdl, weld::ComboBox&, void);
DECL_LINK( FooterLayoutHdl, weld::ComboBox&, void);
diff --git a/sw/source/uibase/sidebar/PageHeaderPanel.cxx b/sw/source/uibase/sidebar/PageHeaderPanel.cxx
index 9f7cd0b795d6..339d9c2ccc9f 100644
--- a/sw/source/uibase/sidebar/PageHeaderPanel.cxx
+++ b/sw/source/uibase/sidebar/PageHeaderPanel.cxx
@@ -249,7 +249,7 @@ void PageHeaderPanel::NotifyItemUpdate(
}
}
-IMPL_LINK_NOARG( PageHeaderPanel, HeaderToggleHdl, weld::ToggleButton&, void )
+IMPL_LINK_NOARG( PageHeaderPanel, HeaderToggleHdl, weld::Toggleable&, void )
{
bool IsChecked = mxHeaderToggle->get_active();
mpHeaderItem->SetValue(IsChecked);
diff --git a/sw/source/uibase/sidebar/PageHeaderPanel.hxx b/sw/source/uibase/sidebar/PageHeaderPanel.hxx
index bffc5d992b75..589c959eaafc 100644
--- a/sw/source/uibase/sidebar/PageHeaderPanel.hxx
+++ b/sw/source/uibase/sidebar/PageHeaderPanel.hxx
@@ -87,7 +87,7 @@ private:
static FieldUnit GetCurrentUnit(SfxItemState eState, const SfxPoolItem* pState);
- DECL_LINK( HeaderToggleHdl, weld::ToggleButton&, void );
+ DECL_LINK( HeaderToggleHdl, weld::Toggleable&, void );
DECL_LINK( HeaderLRMarginHdl, weld::ComboBox&, void);
DECL_LINK( HeaderSpacingHdl, weld::ComboBox&, void);
DECL_LINK( HeaderLayoutHdl, weld::ComboBox&, void);
diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx
index 5f40751cda2e..3dfd61a1f6fa 100644
--- a/sw/source/uibase/sidebar/PageMarginControl.cxx
+++ b/sw/source/uibase/sidebar/PageMarginControl.cxx
@@ -425,12 +425,11 @@ void PageMarginControl::ExecuteMarginLRChange(
{
if ( SfxViewFrame::Current() )
{
- std::unique_ptr<SvxLongLRSpaceItem> pPageLRMarginItem( new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ) );
- pPageLRMarginItem->SetLeft( nPageLeftMargin );
- pPageLRMarginItem->SetRight( nPageRightMargin );
+ SvxLongLRSpaceItem aPageLRMarginItem( 0, 0, SID_ATTR_PAGE_LRSPACE );
+ aPageLRMarginItem.SetLeft( nPageLeftMargin );
+ aPageLRMarginItem.SetRight( nPageRightMargin );
SfxViewFrame::Current()->GetBindings().GetDispatcher()->ExecuteList( SID_ATTR_PAGE_LRSPACE,
- SfxCallMode::RECORD, { pPageLRMarginItem.get() } );
- pPageLRMarginItem.reset();
+ SfxCallMode::RECORD, { &aPageLRMarginItem } );
}
}
@@ -440,12 +439,11 @@ void PageMarginControl::ExecuteMarginULChange(
{
if ( SfxViewFrame::Current() )
{
- std::unique_ptr<SvxLongULSpaceItem> pPageULMarginItem( new SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE ) );
- pPageULMarginItem->SetUpper( nPageTopMargin );
- pPageULMarginItem->SetLower( nPageBottomMargin );
+ SvxLongULSpaceItem aPageULMarginItem( 0, 0, SID_ATTR_PAGE_ULSPACE );
+ aPageULMarginItem.SetUpper( nPageTopMargin );
+ aPageULMarginItem.SetLower( nPageBottomMargin );
SfxViewFrame::Current()->GetBindings().GetDispatcher()->ExecuteList( SID_ATTR_PAGE_ULSPACE,
- SfxCallMode::RECORD, { pPageULMarginItem.get() } );
- pPageULMarginItem.reset();
+ SfxCallMode::RECORD, { &aPageULMarginItem } );
}
}
@@ -453,11 +451,10 @@ void PageMarginControl::ExecutePageLayoutChange( const bool bMirrored )
{
if ( SfxViewFrame::Current() )
{
- std::unique_ptr<SvxPageItem> pPageItem( new SvxPageItem( SID_ATTR_PAGE ) );
- pPageItem->SetPageUsage( bMirrored ? SvxPageUsage::Mirror : SvxPageUsage::All );
+ SvxPageItem aPageItem( SID_ATTR_PAGE );
+ aPageItem.SetPageUsage( bMirrored ? SvxPageUsage::Mirror : SvxPageUsage::All );
SfxViewFrame::Current()->GetBindings().GetDispatcher()->ExecuteList( SID_ATTR_PAGE,
- SfxCallMode::RECORD, { pPageItem.get() } );
- pPageItem.reset();
+ SfxCallMode::RECORD, { &aPageItem } );
}
}
diff --git a/sw/source/uibase/sidebar/PageSizeControl.cxx b/sw/source/uibase/sidebar/PageSizeControl.cxx
index 7fa49f4f75c3..76761edcdc1d 100644
--- a/sw/source/uibase/sidebar/PageSizeControl.cxx
+++ b/sw/source/uibase/sidebar/PageSizeControl.cxx
@@ -203,16 +203,16 @@ void PageSizeControl::ExecuteSizeChange( const Paper ePaper )
SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState( SID_ATTR_PAGE, pItem );
bLandscape = static_cast<const SvxPageItem*>(pItem)->IsLandscape();
- std::unique_ptr<SvxSizeItem> pPageSizeItem( new SvxSizeItem(SID_ATTR_PAGE_SIZE) );
+ SvxSizeItem aPageSizeItem(SID_ATTR_PAGE_SIZE);
Size aPageSize = SvxPaperInfo::GetPaperSize( ePaper, eUnit );
if ( bLandscape )
{
Swap( aPageSize );
}
- pPageSizeItem->SetSize( aPageSize );
+ aPageSizeItem.SetSize( aPageSize );
SfxViewFrame::Current()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE,
- SfxCallMode::RECORD, { pPageSizeItem.get() });
+ SfxCallMode::RECORD, { &aPageSizeItem });
}
diff --git a/sw/source/uibase/table/tablepg.hxx b/sw/source/uibase/table/tablepg.hxx
index 4c1171dd72eb..7c3a4ceea816 100644
--- a/sw/source/uibase/table/tablepg.hxx
+++ b/sw/source/uibase/table/tablepg.hxx
@@ -71,8 +71,8 @@ class SwFormatTablePage : public SfxTabPage
void Init();
void ModifyHdl(const weld::MetricSpinButton& rEdit, bool bAllowInconsistencies = false);
- DECL_LINK(AutoClickHdl, weld::ToggleButton&, void);
- DECL_LINK(RelWidthClickHdl, weld::ToggleButton&, void);
+ DECL_LINK(AutoClickHdl, weld::Toggleable&, void);
+ DECL_LINK(RelWidthClickHdl, weld::Toggleable&, void);
void RightModify();
DECL_LINK(ValueChangedHdl, weld::MetricSpinButton&, void);
@@ -120,7 +120,7 @@ class SwTableColumnPage : public SfxTabPage
DECL_LINK(AutoClickHdl, weld::Button&, void);
void ModifyHdl(const weld::MetricSpinButton* pEdit);
DECL_LINK(ValueChangedHdl, weld::MetricSpinButton&, void);
- DECL_LINK(ModeHdl, weld::ToggleButton&, void);
+ DECL_LINK(ModeHdl, weld::Toggleable&, void);
void UpdateCols( sal_uInt16 nCurrentPos );
SwTwips GetVisibleWidth(sal_uInt16 nPos);
void SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth);
@@ -162,13 +162,13 @@ class SwTextFlowPage : public SfxTabPage
std::unique_ptr<weld::ComboBox> m_xTextDirectionLB;
std::unique_ptr<weld::ComboBox> m_xVertOrientLB;
- DECL_LINK(PageBreakHdl_Impl, weld::ToggleButton&, void);
- DECL_LINK(ApplyCollClickHdl_Impl, weld::ToggleButton&, void);
- DECL_LINK(PageBreakPosHdl_Impl, weld::ToggleButton&, void);
- DECL_LINK(PageBreakTypeHdl_Impl, weld::ToggleButton&, void);
- DECL_LINK(PageNoClickHdl_Impl, weld::ToggleButton&, void);
- DECL_LINK(SplitHdl_Impl, weld::ToggleButton&, void);
- DECL_LINK(HeadLineCBClickHdl, weld::ToggleButton&, void);
+ DECL_LINK(PageBreakHdl_Impl, weld::Toggleable&, void);
+ DECL_LINK(ApplyCollClickHdl_Impl, weld::Toggleable&, void);
+ DECL_LINK(PageBreakPosHdl_Impl, weld::Toggleable&, void);
+ DECL_LINK(PageBreakTypeHdl_Impl, weld::Toggleable&, void);
+ DECL_LINK(PageNoClickHdl_Impl, weld::Toggleable&, void);
+ DECL_LINK(SplitHdl_Impl, weld::Toggleable&, void);
+ DECL_LINK(HeadLineCBClickHdl, weld::Toggleable&, void);
public:
SwTextFlowPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 856dc09f9db3..a432a4de8948 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -103,18 +103,18 @@ static sal_uInt16 lcl_GetNextZoomStep(sal_uInt16 nCurrentZoom, bool bZoomIn)
const int nZoomArrSize = static_cast<int>(SAL_N_ELEMENTS(aZoomArr));
if (bZoomIn)
{
- for(int i = nZoomArrSize - 1; i >= 0; --i)
+ for(sal_uInt16 i : aZoomArr)
{
- if(nCurrentZoom > aZoomArr[i] || !i)
- return aZoomArr[i];
+ if(nCurrentZoom < i)
+ return i;
}
}
else
{
- for(sal_uInt16 i : aZoomArr)
+ for(int i = nZoomArrSize - 1; i >= 0; --i)
{
- if(nCurrentZoom < i)
- return i;
+ if(nCurrentZoom > aZoomArr[i] || !i)
+ return aZoomArr[i];
}
}
return bZoomIn ? MAX_PREVIEW_ZOOM : MIN_PREVIEW_ZOOM;
@@ -170,10 +170,10 @@ SwPagePreviewWin::SwPagePreviewWin( vcl::Window *pParent, SwPagePreview& rPView
, maPaintedPreviewDocRect(tools::Rectangle(0,0,0,0))
, mpPgPreviewLayout(nullptr)
{
- SetOutDevViewType( OutDevViewType::PrintPreview );
+ GetOutDev()->SetOutDevViewType( OutDevViewType::PrintPreview );
SetHelpId(HID_PAGEPREVIEW);
- SetFillColor( GetBackground().GetColor() );
- SetLineColor( GetBackground().GetColor());
+ GetOutDev()->SetFillColor( GetBackground().GetColor() );
+ GetOutDev()->SetLineColor( GetBackground().GetColor());
SetMapMode( MapMode(MapUnit::MapTwip) );
const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(false);
@@ -610,7 +610,7 @@ void SwPagePreview::ExecPgUpAndPgDown( const bool _bPgUp,
nNewSelectedPageNum = 1;
}
else
- nScrollAmount = - std::min( m_pViewWin->GetOutputSize().Height(),
+ nScrollAmount = - std::min( m_pViewWin->GetOutDev()->GetOutputSize().Height(),
m_pViewWin->GetPaintedPreviewDocRect().Top() );
}
else
@@ -624,7 +624,7 @@ void SwPagePreview::ExecPgUpAndPgDown( const bool _bPgUp,
nNewSelectedPageNum = mnPageCount;
}
else
- nScrollAmount = std::min( m_pViewWin->GetOutputSize().Height(),
+ nScrollAmount = std::min( m_pViewWin->GetOutDev()->GetOutputSize().Height(),
( pPagePreviewLay->GetPreviewDocSize().Height() -
m_pViewWin->GetPaintedPreviewDocRect().Bottom() ) );
}
@@ -1006,8 +1006,8 @@ void SwPagePreview::GetState( SfxItemSet& rSet )
case SID_ZOOM_OUT:
{
const SwViewOption* pVOpt = GetViewShell()->GetViewOptions();
- if((SID_ZOOM_OUT == nWhich && pVOpt->GetZoom() >= MAX_PREVIEW_ZOOM)||
- (SID_ZOOM_IN == nWhich && pVOpt->GetZoom() <= MIN_PREVIEW_ZOOM))
+ if((SID_ZOOM_IN == nWhich && pVOpt->GetZoom() >= MAX_PREVIEW_ZOOM) ||
+ (SID_ZOOM_OUT == nWhich && pVOpt->GetZoom() <= MIN_PREVIEW_ZOOM))
{
rSet.DisableItem(nWhich);
}
@@ -1304,7 +1304,7 @@ void SwPagePreview::InnerResizePixel( const Point &rOfst, const Size &rSize, bo
CalcAndSetBorderPixel( aBorder );
tools::Rectangle aRect( rOfst, rSize );
aRect += aBorder;
- ViewResizePixel( *m_pViewWin, aRect.TopLeft(), aRect.GetSize(),
+ ViewResizePixel( *m_pViewWin->GetOutDev(), aRect.TopLeft(), aRect.GetSize(),
m_pViewWin->GetOutputSizePixel(),
*m_pVScrollbar, *m_pHScrollbar, *m_pScrollFill );
@@ -1333,7 +1333,7 @@ void SwPagePreview::OuterResizePixel( const Point &rOfst, const Size &rSize )
SvBorder aBorderNew;
CalcAndSetBorderPixel( aBorderNew );
- ViewResizePixel( *m_pViewWin, rOfst, rSize, m_pViewWin->GetOutputSizePixel(),
+ ViewResizePixel( *m_pViewWin->GetOutDev(), rOfst, rSize, m_pViewWin->GetOutputSizePixel(),
*m_pVScrollbar, *m_pHScrollbar, *m_pScrollFill );
}
@@ -1434,7 +1434,7 @@ IMPL_LINK( SwPagePreview, EndScrollHdl, ScrollBar *, p, void )
if ( GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow() )
{
// Scroll how many pages ??
- const sal_uInt16 nThmbPos = static_cast<sal_uInt16>(pScrollbar->GetThumbPos());
+ const sal_uInt16 nThmbPos = o3tl::narrowing<sal_uInt16>(pScrollbar->GetThumbPos());
// adjust to new preview functionality
if( nThmbPos != m_pViewWin->SelectedPage() )
{
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index c874e021375a..7880e4fcacd8 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -212,11 +212,6 @@ IMPL_LINK_NOARG(SwView, FormControlActivated, LinkParamNone*, void)
}
}
-IMPL_LINK_NOARG(SwView, ExchangeDatabaseHandler, weld::Button&, void)
-{
- GetDispatcher().Execute(FN_CHANGE_DBFIELD);
-}
-
namespace
{
uno::Reference<frame::XLayoutManager> getLayoutManager(const SfxViewFrame& rViewFrame)
@@ -453,9 +448,7 @@ void SwView::SelectShell()
}
// Show Mail Merge toolbar initially for documents with Database fields
- if (!m_bInitOnceCompleted
- && (GetWrtShell().IsAnyDatabaseFieldInDoc()
- || !GetWrtShell().GetDBData().sDataSource.isEmpty()))
+ if (!m_bInitOnceCompleted && GetWrtShell().IsAnyDatabaseFieldInDoc())
ShowUIElement("private:resource/toolbar/mailmerge");
// Activate the toolbar to the new selection which also was active last time.
@@ -1053,6 +1046,9 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
if( !m_pVScrollbar->IsVisible( true ) )
ShowVScrollbar( false );
+ if (m_pWrtShell && m_pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton())
+ m_pWrtShell->InvalidateOutlineContentVisibility();
+
GetViewFrame()->GetWindow().AddChildEventListener( LINK( this, SwView, WindowChildEventListener ) );
}
@@ -1214,7 +1210,7 @@ void SwView::ReadUserData( const OUString &rUserData, bool bBrowse )
sal_Int32 nOff = 0;
SvxZoomType eZoom;
if( !m_pWrtShell->GetViewOptions()->getBrowseMode() )
- eZoom = static_cast<SvxZoomType>(static_cast<sal_uInt16>(rUserData.getToken(nOff, ';', nPos ).toInt32()));
+ eZoom = static_cast<SvxZoomType>(o3tl::narrowing<sal_uInt16>(rUserData.getToken(nOff, ';', nPos ).toInt32()));
else
{
eZoom = SvxZoomType::PERCENT;
@@ -1320,6 +1316,8 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
bGotZoomFactor = false, bGotIsSelectedFrame = false,
bGotViewLayoutColumns = false, bGotViewLayoutBookMode = false,
bBrowseMode = false, bGotBrowseMode = false;
+ bool bKeepRatio = pVOpt->IsKeepRatio();
+ bool bGotKeepRatio = false;
for (const beans::PropertyValue& rValue : rSequence)
{
@@ -1387,6 +1385,11 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
rValue.Value >>= bBrowseMode;
bGotBrowseMode = true;
}
+ else if (rValue.Name == "KeepRatio")
+ {
+ rValue.Value >>= bKeepRatio;
+ bGotKeepRatio = true;
+ }
// Fallback to common SdrModel processing
else
GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->ReadUserDataSequenceValue(&rValue);
@@ -1463,6 +1466,14 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
m_pWrtShell->SetMacroExecAllowed( bSavedFlagValue );
}
+ if (bGotKeepRatio && bKeepRatio != pVOpt->IsKeepRatio())
+ {
+ // Got a custom value, then it makes sense to trigger notifications.
+ SwViewOption aUsrPref(*pVOpt);
+ aUsrPref.SetKeepRatio(bKeepRatio);
+ SW_MOD()->ApplyUsrPref(aUsrPref, this);
+ }
+
// Set ViewLayoutSettings
const bool bSetViewLayoutSettings = bGotViewLayoutColumns && bGotViewLayoutBookMode &&
( pVOpt->GetViewLayoutColumns() != nViewLayoutColumns || pVOpt->IsViewLayoutBookMode() != bViewLayoutBookMode );
@@ -1500,7 +1511,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
Point aTopLeft(aVis.TopLeft());
// make sure the document is still centered
const SwTwips lBorder = IsDocumentBorder() ? DOCUMENTBORDER : 2 * DOCUMENTBORDER;
- SwTwips nEditWidth = GetEditWin().GetOutputSize().Width();
+ SwTwips nEditWidth = GetEditWin().GetOutDev()->GetOutputSize().Width();
if(nEditWidth > (m_aDocSz.Width() + lBorder ))
aTopLeft.setX( ( m_aDocSz.Width() + lBorder - nEditWidth ) / 2 );
else
@@ -1561,6 +1572,9 @@ void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSe
aVector.push_back(comphelper::makePropertyValue("IsSelectedFrame", FrameTypeFlags::NONE != m_pWrtShell->GetSelFrameType()));
+ aVector.push_back(
+ comphelper::makePropertyValue("KeepRatio", m_pWrtShell->GetViewOptions()->IsKeepRatio()));
+
rSequence = comphelper::containerToSequence(aVector);
// Common SdrModel processing
@@ -1642,23 +1656,6 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
else
{
- if (auto pSfxEventHint = dynamic_cast<const SfxEventHint*>(&rHint))
- {
- switch( pSfxEventHint->GetEventId() )
- {
- case SfxEventHintId::CreateDoc:
- case SfxEventHintId::OpenDoc:
- {
- OUString sDataSourceName = GetDataSourceName();
- if ( !sDataSourceName.isEmpty() && !IsDataSourceAvailable(sDataSourceName))
- AppendDataSourceInfobar();
- }
- break;
- default:
- break;
- }
- }
-
SfxHintId nId = rHint.GetId();
switch ( nId )
@@ -1922,19 +1919,6 @@ bool SwView::IsDataSourceAvailable(const OUString sDataSourceName)
return xDatabaseContext->hasByName(sDataSourceName);
}
-void SwView::AppendDataSourceInfobar()
-{
- auto pInfoBar = GetViewFrame()->AppendInfoBar("datasource", "",
- SwResId(STR_DATASOURCE_NOT_AVAILABLE),
- InfobarType::WARNING);
- if (!pInfoBar)
- return;
-
- weld::Button& rBtn = pInfoBar->addButton();
- rBtn.set_label(SwResId(STR_EXCHANGE_DATABASE));
- rBtn.connect_clicked(LINK(this, SwView, ExchangeDatabaseHandler));
-}
-
namespace sw {
void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb)
diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx
index 8d7e8521664e..82ee7b2b83cb 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -360,7 +360,7 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
void SwView::ExecViewOptions(SfxRequest &rReq)
{
- std::unique_ptr<SwViewOption> pOpt(new SwViewOption( *GetWrtShell().GetViewOptions() ));
+ std::optional<SwViewOption> pOpt( *GetWrtShell().GetViewOptions() );
bool bModified = GetWrtShell().IsModified();
int eState = STATE_TOGGLE;
@@ -603,33 +603,20 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
SwWrtShell &rSh = GetWrtShell();
- // move cursor to top of document
- if (rSh.IsSelFrameMode())
- {
- rSh.UnSelectFrame();
- rSh.LeaveSelFrameMode();
- }
- rSh.EnterStdMode();
- rSh.SttEndDoc(true);
-
- if (!bFlag)
- {
- // make all content visible
- const SwOutlineNodes& rOutlineNds = rSh.GetNodes().GetOutLineNds();
- for (SwOutlineNodes::size_type nPos = 0; nPos < rOutlineNds.size(); ++nPos)
- {
- SwNode* pNd = rOutlineNds[nPos];
- bool bOutlineContentVisibleAttr = true;
- pNd->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
- if (!bOutlineContentVisibleAttr)
- {
- rSh.ToggleOutlineContentVisibility(nPos);
- pNd->GetTextNode()->SetAttrOutlineContentVisible(false);
- }
- }
- }
+ if (!bFlag) // Outline folding is being turned ON!
+ rSh.MakeAllFoldedOutlineContentVisible();
pOpt->SetShowOutlineContentVisibilityButton(bFlag);
+
+ // Apply option change here so if toggling the outline folding feature ON
+ // the invalidate function will see this.
+ rSh.StartAction();
+ rSh.ApplyViewOptions(*pOpt);
+ rSh.EndAction();
+
+ if (bFlag) // Outline folding is being turned OFF!
+ rSh.MakeAllFoldedOutlineContentVisible(false);
+
break;
}
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 39752c694d31..0e9694534c44 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -146,6 +146,8 @@
#include <basegfx/utils/zoomtools.hxx>
+#include <ndtxt.hxx>
+
const char sStatusDelim[] = " : ";
using namespace sfx2;
@@ -539,14 +541,6 @@ void SwView::Execute(SfxRequest &rReq)
bool bIgnore = false;
switch( nSlot )
{
- case SID_INSPECTOR_DECK:
- {
- OUString deckId;
- if (nSlot == SID_INSPECTOR_DECK)
- deckId = "InspectorDeck";
- ::sfx2::sidebar::Sidebar::ToggleDeck(deckId, GetViewFrame());
- }
- break;
case SID_CREATE_SW_DRAWVIEW:
m_pWrtShell->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
break;
@@ -589,7 +583,7 @@ void SwView::Execute(SfxRequest &rReq)
case SID_ZOOM_OUT:
{
tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
- if (SID_ZOOM_OUT == nSlot)
+ if (SID_ZOOM_IN == nSlot)
nFact = basegfx::zoomtools::zoomIn(nFact);
else
nFact = basegfx::zoomtools::zoomOut(nFact);
@@ -1193,8 +1187,14 @@ void SwView::Execute(SfxRequest &rReq)
{
m_pWrtShell->EnterStdMode();
size_t nPos(m_pWrtShell->GetOutlinePos());
- m_pWrtShell->ToggleOutlineContentVisibility(nPos);
- m_pWrtShell->GotoOutline(nPos);
+ if (nPos != SwOutlineNodes::npos)
+ {
+ SwNode* pNode = m_pWrtShell->GetNodes().GetOutLineNds()[nPos];
+ pNode->GetTextNode()->SetAttrOutlineContentVisible(
+ !m_pWrtShell->GetAttrOutlineContentVisible(nPos));
+ m_pWrtShell->InvalidateOutlineContentVisibility();
+ m_pWrtShell->GotoOutline(nPos);
+ }
}
break;
case FN_NAV_ELEMENT:
@@ -1402,7 +1402,12 @@ void SwView::Execute(SfxRequest &rReq)
const sal_uLong handleNum = handleNumItem->GetValue();
const sal_uLong newPosX = newPosXTwips->GetValue();
const sal_uLong newPosY = newPosYTwips->GetValue();
- pSdrView->MoveShapeHandle(handleNum, Point(newPosX, newPosY), OrdNum ? OrdNum->GetValue() : -1);
+ const Point mPoint(newPosX, newPosY);
+ const SdrHdl* handle = pSdrView->GetHdlList().GetHdl(handleNum);
+ if (handle->GetKind() == SdrHdlKind::Anchor || handle->GetKind() == SdrHdlKind::Anchor_TR)
+ m_pWrtShell->FindAnchorPos(mPoint, /*bMoveIt=*/true);
+ else
+ pSdrView->MoveShapeHandle(handleNum, mPoint, OrdNum ? OrdNum->GetValue() : -1);
}
break;
}
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index b676999f6448..3ecfa562009c 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -161,7 +161,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
{
Size aDocSize( m_pWrtShell->GetDocSize() );
const SwRect& rVisArea = comphelper::LibreOfficeKit::isActive() ?
- m_pWrtShell->getLOKVisibleArea() : m_pWrtShell->VisArea();
+ SwRect(m_pWrtShell->getLOKVisibleArea()) : m_pWrtShell->VisArea();
Point aPos( rVisArea.Center() );
tools::Rectangle aObjRect( pObj->GetLogicRect() );
@@ -580,7 +580,7 @@ bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin,
if(pView)
{
- Color aBackground(pSh->GetShapeBackgrd());
+ Color aBackground(pSh->GetShapeBackground());
pView->SetBackgroundColor(aBackground);
}
diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx
index f2d3c5747d9e..8d986a6d056d 100644
--- a/sw/source/uibase/uiview/viewmdi.cxx
+++ b/sw/source/uibase/uiview/viewmdi.cxx
@@ -155,7 +155,7 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType,
}
nFac = std::max( tools::Long( MINZOOM ), nFac );
- const sal_uInt16 nZoomFac = static_cast<sal_uInt16>(nFac);
+ const sal_uInt16 nZoomFac = o3tl::narrowing<sal_uInt16>(nFac);
SwViewOption aOpt( *pOpt );
if ( !GetViewFrame()->GetFrame().IsInPlace() )
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index b5ebbb258187..c7b6a48a4179 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -43,6 +43,8 @@
#include "viewfunc.hxx"
+#include <FrameControlsManager.hxx>
+
// The SetVisArea of the DocShell must not be called from InnerResizePixel.
// But our adjustments must take place.
static bool bProtectDocShellVisArea = false;
@@ -244,7 +246,7 @@ void SwView::SetVisArea( const tools::Rectangle &rRect, bool bUpdateScrollbar )
if ( m_pWrtShell )
{
- m_pWrtShell->VisPortChgd( m_aVisArea );
+ m_pWrtShell->VisPortChgd( SwRect(m_aVisArea) );
if ( aOldSz != m_pWrtShell->VisArea().SSize() &&
( std::abs(aOldSz.Width() - m_pWrtShell->VisArea().Width()) > 2 ||
std::abs(aOldSz.Height() - m_pWrtShell->VisArea().Height()) > 2 ) )
@@ -301,6 +303,9 @@ void SwView::SetVisArea( const Point &rPt, bool bUpdateScrollbar )
if ( aPt == m_aVisArea.TopLeft() )
return;
+ if (m_pWrtShell && m_pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton())
+ GetEditWin().GetFrameControlsManager().HideControls(FrameControlType::Outline);
+
const tools::Long lXDiff = m_aVisArea.Left() - aPt.X();
const tools::Long lYDiff = m_aVisArea.Top() - aPt.Y();
SetVisArea( tools::Rectangle( aPt,
@@ -980,7 +985,7 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize, bool )
}
Size aEditSz( GetEditWin().GetOutputSizePixel() );
- ViewResizePixel( GetEditWin(), rOfst, aSz, aEditSz, *m_pVScrollbar,
+ ViewResizePixel( *GetEditWin().GetOutDev(), rOfst, aSz, aEditSz, *m_pVScrollbar,
*m_pHScrollbar, *m_pScrollFill, m_pVRuler, m_pHRuler,
m_pWrtShell->GetViewOptions()->IsVRulerRight());
if ( m_bShowAtResize )
@@ -1076,7 +1081,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
SvBorder aBorder;
CalcAndSetBorderPixel( aBorder );
const Size aEditSz( GetEditWin().GetOutputSizePixel() );
- ViewResizePixel( GetEditWin(), rOfst, rSize, aEditSz, *m_pVScrollbar,
+ ViewResizePixel( *GetEditWin().GetOutDev(), rOfst, rSize, aEditSz, *m_pVScrollbar,
*m_pHScrollbar, *m_pScrollFill, m_pVRuler, m_pHRuler,
m_pWrtShell->GetViewOptions()->IsVRulerRight() );
if ( m_bShowAtResize )
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index 3b4b4375a966..911d2cedd1eb 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -606,7 +606,7 @@ bool SwView::SearchAll()
m_pWrtShell->StartOfSection();
}
s_bExtra = false;
- sal_uInt16 nFound = static_cast<sal_uInt16>(FUNC_Search( aOpts ));
+ sal_uInt16 nFound = o3tl::narrowing<sal_uInt16>(FUNC_Search( aOpts ));
s_bFound = 0 != nFound;
m_pWrtShell->EndAllAction();
@@ -741,9 +741,9 @@ sal_uLong SwView::FUNC_Search( const SwSearchOptions& rOptions )
m_pWrtShell->SttSelect();
static const sal_uInt16 aSearchAttrRange[] = {
- RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
+ RES_FRMATR_BEGIN, RES_FRMATR_END-1,
SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP,
0 };
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index 06b740042bb0..bacc2f395583 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -77,8 +77,8 @@ void SwView::GetState(SfxItemSet &rSet)
case SID_ZOOM_OUT:
{
tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
- if ((SID_ZOOM_OUT == nWhich && nFact >= tools::Long(600)) ||
- (SID_ZOOM_IN == nWhich && nFact <= tools::Long(20)))
+ if ((SID_ZOOM_IN == nWhich && nFact >= tools::Long(600)) ||
+ (SID_ZOOM_OUT == nWhich && nFact <= tools::Long(20)))
{
rSet.DisableItem(nWhich);
}
@@ -305,7 +305,7 @@ void SwView::GetState(SfxItemSet &rSet)
{
const SvxTabStopItem& rDefTabs = m_pWrtShell->GetDefault(RES_PARATR_TABSTOP);
rSet.Put( SfxUInt16Item( nWhich,
- static_cast<sal_uInt16>(::GetTabDist(rDefTabs))));
+ o3tl::narrowing<sal_uInt16>(::GetTabDist(rDefTabs))));
}
break;
case SID_ATTR_LANGUAGE:
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 73da69f4f326..3a1bd7e2b1bd 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -125,7 +125,7 @@ static void lcl_ConvertToCols(const SvxColumnItem& rColItem,
{
OSL_ENSURE(rColItem[i+1].nStart >= rColItem[i].nEnd,"overlapping columns" );
const tools::Long nStart = std::max(rColItem[i+1].nStart, rColItem[i].nEnd);
- const sal_uInt16 nRight = static_cast<sal_uInt16>((nStart - rColItem[i].nEnd) / 2);
+ const sal_uInt16 nRight = o3tl::narrowing<sal_uInt16>((nStart - rColItem[i].nEnd) / 2);
const tools::Long nWidth = rColItem[i].nEnd - rColItem[i].nStart + nLeft + nRight;
@@ -141,7 +141,7 @@ static void lcl_ConvertToCols(const SvxColumnItem& rColItem,
// The difference between the total sum of the desired width and the so far
// calculated columns and margins should result in the width of the last column.
- rArr[rColItem.Count()-1].SetWishWidth( rCols.GetWishWidth() - static_cast<sal_uInt16>(nSumAll) );
+ rArr[rColItem.Count()-1].SetWishWidth( rCols.GetWishWidth() - o3tl::narrowing<sal_uInt16>(nSumAll) );
rCols.SetOrtho(false, 0, 0 );
}
@@ -204,23 +204,23 @@ static void ResizeFrameCols(SwFormatCol& rCol,
SwColumn* pCol = &i;
tools::Long nVal = pCol->GetWishWidth();
lcl_Scale(nVal, nScale);
- pCol->SetWishWidth(static_cast<sal_uInt16>(nVal));
+ pCol->SetWishWidth(o3tl::narrowing<sal_uInt16>(nVal));
nVal = pCol->GetLeft();
lcl_Scale(nVal, nScale);
- pCol->SetLeft(static_cast<sal_uInt16>(nVal));
+ pCol->SetLeft(o3tl::narrowing<sal_uInt16>(nVal));
nVal = pCol->GetRight();
lcl_Scale(nVal, nScale);
- pCol->SetRight(static_cast<sal_uInt16>(nVal));
+ pCol->SetRight(o3tl::narrowing<sal_uInt16>(nVal));
}
lcl_Scale(nNewWishWidth, nScale);
lcl_Scale(nWishDiff, nScale);
}
- rCol.SetWishWidth( static_cast<sal_uInt16>(nNewWishWidth) );
+ rCol.SetWishWidth( o3tl::narrowing<sal_uInt16>(nNewWishWidth) );
if( nLeftDelta >= 2 || nLeftDelta <= -2)
- rArr.front().SetWishWidth(rArr.front().GetWishWidth() + static_cast<sal_uInt16>(nWishDiff));
+ rArr.front().SetWishWidth(rArr.front().GetWishWidth() + o3tl::narrowing<sal_uInt16>(nWishDiff));
else
- rArr.back().SetWishWidth(rArr.back().GetWishWidth() + static_cast<sal_uInt16>(nWishDiff));
+ rArr.back().SetWishWidth(rArr.back().GetWishWidth() + o3tl::narrowing<sal_uInt16>(nWishDiff));
// Reset auto width
rCol.SetOrtho(false, 0, 0 );
}
@@ -510,9 +510,9 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
const bool bHead = bool(nFrameType & FrameTypeFlags::HEADER);
SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() );
if ( bHead )
- aUL.SetUpper( static_cast<sal_uInt16>(aLongULSpace.GetUpper()) );
+ aUL.SetUpper( o3tl::narrowing<sal_uInt16>(aLongULSpace.GetUpper()) );
else
- aUL.SetLower( static_cast<sal_uInt16>(aLongULSpace.GetLower()) );
+ aUL.SetLower( o3tl::narrowing<sal_uInt16>(aLongULSpace.GetLower()) );
aDesc.GetMaster().SetFormatAttr( aUL );
if( (bHead && pHeaderFormat) || (!bHead && pFooterFormat) )
@@ -531,8 +531,8 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
else
{
SvxULSpaceItem aUL(RES_UL_SPACE);
- aUL.SetUpper(static_cast<sal_uInt16>(aLongULSpace.GetUpper()));
- aUL.SetLower(static_cast<sal_uInt16>(aLongULSpace.GetLower()));
+ aUL.SetUpper(o3tl::narrowing<sal_uInt16>(aLongULSpace.GetUpper()));
+ aUL.SetLower(o3tl::narrowing<sal_uInt16>(aLongULSpace.GetLower()));
aDesc.GetMaster().SetFormatAttr(aUL);
}
@@ -550,8 +550,8 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
SwPageDesc aDesc( rDesc );
{
SvxULSpaceItem aUL(RES_UL_SPACE);
- aUL.SetUpper(static_cast<sal_uInt16>(aLongULSpace.GetUpper()));
- aUL.SetLower(static_cast<sal_uInt16>(aLongULSpace.GetLower()));
+ aUL.SetUpper(o3tl::narrowing<sal_uInt16>(aLongULSpace.GetUpper()));
+ aUL.SetLower(o3tl::narrowing<sal_uInt16>(aLongULSpace.GetLower()));
aDesc.GetMaster().SetFormatAttr(aUL);
}
rSh.ChgPageDesc( nDescId, aDesc );
@@ -1956,8 +1956,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
aRect.Pos() += aTmpRect.Pos();
// make relative to page position:
- aColItem.SetLeft (static_cast<sal_uInt16>( aRect.Left() - rPageRect.Left() ));
- aColItem.SetRight(static_cast<sal_uInt16>( rPageRect.Right() - aRect.Right()));
+ aColItem.SetLeft (o3tl::narrowing<sal_uInt16>( aRect.Left() - rPageRect.Left() ));
+ aColItem.SetRight(o3tl::narrowing<sal_uInt16>( rPageRect.Right() - aRect.Right()));
}
aColItem.SetOrtho(aColItem.CalcOrtho());
@@ -2028,12 +2028,12 @@ void SwView::StateTabWin(SfxItemSet& rSet)
{
if (bVerticalWriting)
{
- aColItem.SetLeft(static_cast<sal_uInt16>(rPagePrtRect.Top()));
+ aColItem.SetLeft(o3tl::narrowing<sal_uInt16>(rPagePrtRect.Top()));
aColItem.SetRight(sal_uInt16(nPageHeight - rPagePrtRect.Bottom()));
}
else
{
- aColItem.SetLeft(static_cast<sal_uInt16>(rPagePrtRect.Left()));
+ aColItem.SetLeft(o3tl::narrowing<sal_uInt16>(rPagePrtRect.Left()));
aColItem.SetRight(sal_uInt16(nPageWidth - rPagePrtRect.Right()));
}
}
@@ -2203,9 +2203,9 @@ void SwView::StateTabWin(SfxItemSet& rSet)
: CurRectType::Page, pPt ));
// The width of the frame or within the page margins.
- const sal_uInt16 nTotalWidth = static_cast<sal_uInt16>(aRect.Width());
+ const sal_uInt16 nTotalWidth = o3tl::narrowing<sal_uInt16>(aRect.Width());
// The entire frame width - The difference is twice the distance to the edge.
- const sal_uInt16 nOuterWidth = static_cast<sal_uInt16>(aAbsRect.Width());
+ const sal_uInt16 nOuterWidth = o3tl::narrowing<sal_uInt16>(aAbsRect.Width());
int nWidth = 0,
nEnd = 0;
aRectangle.SetLeft( 0 );
@@ -2325,7 +2325,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
aRect.Pos() += rSh.GetAnyCurRect( CurRectType::FlyEmbedded,
pPt ).Pos();
- const sal_uInt16 nTotalWidth = static_cast<sal_uInt16>(aRect.Width());
+ const sal_uInt16 nTotalWidth = o3tl::narrowing<sal_uInt16>(aRect.Width());
// Initialize nStart and nEnd for nNum == 0
int nWidth = 0,
nStart = 0,
@@ -2341,7 +2341,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
{
const SwColumn* pCol = &rCols[i];
nStart = pCol->GetLeft() + nWidth;
- nWidth += pCols->CalcColWidth( static_cast<sal_uInt16>(i), nTotalWidth );
+ nWidth += pCols->CalcColWidth( o3tl::narrowing<sal_uInt16>(i), nTotalWidth );
nEnd = nWidth - pCol->GetRight();
}
if( bFrame || bColSct )
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index 26454819b9c1..98e71d8e09a8 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -134,6 +134,7 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_EMBED_COMPLEX_SCRIPT_FONTS,
HANDLE_EMBED_SYSTEM_FONTS,
HANDLE_TAB_OVER_MARGIN,
+ HANDLE_TAB_OVER_SPACING,
HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK,
HANDLE_SURROUND_TEXT_WRAP_SMALL,
HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING,
@@ -228,6 +229,7 @@ static rtl::Reference<MasterPropertySetInfo> lcl_createSettingsInfo()
{ OUString("EmbedComplexScriptFonts"), HANDLE_EMBED_COMPLEX_SCRIPT_FONTS, cppu::UnoType<bool>::get(), 0},
{ OUString("EmbedSystemFonts"), HANDLE_EMBED_SYSTEM_FONTS, cppu::UnoType<bool>::get(), 0},
{ OUString("TabOverMargin"), HANDLE_TAB_OVER_MARGIN, cppu::UnoType<bool>::get(), 0},
+ { OUString("TabOverSpacing"), HANDLE_TAB_OVER_SPACING, cppu::UnoType<bool>::get(), 0},
{ OUString("TreatSingleColumnBreakAsPageBreak"), HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK, cppu::UnoType<bool>::get(), 0},
{ OUString("SurroundTextWrapSmall"), HANDLE_SURROUND_TEXT_WRAP_SMALL, cppu::UnoType<bool>::get(), 0},
{ OUString("ApplyParagraphMarkFormatToNumbering"), HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, cppu::UnoType<bool>::get(), 0},
@@ -449,15 +451,11 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
SvMemoryStream aStream (aSequence.getArray(), nSize,
StreamMode::READ );
aStream.Seek ( STREAM_SEEK_TO_BEGIN );
- static sal_uInt16 const nRange[] =
- {
- FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER,
- SID_HTML_MODE, SID_HTML_MODE,
+ auto pItemSet = std::make_unique<SfxItemSet>( mpDoc->GetAttrPool(), svl::Items<
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
- 0
- };
- auto pItemSet = std::make_unique<SfxItemSet>( mpDoc->GetAttrPool(), nRange );
+ SID_HTML_MODE, SID_HTML_MODE,
+ FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER>{} );
VclPtr<SfxPrinter> pPrinter = SfxPrinter::Create ( aStream, std::move(pItemSet) );
assert (! pPrinter->isDisposed() );
// set printer only once; in _postSetValues
@@ -894,6 +892,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::TAB_OVER_MARGIN, bTmp);
}
break;
+ case HANDLE_TAB_OVER_SPACING:
+ {
+ bool bTmp = *o3tl::doAccess<bool>(rValue);
+ mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::TAB_OVER_SPACING, bTmp);
+ }
+ break;
case HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK:
{
bool bTmp = *o3tl::doAccess<bool>(rValue);
@@ -1441,6 +1445,11 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
rValue <<= mpDoc->getIDocumentSettingAccess().get( DocumentSettingId::TAB_OVER_MARGIN );
}
break;
+ case HANDLE_TAB_OVER_SPACING:
+ {
+ rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::TAB_OVER_SPACING);
+ }
+ break;
case HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK:
{
rValue <<= mpDoc->getIDocumentSettingAccess().get( DocumentSettingId::TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK );
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index 754f4debef14..c5689f63a747 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -491,13 +491,15 @@ sal_Int32 SwXAutoTextGroup::getCount()
uno::Any SwXAutoTextGroup::getByIndex(sal_Int32 nIndex)
{
SolarMutexGuard aGuard;
- std::unique_ptr<SwTextBlocks> pGlosGroup(pGlossaries ? pGlossaries->GetGroupDoc(m_sGroupName) : nullptr);
+ if (!pGlossaries)
+ throw uno::RuntimeException();
+ std::unique_ptr<SwTextBlocks> pGlosGroup(pGlossaries->GetGroupDoc(m_sGroupName));
if (!pGlosGroup || pGlosGroup->GetError())
throw uno::RuntimeException();
const sal_uInt16 nCount = pGlosGroup->GetCount();
if (nIndex < 0 || nIndex >= static_cast<sal_Int32>(nCount))
throw lang::IndexOutOfBoundsException();
- return getByName(pGlosGroup->GetShortName(static_cast<sal_uInt16>(nIndex)));
+ return getByName(pGlosGroup->GetShortName(o3tl::narrowing<sal_uInt16>(nIndex)));
}
uno::Type SwXAutoTextGroup::getElementType()
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx
index e2662e00e342..fa1c432d7591 100644
--- a/sw/source/uibase/uno/unomod.cxx
+++ b/sw/source/uibase/uno/unomod.cxx
@@ -645,7 +645,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
sal_Int16 nZoom = 0;
if(!(rValue >>= nZoom) || nZoom > MAXZOOM || nZoom < MINZOOM)
throw lang::IllegalArgumentException();
- mpViewOption->SetZoom(static_cast<sal_uInt16>(nZoom));
+ mpViewOption->SetZoom(o3tl::narrowing<sal_uInt16>(nZoom));
mbApplyZoom = true;
}
break;
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index 3059016abdfe..d1acaa8f9e10 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -463,7 +463,7 @@ SdrObject* SwXTextView::GetControl(
SdrObject* pControl = nullptr;
if ( pFormShell && pDrawView && pWindow )
- pControl = pFormShell->GetFormControl( xModel, *pDrawView, *pWindow, xToFill );
+ pControl = pFormShell->GetFormControl( xModel, *pDrawView, *pWindow->GetOutDev(), xToFill );
return pControl;
}
@@ -487,7 +487,7 @@ uno::Reference< form::runtime::XFormController > SAL_CALL SwXTextView::getFormCo
uno::Reference< form::runtime::XFormController > xController;
if ( pFormShell && pDrawView && pWindow )
- xController = FmFormShell::GetFormController( Form, *pDrawView, *pWindow );
+ xController = FmFormShell::GetFormController( Form, *pDrawView, *pWindow->GetOutDev() );
return xController;
}
@@ -741,7 +741,7 @@ void SwXTextView::NotifyDBChanged()
aURL.Complete = OUString::createFromAscii(SwXDispatch::GetDBChangeURL());
m_SelChangedListeners.forEach<XDispatch>(
- DispatchListener(aURL, Sequence<PropertyValue>(0)));
+ DispatchListener(aURL, {}));
}
uno::Reference< beans::XPropertySetInfo > SAL_CALL SwXTextView::getPropertySetInfo( )
diff --git a/sw/source/uibase/utlui/attrdesc.cxx b/sw/source/uibase/utlui/attrdesc.cxx
index 6331992935c4..e20b38787f97 100644
--- a/sw/source/uibase/utlui/attrdesc.cxx
+++ b/sw/source/uibase/utlui/attrdesc.cxx
@@ -439,6 +439,9 @@ bool SwFormatAnchor::GetPresentation
case RndStdIds::FLY_AS_CHAR:
pId = STR_FLY_AS_CHAR;
break;
+ case RndStdIds::FLY_AT_CHAR:
+ pId = STR_FLY_AT_CHAR;
+ break;
case RndStdIds::FLY_AT_PAGE:
pId = STR_FLY_AT_PAGE;
break;
diff --git a/sw/source/uibase/utlui/bookctrl.cxx b/sw/source/uibase/utlui/bookctrl.cxx
index f47bfe735ec9..8fb7f59f2a9a 100644
--- a/sw/source/uibase/utlui/bookctrl.cxx
+++ b/sw/source/uibase/utlui/bookctrl.cxx
@@ -49,7 +49,7 @@ SwBookmarkControl::~SwBookmarkControl()
{
}
-void SwBookmarkControl::StateChanged(
+void SwBookmarkControl::StateChangedAtStatusBarControl(
sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{
if( eState != SfxItemState::DEFAULT || pState->IsVoidItem() )
@@ -93,7 +93,7 @@ void SwBookmarkControl::Command( const CommandEvent& rCEvt )
if(IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark))
{
xPopup->append(OUString::number(nPopupId), (*ppBookmark)->GetName());
- aBookmarkIdx[nPopupId] = static_cast<sal_uInt16>(ppBookmark - ppBookmarkStart);
+ aBookmarkIdx[nPopupId] = o3tl::narrowing<sal_uInt16>(ppBookmark - ppBookmarkStart);
nPopupId++;
}
}
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index f1264d026f9a..f7b6adc04eb8 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -753,7 +753,8 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
{
// sorted list of all fields - meaning in the order they are in the document model
SetGetExpFields aSrtLst;
- const SwFieldTypes& rFieldTypes = *m_pWrtShell->GetDoc()->getIDocumentFieldsAccess().GetFieldTypes();
+ const SwFieldTypes& rFieldTypes =
+ *m_pWrtShell->GetDoc()->getIDocumentFieldsAccess().GetFieldTypes();
const size_t nSize = rFieldTypes.size();
for (size_t i = 0; i < nSize; ++i)
{
@@ -766,10 +767,14 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
{
const SwTextNode& rTextNode = pTextField->GetTextNode();
const SwContentFrame* pCFrame =
- rTextNode.getLayoutFrame(rTextNode.GetDoc().getIDocumentLayoutAccess().GetCurrentLayout());
+ rTextNode.getLayoutFrame(rTextNode.GetDoc().
+ getIDocumentLayoutAccess().
+ GetCurrentLayout());
if (pCFrame)
{
- std::unique_ptr<SetGetExpField> pNew(new SetGetExpField(SwNodeIndex(rTextNode), pTextField));
+ std::unique_ptr<SetGetExpField>
+ pNew(new SetGetExpField(SwNodeIndex(rTextNode),
+ pTextField));
aSrtLst.insert(std::move(pNew));
}
}
@@ -780,25 +785,53 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
const SwTextField* pTextField = aSrtLst[i]->GetTextField();
const SwFormatField& rFormatField = pTextField->GetFormatField();
const SwField* pField = rFormatField.GetField();
- OUString sFieldName = pField->GetFieldName();
if (pField->GetTypeId() == SwFieldTypesEnum::Postit)
- {
- OUString sEntry(static_cast<const SwPostItField*>(pField)->GetText());
- sEntry = RemoveNewline(sEntry);
- sFieldName = sFieldName + " - " + sEntry;
- }
- else if (pField->GetTypeId() == SwFieldTypesEnum::DocumentStatistics)
+ continue;
+ OUString sExpandedField(pField->ExpandField(true, m_pWrtShell->GetLayout()));
+ if (!sExpandedField.isEmpty())
+ sExpandedField = u" - " + sExpandedField;
+ OUString sText = pField->GetDescription() + u" - " + pField->GetFieldName()
+ + sExpandedField;
+ if (pField->GetTypeId() == SwFieldTypesEnum::DocumentStatistics)
{
SwFieldMgr aFieldMgr(m_pWrtShell);
std::vector<OUString> aLst;
aFieldMgr.GetSubTypes(SwFieldTypesEnum::DocumentStatistics, aLst);
- const SwDocStatField* pDocStatField = static_cast<const SwDocStatField*>(pField);
OUString sSubType;
- if (pDocStatField->GetSubType() < aLst.size())
- sSubType = aLst[pDocStatField->GetSubType()] + " - ";
- sFieldName = sFieldName + " - " + sSubType + pDocStatField->ExpandField(true, nullptr);
+ if (pField->GetSubType() < aLst.size())
+ sSubType = u" - " + aLst[pField->GetSubType()];
+ sText = pField->GetDescription() + u" - " + pField->GetFieldName() + sSubType
+ + sExpandedField;
}
- std::unique_ptr<SwTextFieldContent> pCnt(new SwTextFieldContent(this, sFieldName, &rFormatField, i));
+ else if (pField->GetTypeId() == SwFieldTypesEnum::GetRef)
+ {
+ OUString sExpandedTextOfReferencedTextNode;
+ if (const SwGetRefField* pRefField(dynamic_cast<const SwGetRefField*>(pField));
+ pRefField)
+ {
+ if (pRefField->IsRefToHeadingCrossRefBookmark() ||
+ pRefField->IsRefToNumItemCrossRefBookmark())
+ {
+ sExpandedTextOfReferencedTextNode = u" - " +
+ pRefField->GetExpandedTextOfReferencedTextNode(*m_pWrtShell->
+ GetLayout());
+ if (sExpandedTextOfReferencedTextNode.getLength() > 80)
+ {
+ sExpandedTextOfReferencedTextNode =
+ OUString::Concat(
+ sExpandedTextOfReferencedTextNode.subView(0, 80)) +
+ u"...";
+ }
+ }
+ else
+ {
+ sExpandedTextOfReferencedTextNode = u" - " + pRefField->GetSetRefName();
+ }
+ }
+ sText = pField->GetDescription() + sExpandedTextOfReferencedTextNode;
+ }
+ std::unique_ptr<SwTextFieldContent> pCnt(new SwTextFieldContent(this, sText,
+ &rFormatField, i));
m_pMember->insert(std::move(pCnt));
}
m_nMemberCount = m_pMember->size();
@@ -2923,6 +2956,8 @@ void SwContentTree::Notify(SfxBroadcaster & rBC, SfxHint const& rHint)
void SwContentTree::ExecCommand(std::string_view rCmd, bool bOutlineWithChildren)
{
+ MakeAllOutlineContentTemporarilyVisible a(GetWrtShell()->GetDoc());
+
const bool bUp = rCmd == "chapterup";
const bool bUpDown = bUp || rCmd == "chapterdown";
const bool bLeft = rCmd == "promote";
@@ -2987,7 +3022,6 @@ void SwContentTree::ExecCommand(std::string_view rCmd, bool bOutlineWithChildren
SwOutlineNodes::difference_type nDirLast = bUp ? -1 : 1;
bool bStartedAction = false;
- std::vector<SwNode*> aOutlineNdsArray;
for (auto const& pCurrentEntry : selected)
{
assert(pCurrentEntry && lcl_IsContent(*pCurrentEntry, *m_xTreeView));
@@ -3009,29 +3043,6 @@ void SwContentTree::ExecCommand(std::string_view rCmd, bool bOutlineWithChildren
if (!bStartedAction)
{
pShell->StartAllAction();
- if (bUpDown)
- {
- if (pShell->GetViewOptions()->IsShowOutlineContentVisibilityButton())
- {
- // make all outline nodes content visible before move
- // restore outline nodes content visible state after move
- SwOutlineNodes rOutlineNds = pShell->GetDoc()->GetNodes().GetOutLineNds();
- for (SwOutlineNodes::size_type nPos = 0; nPos < rOutlineNds.size(); ++nPos)
- {
- SwNode* pNd = rOutlineNds[nPos];
- if (pNd->IsTextNode()) // should always be true
- {
- bool bOutlineContentVisibleAttr = true;
- pNd->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
- if (!bOutlineContentVisibleAttr)
- {
- aOutlineNdsArray.push_back(pNd);
- pShell->ToggleOutlineContentVisibility(nPos);
- }
- }
- }
- }
- }
pShell->StartUndo(bLeftRight ? SwUndoId::OUTLINE_LR : SwUndoId::OUTLINE_UD);
bStartedAction = true;
}
@@ -3203,15 +3214,6 @@ void SwContentTree::ExecCommand(std::string_view rCmd, bool bOutlineWithChildren
if (bStartedAction)
{
pShell->EndUndo();
- if (bUpDown)
- {
- if (pShell->GetViewOptions()->IsShowOutlineContentVisibilityButton())
- {
- // restore state of outline content visibility to before move
- for (SwNode* pNd : aOutlineNdsArray)
- pShell->ToggleOutlineContentVisibility(pNd, true);
- }
- }
pShell->EndAllAction();
if (m_aActiveContentArr[ContentTypeId::OUTLINE])
m_aActiveContentArr[ContentTypeId::OUTLINE]->Invalidate();
@@ -3637,30 +3639,10 @@ void SwContentTree::SelectOutlinesWithSelection()
void SwContentTree::MoveOutline(SwOutlineNodes::size_type nTargetPos)
{
+ MakeAllOutlineContentTemporarilyVisible a(GetWrtShell()->GetDoc());
+
SwWrtShell *const pShell = GetWrtShell();
pShell->StartAllAction();
- std::vector<SwNode*> aOutlineNdsArray;
-
- if (pShell->GetViewOptions()->IsShowOutlineContentVisibilityButton())
- {
- // make all outline nodes content visible before move
- // restore outline nodes content visible state after move
- SwOutlineNodes rOutlineNds = pShell->GetDoc()->GetNodes().GetOutLineNds();
- for (SwOutlineNodes::size_type nPos = 0; nPos < rOutlineNds.size(); ++nPos)
- {
- SwNode* pNd = rOutlineNds[nPos];
- if (pNd->IsTextNode()) // should always be true
- {
- bool bOutlineContentVisibleAttr = true;
- pNd->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
- if (!bOutlineContentVisibleAttr)
- {
- aOutlineNdsArray.push_back(pNd);
- pShell->ToggleOutlineContentVisibility(nPos);
- }
- }
- }
- }
pShell->StartUndo(SwUndoId::OUTLINE_UD);
SwOutlineNodes::size_type nPrevSourcePos = SwOutlineNodes::npos;
@@ -3711,12 +3693,6 @@ void SwContentTree::MoveOutline(SwOutlineNodes::size_type nTargetPos)
}
pShell->EndUndo();
- if (pShell->GetViewOptions()->IsShowOutlineContentVisibilityButton())
- {
- // restore state of outline content visibility to before move
- for (SwNode* pNd : aOutlineNdsArray)
- pShell->ToggleOutlineContentVisibility(pNd, true);
- }
pShell->EndAllAction();
m_aActiveContentArr[ContentTypeId::OUTLINE]->Invalidate();
Display(true);
@@ -4028,9 +4004,13 @@ void SwContentTree::ExecuteContextMenuAction(const OString& rSelectedPopupEntry)
m_pActiveShell->EnterStdMode();
m_bIgnoreViewChange = true;
SwOutlineContent* pCntFirst = reinterpret_cast<SwOutlineContent*>(m_xTreeView->get_id(*xFirst).toInt64());
+
+ // toggle the outline node outline content visible attribute
if (nSelectedPopupEntry == TOGGLE_OUTLINE_CONTENT_VISIBILITY)
{
- m_pActiveShell->ToggleOutlineContentVisibility(pCntFirst->GetOutlinePos());
+ SwNode* pNode = m_pActiveShell->GetDoc()->GetNodes().GetOutLineNds()[pCntFirst->GetOutlinePos()];
+ pNode->GetTextNode()->SetAttrOutlineContentVisible(
+ !m_pActiveShell->GetAttrOutlineContentVisible(pCntFirst->GetOutlinePos()));
}
else
{
@@ -4048,15 +4028,16 @@ void SwContentTree::ExecuteContextMenuAction(const OString& rSelectedPopupEntry)
do
{
if (m_pActiveShell->IsOutlineContentVisible(nPos) != bShow)
- m_pActiveShell->ToggleOutlineContentVisibility(nPos);
+ m_pActiveShell->GetDoc()->GetNodes().GetOutLineNds()[nPos]->GetTextNode()->SetAttrOutlineContentVisible(bShow);
} while (++nPos < nOutlineNodesCount
&& (nLevel == -1 || m_pActiveShell->getIDocumentOutlineNodesAccess()->getOutlineLevel(nPos) > nLevel));
}
+ m_pActiveShell->InvalidateOutlineContentVisibility();
// show in the document what was toggled
if (lcl_IsContentType(*xFirst, *m_xTreeView)) // Headings root entry
m_pActiveShell->GotoPage(1, true);
else
- GotoContent(pCntFirst);
+ m_pActiveShell->GotoOutline(pCntFirst->GetOutlinePos());
grab_focus();
m_bIgnoreViewChange = false;
}
@@ -4314,6 +4295,7 @@ void SwContentTree::Select()
}
}
}
+
SwNavigationPI* pNavi = GetParentWindow();
pNavi->m_xContent6ToolBox->set_item_sensitive("chapterup", bEnable);
pNavi->m_xContent6ToolBox->set_item_sensitive("chapterdown", bEnable);
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index 0ff3ca871b48..4225633077a4 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -184,7 +184,7 @@ sal_Int8 SwGlobalTreeDropTarget::ExecuteDrop( const ExecuteDropEvent& rEvt )
if( aData.HasFormat( SotClipboardFormatId::FILE_LIST ))
{
nRet = rEvt.mnAction;
- std::unique_ptr<SwGlblDocContents> pTempContents(new SwGlblDocContents);
+ SwGlblDocContents aTempContents;
int nAbsContPos = xDropEntry ?
rWidget.get_iter_index_in_parent(*xDropEntry):
- 1;
@@ -201,14 +201,14 @@ sal_Int8 SwGlobalTreeDropTarget::ExecuteDrop( const ExecuteDropEvent& rEvt )
// to not work on an old content.
if(n)
{
- m_rTreeView.GetActiveWrtShell()->GetGlobalDocContent(*pTempContents);
+ m_rTreeView.GetActiveWrtShell()->GetGlobalDocContent(aTempContents);
// If the file was successfully inserted,
// then the next content must also be fetched.
- if(nEntryCount < pTempContents->size())
+ if(nEntryCount < aTempContents.size())
{
nEntryCount++;
nAbsContPos++;
- pCnt = (*pTempContents)[ nAbsContPos ].get();
+ pCnt = aTempContents[ nAbsContPos ].get();
}
}
}
@@ -867,20 +867,20 @@ bool SwGlobalTree::Update(bool bHard)
else
{
bool bCopy = false;
- std::unique_ptr<SwGlblDocContents> pTempContents(new SwGlblDocContents);
- m_pActiveShell->GetGlobalDocContent(*pTempContents);
+ SwGlblDocContents aTempContents;
+ m_pActiveShell->GetGlobalDocContent(aTempContents);
size_t nChildren = m_xTreeView->n_children();
- if (pTempContents->size() != m_pSwGlblDocContents->size() ||
- pTempContents->size() != nChildren)
+ if (aTempContents.size() != m_pSwGlblDocContents->size() ||
+ aTempContents.size() != nChildren)
{
bRet = true;
bCopy = true;
}
else
{
- for(size_t i = 0; i < pTempContents->size() && !bCopy; i++)
+ for(size_t i = 0; i < aTempContents.size() && !bCopy; i++)
{
- SwGlblDocContent* pLeft = (*pTempContents)[i].get();
+ SwGlblDocContent* pLeft = aTempContents[i].get();
SwGlblDocContent* pRight = (*m_pSwGlblDocContents)[i].get();
GlobalDocContentType eType = pLeft->GetType();
OUString sTemp = m_xTreeView->get_text(i);
@@ -902,7 +902,7 @@ bool SwGlobalTree::Update(bool bHard)
}
if (bCopy || bHard)
{
- *m_pSwGlblDocContents = std::move( *pTempContents );
+ *m_pSwGlblDocContents = std::move( aTempContents );
bRet = true;
}
}
diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx
index 46b44ecf567d..3bcc3ea299c9 100644
--- a/sw/source/uibase/utlui/gloslst.cxx
+++ b/sw/source/uibase/utlui/gloslst.cxx
@@ -287,7 +287,7 @@ void SwGlossaryList::Update()
OUString sName( aTitle.copy( 0, aTitle.getLength() - sExt.getLength() ));
aFoundGroupNames.push_back(sName);
- sName += OUStringChar(GLOS_DELIM) + OUString::number( static_cast<sal_uInt16>(nPath) );
+ sName += OUStringChar(GLOS_DELIM) + OUString::number( o3tl::narrowing<sal_uInt16>(nPath) );
AutoTextGroup* pFound = FindGroup( sName );
if( !pFound )
{
diff --git a/sw/source/uibase/utlui/initui.cxx b/sw/source/uibase/utlui/initui.cxx
index a690b7cfe9df..5b015c71d9b6 100644
--- a/sw/source/uibase/utlui/initui.cxx
+++ b/sw/source/uibase/utlui/initui.cxx
@@ -181,9 +181,9 @@ SwGlossaryList* GetGlossaryList()
void ShellResource::GetAutoFormatNameLst_() const
{
- assert(!pAutoFormatNameLst);
- pAutoFormatNameLst.reset( new std::vector<OUString> );
- pAutoFormatNameLst->reserve(STR_AUTOFMTREDL_END);
+ assert(!mxAutoFormatNameLst);
+ mxAutoFormatNameLst.emplace();
+ mxAutoFormatNameLst->reserve(STR_AUTOFMTREDL_END);
assert(SAL_N_ELEMENTS(RID_SHELLRES_AUTOFMTSTRS) == STR_AUTOFMTREDL_END);
for (sal_uInt16 n = 0; n < STR_AUTOFMTREDL_END; ++n)
@@ -196,7 +196,7 @@ void ShellResource::GetAutoFormatNameLst_() const
p = p.replaceFirst("%1", rLclD.getDoubleQuotationMarkStart());
p = p.replaceFirst("%2", rLclD.getDoubleQuotationMarkEnd());
}
- pAutoFormatNameLst->push_back(p);
+ mxAutoFormatNameLst->push_back(p);
}
}
diff --git a/sw/source/uibase/utlui/shdwcrsr.cxx b/sw/source/uibase/utlui/shdwcrsr.cxx
index 2a9b2a9f3d99..cd208e5b3a08 100644
--- a/sw/source/uibase/utlui/shdwcrsr.cxx
+++ b/sw/source/uibase/utlui/shdwcrsr.cxx
@@ -57,7 +57,7 @@ void SwShadowCursor::DrawTri( const Point& rPt, tools::Long nHeight, bool bLeft
tools::Long nDiff = bLeft ? -1 : 1;
while( aPt1.Y() <= aPt2.Y() )
{
- pWin->DrawLine( aPt1, aPt2 );
+ pWin->GetOutDev()->DrawLine( aPt1, aPt2 );
aPt1.AdjustY( 1 );
aPt2.AdjustY( -1 );
aPt2.setX( aPt1.AdjustX(nDiff ) );
@@ -68,15 +68,15 @@ void SwShadowCursor::DrawCursor( const Point& rPt, tools::Long nHeight, sal_uInt
{
nHeight = (((nHeight / 4)+1) * 4) + 1;
- pWin->Push();
+ pWin->GetOutDev()->Push();
pWin->SetMapMode(MapMode(MapUnit::MapPixel));
- pWin->SetRasterOp( RasterOp::Xor );
+ pWin->GetOutDev()->SetRasterOp( RasterOp::Xor );
- pWin->SetLineColor( Color( ColorTransparency, sal_uInt32(aCol) ^ sal_uInt32(COL_WHITE) ) );
+ pWin->GetOutDev()->SetLineColor( Color( ColorTransparency, sal_uInt32(aCol) ^ sal_uInt32(COL_WHITE) ) );
// 1. The Line:
- pWin->DrawLine( Point( rPt.X(), rPt.Y() + 1),
+ pWin->GetOutDev()->DrawLine( Point( rPt.X(), rPt.Y() + 1),
Point( rPt.X(), rPt.Y() - 2 + nHeight ));
// 2. The Triangle
@@ -85,7 +85,7 @@ void SwShadowCursor::DrawCursor( const Point& rPt, tools::Long nHeight, sal_uInt
if( text::HoriOrientation::RIGHT == nMode || text::HoriOrientation::CENTER == nMode ) // Arrow to the left
DrawTri( rPt, nHeight, true );
- pWin->Pop();
+ pWin->GetOutDev()->Pop();
}
void SwShadowCursor::Paint()
diff --git a/sw/source/uibase/utlui/tmplctrl.cxx b/sw/source/uibase/utlui/tmplctrl.cxx
index 21cbcfc5a116..da9887745f17 100644
--- a/sw/source/uibase/utlui/tmplctrl.cxx
+++ b/sw/source/uibase/utlui/tmplctrl.cxx
@@ -48,7 +48,7 @@ SwTemplateControl::~SwTemplateControl()
{
}
-void SwTemplateControl::StateChanged(
+void SwTemplateControl::StateChangedAtStatusBarControl(
sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{
const SfxStringItem* pItem = nullptr;
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index b971dc95bb2c..7f6432dbbf1d 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -43,6 +43,8 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <comphelper/processfactory.hxx>
#include <sfx2/viewfrm.hxx>
+#include <sfx2/docfile.hxx>
+#include <sfx2/docfilt.hxx>
#include <fmtornt.hxx>
#include <tabcol.hxx>
#include <fmtfsize.hxx>
@@ -282,7 +284,8 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
{
rMaster.SetFormatAttr(SfxBoolItem(RES_BACKGROUND_FULL_SIZE, bValue));
}
- if (pGrabBag->GetGrabBag().find("RtlGutter")->second >>= bValue)
+ auto it = pGrabBag->GetGrabBag().find("RtlGutter");
+ if (it != pGrabBag->GetGrabBag().end() && (it->second >>= bValue))
{
rMaster.SetFormatAttr(SfxBoolItem(RES_RTL_GUTTER, bValue));
}
@@ -425,6 +428,27 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
}
}
+namespace
+{
+bool IsOwnFormat(const SwDoc& rDoc)
+{
+ const SwDocShell* pDocShell = rDoc.GetDocShell();
+ SfxMedium* pMedium = pDocShell->GetMedium();
+ if (!pMedium)
+ {
+ return false;
+ }
+
+ std::shared_ptr<const SfxFilter> pFilter = pMedium->GetFilter();
+ if (!pFilter)
+ {
+ return false;
+ }
+
+ return pFilter->IsOwnFormat();
+}
+}
+
void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
{
const SwFrameFormat& rMaster = rPageDesc.GetMaster();
@@ -597,8 +621,13 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
}
oGrabBag->GetGrabBag()["BackgroundFullSize"] <<=
rMaster.GetAttrSet().GetItem<SfxBoolItem>(RES_BACKGROUND_FULL_SIZE)->GetValue();
- oGrabBag->GetGrabBag()["RtlGutter"] <<=
- rMaster.GetAttrSet().GetItem<SfxBoolItem>(RES_RTL_GUTTER)->GetValue();
+
+ if (IsOwnFormat(*rMaster.GetDoc()))
+ {
+ oGrabBag->GetGrabBag()["RtlGutter"]
+ <<= rMaster.GetAttrSet().GetItem<SfxBoolItem>(RES_RTL_GUTTER)->GetValue();
+ }
+
rSet.Put(*oGrabBag);
}
diff --git a/sw/source/uibase/utlui/viewlayoutctrl.cxx b/sw/source/uibase/utlui/viewlayoutctrl.cxx
index 9f010e73861d..22346de6b03b 100644
--- a/sw/source/uibase/utlui/viewlayoutctrl.cxx
+++ b/sw/source/uibase/utlui/viewlayoutctrl.cxx
@@ -59,7 +59,7 @@ SwViewLayoutControl::~SwViewLayoutControl()
{
}
-void SwViewLayoutControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
+void SwViewLayoutControl::StateChangedAtStatusBarControl( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{
if ( SfxItemState::DEFAULT != eState || pState->IsVoidItem() )
GetStatusBar().SetItemText( GetId(), OUString() );
diff --git a/sw/source/uibase/utlui/wordcountctrl.cxx b/sw/source/uibase/utlui/wordcountctrl.cxx
index d617c611c500..66d520d99a21 100644
--- a/sw/source/uibase/utlui/wordcountctrl.cxx
+++ b/sw/source/uibase/utlui/wordcountctrl.cxx
@@ -27,7 +27,7 @@ SwWordCountStatusBarControl::~SwWordCountStatusBarControl()
{
}
-void SwWordCountStatusBarControl::StateChanged(
+void SwWordCountStatusBarControl::StateChangedAtStatusBarControl(
sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{
if (eState == SfxItemState::DEFAULT) // Can access pState
diff --git a/sw/source/uibase/utlui/zoomctrl.cxx b/sw/source/uibase/utlui/zoomctrl.cxx
index 493b2f9b7828..3f7ff7021fcf 100644
--- a/sw/source/uibase/utlui/zoomctrl.cxx
+++ b/sw/source/uibase/utlui/zoomctrl.cxx
@@ -36,7 +36,7 @@ SwZoomControl::~SwZoomControl()
{
}
-void SwZoomControl::StateChanged( sal_uInt16 nSID, SfxItemState eState,
+void SwZoomControl::StateChangedAtStatusBarControl( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState )
{
const SfxStringItem* pItem = nullptr;
@@ -48,7 +48,7 @@ void SwZoomControl::StateChanged( sal_uInt16 nSID, SfxItemState eState,
else
{
sPreviewZoom.clear();
- SvxZoomStatusBarControl::StateChanged(nSID, eState, pState);
+ SvxZoomStatusBarControl::StateChangedAtStatusBarControl(nSID, eState, pState);
}
}
diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx
index 8c1c21fc964c..33c47745539f 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -761,18 +761,16 @@ void SwWrtShell::ToggleAddMode()
Invalidate();
}
-bool SwWrtShell::ToggleBlockMode()
+void SwWrtShell::ToggleBlockMode()
{
m_bBlockMode ? LeaveBlockMode(): EnterBlockMode();
Invalidate();
- return !m_bBlockMode;
}
-bool SwWrtShell::ToggleExtMode()
+void SwWrtShell::ToggleExtMode()
{
m_bExtMode ? LeaveExtMode() : EnterExtMode();
Invalidate();
- return !m_bExtMode;
}
// Dragging in standard mode (Selecting of content)
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index b8c36c76eda4..4eb96467fc80 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -28,6 +28,7 @@
#include <hintids.hxx>
#include <sot/exchange.hxx>
+#include <svx/xfillit0.hxx>
#include <svx/hdft.hxx>
#include <svx/svdview.hxx>
#include <svl/itemiter.hxx>
@@ -121,6 +122,25 @@ void collectUIInformation(const OUString& rAction, const OUString& aParameters)
}
+sal_uInt32 MakeAllOutlineContentTemporarilyVisible::nLock = 0;
+
+static bool lcl_IsAllowed(const SwWrtShell* rSh)
+{
+ if (rSh->GetViewOptions()->IsShowOutlineContentVisibilityButton() && rSh->IsEndPara())
+ {
+ SwTextNode* pTextNode = rSh->GetCursor()->GetNode().GetTextNode();
+ if (pTextNode && pTextNode->IsOutline())
+ {
+ // disallow if this is an outline node having folded content
+ bool bVisible = true;
+ pTextNode->GetAttrOutlineContentVisible(bVisible);
+ if (!bVisible)
+ return false;
+ }
+ }
+ return true;
+}
+
#define BITFLD_INI_LIST \
m_bClearMark = \
m_bIns = true;\
@@ -316,6 +336,11 @@ void SwWrtShell::Insert( const OUString &rPath, const OUString &rFilter,
pFrameMgr->SetHeightSizeType(SwFrameSize::Fixed);
}
+ // during change tracking, insert the image anchored as character
+ // (to create an SwRangeRedline on its anchor point)
+ if ( IsRedlineOn() && nAnchorType != RndStdIds::FLY_AS_CHAR )
+ pFrameMgr->SetAnchor( RndStdIds::FLY_AS_CHAR );
+
// Insert the graphic
SwFEShell::Insert(rPath, rFilter, &rGrf, &pFrameMgr->GetAttrSet());
if ( bOwnMgr )
@@ -876,6 +901,9 @@ void SwWrtShell::ConnectObj( svt::EmbeddedObjectRef& xObj, const SwRect &rPrt,
// Selections will be overwritten
void SwWrtShell::InsertPageBreak(const OUString *pPageDesc, const ::std::optional<sal_uInt16>& oPgNum )
{
+ if (!lcl_IsAllowed(this))
+ return;
+
ResetCursorStack();
if( CanInsert() )
{
@@ -911,6 +939,9 @@ void SwWrtShell::InsertPageBreak(const OUString *pPageDesc, const ::std::optiona
void SwWrtShell::InsertLineBreak()
{
+ if (!lcl_IsAllowed(this))
+ return;
+
ResetCursorStack();
if( CanInsert() )
{
@@ -931,6 +962,9 @@ void SwWrtShell::InsertLineBreak()
void SwWrtShell::InsertColumnBreak()
{
+ if (!lcl_IsAllowed(this))
+ return;
+
SwActContext aActContext(this);
ResetCursorStack();
if( !CanInsert() )
@@ -987,6 +1021,9 @@ void SwWrtShell::InsertFootnote(const OUString &rStr, bool bEndNote, bool bEdit
void SwWrtShell::SplitNode( bool bAutoFormat )
{
+ if (!lcl_IsAllowed(this))
+ return;
+
ResetCursorStack();
if( !CanInsert() )
return;
@@ -1080,7 +1117,7 @@ void SwWrtShell::NumOrBulletOn(bool bNum)
OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(),
"<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&
- pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
+ pCollRule->Get( o3tl::narrowing<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
== SVX_NUM_NUMBER_NONE )
{
// activate outline numbering
@@ -1107,7 +1144,7 @@ void SwWrtShell::NumOrBulletOn(bool bNum)
// Check, if corresponding list level of the outline numbering
// has already a numbering format set.
nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
- if ( pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
+ if ( pCollRule->Get( o3tl::narrowing<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
== SVX_NUM_NUMBER_NONE )
{
// activate outline numbering, because from the precondition
@@ -1128,7 +1165,7 @@ void SwWrtShell::NumOrBulletOn(bool bNum)
OSL_ENSURE( pColl->IsAssignedToListLevelOfOutlineStyle(),
"<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&
- pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
+ pCollRule->Get( o3tl::narrowing<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
== SVX_NUM_NUMBER_NONE )
{
// activate outline numbering
@@ -1193,7 +1230,7 @@ void SwWrtShell::NumOrBulletOn(bool bNum)
if (nLevel >= MAXLEVEL)
nLevel = MAXLEVEL - 1;
- SwNumFormat aFormat(aNumRule.Get(static_cast<sal_uInt16>(nLevel)));
+ SwNumFormat aFormat(aNumRule.Get(o3tl::narrowing<sal_uInt16>(nLevel)));
if (bNum)
aFormat.SetNumberingType(SVX_NUM_ARABIC);
@@ -1211,7 +1248,7 @@ void SwWrtShell::NumOrBulletOn(bool bNum)
aFormat.SetPrefix(OUString());
aFormat.SetSuffix(OUString());
}
- aNumRule.Set(static_cast<sal_uInt16>(nLevel), aFormat);
+ aNumRule.Set(o3tl::narrowing<sal_uInt16>(nLevel), aFormat);
}
}
@@ -1365,7 +1402,7 @@ void SwWrtShell::NumOrBulletOff()
if (nLevel >= MAXLEVEL)
nLevel = MAXLEVEL - 1;
- SwNumFormat aFormat(aNumRule.Get(static_cast<sal_uInt16>(nLevel)));
+ SwNumFormat aFormat(aNumRule.Get(o3tl::narrowing<sal_uInt16>(nLevel)));
aFormat.SetNumberingType(SVX_NUM_NUMBER_NONE);
aNumRule.Set(nLevel, aFormat);
@@ -1428,8 +1465,8 @@ SelectionType SwWrtShell::GetSelectionType() const
{
nCnt |= SelectionType::ExtrudedCustomShape;
}
- sal_uInt32 nCheckStatus = 0;
- if (svx::checkForSelectedFontWork( GetDrawView(), nCheckStatus ))
+
+ if (svx::checkForSelectedFontWork( GetDrawView() ))
{
nCnt |= SelectionType::FontWork;
}
@@ -1864,6 +1901,8 @@ void SwWrtShell::ChangeHeaderOrFooter(
const_cast<SwFrameFormat*>(rMaster.GetHeader().GetHeaderFormat()) :
const_cast<SwFrameFormat*>(rMaster.GetFooter().GetFooterFormat());
pFormat->SetFormatAttr( aUL );
+ XFillStyleItem aFill(drawing::FillStyle_NONE);
+ pFormat->SetFormatAttr(aFill);
}
}
if( bChgd )
@@ -1994,64 +2033,53 @@ void SwWrtShell::InsertPostIt(SwFieldMgr& rFieldMgr, const SfxRequest& rReq)
}
bool SwWrtShell::IsOutlineContentVisible(const size_t nPos)
{
- const SwNodes& rNodes = GetDoc()->GetNodes();
- const SwOutlineNodes& rOutlineNodes = rNodes.GetOutLineNds();
+ const SwOutlineNodes& rOutlineNodes = GetDoc()->GetNodes().GetOutLineNds();
+ const SwNode* pOutlineNode = rOutlineNodes[nPos];
- SwNode* pOutlineNode = rOutlineNodes[nPos];
- if (pOutlineNode->IsEndNode())
- return true;
+ // no layout frame means outline folding is set to include sub levels and the outline node has
+ // a parent outline node with outline content visible attribute false (folded outline content)
+ if (!pOutlineNode->GetTextNode()->getLayoutFrame(nullptr))
+ return false;
- bool bOutlineContentVisibleAttr = false;
- if (pOutlineNode->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr))
- return bOutlineContentVisibleAttr;
+ // try the next node to determine if this outline node has visible content
+ SwNodeIndex aIdx(*pOutlineNode, +1);
+ if (&aIdx.GetNode() == &aIdx.GetNodes().GetEndOfContent()) // end of regular content
+ return false;
- return true;
-}
+ if (aIdx.GetNode().IsTextNode())
+ {
+ // sublevels treated as outline content
+ // If next node (aIdx) doesn't have a layout frame
+ // then this outline node does not have visible outline content.
+ // sublevels NOT treated as outline content
+ // If the next node (aIdx) is the next outline node
+ // then return the outline content visible attribute value.
+ if (!GetViewOptions()->IsTreatSubOutlineLevelsAsContent() &&
+ nPos + 1 < rOutlineNodes.size() &&
+ rOutlineNodes[nPos + 1] == &aIdx.GetNode())
+ return GetAttrOutlineContentVisible(nPos);
-void SwWrtShell::ToggleOutlineContentVisibility(SwNode* pNd, const bool bForceNotVisible)
-{
- SwOutlineNodes::size_type nPos;
- if (GetNodes().GetOutLineNds().Seek_Entry(pNd, &nPos))
- ToggleOutlineContentVisibility(nPos, bForceNotVisible);
+ return aIdx.GetNode().GetTextNode()->getLayoutFrame(nullptr);
+ }
+
+ return true;
}
-void SwWrtShell::ToggleOutlineContentVisibility(const size_t nPos, const bool bForceNotVisible)
+void SwWrtShell::MakeOutlineContentVisible(const size_t nPos, bool bMakeVisible)
{
const SwNodes& rNodes = GetNodes();
const SwOutlineNodes& rOutlineNodes = rNodes.GetOutLineNds();
- assert(nPos < rOutlineNodes.size());
-
SwNode* pSttNd = rOutlineNodes[nPos];
- if (pSttNd->IsEndNode())
- return;
+ // determine end node
SwNode* pEndNd = &rNodes.GetEndOfContent();
if (rOutlineNodes.size() > nPos + 1)
pEndNd = rOutlineNodes[nPos + 1];
- if (pSttNd->GetTableBox() || pSttNd->GetIndex() < rNodes.GetEndOfExtras().GetIndex())
- {
- // limit toggle to within table box
- if (pSttNd->EndOfSectionIndex() < pEndNd->GetIndex() )
- pEndNd = pSttNd->EndOfSectionNode();
- }
- // if pSttNd isn't in table but pEndNd is, skip over all outline nodes in table
- else if (pEndNd->GetTableBox())
- {
- pEndNd = &rNodes.GetEndOfContent();
- for (size_t nOutlinePos = nPos + 2; nOutlinePos < rOutlineNodes.size(); nOutlinePos++)
- {
- if (!(rOutlineNodes[nOutlinePos]->GetTableBox()))
- {
- pEndNd = rOutlineNodes[nOutlinePos];
- break;
- }
- }
- }
-
if (GetViewOptions()->IsTreatSubOutlineLevelsAsContent())
{
+ // get the last outline node to include (iPos)
int nLevel = pSttNd->GetTextNode()->GetAttrOutlineLevel();
SwOutlineNodes::size_type iPos = nPos;
while (++iPos < rOutlineNodes.size() &&
@@ -2080,64 +2108,173 @@ void SwWrtShell::ToggleOutlineContentVisibility(const size_t nPos, const bool bF
}
}
- SwNodeIndex aIdx(*pSttNd, +1); // the next node after pSttdNd in the doc model SwNodes
- if (!IsOutlineContentVisible(nPos) && !bForceNotVisible)
+ // table, text box, header, footer
+ if (pSttNd->GetTableBox() || pSttNd->GetIndex() < rNodes.GetEndOfExtras().GetIndex())
{
- // make visible
+ // limit to within section
+ if (pSttNd->EndOfSectionIndex() < pEndNd->GetIndex())
+ pEndNd = pSttNd->EndOfSectionNode();
+ }
+ // if pSttNd isn't in table but pEndNd is, skip over all outline nodes in table
+ else if (pEndNd->GetTableBox())
+ {
+ pEndNd = &rNodes.GetEndOfContent();
+ for (size_t nOutlinePos = nPos + 2; nOutlinePos < rOutlineNodes.size(); nOutlinePos++)
+ {
+ if (!(rOutlineNodes[nOutlinePos]->GetTableBox()))
+ {
+ pEndNd = rOutlineNodes[nOutlinePos];
+ break;
+ }
+ }
+ }
+ // end node determined
+
+ // Remove content frames from the next node after the starting outline node to
+ // the determined ending node. Always do this to prevent the chance of duplicate
+ // frames being made. They will be remade below if needed.
+ SwNodeIndex aIdx(*pSttNd, +1);
+ while (aIdx != *pEndNd)
+ {
+ SwNode* pNd = &aIdx.GetNode();
+ if (pNd->IsContentNode())
+ pNd->GetContentNode()->DelFrames(nullptr);
+ else if (pNd->IsTableNode())
+ pNd->GetTableNode()->DelFrames(nullptr);
+ aIdx++;
+ }
+
+ if (bMakeVisible) // make outline nodes outline content visible
+ {
+ // reset the index marker and make frames
+ aIdx.Assign(*pSttNd, +1);
MakeFrames(GetDoc(), aIdx, *pEndNd);
pSttNd->GetTextNode()->SetAttrOutlineContentVisible(true);
- if (GetViewOptions()->IsShowOutlineContentVisibilityButton())
+ // make outline content made visible that have outline visible attribute false not visible
+ while (aIdx != *pEndNd)
{
- // remove button if focus is not on outline frame control window
- SwContentFrame* pFrame = pSttNd->GetTextNode()->getLayoutFrame(nullptr);
- if (pFrame && !pFrame->IsInDtor())
- {
- SwFrameControlPtr pOutlineFrameControl = GetView().GetEditWin().GetFrameControlsManager().GetControl(FrameControlType::Outline, pFrame);
- if (pOutlineFrameControl && pOutlineFrameControl->GetWindow() && !pOutlineFrameControl->HasFocus())
- GetView().GetEditWin().GetFrameControlsManager().RemoveControlsByType(FrameControlType::Outline, pFrame);
- }
-
- // toggle outline content made visible that have outline visible attribute false
- while (aIdx != *pEndNd)
+ SwNode* pNd = &aIdx.GetNode();
+ if (pNd->IsTextNode() && pNd->GetTextNode()->IsOutline())
{
- SwNode* pTmpNd = &aIdx.GetNode();
- if (pTmpNd->IsTextNode() && pTmpNd->GetTextNode()->IsOutline())
+ SwTextNode* pTextNd = pNd->GetTextNode();
+ bool bOutlineContentVisibleAttr = true;
+ pTextNd->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
+ if (!bOutlineContentVisibleAttr)
{
- SwTextNode* pTmpTextNd = pTmpNd->GetTextNode();
- bool bOutlineContentVisibleAttr = true;
- if (pTmpTextNd->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr) &&
- !bOutlineContentVisibleAttr)
+ SwOutlineNodes::size_type iPos;
+ if (rOutlineNodes.Seek_Entry(pTextNd, &iPos))
{
- SwOutlineNodes::size_type iPos;
- if (rOutlineNodes.Seek_Entry(pTmpTextNd, &iPos))
- {
- if (pTmpTextNd->getLayoutFrame(nullptr))
- ToggleOutlineContentVisibility(iPos, true); // force not visible
- }
+ if (pTextNd->getLayoutFrame(nullptr))
+ MakeOutlineContentVisible(iPos, false);
}
}
- aIdx++;
}
+ aIdx++;
}
}
else
+ pSttNd->GetTextNode()->SetAttrOutlineContentVisible(false);
+}
+
+// make content visible or not visible only if needed
+void SwWrtShell::InvalidateOutlineContentVisibility()
+{
+ GetView().GetEditWin().GetFrameControlsManager().HideControls(FrameControlType::Outline);
+
+ const SwOutlineNodes& rOutlineNds = GetNodes().GetOutLineNds();
+ for (SwOutlineNodes::size_type nPos = 0; nPos < rOutlineNds.size(); ++nPos)
{
- // remove content frames
- while (aIdx != *pEndNd)
+ bool bIsOutlineContentVisible = IsOutlineContentVisible(nPos);
+ bool bOutlineContentVisibleAttr = true;
+ rOutlineNds[nPos]->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
+ if (!bIsOutlineContentVisible && bOutlineContentVisibleAttr)
+ MakeOutlineContentVisible(nPos);
+ else if (bIsOutlineContentVisible && !bOutlineContentVisibleAttr)
+ MakeOutlineContentVisible(nPos, false);
+ }
+}
+
+void SwWrtShell::MakeAllFoldedOutlineContentVisible(bool bMakeVisible)
+{
+ // deselect any drawing or frame and leave editing mode
+ SdrView* pSdrView = GetDrawView();
+ if (pSdrView && pSdrView->IsTextEdit() )
+ {
+ bool bLockView = IsViewLocked();
+ LockView(true);
+ EndTextEdit();
+ LockView(bLockView);
+ }
+
+ if (IsSelFrameMode() || IsObjSelected())
+ {
+ UnSelectFrame();
+ LeaveSelFrameMode();
+ GetView().LeaveDrawCreate();
+ EnterStdMode();
+ DrawSelChanged();
+ GetView().StopShellTimer();
+ }
+ else
+ EnterStdMode();
+
+ SwOutlineNodes::size_type nPos = GetOutlinePos();
+
+ if (bMakeVisible)
+ {
+ // make all content visible
+
+ // When shortcut is assigned to the show outline content visibility button and used to
+ // toggle the feature and the mouse pointer is on an outline frame the button will not
+ // be removed. An easy way to make sure the button does not remain shown is to use the
+ // HideControls function.
+ GetView().GetEditWin().GetFrameControlsManager().HideControls(FrameControlType::Outline);
+
+ // temporarily set outline content visible attribute true for folded outline nodes
+ std::vector<SwNode*> aFoldedOutlineNodeArray;
+ for (SwNode* pNd: GetNodes().GetOutLineNds())
{
- SwNode* pNd = &aIdx.GetNode();
- if (pNd->IsContentNode())
- pNd->GetContentNode()->DelFrames(nullptr);
- else if (pNd->IsTableNode())
- pNd->GetTableNode()->DelFrames(nullptr);
- aIdx++;
+ bool bOutlineContentVisibleAttr = true;
+ pNd->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
+ if (!bOutlineContentVisibleAttr)
+ {
+ aFoldedOutlineNodeArray.push_back(pNd);
+ pNd->GetTextNode()->SetAttrOutlineContentVisible(true);
+ }
+ }
+
+ StartAction();
+ InvalidateOutlineContentVisibility();
+ EndAction();
+
+ // restore outline content visible attribute for folded outline nodes
+ for (SwNode* pNd: aFoldedOutlineNodeArray)
+ pNd->GetTextNode()->SetAttrOutlineContentVisible(false);
+ }
+ else
+ {
+ StartAction();
+ InvalidateOutlineContentVisibility();
+ EndAction();
+
+ // If needed, find visible outline node to place cursor.
+ if (nPos != SwOutlineNodes::npos && !IsOutlineContentVisible(nPos))
+ {
+ while (nPos != SwOutlineNodes::npos && !GetNodes().GetOutLineNds()[nPos]->GetTextNode()->getLayoutFrame(nullptr))
+ --nPos;
+ if (nPos != SwOutlineNodes::npos)
+ GotoOutline(nPos);
}
- pSttNd->GetTextNode()->SetAttrOutlineContentVisible(false);
}
+}
- GetDoc()->GetDocShell()->Broadcast(SfxHint(SfxHintId::DocChanged));
+bool SwWrtShell::GetAttrOutlineContentVisible(const size_t nPos)
+{
+ bool bVisibleAttr = true;
+ GetNodes().GetOutLineNds()[nPos]->GetTextNode()->GetAttrOutlineContentVisible(bVisibleAttr);
+ return bVisibleAttr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */