[Libreoffice-commits] .: Branch 'distro/suse/suse-3.6-appup' - 37 commits - bin/lo-commit-stat chart2/source connectivity/source desktop/source editeng/source i18npool/source instsetoo_native/util oox/inc oox/source reportdesign/source sc/inc sc/qa sc/source sd/source solenv/inc sot/qa sot/source sw/inc sw/qa sw/source vcl/inc vcl/source writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Jan 13 13:02:30 PST 2013


 bin/lo-commit-stat                                           |  188 +++++++----
 chart2/source/controller/dialogs/res_DataLabel.cxx           |    9 
 chart2/source/controller/main/ChartController_Properties.cxx |    2 
 chart2/source/view/charttypes/PieChart.cxx                   |   10 
 connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx   |    2 
 desktop/source/deployment/gui/dp_gui_service.cxx             |   16 
 desktop/source/deployment/inc/dp_misc.h                      |    8 
 desktop/source/deployment/misc/dp_misc.cxx                   |   25 +
 desktop/source/pkgchk/unopkg/unopkg_app.cxx                  |   42 --
 desktop/source/pkgchk/unopkg/unopkg_misc.cxx                 |   15 
 desktop/source/pkgchk/unopkg/unopkg_shared.h                 |   32 -
 editeng/source/editeng/editdoc.hxx                           |    2 
 editeng/source/editeng/impedit3.cxx                          |    6 
 i18npool/source/localedata/data/hr_HR.xml                    |    2 
 i18npool/source/localedata/data/no_NO.xml                    |    4 
 i18npool/source/localedata/data/tr_TR.xml                    |   20 -
 instsetoo_native/util/openoffice.lst                         |   22 -
 oox/inc/oox/core/xmlfilterbase.hxx                           |    2 
 oox/source/core/xmlfilterbase.cxx                            |    2 
 oox/source/vml/vmlshape.cxx                                  |    8 
 oox/source/vml/vmltextboxcontext.cxx                         |    8 
 reportdesign/source/core/inc/ReportHelperImpl.hxx            |   18 -
 sc/inc/dpsave.hxx                                            |    2 
 sc/qa/unit/ucalc.cxx                                         |   29 +
 sc/source/core/data/dpobject.cxx                             |   12 
 sc/source/core/data/dpsave.cxx                               |   37 ++
 sc/source/filter/oox/excelfilter.cxx                         |    9 
 sc/source/filter/oox/workbookhelper.cxx                      |    7 
 sc/source/ui/view/dbfunc3.cxx                                |   43 --
 sd/source/ui/view/sdview4.cxx                                |    2 
 solenv/inc/minor.mk                                          |    4 
 sot/qa/cppunit/data/pass/fdo57532-1.compound                 |binary
 sot/source/sdstor/stgelem.cxx                                |    2 
 sw/inc/iodetect.hxx                                          |    3 
 sw/inc/shellres.hxx                                          |    2 
 sw/qa/core/macros-test.cxx                                   |   43 ++
 sw/source/core/doc/notxtfrm.cxx                              |    2 
 sw/source/core/inc/cellfrm.hxx                               |    2 
 sw/source/core/inc/flyfrm.hxx                                |    2 
 sw/source/core/inc/frame.hxx                                 |    2 
 sw/source/core/inc/layfrm.hxx                                |    2 
 sw/source/core/inc/notxtfrm.hxx                              |    2 
 sw/source/core/inc/pagefrm.hxx                               |    2 
 sw/source/core/inc/rootfrm.hxx                               |    2 
 sw/source/core/inc/txtfrm.hxx                                |    2 
 sw/source/core/layout/tabfrm.cxx                             |    4 
 sw/source/core/layout/trvlfrm.cxx                            |  102 ++++-
 sw/source/core/layout/unusedf.cxx                            |    2 
 sw/source/core/text/frmcrsr.cxx                              |    2 
 sw/source/core/unocore/unodraw.cxx                           |   52 +--
 sw/source/filter/basflt/iodetect.cxx                         |   15 
 sw/source/ui/uiview/formatclipboard.cxx                      |   10 
 sw/source/ui/uno/swdet2.cxx                                  |    2 
 sw/source/ui/utlui/initui.cxx                                |    8 
 vcl/inc/vcl/wrkwin.hxx                                       |   24 -
 vcl/source/window/wrkwin.cxx                                 |   16 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx            |    9 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx               |    2 
 58 files changed, 584 insertions(+), 320 deletions(-)

New commits:
commit 2dde9903967edaf903ddcdb121668e2c03dc7879
Author: Petr Mladek <pmladek at suse.cz>
Date:   Fri Dec 14 16:04:11 2012 +0100

    bump product version to 3.6-4, release number to 304
    
    Change-Id: Ie714cc4dbac052f5b74b63402d60248af66d9d6c

diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst
index 60d3b4d..00eb2e2 100644
--- a/instsetoo_native/util/openoffice.lst
+++ b/instsetoo_native/util/openoffice.lst
@@ -51,13 +51,13 @@ LibreOffice
             PRODUCTVERSION 3.6
             PRODUCTEXTENSION
             LONG_PRODUCTEXTENSION
-            SHORT_PRODUCTEXTENSION -3
+            SHORT_PRODUCTEXTENSION -4
             POSTVERSIONEXTENSION
             POSTVERSIONEXTENSIONUNIX
             BRANDPACKAGEVERSION 3.6
             USERDIRPRODUCTVERSION 3
             ABOUTBOXPRODUCTVERSION 3.6
-            ABOUTBOXPRODUCTVERSIONSUFFIX :build-303
+            ABOUTBOXPRODUCTVERSIONSUFFIX :build-304
             BASEPRODUCTVERSION 3.6
             PCPFILENAME libreoffice.pcp
             UPDATEURL http://update.libreoffice.org/check.php
@@ -103,14 +103,14 @@ LibreOffice_Dev
             PRODUCTVERSION 3.6
             PRODUCTEXTENSION
             LONG_PRODUCTEXTENSION
-            SHORT_PRODUCTEXTENSION -3
+            SHORT_PRODUCTEXTENSION -4
             UNIXBASISROOTNAME lodev3.6
             POSTVERSIONEXTENSION
             POSTVERSIONEXTENSIONUNIX
             BRANDPACKAGEVERSION 3.6
             USERDIRPRODUCTVERSION 3
             ABOUTBOXPRODUCTVERSION 3.6
-            ABOUTBOXPRODUCTVERSIONSUFFIX :build-303
+            ABOUTBOXPRODUCTVERSIONSUFFIX :build-304
             BASEPRODUCTVERSION 3.6
             DEVELOPMENTPRODUCT 1
             BASISPACKAGEPREFIX lodevbasis
@@ -167,7 +167,7 @@ URE
             PRODUCTEXTENSION
             BRANDPACKAGEVERSION 3.6
             LONG_PRODUCTEXTENSION
-            SHORT_PRODUCTEXTENSION -3
+            SHORT_PRODUCTEXTENSION -4
             LICENSENAME LGPL
             NOVERSIONINDIRNAME 1
             PCPFILENAME ure.pcp
@@ -199,7 +199,7 @@ LibreOffice_SDK
             PRODUCTVERSION 3.6
             PRODUCTEXTENSION
             LONG_PRODUCTEXTENSION
-            SHORT_PRODUCTEXTENSION -3
+            SHORT_PRODUCTEXTENSION -4
             POSTVERSIONEXTENSION SDK
             POSTVERSIONEXTENSIONUNIX sdk
             BRANDPACKAGEVERSION 3.6
@@ -240,7 +240,7 @@ LibreOffice_Dev_SDK
             PRODUCTVERSION 3.6
             PRODUCTEXTENSION
             LONG_PRODUCTEXTENSION
-            SHORT_PRODUCTEXTENSION -3
+            SHORT_PRODUCTEXTENSION -4
             UNIXBASISROOTNAME lodev3.6
             POSTVERSIONEXTENSION SDK
             POSTVERSIONEXTENSIONUNIX sdk
@@ -287,7 +287,7 @@ LibreOffice_Test
             PRODUCTVERSION 3.6
             PRODUCTEXTENSION
             LONG_PRODUCTEXTENSION
-            SHORT_PRODUCTEXTENSION -3
+            SHORT_PRODUCTEXTENSION -4
             POSTVERSIONEXTENSION TEST
             POSTVERSIONEXTENSIONUNIX test
             BRANDPACKAGEVERSION 3.6
@@ -328,7 +328,7 @@ LibreOffice_Dev_Test
             PRODUCTVERSION 3.6
             PRODUCTEXTENSION
             LONG_PRODUCTEXTENSION
-            SHORT_PRODUCTEXTENSION -3
+            SHORT_PRODUCTEXTENSION -4
             UNIXBASISROOTNAME lodev3.6
             POSTVERSIONEXTENSION TEST
             POSTVERSIONEXTENSIONUNIX test
@@ -374,13 +374,13 @@ OxygenOffice
             PRODUCTVERSION 3.6
             PRODUCTEXTENSION
             LONG_PRODUCTEXTENSION
-            SHORT_PRODUCTEXTENSION -3
+            SHORT_PRODUCTEXTENSION -4
             POSTVERSIONEXTENSION
             POSTVERSIONEXTENSIONUNIX
             BRANDPACKAGEVERSION 3.6
             USERDIRPRODUCTVERSION 3
             ABOUTBOXPRODUCTVERSION 3.6
-            ABOUTBOXPRODUCTVERSIONSUFFIX :build-303
+            ABOUTBOXPRODUCTVERSIONSUFFIX :build-304
             BASEPRODUCTVERSION 3.6
             PCPFILENAME openoffice.pcp
             UPDATEURL http://update.libreoffice.org/check.php
diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk
index ba6f12c..fbed4dd 100644
--- a/solenv/inc/minor.mk
+++ b/solenv/inc/minor.mk
@@ -1,6 +1,6 @@
 RSCVERSION=360
-RSCREVISION=360m1(Build:303)
-BUILD=303
+RSCREVISION=360m1(Build:304)
+BUILD=304
 LAST_MINOR=m1
 SOURCEVERSION=OOO360
 
commit eb06a295599d218f4b91211a73eb674e845a40c1
Author: Noel Power <noel.power at suse.com>
Date:   Thu Dec 13 16:52:50 2012 +0000

    fix sometimes data corruption with xlsx import ( with scenario sheets )
    
    formula import is buffered 'till the end of import. The processing of the
    formula data need to happen before the scenario import happens. This is
    necessary because sheet numbers stored in the formula addresses can become
    invalid as scenario import insertes new hidden sheets upsetting the previous
    table order
    
    Change-Id: I9357f028f31bec1b1504ca991f5534f80d79c9bc

diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 071b9a6..dce942c 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -591,11 +591,6 @@ void WorkbookGlobals::finalize()
         // #i79826# enable updating automatic row height after loading the document
         aPropSet.setProperty( PROP_IsAdjustHeightEnabled, true );
 
-        getFormulaBuffer().finalizeImport();
-
-        // hack, setting it true the second time will delete the cache
-        aPropSet.setProperty( PROP_IsAdjustHeightEnabled, true );
-
         // Insert all pivot tables. Must be done after loading all sheets and
         // formulas, because data pilots expect existing source data on
         // creation.
@@ -667,6 +662,8 @@ void WorkbookHelper::finalizeWorkbookImport()
     mrBookGlob.getWorkbookSettings().finalizeImport();
     mrBookGlob.getViewSettings().finalizeImport();
 
+    // need to import formulas before scenarios
+    mrBookGlob.getFormulaBuffer().finalizeImport();
     /*  Insert scenarios after all sheet processing is done, because new hidden
         sheets are created for scenarios which would confuse code that relies
         on certain sheet indexes. Must be done after pivot tables too. */
commit be3fc27ff3e52cf041f0c8f72035b83044704d8e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Dec 13 01:28:59 2012 +0100

    fdo#58142: fix frame selection in SwPageFrm::GetCrsrOfst:
    
    The function does not handle the case where a paragraph was hit but no
    background frame was hit properly, which may or may not (depending on
    the platform) cause it to return a position of a frame when that is
    undesirable, such as when called from SwWrtShell::UnSelectFrm().
    
    When UnselectFrm() leaves a frame selected pasting multiple pictures
    leads to a crash.
    
    (regression from e8fbe97900f13305b17015d9044993bde4adab36)
    
    Change-Id: I3604825f654c523a37f47a9fc660647d8b3e7077
    (cherry picked from commit 2fc4af311656e7d019ca802d23444e5161f820ee)
    Reviewed-on: https://gerrit.libreoffice.org/1314
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 2ffc033..ee907cd 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -275,8 +275,12 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
         if ( ( bTestBackground && bBackRet ) || !bTextRet )
         {
             bRet = bBackRet;
-            pPos->nNode = aBackPos.nNode;
-            pPos->nContent = aBackPos.nContent;
+            (*pPos) = aBackPos;
+        }
+        else if (bTextRet && !bBackRet)
+        {
+            bRet = bTextRet;
+            (*pPos) = aTextPos;
         }
         else
         {
@@ -314,14 +318,12 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
             if ( bValidTextDistance && bValidBackDistance && basegfx::fTools::more( nTextDistance, nBackDistance ) )
             {
                 bRet = bBackRet;
-                pPos->nNode = aBackPos.nNode;
-                pPos->nContent = aBackPos.nContent;
+                (*pPos) = aBackPos;
             }
             else
             {
                 bRet = bTextRet;
-                pPos->nNode = aTextPos.nNode;
-                pPos->nContent = aTextPos.nContent;
+                (*pPos) = aTextPos;
             }
         }
     }
