[Libreoffice-commits] .: patches/dev300 src/icons
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Thu Jan 6 03:23:16 PST 2011
dev/null |binary
patches/dev300/apply | 5
patches/dev300/writer-navigation-buttons.diff | 1419 --------------------------
3 files changed, 1 insertion(+), 1423 deletions(-)
New commits:
commit 71fce2e824f907e6f347f95f4ee336a2b88ea978
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Thu Jan 6 12:21:58 2011 +0100
Moved writer-navigation-buttons.diff to git repos and cleaned it
diff --git a/patches/dev300/apply b/patches/dev300/apply
index aca81b8..ebd6ae6 100755
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -18,7 +18,7 @@ Common : BuildBits, TemporaryHacks, FixesNotForUpstream, \
OOXML, OOXMLExportDevel, OOXMLExport, UnitTesting, \
FedoraCommonFixes, LayoutDialogs, Fuzz, \
BuildFix, WriterDocComparison, \
- MySQL, BorderTypes, WriterNavigation
+ MySQL, BorderTypes
LinuxCommon : Common, Defaults, FontConfigTemporaryHacks, \
FedoraLinuxOnlyFixes, LinuxOnly, msaccess, \
@@ -1946,9 +1946,6 @@ SectionOwner => kohei
[ AutoLayout ]
impress-autolayout.diff, cocofan
-[ WriterNavigation ]
-writer-navigation-buttons.diff, ovcica
-
[ WriterDocComparison ]
SectionOwner => jholesov
# GSoC 2009 task, implemented by Tzvetelina Tzeneva
diff --git a/patches/dev300/writer-navigation-buttons.diff b/patches/dev300/writer-navigation-buttons.diff
deleted file mode 100644
index a0c8ec3..0000000
--- a/patches/dev300/writer-navigation-buttons.diff
+++ /dev/null
@@ -1,1419 +0,0 @@
-Feature from Maja's GSoc project
-
-From: Cédric Bosdonnat <cedricbosdo at openoffice.org>
-
-
----
-
- .../org/openoffice/Office/UI/WriterCommands.xcu | 16 +
- .../Office/UI/WriterGlobalWindowState.xcu | 23 ++
- .../org/openoffice/Office/UI/WriterWindowState.xcu | 23 ++
- packimages/pack/image-sort.lst | 1
- sfx2/inc/sfx2/sfx.hrc | 1
- sw/inc/cmdid.h | 3
- sw/inc/helpid.h | 1
- sw/inc/shellid.hxx | 1
- sw/sdi/_navsh.sdi | 49 +++
- sw/sdi/makefile.mk | 2
- sw/sdi/navsh.sdi | 34 ++
- sw/sdi/swriter.sdi | 51 ++++
- sw/sdi/swslots.sdi | 2
- sw/source/ui/app/swmodule.cxx | 2
- sw/source/ui/inc/navmgr.hxx | 74 +++++
- sw/source/ui/inc/navsh.hxx | 51 ++++
- sw/source/ui/inc/shells.hrc | 5
- sw/source/ui/inc/view.hxx | 3
- sw/source/ui/inc/wrtsh.hxx | 18 +
- sw/source/ui/shells/makefile.mk | 1
- sw/source/ui/shells/navsh.cxx | 169 ++++++++++++
- sw/source/ui/shells/shells.src | 31 ++
- sw/source/ui/shells/textsh1.cxx | 1
- sw/source/ui/uiview/view.cxx | 8 +
- sw/source/ui/uiview/view2.cxx | 4
- sw/source/ui/utlui/content.cxx | 7
- sw/source/ui/wrtsh/makefile.mk | 1
- sw/source/ui/wrtsh/move.cxx | 132 +++++++++
- sw/source/ui/wrtsh/navmgr.cxx | 282 ++++++++++++++++++++
- sw/source/ui/wrtsh/wrtsh1.cxx | 13 +
- sw/source/ui/wrtsh/wrtsh3.cxx | 1
- .../swriter/toolbar/navigationobjectbar.xml | 6
- 32 files changed, 1006 insertions(+), 10 deletions(-)
- create mode 100644 sw/sdi/_navsh.sdi
- create mode 100644 sw/sdi/navsh.sdi
- create mode 100644 sw/source/ui/inc/navmgr.hxx
- create mode 100644 sw/source/ui/inc/navsh.hxx
- create mode 100644 sw/source/ui/shells/navsh.cxx
- create mode 100644 sw/source/ui/wrtsh/navmgr.cxx
- create mode 100644 sw/uiconfig/swriter/toolbar/navigationobjectbar.xml
-
-
-diff --git officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
-index 4fa2366..dc35bbc 100644
---- officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
-+++ officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
-@@ -2274,6 +2274,22 @@
- <value xml:lang="en-US">Continue previous numbering</value>
- </prop>
- </node>
-+ <node oor:name=".uno:NavigateBack" oor:op="replace">
-+ <prop oor:name="Label" oor:type="xs:string">
-+ <value xml:lang="en-US">Back</value>
-+ </prop>
-+ <prop oor:name="Properties" oor:type="xs:int">
-+ <value>1</value>
-+ </prop>
-+ </node>
-+ <node oor:name=".uno:NavigateForward" oor:op="replace">
-+ <prop oor:name="Label" oor:type="xs:string">
-+ <value xml:lang="en-US">Forward</value>
-+ </prop>
-+ <prop oor:name="Properties" oor:type="xs:int">
-+ <value>1</value>
-+ </prop>
-+ </node>
- </node>
- </node>
- </oor:component-data>
-diff --git officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
-index c18fc70..4b41812 100644
---- officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
-+++ officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
-@@ -649,6 +649,29 @@
- <value>true</value>
- </prop>
- </node>
-+ <node oor:name="private:resource/toolbar/navigationobjectbar" oor:op="replace">
-+ <prop oor:name="DockingArea" oor:type="xs:int">
-+ <value>0</value>
-+ </prop>
-+ <prop oor:name="DockPos" oor:type="xs:string">
-+ <value>0,1</value>
-+ </prop>
-+ <prop oor:name="Docked" oor:type="xs:boolean">
-+ <value>true</value>
-+ </prop>
-+ <prop oor:name="Visible" oor:type="xs:boolean">
-+ <value>true</value>
-+ </prop>
-+ <prop oor:name="UIName" oor:type="xs:string">
-+ <value xml:lang="en-US">Navigation</value>
-+ </prop>
-+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
-+ <value>false</value>
-+ </prop>
-+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
-+ <value>false</value>
-+ </prop>
-+ </node>
- </node>
- </node>
- </oor:component-data>
-diff --git officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
-index 51b7224..f1d14cd 100644
---- officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
-+++ officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
-@@ -655,6 +655,29 @@
- <value>true</value>
- </prop>
- </node>
-+ <node oor:name="private:resource/toolbar/navigationobjectbar" oor:op="replace">
-+ <prop oor:name="DockingArea" oor:type="xs:int">
-+ <value>0</value>
-+ </prop>
-+ <prop oor:name="DockPos" oor:type="xs:string">
-+ <value>0,1</value>
-+ </prop>
-+ <prop oor:name="Docked" oor:type="xs:boolean">
-+ <value>true</value>
-+ </prop>
-+ <prop oor:name="Visible" oor:type="xs:boolean">
-+ <value>true</value>
-+ </prop>
-+ <prop oor:name="UIName" oor:type="xs:string">
-+ <value xml:lang="en-US">Navigation</value>
-+ </prop>
-+ <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
-+ <value>false</value>
-+ </prop>
-+ <prop oor:name="ContextSensitive" oor:type="xs:boolean">
-+ <value>false</value>
-+ </prop>
-+ </node>
- </node>
- </node>
- </oor:component-data>
-diff --git packimages/pack/image-sort.lst packimages/pack/image-sort.lst
-index d7a615b..5339b55 100644
---- packimages/pack/image-sort.lst
-+++ packimages/pack/image-sort.lst
-@@ -309,6 +309,7 @@ uiconfig/modules/swriter/toolbar/graphicobjectbar.xml
- uiconfig/modules/swriter/toolbar/insertbar.xml
- uiconfig/modules/swriter/toolbar/mediaobjectbar.xml
- uiconfig/modules/swriter/toolbar/moreformcontrols.xml
-+uiconfig/modules/swriter/toolbar/navigationobjectbar.xml
- uiconfig/modules/swriter/toolbar/numobjectbar.xml
- uiconfig/modules/swriter/toolbar/oleobjectbar.xml
- uiconfig/modules/swriter/toolbar/optimizetablebar.xml
-diff --git sfx2/inc/sfx2/sfx.hrc sfx2/inc/sfx2/sfx.hrc
-index 6071c16..7ea194f 100755
---- sfx2/inc/sfx2/sfx.hrc
-+++ sfx2/inc/sfx2/sfx.hrc
-@@ -303,6 +303,7 @@
- #define GID_MODIFY (RID_GROUPS_SFXOFFSET+23)
- #define GID_DRAWING (RID_GROUPS_SFXOFFSET+24)
- #define GID_CONTROLS (RID_GROUPS_SFXOFFSET+25)
-+#define GID_NAVIGATION (RID_GROUPS_SFXOFFSET+26)
-
- // compatibility-#defines
- #define GID_FORMEL GID_MATH
-diff --git sw/inc/cmdid.h sw/inc/cmdid.h
-index 5c59f70..475354b 100644
---- sw/inc/cmdid.h
-+++ sw/inc/cmdid.h
-@@ -908,6 +908,9 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr
- #define FN_UNO_META (FN_EXTRA2 + 112)
- #define FN_UNO_NESTED_TEXT_CONTENT (FN_EXTRA2 + 113)
-
-+#define FN_NAVIGATION_BACK (FN_EXTRA2 + 114)
-+#define FN_NAVIGATION_FORWARD (FN_EXTRA2 + 115)
-+
- /*--------------------------------------------------------------------
- Bereich: Hilfe
- --------------------------------------------------------------------*/
-diff --git sw/inc/helpid.h sw/inc/helpid.h
-index 9f5c6ad..f0658f1 100644
---- sw/inc/helpid.h
-+++ sw/inc/helpid.h
-@@ -982,5 +982,7 @@
- #define HID_MM_HEADER_13 (HID_BASE + 2280)
-
- #define HID_TITLEPAGE (HID_BASE + 2281)
-+
-+#define HID_NAVIGATION_TOOLBOX (HID_BASE + 2282)
-
- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-diff --git sw/inc/shellid.hxx sw/inc/shellid.hxx
-index 65af848..e3ef3e6 100644
---- sw/inc/shellid.hxx
-+++ sw/inc/shellid.hxx
-@@ -70,6 +70,7 @@
- #define SW_MEDIASHELL (SFX_INTERFACE_SW_START + 31)
- #define SW_ANNOTATIONSHELL (SFX_INTERFACE_SW_START + 32)
-
-+#define SW_NAVIGATIONSHELL (SFX_INTERFACE_SW_START + 33)
- #endif // _UIPARAM_HXX
-
- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-diff --git sw/sdi/_navsh.sdi sw/sdi/_navsh.sdi
-new file mode 100644
-index 0000000..deb4fb9
---- /dev/null
-+++ sw/sdi/_navsh.sdi
-@@ -0,0 +1,49 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: _navsh.sdi,v $
-+ * $Revision: 1.0 $
-+ *
-+ * This file is part of OpenOffice.org.
-+ *
-+ * OpenOffice.org is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License version 3
-+ * only, as published by the Free Software Foundation.
-+ *
-+ * OpenOffice.org is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License version 3 for more details
-+ * (a copy is included in the LICENSE file that accompanied this code).
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * version 3 along with OpenOffice.org. If not, see
-+ * <http://www.openoffice.org/license.html>
-+ * for a copy of the LGPLv3 License.
-+ *
-+ ************************************************************************/
-+
-+interface _Navigation
-+[ Automation = FALSE; ]
-+{
-+ SfxVoidItem NavigateBack FN_NAVIGATION_BACK
-+ [
-+ ExecMethod = Execute ;
-+ StateMethod = GetState;
-+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
-+ ]
-+
-+ SfxVoidItem NavigateForward FN_NAVIGATION_FORWARD
-+ [
-+ ExecMethod = Execute ;
-+ StateMethod = GetState;
-+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
-+ ]
-+
-+}
-+
-diff --git sw/sdi/makefile.mk sw/sdi/makefile.mk
-index e539c7a..dbbd3e2 100644
---- sw/sdi/makefile.mk
-+++ sw/sdi/makefile.mk
-@@ -96,6 +96,8 @@ SVSDI1DEPEND= \
- mediash.sdi\
- _annotsh.sdi\
- annotsh.sdi\
-+ _navsh.sdi \
-+ navsh.sdi \
- swslots.hrc \
- $(INC)$/globals.hrc \
- $(INC)$/cmdid.h
-diff --git sw/sdi/navsh.sdi sw/sdi/navsh.sdi
-new file mode 100644
-index 0000000..dbb7a2e
---- /dev/null
-+++ sw/sdi/navsh.sdi
-@@ -0,0 +1,34 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: navsh.sdi,v $
-+ * $Revision: 1.6 $
-+ *
-+ * This file is part of OpenOffice.org.
-+ *
-+ * OpenOffice.org is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License version 3
-+ * only, as published by the Free Software Foundation.
-+ *
-+ * OpenOffice.org is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License version 3 for more details
-+ * (a copy is included in the LICENSE file that accompanied this code).
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * version 3 along with OpenOffice.org. If not, see
-+ * <http://www.openoffice.org/license.html>
-+ * for a copy of the LGPLv3 License.
-+ *
-+ ************************************************************************/
-+
-+shell SwNavigationShell
-+{
-+ import _Navigation[Automation];
-+}
-diff --git sw/sdi/swriter.sdi sw/sdi/swriter.sdi
-index 633cda7..72d2557 100755
---- sw/sdi/swriter.sdi
-+++ sw/sdi/swriter.sdi
-@@ -10341,3 +10341,54 @@ SfxVoidItem CopyHyperlinkLocation FN_COPY_HYPERLINK_LOCATION
- ToolBoxConfig = TRUE,
- GroupId = GID_EDIT;
- ]
-+
-+//--------------------------------------------------------------------------
-+SfxVoidItem NavigateBack FN_NAVIGATION_BACK
-+[
-+ /* flags: */
-+ AutoUpdate = TRUE,
-+ Cachable = Cachable,
-+ FastCall = FALSE,
-+ HasCoreId = FALSE,
-+ HasDialog = FALSE,
-+ ReadOnlyDoc = FALSE,
-+ Toggle = FALSE,
-+ Container = FALSE,
-+ RecordAbsolute = FALSE,
-+ RecordPerSet;
-+ Asynchron;
-+
-+ Readonly = FALSE,
-+
-+ /* config: */
-+ AccelConfig = TRUE,
-+ MenuConfig = TRUE,
-+ StatusBarConfig = FALSE,
-+ ToolBoxConfig = TRUE,
-+ GroupId = GID_NAVIGATION;
-+]
-+//--------------------------------------------------------------------------
-+SfxVoidItem NavigateForward FN_NAVIGATION_FORWARD
-+[
-+ /* flags: */
-+ AutoUpdate = TRUE,
-+ Cachable = Cachable,
-+ FastCall = FALSE,
-+ HasCoreId = FALSE,
-+ HasDialog = FALSE,
-+ ReadOnlyDoc = FALSE,
-+ Toggle = FALSE,
-+ Container = FALSE,
-+ RecordAbsolute = FALSE,
-+ RecordPerSet;
-+ Asynchron;
-+
-+ Readonly = FALSE,
-+
-+ /* config: */
-+ AccelConfig = TRUE,
-+ MenuConfig = TRUE,
-+ StatusBarConfig = FALSE,
-+ ToolBoxConfig = TRUE,
-+ GroupId = GID_NAVIGATION;
-+]
-diff --git sw/sdi/swslots.sdi sw/sdi/swslots.sdi
-index eb43955..118a482 100644
---- sw/sdi/swslots.sdi
-+++ sw/sdi/swslots.sdi
-@@ -120,6 +120,8 @@ ModulePrefix( "Sw" )
- include "_annotsh.sdi"
- include "annotsh.sdi"
-
-+ include "_navsh.sdi"
-+ include "navsh.sdi"
- }
-
-
-diff --git sw/source/ui/app/swmodule.cxx sw/source/ui/app/swmodule.cxx
-index 569e068..8aa0ee9 100644
---- sw/source/ui/app/swmodule.cxx
-+++ sw/source/ui/app/swmodule.cxx
-@@ -161,6 +161,7 @@
- #include <avmedia/mediatoolbox.hxx>
-
- #include <annotsh.hxx>
-+#include <navsh.hxx>
-
- #include <app.hrc>
- #include <svx/xmlsecctrl.hxx>
-@@ -348,6 +349,7 @@ void SwDLL::RegisterInterfaces()
- SwBezierShell::RegisterInterface(pMod);
- SwGrfShell::RegisterInterface(pMod);
- SwOleShell::RegisterInterface(pMod);
-+ SwNavigationShell::RegisterInterface(pMod);
- SwWebTextShell::RegisterInterface(pMod);
- SwWebFrameShell::RegisterInterface(pMod);
- SwWebGrfShell::RegisterInterface(pMod);
-diff --git sw/source/ui/inc/navmgr.hxx sw/source/ui/inc/navmgr.hxx
-new file mode 100644
-index 0000000..4044767
---- /dev/null
-+++ sw/source/ui/inc/navmgr.hxx
-@@ -0,0 +1,74 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: navmgr.hxx,v $
-+ * $Revision: 1.0 $
-+ *
-+ * This file is part of OpenOffice.org.
-+ *
-+ * OpenOffice.org is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License version 3
-+ * only, as published by the Free Software Foundation.
-+ *
-+ * OpenOffice.org is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License version 3 for more details
-+ * (a copy is included in the LICENSE file that accompanied this code).
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * version 3 along with OpenOffice.org. If not, see
-+ * <http://www.openoffice.org/license.html>
-+ * for a copy of the LGPLv3 License.
-+ *
-+ ************************************************************************/
-+#ifndef _NAVMGR_HXX
-+#define _NAVMGR_HXX
-+
-+#include "swtypes.hxx"
-+#include "pam.hxx"
-+#include "swdllapi.h"
-+
-+class SwWrtShell;
-+struct SwPosition;
-+
-+class SW_DLLPUBLIC SwNavigationMgr
-+{
-+private:
-+ /*
-+ * List of entries in the navigation history
-+ * Each entry is a SwPosition, which represents a position within the document
-+ * SwPosition is given by a node index (SwNodeIndex) which usually represents the paragraph the position is in
-+ * and an index (SwIndex), which represents the position inside this paragraph.
-+ * You can find more on SwPositions at http://wiki.services.openoffice.org/wiki/Writer_Core_And_Layout
-+ *
-+ * The navigation history behaves as a stack, to which items are added when we jump to a new position
-+ * (e.g. click a link, or double click an entry from the navigator).
-+ * Every use of the back/forward buttons results in moving the stack pointer within the navigation history
-+ */
-+ std::vector<SwPosition> _entries;
-+ std::vector<SwPosition>::size_type _nCurrent; /* Current position within the navigation history */
-+ SwWrtShell* _pMyShell; /* The active shell within which the navigation occurs */
-+
-+ void GotoSwPosition(const SwPosition &rPos);
-+
-+public:
-+ /* Constructor that initializes the shell to the current shell */
-+ SwNavigationMgr( SwWrtShell* pShell );
-+ /* Can we go back in the history ? */
-+ BOOL backEnabled() ;
-+ /* Can we go forward in the history ? */
-+ BOOL forwardEnabled();
-+ /* The method that is called when we click the back button */
-+ void goBack() ;
-+ /* The method that is called when we click the forward button */
-+ void goForward() ;
-+ /* The method that adds the position pPos to the navigation history */
-+ bool addEntry(const SwPosition& rPos);
-+};
-+#endif
-diff --git sw/source/ui/inc/navsh.hxx sw/source/ui/inc/navsh.hxx
-new file mode 100644
-index 0000000..5f0c3c6
---- /dev/null
-+++ sw/source/ui/inc/navsh.hxx
-@@ -0,0 +1,51 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: navsh.hxx,v $
-+ * $Revision: 1.2 $
-+ *
-+ * This file is part of OpenOffice.org.
-+ *
-+ * OpenOffice.org is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License version 3
-+ * only, as published by the Free Software Foundation.
-+ *
-+ * OpenOffice.org is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License version 3 for more details
-+ * (a copy is included in the LICENSE file that accompanied this code).
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * version 3 along with OpenOffice.org. If not, see
-+ * <http://www.openoffice.org/license.html>
-+ * for a copy of the LGPLv3 License.
-+ *
-+ ************************************************************************/
-+#ifndef _SWNAVIGATIONSH_HXX
-+#define _SWNAVIGATIONSH_HXX
-+
-+#include "frmsh.hxx"
-+
-+class SfxItemSet;
-+class SwWrtShell;
-+
-+
-+
-+class SwNavigationShell: public SwBaseShell
-+{
-+public:
-+ SFX_DECL_INTERFACE(SW_NAVIGATIONSHELL)
-+
-+ SwNavigationShell(SwView &rView);
-+
-+ void GetState(SfxItemSet &);
-+ void Execute(SfxRequest &);
-+};
-+
-+#endif
-diff --git sw/source/ui/inc/shells.hrc sw/source/ui/inc/shells.hrc
-index 243c4fc..847d322 100644
---- sw/source/ui/inc/shells.hrc
-+++ sw/source/ui/inc/shells.hrc
-@@ -102,7 +102,9 @@
-
- #define RID_MEDIA_TOOLBOX (RC_SHELLS_BEGIN + 61)
-
--#define SHELLS_ACT_END RID_MEDIA_TOOLBOX
-+#define STR_SHELLNAME_NAVIGATION (RC_SHELLS_BEGIN + 62)
-+
-+#define SHELLS_ACT_END STR_SHELLNAME_NAVIGATION
-
- #if SHELLS_ACT_END > RC_SHELLS_END
- #error Resource-Id Ueberlauf in #file, #line
-diff --git sw/source/ui/inc/view.hxx sw/source/ui/inc/view.hxx
-index 08e27ac..09f0c1b 100644
---- sw/source/ui/inc/view.hxx
-+++ sw/source/ui/inc/view.hxx
-@@ -129,7 +129,8 @@ enum ShellModes
- SHELL_MODE_MEDIA,
- SHELL_MODE_EXTRUDED_CUSTOMSHAPE,
- SHELL_MODE_FONTWORK,
-- SHELL_MODE_POSTIT
-+ SHELL_MODE_POSTIT,
-+ SHELL_MODE_NAVIGATION
- };
-
- /*--------------------------------------------------------------------
-diff --git sw/source/ui/inc/wrtsh.hxx sw/source/ui/inc/wrtsh.hxx
-index 14b26c0..3adf7dd 100644
---- sw/source/ui/inc/wrtsh.hxx
-+++ sw/source/ui/inc/wrtsh.hxx
-@@ -33,6 +33,7 @@
- #include <sortopt.hxx>
- #include <swurl.hxx>
- #include <IMark.hxx>
-+#include "navmgr.hxx"
-
- class Window;
- class OutputDevice;
-@@ -474,6 +476,21 @@ typedef BOOL (SwWrtShell:: *FNSimpleMove)();
-
- String GetSelDescr() const;
-
-+ SwNavigationMgr& GetNavigationMgr();
-+ void addCurrentPosition();
-+ BOOL GotoFly( const String& rName, FlyCntType eType = FLYCNTTYPE_ALL,
-+ BOOL bSelFrame = TRUE );
-+ BOOL GotoINetAttr( const SwTxtINetFmt& rAttr );
-+ void GotoOutline( USHORT nIdx );
-+ BOOL GotoOutline( const String& rName );
-+ BOOL GotoRegion( const String& rName );
-+ BOOL GotoRefMark( const String& rRefMark, USHORT nSubType = 0,
-+ USHORT nSeqNo = 0 );
-+ BOOL GotoNextTOXBase( const String* pName = 0);
-+ BOOL GotoTable( const String& rName );
-+ BOOL GotoFld( const SwFmtFld& rFld );
-+ const SwRedline* GotoRedline( USHORT nArrPos, BOOL bSelect = FALSE);
-+
- private:
-
- SW_DLLPRIVATE void OpenMark();
-@@ -530,6 +547,7 @@ private:
- } *pCrsrStack;
-
- SwView &rView;
-+ SwNavigationMgr aNavigationMgr;
-
- Point aDest;
- BOOL bDestOnStack;
-diff --git sw/source/ui/shells/makefile.mk sw/source/ui/shells/makefile.mk
-index dce62a2..b940bd0 100644
---- sw/source/ui/shells/makefile.mk
-+++ sw/source/ui/shells/makefile.mk
-@@ -58,6 +58,7 @@ SLOFILES = \
- $(SLO)$/grfshex.obj \
- $(SLO)$/mediash.obj \
- $(SLO)$/listsh.obj \
-+ $(SLO)$/navsh.obj \
- $(SLO)$/olesh.obj \
- $(SLO)$/slotadd.obj \
- $(SLO)$/tabsh.obj \
-diff --git sw/source/ui/shells/navsh.cxx sw/source/ui/shells/navsh.cxx
-new file mode 100644
-index 0000000..9f3a1ca
---- /dev/null
-+++ sw/source/ui/shells/navsh.cxx
-@@ -0,0 +1,168 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: navsh.cxx,v $
-+ * $Revision: 1.1 $
-+ *
-+ * This file is part of OpenOffice.org.
-+ *
-+ * OpenOffice.org is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License version 3
-+ * only, as published by the Free Software Foundation.
-+ *
-+ * OpenOffice.org is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License version 3 for more details
-+ * (a copy is included in the LICENSE file that accompanied this code).
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * version 3 along with OpenOffice.org. If not, see
-+ * <http://www.openoffice.org/license.html>
-+ * for a copy of the LGPLv3 License.
-+ *
-+ ************************************************************************/
-+
-+// MARKER(update_precomp.py): autogen include statement, do not remove
-+#include "precompiled_sw.hxx"
-+
-+
-+#include "cmdid.h"
-+#include <svx/svdview.hxx>
-+#include <svx/srchitem.hxx>
-+#include <svl/eitem.hxx>
-+#include <svl/whiter.hxx>
-+#include <svx/svdopath.hxx>
-+#include <sfx2/request.hxx>
-+#include <sfx2/dispatch.hxx>
-+#include <sfx2/objface.hxx>
-+
-+#include "wrtsh.hxx"
-+#include "view.hxx"
-+#include "edtwin.hxx"
-+#include "helpid.h"
-+#include "globals.hrc"
-+
-+#include "navsh.hxx"
-+
-+
-+#include "popup.hrc"
-+#include "shells.hrc"
-+#define SwNavigationShell
-+#include "swslots.hxx"
-+
-+#include <unomid.h>
-+
-+#include "navmgr.hxx"
-+
-+#if DEBUG
-+#include <iostream>
-+using namespace std;
-+#endif
-+
-+
-+//#define DEBUG_STATE 1
-+//#define DEBUG_EXECUTE 1
-+
-+SFX_IMPL_INTERFACE(SwNavigationShell, SwBaseShell, SW_RES(STR_SHELLNAME_NAVIGATION))
-+{
-+}
-+
-+SwNavigationShell::SwNavigationShell(SwView &_rView):
-+ SwBaseShell( _rView )
-+
-+{
-+ SetName(C2S("Navigation"));
-+ SetHelpId(SW_NAVIGATIONSHELL);
-+}
-+
-+void SwNavigationShell::Execute(SfxRequest &rReq)
-+{
-+#if DEBUG_EXECUTE
-+ clog << "Calling execute " << endl;
-+#endif
-+ SwWrtShell *pSh = &GetShell();
-+ SdrView* pSdrView = pSh->GetDrawView();
-+ const SfxItemSet *pArgs = rReq.GetArgs();
-+ USHORT nSlotId = rReq.GetSlot();
-+ BOOL bChanged = pSdrView->GetModel()->IsChanged();
-+ pSdrView->GetModel()->SetChanged(FALSE);
-+ SwNavigationMgr& aSwNavigationMgr = pSh->GetNavigationMgr();
-+ const SfxPoolItem* pItem;
-+ if(pArgs)
-+ pArgs->GetItemState(nSlotId, FALSE, &pItem);
-+#if DEBUG_EXECUTE
-+ clog << "entering switch() " << endl;
-+#endif
-+ switch (nSlotId)
-+ {
-+ case FN_NAVIGATION_BACK:
-+#if DEBUG_EXECUTE
-+ clog << "Execute(FN_NAVIGATION_BACK)" << endl;
-+#endif
-+ aSwNavigationMgr.goBack();
-+ break;
-+
-+ case FN_NAVIGATION_FORWARD:
-+#if DEBUG_EXECUTE
-+ clog << "Execute(FN_NAVIGATION_FORWARD)" << endl;
-+#endif
-+ aSwNavigationMgr.goForward();
-+ break;
-+ default:
-+ break;
-+ }
-+ if (pSdrView->GetModel()->IsChanged())
-+ GetShell().SetModified();
-+ else if (bChanged)
-+ pSdrView->GetModel()->SetChanged(TRUE);
-+#if DEBUG_EXECUTE
-+ clog << "execute ended" << endl << endl;
-+#endif
-+}
-+
-+/*--------------------------------------------------------------------
-+ determine if the buttons should be enabled/disabled
-+ --------------------------------------------------------------------*/
-+
-+
-+void SwNavigationShell::GetState(SfxItemSet &rSet)
-+{
-+ SwWrtShell *pSh = &GetShell();
-+ SfxWhichIter aIter( rSet );
-+ USHORT nWhich = aIter.FirstWhich();
-+ SwNavigationMgr& aNavigationMgr = pSh->GetNavigationMgr();
-+ while( nWhich )
-+ {
-+ switch( nWhich )
-+ {
-+ case FN_NAVIGATION_BACK:
-+ {
-+#if DEBUG_STATE
-+ clog << "SwNavigationShell::GetState( FN_NAVIGATION_BACK )" << endl;
-+#endif
-+ if (!aNavigationMgr.backEnabled()) {
-+ rSet.DisableItem(FN_NAVIGATION_BACK);
-+ }
-+ }
-+ break;
-+ case FN_NAVIGATION_FORWARD:
-+ {
-+#if DEBUG_STATE
-+ clog << "SwNavigationShell::GetState( FN_NAVIGATION_FORWARD )" << endl;
-+#endif
-+ if (!aNavigationMgr.forwardEnabled())
-+ rSet.DisableItem(FN_NAVIGATION_FORWARD);
-+ }
-+ break;
-+ default:
-+ break;
-+ }
-+ nWhich = aIter.NextWhich();
-+ }
-+}
-diff --git sw/source/ui/shells/textsh1.cxx sw/source/ui/shells/textsh1.cxx
-index f41d28c..760e4d7 100644
---- sw/source/ui/shells/textsh1.cxx
-+++ sw/source/ui/shells/textsh1.cxx
-@@ -1745,6 +1745,7 @@ void SwTextShell::ChangeHeaderOrFooter(
- const String& rStyleName, BOOL bHeader, BOOL bOn, BOOL bShowWarning)
- {
- SwWrtShell& rSh = GetShell();
-+ rSh.addCurrentPosition();
- rSh.StartAllAction();
- rSh.StartUndo( UNDO_HEADER_FOOTER ); // #i7983#
- BOOL bExecute = TRUE;
-diff --git sw/source/ui/uiview/view.cxx sw/source/ui/uiview/view.cxx
-index 0e3d55e..dabdefa 100644
---- sw/source/ui/uiview/view.cxx
-+++ sw/source/ui/uiview/view.cxx
-@@ -73,6 +73,7 @@
- #include <drformsh.hxx>
- #include <drwtxtsh.hxx>
- #include <beziersh.hxx>
-+#include <navsh.hxx>
- #include <globdoc.hxx>
- #include <scroll.hxx>
- #include <globdoc.hxx>
-@@ -335,6 +336,10 @@ void SwView::SelectShell()
- if ( !( nSelectionType & nsSelectionType::SEL_FOC_FRM_CTRL ) )
- rDispatcher.Push( *pFormShell );
-
-+ eShellMode = SHELL_MODE_NAVIGATION;
-+ pShell = new SwNavigationShell( *this );
-+ rDispatcher.Push( *pShell );
-+
- if ( nSelectionType & nsSelectionType::SEL_OLE )
- {
- eShellMode = SHELL_MODE_OBJECT;
-diff --git sw/source/ui/uiview/view2.cxx sw/source/ui/uiview/view2.cxx
-index dbabf2b..f212478 100755
---- sw/source/ui/uiview/view2.cxx
-+++ sw/source/ui/uiview/view2.cxx
-@@ -1917,8 +1917,10 @@ BOOL SwView::JumpToSwMark( const String& rMark )
- }
- else if( pMarkAccess->getMarksEnd() != (ppMark = pMarkAccess->findMark(sMark)) )
- pWrtShell->GotoMark( ppMark->get(), FALSE, TRUE ), bRet = TRUE;
-- else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) ))
-+ else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) )) {
-+ pWrtShell->addCurrentPosition();
- bRet = pWrtShell->GotoINetAttr( *pINet->GetTxtINetFmt() );
-+ }
-
- // fuer alle Arten von Flys
- if( FLYCNTTYPE_ALL != eFlyType && pWrtShell->GotoFly( sName, eFlyType ))
-diff --git sw/source/ui/utlui/content.cxx sw/source/ui/utlui/content.cxx
-index a59244a..6f44d96 100644
---- sw/source/ui/utlui/content.cxx
-+++ sw/source/ui/utlui/content.cxx
-@@ -114,6 +114,7 @@
- #include "globals.hrc"
- #include <unomid.h>
-
-+#include "navmgr.hxx"
-
- #define CTYPE_CNT 0
- #define CTYPE_CTT 1
-@@ -3217,10 +3218,10 @@ void SwContentTree::GotoContent(SwContent* pCnt)
- break;
- case CONTENT_TYPE_URLFIELD:
- {
-- if(pActiveShell->GotoINetAttr(
-+ if(pActiveShell->GotoINetAttr(
- *((SwURLFieldContent*)pCnt)->GetINetAttr() ))
- {
-- pActiveShell->Right( CRSR_SKIP_CHARS, sal_True, 1, sal_False);
-+ pActiveShell->Right( CRSR_SKIP_CHARS, sal_True, 1, sal_False);
- pActiveShell->SwCrsrShell::SelectTxtAttr( RES_TXTATR_INETFMT, sal_True );
- }
-
-@@ -3248,6 +3249,7 @@ void SwContentTree::GotoContent(SwContent* pCnt)
- break;
- case CONTENT_TYPE_DRAWOBJECT:
- {
-+ SwPosition aPos = *pActiveShell->GetCrsr()->GetPoint();
- SdrView* pDrawView = pActiveShell->GetDrawView();
- if (pDrawView)
- {
-@@ -3271,6 +3273,7 @@ void SwContentTree::GotoContent(SwContent* pCnt)
- }
- }
- }
-+ pActiveShell->GetNavigationMgr().addEntry(aPos);
- }
- }
- break;
-diff --git sw/source/ui/wrtsh/makefile.mk sw/source/ui/wrtsh/makefile.mk
-index baeb3ac..464f2f8 100644
---- sw/source/ui/wrtsh/makefile.mk
-+++ sw/source/ui/wrtsh/makefile.mk
-@@ -43,6 +43,7 @@ SRC1FILES = \
- wrtsh.src
-
- SLOFILES = \
-+ $(SLO)$/navmgr.obj \
- $(SLO)$/move.obj \
- $(SLO)$/select.obj \
- $(SLO)$/wrtsh1.obj \
-diff --git sw/source/ui/wrtsh/move.cxx sw/source/ui/wrtsh/move.cxx
-index 3e649a9..80dafb6 100644
---- sw/source/ui/wrtsh/move.cxx
-+++ sw/source/ui/wrtsh/move.cxx
-@@ -37,6 +37,10 @@
- #include <viewopt.hxx>
- #include <crsskip.hxx>
-
-+#if DEBUG
-+#include <cstdio>
-+#endif
-+
- /* Immer:
- - Zuruecksetzen des Cursorstacks
- - Timer nachtriggern
-@@ -670,7 +674,130 @@ BOOL SwWrtShell::GotoPage(USHORT nPage, BOOL bRecord)
- BOOL SwWrtShell::GotoMark( const ::sw::mark::IMark* const pMark, BOOL bSelect, BOOL bStart )
- {
- ShellMoveCrsr aTmp( this, bSelect );
-- return SwCrsrShell::GotoMark( pMark, bStart );
-+ SwPosition aPos = *GetCrsr()->GetPoint();
-+#if DEBUG
-+ fprintf(stderr, "SwWrtShell::GotoBookmark()...\n");
-+#endif
-+ bool bRet = SwCrsrShell::GotoMark( pMark, bStart );
-+ if (bRet)
-+ aNavigationMgr.addEntry(aPos);
-+ return bRet;
-+}
-+
-+BOOL SwWrtShell::GotoFly( const String& rName, FlyCntType eType, BOOL bSelFrame )
-+{
-+ SwPosition aPos = *GetCrsr()->GetPoint();
-+#if DEBUG
-+ fprintf(stderr,"SwWrtShell::GotoFly()...\n");
-+#endif
-+ bool bRet = SwFEShell::GotoFly(rName, eType, bSelFrame);
-+ if (bRet)
-+ aNavigationMgr.addEntry(aPos);
-+ return bRet;
-+}
-+
-+BOOL SwWrtShell::GotoINetAttr( const SwTxtINetFmt& rAttr )
-+{
-+ SwPosition aPos = *GetCrsr()->GetPoint();
-+#if DEBUG
-+ fprintf(stderr, "SwWrtShell::GotoINetAttr()...\n");
-+#endif
-+ bool bRet = SwCrsrShell::GotoINetAttr(rAttr);
-+ if (bRet)
-+ aNavigationMgr.addEntry(aPos);
-+ return bRet;
-+}
-+
-+void SwWrtShell::GotoOutline( USHORT nIdx )
-+{
-+#if DEBUG
-+ fprintf(stderr, "SwWrtShell::GotoOutline(USHORT)...\n");
-+#endif
-+ addCurrentPosition();
-+ return SwCrsrShell::GotoOutline (nIdx);
-+}
-+
-+BOOL SwWrtShell::GotoOutline( const String& rName )
-+{
-+ SwPosition aPos = *GetCrsr()->GetPoint();
-+#if DEBUG
-+ fprintf(stderr, "SwWrtShell::GotoOutline(String)...\n");
-+#endif
-+ bool bRet = SwCrsrShell::GotoOutline (rName);
-+ if (bRet)
-+ aNavigationMgr.addEntry(aPos);
-+ return bRet;
-+}
-+
-+BOOL SwWrtShell::GotoRegion( const String& rName )
-+{
-+ SwPosition aPos = *GetCrsr()->GetPoint();
-+#if DEBUG
-+ fprintf(stderr, "SwWrtShell::GotoRegion()...\n");
-+#endif
-+ bool bRet = SwCrsrShell::GotoRegion (rName);
-+ if (bRet)
-+ aNavigationMgr.addEntry(aPos);
-+ return bRet;
-+ }
-+
-+BOOL SwWrtShell::GotoRefMark( const String& rRefMark, USHORT nSubType,
-+ USHORT nSeqNo )
-+{
-+ SwPosition aPos = *GetCrsr()->GetPoint();
-+#if DEBUG
-+ fprintf(stderr, "SwWrtShell::GotoRefMark(String)...\n");
-+#endif
-+ bool bRet = SwCrsrShell::GotoRefMark(rRefMark, nSubType, nSeqNo);
-+ if (bRet)
-+ aNavigationMgr.addEntry(aPos);
-+ return bRet;
-+}
-+
-+BOOL SwWrtShell::GotoNextTOXBase( const String* pName )
-+{
-+ SwPosition aPos = *GetCrsr()->GetPoint();
-+#if DEBUG
-+ fprintf(stderr, "SwWrtShell::GotoNextTOXBase(String)...\n");
-+#endif
-+ bool bRet = SwCrsrShell::GotoNextTOXBase(pName);
-+ if (bRet)
-+ aNavigationMgr.addEntry(aPos);
-+ return bRet;
-+}
-+
-+BOOL SwWrtShell::GotoTable( const String& rName )
-+{
-+ SwPosition aPos = *GetCrsr()->GetPoint();
-+#if DEBUG
-+ fprintf(stderr, "SwWrtShell::GotoTable(String)...\n");
-+#endif
-+ bool bRet = SwCrsrShell::GotoTable(rName);
-+ if (bRet)
-+ aNavigationMgr.addEntry(aPos);
-+ return bRet;
-+}
-+
-+BOOL SwWrtShell::GotoFld( const SwFmtFld& rFld ) {
-+ SwPosition aPos = *GetCrsr()->GetPoint();
-+#if DEBUG
-+ fprintf(stderr, "SwWrtShell::GotoFld()...\n");
-+#endif
-+ bool bRet = SwCrsrShell::GotoFld(rFld);
-+ if (bRet)
-+ aNavigationMgr.addEntry(aPos);
-+ return bRet;
-+}
-+
-+const SwRedline* SwWrtShell::GotoRedline( USHORT nArrPos, BOOL bSelect ) {
-+ SwPosition aPos = *GetCrsr()->GetPoint();
-+#if DEBUG
-+ fprintf(stderr, "SwWrtShell::GotoRedline()...\n");
-+#endif
-+ const SwRedline *pRedline = SwCrsrShell::GotoRedline(nArrPos, bSelect);
-+ if (pRedline)
-+ aNavigationMgr.addEntry(aPos);
-+ return pRedline;
- }
-
-
-diff --git sw/source/ui/wrtsh/navmgr.cxx sw/source/ui/wrtsh/navmgr.cxx
-new file mode 100644
-index 0000000..a0fc70f
---- /dev/null
-+++ sw/source/ui/wrtsh/navmgr.cxx
-@@ -0,0 +1,282 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2009 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: navmgr.cxx,v $
-+ * $Revision: 2.0 $
-+ *
-+ * This file is part of OpenOffice.org.
-+ *
-+ * OpenOffice.org is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License version 3
-+ * only, as published by the Free Software Foundation.
-+ *
-+ * OpenOffice.org is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License version 3 for more details
-+ * (a copy is included in the LICENSE file that accompanied this code).
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * version 3 along with OpenOffice.org. If not, see
-+ * <http://www.openoffice.org/license.html>
-+ * for a copy of the LGPLv3 License.
-+ *
-+ ************************************************************************/
-+#include "precompiled_sw.hxx"
-+
-+#include "navmgr.hxx"
-+#include "wrtsh.hxx"
-+#include <sfx2/bindings.hxx>
-+#include <sfx2/viewfrm.hxx>
-+#include <cmdid.h>
-+#include <view.hxx>
-+#include <stdio.h>
-+
-+/**
-+ * If SMART is defined, the navigation history has recency with temporal ordering enhancement,
-+ * as described on http://zing.ncsl.nist.gov/hfweb/proceedings/greenberg/
-+ */
-+#define SMART 1
-+
-+/* Debugging flags - uncomment a flag to see printouts that might be useful when debugging the feature*/
-+//#define DEBUG 1 /* For general debugging */
-+//#define DEBUG_GOTO 1 /* For debugging the moving of the cursor */
-+//#define DEBUG_ADDING 1 /* For debugging the adding of a new entry to the list */
-+
-+/*
-+ * This method positions the cursor to the position rPos
-+ */
-+void SwNavigationMgr::GotoSwPosition(const SwPosition &rPos) {
-+#if DEBUG_GOTO
-+ fprintf(stderr, "Going to sw position of index %d\n", rPos.nNode.GetIndex());
-+#endif
-+ SwWrtShell& rSh = *_pMyShell;
-+ /* EnterStdMode() prevents the cursor to 'block' the current shell when it should move from the image back to the normal shell */
-+ rSh.EnterStdMode();
-+ rSh.StartAllAction();
-+ /*
-+ * cursor consists of two SwPositions: Point and Mark.
-+ * Such a pair is called a PaM. SwPaM is derived from SwRing.
-+ * The Ring contains the single regions of a multi-selection.
-+ */
-+ SwPaM* pPaM = rSh.GetCrsr();
-+
-+ if(pPaM->HasMark())
-+ pPaM->DeleteMark(); // If there was a selection, get rid of it
-+ *pPaM->GetPoint() = rPos; // Position Cursor
-+
-+ rSh.EndAllAction();
-+}
-+/*
-+ * Ctor for the SwNavigationMgr class
-+ * Sets the shell to the current shell
-+ * and the index of the current position to 0
-+ */
-+
-+SwNavigationMgr::SwNavigationMgr(SwWrtShell* pShell)
-+ : _nCurrent(0), _pMyShell(pShell) {
-+}
-+/*
-+ * This method is used by the navigation shell - defined in sw/source/ui/inc/navsh.hxx
-+ * and implemented in sw/source/ui/shells/navsh.cxx
-+ * It is called when we want to check if the back button should be enabled or not.
-+ * The back button should be enabled only if there are some entries in the navigation history
-+ */
-+BOOL SwNavigationMgr::backEnabled() {
-+ return (_nCurrent > 0);
-+}
-+/*
-+ * Similar to backEnabled() method.
-+ * The forward button should be enabled if we ever clicked back
-+ * Due to the implementation of the navigation class, this is when the
-+ * current position within the navigation history entries in not the last one
-+ * i.e. when the _nCurrent index is not at the end of the _entries vector
-+ */
-+BOOL SwNavigationMgr::forwardEnabled() {
-+ return _nCurrent+1 < _entries.size();
-+}
-+
-+
-+/*
-+ * The goBack() method positions the cursor to the previous entry in the navigation history
-+ * If there was no history to go forward to, it adds the current position of the cursor
-+ * to the history so we could go forward to where we came from
-+ */
-+void SwNavigationMgr::goBack() {
-+ /*
-+ * Although the button should be disabled whenever the backEnabled() returns false,
-+ * the UI is sometimes not as responsive as we would like it to be :)
-+ * this check prevents segmentation faults and in this way the class is not relying on the UI
-+ */
-+ if (backEnabled()) {
-+ SwWrtShell& rSh = *_pMyShell;
-+ /* Trying to get the current cursor */
-+ SwPaM* pPaM = rSh.GetCrsr();
-+ if (!pPaM) {
-+#if DEBUG
-+ fprintf (stderr, "No PaM, returning...\n");
-+#endif
-+ return;
-+ }
-+
-+#if DEBUG
-+ fprintf(stderr, "Going back...\n");
-+ fprintf(stderr, "Current position = %d\n", _nCurrent);
-+#endif
-+ /* This flag will be used to manually refresh the buttons */
-+ bool bForwardWasDisabled = !forwardEnabled();
-+ /*
-+ * If we're going backwards in our history, but the current location is not
-+ * in the history then we need to add *here* to it so that we can "go
-+ * forward" to here again.
-+ */
-+
-+ if (bForwardWasDisabled) {
-+ /*
-+ * the cursor consists of two SwPositions: Point and Mark.
-+ * We are adding the current Point to the navigation history
-+ * so we could later navigate forward to it
-+ */
-+#if DEBUG
-+ fprintf(stderr, "No forward. Attempting to add the current position...\n");
-+#endif
-+ /* The addEntry() method returns true iff we should decrement the index before navigating back */
-+ if (addEntry(*pPaM->GetPoint()) ) {
-+ _nCurrent--;
-+#if DEBUG
-+ fprintf(stderr, "New position added to the navigation history.\n");
-+#endif
-+ }
-+ }
-+ _nCurrent--;
-+#if DEBUG
-+ fprintf(stderr, "Going back to position with index %d...\n", _nCurrent);
-+#endif
-+ /* Position cursor to appropriate navigation history entry */
-+ GotoSwPosition(_entries[_nCurrent]);
-+#if DEBUG
-+ fprintf(stderr, "Jumped to position of index %d\n", _nCurrent);
-+#endif
-+ /* Refresh the buttons */
-+ if (bForwardWasDisabled)
-+ _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_FORWARD);
-+ if (!backEnabled())
-+ _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_BACK);
-+ }
-+}
-+/*
-+ * The goForward() method positions the cursor to the next entry in the navigation history
-+ */
-+
-+void SwNavigationMgr::goForward() {
-+ /*
-+ * Although the button should be disabled whenever the backForward() returns false,
-+ * the UI is sometimes not as responsive as we would like it to be :)
-+ * this check prevents segmentation faults and in this way the class is not relying on the UI
-+ */
-+
-+ if (forwardEnabled()) {
-+#if DEBUG
-+ fprintf(stderr, "Going forward to position with index %d...\n", _nCurrent);
-+#endif
-+ /* This flag will be used to manually refresh the buttons */
-+ bool bBackWasDisabled = !backEnabled();
-+ /*
-+ * The current index is positioned at the current entry in the navigation history
-+ * We have to increment it to go to the next entry
-+ */
-+ _nCurrent++;
-+ GotoSwPosition(_entries[_nCurrent]);
-+#if DEBUG
-+ fprintf(stderr, "Jumped to position of index %d\n", _nCurrent);
-+#endif
-+ /* Refresh the buttons */
-+ if (bBackWasDisabled)
-+ _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_BACK);
-+ if (!forwardEnabled())
-+ _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_FORWARD);
-+ }
-+}
-+/*
-+ * This method adds the SwPosition rPos to the navigation history
-+ * rPos is usually the current position of the cursor in the document
-+ */
-+bool SwNavigationMgr::addEntry(const SwPosition& rPos) {
-+#if DEBUG_ADDING
-+ fprintf(stderr, "------------------\n");
-+ fprintf(stderr, "Index of the entry: %d\n", rPos.nNode.GetIndex());
-+ fprintf(stderr, "Before addEntry: ");
-+ fprintf(stderr, "Entries.size() : %d\n", _entries.size());
-+ fprintf(stderr, "Current index is %d\n", _nCurrent);
-+#endif
-+ /* Flags that will be used for refreshing the buttons */
-+ bool bBackWasDisabled = !backEnabled();
-+ bool bForwardWasEnabled = forwardEnabled();
-+
-+ bool bRet = false; // return value of the function.
-+ // Indicates weather the index should be decremented before jumping back or not
-+#if SMART
-+ /* If any forward history exists, twist the tail of the list from the current position to the end */
-+ if (bForwardWasEnabled) {
-+
-+ size_t number_of_entries = _entries.size(); /* To avoid calling _entries.size() multiple times */
-+ int curr = _nCurrent; /* Index from which we'll twist the tail. */
-+ int n = (number_of_entries - curr) / 2; /* Number of entries that will swap places */
-+#if DEBUG_ADDING
-+ fprintf(stderr, "Twisting tail from position no %d...\n", _nCurrent);
-+#endif
-+ for (int i = 0; i < n; i++) {
-+#if DEBUG_ADDING
-+ fprintf(stderr, "swaping %d and %d\n",
-+ curr+i, number_of_entries - 1 - i);
-+#endif
-+ SwPosition temp = _entries[curr + i];
-+ _entries[curr + i] = _entries[number_of_entries -1 - i];
-+ _entries[number_of_entries -1 - i] = temp;
-+ }
-+
-+ if (_entries.back() != rPos)
-+ _entries.push_back(rPos);
-+
-+
-+ bRet = true;
-+ }
-+ else {
-+ if ( (_entries.size() > 0 && _entries.back() != rPos) || (_entries.size() == 0) ) {
-+ _entries.push_back(rPos);
-+ bRet = true;
-+ }
-+ if (_entries.size() > 1 && _entries.back() == rPos)
-+ bRet = true;
-+ if (_entries.size() == 1 && _entries.back() == rPos)
-+ bRet = false;
-+ }
-+#else
-+ _entries.erase(_entries.begin() + _nCurrent, _entries.end());
-+ _entries.push_back(rPos);
-+ bRet = true;
-+#endif
-+ _nCurrent = _entries.size();
-+
-+#if DEBUG_ADDING
-+ fprintf(stderr, "After addEntry(), _entries.size() is %d\n", _entries.size());
-+ fprintf(stderr, "nCurrent = %d\n", _nCurrent);
-+ fprintf(stderr, "------------------\n");
-+#endif
-+
-+ /* Refresh buttons */
-+ if (bBackWasDisabled)
-+ _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_BACK);
-+ if (bForwardWasEnabled)
-+ _pMyShell->GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_FORWARD);
-+#if DEBUG_ADDING
-+ if (bRet)
-+ fprintf(stderr, "New entry added\n");
-+#endif
-+ return bRet;
-+}
-diff --git sw/source/ui/wrtsh/wrtsh1.cxx sw/source/ui/wrtsh/wrtsh1.cxx
-index 9f0b753..465f178 100644
---- sw/source/ui/wrtsh/wrtsh1.cxx
-+++ sw/source/ui/wrtsh/wrtsh1.cxx
-@@ -136,6 +136,7 @@ using namespace com::sun::star;
- ePageMove(MV_NO),\
- pCrsrStack(0), \
- rView(rShell),\
-+ aNavigationMgr(this), \
- bDestOnStack(FALSE), \
- fnLeaveSelect(&SwWrtShell::SttLeaveSelect)
-
-@@ -1011,7 +1012,7 @@ void SwWrtShell::InsertFootnote(const String &rStr, BOOL bEndNote, BOOL bEdit )
- SwapPam();
- ClearMark();
- }
--
-+ SwPosition aPos = *GetCrsr()->GetPoint();
- SwFmtFtn aFootNote( bEndNote );
- if(rStr.Len())
- aFootNote.SetNumStr( rStr );
-@@ -1024,6 +1025,7 @@ void SwWrtShell::InsertFootnote(const String &rStr, BOOL bEndNote, BOOL bEdit )
- Left(CRSR_SKIP_CHARS, FALSE, 1, FALSE );
- GotoFtnTxt();
- }
-+ aNavigationMgr.addEntry(aPos);
- }
- }
- /*------------------------------------------------------------------------
-@@ -1628,7 +1632,14 @@ SwFrmFmt *SwWrtShell::GetTblStyle(const String &rFmtName)
- return 0;
- }
-
-+SwNavigationMgr& SwWrtShell::GetNavigationMgr() {
-+ return aNavigationMgr;
-+}
-
-+void SwWrtShell::addCurrentPosition() {
-+ SwPaM* pPaM = GetCrsr();
-+ aNavigationMgr.addEntry(*pPaM->GetPoint());
-+}
- /*------------------------------------------------------------------------
- Beschreibung: Anwenden der Vorlagen
- ------------------------------------------------------------------------*/
-diff --git sw/source/ui/wrtsh/wrtsh3.cxx sw/source/ui/wrtsh/wrtsh3.cxx
-index 2f277f6..873c6dd 100644
---- sw/source/ui/wrtsh/wrtsh3.cxx
-+++ sw/source/ui/wrtsh/wrtsh3.cxx
-@@ -61,6 +61,7 @@ BOOL SwWrtShell::MoveBookMark( BookMarkMove eFuncId, const ::sw::mark::IMark* co
- {
- //JP 08.03.96: die Wizards brauchen die Selektion !!
- // EndSelect();
-+ addCurrentPosition();
- (this->*fnKillSel)( 0, sal_False );
-
- BOOL bRet = sal_True;
-diff --git sw/uiconfig/swriter/toolbar/navigationobjectbar.xml sw/uiconfig/swriter/toolbar/navigationobjectbar.xml
-new file mode 100644
-index 0000000..6cea7c3
---- /dev/null
-+++ sw/uiconfig/swriter/toolbar/navigationobjectbar.xml
-@@ -0,0 +1,6 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
-+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
-+ <toolbar:toolbaritem xlink:href=".uno:NavigateBack" toolbar:helpid="helpid:22314"/>
-+ <toolbar:toolbaritem xlink:href=".uno:NavigateForward" toolbar:helpid="helpid:22315"/>
-+</toolbar:toolbar>
-diff --git sfx2/source/appl/workwin.cxx sfx2/source/appl/workwin.cxx
-index fc45667..d6a89d1 100644
---- sfx2/source/appl/workwin.cxx
-+++ sfx2/source/appl/workwin.cxx
-@@ -139,6 +139,7 @@ static const ResIdToResName pToolBarResToName[] =
- { 23031, "mediaobjectbar" }, //draw/impress
- { 25060, "mediaobjectbar" }, //calc
- { 23311, "mediaobjectbar" }, //writer
-+ { 23313, "navigationobjectbar" }, //writer
- { 0, "" }
- };
-
diff --git a/src/icons/lc_navigateback.png b/src/icons/lc_navigateback.png
deleted file mode 100644
index 17ac643..0000000
Binary files a/src/icons/lc_navigateback.png and /dev/null differ
diff --git a/src/icons/lc_navigateforward.png b/src/icons/lc_navigateforward.png
deleted file mode 100644
index 429ce34..0000000
Binary files a/src/icons/lc_navigateforward.png and /dev/null differ
diff --git a/src/icons/lch_navigateback.png b/src/icons/lch_navigateback.png
deleted file mode 100644
index 20913a1..0000000
Binary files a/src/icons/lch_navigateback.png and /dev/null differ
diff --git a/src/icons/lch_navigateforward.png b/src/icons/lch_navigateforward.png
deleted file mode 100644
index 37c11e4..0000000
Binary files a/src/icons/lch_navigateforward.png and /dev/null differ
diff --git a/src/icons/sch_navigateback.png b/src/icons/sch_navigateback.png
deleted file mode 100644
index be9eb86..0000000
Binary files a/src/icons/sch_navigateback.png and /dev/null differ
diff --git a/src/icons/sch_navigateforward.png b/src/icons/sch_navigateforward.png
deleted file mode 100644
index 14266bf..0000000
Binary files a/src/icons/sch_navigateforward.png and /dev/null differ
More information about the Libreoffice-commits
mailing list