[Libreoffice-commits] .: filter/inc filter/Library_msfilter.mk filter/Package_inc.mk filter/source sw/source writerfilter/Library_rtftok.mk writerfilter/source

2012-04-25 Thread Miklos Vajna
 filter/Library_msfilter.mk |1 
 filter/Package_inc.mk  |1 
 filter/inc/filter/msfilter/util.hxx|   46 
 filter/source/msfilter/util.cxx|   55 +
 sw/source/filter/ww8/ww8par.cxx|   27 
 writerfilter/Library_rtftok.mk |1 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   16 ---
 7 files changed, 108 insertions(+), 39 deletions(-)

New commits:
commit ee242df844d1a2b85e0d7b86dbdb8bf3643fc74f
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Apr 24 17:35:40 2012 +0200

msfilter::util: avoid code duplication by merging from sw and writerfilter

diff --git a/filter/Library_msfilter.mk b/filter/Library_msfilter.mk
index e2e5eb2..979abd7 100644
--- a/filter/Library_msfilter.mk
+++ b/filter/Library_msfilter.mk
@@ -71,6 +71,7 @@ $(eval $(call gb_Library_add_exception_objects,msfilter,\
filter/source/msfilter/services \
filter/source/msfilter/svdfppt \
filter/source/msfilter/svxmsbas2 \
+   filter/source/msfilter/util \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/filter/Package_inc.mk b/filter/Package_inc.mk
index 27a6c45..2b113f1 100644
--- a/filter/Package_inc.mk
+++ b/filter/Package_inc.mk
@@ -30,5 +30,6 @@ $(eval $(call 
gb_Package_add_file,filter_inc,inc/filter/msfilter/mstoolbar.hxx,f
 $(eval $(call 
gb_Package_add_file,filter_inc,inc/filter/msfilter/msvbahelper.hxx,filter/msfilter/msvbahelper.hxx))
 $(eval $(call 
gb_Package_add_file,filter_inc,inc/filter/msfilter/svdfppt.hxx,filter/msfilter/svdfppt.hxx))
 $(eval $(call 
gb_Package_add_file,filter_inc,inc/filter/msfilter/svxmsbas.hxx,filter/msfilter/svxmsbas.hxx))
+$(eval $(call 
gb_Package_add_file,filter_inc,inc/filter/msfilter/util.hxx,filter/msfilter/util.hxx))
 
 # vim: set noet sw=4 ts=4:
diff --git a/filter/inc/filter/msfilter/util.hxx 
b/filter/inc/filter/msfilter/util.hxx
new file mode 100644
index 000..33a6658
--- /dev/null
+++ b/filter/inc/filter/msfilter/util.hxx
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the License); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an AS IS basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *   Miklos Vajna vmik...@suse.cz (SUSE, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2012 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the GPLv3+), or
+ * the GNU Lesser General Public License Version 3 or later (the LGPLv3+),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef INCLUDED_MSFILTER_UTIL_HXX
+#define INCLUDED_MSFILTER_UTIL_HXX
+
+#include rtl/textenc.h
+#include filter/msfilter/msfilterdllapi.h
+
+namespace msfilter {
+namespace util {
+
+/// Returns the default encoding, based on the application's locale.
+MSFILTER_DLLPUBLIC rtl_TextEncoding GetDefaultTextEncoding();
+
+}
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
new file mode 100644
index 000..a5fb209
--- /dev/null
+++ b/filter/source/msfilter/util.cxx
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the License); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an AS IS basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *   Miklos Vajna vmik...@suse.cz (SUSE, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2012 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the GPLv3+), or
+ * the GNU Lesser General Public License Version 3 or later (the LGPLv3+),
+ * in which case

[Libreoffice-commits] .: solenv/bin

2012-04-24 Thread Miklos Vajna
 solenv/bin/create-tags |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 061e4e119cc932dadda976d2b8622f671201a6bd
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Apr 24 12:25:22 2012 +0200

create-tags: config_host.mk reading

diff --git a/solenv/bin/create-tags b/solenv/bin/create-tags
index a61c5b6..0388928 100755
--- a/solenv/bin/create-tags
+++ b/solenv/bin/create-tags
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 if [ -z $INPATH ] ; then
-   INPATH=$(grep INPATH= ./config_host.mk | sed -e s/INPATH=//)
+   INPATH=$(grep INPATH= ./config_host.mk | sed -e s/export INPATH=//)
 fi
 if [ -z $INPATH ] ; then
 echo could not determine INPATH 2
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-04-24 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 836d56dd563523853e4b9d4bbe7e6f93c1710a2a
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Apr 24 12:30:41 2012 +0200

WaE: make MSVC happy wrt. RTFDocumentImpl::dispatchDestination()

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 750e473..50f84c4 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1062,7 +1062,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 // Look for the field type
 sal_Int32 nPos = Strm().Tell();
 OStringBuffer aBuf;
-char ch;
+char ch = 0;
 bool bFoundCode = false;
 bool bInKeyword = false;
 while (!bFoundCode  ch != '}')
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/qa sw/source

2012-04-24 Thread Miklos Vajna
 sw/qa/extras/rtfexport/data/fdo38176.rtf |3 +++
 sw/qa/extras/rtfexport/rtfexport.cxx |   30 ++
 sw/source/filter/ww8/rtfexport.cxx   |3 ++-
 3 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit ef7cc64d8b5044251d6e31ca24aeb0ac11818e5d
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Apr 24 12:47:16 2012 +0200

fdo#38176 fix RTF export of non-breaking space

diff --git a/sw/qa/extras/rtfexport/data/fdo38176.rtf 
b/sw/qa/extras/rtfexport/data/fdo38176.rtf
new file mode 100644
index 000..c5126e4
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/fdo38176.rtf
@@ -0,0 +1,3 @@
+{\rtf1
+foo\~bar
+\par}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index 642544d..607a39a 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -26,6 +26,7 @@
  */
 
 #include com/sun/star/frame/XStorable.hpp
+#include com/sun/star/text/XTextDocument.hpp
 #include com/sun/star/view/XViewSettingsSupplier.hpp
 
 #include test/bootstrapfixture.hxx
@@ -44,15 +45,19 @@ public:
 virtual void setUp();
 virtual void tearDown();
 void testZoom();
+void testFdo38176();
 
 CPPUNIT_TEST_SUITE(RtfExportTest);
 #if !defined(MACOSX)  !defined(WNT)
 CPPUNIT_TEST(testZoom);
+CPPUNIT_TEST(testFdo38176);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
 private:
 void roundtrip(const OUString rURL);
+/// Get the length of the whole document.
+int getLength();
 uno::Referencelang::XComponent mxComponent;
 };
 
@@ -69,6 +74,25 @@ void RtfExportTest::roundtrip(const OUString rFilename)
 mxComponent = loadFromDesktop(aTempFile.GetURL());
 }
 
+int RtfExportTest::getLength()
+{
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xParaEnum = 
xParaEnumAccess-createEnumeration();
+OUStringBuffer aBuf;
+while (xParaEnum-hasMoreElements())
+{
+uno::Referencecontainer::XEnumerationAccess 
xRangeEnumAccess(xParaEnum-nextElement(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xRangeEnum = 
xRangeEnumAccess-createEnumeration();
+while (xRangeEnum-hasMoreElements())
+{
+uno::Referencetext::XTextRange xRange(xRangeEnum-nextElement(), 
uno::UNO_QUERY);
+aBuf.append(xRange-getString());
+}
+}
+return aBuf.getLength();
+}
+
 void RtfExportTest::setUp()
 {
 test::BootstrapFixture::setUp();
@@ -97,6 +121,12 @@ void RtfExportTest::testZoom()
 CPPUNIT_ASSERT_EQUAL(sal_Int16(42), nValue);
 }
 
+void RtfExportTest::testFdo38176()
+{
+roundtrip(fdo38176.rtf);
+CPPUNIT_ASSERT_EQUAL(7, getLength());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index d5a90ad..15eec5e 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -924,7 +924,8 @@ OString RtfExport::OutChar(sal_Unicode c, int *pUCMode, 
rtl_TextEncoding eDestEn
 }
 if (pStr) {
 aBuf.append(pStr);
-aBuf.append(' ');
+if (c != 0xa0)
+aBuf.append(' ');
 }
 return aBuf.makeStringAndClear();
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/qa sw/source

2012-04-24 Thread Miklos Vajna
 sw/qa/extras/rtfexport/data/fdo38176.rtf |2 +-
 sw/qa/extras/rtfexport/rtfexport.cxx |2 +-
 sw/source/filter/ww8/rtfexport.cxx   |   11 +--
 3 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit dfc7c67e464e57f5442365e193c56033af564d84
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Apr 24 13:05:12 2012 +0200

fdo#38176 fix RTF export of non-breaking hyphen and optional hyphen

diff --git a/sw/qa/extras/rtfexport/data/fdo38176.rtf 
b/sw/qa/extras/rtfexport/data/fdo38176.rtf
index c5126e4..baa4193 100644
--- a/sw/qa/extras/rtfexport/data/fdo38176.rtf
+++ b/sw/qa/extras/rtfexport/data/fdo38176.rtf
@@ -1,3 +1,3 @@
 {\rtf1
-foo\~bar
+foo\~\_\-bar
 \par}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index 607a39a..5bab469 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -124,7 +124,7 @@ void RtfExportTest::testZoom()
 void RtfExportTest::testFdo38176()
 {
 roundtrip(fdo38176.rtf);
-CPPUNIT_ASSERT_EQUAL(7, getLength());
+CPPUNIT_ASSERT_EQUAL(9, getLength());
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfExportTest);
diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index 15eec5e..8101125 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -924,8 +924,15 @@ OString RtfExport::OutChar(sal_Unicode c, int *pUCMode, 
rtl_TextEncoding eDestEn
 }
 if (pStr) {
 aBuf.append(pStr);
-if (c != 0xa0)
-aBuf.append(' ');
+switch (c)
+{
+case 0xa0:
+case 0x1e:
+case 0x1f:
+break;
+default:
+aBuf.append(' ');
+}
 }
 return aBuf.makeStringAndClear();
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 3 commits - oox/inc oox/source sw/qa writerfilter/source

2012-04-23 Thread Miklos Vajna
 oox/inc/oox/vml/vmlshape.hxx |1 +
 oox/source/token/properties.txt  |1 +
 oox/source/vml/vmlshape.cxx  |2 ++
 oox/source/vml/vmlshapecontext.cxx   |1 +
 sw/qa/extras/ooxmltok/data/n757890.docx  |binary
 sw/qa/extras/ooxmltok/ooxmltok.cxx   |   27 +++
 writerfilter/source/dmapper/DomainMapper.cxx |2 ++
 7 files changed, 34 insertions(+)

New commits:
commit 8ee0e1f3fc54727f03674be415302109f6d87dc1
Author: Miklos Vajna vmik...@suse.cz
Date:   Mon Apr 23 17:00:23 2012 +0200

n#757890 add testcase

diff --git a/sw/qa/extras/ooxmltok/data/n757890.docx 
b/sw/qa/extras/ooxmltok/data/n757890.docx
new file mode 100644
index 000..f70368a
Binary files /dev/null and b/sw/qa/extras/ooxmltok/data/n757890.docx differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx 
b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index 5aff21c..e5bdece 100644
--- a/sw/qa/extras/ooxmltok/ooxmltok.cxx
+++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx
@@ -28,11 +28,14 @@
 #include com/sun/star/beans/XPropertySet.hpp
 #include com/sun/star/drawing/XDrawPageSupplier.hpp
 #include com/sun/star/lang/XServiceInfo.hpp
+#include com/sun/star/text/HoriOrientation.hpp
 #include com/sun/star/text/SetVariableType.hpp
 #include com/sun/star/text/TextContentAnchorType.hpp
 #include com/sun/star/text/XDependentTextField.hpp
 #include com/sun/star/text/XPageCursor.hpp
+#include com/sun/star/text/XTextDocument.hpp
 #include com/sun/star/text/XTextFieldsSupplier.hpp
+#include com/sun/star/text/XTextFramesSupplier.hpp
 #include com/sun/star/text/XTextViewCursorSupplier.hpp
 
 #include test/bootstrapfixture.hxx
@@ -53,6 +56,7 @@ public:
 void testN751117();
 void testN751017();
 void testN750935();
+void testN757890();
 
 CPPUNIT_TEST_SUITE(OoxmlModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -60,6 +64,7 @@ public:
 CPPUNIT_TEST(testN751117);
 CPPUNIT_TEST(testN751017);
 CPPUNIT_TEST(testN750935);
+CPPUNIT_TEST(testN757890);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -185,6 +190,28 @@ void OoxmlModelTest::testN750935()
 CPPUNIT_ASSERT_EQUAL(sal_Int16(5), xCursor-getPage());
 }
 
+void OoxmlModelTest::testN757890()
+{
+load(n757890.docx);
+
+// The w:pStyle token affected the text outside the textbox.
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xParaEnum = 
xParaEnumAccess-createEnumeration();
+uno::Referencebeans::XPropertySet xPara(xParaEnum-nextElement(), 
uno::UNO_QUERY);
+OUString aValue;
+xPara-getPropertyValue(ParaStyleName) = aValue;
+CPPUNIT_ASSERT_EQUAL(OUString(Heading 1), aValue);
+
+// This wan't centered
+uno::Referencetext::XTextFramesSupplier xTextFramesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xIndexAccess(xTextFramesSupplier-getTextFrames(), uno::UNO_QUERY);
+uno::Referencebeans::XPropertySet xFrame(xIndexAccess-getByIndex(0), 
uno::UNO_QUERY);
+sal_Int16 nValue;
+xFrame-getPropertyValue(HoriOrient) = nValue;
+CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, nValue);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(OoxmlModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit 5dd8e91934618532bdb7f3d80035d8301a782b32
Author: Miklos Vajna vmik...@suse.cz
Date:   Mon Apr 23 16:22:54 2012 +0200

n#757890 dmapper: paragraph properties of shape text should have limited 
scope

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index dcc20cf..b597ddf 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3239,10 +3239,12 @@ void DomainMapper::markLastParagraphInSection( )
 void DomainMapper::lcl_startShape( uno::Reference drawing::XShape  xShape )
 {
 m_pImpl-PushShapeContext( xShape );
+lcl_startParagraphGroup();
 }
 
 void DomainMapper::lcl_endShape( )
 {
+lcl_endParagraphGroup();
 m_pImpl-PopShapeContext( );
 }
 
commit a5b3bf724e355ceb476991f4ecaa56fd019e3067
Author: Miklos Vajna vmik...@suse.cz
Date:   Mon Apr 23 11:48:42 2012 +0200

n#757890 oox: implement mso-position-horizontal shape property for 
textframes

diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index 82c0f3e..d969577 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -80,6 +80,7 @@ struct ShapeTypeModel
 ::rtl::OUString maMarginLeft;   /// X position of the shape 
bounding box to shape anchor (number with unit).
 ::rtl::OUString maMarginTop;/// Y position of the shape 
bounding box to shape anchor (number with unit).
 ::rtl::OUString maPositionVerticalRelative; /// The Y position is 
relative to this.
+::rtl::OUString maPositionHorizontal

[Libreoffice-commits] .: 2 commits - sw/qa writerfilter/source

2012-04-21 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo48023.rtf  |8 
 sw/qa/extras/rtftok/rtftok.cxx |   25 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   17 +++--
 3 files changed, 48 insertions(+), 2 deletions(-)

New commits:
commit e0190ffa766dbe26a9d4e9dd29e00baaf0ccd5b9
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 21 11:28:41 2012 +0200

rtftok: dump collected strings after encoding

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 2b30481..e50cc1f 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -818,9 +818,9 @@ int RTFDocumentImpl::resolveChars(char ch)
 m_aStates.top().aLevelNumbers.push_back(sal_Int32(ch));
 return 0;
 }
-SAL_INFO(writerfilter, OSL_THIS_FUNC  : collected '  aStr.getStr() 
 ');
 
 OUString aOUStr(OStringToOUString(aStr, m_aStates.top().nCurrentEncoding));
+SAL_INFO(writerfilter, OSL_THIS_FUNC  : collected '  aOUStr  
');
 
 if (m_aStates.top().nDestinationState == DESTINATION_COLORTABLE)
 {
commit f8bda240a09b4ece1c3401874b3cc8f325dbcedb
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 21 11:25:18 2012 +0200

fdo#48023 fix RTF import of Russian characters without an encoding specified

lcl_GetDefaultTextEncodingForRTF() in editeng did the same.

diff --git a/sw/qa/extras/rtftok/data/fdo48023.rtf 
b/sw/qa/extras/rtftok/data/fdo48023.rtf
new file mode 100644
index 000..6d6a0d9
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo48023.rtf
@@ -0,0 +1,8 @@
+{\rtf
+{\fonttbl
+{\f1 Arial;}
+}
+\pard
+\f1 Ïðîãðàììèñò
+\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index fa1321f..6870f02 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -82,6 +82,7 @@ public:
 void testFdo44176();
 void testFdo39053();
 void testFdo48356();
+void testFdo48023();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -106,6 +107,7 @@ public:
 CPPUNIT_TEST(testFdo44176);
 CPPUNIT_TEST(testFdo39053);
 CPPUNIT_TEST(testFdo48356);
+CPPUNIT_TEST(testFdo48023);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -574,6 +576,29 @@ void RtfModelTest::testFdo48356()
 CPPUNIT_ASSERT_EQUAL(1, i);
 }
 
+void RtfModelTest::testFdo48023()
+{
+lang::Locale aLocale;
+aLocale.Language = ru;
+AllSettings aSettings(Application::GetSettings());
+AllSettings aSavedSettings(aSettings);
+aSettings.SetLocale(aLocale);
+Application::SetSettings(aSettings);
+load(fdo48023.rtf);
+Application::SetSettings(aSavedSettings);
+
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xParaEnum = 
xParaEnumAccess-createEnumeration();
+uno::Referencecontainer::XEnumerationAccess 
xRangeEnumAccess(xParaEnum-nextElement(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xRangeEnum = 
xRangeEnumAccess-createEnumeration();
+uno::Referencetext::XTextRange xTextRange(xRangeEnum-nextElement(), 
uno::UNO_QUERY);
+
+// Implicit encoding detection based on locale was missing
+OUString aExpected(Программист, 22, RTL_TEXTENCODING_UTF8);
+CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange-getString());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 2527cef..2b30481 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -513,13 +513,26 @@ sal_uInt32 RTFDocumentImpl::getColorTable(sal_uInt32 
nIndex)
 return 0;
 }
 
+rtl_TextEncoding lcl_getDefaultTextEncoding()
+{
+
+const OUString rLanguage = 
Application::GetSettings().GetLocale().Language;
+
+if (rLanguage == ru || rLanguage == uk)
+return RTL_TEXTENCODING_MS_1251;
+if (rLanguage == tr)
+return RTL_TEXTENCODING_MS_1254;
+else
+return RTL_TEXTENCODING_MS_1252;
+}
+
 rtl_TextEncoding RTFDocumentImpl::getEncoding(sal_uInt32 nFontIndex)
 {
 if (!m_pSuperstream)
 {
 if (nFontIndex  m_aFontEncodings.size())
 return m_aFontEncodings[nFontIndex];
-return 0;
+return lcl_getDefaultTextEncoding();
 }
 else
 return m_pSuperstream-getEncoding(nFontIndex);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: cui/source

2012-04-21 Thread Miklos Vajna
 cui/source/tabpages/paragrph.src |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 29042d096a2c5812ae179e1553367afd21b0f71e
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 21 14:26:49 2012 +0200

cui: fix position of ED_LINEDISTMETRIC

I broke that when I added CB_CONTEXTUALSPACING

diff --git a/cui/source/tabpages/paragrph.src b/cui/source/tabpages/paragrph.src
index d6de18e..e064ac7 100644
--- a/cui/source/tabpages/paragrph.src
+++ b/cui/source/tabpages/paragrph.src
@@ -235,7 +235,7 @@ TabPage RID_SVXPAGE_STD_PARAGRAPH
 Disable = TRUE ;
 Border = TRUE ;
 Hide = TRUE ;
-Pos = MAP_APPFONT ( 135 , 133 ) ;
+Pos = MAP_APPFONT ( 135 , 147 ) ;
 Size = MAP_APPFONT ( 40 , 12 ) ;
 Group = TRUE ;
 Left = TRUE ;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/qa writerfilter/source

2012-04-21 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo48876.rtf  |5 +
 sw/qa/extras/rtftok/rtftok.cxx |   17 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   10 --
 3 files changed, 30 insertions(+), 2 deletions(-)

New commits:
commit 99b875aee04a808fb28715fb0e143a2b00332832
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 21 12:53:22 2012 +0200

fdo#48876 fix RTF import of \sl without \slmult

diff --git a/sw/qa/extras/rtftok/data/fdo48876.rtf 
b/sw/qa/extras/rtftok/data/fdo48876.rtf
new file mode 100644
index 000..49a6eb0
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo48876.rtf
@@ -0,0 +1,5 @@
+{\rtf
+\sl54
+C
+\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 6870f02..0bb45e4 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -29,6 +29,8 @@
 #include com/sun/star/drawing/XDrawPageSupplier.hpp
 #include com/sun/star/lang/XServiceInfo.hpp
 #include com/sun/star/style/CaseMap.hpp
+#include com/sun/star/style/LineSpacing.hpp
+#include com/sun/star/style/LineSpacingMode.hpp
 #include com/sun/star/style/XStyleFamiliesSupplier.hpp
 #include com/sun/star/table/BorderLine2.hpp
 #include com/sun/star/table/BorderLineStyle.hpp
@@ -83,6 +85,7 @@ public:
 void testFdo39053();
 void testFdo48356();
 void testFdo48023();
+void testFdo48876();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -108,6 +111,7 @@ public:
 CPPUNIT_TEST(testFdo39053);
 CPPUNIT_TEST(testFdo48356);
 CPPUNIT_TEST(testFdo48023);
+CPPUNIT_TEST(testFdo48876);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -599,6 +603,19 @@ void RtfModelTest::testFdo48023()
 CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange-getString());
 }
 
+void RtfModelTest::testFdo48876()
+{
+load(fdo48876.rtf);
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xParaEnum = 
xParaEnumAccess-createEnumeration();
+CPPUNIT_ASSERT(xParaEnum-hasMoreElements());
+uno::Referencebeans::XPropertySet xPropertySet(xParaEnum-nextElement(), 
uno::UNO_QUERY);
+style::LineSpacing aSpacing;
+xPropertySet-getPropertyValue(ParaLineSpacing) = aSpacing;
+CPPUNIT_ASSERT_EQUAL(style::LineSpacingMode::MINIMUM, aSpacing.Mode);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index e50cc1f..750e473 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2379,9 +2379,15 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, 
int nParam)
 }
 break;
 case RTF_SL:
-if (nParam  0)
 {
-// NS_sprm::LN_PDyaLine could be used, but that won't work 
with slmult
+// This is similar to RTF_ABSH, negative value means 'exact', 
positive means 'at least'.
+RTFValue::Pointer_t pValue(new 
RTFValue(NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_atLeast));
+if (nParam  0)
+{
+pValue.reset(new 
RTFValue(NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_exact));
+pIntValue.reset(new RTFValue(-nParam));
+}
+
m_aStates.top().aParagraphAttributes-push_back(make_pair(NS_ooxml::LN_CT_Spacing_lineRule,
 pValue));
 
m_aStates.top().aParagraphAttributes-push_back(make_pair(NS_ooxml::LN_CT_Spacing_line,
 pIntValue));
 }
 break;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - writerfilter/source

2012-04-21 Thread Miklos Vajna
 writerfilter/source/filter/RtfFilter.cxx   |4 ++-
 writerfilter/source/rtftok/rtfcontrolwords.cxx |   18 
 writerfilter/source/rtftok/rtfcontrolwords.hxx |4 +++
 writerfilter/source/rtftok/rtftokenizer.cxx|   28 -
 writerfilter/source/rtftok/rtftokenizer.hxx|2 +
 5 files changed, 41 insertions(+), 15 deletions(-)

New commits:
commit 22eb78b6eee38e11aec32909b6983becb309ce13
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 21 18:58:31 2012 +0200

fdo#44736 speed up RTF import a bit by sorting keywords

If we sort the keywords once in the constructor, then we can do binary
search when looking up RTF keywords, and that speeds up the import by
about 20% using the first testcase from the bug.

diff --git a/writerfilter/source/rtftok/rtfcontrolwords.cxx 
b/writerfilter/source/rtftok/rtfcontrolwords.cxx
index cce0c2e..11c4d3d 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.cxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.cxx
@@ -27,6 +27,7 @@
 
 #include rtfcontrolwords.hxx
 #include sal/macros.h
+#include string.h
 
 namespace writerfilter {
 namespace rtftok {
@@ -1856,6 +1857,23 @@ RTFSymbol aRTFControlWords[] = {
 };
 int nRTFControlWords = SAL_N_ELEMENTS(aRTFControlWords);
 
+bool RTFSymbol::operator(const RTFSymbol rOther) const
+{
+return strcmp(sKeyword, rOther.sKeyword)  0;
+}
+
+RTFSymbol::RTFSymbol(const char* pKeyword)
+: sKeyword(pKeyword)
+{
+}
+
+RTFSymbol::RTFSymbol(const char *pKeyword, int pControlType, RTFKeyword pIndex)
+: sKeyword(pKeyword),
+nControlType(pControlType),
+nIndex(pIndex)
+{
+}
+
 } // namespace rtftok
 } // namespace writerfilter
 
diff --git a/writerfilter/source/rtftok/rtfcontrolwords.hxx 
b/writerfilter/source/rtftok/rtfcontrolwords.hxx
index 5afb8c6..477ddb5 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.hxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.hxx
@@ -1866,6 +1866,10 @@ struct RTFSymbol
 const char *sKeyword;
 int nControlType;
 RTFKeyword nIndex;
+
+bool operator(const RTFSymbol rOther) const;
+RTFSymbol(const char* pKeyword);
+RTFSymbol(const char *pKeyword, int pControlType, RTFKeyword pIndex);
 };
 
 extern RTFSymbol aRTFControlWords[];
diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx 
b/writerfilter/source/rtftok/rtftokenizer.cxx
index f247317..b40a912 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -45,8 +45,10 @@ namespace rtftok {
 RTFTokenizer::RTFTokenizer(RTFDocumentImpl rImport, SvStream* pInStream, 
uno::Referencetask::XStatusIndicator const xStatusIndicator)
 : m_rImport(rImport),
 m_pInStream(pInStream),
-m_xStatusIndicator(xStatusIndicator)
+m_xStatusIndicator(xStatusIndicator),
+m_aRTFControlWords(std::vectorRTFSymbol(aRTFControlWords, 
aRTFControlWords + nRTFControlWords))
 {
+std::sort(m_aRTFControlWords.begin(), m_aRTFControlWords.end());
 }
 
 RTFTokenizer::~RTFTokenizer()
@@ -266,13 +268,10 @@ int RTFTokenizer::dispatchKeyword(OString rKeyword, bool 
bParam, int nParam)
 return 0;
 /*SAL_INFO(writefilter, OSL_THIS_FUNC  : keyword '\\  
rKeyword.getStr() 
' with param?   (bParam ? 1 : 0)  param val: '  
(bParam ? nParam : 0)  ');*/
-int i, ret;
-for (i = 0; i  nRTFControlWords; i++)
-{
-if (!strcmp(rKeyword.getStr(), aRTFControlWords[i].sKeyword))
-break;
-}
-if (i == nRTFControlWords)
+RTFSymbol aSymbol(rKeyword.getStr());
+std::vectorRTFSymbol::iterator low = 
std::lower_bound(m_aRTFControlWords.begin(), m_aRTFControlWords.end(), aSymbol);
+int i = low - m_aRTFControlWords.begin();
+if (low == m_aRTFControlWords.end() || aSymbol  *low)
 {
 SAL_INFO(writerfilter, OSL_THIS_FUNC  : unknown keyword '\\  
rKeyword.getStr()  ');
 RTFSkipDestination aSkip(m_rImport);
@@ -280,35 +279,36 @@ int RTFTokenizer::dispatchKeyword(OString rKeyword, bool 
bParam, int nParam)
 return 0;
 }
 
-switch (aRTFControlWords[i].nControlType)
+int ret;
+switch (m_aRTFControlWords[i].nControlType)
 {
 case CONTROL_FLAG:
 // flags ignore any parameter by definition
-ret = m_rImport.dispatchFlag(aRTFControlWords[i].nIndex);
+ret = m_rImport.dispatchFlag(m_aRTFControlWords[i].nIndex);
 if (ret)
 return ret;
 break;
 case CONTROL_DESTINATION:
 // same for destinations
-ret = m_rImport.dispatchDestination(aRTFControlWords[i].nIndex);
+ret = m_rImport.dispatchDestination(m_aRTFControlWords[i].nIndex);
 if (ret)
 return ret;
 break;
 case CONTROL_SYMBOL:
 // and symbols
-ret = m_rImport.dispatchSymbol(aRTFControlWords[i].nIndex);
+ret = m_rImport.dispatchSymbol(m_aRTFControlWords[i].nIndex

[Libreoffice-commits] .: writerfilter/source

2012-04-21 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfcontrolwords.cxx |   12 
 writerfilter/source/rtftok/rtfcontrolwords.hxx |2 --
 writerfilter/source/rtftok/rtftokenizer.cxx|3 ++-
 3 files changed, 2 insertions(+), 15 deletions(-)

New commits:
commit 9fda7a919f31a192b9bd2938139b6566b7fc2935
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 21 20:00:08 2012 +0200

rtftok: try to make tinderboxes happy

diff --git a/writerfilter/source/rtftok/rtfcontrolwords.cxx 
b/writerfilter/source/rtftok/rtfcontrolwords.cxx
index 11c4d3d..516a9b8 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.cxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.cxx
@@ -1862,18 +1862,6 @@ bool RTFSymbol::operator(const RTFSymbol rOther) const
 return strcmp(sKeyword, rOther.sKeyword)  0;
 }
 
-RTFSymbol::RTFSymbol(const char* pKeyword)
-: sKeyword(pKeyword)
-{
-}
-
-RTFSymbol::RTFSymbol(const char *pKeyword, int pControlType, RTFKeyword pIndex)
-: sKeyword(pKeyword),
-nControlType(pControlType),
-nIndex(pIndex)
-{
-}
-
 } // namespace rtftok
 } // namespace writerfilter
 
diff --git a/writerfilter/source/rtftok/rtfcontrolwords.hxx 
b/writerfilter/source/rtftok/rtfcontrolwords.hxx
index 477ddb5..1088982 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.hxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.hxx
@@ -1868,8 +1868,6 @@ struct RTFSymbol
 RTFKeyword nIndex;
 
 bool operator(const RTFSymbol rOther) const;
-RTFSymbol(const char* pKeyword);
-RTFSymbol(const char *pKeyword, int pControlType, RTFKeyword pIndex);
 };
 
 extern RTFSymbol aRTFControlWords[];
diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx 
b/writerfilter/source/rtftok/rtftokenizer.cxx
index b40a912..709bb30 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -268,7 +268,8 @@ int RTFTokenizer::dispatchKeyword(OString rKeyword, bool 
bParam, int nParam)
 return 0;
 /*SAL_INFO(writefilter, OSL_THIS_FUNC  : keyword '\\  
rKeyword.getStr() 
' with param?   (bParam ? 1 : 0)  param val: '  
(bParam ? nParam : 0)  ');*/
-RTFSymbol aSymbol(rKeyword.getStr());
+RTFSymbol aSymbol;
+aSymbol.sKeyword = rKeyword.getStr();
 std::vectorRTFSymbol::iterator low = 
std::lower_bound(m_aRTFControlWords.begin(), m_aRTFControlWords.end(), aSymbol);
 int i = low - m_aRTFControlWords.begin();
 if (low == m_aRTFControlWords.end() || aSymbol  *low)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sw/source

2012-04-20 Thread Miklos Vajna
 sw/source/core/crsr/callnk.cxx |   63 ++---
 1 file changed, 34 insertions(+), 29 deletions(-)

New commits:
commit e4509eea8fc7c07ddff48edf0d4c015c2663d896
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Apr 20 09:45:24 2012 +0200

n#751313 SwCallLink: avoid redrawing complete rows without nested tables

diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 642b3ea..79aac33 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -100,8 +100,21 @@ void lcl_notifyRow(const SwCntntNode* pNode, SwCrsrShell 
rShell)
 if ( pRow )
 {
 const SwTableLine* pLine = pRow-GetTabLine( );
-SwFmtFrmSize pSize = pLine-GetFrmFmt( )-GetFrmSize( );
-pRow-ModifyNotification( NULL, pSize );
+// Avoid redrawing the complete row if there are no nested 
tables
+bool bHasTable = false;
+SwFrm *pCell = pRow-GetLower();
+for (; pCell  !bHasTable; pCell = pCell-GetNext())
+{
+SwFrm *pContent = pCell-GetLower();
+for (; pContent  !bHasTable; pContent = 
pContent-GetNext())
+if (pContent-GetType() == FRM_TAB)
+bHasTable = true;
+}
+if (bHasTable)
+{
+SwFmtFrmSize pSize = pLine-GetFrmFmt()-GetFrmSize();
+pRow-ModifyNotification(NULL, pSize);
+}
 }
 }
 }
commit 071c4d56517c43d3160c4c529abc534851066060
Author: Miklos Vajna vmik...@suse.cz
Date:   Thu Apr 19 16:20:46 2012 +0200

n#751313 SwCallLink: avoid copypaste via introducing lcl_notifyRow

diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index a6373da..642b3ea 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -87,6 +87,25 @@ SwCallLink::SwCallLink( SwCrsrShell  rSh )
 }
 }
 
+void lcl_notifyRow(const SwCntntNode* pNode, SwCrsrShell rShell)
+{
+if ( pNode != NULL )
+{
+SwFrm *myFrm = pNode-getLayoutFrm( rShell.GetLayout() );
+if (myFrm!=NULL)
+{
+// We need to emulated a change of the row height in order
+// to have the complete row redrawn
+SwRowFrm* pRow = myFrm-FindRowFrm();
+if ( pRow )
+{
+const SwTableLine* pLine = pRow-GetTabLine( );
+SwFmtFrmSize pSize = pLine-GetFrmFmt( )-GetFrmSize( );
+pRow-ModifyNotification( NULL, pSize );
+}
+}
+}
+}
 
 SwCallLink::~SwCallLink()
 {
@@ -100,19 +119,7 @@ SwCallLink::~SwCallLink()
 if( !pCNd )
 return;
 
-SwFrm *myFrm = pCNd-getLayoutFrm( rShell.GetLayout() );
-if (myFrm!=NULL)
-{
-// We need to emulated a change of the row height in order
-// to have the complete row redrawn
-SwRowFrm* pRow = myFrm-FindRowFrm( );
-if ( pRow )
-{
-const SwTableLine* pLine = pRow-GetTabLine( );
-SwFmtFrmSize pSize = pLine-GetFrmFmt( )-GetFrmSize( );
-pRow-ModifyNotification( NULL, pSize );
-}
-}
+lcl_notifyRow(pCNd, rShell);
 
 const SwDoc *pDoc=rShell.GetDoc();
 const SwCntntNode *pNode = NULL;
@@ -120,22 +127,7 @@ SwCallLink::~SwCallLink()
 {
 pNode = pDoc-GetNodes()[nNode]-GetCntntNode();
 }
-if ( pNode != NULL )
-{
-SwFrm *myFrm2 = pNode-getLayoutFrm( rShell.GetLayout() );
-if (myFrm2!=NULL)
-{
-// We need to emulated a change of the row height in order
-// to have the complete row redrawn
-SwRowFrm* pRow = myFrm2-FindRowFrm();
-if ( pRow )
-{
-const SwTableLine* pLine = pRow-GetTabLine( );
-SwFmtFrmSize pSize = pLine-GetFrmFmt( )-GetFrmSize( );
-pRow-ModifyNotification( NULL, pSize );
-}
-}
-}
+lcl_notifyRow(pNode, rShell);
 
 xub_StrLen nCmp, nAktCntnt = pCurCrsr-GetPoint()-nContent.GetIndex();
 sal_uInt16 nNdWhich = pCNd-GetNodeType();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-04-20 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit dd1fbdd27d44ac237a36579a8858983d5ab6d637
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Apr 20 15:29:20 2012 +0200

RTFDocumentImpl::resolvePict: use new-style uno ctor

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 4a0eb27..2527cef 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -27,7 +27,7 @@
 
 #include com/sun/star/beans/PropertyAttribute.hpp
 #include com/sun/star/document/XDocumentPropertiesSupplier.hpp
-#include com/sun/star/graphic/XGraphicProvider.hpp
+#include com/sun/star/graphic/GraphicProvider.hpp
 #include com/sun/star/io/UnexpectedEOFException.hpp
 #include com/sun/star/text/XTextFrame.hpp
 #include com/sun/star/text/SizeType.hpp
@@ -647,8 +647,7 @@ int RTFDocumentImpl::resolvePict(bool bInline)
 beans::PropertyValues aMediaProperties(1);
 aMediaProperties[0].Name = URL;
 aMediaProperties[0].Value = aGraphicUrl;
-uno::Referencegraphic::XGraphicProvider 
xGraphicProvider(m_xContext-getServiceManager()-createInstanceWithContext(com.sun.star.graphic.GraphicProvider,
 m_xContext),
-uno::UNO_QUERY_THROW);
+uno::Referencegraphic::XGraphicProvider 
xGraphicProvider(graphic::GraphicProvider::create(m_xContext));
 uno::Referencegraphic::XGraphic xGraphic = 
xGraphicProvider-queryGraphic(aMediaProperties);
 xPropertySet-setPropertyValue(Graphic, uno::Any(xGraphic));
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: UnoControls/source

2012-04-19 Thread Miklos Vajna
 UnoControls/source/base/basecontainercontrol.cxx |2 
 UnoControls/source/base/basecontrol.cxx  |4 -
 UnoControls/source/controls/framecontrol.cxx |   12 ++--
 UnoControls/source/controls/progressbar.cxx  |2 
 UnoControls/source/controls/progressmonitor.cxx  |   62 +++
 UnoControls/source/controls/statusindicator.cxx  |   16 ++---
 6 files changed, 49 insertions(+), 49 deletions(-)

New commits:
commit c39d96a8e986c85259d01884762bd135fa0d0f5b
Author: Szabolcs Dezsi dezsisz...@hotmail.com
Date:   Thu Apr 19 09:05:43 2012 +0200

Removed RTL_CONSTASCII_USTRINGPARAM from UnoControls

diff --git a/UnoControls/source/base/basecontainercontrol.cxx 
b/UnoControls/source/base/basecontainercontrol.cxx
index 1105941..f219b3f 100644
--- a/UnoControls/source/base/basecontainercontrol.cxx
+++ b/UnoControls/source/base/basecontainercontrol.cxx
@@ -560,7 +560,7 @@ WindowDescriptor* 
BaseContainerControl::impl_getWindowDescriptor ( const Referen
 WindowDescriptor*   aDescriptor = new WindowDescriptor ;
 
 aDescriptor-Type   = WindowClass_CONTAINER
 ;
-aDescriptor-WindowServiceName  = 
OUString(RTL_CONSTASCII_USTRINGPARAM(window))   ;
+aDescriptor-WindowServiceName  = window 
 ;
 aDescriptor-ParentIndex= -1   
 ;
 aDescriptor-Parent = rParentPeer  
 ;
 aDescriptor-Bounds = getPosSize ()
 ;
diff --git a/UnoControls/source/base/basecontrol.cxx 
b/UnoControls/source/base/basecontrol.cxx
index 1240bb2..f3f1307 100644
--- a/UnoControls/source/base/basecontrol.cxx
+++ b/UnoControls/source/base/basecontrol.cxx
@@ -368,7 +368,7 @@ void SAL_CALL BaseControl::createPeer(  const   Reference 
XToolkit   xToo
 if ( xLocalToolkit.is() == sal_False )
 {
 // but first create wellknown toolkit, if it not exist
-xLocalToolkit = Reference XToolkit  ( 
m_xFactory-createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM( 
SERVICE_VCLTOOLKIT )) ), UNO_QUERY );
+xLocalToolkit = Reference XToolkit  ( 
m_xFactory-createInstance( SERVICE_VCLTOOLKIT ), UNO_QUERY );
 }
 m_xPeer = xLocalToolkit-createWindow( *pDescriptor );
 m_xPeerWindow   = Reference XWindow ( m_xPeer, UNO_QUERY );
@@ -934,7 +934,7 @@ WindowDescriptor* BaseControl::impl_getWindowDescriptor( 
const Reference XWindo
 WindowDescriptor* pDescriptor = new WindowDescriptor ;
 
 pDescriptor-Type   = WindowClass_SIMPLE;
-pDescriptor-WindowServiceName  = 
OUString(RTL_CONSTASCII_USTRINGPARAM(window))   ;
+pDescriptor-WindowServiceName  = window  ;
 pDescriptor-ParentIndex= -1;
 pDescriptor-Parent = xParentPeer   ;
 pDescriptor-Bounds = getPosSize () ;
diff --git a/UnoControls/source/controls/framecontrol.cxx 
b/UnoControls/source/controls/framecontrol.cxx
index 6b29190..71911a9 100644
--- a/UnoControls/source/controls/framecontrol.cxx
+++ b/UnoControls/source/controls/framecontrol.cxx
@@ -310,7 +310,7 @@ const Sequence OUString  
FrameControl::impl_getStaticSupportedServiceNames()
 {
 MutexGuard aGuard( Mutex::getGlobalMutex() );
 Sequence OUString  seqServiceNames( 1 );
-seqServiceNames.getArray() [0] = OUString(RTL_CONSTASCII_USTRINGPARAM( 
SERVICENAME_FRAMECONTROL ));
+seqServiceNames.getArray() [0] = SERVICENAME_FRAMECONTROL;
 return seqServiceNames ;
 }
 
@@ -508,7 +508,7 @@ void FrameControl::impl_createFrame(const   Reference 
XWindowPeerxPee
 xOldFrame = m_xFrame ;
 }
 
-xNewFrame = Reference XFrame   ( 
impl_getMultiServiceFactory()-createInstance ( 
OUString(RTL_CONSTASCII_USTRINGPARAM(com.sun.star.frame.Frame)) ), UNO_QUERY 
) ;
+xNewFrame = Reference XFrame   ( 
impl_getMultiServiceFactory()-createInstance ( com.sun.star.frame.Frame ), 
UNO_QUERY ) ;
 Reference XDispatchProvider   xDSP ( xNewFrame, UNO_QUERY ) ;
 
 if (xDSP.is())
@@ -519,7 +519,7 @@ void FrameControl::impl_createFrame(const   Reference 
XWindowPeerxPee
 //  option
 //xFrame-setName( WhatYouWant );
 
-Reference XURLTransformer   xTrans ( 
impl_getMultiServiceFactory()-createInstance ( 
OUString(RTL_CONSTASCII_USTRINGPARAM(com.sun.star.util.URLTransformer)) ), 
UNO_QUERY ) ;
+Reference XURLTransformer   xTrans ( 
impl_getMultiServiceFactory()-createInstance ( 
com.sun.star.util.URLTransformer ), UNO_QUERY ) ;
 if(xTrans.is())
 {
 // load file
@@ -591,9 +591,9 @@ const Sequence Property  
FrameControl::impl_getStaticPropertyDescriptor()
 // All Properties of this implementation. The array must be 

[Libreoffice-commits] .: writerfilter/source

2012-04-19 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |4 +---
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |2 --
 2 files changed, 1 insertion(+), 5 deletions(-)

New commits:
commit df2a76d988ad11b20ce7cec9cff06a1bc5c94788
Author: Miklos Vajna vmik...@suse.cz
Date:   Thu Apr 19 16:26:02 2012 +0200

RTFDocumentImpl: get rid of practically unused m_bWasInFrame

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 54fdac2..e2fa851 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -278,7 +278,6 @@ 
RTFDocumentImpl::RTFDocumentImpl(uno::Referenceuno::XComponentContext const x
 m_nCurrentStyleIndex(0),
 m_bEq(false),
 m_bFormField(false),
-m_bWasInFrame(false),
 m_bIsInFrame(false),
 m_aUnicodeBuffer(),
 m_aHexBuffer()
@@ -1408,8 +1407,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
 }
 // but don't emit properties yet, since they may change till 
the first text token arrives
 m_bNeedPap = true;
-m_bWasInFrame = m_aStates.top().aFrame.inFrame();
-if (!m_bWasInFrame)
+if (!m_aStates.top().aFrame.inFrame())
 m_bNeedPar = false;
 }
 break;
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 81f05c3..3a1bad4 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -478,8 +478,6 @@ namespace writerfilter {
 int m_nCurrentStyleIndex;
 bool m_bEq;
 bool m_bFormField;
-/// If we were in a frame.
-bool m_bWasInFrame;
 /// If a frame start token is already sent to dmapper (nesting 
them is not OK).
 bool m_bIsInFrame;
 // Unicode characters are collected here so we don't have to 
send them one by one.
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sw/source

2012-04-18 Thread Miklos Vajna
 sw/source/core/layout/paintfrm.cxx |   36 
 1 file changed, 24 insertions(+), 12 deletions(-)

New commits:
commit fe2a1f6bcb72b17d050355377b68e986f17cf1ff
Author: Michael Stahl mst...@redhat.com
Date:   Tue Apr 17 22:30:25 2012 +0200

fdo#38635: sw: fix border corner gaps:

The start and end points of the vertical and adjacent horizontal borders
were apart by 1.5 to 3 twips, leading to small visible gaps in the corners.
This is fixed by using lcl_AlignWidth/lcl_AlignHeight on the border widths,
and by always computing the start/end positions from the outer edge,
which makes the horizontal and vertical start/end points match.
(regression from 0f0896c26fb260d1bbf31d7a886df3f61837f0f2)
(cherry picked from commit b08e9f3023e9ea1ca0926334becac939ca8fdfac)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 0a451b8..69e32ff 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4483,8 +4483,13 @@ void lcl_PaintLeftRightLine( const sal_Bool 
_bLeft,
 nExtentOE = lcl_GetExtent( pBottomBorder, NULL );
 }
 
-basegfx::B2DPoint aStart( aRect.Left() + aRect.Width() / 2.0, 
aRect.Top() + lcl_GetLineWidth( pTopBorder ) / 2.0 );
-basegfx::B2DPoint aEnd( aRect.Left() + aRect.Width() / 2.0, 
aRect.Bottom() - lcl_GetLineWidth( pBottomBorder ) / 2.0 );
+double const fStartX( (_bLeft) // fdo#38635: always from outer edge
+? aRect.Left()  + (aRect.Width() / 2.0)
+: aRect.Right() - (aRect.Width() / 2.0));
+basegfx::B2DPoint const aStart(fStartX,
+aRect.Top() + lcl_AlignHeight(lcl_GetLineWidth(pTopBorder))/2.0 );
+basegfx::B2DPoint const aEnd(fStartX,
+aRect.Bottom() - 
lcl_AlignHeight(lcl_GetLineWidth(pBottomBorder))/2.0 );
 
 double nLeftWidth = !_bLeft ? pLeftRightBorder-GetOutWidth() : 
pLeftRightBorder-GetInWidth( );
 double nRightWidth = !_bLeft ? pLeftRightBorder-GetInWidth() : 
pLeftRightBorder-GetOutWidth( );
@@ -4558,8 +4563,15 @@ void lcl_PaintTopBottomLine( const sal_Bool 
_bTop,
 nExtentOE = lcl_GetExtent( NULL, pRightBorder );
 }
 
-basegfx::B2DPoint aStart( aRect.Left() + lcl_GetLineWidth( pLeftBorder 
) / 2.0, aRect.Top() + aRect.Height() / 2.0 );
-basegfx::B2DPoint aEnd( aRect.Right() - lcl_GetLineWidth( pRightBorder 
) / 2.0, aRect.Top() + aRect.Height() / 2.0 );
+double const fStartY( (_bTop) // fdo#38635: always from outer edge
+? aRect.Top()+ (aRect.Height() / 2.0)
+: aRect.Bottom() - (aRect.Height() / 2.0));
+basegfx::B2DPoint const aStart(
+aRect.Left() + lcl_AlignWidth(lcl_GetLineWidth(pLeftBorder))/2.0,
+fStartY );
+basegfx::B2DPoint const aEnd(
+aRect.Right() - lcl_AlignWidth(lcl_GetLineWidth(pRightBorder))/2.0,
+fStartY );
 
 double nLeftWidth = !_bTop ? pTopBottomBorder-GetOutWidth() : 
pTopBottomBorder-GetInWidth( );
 double nRightWidth = !_bTop ? pTopBottomBorder-GetInWidth() : 
pTopBottomBorder-GetOutWidth( );
commit d53367946360483ffbc1bcd5babcfcef795507ce
Author: Michael Stahl mst...@redhat.com
Date:   Sun Apr 15 15:28:50 2012 +0200

sw: create horizontal border lines with start left and end right

(cherry picked from commit 1d5e263a129c56e561ce145bad9749027c583a75)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 659606f..0a451b8 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4545,21 +4545,21 @@ void lcl_PaintTopBottomLine( const sal_Bool 
_bTop,
 
 if ( lcl_GetLineWidth( pTopBottomBorder )  0 )
 {
-double nExtentIS = lcl_GetExtent( pRightBorder, NULL );
-double nExtentIE = lcl_GetExtent( pLeftBorder, NULL );
-double nExtentOS = lcl_GetExtent( NULL, pRightBorder );
-double nExtentOE = lcl_GetExtent( NULL, pLeftBorder );
+double nExtentIS = lcl_GetExtent( NULL, pLeftBorder );
+double nExtentIE = lcl_GetExtent( NULL, pRightBorder );
+double nExtentOS = lcl_GetExtent( pLeftBorder, NULL );
+double nExtentOE = lcl_GetExtent( pRightBorder, NULL );
 
 if ( !_bTop )
 {
-nExtentIS = lcl_GetExtent( NULL, pRightBorder );
-nExtentIE = lcl_GetExtent( NULL, pLeftBorder );
-nExtentOS = lcl_GetExtent( pRightBorder, NULL );
-nExtentOE = lcl_GetExtent( pLeftBorder, NULL );
+nExtentIS = lcl_GetExtent( pLeftBorder, NULL );
+nExtentIE = lcl_GetExtent( pRightBorder, NULL );
+nExtentOS = lcl_GetExtent( NULL, pLeftBorder );
+nExtentOE = lcl_GetExtent( NULL, pRightBorder

[Libreoffice-commits] .: oox/inc

2012-04-18 Thread Miklos Vajna
 oox/inc/oox/vml/vmlshape.hxx |   58 +--
 1 file changed, 29 insertions(+), 29 deletions(-)

New commits:
commit 8fd03963cdaa0ffd9a5fbe0f56d6e4c2700e7883
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Apr 18 14:01:56 2012 +0200

oox: fix doxygen syntax to avoid misleading output in vml::ClientData

diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index d11e34a..82c0f3e 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -139,35 +139,35 @@ protected:
 /** Excel specific shape client data (such as cell anchor). */
 struct ClientData
 {
-::rtl::OUString maAnchor;   /// Cell anchor as comma-separated 
string.
-::rtl::OUString maFmlaMacro;/// Link to macro associated to 
the control.
-::rtl::OUString maFmlaPict; /// Target cell range of picture 
links.
-::rtl::OUString maFmlaLink; /// Link to value cell associated 
to the control.
-::rtl::OUString maFmlaRange;/// Link to cell range used as 
data source for the control.
-::rtl::OUString maFmlaGroup;/// Link to value cell associated 
to a group of option buttons.
-sal_Int32   mnObjType;  /// Type of the shape.
-sal_Int32   mnTextHAlign;   /// Horizontal text alignment.
-sal_Int32   mnTextVAlign;   /// Vertical text alignment.
-sal_Int32   mnCol;  /// Column index for spreadsheet 
cell note.
-sal_Int32   mnRow;  /// Row index for spreadsheet cell 
note.
-sal_Int32   mnChecked;  /// State for checkboxes and 
option buttons.
-sal_Int32   mnDropStyle;/// Drop down box style (read-only 
or editable).
-sal_Int32   mnDropLines;/// Number of lines in drop down 
box.
-sal_Int32   mnVal;  /// Current value of spin buttons 
and scroll bars.
-sal_Int32   mnMin;  /// Minimum value of spin buttons 
and scroll bars.
-sal_Int32   mnMax;  /// Maximum value of spin buttons 
and scroll bars.
-sal_Int32   mnInc;  /// Small increment of spin 
buttons and scroll bars.
-sal_Int32   mnPage; /// Large increment of spin 
buttons and scroll bars.
-sal_Int32   mnSelType;  /// Listbox selection type.
-sal_Int32   mnVTEdit;   /// Data type of the textbox.
-boolmbPrintObject;  /// True = print the object.
-boolmbVisible;  /// True = cell note is visible.
-boolmbDde;  /// True = object is linked 
through DDE.
-boolmbNo3D; /// True = flat style, false = 3D 
style.
-boolmbNo3D2;/// True = flat style, false = 3D 
style (listboxes and dropdowns).
-boolmbMultiLine;/// True = textbox allows line 
breaks.
-boolmbVScroll;  /// True = textbox has a vertical 
scrollbar.
-boolmbSecretEdit;   /// True = textbox is a password 
edit field.
+::rtl::OUString maAnchor;   /// Cell anchor as 
comma-separated string.
+::rtl::OUString maFmlaMacro;/// Link to macro associated to 
the control.
+::rtl::OUString maFmlaPict; /// Target cell range of picture 
links.
+::rtl::OUString maFmlaLink; /// Link to value cell associated 
to the control.
+::rtl::OUString maFmlaRange;/// Link to cell range used as 
data source for the control.
+::rtl::OUString maFmlaGroup;/// Link to value cell associated 
to a group of option buttons.
+sal_Int32   mnObjType;  /// Type of the shape.
+sal_Int32   mnTextHAlign;   /// Horizontal text alignment.
+sal_Int32   mnTextVAlign;   /// Vertical text alignment.
+sal_Int32   mnCol;  /// Column index for spreadsheet 
cell note.
+sal_Int32   mnRow;  /// Row index for spreadsheet 
cell note.
+sal_Int32   mnChecked;  /// State for checkboxes and 
option buttons.
+sal_Int32   mnDropStyle;/// Drop down box style 
(read-only or editable).
+sal_Int32   mnDropLines;/// Number of lines in drop down 
box.
+sal_Int32   mnVal;  /// Current value of spin buttons 
and scroll bars.
+sal_Int32   mnMin;  /// Minimum value of spin buttons 
and scroll bars.
+sal_Int32   mnMax;  /// Maximum value of spin buttons 
and scroll bars.
+sal_Int32   mnInc;  /// Small increment of spin 
buttons and scroll bars.
+sal_Int32   mnPage; /// Large increment of spin 
buttons and scroll bars.
+sal_Int32   mnSelType

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sw/source

2012-04-17 Thread Miklos Vajna
 sw/source/core/layout/paintfrm.cxx |   67 -
 1 file changed, 67 deletions(-)

New commits:
commit f20c1f3081c98cfb03940318e4ba7ec33f624aec
Author: Michael Stahl mst...@redhat.com
Date:   Mon Apr 16 16:12:39 2012 +0200

fdo#38635: fix border printing:

Apparently this special case in lcl_PaintLeftRightLine for printer
output devices is no longer necessary with the new drawing layer borders
and causes the vertical border lines to be far too short, leading to
visible gaps in the PDF.
(regression from 0f0896c26fb260d1bbf31d7a886df3f61837f0f2)

(cherry picked from commit 502c93143ef29989692ca3e63e3e6abc255fd53f)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 3a93e47..659606f 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4462,73 +4462,6 @@ void lcl_PaintLeftRightLine( const sal_Bool 
_bLeft,
 if ( _rAttrs.JoinedWithNext( _rFrm ) ) pBottomBorder = NULL;
 }
 
-// OD 06.05.2003 #107169# - adjustments for printer output device
-if ( bPrtOutputDev )
-{
-// substract width of outer top line.
-if ( rBox.GetTop()  (!bCnt || _rAttrs.GetTopLine( _rFrm )) )
-{
-long nDist = ::lcl_AlignHeight( rBox.GetTop()-GetOutWidth() );
-(aRect.*_rRectFn-fnSubTop)( -nDist );
-// OD 19.05.2003 #109667# - If outer top line is hair line, 
calculated
-// top has to be adjusted.
-if ( nDist == 1 )
-{
-if ( _rFrm.IsVertical() )
-{
-// right of border rectangle has to be checked and adjusted
-Point aCompPt( aRect.Right(), 0 );
-Point aRefPt( aCompPt.X() + 1, aCompPt.Y() );
-lcl_CompPxPosAndAdjustPos( *(pGlobalShell-GetOut()),
-  aRefPt, aCompPt,
-  sal_True, -1 );
-aRect.Right( aCompPt.X() );
-}
-else
-{
-// top of border rectangle has to be checked and adjusted
-Point aCompPt( 0, aRect.Top() );
-Point aRefPt( aCompPt.X(), aCompPt.Y() - 1 );
-lcl_CompPxPosAndAdjustPos( *(pGlobalShell-GetOut()),
-  aRefPt, aCompPt,
-  sal_False, +1 );
-aRect.Top( aCompPt.Y() );
-}
-}
-}
-// substract width of outer bottom line.
-if ( rBox.GetBottom()  (!bCnt || _rAttrs.GetBottomLine( _rFrm )) )
-{
-long nDist = ::lcl_AlignHeight( rBox.GetBottom()-GetOutWidth());
-(aRect.*_rRectFn-fnAddBottom)( -nDist );
-// OD 19.05.2003 #109667# - If outer bottom line is hair line, 
calculated
-// top has to be adjusted.
-if ( nDist == 1 )
-{
-if ( _rFrm.IsVertical() )
-{
-// left of border rectangle has to be checked and adjusted
-Point aCompPt( aRect.Left(), 0 );
-Point aRefPt( aCompPt.X() - 1, aCompPt.Y() );
-lcl_CompPxPosAndAdjustPos( *(pGlobalShell-GetOut()),
-  aRefPt, aCompPt,
-  sal_True, +1 );
-aRect.Left( aCompPt.X() );
-}
-else
-{
-// bottom of border rectangle has to be checked and 
adjusted
-Point aCompPt( 0, aRect.Bottom() );
-Point aRefPt( aCompPt.X(), aCompPt.Y() + 1 );
-lcl_CompPxPosAndAdjustPos( *(pGlobalShell-GetOut()),
-  aRefPt, aCompPt,
-  sal_False, -1 );
-aRect.Bottom( aCompPt.Y() );
-}
-}
-}
-}
-
 if ( !pLeftRightBorder-GetInWidth() )
 {
 // OD 06.05.2003 #107169# - add 6th parameter
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: cui/source

2012-04-17 Thread Miklos Vajna
 cui/source/dialogs/SpellDialog.cxx |   21 +
 cui/source/inc/SpellDialog.hxx |4 +++-
 2 files changed, 20 insertions(+), 5 deletions(-)

New commits:
commit 808be9732e409789f9d26c13c15bbd899c408cd0
Author: Rob Snelders r...@ertai.nl
Date:   Sat Apr 14 13:17:04 2012 +0200

fdo#40778 Remove dictionary choice when adding new entry to the spellchecker

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index 04f8185..fe1e39d 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -324,7 +324,10 @@ void SpellDialog::Init_Impl()
 aSuggestionLB.SetDoubleClickHdl( LINK( this, SpellDialog, ChangeHdl ) );
 
 aSentenceED.SetModifyHdl(LINK ( this, SpellDialog, ModifyHdl) );
-aAddToDictMB.SetSelectHdl(LINK ( this, SpellDialog, AddToDictionaryHdl ) );
+
+aAddToDictMB.SetMenuMode( MENUBUTTON_MENUMODE_TIMED );
+aAddToDictMB.SetSelectHdl(LINK ( this, SpellDialog, AddToDictSelectHdl ) );
+aAddToDictMB.SetClickHdl(LINK ( this, SpellDialog, AddToDictClickHdl ) );
 aLanguageLB.SetSelectHdl(LINK( this, SpellDialog, LanguageSelectHdl ) );
 
 aExplainLink.SetClickHdl( LINK( this, SpellDialog, HandleHyperlink ) );
@@ -1003,7 +1006,19 @@ void SpellDialog::InitUserDicts()
 }
 
 //---
-IMPL_LINK(SpellDialog, AddToDictionaryHdl, MenuButton*, pButton )
+IMPL_LINK(SpellDialog, AddToDictClickHdl, MenuButton*, pButton )
+{
+return AddToDictionaryExecute(1, pButton-GetPopupMenu());
+}
+
+//---
+IMPL_LINK(SpellDialog, AddToDictSelectHdl, MenuButton*, pButton )
+{
+return AddToDictionaryExecute(pButton-GetCurItemId(), 
pButton-GetPopupMenu());
+}
+
+//---
+int SpellDialog::AddToDictionaryExecute( sal_uInt16 nItemId, PopupMenu *pMenu )
 {
 aSentenceED.UndoActionStart( SPELLUNDO_CHANGE_GROUP );
 
@@ -1011,8 +1026,6 @@ IMPL_LINK(SpellDialog, AddToDictionaryHdl, MenuButton*, 
pButton )
 //manually changed
 const String aNewWord= aSentenceED.GetErrorText();
 
-sal_uInt16 nItemId = pButton-GetCurItemId();
-PopupMenu *pMenu = pButton-GetPopupMenu();
 String aDicName ( pMenu-GetItemText( nItemId ) );
 
 uno::Reference linguistic2::XDictionary   xDic;
diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx
index 2d9383b..f302e1f 100644
--- a/cui/source/inc/SpellDialog.hxx
+++ b/cui/source/inc/SpellDialog.hxx
@@ -212,13 +212,15 @@ private:
 DECL_LINK(CancelHdl, void *);
 DECL_LINK( ModifyHdl, SentenceEditWindow_Impl *);
 DECL_LINK(UndoHdl, void *);
-DECL_LINK( AddToDictionaryHdl, MenuButton* );
+DECL_LINK( AddToDictSelectHdl, MenuButton* );
+DECL_LINK( AddToDictClickHdl, MenuButton* );
 DECL_LINK( LanguageSelectHdl, SvxLanguageBox* );
 DECL_LINK( DialogUndoHdl, SpellUndoAction_Impl* );
 DECL_LINK( HandleHyperlink, svt::FixedHyperlink * );
 
 DECL_STATIC_LINK( SpellDialog, InitHdl, SpellDialog * );
 
+int AddToDictionaryExecute( sal_uInt16 ItemId, PopupMenu 
*pMenu );
 voidStartSpellOptDlg_Impl();
 voidInitUserDicts();
 voidUpdateBoxes_Impl();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/source

2012-04-15 Thread Miklos Vajna
 sw/source/filter/ww8/rtfexport.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 1d256da4dcbeb623c146e197bc20d3583d9bb3b8
Author: Miklos Vajna vmik...@suse.cz
Date:   Sun Apr 15 03:30:06 2012 +0200

sw: implement writing of RTF_VIEWSCALE

diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index 9d9cc37..d5a90ad 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -35,6 +35,8 @@
 #include com/sun/star/i18n/ScriptType.hdl
 
 #include docsh.hxx
+#include viewsh.hxx
+#include viewopt.hxx
 #include ndtxt.hxx
 #include fmtpdsc.hxx
 #include section.hxx
@@ -504,6 +506,13 @@ void RtfExport::ExportDocument_Impl()
 WriteInfo();
 // Default TabSize
 Strm()  m_pAttrOutput-m_aTabStop.makeStringAndClear().getStr()  
sNewLine;
+// Zoom
+ViewShell *pViewShell(pDoc-GetCurrentViewShell());
+if (pViewShell)
+{
+Strm()  OOO_STRING_SVTOOLS_RTF_VIEWSCALE;
+OutULong(pViewShell-GetViewOptions()-GetZoom());
+}
 // Page description
 WritePageDescTable();
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sw/qa writerfilter/source

2012-04-15 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo39053.rtf  |binary
 sw/qa/extras/rtftok/rtftok.cxx |   21 +++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   66 +
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |4 +
 writerfilter/source/rtftok/rtftokenizer.cxx|4 +
 5 files changed, 74 insertions(+), 21 deletions(-)

New commits:
commit 385017e0f2147d2a49e36d6c44ae76a1e7600668
Author: Miklos Vajna vmik...@suse.cz
Date:   Sun Apr 15 14:39:27 2012 +0200

testcase for fdo#39053

diff --git a/sw/qa/extras/rtftok/data/fdo39053.rtf 
b/sw/qa/extras/rtftok/data/fdo39053.rtf
new file mode 100644
index 000..71d2691
Binary files /dev/null and b/sw/qa/extras/rtftok/data/fdo39053.rtf differ
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 9fbffca..2b5146a 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -82,6 +82,7 @@ public:
 void testFdo45182();
 void testFdo44176();
 void testZoom();
+void testFdo39053();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -105,6 +106,7 @@ public:
 CPPUNIT_TEST(testFdo45182);
 CPPUNIT_TEST(testFdo44176);
 CPPUNIT_TEST(testZoom);
+CPPUNIT_TEST(testFdo39053);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -548,6 +550,25 @@ void RtfModelTest::testZoom()
 CPPUNIT_ASSERT_EQUAL(sal_Int16(42), nValue);
 }
 
+void RtfModelTest::testFdo39053()
+{
+load(fdo39053.rtf);
+
+uno::Referencedrawing::XDrawPageSupplier xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xDraws(xDrawPageSupplier-getDrawPage(), uno::UNO_QUERY);
+int nAsCharacter = 0;
+for (int i = 0; i  xDraws-getCount(); ++i)
+{
+uno::Referencebeans::XPropertySet 
xPropertySet(xDraws-getByIndex(i), uno::UNO_QUERY);
+text::TextContentAnchorType eValue;
+xPropertySet-getPropertyValue(AnchorType) = eValue;
+if (eValue == text::TextContentAnchorType_AS_CHARACTER)
+nAsCharacter++;
+}
+// The image in binary format was ignored.
+CPPUNIT_ASSERT_EQUAL(1, nAsCharacter);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit 5187174cd4054486100ef29125ee4a36f7e3bee3
Author: Miklos Vajna vmik...@suse.cz
Date:   Sun Apr 15 14:10:49 2012 +0200

fdo#39053 writerfilter: implement RTF_BIN

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index e00458d..54fdac2 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -574,34 +574,42 @@ void RTFDocumentImpl::resolve(Stream  rMapper)
 int RTFDocumentImpl::resolvePict(bool bInline)
 {
 SvMemoryStream aStream;
-int b = 0, count = 2;
+SvStream *pStream = 0;
 
-// Feed the destination text to a stream.
-OString aStr = 
OUStringToOString(m_aStates.top().aDestinationText.makeStringAndClear(), 
RTL_TEXTENCODING_ASCII_US);
-const char *str = aStr.getStr();
-for (int i = 0; i  aStr.getLength(); ++i)
+if (!m_pBinaryData.get())
 {
-char ch = str[i];
-if (ch != 0x0d  ch != 0x0a)
+pStream = aStream;
+int b = 0, count = 2;
+
+// Feed the destination text to a stream.
+OString aStr = 
OUStringToOString(m_aStates.top().aDestinationText.makeStringAndClear(), 
RTL_TEXTENCODING_ASCII_US);
+const char *str = aStr.getStr();
+for (int i = 0; i  aStr.getLength(); ++i)
 {
-b = b  4;
-sal_Int8 parsed = m_pTokenizer-asHex(ch);
-if (parsed == -1)
-return ERROR_HEX_INVALID;
-b += parsed;
-count--;
-if (!count)
-{
-aStream  (char)b;
-count = 2;
-b = 0;
+char ch = str[i];
+if (ch != 0x0d  ch != 0x0a)
+{
+b = b  4;
+sal_Int8 parsed = m_pTokenizer-asHex(ch);
+if (parsed == -1)
+return ERROR_HEX_INVALID;
+b += parsed;
+count--;
+if (!count)
+{
+aStream  (char)b;
+count = 2;
+b = 0;
+}
 }
 }
 }
+else
+pStream = m_pBinaryData.get();
 
 // Store, and get its URL.
-aStream.Seek(0);
-uno::Referenceio::XInputStream xInputStream(new 
utl::OInputStreamWrapper(aStream));
+pStream-Seek(0);
+uno::Referenceio::XInputStream xInputStream(new 
utl::OInputStreamWrapper(pStream));
 WMF_EXTERNALHEADER aExtHeader;
 aExtHeader.mapMode = m_aStates.top().aPicture.eWMetafile;
 aExtHeader.xExt = m_aStates.top().aPicture.nWidth;
@@ -736,6 +744,19 @@ int RTFDocumentImpl::resolvePict(bool bInline)
 
 int RTFDocumentImpl::resolveChars(char ch

[Libreoffice-commits] .: sw/qa writerfilter/source

2012-04-14 Thread Miklos Vajna
 sw/qa/extras/ooxmltok/data/n750935.docx |binary
 sw/qa/extras/ooxmltok/ooxmltok.cxx  |   14 ++
 writerfilter/source/dmapper/PropertyMap.cxx |   11 +--
 3 files changed, 23 insertions(+), 2 deletions(-)

New commits:
commit 0ef7dbcb365534c4203760c86d089d50f7eb9562
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 14 16:11:46 2012 +0200

dmapper: fix import of odd/even page breaks

diff --git a/sw/qa/extras/ooxmltok/data/n750935.docx 
b/sw/qa/extras/ooxmltok/data/n750935.docx
new file mode 100644
index 000..0dd0159
Binary files /dev/null and b/sw/qa/extras/ooxmltok/data/n750935.docx differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx 
b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index 5beb577..5aff21c 100644
--- a/sw/qa/extras/ooxmltok/ooxmltok.cxx
+++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx
@@ -31,7 +31,9 @@
 #include com/sun/star/text/SetVariableType.hpp
 #include com/sun/star/text/TextContentAnchorType.hpp
 #include com/sun/star/text/XDependentTextField.hpp
+#include com/sun/star/text/XPageCursor.hpp
 #include com/sun/star/text/XTextFieldsSupplier.hpp
+#include com/sun/star/text/XTextViewCursorSupplier.hpp
 
 #include test/bootstrapfixture.hxx
 #include unotest/macros_test.hxx
@@ -50,12 +52,14 @@ public:
 void testN751054();
 void testN751117();
 void testN751017();
+void testN750935();
 
 CPPUNIT_TEST_SUITE(OoxmlModelTest);
 #if !defined(MACOSX)  !defined(WNT)
 CPPUNIT_TEST(testN751054);
 CPPUNIT_TEST(testN751117);
 CPPUNIT_TEST(testN751017);
+CPPUNIT_TEST(testN750935);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -171,6 +175,16 @@ void OoxmlModelTest::testN751017()
 CPPUNIT_ASSERT(bFoundGet);
 }
 
+void OoxmlModelTest::testN750935()
+{
+load(n750935.docx);
+uno::Referenceframe::XModel xModel(mxComponent, uno::UNO_QUERY);
+uno::Referencetext::XTextViewCursorSupplier 
xTextViewCursorSupplier(xModel-getCurrentController(), uno::UNO_QUERY);
+uno::Referencetext::XPageCursor 
xCursor(xTextViewCursorSupplier-getViewCursor(), uno::UNO_QUERY);
+xCursor-jumpToLastPage();
+CPPUNIT_ASSERT_EQUAL(sal_Int16(5), xCursor-getPage());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(OoxmlModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index 471f9b8..3f6b18c 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -39,6 +39,7 @@
 #include com/sun/star/container/XEnumerationAccess.hpp
 #include com/sun/star/container/XNameContainer.hpp
 #include com/sun/star/style/BreakType.hpp
+#include com/sun/star/style/PageStyleLayout.hpp
 #include com/sun/star/text/RelOrientation.hpp
 #include com/sun/star/text/WritingMode.hpp
 #include com/sun/star/text/XTextColumns.hpp
@@ -974,8 +975,14 @@ void SectionPropertyMap::CloseSectionGroup( 
DomainMapper_Impl rDM_Impl )
 0 - No break 1 - New Colunn 2 - New page 3 - Even page 4 - odd 
page */
 xRangeProperties-setPropertyValue(rPropNameSupplier.GetName( 
PROP_PAGE_DESC_NAME ),
 uno::makeAny( m_bTitlePage ? m_sFirstPageStyleName : 
m_sFollowPageStyleName ));
-//  todo: page breaks with odd/even page numbering are not available - 
find out current page number to check how to change the number
-//  or add even/odd page break types
+// handle page breaks with odd/even page numbering
+style::PageStyleLayout nPageStyleLayout;
+if (m_nBreakType == 3)
+nPageStyleLayout = style::PageStyleLayout_LEFT;
+else if (m_nBreakType == 4)
+nPageStyleLayout = style::PageStyleLayout_RIGHT;
+if (nPageStyleLayout)
+xFollowPageStyle-setPropertyValue(PageStyleLayout, 
uno::makeAny(nPageStyleLayout));
 if(m_bPageNoRestart || m_nPageNumber = 0)
 {
 sal_Int16 nPageNumber = m_nPageNumber = 0 ? static_cast 
sal_Int16 (m_nPageNumber) : 1;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-04-14 Thread Miklos Vajna
 writerfilter/source/dmapper/PropertyIds.cxx |1 +
 writerfilter/source/dmapper/PropertyIds.hxx |1 +
 writerfilter/source/dmapper/PropertyMap.cxx |2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit fd1bef82a99de423005e1dfaf2935823a1fc74bd
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 14 16:52:36 2012 +0200

dmapper: use PropNameSupplier in SectionPropertyMap::CloseSectionGroup()

diff --git a/writerfilter/source/dmapper/PropertyIds.cxx 
b/writerfilter/source/dmapper/PropertyIds.cxx
index 64f562a..f1835c3 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -322,6 +322,7 @@ const rtl::OUString PropertyNameSupplier::GetName( 
PropertyIds eId ) const
 case PROP_FRM_DIRECTION:sName = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(FRMDirection)); break;
 case PROP_EMBEDDED_OBJECT   :sName = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(EmbeddedObject)); break;
 case PROP_IS_VISIBLE: sName = IsVisible; break;
+case PROP_PAGE_STYLE_LAYOUT: sName = PageStyleLayout; break;
 }
 ::std::pairPropertyNameMap_t::iterator,bool aInsertIt =
 m_pImpl-aNameMap.insert( PropertyNameMap_t::value_type( eId, 
sName ));
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx 
b/writerfilter/source/dmapper/PropertyIds.hxx
index c6e5369..330c1d9 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -295,6 +295,7 @@ enum PropertyIds
 /*253*/ ,PROP_FRM_DIRECTION
 ,PROP_EMBEDDED_OBJECT
 ,PROP_PARA_CONTEXT_MARGIN
+,PROP_PAGE_STYLE_LAYOUT
 };
 struct PropertyNameSupplier_Impl;
 class PropertyNameSupplier
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index 3f6b18c..72b92b3 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -982,7 +982,7 @@ void SectionPropertyMap::CloseSectionGroup( 
DomainMapper_Impl rDM_Impl )
 else if (m_nBreakType == 4)
 nPageStyleLayout = style::PageStyleLayout_RIGHT;
 if (nPageStyleLayout)
-xFollowPageStyle-setPropertyValue(PageStyleLayout, 
uno::makeAny(nPageStyleLayout));
+
xFollowPageStyle-setPropertyValue(rPropNameSupplier.GetName(PROP_PAGE_STYLE_LAYOUT),
 uno::makeAny(nPageStyleLayout));
 if(m_bPageNoRestart || m_nPageNumber = 0)
 {
 sal_Int16 nPageNumber = m_nPageNumber = 0 ? static_cast 
sal_Int16 (m_nPageNumber) : 1;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sfx2/source sw/source writerfilter/source

2012-04-14 Thread Miklos Vajna
 sfx2/source/doc/objstor.cxx  |2 +-
 sw/source/core/docnode/ndtbl.cxx |   10 +-
 sw/source/core/unocore/unotext.cxx   |4 
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |2 +-
 writerfilter/source/rtftok/rtftokenizer.cxx  |   10 ++
 5 files changed, 25 insertions(+), 3 deletions(-)

New commits:
commit 51c8c95b2864b49e7bcbd824eacedb5778a758c0
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Apr 14 12:45:38 2012 +0100

Resolves: fdo#48640 handle various busted rtf docs without hanging

(cherry picked from commit 234f150f30d881b2691288c5f5581306bd4d3d18)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index b652fe6..7a43904 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2238,7 +2238,7 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium rMedium, 
bool bInsert )
 }
 
 return xLoader-filter( aArgs );
-}catch(const uno::Exception)
+}catch(...)
 {}
 }
 
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index ba7581f..981f3c3 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1078,8 +1078,16 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange 
rRange, sal_Unicode cCh,
 
 const SwTable* SwDoc::TextToTable( const std::vector std::vectorSwNodeRange 
 rTableNodes )
 {
+if (rTableNodes.empty())
+return NULL;
+
+std::vectorSwNodeRange rFirstRange = *rTableNodes.begin();
+
+if (rFirstRange.empty())
+return NULL;
+
 /* Save first node in the selection if it is a content node. */
-SwCntntNode * pSttCntntNd = 
rTableNodes.begin()-begin()-aStart.GetNode().GetCntntNode();
+SwCntntNode * pSttCntntNd = 
rFirstRange.begin()-aStart.GetNode().GetCntntNode();
 
 /**debug**/
 #if OSL_DEBUG_LEVEL  1
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 71939e4..bd356da 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2231,6 +2231,10 @@ throw (lang::IllegalArgumentException, 
uno::RuntimeException)
 std::vectorVerticallyMergedCell aMergedCells;
 
 SwTable const*const pTable = m_pImpl-m_pDoc-TextToTable( aTableNodes );
+
+if (!pTable)
+return uno::Reference text::XTextTable ();
+
 SwXTextTable *const pTextTable = new SwXTextTable( *pTable-GetFrmFmt() );
 const uno::Reference text::XTextTable  xRet = pTextTable;
 const uno::Reference beans::XPropertySet  xPrSet = pTextTable;
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx 
b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 2331e57..b4aaf3d 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -442,7 +442,7 @@ void DomainMapperTableManager::endOfRowAction()
 double nFullWidth = m_nTableWidth;
 //the positions have to be distibuted in a range of 1
 const double nFullWidthRelative = 1.;
-if( pTableGrid-size() == nGrids )
+if( pTableGrid-size() == nGrids  m_nCell  0 )
 {
 uno::Sequence text::TableColumnSeparator  aSeparators( m_nCell - 1 );
 text::TableColumnSeparator* pSeparators = aSeparators.getArray();
diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx 
b/writerfilter/source/rtftok/rtftokenizer.cxx
index 897e316..8a0f155 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -213,6 +213,11 @@ int RTFTokenizer::resolveKeyword()
 {
 aBuf.append(ch);
 Strm()  ch;
+if (Strm().IsEof())
+{
+ch = ' ';
+break;
+}
 }
 if (aBuf.getLength()  32)
 // See RTF spec v1.9.1, page 7
@@ -237,6 +242,11 @@ int RTFTokenizer::resolveKeyword()
 {
 aParameter.append(ch);
 Strm()  ch;
+if (Strm().IsEof())
+{
+ch = ' ';
+break;
+}
 }
 nParam = aParameter.makeStringAndClear().toInt32();
 if (bNeg)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - writerfilter/debug_setup.mk writerfilter/source

2012-04-14 Thread Miklos Vajna
 writerfilter/debug_setup.mk   |1 +
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   20 
 writerfilter/source/dmapper/SettingsTable.cxx |   22 +-
 writerfilter/source/dmapper/SettingsTable.hxx |3 +++
 4 files changed, 37 insertions(+), 9 deletions(-)

New commits:
commit 8adbd3df42ee18fe58455ac92a44bca4f76444c9
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Apr 14 23:31:19 2012 +0200

dmapper: parse NS_ooxml::LN_CT_Zoom_percent token

The VisibleBottom and ZoomType properties are just set as it seems
without that, SwView::ReadUserDataSequence() ignores the ZoomFactor as
well.

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index de03396..3c4e8eb 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -74,6 +74,8 @@
 #include com/sun/star/util/XNumberFormatsSupplier.hpp
 #include com/sun/star/util/XNumberFormats.hpp
 #include com/sun/star/embed/XEmbeddedObject.hpp
+#include com/sun/star/document/XViewDataSupplier.hpp
+#include com/sun/star/container/XIndexContainer.hpp
 #include rtl/ustrbuf.hxx
 #include rtl/string.h
 #include rtl/oustringostreaminserter.hxx
@@ -3543,6 +3545,24 @@ void DomainMapper_Impl::ApplySettingsTable()
 aSpacing.Height = sal_Int16(115);
 
xTextDefaults-setPropertyValue(rSupplier.GetName(PROP_PARA_LINE_SPACING), 
uno::makeAny(aSpacing));
 }
+
+if (m_pSettingsTable-GetZoomFactor())
+{
+uno::Sequencebeans::PropertyValue aViewProps(3);
+aViewProps[0].Name = ZoomFactor;
+aViewProps[0].Value = m_pSettingsTable-GetZoomFactor();
+aViewProps[1].Name = VisibleBottom;
+aViewProps[1].Value = sal_Int32(0);
+aViewProps[2].Name = ZoomType;
+aViewProps[2].Value = sal_Int16(0);
+
+uno::Referencecontainer::XIndexContainer 
xBox(m_xComponentContext-getServiceManager()-createInstanceWithContext(com.sun.star.document.IndexedPropertyValues,
+m_xComponentContext), uno::UNO_QUERY );
+xBox-insertByIndex(sal_Int32(0), uno::makeAny(aViewProps));
+uno::Referencecontainer::XIndexAccess xIndexAccess(xBox, 
uno::UNO_QUERY);
+uno::Referencedocument::XViewDataSupplier 
xViewDataSupplier(m_xTextDocument, uno::UNO_QUERY);
+xViewDataSupplier-setViewData(xIndexAccess);
+}
 }
 catch(const uno::Exception )
 {
diff --git a/writerfilter/source/dmapper/SettingsTable.cxx 
b/writerfilter/source/dmapper/SettingsTable.cxx
index 870ce6f..1012d7b 100644
--- a/writerfilter/source/dmapper/SettingsTable.cxx
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -75,6 +75,7 @@ struct SettingsTable_Impl
 ::rtl::OUString m_sHash;
 ::rtl::OUString m_sSalt;
 boolm_bLinkStyles;
+sal_Int16   m_nZoomFactor;
 
 SettingsTable_Impl( DomainMapper rDMapper, const uno::Reference 
lang::XMultiServiceFactory  xTextFactory ) :
 m_rDMapper( rDMapper )
@@ -92,6 +93,7 @@ struct SettingsTable_Impl
 , 
m_nCryptAlgorithmType(NS_ooxml::LN_Value_wordprocessingml_ST_AlgType_typeAny)
 , m_nCryptSpinCount(0)
 , m_bLinkStyles(false)
+, m_nZoomFactor(0)
 {}
 
 };
@@ -111,16 +113,13 @@ SettingsTable::~SettingsTable()
 
 void SettingsTable::lcl_attribute(Id nName, Value  val)
 {
-(void) nName;
 int nIntValue = val.getInt();
-(void)nIntValue;
-::rtl::OUString sValue = val.getString();
-(void)sValue;
 
 switch(nName)
 {
-//case NS_ooxml:::
-//break;
+case NS_ooxml::LN_CT_Zoom_percent:
+m_pImpl-m_nZoomFactor = nIntValue;
+break;
 default:
 {
 #ifdef DEBUG_DMAPPER_SETTINGS_TABLE
@@ -226,6 +225,11 @@ bool SettingsTable::GetLinkStyles() const
 return m_pImpl-m_bLinkStyles;
 }
 
+sal_Int16 SettingsTable::GetZoomFactor() const
+{
+return m_pImpl-m_nZoomFactor;
+}
+
 void SettingsTable::ApplyProperties( uno::Reference text::XTextDocument  
xDoc )
 {
 uno::Reference beans::XPropertySet xDocProps( xDoc, uno::UNO_QUERY );
diff --git a/writerfilter/source/dmapper/SettingsTable.hxx 
b/writerfilter/source/dmapper/SettingsTable.hxx
index 79e095a..3d9a560 100644
--- a/writerfilter/source/dmapper/SettingsTable.hxx
+++ b/writerfilter/source/dmapper/SettingsTable.hxx
@@ -67,6 +67,9 @@ class WRITERFILTER_DLLPRIVATE SettingsTable : public 
LoggedProperties, public Lo
 /// Automatically update styles from document template?
 bool GetLinkStyles() const;
 
+/// What's the zoom factor set in percents?
+sal_Int16 GetZoomFactor() const;
+
 void ApplyProperties( uno::Reference text::XTextDocument  xDoc );
 
  private:
commit 9a8c2db542618b7a6d242b9d3257f23f54007682
Author

[Libreoffice-commits] .: icon-themes/human icon-themes/oxygen

2012-04-14 Thread Miklos Vajna
 icon-themes/human/cmd/lc_fliphorizontal.png  |binary
 icon-themes/human/cmd/lc_flipvertical.png|binary
 icon-themes/human/cmd/sc_fliphorizontal.png  |binary
 icon-themes/human/cmd/sc_flipvertical.png|binary
 icon-themes/oxygen/cmd/lc_fliphorizontal.png |binary
 icon-themes/oxygen/cmd/lc_flipvertical.png   |binary
 icon-themes/oxygen/cmd/sc_fliphorizontal.png |binary
 icon-themes/oxygen/cmd/sc_flipvertical.png   |binary
 8 files changed

New commits:
commit b32ae7fbaa0429bfc82fd8d82c1f437544880a08
Author: Stefan Knorr heinzless...@gmail.com
Date:   Sat Apr 14 22:20:07 2012 +0200

Correct icons for flipping images in Oxygen/Human themes

diff --git a/icon-themes/human/cmd/lc_fliphorizontal.png 
b/icon-themes/human/cmd/lc_fliphorizontal.png
index 116cad6..b02e1fd 100644
Binary files a/icon-themes/human/cmd/lc_fliphorizontal.png and 
b/icon-themes/human/cmd/lc_fliphorizontal.png differ
diff --git a/icon-themes/human/cmd/lc_flipvertical.png 
b/icon-themes/human/cmd/lc_flipvertical.png
index b02e1fd..116cad6 100644
Binary files a/icon-themes/human/cmd/lc_flipvertical.png and 
b/icon-themes/human/cmd/lc_flipvertical.png differ
diff --git a/icon-themes/human/cmd/sc_fliphorizontal.png 
b/icon-themes/human/cmd/sc_fliphorizontal.png
index 901b218..9a2994b 100644
Binary files a/icon-themes/human/cmd/sc_fliphorizontal.png and 
b/icon-themes/human/cmd/sc_fliphorizontal.png differ
diff --git a/icon-themes/human/cmd/sc_flipvertical.png 
b/icon-themes/human/cmd/sc_flipvertical.png
index 9a2994b..901b218 100644
Binary files a/icon-themes/human/cmd/sc_flipvertical.png and 
b/icon-themes/human/cmd/sc_flipvertical.png differ
diff --git a/icon-themes/oxygen/cmd/lc_fliphorizontal.png 
b/icon-themes/oxygen/cmd/lc_fliphorizontal.png
index 8e39935..6828b4d 100644
Binary files a/icon-themes/oxygen/cmd/lc_fliphorizontal.png and 
b/icon-themes/oxygen/cmd/lc_fliphorizontal.png differ
diff --git a/icon-themes/oxygen/cmd/lc_flipvertical.png 
b/icon-themes/oxygen/cmd/lc_flipvertical.png
index 6828b4d..8e39935 100644
Binary files a/icon-themes/oxygen/cmd/lc_flipvertical.png and 
b/icon-themes/oxygen/cmd/lc_flipvertical.png differ
diff --git a/icon-themes/oxygen/cmd/sc_fliphorizontal.png 
b/icon-themes/oxygen/cmd/sc_fliphorizontal.png
index 6b428d0..c9a7442 100644
Binary files a/icon-themes/oxygen/cmd/sc_fliphorizontal.png and 
b/icon-themes/oxygen/cmd/sc_fliphorizontal.png differ
diff --git a/icon-themes/oxygen/cmd/sc_flipvertical.png 
b/icon-themes/oxygen/cmd/sc_flipvertical.png
index c9a7442..6b428d0 100644
Binary files a/icon-themes/oxygen/cmd/sc_flipvertical.png and 
b/icon-themes/oxygen/cmd/sc_flipvertical.png differ
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/source

2012-04-13 Thread Miklos Vajna
 sw/source/core/text/frminf.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 63585de969d3892ddb6034cfa05284e30f97a304
Author: Philipp Weissenbacher p.weissenbac...@gmail.com
Date:   Thu Apr 12 21:07:21 2012 +0200

Convert macro to local const variable

diff --git a/sw/source/core/text/frminf.cxx b/sw/source/core/text/frminf.cxx
index 93b4c01..a9b3c48 100644
--- a/sw/source/core/text/frminf.cxx
+++ b/sw/source/core/text/frminf.cxx
@@ -279,13 +279,13 @@ sal_Bool SwTxtFrmInfo::IsBullet( xub_StrLen nTxtStart ) 
const
 // All lines (except for the first one) have the same left margin.
 // We do not want to be so picky and work with a tolerance of TOLERANCE twips.
 
-#define TOLERANCE 20
-
 SwTwips SwTxtFrmInfo::GetFirstIndent() const
 {
 SwTxtSizeInfo aInf( (SwTxtFrm*)pFrm );
 SwTxtCursor aLine( (SwTxtFrm*)pFrm, aInf );
 const SwTwips nFirst = GetLineStart( aLine );
+const SwTwips TOLERANCE = 20;
+
 if( !aLine.Next() )
 return 0;
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source unusedcode.easy

2012-04-13 Thread Miklos Vajna
 sc/source/filter/inc/stylesbuffer.hxx |   47 
 sc/source/filter/oox/stylesbuffer.cxx |  199 --
 unusedcode.easy   |   21 ---
 3 files changed, 267 deletions(-)

New commits:
commit 574fcec8cd287c868b582bc9a4e5087f6e27d83c
Author: Santiago Martinez smvar...@gmail.com
Date:   Thu Apr 12 19:59:56 2012 +0200

Remove unused code in sc.

diff --git a/sc/source/filter/inc/stylesbuffer.hxx 
b/sc/source/filter/inc/stylesbuffer.hxx
index 185ba98..4facf0f 100644
--- a/sc/source/filter/inc/stylesbuffer.hxx
+++ b/sc/source/filter/inc/stylesbuffer.hxx
@@ -278,8 +278,6 @@ public:
 /** Imports a font style flag from a DXF record. */
 voidimportDxfFlag( sal_Int32 nElement, 
SequenceInputStream rStrm );
 
-/** Imports the FONTCOLOR record from the passed stream. */
-voidimportFontColor( BiffInputStream rStrm );
 /** Sets the font attributes from the font block of a CFRULE record. */
 voidimportCfRule( BiffInputStream rStrm );
 
@@ -311,17 +309,6 @@ public:
 FontPropertyType ePropType ) const;
 
 private:
-/** Reads and sets height and flags. */
-voidimportFontData2( BiffInputStream rStrm );
-/** Reads and sets weight, escapement, underline, family, charset 
(BIFF5+). */
-voidimportFontData5( BiffInputStream rStrm );
-
-/** Reads and sets a byte string as font name. */
-voidimportFontName2( BiffInputStream rStrm );
-/** Reads and sets a Unicode string as font name. */
-voidimportFontName8( BiffInputStream rStrm );
-
-private:
 FontModel   maModel;
 ApiFontData maApiData;
 ApiFontUsedFlagsmaUsedFlags;
@@ -390,16 +377,6 @@ public:
 
 /** Sets the alignment attributes from the passed BIFF12 XF record data. */
 voidsetBiff12Data( sal_uInt32 nFlags );
-/** Sets the alignment attributes from the passed BIFF2 XF record data. */
-voidsetBiff2Data( sal_uInt8 nFlags );
-/** Sets the alignment attributes from the passed BIFF3 XF record data. */
-voidsetBiff3Data( sal_uInt16 nAlign );
-/** Sets the alignment attributes from the passed BIFF4 XF record data. */
-voidsetBiff4Data( sal_uInt16 nAlign );
-/** Sets the alignment attributes from the passed BIFF5 XF record data. */
-voidsetBiff5Data( sal_uInt16 nAlign );
-/** Sets the alignment attributes from the passed BIFF8 XF record data. */
-voidsetBiff8Data( sal_uInt16 nAlign, sal_uInt16 
nMiscAttrib );
 
 /** Final processing after import of all style settings. */
 voidfinalizeImport();
@@ -460,10 +437,6 @@ public:
 
 /** Sets the protection attributes from the passed BIFF12 XF record data. 
*/
 voidsetBiff12Data( sal_uInt32 nFlags );
-/** Sets the protection attributes from the passed BIFF2 XF record data. */
-voidsetBiff2Data( sal_uInt8 nNumFmt );
-/** Sets the protection attributes from the passed BIFF3-BIFF8 XF record 
data. */
-voidsetBiff3Data( sal_uInt16 nProt );
 
 /** Final processing after import of all style settings. */
 voidfinalizeImport();
@@ -559,14 +532,6 @@ public:
 /** Imports a border from a DXF record from the passed stream. */
 voidimportDxfBorder( sal_Int32 nElement, 
SequenceInputStream rStrm );
 
-/** Sets the border attributes from the passed BIFF2 XF record data. */
-voidsetBiff2Data( sal_uInt8 nFlags );
-/** Sets the border attributes from the passed BIFF3/BIFF4 XF record data. 
*/
-voidsetBiff3Data( sal_uInt32 nBorder );
-/** Sets the border attributes from the passed BIFF5 XF record data. */
-voidsetBiff5Data( sal_uInt32 nBorder, sal_uInt32 nArea );
-/** Sets the border attributes from the passed BIFF8 XF record data. */
-voidsetBiff8Data( sal_uInt32 nBorder1, sal_uInt32 nBorder2 
);
 /** Sets the border attributes from the border block of a CFRULE record. */
 voidimportCfRule( BiffInputStream rStrm, sal_uInt32 
nFlags );
 
@@ -691,14 +656,6 @@ public:
 /** Imports gradient stop settings from a DXF record. */
 voidimportDxfStop( SequenceInputStream rStrm );
 
-/** Sets the fill attributes from the passed BIFF2 XF record data. */
-voidsetBiff2Data( sal_uInt8 nFlags );
-/** Sets the fill attributes from the passed BIFF3/BIFF4 XF record data. */
-voidsetBiff3Data( sal_uInt16 nArea );
-/** Sets the fill attributes from the passed BIFF5 XF record data. */
-voidsetBiff5Data( sal_uInt32 nArea );
-/** Sets the fill attributes from the passed BIFF8 XF record data. */
-void  

[Libreoffice-commits] .: oox/source

2012-04-13 Thread Miklos Vajna
 oox/source/drawingml/shape.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit b8b69ab0889e24ae385cda40b0ebbb1099a4d150
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Apr 13 10:43:19 2012 +0200

oox::drawingml::Shape: OSL_TRACE - SAL_INFO

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 967f57c..51803a6 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -205,7 +205,7 @@ void Shape::addShape(
 const awt::Rectangle* pShapeRect,
 ShapeIdMap* pShapeMap )
 {
-OSL_TRACE(Shape::addShape id: %s, rtl::OUStringToOString(msId, 
RTL_TEXTENCODING_UTF8 ).getStr());
+SAL_INFO(oox, OSL_THIS_FUNC   id:   msId);
 
 try
 {
@@ -233,7 +233,7 @@ void Shape::addShape(
 
 void Shape::applyShapeReference( const Shape rReferencedShape )
 {
-OSL_TRACE(apply shape reference: %s to shape id: %s, 
rtl::OUStringToOString(rReferencedShape.msId, RTL_TEXTENCODING_UTF8 ).getStr(), 
rtl::OUStringToOString(msId, RTL_TEXTENCODING_UTF8 ).getStr());
+SAL_INFO(oox, apply shape reference:   rReferencedShape.msId   to 
shape id:   msId);
 
 if ( rReferencedShape.mpTextBody.get() )
 mpTextBody = TextBodyPtr( new TextBody( 
*rReferencedShape.mpTextBody.get() ) );
@@ -331,7 +331,7 @@ Reference XShape  Shape::createAndInsert(
 basegfx::B2DHomMatrix aParentTransformation )
 {
 bool bIsEmbMedia = false;
-OSL_TRACE(Shape::createAndInsert id: %s, rtl::OUStringToOString(msId, 
RTL_TEXTENCODING_UTF8 ).getStr());
+SAL_INFO(oox, OSL_THIS_FUNC   id:   msId);
 
 awt::Rectangle aShapeRectHmm( maPosition.X / 360, maPosition.Y / 360, 
maSize.Width / 360, maSize.Height / 360 );
 
@@ -468,7 +468,7 @@ Reference XShape  Shape::createAndInsert(
 
 if ( mbHidden || mbHiddenMasterShape )
 {
-OSL_TRACE(invisible shape with id: %s, 
rtl::OUStringToOString(msId, RTL_TEXTENCODING_UTF8 ).getStr());
+SAL_INFO(oox, invisible shape with id:   msId);
 const OUString sVisible( CREATE_OUSTRING( Visible ) );
 xSet-setPropertyValue( sVisible, Any( sal_False ) );
 }
@@ -561,7 +561,7 @@ Reference XShape  Shape::createAndInsert(
 mpCustomShapePropertiesPtr-setTextRotateAngle( 
-nTextRotateAngle / 6 );
 }
 
-OSL_TRACE(==cscode== shape name: '%s', 
rtl::OUStringToOString(msName, RTL_TEXTENCODING_UTF8 ).getStr());
+SAL_INFO(oox, ==cscode== shape name:   msName);
 mpCustomShapePropertiesPtr-pushToPropSet( rFilterBase, xSet, 
mxShape );
 }
 else if( getTextBody() )
@@ -579,7 +579,7 @@ Reference XShape  Shape::createAndInsert(
 if( pTheme )
 if( const TextCharacterProperties* pCharProps = 
pTheme-getFontStyle( pFontRef-mnThemedIdx ) )
 aCharStyleProperties.assignUsed( *pCharProps );
-OSL_TRACE(use font color);
+SAL_INFO(oox, use font color);
 aCharStyleProperties.maCharColor.assignIfUsed( 
pFontRef-maPhClr );
 }
 
@@ -615,7 +615,7 @@ void Shape::moveAllToPosition( const Point rPoint )
 
 void Shape::setMasterTextListStyle( const TextListStylePtr 
pMasterTextListStyle )
 {
-OSL_TRACE(set master text list style to shape id: %s, 
rtl::OUStringToOString(msId, RTL_TEXTENCODING_UTF8 ).getStr());
+SAL_INFO(oox, set master text list style to shape id: %s  msId);
 
 mpMasterTextListStyle = pMasterTextListStyle;
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - configure.in

2012-04-12 Thread Miklos Vajna
 configure.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3c21a3189e93837dc0f78259391733a169deb2ec
Author: Kalman Szalai - KAMI kami...@gmail.com
Date:   Sun Apr 8 11:20:44 2012 +0200

Add Barcode 1.3.5.0 extension

Barcode 1.3.5.0 release:

* LibreOffice 3.4.x-3.5.x support
* Resizeable barcodes
* CODE128 fix
(cherry picked from commit 39d8a541e623fd3ae91e28dc6dfc34411bf23b57)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/configure.in b/configure.in
index 8e45756..825edda 100644
--- a/configure.in
+++ b/configure.in
@@ -8114,7 +8114,7 @@ AC_MSG_CHECKING([for Barcode extension integration])
 BARCODE_EXTENSION_PACK=
 if test x$enable_ext_barcode = xyes -a x$enable_extension_integration != 
xno; then
 SCPDEFS=$SCPDEFS -DWITH_EXTENSION_BARCODE
-
BARCODE_EXTENSION_PACK=7e7efc5d4a03126bb9ae3ae9aa2c4e87-Barcode_1.3.1.0.oxt
+
BARCODE_EXTENSION_PACK=3ed18025a766f1e955707b969c8113a5-Barcode_1.3.5.0.oxt
 AC_MSG_RESULT([yes])
 else
 AC_MSG_RESULT([no])
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: oox/inc

2012-04-12 Thread Miklos Vajna
 oox/inc/oox/vml/vmlshape.hxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 99deffbeba414443ec7e0961501d5dcbc475b07d
Author: Miklos Vajna vmik...@suse.cz
Date:   Thu Apr 12 14:16:38 2012 +0200

oox: fix doxygen syntax to avoid misleading output in ShapeModel

diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index c6c6cb6..d11e34a 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -182,13 +182,13 @@ struct ShapeModel
 typedef ::std::auto_ptr ClientDataClientDataPtr;
 SAL_WNODEPRECATED_DECLARATIONS_POP
 
-::rtl::OUString maType; /// Shape template with default 
properties.
-PointVector maPoints;   /// Points for the polyline shape.
-TextBoxPtr  mxTextBox;  /// Text contents and properties.
-ClientDataPtr   mxClientData;   /// Excel specific client data.
-::rtl::OUString maLegacyDiagramPath;/// Legacy Diagram Fragment Path
-::rtl::OUString maFrom; /// Start point for line shape.
-::rtl::OUString maTo;   /// End point for line shape.
+::rtl::OUString maType; /// Shape template with default 
properties.
+PointVector maPoints;   /// Points for the polyline shape.
+TextBoxPtr  mxTextBox;  /// Text contents and properties.
+ClientDataPtr   mxClientData;   /// Excel specific client data.
+::rtl::OUString maLegacyDiagramPath;/// Legacy Diagram Fragment Path
+::rtl::OUString maFrom; /// Start point for line shape.
+::rtl::OUString maTo;   /// End point for line shape.
 
 explicitShapeModel();
 ~ShapeModel();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: xmloff/inc xmloff/source

2012-04-10 Thread Miklos Vajna
 xmloff/inc/xmloff/txtparae.hxx  |6 ++
 xmloff/source/text/txtparae.cxx |   92 ++--
 2 files changed, 94 insertions(+), 4 deletions(-)

New commits:
commit 7a1c5e54afe4e4ef7e17c2e9c969cd41221edc28
Author: Brennan Vincent brenn...@email.arizona.edu
Date:   Sun Apr 8 14:45:01 2012 -0700

Partial fix for bug 30711

diff --git a/xmloff/inc/xmloff/txtparae.hxx b/xmloff/inc/xmloff/txtparae.hxx
index 11e0140..c5d3e75 100644
--- a/xmloff/inc/xmloff/txtparae.hxx
+++ b/xmloff/inc/xmloff/txtparae.hxx
@@ -110,6 +110,9 @@ class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public 
XMLStyleExport
 ::std::vector XMLTextListsHelper*  maTextListsHelperStack;
 
 enum FrameType { FT_TEXT, FT_GRAPHIC, FT_EMBEDDED, FT_SHAPE };
+public:
+
+enum FieldmarkType { NONE, TEXT, CHECK }; // Used for simulating 
fieldmarks in OpenDocument 1.n Strict (for n = 2). CHECK currently ignored.
 
 protected:
 
@@ -430,7 +433,8 @@ protected:
 const ::com::sun::star::uno::Reference 
 ::com::sun::star::text::XTextRange   rTextRange,
 sal_Bool bAutoStyles,
-bool rPrevCharWasSpace );
+bool rPrevCharWasSpace,
+FieldmarkType openFieldmarkType );
 
 void exportListChange( const XMLTextNumRuleInfo rPrvInfo,
const XMLTextNumRuleInfo rNextInfo );
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 522d43f..922dce1 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -2182,6 +2182,10 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
 static OUString sMeta(RTL_CONSTASCII_USTRINGPARAM(InContentMetadata));
 bool bPrevCharIsSpace = bPrvChrIsSpc;
 
+/* This is  used for exporting to strict OpenDocument 1.2, in which case 
traditional
+ * bookmarks are used instead of fieldmarks. */
+FieldmarkType openFieldMark = NONE;
+
 while( rTextEnum-hasMoreElements() )
 {
 ReferenceXPropertySet xPropSet(rTextEnum-nextElement(), UNO_QUERY);
@@ -2196,7 +2200,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
 if( sType.equals(sText))
 {
 exportTextRange( xTxtRange, bAutoStyles,
- bPrevCharIsSpace );
+ bPrevCharIsSpace, openFieldMark);
 }
 else if( sType.equals(sTextField))
 {
@@ -2261,6 +2265,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
 }
 else if (sType.equals(sTextFieldStart))
 {
+/* As of now, textmarks are a proposed extension to the 
OpenDocument standard. */
 if ( GetExport().getDefaultVersion() == 
SvtSaveOptions::ODFVER_LATEST )
 {
 ReferenceXNamed 
xBookmark(xPropSet-getPropertyValue(sBookmark), UNO_QUERY);
@@ -2280,6 +2285,46 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
 }
 GetExport().EndElement(XML_NAMESPACE_FIELD, 
XML_FIELDMARK_START, sal_False);
 }
+/* The OpenDocument standard does not include support for 
TextMarks for now, so use bookmarks instead. */
+else
+{
+Reference ::com::sun::star::text::XFormField  
xFormField(xPropSet-getPropertyValue(sBookmark), UNO_QUERY);
+if (xFormField.is())
+{
+Reference ::com::sun::star::container::XNameAccess  
xParameters(xFormField-getParameters(), UNO_QUERY);
+if (xParameters.is()  xParameters-hasByName(Name))
+{
+const Any aValue = xParameters-getByName(Name);
+const Type aValueType = aValue.getValueType();
+if (aValueType == ::getCppuType((OUString*)0))
+{
+OUString sValue;
+aValue = sValue;
+GetExport().AddAttribute(XML_NAMESPACE_TEXT, 
XML_NAME, sValue);
+}
+}
+GetExport().StartElement(XML_NAMESPACE_TEXT, 
XML_BOOKMARK_START, sal_False);
+GetExport().EndElement(XML_NAMESPACE_TEXT, 
XML_BOOKMARK_START, sal_False);
+const OUString sFieldType = xFormField-getFieldType();
+if (sFieldType ==  ODF_FORMTEXT)
+{
+openFieldMark = TEXT;
+}
+else if (sFieldType == ODF_FORMCHECKBOX)
+{
+openFieldMark = CHECK;
+}
+else
+{
+openFieldMark = NONE;
+}
+   

[Libreoffice-commits] .: writerfilter/source

2012-04-10 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 95803f44cfa0dc62b500e931e401e0593b0c3eae
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Apr 10 15:42:23 2012 +0200

fdo#47802 fix crash on RTF import of shapes inside tables

We already ignore textframes inside tables, the same should be done with
textboxes till they can be handled properly.

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 6277004..729e569 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1128,7 +1128,11 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 m_aStates.top().nDestinationState = DESTINATION_SHAPE;
 break;
 case RTF_SHPINST:
-m_aStates.top().nDestinationState = DESTINATION_SHAPEINSTRUCTION;
+// Don't try to support shapes inside tables for now.
+if (m_pCurrentBuffer != m_aTableBuffer)
+m_aStates.top().nDestinationState = 
DESTINATION_SHAPEINSTRUCTION;
+else
+m_aStates.top().nDestinationState = DESTINATION_SKIP;
 break;
 case RTF_NESTTABLEPROPS:
 m_aStates.top().nDestinationState = 
DESTINATION_NESTEDTABLEPROPERTIES;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-04-06 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   19 ++-
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |2 --
 2 files changed, 6 insertions(+), 15 deletions(-)

New commits:
commit 1a3ab52289338c4f07fc9fee3f9022be114d2553
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Apr 6 10:07:43 2012 +0200

rtftok: drop m_bIsSubstream, we already have a m_pSuperstream

Originally there was m_bIsSubstream (true for footnotes, headers, etc.),
then we needed a pointer to the original stream, now the boolean value
is redundant, so remove it.

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index e938f98..c244746 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -260,7 +260,6 @@ 
RTFDocumentImpl::RTFDocumentImpl(uno::Referenceuno::XComponentContext const x
 m_aShapetextBuffer(),
 m_pCurrentBuffer(0),
 m_bHasFootnote(false),
-m_bIsSubstream(false),
 m_pSuperstream(0),
 m_nHeaderFooterPositions(),
 m_nGroupStartPos(0),
@@ -312,11 +311,6 @@ Stream RTFDocumentImpl::Mapper()
 return *m_pMapperStream;
 }
 
-void RTFDocumentImpl::setSubstream(bool bIsSubtream)
-{
-m_bIsSubstream = bIsSubtream;
-}
-
 void RTFDocumentImpl::setSuperstream(RTFDocumentImpl *pSuperstream)
 {
 m_pSuperstream = pSuperstream;
@@ -329,7 +323,7 @@ void RTFDocumentImpl::setAuthor(rtl::OUString rAuthor)
 
 bool RTFDocumentImpl::isSubstream() const
 {
-return m_bIsSubstream;
+return m_pSuperstream != 0;
 }
 
 void RTFDocumentImpl::finishSubstream()
@@ -360,7 +354,6 @@ void RTFDocumentImpl::resolveSubstream(sal_uInt32 nPos, Id 
nId, OUString rIgnor
 sal_uInt32 nCurrent = Strm().Tell();
 // Seek to header position, parse, then seek back.
 RTFDocumentImpl::Pointer_t pImpl(new RTFDocumentImpl(m_xContext, 
m_xInputStream, m_xDstDoc, m_xFrame, m_xStatusIndicator));
-pImpl-setSubstream(true);
 pImpl-setSuperstream(this);
 pImpl-setIgnoreFirst(rIgnoreFirst);
 if (!m_aAuthor.isEmpty())
@@ -388,7 +381,7 @@ void RTFDocumentImpl::checkFirstRun()
 writerfilter::ReferenceTable::Pointer_t const pTable(new 
RTFReferenceTable(aSettingsTableEntries));
 Mapper().table(NS_ooxml::LN_settings_settings, pTable);
 // start initial paragraph
-if (!m_bIsSubstream)
+if (!m_pSuperstream)
 Mapper().startSectionGroup();
 Mapper().startParagraphGroup();
 m_bFirstRun = false;
@@ -499,7 +492,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal = false)
 // The trick is that we send properties of the previous section right now, 
which will be exactly what dmapper expects.
 Mapper().props(pProperties);
 Mapper().endParagraphGroup();
-if (!m_bIsSubstream)
+if (!m_pSuperstream)
 Mapper().endSectionGroup();
 if (!bFinal)
 {
@@ -1149,7 +1142,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 case RTF_FOOTERL:
 case RTF_FOOTERR:
 case RTF_FOOTERF:
-if (!m_bIsSubstream)
+if (!m_pSuperstream)
 {
 Id nId = 0;
 sal_uInt32 nPos = m_nGroupStartPos - 1;
@@ -1170,7 +1163,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 }
 break;
 case RTF_FOOTNOTE:
-if (!m_bIsSubstream)
+if (!m_pSuperstream)
 {
 Id nId = NS_rtf::LN_footnote;
 
@@ -1227,7 +1220,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 m_aStates.top().nDestinationState = DESTINATION_REVISIONTABLE;
 break;
 case RTF_ANNOTATION:
-if (!m_bIsSubstream)
+if (!m_pSuperstream)
 {
 resolveSubstream(m_nGroupStartPos - 1, NS_rtf::LN_annotation);
 m_aStates.top().nDestinationState = DESTINATION_SKIP;
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 1d72ece..e66f22e 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -441,8 +441,6 @@ namespace writerfilter {
 RTFBuffer_t* m_pCurrentBuffer;
 
 bool m_bHasFootnote;
-/// If this is a substream.
-bool m_bIsSubstream;
 /// Superstream of this substream.
 RTFDocumentImpl *m_pSuperstream;
 std::queue std::pairId, sal_uInt32  
m_nHeaderFooterPositions;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - writerfilter/source

2012-04-06 Thread Miklos Vajna
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 2ff3c94c471ee586c733121e528e9623c4344224
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Tue Dec 20 16:27:46 2011 +0100

fdo#47036 n#703032 RTF/DOCX import: fixed the import of consecutive frames

When we have two consecutive paragraphs with different frame properties,
the second frame wasn't created. Now store the current paragraph
properties in order to create the frame later.

(cherry picked from commit e040d2931658b411bfbd1c668dc96422374a74be)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index bc38966..5461a99 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1010,6 +1010,13 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr 
pPropertyMap )
 {
 //handles (8)(9) and completes (6)
 CheckUnregisteredFrameConversion( );
+
+// If different frame properties are set on this 
paragraph, keep them.
+if ( !bIsDropCap  pParaContext-IsFrameMode() )
+{
+pToBeSavedProperties.reset( new 
ParagraphProperties(*pParaContext) );
+lcl_AddRangeAndStyle(pToBeSavedProperties, 
xTextAppend, pPropertyMap);
+}
 }
 
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/qa

2012-04-06 Thread Miklos Vajna
 sw/qa/extras/ooxmltok/data/n751017.docx |binary
 sw/qa/extras/ooxmltok/ooxmltok.cxx  |   52 
 2 files changed, 52 insertions(+)

New commits:
commit 46e7e5a505ddc2933316ba1d42895155a26e8b67
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Apr 6 16:55:34 2012 +0200

n#751017 testcase

diff --git a/sw/qa/extras/ooxmltok/data/n751017.docx 
b/sw/qa/extras/ooxmltok/data/n751017.docx
new file mode 100644
index 000..cdd81cf
Binary files /dev/null and b/sw/qa/extras/ooxmltok/data/n751017.docx differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx 
b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index 364d66d..5beb577 100644
--- a/sw/qa/extras/ooxmltok/ooxmltok.cxx
+++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx
@@ -28,7 +28,10 @@
 #include com/sun/star/beans/XPropertySet.hpp
 #include com/sun/star/drawing/XDrawPageSupplier.hpp
 #include com/sun/star/lang/XServiceInfo.hpp
+#include com/sun/star/text/SetVariableType.hpp
 #include com/sun/star/text/TextContentAnchorType.hpp
+#include com/sun/star/text/XDependentTextField.hpp
+#include com/sun/star/text/XTextFieldsSupplier.hpp
 
 #include test/bootstrapfixture.hxx
 #include unotest/macros_test.hxx
@@ -46,11 +49,13 @@ public:
 virtual void tearDown();
 void testN751054();
 void testN751117();
+void testN751017();
 
 CPPUNIT_TEST_SUITE(OoxmlModelTest);
 #if !defined(MACOSX)  !defined(WNT)
 CPPUNIT_TEST(testN751054);
 CPPUNIT_TEST(testN751117);
+CPPUNIT_TEST(testN751017);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -119,6 +124,53 @@ void OoxmlModelTest::testN751117()
 
CPPUNIT_ASSERT(xServiceInfo-supportsService(com.sun.star.drawing.LineShape));
 }
 
+void OoxmlModelTest::testN751017()
+{
+load(n751017.docx);
+uno::Referencetext::XTextFieldsSupplier xTextFieldsSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XNameAccess 
xMasters(xTextFieldsSupplier-getTextFieldMasters());
+// Make sure we have a variable named foo.
+
CPPUNIT_ASSERT(xMasters-hasByName(com.sun.star.text.FieldMaster.SetExpression.foo));
+
+uno::Referencecontainer::XEnumerationAccess 
xFieldsAccess(xTextFieldsSupplier-getTextFields());
+uno::Referencecontainer::XEnumeration 
xFields(xFieldsAccess-createEnumeration());
+bool bFoundSet(false), bFoundGet(false);
+while (xFields-hasMoreElements())
+{
+uno::Referencelang::XServiceInfo 
xServiceInfo(xFields-nextElement(), uno::UNO_QUERY);
+uno::Referencebeans::XPropertySet xPropertySet(xServiceInfo, 
uno::UNO_QUERY);
+sal_Int16 nValue = 0;
+OUString aValue;
+if 
(xServiceInfo-supportsService(com.sun.star.text.TextField.SetExpression))
+{
+bFoundSet = true;
+uno::Referencetext::XDependentTextField 
xDependentTextField(xServiceInfo, uno::UNO_QUERY);
+uno::Referencebeans::XPropertySet 
xMasterProps(xDependentTextField-getTextFieldMaster());
+
+// First step: did we set foo to bar?
+xMasterProps-getPropertyValue(Name) = aValue;
+CPPUNIT_ASSERT_EQUAL(OUString(foo), aValue);
+xPropertySet-getPropertyValue(SubType) = nValue;
+CPPUNIT_ASSERT_EQUAL(text::SetVariableType::STRING, nValue);
+xPropertySet-getPropertyValue(Content) = aValue;
+CPPUNIT_ASSERT_EQUAL(OUString(bar), aValue);
+}
+else if 
(xServiceInfo-supportsService(com.sun.star.text.TextField.GetExpression))
+{
+// Second step: check the value of foo.
+bFoundGet = true;
+xPropertySet-getPropertyValue(Content) = aValue;
+CPPUNIT_ASSERT_EQUAL(OUString(foo), aValue);
+xPropertySet-getPropertyValue(SubType) = nValue;
+CPPUNIT_ASSERT_EQUAL(text::SetVariableType::STRING, nValue);
+xPropertySet-getPropertyValue(CurrentPresentation) = aValue;
+CPPUNIT_ASSERT_EQUAL(OUString(bar), aValue);
+}
+}
+CPPUNIT_ASSERT(bFoundSet);
+CPPUNIT_ASSERT(bFoundGet);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(OoxmlModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-04-05 Thread Miklos Vajna
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   25 +-
 writerfilter/source/dmapper/PropertyIds.cxx   |1 
 writerfilter/source/dmapper/PropertyIds.hxx   |1 
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 1cb273098188b5749109b8f58516e7003600a704
Author: Miklos Vajna vmik...@suse.cz
Date:   Thu Apr 5 12:06:39 2012 +0200

n#751017 dmapper: fix handling of GetExpression and SetExpression fields

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 5ba7ddc..5b1f4d2 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2157,6 +2157,8 @@ void DomainMapper_Impl::handleFieldAsk
 uno::Reference beans::XPropertySet  xMaster =
 FindOrCreateFieldMaster
 (com.sun.star.text.FieldMaster.SetExpression, sVariable );
+// An ASK field is always a string of characters
+xMaster-setPropertyValue(rPropNameSupplier.GetName(PROP_SUB_TYPE), 
uno::makeAny(text::SetVariableType::STRING));
 
 // attach the master to the field
 uno::Reference text::XDependentTextField  xDependentField
@@ -2170,6 +2172,9 @@ void DomainMapper_Impl::handleFieldAsk
 xFieldProperties-setPropertyValue(
 rPropNameSupplier.GetName(PROP_HINT),
 uno::makeAny( sHint ));
+
xFieldProperties-setPropertyValue(rPropNameSupplier.GetName(PROP_SUB_TYPE), 
uno::makeAny(text::SetVariableType::STRING));
+// The ASK has no field value to display
+
xFieldProperties-setPropertyValue(rPropNameSupplier.GetName(PROP_IS_VISIBLE), 
uno::makeAny(sal_False));
 }
 else
 {
@@ -2889,6 +2894,13 @@ void DomainMapper_Impl::CloseFieldCommand()
 bool bPageRef = aIt-second.eFieldId == FIELD_PAGEREF;
 ::rtl::OUString sBookmark = 
lcl_ExtractParameter(pContext-GetCommand(),
 (bPageRef ? sizeof( PAGEREF) : sizeof( 
REF)));
+
+// Do we need a GetReference (default) or a 
GetExpression field?
+uno::Reference text::XTextFieldsSupplier  
xFieldsSupplier( GetTextDocument(), uno::UNO_QUERY );
+uno::Reference container::XNameAccess  
xFieldMasterAccess = xFieldsSupplier-getTextFieldMasters();
+
+if 
(!xFieldMasterAccess-hasByName(com.sun.star.text.FieldMaster.SetExpression. 
+ sBookmark))
+{
 xFieldProperties-setPropertyValue(
 
rPropNameSupplier.GetName(PROP_REFERENCE_FIELD_SOURCE),
 uno::makeAny( 
sal_Int16(text::ReferenceFieldSource::BOOKMARK)) );
@@ -2919,6 +2931,14 @@ void DomainMapper_Impl::CloseFieldCommand()
 }
 xFieldProperties-setPropertyValue(
 rPropNameSupplier.GetName( 
PROP_REFERENCE_FIELD_PART ), uno::makeAny( nFieldPart ));
+}
+else
+{
+xFieldInterface = 
m_xTextFactory-createInstance(com.sun.star.text.TextField.GetExpression);
+xFieldProperties.set(xFieldInterface, 
uno::UNO_QUERY);
+
xFieldProperties-setPropertyValue(rPropNameSupplier.GetName(PROP_CONTENT), 
uno::makeAny(sBookmark));
+
xFieldProperties-setPropertyValue(rPropNameSupplier.GetName(PROP_SUB_TYPE), 
uno::makeAny(text::SetVariableType::STRING));
+}
 }
 break;
 case FIELD_REVNUM   : break;
@@ -3067,8 +3087,11 @@ void DomainMapper_Impl::SetFieldResult( ::rtl::OUString 
rResult )
 else
 {
 uno::Reference beans::XPropertySet  
xFieldProperties( xTextField, uno::UNO_QUERY_THROW);
+// In case of SetExpression, the field result contains 
the content of the variable.
+uno::Referencelang::XServiceInfo 
xServiceInfo(xTextField, uno::UNO_QUERY);
+bool bIsSetExpression = 
xServiceInfo-supportsService(com.sun.star.text.TextField.SetExpression);
 xFieldProperties-setPropertyValue(
-
rPropNameSupplier.GetName(PROP_CURRENT_PRESENTATION),
+rPropNameSupplier.GetName(bIsSetExpression ? 
PROP_CONTENT : PROP_CURRENT_PRESENTATION),
  uno::makeAny( rResult ));
 }
 }
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx 
b/writerfilter/source/dmapper/PropertyIds.cxx
index 4c176cb..64f562a 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -321,6

[Libreoffice-commits] .: 3 commits - sw/qa writerfilter/source

2012-04-03 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo47107.rtf  |   21 
 sw/qa/extras/rtftok/rtftok.cxx |   14 ++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |  122 +
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |5 -
 4 files changed, 161 insertions(+), 1 deletion(-)

New commits:
commit 63b78e6db15a76b9e928cb4a7d0d995bd12f9bf4
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Apr 3 15:07:06 2012 +0200

testcase for fdo#47107

diff --git a/sw/qa/extras/rtftok/data/fdo47107.rtf 
b/sw/qa/extras/rtftok/data/fdo47107.rtf
new file mode 100644
index 000..74371cd
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo47107.rtf
@@ -0,0 +1,21 @@
+{\rtf1
+{\fonttbl
+{\f1 Symbol;}
+}
+\pard \fi-283\li283
+{\*\pn \pnlvlbody\pndec\pnstart1
+{\pntxta .}
+}
+{Alpha
+\par 
+Beta
+\par }
+\pard \fi-283\li283
+{\*\pn \pnlvlblt\pnf1\pnstart1
+{\pntxtb \'b7}
+}
+{Alpha
+\par 
+Beta
+\par }
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index ac7a2e4..45eabbf 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -76,6 +76,7 @@ public:
 void testFdo46955();
 void testFdo45394();
 void testFdo48104();
+void testFdo47107();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -95,6 +96,7 @@ public:
 CPPUNIT_TEST(testFdo46955);
 CPPUNIT_TEST(testFdo45394);
 CPPUNIT_TEST(testFdo48104);
+CPPUNIT_TEST(testFdo47107);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -486,6 +488,18 @@ void RtfModelTest::testFdo48104()
 CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
+void RtfModelTest::testFdo47107()
+{
+load(fdo47107.rtf);
+
+uno::Referencestyle::XStyleFamiliesSupplier 
xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Referencecontainer::XNameAccess 
xStyles(xStyleFamiliesSupplier-getStyleFamilies(), uno::UNO_QUERY);
+uno::Referencecontainer::XNameAccess 
xNumberingStyles(xStyles-getByName(OUString(RTL_CONSTASCII_USTRINGPARAM(NumberingStyles))),
 uno::UNO_QUERY);
+// Make sure numbered and bullet legacy syntax is recognized, this used to 
throw a NoSuchElementException
+xNumberingStyles-getByName(WWNum1);
+xNumberingStyles-getByName(WWNum2);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit ea04bbd697ad984cc4e39ed42994a072f052ba36
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Apr 3 11:53:59 2012 +0200

fdo#47107 rtftok: support bullet points in paragraph numberings

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 51f7b5e..5ceeaeb 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -893,6 +893,7 @@ void RTFDocumentImpl::text(OUString rString)
 case DESTINATION_ANNOTATIONAUTHOR:
 case DESTINATION_FALT:
 case DESTINATION_PARAGRAPHNUMBERING_TEXTAFTER:
+case DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE:
 m_aStates.top().aDestinationText.append(rString);
 break;
 case DESTINATION_EQINSTRUCTION:
@@ -1321,6 +1322,9 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 case RTF_PNTXTA:
 m_aStates.top().nDestinationState = 
DESTINATION_PARAGRAPHNUMBERING_TEXTAFTER;
 break;
+case RTF_PNTXTB:
+m_aStates.top().nDestinationState = 
DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE;
+break;
 default:
 SAL_INFO(writerfilter, OSL_THIS_FUNC  : TODO handle 
destination '  lcl_RtfToString(nKeyword)  ');
 // Make sure we skip destinations (even without \*) till we don't 
handle them
@@ -2083,6 +2087,12 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 
m_aStates.top().aTableSprms-push_back(make_pair(NS_rtf::LN_NFC, pValue));
 }
 break;
+case RTF_PNLVLBLT:
+{
+
m_aStates.top().aTableAttributes-push_back(make_pair(NS_rtf::LN_LSID, 
RTFValue::Pointer_t(new RTFValue(1;
+
m_aStates.top().aTableSprms-push_back(make_pair(NS_rtf::LN_NFC, 
RTFValue::Pointer_t(new RTFValue(23; // bullets, same as \levelnfc23
+}
+break;
 default:
 SAL_INFO(writerfilter, OSL_THIS_FUNC  : TODO handle flag ' 
 lcl_RtfToString(nKeyword)  ');
 aSkip.setParsed(false);
@@ -2735,6 +2745,13 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, 
int nParam)
 case RTF_PNSTART:
 
m_aStates.top().aTableSprms-push_back(make_pair(NS_rtf::LN_ISTARTAT, 
pIntValue));
 break;
+case RTF_PNF:
+{
+int nFontIndex = getFontIndex(nParam);
+RTFValue::Pointer_t pValue(new RTFValue(nFontIndex));
+lcl_putNestedSprm(m_aStates.top().aTableSprms, 
NS_ooxml::LN_CT_Lvl_rPr, NS_sprm::LN_CRgFtc0

[Libreoffice-commits] .: sw/qa writerfilter/source

2012-04-03 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo45182.rtf  |   11 +++
 sw/qa/extras/rtftok/rtftok.cxx |   15 +++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   17 +++--
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |2 ++
 4 files changed, 43 insertions(+), 2 deletions(-)

New commits:
commit f4e0cbaa15c2861e87149a62c9c80a9e9b4094b3
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Apr 3 16:49:41 2012 +0200

fdo#45182 fix RTF import of character encoding in footnotes

There were two problems here:

1) \plain reset the character properties, but did not touch the current 
encoding
2) the default properties were not passed to substreams

diff --git a/sw/qa/extras/rtftok/data/fdo45182.rtf 
b/sw/qa/extras/rtftok/data/fdo45182.rtf
new file mode 100644
index 000..b076106
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo45182.rtf
@@ -0,0 +1,11 @@
+{\rtf1\deff0
+{\fonttbl
+{\f0\fcharset238
+Times New Roman;}
+}
+a\chftn 
+{\footnote 
+\ltrpar \pard\plain\'9eivnost\'ed
+\par
+}
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 45eabbf..9267967 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -35,6 +35,7 @@
 #include com/sun/star/text/RelOrientation.hpp
 #include com/sun/star/text/SizeType.hpp
 #include com/sun/star/text/TextContentAnchorType.hpp
+#include com/sun/star/text/XFootnotesSupplier.hpp
 #include com/sun/star/text/XPageCursor.hpp
 #include com/sun/star/text/XTextDocument.hpp
 #include com/sun/star/text/XTextGraphicObjectsSupplier.hpp
@@ -77,6 +78,7 @@ public:
 void testFdo45394();
 void testFdo48104();
 void testFdo47107();
+void testFdo45182();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -97,6 +99,7 @@ public:
 CPPUNIT_TEST(testFdo45394);
 CPPUNIT_TEST(testFdo48104);
 CPPUNIT_TEST(testFdo47107);
+CPPUNIT_TEST(testFdo45182);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -500,6 +503,18 @@ void RtfModelTest::testFdo47107()
 xNumberingStyles-getByName(WWNum2);
 }
 
+void RtfModelTest::testFdo45182()
+{
+load(fdo45182.rtf);
+
+uno::Referencetext::XFootnotesSupplier xFootnotesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xFootnotes(xFootnotesSupplier-getFootnotes(), uno::UNO_QUERY);
+uno::Referencetext::XTextRange xTextRange(xFootnotes-getByIndex(0), 
uno::UNO_QUERY);
+// Encoding in the footnote was wrong.
+OUString aExpected(živností, 10, RTL_TEXTENCODING_UTF8);
+CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange-getString());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5ceeaeb..e938f98 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -541,6 +541,14 @@ int RTFDocumentImpl::getFontIndex(int nIndex)
 return m_pSuperstream-getFontIndex(nIndex);
 }
 
+RTFParserState RTFDocumentImpl::getDefaultState()
+{
+if (!m_pSuperstream)
+return m_aDefaultState;
+else
+return m_pSuperstream-getDefaultState();
+}
+
 void RTFDocumentImpl::resolve(Stream  rMapper)
 {
 m_pMapperStream = rMapper;
@@ -1762,8 +1770,13 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 m_aStates.top().nCurrentEncoding = RTL_TEXTENCODING_MS_1252;
 break;
 case RTF_PLAIN:
-m_aStates.top().aCharacterSprms = m_aDefaultState.aCharacterSprms;
-m_aStates.top().aCharacterAttributes = 
m_aDefaultState.aCharacterAttributes;
+{
+m_aStates.top().aCharacterSprms = 
getDefaultState().aCharacterSprms;
+RTFValue::Pointer_t pValue = 
m_aStates.top().aCharacterSprms.find(NS_sprm::LN_CRgFtc0);
+if (pValue.get())
+m_aStates.top().nCurrentEncoding = 
getEncoding(pValue-getInt());
+m_aStates.top().aCharacterAttributes = 
getDefaultState().aCharacterAttributes;
+}
 break;
 case RTF_PARD:
 m_aStates.top().aParagraphSprms = m_aDefaultState.aParagraphSprms;
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 1747958..1d72ece 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -372,6 +372,8 @@ namespace writerfilter {
 int getFontIndex(int nIndex);
 /// Return the encoding associated with a dmapper font index.
 rtl_TextEncoding getEncoding(sal_uInt32 nFontIndex);
+/// Get the default parser state.
+RTFParserState getDefaultState();
 
 private:
 SvStream Strm();
___
Libreoffice

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - oox/inc oox/source

2012-04-02 Thread Miklos Vajna
 oox/inc/oox/vml/vmlshape.hxx   |1 +
 oox/source/token/properties.txt|2 ++
 oox/source/vml/vmlshape.cxx|9 -
 oox/source/vml/vmlshapecontext.cxx |1 +
 4 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit f1afee4b1f40d45b6b4a11e7b1bfe5253627e80f
Author: Cédric Bosdonnat cedric.bosdonnat@free.fr
Date:   Fri Mar 23 15:28:29 2012 +0100

n#751573: docx, no mso-fit-shape-to-text means the textbox size is fixed

(cherry picked from commit 3751ab6910d06ca01d1980fce40792560afc9ebb)

Conflicts:

oox/inc/oox/vml/vmlshape.hxx
oox/source/vml/vmlshapecontext.cxx

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index 65683f7..1926a08 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -78,6 +78,7 @@ struct ShapeTypeModel
 ::rtl::OUString maHeight;   /// Height of the shape 
bounding box (number with unit).
 ::rtl::OUString maMarginLeft;   /// X position of the shape 
bounding box to shape anchor (number with unit).
 ::rtl::OUString maMarginTop;/// Y position of the shape 
bounding box to shape anchor (number with unit).
+sal_BoolmbAutoHeight;   /// If true, the height value 
is a minimum value (mostly used for textboxes)
 
 StrokeModel maStrokeModel;  /// Border line formatting.
 FillModel   maFillModel;/// Shape fill formatting.
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 9127c38..b754f1d 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -179,6 +179,7 @@ FooterIsDynamicHeight
 FooterIsOn
 FooterIsShared
 FormulaConvention
+FrameIsAutomaticHeight
 Function
 GapwidthSequence
 Geometry3D
@@ -416,6 +417,7 @@ Size
 Size100thMM
 SizePixel
 SizeProtect
+SizeType
 SkipDuplicates
 SortInfo
 Sound
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index b9bd653..4f1b40f 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -170,7 +170,8 @@ void lclSetXShapeRect( const Reference XShape  rxShape, 
const Rectangle rSha
 
 // 
 
-ShapeTypeModel::ShapeTypeModel()
+ShapeTypeModel::ShapeTypeModel():
+mbAutoHeight( sal_False )
 {
 }
 
@@ -425,6 +426,12 @@ Reference XShape  SimpleShape::implConvertAndInsert( 
const Reference XShapes
 Reference XShape  xShape = mrDrawing.createAndInsertXShape( maService, 
rxShapes, rShapeRect );
 convertShapeProperties( xShape );
 
+if ( maService.equalsAscii( com.sun.star.text.TextFrame ) )
+{
+PropertySet( xShape ).setAnyProperty( PROP_FrameIsAutomaticHeight, 
makeAny( maTypeModel.mbAutoHeight ) );
+PropertySet( xShape ).setAnyProperty( PROP_SizeType, makeAny( 
maTypeModel.mbAutoHeight ? SizeType::MIN : SizeType::FIX ) );
+}
+
 // Import Legacy Fragments (if any)
 if( xShape.is()  !maShapeModel.maLegacyDiagramPath.isEmpty() )
 {
diff --git a/oox/source/vml/vmlshapecontext.cxx 
b/oox/source/vml/vmlshapecontext.cxx
index 6980ce3..cb64424 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -346,6 +346,7 @@ void ShapeTypeContext::setStyle( const OUString rStyle )
 else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( height 
) ) )mrTypeModel.maHeight = aValue;
 else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( 
margin-left ) ) )   mrTypeModel.maMarginLeft = aValue;
 else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( 
margin-top ) ) )mrTypeModel.maMarginTop = aValue;
+else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( 
mso-fit-shape-to-text ) ) )  mrTypeModel.mbAutoHeight = sal_True;
 }
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sw/qa writerfilter/source

2012-04-02 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo48104.rtf  |6 ++
 sw/qa/extras/rtftok/rtftok.cxx |   25 -
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   18 +-
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |2 --
 4 files changed, 31 insertions(+), 20 deletions(-)

New commits:
commit 0f330ea25840690d05516adc20cfb3d1a9d33317
Author: Miklos Vajna vmik...@suse.cz
Date:   Mon Apr 2 14:24:53 2012 +0200

RtfModelTest: introduce common getPages() method

diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 7f9b498..ac7a2e4 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -103,6 +103,8 @@ private:
 void load(const OUString rURL);
 /// Get the length of the whole document.
 int getLength();
+/// Get page count.
+int getPages();
 uno::Referencelang::XComponent mxComponent;
 };
 
@@ -130,6 +132,15 @@ int RtfModelTest::getLength()
 return aBuf.getLength();
 }
 
+int RtfModelTest::getPages()
+{
+uno::Referenceframe::XModel xModel(mxComponent, uno::UNO_QUERY);
+uno::Referencetext::XTextViewCursorSupplier 
xTextViewCursorSupplier(xModel-getCurrentController(), uno::UNO_QUERY);
+uno::Referencetext::XPageCursor 
xCursor(xTextViewCursorSupplier-getViewCursor(), uno::UNO_QUERY);
+xCursor-jumpToLastPage();
+return xCursor-getPage();
+}
+
 void RtfModelTest::setUp()
 {
 test::BootstrapFixture::setUp();
@@ -382,11 +393,7 @@ void RtfModelTest::testFdo43965()
 CPPUNIT_ASSERT_EQUAL(sal_uInt32(26), aBorder.LineWidth);
 
 // Finally, make sure that we have two pages
-uno::Referenceframe::XModel xModel(mxComponent, uno::UNO_QUERY);
-uno::Referencetext::XTextViewCursorSupplier 
xTextViewCursorSupplier(xModel-getCurrentController(), uno::UNO_QUERY);
-uno::Referencetext::XPageCursor 
xCursor(xTextViewCursorSupplier-getViewCursor(), uno::UNO_QUERY);
-xCursor-jumpToLastPage();
-CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor-getPage());
+CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
 void RtfModelTest::testN751020()
@@ -476,11 +483,7 @@ void RtfModelTest::testFdo45394()
 void RtfModelTest::testFdo48104()
 {
 load(OUString(RTL_CONSTASCII_USTRINGPARAM(fdo48104.rtf)));
-uno::Referenceframe::XModel xModel(mxComponent, uno::UNO_QUERY);
-uno::Referencetext::XTextViewCursorSupplier 
xTextViewCursorSupplier(xModel-getCurrentController(), uno::UNO_QUERY);
-uno::Referencetext::XPageCursor 
xCursor(xTextViewCursorSupplier-getViewCursor(), uno::UNO_QUERY);
-xCursor-jumpToLastPage();
-CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor-getPage());
+CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
commit 7b58fc3dafc789aa55fff5ffef6ab83c3aa8b6e0
Author: Miklos Vajna vmik...@suse.cz
Date:   Mon Apr 2 14:10:39 2012 +0200

fdo#48104 fix RTF import of \page in inner groups

If we have a postponed page break and it's sent to dmapper during a new
inner group, we'll still have the page break request after the parser
state is popped, leading to duplicated page breaks. Instead of the
earlier workaround, just send the proper token to the domain mapper, and
it'll handle it properly.

diff --git a/sw/qa/extras/rtftok/data/fdo48104.rtf 
b/sw/qa/extras/rtftok/data/fdo48104.rtf
new file mode 100644
index 000..64d5e59
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo48104.rtf
@@ -0,0 +1,6 @@
+{\rtf1
+first page\par
+\page 
+{second page first line\par}
+second page second line\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index f13e15d..7f9b498 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -75,6 +75,7 @@ public:
 void testFdo47036();
 void testFdo46955();
 void testFdo45394();
+void testFdo48104();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -93,6 +94,7 @@ public:
 CPPUNIT_TEST(testFdo47036);
 CPPUNIT_TEST(testFdo46955);
 CPPUNIT_TEST(testFdo45394);
+CPPUNIT_TEST(testFdo48104);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -471,6 +473,16 @@ void RtfModelTest::testFdo45394()
 CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess-getCount());
 }
 
+void RtfModelTest::testFdo48104()
+{
+load(OUString(RTL_CONSTASCII_USTRINGPARAM(fdo48104.rtf)));
+uno::Referenceframe::XModel xModel(mxComponent, uno::UNO_QUERY);
+uno::Referencetext::XTextViewCursorSupplier 
xTextViewCursorSupplier(xModel-getCurrentController(), uno::UNO_QUERY);
+uno::Referencetext::XPageCursor 
xCursor(xTextViewCursorSupplier-getViewCursor(), uno::UNO_QUERY);
+xCursor-jumpToLastPage();
+CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor-getPage());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index e63c451..038ead9

[Libreoffice-commits] .: sw/source

2012-04-02 Thread Miklos Vajna
 sw/source/filter/ww8/ww8atr.cxx  |2 +-
 sw/source/filter/ww8/ww8par6.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 36e176ee2354e62d5e4208fb0ae2a101ba32d7f5
Author: Miklos Vajna vmik...@suse.cz
Date:   Mon Apr 2 16:03:22 2012 +0200

ww8: sprmPFContextualSpacing is a Bool8 value

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 7fcba60..16a5539 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3889,7 +3889,7 @@ void WW8AttributeOutput::FormatULSpace( const 
SvxULSpaceItem rUL )
 if (m_rWW8Export.bWrtWW8  rUL.GetContext())
 {
 m_rWW8Export.InsUInt16(NS_sprm::LN_PContextualSpacing);
-m_rWW8Export.InsUInt16(rUL.GetContext());
+m_rWW8Export.pO-push_back( (sal_uInt8)rUL.GetContext() );
 }
 }
 }
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index e995640..993020c 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -4177,7 +4177,7 @@ void SwWW8ImplReader::Read_UL( sal_uInt16 nId, const 
sal_uInt8* pData, short nLe
 pCtrlStck-SetAttr( *pPaM-GetPoint(), RES_UL_SPACE );
 return;
 }
-short nPara = SVBT16ToShort( pData );
+short nPara = nId == 0x246D ? SVBT16ToShort( pData ) : 0 != *pData;
 if( nPara  0 )
 nPara = -nPara;
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/source

2012-04-02 Thread Miklos Vajna
 sw/source/filter/ww8/ww8par6.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e650f3ec528777b56d45f4a652ff0569f8b925b4
Author: Miklos Vajna vmik...@suse.cz
Date:   Mon Apr 2 16:27:18 2012 +0200

SwWW8ImplReader::Read_UL: make this a bit less hard to read

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 993020c..65cea9d 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -4177,7 +4177,7 @@ void SwWW8ImplReader::Read_UL( sal_uInt16 nId, const 
sal_uInt8* pData, short nLe
 pCtrlStck-SetAttr( *pPaM-GetPoint(), RES_UL_SPACE );
 return;
 }
-short nPara = nId == 0x246D ? SVBT16ToShort( pData ) : 0 != *pData;
+short nPara = ((nId == 0x246D) ? SVBT16ToShort( pData ) : (0 != *pData));
 if( nPara  0 )
 nPara = -nPara;
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/qa

2012-03-30 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo45394.rtf |   19 +++
 sw/qa/extras/rtftok/rtftok.cxx|   22 ++
 2 files changed, 41 insertions(+)

New commits:
commit 0827e813f9b5afcec393bad7894c4ec1954d88f1
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Mar 30 10:44:09 2012 +0200

testcase for fdo#45394

diff --git a/sw/qa/extras/rtftok/data/fdo45394.rtf 
b/sw/qa/extras/rtftok/data/fdo45394.rtf
new file mode 100644
index 000..6d02f50
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo45394.rtf
@@ -0,0 +1,19 @@
+{\rtf1
+{\fonttbl
+{\f37\fswiss\fcharset204\fprq2
+Verdana;}
+}
+{\headerr
+\f37 \'cf\'ca \'d0\'c8\'ca\par
+}
+\trowd \cellx4498\cellx9104
+\pard\plain\intbl
+\cell \cell
+\row
+\trowd \cellx4498\cellx9104
+\pard\plain\intbl
+c\cell d\cell
+\row
+\pard\plain
+\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 472e775..f13e15d 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -39,6 +39,7 @@
 #include com/sun/star/text/XTextDocument.hpp
 #include com/sun/star/text/XTextGraphicObjectsSupplier.hpp
 #include com/sun/star/text/XTextFramesSupplier.hpp
+#include com/sun/star/text/XTextTablesSupplier.hpp
 #include com/sun/star/text/XTextViewCursorSupplier.hpp
 
 #include rtl/oustringostreaminserter.hxx
@@ -73,6 +74,7 @@ public:
 void testFdo47326();
 void testFdo47036();
 void testFdo46955();
+void testFdo45394();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -90,6 +92,7 @@ public:
 CPPUNIT_TEST(testFdo47326);
 CPPUNIT_TEST(testFdo47036);
 CPPUNIT_TEST(testFdo46955);
+CPPUNIT_TEST(testFdo45394);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -449,6 +452,25 @@ void RtfModelTest::testFdo46955()
 }
 }
 
+void RtfModelTest::testFdo45394()
+{
+load(OUString(RTL_CONSTASCII_USTRINGPARAM(fdo45394.rtf)));
+
+uno::Referencestyle::XStyleFamiliesSupplier 
xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Referencecontainer::XNameAccess 
xStyles(xStyleFamiliesSupplier-getStyleFamilies(), uno::UNO_QUERY);
+uno::Referencecontainer::XNameAccess 
xPageStyles(xStyles-getByName(PageStyles), uno::UNO_QUERY);
+uno::Referencebeans::XPropertySet 
xPropertySet(xPageStyles-getByName(Default), uno::UNO_QUERY);
+uno::Referencetext::XText 
xHeaderText(xPropertySet-getPropertyValue(HeaderText), uno::UNO_QUERY);
+OUString aActual = xHeaderText-getString();
+// Encoding in the header was wrong.
+OUString aExpected(ПК РИК, 11, RTL_TEXTENCODING_UTF8);
+CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
+
+uno::Referencetext::XTextTablesSupplier xTextTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xIndexAccess(xTextTablesSupplier-getTextTables(), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess-getCount());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/source

2012-03-30 Thread Miklos Vajna
 sw/source/filter/ww8/rtfattributeoutput.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8836b45de536a3a2fd72533c3210e439bc2fbca1
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Mar 30 14:18:40 2012 +0200

fdo#40735 RTF export: CJK text is typically not single-byte

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 7cdae5f..1eb0803 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2100,7 +2100,7 @@ void RtfAttributeOutput::CharFontCJK( const SvxFontItem 
rFont )
 {
 SAL_INFO(sw.rtf, OSL_THIS_FUNC);
 
-m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HICH);
+m_aStyles.append(OOO_STRING_SVTOOLS_RTF_DBCH);
 m_aStyles.append(OOO_STRING_SVTOOLS_RTF_AF);
 m_aStyles.append((sal_Int32)m_rExport.maFontHelper.GetId(rFont));
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-03-29 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 3a68ecc47ffcbfa0db2516b717809d824cf60eb6
Author: Miklos Vajna vmik...@suse.cz
Date:   Thu Mar 29 12:10:54 2012 +0200

rtftok: OSL_FAIL() - SAL_WARN()

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index a3cb434..4254c49 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -124,7 +124,7 @@ static RTFSprms lcl_getLastAttributes(RTFSprms rSprms, Id 
nId)
 return p-getSprms()-back().second-getAttributes();
 else
 {
-OSL_FAIL(trying to set property when no type is defined);
+SAL_WARN(writerfilter, trying to set property when no type is 
defined);
 return rSprms;
 }
 }
@@ -984,7 +984,7 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t rBuffer)
 else if (aPair.first == BUFFER_PAR)
 parBreak();
 else
-OSL_FAIL(should not happen);
+SAL_WARN(writerfilter, should not happen);
 }
 
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - writerfilter/source

2012-03-29 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   35 -
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |8 +
 2 files changed, 35 insertions(+), 8 deletions(-)

New commits:
commit 6b7942f5ac0498414931a0e7842aa96452b7a04d
Author: Miklos Vajna vmik...@suse.cz
Date:   Thu Mar 29 15:26:28 2012 +0200

fdo#45394 fix RTF import of custom fonts in substreams

Substreams (headers, footers, etc.) are parsed separately, so their font
table is empty by default. Fix handling of custom fonts (and thus
encodings) there by passing a pointer to the superstream.

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 6a1daea..e63c451 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -261,6 +261,7 @@ 
RTFDocumentImpl::RTFDocumentImpl(uno::Referenceuno::XComponentContext const x
 m_pCurrentBuffer(0),
 m_bHasFootnote(false),
 m_bIsSubstream(false),
+m_pSuperstream(0),
 m_nHeaderFooterPositions(),
 m_nGroupStartPos(0),
 m_aBookmarks(),
@@ -317,6 +318,11 @@ void RTFDocumentImpl::setSubstream(bool bIsSubtream)
 m_bIsSubstream = bIsSubtream;
 }
 
+void RTFDocumentImpl::setSuperstream(RTFDocumentImpl *pSuperstream)
+{
+m_pSuperstream = pSuperstream;
+}
+
 void RTFDocumentImpl::setAuthor(rtl::OUString rAuthor)
 {
 m_aAuthor = rAuthor;
@@ -356,6 +362,7 @@ void RTFDocumentImpl::resolveSubstream(sal_uInt32 nPos, Id 
nId, OUString rIgnor
 // Seek to header position, parse, then seek back.
 RTFDocumentImpl::Pointer_t pImpl(new RTFDocumentImpl(m_xContext, 
m_xInputStream, m_xDstDoc, m_xFrame, m_xStatusIndicator));
 pImpl-setSubstream(true);
+pImpl-setSuperstream(this);
 pImpl-setIgnoreFirst(rIgnoreFirst);
 if (!m_aAuthor.isEmpty())
 {
@@ -516,11 +523,24 @@ sal_uInt32 RTFDocumentImpl::getColorTable(sal_uInt32 
nIndex)
 return 0;
 }
 
-sal_uInt32 RTFDocumentImpl::getEncodingTable(sal_uInt32 nFontIndex)
+rtl_TextEncoding RTFDocumentImpl::getEncoding(sal_uInt32 nFontIndex)
 {
-if (nFontIndex  m_aFontEncodings.size())
-return m_aFontEncodings[nFontIndex];
-return 0;
+if (!m_pSuperstream)
+{
+if (nFontIndex  m_aFontEncodings.size())
+return m_aFontEncodings[nFontIndex];
+return 0;
+}
+else
+return m_pSuperstream-getEncoding(nFontIndex);
+}
+
+int RTFDocumentImpl::getFontIndex(int nIndex)
+{
+if (!m_pSuperstream)
+return std::find(m_aFontIndexes.begin(), m_aFontIndexes.end(), nIndex) 
- m_aFontIndexes.begin();
+else
+return m_pSuperstream-getFontIndex(nIndex);
 }
 
 void RTFDocumentImpl::resolve(Stream  rMapper)
@@ -2168,14 +2188,14 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, 
int nParam)
 if (m_aStates.top().nDestinationState == DESTINATION_FONTTABLE || 
m_aStates.top().nDestinationState == DESTINATION_FONTENTRY)
 {
 m_aFontIndexes.push_back(nParam);
-m_nCurrentFontIndex = std::find(m_aFontIndexes.begin(), 
m_aFontIndexes.end(), nParam) - m_aFontIndexes.begin();
+m_nCurrentFontIndex = getFontIndex(nParam);
 }
 else
 {
-int nFontIndex = std::find(m_aFontIndexes.begin(), 
m_aFontIndexes.end(), nParam) - m_aFontIndexes.begin();
+int nFontIndex = getFontIndex(nParam);
 RTFValue::Pointer_t pValue(new RTFValue(nFontIndex));
 
m_aStates.top().aCharacterSprms-push_back(make_pair(NS_sprm::LN_CRgFtc0, 
pValue));
-m_aStates.top().nCurrentEncoding = 
getEncodingTable(nFontIndex);
+m_aStates.top().nCurrentEncoding = getEncoding(nFontIndex);
 }
 break;
 case RTF_RED:
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 54459e7..eb7e27a 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -330,6 +330,7 @@ namespace writerfilter {
 
 Stream Mapper();
 void setSubstream(bool bIsSubtream);
+void setSuperstream(RTFDocumentImpl *pSuperstream);
 void setAuthor(rtl::OUString rAuthor);
 bool isSubstream() const;
 void finishSubstream();
@@ -364,11 +365,14 @@ namespace writerfilter {
 bool getFirstRun();
 /// If we need to add a dummy paragraph before a section break.
 void setNeedPar(bool bNeedPar);
+/// Return the dmapper index of an RTF index for fonts.
+int getFontIndex(int nIndex);
+/// Return the encoding associated with a dmapper font index.
+rtl_TextEncoding getEncoding(sal_uInt32 nFontIndex);
 
 private:
 SvStream Strm

[Libreoffice-commits] .: 4 commits - oox/inc oox/source writerfilter/source

2012-03-28 Thread Miklos Vajna
 oox/inc/oox/vml/vmlshape.hxx|   17 
 oox/inc/oox/vml/vmlshapecontext.hxx |4 +
 oox/source/vml/vmlshape.cxx |   42 +++-
 oox/source/vml/vmlshapecontext.cxx  |   20 +
 writerfilter/source/Makefile|4 -
 writerfilter/source/ooxml/gperffasttokenhandler.xsl |   13 ++
 6 files changed, 89 insertions(+), 11 deletions(-)

New commits:
commit 4159a4e6ce38b333ced3ba5f75e28473605633e8
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Mar 27 18:39:04 2012 +0200

n#751117 oox: implement VML import of shape style 'flip'

diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index bde8823..c4ab2cd 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -81,6 +81,7 @@ struct ShapeTypeModel
 ::rtl::OUString maMarginTop;/// Y position of the shape 
bounding box to shape anchor (number with unit).
 ::rtl::OUString maPositionVerticalRelative; /// The Y position is 
relative to this.
 ::rtl::OUString maRotation; /// Rotation of the shape, in 
degrees.
+::rtl::OUString maFlip; /// Rotation of the shape, in 
degrees.
 sal_BoolmbAutoHeight;   /// If true, the height value 
is a minimum value (mostly used for textboxes)
 
 StrokeModel maStrokeModel;  /// Border line formatting.
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index ad508c6..37e6431 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -367,7 +367,22 @@ SimpleShape::SimpleShape( Drawing rDrawing, const 
OUString rService ) :
 
 Reference XShape  SimpleShape::implConvertAndInsert( const Reference 
XShapes  rxShapes, const Rectangle rShapeRect ) const
 {
-Reference XShape  xShape = mrDrawing.createAndInsertXShape( maService, 
rxShapes, rShapeRect );
+Rectangle aShapeRect(rShapeRect);
+if (!maTypeModel.maFlip.isEmpty())
+{
+if (maTypeModel.maFlip.equalsAscii(x))
+{
+aShapeRect.X += aShapeRect.Width;
+aShapeRect.Width *= -1;
+}
+else if (maTypeModel.maFlip.equalsAscii(y))
+{
+aShapeRect.Y += aShapeRect.Height;
+aShapeRect.Height *= -1;
+}
+}
+
+Reference XShape  xShape = mrDrawing.createAndInsertXShape( maService, 
rxShapes, aShapeRect );
 convertShapeProperties( xShape );
 
 if ( maService.equalsAscii( com.sun.star.text.TextFrame ) )
diff --git a/oox/source/vml/vmlshapecontext.cxx 
b/oox/source/vml/vmlshapecontext.cxx
index fb10331..57a85e9 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -350,6 +350,7 @@ void ShapeTypeContext::setStyle( const OUString rStyle )
 else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( 
mso-position-vertical-relative ) ) ) mrTypeModel.maPositionVerticalRelative = 
aValue;
 else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( 
mso-fit-shape-to-text ) ) )  mrTypeModel.mbAutoHeight = sal_True;
 else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( 
rotation ) ) )  mrTypeModel.maRotation = aValue;
+else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( flip ) 
) )  mrTypeModel.maFlip = aValue;
 }
 }
 }
commit 559ecabbfc6d78df995c899ba996a470e241b76c
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Mar 27 14:34:35 2012 +0200

n#751117 oox: implement VML import of v:line token

diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index c00625c..bde8823 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -186,6 +186,8 @@ struct ShapeModel
 TextBoxPtr  mxTextBox;  /// Text contents and properties.
 ClientDataPtr   mxClientData;   /// Excel specific client data.
 ::rtl::OUString maLegacyDiagramPath;/// Legacy Diagram Fragment Path
+::rtl::OUString maFrom; /// Start point for line shape.
+::rtl::OUString maTo;   /// End point for line shape.
 
 explicitShapeModel();
 ~ShapeModel();
@@ -312,6 +314,19 @@ protected:
 const ::com::sun::star::awt::Rectangle rShapeRect 
) const;
 };
 
+/** A Line shape object. */
+class LineShape : public SimpleShape
+{
+public:
+explicitLineShape( Drawing rDrawing );
+
+protected:
+/** Creates the corresponding XShape and inserts it into the passed 
container. */
+virtual ::com::sun::star::uno::Reference 
::com::sun::star::drawing::XShape 
+implConvertAndInsert(
+const ::com::sun::star::uno::Reference 
::com::sun::star::drawing::XShapes  rxShapes,
+const ::com::sun::star::awt::Rectangle rShapeRect 
) const

[Libreoffice-commits] .: oox/inc

2012-03-28 Thread Miklos Vajna
 oox/inc/oox/vml/vmlshape.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b9f79762f07448b7100bb09acd1f4ee748b32a2e
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Mar 28 10:36:18 2012 +0200

ShapeTypeModel::maFlip: correct bogus doxygen comment

diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index c4ab2cd..c6c6cb6 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -81,7 +81,7 @@ struct ShapeTypeModel
 ::rtl::OUString maMarginTop;/// Y position of the shape 
bounding box to shape anchor (number with unit).
 ::rtl::OUString maPositionVerticalRelative; /// The Y position is 
relative to this.
 ::rtl::OUString maRotation; /// Rotation of the shape, in 
degrees.
-::rtl::OUString maFlip; /// Rotation of the shape, in 
degrees.
+::rtl::OUString maFlip; /// Flip type of the shape 
(can be x or y).
 sal_BoolmbAutoHeight;   /// If true, the height value 
is a minimum value (mostly used for textboxes)
 
 StrokeModel maStrokeModel;  /// Border line formatting.
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/qa

2012-03-28 Thread Miklos Vajna
 sw/qa/extras/ooxmltok/data/n751117.docx |binary
 sw/qa/extras/ooxmltok/ooxmltok.cxx  |   29 +
 2 files changed, 29 insertions(+)

New commits:
commit bbb03549db3ecb9e4e5a3c4c3cb58059c06ea7e8
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Mar 28 17:35:44 2012 +0200

add testcase for n#751117

diff --git a/sw/qa/extras/ooxmltok/data/n751117.docx 
b/sw/qa/extras/ooxmltok/data/n751117.docx
new file mode 100644
index 000..17cc9c5
Binary files /dev/null and b/sw/qa/extras/ooxmltok/data/n751117.docx differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx 
b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index 32d39af..364d66d 100644
--- a/sw/qa/extras/ooxmltok/ooxmltok.cxx
+++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx
@@ -27,6 +27,7 @@
 
 #include com/sun/star/beans/XPropertySet.hpp
 #include com/sun/star/drawing/XDrawPageSupplier.hpp
+#include com/sun/star/lang/XServiceInfo.hpp
 #include com/sun/star/text/TextContentAnchorType.hpp
 
 #include test/bootstrapfixture.hxx
@@ -44,10 +45,12 @@ public:
 virtual void setUp();
 virtual void tearDown();
 void testN751054();
+void testN751117();
 
 CPPUNIT_TEST_SUITE(OoxmlModelTest);
 #if !defined(MACOSX)  !defined(WNT)
 CPPUNIT_TEST(testN751054);
+CPPUNIT_TEST(testN751117);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -90,6 +93,32 @@ void OoxmlModelTest::testN751054()
 CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER);
 }
 
+void OoxmlModelTest::testN751117()
+{
+load(n751117.docx);
+
+uno::Referencedrawing::XDrawPageSupplier xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xDraws(xDrawPageSupplier-getDrawPage(), uno::UNO_QUERY);
+
+// First shape: the end should be an arrow, should be rotated and should 
be flipped.
+uno::Referencebeans::XPropertySet xPropertySet(xDraws-getByIndex(0), 
uno::UNO_QUERY);
+OUString aValue;
+xPropertySet-getPropertyValue(LineEndName) = aValue;
+CPPUNIT_ASSERT(aValue.indexOf(Arrow) != -1);
+
+sal_Int32 nValue = 0;
+xPropertySet-getPropertyValue(RotateAngle) = nValue;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(90 * 100), nValue);
+
+uno::Referencedrawing::XShape xShape(xPropertySet, uno::UNO_QUERY);
+awt::Size aActualSize(xShape-getSize());
+CPPUNIT_ASSERT(aActualSize.Width  0);
+
+// The second shape should be a line
+uno::Referencelang::XServiceInfo xServiceInfo(xDraws-getByIndex(1), 
uno::UNO_QUERY);
+
CPPUNIT_ASSERT(xServiceInfo-supportsService(com.sun.star.drawing.LineShape));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(OoxmlModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: oox/inc

2012-03-26 Thread Miklos Vajna
 oox/inc/oox/vml/vmlshape.hxx |   42 +-
 1 file changed, 21 insertions(+), 21 deletions(-)

New commits:
commit 2452e28a068803ad1ca910798339303cc52e45be
Author: Miklos Vajna vmik...@suse.cz
Date:   Mon Mar 26 13:07:03 2012 +0200

oox: fix doxygen syntax to avoid misleading output in ShapeTypeModel

diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index 8c68337..946af36 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -66,27 +66,27 @@ const sal_Int32 VML_CLIENTDATA_FORMULA  = 4;
 /** The shape model structure contains all properties shared by all types of 
shapes. */
 struct ShapeTypeModel
 {
-::rtl::OUString maShapeId;  /// Unique identifier of the 
shape.
-::rtl::OUString maShapeName;/// Name of the shape, if 
present.
-OptValue sal_Int32  moShapeType;  /// Builtin shape type 
identifier.
-
-OptValue Int32Pair  moCoordPos;   /// Top-left position of 
coordinate system for children scaling.
-OptValue Int32Pair  moCoordSize;  /// Size of coordinate system 
for children scaling.
-::rtl::OUString maPosition; /// Position type of the shape.
-::rtl::OUString maLeft; /// X position of the shape 
bounding box (number with unit).
-::rtl::OUString maTop;  /// Y position of the shape 
bounding box (number with unit).
-::rtl::OUString maWidth;/// Width of the shape 
bounding box (number with unit).
-::rtl::OUString maHeight;   /// Height of the shape 
bounding box (number with unit).
-::rtl::OUString maMarginLeft;   /// X position of the shape 
bounding box to shape anchor (number with unit).
-::rtl::OUString maMarginTop;/// Y position of the shape 
bounding box to shape anchor (number with unit).
-::rtl::OUString maPositionVerticalRelative; /// The Y position is 
relative to this.
-sal_BoolmbAutoHeight;   /// If true, the height value 
is a minimum value (mostly used for textboxes)
-
-StrokeModel maStrokeModel;  /// Border line formatting.
-FillModel   maFillModel;/// Shape fill formatting.
-
-OptValue ::rtl::OUString  moGraphicPath;  /// Path to a graphic for this 
shape.
-OptValue ::rtl::OUString  moGraphicTitle; /// Title of the graphic.
+::rtl::OUString maShapeId;  /// Unique identifier of the 
shape.
+::rtl::OUString maShapeName;/// Name of the shape, if 
present.
+OptValue sal_Int32  moShapeType;  /// Builtin shape type 
identifier.
+
+OptValue Int32Pair  moCoordPos;   /// Top-left position of 
coordinate system for children scaling.
+OptValue Int32Pair  moCoordSize;  /// Size of coordinate system 
for children scaling.
+::rtl::OUString maPosition; /// Position type of the 
shape.
+::rtl::OUString maLeft; /// X position of the shape 
bounding box (number with unit).
+::rtl::OUString maTop;  /// Y position of the shape 
bounding box (number with unit).
+::rtl::OUString maWidth;/// Width of the shape 
bounding box (number with unit).
+::rtl::OUString maHeight;   /// Height of the shape 
bounding box (number with unit).
+::rtl::OUString maMarginLeft;   /// X position of the shape 
bounding box to shape anchor (number with unit).
+::rtl::OUString maMarginTop;/// Y position of the shape 
bounding box to shape anchor (number with unit).
+::rtl::OUString maPositionVerticalRelative; /// The Y position is 
relative to this.
+sal_BoolmbAutoHeight;   /// If true, the height value 
is a minimum value (mostly used for textboxes)
+
+StrokeModel maStrokeModel;  /// Border line formatting.
+FillModel   maFillModel;/// Shape fill formatting.
+
+OptValue ::rtl::OUString  moGraphicPath;  /// Path to a graphic for 
this shape.
+OptValue ::rtl::OUString  moGraphicTitle; /// Title of the graphic.
 
 explicitShapeTypeModel();
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/qa

2012-03-25 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo46955.rtf |1 +
 sw/qa/extras/rtftok/rtftok.cxx|2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit da1a73fa0b3e5baf535333c0b344be2d3cb46e4f
Author: Miklos Vajna vmik...@suse.cz
Date:   Sun Mar 25 23:00:45 2012 +0200

rtftok: added missing test document

diff --git a/sw/qa/extras/rtftok/data/fdo46955.rtf 
b/sw/qa/extras/rtftok/data/fdo46955.rtf
new file mode 100644
index 000..4e3ddda
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo46955.rtf
@@ -0,0 +1 @@
+{\rtf1 \caps caps\par}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 59390a5..472e775 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -89,7 +89,7 @@ public:
 CPPUNIT_TEST(testN751020);
 CPPUNIT_TEST(testFdo47326);
 CPPUNIT_TEST(testFdo47036);
-//CPPUNIT_TEST(testFdo46955);
+CPPUNIT_TEST(testFdo46955);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sw/source

2012-03-24 Thread Miklos Vajna
 sw/source/core/docnode/nodes.cxx |   34 +-
 sw/source/core/txtnode/ndtxt.cxx |6 ++
 2 files changed, 23 insertions(+), 17 deletions(-)

New commits:
commit b8fe125186a6a99f12a22e50d578e4aabd8aac14
Author: Michael Stahl mst...@redhat.com
Date:   Wed Mar 21 10:25:45 2012 +0100

rhbz#789022: SwNodes: fix inconsistent outline check:

SwNodes::UpdateOutlineNode will add/remove the node from
SwNodes::pOutlineNds depending on IsOutline(), while various SwNodes
methods that move and delete nodes check GetAttrOutlineLevel() != 0,
which may be false even if IsOutline() is true.
(cherry picked from commit 082906e1f4cf58fdfab1a4064e2b7955fcdaeb8a)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 6d0e45b..55c1613 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -173,7 +173,7 @@ void SwNodes::ChgNode( SwNodeIndex rDelPos, sal_uLong nSz,
 
 pTxtNode-RemoveFromList();
 
-if ( pTxtNode-GetAttrOutlineLevel() != 0 )//-end,zhaojianwei
+if (pTxtNode-IsOutline())
 {
 const SwNodePtr pSrch = (SwNodePtr)rNd;
 pOutlineNds-Remove( pSrch );
@@ -188,8 +188,7 @@ void SwNodes::ChgNode( SwNodeIndex rDelPos, sal_uLong nSz,
 
 rTxtNd.AddToList();
 
-if( bInsOutlineIdx 
-0 != rTxtNd.GetAttrOutlineLevel() )//-end,zhaojianwei
+if (bInsOutlineIdx  rTxtNd.IsOutline())
 {
 const SwNodePtr pSrch = (SwNodePtr)rNd;
 pOutlineNds-Insert( pSrch );
@@ -232,9 +231,11 @@ void SwNodes::ChgNode( SwNodeIndex rDelPos, sal_uLong nSz,
 {
 SwTxtNode* pTxtNd = (SwTxtNode*)pNd;
 
-// loesche die Gliederungs-Indizies aus dem alten Nodes-Array
-if( 0 != pTxtNd-GetAttrOutlineLevel() )//-end,zhaojianwei
+// remove outline index from old nodes array
+if (pTxtNd-IsOutline())
+{
 pOutlineNds-Remove( pNd );
+}
 
 // muss die Rule kopiere werden?
 if( pDestDoc )
@@ -269,8 +270,7 @@ void SwNodes::ChgNode( SwNodeIndex rDelPos, sal_uLong nSz,
 {
 SwpHints * const pHts = pTxtNd-GetpSwpHints();
 // OultineNodes set the new nodes in the array
-if( bInsOutlineIdx 
-0 != pTxtNd-GetAttrOutlineLevel() ) //#outline 
level,added by zhaojianwei
+if (bInsOutlineIdx  pTxtNd-IsOutline())
 {
 rNds.pOutlineNds-Insert( pTxtNd );
 }
@@ -537,12 +537,12 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange aRange, 
SwNodes  rNodes,
 if( pTmpNd-IsTxtNode() )
 ((SwTxtNode*)pTmpNd)-RemoveFromList();
 
-// setze bei Start/EndNodes die richtigen 
Indizies
-// loesche die Gliederungs-Indizies aus
-// dem alten Nodes-Array
-if( pCNd-IsTxtNode()  0 !=
-((SwTxtNode*)pCNd)-GetAttrOutlineLevel() 
)//-end,by zhaojianwei
+// remove outline index from old nodes array
+if (pCNd-IsTxtNode() 
+static_castSwTxtNode*(pCNd)-IsOutline())
+{
 pOutlineNds-Remove( pCNd );
+}
 else
 pCNd = 0;
 }
@@ -572,7 +572,7 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange aRange, 
SwNodes  rNodes,
 SwNode* pNd = aMvIdx.GetNode();
 
 const bool bOutlNd = pNd-IsTxtNode() 
-0 != 
((SwTxtNode*)pNd)-GetAttrOutlineLevel();//-end,zhaojianwei
+static_castSwTxtNode*(pNd)-IsOutline();
 // loesche die Gliederungs-Indizies aus
 // dem alten Nodes-Array
 if( bOutlNd )
@@ -1221,14 +1221,15 @@ void SwNodes::Delete(const SwNodeIndex rIndex, 
sal_uLong nNodes)
 
 if( pNd-IsTxtNode() )
 {
-if( 0 != ((SwTxtNode*)pNd)-GetAttrOutlineLevel() 
//-end,zhaojianwei
+SwTxtNode *const 
pTxtNode(static_castSwTxtNode*(pNd));
+if (pTxtNode-IsOutline() 
 pOutlineNds-Seek_Entry( pNd, nIdxPos

[Libreoffice-commits] .: sw/qa writerfilter/source

2012-03-24 Thread Miklos Vajna
 sw/qa/extras/rtftok/rtftok.cxx |   24 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |1 +
 2 files changed, 25 insertions(+)

New commits:
commit 04cae9ec1e1f04833b06fe9f24e23cfaf5265599
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Mar 24 17:14:12 2012 +0100

fdo#46955 fix RTF import of all capitals char prop

diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 0628268..472e775 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -28,6 +28,7 @@
 #include com/sun/star/beans/XPropertySet.hpp
 #include com/sun/star/drawing/XDrawPageSupplier.hpp
 #include com/sun/star/lang/XServiceInfo.hpp
+#include com/sun/star/style/CaseMap.hpp
 #include com/sun/star/style/XStyleFamiliesSupplier.hpp
 #include com/sun/star/table/BorderLine2.hpp
 #include com/sun/star/table/BorderLineStyle.hpp
@@ -71,6 +72,7 @@ public:
 void testN751020();
 void testFdo47326();
 void testFdo47036();
+void testFdo46955();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -87,6 +89,7 @@ public:
 CPPUNIT_TEST(testN751020);
 CPPUNIT_TEST(testFdo47326);
 CPPUNIT_TEST(testFdo47036);
+CPPUNIT_TEST(testFdo46955);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -425,6 +428,27 @@ void RtfModelTest::testFdo47036()
 CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess-getCount());
 }
 
+void RtfModelTest::testFdo46955()
+{
+load(OUString(RTL_CONSTASCII_USTRINGPARAM(fdo46955.rtf)));
+
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xParaEnum = 
xParaEnumAccess-createEnumeration();
+while (xParaEnum-hasMoreElements())
+{
+uno::Referencecontainer::XEnumerationAccess 
xRangeEnumAccess(xParaEnum-nextElement(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xRangeEnum = 
xRangeEnumAccess-createEnumeration();
+while (xRangeEnum-hasMoreElements())
+{
+uno::Referencebeans::XPropertySet 
xPropertySet(xRangeEnum-nextElement(), uno::UNO_QUERY);
+sal_Int16 nValue;
+
xPropertySet-getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CharCaseMap)))
 = nValue;
+CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, nValue);
+}
+}
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index e4d4e50..85f70f9 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2768,6 +2768,7 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, 
bool bParam, int nParam
 case RTF_STRIKED: nSprm = NS_sprm::LN_CFDStrike; break;
 case RTF_SCAPS: nSprm = NS_sprm::LN_CFSmallCaps; break;
 case RTF_IMPR: nSprm = NS_sprm::LN_CFImprint; break;
+case RTF_CAPS: nSprm = NS_sprm::LN_CFCaps; break;
 default: break;
 }
 if (nSprm = 0)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: git-hooks/commit-msg

2012-03-24 Thread Miklos Vajna
 git-hooks/commit-msg |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 81dbafd1227fbd976e343c1ce880b4020112808a
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Mar 24 18:01:34 2012 +0100

git-hooks: commit-msg should not search for whitespace in the diff itself

The additional sed removes every line after seeing the first line
starting with a #, just like git will do it later as well.

See: 
http://article.gmane.org/gmane.comp.documentfoundation.libreoffice.devel/26794

diff --git a/git-hooks/commit-msg b/git-hooks/commit-msg
index 378acfa..f2bcb3f 100755
--- a/git-hooks/commit-msg
+++ b/git-hooks/commit-msg
@@ -57,7 +57,7 @@ fi
 
 # Check for whitespace in front of *'s
 
-if [ -n `grep '^[[:space:]]\+\*.*:' $1` -a -z `grep '^\*' $1` ] ; then
+if [ -n `sed '/^#/,$d' $1 | grep '^[[:space:]]\+\*.*:'` -a -z `grep '^\*' 
$1` ] ; then
 abort $1 Please don't use whitespace in front of '* file: Description.' 
entries.
 fi
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/CppunitTest_sw_subsequent_ooxmltok.mk sw/Module_sw.mk sw/qa

2012-03-23 Thread Miklos Vajna
 sw/CppunitTest_sw_subsequent_ooxmltok.mk |   89 
 sw/Module_sw.mk  |1 
 sw/qa/extras/ooxmltok/data/n751054.docx  |binary
 sw/qa/extras/ooxmltok/ooxmltok.cxx   |   97 +++
 4 files changed, 187 insertions(+)

New commits:
commit 99298d615bc71c6dbc0ea718803ae73ef6648e81
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Mar 23 10:04:35 2012 +0100

add testcase for n#751054

diff --git a/sw/CppunitTest_sw_subsequent_ooxmltok.mk 
b/sw/CppunitTest_sw_subsequent_ooxmltok.mk
new file mode 100644
index 000..cec2405
--- /dev/null
+++ b/sw/CppunitTest_sw_subsequent_ooxmltok.mk
@@ -0,0 +1,89 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the License); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an AS IS basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+#   Miklos Vajna vmik...@suse.cz (SUSE, Inc.)
+# Portions created by the Initial Developer are Copyright (C) 2012 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the GPLv3+), or
+# the GNU Lesser General Public License Version 3 or later (the LGPLv3+),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_subsequent_ooxmltok))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_subsequent_ooxmltok, \
+sw/qa/extras/ooxmltok/ooxmltok \
+))
+
+$(eval $(call gb_CppunitTest_add_linked_libs,sw_subsequent_ooxmltok, \
+cppu \
+sal \
+test \
+unotest \
+vcl \
+$(gb_STDLIBS) \
+))
+
+$(eval $(call gb_CppunitTest_add_api,sw_subsequent_ooxmltok,\
+offapi \
+udkapi \
+))
+
+$(eval $(call gb_CppunitTest_uses_ure,sw_subsequent_ooxmltok))
+
+$(eval $(call gb_CppunitTest_add_type_rdbs,sw_subsequent_ooxmltok,\
+types \
+))
+
+$(eval $(call gb_CppunitTest_add_components,sw_subsequent_ooxmltok,\
+comphelper/util/comphelp \
+configmgr/source/configmgr \
+fileaccess/source/fileacc \
+filter/source/config/cache/filterconfig1 \
+framework/util/fwk \
+i18npool/util/i18npool \
+oox/util/oox \
+package/source/xstor/xstor \
+package/util/package2 \
+sax/source/expatwrap/expwrap \
+sax/source/fastparser/fastsax \
+sw/util/sw \
+sw/util/swd \
+sw/util/msword \
+sfx2/util/sfx \
+svl/source/fsstor/fsstorage \
+svtools/util/svt \
+toolkit/util/tk \
+ucb/source/core/ucb1 \
+ucb/source/ucp/file/ucpfile1 \
+unotools/util/utl \
+unoxml/source/service/unoxml \
+writerfilter/util/writerfilter \
+))
+
+$(eval $(call gb_CppunitTest_set_args,sw_subsequent_ooxmltok,\
+--headless \
+--protector unoexceptionprotector$(gb_Library_DLLEXT) 
unoexceptionprotector \
+-env:CONFIGURATION_LAYERS=xcsxcu:$(call 
gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry) module:$(call 
gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry/spool) xcsxcu:$(call 
gb_CppunitTarget__make_url,$(OUTDIR)/unittest/registry) \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 8cf4f39..d5f1e06 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -54,6 +54,7 @@ $(eval $(call gb_Module_add_check_targets,sw,\
 $(eval $(call gb_Module_add_slowcheck_targets,sw,\
 CppunitTest_sw_filters_test \
 CppunitTest_sw_macros_test \
+CppunitTest_sw_subsequent_ooxmltok \
 CppunitTest_sw_subsequent_rtftok \
 ))
 
diff --git a/sw/qa/extras/ooxmltok/data/n751054.docx 
b/sw/qa/extras/ooxmltok/data/n751054.docx
new file mode 100644
index 000..49d7d6a
Binary files /dev/null and b/sw/qa/extras/ooxmltok/data/n751054.docx differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx 
b/sw/qa/extras/ooxmltok/ooxmltok.cxx
new file mode 100644
index 000..32d39af
--- /dev/null
+++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx
@@ -0,0 +1,97 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the License); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http

[Libreoffice-commits] .: sw/qa writerfilter/source

2012-03-23 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo47326.rtf  |5 +
 sw/qa/extras/rtftok/rtftok.cxx |9 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |8 
 3 files changed, 22 insertions(+)

New commits:
commit f84e0e6b1b0ec5f52ee963a62ac420cd872a771e
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Mar 23 12:47:41 2012 +0100

fdo#47326 fix RTF import of mixed super/nonsuper text

In most cases \super has its own group, but it's valid to have mixed
super and non-super text in a single group, as long as \super and
\nosupersub keywords are used: handle this.

diff --git a/sw/qa/extras/rtftok/data/fdo47326.rtf 
b/sw/qa/extras/rtftok/data/fdo47326.rtf
new file mode 100644
index 000..264e719
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo47326.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+Windows\super\'ae\nosupersub XP:
+\pard
+ Cartes:\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 7483634..f4a0c4d 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -68,6 +68,7 @@ public:
 void testFdo45563();
 void testFdo43965();
 void testN751020();
+void testFdo47326();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -82,6 +83,7 @@ public:
 CPPUNIT_TEST(testFdo45563);
 CPPUNIT_TEST(testFdo43965);
 CPPUNIT_TEST(testN751020);
+CPPUNIT_TEST(testFdo47326);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -389,6 +391,13 @@ void RtfModelTest::testN751020()
 CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(200)), nValue);
 }
 
+void RtfModelTest::testFdo47326()
+{
+load(OUString(RTL_CONSTASCII_USTRINGPARAM(fdo47326.rtf)));
+// This was 15 only, as \super buffered text, then the contents of it got 
lost.
+CPPUNIT_ASSERT_EQUAL(19, getLength());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 84267f3..d378694 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1932,6 +1932,14 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 
m_aStates.top().aCharacterSprms-push_back(make_pair(NS_ooxml::LN_EG_RPrBase_vertAlign,
 pValue));
 }
 break;
+case RTF_NOSUPERSUB:
+if (m_pCurrentBuffer == m_aSuperBuffer)
+{
+replayBuffer(m_aSuperBuffer);
+m_pCurrentBuffer = 0;
+}
+
m_aStates.top().aCharacterSprms.erase(NS_ooxml::LN_EG_RPrBase_vertAlign);
+break;
 case RTF_LINEPPAGE:
 case RTF_LINECONT:
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: oox/inc oox/source sw/source writerfilter/source

2012-03-22 Thread Miklos Vajna
 oox/inc/oox/drawingml/drawingmltypes.hxx  |2 +-
 oox/inc/oox/vml/vmlshape.hxx  |1 +
 oox/source/token/properties.txt   |1 +
 oox/source/vml/vmlshape.cxx   |   14 +-
 oox/source/vml/vmlshapecontext.cxx|1 +
 sw/source/core/layout/anchoreddrawobject.cxx  |7 +--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |7 +++
 7 files changed, 29 insertions(+), 4 deletions(-)

New commits:
commit 51cfbf0cfaec395a99a00f2c20fcba96de9a4427
Author: Miklos Vajna vmik...@suse.cz
Date:   Thu Mar 22 10:34:24 2012 +0100

n#751054 fix VML import of absolutely positioned pictures

There were multiple issues here:

- convertEmuToHmm() not handling negative values
- position:absolute style property being ignored
- mso-position-vertical-relative is not converted to
  text::RelOrientation
- SwAnchoredDrawObject::_SetPositioningAttr() re-positioning already
  positioned objects
- DomainMapper_Impl::PushShapeContext() inserting positioned objects as
  character

diff --git a/oox/inc/oox/drawingml/drawingmltypes.hxx 
b/oox/inc/oox/drawingml/drawingmltypes.hxx
index 600b1bc..71174b3 100644
--- a/oox/inc/oox/drawingml/drawingmltypes.hxx
+++ b/oox/inc/oox/drawingml/drawingmltypes.hxx
@@ -156,7 +156,7 @@ inline sal_Int64 convertHmmToEmu( sal_Int32 nValue )
 /** Converts the passed 64-bit integer value from EMUs to 1/100 mm. */
 inline sal_Int32 convertEmuToHmm( sal_Int64 nValue )
 {
-return getLimitedValue sal_Int32, sal_Int64 ( (nValue + EMU_PER_HMM / 2) 
/ EMU_PER_HMM, 0, SAL_MAX_INT32 );
+return getLimitedValue sal_Int32, sal_Int64 ( (nValue + EMU_PER_HMM / 2) 
/ EMU_PER_HMM, SAL_MIN_INT32, SAL_MAX_INT32 );
 }
 
 // 
diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index 1998a02..37e9c09 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -79,6 +79,7 @@ struct ShapeTypeModel
 ::rtl::OUString maHeight;   /// Height of the shape 
bounding box (number with unit).
 ::rtl::OUString maMarginLeft;   /// X position of the shape 
bounding box to shape anchor (number with unit).
 ::rtl::OUString maMarginTop;/// Y position of the shape 
bounding box to shape anchor (number with unit).
+::rtl::OUString maPositionVerticalRelative; /// The Y position is 
relative to this.
 
 StrokeModel maStrokeModel;  /// Border line formatting.
 FillModel   maFillModel;/// Shape fill formatting.
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 176ae08..560f879 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -498,6 +498,7 @@ VerticalAlign
 VerticalSplitMode
 VerticalSplitPositionTwips
 VertOrientPosition
+VertOrientRelation
 ViewBox
 Visible
 VisibleFlag
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index c2fbd65..bdecb8b 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -42,6 +42,7 @@
 #include com/sun/star/text/XTextContent.hpp
 #include com/sun/star/text/XTextDocument.hpp
 #include com/sun/star/text/XTextFrame.hpp
+#include com/sun/star/text/TextContentAnchorType.hpp
 #include rtl/math.hxx
 #include rtl/ustrbuf.hxx
 #include oox/drawingml/shapepropertymap.hxx
@@ -59,6 +60,7 @@
 using ::com::sun::star::beans::XPropertySet;
 using ::com::sun::star::uno::Any;
 
+using namespace ::com::sun::star;
 using namespace ::com::sun::star::text;
 
 namespace oox {
@@ -524,11 +526,21 @@ Reference XShape  ComplexShape::implConvertAndInsert( 
const Reference XShapes
 if( xShape.is() )
 {
 OUString aGraphicUrl = 
rFilter.getGraphicHelper().importEmbeddedGraphicObject( aGraphicPath );
+PropertySet aPropSet( xShape );
 if( !aGraphicUrl.isEmpty() )
 {
-PropertySet aPropSet( xShape );
 aPropSet.setProperty( PROP_GraphicURL, aGraphicUrl );
 }
+// If the shape has an absolute position, set the properties 
accordingly.
+if 
(maTypeModel.maPosition.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(absolute)))
+{
+aPropSet.setProperty(PROP_HoriOrientPosition, rShapeRect.X);
+aPropSet.setProperty(PROP_VertOrientPosition, rShapeRect.Y);
+}
+if 
(maTypeModel.maPositionVerticalRelative.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(page)))
+{
+aPropSet.setProperty(PROP_VertOrientRelation, 
text::RelOrientation::PAGE_FRAME);
+}
 }
 return xShape;
 }
diff --git a/oox/source/vml/vmlshapecontext.cxx 
b/oox/source/vml/vmlshapecontext.cxx
index e0e38ce..91703fc 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sw/source

2012-03-22 Thread Miklos Vajna
 sw/source/core/doc/doc.cxx  |1 
 sw/source/core/inc/layouter.hxx |9 
 sw/source/core/layout/layouter.cxx  |   48 
 sw/source/core/layout/objectformattertxtfrm.cxx |6 ---
 sw/source/core/text/txtfly.cxx  |3 -
 5 files changed, 1 insertion(+), 66 deletions(-)

New commits:
commit b4b8f6966d5c2d308874f6213e68ecc620e92777
Author: Cédric Bosdonnat cedric.bosdonnat@free.fr
Date:   Thu Mar 22 14:52:37 2012 +0100

n#750258: removed strange non-wrapping condition

In the bug file, some text wrapping was badly computed when showing the
document (but not at the first rendering) due to that weird NotToWrap
mecahnism in SwLayouter. Checked the original issue i#40155 that
removing this does hurt.

(cherry picked from commit 8a233f17ae589b33e3b54ef9ebb1fcff41ef6cd7)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index d07ef90..5a2f44c 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1822,7 +1822,6 @@ void SwDoc::ClearSwLayouterEntries()
 {
 SwLayouter::ClearMovedFwdFrms( *this );
 SwLayouter::ClearObjsTmpConsiderWrapInfluence( *this );
-SwLayouter::ClearFrmsNotToWrap( *this );
 // #i65250#
 SwLayouter::ClearMoveBwdLayoutInfo( *this );
 }
diff --git a/sw/source/core/inc/layouter.hxx b/sw/source/core/inc/layouter.hxx
index 135263e..4350b95 100644
--- a/sw/source/core/inc/layouter.hxx
+++ b/sw/source/core/inc/layouter.hxx
@@ -68,9 +68,6 @@ class SwLayouter
 SwMovedFwdFrmsByObjPos* mpMovedFwdFrms;
 // -- #i35911#
 SwObjsMarkedAsTmpConsiderWrapInfluence* mpObjsTmpConsiderWrapInfl;
-// -- #i40155# - data structure to collect frames, which are
-// marked not to wrap around objects.
-std::vector const SwFrm*  maFrmsNotToWrap;
 
 public:
 // -- #i65250#
@@ -148,12 +145,6 @@ public:
 static void InsertObjForTmpConsiderWrapInfluence(
 const SwDoc _rDoc,
 SwAnchoredObject _rAnchoredObj );
-// -- #i40155#
-static void ClearFrmsNotToWrap( const SwDoc _rDoc );
-static void InsertFrmNotToWrap( const SwDoc _rDoc,
-const SwFrm _rFrm );
-static bool FrmNotToWrap( const IDocumentLayoutAccess _rIDLA,
-  const SwFrm _rFrm );
 // -- #i65250#
 static bool MoveBwdSuppressed( const SwDoc p_rDoc,
const SwFlowFrm p_rFlowFrm,
diff --git a/sw/source/core/layout/layouter.cxx 
b/sw/source/core/layout/layouter.cxx
index 3105bce..5ed1712 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -440,54 +440,6 @@ void SwLayouter::InsertObjForTmpConsiderWrapInfluence(
 
 _rDoc.GetLayouter()-mpObjsTmpConsiderWrapInfl-Insert( _rAnchoredObj );
 }
-// #i40155#
-void SwLayouter::ClearFrmsNotToWrap( const SwDoc _rDoc )
-{
-if ( _rDoc.GetLayouter() )
-{
-const_castSwDoc(_rDoc).GetLayouter()-maFrmsNotToWrap.clear();
-}
-}
-
-void SwLayouter::InsertFrmNotToWrap( const SwDoc _rDoc,
- const SwFrm _rFrm )
-{
-if ( !_rDoc.GetLayouter() )
-{
-const_castSwDoc(_rDoc).SetLayouter( new SwLayouter() );
-}
-
-if ( !SwLayouter::FrmNotToWrap( _rDoc, _rFrm ) )
-{
-const_castSwDoc(_rDoc).GetLayouter()-maFrmsNotToWrap.push_back( 
_rFrm );
-}
-}
-
-bool SwLayouter::FrmNotToWrap( const IDocumentLayoutAccess _rDLA,
-   const SwFrm _rFrm )
-{
-const SwLayouter* pLayouter = _rDLA.GetLayouter();
-if ( !pLayouter )
-{
-return false;
-}
-else
-{
-bool bFrmNotToWrap( false );
-std::vector const SwFrm* ::const_iterator aIter =
-pLayouter-maFrmsNotToWrap.begin();
-for ( ; aIter != pLayouter-maFrmsNotToWrap.end(); ++aIter )
-{
-const SwFrm* pFrm = *(aIter);
-if ( pFrm == _rFrm )
-{
-bFrmNotToWrap = true;
-break;
-}
-}
-return bFrmNotToWrap;
-}
-}
 
 void LOOPING_LOUIE_LIGHT( bool bCondition, const SwTxtFrm rTxtFrm )
 {
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx 
b/sw/source/core/layout/objectformattertxtfrm.cxx
index 3ceb54a..c1d8eb8 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -296,9 +296,6 @@ bool SwObjectFormatterTxtFrm::DoFormatObj( 
SwAnchoredObject _rAnchoredObj,
   mrAnchorTxtFrm.GetFollow() 
   mrAnchorTxtFrm.GetFollow()-GetOfst() == 0 )
 {
-SwLayouter::InsertFrmNotToWrap(
-
*(mrAnchorTxtFrm.FindPageFrm()-GetFmt()-GetDoc

[Libreoffice-commits] .: sw/source

2012-03-21 Thread Miklos Vajna
 sw/source/core/unocore/unodraw.cxx |   26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 28253b4d826a8a008349fa66c902028e3f5a907b
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Mar 21 09:45:25 2012 +0100

SwXShape::setPropertyValue: OSL_ENSURE - SAL_WARN_IF

diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index 834d14d..ea49842 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();
-OSL_ENSURE(pSvxShape, No SvxShape found!);
+SAL_WARN_IF(pSvxShape, sw.uno, No SvxShape found!);
 if(pSvxShape)
 {
 SdrObject* pObj = pSvxShape-GetSdrObject();
@@ -1220,15 +1220,15 @@ 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();
-OSL_ENSURE( pTxtNode-HasHints(), 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 );
-OSL_ENSURE( pHnt  pHnt-Which() == 
RES_TXTATR_FLYCNT,
-Missing FlyInCnt-Hint. );
-OSL_ENSURE( pHnt  
pHnt-GetFlyCnt().GetFrmFmt() == pFmt,
-Wrong TxtFlyCnt-Hint. );
+SAL_WARN_IF( pHnt  pHnt-Which() == 
RES_TXTATR_FLYCNT,
+sw.uno, Missing FlyInCnt-Hint. 
);
+SAL_WARN_IF( pHnt  
pHnt-GetFlyCnt().GetFrmFmt() == pFmt,
+sw.uno, Wrong TxtFlyCnt-Hint. 
);
 const_castSwFmtFlyCnt(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();
-OSL_ENSURE( pNd, 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 );
@@ -1306,15 +1306,15 @@ 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();
-OSL_ENSURE( pTxtNode-HasHints(), 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 );
-OSL_ENSURE( pHnt  pHnt-Which() == 
RES_TXTATR_FLYCNT,
-Missing FlyInCnt-Hint. );
-OSL_ENSURE( pHnt  pHnt-GetFlyCnt().GetFrmFmt() 
== pFlyFmt,
-Wrong TxtFlyCnt-Hint. );
+SAL_WARN_IF( pHnt  pHnt-Which() == 
RES_TXTATR_FLYCNT,
+sw.uno, Missing FlyInCnt-Hint. );
+SAL_WARN_IF( pHnt  pHnt-GetFlyCnt().GetFrmFmt() 
== pFlyFmt,
+sw.uno, Wrong TxtFlyCnt-Hint. );
 const_castSwFmtFlyCnt(pHnt-GetFlyCnt())
 .SetFlyFmt();
 
@@ -1349,7 +1349,7 @@ void SwXShape::setPropertyValue(const rtl

[Libreoffice-commits] .: sw/source

2012-03-21 Thread Miklos Vajna
 sw/source/core/layout/atrfrm.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 0994cb60411b0efc71a8d6ef182e158761a85b6b
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Mar 21 15:24:42 2012 +0100

SwFmtVertOrient: warn if passed relation type is wrong, don't just ignore it

diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 920eb52..e836f62 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -149,7 +149,8 @@ sal_Int16 lcl_IntToRelation(const uno::Any rVal)
 {
 sal_Int16 eRet = text::RelOrientation::FRAME;
 sal_Int16 nVal = 0;
-rVal = nVal;
+if (!(rVal = nVal))
+SAL_WARN(sw.core, lcl_IntToRelation: read from Any failed!);
 switch(nVal)
 {
 case  text::RelOrientation::PRINT_AREA: eRet =   
text::RelOrientation::PRINT_AREA   ; break;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: oox/source

2012-03-21 Thread Miklos Vajna
 oox/source/vml/vmlformatting.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5881168bf8187149e2caf59e72e1ac2d739aa3a4
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Mar 21 16:39:15 2012 +0100

oox: it's EMU, not MEU

diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 1197829..1d5a958 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -150,7 +150,7 @@ bool lclExtractDouble( double orfValue, sal_Int32 
ornEndPos, const OUString r
 fValue *= 36.0;
 else if( (cChar1 == 'm')  (cChar2 == 'm') )   // 1 mm = 36,000 EMU
 fValue *= 36000.0;
-else if( (cChar1 == 'p')  (cChar2 == 't') )   // 1 point = 1/72 inch 
= 12,700 MEU
+else if( (cChar1 == 'p')  (cChar2 == 't') )   // 1 point = 1/72 inch 
= 12,700 EMU
 fValue *= 12700.0;
 else if( (cChar1 == 'p')  (cChar2 == 'c') )   // 1 pica = 1/6 inch = 
152,400 EMU
 fValue *= 152400.0;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-03-20 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 066d9b97414d103614b18b83df2df82ac9c07620
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Mar 20 09:58:36 2012 +0100

cleanup: use lcl_getParagraphBorder() while parsing RTF_BOX

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index f8da21d..84267f3 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1756,10 +1756,8 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 {
 RTFSprms aAttributes;
 RTFValue::Pointer_t pValue(new RTFValue(aAttributes));
-
m_aStates.top().aParagraphSprms-push_back(make_pair(NS_sprm::LN_PBrcTop, 
pValue));
-
m_aStates.top().aParagraphSprms-push_back(make_pair(NS_sprm::LN_PBrcLeft, 
pValue));
-
m_aStates.top().aParagraphSprms-push_back(make_pair(NS_sprm::LN_PBrcBottom, 
pValue));
-
m_aStates.top().aParagraphSprms-push_back(make_pair(NS_sprm::LN_PBrcRight, 
pValue));
+for (int i = 0; i  4; i++)
+
m_aStates.top().aParagraphSprms-push_back(make_pair(lcl_getParagraphBorder(i), 
pValue));
 m_aStates.top().nBorderState = BORDER_PARAGRAPH_BOX;
 }
 break;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 3 commits - sw/qa writerfilter/source

2012-03-19 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo43965.rtf  |   16 +++
 sw/qa/extras/rtftok/rtftok.cxx |   35 +
 writerfilter/source/dmapper/BorderHandler.cxx  |2 -
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   13 ++---
 4 files changed, 55 insertions(+), 11 deletions(-)

New commits:
commit dd875e4f6a7b6c6bea7121f701821d7c7ba7f6d0
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Mar 16 14:23:36 2012 +0100

testcase for fdo#43965

diff --git a/sw/qa/extras/rtftok/data/fdo43965.rtf 
b/sw/qa/extras/rtftok/data/fdo43965.rtf
new file mode 100644
index 000..968fe77
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo43965.rtf
@@ -0,0 +1,16 @@
+{\rtf1\ansi\ansicpg1252
+{\fonttbl \f0\froman\fcharset0 Times;\f1\fswiss\fcharset0 Helvetica;}
+{\info{\subject Test file for LibreOffice 3.5}}
+\margl1440\margr1440\margt1440\margb1440\deftab720\viewkind1\viewscale100
+\pard\pardeftab720\ql\qnatural
+\f0\fs36
+{
+{\fs22\up8 2}
+}\
+{\box\brdrsBox
+}\
+Page feeds:\
+   This is on the first page.\
+\page
+   This is on the second page.\
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 95fc51b..c376779 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -33,9 +33,11 @@
 #include com/sun/star/table/BorderLineStyle.hpp
 #include com/sun/star/text/RelOrientation.hpp
 #include com/sun/star/text/SizeType.hpp
+#include com/sun/star/text/XPageCursor.hpp
 #include com/sun/star/text/XTextDocument.hpp
 #include com/sun/star/text/XTextGraphicObjectsSupplier.hpp
 #include com/sun/star/text/XTextFramesSupplier.hpp
+#include com/sun/star/text/XTextViewCursorSupplier.hpp
 
 #include rtl/oustringostreaminserter.hxx
 #include test/bootstrapfixture.hxx
@@ -64,6 +66,7 @@ public:
 void testFdo46662();
 void testN750757();
 void testFdo45563();
+void testFdo43965();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -76,6 +79,7 @@ public:
 CPPUNIT_TEST(testFdo46662);
 CPPUNIT_TEST(testN750757);
 CPPUNIT_TEST(testFdo45563);
+CPPUNIT_TEST(testFdo43965);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -339,6 +343,37 @@ void RtfModelTest::testFdo45563()
 CPPUNIT_ASSERT_EQUAL(4, i);
 }
 
+void RtfModelTest::testFdo43965()
+{
+load(OUString(RTL_CONSTASCII_USTRINGPARAM(fdo43965.rtf)));
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xParaEnum = 
xParaEnumAccess-createEnumeration();
+
+// First paragraph: the parameter of \up was ignored
+uno::Referencecontainer::XEnumerationAccess 
xRangeEnumAccess(xParaEnum-nextElement(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xRangeEnum = 
xRangeEnumAccess-createEnumeration();
+uno::Referencebeans::XPropertySet 
xPropertySet(xRangeEnum-nextElement(), uno::UNO_QUERY);
+sal_Int32 nValue;
+
xPropertySet-getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CharEscapement)))
 = nValue;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(58), nValue);
+
xPropertySet-getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CharEscapementHeight)))
 = nValue;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(100), nValue);
+
+// Second paragraph: Word vs Writer border default problem
+xPropertySet.set(xParaEnum-nextElement(), uno::UNO_QUERY);
+table::BorderLine2 aBorder;
+
xPropertySet-getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(TopBorder)))
 = aBorder;
+CPPUNIT_ASSERT_EQUAL(sal_uInt32(26), aBorder.LineWidth);
+
+// Finally, make sure that we have two pages
+uno::Referenceframe::XModel xModel(mxComponent, uno::UNO_QUERY);
+uno::Referencetext::XTextViewCursorSupplier 
xTextViewCursorSupplier(xModel-getCurrentController(), uno::UNO_QUERY);
+uno::Referencetext::XPageCursor 
xCursor(xTextViewCursorSupplier-getViewCursor(), uno::UNO_QUERY);
+xCursor-jumpToLastPage();
+CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor-getPage());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit dac6b7938173d0793810ee5731de51c440c1af5e
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Mar 16 13:49:00 2012 +0100

fdo#43965 fix RTF import of \up and \dn with custom parameters

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 3e0c9b9..f8da21d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2252,18 +2252,11 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, 
int nParam)
 m_aStates.top().aCharacterSprms-push_back(make_pair(0x6877, 
pValue));
 }
 break;
-case RTF_UP: // TODO handle when point size is not shrinking
-{
-OUString aValue

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - pyuno/source

2012-03-19 Thread Miklos Vajna
 pyuno/source/module/pyuno.cxx |   19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 8d7726c6a54cd65700f4d3183baef7800aaeced5
Author: David Bolen db3l@gmail.com
Date:   Fri Mar 16 22:10:24 2012 +0100

fdo#46926: PyUNO_cmp: return acquired reference

(cherry picked from commit 742dca7366ba6ac3c58b1df6ee548788f4ce24e7)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx
index 7f5f0b5..b712ae4 100644
--- a/pyuno/source/module/pyuno.cxx
+++ b/pyuno/source/module/pyuno.cxx
@@ -595,6 +595,8 @@ int PyUNO_setattr (PyObject* self, char* name, PyObject* 
value)
 // ensure object identity and struct equality
 static PyObject* PyUNO_cmp( PyObject *self, PyObject *that, int op )
 {
+PyObject *result;
+
 if(op != Py_EQ  op != Py_NE)
 {
 PyErr_SetString(PyExc_TypeError, only '==' and '!=' comparisions are 
defined);
@@ -602,7 +604,9 @@ static PyObject* PyUNO_cmp( PyObject *self, PyObject *that, 
int op )
 }
 if( self == that )
 {
-return (op == Py_EQ ? Py_True : Py_False);
+result = (op == Py_EQ ? Py_True : Py_False);
+Py_INCREF(result);
+return result;
 }
 try
 {
@@ -624,14 +628,18 @@ static PyObject* PyUNO_cmp( PyObject *self, PyObject 
*that, int op )
 Reference XMaterialHolder  xOther( 
other-members-xInvocation,UNO_QUERY );
 if( xMe-getMaterial() == xOther-getMaterial() )
 {
-return (op == Py_EQ ? Py_True : Py_False);
+result = (op == Py_EQ ? Py_True : Py_False);
+Py_INCREF(result);
+return result;
 }
 }
 else if( tcMe == com::sun::star::uno::TypeClass_INTERFACE )
 {
 if( me-members-wrappedObject == 
other-members-wrappedObject )
 {
-return (op == Py_EQ ? Py_True : Py_False);
+result = (op == Py_EQ ? Py_True : Py_False);
+Py_INCREF(result);
+return result;
 }
 }
 }
@@ -641,7 +649,10 @@ static PyObject* PyUNO_cmp( PyObject *self, PyObject 
*that, int op )
 {
 raisePyExceptionWithAny( makeAny( e ) );
 }
-return (op == Py_EQ ? Py_False : Py_True);
+
+result = (op == Py_EQ ? Py_False : Py_True);
+Py_INCREF(result);
+return result;
 }
 
 /* Python 2 has a tp_flags value for rich comparisons.  Python 3 does not (on 
by default) */
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/qa

2012-03-19 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/n751020.rtf |8 
 sw/qa/extras/rtftok/rtftok.cxx   |   15 +++
 2 files changed, 23 insertions(+)

New commits:
commit 9415e8c6c3089be3c4c78e3878163eda3e2bd873
Author: Miklos Vajna vmik...@suse.cz
Date:   Mon Mar 19 10:45:28 2012 +0100

testcase for n#751020

diff --git a/sw/qa/extras/rtftok/data/n751020.rtf 
b/sw/qa/extras/rtftok/data/n751020.rtf
new file mode 100644
index 000..66175cf
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/n751020.rtf
@@ -0,0 +1,8 @@
+{\rtf1
+{\stylesheet
+{Normal;}
+}
+\linkstyles
+first\par
+second\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index c376779..7483634 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -67,6 +67,7 @@ public:
 void testN750757();
 void testFdo45563();
 void testFdo43965();
+void testN751020();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -80,6 +81,7 @@ public:
 CPPUNIT_TEST(testN750757);
 CPPUNIT_TEST(testFdo45563);
 CPPUNIT_TEST(testFdo43965);
+CPPUNIT_TEST(testN751020);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -374,6 +376,19 @@ void RtfModelTest::testFdo43965()
 CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor-getPage());
 }
 
+void RtfModelTest::testN751020()
+{
+load(OUString(RTL_CONSTASCII_USTRINGPARAM(n751020.rtf)));
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xParaEnum = 
xParaEnumAccess-createEnumeration();
+CPPUNIT_ASSERT(xParaEnum-hasMoreElements());
+uno::Referencebeans::XPropertySet xPropertySet(xParaEnum-nextElement(), 
uno::UNO_QUERY);
+sal_Int32 nValue = 0;
+
xPropertySet-getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ParaBottomMargin)))
 = nValue;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(200)), nValue);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: bin/find-german-comments

2012-03-14 Thread Miklos Vajna
 bin/find-german-comments |   44 +++-
 1 file changed, 43 insertions(+), 1 deletion(-)

New commits:
commit 21c646a8e8e5154f7e7a85de4d50239b72ebc7f6
Author: Tom Thorogood t...@tomthorogood.com
Date:   Tue Mar 13 22:50:13 2012 -0400

Add options to bin/find-german-comments to help weed out false positives

diff --git a/bin/find-german-comments b/bin/find-german-comments
index e0ce382..1cc9d51 100755
--- a/bin/find-german-comments
+++ b/bin/find-german-comments
@@ -44,6 +44,10 @@ class Parser:
 help=Only print the filenames of files containing German 
comments)
 op.add_option(-v, --verbose, action=store_true, dest=verbose, 
default=False,
 help=Turn on verbose mode (print progress to stderr))
+op.add_option(-l, --line-numbers, action=store_true, 
dest=line_numbers, default=False,
+help=Prints the filenames and line numbers only.)
+op.add_option(-t, --threshold, action=store, dest=THRESHOLD, 
default=0,
+help=When used with '--line-numbers', only bothers outputting 
comment info if there are more than X number of flagged comments. Useful for 
weeding out false positives.)
 self.options, args = op.parse_args()
 try:
 dir = args[0]
@@ -141,7 +145,45 @@ class Parser:
 
 checks each comment in a file
 
-if not self.options.filenames_only:
+def tab_calc (string):
+START = 40 #Default of 10 tabs
+if len(string) = START:
+return 1, 0
+diff = START - len(string)
+if diff % 4 is not 0:
+padding = 1
+else:
+padding = 0
+return (diff/4)+padding
+
+if self.options.line_numbers:
+TABS = \t*10
+path_linenums = []
+for linenum, s in self.get_comments(path):
+if self.is_german(s):
+path_linenums.append(linenum)
+valid = len(path_linenums)  int(self.options.THRESHOLD)
+sys.stderr.write(%s ... %s positives -- %s\n % (path, 
str(len(path_linenums)), str(valid)))
+if valid:
+if len(path) + (len(path_linenums)*4)  75:
+print %s:\n % path
+while(path_linenums):
+i = 0
+numline = []
+while i  10:
+try:
+numline.append(path_linenums[0])
+path_linenums.remove(path_linenums[0])
+except IndexError:
+i = 10
+i+=1
+numline = [str(i) for i in numline]
+print %s%s %(TABS, ,.join(numline))
+else:
+path_linenums = [str(i) for i in path_linenums]
+print %s:%s%s % 
(path,\t*tab_calc(path),,.join(path_linenums))
+
+elif not self.options.filenames_only:
 for linenum, s in self.get_comments(path):
 if self.is_german(s):
 print %s:%s: %s % (path, linenum, s)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/source

2012-03-14 Thread Miklos Vajna
 sw/source/ui/chrdlg/pardlg.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit f1a2665128fa476f571cfd47c29b202a7ecc21cc
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Mar 14 15:13:40 2012 +0100

SwParaDlg::PageCreated: replace this hardwired 0x001E with something 
readable

diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx
index be65dfb..7e92407 100644
--- a/sw/source/ui/chrdlg/pardlg.cxx
+++ b/sw/source/ui/chrdlg/pardlg.cxx
@@ -186,7 +186,8 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage 
rPage)
 
 if (!bDrawParaDlg)
 {
-aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,0x001E));
+// See SvxStdParagraphTabPage::PageCreated: enable RegisterMode, 
AutoFirstLine, NegativeMode, ContextualMode
+
aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,0x0002|0x0004|0x0008|0x0010));
 aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST, 
MM50/10));
 
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - writerfilter/source

2012-03-13 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfcontrolwords.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 9f5dfe07794130a96b7c2056f468354cb8d750ff
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Mar 13 10:02:41 2012 +0100

Related: fdo#45563 RTF import of \r should be the same as \par

diff --git a/writerfilter/source/rtftok/rtfcontrolwords.cxx 
b/writerfilter/source/rtftok/rtfcontrolwords.cxx
index f7036eb..cce0c2e 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.cxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.cxx
@@ -39,6 +39,7 @@ RTFSymbol aRTFControlWords[] = {
 {:, CONTROL_SYMBOL, RTF_SUBENTRY},
 {\\, CONTROL_SYMBOL, RTF_BACKSLASH},
 {\n, CONTROL_SYMBOL, RTF_PAR},
+{\r, CONTROL_SYMBOL, RTF_PAR},
 {\r\n, CONTROL_SYMBOL, RTF_PAR},
 {_, CONTROL_SYMBOL, RTF_NOBRKHYPH},
 {{, CONTROL_SYMBOL, RTF_LBRACE},
commit f8c9ed1663ac675ed2151a584fcbf86b319cdaf1
Author: Christina Rossmanith chrrossman...@web.de
Date:   Sat Mar 10 15:21:49 2012 +0100

Bug 45563 - incorrect IMPORT of Zotero RTF, regression

diff --git a/writerfilter/source/rtftok/rtfcontrolwords.cxx 
b/writerfilter/source/rtftok/rtfcontrolwords.cxx
index 3dd2672..f7036eb 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.cxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.cxx
@@ -39,6 +39,7 @@ RTFSymbol aRTFControlWords[] = {
 {:, CONTROL_SYMBOL, RTF_SUBENTRY},
 {\\, CONTROL_SYMBOL, RTF_BACKSLASH},
 {\n, CONTROL_SYMBOL, RTF_PAR},
+{\r\n, CONTROL_SYMBOL, RTF_PAR},
 {_, CONTROL_SYMBOL, RTF_NOBRKHYPH},
 {{, CONTROL_SYMBOL, RTF_LBRACE},
 {|, CONTROL_SYMBOL, RTF_FORMULA},
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - writerfilter/source

2012-03-13 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfcontrolwords.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 1ce604a5f3366513bd86fe9feb938a53d996886e
Author: Christina Rossmanith chrrossman...@web.de
Date:   Sat Mar 10 15:21:49 2012 +0100

Bug 45563 - incorrect IMPORT of Zotero RTF, regression

(cherry picked from commit f8c9ed1663ac675ed2151a584fcbf86b319cdaf1)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/writerfilter/source/rtftok/rtfcontrolwords.cxx 
b/writerfilter/source/rtftok/rtfcontrolwords.cxx
index 3dd2672..f7036eb 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.cxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.cxx
@@ -39,6 +39,7 @@ RTFSymbol aRTFControlWords[] = {
 {:, CONTROL_SYMBOL, RTF_SUBENTRY},
 {\\, CONTROL_SYMBOL, RTF_BACKSLASH},
 {\n, CONTROL_SYMBOL, RTF_PAR},
+{\r\n, CONTROL_SYMBOL, RTF_PAR},
 {_, CONTROL_SYMBOL, RTF_NOBRKHYPH},
 {{, CONTROL_SYMBOL, RTF_LBRACE},
 {|, CONTROL_SYMBOL, RTF_FORMULA},
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/qa

2012-03-13 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo45563.rtf |5 +
 sw/qa/extras/rtftok/rtftok.cxx|   17 +
 2 files changed, 22 insertions(+)

New commits:
commit e5823e8513eee31fd96549a4b0273063ed31b192
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Mar 13 10:16:27 2012 +0100

testcase for fdo#45563

diff --git a/sw/qa/extras/rtftok/data/fdo45563.rtf 
b/sw/qa/extras/rtftok/data/fdo45563.rtf
new file mode 100644
index 000..3dd3fd0
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo45563.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+only n\
+only r\
both r and n\
+last\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index c11af26..95fc51b 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -63,6 +63,7 @@ public:
 void testFdo45187();
 void testFdo46662();
 void testN750757();
+void testFdo45563();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -74,6 +75,7 @@ public:
 CPPUNIT_TEST(testFdo45187);
 CPPUNIT_TEST(testFdo46662);
 CPPUNIT_TEST(testN750757);
+CPPUNIT_TEST(testFdo45563);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -322,6 +324,21 @@ void RtfModelTest::testN750757()
 CPPUNIT_ASSERT_EQUAL(sal_Bool(true), bValue);
 }
 
+void RtfModelTest::testFdo45563()
+{
+load(OUString(RTL_CONSTASCII_USTRINGPARAM(fdo45563.rtf)));
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xParaEnum = 
xParaEnumAccess-createEnumeration();
+int i = 0;
+while (xParaEnum-hasMoreElements())
+{
+xParaEnum-nextElement();
+i++;
+}
+CPPUNIT_ASSERT_EQUAL(4, i);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: g

2012-03-13 Thread Miklos Vajna
 g |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ae6d4aeb89ce87d5474f49cd180cfefc205262a2
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Mar 13 11:48:37 2012 +0100

g push/status: use @{upstream} instead of origin

origin won't work if origin/HEAD points to nowhere, which is a valid
use-case.

diff --git a/g b/g
index 5b39c46..11ecaa6 100755
--- a/g
+++ b/g
@@ -321,11 +321,11 @@ for REPO in $DIRS ; do
 ;;
 push)
 if [ $PUSH_ALL != 1 ] ; then
-[ -n $(git rev-list origin..HEAD) ] || exit 0
+[ -n $(git rev-list @{upstream}..HEAD) ] || exit 0
 fi
 ;;
 status)
-LOCALCOMMITS=$(git rev-list origin..HEAD)
+LOCALCOMMITS=$(git rev-list @{upstream}..HEAD)
 if [ -z $LOCALCOMMITS ] ; then
 [ -z $(git diff-index --name-only HEAD --) ]  exit 0
 fi
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/source

2012-03-13 Thread Miklos Vajna
 sw/source/filter/ww8/ww8atr.cxx  |6 ++
 sw/source/filter/ww8/ww8par.hxx  |1 -
 sw/source/filter/ww8/ww8par6.cxx |   11 ---
 sw/source/filter/ww8/ww8scan.cxx |2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)

New commits:
commit 605bc21f7941d598f98203928b034add416c9c65
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Mar 13 15:01:24 2012 +0100

ww8: implement sprmPFContextualSpacing

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index c8f005b..7fcba60 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3885,6 +3885,12 @@ void WW8AttributeOutput::FormatULSpace( const 
SvxULSpaceItem rUL )
 else
 m_rWW8Export.pO-push_back( 22 );
 m_rWW8Export.InsUInt16( rUL.GetLower() );
+// sprmPFContextualSpacing
+if (m_rWW8Export.bWrtWW8  rUL.GetContext())
+{
+m_rWW8Export.InsUInt16(NS_sprm::LN_PContextualSpacing);
+m_rWW8Export.InsUInt16(rUL.GetContext());
+}
 }
 }
 
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index cdc495d..b86c5b6 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1588,7 +1588,6 @@ public: // eigentlich private, geht aber leider nur 
public
 void Read_UL(   sal_uInt16 nId, const sal_uInt8*, short nLen );
 void Read_ParaAutoBefore(sal_uInt16 , const sal_uInt8 *pData, short nLen);
 void Read_ParaAutoAfter(sal_uInt16 , const sal_uInt8 *pData, short nLen);
-void Read_DontAddEqual(sal_uInt16 , const sal_uInt8 *pData, short nLen);
 void Read_LineSpace(sal_uInt16, const sal_uInt8*, short nLen );
 void Read_Justify(sal_uInt16, const sal_uInt8*, short nLen);
 void Read_IdctHint(sal_uInt16, const sal_uInt8*, short nLen);
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index eca258b..e995640 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -4102,12 +4102,6 @@ sal_uInt16 SwWW8ImplReader::GetParagraphAutoSpace(bool 
fDontUseHTMLAutoSpacing)
 return 280;  //Seems to be always 14points in this case
 }
 
-void SwWW8ImplReader::Read_DontAddEqual(sal_uInt16, const sal_uInt8 *, short 
nLen)
-{
-if (nLen  0)
-return;
-}
-
 void SwWW8ImplReader::Read_ParaAutoBefore(sal_uInt16, const sal_uInt8 *pData, 
short nLen)
 {
 if (nLen  0)
@@ -4201,6 +4195,9 @@ void SwWW8ImplReader::Read_UL( sal_uInt16 nId, const 
sal_uInt8* pData, short nLe
 case 0xA414:
 aUL.SetLower( nPara );
 break;
+case 0x246D:
+aUL.SetContextValue( nPara );
+break;
 default:
 return;
 };
@@ -6079,7 +6076,7 @@ const wwSprmDispatcher *GetWW8SprmDispatcher()
 {0x303C, 0}, //undocumented
 {0x245B, SwWW8ImplReader::Read_ParaAutoBefore},//undocumented, para
 {0x245C, SwWW8ImplReader::Read_ParaAutoAfter},//undocumented, para
-{0x246D, SwWW8ImplReader::Read_DontAddEqual}//undocumented, para
+{0x246D, SwWW8ImplReader::Read_UL}  
//sprmPFContextualSpacing
 };
 
 static wwSprmDispatcher aSprmSrch(aSprms, SAL_N_ELEMENTS(aSprms));
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 7027261..ac801fb 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -779,7 +779,7 @@ const wwSprmSearcher *wwSprmParser::GetWW8SprmSearcher()
 {0x303C, 1, L_FIX}, // undocumented, sep
 {0x245B, 1, L_FIX}, // undocumented, para autobefore
 {0x245C, 1, L_FIX}, // undocumented, para autoafter
-// undocumented, don't add space between para of the same style
+// sprmPFContextualSpacing, don't add space between para of the same 
style
 {0x246D, 1, L_FIX}
 };
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - writerfilter/source

2012-03-13 Thread Miklos Vajna
 writerfilter/source/dmapper/ModelEventListener.cxx |   25 +
 1 file changed, 16 insertions(+), 9 deletions(-)

New commits:
commit 2352ed8a8c86a2c8fcb2b7b75b750cec6956d2d7
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Mar 13 16:30:32 2012 +0100

writerfilter: catch UnknownPropertyExcetion early

diff --git a/writerfilter/source/dmapper/ModelEventListener.cxx 
b/writerfilter/source/dmapper/ModelEventListener.cxx
index 22c6b9a..f4fd04a 100644
--- a/writerfilter/source/dmapper/ModelEventListener.cxx
+++ b/writerfilter/source/dmapper/ModelEventListener.cxx
@@ -83,13 +83,20 @@ void ModelEventListener::notifyEvent( const 
document::EventObject rEvent ) thro
 sal_Int32 nIndex = 0;
 while(xEnumeration-hasMoreElements())
 {
-uno::Referencebeans::XPropertySet 
xPropertySet(xEnumeration-nextElement(), uno::UNO_QUERY);
-sal_Int16 nSource = 0;
-
xPropertySet-getPropertyValue(rPropNameSupplier.GetName(PROP_REFERENCE_FIELD_SOURCE))
 = nSource;
-sal_Int16 nPart = 0;
-
xPropertySet-getPropertyValue(rPropNameSupplier.GetName(PROP_REFERENCE_FIELD_PART))
 = nPart;
-if (nSource == text::ReferenceFieldSource::BOOKMARK  nPart 
== text::ReferenceFieldPart::PAGE)
-++nIndex;
+try
+{
+uno::Referencebeans::XPropertySet 
xPropertySet(xEnumeration-nextElement(), uno::UNO_QUERY);
+sal_Int16 nSource = 0;
+
xPropertySet-getPropertyValue(rPropNameSupplier.GetName(PROP_REFERENCE_FIELD_SOURCE))
 = nSource;
+sal_Int16 nPart = 0;
+
xPropertySet-getPropertyValue(rPropNameSupplier.GetName(PROP_REFERENCE_FIELD_PART))
 = nPart;
+if (nSource == text::ReferenceFieldSource::BOOKMARK  
nPart == text::ReferenceFieldPart::PAGE)
+++nIndex;
+}
+catch( const beans::UnknownPropertyException )
+{
+// doesn't even have such a property? ignore
+}
 }
 if (nIndex)
 {
commit 2ff3ce4b7e9ff6603ba472cbb8d35f75b9ef9c16
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Mar 13 15:38:36 2012 +0100

writerfilter: log exception message in ModelEventListener

diff --git a/writerfilter/source/dmapper/ModelEventListener.cxx 
b/writerfilter/source/dmapper/ModelEventListener.cxx
index a5b2ca5..22c6b9a 100644
--- a/writerfilter/source/dmapper/ModelEventListener.cxx
+++ b/writerfilter/source/dmapper/ModelEventListener.cxx
@@ -27,6 +27,7 @@
  /
 #include ModelEventListener.hxx
 #include PropertyIds.hxx
+#include rtl/oustringostreaminserter.hxx
 #include com/sun/star/document/XEventBroadcaster.hpp
 #include com/sun/star/text/XDocumentIndex.hpp
 #include com/sun/star/text/XDocumentIndexesSupplier.hpp
@@ -98,8 +99,7 @@ void ModelEventListener::notifyEvent( const 
document::EventObject rEvent ) thro
 }
 catch( const uno::Exception rEx )
 {
-(void)rEx;
-OSL_FAIL( exception while updating indexes );
+SAL_WARN(writerfilter, exception while updating indexes:   
rEx.Message);
 }
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 6 commits - cui/source editeng/inc editeng/source offapi/com svx/sdi sw/inc sw/source writerfilter/source xmloff/inc xmloff/source

2012-03-12 Thread Miklos Vajna
 cui/source/inc/paragrph.hxx   |2 +
 cui/source/tabpages/paragrph.cxx  |   16 -
 cui/source/tabpages/paragrph.hrc  |1 
 cui/source/tabpages/paragrph.src  |   21 +++
 editeng/inc/editeng/memberids.hrc |1 
 editeng/inc/editeng/ulspitem.hxx  |4 ++
 editeng/source/items/frmitems.cxx |8 
 offapi/com/sun/star/style/ParagraphProperties.idl |9 +
 svx/sdi/svxitems.sdi  |1 
 sw/inc/unoprnms.hxx   |4 +-
 sw/source/core/layout/flowfrm.cxx |   39 +-
 sw/source/core/unocore/unomap.cxx |2 +
 sw/source/core/unocore/unoprnms.cxx   |2 +
 sw/source/filter/ww8/docxattributeoutput.cxx  |4 ++
 sw/source/ui/chrdlg/pardlg.cxx|2 -
 writerfilter/source/dmapper/DomainMapper.cxx  |2 -
 writerfilter/source/dmapper/PropertyIds.cxx   |1 
 writerfilter/source/dmapper/PropertyIds.hxx   |1 
 xmloff/inc/xmloff/xmltoken.hxx|1 
 xmloff/source/core/xmltoken.cxx   |1 
 xmloff/source/text/txtprmap.cxx   |1 
 21 files changed, 111 insertions(+), 12 deletions(-)