commit 5dd06e066e202dd68676cd63612f37a717621512
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jul 5 21:37:49 2012 +0100

    Resolves: fdo#49587 apparent loop in style hierarchy
    
    Change-Id: I32317a1a6500377f7e7bb98d1dcc65ad86feb9a2
    (cherry picked from commit 7e3923520c27ff139bc3abab35a1c01e1a785fb1)
    
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 4cc997b..5c760e4 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -588,7 +588,14 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId)
             }
         }
         //search until the property is set or no parent is available
-        pEntry = GetStyleSheetTable()->FindParentStyleSheet(pEntry->sBaseStyleIdentifier);
+        StyleSheetEntryPtr pNewEntry = GetStyleSheetTable()->FindParentStyleSheet(pEntry->sBaseStyleIdentifier);
+
+        SAL_WARN_IF( pEntry == pNewEntry, "writerfilter", "circular loop in style hierarchy?");
+
+        if (pEntry == pNewEntry) //fdo#49587
+            break;
+
+        pEntry = pNewEntry;
     }
     return uno::Any();
 }
commit 34f84a3be08846ca75629cd1ba9e17655bb19fc2
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Dec 10 20:52:55 2012 +0100

    fdo#57780: sw: lcl_ArrangeLowers: register drawing ...
    
    ... objects at the right page.  This was effectively disabled for all
    anchor types except FLY_AT_PARA by a misplaced ! in the conditional,
    and C++ not being a type safe language.
    
    Change-Id: I64af2141e577ac896292eecd9f8c46c62a0548db
    (cherry picked from commit c479ccc438edeb7197a2d05bdb99067365d7bac0)
    Reviewed-on: https://gerrit.libreoffice.org/1290
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index a008a13..39dad68 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -4832,8 +4832,8 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
                         if ( pTabFrm &&
                              !( pTabFrm->IsFollow() &&
                                 pTabFrm->FindMaster()->IsRebuildLastLine() ) &&
-                             !pAnchoredObj->GetFrmFmt().GetAnchor().GetAnchorId()
-                                                            == FLY_AS_CHAR )
+                            (pAnchoredObj->GetFrmFmt().GetAnchor().GetAnchorId()
+                                                            != FLY_AS_CHAR))
                         {
                             SwPageFrm* pPageFrm = pAnchoredObj->GetPageFrm();
                             SwPageFrm* pPageOfAnchor = pFrm->FindPageFrm();
commit a317e159fdcb536cee470d81c4b39cc278d7ba00
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Dec 10 14:36:31 2012 +0100

    fdo#52240 added [hr-HR] date acceptance patterns D/M/Y;D/M
    
    As per https://bugs.freedesktop.org/show_bug.cgi?id=52240#c59
    
    (cherry picked from commit b1184f8a4e4a3949d38407c5f1d5155c2c2b42d5)
    
    Change-Id: I83afc59e4ac71b18219ace60dcbcabafebd5b525
    Reviewed-on: https://gerrit.libreoffice.org/1288
    Reviewed-by: Kohei Yoshida <kohei.yoshida at gmail.com>
    Tested-by: Kohei Yoshida <kohei.yoshida at gmail.com>

diff --git a/i18npool/source/localedata/data/hr_HR.xml b/i18npool/source/localedata/data/hr_HR.xml
index e5a05424..b9e25e7 100644
--- a/i18npool/source/localedata/data/hr_HR.xml
+++ b/i18npool/source/localedata/data/hr_HR.xml
@@ -36,6 +36,8 @@
   </LC_CTYPE>
   <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$kn-41A]">
     <DateAcceptancePattern>D.M</DateAcceptancePattern>
+    <DateAcceptancePattern>D/M/Y</DateAcceptancePattern>
+    <DateAcceptancePattern>D/M</DateAcceptancePattern>
     <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34">
       <FormatCode>MM.YY</FormatCode>
     </FormatElement>
commit 0ac2873c66db577a60d57f375b2bb0500125abc5
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Dec 10 14:29:03 2012 +0100

    fdo#52240 added [no-NO] date acceptance patterns D.M;D/M/Y;D/M;D/M Y
    
    Also referenced by nb-NO and ny-NO
    Changes as per http://erack.org/blog/archives/18-comments.html#c351
    
    Change-Id: I9e07f4307800e99fdff21bccde91af4178b244f3
    (cherry picked from commit 638993d9b80b3793dfd31db0dacba3746ceb98fd)
    Reviewed-on: https://gerrit.libreoffice.org/1287
    Reviewed-by: Kohei Yoshida <kohei.yoshida at gmail.com>
    Tested-by: Kohei Yoshida <kohei.yoshida at gmail.com>

diff --git a/i18npool/source/localedata/data/no_NO.xml b/i18npool/source/localedata/data/no_NO.xml
index 2c01a21..beaf7a7 100644
--- a/i18npool/source/localedata/data/no_NO.xml
+++ b/i18npool/source/localedata/data/no_NO.xml
@@ -35,6 +35,10 @@
     <MeasurementSystem>Metric</MeasurementSystem>
   </LC_CTYPE>
   <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$kr-14]">
+    <DateAcceptancePattern>D.M</DateAcceptancePattern>
+    <DateAcceptancePattern>D/M/Y</DateAcceptancePattern>
+    <DateAcceptancePattern>D/M</DateAcceptancePattern>
+    <DateAcceptancePattern>D/M Y</DateAcceptancePattern>
     <FormatElement msgid="DateFormatskey1" default="true" type="short" usage="DATE" formatindex="18">
       <FormatCode>DD.MM.YY</FormatCode>
     </FormatElement>
commit 645fc0ce677a4da7f175419b950b12e2eae76f84
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 30 17:11:59 2012 +0100

    Resolves: fdo#51638 In "unopkg gui" dispose component context from DeInitVCL
    
    ...the same way it is done in soffice.bin.  framework's Desktop::dispose()
    requires the solar mutex to be still alive, which is destroyed in DeInitVCL, so
    if the component context/service manager is only disposed afterwards, the solar
    mutex is already gone.
    
    This required moving disposeBridges() around, but it allowed to get rid of
    DisposeGuard.
    
    (cherry picked from commit 37cc83e594fa8ca131fc5fb98506287b7daedffd)
    
    Conflicts:
    	desktop/source/pkgchk/unopkg/unopkg_app.cxx
    	desktop/source/pkgchk/unopkg/unopkg_shared.h
    
    Change-Id: Ibec3d19040fdae23f492cd1e29084e673403e00b
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx
index 71c6ccd..cec91ad 100644
--- a/desktop/source/deployment/gui/dp_gui_service.cxx
+++ b/desktop/source/deployment/gui/dp_gui_service.cxx
@@ -33,6 +33,7 @@
 #include "cppuhelper/implbase2.hxx"
 #include "cppuhelper/implementationentry.hxx"
 #include "unotools/configmgr.hxx"
+#include "comphelper/processfactory.hxx"
 #include "comphelper/servicedecl.hxx"
 #include "comphelper/unwrapargs.hxx"
 #include <i18npool/mslangid.hxx>
@@ -47,6 +48,8 @@
 #include "license_dialog.hxx"
 #include "dp_gui_dialog2.hxx"
 #include "dp_gui_extensioncmdqueue.hxx"
+#include <ucbhelper/contentbroker.hxx>
+
 
 using namespace ::dp_misc;
 using namespace ::com::sun::star;
@@ -66,6 +69,7 @@ public:
 
     // Application
     virtual int Main();
+    virtual void DeInit();
 };
 
 //______________________________________________________________________________
@@ -85,6 +89,18 @@ int MyApp::Main()
 }
 
 
+void MyApp::DeInit()
+{
+    if (::ucbhelper::ContentBroker::get())
+        ::ucbhelper::ContentBroker::deinitialize();
+    css::uno::Reference< css::uno::XComponentContext > context(
+        comphelper::getProcessComponentContext());
+    dp_misc::disposeBridges(context);
+    css::uno::Reference< css::lang::XComponent >(
+        context, css::uno::UNO_QUERY_THROW)->dispose();
+    comphelper::setProcessServiceFactory(0);
+}
+
 namespace
 {
     struct ProductName
diff --git a/desktop/source/deployment/inc/dp_misc.h b/desktop/source/deployment/inc/dp_misc.h
index 06e67aa..b95a64c 100644
--- a/desktop/source/deployment/inc/dp_misc.h
+++ b/desktop/source/deployment/inc/dp_misc.h
@@ -159,6 +159,14 @@ void syncRepositories(
     ::com::sun::star::uno::Reference<
         ::com::sun::star::ucb::XCommandEnvironment> const & xCmdEnv);
 
+/** workaround: for some reason the bridge threads which communicate with the
+    uno.exe process are not released on time
+*/
+DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
+void disposeBridges(
+    com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+        const & ctx);
+
 }
 
 #endif
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index 9ed579f..00fd352 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -43,6 +43,7 @@
 #include "osl/mutex.hxx"
 #include "com/sun/star/ucb/CommandAbortedException.hpp"
 #include "com/sun/star/task/XInteractionHandler.hpp"
+#include "com/sun/star/bridge/XBridgeFactory.hpp"
 #include "com/sun/star/bridge/UnoUrlResolver.hpp"
 #include "com/sun/star/bridge/XUnoUrlResolver.hpp"
 #include "com/sun/star/deployment/ExtensionManager.hpp"
@@ -631,7 +632,31 @@ void syncRepositories(
      }
 }
 
+void disposeBridges(Reference<css::uno::XComponentContext> const & ctx)
+{
+    if (!ctx.is())
+        return;
 
+    Reference<css::bridge::XBridgeFactory> bridgeFac(
+        ctx->getServiceManager()->createInstanceWithContext(
+            OUSTR("com.sun.star.bridge.BridgeFactory"), ctx),
+        UNO_QUERY_THROW);
+
+    const Sequence< Reference<css::bridge::XBridge> >seqBridges = bridgeFac->getExistingBridges();
+    for (sal_Int32 i = 0; i < seqBridges.getLength(); i++)
+    {
+        Reference<css::lang::XComponent> comp(seqBridges[i], UNO_QUERY);
+        if (comp.is())
+        {
+            try {
+                comp->dispose();
+            }
+            catch ( const css::lang::DisposedException& )
+            {
+            }
+        }
+    }
+}
 
 }
 
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index ef16ea1..938591a 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -48,7 +48,6 @@
 
 #include "com/sun/star/deployment/ui/PackageManagerDialog.hpp"
 #include "com/sun/star/ui/dialogs/XExecutableDialog.hpp"
-#include "com/sun/star/lang/DisposedException.hpp"
 #include "boost/scoped_array.hpp"
 #include "com/sun/star/ui/dialogs/XDialogClosedListener.hpp"
 #include "com/sun/star/bridge/XBridgeFactory.hpp"
@@ -189,42 +188,9 @@ Reference<deployment::XPackage> findPackage(
 
 } // anon namespace
 
-
-//workaround for some reason the bridge threads which communicate with the uno.exe
-//process are not releases on time
-void disposeBridges(Reference<css::uno::XComponentContext> ctx)
-{
-    if (!ctx.is())
-        return;
-
-    Reference<css::bridge::XBridgeFactory> bridgeFac(
-        ctx->getServiceManager()->createInstanceWithContext(
-            OUSTR("com.sun.star.bridge.BridgeFactory"), ctx),
-        UNO_QUERY);
-
-    if (bridgeFac.is())
-    {
-        const Sequence< Reference<css::bridge::XBridge> >seqBridges = bridgeFac->getExistingBridges();
-        for (sal_Int32 i = 0; i < seqBridges.getLength(); i++)
-        {
-            Reference<css::lang::XComponent> comp(seqBridges[i], UNO_QUERY);
-            if (comp.is())
-            {
-                try {
-                    comp->dispose();
-                }
-                catch ( const css::lang::DisposedException& )
-                {
-                }
-            }
-        }
-    }
-}
-
 extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
 {
     tools::extendApplicationEnvironment();
-    DisposeGuard disposeGuard;
     bool bNoOtherErrorMsg = false;
     OUString subCommand;
     bool option_shared = false;
@@ -376,8 +342,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
         }
 
         xComponentContext = getUNO(
-            disposeGuard, option_verbose, option_shared, subcmd_gui,
-            xLocalComponentContext );
+            option_verbose, option_shared, subcmd_gui, xLocalComponentContext );
 
         Reference<deployment::XExtensionManager> xExtensionManager(
             deployment::ExtensionManager::get( xComponentContext ) );
