[Libreoffice-commits] core.git: 2 commits - pyuno/source sal/osl sw/source

Michael Stahl mstahl at redhat.com
Wed Oct 9 10:49:18 PDT 2013


 pyuno/source/module/pyuno_module.cxx |    8 ++++++++
 sal/osl/unx/process_impl.cxx         |    2 +-
 sw/source/core/doc/docedt.cxx        |   13 +++++++++----
 3 files changed, 18 insertions(+), 5 deletions(-)

New commits:
commit f011a5c5071ed4a60f0ee7117608b72cecbb958d
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Oct 9 14:22:00 2013 +0200

    fdo#70143: fix SwDoc::ReplaceRangeImpl() a bit more
    
    Fixes regex replace of "$" with nothing (to delete line
    breaks).
    
    Change-Id: If7ec1e5f524f7bb308a2949ace16cb8aa6989106

diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index c269b1d..4df3707 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -2440,18 +2440,23 @@ SetRedlineMode( eOld );
                 }
             }
 
-            if (aDelPam.GetMark() != pStt)
-                *rPam.GetPoint() = *aDelPam.GetMark();
-
+            *rPam.GetPoint() = *aDelPam.GetMark();
             ++aPtNd;
             rPam.GetMark()->nNode = aPtNd;
             rPam.GetMark()->nContent.Assign( aPtNd.GetNode().GetCntntNode(),
                                                 nPtCnt );
 
-            if (bJoinTxt && !bJoinPrev)
+            if (bJoinTxt)
             {
+                assert(rPam.GetPoint() == rPam.End());
+                // move so that SetEnd remembers position after sw_JoinText
                 rPam.Move(fnMoveBackward);
             }
+            else if (aDelPam.GetPoint() == pStt) // backward selection?
+            {
+                assert(*rPam.GetMark() <= *rPam.GetPoint());
+                rPam.Exchange(); // swap so that rPam is backwards
+            }
 
             if( pUndoRpl )
             {
commit 2386a92c1e6e8ec263edb4dc4fdcfeaa4673ce1f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Oct 9 14:18:11 2013 +0200

    pyuno: set up fake command line in getComponentContext()
    
    Easy to trigger the assert in osl_getCommandArgCount(), just
    run instdir/*/program/python and "import unohelper".
    
    Avoid that by setting up a fake command line, hopefully
    nobody expects to be able to give relevant args to python...
    
    Change-Id: I0df6c23d6ecbb3c2bce81a9d5bcecdcb1729ddbb

diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx
index d9d510a..e34b675 100644
--- a/pyuno/source/module/pyuno_module.cxx
+++ b/pyuno/source/module/pyuno_module.cxx
@@ -27,6 +27,7 @@
 
 #include <osl/module.hxx>
 #include <osl/thread.h>
+#include <osl/process.h>
 #include <osl/file.hxx>
 
 #include <typelib/typedescription.hxx>
@@ -260,6 +261,13 @@ static PyObject* getComponentContext(
         }
         else
         {
+            // cppu::defaultBootstrap_InitialComponentContext expects
+            // command line arguments to be present
+            static char * argv [1];
+            argv[0] = strdup(
+                "this is just a fake and cheap imitation of a command line");
+            osl_setCommandArgs(1, argv);
+
             OUString iniFile;
             if( path.isEmpty() )
             {
diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx
index b75e772..00766cc 100644
--- a/sal/osl/unx/process_impl.cxx
+++ b/sal/osl/unx/process_impl.cxx
@@ -176,7 +176,7 @@ sal_uInt32 SAL_CALL osl_getCommandArgCount (void)
     sal_uInt32 result = 0;
 
     pthread_mutex_lock (&(g_command_args.m_mutex));
-    SAL_WARN_IF (g_command_args.m_nCount == 0, "sal.osl", "osl_setCommandArgs() not called before calling osl_getCommandArgCount()");
+    assert (g_command_args.m_nCount != 0);
     if (g_command_args.m_nCount > 0)
         result = g_command_args.m_nCount - 1;
     pthread_mutex_unlock (&(g_command_args.m_mutex));


More information about the Libreoffice-commits mailing list