New commits:
commit 9f4bb5bd4f55b4a80544413efde26391849b1d7f
Author: Miklos Vajna vmik...@suse.cz
Date:   Mon Mar 12 17:35:16 2012 +0100

xmloff: implement contextual spacing import/export

diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 3a07e30..f241023 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -467,6 +467,7 @@ namespace xmloff { namespace token {
 XML_CONTENT_VALIDATION,
 XML_CONTENT_VALIDATION_NAME,
 XML_CONTENT_VALIDATIONS,
+XML_CONTEXTUAL_SPACING,
 XML_CONTINUE,
 XML_CONTINUE_NUMBERING,
 XML_CONTOUR_PATH,
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 9ccc67f..7c56037 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -471,6 +471,7 @@ namespace xmloff { namespace token {
 TOKEN( content-validation,  XML_CONTENT_VALIDATION ),
 TOKEN( content-validation-name, XML_CONTENT_VALIDATION_NAME 
),
 TOKEN( content-validations, XML_CONTENT_VALIDATIONS ),
+TOKEN( contextual-spacing,  XML_CONTEXTUAL_SPACING ),
 TOKEN( continue,XML_CONTINUE ),
 TOKEN( continue-numbering,  XML_CONTINUE_NUMBERING ),
 TOKEN( contour-path,XML_CONTOUR_PATH ),
diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index ba5c899..c1ec7e0 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -101,6 +101,7 @@ XMLPropertyMapEntry aXMLParaPropMap[] =
 MP_E( ParaTopMarginRelative,  FO, MARGIN_TOP, 
XML_TYPE_PERCENT16, CTF_PARATOPMARGIN_REL ),
 MP_E( ParaBottomMargin,   FO, MARGIN_BOTTOM,  
XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARABOTTOMMARGIN ),
 MP_E( ParaBottomMarginRelative,FO,MARGIN_BOTTOM,  
XML_TYPE_PERCENT16, CTF_PARABOTTOMMARGIN_REL ),
+{ ParaContextMargin, sizeof(ParaContextMargin)-1, XML_NAMESPACE_STYLE, 
XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0, 
SvtSaveOptions::ODFVER_LATEST },
 // RES_CHRATR_CASEMAP
 MT_E( CharCaseMap,FO, FONT_VARIANT,   
XML_TYPE_TEXT_CASEMAP_VAR,  0 ),
 MT_E( CharCaseMap,FO, TEXT_TRANSFORM, 
XML_TYPE_TEXT_CASEMAP,  0 ),
commit 8631dbf85fb5ed56d225e32ea5a9c36c96b0d649
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Mar 9 15:48:53 2012 +0100

cui: implement contextual spacing UI

diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx
index 7a7af80..1267298 100644
--- a/cui/source/inc/paragrph.hxx
+++ b/cui/source/inc/paragrph.hxx
@@ -85,6 +85,7 @@ private:
 SvxRelativeFieldaTopDist;
 FixedText   aBottomLabel;
 SvxRelativeFieldaBottomDist;
+CheckBoxaContextualCB;
 
 // Zeilenabstand
 FixedLine   aLineDistFrm;
@@ -132,6 +133,7 @@ public:
 voidSetPageWidth( sal_uInt16 nPageWidth );
 voidEnableRelativeMode();
 voidEnableRegisterMode();
+voidEnableContextualMode();
 voidEnableAutoFirstLine();
 voidEnableAbsLineDist(long nMinTwip);
 voidEnableNegativeMode();
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 5672b45..a2334b5 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -282,7 +282,8 @@ sal_Bool SvxStdParagraphTabPage

[Libreoffice-commits] .: svtools/inc sw/qa sw/source writerfilter/source

2012-03-12 Thread Miklos Vajna
 svtools/inc/svtools/rtfkeywd.hxx   |1 
 sw/qa/extras/rtftok/data/n750757.rtf   |   45 +
 sw/qa/extras/rtftok/rtftok.cxx |   21 +++
 sw/source/filter/ww8/rtfattributeoutput.cxx|2 +
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |6 +++
 5 files changed, 75 insertions(+)

New commits:
commit f722299e133568fe75f7cf9ce0c103a1553474c4
Author: Miklos Vajna vmik...@suse.cz
Date:   Mon Mar 12 20:43:42 2012 +0100

implement RTF support of contextual spacing

Import, export and testcase.

diff --git a/svtools/inc/svtools/rtfkeywd.hxx b/svtools/inc/svtools/rtfkeywd.hxx
index dca17c9..67aa41e 100644
--- a/svtools/inc/svtools/rtfkeywd.hxx
+++ b/svtools/inc/svtools/rtfkeywd.hxx
@@ -130,6 +130,7 @@
 #define OOO_STRING_SVTOOLS_RTF_COLUMN \\column
 #define OOO_STRING_SVTOOLS_RTF_COLW \\colw
 #define OOO_STRING_SVTOOLS_RTF_COMMENT \\comment
+#define OOO_STRING_SVTOOLS_RTF_CONTEXTUALSPACE \\contextualspace
 #define OOO_STRING_SVTOOLS_RTF_CREATIM \\creatim
 #define OOO_STRING_SVTOOLS_RTF_CTRL \\ctrl
 #define OOO_STRING_SVTOOLS_RTF_DEFF \\deff
diff --git a/sw/qa/extras/rtftok/data/n750757.rtf 
b/sw/qa/extras/rtftok/data/n750757.rtf
new file mode 100644
index 000..04d78b6
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/n750757.rtf
@@ -0,0 +1,45 @@
+{\rtf1
+{\stylesheet
+{\s15\ql 
\li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\contextualspace
 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 
\f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033 
+\sbasedon0 \snext15 \sqformat \spriority34 \styrsid13858768 List Paragraph;}
+}
+{\*\listtable
+{\list\listtemplateid188802200\listhybrid
+{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\leveltemplateid68026383
+\'02\'00.;}
+{\levelnumbers\'01;}
+\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li720\lin720 }
+{\listname ;}
+\listid983924569}
+}
+{\*\listoverridetable
+{\listoverride\listid983924569\listoverridecount0\ls4}
+}
+\pard\plain \ltrpar\ql 
\li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4409714
 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 
+\f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033 
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 before
+\par 
+{\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 
\f31506\fs22\lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 
\hich\af31506\dbch\af31506\loch\f31506 1.\tab}
+}
+\pard\plain \ltrpar
+\s15\ql 
\fi-360\li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin720\itap0\pararsid13858768\contextualspace
 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 
+\f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033 
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 
\lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 num}
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714  1
+\par 
+{\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 
\f31506\fs22\lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 
\hich\af31506\dbch\af31506\loch\f31506 2.\tab}
+}
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 
+\lang1033\langfe1033\langnp1033\insrsid4409714\charrsid13858768 num}
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714  2
+\par 
+{\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 
\f31506\fs22\insrsid420015 \hich\af31506\dbch\af31506\loch\f31506 3.\tab}
+}
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid420015 num 3
+\par }
+\pard\plain \ltrpar\ql 
\li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4409714
 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 