@@ -580,6 +545,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
 
             xDialog->startExecuteModal(xListener);
             dialogEnded.wait();
+            return 0;
         }
         else
         {
@@ -596,7 +562,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
         if (option_verbose)
             dp_misc::writeConsole(OUSTR("\n" APP_NAME " done.\n"));
         //Force to release all bridges which connect us to the child processes
-        disposeBridges(xLocalComponentContext);
+        dp_misc::disposeBridges(xLocalComponentContext);
         return 0;
     }
     catch (const ucb::CommandFailedException &e)
@@ -645,7 +611,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
     }
     if (!bNoOtherErrorMsg)
         dp_misc::writeConsoleError("\n" APP_NAME " failed.\n");
-    disposeBridges(xLocalComponentContext);
+    dp_misc::disposeBridges(xLocalComponentContext);
     return 1;
 }
 
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index 52b4ab8..4b1da99 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -364,21 +364,14 @@ void printf_packages(
     }
 }
 
-
-
 namespace {
 
 //------------------------------------------------------------------------------
-Reference<XComponentContext> bootstrapStandAlone(
-    DisposeGuard & disposeGuard, bool /*verbose */)
+Reference<XComponentContext> bootstrapStandAlone()
 {
     Reference<XComponentContext> xContext =
         ::cppu::defaultBootstrap_InitialComponentContext();
 
-    // assure disposing of local component context:
-    disposeGuard.reset(
-        Reference<lang::XComponent>( xContext, UNO_QUERY ) );
-
     Reference<lang::XMultiServiceFactory> xServiceManager(
         xContext->getServiceManager(), UNO_QUERY_THROW );
     // set global process service factory used by unotools config helpers
@@ -392,7 +385,6 @@ Reference<XComponentContext> bootstrapStandAlone(
     if (! ::ucbhelper::ContentBroker::initialize( xServiceManager, ucb_args ))
         throw RuntimeException( OUSTR("cannot initialize UCB!"), 0 );
 
-    disposeGuard.setDeinitUCB();
     return xContext;
 }
 
@@ -468,7 +460,7 @@ OUString getLockFilePath()
 }
 //==============================================================================
 Reference<XComponentContext> getUNO(
-    DisposeGuard & disposeGuard, bool verbose, bool shared, bool bGui,
+    bool verbose, bool shared, bool bGui,
     Reference<XComponentContext> & out_localContext)
 {
     // do not create any user data (for the root user) in --shared mode:
@@ -480,8 +472,7 @@ Reference<XComponentContext> getUNO(
 
     // hold lock during process runtime:
     static ::desktop::Lockfile s_lockfile( false /* no IPC server */ );
-    Reference<XComponentContext> xComponentContext(
-        bootstrapStandAlone( disposeGuard, verbose ) );
+    Reference<XComponentContext> xComponentContext( bootstrapStandAlone() );
     out_localContext = xComponentContext;
     if (::dp_misc::office_is_running()) {
         xComponentContext.set(
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index 400e283..a592f46 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -28,7 +28,6 @@
 
 #include "dp_misc.h"
 #include "com/sun/star/uno/Exception.hpp"
-#include "com/sun/star/lang/XComponent.hpp"
 #include "com/sun/star/uno/XComponentContext.hpp"
 #include "com/sun/star/ucb/XCommandEnvironment.hpp"
 #include "com/sun/star/deployment/XPackage.hpp"
@@ -123,35 +122,6 @@ bool isBootstrapVariable(sal_uInt32 * pIndex);
 //##############################################################################
 
 //==============================================================================
-class DisposeGuard
-{
-    css::uno::Reference<css::lang::XComponent> m_xComp;
-    bool m_bDeinitUCB;
-public:
-    DisposeGuard(): m_bDeinitUCB(false) {}
-    inline ~DisposeGuard()
-    {
-        if (m_bDeinitUCB)
-            ::ucbhelper::ContentBroker::deinitialize();
-
-        if (m_xComp.is())
-            m_xComp->dispose();
-    }
-
-    inline void reset(
-        css::uno::Reference<css::lang::XComponent> const & xComp )
-    {
-        m_xComp = xComp;
-    }
-
-    inline void setDeinitUCB()
-    {
-        m_bDeinitUCB = true;
-    }
-
-};
-
-//==============================================================================
 css::uno::Reference<css::ucb::XCommandEnvironment> createCmdEnv(
     css::uno::Reference<css::uno::XComponentContext> const & xContext,
     ::rtl::OUString const & logFile,
@@ -170,7 +140,7 @@ void printf_packages(
 
 //==============================================================================
 css::uno::Reference<css::uno::XComponentContext> getUNO(
-    DisposeGuard & disposeGuard, bool verbose, bool shared, bool bGui,
+    bool verbose, bool shared, bool bGui,
     css::uno::Reference<css::uno::XComponentContext> & out_LocalComponentContext);
 
 }
commit 1ee11a24aa30b498c0c2d741bee2085de55e69b6
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Dec 7 12:23:21 2012 +0100

    fdo#55289: fix crash in SwXShape::setPropertyValue:
    
    In the libreoffice-3-6 branch the docx import crashes here when setting
    the anchor position of a shape, because the previous setting of the
    AnchorType was not done properly: the position of the anchor in the
    SwFmt did not match the actual position of the text attribute, so we get
    these assertions: "Missing FlyInCnt-Hint." and crash.
    
    This cannot be reproduced with the docx import on master, because on
    master a different intermediate AnchorType is set, and transitioning
    from that happens not to cause the crash.  But it can be reproduced with
    a unit test.
    
    The regression was introduced in libreoffice-3-6 with
    backport commit bbbb10a0774b9da546557632cd09c4f6958f8939.
    
    Change-Id: I394643e11862543177ba57958a26cd8ce06dc09c
    (cherry picked from commit 01cd24df1ec7eaa53e9e2156d4d6890a7cc5996a)
    Reviewed-on: https://gerrit.libreoffice.org/1264
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index 3f9262e..cbabeaf 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -37,8 +37,15 @@
 #include <com/sun/star/frame/XDesktop.hpp>
 
 #include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/frame/XComponentLoader.hpp>
 #include <com/sun/star/document/MacroExecMode.hpp>
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
 
 #include <sfx2/app.hxx>
 #include <sfx2/docfilt.hxx>
@@ -48,6 +55,7 @@
 
 #include <basic/sbxdef.hxx>
 
+#include <doc.hxx>
 #include "docsh.hxx"
 
 SO2_DECL_REF(SwDocShell)
@@ -73,6 +81,7 @@ public:
 
     //void testStarBasic();
     void testVba();
+    void testFdo55289();
     CPPUNIT_TEST_SUITE(SwMacrosTest);
 #if !defined(MACOSX) && !defined(WNT)
     //enable this test if you want to play with star basic macros in unit tests
@@ -80,6 +89,7 @@ public:
     //CPPUNIT_TEST(testStarBasic);
     CPPUNIT_TEST(testVba);
 #endif
+    CPPUNIT_TEST(testFdo55289);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -162,6 +172,39 @@ void SwMacrosTest::testVba()
     }
 }
 
+void SwMacrosTest::testFdo55289()
+{
+    SwDoc *const pDoc = new SwDoc;
+    SwDocShellRef pDocShell = new SwDocShell(pDoc, SFX_CREATE_MODE_EMBEDDED);
+    // this needs to run with no layout to tickle the bugs in the special
+    // cases in SwXShape re-anchoring
+    assert(!pDoc->GetCurrentLayout());
+
+    uno::Reference<frame::XModel> const xModel(pDocShell->GetModel());
+    uno::Reference<drawing::XDrawPageSupplier> const xDPS(xModel, UNO_QUERY);
+    uno::Reference<drawing::XShapes> const xShapes(xDPS->getDrawPage(),
+            UNO_QUERY);
+    uno::Reference<beans::XPropertySet> const xShape(
+        uno::Reference<lang::XMultiServiceFactory>(xModel, UNO_QUERY)->
+            createInstance("com.sun.star.drawing.GraphicObjectShape"),
+        UNO_QUERY);
+    xShape->setPropertyValue("AnchorType",
+            makeAny(text::TextContentAnchorType_AT_PAGE));
+    xShapes->add(uno::Reference<drawing::XShape>(xShape, UNO_QUERY));
+    xShape->setPropertyValue("AnchorType",
+            makeAny(text::TextContentAnchorType_AT_CHARACTER));
+    xShape->setPropertyValue("AnchorType",
+            makeAny(text::TextContentAnchorType_AS_CHARACTER));
+    xShape->setPropertyValue("AnchorType",
+            makeAny(text::TextContentAnchorType_AT_CHARACTER));
+    xShape->setPropertyValue("AnchorType",
+            makeAny(text::TextContentAnchorType_AS_CHARACTER));
+    uno::Reference<text::XTextRange> const xEnd =
+        uno::Reference<text::XTextDocument>(xModel, UNO_QUERY)->getText()->getEnd();
+    uno::Reference<text::XTextContent> const xShapeContent(xShape, UNO_QUERY);
+    xShapeContent->attach(xEnd);
+}
+
 SwMacrosTest::SwMacrosTest()
       : m_aBaseString(RTL_CONSTASCII_USTRINGPARAM("/sw/qa/core/data"))
 {
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 1bf4b20..b8b5663 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1382,7 +1382,12 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
                             SwFmtFlyCnt aFmt( pFlyFmt );
                             pNd->InsertItem(aFmt,
                                 aPam.GetPoint()->nContent.GetIndex(), 0 );
-                            //aPam.GetPoint()->nContent--;
+                            aPam.GetPoint()->nContent--; // InsertItem moved it
+                            SwFmtAnchor aNewAnchor(
+                                dynamic_cast<const SwFmtAnchor&>(
+                                    aSet.Get(RES_ANCHOR)));
+                            aNewAnchor.SetAnchor( aPam.GetPoint() );
+                            aSet.Put( aNewAnchor );
                         }
                         if( bSetAttr )
                             pFmt->SetFmtAttr(aSet);
commit 5af027dbea69d9159b000c2bac41433d50b250a0
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Wed Jun 6 20:29:57 2012 +0200

    handle properly anchor transition at page->at paragraph->as character
    
    Otherwise setting text range afterwards crashes with pHnt being NULL.
    
    Change-Id: Ib4ac2712c061605dcaaa262280c0307f7a9af2ce
    (cherry picked from commit 5de61f7a4ddb502730454e4bf3232f7f4b4175e1)
    
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 6cf0c6d..1bf4b20 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1360,18 +1360,29 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
                             aSet.Put( aNewAnchor );
                             pFmt->SetFmtAttr(aSet);
                             bSetAttr = false;
-                            if( text::TextContentAnchorType_AS_CHARACTER == eNewAnchor &&
-                                (FLY_AS_CHAR != eOldAnchorId))
+                        }
+                        if( text::TextContentAnchorType_AS_CHARACTER == eNewAnchor &&
+                            (FLY_AS_CHAR != eOldAnchorId))
+                        {
+                            SwPaM aPam(pDoc->GetNodes().GetEndOfContent());
+                            if( pDoc->GetCurrentLayout() )
                             {
-                                //the RES_TXTATR_FLYCNT needs to be added now
-                                SwTxtNode *pNd = aPam.GetNode()->GetTxtNode();
-                                SAL_WARN_IF( !pNd, "sw.uno", "Crsr is not in a TxtNode." );
-                                SwFmtFlyCnt aFmt( pFlyFmt );
-                                pNd->InsertItem(aFmt,
-                                    aPam.GetPoint()->nContent.GetIndex(), 0 );
-                                //aPam.GetPoint()->nContent--;
-
+                                SwCrsrMoveState aState( MV_SETONLYTEXT );
+                                Point aTmp( pObj->GetSnapRect().TopLeft() );
+                                pDoc->GetCurrentLayout()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState );
+                            }
+                            else
+                            {
+                                //without access to the layout the last node of the body will be used as anchor position
+                                aPam.Move( fnMoveBackward, fnGoDoc );
                             }
+                            //the RES_TXTATR_FLYCNT needs to be added now
+                            SwTxtNode *pNd = aPam.GetNode()->GetTxtNode();
+                            SAL_WARN_IF( !pNd, "sw.uno", "Crsr is not in a TxtNode." );
+                            SwFmtFlyCnt aFmt( pFlyFmt );
+                            pNd->InsertItem(aFmt,
+                                aPam.GetPoint()->nContent.GetIndex(), 0 );
+                            //aPam.GetPoint()->nContent--;
                         }
                         if( bSetAttr )
                             pFmt->SetFmtAttr(aSet);
commit e41a40dd821c21e726415a66400e74750fa76996
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Wed Jun 6 18:17:50 2012 +0200

    fix incorrect OSL_ENSURE -> SAL_WARN_IF conversion (condition not inverted)
    
    Change-Id: I57dfa64c55e046ed51797b2abeb7ba3242e637da
    (cherry picked from commit dfc4832049c140b7442c085062599aef1953e8fd)
    
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 7f7a7af..6cf0c6d 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1174,7 +1174,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
                 else if(RES_OPAQUE == pEntry->nWID)
                 {
                     SvxShape* pSvxShape = GetSvxShape();
-                    SAL_WARN_IF(pSvxShape, "sw.uno", "No SvxShape found!");
+                    SAL_WARN_IF(!pSvxShape, "sw.uno", "No SvxShape found!");
                     if(pSvxShape)
                     {
                         SdrObject* pObj = pSvxShape->GetSdrObject();
@@ -1220,14 +1220,14 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
                                 //To prevent this the connection between format and attribute has to be broken before.
                                 const SwPosition *pPos = aAnchor.GetCntntAnchor();
                                 SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
-                                SAL_WARN_IF( pTxtNode->HasHints(), "sw.uno", "Missing FlyInCnt-Hint." );
+                                SAL_WARN_IF( !pTxtNode->HasHints(), "sw.uno", "Missing FlyInCnt-Hint." );
                                 const xub_StrLen nIdx = pPos->nContent.GetIndex();
                                 SwTxtAttr * const pHnt =
                                     pTxtNode->GetTxtAttrForCharAt(
                                         nIdx, RES_TXTATR_FLYCNT );
-                                SAL_WARN_IF( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+                                SAL_WARN_IF( !pHnt || pHnt->Which() != RES_TXTATR_FLYCNT,
                                             "sw.uno", "Missing FlyInCnt-Hint." );
-                                SAL_WARN_IF( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFmt,
+                                SAL_WARN_IF( !pHnt || pHnt->GetFlyCnt().GetFrmFmt() != pFmt,
                                             "sw.uno", "Wrong TxtFlyCnt-Hint." );
                                 const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt())
                                     .SetFlyFmt();
@@ -1237,7 +1237,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
                                     RES_TXTATR_FLYCNT, nIdx );
                                 //create a new one
                                 SwTxtNode *pNd = pInternalPam->GetNode()->GetTxtNode();
-                                SAL_WARN_IF( pNd, "sw.uno", "Cursor not at TxtNode." );
+                                SAL_WARN_IF( !pNd, "sw.uno", "Cursor not at TxtNode." );
                                 SwFmtFlyCnt aFmt( pFmt );
                                 pNd->InsertItem(aFmt, pInternalPam->GetPoint()
                                         ->nContent.GetIndex(), 0 );
@@ -1322,14 +1322,14 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
                             //To prevent this the connection between format and attribute has to be broken before.
                             const SwPosition *pPos = rOldAnchor.GetCntntAnchor();
                             SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
-                            SAL_WARN_IF( pTxtNode->HasHints(), "sw.uno", "Missing FlyInCnt-Hint." );
+                            SAL_WARN_IF( !pTxtNode->HasHints(), "sw.uno", "Missing FlyInCnt-Hint." );
                             const xub_StrLen nIdx = pPos->nContent.GetIndex();
                             SwTxtAttr * const pHnt =
                                 pTxtNode->GetTxtAttrForCharAt(
                                     nIdx, RES_TXTATR_FLYCNT );
-                            SAL_WARN_IF( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+                            SAL_WARN_IF( !pHnt || pHnt->Which() != RES_TXTATR_FLYCNT,
                                         "sw.uno", "Missing FlyInCnt-Hint." );
-                            SAL_WARN_IF( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFlyFmt,
+                            SAL_WARN_IF( !pHnt || pHnt->GetFlyCnt().GetFrmFmt() != pFlyFmt,
                                         "sw.uno", "Wrong TxtFlyCnt-Hint." );
                             const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt())
                                 .SetFlyFmt();
@@ -1365,7 +1365,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
                             {
                                 //the RES_TXTATR_FLYCNT needs to be added now
                                 SwTxtNode *pNd = aPam.GetNode()->GetTxtNode();
-                                SAL_WARN_IF( pNd, "sw.uno", "Crsr is not in a TxtNode." );
+                                SAL_WARN_IF( !pNd, "sw.uno", "Crsr is not in a TxtNode." );
                                 SwFmtFlyCnt aFmt( pFlyFmt );
                                 pNd->InsertItem(aFmt,
                                     aPam.GetPoint()->nContent.GetIndex(), 0 );
commit 0134e6723c9b100a8d56f9b079192a8609dd5ba0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 5 13:16:32 2012 +0000

    Resolves: fdo#57532 restrict page sanity check to non-storage chunks
    
    Change-Id: I47c24131e95b9a8a691dbff4710869ba91df8306
    (cherry picked from commit 4a1044229afd6b52ca10e5c55f1957b153a8c6ea)
    Reviewed-on: https://gerrit.libreoffice.org/1245
    Reviewed-by: Michael Meeks <michael.meeks at suse.com>
    Tested-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/sot/qa/cppunit/data/pass/fdo57532-1.compound b/sot/qa/cppunit/data/pass/fdo57532-1.compound
new file mode 100644
index 0000000..70068fe
Binary files /dev/null and b/sot/qa/cppunit/data/pass/fdo57532-1.compound differ
diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx
index c4a8c28..9b1c918 100644
--- a/sot/source/sdstor/stgelem.cxx
+++ b/sot/source/sdstor/stgelem.cxx
@@ -405,7 +405,7 @@ sal_Bool StgEntry::Load( const void* pFrom, sal_uInt32 nBufSize )
     if (n > nMaxLegalStr)
         return sal_False;
 
-    if ((nSize < 0 && cType != STG_STORAGE) || (nPage1 < 0 && !isKnownSpecial(nPage1)))
+    if ((cType != STG_STORAGE) && ((nSize < 0) || (nPage1 < 0 && !isKnownSpecial(nPage1))))
     {
         // the size makes no sense for the substorage
         // TODO/LATER: actually the size should be an unsigned value, but in this case it would mean a stream of more than 2Gb
commit 3e05815c27e03c929d7d2f870d1ff8e898843127
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Dec 4 13:48:00 2012 +0100

    fdo#52640 fix right-aligned tabstops
    
    It is no good to change temporary object...
    
    Change-Id: Ib1178e154341dd0216fd965d3ed6c264de40d634
    Signed-off-by: Kohei Yoshida <kohei.yoshida at gmail.com>

diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index d952e6a..77f1d49 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -417,7 +417,7 @@ public:
     void        SetLen( sal_uInt16 nL )         { nLen = nL; }
 
     Size&       GetSize()                   { return aOutSz; }
-    Size        GetSize() const             { return aOutSz; }
+    const Size& GetSize() const             { return aOutSz; }
 
     sal_uInt8&      GetKind()                   { return nKind; }
     sal_uInt8       GetKind() const             { return nKind; }
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 59c70bf..9f1a955 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1157,7 +1157,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY )
                     nW = nMaxW;
                     aCurrentTab.bValid = sal_False;
                 }
-                const TextPortion* pTabPortion = pParaPortion->GetTextPortions()[aCurrentTab.nTabPortion];
+                TextPortion* const pTabPortion = pParaPortion->GetTextPortions()[aCurrentTab.nTabPortion];
                 pTabPortion->GetSize().Width() = aCurrentTab.nTabPos - aCurrentTab.nStartPosX - nW - nStartX;
                 nTmpWidth = aCurrentTab.nStartPosX + pTabPortion->GetSize().Width() + nWidthAfterTab;
             }
@@ -1400,7 +1400,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY )
             // Width from HangingPunctuation was set to 0 in ImpBreakLine,
             // check for rel width now, maybe create compression...
             long n = nMaxLineWidth - aTextSize.Width();
-            const TextPortion* pTP = pParaPortion->GetTextPortions()[pLine->GetEndPortion()];
+            TextPortion* const pTP = pParaPortion->GetTextPortions()[pLine->GetEndPortion()];
             sal_uInt16 nPosInArray = pLine->GetEnd()-1-pLine->GetStart();
             long nNewValue = ( nPosInArray ? pLine->GetCharPosArray()[ nPosInArray-1 ] : 0 ) + n;
             pLine->GetCharPosArray()[ nPosInArray ] = nNewValue;
@@ -1942,7 +1942,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te
 
     if ( bCompressBlank || bHangingPunctuation )
     {
-        const TextPortion* pTP = pParaPortion->GetTextPortions()[nEndPortion];
+        TextPortion* const pTP = pParaPortion->GetTextPortions()[nEndPortion];
         DBG_ASSERT( pTP->GetKind() == PORTIONKIND_TEXT, "BlankRubber: No TextPortion!" );
         DBG_ASSERT( nBreakPos > pLine->GetStart(), "SplitTextPortion at the beginning of the line?" );
         sal_uInt16 nPosInArray = nBreakPos - 1 - pLine->GetStart();
commit 2747bb9c4d814f64b1a2bf6a9cba99575695cd2e
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue Dec 4 10:38:53 2012 +0100

    fdo#54473 fdo#57133 fix RTF import of character styles
    
    Regression from commit d2d77fd86e6cb7341e113557e2cfe3d7948759bd
    
    (cherry picked from commit 41890bf714803969515578b47e63fa9730ea7090)
    
    Change-Id: I7accc5c383de3fa53c12527766c3fc155bfa9863
    Reviewed-on: https://gerrit.libreoffice.org/1235
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index b84e303..51f4966 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2438,7 +2438,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
                 m_aStates.top().aParagraphAttributes.set(NS_rtf::LN_ISTD, pIntValue);
             break;
         case RTF_CS:
-            if (m_aStates.top().nDestinationState == DESTINATION_STYLESHEET)
+            if (m_aStates.top().nDestinationState == DESTINATION_STYLESHEET || m_aStates.top().nDestinationState == DESTINATION_STYLEENTRY)
             {
                 m_nCurrentStyleIndex = nParam;
                 m_aStates.top().aTableAttributes.set(NS_rtf::LN_ISTD, pIntValue);
commit b5c39d6842f7489f4782d7e771cf8822ee1f262c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Dec 1 12:18:53 2012 +0000

    Resolves: fdo#56549 crash in format->autocorrect->apply and edit changes
    
    regression from cad9afa15f53d547733fa55f1353772f6d696611
    
    Change-Id: I1aa36bf86969a5a90456817d360d59125948e519
    (cherry picked from commit 32c26ffb1f7585318a11f684a9886b58cea5b307)
    Reviewed-on: https://gerrit.libreoffice.org/1218
    Reviewed-by: Miklos Vajna <vmiklos at suse.cz>
    Tested-by: Miklos Vajna <vmiklos at suse.cz>

diff --git a/sw/inc/shellres.hxx b/sw/inc/shellres.hxx
index 688fe08..7a7a543 100644
--- a/sw/inc/shellres.hxx
+++ b/sw/inc/shellres.hxx
@@ -95,7 +95,7 @@ struct SW_DLLPUBLIC ShellResource : public Resource
 
 private:
     void _GetAutoFmtNameLst() const;
-    std::vector<String> *pAutoFmtNameLst;
+    mutable std::vector<String> *pAutoFmtNameLst;
     String          sPageDescFirstName;
     String          sPageDescFollowName;
     String          sPageDescName;
diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx
index 1a3e6d4..0b2dac9 100644
--- a/sw/source/ui/utlui/initui.cxx
+++ b/sw/source/ui/utlui/initui.cxx
@@ -238,10 +238,10 @@ struct ImpAutoFmtNameListLoader : public Resource
 
 void ShellResource::_GetAutoFmtNameLst() const
 {
-    std::vector<String>* pLst(pAutoFmtNameLst);
-    pLst = new std::vector<String>;
-    pLst->reserve(STR_AUTOFMTREDL_END);
-    ImpAutoFmtNameListLoader aTmp( *pLst );
+    assert(!pAutoFmtNameLst);
+    pAutoFmtNameLst = new std::vector<String>;
+    pAutoFmtNameLst->reserve(STR_AUTOFMTREDL_END);
+    ImpAutoFmtNameListLoader aTmp(*pAutoFmtNameLst);
 }
 
 ImpAutoFmtNameListLoader::ImpAutoFmtNameListLoader( std::vector<String>& rLst )
commit 45f64fb9d9017c833f8fe2a900b63f7a3a770cf1
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Nov 29 17:10:12 2012 +0100

    resolved fdo#57668 additional date formats using '/' separator
    
    Change-Id: Ib71fb25b8d5411b83f55649d9a18833470647eb3
    Reviewed-on: https://gerrit.libreoffice.org/1196
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/i18npool/source/localedata/data/tr_TR.xml b/i18npool/source/localedata/data/tr_TR.xml
index ca2d1ab..45ce90f 100644
--- a/i18npool/source/localedata/data/tr_TR.xml
+++ b/i18npool/source/localedata/data/tr_TR.xml
@@ -37,7 +37,9 @@
   <LC_FORMAT>
     <DateAcceptancePattern>D.M</DateAcceptancePattern>
     <DateAcceptancePattern>D/M</DateAcceptancePattern>
+    <DateAcceptancePattern>D/M/Y</DateAcceptancePattern>
     <DateAcceptancePattern>D-M</DateAcceptancePattern>
+    <DateAcceptancePattern>D-M-Y</DateAcceptancePattern>
     <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
       <FormatCode>Standard</FormatCode>
     </FormatElement>
@@ -90,12 +92,12 @@
       <FormatCode>DD.MM.YY</FormatCode>
     </FormatElement>
     <FormatElement msgid="DateFormatskey9" default="true" type="long" usage="DATE" formatindex="19">
-      <FormatCode>DD.MM.YY</FormatCode>
+      <FormatCode>NNNND.MMMM.YYYY</FormatCode>
     </FormatElement>
-    <FormatElement msgid="DateFormatskey8" default="true" type="medium" usage="DATE" formatindex="20">
+    <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="20">
       <FormatCode>DD.MM.YY</FormatCode>
     </FormatElement>
-    <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="21">
+    <FormatElement msgid="DateFormatskey7" default="true" type="medium" usage="DATE" formatindex="21">
       <FormatCode>DD.MM.YYYY</FormatCode>
     </FormatElement>
     <FormatElement msgid="DateFormatskey10" default="false" type="long" usage="DATE" formatindex="22">
@@ -177,6 +179,18 @@
     <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47">
       <FormatCode>DD.MM.YYYY HH:MM:SS</FormatCode>
     </FormatElement>
+    <FormatElement msgid="DateFormatskey22" default="false" type="medium" usage="DATE" formatindex="51">
+      <FormatCode>DD/MM/YYYY</FormatCode>
+    </FormatElement>
+    <FormatElement msgid="DateFormatskey23" default="false" type="short" usage="DATE" formatindex="52">
+      <FormatCode>DD/MM/YY</FormatCode>
+    </FormatElement>
+    <FormatElement msgid="DateFormatskey24" default="false" type="long" usage="DATE" formatindex="53">
+      <FormatCode>DD/MMM/YYYY</FormatCode>
+    </FormatElement>
+    <FormatElement msgid="DateTimeFormatskey3" default="false" type="medium" usage="DATE_TIME" formatindex="54">
+      <FormatCode>DD/MM/YYYY HH:MM:SS</FormatCode>
+    </FormatElement>
   </LC_FORMAT>
   <LC_COLLATION ref="en_US" />
   <LC_SEARCH ref="en_US"/>
commit 13d40d9667f1f01b1f5b36d14ebd714600b76f37
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Dec 1 15:32:38 2012 +0100

    Fix lacking "/" on .icedove
    
    It would prevent to find icedove addressbook if there's no link .thunderbird to .icedove
    I already did the same on master sources, see:
    https://gerrit.libreoffice.org/gitweb?p=core.git;a=commitdiff;h=ea5a96a5c771ee2c2ebbe4c12c4e7f3b1cba29a7
    
    Change-Id: I24d1ff9b4af327a810997b97b0cf4112eba21e64

diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx
index c613faa..17de26b 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx
@@ -85,7 +85,7 @@ namespace
     #else
         { ".mozilla/seamonkey/", NULL, NULL, NULL },
         { ".mozilla/firefox/", NULL, NULL, NULL },
-        { ".thunderbird/", ".mozilla-thunderbird/", ".mozilla/thunderbird/", ".icedove" }
+        { ".thunderbird/", ".mozilla-thunderbird/", ".mozilla/thunderbird/", ".icedove/" }
     #endif
     };
 
commit 7061141096134a6cb5103bdf5a08d02bc0392330
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Thu Nov 29 16:35:14 2012 +0100

    fdo#57611 do not crash when setting too small size
    
    setWidth/setHeight's exception specifications are lacking,
    but fixing this in a stable release line is too invasive:
    they are "inherited" from the specification in
    offapi/com/sun/star/report/XReportComponent.idl
    and are thus part of our public API.
    
    Change-Id: I8ae2048a6c0acc6b6cf2beece9e630c87caac39f
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/reportdesign/source/core/inc/ReportHelperImpl.hxx b/reportdesign/source/core/inc/ReportHelperImpl.hxx
index 1b5f7d2..6325f8f 100644
--- a/reportdesign/source/core/inc/ReportHelperImpl.hxx
+++ b/reportdesign/source/core/inc/ReportHelperImpl.hxx
@@ -46,7 +46,14 @@ void SAL_CALL clazz::setHeight( ::sal_Int32 _height ) throw (uno::RuntimeExcepti
 { \
     awt::Size aSize = getSize(); \
     aSize.Height = _height; \
-    setSize(aSize); \
+    try \
+    { \
+        setSize(aSize); \
+    } \
+    catch (const beans::PropertyVetoException &)      \
+    { \
+        throw uno::RuntimeException("Unacceptable height", static_cast<cppu::OWeakObject*>(this)); \
+    } \
 } \
 ::sal_Int32 SAL_CALL clazz::getPositionX() throw (uno::RuntimeException) \
 { \
@@ -76,7 +83,14 @@ void SAL_CALL clazz::setWidth( ::sal_Int32 _width ) throw (uno::RuntimeException
 { \
     awt::Size aSize = getSize(); \
     aSize.Width = _width; \
-    setSize(aSize); \
+    try \
+    { \
+        setSize(aSize); \
+    } \
+    catch (const beans::PropertyVetoException &)      \
+    { \
+        throw uno::RuntimeException("Unacceptable width", static_cast<cppu::OWeakObject*>(this)); \
+    } \
 } \
 uno::Reference< report::XSection > SAL_CALL clazz::getSection() throw (uno::RuntimeException) \
 { \
commit ae8a34b85f7048b9df213eea34bfb49f8de8c99f
Author: Petr Mladek <pmladek at suse.cz>
Date:   Thu Nov 29 11:14:13 2012 +0100

    lo-commit-stat: allow to filer cherry-picked commits
    
    Add --cherry option that filters commits using the "git cherry" command.
    
    Note that you need to pass git arguments for "git cherry". It means
    "old-branch-or-tag" "new-branch-or-tag".
    
    Change-Id: Iea67d0ead205c66112791cb0444fa183c7fa6e9b

diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index 6da5285..7dd2211 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -6,6 +6,7 @@
 use strict;
 use LWP::UserAgent;
 use utf8;
+use File::Temp;
 
 my $main_repo="core";
 my @pieces=("binfilter", "dictionaries", "help", "translations");
@@ -87,11 +88,53 @@ sub standardize_summary($)
     return $line;
 }
 
-sub load_git_log($$$$$) 
+sub generate_git_cherry_ids_log($$$$$) 
 {
-    my ($pdata, $repo_dir, $piece, $branch_name, $git_command) = @_;
+    my ($pdata, $repo_dir, $piece, $branch_name, $git_args) = @_;
+
+    my $commit_ids_log;
+    my $commit_ids_log_fh;
+    $commit_ids_log_fh = File::Temp->new(TEMPLATE => 'lo-commit-stat-ids-XXXXXX',
+                                         DIR => '/tmp',
+                                         UNLINK => 0);
+    $commit_ids_log = $commit_ids_log_fh->filename;
+
+    print STDERR "Filtering cherry-picked commits in the git repo: $piece...\n";
+
+    my $cmd = "cd $repo_dir; git cherry $git_args";
+    open (GIT, "$cmd 2>&1|") || die "Can't run $cmd: $!";
+
+    while (my $line = <GIT>) {
+
+        # skip cherry-picked commits
+        next if ( $line =~ m/^\-/ );
+    
+        if ( $line =~ m/^\+ / ) {
+            $line =~ s/^\+ //;
+            print $commit_ids_log_fh $line;
+        }
+    }
+    
+    close GIT;
+    close $commit_ids_log_fh;
+    
+    return $commit_ids_log;
+}
+
+sub load_git_log($$$$$$$) 
+{
+    my ($pdata, $repo_dir, $piece, $branch_name, $git_command, $git_cherry, $git_args) = @_;
+
+    my $cmd = "cd $repo_dir;";
+    my $commit_ids_log;
+    
+    if ($git_cherry) {
+        $commit_ids_log = generate_git_cherry_ids_log($pdata, $repo_dir, $piece, $branch_name, $git_args);
+        $cmd .= " cat $commit_ids_log | xargs -n 1 $git_command -1";
+    } else {
+        $cmd .= " $git_command $git_args";
+    }
 
-    my $cmd = "cd $repo_dir; $git_command";
     my $commit_id;
     my $summary;
 
@@ -149,6 +192,7 @@ sub load_git_log($$$$$)
     }
 
     close GIT;
+    unlink $commit_ids_log if ($git_cherry);
 }
 
 sub get_repo_name($)
@@ -170,9 +214,9 @@ sub get_repo_name($)
     die "Error: can't find repo name in \"$$repo_dir/.git/config\"\n";
 }
 
-sub load_data($$$$$)
+sub load_data($$$$$$$)
 {
-    my ($pdata, $top_dir, $piece, $branch_name, $git_command) = @_;
+    my ($pdata, $top_dir, $piece, $branch_name, $git_command, $git_cherry, $git_args) = @_;
 
     if (defined $piece) {
         my $piece_dir;
@@ -181,11 +225,11 @@ sub load_data($$$$$)
         } else {
             $piece_dir = "$top_dir/clone/$piece";
         }
-        load_git_log($pdata, $piece_dir, $piece, $branch_name, $git_command);
+        load_git_log($pdata, $piece_dir, $piece, $branch_name, $git_command, $git_cherry, $git_args);
     } else {
-        load_git_log($pdata, $top_dir, $main_repo, $branch_name, $git_command);
-        foreach my $piece (@pieces) {
-            load_git_log($pdata, "$top_dir/clone/$piece", $piece, $branch_name, $git_command);
+        load_git_log($pdata, $top_dir, $main_repo, $branch_name, $git_command, $git_cherry, $git_args);
+        foreach my $piece (sort { $a cmp $b } @pieces) {
+            load_git_log($pdata, "$top_dir/clone/$piece", $piece, $branch_name, $git_command, $git_cherry, $git_args);
         }
     }
 }
@@ -420,13 +464,17 @@ sub usage()
           "     --bugs-numbers  generate log with bugzilla numbers\n" .
           "     --rev-list      use \"git rev-list\" instead of \"git log\"; useful to check\n" .
           "                     differences between branches\n" .
+          "     --cherry        use \"git cherry\" instead of \"git log\"; detects cherry-picked\n" .
+          "                     commits between branches\n" .
           "      topdir         directory with the libreoffice/core clone; the piece repos\n" .
           "                     must be cloned in the main-repo-root/clone/<piece> subdirectories\n" .
           "      git_arg        extra parameters passed to the git command to define\n" .
           "                     the area of interest; The default command is \"git log\" and\n" .
           "                     parameters might be, for example, --after=\"2010-09-27\" or\n" .
           "                     TAG..HEAD; with the option --rev-list, useful might be, for\n" .
-          "                     example origin/master ^origin/libreoffice-3-3\n";
+          "                     example origin/master ^origin/libreoffice-3-3; with the option\n" .
+          "                     --rev-list, useful might be, for example libreoffice-3.6.3.2\n" .
+          "                     libreoffice-3.6.4.1\n";
 }
 
 
@@ -446,8 +494,9 @@ my $log_suffix;
 my $log;
 my $branch_name;
 my $git_command = "git log";
+my $git_cherry;
+my $git_args = "";
 my $branch_name;
-my @git_args;
 my %data;
 my $print_mode = "normal";
 
@@ -482,11 +531,14 @@ foreach my $arg (@ARGV) {
         $generate_log{"bugs-numbers"} = 1;
     } elsif ($arg eq '--rev-list') {
         $git_command = "git rev-list --pretty=medium"
+    } elsif ($arg eq '--cherry') {
+        $git_command = "git log";
+        $git_cherry = 1;
     } else {
         if (! defined $top_dir) {
             $top_dir=$arg;
         } else {
-            push @git_args, $arg;
+            $git_args .= " $arg";
         }
     }
 }
@@ -496,8 +548,6 @@ if (%generate_log == 0) {
     $generate_log{"commits"} = 1;
 }
 
-$git_command .= " " . join ' ', @git_args if (@git_args);
-
 (defined $top_dir) || die "Error: top directory is not defined\n";
 (-d "$top_dir") || die "Error: not a directory: $top_dir\n";
 (-f "$top_dir/.git/config") || die "Error: can't find $top_dir/.git/config\n";
@@ -508,7 +558,7 @@ $git_command .= " " . join ' ', @git_args if (@git_args);
 
 $branch_name = get_branch_name($top_dir);
 
-load_data(\%data, $top_dir, $piece, $branch_name, $git_command);
+load_data(\%data, $top_dir, $piece, $branch_name, $git_command, $git_cherry, $git_args);
 
 generate_log(\%data, \&print_commits,    $log_dir, "commits",     $log_suffix, $top_dir, $branch_name, 0) if (defined $generate_log{"commits"});
 generate_log(\%data, \&print_bugs,       $log_dir, "bugs",        $log_suffix, $top_dir, $branch_name, 0) if (defined $generate_log{"bugs"});
commit 74e2a439656d00f97493e4fd53b24cdbe1b9ece2
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Nov 20 16:10:58 2012 +0100

    lo-commit-stat: allow to generate more logs at once
    
    It takes ages to get bug summary from bugzilla => it is worh to
    generate normal and wiki logs at the same time. Why not produce
    all logs with one call
    
    Add --commits option. Also rename --wikibugs to --bugs-wiki.
    
    Use .wiki suffix for wiki logs. Also rename "commit-log" to "commits".
    It is enough to use ".log" as the suffix.
    
    Change-Id: I92bbc4d56a0ae9e23401be0677256059c777d712

diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index 4135b8b..6da5285 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -214,12 +214,17 @@ sub get_branch_name($)
     return $branch;
 }
 
-sub open_log_file($$$$$)
+sub open_log_file($$$$$$)
 {
-    my ($log_dir, $log_prefix, $log_suffix, $top_dir, $branch_name) = @_;
+    my ($log_dir, $log_prefix, $log_suffix, $top_dir, $branch_name, $wiki) = @_;
 
-    my $logfilename = "$log_prefix-$branch_name-$log_suffix.log";
+    my $logfilename = "$log_prefix-$branch_name-$log_suffix";
     $logfilename = "$log_dir/$logfilename" if (defined $log_dir);
+    if ($wiki) {
+        $logfilename .= ".wiki";
+    } else {
+        $logfilename .= ".log";
+    }
 
     if (-f $logfilename) {
         print "WARNING: The log file already exists: $logfilename\n";
@@ -236,7 +241,7 @@ sub open_log_file($$$$$)
     return $log;
 }
 
-sub print_summary_in_stat($$$$$$)
+sub print_commit_summary($$$$$$)
 {
     my ($summary, $ppiece_title, $pbugs, $pauthors, $prefix, $log) = @_;
 
@@ -262,9 +267,9 @@ sub print_summary_in_stat($$$$$$)
     print $log $prefix, $summary, $bugs, $authors, "\n";
 }
 
-sub print_stat($$)
+sub print_commits($$$)
 {
-    my ($pdata, $log) = @_;
+    my ($pdata, $log, $wiki) = @_;
 
     foreach my $piece ( sort { $a cmp $b } keys %{$pdata}) {
         # check if this piece has any entries at all
@@ -276,7 +281,7 @@ sub print_stat($$)
             foreach my $id ( sort { lc $pdata->{$piece}{$a}{'summary'} cmp lc $pdata->{$piece}{$b}{'summary'} } keys %{$pdata->{$piece}}) {
                 my $summary = $pdata->{$piece}{$id}{'summary'};
                 if ($summary ne $old_summary) {
-                    print_summary_in_stat($old_summary, \$piece_title, \%bugs, \%authors, "    + ", $log);
+                    print_commit_summary($old_summary, \$piece_title, \%bugs, \%authors, "    + ", $log);
                     $old_summary = $summary;
                     %authors = ();
                     %bugs = ();
@@ -291,7 +296,7 @@ sub print_stat($$)
                 my $author = $pdata->{$piece}{$id}{'author'}{'name'};
                 $authors{$author} = 1;
             }
-            print_summary_in_stat($old_summary, \$piece_title, \%bugs, \%authors, "    + ", $log);
+            print_commit_summary($old_summary, \$piece_title, \%bugs, \%authors, "    + ", $log);
         }
     }
 }
@@ -331,7 +336,7 @@ sub get_bug_name($$)
 
 sub print_bugs($$$)
 {
-    my ($pdata, $log, $convert_func) = @_;
+    my ($pdata, $log, $wiki) = @_;
 
     # associate bugs with their summaries and fixers
     my %bugs = ();
@@ -361,13 +366,14 @@ sub print_bugs($$$)
             $authors = " [" . join (", ", keys %{$bugs{$bug}{'author'}}) . "]";
         }
 
-        print $log $convert_func->($bug), " ", $summary, $authors, "\n";
+        $bug =~ s/(.*)\#(.*)/* {{$1|$2}}/ if ($wiki);
+        print $log $bug, " ", $summary, $authors, "\n";
     }
 }
 
-sub print_bugnumbers($$)
+sub print_bugnumbers($$$)
 {
-    my ($pdata, $log) = @_;
+    my ($pdata, $log, $wiki) = @_;
 
     # just collect bugs
     my %bugs = ();
@@ -382,6 +388,15 @@ sub print_bugnumbers($$)
     print $log join ("\n", sort { $a cmp $b } keys %bugs), "\n";
 }
 
+sub generate_log($$$$$$$$)
+{
+    my ($pdata, $print_func, $log_dir, $log_prefix, $log_suffix, $top_dir, $branch_name, $wiki) = @_;
+
+    my $log = open_log_file($log_dir, $log_prefix, $log_suffix, $top_dir, $branch_name, $wiki);
+    & {$print_func} ($pdata, $log, $wiki);
+    close $log;
+}
+
 ########################################################################
 # help
 
@@ -399,9 +414,10 @@ sub usage()
           "     --log-suffix=<string> suffix of the log file name; the result will be\n" .
           "                     commit-log-<branch>-<log-name-suffix>.log; the branch name\n" .
           "                     is detected automatically\n" .
-          "     --bugs          print just bug fixes\n" .
-          "     --wikibugs      print just bug fixes, use wiki markup\n" .
-          "     --bug-numbers   print just fixed bug numbers\n" .
+          "     --commits       generete log with all commits (default)\n" .
+          "     --bugs          generate log with bugzilla entries\n" .
+          "     --bugs-wiki     generate log with bugzilla entries, use wiki markup\n" .
+          "     --bugs-numbers  generate log with bugzilla numbers\n" .
           "     --rev-list      use \"git rev-list\" instead of \"git log\"; useful to check\n" .
           "                     differences between branches\n" .
           "      topdir         directory with the libreoffice/core clone; the piece repos\n" .
@@ -422,6 +438,7 @@ sub usage()
 
 
 my $piece;
+my %generate_log = ();
 my $top_dir;
 my $log_prefix = "commit-log";
 my $log_dir;
@@ -434,6 +451,15 @@ my @git_args;
 my %data;
 my $print_mode = "normal";
 
+        $log_prefix = "bugfixes";
+        $print_mode = "bugs";
+        $log_prefix = "bugfixes";
+        $print_mode = "wikibugs";
+        $log_prefix = "bugnumbers";
+        $print_mode = "bugnumbers";
+
+
+
 foreach my $arg (@ARGV) {
     if ($arg eq '--help') {
         usage();
@@ -446,15 +472,14 @@ foreach my $arg (@ARGV) {
 	$log_suffix = "$1";
     } elsif ($arg =~ m/--log-dir=(.*)/) {
 	$log_dir = "$1";
+    } elsif ($arg eq '--commits') {
+        $generate_log{"commits"} = 1;
     } elsif ($arg eq '--bugs') {
-        $log_prefix = "bugfixes";
-        $print_mode = "bugs";
-    } elsif ($arg eq '--wikibugs') {
-        $log_prefix = "bugfixes";
-        $print_mode = "wikibugs";
-    } elsif ($arg eq '--bug-numbers') {
-        $log_prefix = "bugnumbers";
-        $print_mode = "bugnumbers";
+        $generate_log{"bugs"} = 1;
+    } elsif ($arg eq '--bugs-wiki' || $arg eq '--wikibugs') {
+        $generate_log{"bugs-wiki"} = 1;
+    } elsif ($arg eq '--bugs-numbers' || $arg eq '--bug-numbers') {
+        $generate_log{"bugs-numbers"} = 1;
     } elsif ($arg eq '--rev-list') {
         $git_command = "git rev-list --pretty=medium"
     } else {
@@ -466,6 +491,11 @@ foreach my $arg (@ARGV) {
     }
 }
 
+# default log
+if (%generate_log == 0) {
+    $generate_log{"commits"} = 1;
+}
+
 $git_command .= " " . join ' ', @git_args if (@git_args);
 
 (defined $top_dir) || die "Error: top directory is not defined\n";
@@ -480,16 +510,7 @@ $branch_name = get_branch_name($top_dir);
 
 load_data(\%data, $top_dir, $piece, $branch_name, $git_command);
 
-$log = open_log_file($log_dir, $log_prefix, $log_suffix, $top_dir, $branch_name);
-if ( $print_mode eq "bugs" ) {
-    # identity-transform bug ids
-    print_bugs(\%data, $log, sub { return $_[0] } );
-} elsif ( $print_mode eq "wikibugs" ) {
-    # wiki-ize bug ids
-    print_bugs(\%data, $log, sub { $_[0] =~ s/(.*)\#(.*)/* {{$1|$2}}/; return $_[0] });
-} elsif ( $print_mode eq "bugnumbers" ) {
-    print_bugnumbers(\%data, $log);
-} else {
-    print_stat(\%data, $log);
-}
-close $log;
+generate_log(\%data, \&print_commits,    $log_dir, "commits",     $log_suffix, $top_dir, $branch_name, 0) if (defined $generate_log{"commits"});
+generate_log(\%data, \&print_bugs,       $log_dir, "bugs",        $log_suffix, $top_dir, $branch_name, 0) if (defined $generate_log{"bugs"});
+generate_log(\%data, \&print_bugs,       $log_dir, "bugs",        $log_suffix, $top_dir, $branch_name, 1) if (defined $generate_log{"bugs-wiki"});
+generate_log(\%data, \&print_bugnumbers, $log_dir, "bug-numbers", $log_suffix, $top_dir, $branch_name, 0) if (defined $generate_log{"bugs-numbers"});
commit 23b330aac632ac591271daf1ebf7bd029b7fbcb1
Author: Thorsten Behrens <tbehrens at suse.com>
Date:   Thu Jul 12 01:32:55 2012 +0200

    Make commit stat script recognize opensuse fate entries, too
    
    Change-Id: Ia6b3e6459c5bda7ea24091024cf3dabd19746237
    Signed-off-by: Petr Mladek <pmladek at suse.cz>

diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index 4fb8a10..4135b8b 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -11,10 +11,11 @@ my $main_repo="core";
 my @pieces=("binfilter", "dictionaries", "help", "translations");
 
 my %bugzillas = (
-    fdo  => "https://bugs.freedesktop.org/",
-    bnc  => "https://bugzilla.novell.com/",
-    rhbz => "https://bugzilla.redhat.com/",
-    i    => "https://issues.apache.org/ooo/",
+    fdo  => "https://bugs.freedesktop.org/show_bug.cgi?id=",
+    bnc  => "https://bugzilla.novell.com/show_bug.cgi?id=",
+    rhbz => "https://bugzilla.redhat.com/show_bug.cgi?id=",
+    i    => "https://issues.apache.org/ooo/show_bug.cgi?id=",
+    fate => "https://features.opensuse.org/",
 );
 
 sub search_bugs($$$$)
@@ -305,7 +306,7 @@ sub get_bug_name($$)
     my $bug_number = $2;          # 12345
 
     if ( $bugzillas{$bugzilla} ) {
-        my $url = $bugzillas{$bugzilla} . "show_bug.cgi?id=" . $bug_number;
+        my $url = $bugzillas{$bugzilla} . $bug_number;
         my $ua = LWP::UserAgent->new;
         $ua->timeout(10);
         $ua->env_proxy;
commit e84e03155ea88a6682115b0b764632e3145d43d2
Author: Thorsten Behrens <tbehrens at suse.com>
Date:   Sat Jun 23 16:08:10 2012 +0200

    Slightly more robust removal of bug title prefix.
    
    Change-Id: Ic37589222831d03ec48689a077b1eb16a9199385
    Signed-off-by: Petr Mladek <pmladek at suse.cz>

diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index d2b6d855..4fb8a10 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -312,11 +312,11 @@ sub get_bug_name($$)
         my $response = $ua->get($url);
         if ($response->is_success) {
             my $title = $response->title;
-            if ( $title =~ s/^Bug \d+ – // ) {
+            if ( $title =~ s/^Bug \d+ \S+ // ) {
                 print "$title\n";
                 return $title;
             } else {
-                print "warning: not found; using commit message\n";
+                print "warning: not found; using commit message (only got $title)\n";
             }
         } else {
             print "\n";
commit dd66f048d73fa331376f22e25fed852e59eef01e
Author: Maxime de Roucy <mderoucy at linagora.com>
Date:   Fri Nov 23 14:40:27 2012 +0100

    fix bug 53508
    
    In the format paintbrush function :
    Apply the paragraph automatic attributes to all the nodes in the
    selection instead of just the last node.
    
    Change-Id: I655f00cbf44d3d80c19a7ef623bc1c7cb505ead9
    Reviewed-on: https://gerrit.libreoffice.org/1180
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/sw/source/ui/uiview/formatclipboard.cxx b/sw/source/ui/uiview/formatclipboard.cxx
index 8b09cba..15e3cdf 100644
--- a/sw/source/ui/uiview/formatclipboard.cxx
+++ b/sw/source/ui/uiview/formatclipboard.cxx
@@ -551,7 +551,15 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo
             // it can't be a multiple selection
             SwPaM* pCrsr = rWrtShell.GetCrsr();
 
-            // apply the paragraph automatic attributes
+            // apply the paragraph automatic attributes to all the nodes in the selection
+            for (SwNodeIndex pNodeIndexIterator = pCrsr->Start()->nNode,
+                             pNodeIndexEnd = pCrsr->End()->nNode;
+                    pNodeIndexIterator != pNodeIndexEnd;
+                    ++pNodeIndexIterator )
+            {
+                pNodeIndexIterator.GetNode().GetCntntNode()->SetAttr( *pTemplateItemSet );
+            }
+            // same as pCrsr->End()->nNode.GetNode().GetCntntNode()->SetAttr
             pCrsr->GetCntntNode()->SetAttr( *pTemplateItemSet );
 
             // store the attributes in aItemVector in order not to apply them as
commit 3b863411f7ea3bb4885c3cc1fa86b12f9836178a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Nov 24 18:35:12 2012 +0100

    this method actually can throw, related fdo#57451
    
    Change-Id: I26b79829029e127eb8b9ab4fbea3e0f02035ee41
    Signed-off-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/oox/inc/oox/core/xmlfilterbase.hxx b/oox/inc/oox/core/xmlfilterbase.hxx
index 0e015da..e001df0 100644
--- a/oox/inc/oox/core/xmlfilterbase.hxx
+++ b/oox/inc/oox/core/xmlfilterbase.hxx
@@ -235,7 +235,7 @@ public:
 
     sal_Int32 getNamespaceId( const ::rtl::OUString& rUrl );
 
-    void importDocumentProperties() throw();
+    void importDocumentProperties();
 
 protected:
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 583170b..e7db943 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -236,7 +236,7 @@ XmlFilterBase::~XmlFilterBase()
 
 // ----------------------------------------------------------------------------
 
-void XmlFilterBase::importDocumentProperties() throw()
+void XmlFilterBase::importDocumentProperties()
 {
     Reference< XMultiServiceFactory > xFactory( getServiceFactory(), UNO_QUERY );
     MediaDescriptor aMediaDesc( getMediaDescriptor() );
commit 62950de8e1f168b531ebafa5e6a18ca72dba956b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Nov 24 18:56:18 2012 +0100

    we need to catch the exception here, fdo#57451
    
    Change-Id: I203aa640e7d4373f3a090a4988c28c6059b93064
    Signed-off-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx
index 84f9331..51f764e 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -129,7 +129,14 @@ bool ExcelFilter::importDocument() throw()
     WorkbookGlobalsRef xBookGlob = WorkbookHelper::constructGlobals( *this );
     if ( xBookGlob.get() && importFragment( new WorkbookFragment( *xBookGlob, aWorkbookPath ) ) )
     {
-        importDocumentProperties();
+        try
+        {
+            importDocumentProperties();
+        }
+        catch( const Exception& e )
+        {
+            SAL_WARN("sc", "exception when importing document properties " << e.Message);
+        }
         return true;
     }
     return false;
commit 7108705874a3f445744c197ce5ee0412a3fe3977
Author: Pierre-Eric Pelloux-Prayer <pierre-eric at lanedo.com>
Date:   Fri Oct 5 15:30:11 2012 +0200

    vml import: only apply width-percent attribute if it's != 0
    
    This fixes an issue with a shape defined with these attributes:
    mso-width-percent:0;mso-height-percent:0 and
    mso-width-relative:page;mso-height-relative:page;
    where all points were then located in (0,0)
    
    Change-Id: I51070ad2b2e4e05ab64f16813472ca1d7099fb09
    Reviewed-on: https://gerrit.libreoffice.org/775
    Reviewed-by: Petr Mladek <pmladek at suse.cz>
    Tested-by: Petr Mladek <pmladek at suse.cz>

diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 1e9573e..fde972c 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -464,7 +464,9 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
             if ( maTypeModel.maWidthRelative.isEmpty() || maTypeModel.maWidthRelative.equalsAscii( "page" ) )
             {
                 sal_Int16 nWidth = maTypeModel.maWidthPercent.toInt32() / 10;
-                PropertySet( xShape ).setAnyProperty(PROP_RelativeWidth, makeAny( nWidth ) );
+                // Only apply if nWidth != 0
+                if ( nWidth )
+                    PropertySet( xShape ).setAnyProperty(PROP_RelativeWidth, makeAny( nWidth ) );
             }
         }
         if ( !maTypeModel.maHeightPercent.isEmpty( ) )
@@ -473,7 +475,9 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
             if ( maTypeModel.maHeightRelative.isEmpty() || maTypeModel.maHeightRelative.equalsAscii( "page" ) )
             {
                 sal_Int16 nHeight = maTypeModel.maHeightPercent.toInt32() / 10;
-                PropertySet( xShape ).setAnyProperty(PROP_RelativeHeight, makeAny( nHeight ) );
+                // Only apply if nHeight != 0
+                if ( nHeight )
+                    PropertySet( xShape ).setAnyProperty(PROP_RelativeHeight, makeAny( nHeight ) );
             }
         }
     }
commit 71c485a99640b366aa511b0b27f4b0207f2b1db5
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Fri Nov 23 17:51:16 2012 +0100

    fdo#52182: Fixed click in frames located in header/footer
    
    Using a distance to click to select the best object to select between
    normal text and background object.
    
    (cherry picked from commit e8fbe97900f13305b17015d9044993bde4adab36)
    
    Conflicts:
    	sw/source/ui/docvw/edtwin.cxx
    	sw/source/ui/inc/edtwin.hxx
    
    Change-Id: Ib5b53161c7af2c16f4df379382f2e53fc6d8092b
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index d3ca641..f116e11 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -609,7 +609,7 @@ sal_Bool SwNoTxtFrm::GetCharRect( SwRect &rRect, const SwPosition& rPos,
 
 
 sal_Bool SwNoTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& ,
-                             SwCrsrMoveState* ) const
+                             SwCrsrMoveState*, bool ) const
 {
     SwCntntNode* pCNd = (SwCntntNode*)GetNode();
     pPos->nNode = *pCNd;
diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx
index 0bc62ae..958806e 100644
--- a/sw/source/core/inc/cellfrm.hxx
+++ b/sw/source/core/inc/cellfrm.hxx
@@ -48,7 +48,7 @@ public:
     SwCellFrm( const SwTableBox &, SwFrm*, bool bInsertContent = true );
     ~SwCellFrm();
 
-    virtual sal_Bool GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const;
+    virtual sal_Bool GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
     virtual void Paint( SwRect const&,
                         SwPrintData const*const pPrintData = NULL ) const;
     virtual void CheckDirection( sal_Bool bVert );
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index 170064e..635451b 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -163,7 +163,7 @@ public:
                         SwPrintData const*const pPrintData = NULL ) const;
     virtual Size ChgSize( const Size& aNewSize );
     virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
-                              SwCrsrMoveState* = 0 ) const;
+                              SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
 
     virtual void  CheckDirection( sal_Bool bVert );
     virtual void Cut();
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index e2213cf..729d358 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -786,7 +786,7 @@ public:
     virtual bool    FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
 
     virtual sal_Bool    GetCrsrOfst( SwPosition *, Point&,
-                                 SwCrsrMoveState* = 0 ) const;
+                                 SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
     virtual sal_Bool    GetCharRect( SwRect &, const SwPosition&,
                                  SwCrsrMoveState* = 0 ) const;
     virtual void Paint( SwRect const&,
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index 4c4e4e6..a8d4bc4 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -92,7 +92,7 @@ public:
     virtual bool    FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
 
     virtual sal_Bool  GetCrsrOfst( SwPosition *, Point&,
-                               SwCrsrMoveState* = 0 ) const;
+                               SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
 
     virtual void Cut();
     virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx
index 17494b0..f8c1033 100644
--- a/sw/source/core/inc/notxtfrm.hxx
+++ b/sw/source/core/inc/notxtfrm.hxx
@@ -61,7 +61,7 @@ public:
     virtual sal_Bool GetCharRect( SwRect &, const SwPosition&,
                               SwCrsrMoveState* = 0) const;
     sal_Bool GetCrsrOfst(SwPosition* pPos, Point& aPoint,
-                     SwCrsrMoveState* = 0) const;
+                     SwCrsrMoveState* = 0, bool bTestBackground = false) const;
 
     const Size &GetGrfSize() const  { return GetSize(); }
     void GetGrfArea( SwRect &rRect, SwRect * = 0, sal_Bool bMirror = sal_True ) const;
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 0091e24..688ab5b 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -183,7 +183,7 @@ public:
     void PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt );
 
     virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
-                              SwCrsrMoveState* = 0 ) const;
+                              SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
         // erfrage vom Client Informationen
     virtual sal_Bool GetInfo( SfxPoolItem& ) const;
 
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 85c2a07..f71b2eb 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -201,7 +201,7 @@ public:
           void     SetDrawPage( SdrPage* pNew ){ pDrawPage = pNew; }
 
     virtual sal_Bool  GetCrsrOfst( SwPosition *, Point&,
-                               SwCrsrMoveState* = 0 ) const;
+                               SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
 
     virtual void Paint( SwRect const&,
                         SwPrintData const*const pPrintData = NULL ) const;
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index e8da527..6e03dda 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -285,7 +285,7 @@ public:
     //naechsten ist. Wenn der SPoint ausserhalb der SSize liegt,
     //liefert die Funktion sal_False, sal_True sonst.
     virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
-                                  SwCrsrMoveState* = 0) const;
+                                  SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
 
     // GetKeyCrsrOfst sorgt dafuer, dass der Frame nicht gewechselt wird
     // (z.B. Wechsel in den zeichengebundenen Frame).
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index ef9ec60..2ffc033 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -31,6 +31,7 @@
 #include <hintids.hxx>
 #include <hints.hxx>
 #include <tools/bigint.hxx>
+#include <tools/line.hxx>
 #include <editeng/opaqitem.hxx>
 #include <editeng/protitem.hxx>
 #include <vcl/settings.hxx>
@@ -65,9 +66,11 @@
 #include <cfloat>
 #include <swselectionlist.hxx>
 
+#include <basegfx/numeric/ftools.hxx>
+
 namespace {
     bool lcl_GetCrsrOfst_Objects( const SwPageFrm* pPageFrm, bool bSearchBackground,
-           SwPosition *pPos, Point& rPoint, SwCrsrMoveState* pCMS, long& rSurface )
+           SwPosition *pPos, Point& rPoint, SwCrsrMoveState* pCMS  )
     {
         bool bRet = false;
         Point aPoint( rPoint );
@@ -91,7 +94,6 @@ namespace {
                    !pFly->IsProtected() ) &&
                  pFly->GetCrsrOfst( pPos, aPoint, pCMS ) )
             {
-                rSurface = pFly->Frm().Width() * pFly->Frm().Height();
                 bRet = true;
                 break;
             }
@@ -103,18 +105,19 @@ namespace {
         return bRet;
     }
 
-    long lcl_GetSurface( SwPosition* pPos )
+    double lcl_getDistance( const SwRect& rRect, const Point& rPoint )
     {
-        SwRect aArea;
-
-        SwNode& rNode = pPos->nNode.GetNode();
-
-        if ( rNode.IsCntntNode() )
-            aArea = rNode.GetCntntNode()->FindLayoutRect();
+        double nDist = 0.0;
 
-        // FIXME Handle the other kinds of nodes?
+        // If the point is inside the rectangle, then distance is 0
+        // Otherwise, compute the distance to the center of the rectangle.
+        if ( !rRect.IsInside( rPoint ) )
+        {
+            Line aLine( rPoint, rRect.Center( ) );
+            nDist = aLine.GetLength( );
+        }
 
-        return aArea.Height() * aArea.Width();
+        return nDist;
     }
 }
 
