summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorheiko tietze <tietze.heiko@gmail.com>2018-10-12 10:56:58 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2018-10-12 13:33:29 +0200
commit4e4c8a71756da952686cdd682c6132413959dc21 (patch)
tree95adfb5c47f7914a628a382d940ed3e11e72d66f
parent95b91bafa519e45177689e9459e621370a34a40b (diff)
tdf#118621 - Optionally disable floating header/footer menu
UNO command UseHeaderFooterMenu introduced Change-Id: I4be009e08bc66dc675c7c903552c6376e22639f1 Reviewed-on: https://gerrit.libreoffice.org/61706 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--offapi/com/sun/star/text/ViewSettings.idl7
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu11
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Writer.xcs8
-rw-r--r--sw/inc/cmdid.h1
-rw-r--r--sw/inc/viewopt.hxx9
-rw-r--r--sw/inc/viewsh.hxx2
-rw-r--r--sw/sdi/_viewsh.sdi8
-rw-r--r--sw/sdi/swriter.sdi17
-rw-r--r--sw/source/core/view/viewsh.cxx12
-rw-r--r--sw/source/uibase/uiview/view0.cxx12
-rw-r--r--sw/source/uibase/uno/unomod.cxx5
-rw-r--r--sw/uiconfig/sglobal/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/swriter/menubar/menubar.xml1
13 files changed, 90 insertions, 4 deletions
diff --git a/offapi/com/sun/star/text/ViewSettings.idl b/offapi/com/sun/star/text/ViewSettings.idl
index c433d9c3f2b0..5de3bf8d6dd5 100644
--- a/offapi/com/sun/star/text/ViewSettings.idl
+++ b/offapi/com/sun/star/text/ViewSettings.idl
@@ -271,6 +271,13 @@ published service ViewSettings
@since LibreOffice 6.1
*/
[optional, property] boolean ShowInlineTooltips;
+
+ /** If this property is `TRUE`, the advanced menu for header/footer is shown
+
+ @since LibreOffice 6.2
+ */
+ [optional, property] boolean UseHeaderFooterMenu;
+
};
}; }; }; };
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 4e1dfe6b1b34..fcb924112781 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -353,6 +353,17 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:UseHeaderFooterMenu" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Use header/footer menu</value>
+ </prop>
+ <prop oor:name="TooltipLabel" oor:type="xs:string">
+ <value xml:lang="en-US">Use the advanced popup menu to create header/footer on the fly</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</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 f9a9ba770f1c..164d74e24dc5 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -1063,6 +1063,14 @@
</info>
<value>true</value>
</prop>
+ <prop oor:name="UseHeaderFooterMenu" oor:type="xs:boolean" oor:nillable="false">
+ <!-- UIHints: Tools - Options - Text document - Contents - [Section] Display -->
+ <info>
+ <desc>Enables the writer to use the advanced menu on headers/footers.</desc>
+ <label>Use advanced header/footer menu</label>
+ </info>
+ <value>true</value>
+ </prop>
</group>
<group oor:name="NonprintingCharacter">
<info>
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 377cae2b4121..d829c3d45fe2 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -181,6 +181,7 @@
#define FN_SCROLL_NEXT (FN_VIEW + 58) /* uno:ScrollToNext */
#define FN_VIEW_HIDE_WHITESPACE (FN_VIEW + 59) /* Hide header, footer, and pagebreak */
#define FN_SHOW_INLINETOOLTIPS (FN_VIEW + 60) /* Show tooltips for tracked changes */
+#define FN_USE_HEADERFOOTERMENU (FN_VIEW + 61) /* Show advanced header/footer menu */
// Region: Insert
#define FN_INSERT_BOOKMARK (FN_INSERT + 2 ) /* Bookmark */
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index 6b4bbd1de9fc..439650d43a0e 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -35,6 +35,7 @@ class SwDocShell;
namespace svtools{ class ColorConfig;}
enum class ViewOptFlags1 {
+ UseHeaderFooterMenu = 0x00000001,
Tab = 0x00000002,
Blank = 0x00000004,
HardBlank = 0x00000008,
@@ -62,7 +63,7 @@ enum class ViewOptFlags1 {
Pageback = 0x40000000
};
namespace o3tl {
- template<> struct typed_flags<ViewOptFlags1> : is_typed_flags<ViewOptFlags1, 0x77dfcdfe> {};
+ template<> struct typed_flags<ViewOptFlags1> : is_typed_flags<ViewOptFlags1, 0x77dfcdff> {};
}
enum class ViewOptCoreFlags2 {
@@ -267,6 +268,12 @@ public:
void SetShowInlineTooltips( bool b )
{ b ? (m_nCoreOptions |= ViewOptFlags1::ShowInlineTooltips ) : ( m_nCoreOptions &= ~ViewOptFlags1::ShowInlineTooltips); }
+ //show/hide interactive header/footer on top/bootom of pages
+ bool IsUseHeaderFooterMenu() const
+ { return bool(m_nCoreOptions & ViewOptFlags1::UseHeaderFooterMenu ); }
+ void SetUseHeaderFooterMenu( bool b )
+ { b ? (m_nCoreOptions |= ViewOptFlags1::UseHeaderFooterMenu ) : ( m_nCoreOptions &= ~ViewOptFlags1::UseHeaderFooterMenu); }
+
bool IsShowHiddenChar(bool bHard = false) const
{ return !m_bReadonly && (m_nCoreOptions & ViewOptFlags1::CharHidden) &&
((m_nCoreOptions & ViewOptFlags1::ViewMetachars)||bHard); }
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 484fbe951f95..db92346bc587 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -559,7 +559,7 @@ public:
/// Acts both for headers / footers, depending on the bShow(Header|Footer)Separator flags
bool IsHeaderFooterEdit() const { return mbHeaderFooterEdit; }
bool IsShowHeaderFooterSeparator( FrameControlType eControl ) { return (eControl == Header)? mbShowHeaderSeparator: mbShowFooterSeparator; }
- virtual void SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow ) { if ( eControl == Header ) mbShowHeaderSeparator = bShow; else mbShowFooterSeparator = bShow; }
+ virtual void SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow );
bool IsSelectAll() { return mbSelectAll; }
void setOutputToWindow(bool bOutputToWindow);
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index d61142d9bfde..43425fc9e6ca 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -915,5 +915,13 @@ interface BaseTextEditView
MenuConfig , AccelConfig , ToolBoxConfig ;
]
+ FN_USE_HEADERFOOTERMENU
+ [
+ ExecMethod = ExecViewOptions ;
+ StateMethod = StateViewOptions ;
+ Export = FALSE;
+ MenuConfig , AccelConfig , ToolBoxConfig ;
+ ]
+
}
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 52e73878e655..6f7d1d5e59e1 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -7684,3 +7684,20 @@ SfxBoolItem ShowInlineTooltips FN_SHOW_INLINETOOLTIPS
ToolBoxConfig = TRUE,
GroupId = SfxGroupId::View;
]
+
+SfxBoolItem UseHeaderFooterMenu FN_USE_HEADERFOOTERMENU
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::View;
+]
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index e2e855394e3a..587b3bc6b07c 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -100,6 +100,18 @@ static bool bInSizeNotify = false;
using namespace ::com::sun::star;
+void SwViewShell::SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow ) {
+
+ //tdf#118621 - Optionally disable floating header/footer menu
+ if ( bShow )
+ bShow = GetViewOptions()->IsUseHeaderFooterMenu();
+
+ if ( eControl == Header )
+ mbShowHeaderSeparator = bShow;
+ else
+ mbShowFooterSeparator = bShow;
+}
+
void SwViewShell::ToggleHeaderFooterEdit()
{
mbHeaderFooterEdit = !mbHeaderFooterEdit;
diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx
index 592147febec9..a51e3c5cbd1c 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -325,7 +325,10 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
break;
case FN_SHOW_INLINETOOLTIPS:
aBool.SetValue( pOpt->IsShowInlineTooltips() );
-
+ break;
+ case FN_USE_HEADERFOOTERMENU:
+ aBool.SetValue( pOpt->IsUseHeaderFooterMenu() );
+ break;
}
if( nWhich )
@@ -548,6 +551,13 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
pOpt->SetShowInlineTooltips( bFlag );
break;
+ case FN_USE_HEADERFOOTERMENU:
+ if( STATE_TOGGLE == eState )
+ bFlag = !pOpt->IsUseHeaderFooterMenu();
+
+ pOpt->SetUseHeaderFooterMenu( bFlag );
+ break;
+
default:
OSL_FAIL("wrong request method");
return;
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx
index 259c9728acce..00399ac9ca45 100644
--- a/sw/source/uibase/uno/unomod.cxx
+++ b/sw/source/uibase/uno/unomod.cxx
@@ -90,7 +90,8 @@ enum SwViewSettingsPropertyHandles
HANDLE_VIEWSET_VERT_RULER_METRIC,
HANDLE_VIEWSET_SCROLLBAR_TIPS,
HANDLE_VIEWSET_INLINECHANGES_TIPS,
- HANDLE_VIEWSET_HIDE_WHITESPACE
+ HANDLE_VIEWSET_HIDE_WHITESPACE,
+ HANDLE_VIEWSET_USE_HEADERFOOTERMENU,
};
enum SwPrintSettingsPropertyHandles
@@ -126,6 +127,7 @@ static ChainablePropertySetInfo * lcl_createViewSettingsInfo()
{ OUString( "IsVertRulerRightAligned"),HANDLE_VIEWSET_VRULER_RIGHT , cppu::UnoType<bool>::get(), PROPERTY_NONE},
{ 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( "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_IS_SNAP_TO_RASTER : mpViewOption->SetSnap(*o3tl::doAccess<bool>(rValue)); break;
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_RASTER_RESOLUTION_X :
{
sal_Int32 nTmp = 0;
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index dd478981d280..60579f58ed6c 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -336,6 +336,7 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertPageHeader"/>
<menu:menuitem menu:id=".uno:InsertPageFooter"/>
+ <menu:menuitem menu:id=".uno:UseHeaderFooterMenu"/>
</menu:menupopup>
</menu:menu>
<menu:menuseparator/>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index bec1b1644f76..7c9245e69923 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -336,6 +336,7 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertPageHeader"/>
<menu:menuitem menu:id=".uno:InsertPageFooter"/>
+ <menu:menuitem menu:id=".uno:UseHeaderFooterMenu"/>
</menu:menupopup>
</menu:menu>
<menu:menuseparator/>