\f31506\fs22\lang1038\langfe1033\cgrid\langnp1038\langfenp1033 
+{
+\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid4409714 after
+\par }
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 1174626..c11af26 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -62,6 +62,7 @@ public:
 void testFdo42465();
 void testFdo45187();
 void testFdo46662();
+void testN750757();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -72,6 +73,7 @@ public:
 CPPUNIT_TEST(testFdo42465);
 CPPUNIT_TEST(testFdo45187);
 CPPUNIT_TEST(testFdo46662);
+CPPUNIT_TEST(testN750757);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -301,6 +303,25 @@ void RtfModelTest::testFdo46662()
 }
 }
 
+void RtfModelTest::testN750757()
+{
+load(OUString(RTL_CONSTASCII_USTRINGPARAM(n750757.rtf)));
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
+uno::Referencecontainer

[Libreoffice-commits] .: writerfilter/inc

2012-03-11 Thread Miklos Vajna
 writerfilter/inc/resourcemodel/WW8ResourceModel.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit f32fe9f5012e3ee184e1a1fca6814bee9105d8fb
Author: Arnaud Versini arnaud.vers...@gmail.com
Date:   Sun Mar 11 20:42:44 2012 +0100

Add a virtual destrcutor to value to prevent memory leak in RTFValue

diff --git a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx 
b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
index f452a83..9504b6f 100644
--- a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
+++ b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
@@ -295,6 +295,8 @@ public:
 typedef auto_ptrValue Pointer_t;
 SAL_WNODEPRECATED_DECLARATIONS_POP
 
+virtual ~Value() {}
+
 /**
Returns integer representation of the value.
  */
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - writerfilter/inc

2012-03-11 Thread Miklos Vajna
 writerfilter/inc/resourcemodel/WW8ResourceModel.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 9972f86a01969535139bf5a02ea10714d94b51a3
Author: Arnaud Versini arnaud.vers...@gmail.com
Date:   Sun Mar 11 20:42:44 2012 +0100

Add a virtual destrcutor to value to prevent memory leak in RTFValue

(cherry picked from commit f32fe9f5012e3ee184e1a1fca6814bee9105d8fb)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx 
b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
index f452a83..9504b6f 100644
--- a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
+++ b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
@@ -295,6 +295,8 @@ public:
 typedef auto_ptrValue Pointer_t;
 SAL_WNODEPRECATED_DECLARATIONS_POP
 
+virtual ~Value() {}
+
 /**
Returns integer representation of the value.
  */
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-03-09 Thread Miklos Vajna
 writerfilter/source/dmapper/NumberingManager.cxx |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 401a834e0bb5b9a1fdf4d8648cb7c630ce452459
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Mar 9 09:26:05 2012 +0100

writerfilter: ifdef + fprintf - SAL_INFO

diff --git a/writerfilter/source/dmapper/NumberingManager.cxx 
b/writerfilter/source/dmapper/NumberingManager.cxx
index a3b0e7e..85ef2f2 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -16,9 +16,7 @@
 #include com/sun/star/text/PositionAndSpaceMode.hpp
 #include com/sun/star/text/XChapterNumberingSupplier.hpp
 
-#if DEBUG
-#include stdio.h
-#endif
+#include rtl/oustringostreaminserter.hxx
 
 #include dmapperLoggers.hxx
 
@@ -53,11 +51,7 @@ void lcl_printProperties( uno::Sequence 
beans::PropertyValue  aProps )
 if ( !( aValue = sValue )  ( aValue = nValue ) )
 sValue = OUString::valueOf( nValue );
 
-#if DEBUG
-fprintf( stderr, Property %s: %s\n,
-OUSTR_TO_C( aProps[i].Name ),
-OUSTR_TO_C( sValue ) );
-#endif
+SAL_INFO(writerfilter, Property   aProps[i].Name  :   
sValue);
 }
 }
 