@@ -166,7 +169,7 @@ static SwCrsrOszControl aOszCtrl = { 0, 0, 0 };
 |*
 |*************************************************************************/
 sal_Bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
-                               SwCrsrMoveState* pCMS ) const
+                               SwCrsrMoveState* pCMS, bool ) const
 {
     sal_Bool bRet = sal_False;
     const SwFrm *pFrm = Lower();
@@ -201,7 +204,7 @@ sal_Bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
 |*************************************************************************/
 
 sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
-                             SwCrsrMoveState* pCMS ) const
+                             SwCrsrMoveState* pCMS, bool bTestBackground ) const
 {
     sal_Bool bRet     = sal_False;
     Point aPoint( rPoint );
@@ -222,14 +225,11 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
     //hineinsetzen, dadurch sollten alle Aenderungen unmoeglich sein.
     if ( GetSortedObjs() )
     {
-        long nObjSurface = 0; // Unused
-        bRet = lcl_GetCrsrOfst_Objects( this, false, pPos, rPoint, pCMS, nObjSurface );
+        bRet = lcl_GetCrsrOfst_Objects( this, false, pPos, rPoint, pCMS );
     }
 
     if ( !bRet )
     {
-        long nTextSurface = 0;
-        long nBackSurface = 0;
         SwPosition aBackPos( *pPos );
         SwPosition aTextPos( *pPos );
 
@@ -238,7 +238,6 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
         //aktuellen an. Mit Flys ist es dann allerdings vorbei.
         if ( SwLayoutFrm::GetCrsrOfst( &aTextPos, aPoint, pCMS ) )
         {
-            nTextSurface = lcl_GetSurface( &aTextPos );
             bTextRet = sal_True;
         }
         else
@@ -252,8 +251,6 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
             if ( pCMS && pCMS->bStop )
                 return sal_False;
 
-            nTextSurface = pCnt->Frm().Height() * pCnt->Frm().Width();
-
             OSL_ENSURE( pCnt, "Crsr is gone to a Black hole" );
             if( pCMS && pCMS->pFill && pCnt->IsTxtFrm() )
                 bTextRet = pCnt->GetCrsrOfst( &aTextPos, rPoint, pCMS );
@@ -272,11 +269,10 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
         // Check objects in the background if nothing else matched
         if ( GetSortedObjs() )
         {
-            bBackRet = lcl_GetCrsrOfst_Objects( this, true, &aBackPos, rPoint, pCMS, nBackSurface );
+            bBackRet = lcl_GetCrsrOfst_Objects( this, true, &aBackPos, rPoint, pCMS );
         }
 
-        // TODO Pick up the best approaching selection
-        if ( bTextRet && bBackRet && ( nTextSurface > nBackSurface ) )
+        if ( ( bTestBackground && bBackRet ) || !bTextRet )
         {
             bRet = bBackRet;
             pPos->nNode = aBackPos.nNode;
@@ -284,9 +280,49 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
         }
         else
         {
-            bRet = bTextRet;
-            pPos->nNode = aTextPos.nNode;
-            pPos->nContent = aTextPos.nContent;
+            /* In order to provide a selection as accurable as possible when we have both
+             * text and brackground object, then we compute the distance between both
+             * would-be positions and the click point. The shortest distance wins.
+             */
+            SwCntntNode* pTextNd = aTextPos.nNode.GetNode( ).GetCntntNode( );
+            double nTextDistance = 0;
+            bool bValidTextDistance = false;
+            if ( pTextNd )
+            {
+                SwCntntFrm* pTextFrm = pTextNd->getLayoutFrm( getRootFrm( ) );
+                SwRect rTextRect;
+                pTextFrm->GetCharRect( rTextRect, aTextPos );
+
+                nTextDistance = lcl_getDistance( rTextRect, rPoint );
+                bValidTextDistance = true;
+            }
+
+            double nBackDistance = 0;
+            bool bValidBackDistance = false;
+            SwCntntNode* pBackNd = aBackPos.nNode.GetNode( ).GetCntntNode( );
+            if ( pBackNd )
+            {
+                // FIXME There are still cases were we don't have the proper node here.
+                SwCntntFrm* pBackFrm = pBackNd->getLayoutFrm( getRootFrm( ) );
+                SwRect rBackRect;
+                pBackFrm->GetCharRect( rBackRect, aBackPos );
+
+                nBackDistance = lcl_getDistance( rBackRect, rPoint );
+                bValidBackDistance = true;
+            }
+
+            if ( bValidTextDistance && bValidBackDistance && basegfx::fTools::more( nTextDistance, nBackDistance ) )
+            {
+                bRet = bBackRet;
+                pPos->nNode = aBackPos.nNode;
+                pPos->nContent = aBackPos.nContent;
+            }
+            else
+            {
+                bRet = bTextRet;
+                pPos->nNode = aTextPos.nNode;
+                pPos->nContent = aTextPos.nContent;
+            }
         }
     }
 
@@ -362,7 +398,7 @@ bool SwRootFrm::FillSelection( SwSelectionList& aSelList, const SwRect& rRect) c
 |*
 |*************************************************************************/
 sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
-                             SwCrsrMoveState* pCMS ) const
+                             SwCrsrMoveState* pCMS, bool bTestBackground ) const
 {
     sal_Bool bOldAction = IsCallbackActionEnabled();
     ((SwRootFrm*)this)->SetCallbackActionEnabled( sal_False );
@@ -389,7 +425,7 @@ sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
     }
     if ( pPage )
     {
-        pPage->SwPageFrm::GetCrsrOfst( pPos, rPoint, pCMS );
+        pPage->SwPageFrm::GetCrsrOfst( pPos, rPoint, pCMS, bTestBackground );
     }
 
     ((SwRootFrm*)this)->SetCallbackActionEnabled( bOldAction );
