summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-01-21 15:20:45 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-01-21 15:43:35 +0100
commit8347176bba09a2e77cecd3d69e81effb15fe1408 (patch)
tree0095aaebea0e3938d55801a94099dac330fad6b0
parent11f71656025763073c2167bce0e86b727704990e (diff)
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
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx5
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx5
2 files changed, 10 insertions, 0 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 0d39f931ae69..b80dc0b4cc76 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 37f0553ab2a0..0a92d7014687 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
{