@@ -534,7 +528,9 @@ void ListDef::CreateNumberingRules( DomainMapper rDMapper,
 // Get the merged level properties
 uno::Sequence beans::PropertyValue  aLvlProps = 
aProps[sal_Int32( nLevel )];
 
+#if DEBUG
 lcl_printProperties( aLvlProps );
+#endif
 
 // Get the char style
 uno::Sequence beans::PropertyValue  aAbsCharStyleProps = 
pAbsLevel-GetCharStyleProperties( );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/inc sw/source

2012-03-09 Thread Miklos Vajna
 sw/inc/fmtcol.hxx  |1 +
 sw/source/core/inc/flowfrm.hxx |1 +
 sw/source/core/inc/txtfrm.hxx  |1 +
 3 files changed, 3 insertions(+)

New commits:
commit 5191ee9800d53c8ebb6f56222eb81a1e4bce9925
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Mar 9 13:08:10 2012 +0100

sw: doxygen comments for SwTxtFmtColl, SwFlowFrm, SwTxtFrm

diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx
index 16db7c6..3451a4b 100644
--- a/sw/inc/fmtcol.hxx
+++ b/sw/inc/fmtcol.hxx
@@ -57,6 +57,7 @@ private:
 const SwFmtColl operator=(const SwFmtColl );
 };
 
