Hide Navigation toolbar until needed
Hide Navigation toolbar until there is something to navigate.
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
index e0a1085..465244a 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
@@ -660,7 +660,7 @@
<value>true</value>
</prop>
<prop oor:name="Visible" oor:type="xs:boolean">
<value>true</value>
<value>false</value>
</prop>
<prop oor:name="UIName" oor:type="xs:string">
<value xml:lang="en-US">Navigation</value>
@@ -669,7 +669,7 @@
<value>false</value>
</prop>
<prop oor:name="ContextSensitive" oor:type="xs:boolean">
<value>false</value>
<value>true</value>
</prop>
</node>
</node>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
index 455b97e..3bf5e2f 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
@@ -666,7 +666,7 @@
<value>true</value>
</prop>
<prop oor:name="Visible" oor:type="xs:boolean">
<value>true</value>
<value>false</value>
</prop>
<prop oor:name="UIName" oor:type="xs:string">
<value xml:lang="en-US">Navigation</value>
@@ -675,7 +675,7 @@
<value>false</value>
</prop>
<prop oor:name="ContextSensitive" oor:type="xs:boolean">
<value>false</value>
<value>true</value>
</prop>
</node>
</node>
diff --git a/sw/source/ui/wrtsh/navmgr.cxx b/sw/source/ui/wrtsh/navmgr.cxx
index 2ef5b17..f465463 100644
--- a/sw/source/ui/wrtsh/navmgr.cxx
+++ b/sw/source/ui/wrtsh/navmgr.cxx
@@ -35,6 +35,10 @@
#include <cmdid.h>
#include <view.hxx>
#include <com/sun/star/frame/XLayoutManager.hpp>
namespace css = ::com::sun::star;
/**
* If SMART is defined, the navigation history has recency with temporal ordering enhancement,
* as described on http://zing.ncsl.nist.gov/hfweb/proceedings/greenberg/
@@ -219,6 +223,31 @@ bool SwNavigationMgr::addEntry(const SwPosition& rPos) {
_pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_BACK);
if (bForwardWasEnabled)
_pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_FORWARD);
/* show the Navigation toolbar */
css::uno::Reference< css::frame::XFrame > xFrame = _pMyShell->GetView().GetViewFrame()->GetFrame().GetFrameInterface();
if (xFrame.is())
{
css::uno::Reference< css::beans::XPropertySet > xPropSet(xFrame, css::uno::UNO_QUERY);
if (xPropSet.is())
{
css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
css::uno::Any aValue = xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ) );
aValue >>= xLayoutManager;
if (xLayoutManager.is())
{
const ::rtl::OUString sResourceURL( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/navigationobjectbar" ) );
css::uno::Reference< css::ui::XUIElement > xUIElement = xLayoutManager->getElement(sResourceURL);
if (!xUIElement.is())
{
xLayoutManager->createElement( sResourceURL );
xLayoutManager->showElement( sResourceURL );
}
}
}
}
return bRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */