[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - desktop/qa sw/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Jan 21 06:47:43 PST 2016


 desktop/qa/desktop_lib/test_desktop_lib.cxx |    5 +++++
 sw/source/uibase/wrtsh/wrtsh1.cxx           |    5 +++++
 2 files changed, 10 insertions(+)

New commits:
commit 8347176bba09a2e77cecd3d69e81effb15fe1408
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jan 21 15:20:45 2016 +0100

    sw tiled editing: default to anchoring new images as-char
    
    (cherry picked from commit e7eca35148204d094dcdb7d8b3e4ec6c9d454159)
    
    Conflicts:
    	desktop/qa/desktop_lib/test_desktop_lib.cxx
    	sw/source/uibase/wrtsh/wrtsh1.cxx
    
    Change-Id: I6aeb06fe1697b7a30e83a3b1b364f44e5822fe95

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 0d39f93..b80dc0b 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -19,6 +19,7 @@
 #ifdef WNT
 #include <prewin.h>
 #endif
+#include <com/sun/star/text/TextContentAnchorType.hpp>
 #include <boost/property_tree/json_parser.hpp>
 #ifdef WNT
 #include <postwin.h>
@@ -437,6 +438,10 @@ void DesktopLOKTest::testPasteWriterJPEG()
     // This was 0, JPEG was not handled as a format for clipboard paste.
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xDrawPage->getCount());
 
+    uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+    // This was text::TextContentAnchorType_AT_PARAGRAPH.
+    CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, xShape->getPropertyValue("AnchorType").get<text::TextContentAnchorType>());
+
     comphelper::LibreOfficeKit::setActive(false);
 }
 
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 37f0553..0a92d70 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -104,6 +104,7 @@
 #include "PostItMgr.hxx"
 #include <sfx2/msgpool.hxx>
 #include <boost/scoped_ptr.hpp>
+#include <comphelper/lok.hxx>
 
 using namespace sw::mark;
 using namespace com::sun::star;
@@ -274,6 +275,10 @@ void SwWrtShell::Insert( const OUString &rPath, const OUString &rFilter,
         // because of the DEF-Framesize
         // These must be removed explicitly for the optimal size.
         pFrmMgr->DelAttr(RES_FRM_SIZE);
+
+        if (comphelper::LibreOfficeKit::isActive())
+            // LOK: anchor inserted images as-char by default.
+            pFrmMgr->SetAnchor(FLY_AS_CHAR);
     }
     else
     {


More information about the Libreoffice-commits mailing list