+/// Represents the style of a paragraph.
 class SW_DLLPUBLIC SwTxtFmtColl: public SwFmtColl
 {
 friend class SwDoc;
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index 7104060..c10e7b3 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -58,6 +58,7 @@ class SwObjectFormatterTxtFrm;
 
 void MakeFrms( SwDoc *, const SwNodeIndex , const SwNodeIndex  );
 
+/// Base class for frames that are allowed at page breaks and shall continue 
on the next page, e.g. paragraphs, tables.
 class SwFlowFrm
 {
 //PrepareMake darf Locken/Unlocken (Robustheit)
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index c42be69..e8da527 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -62,6 +62,7 @@ class SwWrongList;
 #define RUBY_TOP3
 #define GRID_CELLS  4
 
+/// Represents the visualization of a paragraph.
 class SwTxtFrm: public SwCntntFrm
 {
 friend class SwTxtIter;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - extensions/source

2012-03-09 Thread Miklos Vajna
 extensions/source/bibliography/bibload.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 285b3a4fe0b5b21abe061dfb664800b7e537471e
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Mar 9 14:09:30 2012 +

Fix tools-bibliography database, brown paper bag over head commit :-)

(cherry picked from commit bd1088567bafa6293ffecf5331a9016b6d0438e3)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/extensions/source/bibliography/bibload.cxx 
b/extensions/source/bibliography/bibload.cxx
index 9159124..8b581fd 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -250,7 +250,7 @@ namespace
 static bool lcl_isBaseAvailable()
 {
 Reference XMultiServiceFactory   xMgr = 
comphelper::getProcessServiceFactory();
-Reference XAggregation  xAggregate = Reference XAggregation ( 
xMgr-createInstance(C2U(com.sun.star.sbd.RowSet)), UNO_QUERY);
+Reference XAggregation  xAggregate = Reference XAggregation ( 
xMgr-createInstance(C2U(com.sun.star.sdbc.RowSet)), UNO_QUERY);
 return xAggregate.is();
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-03-08 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   26 ++---
 1 file changed, 3 insertions(+), 23 deletions(-)

New commits:
commit 879325fcf7b9cbf9376bdd0260bbaa943234a654
Author: Miklos Vajna vmik...@suse.cz
Date:   Thu Mar 8 11:11:22 2012 +0100

rtftok: get rid of unnecessary lcl_getNumPr()

The more generic lcl_putNestedSprm() can be used instead.

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index ec01aac..82b1614 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -70,21 +70,6 @@ using rtl::OUStringToOString;
 namespace writerfilter {
 namespace rtftok {
 
-static RTFSprms lcl_getNumPr(std::stackRTFParserState aStates)
-{
-// insert the numpr sprm if necessary
-RTFValue::Pointer_t p = 
aStates.top().aParagraphSprms.find(NS_ooxml::LN_CT_PPrBase_numPr);
-if (!p.get())
-{
-RTFSprms aAttributes;
-RTFSprms aSprms;
-RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms));
-
aStates.top().aParagraphSprms-push_back(make_pair(NS_ooxml::LN_CT_PPrBase_numPr,
 pValue));
-p = aStates.top().aParagraphSprms.find(NS_ooxml::LN_CT_PPrBase_numPr);
-}
-return p-getSprms();
-}
-
 static Id lcl_getParagraphBorder(sal_uInt32 nIndex)
 {
 static const Id aBorderIds[] =
@@ -2337,10 +2322,8 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, 
int nParam)
 }
 break;
 case RTF_ILVL:
-{
-RTFSprms rSprms = lcl_getNumPr(m_aStates);
-rSprms-push_back(make_pair(NS_sprm::LN_PIlvl, pIntValue));
-}
+lcl_putNestedSprm(m_aStates.top().aParagraphSprms, 
NS_ooxml::LN_CT_PPrBase_numPr, NS_sprm::LN_PIlvl, pIntValue);
+break;
 case RTF_LISTTEMPLATEID:
 // This one is not referenced anywhere, so it's pointless to store 
it at the moment.
 break;
@@ -2357,10 +2340,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, 
int nParam)
 if (m_aStates.top().nDestinationState == 
DESTINATION_LISTOVERRIDEENTRY)
 
m_aStates.top().aTableAttributes-push_back(make_pair(NS_rtf::LN_LSID, 
pIntValue));
 else
-{
-RTFSprms rSprms = lcl_getNumPr(m_aStates);
-rSprms-push_back(make_pair(NS_sprm::LN_PIlfo, pIntValue));
-}
+lcl_putNestedSprm(m_aStates.top().aParagraphSprms, 
NS_ooxml::LN_CT_PPrBase_tabs, NS_sprm::LN_PIlfo, pIntValue);
 }
 break;
 case RTF_UC:
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sw/inc sw/source

2012-03-05 Thread Miklos Vajna
 sw/inc/txtfld.hxx   |3 ++-
 sw/source/core/crsr/crstrvl.cxx |3 ++-
 sw/source/core/txtnode/atrfld.cxx   |7 +--
 sw/source/core/txtnode/thints.cxx   |3 ++-
 sw/source/core/unocore/unofield.cxx |5 ++---
 5 files changed, 13 insertions(+), 8 deletions(-)

New commits:
commit be999f1bc692a122e36add37f23312edad8f81d2
Author: Michael Stahl mst...@redhat.com
Date:   Fri Mar 2 21:32:27 2012 +0100

fdo#42073: sw: expand all text fields when setting properties:

SwXTextField::setPropertyValue: call Expand() for all text fields
Fixes getPresentation returning stale values.
(regression from CWS sw34bf01, 8485708f3001fca132c3353c464fe7187ef62bed)
Also, without this the text formatting does not actually update and the new
content is not displayed until some other unrelated editing operation.
(cherry picked from commit e3dfae0741aae8581cd3fc713ba1b4459bb22d88)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/core/unocore/unofield.cxx 
b/sw/source/core/unocore/unofield.cxx
index 6b0ddc7..77134ec 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1911,9 +1911,8 @@ void SwXTextField::setPropertyValue(const OUString 
rPropertyName, const uno::An
 const_castSwFmtFld*(pFmtFld)-Broadcast(SwFmtFldHint( 0, 
SWFMTFLD_CHANGED ));
 }
 
-// changes of the expanded string have to be notified
-//#to the SwTxtFld
-if(RES_DBFLD == nWhich  pFmtFld-GetTxtFld())
+// fdo#42073 notify SwTxtFld about changes of the expanded string
+if (pFmtFld-GetTxtFld())
 {
 pFmtFld-GetTxtFld()-Expand();
 }
commit 81828ab68a37715505b19988cdb4508ee0477c68
Author: Michael Stahl mst...@redhat.com
Date:   Fri Mar 2 19:02:03 2012 +0100

fdo#39694: SwTxtFld: do expand the field in the ctor

While only the text formatting is able to expand all fields correctly,
this is still good enough for many field types and fixes a race
condition when the field value is requested before layout is finished.
(regression from CWS sw34bf01, 8485708f3001fca132c3353c464fe7187ef62bed)
(cherry picked from commit 9519deda120b73b72e75d89c3b2ae3d66220ec2d)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx
index 3ecabb8..f574811 100644
--- a/sw/inc/txtfld.hxx
+++ b/sw/inc/txtfld.hxx
@@ -42,7 +42,8 @@ class SwTxtFld : public SwTxtAttr
 SwTxtNode * m_pTxtNode;
 
 public:
-SwTxtFld(SwFmtFld  rAttr, xub_StrLen const nStart);
+SwTxtFld(SwFmtFld  rAttr, xub_StrLen const nStart,
+bool const bInClipboard);
 virtual ~SwTxtFld();
 
 void CopyFld( SwTxtFld *pDest ) const;
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 31c289c..9e4d6f0 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -710,7 +710,8 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* 
pFldType, sal_Bool bNext,
 SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField(
 (SwDateTimeFieldType*)pDoc-GetSysFldType( RES_DATETIMEFLD ) ) 
);
 
-pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex() );
+pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex(),
+pDoc-IsClipBoard() );
 pTxtFld-ChgTxtNode( pTNd );
 }
 
diff --git a/sw/source/core/txtnode/atrfld.cxx 
b/sw/source/core/txtnode/atrfld.cxx
index 4789c5f..dbf4d82 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -284,9 +284,12 @@ sal_Bool SwFmtFld::IsProtect() const
 |*
 */
 
-SwTxtFld::SwTxtFld(SwFmtFld  rAttr, xub_StrLen const nStartPos)
+SwTxtFld::SwTxtFld(SwFmtFld  rAttr, xub_StrLen const nStartPos,
+bool const bInClipboard)
 : SwTxtAttr( rAttr, nStartPos )
-, m_aExpand( rAttr.GetFld()-ExpandField(true) )
+// fdo#39694 the ExpandField here may not give the correct result in all cases,
+// but is better than nothing
+, m_aExpand( rAttr.GetFld()-ExpandField(bInClipboard) )
 , m_pTxtNode( 0 )
 {
 rAttr.pTxtAttr = this;
diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index d17cb7f..b11682b 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1035,7 +1035,8 @@ SwTxtAttr* MakeTxtAttr( SwDoc  rDoc, SfxPoolItem rAttr,
 pNew = new SwTxtINetFmt( (SwFmtINetFmt)rNew, nStt, nEnd );
 break;
 case RES_TXTATR_FIELD:
-pNew = new SwTxtFld( static_castSwFmtFld (rNew), nStt );
+pNew = new SwTxtFld( static_castSwFmtFld (rNew), nStt,
+rDoc.IsClipBoard() );
 break;
 case RES_TXTATR_FLYCNT:
 {
___
Libreoffice-commits mailing list
Libreoffice-commits

[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 3 commits - sw/JunitTest_sw_complex.mk sw/qa

2012-03-05 Thread Miklos Vajna
 sw/JunitTest_sw_complex.mk  |2 
 sw/qa/complex/writer/CheckFields.java   |  179 
 sw/qa/complex/writer/testdocuments/fdo39694.ott |binary
 3 files changed, 181 insertions(+)

New commits:
commit 2ece920ad7d3876ee6c49bd819ee9aaf99c72e66
Author: Michael Stahl mst...@redhat.com
Date:   Mon Mar 5 12:32:39 2012 +0100

sw: CheckFields: oops, forgot to close the document
(cherry picked from commit 72a3c7a2778c493ef1d3f740a0b4b14f805c624a)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/qa/complex/writer/CheckFields.java 
b/sw/qa/complex/writer/CheckFields.java
index f966e52..00c6916 100644
--- a/sw/qa/complex/writer/CheckFields.java
+++ b/sw/qa/complex/writer/CheckFields.java
@@ -36,6 +36,7 @@ import com.sun.star.lang.XServiceInfo;
 import com.sun.star.beans.XPropertySet;
 import com.sun.star.beans.PropertyValue;
 import com.sun.star.container.XEnumeration;
+import com.sun.star.util.XCloseable;
 import com.sun.star.text.XText;
 import com.sun.star.text.XTextContent;
 import com.sun.star.text.XTextDocument;
@@ -138,6 +139,11 @@ public class CheckFields
 }
 }
 assertTrue(placeholders.isEmpty());
+XCloseable xClos = (XCloseable) UnoRuntime.queryInterface(
+XCloseable.class, xComp);
+if (xClos != null) {
+xClos.close(true);
+}
 }
 
 @Test
commit 24a5db94da34fc40c713d6534b5f741dfee50e44
Author: Michael Stahl mst...@redhat.com
Date:   Mon Mar 5 12:20:48 2012 +0100

fdo#39694, fdo#42073: add junit test for these
(cherry picked from commit 870e5a8e8251967b513b4255231ee9665b085431)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/JunitTest_sw_complex.mk b/sw/JunitTest_sw_complex.mk
index 4ed426d..b242c8d 100644
--- a/sw/JunitTest_sw_complex.mk
+++ b/sw/JunitTest_sw_complex.mk
@@ -40,6 +40,7 @@ $(eval $(call gb_JunitTest_add_sourcefiles,sw_complex,\
 sw/qa/complex/writer/CheckBookmarks \
 sw/qa/complex/writer/CheckCrossReferences \
 sw/qa/complex/writer/CheckFlies \
+sw/qa/complex/writer/CheckFields \
 sw/qa/complex/writer/CheckIndexedPropertyValues \
 sw/qa/complex/writer/CheckNamedPropertyValues \
 sw/qa/complex/writer/LoadSaveTest \
@@ -60,6 +61,7 @@ $(eval $(call gb_JunitTest_add_classes,sw_complex,\
 complex.writer.CheckBookmarks \
 complex.checkColor.CheckChangeColor \
 complex.writer.CheckCrossReferences \
+complex.writer.CheckFields\
 complex.writer.CheckFlies \
 complex.writer.CheckIndexedPropertyValues \
 complex.writer.CheckNamedPropertyValues \
diff --git a/sw/qa/complex/writer/CheckFields.java 
b/sw/qa/complex/writer/CheckFields.java
new file mode 100644
index 000..f966e52
--- /dev/null
+++ b/sw/qa/complex/writer/CheckFields.java
@@ -0,0 +1,173 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the License); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an AS IS basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2012 Red Hat, Inc., Michael Stahl mst...@redhat.com 
(initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the GPLv3+), or
+ * the GNU Lesser General Public License Version 3 or later (the LGPLv3+),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+package complex.writer;
+
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XEnumeration;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.text.XTextField;
+import com.sun.star.text.XTextFieldsSupplier;
+import com.sun.star.text.XTextRange;
+import com.sun.star.text.XTextCursor;
+
+import org.openoffice.test.OfficeConnection;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import java.util.Set;
+import java.util.HashSet;
+
+
+public class

[Libreoffice-commits] .: Branch 'libreoffice-3-4' - 2 commits - sw/inc sw/source

2012-03-05 Thread Miklos Vajna
 sw/inc/txtfld.hxx   |3 ++-
 sw/source/core/crsr/crstrvl.cxx |3 ++-
 sw/source/core/txtnode/atrfld.cxx   |7 +--
 sw/source/core/txtnode/thints.cxx   |3 ++-
 sw/source/core/unocore/unofield.cxx |5 ++---
 5 files changed, 13 insertions(+), 8 deletions(-)

New commits:
commit ea137eef21554dfc7b8420b1f40e7a26eaaa5210
Author: Michael Stahl mst...@redhat.com
Date:   Fri Mar 2 21:32:27 2012 +0100

fdo#42073: sw: expand all text fields when setting properties:

SwXTextField::setPropertyValue: call Expand() for all text fields
Fixes getPresentation returning stale values.
(regression from CWS sw34bf01, 8485708f3001fca132c3353c464fe7187ef62bed)
Also, without this the text formatting does not actually update and the new
content is not displayed until some other unrelated editing operation.
(cherry picked from commit e3dfae0741aae8581cd3fc713ba1b4459bb22d88)

Signed-off-by: Miklos Vajna vmik...@suse.cz
Signed-off-by: Miklos Vajna vmik...@frugalware.org

diff --git a/sw/source/core/unocore/unofield.cxx 
b/sw/source/core/unocore/unofield.cxx
index 8351970..ca9511b 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1902,9 +1902,8 @@ void SwXTextField::setPropertyValue(const OUString 
rPropertyName, const uno::An
 const_castSwFmtFld*(pFmtFld)-Broadcast(SwFmtFldHint( 0, 
SWFMTFLD_CHANGED ));
 }
 
-// changes of the expanded string have to be notified
-//#to the SwTxtFld
-if(RES_DBFLD == nWhich  pFmtFld-GetTxtFld())
+// fdo#42073 notify SwTxtFld about changes of the expanded string
+if (pFmtFld-GetTxtFld())
 {
 pFmtFld-GetTxtFld()-Expand();
 }
commit bad17b39d1567c5f58c439093c8f8b692e106cdc
Author: Michael Stahl mst...@redhat.com
Date:   Fri Mar 2 19:02:03 2012 +0100

fdo#39694: SwTxtFld: do expand the field in the ctor

While only the text formatting is able to expand all fields correctly,
this is still good enough for many field types and fixes a race
condition when the field value is requested before layout is finished.
(regression from CWS sw34bf01, 8485708f3001fca132c3353c464fe7187ef62bed)
(cherry picked from commit 9519deda120b73b72e75d89c3b2ae3d66220ec2d)

Signed-off-by: Miklos Vajna vmik...@suse.cz
Signed-off-by: Miklos Vajna vmik...@frugalware.org

diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx
index 4b06c3f..246de80 100644
--- a/sw/inc/txtfld.hxx
+++ b/sw/inc/txtfld.hxx
@@ -42,7 +42,8 @@ class SwTxtFld : public SwTxtAttr
 SwTxtNode * m_pTxtNode;
 
 public:
-SwTxtFld(SwFmtFld  rAttr, xub_StrLen const nStart);
+SwTxtFld(SwFmtFld  rAttr, xub_StrLen const nStart,
+bool const bInClipboard);
 virtual ~SwTxtFld();
 
 void CopyFld( SwTxtFld *pDest ) const;
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index ca4b282..0bf0aae 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -711,7 +711,8 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* 
pFldType, sal_Bool bNext,
 SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField(
 (SwDateTimeFieldType*)pDoc-GetSysFldType( RES_DATETIMEFLD ) ) 
);
 
-pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex() );
+pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex(),
+pDoc-IsClipBoard() );
 pTxtFld-ChgTxtNode( pTNd );
 }
 
diff --git a/sw/source/core/txtnode/atrfld.cxx 
b/sw/source/core/txtnode/atrfld.cxx
index 30eb065..a2e7462 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -287,9 +287,12 @@ sal_Bool SwFmtFld::IsProtect() const
 |*
 */
 
-SwTxtFld::SwTxtFld(SwFmtFld  rAttr, xub_StrLen const nStartPos)
+SwTxtFld::SwTxtFld(SwFmtFld  rAttr, xub_StrLen const nStartPos,
+bool const bInClipboard)
 : SwTxtAttr( rAttr, nStartPos )
-, m_aExpand( rAttr.GetFld()-ExpandField(true) )
+// fdo#39694 the ExpandField here may not give the correct result in all cases,
+// but is better than nothing
+, m_aExpand( rAttr.GetFld()-ExpandField(bInClipboard) )
 , m_pTxtNode( 0 )
 {
 rAttr.pTxtAttr = this;
diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index b67be35..4f0de8e 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1041,7 +1041,8 @@ SwTxtAttr* MakeTxtAttr( SwDoc  rDoc, SfxPoolItem rAttr,
 pNew = new SwTxtINetFmt( (SwFmtINetFmt)rNew, nStt, nEnd );
 break;
 case RES_TXTATR_FIELD:
-pNew = new SwTxtFld( static_castSwFmtFld (rNew), nStt );
+pNew = new SwTxtFld( static_castSwFmtFld (rNew), nStt,
+rDoc.IsClipBoard() );
 break;
 case RES_TXTATR_FLYCNT

[Libreoffice-commits] .: sw/qa

2012-03-01 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo46662.rtf |   46 ++
 sw/qa/extras/rtftok/rtftok.cxx|   35 +
 2 files changed, 81 insertions(+)

New commits:
commit 7029ccec25bc0b15f9cea463ea3713e802eafc08
Author: Miklos Vajna vmik...@suse.cz
Date:   Thu Mar 1 11:38:47 2012 +0100

testcase for fdo#46662

diff --git a/sw/qa/extras/rtftok/data/fdo46662.rtf 
b/sw/qa/extras/rtftok/data/fdo46662.rtf
new file mode 100644
index 000..db93c9c
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo46662.rtf
@@ -0,0 +1,46 @@
+{\rtf1
+{\*\listtable
+{\list\listtemplateid3
+{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\'01\'00;}
+{\levelnumbers\'01;}
+\fi-360\li720\lin720 }
+{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\'03\'00.\'01;}
+{\levelnumbers\'01\'03;}
+\fi-360\li1080\lin1080 }
+{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\'05\'00.\'01.\'02;}
+{\levelnumbers\'01\'03\'05;}
+\fi-360\li1440\lin1440 
+}
+{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\'07\'00.\'01.\'02.\'03;}
+{\levelnumbers\'01\'03\'05\'07;}
+\fi-360\li1800\lin1800 }
+\listid3}
+}
+{\*\listoverridetable
+{\listoverride\listid3\listoverridecount0\ls3}
+}
+\pard\ls3
+{numbering with all sublevels: test 1
+\par 
+}
+\pard\ls3\ilvl1
+{test 1.1
+\par 
+}
+\pard\ls3\ilvl2
+{test 1.1.1
+\par 
+}
+\pard\ls3\ilvl3
+{test 1.1.1.1
+\par
+}
+\pard\ls3
+{test 2
+\par
+}
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 0e4a31b..1174626 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -28,6 +28,7 @@
 #include com/sun/star/beans/XPropertySet.hpp
 #include com/sun/star/drawing/XDrawPageSupplier.hpp
 #include com/sun/star/lang/XServiceInfo.hpp
+#include com/sun/star/style/XStyleFamiliesSupplier.hpp
 #include com/sun/star/table/BorderLine2.hpp
 #include com/sun/star/table/BorderLineStyle.hpp
 #include com/sun/star/text/RelOrientation.hpp
@@ -60,6 +61,7 @@ public:
 void testN695479();
 void testFdo42465();
 void testFdo45187();
+void testFdo46662();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -69,6 +71,7 @@ public:
 CPPUNIT_TEST(testN695479);
 CPPUNIT_TEST(testFdo42465);
 CPPUNIT_TEST(testFdo45187);
+CPPUNIT_TEST(testFdo46662);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -266,6 +269,38 @@ void RtfModelTest::testFdo45187()
 CPPUNIT_ASSERT(aFirstPoint.Y != aSecondPoint.Y);
 }
 
+void RtfModelTest::testFdo46662()
+{
+load(OUString(RTL_CONSTASCII_USTRINGPARAM(fdo46662.rtf)));
+
+uno::Referencestyle::XStyleFamiliesSupplier 
xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Referencecontainer::XNameAccess 
xStyles(xStyleFamiliesSupplier-getStyleFamilies(), uno::UNO_QUERY);
+uno::Referencecontainer::XNameAccess 
xNumberingStyles(xStyles-getByName(OUString(RTL_CONSTASCII_USTRINGPARAM(NumberingStyles))),
 uno::UNO_QUERY);
+uno::Referencebeans::XPropertySet 
xPropertySet(xNumberingStyles-getByName(OUString(RTL_CONSTASCII_USTRINGPARAM(WWNum3))),
 uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xLevels(xPropertySet-getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NumberingRules))),
 uno::UNO_QUERY);
+uno::Any aValue = xLevels-getByIndex(1); // 2nd level
+uno::Sequencebeans::PropertyValue aProps;
+aValue = aProps;
+
+for (int i = 0; i  aProps.getLength(); ++i)
+{
+const beans::PropertyValue rProp = aProps[i];
+
+if 
(rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(ParentNumbering)))
+{
+sal_Int16 nValue;
+rProp.Value = nValue;
+CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nValue);
+}
+else if (rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(Suffix)))
+{
+rtl::OUString sValue;
+rProp.Value = sValue;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sValue.getLength());
+}
+}
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-03-01 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 456a59b24d4ba5ac341f76b4302e82b687e97f69
Author: Miklos Vajna vmik...@suse.cz
Date:   Thu Mar 1 11:56:08 2012 +0100

fix RTF import of drawing objects when there is no shape to send

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index fbe257c..ad45d96 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3245,7 +3245,7 @@ int RTFDocumentImpl::popState()
 aFrame = m_aStates.top().aFrame;
 bPopFrame = true;
 }