@@ -414,7 +450,7 @@ sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
 |*
 |*************************************************************************/
 sal_Bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
-                             SwCrsrMoveState* pCMS ) const
+                             SwCrsrMoveState* pCMS, bool ) const
 {
     // cell frame does not necessarily have a lower (split table cell)
     if ( !Lower() )
@@ -491,7 +527,7 @@ sal_Bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
 //am weitesten oben liegt.
 
 sal_Bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
-                            SwCrsrMoveState* pCMS ) const
+                            SwCrsrMoveState* pCMS, bool ) const
 {
     aOszCtrl.Entry( this );
 
diff --git a/sw/source/core/layout/unusedf.cxx b/sw/source/core/layout/unusedf.cxx
index d28eb5f..f12f19c 100644
--- a/sw/source/core/layout/unusedf.cxx
+++ b/sw/source/core/layout/unusedf.cxx
@@ -54,7 +54,7 @@ bool SwFrm::FillSelection( SwSelectionList& , const SwRect& ) const
     return false;
 }
 
-sal_Bool SwFrm::GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState*  ) const
+sal_Bool SwFrm::GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState*, bool  ) const
 {
     OSL_FAIL( "GetCrsrOfst of the base class, hi!" );
     return sal_False;
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 1ca3794..aad6a6d 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -684,7 +684,7 @@ sal_Bool SwTxtFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint,
  *************************************************************************/
 
 sal_Bool SwTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& rPoint,
-                               SwCrsrMoveState* pCMS ) const
+                               SwCrsrMoveState* pCMS, bool ) const
 {
     MSHORT nChgFrm = 2;
     if( pCMS )
commit c46c8164c5ad8c8c2aee72f5ee3bd73eeef59e06
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Mon Dec 10 12:51:01 2012 +0100

    oox: v:textbox's inset attribute should be imported in Hmm, not in Emu
    
    Trivial reproducer: http://people.freedesktop.org/~vmiklos/2012/simple-textbox.docx
    
    Change-Id: I030f7153326affc5a01e7ede1ddf1164fa500071
    (cherry picked from commit 5bc835d48f1e5373b3a31bd166fadfdf19b3588f)

diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx
index 841c150..3f188e3 100644
--- a/oox/source/vml/vmltextboxcontext.cxx
+++ b/oox/source/vml/vmltextboxcontext.cxx
@@ -137,16 +137,16 @@ TextBoxContext::TextBoxContext( ContextHandler2Helper& rParent, TextBox& rTextBo
         OUString inset = rAttribs.getString( XML_inset ).get();
         OUString value;
         ConversionHelper::separatePair( value, inset, inset, ',' );
-        rTextBox.borderDistanceLeft = ConversionHelper::decodeMeasureToEmu( graphicHelper,
+        rTextBox.borderDistanceLeft = ConversionHelper::decodeMeasureToHmm( graphicHelper,
             value.isEmpty() ? "0.1in" : value, 0, false, false );
         ConversionHelper::separatePair( value, inset, inset, ',' );
-        rTextBox.borderDistanceTop = ConversionHelper::decodeMeasureToEmu( graphicHelper,
+        rTextBox.borderDistanceTop = ConversionHelper::decodeMeasureToHmm( graphicHelper,
             value.isEmpty() ? "0.05in" : value, 0, false, false );
         ConversionHelper::separatePair( value, inset, inset, ',' );
-        rTextBox.borderDistanceRight = ConversionHelper::decodeMeasureToEmu( graphicHelper,
+        rTextBox.borderDistanceRight = ConversionHelper::decodeMeasureToHmm( graphicHelper,
             value.isEmpty() ? "0.1in" : value, 0, false, false );
         ConversionHelper::separatePair( value, inset, inset, ',' );
-        rTextBox.borderDistanceBottom = ConversionHelper::decodeMeasureToEmu( graphicHelper,
+        rTextBox.borderDistanceBottom = ConversionHelper::decodeMeasureToHmm( graphicHelper,
             value.isEmpty() ? "0.05in" : value, 0, false, false );
         rTextBox.borderDistanceSet = true;
     }
commit 46bee74bf9ae9173ab903969edc02920cf15a9b3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 29 09:48:24 2012 +0000

    .dot files sometimes rejected by writer, bnc#793422
    
    because CWW8 appears twice, once for normal .doc and once for .dot. So a .dot
    files is tested twice if it's supported by the WW8 filter. Depending on the
    (effectively arbitrary) order they appear in the list .dots may fail the "is a
    normal non template .doc" test after the "is a template .dot" test and get
    rejected as a CWW8 candidate.
    
    Change-Id: I88aec29fdd5f9ec4dd4ad2813ff3c6b8fa5c5461
    Signed-off-by: Tor Lillqvist <tlillqvist at suse.com>

diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index b99d57c..f32fa1c 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -266,6 +266,12 @@ sal_Bool SwIoSystem::IsFileFilter(SfxMedium& rMedium, const String& rFmtName)
                     }
                 }
             }
+            //The same underlying filter can appear multiple times in the
+            //filter list, e.g. CWW8 filter twice, once for .doc and once for
+            //.dot.  We just care here if its either, not enforce that it's
+            //both which would be a bit of an odd requirement
+            if (bRet)
+                break;
         }
 
         pFltr = aIter.Next();
commit 403521ad614d880876a6db0b98c0b6063f04ae39
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 29 09:29:19 2012 +0000

    optional ppFlt argument never used
    
    Change-Id: Ib2c68091f14d04818ae5e7db0ad7b8a1ec151f4f
    Signed-off-by: Tor Lillqvist <tlillqvist at suse.com>

diff --git a/sw/inc/iodetect.hxx b/sw/inc/iodetect.hxx
index cc58b29..f8ff622 100644
--- a/sw/inc/iodetect.hxx
+++ b/sw/inc/iodetect.hxx
@@ -111,8 +111,7 @@ public:
 
     // Detect whether the given file is in the given format.
     // For now, only our own filters are supported!
-    static sal_Bool IsFileFilter( SfxMedium& rMedium, const String& rFmtName,
-            const SfxFilter** ppFlt = 0 );
+    static sal_Bool IsFileFilter(SfxMedium& rMedium, const String& rFmtName);
 
     static sal_Bool IsValidStgFilter( SotStorage& , const SfxFilter& );
     static sal_Bool IsValidStgFilter( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rStg, const SfxFilter& rFilter);
diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index 7a72a6f..b99d57c 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -211,8 +211,7 @@ void TerminateBuffer(sal_Char *pBuffer, sal_uLong nBytesRead, sal_uLong nBufferL
 
 /* Feststellen ob das File in dem entsprechenden Format vorliegt. */
 /* Z.z werden nur unsere eigene Filter unterstuetzt               */
-sal_Bool SwIoSystem::IsFileFilter( SfxMedium& rMedium, const String& rFmtName,
-        const SfxFilter** ppFilter )
+sal_Bool SwIoSystem::IsFileFilter(SfxMedium& rMedium, const String& rFmtName)
 {
     sal_Bool bRet = sal_False;
 
@@ -267,9 +266,6 @@ sal_Bool SwIoSystem::IsFileFilter( SfxMedium& rMedium, const String& rFmtName,
                     }
                 }
             }
-
-            if( bRet && ppFilter  )
-                *ppFilter = pFltr;
         }
 
         pFltr = aIter.Next();
diff --git a/sw/source/ui/uno/swdet2.cxx b/sw/source/ui/uno/swdet2.cxx
index 40e4be5..5594438 100644
--- a/sw/source/ui/uno/swdet2.cxx
+++ b/sw/source/ui/uno/swdet2.cxx
@@ -65,7 +65,7 @@ sal_uLong SwFilterDetect::DetectFilter( SfxMedium& rMedium, const SfxFilter** pp
         String aPrefFlt = (*ppFilter)->GetUserData();
 
         // detection for TextFilter needs an additional checking
-        sal_Bool bDetected = SwIoSystem::IsFileFilter( rMedium, aPrefFlt );
+        sal_Bool bDetected = SwIoSystem::IsFileFilter(rMedium, aPrefFlt);
         return bDetected ? nRet : ERRCODE_ABORT;
     }
 
commit 907d934daca790c0168c57924de6bef9ef8068f6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 29 09:23:37 2012 +0000

    Simplify SwIoSystem::IsFileFilter
    
    bRet = bRet && (pFltr->GetUserData().equals(rFmtName)); is already inside an if
    bRet = bRet && (pFltr->GetUserData().equals(rFmtName)); condition
    

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list