[ooo-build-commit] .: 37 commits - configmgr/source connectivity/source desktop/source drawinglayer/source editeng/inc editeng/source sfx2/inc sfx2/source svx/source xmlhelp/prj xmlhelp/util xmloff/inc xmloff/source

Jan Holesovsky kendy at kemper.freedesktop.org
Wed Oct 6 07:10:08 PDT 2010


 configmgr/source/components.cxx                            |   45 
 configmgr/source/components.hxx                            |    5 
 connectivity/source/commontools/formattedcolumnvalue.cxx   |   13 
 connectivity/source/drivers/odbcbase/OTools.cxx            |    2 
 desktop/source/deployment/gui/dp_gui_dialog2.cxx           |   32 
 desktop/source/deployment/misc/dp_update.cxx               |   84 -
 desktop/source/deployment/registry/help/dp_help.cxx        |  404 +++--
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx |    7 
 editeng/inc/editeng/unoipset.hxx                           |    1 
 editeng/source/uno/unoipset.cxx                            |   21 
 sfx2/inc/sfx2/docfac.hxx                                   |    2 
 sfx2/inc/sfx2/viewfrm.hxx                                  |    1 
 sfx2/inc/sfx2/viewsh.hxx                                   |    4 
 sfx2/inc/viewfac.hxx                                       |   17 
 sfx2/source/dialog/taskpane.cxx                            |    3 
 sfx2/source/doc/docfac.cxx                                 |   19 
 sfx2/source/doc/sfxbasemodel.cxx                           |    4 
 sfx2/source/view/frmload.cxx                               |    2 
 sfx2/source/view/sfxbasecontroller.cxx                     |   51 
 sfx2/source/view/viewfac.cxx                               |   19 
 sfx2/source/view/viewfrm.cxx                               |   73 
 svx/source/dialog/checklbx.cxx                             |    9 
 svx/source/items/svxitems.src                              |    2 
 svx/source/unodraw/unoshape.cxx                            |    1 
 xmlhelp/prj/d.lst                                          |    3 
 xmlhelp/util/embed.xsl                                     |   83 +
 xmlhelp/util/idxcaption.xsl                                |   34 
 xmlhelp/util/idxcontent.xsl                                |  104 +
 xmlhelp/util/main_transform.xsl                            |  972 +++++++++++++
 xmlhelp/util/makefile.mk                                   |    6 
 xmloff/inc/xmloff/xmltoken.hxx                             |    3 
 xmloff/source/chart/PropertyMap.hxx                        |    2 
 xmloff/source/chart/SchXMLExport.cxx                       |   42 
 xmloff/source/chart/SchXMLTableContext.cxx                 |   70 
 xmloff/source/chart/SchXMLTools.cxx                        |   23 
 xmloff/source/chart/SchXMLTools.hxx                        |    2 
 xmloff/source/core/xmltoken.cxx                            |    7 
 37 files changed, 1883 insertions(+), 289 deletions(-)

New commits:
commit 020edad3cc21b5c604c3c21e0ab70269ee418b9e
Merge: 1d2139a... 2cb0e28...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Wed Oct 6 16:04:22 2010 +0200

    Merge branch 'master' of ssh://git.freedesktop.org/git/libreoffice/libs-core

commit 1d2139a8d204a9665042ab0ea8eb76028577d4f9
Merge: a5555aa... 4ad5d2f...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Wed Oct 6 13:36:08 2010 +0200

    Merge commit 'ooo/OOO330_m9'

commit 4ad5d2ff2763a17d0ab7eebe735add9dcf12aa46
Merge: 0826f67... 3d4502d...
Author: Kurt Zenker <kz at openoffice.org>
Date:   Fri Sep 24 15:29:31 2010 +0200

    CWS-TOOLING: integrate CWS fwk158

commit 0826f6744d05e0966704b17cdb4ad6b344251f71
Merge: 1c6775c... be66284...
Author: Kurt Zenker <kz at openoffice.org>
Date:   Fri Sep 24 15:12:04 2010 +0200

    CWS-TOOLING: integrate CWS ooo330l10n3

commit 1c6775cd256e7246d1f4d44fb8fc37dfd5286eac
Merge: d9a1bd0... 8d56452...
Author: Kurt Zenker <kz at openoffice.org>
Date:   Fri Sep 24 14:18:50 2010 +0200

    CWS-TOOLING: integrate CWS dv21

diff --cc desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 9f5d400,5f1b359..5f1b359
mode 100644,100755..100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
commit 3d4502d95a77e80087bc0711e637abd8a791f9e1
Author: sb <sb at openoffice.org>
Date:   Thu Sep 16 14:23:50 2010 +0200

    fwk158: #i114541# generally ignore erroneous xcs/xcu files during startup (typically from extensions installed pre 3.3)

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 33b0eca..cc5ea1e 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -334,12 +334,14 @@ void Components::insertModificationXcuFile(
     Modifications * modifications)
 {
     OSL_ASSERT(modifications != 0);
+    Partial part(includedPaths, excludedPaths);
     try {
-        Partial part(includedPaths, excludedPaths);
-        parseXcuFile(fileUri, Data::NO_LAYER, data_, &part, modifications, 0);
-    } catch (css::uno::Exception & e) { //TODO: more specific exception catching
+        parseFileLeniently(
+            &parseXcuFile, fileUri, Data::NO_LAYER, data_, &part, modifications,
+            0);
+    } catch (css::container::NoSuchElementException & e) {
         OSL_TRACE(
-            "configmgr error inserting %s: %s",
+            "configmgr error inserting non-existing %s: %s",
             rtl::OUStringToOString(fileUri, RTL_TEXTENCODING_UTF8).getStr(),
             rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
     }
@@ -492,20 +494,32 @@ Components::Components(
                     "com.sun.star.comp.deployment.configuration."
                     "PackageRegistryBackend/configmgr.ini"))),
         true);
+    parseModificationLayer();
+    RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "end parsing");
+}
+
+Components::~Components() {}
+
+void Components::parseFileLeniently(
+    FileParser * parseFile, rtl::OUString const & url, int layer, Data & data,
+    Partial const * partial, Modifications * modifications,
+    Additions * additions)
+{
+    OSL_ASSERT(parseFile != 0);
     try {
-        parseModificationLayer();
+        (*parseFile)(url, layer, data, partial, modifications, additions);
+    } catch (css::container::NoSuchElementException &) {
+        throw;
     } catch (css::uno::Exception & e) { //TODO: more specific exception catching
-        // Silently ignore unreadable parts of a corrupted user modification
-        // layer, instead of completely preventing OOo from starting:
+        // Silently ignore invalid XML files, instead of completely preventing
+        // OOo from starting:
         OSL_TRACE(
-            "configmgr error reading user modification layer: %s",
+            "configmgr error reading %s: %s",
+            rtl::OUStringToOString(url, RTL_TEXTENCODING_UTF8).getStr(),
             rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
     }
-    RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "end parsing");
 }
 
-Components::~Components() {}
-
 void Components::parseFiles(
     int layer, rtl::OUString const & extension, FileParser * parseFile,
     rtl::OUString const & url, bool recursive)