-else if (m_aStates.top().nDestinationState == DESTINATION_DRAWINGOBJECT)
+else if (m_aStates.top().nDestinationState == DESTINATION_DRAWINGOBJECT  
m_aStates.top().aDrawingObject.xShape.is())
 {
 RTFDrawingObject rDrawing = m_aStates.top().aDrawingObject;
 uno::Referencedrawing::XShape xShape(rDrawing.xShape);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sw/source

2012-03-01 Thread Miklos Vajna
 sw/source/core/inc/frame.hxx  |2 ++
 sw/source/core/inc/layfrm.hxx |4 +++-
 sw/source/core/inc/rootfrm.hxx|2 +-
 sw/source/core/inc/sectfrm.hxx|2 +-
 sw/source/core/layout/newfrm.cxx  |9 -
 sw/source/core/layout/sectfrm.cxx |   13 +
 sw/source/core/layout/ssfrm.cxx   |   22 +++---
 7 files changed, 43 insertions(+), 11 deletions(-)

New commits:
commit 5bfeedfcfd542717f40693524dcb7808f23ab42f
Author: Michael Stahl mst...@redhat.com
Date:   Mon Feb 27 20:43:27 2012 +0100

SwSectionFrm: initialised members are happy members

Valgrind complained about uninitialised use in
SwSectionFrm::_CheckClipping (sectfrm.cxx:).
(cherry picked from commit f430b71c46186b53a6364a60b237c81245f3eabb)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index bc16e52..c3beb2e 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -71,7 +71,7 @@ protected:
 public:
 SwSectionFrm( SwSection , SwFrm* ); //Inhalt wird nicht 
erzeugt!
 SwSectionFrm( SwSectionFrm , sal_Bool bMaster );//_Nur_ zum Erzeugen von 
Master/Follows
-~SwSectionFrm();
+virtual ~SwSectionFrm();
 
 void Init();
 virtual void  CheckDirection( sal_Bool bVert );
diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index 3f2ea28..35d38d1 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -71,10 +71,15 @@ SV_IMPL_PTRARR_SORT( SwDestroyList, SwSectionFrmPtr )
 |*  SwSectionFrm::SwSectionFrm(), ~SwSectionFrm()
 |*
 |*/
-SwSectionFrm::SwSectionFrm( SwSection rSect, SwFrm* pSib ) :
-SwLayoutFrm( rSect.GetFmt(), pSib ),
-SwFlowFrm( (SwFrm)*this ),
-pSection( rSect )
+SwSectionFrm::SwSectionFrm( SwSection rSect, SwFrm* pSib )
+: SwLayoutFrm( rSect.GetFmt(), pSib )
+, SwFlowFrm( static_castSwFrm(*this) )
+, pSection( rSect )
+, bFtnAtEnd(false)
+, bEndnAtEnd(false)
+, bCntntLock(false)
+, bOwnFtnNum(false)
+, bFtnLock(false)
 {
 nType = FRMC_SECTION;
 
commit 8e28ba240ae2f958a67c2502546651bd9aed76cd
Author: Michael Stahl mst...@redhat.com
Date:   Mon Feb 27 20:43:27 2012 +0100

SwRootFrm::~SwRootFrm: refactor:

Since CWS swlayoutrefactoring the SwRootFrms are destroyed with
SwDoc::IsInDtor not set.  This can cause at least reads of freed
SwRootFrm members when executing the dtors of SwRootFrm base class
SwLayoutFrm calling into SwRootFrm::GetPageAtPos.

Prevent this scenario by:
- moving the implementation of SwRootFrm base class dtors to new
  methods SwFrm::Destroy and SwLayoutFrm::Destroy
- calling SwFrm::Destroy and SwLayoutFrm::Destroy explicitly before
  SwRootFrm members are freed
(cherry picked from commit ebb74441790a9852b1a1532d6e025c324666f6fc)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 7e4a389..34fcb4b 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -401,6 +401,8 @@ protected:
 void ColLock()  { bColLocked = sal_True; }
 void ColUnlock(){ bColLocked = sal_False; }
 
+void Destroy(); // for ~SwRootFrm
+
 // Only used by SwRootFrm Ctor to get 'this' into mpRoot...
 void setRootFrm( SwRootFrm* pRoot ) { mpRoot = pRoot; }
 
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index 1144a9d..4c4e4e6 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -56,6 +56,8 @@ class SwLayoutFrm: public SwFrm
 
 void CopySubtree( const SwLayoutFrm *pDest );
 protected:
+void Destroy(); // for ~SwRootFrm
+
 virtual void Format( const SwBorderAttrs *pAttrs = 0 );
 virtual void MakeAll();
 
@@ -104,7 +106,7 @@ public:
const sal_Bool bDefaultExpand = sal_True ) 
const;
 
 SwLayoutFrm( SwFrmFmt*, SwFrm* );
-~SwLayoutFrm();
+virtual ~SwLayoutFrm();
 
 virtual void Paint( SwRect const,
 SwPrintData const*const pPrintData = NULL ) const;
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 788fc55..7e07fae 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -177,7 +177,7 @@ public:
 static sal_Bool HasSameRect( const SwRect rRect );
 
 SwRootFrm( SwFrmFmt*, ViewShell* );
-~SwRootFrm();
+virtual ~SwRootFrm();
 void Init(SwFrmFmt*);
 
 ViewShell *GetCurrShell() const { return pCurrShell; }
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 3b6b920..5277d83 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -629,8 +629,15 @@ SwRootFrm::~SwRootFrm

[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sw/source

2012-03-01 Thread Miklos Vajna
 sw/source/core/inc/frame.hxx |2 ++
 sw/source/core/inc/layfrm.hxx|4 +++-
 sw/source/core/inc/rootfrm.hxx   |2 +-
 sw/source/core/layout/newfrm.cxx |9 -
 sw/source/core/layout/ssfrm.cxx  |   21 +++--
 5 files changed, 33 insertions(+), 5 deletions(-)

New commits:
commit 011a970de6f65fe6543337c7da643d998a450750
Author: Michael Stahl mst...@redhat.com
Date:   Mon Feb 27 20:43:27 2012 +0100

SwRootFrm::~SwRootFrm: refactor:

Since CWS swlayoutrefactoring the SwRootFrms are destroyed with
SwDoc::IsInDtor not set.  This can cause at least reads of freed
SwRootFrm members when executing the dtors of SwRootFrm base class
SwLayoutFrm calling into SwRootFrm::GetPageAtPos.

Prevent this scenario by:
- moving the implementation of SwRootFrm base class dtors to new
  methods SwFrm::Destroy and SwLayoutFrm::Destroy
- calling SwFrm::Destroy and SwLayoutFrm::Destroy explicitly before
  SwRootFrm members are freed
(cherry picked from commit ebb74441790a9852b1a1532d6e025c324666f6fc)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index ba148cc..f118233 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -442,6 +442,8 @@ protected:
 void ColLock() { bColLocked = sal_True; }
 void ColUnlock()   { bColLocked = sal_False; }
 
+void Destroy(); // for ~SwRootFrm
+
 // Only used by SwRootFrm Ctor to get 'this' into mpRoot...
 void setRootFrm( SwRootFrm* pRoot ){ mpRoot = pRoot; }
 
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index c6d17ba..14f4a3e 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -56,6 +56,8 @@ class SwLayoutFrm: public SwFrm
 
 void CopySubtree( const SwLayoutFrm *pDest );
 protected:
+void Destroy(); // for ~SwRootFrm
+
 virtual void Format( const SwBorderAttrs *pAttrs = 0 );
 virtual void MakeAll();
 
@@ -104,7 +106,7 @@ public:
const sal_Bool bDefaultExpand = sal_True ) 
const;
 
 SwLayoutFrm( SwFrmFmt*, SwFrm* );
-~SwLayoutFrm();
+virtual ~SwLayoutFrm();
 
 virtual void Paint( SwRect const,
 SwPrintData const*const pPrintData = NULL ) const;
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index a73b28b..e460486 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -178,7 +178,7 @@ public:
 static sal_Bool HasSameRect( const SwRect rRect );
 
 SwRootFrm( SwFrmFmt*, ViewShell* );
-~SwRootFrm();
+virtual ~SwRootFrm();
 void Init(SwFrmFmt*);
 
 ViewShell *GetCurrShell() const { return pCurrShell; }
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index f51aa6b..e96ebb8 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -630,8 +630,15 @@ SwRootFrm::~SwRootFrm()
 (*pCurrShells)[i]-pRoot = 0;
 
 delete pCurrShells;
+pCurrShells = 0;
 
-OSL_ENSURE( 0==nAccessibleShells, Some accessible shells are left );
+// Some accessible shells are left = problems on second SwFrm::Destroy 
call
+assert(0 == nAccessibleShells);
+
+// manually call base classes Destroy because it could call stuff
+// that accesses members of this
+SwLayoutFrm::Destroy();
+SwFrm::Destroy();
 }
 
 /*
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 6ac8bc7..a77b00b 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -365,7 +365,7 @@ Point SwFrm::GetFrmAnchorPos( sal_Bool 
bIgnoreFlysAnchoredAtThisFrame ) const
 |*
 |*/
 
-SwFrm::~SwFrm()
+void SwFrm::Destroy()
 {
 // accessible objects for fly and cell frames have been already disposed
 // by the destructors of the derived classes.
@@ -405,6 +405,7 @@ SwFrm::~SwFrm()
 }
 if ( pDrawObjs )
 delete pDrawObjs;
+pDrawObjs = 0;
 }
 
 #if OSL_DEBUG_LEVEL  1
@@ -413,6 +414,14 @@ SwFrm::~SwFrm()
 #endif
 }
 
+SwFrm::~SwFrm()
+{
+if (!IsRootFrm()) // ~SwRootFrm already calls Destroy!
+{
+Destroy();
+}
+}
+
 /*/
 
 const SwFrmFmt * SwLayoutFrm::GetFmt() const
@@ -560,7 +569,7 @@ void SwCntntFrm::DelFrms( const SwCntntNode rNode )
 |*/
 
 
-SwLayoutFrm::~SwLayoutFrm()
+void SwLayoutFrm::Destroy()
 {
 SwFrm *pFrm = pLower;
 
@@ -644,6 +653,14 @@ SwLayoutFrm::~SwLayoutFrm()
 }
 }
 
+SwLayoutFrm::~SwLayoutFrm()
+{
+if (!IsRootFrm()) // ~SwRootFrm already calls Destroy

[Libreoffice-commits] .: sax/source

2012-02-29 Thread Miklos Vajna
 sax/source/expatwrap/saxwriter.cxx |   48 -
 1 file changed, 48 deletions(-)

New commits:
commit b6164f3f51ae891c9f38eb522f9b248498a5a10c
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Feb 29 09:17:16 2012 +0100

sax: this CalcXMLLen() was commented out since 2001

diff --git a/sax/source/expatwrap/saxwriter.cxx 
b/sax/source/expatwrap/saxwriter.cxx
index 49c6a83..e80b8bd 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -71,54 +71,6 @@ using namespace ::com::sun::star::io;
 */
 
 namespace sax_expatwrap {
-/*
-*
-* Calculates the length of the sequence after conversion, but the conversion 
is not done.
-* .g. ' plus some more are
-* special characters in XML that need to be transformed
-*
-* @param bConvertAll For Attributes it is necessary to convert every symbol 
(including line feed and tab)
-*Set this to true, if you want to perform this special 
conversion
-* @return The returned value is equal to the length of the incoming sequence, 
when no
-+ conversion is necessary, otherwise it is larger than the length of 
the sequence.
-/
-//  inline sal_Int32 CalcXMLLen( const Sequencesal_Int8  seq , sal_Bool 
bConvertAll ) throw()
-//  {
-//  sal_Int32 nLen = 0;
-//  const sal_Int8 *pArray = seq.getConstArray();
-
-//  for( int i = 0 ; i  seq.getLength() ; i ++ ) {
-
-//  sal_Int8 c = pArray[i];
-//  switch( c )
-//  {
-//  case '':   // resemble to amp;
-//  nLen +=5;
-//  break;
-//  case '':   // lt;
-//  case '':   // gt;
-//  nLen +=4;
-//  break;
-//  case 39:// 39 == ''', apos;
-//  case '':   // quot;
-//  case 13:// #x0d;
-//  nLen += 6;
-//  break;
-
-//  case 10:// #x0a;
-//  case 9: // #x09;
-//  if( bConvertAll )
-//  {
-//  nLen += 6;//
-//  }
-//  break;
-//  default:
-//  nLen ++;
-//  }
-//  }
-
-//  return nLen;
-//  }
 
 enum SaxInvalidCharacterError
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-02-29 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 00859026749e005759ce4e7115b746b064cd902b
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Feb 29 12:06:32 2012 +0100

fdo#46662 fix RTF import of numbering levelnumbers

To handle stateful encodings, we process hex characters in one go for a
run. Levelnumbers of numberings should be an exception, since there the
special characters (here: 0x7, which is table cell end) have no special
meaning.

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index f388ec8..7342010 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -760,7 +760,7 @@ int RTFDocumentImpl::resolveChars(char ch)
 if (m_aStates.top().nInternalState != INTERNAL_HEX  !Strm().IsEof())
 Strm().SeekRel(-1);
 
-if (m_aStates.top().nInternalState == INTERNAL_HEX)
+if (m_aStates.top().nInternalState == INTERNAL_HEX  
m_aStates.top().nDestinationState != DESTINATION_LEVELNUMBERS)
 {
 if (!bSkipped)
 m_aHexBuffer.append(ch);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sw/inc sw/source

2012-02-28 Thread Miklos Vajna
 sw/inc/doc.hxx   |2 -
 sw/source/core/doc/docfmt.cxx|   48 ---
 sw/source/ui/dochdl/swdtflvr.cxx |2 -
 3 files changed, 32 insertions(+), 20 deletions(-)

New commits:
commit 018fd9afa4659a791dd6e2a6c1d44185505ba4ec
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Feb 27 12:39:06 2012 +

Resolves: fdo#46038 don't copy page styles into temporary clipboard doc

writer rtf export has a nasty pgdsctbl extension
sd rtf import has nasty if its got a table keyword in it its a table
logic

Classically we never put our styles into the temporary clipboard, so fastest
and safest fix is to simply skip putting the page styles into it.

(cherry picked from commit 15547450bdba10959473c2cb5891f29ad5053b09)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 8165a57..29be2a7 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1275,7 +1275,7 @@ public:
 SwGrfFmtColl* CopyGrfColl( const SwGrfFmtColl rColl );
 
 // Replace all styles with those from rSource.
-void ReplaceStyles( const SwDoc rSource );
+void ReplaceStyles( const SwDoc rSource, bool bIncludePageStyles = true );
 
 // Replace all property defaults with those from rSource.
 void ReplaceDefaults( const SwDoc rSource );
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 10cd5f7..54a9707 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -2135,7 +2135,7 @@ void SwDoc::CopyPageDesc( const SwPageDesc rSrcDesc, 
SwPageDesc rDstDesc,
 }
 }
 
-void SwDoc::ReplaceStyles( const SwDoc rSource )
+void SwDoc::ReplaceStyles( const SwDoc rSource, bool bIncludePageStyles )
 {
 ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
 
@@ -2146,26 +2146,38 @@ void SwDoc::ReplaceStyles( const SwDoc rSource )
 CopyFmtArr( *rSource.pTxtFmtCollTbl, *pTxtFmtCollTbl,
 SwDoc::_MakeTxtFmtColl, *pDfltTxtFmtColl );
 
-// and now the page templates
-sal_uInt16 nCnt = rSource.aPageDescs.Count();
-if( nCnt )
-{
-// a different Doc - Number formatter needs to be merged
-SwTblNumFmtMerge aTNFM( rSource, *this );
+sal_uInt16 nCnt;
 
-// 1st step: Create all formats (skip the 0th - it's the default!)
-while( nCnt )
+//To-Do:
+//  a) in rtf export don't export our hideous pgdsctbl
+//  extension to rtf anymore
+//  b) in sd rtf import (View::InsertData) don't use
+//  a super-fragile test for mere presence of \trowd to
+//  indicate import of rtf into a table
+//  c) then drop use of bIncludePageStyles
+if (bIncludePageStyles)
+{
+// and now the page templates
+nCnt = rSource.aPageDescs.Count();
+if( nCnt )
 {
-SwPageDesc *pSrc = rSource.aPageDescs[ --nCnt ];
-if( 0 == ::lcl_FindPageDesc( aPageDescs, pSrc-GetName() ) )
-MakePageDesc( pSrc-GetName() );
-}
+// a different Doc - Number formatter needs to be merged
+SwTblNumFmtMerge aTNFM( rSource, *this );
 
-// 2nd step: Copy all attributes, set the right parents
-for( nCnt = rSource.aPageDescs.Count(); nCnt; )
-{
-SwPageDesc *pSrc = rSource.aPageDescs[ --nCnt ];
-CopyPageDesc( *pSrc, *::lcl_FindPageDesc( aPageDescs, 
pSrc-GetName() ));
+// 1st step: Create all formats (skip the 0th - it's the default!)
+while( nCnt )
+{
+SwPageDesc *pSrc = rSource.aPageDescs[ --nCnt ];
+if( 0 == ::lcl_FindPageDesc( aPageDescs, pSrc-GetName() ) )
+MakePageDesc( pSrc-GetName() );
+}
+
+// 2nd step: Copy all attributes, set the right parents
+for( nCnt = rSource.aPageDescs.Count(); nCnt; )
+{
+SwPageDesc *pSrc = rSource.aPageDescs[ --nCnt ];
+CopyPageDesc( *pSrc, *::lcl_FindPageDesc( aPageDescs, 
pSrc-GetName() ));
+}
 }
 }
 
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index e5fdd55..dfa85ed 100755
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -379,7 +379,7 @@ namespace
 
 //It would probably make most sense here to only insert the styles used
 //by the selection, e.g. apply SwDoc::IsUsed on styles ?
-rDest.ReplaceStyles(rSrc);
+rDest.ReplaceStyles(rSrc, false);
 
 rSrcWrtShell.Copy(rDest);
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-02-28 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f31548f70c85a83fe820c6ae1c9b9803074039b0
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Feb 28 10:06:29 2012 +0100

RTFFrame::getSprms: use SAL_N_ELEMENTS()

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index f293bf6..f388ec8 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3496,7 +3496,7 @@ RTFSprms RTFFrame::getSprms()
 NS_ooxml::LN_CT_FramePr_lines
 };
 
-for ( int i = 0, len = sizeof( pNames ) / sizeof( Id ); i  len; ++i )
+for ( int i = 0, len = SAL_N_ELEMENTS(pNames); i  len; ++i )
 {
 Id aId = pNames[i];
 RTFValue::Pointer_t pValue;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/qa

2012-02-27 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo45187.rtf |   32 
 sw/qa/extras/rtftok/rtftok.cxx|   22 ++
 2 files changed, 54 insertions(+)

New commits:
commit bb4ceaa4bbe253f4d6b22b09098de0f2f0b793c8
Author: Miklos Vajna vmik...@suse.cz
Date:   Mon Feb 27 11:19:38 2012 +0100

add testcase for fdo#45187

diff --git a/sw/qa/extras/rtftok/data/fdo45187.rtf 
b/sw/qa/extras/rtftok/data/fdo45187.rtf
new file mode 100644
index 000..61b71ad
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo45187.rtf
@@ -0,0 +1,32 @@
+{\rtf1
+{\field
+{\*\fldinst SHAPE }
+{\fldrslt
+{\shp
+{\*\shpinst\shpleft1000\shptop1000\shpright2000\shpbottom2000
+{\sp
+{\sn shapeType}
+{\sv 1}
+}
+}
+}
+}
+}
+first
+\par
+{\field
+{\*\fldinst SHAPE }
+{\fldrslt
+{\shp
+{\*\shpinst\shpleft1000\shptop3000\shpright2000\shpbottom4000
+{\sp
+{\sn shapeType}
+{\sv 3}
+}
+}
+}
+}
+}
+second
+\par
+}
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 92c3229..0e4a31b 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -59,6 +59,7 @@ public:
 void testFdo45543();
 void testN695479();
 void testFdo42465();
+void testFdo45187();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -67,6 +68,7 @@ public:
 CPPUNIT_TEST(testFdo45543);
 CPPUNIT_TEST(testN695479);
 CPPUNIT_TEST(testFdo42465);
+CPPUNIT_TEST(testFdo45187);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -244,6 +246,26 @@ void RtfModelTest::testFdo42465()
 CPPUNIT_ASSERT_EQUAL(3, getLength());
 }
 
+void RtfModelTest::testFdo45187()
+{
+load(OUString(RTL_CONSTASCII_USTRINGPARAM(fdo45187.rtf)));
+
+uno::Referencedrawing::XDrawPageSupplier xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xDraws(xDrawPageSupplier-getDrawPage(), uno::UNO_QUERY);
+// There should be two shapes.
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDraws-getCount());
+// They should be anchored to different paragraphs.
+uno::Referencebeans::XPropertySet xPropertySet(xDraws-getByIndex(0), 
uno::UNO_QUERY);
+uno::Any aValue = 
xPropertySet-getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(AnchorPosition)));
+awt::Point aFirstPoint;
+aValue = aFirstPoint;
+xPropertySet.set(xDraws-getByIndex(1), uno::UNO_QUERY);
+aValue = 
xPropertySet-getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(AnchorPosition)));
+awt::Point aSecondPoint;
+aValue = aSecondPoint;
+CPPUNIT_ASSERT(aFirstPoint.Y != aSecondPoint.Y);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: oox/inc oox/source

2012-02-24 Thread Miklos Vajna
 oox/inc/oox/helper/propertymap.hxx |2 ++
 oox/source/helper/propertymap.cxx  |2 ++
 2 files changed, 4 insertions(+)

New commits:
commit 15af96ffec893cd2b1df734fd61e79feae5e2976
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Feb 24 10:08:04 2012 +0100

oox: guard dbgutil-only methods with ifdef

diff --git a/oox/inc/oox/helper/propertymap.hxx 
b/oox/inc/oox/helper/propertymap.hxx
index eda19e4..2696d49 100644
--- a/oox/inc/oox/helper/propertymap.hxx
+++ b/oox/inc/oox/helper/propertymap.hxx
@@ -100,8 +100,10 @@ public:
 makePropertySet() const;
 
 #if OSL_DEBUG_LEVEL  0
+#ifdef DBG_UTIL
   static void dump( ::com::sun::star::uno::Reference 
::com::sun::star::beans::XPropertySet  rXPropSet);
   void dump();
+#endif
   static void dumpCode( ::com::sun::star::uno::Reference 
::com::sun::star::beans::XPropertySet  rXPropSet);
   void dumpCode();
 #endif
diff --git a/oox/source/helper/propertymap.cxx 
b/oox/source/helper/propertymap.cxx
index 8923d9c..dcc3a83 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -431,6 +431,7 @@ static void lclDumpAnyValue( Any value)
   fprintf (stderr,???   unhandled type %s\n, 
USS(value.getValueTypeName()));
 }
 
+#ifdef DBG_UTIL
 void PropertyMap::dump( Reference XPropertySet  rXPropSet )
 {
 Reference XPropertySetInfo  info = rXPropSet-getPropertySetInfo ();
@@ -454,6 +455,7 @@ void PropertyMap::dump()
 {
 dump( Reference XPropertySet ( makePropertySet(), UNO_QUERY ) );
 }
+#endif
 
 static void printLevel (int level)
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-02-24 Thread Miklos Vajna
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   15 +++
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |2 +-
 2 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit b538f6a0f4193531e1187874b4b35a4384d6fcd1
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Feb 24 15:38:55 2012 +0100

fdo#45187 revert writerfilter import, fixed the shapes import

This reverts commit 0e26bd20978cbdd7c59368044c2a21b98ffba164. Sadly
without a test document for the original issue there is no better fix
for this one.

Acked-by: Luboš Luňák l.lu...@suse.cz
Acked-by: Cédric Bosdonnat cedric.bosdonnat@free.fr

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index d775650..8e5b9ea 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -192,7 +192,7 @@ DomainMapper_Impl::DomainMapper_Impl(
 m_bIsColumnBreakDeferred( false ),
 m_bIsPageBreakDeferred( false ),
 m_bIsInShape( false ),
-m_bRemovedLastAnchored( false ),
+m_bShapeContextAdded( false ),
 m_pLastSectionContext( ),
 m_nCurrentTabStopIndex( 0 ),
 m_sCurrentParaStyleId(),
@@ -1062,8 +1062,6 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr 
pPropertyMap )
 // this is normal: the shape is already attached
 }
 m_aAnchoredStack.pop( );
-m_aTextAppendStack.pop( );
-m_bRemovedLastAnchored = true;
 }
 
 // Get the end of paragraph character inserted
@@ -1204,10 +1202,10 @@ void DomainMapper_Impl::appendOLE( const 
::rtl::OUString rStreamName, OLEHandle
 // gives a better ( visually ) result
 
xOLEProperties-setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName(
 PROP_ANCHOR_TYPE ),  uno::makeAny( text::TextContentAnchorType_AS_CHARACTER ) 
);
 // remove ( if valid ) associated shape ( used for graphic replacement 
)
-if ( m_aAnchoredStack.size()  0 )
+if ( m_bShapeContextAdded )
 {
 if ( lcl_removeShape(  m_xTextDocument, pOLEHandler-getShape(), 
m_aAnchoredStack, m_aTextAppendStack ) )
-m_bRemovedLastAnchored = true; // ensure PopShapeContext 
processing doesn't pop the append stack
+m_bShapeContextAdded = false; // ensure PopShapeContext 
processing doesn't pop the append stack
 }
 
 //
@@ -1219,6 +1217,7 @@ void DomainMapper_Impl::appendOLE( const ::rtl::OUString 
rStreamName, OLEHandle
 (void)rEx;
 OSL_FAIL( Exception in creation of OLE object );
 }
+
 }
 
 void DomainMapper_Impl::appendStarMath( const Value val )
@@ -1549,7 +1548,7 @@ void DomainMapper_Impl::PushShapeContext( const 
uno::Reference drawing::XShape
 {
 // Add the shape to the text append stack
 m_aTextAppendStack.push( uno::Reference text::XTextAppend ( xShape, 
uno::UNO_QUERY_THROW ) );
-m_bRemovedLastAnchored = false;
+m_bShapeContextAdded = true;
 
 // Add the shape to the anchored objects stack
 uno::Reference text::XTextContent  xTxtContent( xShape, 
uno::UNO_QUERY_THROW );
@@ -1588,11 +1587,11 @@ void DomainMapper_Impl::PushShapeContext( const 
uno::Reference drawing::XShape
 
 void DomainMapper_Impl::PopShapeContext()
 {
-if ( !m_bRemovedLastAnchored  m_aAnchoredStack.size()  0 )
+if ( m_bShapeContextAdded )
 {
 RemoveLastParagraph();
 m_aTextAppendStack.pop();
-m_aAnchoredStack.pop();
+m_bShapeContextAdded = false;
 }
 m_bIsInShape = false;
 }
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index c4899cb..924c8dd 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -295,7 +295,7 @@ private:
 bool   
 m_bIsColumnBreakDeferred;
 bool   
 m_bIsPageBreakDeferred;
 bool   
 m_bIsInShape;
-bool   
 m_bRemovedLastAnchored;
+bool   
 m_bShapeContextAdded;
 
 LineNumberSettings 
 m_aLineNumberSettings;
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - writerfilter/source

2012-02-22 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   42 +
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |1 
 2 files changed, 31 insertions(+), 12 deletions(-)

New commits:
commit fe4cea3e8b7416151f67bc6e72e12cc6cf6a0f6d
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Feb 22 11:43:25 2012 +0100

RTF: clean up border property handling

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 4b1a1a7..581f912 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -146,6 +146,7 @@ static RTFSprms lcl_getLastAttributes(RTFSprms rSprms, Id 
nId)
 
 static void lcl_putBorderProperty(std::stackRTFParserState aStates, Id nId, 
RTFValue::Pointer_t pValue)
 {
+RTFSprms* pAttributes = 0;
 if (aStates.top().nBorderState == BORDER_PARAGRAPH_BOX)
 for (int i = 0; i  4; i++)
 {
@@ -156,24 +157,15 @@ static void 
lcl_putBorderProperty(std::stackRTFParserState aStates, Id nId, R
 rAttributes-push_back(make_pair(nId, pValue));
 }
 }
+// Attributes of the last border type
 else if (aStates.top().nBorderState == BORDER_PARAGRAPH)
-{
-// Attributes of the last border type
-RTFSprms rAttributes = 
lcl_getLastAttributes(aStates.top().aParagraphSprms, 
NS_ooxml::LN_CT_PrBase_pBdr);
-rAttributes-push_back(make_pair(nId, pValue));
-}
+pAttributes = lcl_getLastAttributes(aStates.top().aParagraphSprms, 
NS_ooxml::LN_CT_PrBase_pBdr);
 else if (aStates.top().nBorderState == BORDER_CELL)
-{
-// Attributes of the last border type
-RTFSprms rAttributes = 
lcl_getLastAttributes(aStates.top().aTableCellSprms, 
NS_ooxml::LN_CT_TcPrBase_tcBorders);
-rAttributes-push_back(make_pair(nId, pValue));
-}
+pAttributes = lcl_getLastAttributes(aStates.top().aTableCellSprms, 
NS_ooxml::LN_CT_TcPrBase_tcBorders);
 else if (aStates.top().nBorderState == BORDER_PAGE)
-{
-// Attributes of the last border type
-RTFSprms rAttributes = 
lcl_getLastAttributes(aStates.top().aSectionSprms, 
NS_ooxml::LN_EG_SectPrContents_pgBorders);
-rAttributes-push_back(make_pair(nId, pValue));
-}
+pAttributes = lcl_getLastAttributes(aStates.top().aSectionSprms, 
NS_ooxml::LN_EG_SectPrContents_pgBorders);
+if (pAttributes)
+(*pAttributes)-push_back(make_pair(nId, pValue));
 }
 
 // NEEDSWORK: DocxAttributeOutput's impl_AppendTwoDigits does the same.
commit 343b52ee76f1a88a27007319af644dcce76536cc
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Feb 22 11:38:29 2012 +0100

implement RTF import of non-box paragraph borders

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 806b43f..4b1a1a7 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -146,7 +146,7 @@ static RTFSprms lcl_getLastAttributes(RTFSprms rSprms, Id 
nId)
 
 static void lcl_putBorderProperty(std::stackRTFParserState aStates, Id nId, 
RTFValue::Pointer_t pValue)
 {
-if (aStates.top().nBorderState == BORDER_PARAGRAPH)
+if (aStates.top().nBorderState == BORDER_PARAGRAPH_BOX)
 for (int i = 0; i  4; i++)
 {
 RTFValue::Pointer_t p = 
aStates.top().aParagraphSprms.find(lcl_getParagraphBorder(i));
@@ -156,6 +156,12 @@ static void 
lcl_putBorderProperty(std::stackRTFParserState aStates, Id nId, R
 rAttributes-push_back(make_pair(nId, pValue));
 }
 }
+else if (aStates.top().nBorderState == BORDER_PARAGRAPH)
+{
+// Attributes of the last border type
+RTFSprms rAttributes = 
lcl_getLastAttributes(aStates.top().aParagraphSprms, 
NS_ooxml::LN_CT_PrBase_pBdr);
+rAttributes-push_back(make_pair(nId, pValue));
+}
 else if (aStates.top().nBorderState == BORDER_CELL)
 {
 // Attributes of the last border type
@@ -1772,7 +1778,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 
m_aStates.top().aParagraphSprms-push_back(make_pair(NS_sprm::LN_PBrcLeft, 
pValue));
 
m_aStates.top().aParagraphSprms-push_back(make_pair(NS_sprm::LN_PBrcBottom, 
pValue));
 
m_aStates.top().aParagraphSprms-push_back(make_pair(NS_sprm::LN_PBrcRight, 
pValue));
-m_aStates.top().nBorderState = BORDER_PARAGRAPH;
+m_aStates.top().nBorderState = BORDER_PARAGRAPH_BOX;
 }
 break;
 case RTF_LTRSECT:
@@ -1849,6 +1855,26 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
 m_aStates.top().nBorderState = BORDER_PAGE;
 }
 break;
+case RTF_BRDRT:
+case RTF_BRDRL:
+case RTF_BRDRB:
+case RTF_BRDRR:
+{
+RTFSprms aAttributes

[Libreoffice-commits] .: 2 commits - sfx2/source sw/qa

2012-02-22 Thread Miklos Vajna
 sfx2/source/doc/new.cxx  |   12 
 sw/qa/extras/rtftok/data/n695479.rtf |1 +
 sw/qa/extras/rtftok/rtftok.cxx   |   11 +++
 3 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit d453788ac0476cc02b929b0907718ca771d6d956
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Feb 22 15:49:36 2012 +0100

SfxNewFileDialog_Impl: drop unneeded includes

diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index da13a06..3be70a3 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -28,7 +28,6 @@
 
 #include comphelper/string.hxx
 #include sfx2/new.hxx
-#include vcl/gdimtf.hxx
 #include vcl/msgbox.hxx
 #include vcl/morebtn.hxx
 #include svtools/svmedit.hxx
@@ -41,24 +40,13 @@
 
 #include new.hrc
 #include doc.hrc
-#include sfx2/sfx.hrc
-#include helpid.hrc
-#include sfxtypes.hxx
 #include sfx2/app.hxx
-#include sfx2/viewfrm.hxx
-#include sfx2/docfac.hxx
 #include sfx2/objsh.hxx
-#include fltfnc.hxx
-#include sfx2/viewsh.hxx
-#include sfx2/viewfac.hxx
 #include sfx2/sfxresid.hxx
 #include sfx2/docfile.hxx
 #include preview.hxx
 #include sfx2/printer.hxx
 #include vcl/waitobj.hxx
-#include vcl/virdev.hxx
-#include vcl/jobset.hxx
-#include svtools/accessibilityoptions.hxx
 
 // Draw modes
 #define OUTPUT_DRAWMODE_COLOR   (DRAWMODE_DEFAULT)
commit 9fec1e59fa7e92cf91eaf8376f30160edcb86242
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Feb 22 13:05:37 2012 +0100

testcase for non-box paragraph borders

diff --git a/sw/qa/extras/rtftok/data/n695479.rtf 
b/sw/qa/extras/rtftok/data/n695479.rtf
index 213f868..5fe7e45 100644
--- a/sw/qa/extras/rtftok/data/n695479.rtf
+++ b/sw/qa/extras/rtftok/data/n695479.rtf
@@ -1,6 +1,7 @@
 {\rtf1
 \paperw12240\paperh15840\margl360\margr360\margt360\margb302\gutter0\ltrsect 
 \pard\plain \ltrpar\ql 
\li0\ri0\nowidctlpar\pvpg\posx116\posy2167\absh-300\absw5134\overlay\faauto\rin0\lin0\itap0
 
+\brdrb\brdrdb\brdrw15\brsp20
 \rtlch\fcs1 \af0\afs19\alang1025 \ltrch\fcs0 
\fs19\lang1033\langfe1038\loch\af0\hich\af0\dbch\af31505\cgrid\langnp1033\langfenp1038
 
 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 
\fs18\cf1\lang1038\langfe1038\langnp1038\insrsid10974703 
 \hich\af0\dbch\af31505\loch\f0 first
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index a1f6521..eb64e0a 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -28,6 +28,8 @@
 #include com/sun/star/beans/XPropertySet.hpp
 #include com/sun/star/drawing/XDrawPageSupplier.hpp
 #include com/sun/star/lang/XServiceInfo.hpp
+#include com/sun/star/table/BorderLine2.hpp
+#include com/sun/star/table/BorderLineStyle.hpp
 #include com/sun/star/text/RelOrientation.hpp
 #include com/sun/star/text/SizeType.hpp
 #include com/sun/star/text/XTextDocument.hpp
@@ -198,6 +200,15 @@ void RtfModelTest::testN695479()
 uno::Referencetext::XTextRange xRange(xTextContent-getAnchor(), 
uno::UNO_QUERY);
 uno::Referencetext::XText xText(xRange-getText(), 
uno::UNO_QUERY);
 
CPPUNIT_ASSERT_EQUAL(OUString(RTL_CONSTASCII_USTRINGPARAM(plain)), 
xText-getString());
+
+if (i == 0)
+{
+// Additonally, the frist frame should have double border at 
the bottom.
+aValue = 
xPropertySet-getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(BottomBorder)));
+table::BorderLine2 aBorder;
+aValue = aBorder;
+CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::DOUBLE, 
aBorder.LineStyle);
+}
 }
 else if 
(xServiceInfo-supportsService(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(com.sun.star.drawing.LineShape
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: writerfilter/source

2012-02-22 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 0915f1b3d77afa694a2ca692aec307846827da99
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Feb 22 17:06:18 2012 +0100

fdo#42465 fix RTF import of unicode characters with backwards compatibility

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 581f912..f293bf6 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -732,6 +732,7 @@ int RTFDocumentImpl::resolveChars(char ch)
 OStringBuffer aBuf;
 
 bool bUnicodeChecked = false;
+bool bSkipped = false;
 while(!Strm().IsEof()  ch != '{'  ch != '}'  ch != '\\')
 {
 if (ch != 0x0d  ch != 0x0a)
@@ -746,7 +747,10 @@ int RTFDocumentImpl::resolveChars(char ch)
 aBuf.append(ch);
 }
 else
+{
+bSkipped = true;
 m_aStates.top().nCharsToSkip--;
+}
 }
 // read a single char if we're in hex mode
 if (m_aStates.top().nInternalState == INTERNAL_HEX)
@@ -758,7 +762,8 @@ int RTFDocumentImpl::resolveChars(char ch)
 
 if (m_aStates.top().nInternalState == INTERNAL_HEX)
 {
-m_aHexBuffer.append(ch);
+if (!bSkipped)
+m_aHexBuffer.append(ch);
 return 0;
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/qa

2012-02-22 Thread Miklos Vajna
 sw/qa/extras/rtftok/data/fdo42465.rtf |4 ++
 sw/qa/extras/rtftok/rtftok.cxx|   47 ++
 2 files changed, 35 insertions(+), 16 deletions(-)

New commits:
commit 938ddf379004d9696a005ed612994576e2d7cca0
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Feb 22 17:53:03 2012 +0100

testcase for fdo#42465

diff --git a/sw/qa/extras/rtftok/data/fdo42465.rtf 
b/sw/qa/extras/rtftok/data/fdo42465.rtf
new file mode 100644
index 000..06c29d4
--- /dev/null
+++ b/sw/qa/extras/rtftok/data/fdo42465.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+{\langfe1038\dbch\af14\afs24\alang1025\rtlch \ltrch\loch\fs24\lang1038\loch\f7
+k\uc2 \u243\'c3\'b3d\uc1 }
+\par }
diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index eb64e0a..92c3229 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -58,6 +58,7 @@ public:
 void testN192129();
 void testFdo45543();
 void testN695479();
+void testFdo42465();
 
 CPPUNIT_TEST_SUITE(RtfModelTest);
 #if !defined(MACOSX)  !defined(WNT)
@@ -65,11 +66,15 @@ public:
 CPPUNIT_TEST(testN192129);
 CPPUNIT_TEST(testFdo45543);
 CPPUNIT_TEST(testN695479);
+CPPUNIT_TEST(testFdo42465);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
 private:
+/// Load an RTF file and make the document available via mxComponent.
 void load(const OUString rURL);
+/// Get the length of the whole document.
+int getLength();
 uno::Referencelang::XComponent mxComponent;
 };
 
@@ -78,6 +83,25 @@ void RtfModelTest::load(const OUString rFilename)
 mxComponent = loadFromDesktop(getURLFromSrc(/sw/qa/extras/rtftok/data/) 
+ rFilename);
 }
 
+int RtfModelTest::getLength()
+{
+uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xParaEnum = 
xParaEnumAccess-createEnumeration();
+OUStringBuffer aBuf;
+while (xParaEnum-hasMoreElements())
+{
+uno::Referencecontainer::XEnumerationAccess 
xRangeEnumAccess(xParaEnum-nextElement(), uno::UNO_QUERY);
+uno::Referencecontainer::XEnumeration xRangeEnum = 
xRangeEnumAccess-createEnumeration();
+while (xRangeEnum-hasMoreElements())
+{
+uno::Referencetext::XTextRange xRange(xRangeEnum-nextElement(), 
uno::UNO_QUERY);
+aBuf.append(xRange-getString());
+}
+}
+return aBuf.getLength();
+}
+
 void RtfModelTest::setUp()
 {
 test::BootstrapFixture::setUp();
@@ -150,22 +174,7 @@ void RtfModelTest::testN192129()
 void RtfModelTest::testFdo45543()
 {
 load(OUString(RTL_CONSTASCII_USTRINGPARAM(fdo45543.rtf)));
-
-uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
-uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
-uno::Referencecontainer::XEnumeration xParaEnum = 
xParaEnumAccess-createEnumeration();
-OUStringBuffer aBuf;
-while (xParaEnum-hasMoreElements())
-{
-uno::Referencecontainer::XEnumerationAccess 
xRangeEnumAccess(xParaEnum-nextElement(), uno::UNO_QUERY);
-uno::Referencecontainer::XEnumeration xRangeEnum = 
xRangeEnumAccess-createEnumeration();
-while (xRangeEnum-hasMoreElements())
-{
-uno::Referencetext::XTextRange xRange(xRangeEnum-nextElement(), 
uno::UNO_QUERY);
-aBuf.append(xRange-getString());
-}
-}
-CPPUNIT_ASSERT_EQUAL((sal_Int32)5, aBuf.getLength());
+CPPUNIT_ASSERT_EQUAL(5, getLength());
 }
 
 void RtfModelTest::testN695479()
@@ -229,6 +238,12 @@ void RtfModelTest::testN695479()
 CPPUNIT_ASSERT(bDrawFound);
 }
 
+void RtfModelTest::testFdo42465()
+{
+load(OUString(RTL_CONSTASCII_USTRINGPARAM(fdo42465.rtf)));
+CPPUNIT_ASSERT_EQUAL(3, getLength());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >