diff options
-rw-r--r-- | offapi/com/sun/star/text/ViewSettings.idl | 6 | ||||
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu | 14 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Writer.xcs | 8 | ||||
-rw-r--r-- | sw/inc/cmdid.h | 1 | ||||
-rw-r--r-- | sw/inc/viewopt.hxx | 11 | ||||
-rw-r--r-- | sw/sdi/_viewsh.sdi | 6 | ||||
-rw-r--r-- | sw/sdi/swriter.sdi | 18 | ||||
-rw-r--r-- | sw/source/ui/config/optpage.cxx | 15 | ||||
-rw-r--r-- | sw/source/uibase/config/cfgitems.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/config/usrpref.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/inc/cfgitems.hxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/inc/edtwin.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/optpage.hxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view0.cxx | 13 | ||||
-rw-r--r-- | sw/source/uibase/uno/unomod.cxx | 3 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/viewoptionspage.ui | 16 |
16 files changed, 122 insertions, 2 deletions
diff --git a/offapi/com/sun/star/text/ViewSettings.idl b/offapi/com/sun/star/text/ViewSettings.idl index b0afa27c46e8..656866a5a08a 100644 --- a/offapi/com/sun/star/text/ViewSettings.idl +++ b/offapi/com/sun/star/text/ViewSettings.idl @@ -284,6 +284,12 @@ published service ViewSettings */ [optional, property] boolean ShowBookmarks; + /** If this property is `TRUE`, the outline content visibility toggle button is shown. + + @since LibreOffice 7.1 + */ + [optional, property] boolean ShowOutlineContentVisibilityButton; + }; }; }; }; }; diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu index 5cf5ed8436b8..7d3292add406 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu @@ -398,6 +398,20 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:ShowOutlineContentVisibilityButton" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Show outline content visibility button</value> + </prop> + <prop oor:name="TooltipLabel" oor:type="xs:string"> + <value xml:lang="en-US">Show outline content visibility button</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + <prop oor:name="IsExperimental" oor:type="xs:boolean"> + <value>true</value> + </prop> + </node> <node oor:name=".uno:GotoPage" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Go t~o Page...</value> diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs index dab6d9af6711..a50ac3e247cd 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs @@ -1071,6 +1071,14 @@ </info> <value>true</value> </prop> + <prop oor:name="ShowOutlineContentVisibilityButton" oor:type="xs:boolean" oor:nillable="false"> + <!-- UIHints: Tools - Options - Writer - View - [Section] Display --> + <info> + <desc>Enables the writer to show the outline content visibility button.</desc> + <label>Show outline content visibility button</label> + </info> + <value>false</value> + </prop> </group> <group oor:name="NonprintingCharacter"> <info> diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 5dacd22c53c7..d5332f02ca73 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -186,6 +186,7 @@ #define FN_USE_HEADERFOOTERMENU (FN_VIEW + 61) /* Show advanced header/footer menu */ #define FN_VIEW_SHOW_WHITESPACE (FN_VIEW + 62) /* Show header, footer, and pagebreak */ +#define FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON (FN_VIEW + 63) /* Show outline content visibility toggle button */ // Region: Insert #define FN_INSERT_BOOKMARK (FN_INSERT + 2 ) /* Bookmark */ diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index f5add2b728d1..cf501a9d181f 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -28,6 +28,8 @@ #include <sfx2/zoomitem.hxx> #include "swdllapi.h" +#include <svtools/miscopt.hxx> + class SwRect; namespace vcl { class Window; } class OutputDevice; @@ -63,9 +65,10 @@ enum class ViewOptFlags1 : sal_uInt32 { ShowInlineTooltips = 0x10000000, //tooltips on tracked changes ViewMetachars = 0x20000000, Pageback = 0x40000000, + ShowOutlineContentVisibilityButton = 0x80000000 }; namespace o3tl { - template<> struct typed_flags<ViewOptFlags1> : is_typed_flags<ViewOptFlags1, 0x77dfcfff> {}; + template<> struct typed_flags<ViewOptFlags1> : is_typed_flags<ViewOptFlags1, 0xF7dfcfff> {}; } enum class ViewOptCoreFlags2 { @@ -291,6 +294,12 @@ public: void SetUseHeaderFooterMenu( bool b ) { SetCoreOption(b, ViewOptFlags1::UseHeaderFooterMenu); } + //show/hide outline content visibility button + bool IsShowOutlineContentVisibilityButton() const + { SvtMiscOptions aMiscOptions; return aMiscOptions.IsExperimentalMode() && (m_nCoreOptions & ViewOptFlags1::ShowOutlineContentVisibilityButton); } + void SetShowOutlineContentVisibilityButton(bool b) + { SetCoreOption(b, ViewOptFlags1::ShowOutlineContentVisibilityButton); } + bool IsShowHiddenChar(bool bHard = false) const { return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::CharHidden) && ((m_nCoreOptions & ViewOptFlags1::ViewMetachars)||bHard); } diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index 4dbc2aecffcf..f26e4f0f615e 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -970,5 +970,11 @@ interface BaseTextEditView MenuConfig , AccelConfig , ToolBoxConfig ; ] + FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON + [ + ExecMethod = ExecViewOptions ; + StateMethod = StateViewOptions ; + ] + } diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 69dbc63205c0..b17737f06c36 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -7897,6 +7897,24 @@ SfxBoolItem UseHeaderFooterMenu FN_USE_HEADERFOOTERMENU ToolBoxConfig = TRUE, GroupId = SfxGroupId::View; ] + +SfxBoolItem ShowOutlineContentVisibilityButton FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON +() +[ + AutoUpdate = TRUE, + FastCall = FALSE, + ReadOnlyDoc = TRUE, + Toggle = TRUE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::View; +] + SfxVoidItem TextFormField FN_INSERT_TEXT_FORMFIELD [ diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 70a2db75fcb7..fda991a7abfb 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -52,6 +52,7 @@ #include <editeng/svxenum.hxx> #include <sal/macros.h> #include <sfx2/dialoghelper.hxx> +#include <sfx2/dispatch.hxx> #include <sfx2/printer.hxx> #include <sfx2/bindings.hxx> #include <sfx2/viewfrm.hxx> @@ -67,6 +68,8 @@ #include <optload.hxx> +#include <svtools/miscopt.hxx> + using namespace ::com::sun::star; namespace { @@ -99,9 +102,14 @@ SwContentOptPage::SwContentOptPage(weld::Container* pPage, weld::DialogControlle , m_xMetricLabel(m_xBuilder->weld_label("measureunitlabel")) , m_xMetricLB(m_xBuilder->weld_combo_box("measureunit")) , m_xShowInlineTooltips(m_xBuilder->weld_check_button("changestooltip")) + , m_xShowOutlineContentVisibilityButton(m_xBuilder->weld_check_button("outlinecontentvisibilitybutton")) , m_xFieldHiddenCB(m_xBuilder->weld_check_button("hiddentextfield")) , m_xFieldHiddenParaCB(m_xBuilder->weld_check_button("hiddenparafield")) { + SvtMiscOptions aMiscOptions; + if (!aMiscOptions.IsExperimentalMode()) + m_xShowOutlineContentVisibilityButton->hide(); + /* This part is visible only with Writer/Web->View dialogue. */ const SfxPoolItem* pItem; if (! (SfxItemState::SET == rCoreSet.GetItemState(SID_HTML_MODE, false, &pItem ) @@ -198,8 +206,11 @@ void SwContentOptPage::Reset(const SfxItemSet* rSet) m_xVRulerRightCBox->set_active(pElemAttr->m_bVertRulerRight); m_xSmoothCBox->set_active(pElemAttr->m_bSmoothScroll); m_xShowInlineTooltips->set_active(pElemAttr->m_bShowInlineTooltips); + m_xShowOutlineContentVisibilityButton->set_active(pElemAttr->m_bShowOutlineContentVisibilityButton); m_xFieldHiddenCB->set_active( pElemAttr->m_bFieldHiddenText ); m_xFieldHiddenParaCB->set_active( pElemAttr->m_bShowHiddenPara ); + if (GetActiveWrtShell()->GetViewOptions()->IsShowOutlineContentVisibilityButton() != pElemAttr->m_bShowOutlineContentVisibilityButton) + GetActiveWrtShell()->GetView().GetDocShell()->GetDispatcher()->Execute(FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON); } m_xMetricLB->set_active(-1); lcl_SelectMetricLB(*m_xMetricLB, SID_ATTR_METRIC, *rSet); @@ -222,9 +233,13 @@ bool SwContentOptPage::FillItemSet(SfxItemSet* rSet) aElem.m_bVertRulerRight = m_xVRulerRightCBox->get_active(); aElem.m_bSmoothScroll = m_xSmoothCBox->get_active(); aElem.m_bShowInlineTooltips = m_xShowInlineTooltips->get_active(); + aElem.m_bShowOutlineContentVisibilityButton = m_xShowOutlineContentVisibilityButton->get_active(); aElem.m_bFieldHiddenText = m_xFieldHiddenCB->get_active(); aElem.m_bShowHiddenPara = m_xFieldHiddenParaCB->get_active(); + if (GetActiveWrtShell()->GetViewOptions()->IsShowOutlineContentVisibilityButton() != aElem.m_bShowOutlineContentVisibilityButton) + GetActiveWrtShell()->GetView().GetDocShell()->GetDispatcher()->Execute(FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON); + bool bRet = !pOldAttr || aElem != *pOldAttr; if(bRet) bRet = nullptr != rSet->Put(aElem); diff --git a/sw/source/uibase/config/cfgitems.cxx b/sw/source/uibase/config/cfgitems.cxx index 217ae8624c56..457ced7d6320 100644 --- a/sw/source/uibase/config/cfgitems.cxx +++ b/sw/source/uibase/config/cfgitems.cxx @@ -95,6 +95,7 @@ SwElemItem::SwElemItem() : m_bDrawing = m_bNotes = false; m_bShowInlineTooltips = true; + m_bShowOutlineContentVisibilityButton = m_bFieldHiddenText = m_bShowHiddenPara = false; } @@ -111,6 +112,7 @@ SwElemItem::SwElemItem(const SwViewOption& rVOpt) : m_bDrawing = rVOpt.IsDraw() && rVOpt.IsControl(); m_bNotes = rVOpt.IsPostIts(); m_bShowInlineTooltips = rVOpt.IsShowInlineTooltips(); + m_bShowOutlineContentVisibilityButton = rVOpt.IsShowOutlineContentVisibilityButton(); m_bFieldHiddenText = rVOpt.IsShowHiddenField(); m_bShowHiddenPara = rVOpt.IsShowHiddenPara(); } @@ -135,6 +137,7 @@ bool SwElemItem::operator==( const SfxPoolItem& rAttr ) const m_bDrawing == rItem.m_bDrawing && m_bNotes == rItem.m_bNotes && m_bShowInlineTooltips == rItem.m_bShowInlineTooltips && + m_bShowOutlineContentVisibilityButton == rItem.m_bShowOutlineContentVisibilityButton && m_bFieldHiddenText == rItem.m_bFieldHiddenText && m_bShowHiddenPara == rItem.m_bShowHiddenPara); } @@ -151,6 +154,7 @@ void SwElemItem::FillViewOptions( SwViewOption& rVOpt) const rVOpt.SetControl (m_bDrawing ); rVOpt.SetPostIts (m_bNotes ); rVOpt.SetShowInlineTooltips( m_bShowInlineTooltips ); + rVOpt.SetShowOutlineContentVisibilityButton(m_bShowOutlineContentVisibilityButton); rVOpt.SetShowHiddenField(m_bFieldHiddenText ); rVOpt.SetShowHiddenPara(m_bShowHiddenPara ); } diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx index 4a21273b2989..f6eb03e818f4 100644 --- a/sw/source/uibase/config/usrpref.cxx +++ b/sw/source/uibase/config/usrpref.cxx @@ -102,7 +102,8 @@ Sequence<OUString> SwContentViewConfig::GetPropertyNames() const "Update/Field", // 18 "Update/Chart", // 19 "Display/ShowInlineTooltips", // 20 - "Display/UseHeaderFooterMenu" // 21 + "Display/UseHeaderFooterMenu", // 21 + "Display/ShowOutlineContentVisibilityButton" // 22 }; #if defined(__GNUC__) && !defined(__clang__) // clang 8.0.0 says strcmp isn't constexpr @@ -170,6 +171,7 @@ void SwContentViewConfig::ImplCommit() case 19: bVal = rParent.IsUpdateCharts(); break;// "Update/Chart" case 20: bVal = rParent.IsShowInlineTooltips(); break;// "Display/ShowInlineTooltips" case 21: bVal = rParent.IsUseHeaderFooterMenu(); break;// "Display/UseHeaderFooterMenu" + case 22: bVal = rParent.IsShowOutlineContentVisibilityButton(); break;// "Display/ShowOutlineContnetVisibilityButton" } if (nProp != g_UpdateLinkIndex) pValues[nProp] <<= bVal; @@ -220,6 +222,7 @@ void SwContentViewConfig::Load() case 19: rParent.SetUpdateCharts(bSet); break;// "Update/Chart" case 20: rParent.SetShowInlineTooltips(bSet); break;// "Display/ShowInlineTooltips" case 21: rParent.SetUseHeaderFooterMenu(bSet); break;// "Display/UseHeaderFooterMenu" + case 22: rParent.SetShowOutlineContentVisibilityButton(bSet); break;// "Display/ShowOutlineContententVisibilityButton" } } } diff --git a/sw/source/uibase/inc/cfgitems.hxx b/sw/source/uibase/inc/cfgitems.hxx index feb68c81a9bc..d52880c69e3a 100644 --- a/sw/source/uibase/inc/cfgitems.hxx +++ b/sw/source/uibase/inc/cfgitems.hxx @@ -77,6 +77,7 @@ class SW_DLLPUBLIC SwElemItem : public SfxPoolItem bool m_bDrawing :1; bool m_bNotes :1; bool m_bShowInlineTooltips :1; + bool m_bShowOutlineContentVisibilityButton :1; bool m_bFieldHiddenText :1; bool m_bShowHiddenPara :1; diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx index 3059ee609a1c..855a2ff4158c 100644 --- a/sw/source/uibase/inc/edtwin.hxx +++ b/sw/source/uibase/inc/edtwin.hxx @@ -288,6 +288,8 @@ public: /// Allows starting or ending a graphic move or resize action. void SetGraphicTwipPosition(bool bStart, const Point& rPosition); + void SetOutlineContentVisiblityButtons() {(void)this;} + virtual FactoryFunction GetUITestFactory() const override; }; diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx index 73062bb3b730..95f657320af8 100644 --- a/sw/source/uibase/inc/optpage.hxx +++ b/sw/source/uibase/inc/optpage.hxx @@ -53,6 +53,7 @@ class SwContentOptPage : public SfxTabPage std::unique_ptr<weld::ComboBox> m_xMetricLB; std::unique_ptr<weld::CheckButton> m_xShowInlineTooltips; + std::unique_ptr<weld::CheckButton> m_xShowOutlineContentVisibilityButton; std::unique_ptr<weld::CheckButton> m_xFieldHiddenCB; std::unique_ptr<weld::CheckButton> m_xFieldHiddenParaCB; diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index d15c0bcc176d..e746016282de 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -336,6 +336,9 @@ void SwView::StateViewOptions(SfxItemSet &rSet) case FN_USE_HEADERFOOTERMENU: aBool.SetValue( pOpt->IsUseHeaderFooterMenu() ); break; + case FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON: + aBool.SetValue( pOpt->IsShowOutlineContentVisibilityButton() ); + break; } if( nWhich ) @@ -583,6 +586,13 @@ void SwView::ExecViewOptions(SfxRequest &rReq) pOpt->SetUseHeaderFooterMenu( bFlag ); break; + case FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON: + if( STATE_TOGGLE == eState ) + bFlag = !pOpt->IsShowOutlineContentVisibilityButton(); + + pOpt->SetShowOutlineContentVisibilityButton( bFlag ); + break; + default: OSL_FAIL("wrong request method"); return; @@ -616,6 +626,9 @@ void SwView::ExecViewOptions(SfxRequest &rReq) if ( nSlot == SID_AUTOSPELL_CHECK ) GetPostItMgr()->SetSpellChecking(); + if (nSlot == FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON) + GetEditWin().SetOutlineContentVisiblityButtons(); + const bool bLockedView = rSh.IsViewLocked(); rSh.LockView( true ); //lock visible section GetWrtShell().EndAction(); diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index 24e44dfbc675..0888e448cee9 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -94,6 +94,7 @@ enum SwViewSettingsPropertyHandles HANDLE_VIEWSET_HIDE_WHITESPACE, HANDLE_VIEWSET_USE_HEADERFOOTERMENU, HANDLE_VIEWSET_BOOKMARKS, + HANDLE_VIEWSET_SHOW_OUTLINECONTENTVISIBILITYBUTTON }; enum SwPrintSettingsPropertyHandles @@ -132,6 +133,7 @@ static ChainablePropertySetInfo * lcl_createViewSettingsInfo() { OUString( "ShowContentTips" ), HANDLE_VIEWSET_SHOW_CONTENT_TIPS , cppu::UnoType<bool>::get(), PROPERTY_NONE}, { OUString( "ShowInlineTooltips" ), HANDLE_VIEWSET_INLINECHANGES_TIPS , cppu::UnoType<bool>::get(), PROPERTY_NONE}, { OUString( "UseHeaderFooterMenu" ), HANDLE_VIEWSET_USE_HEADERFOOTERMENU , cppu::UnoType<bool>::get(), PROPERTY_NONE}, + { OUString( "ShowOutlineContentVisibilityButton" ), HANDLE_VIEWSET_SHOW_OUTLINECONTENTVISIBILITYBUTTON , cppu::UnoType<bool>::get(), PROPERTY_NONE}, { OUString( "RasterResolutionX"), HANDLE_VIEWSET_RASTER_RESOLUTION_X, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE}, { OUString( "RasterResolutionY"), HANDLE_VIEWSET_RASTER_RESOLUTION_Y, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE}, { OUString( "RasterSubdivisionX"), HANDLE_VIEWSET_RASTER_SUBDIVISION_X, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE}, @@ -594,6 +596,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c case HANDLE_VIEWSET_SCROLLBAR_TIPS : mpViewOption->SetShowScrollBarTips(*o3tl::doAccess<bool>(rValue)); break; case HANDLE_VIEWSET_INLINECHANGES_TIPS : mpViewOption->SetShowInlineTooltips(*o3tl::doAccess<bool>(rValue)); break; case HANDLE_VIEWSET_USE_HEADERFOOTERMENU : mpViewOption->SetUseHeaderFooterMenu(*o3tl::doAccess<bool>(rValue)); break; + case HANDLE_VIEWSET_SHOW_OUTLINECONTENTVISIBILITYBUTTON : mpViewOption->SetShowOutlineContentVisibilityButton(*o3tl::doAccess<bool>(rValue)); break; case HANDLE_VIEWSET_RASTER_RESOLUTION_X : { sal_Int32 nTmp = 0; diff --git a/sw/uiconfig/swriter/ui/viewoptionspage.ui b/sw/uiconfig/swriter/ui/viewoptionspage.ui index cf6e782a2373..b3237c7c41f7 100644 --- a/sw/uiconfig/swriter/ui/viewoptionspage.ui +++ b/sw/uiconfig/swriter/ui/viewoptionspage.ui @@ -174,6 +174,7 @@ <property name="can_focus">True</property> <property name="receives_default">False</property> <property name="use_underline">True</property> + <property name="xalign">0</property> <property name="draw_indicator">True</property> </object> <packing> @@ -181,6 +182,21 @@ <property name="top_attach">5</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="outlinecontentvisibilitybutton"> + <property name="label" translatable="yes" context="viewoptionspage|outlinecontentvisibilitybutton">_Show outline content visibility button</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">6</property> + </packing> + </child> </object> </child> </object> |