@@ -557,7 +571,8 @@ void Components::parseFiles(
                 file.match(extension, file.getLength() - extension.getLength()))
             {
                 try {
-                    (*parseFile)(stat.getFileURL(), layer, data_, 0, 0, 0);
+                    parseFileLeniently(
+                        parseFile, stat.getFileURL(), layer, data_, 0, 0, 0);
                 } catch (css::container::NoSuchElementException & e) {
                     throw css::uno::RuntimeException(
                         (rtl::OUString(
@@ -584,7 +599,7 @@ void Components::parseFileList(
                 adds = data_.addExtensionXcuAdditions(url, layer);
             }
             try {
-                (*parseFile)(url, layer, data_, 0, 0, adds);
+                parseFileLeniently(parseFile, url, layer, data_, 0, 0, adds);
             } catch (css::container::NoSuchElementException & e) {
                 OSL_TRACE(
                     "configmgr file does not exist: %s",
@@ -746,7 +761,9 @@ rtl::OUString Components::getModificationFileUrl() const {
 
 void Components::parseModificationLayer() {
     try {
-        parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, data_, 0, 0, 0);
+        parseFileLeniently(
+            &parseXcuFile, getModificationFileUrl(), Data::NO_LAYER, data_, 0,
+            0, 0);
     } catch (css::container::NoSuchElementException &) {
         OSL_TRACE(
             "configmgr user registrymodifications.xcu does not (yet) exist");
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index 880ac95..4fc47f7 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -123,6 +123,11 @@ private:
 
     ~Components();
 
+    void parseFileLeniently(
+        FileParser * parseFile, rtl::OUString const & url, int layer,
+        Data & data, Partial const * partial, Modifications * modifications,
+        Additions * additions);
+
     void parseFiles(
         int layer, rtl::OUString const & extension, FileParser * parseFile,
         rtl::OUString const & url, bool recursive);
commit d9a1bd0e7171a4eb07b89e9e3c0ebc6cbcc0a795
Merge: 676446d... b76c07a...
Author: obo <obo at openoffice.org>
Date:   Tue Sep 14 13:03:44 2010 +0200

    CWS-TOOLING: integrate CWS jl158

commit 676446d17e9f43d237db66112692ecd7ec03139a
Merge: 48d38c3... cee4cda...
Author: obo <obo at openoffice.org>
Date:   Tue Sep 14 12:55:12 2010 +0200

    CWS-TOOLING: integrate CWS ooo33gsl08

commit 48d38c30f11aab1390cfaba67717124c6e46e7f2
Merge: 1087bc5... 5dbf2ba...
Author: obo <obo at openoffice.org>
Date:   Tue Sep 14 09:30:41 2010 +0200

    CWS-TOOLING: integrate CWS chart50

commit 1087bc5e5922e016bb6f21c466d4eb87d8d5ff43
Merge: d08f8a0... 43ee56e...
Author: obo <obo at openoffice.org>
Date:   Tue Sep 14 09:05:18 2010 +0200

    CWS-TOOLING: integrate CWS dba33i

commit d08f8a04741926c98cf24fe73dfc0677cc19ba05
Merge: 7373841... 152a5a2...
Author: obo <obo at openoffice.org>
Date:   Tue Sep 14 08:56:44 2010 +0200

    CWS-TOOLING: integrate CWS dba33h

commit 7373841ba6fe0b0ce5e1aedd170325475f01ef41
Merge: b47d587... 358aeb0...
Author: obo <obo at openoffice.org>
Date:   Tue Sep 14 07:53:51 2010 +0200

    CWS-TOOLING: integrate CWS impress200

commit be66284306a7e6bcb31d15e21fb3835ca8d21cb7
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date:   Fri Sep 10 17:49:25 2010 +0200

    ooo330l10n3: #i113535# enable itemlist

diff --git a/svx/source/items/svxitems.src b/svx/source/items/svxitems.src
index d70e69e..77ef840 100644
--- a/svx/source/items/svxitems.src
+++ b/svx/source/items/svxitems.src
@@ -32,7 +32,7 @@
 
 StringArray RID_ATTR_NAMES
 {
-    ItemList =
+    ItemList [ en-US ] =
     {
         < "Scale"			;           SID_ATTR_ZOOM ; > ;
         < "Brush"			;           SID_ATTR_BRUSH ; > ;
commit cee4cdae3a3f0becd1c60b958bc503886b8ac189
Author: Armin Le Grand <armin.le.grand at oracle.com>
Date:   Tue Sep 7 17:50:32 2010 +0200

    #i113922# added code to transform the LineWidth on MetaFile creation with the current transformation

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 01cfe2f..27e9c40 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1206,7 +1206,12 @@ namespace drawinglayer
                             mpOutputDevice->SetLineColor(Color(aHairlineColor));
                             mpOutputDevice->SetFillColor();
                             aHairLinePolyPolygon.transform(maCurrentTransformation);
-                            LineInfo aLineInfo(LINE_SOLID, basegfx::fround(rLine.getWidth()));
+                            
+                            // #i113922# LineWidth needs to be transformed, too
+                            const basegfx::B2DVector aDiscreteUnit(maCurrentTransformation * basegfx::B2DVector(rLine.getWidth(), 0.0));
+                            const double fDiscreteLineWidth(aDiscreteUnit.getLength());
+
+                            LineInfo aLineInfo(LINE_SOLID, basegfx::fround(fDiscreteLineWidth));
                             aLineInfo.SetLineJoin(rLine.getLineJoin());
 
                             for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++)
commit 43ee56e3fddde85de3b68b9eaa27ece174296a4b
Author: Frank Schoenheit [fs] <frank.schoenheit at oracle.com>
Date:   Thu Sep 2 12:25:31 2010 +0200

    dba33i: fix GCC warning

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index d74ab25..8855aae 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2285,8 +2285,8 @@ void SfxViewFrame::SaveCurrentViewData_Impl( const USHORT i_nNewViewId )
         const sal_Int32 nCount = xViewData->getCount();
         for ( sal_Int32 i=0; i<nCount; ++i )
         {
-            const ::comphelper::NamedValueCollection aViewData( xViewData->getByIndex(i) );
-            ::rtl::OUString sViewId( aViewData.getOrDefault( "ViewId", ::rtl::OUString() ) );
+            const ::comphelper::NamedValueCollection aCurViewData( xViewData->getByIndex(i) );
+            ::rtl::OUString sViewId( aCurViewData.getOrDefault( "ViewId", ::rtl::OUString() ) );
             if ( sViewId.getLength() == 0 )
                 continue;
 
commit 31a09194214fdaa8e98525c13e3802e154c0d82c
Author: Frank Schoenheit [fs] <frank.schoenheit at oracle.com>
Date:   Thu Sep 2 12:25:23 2010 +0200

    dba33i: #i113684# proper termination condition when reading large strings

diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx
index f84f8e7..5090042 100644
--- a/connectivity/source/drivers/odbcbase/OTools.cxx
+++ b/connectivity/source/drivers/odbcbase/OTools.cxx
@@ -578,7 +578,7 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
             // StarView zu lang ist oder der Treiber kann die Laenge der
             // Daten nicht im voraus bestimmen - also als MemoryStream
             // speichern.
-            while ((pcbValue == SQL_NO_TOTAL ) || pcbValue > nMaxLen)
+            while ((pcbValue == SQL_NO_TOTAL ) || nLen > nMaxLen)
             {
                 // Bei Strings wird der Puffer nie ganz ausgenutzt
                 // (das letzte Byte ist immer ein NULL-Byte, das
commit ca707070e754a6fafba5ae75f36db4f7430efe1b
Author: Frank Schoenheit [fs] <frank.schoenheit at sun.com>
Date:   Wed Sep 1 21:56:16 2010 +0200

    dba33i: #i112694# care for mouse handlers which tamper with the tree: survive this

diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx
index 06730c4..2e070ca 100644
--- a/svx/source/dialog/checklbx.cxx
+++ b/svx/source/dialog/checklbx.cxx
@@ -212,7 +212,7 @@ void SvxCheckListBox::MouseButtonDown( const MouseEvent& rMEvt )
 {
     if ( rMEvt.IsLeft() )
     {
-        Point aPnt = rMEvt.GetPosPixel();
+        const Point aPnt = rMEvt.GetPosPixel();
         SvLBoxEntry* pEntry = GetEntry( aPnt );
 
         if ( pEntry )
@@ -230,6 +230,13 @@ void SvxCheckListBox::MouseButtonDown( const MouseEvent& rMEvt )
             {
                 ToggleCheckButton( pEntry );
                 SvTreeListBox::MouseButtonDown( rMEvt );
+
+                // check if the entry below the mouse changed during the base method call. This is possible if,
+                // for instance, a handler invoked by the base class tampers with the list entries.
+                const SvLBoxEntry* pNewEntry = GetEntry( aPnt );
+                if ( pNewEntry != pEntry )
+                    return;
+
                 if ( bCheck != ( GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED ) )
                     CheckButtonHdl();
                 return;
commit b76c07ad93ea7c7e45fb12313bb3455b43643a59
Author: Hans-Joachim Lankenau <hjs at openoffice.org>
Date:   Wed Sep 1 17:41:13 2010 +0200

    jl158: #i114008# deliver moved .zip

diff --git a/xmlhelp/prj/d.lst b/xmlhelp/prj/d.lst
index ec45189..67fe323 100644
--- a/xmlhelp/prj/d.lst
+++ b/xmlhelp/prj/d.lst
@@ -6,3 +6,5 @@
 ..\util\ucpchelp.xml %_DEST%\xml%_EXT%\ucpchelp.xml
 ..\util\*.xsl %_DEST%\bin%_EXT%\*.*
 ..\%__SRC%\lib\ihelplinker.lib %_DEST%\lib%_EXT%\ihelplinker.lib
+..\%__SRC%\bin\helpxsl.zip %_DEST%\pck%_EXT%\helpxsl.zip
+
commit f4685eddef16b3d78e511e2ed4567a7e0b1a1934
Author: Hans-Joachim Lankenau <hjs at openoffice.org>
Date:   Wed Sep 1 17:15:05 2010 +0200

    jl158: #i114008# move transformation files

diff --git a/xmlhelp/util/embed.xsl b/xmlhelp/util/embed.xsl
new file mode 100644
index 0000000..3a4e3ef
--- /dev/null
+++ b/xmlhelp/util/embed.xsl
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output indent="yes" method="xml"/>
+
+<!-- SPECIFY YOUR FILE SYSTEM ROOT PATH TO THE HELP FILES -->
+<xsl:param name="fsroot" select="'file:///handbuch/WORKBENCH/helpcontent2/source/'"/>
+
+<!--
+######################################################
+All others
+######################################################
+-->
+<xsl:template match="/">
+	<xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="*|@*|comment()|processing-instruction()|text()">
+  <xsl:copy>
+    <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="*|@*|comment()|processing-instruction()|text()" mode="embedded">
+  <xsl:copy>
+    <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()" mode="embedded"/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="bookmark" mode="embedded" />
+<xsl:template match="ahelp" mode="embedded">
+	<xsl:apply-templates mode="embedded"/>
+</xsl:template>
+
+<xsl:template match="paragraph[@role='heading']">
+    <title>
+        <xsl:apply-templates/>
+    </title>
+</xsl:template>
+
+<xsl:template match="paragraph[@role=*]">
+    <paragraph>
+        <xsl:apply-templates/>
+    </paragraph>
+</xsl:template>
+
+<xsl:template match="sort">
+    <xsl:apply-templates/>
+</xsl:template>
+
+
+<!-- 
+###################################################### 
+EMBED
+###################################################### 
+-->
+<xsl:template match="embed">
+
+		<xsl:variable name="href"><xsl:value-of select="substring-before(concat($fsroot, at href),'#')"/></xsl:variable>
+		<xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
+		<xsl:variable name="doc" select="document($href)"/>
+		<xsl:apply-templates select="$doc//section[@id=$anchor]" mode="embedded"/>
+		<xsl:if test="not($doc//section[@id=$anchor])"> <!-- fallback for embeds that actually should be embedvars -->
+			<paragraph role="paragraph"><xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/></paragraph>
+		</xsl:if>
+</xsl:template>
+
+<!-- 
+###################################################### 
+EMBEDVAR
+###################################################### 
+-->
+<xsl:template match="embedvar">
+	<xsl:if test="not(@href='text/shared/00/00000004.xhp#wie')"> <!-- special treatment if howtoget links -->
+		<xsl:variable name="href"><xsl:value-of select="substring-before(concat($fsroot, at href),'#')"/></xsl:variable>
+		<xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
+		<xsl:variable name="doc" select="document($href)"/>
+		<xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
+	</xsl:if>
+	
+	<!-- FPE: embedvars, that point to "text/shared/00/00000004.xml#wie" will only be resolved in the main_transform -->
+	
+</xsl:template>
+</xsl:stylesheet>
diff --git a/xmlhelp/util/idxcaption.xsl b/xmlhelp/util/idxcaption.xsl
new file mode 100644
index 0000000..7570fa5
--- /dev/null
+++ b/xmlhelp/util/idxcaption.xsl
@@ -0,0 +1,34 @@
+<xsl:stylesheet version="1.0" encoding="UTF-8"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:office="http://openoffice.org/2000/office"
+	xmlns:style="http://openoffice.org/2000/style"
+	xmlns:table="http://openoffice.org/2000/table"
+	xmlns:draw="http://openoffice.org/2000/drawing"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:meta="http://openoffice.org/2000/meta"
+	xmlns:number="http://openoffice.org/2000/datastyle"
+	xmlns:svg="http://www.w3.org/2000/svg"
+	xmlns:chart="http://openoffice.org/2000/chart"
+	xmlns:help="http://openoffice.org/2000/help"
+	xmlns:index="http://sun.com/2000/XMLSearch"	
+	xmlns:text="http://openoffice.org/2000/text">
+
+<xsl:param name="Language" select="'en-US'"/>
+<xsl:output method="text" encoding="UTF-8"/>
+
+<xsl:template match="/">
+	<xsl:apply-templates select="//title" mode="include"/>
+	<xsl:apply-templates select="//paragraph[@role='heading']" mode="include"/>
+</xsl:template>
+
+<xsl:template match="*" mode="include">
+	<xsl:value-of select="."/>
+	<xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="*"/>
+
+</xsl:stylesheet>
+
diff --git a/xmlhelp/util/idxcontent.xsl b/xmlhelp/util/idxcontent.xsl
new file mode 100644
index 0000000..aa371d7
--- /dev/null
+++ b/xmlhelp/util/idxcontent.xsl
@@ -0,0 +1,104 @@
+<xsl:stylesheet version="1.0" encoding="UTF-8"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:office="http://openoffice.org/2000/office"
+	xmlns:style="http://openoffice.org/2000/style"
+	xmlns:table="http://openoffice.org/2000/table"
+	xmlns:draw="http://openoffice.org/2000/drawing"
+	xmlns:fo="http://www.w3.org/1999/XSL/Format"
+	xmlns:xlink="http://www.w3.org/1999/xlink"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+	xmlns:meta="http://openoffice.org/2000/meta"
+	xmlns:number="http://openoffice.org/2000/datastyle"
+	xmlns:svg="http://www.w3.org/2000/svg"
+	xmlns:chart="http://openoffice.org/2000/chart"
+	xmlns:help="http://openoffice.org/2000/help"
+	xmlns:index="http://sun.com/2000/XMLSearch"	
+	xmlns:text="http://openoffice.org/2000/text">
+
+<xsl:param name="Language" select="'en-US'"/>
+<xsl:output method="text" encoding="UTF-8"/>
+
+<xsl:template match="helpdocument|body">
+  <xsl:choose>
+    <xsl:when test="meta/topic[@indexer='exclude']"/>
+    <xsl:otherwise>
+      <xsl:apply-templates/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="title">
+  <xsl:value-of select="."/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="table">
+  <xsl:apply-templates/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="tablecell">
+  <xsl:apply-templates/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="tablerow">
+  <xsl:apply-templates/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="list">
+  <xsl:apply-templates/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="listitem">
+  <xsl:apply-templates/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="item">
+  <xsl:apply-templates/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="emph">
+  <xsl:apply-templates/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="paragraph">
+  <xsl:value-of select="."/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="section">
+  <xsl:apply-templates/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="bookmark">
+  <xsl:apply-templates/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="bookmark_value">
+  <xsl:apply-templates/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="link">
+  <xsl:apply-templates/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="ahelp[@visibility='visible']">
+  <xsl:value-of select="."/>
+  <xsl:text>&#xA;</xsl:text>
+</xsl:template>
+
+<xsl:template match="*"/>
+
+</xsl:stylesheet>
+
+
diff --git a/xmlhelp/util/main_transform.xsl b/xmlhelp/util/main_transform.xsl
new file mode 100644
index 0000000..d9b6c32
--- /dev/null
+++ b/xmlhelp/util/main_transform.xsl
@@ -0,0 +1,972 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<!--***********************************************************************
+  This is the main transformation style sheet for transforming.
+  Only use with OOo 2.0
+  Owner: fpe at openoffice.org
+  =========================================================================
+  Changes Log
+    May 24 2004 Created
+    Aug 24 2004 Fixed for help2 CWS
+    Aug 27 2004 Added css link, fixed missing embed-mode for variable
+                Removed width/height for images
+    Sep 03 2004 Modularized xsl, added some embedded modes
+    Oct 08 2004 Fixed bug wrong mode "embedded" for links
+                Added embedded modes for embed and embedvar (for cascaded embeds)
+                Added <p> tags around falsely embedded pars and vars
+    Dec 08 2004 #i38483#, fixed wrong handling of web links
+                #i37377#, fixed missing usage of Database parameter for switching
+    Jan 04 2005 #i38905#, fixed buggy branding replacement template
+    Mar 17 2005 #i43972#, added language info to image URL, evaluate Language parameter
+                evaluate new localize attribute in images
+    May 10 2005 #i48785#, fixed wrong setting of distrib variable
+    Aug 16 2005 workaround for #i53365#
+    Aug 19 2005 fixed missing list processing in embedded sections
+    Aug 19 2005 #i53535#, fixed wrong handling of Database parameter
+    Oct 17 2006 #i70462#, disabled sorting to avoid output of error messages to console
+    Jun 15 2009 #i101799#, fixed wrong handling of http URLs with anchors
+***********************************************************************//-->
+
+<!--
+
+  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  
+  Copyright 2000, 2010 Oracle and/or its affiliates.
+ 
+  OpenOffice.org - a multi-platform office productivity suite
+ 
+  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.
+
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output indent="yes" method="html"/>
+
+<!--
+############################
+# Variables and Parameters #
+############################
+//-->
+
+<!-- General Usage -->
+<xsl:variable name="am" select="'&amp;'"/>
+<xsl:variable name="sl" select="'/'"/>
+<xsl:variable name="qt" select="'&quot;'"/>
+
+<!-- generic Icon alt text -->
+<xsl:variable name="alttext" select="'text/shared/00/icon_alt.xhp'"/>
+
+<!-- For calculating pixel sizes -->
+<xsl:variable name="dpi" select="'96'"/>
+<xsl:variable name="dpcm" select="'38'"/>
+
+<!-- Product brand variables used in the help files -->
+<xsl:variable name="brand1" select="'$[officename]'"/>
+<xsl:variable name="brand2" select="'$[officeversion]'"/>
+<xsl:variable name="brand3" select="'%PRODUCTNAME'"/>
+<xsl:variable name="brand4" select="'%PRODUCTVERSION'"/>
+
+<!-- meta data variables from the help file -->
+<xsl:variable name="filename" select="/helpdocument/meta/topic/filename"/>
+<xsl:variable name="topic_id" select="/helpdocument/meta/topic/@id"/>
+<xsl:variable name="topic_status" select="/helpdocument/meta/topic/@status"/>
+<xsl:variable name="title" select="/helpdocument/meta/topic/title"/>
+<xsl:variable name="doclang" select="/helpdocument/meta/topic/title/@xml-lang"/>
+
+<!-- Module and the corresponding switching values-->
+<xsl:param name="Database" select="'swriter'"/>
+<xsl:variable name="module" select="$Database"/>
+<xsl:variable name="appl">
+	<xsl:choose>
+		<xsl:when test="$module = 'swriter'"><xsl:value-of select="'WRITER'"/></xsl:when>
+		<xsl:when test="$module = 'scalc'"><xsl:value-of select="'CALC'"/></xsl:when>
+		<xsl:when test="$module = 'sdraw'"><xsl:value-of select="'DRAW'"/></xsl:when>
+		<xsl:when test="$module = 'simpress'"><xsl:value-of select="'IMPRESS'"/></xsl:when>
+		<xsl:when test="$module = 'schart'"><xsl:value-of select="'CHART'"/></xsl:when>
+		<xsl:when test="$module = 'sbasic'"><xsl:value-of select="'BASIC'"/></xsl:when>
+		<xsl:when test="$module = 'smath'"><xsl:value-of select="'MATH'"/></xsl:when>
+	</xsl:choose>
+</xsl:variable>
+
+  <!-- the other parameters given by the help caller -->
+<xsl:param name="System" select="'WIN'"/>
+<xsl:param name="productname" select="'Office'"/>
+<xsl:param name="productversion" select="''"/>
+<xsl:variable name="pversion">
+	<xsl:value-of select="translate($productversion,' ','')"/>
+</xsl:variable>
+<!-- this is were the images are -->
+<xsl:param name="imgrepos" select="''"/>
+<xsl:param name="Id" />
+<!-- (lame) distinction between OS and Commercial -->
+<xsl:param name="distrib">
+	<xsl:choose>
+		<xsl:when test="starts-with($productname,'OpenOffice')">
+			<xsl:value-of select="'OpenSource'"/>
+		</xsl:when>
+		<xsl:otherwise>
+			<xsl:value-of select="'COMMERCIAL'"/>
+		</xsl:otherwise>
+	</xsl:choose>
+</xsl:param>
+<xsl:param name="Language" select="'en-US'"/>
+<xsl:variable name="lang" select="$Language"/>
+
+<xsl:param name="ExtensionId" select="''"/>
+<xsl:param name="ExtensionPath" select="''"/>
+
+
+  <!-- parts of help and image urls -->
+<xsl:variable name="help_url_prefix" select="'vnd.sun.star.help://'"/>
+<xsl:variable name="img_url_prefix" select="concat('vnd.sun.star.zip://',$imgrepos,'/')"/>
+<xsl:variable name="urlpost" select="concat('?Language=',$lang,$am,'System=',$System,$am,'UseDB=no')"/>
+<xsl:variable name="urlpre" select="$help_url_prefix" /> 
+<xsl:variable name="linkprefix" select="$urlpre"/>
+<xsl:variable name="linkpostfix" select="$urlpost"/>
+
+<xsl:variable name="css" select="'default.css'"/>
+
+<!-- images for notes, tips and warnings -->
+<xsl:variable name="note_img" select="concat($img_url_prefix,'res/helpimg/note.png')"/>
+<xsl:variable name="tip_img" select="concat($img_url_prefix,'res/helpimg/tip.png')"/>
+<xsl:variable name="warning_img" select="concat($img_url_prefix,'res/helpimg/warning.png')"/>
+
+<!--
+#############
+# Templates #
+#############
+//-->
+
+<!-- Create the document skeleton -->
+<xsl:template match="/">
+	<xsl:variable name="csslink" select="concat($urlpre,'/',$urlpost)"/>
+	<html>
+		<head>
+			<title><xsl:value-of select="$title"/></title>
+			<link href="{$csslink}" rel="Stylesheet" type="text/css" /> <!-- stylesheet link -->
+  		<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
+		</head>
+		<body lang="{$lang}">
+			<xsl:apply-templates select="/helpdocument/body"/>
+		</body>
+	</html>
+</xsl:template>
+
+<!-- AHELP -->
+<xsl:template match="ahelp">
+	<xsl:if test="not(@visibility='hidden')"><span class="avis"><xsl:apply-templates /></span></xsl:if>
+</xsl:template>
+
+<!-- ALT -->
+<xsl:template match="alt"/>
+
+<!-- BOOKMARK -->
+<xsl:template match="bookmark">
+	<a name="{@id}"></a>
+	<xsl:choose>
+		<xsl:when test="starts-with(@branch,'hid')" />
+		<xsl:otherwise><xsl:apply-templates /></xsl:otherwise>
+	</xsl:choose>
+</xsl:template>
+<xsl:template match="bookmark" mode="embedded" />
+
+<!-- BOOKMARK_VALUE -->
+<xsl:template match="bookmark_value" />
+
+<!-- BR -->
+<xsl:template match="br"><br /></xsl:template>
+
+<!-- CAPTION -->
+<xsl:template match="caption" />
+
+<!-- CASE -->
+<xsl:template match="case"><xsl:call-template name="insertcase" /></xsl:template>
+<xsl:template match="case" mode="embedded">
+	<xsl:call-template name="insertcase">
+		<xsl:with-param name="embedded" select="'yes'"/>
+	</xsl:call-template>
+</xsl:template>
+
+<!-- CASEINLINE -->
+<xsl:template match="caseinline"><xsl:call-template name="insertcase" /></xsl:template>
+<xsl:template match="caseinline" mode="embedded">
+	<xsl:call-template name="insertcase">
+		<xsl:with-param name="embedded" select="'yes'"/>
+	</xsl:call-template>
+</xsl:template>
+
+<!-- COMMENT -->
+<xsl:template match="comment" />
+<xsl:template match="comment" mode="embedded"/>
+
+<!-- CREATED -->
+<xsl:template match="created" />
+
+<!-- DEFAULT -->
+<xsl:template match="default"><xsl:call-template name="insertdefault" /></xsl:template>
+<xsl:template match="default" mode="embedded">
+	<xsl:call-template name="insertdefault">
+		<xsl:with-param name="embedded" select="'yes'"/>
+	</xsl:call-template>
+</xsl:template>
+
+<!-- DEFAULTINLINE -->
+<xsl:template match="defaultinline"><xsl:call-template name="insertdefault" /></xsl:template>
+<xsl:template match="defaultinline" mode="embedded">
+	<xsl:call-template name="insertdefault">
+		<xsl:with-param name="embedded" select="'yes'"/>
+	</xsl:call-template>
+</xsl:template>
+
+<!-- EMBED -->
+<xsl:template match="embed"><xsl:call-template name="resolveembed"/></xsl:template>
+<xsl:template match="embed" mode="embedded"><xsl:call-template name="resolveembed"/></xsl:template>
+
+<!-- EMBEDVAR -->
+<xsl:template match="embedvar"><xsl:call-template name="resolveembedvar"/></xsl:template>
+<xsl:template match="embedvar" mode="embedded"><xsl:call-template name="resolveembedvar"/></xsl:template>
+
+<!-- EMPH -->
+<xsl:template match="emph">
+	<span class="emph"><xsl:apply-templates /></span>
+</xsl:template>
+<xsl:template match="emph" mode="embedded">
+	<span class="emph"><xsl:apply-templates /></span>
+</xsl:template>
+
+<!-- FILENAME -->
+<xsl:template match="filename" />
+
+<!-- HISTORY -->
+<xsl:template match="history" />
+
+<!-- IMAGE -->
+<xsl:template match="image"><xsl:call-template name="insertimage"/></xsl:template>
+<xsl:template match="image" mode="embedded"><xsl:call-template name="insertimage"/></xsl:template>
+
+<!-- ITEM -->
+<xsl:template match="item"><span class="{@type}"><xsl:apply-templates /></span></xsl:template>
+<xsl:template match="item" mode="embedded"><span class="{@type}"><xsl:apply-templates /></span></xsl:template>
+
+<!-- LASTEDITED -->
+<xsl:template match="lastedited" />
+
+<!-- LINK -->
+<xsl:template match="link">
+	<xsl:choose> <!-- don't insert the heading link to itself -->
+		<xsl:when test="(concat('/', at href) = /helpdocument/meta/topic/filename) or (@href = /helpdocument/meta/topic/filename)">
+			<xsl:apply-templates />
+		</xsl:when>
+		<xsl:when test="contains(child::embedvar/@href,'/00/00000004.xhp#wie')"> <!-- special treatment of howtoget links -->
+			<xsl:call-template name="insert_howtoget">
+				<xsl:with-param name="linkhref" select="@href"/>
+			</xsl:call-template>
+		</xsl:when>
+		<xsl:otherwise>
+			<xsl:call-template name="createlink" /> 
+		</xsl:otherwise>
+	</xsl:choose>
+</xsl:template>
+<xsl:template match="link" mode="embedded">
+	<xsl:call-template name="createlink"/>
+</xsl:template>
+
+<!-- LIST -->
+<xsl:template match="list">
+	<xsl:choose>
+		<xsl:when test="@type='ordered'">
+			<ol>
+				<xsl:if test="@startwith">
+					<xsl:attribute name="start"><xsl:value-of select="@startwith"/></xsl:attribute>
+				</xsl:if>
+				<xsl:apply-templates />
+			</ol>
+		</xsl:when>
+		<xsl:otherwise>
+			<ul><xsl:apply-templates /></ul>
+		</xsl:otherwise>
+	</xsl:choose>
+</xsl:template>
+
+<xsl:template match="list" mode="embedded">
+	<xsl:choose>
+		<xsl:when test="@type='ordered'">
+			<ol>
+				<xsl:if test="@startwith">
+					<xsl:attribute name="start"><xsl:value-of select="@startwith"/></xsl:attribute>
+				</xsl:if>
+				<xsl:apply-templates mode="embedded"/>
+			</ol>
+		</xsl:when>
+		<xsl:otherwise>
+			<ul><xsl:apply-templates mode="embedded"/></ul>
+		</xsl:otherwise>
+	</xsl:choose>
+</xsl:template>
+
+<!-- LISTITEM -->
+<xsl:template match="listitem">
+	<li><xsl:apply-templates /></li>
+</xsl:template>
+
+<xsl:template match="listitem" mode="embedded">
+	<li><xsl:apply-templates mode="embedded"/></li>
+</xsl:template>
+
+<!-- META, SEE HEADER -->
+<xsl:template match="meta" />
+
+<!-- OBJECT (UNUSED) -->
+<xsl:template match="object" />
+
+<!-- PARAGRAPH -->
+<xsl:template match="paragraph">
+	<xsl:choose>
+		
+		<xsl:when test="@role='heading'">
+			<xsl:call-template name="insertheading">
+				<xsl:with-param name="level" select="@level"/>
+			</xsl:call-template>
+		</xsl:when>
+		
+		<xsl:when test="contains(' note warning tip ', at role)">
+			<xsl:call-template name="insertnote">
+				<xsl:with-param name="type" select="@role" />
+			</xsl:call-template>
+		</xsl:when>
+		
+		<xsl:when test="contains(descendant::embedvar/@href,'/00/00000004.xhp#wie')"> <!-- special treatment of howtoget links -->
+			<xsl:apply-templates />
+		</xsl:when>		
+		
+		<xsl:otherwise>
+			<xsl:call-template name="insertpara" />
+		</xsl:otherwise>
+	
+	</xsl:choose>
+</xsl:template>
+
+<xsl:template match="paragraph" mode="embedded">
+		<xsl:choose>
+		
+		<xsl:when test="@role='heading'">	<!-- increase the level of headings that are embedded -->
+		<!-- 
+		   The internal sablotron processor does not seem to support the number function.
+			 Therefore, we need a workaround for
+			 <xsl:variable name="level"><xsl:value-of select="number(@level)+1"/></xsl:variable>
+		-->
+			<xsl:variable name="newlevel">
+				<xsl:choose>
+					<xsl:when test="@level='1'"><xsl:value-of select="'2'"/></xsl:when>
+					<xsl:when test="@level='2'"><xsl:value-of select="'2'"/></xsl:when>
+					<xsl:when test="@level='3'"><xsl:value-of select="'3'"/></xsl:when>
+					<xsl:when test="@level='4'"><xsl:value-of select="'4'"/></xsl:when>
+					<xsl:when test="@level='5'"><xsl:value-of select="'5'"/></xsl:when>
+				</xsl:choose>
+			</xsl:variable>
+			
+			<xsl:call-template name="insertheading">
+				<xsl:with-param name="level" select="$newlevel"/>
+				<xsl:with-param name="embedded" select="'yes'"/>
+			</xsl:call-template>
+		</xsl:when>
+		
+		<xsl:when test="contains(' note warning tip ', at role)">
+			<xsl:call-template name="insertnote">
+				<xsl:with-param name="type" select="@role" />
+			</xsl:call-template>
+		</xsl:when>
+		
+		<xsl:when test="contains(descendant::embedvar/@href,'/00/00000004.xhp#wie')"> <!-- special treatment of howtoget links -->
+			<xsl:apply-templates />
+		</xsl:when>		
+		
+		<xsl:otherwise>
+			<xsl:call-template name="insertpara" />
+		</xsl:otherwise>
+		
+	</xsl:choose>
+</xsl:template>
+
+
+<!-- SECTION -->
+<xsl:template match="section">
+	<a name="{@id}"></a>
+
+		<xsl:choose>
+			
+			<xsl:when test="@id='relatedtopics'">
+				<div class="relatedtopics">
+					<xsl:variable name="href"><xsl:value-of select="concat($urlpre,'shared/text/shared/00/00000004.xhp',$urlpost)"/></xsl:variable>
+					<xsl:variable name="anchor"><xsl:value-of select="'related'"/></xsl:variable>
+					<xsl:variable name="doc" select="document($href)"/>
+					<p class="related">
+						<xsl:apply-templates select="$doc//variable[@id=$anchor]"/>
+					</p>
+					<div class="relatedbody">
+						<xsl:apply-templates />
+					</div>
+				</div>
+			</xsl:when>
+			
+			<xsl:when test="@id='howtoget'">
+				<xsl:call-template name="insert_howtoget" />
+			</xsl:when>
+			
+			<xsl:otherwise>
+						<xsl:apply-templates/>
+			</xsl:otherwise>
+		
+		</xsl:choose>
+
+</xsl:template>
+
+
+<!-- SECTION -->
+<xsl:template match="section" mode="embedded">
+	<a name="{@id}"></a>
+	<xsl:apply-templates mode="embedded"/>
+</xsl:template>
+
+<!-- SORT -->
+<xsl:template match="sort" >
+  <!-- sorting disabled due to #i70462#
+	<xsl:apply-templates><xsl:sort select="descendant::paragraph"/></xsl:apply-templates>
+	//-->
+	<xsl:apply-templates />
+</xsl:template>
+<xsl:template match="sort" mode="embedded">
+<!-- sorting disabled due to #i70462#
+	<xsl:apply-templates><xsl:sort select="descendant::paragraph"/></xsl:apply-templates>
+	//-->
+	<xsl:apply-templates />
+</xsl:template>
+
+<!-- SWITCH -->
+<xsl:template match="switch"><xsl:apply-templates /></xsl:template>
+<xsl:template match="switch" mode="embedded"><xsl:apply-templates /></xsl:template>
+
+<!-- SWITCHINLINE -->
+<xsl:template match="switchinline"><xsl:apply-templates /></xsl:template>
+<xsl:template match="switchinline" mode="embedded"><xsl:apply-templates mode="embedded"/></xsl:template>
+
+<!-- TABLE -->
+<xsl:template match="table"><xsl:call-template name="inserttable"/></xsl:template>
+<xsl:template match="table" mode="embedded"><xsl:call-template name="inserttable"/></xsl:template>
+
+<!-- TABLECELL -->
+<xsl:template match="tablecell"><td valign="top"><xsl:apply-templates /></td></xsl:template>
+<xsl:template match="tablecell" mode="icontable"><td valign="top"><xsl:apply-templates/></td></xsl:template>
+<xsl:template match="tablecell" mode="embedded"><td valign="top"><xsl:apply-templates mode="embedded"/></td></xsl:template>
+
+<!-- TABLEROW -->
+<xsl:template match="tablerow"><tr><xsl:apply-templates /></tr></xsl:template>
+<xsl:template match="tablerow" mode="icontable"><tr><xsl:apply-templates mode="icontable"/></tr></xsl:template>
+<xsl:template match="tablerow" mode="embedded"><tr><xsl:apply-templates mode="embedded"/></tr></xsl:template>
+
+<!-- TITLE -->
+<xsl:template match="title"/>
+
+<!-- TOPIC -->
+<xsl:template match="topic"/>
+
+<!-- VARIABLE -->
+<xsl:template match="variable"><a name="{@id}"></a><xsl:apply-templates /></xsl:template>
+<xsl:template match="variable" mode="embedded"><a name="{@id}"></a><xsl:apply-templates mode="embedded"/></xsl:template>
+
+<xsl:template match="text()">
+	<xsl:call-template name="brand">
+		<xsl:with-param name="string"><xsl:value-of select="."/></xsl:with-param>
+	</xsl:call-template>
+</xsl:template>
+
+<xsl:template match="text()" mode="embedded">
+	<xsl:call-template name="brand">
+		<xsl:with-param name="string"><xsl:value-of select="."/></xsl:with-param>
+	</xsl:call-template>
+</xsl:template>
+
+<!-- In case of missing help files -->
+<xsl:template match="help-id-missing"><xsl:value-of select="$Id"/></xsl:template>
+
+<!-- 
+###################
+# NAMED TEMPLATES #
+###################
+//-->
+
+<!-- Branding -->
+<xsl:template name="brand" >
+	<xsl:param name="string"/>
+	
+    <xsl:choose>
+		
+        <xsl:when test="contains($string,$brand1)">
+           <xsl:variable name="newstr">
+                <xsl:value-of select="substring-before($string,$brand1)"/>
+                <xsl:value-of select="$productname"/>
+                <xsl:value-of select="substring-after($string,$brand1)"/>
+           </xsl:variable>
+			<xsl:call-template name="brand">
+				<xsl:with-param name="string" select="$newstr"/>
+			</xsl:call-template>
+		</xsl:when>
+        
+		<xsl:when test="contains($string,$brand2)">
+		    <xsl:variable name="newstr">
+                <xsl:value-of select="substring-before($string,$brand2)"/>
+                <xsl:value-of select="$pversion"/>
+                <xsl:value-of select="substring-after($string,$brand2)"/>
+           </xsl:variable>
+			<xsl:call-template name="brand">
+				<xsl:with-param name="string" select="$newstr"/>
+			</xsl:call-template>
+		</xsl:when>
+        
+		<xsl:when test="contains($string,$brand3)">
+			<xsl:variable name="newstr">
+                <xsl:value-of select="substring-before($string,$brand3)"/>
+                <xsl:value-of select="$productname"/>
+                <xsl:value-of select="substring-after($string,$brand3)"/>
+           </xsl:variable>
+			<xsl:call-template name="brand">
+				<xsl:with-param name="string" select="$newstr"/>
+			</xsl:call-template>
+		</xsl:when>
+		
+        <xsl:when test="contains($string,$brand4)">
+			    <xsl:variable name="newstr">
+                <xsl:value-of select="substring-before($string,$brand4)"/>
+                <xsl:value-of select="$pversion"/>
+                <xsl:value-of select="substring-after($string,$brand4)"/>
+           </xsl:variable>
+			<xsl:call-template name="brand">
+				<xsl:with-param name="string" select="$newstr"/>
+			</xsl:call-template>
+		</xsl:when>
+		
+        <xsl:otherwise>
+			<xsl:value-of select="$string"/>
+		</xsl:otherwise>
+	</xsl:choose> 
+    
+</xsl:template>
+
+
+<!-- Insert Paragraph -->
+<xsl:template name="insertpara">
+	<xsl:variable name="role">
+		<xsl:choose>
+			<xsl:when test="ancestor::table">
+				<xsl:value-of select="concat(@role,'intable')"/>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:value-of select="@role"/>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+	<p class="{$role}"><xsl:apply-templates /></p>
+</xsl:template>
+
+<!-- Insert "How to get Link" -->
+<xsl:template name="insert_howtoget">
+	<xsl:param name="linkhref" />
+	<xsl:variable name="archive" select="'shared'"/>
+	<xsl:variable name="tmp_href"><xsl:value-of select="concat($urlpre,'shared/text/shared/00/00000004.xhp',$urlpost)"/></xsl:variable>	
+	<xsl:variable name="tmp_doc" select="document($tmp_href)"/>
+	<table class="howtoget" width="100%" border="1" cellpadding="3" cellspacing="0">
+		<tr>
+			<td>
+				<p class="howtogetheader"><xsl:apply-templates select="$tmp_doc//variable[@id='wie']"/></p>
+				<div class="howtogetbody">
+				<xsl:choose>
+					<xsl:when test="$linkhref = ''"> <!-- new style -->
+						<xsl:apply-templates/>
+					</xsl:when>
+					<xsl:otherwise> <!-- old style -->
+						<xsl:variable name="archive1"><xsl:value-of select="concat(substring-before(substring-after($linkhref,'text/'),'/'),'/')"/></xsl:variable>
+						<xsl:variable name="href"><xsl:value-of select="concat($urlpre,$archive1,substring-before($linkhref,'#'),$urlpost)"/></xsl:variable>
+						<xsl:variable name="anc"><xsl:value-of select="substring-after($linkhref,'#')"/></xsl:variable>
+						<xsl:variable name="docum" select="document($href)"/>
+						
+						<xsl:call-template name="insertembed">
+							<xsl:with-param name="doc" select="$docum" />
+							<xsl:with-param name="anchor" select="$anc" />
+						</xsl:call-template>
+
+					</xsl:otherwise>
+				</xsl:choose>				
+				</div>
+			</td>
+		</tr>
+	</table>
+	<br/>
+</xsl:template>
+
+<!-- Create a link -->
+<xsl:template name="createlink">
+<xsl:variable name="archive"><xsl:value-of select="concat(substring-before(substring-after(@href,'text/'),'/'),'/')"/></xsl:variable>
+<xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="$archive"/></xsl:call-template></xsl:variable>
+	<xsl:choose>
+		<xsl:when test="starts-with(@href,'http://')">  <!-- web links -->
+			<a href="{@href}"><xsl:apply-templates /></a>
+		</xsl:when>
+		<xsl:when test="contains(@href,'#')">
+			<xsl:variable name="anchor"><xsl:value-of select="concat('#',substring-after(@href,'#'))"/></xsl:variable>
+			<xsl:variable name="href"><xsl:value-of select="concat($linkprefix,$archive,substring-before(@href,'#'),$linkpostfix,$dbpostfix,$anchor)"/></xsl:variable>
+			<a href="{$href}"><xsl:apply-templates /></a>
+		</xsl:when>
+		<xsl:otherwise>
+			<xsl:variable name="href"><xsl:value-of select="concat($linkprefix,$archive, at href,$linkpostfix,$dbpostfix)"/></xsl:variable>
+			<a href="{$href}"><xsl:apply-templates /></a>
+		</xsl:otherwise>
+	</xsl:choose>
+</xsl:template>
+
+<!-- Insert Note, Warning, or Tip -->
+<xsl:template name="insertnote">
+	<xsl:param name="type" /> <!-- note, tip, or warning -->
+	<xsl:variable name="imgsrc">
+		<xsl:choose>
+			<xsl:when test="$type='note'"><xsl:value-of select="$note_img"/></xsl:when>
+			<xsl:when test="$type='tip'"><xsl:value-of select="$tip_img"/></xsl:when>
+			<xsl:when test="$type='warning'"><xsl:value-of select="$warning_img"/></xsl:when>
+		</xsl:choose>
+	</xsl:variable>
+	<xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="'shared'"/></xsl:call-template></xsl:variable>
+	<xsl:variable name="alt">
+		<xsl:variable name="href"><xsl:value-of select="concat($urlpre,'shared/',$alttext,$urlpost,$dbpostfix)"/></xsl:variable>
+		<xsl:variable name="anchor"><xsl:value-of select="concat('alt_',$type)"/></xsl:variable>
+		<xsl:variable name="doc" select="document($href)"/>
+		<xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
+	</xsl:variable>
+	<div class="{$type}">
+		<table border="0" class="{$type}" cellspacing="0" cellpadding="5">
+			<tr>
+				<td><img src="{$imgsrc}" alt="{$alt}" title="{$alt}"/></td>
+				<td><xsl:apply-templates /></td>
+			</tr>
+		</table>
+	</div>
+	<br/>
+</xsl:template>
+
+<!-- Insert a heading -->
+<xsl:template name="insertheading">
+	<xsl:param name="level" />
+	<xsl:param name="embedded" />
+	<xsl:text disable-output-escaping="yes">&lt;h</xsl:text><xsl:value-of select="$level"/><xsl:text disable-output-escaping="yes">&gt;</xsl:text>
+		<xsl:choose>
+			<xsl:when test="$embedded = 'yes'">
+				<xsl:apply-templates mode="embedded"/>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
+	<xsl:text disable-output-escaping="yes">&lt;/h</xsl:text><xsl:value-of select="$level"/><xsl:text disable-output-escaping="yes">&gt;</xsl:text>
+</xsl:template>
+
+<!-- Evaluate a case or caseinline switch -->
+<xsl:template name="insertcase">
+	<xsl:param name="embedded" />
+	<xsl:choose>
+		<xsl:when test="parent::switch[@select='sys'] or parent::switchinline[@select='sys']">
+			<xsl:if test="@select = $System">
+				<xsl:choose>
+					<xsl:when test="$embedded = 'yes'">
+						<xsl:apply-templates mode="embedded"/>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:if>
+		</xsl:when>
+		<xsl:when test="parent::switch[@select='appl'] or parent::switchinline[@select='appl']">
+			<xsl:if test="@select = $appl">
+				<xsl:choose>
+					<xsl:when test="$embedded = 'yes'">
+						<xsl:apply-templates mode="embedded"/>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:if>
+		</xsl:when>
+		<xsl:when test="parent::switch[@select='distrib'] or parent::switchinline[@select='distrib']">
+			<xsl:if test="@select = $distrib">
+				<xsl:choose>
+					<xsl:when test="$embedded = 'yes'">
+						<xsl:apply-templates mode="embedded"/>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:if>
+		</xsl:when>
+	</xsl:choose>
+</xsl:template>
+
+<!-- Evaluate a default or defaultinline switch -->
+<xsl:template name="insertdefault">
+	<xsl:param name="embedded" />
+	
+	<xsl:choose>
+		<xsl:when test="parent::switch[@select='sys'] or parent::switchinline[@select='sys']">
+			<xsl:if test="not(../child::case[@select=$System]) and not(../child::caseinline[@select=$System])">
+				<xsl:choose>
+					<xsl:when test="$embedded = 'yes'">
+						<xsl:apply-templates mode="embedded"/>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:if>
+		</xsl:when>
+		<xsl:when test="parent::switch[@select='appl'] or parent::switchinline[@select='appl']">
+			<xsl:if test="not(../child::case[@select=$appl]) and not(../child::caseinline[@select=$appl])">
+				<xsl:choose>
+					<xsl:when test="$embedded = 'yes'">
+						<xsl:apply-templates mode="embedded"/>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:if>
+		</xsl:when>
+		<xsl:when test="parent::switch[@select='distrib'] or parent::switchinline[@select='distrib']">
+			<xsl:if test="not(../child::case[@select=$distrib]) and not(../child::caseinline[@select=$distrib])">
+				<xsl:choose>
+					<xsl:when test="$embedded = 'yes'">
+						<xsl:apply-templates mode="embedded"/>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates />
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:if>
+		</xsl:when>
+	</xsl:choose>
+</xsl:template>
+
+<!-- evaluate embeds -->
+<xsl:template name="insertembed">
+	<xsl:param name="doc" />
+	<xsl:param name="anchor" />
+	<!-- different embed targets (also falsely used embed instead embedvar) -->
+	<xsl:choose>
+		<xsl:when test="$doc//section[@id=$anchor]"> <!-- first test for a section of that name -->
+			<xsl:apply-templates select="$doc//section[@id=$anchor]" mode="embedded"/>
+		</xsl:when>
+		<xsl:when test="$doc//paragraph[@id=$anchor]"> <!-- then test for a para of that name -->
+			<p class="embedded">
+				<xsl:apply-templates select="$doc//paragraph[@id=$anchor]" mode="embedded"/>
+			</p>
+		</xsl:when>
+		<xsl:when test="$doc//variable[@id=$anchor]"> <!-- then test for a variable of that name -->
+			<p class="embedded">
+				<xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
+			</p>
+		</xsl:when>
+		<xsl:otherwise> <!-- then give up -->
+			<p class="bug">D'oh! You found a bug (<xsl:value-of select="@href"/> not found).</p> 
+		</xsl:otherwise>
+	</xsl:choose>
+</xsl:template>
+
+<!-- Insert an image -->
+<xsl:template name="insertimage">
+	
+	<xsl:variable name="fpath">
+		<xsl:call-template name="getfpath">
+			<xsl:with-param name="s"><xsl:value-of select="@src"/></xsl:with-param>
+		</xsl:call-template>
+	</xsl:variable>
+	
+	<xsl:variable name="fname">
+		<xsl:call-template name="getfname">
+			<xsl:with-param name="s"><xsl:value-of select="@src"/></xsl:with-param>
+		</xsl:call-template>
+	</xsl:variable>
+
+  <xsl:variable name="src">
+    <xsl:choose>
+      <xsl:when test="not($ExtensionId='') and starts-with(@src,$ExtensionId)">
+        <xsl:value-of select="concat($ExtensionPath,'/', at src)"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:choose>
+          <xsl:when test="(@localize='true') and not($lang='en-US')">
+            <xsl:value-of select="concat($img_url_prefix,$fpath,$lang,'/',$fname)"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="concat($img_url_prefix,$fpath,$fname)"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  
+	<!--<xsl:variable name="src"><xsl:value-of select="concat($img_url_prefix, at src)"/></xsl:variable>-->
+	<xsl:variable name="alt"><xsl:value-of select="./alt"/></xsl:variable>
+	<xsl:variable name="width" select="''"/> <!-- Images don't all have the correct size -->
+	<xsl:variable name="height" select="''"/><!-- Image don't all have the correct size -->
+	<img src="{$src}" alt="{$alt}" title="{$alt}">
+		<xsl:if test="not($width='')"><xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute></xsl:if>
+		<xsl:if test="not($height='')"><xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute></xsl:if>
+	</img>  
+</xsl:template>
+
+<!-- Insert a Table -->
+<xsl:template name="inserttable">
+	<xsl:variable name="imgsrc">	<!-- see if we are in an image table -->
+		<xsl:value-of select="tablerow/tablecell[1]/paragraph[1]/image/@src"/>
+	</xsl:variable>
+	
+	<xsl:choose>
+		
+		<xsl:when test="count(descendant::tablecell)=1">
+			<table border="0" class="onecell" cellpadding="0" cellspacing="0">
+				<xsl:apply-templates />
+		 </table>
+		</xsl:when>
+		
+		<xsl:when test="descendant::tablecell[1]/descendant::image">
+			<table border="0" class="icontable" cellpadding="5" cellspacing="0">
+				<xsl:apply-templates mode="icontable"/>
+		 </table>
+		</xsl:when>
+		
+		<xsl:when test="@class='wide'">
+			<table border="1" class="{@class}" cellpadding="0" cellspacing="0" width="100%" >
+				<xsl:apply-templates />
+		 </table>
+		</xsl:when>
+		
+		<xsl:when test="not(@class='')">
+			<table border="1" class="{@class}" cellpadding="0" cellspacing="0" >
+				<xsl:apply-templates />
+		 </table>
+		</xsl:when>
+		
+		<xsl:otherwise>
+			<table border="1" class="border" cellpadding="0" cellspacing="0" >
+				<xsl:apply-templates />
+		 </table>
+		</xsl:otherwise>
+	</xsl:choose>
+	
+	<br/>
+</xsl:template>
+
+<xsl:template name="resolveembed">
+	<div class="embedded">
+		<xsl:variable name="archive"><xsl:value-of select="concat(substring-before(substring-after(@href,'text/'),'/'),'/')"/></xsl:variable>
+		<xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="$archive"/></xsl:call-template></xsl:variable>
+		<xsl:variable name="href"><xsl:value-of select="concat($urlpre,$archive,substring-before(@href,'#'),$urlpost,$dbpostfix)"/></xsl:variable>
+		<xsl:variable name="anc"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
+		<xsl:variable name="docum" select="document($href)"/>
+		
+		<xsl:call-template name="insertembed">
+			<xsl:with-param name="doc" select="$docum" />
+			<xsl:with-param name="anchor" select="$anc" />
+		</xsl:call-template>
+
+	</div>
+</xsl:template>
+
+<xsl:template name="resolveembedvar">
+	<xsl:if test="not(@href='text/shared/00/00000004.xhp#wie')"> <!-- special treatment if howtoget links -->
+		<xsl:variable name="archive"><xsl:value-of select="concat(substring-before(substring-after(@href,'text/'),'/'),'/')"/></xsl:variable>
+		<xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="$archive"/></xsl:call-template></xsl:variable>
+		<xsl:variable name="href"><xsl:value-of select="concat($urlpre,$archive,substring-before(@href,'#'),$urlpost,$dbpostfix)"/></xsl:variable>
+		<xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
+		<xsl:variable name="doc" select="document($href)"/>
+		<xsl:choose>
+			<xsl:when test="$doc//variable[@id=$anchor]"> <!-- test for a variable of that name -->
+				<xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
+			</xsl:when>
+			<xsl:otherwise> <!-- or give up -->
+				<span class="bug">[<xsl:value-of select="@href"/> not found].</span> 
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:if>
+</xsl:template>
+
+<!-- Apply -->
+<xsl:template name="apply">
+	<xsl:param name="embedded" />
+	<xsl:choose>
+		<xsl:when test="$embedded = 'yes'">
+			<xsl:apply-templates mode="embedded"/>
+		</xsl:when>
+		<xsl:otherwise>
+			<xsl:apply-templates />
+		</xsl:otherwise>
+	</xsl:choose>
+</xsl:template>
+
+<xsl:template name="getfpath">
+	<xsl:param name="s"/>
+	<xsl:param name="p"/>
+	<xsl:choose>
+		<xsl:when test="contains($s,'/')">
+			<xsl:call-template name="getfpath">
+				<xsl:with-param name="p"><xsl:value-of select="concat($p,substring-before($s,'/'),'/')"/></xsl:with-param>
+				<xsl:with-param name="s"><xsl:value-of select="substring-after($s,'/')"/></xsl:with-param>
+			</xsl:call-template>
+		</xsl:when>
+		<xsl:otherwise>
+			<xsl:value-of select="$p"/>
+		</xsl:otherwise>
+	</xsl:choose>
+</xsl:template>
+
+<xsl:template name="getfname">
+	<xsl:param name="s"/>
+	<xsl:choose>
+		<xsl:when test="contains($s,'/')">
+			<xsl:call-template name="getfname">
+				<xsl:with-param name="s"><xsl:value-of select="substring-after($s,'/')"/></xsl:with-param>
+			</xsl:call-template>
+		</xsl:when>
+		<xsl:otherwise>
+			<xsl:value-of select="$s"/>
+		</xsl:otherwise>
+	</xsl:choose>
+</xsl:template>
+
+<xsl:template name="createDBpostfix">
+	<xsl:param name="archive"/>
+	<xsl:variable name="newDB">
+		<xsl:choose>
+			<xsl:when test="(substring($archive,1,6) = 'shared')"><xsl:value-of select="$Database"/></xsl:when>
+			<xsl:otherwise><xsl:value-of select="substring-before($archive,'/')"/></xsl:otherwise>
+		</xsl:choose>
+	</xsl:variable>
+	<xsl:value-of select="concat($am,'DbPAR=',$newDB)"/>
+</xsl:template>
+
+</xsl:stylesheet>
commit d18dfc48dc7a743db031250ab9dc7f67b73c73e4
Author: Hans-Joachim Lankenau <hjs at openoffice.org>
Date:   Wed Sep 1 15:49:06 2010 +0200

    jl158: #i114088# required file missing

diff --git a/xmlhelp/util/delzip b/xmlhelp/util/delzip
new file mode 100644
index 0000000..e69de29
commit 607d1b720a296580e476e9b3a601445c2a6c9fcf
Author: Frank Schoenheit [fs] <frank.schoenheit at sun.com>
Date:   Wed Sep 1 15:13:11 2010 +0200

    dba33i: #i111146# SaveCurrentViewData_Impl: be less generous, only store the old view's data in the model if the new view is a print preview

diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx
index 690306f..cf6bbf0 100644
--- a/sfx2/inc/sfx2/viewfrm.hxx
+++ b/sfx2/inc/sfx2/viewfrm.hxx
@@ -253,7 +253,7 @@ public:
 private:
     SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE );
     SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell );
-    SAL_DLLPRIVATE void SaveCurrentViewData_Impl();
+    SAL_DLLPRIVATE void SaveCurrentViewData_Impl( const USHORT i_nNewViewId );
 
     /** loads the given existing document into the given frame
 
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 590232c..d74ab25 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2246,24 +2246,28 @@ SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, c
 
 //--------------------------------------------------------------------
 
-void SfxViewFrame::SaveCurrentViewData_Impl()
+void SfxViewFrame::SaveCurrentViewData_Impl( const USHORT i_nNewViewId )
 {
     SfxViewShell* pCurrentShell = GetViewShell();
     ENSURE_OR_RETURN_VOID( pCurrentShell != NULL, "SfxViewFrame::SaveCurrentViewData_Impl: no current view shell -> no current view data!" );
 
     // determine the logical (API) view name
     const SfxObjectFactory& rDocFactory( pCurrentShell->GetObjectShell()->GetFactory() );
-    const sal_uInt16 nViewNo = rDocFactory.GetViewNo_Impl( GetCurViewId(), 0 );
-    const String sViewName = rDocFactory.GetViewFactory( nViewNo ).GetAPIViewName();
-    if ( sViewName.Len() == 0 )
+    const sal_uInt16 nCurViewNo = rDocFactory.GetViewNo_Impl( GetCurViewId(), 0 );
+    const String sCurrentViewName = rDocFactory.GetViewFactory( nCurViewNo ).GetAPIViewName();
+    const sal_uInt16 nNewViewNo = rDocFactory.GetViewNo_Impl( i_nNewViewId, 0 );
+    const String sNewViewName = rDocFactory.GetViewFactory( nNewViewNo ).GetAPIViewName();
+    if ( ( sCurrentViewName.Len() == 0 ) || ( sNewViewName.Len() == 0 ) )
     {
         // can't say anything about the view, the respective application did not yet migrate its code to
         // named view factories => bail out
+        OSL_ENSURE( false, "SfxViewFrame::SaveCurrentViewData_Impl: views without API names? Shouldn't happen anymore?" );
         return;
     }
+    OSL_ENSURE( !sNewViewName.Equals( sCurrentViewName ), "SfxViewFrame::SaveCurrentViewData_Impl: suspicious: new and old view name are identical!" );
 
-    // do *not* save view data when the view is a print preview
-    if ( sViewName.EqualsAscii( "PrintPreview" ) )
+    // save the view data only when we're moving from a non-print-preview to the print-preview view
+    if ( !sNewViewName.EqualsAscii( "PrintPreview" ) )
         return;
 
     // retrieve the view data from the view
@@ -2371,7 +2375,7 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl
         const USHORT nViewId = ( bIsIndex || !nViewIdOrNo ) ? rDocFact.GetViewFactory( nViewIdOrNo ).GetOrdinal() : nViewIdOrNo;
 
         // save the view data of the old view, so it can be restored later on (when needed)
-        SaveCurrentViewData_Impl();
+        SaveCurrentViewData_Impl( nViewId );
 
         // create and load new ViewShell
         SfxViewShell* pNewSh = LoadViewIntoFrame_Impl(
commit db8cd8e2439cd0d2712de7416eccfa4e9e0264ff
Author: Frank Schoenheit [fs] <frank.schoenheit at sun.com>
Date:   Wed Sep 1 14:59:07 2010 +0200

    dba33i: #i111146# migrated all SFX-based applications to use named views

diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index d7e818f..f60c58b 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -123,17 +123,6 @@ public: \
     static SfxViewFactory&Factory() { return *pFactory; } \
     static void           InitFactory()
 
-#define SFX_IMPL_VIEWFACTORY(Class, rResId) \
-    SfxViewFactory* Class::pFactory; \
-    SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \
-    { return new Class(pFrame, pOldView); } \
-    void Class::RegisterFactory( USHORT nPrio ) \
-    { \
-        pFactory = new SfxViewFactory(&CreateInstance,&InitFactory,nPrio,rResId);\
-        InitFactory(); \
-    } \
-    void Class::InitFactory()
-
 #define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \
     SfxViewFactory* Class::pFactory; \
     SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \
diff --git a/sfx2/inc/viewfac.hxx b/sfx2/inc/viewfac.hxx
index c4d2770..15462c3 100644
--- a/sfx2/inc/viewfac.hxx
+++ b/sfx2/inc/viewfac.hxx
@@ -46,16 +46,12 @@ class SFX2_DLLPUBLIC SfxViewFactory
 {
 public:
     SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
-                    USHORT nOrdinal, const ResId& aDescrResId );
-    SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
                     USHORT nOrdinal, const sal_Char* asciiViewName );
     ~SfxViewFactory();
 
     SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh);
     void		  InitFactory();
 
-    String		  GetDescription() const
-                  { return String( aDescription ); }
     USHORT		  GetOrdinal() const { return nOrd; }
 
     /// returns a legacy view name. This is "view" with an appended ordinal/ID.
@@ -72,7 +68,6 @@ private:
     SfxViewCtor fnCreate;
     SfxViewInit fnInit;
     USHORT      nOrd;
-    ResId		aDescription;
     const String    m_sViewName;
 };
 
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 6b8d4e7..47a46fc 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -159,6 +159,21 @@ void SfxObjectFactory::RegisterViewFactory
     SfxViewFactory &rFactory
 )
 {
+#if OSL_DEBUG_LEVEL > 0
+    {
+        const String sViewName( rFactory.GetAPIViewName() );
+        for ( sal_uInt16 i = 0; i < pImpl->aViewFactoryArr.Count(); ++i )
+        {
+            if ( !pImpl->aViewFactoryArr[i]->GetAPIViewName().Equals( sViewName ) )
+                continue;
+            ByteString sMessage( "SfxObjectFactory::RegisterViewFactory: duplicate view name '" );
+            sMessage += ByteString( sViewName, RTL_TEXTENCODING_ASCII_US );
+            sMessage += "'!";
+            OSL_ENSURE( false, sMessage.GetBuffer() );
+            break;
+        }
+    }
+#endif
     sal_uInt16 nPos;
     for ( nPos = 0;
           nPos < pImpl->aViewFactoryArr.Count() &&
diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx
index 827782c..70a076b 100644
--- a/sfx2/source/view/viewfac.cxx
+++ b/sfx2/source/view/viewfac.cxx
@@ -30,7 +30,6 @@
 // INCLUDE ---------------------------------------------------------------
 
 #include <sfx2/app.hxx>
-#include "sfxresid.hxx"
 #include <rtl/ustrbuf.hxx>
 #include "viewfac.hxx"
 
@@ -72,23 +71,10 @@ String SfxViewFactory::GetAPIViewName() const
 // CTOR / DTOR -----------------------------------------------------------
 
 SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
-                                USHORT nOrdinal, const ResId& aDescrResId ):
-    fnCreate(fnC),
-    fnInit(fnI),
-    nOrd(nOrdinal),
-    aDescription(aDescrResId.GetId(), *aDescrResId.GetResMgr()),
-    m_sViewName()
-{
-    aDescription.SetRT(aDescrResId.GetRT());
-    DBG_CTOR(SfxViewFactory, 0);
-}
-
-SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
                                 USHORT nOrdinal, const sal_Char* asciiViewName ):
     fnCreate(fnC),
     fnInit(fnI),
     nOrd(nOrdinal),
-    aDescription( SfxResId( 0 ) ),
     m_sViewName( String::CreateFromAscii( asciiViewName ) )
 {
     DBG_CTOR(SfxViewFactory, 0);
commit 86df19c72c76a5db55072442bd427973b301308b
Author: Frank Schoenheit [fs] <frank.schoenheit at sun.com>
Date:   Wed Sep 1 13:39:49 2010 +0200

    dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
    print preview and back, to SFX
    In particular, the following changes have been applied
    - the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
    - the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
      factories for such named views
    - SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
      is exchanged with another view. In this case, it preserves the view's view data at the model
    - Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
      the print preview, has been removed completely.
    
    What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
    This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
    view names would be speaking then, instead of the current "view<number>" names.

diff --git a/sfx2/inc/sfx2/docfac.hxx b/sfx2/inc/sfx2/docfac.hxx
index fe2667d..3054278 100644
--- a/sfx2/inc/sfx2/docfac.hxx
+++ b/sfx2/inc/sfx2/docfac.hxx
@@ -94,7 +94,7 @@ public:
     USHORT			GetViewFactoryCount() const;
     SfxViewFactory& GetViewFactory(USHORT i = 0) const;
 
-    /// returns the view factory whose GetViewName delivers the requested logical name
+    /// returns the view factory whose GetAPIViewName or GetLegacyViewName delivers the requested logical name
     SfxViewFactory* GetViewFactoryByViewName( const String& i_rViewName ) const;
 
     // Filter
diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx
index 81b296b..690306f 100644
--- a/sfx2/inc/sfx2/viewfrm.hxx
+++ b/sfx2/inc/sfx2/viewfrm.hxx
@@ -253,6 +253,7 @@ public:
 private:
     SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE );
     SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell );
+    SAL_DLLPRIVATE void SaveCurrentViewData_Impl();
 
     /** loads the given existing document into the given frame
 
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index 0e8bc90..d7e818f 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -134,6 +134,17 @@ public: \
     } \
     void Class::InitFactory()
 
+#define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \
+    SfxViewFactory* Class::pFactory; \
+    SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \
+    { return new Class(pFrame, pOldView); } \
+    void Class::RegisterFactory( USHORT nPrio ) \
+    { \
+        pFactory = new SfxViewFactory(&CreateInstance,&InitFactory,nPrio,AsciiViewName);\
+        InitFactory(); \
+    } \
+    void Class::InitFactory()
+
 #define SFX_VIEW_REGISTRATION(DocClass) \
             DocClass::Factory().RegisterViewFactory( Factory() )
 
diff --git a/sfx2/inc/viewfac.hxx b/sfx2/inc/viewfac.hxx
index 0ab7159..c4d2770 100644
--- a/sfx2/inc/viewfac.hxx
+++ b/sfx2/inc/viewfac.hxx
@@ -47,6 +47,8 @@ class SFX2_DLLPUBLIC SfxViewFactory
 public:
     SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
                     USHORT nOrdinal, const ResId& aDescrResId );
+    SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
+                    USHORT nOrdinal, const sal_Char* asciiViewName );
     ~SfxViewFactory();
 
     SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh);
@@ -56,14 +58,22 @@ public:
                   { return String( aDescription ); }
     USHORT		  GetOrdinal() const { return nOrd; }
 
-    /// returns an API-compatible view name. For the moment, this is "view" with an appended ordinal/ID
-    String        GetViewName() const;
+    /// returns a legacy view name. This is "view" with an appended ordinal/ID.
+    String        GetLegacyViewName() const;
+
+    /** returns a API-compatible view name.
+
+        For details on which view names are specified, see the XModel2.getAvailableViewControllerNames
+        documentation.
+    */
+    String        GetAPIViewName() const;
 
 private:
     SfxViewCtor fnCreate;
     SfxViewInit fnInit;
     USHORT      nOrd;
     ResId		aDescription;
+    const String    m_sViewName;
 };
 
 #endif
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 448d89b..6b8d4e7 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -467,7 +467,9 @@ SfxViewFactory* SfxObjectFactory::GetViewFactoryByViewName( const String& i_rVie
         )
     {
         SfxViewFactory& rViewFac( GetViewFactory( nViewNo ) );
-        if ( rViewFac.GetViewName() == i_rViewName )
+        if  (   ( rViewFac.GetAPIViewName() == i_rViewName )
+            ||  ( rViewFac.GetLegacyViewName() == i_rViewName )
+            )
             return &rViewFac;
     }
     return NULL;
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 9aa9749..24a68de 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3812,7 +3812,7 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getAvailableViewCon
 
     Sequence< ::rtl::OUString > aViewNames( nViewFactoryCount );
     for ( sal_Int32 nViewNo = 0; nViewNo < nViewFactoryCount; ++nViewNo )
-        aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetViewName();
+        aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetAPIViewName();
     return aViewNames;
 }
 
@@ -3826,7 +3826,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDef
     SfxModelGuard aGuard( *this );
 
     const SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory();
-    const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetViewName();
+    const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetAPIViewName();
 
     aGuard.clear();
 
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index f59b80b..03c2289 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -650,7 +650,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA
         // ensure the ID of the to-be-created view is in the descriptor, if possible
         const sal_Int16 nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor );
         const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 );
-        const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetViewName() );
+        const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetAPIViewName() );
 
         // if the document is created hidden, prevent it from being deleted until it is shown or disposed
         impl_lockHiddenDocument( *xDoc, aDescriptor );
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 339e1bf..1d65579 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -118,6 +118,7 @@ using namespace ::com::sun::star;
 using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::RuntimeException;
 using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_SET_THROW;
 using ::com::sun::star::lang::DisposedException;
 using ::com::sun::star::awt::XWindow;
 using ::com::sun::star::frame::XController;
@@ -579,7 +580,7 @@ Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (Run
 
     ::rtl::OUString sViewName;
     if ( nViewNo < rDocFac.GetViewFactoryCount() )
-        sViewName = rDocFac.GetViewFactory( nViewNo ).GetViewName();
+        sViewName = rDocFac.GetViewFactory( nViewNo ).GetAPIViewName();
 
     return sViewName;
 }
@@ -1421,20 +1422,52 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect )
             // if so, forward it to the view/shell.
             if ( !bHasPluginMode && !bHasJumpMark )
             {
+                // Note that this might not be the ideal place here. Restoring view data should, IMO, be the
+                // responsibility of the loader, not an implementation detail burried here deep within the controller's
+                // implementation.
+                // What I think should be done to replace the below code:
+                // - change SfxBaseController::restoreViewData to also accept a PropertyValue[] (it currently accepts
+                //   a string only), and forward it to its ViewShell's ReadUserDataSequence
+                // - change the frame loader so that when a new document is loaded (as opposed to an existing
+                //   document being loaded into a new frame), the model's view data is examine the very same
+                //   way as below, and the proper view data is set via XController::restoreViewData
+                // - extend SfxViewFrame::SwitchToViewShell_Impl. Currently, it cares for the case where a non-PrintPreview
+                //   view is exchanged, and sets the old view's data at the model. It should also care for the other
+                //   way, were the PrintPreview view is left: in this case, the new view should also be initialized
+                //   with the model's view data
                 try
                 {
-                    Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY );
-                    Reference< XIndexAccess > xViewData;
-                    if ( xViewDataSupplier.is() )
-                        xViewData = xViewDataSupplier->getViewData();
-                    if ( xViewData.is() && xViewData->getCount() > 0 )
+                    Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY_THROW );
+                    Reference< XIndexAccess > xViewData( xViewDataSupplier->getViewData(), UNO_SET_THROW );
+
+                    // find the view data item whose ViewId matches the ID of the view we're just connecting to
+                    const SfxObjectFactory& rDocFactory( rDoc.GetFactory() );
+                    const sal_Int32 nCount = xViewData->getCount();
+                    sal_Int32 nViewDataIndex = 0;
+                    for ( sal_Int32 i=0; i<nCount; ++i )
                     {
-                        Sequence< PropertyValue > aViewData;
-                        if ( ( xViewData->getByIndex( 0 ) >>= aViewData ) && ( aViewData.getLength() ) )
+                        const ::comphelper::NamedValueCollection aViewData( xViewData->getByIndex(i) );
+                        ::rtl::OUString sViewId( aViewData.getOrDefault( "ViewId", ::rtl::OUString() ) );
+                        if ( sViewId.getLength() == 0 )
+                            continue;
+
+                        const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId );
+                        if ( pViewFactory == NULL )
+                            continue;
+
+                        if ( pViewFactory->GetOrdinal() == pViewFrame->GetCurViewId() )
                         {
-                            m_pData->m_pViewShell->ReadUserDataSequence( aViewData, TRUE );
+                            nViewDataIndex = i;
+                            break;
                         }
                     }
+                    if ( nViewDataIndex < nCount )
+                    {
+                        Sequence< PropertyValue > aViewData;
+                        OSL_VERIFY( xViewData->getByIndex( nViewDataIndex ) >>= aViewData );
+                        if ( aViewData.getLength() > 0 )
+                            m_pData->m_pViewShell->ReadUserDataSequence( aViewData, TRUE );
+                    }
                 }
                 catch( const Exception& )
                 {
diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx
index 57187cd..827782c 100644
--- a/sfx2/source/view/viewfac.cxx
+++ b/sfx2/source/view/viewfac.cxx
@@ -30,6 +30,7 @@
 // INCLUDE ---------------------------------------------------------------
 
 #include <sfx2/app.hxx>
+#include "sfxresid.hxx"
 #include <rtl/ustrbuf.hxx>
 #include "viewfac.hxx"
 
@@ -49,7 +50,7 @@ void SfxViewFactory::InitFactory()
     (*fnInit)();
 }
 
-String SfxViewFactory::GetViewName() const
+String SfxViewFactory::GetLegacyViewName() const
 {
     ::rtl::OUStringBuffer aViewName;
     aViewName.appendAscii( "view" );
@@ -57,6 +58,17 @@ String SfxViewFactory::GetViewName() const
     return aViewName.makeStringAndClear();
 }
 
+String SfxViewFactory::GetAPIViewName() const
+{
+    if ( m_sViewName.Len() > 0 )
+        return m_sViewName;
+
+    if ( GetOrdinal() == 0 )
+        return String::CreateFromAscii( "Default" );
+
+    return GetLegacyViewName();
+}
+
 // CTOR / DTOR -----------------------------------------------------------
 
 SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
@@ -64,11 +76,22 @@ SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
     fnCreate(fnC),
     fnInit(fnI),
     nOrd(nOrdinal),
-    aDescription(aDescrResId.GetId(), *aDescrResId.GetResMgr())
+    aDescription(aDescrResId.GetId(), *aDescrResId.GetResMgr()),
+    m_sViewName()
 {
     aDescription.SetRT(aDescrResId.GetRT());
     DBG_CTOR(SfxViewFactory, 0);
-//	SFX_APP()->RegisterViewFactory_Impl(*this);
+}
+
+SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
+                                USHORT nOrdinal, const sal_Char* asciiViewName ):
+    fnCreate(fnC),
+    fnInit(fnI),
+    nOrd(nOrdinal),
+    aDescription( SfxResId( 0 ) ),
+    m_sViewName( String::CreateFromAscii( asciiViewName ) )
+{
+    DBG_CTOR(SfxViewFactory, 0);
 }
 
 SfxViewFactory::~SfxViewFactory()
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index a8edc01..590232c 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -75,6 +75,8 @@
 #include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
 #include <com/sun/star/embed/XStorage.hpp>
 #include <com/sun/star/embed/EmbedStates.hpp>
+#include <com/sun/star/document/XViewDataSupplier.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
 #include <rtl/ustrbuf.hxx>
 
 #include <unotools/localfilehelper.hxx>
@@ -106,6 +108,8 @@ using namespace ::com::sun::star::frame;
 using namespace ::com::sun::star::lang;
 using ::com::sun::star::awt::XWindow;
 using ::com::sun::star::beans::PropertyValue;
+using ::com::sun::star::document::XViewDataSupplier;
+using ::com::sun::star::container::XIndexContainer;
 namespace css = ::com::sun::star;
 
 #ifndef GCC
@@ -2242,6 +2246,68 @@ SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, c
 
 //--------------------------------------------------------------------
 
+void SfxViewFrame::SaveCurrentViewData_Impl()
+{
+    SfxViewShell* pCurrentShell = GetViewShell();
+    ENSURE_OR_RETURN_VOID( pCurrentShell != NULL, "SfxViewFrame::SaveCurrentViewData_Impl: no current view shell -> no current view data!" );
+
+    // determine the logical (API) view name
+    const SfxObjectFactory& rDocFactory( pCurrentShell->GetObjectShell()->GetFactory() );
+    const sal_uInt16 nViewNo = rDocFactory.GetViewNo_Impl( GetCurViewId(), 0 );
+    const String sViewName = rDocFactory.GetViewFactory( nViewNo ).GetAPIViewName();
+    if ( sViewName.Len() == 0 )
+    {
+        // can't say anything about the view, the respective application did not yet migrate its code to
+        // named view factories => bail out
+        return;
+    }
+
+    // do *not* save view data when the view is a print preview
+    if ( sViewName.EqualsAscii( "PrintPreview" ) )
+        return;
+
+    // retrieve the view data from the view
+    Sequence< PropertyValue > aViewData;
+    pCurrentShell->WriteUserDataSequence( aViewData );
+
+    try
+    {
+        // retrieve view data (for *all* views) from the model
+        const Reference< XController > xController( pCurrentShell->GetController(), UNO_SET_THROW );
+        const Reference< XViewDataSupplier > xViewDataSupplier( xController->getModel(), UNO_QUERY_THROW );
+        const Reference< XIndexContainer > xViewData( xViewDataSupplier->getViewData(), UNO_QUERY_THROW );
+
+        // look up the one view data item which corresponds to our current view, and remove it
+        const sal_Int32 nCount = xViewData->getCount();
+        for ( sal_Int32 i=0; i<nCount; ++i )
+        {
+            const ::comphelper::NamedValueCollection aViewData( xViewData->getByIndex(i) );
+            ::rtl::OUString sViewId( aViewData.getOrDefault( "ViewId", ::rtl::OUString() ) );
+            if ( sViewId.getLength() == 0 )
+                continue;
+
+            const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId );
+            if ( pViewFactory == NULL )
+                continue;
+
+            if ( pViewFactory->GetOrdinal() == GetCurViewId() )
+            {
+                xViewData->removeByIndex(i);
+                break;
+            }
+        }
+
+        // then replace it with the most recent view data we just obtained
+        xViewData->insertByIndex( 0, makeAny( aViewData ) );
+    }
+    catch( const Exception& )
+    {
+        DBG_UNHANDLED_EXCEPTION();
+    }
+}
+
+//--------------------------------------------------------------------
+
 sal_Bool SfxViewFrame::SwitchToViewShell_Impl
 (
     sal_uInt16  nViewIdOrNo,    /*  > 0
@@ -2304,6 +2370,9 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl
         SfxObjectFactory& rDocFact = GetObjectShell()->GetFactory();
         const USHORT nViewId = ( bIsIndex || !nViewIdOrNo ) ? rDocFact.GetViewFactory( nViewIdOrNo ).GetOrdinal() : nViewIdOrNo;
 
+        // save the view data of the old view, so it can be restored later on (when needed)
+        SaveCurrentViewData_Impl();
+
         // create and load new ViewShell
         SfxViewShell* pNewSh = LoadViewIntoFrame_Impl(
             *GetObjectShell(), 
commit 9af878672298541fbc68457256f72ef03a2a38d6
Author: Hans-Joachim Lankenau <hjs at openoffice.org>
Date:   Wed Sep 1 13:01:03 2010 +0200

    jl158: #i114008# pre-indexing of extension help

diff --git a/xmlhelp/prj/d.lst b/xmlhelp/prj/d.lst
index 1cfa107..ec45189 100644
--- a/xmlhelp/prj/d.lst
+++ b/xmlhelp/prj/d.lst
@@ -4,4 +4,5 @@
 ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.*
 ..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.*
 ..\util\ucpchelp.xml %_DEST%\xml%_EXT%\ucpchelp.xml
+..\util\*.xsl %_DEST%\bin%_EXT%\*.*
 ..\%__SRC%\lib\ihelplinker.lib %_DEST%\lib%_EXT%\ihelplinker.lib
diff --git a/xmlhelp/util/makefile.mk b/xmlhelp/util/makefile.mk
index 1020667..66551f1 100644
--- a/xmlhelp/util/makefile.mk
+++ b/xmlhelp/util/makefile.mk
@@ -74,5 +74,11 @@ DEF1NAME=$(SHL1TARGET)
 
 # --- Targets ----------------------------------------------------------
 
+ZIP1TARGET=helpxsl
+ZIP1FLAGS= -u -r
+#ZIP1DIR=$(PRJ)$/source$/auxiliary
+ZIP1LIST=main_transform*.xsl idxcaption.xsl idxcontent.xsl
+
+
 .INCLUDE: target.mk
 
commit 152a5a2bdc7e3908eaa14e8f232649c98929a9b8
Merge: a1ca8de... faf3732...
Author: Frank Schoenheit [fs] <frank.schoenheit at oracle.com>
Date:   Mon Aug 30 14:10:40 2010 +0200

    dba33h: merge after pulling OOO330.m6

commit a1ca8de0bfb86a277c5526c9b0fa642faa9133b9
Author: Frank Schoenheit [fs] <frank.schoenheit at oracle.com>
Date:   Mon Aug 30 14:08:45 2010 +0200

    dba33h: #i114161#

diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx
index ef6fb38..ed29ae0 100644
--- a/sfx2/source/dialog/taskpane.cxx
+++ b/sfx2/source/dialog/taskpane.cxx
@@ -253,10 +253,11 @@ namespace sfx2
 
         pWindow->SetHelpId( HID_TASKPANE_WINDOW );
         pWindow->SetOutputSizePixel( Size( 300, 450 ) );
-        pWindow->Show();
 
         dynamic_cast< SfxDockingWindow* >( pWindow )->Initialize( i_pInfo );
         SetHideNotDelete( TRUE );
+
+        pWindow->Show();
     }
 
     //------------------------------------------------------------------------------------------------------------------
commit 5dbf2ba7756c79430fd859a8f18f2b6cabcb6808
Author: Ingrid Halama <iha at openoffice.org>
Date:   Fri Aug 27 16:46:26 2010 +0200

    chart50: #i114149# ODF: export missing attribute dimension to element chart:error-indicator

diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 2a89785..7533422 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -3053,6 +3053,10 @@ void SchXMLExportHelper_Impl::exportSeries(
                                 {
                                     // add style name attribute
                                     AddAutoStyleAttribute( aPropertyStates );
+
+                                    const SvtSaveOptions::ODFDefaultVersion nCurrentVersion( SvtSaveOptions().GetODFDefaultVersion() );
+                                    if( nCurrentVersion >= SvtSaveOptions::ODFVER_012 )
+                                        mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_Y );//#i114149#
                                     SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_ERROR_INDICATOR, sal_True, sal_True );
                                 }
                                 else	// autostyles
commit 0a0c59d57568082049b413521621154cc6318181
Author: Frank Schoenheit [fs] <frank.schoenheit at sun.com>
Date:   Fri Aug 27 15:51:44 2010 +0200

    #i111295# getFormattedValue: don't treat non-numeric columns with numeric formats

diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx
index 90bb97a..1f39d6d 100644
--- a/connectivity/source/commontools/formattedcolumnvalue.cxx
+++ b/connectivity/source/commontools/formattedcolumnvalue.cxx
@@ -326,9 +326,16 @@ namespace dbtools
         ::rtl::OUString sStringValue;
         if ( m_pData->m_xColumn.is() )
         {
-            sStringValue = DBTypeConversion::getValue(
-                m_pData->m_xColumn, m_pData->m_xFormatter, m_pData->m_aNullDate, m_pData->m_nFormatKey, m_pData->m_nKeyType
-            );
+            if ( m_pData->m_bNumericField )
+            {
+                sStringValue = DBTypeConversion::getValue(
+                    m_pData->m_xColumn, m_pData->m_xFormatter, m_pData->m_aNullDate, m_pData->m_nFormatKey, m_pData->m_nKeyType
+                );
+            }
+            else
+            {
+                sStringValue = m_pData->m_xColumn->getString();
+            }
         }
         return sStringValue;
     }
commit 4fb9b36c4bda2469de627b8b5081690cf712aa22
Author: Ingrid Halama <iha at openoffice.org>
Date:   Fri Aug 27 15:40:24 2010 +0200

    chart50: #i114142# ODF: don't export invalid content to attribute chart:axis-label-position

diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 13c8e98..5fd38a4 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -3110,6 +3110,9 @@ namespace xmloff { namespace token {
         XML_DIAGONAL_BL_TR_WIDTHS,
         XML_DIAGONAL_TL_BR_WIDTHS,
 
+        XML_OUTSIDE_MINIMUM,//#i114142#
+        XML_OUTSIDE_MAXIMUM,//#i114142#
+
         XML_TOKEN_END
     };
 
diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx
index e52ec47..373a8da 100644
--- a/xmloff/source/chart/PropertyMap.hxx
+++ b/xmloff/source/chart/PropertyMap.hxx
@@ -223,6 +223,8 @@ SvXMLEnumMapEntry aXMLChartAxisLabelPositionEnumMap[] =
     { ::xmloff::token::XML_NEAR_AXIS_OTHER_SIDE,    ::com::sun::star::chart::ChartAxisLabelPosition_NEAR_AXIS_OTHER_SIDE },
     { ::xmloff::token::XML_OUTSIDE_START,	        ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START },
     { ::xmloff::token::XML_OUTSIDE_END,	            ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END },
+    { ::xmloff::token::XML_OUTSIDE_MINIMUM,	        ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START },//#i114142#
+    { ::xmloff::token::XML_OUTSIDE_MAXIMUM,	        ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END },//#i114142#
     { ::xmloff::token::XML_TOKEN_INVALID, 0 }
 };
 
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index fd878dd..25550b1 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3082,8 +3082,8 @@ namespace xmloff { namespace token {
         TOKEN( "axis-label-position",   XML_AXIS_LABEL_POSITION ),
         TOKEN( "near-axis",             XML_NEAR_AXIS ),
         TOKEN( "near-axis-other-side",  XML_NEAR_AXIS_OTHER_SIDE ),
-        TOKEN( "outside-minimum",       XML_OUTSIDE_START ),
-        TOKEN( "outside-maximum",       XML_OUTSIDE_END ),
+        TOKEN( "outside-start",         XML_OUTSIDE_START ),
+        TOKEN( "outside-end",           XML_OUTSIDE_END ),
         TOKEN( "tick-mark-position",    XML_TICK_MARK_POSITION ),
         TOKEN( "at-labels",             XML_AT_LABELS ),
         TOKEN( "at-axis",               XML_AT_AXIS ),
@@ -3110,6 +3110,9 @@ namespace xmloff { namespace token {
         TOKEN( "diagonal-bl-tr-widths", XML_DIAGONAL_BL_TR_WIDTHS ),
         TOKEN( "diagonal-tl-br-widths", XML_DIAGONAL_TL_BR_WIDTHS ),
 
+        TOKEN( "outside-minimum",       XML_OUTSIDE_MINIMUM ),
+        TOKEN( "outside-maximum",       XML_OUTSIDE_MAXIMUM ),
+
 #if OSL_DEBUG_LEVEL > 0
         { 0, NULL, NULL,                       XML_TOKEN_END }
 #else
commit c9da770794b3bcc905d0c14017b768884404aeb3
Merge: 45ba31b... 5fba505...
Author: Frank Schoenheit [fs] <frank.schoenheit at oracle.com>
Date:   Fri Aug 27 15:35:58 2010 +0200

    dba33h: merge after pulling in fs33a

commit 6fe1823a957a23af31b78db424299b985e78a76d
Author: Ingrid Halama <iha at openoffice.org>
Date:   Fri Aug 27 12:58:30 2010 +0200

    chart50: #i113950# ODF: don't export text:id with bad value

diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 6d897c5..2a89785 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -1688,20 +1688,16 @@ void SchXMLExportHelper_Impl::exportTable()
         {
             mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING );
             SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
-            // write the original range name as id into the local table
-            // to allow a correct re-association when copying via clipboard
+            exportText( *aIt );
+            if( nC < nComplexCount )
+                lcl_exportComplexLabel( rComplexColumnDescriptions[nC++], mrExport );
             if( !bHasOwnData && aColumnDescriptions_RangeIter != aColumnDescriptions_RangeEnd )
             {
+                // remind the original range to allow a correct re-association when copying via clipboard
                 if ((*aColumnDescriptions_RangeIter).getLength())
-                {
-                    mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT,
-                        *aColumnDescriptions_RangeIter);
-                }
+                    SchXMLTools::exportRangeToSomewhere( mrExport, *aColumnDescriptions_RangeIter );
                 ++aColumnDescriptions_RangeIter;
             }
-            exportText( *aIt );
-            if( nC < nComplexCount )
-                lcl_exportComplexLabel( rComplexColumnDescriptions[nC++], mrExport );
         }
         OSL_ASSERT( bHasOwnData || aColumnDescriptions_RangeIter == aColumnDescriptions_RangeEnd );
     } // closing row and header-rows elements
@@ -1725,17 +1721,15 @@ void SchXMLExportHelper_Impl::exportTable()
                 SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
                 if( aRowDescriptionsIter != aData.aRowDescriptions.end())
                 {
-                    // write the original range name as id into the local table
-                    // to allow a correct re-association when copying via clipboard
-                    if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd )
-                    {
-                        mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT,
-                            *aRowDescriptions_RangeIter++);
-                    }
                     exportText( *aRowDescriptionsIter );
                     ++aRowDescriptionsIter;
                     if( nC < nComplexCount )
                         lcl_exportComplexLabel( rComplexRowDescriptions[nC++], mrExport );
+                    if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd )
+                    {
+                        // remind the original range to allow a correct re-association when copying via clipboard
+                        SchXMLTools::exportRangeToSomewhere( mrExport, *aRowDescriptions_RangeIter++ );
+                    }
                 }
             }
 
@@ -1748,19 +1742,15 @@ void SchXMLExportHelper_Impl::exportTable()
                 mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT );
                 mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE, msString );
                 SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
-                // write the original range name as id into the local table to
-                // allow a correct re-association when copying via clipboard
+                exportText( msString, false ); // do not convert tabs and lfs
                 if( ( !bHasOwnData && aDataRangeIter != aDataRangeEndIter ) &&
-                    ( mbRowSourceColumns || (aColIt == aRowIt->begin())) )
+                    ( mbRowSourceColumns || (aColIt == aRowIt->begin()) ) )
                 {
+                    // remind the original range to allow a correct re-association when copying via clipboard
                     if ((*aDataRangeIter).getLength())
-                    {
-                        mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT,
-                            *aDataRangeIter);
-                    }
+                        SchXMLTools::exportRangeToSomewhere( mrExport, *aDataRangeIter );
                     ++aDataRangeIter;
                 }
-                exportText( msString, false ); // do not convert tabs and lfs
             }
         }
     }
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index 8c12781..4d6f69a 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -34,6 +34,7 @@
 #include "SchXMLImport.hxx"
 #include "SchXMLTools.hxx"
 #include "transporttypes.hxx"
+#include "XMLStringBufferImportContext.hxx"
 #include <tools/debug.hxx>
 #include <rtl/math.hxx>
 #include "xmlnmspe.hxx"
@@ -687,6 +688,35 @@ SvXMLImportContext* SchXMLTableRowContext::CreateChildContext(
     return pContext;
 }
 
+//---------------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------------
+
+class SchXMLRangeSomewhereContext : public SvXMLImportContext
+{
+//#i113950# previously the range was exported to attribute text:id,
+//but that attribute does not allow arbitrary strings anymore
+//so we need to find an alternative to save that range info for copy/paste scenario ...
+//-> use description at an empty group element for now
+
+private:
+    ::rtl::OUString& mrRangeString;
+    ::rtl::OUStringBuffer maRangeStringBuffer;
+
+public:
+    SchXMLRangeSomewhereContext( SvXMLImport& rImport,
+                            const ::rtl::OUString& rLocalName,
+                            ::rtl::OUString& rRangeString );
+    virtual ~SchXMLRangeSomewhereContext();
+    
+    virtual SvXMLImportContext* CreateChildContext(
+        USHORT nPrefix,
+        const ::rtl::OUString& rLocalName,
+        const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
+    virtual void EndElement();
+};
+
+//---------------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------------
 
 // ========================================
 // classes for cells and their content
@@ -778,11 +808,18 @@ SvXMLImportContext* SchXMLTableCellContext::CreateChildContext(
         pContext = new SchXMLTextListContext( GetImport(), rLocalName, *rCell.pComplexString );
         mbReadText = sal_False;//don't apply text from <text:p>
     }
-    // <text:p> element - read text and range-id
+    // <text:p> element - read text (and range from text:id old version)
     else if( nPrefix == XML_NAMESPACE_TEXT && IsXMLToken( rLocalName, XML_P ) )
     {
         pContext = new SchXMLParagraphContext( GetImport(), rLocalName, maCellContent, &maRangeId );
     }
+    // <draw:g> element - read range
+    else if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_G ) )
+    {
+        //#i113950# previously the range was exported to attribute text:id, but that attribute does not allow arbitrary strings anymore
+        //so we need to find an alternative to save that range info for copy/paste scenario ... -> use description at an empty group element for now
+        pContext = new SchXMLRangeSomewhereContext( GetImport(), rLocalName, maRangeId );
+    }
     else
     {
         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
@@ -1148,3 +1185,34 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary(
     }
 }
 
+//---------------------------------------------------------------------------------------------------
+
+SchXMLRangeSomewhereContext::SchXMLRangeSomewhereContext( SvXMLImport& rImport,
+                                                const OUString& rLocalName,
+                                                OUString& rRangeString ) :
+        SvXMLImportContext( rImport, XML_NAMESPACE_TEXT, rLocalName ),
+        mrRangeString( rRangeString )
+{
+}
+
+SchXMLRangeSomewhereContext::~SchXMLRangeSomewhereContext()
+{
+}
+
+SvXMLImportContext* SchXMLRangeSomewhereContext::CreateChildContext(
+    USHORT nPrefix,
+    const OUString& rLocalName,

... etc. - the rest is truncated


More information about the ooo-build-commit mailing list