[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 13 commits - bin/lo-commit-stat download.lst external/expat include/oox oox/source sc/source sd/qa sd/source sw/qa sw/source writerfilter/source xmloff/source

Caolán McNamara caolanm at redhat.com
Fri Aug 4 11:50:12 UTC 2017


 bin/lo-commit-stat                                     |   36 +++++++--------
 download.lst                                           |    4 -
 external/expat/StaticLibrary_expat.mk                  |    1 
 external/expat/StaticLibrary_expat_x64.mk              |    1 
 external/expat/UnpackedTarball_expat.mk                |    2 
 external/expat/expat.getrandom_detection.patch.1       |   40 -----------------
 include/oox/drawingml/shape.hxx                        |    2 
 include/oox/vml/vmltextbox.hxx                         |    2 
 oox/source/drawingml/shape.cxx                         |    6 ++
 oox/source/vml/vmltextbox.cxx                          |   14 +++++
 oox/source/vml/vmltextboxcontext.cxx                   |    6 ++
 sc/source/core/data/document.cxx                       |    2 
 sc/source/ui/undo/undotab.cxx                          |    1 
 sd/qa/unit/data/pptx/tdf109223.pptx                    |binary
 sd/qa/unit/import-tests.cxx                            |   34 ++++++++++++++
 sd/source/ui/dlg/sdpreslt.cxx                          |    2 
 sw/qa/extras/odfimport/data/tdf109228.odt              |binary
 sw/qa/extras/odfimport/odfimport.cxx                   |    7 ++
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx              |    3 +
 sw/qa/extras/ooxmlimport/data/groupshape-fontname.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx               |   11 ++++
 sw/source/core/doc/CntntIdxStore.cxx                   |    6 ++
 sw/source/core/inc/MarkManager.hxx                     |    2 
 writerfilter/source/dmapper/PropertyMap.cxx            |   21 ++++----
 xmloff/source/text/XMLTextFrameContext.cxx             |    1 
 25 files changed, 129 insertions(+), 75 deletions(-)

New commits:
commit f9f8acfb2e9f0b672e1658ed586f43ab40645f81
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Aug 3 14:03:27 2017 +0100

    CVE-2017-11742: Expat 2.2.3
    
    Reviewed-on: https://gerrit.libreoffice.org/40718
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit f680e5a441cecba4d238f031fc417ef3bccfd792)
    
    Change-Id: I1a1de789eaa5a78d2dc0e41ef861d10fa97b689b
    Reviewed-on: https://gerrit.libreoffice.org/40749
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit 2351570154e43fe919e5b9dd756bbe13a6b9c60d)

diff --git a/download.lst b/download.lst
index 7d92110fba01..a6af0c4369b0 100644
--- a/download.lst
+++ b/download.lst
@@ -33,8 +33,8 @@ export EPM_TARBALL := 3ade8cfe7e59ca8e65052644fed9fca4-epm-3.7.tar.gz
 export ETONYEK_MD5SUM := 77ff46936dcc83670557274e7dd2aa33
 export ETONYEK_VERSION_MICRO := 6
 export ETONYEK_TARBALL := libetonyek-0.1.$(ETONYEK_VERSION_MICRO).tar.bz2
-export EXPAT_MD5SUM := d9c3baeab58774cefc2f04faf29f2cf8
-export EXPAT_TARBALL := expat-2.2.1.tar.bz2
+export EXPAT_MD5SUM := f053af63ef5f39bd9b78d01fbc203334
+export EXPAT_TARBALL := expat-2.2.3.tar.bz2
 export FIREBIRD_MD5SUM := 821260b61dafc22899d1464d4e91ee6a
 export FIREBIRD_TARBALL := Firebird-3.0.0.32483-0.tar.bz2
 export FONTCONFIG_TARBALL := 77e15a92006ddc2adbb06f840d591c0e-fontconfig-2.8.0.tar.gz
diff --git a/external/expat/StaticLibrary_expat.mk b/external/expat/StaticLibrary_expat.mk
index 4d6957f9ef52..5a7d43d6c9bd 100644
--- a/external/expat/StaticLibrary_expat.mk
+++ b/external/expat/StaticLibrary_expat.mk
@@ -48,6 +48,7 @@ $(eval $(call gb_StaticLibrary_add_cflags,expat,\
 ))
 
 $(eval $(call gb_StaticLibrary_add_generated_cobjects,expat,\
+	UnpackedTarball/expat/lib/loadlibrary \
 	UnpackedTarball/expat/lib/xmlparse \
 	UnpackedTarball/expat/lib/xmlrole \
 	UnpackedTarball/expat/lib/xmltok \
diff --git a/external/expat/StaticLibrary_expat_x64.mk b/external/expat/StaticLibrary_expat_x64.mk
index a38ba28c80dd..4f92d0fb284e 100644
--- a/external/expat/StaticLibrary_expat_x64.mk
+++ b/external/expat/StaticLibrary_expat_x64.mk
@@ -25,6 +25,7 @@ $(eval $(call gb_StaticLibrary_add_defs,expat_x64,\
 ))
 
 $(eval $(call gb_StaticLibrary_add_x64_generated_cobjects,expat_x64,\
+	UnpackedTarball/expat/lib/loadlibrary_x64 \
 	UnpackedTarball/expat/lib/xmlparse_x64 \
 	UnpackedTarball/expat/lib/xmltok_x64 \
 	UnpackedTarball/expat/lib/xmlrole_x64 \
diff --git a/external/expat/UnpackedTarball_expat.mk b/external/expat/UnpackedTarball_expat.mk
index 5d803dcf303a..f90fc8552568 100644
--- a/external/expat/UnpackedTarball_expat.mk
+++ b/external/expat/UnpackedTarball_expat.mk
@@ -13,7 +13,6 @@ $(eval $(call gb_UnpackedTarball_set_tarball,expat,$(EXPAT_TARBALL)))
 
 $(eval $(call gb_UnpackedTarball_add_patches,expat,\
 	external/expat/expat-winapi.patch \
-	external/expat/expat.getrandom_detection.patch.1 \
 ))
 
 # This is a bit hackish.
@@ -25,6 +24,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,expat,\
 
 $(eval $(call gb_UnpackedTarball_set_post_action,expat,\
 	$(if $(filter $(BUILD_X64),TRUE),         \
+	  cp lib/loadlibrary.c lib/loadlibrary_x64.c && \
 	  cp lib/xmlparse.c lib/xmlparse_x64.c && \
 	  cp lib/xmltok.c lib/xmltok_x64.c     && \
 	  cp lib/xmlrole.c lib/xmlrole_x64.c) \
diff --git a/external/expat/expat.getrandom_detection.patch.1 b/external/expat/expat.getrandom_detection.patch.1
deleted file mode 100644
index eaf25df767dd..000000000000
--- a/external/expat/expat.getrandom_detection.patch.1
+++ /dev/null
@@ -1,40 +0,0 @@
-https://github.com/libexpat/libexpat/issues/52
-
-fixes /usr/include/sys/random.h:37:22: error: expected ')'
-misdetection of random.h feature, already fixed upstream:
-https://github.com/libexpat/libexpat/commit/602e6c78ca750c082b72f8cdf4a38839b312959f
-
-diff -ur expat.org/configure expat/configure
---- expat.org/configure	2017-07-12 17:04:34.000000000 +0200
-+++ expat/configure	2017-07-12 17:05:59.000000000 +0200
-@@ -16341,7 +16341,7 @@
-   }
- 
- _ACEOF
--if ac_fn_c_try_compile "$LINENO"; then :
-+if ac_fn_c_try_link "$LINENO"; then :
- 
- 
- $as_echo "#define HAVE_GETRANDOM 1" >>confdefs.h
-@@ -16386,7 +16386,8 @@
-     conftest$ac_exeext conftest.$ac_ext
- 
- fi
--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+rm -f core conftest.err conftest.$ac_objext \
-+    conftest$ac_exeext conftest.$ac_ext
- 
- 
- for ac_header in fcntl.h unistd.h
-diff -ur expat.org/configure.ac expat/configure.ac
---- expat.org/configure.ac	2017-07-12 17:04:34.000000000 +0200
-+++ expat/configure.ac	2017-07-12 17:05:31.000000000 +0200
-@@ -130,7 +130,7 @@
- 
- 
- AC_MSG_CHECKING([for getrandom (Linux 3.17+, glibc 2.25+)])
--AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-+AC_LINK_IFELSE([AC_LANG_SOURCE([
-   #include <stdlib.h>  /* for NULL */
-   #include <sys/random.h>
-   int main() {
commit 8d46259510c6ac39c74c10cc5e2422430e65b737
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Aug 3 17:24:32 2017 +0100

    Resolves: tdf#111308 crash after load designs with no design selected
    
    Change-Id: Ia7d5e1d0c4c960700d94cfec01a8a01799f89d9a
    Reviewed-on: https://gerrit.libreoffice.org/40732
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit e325a5442ab350e8eb66458aed98d38ce21aec06)
    Reviewed-on: https://gerrit.libreoffice.org/40750
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit 2b4ebf00d21f6305966c78f82336f9ac76425804)

diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx
index 6ee9b9a24b20..3e4f60861fea 100644
--- a/sd/source/ui/dlg/sdpreslt.cxx
+++ b/sd/source/ui/dlg/sdpreslt.cxx
@@ -120,7 +120,7 @@ void SdPresLayoutDlg::GetAttr(SfxItemSet& rOutAttrs)
     {
         aLayoutName = maName + "#" + maLayoutNames[ nId - 1 ];
     }
-    else
+    else if (nId)
     {
         aLayoutName = maLayoutNames[ nId - 1 ];
         if( aLayoutName == maStrNone )
commit 65b77bc45799c32d969debc2365d4e1aaacd5479
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Sat Apr 29 19:15:26 2017 +0200

    lo-commit-stat: use matching group before destroying it with another match
    
    it also doesn't make sense to numerically compare a %hash
    enable warnings in the script and remove a duplicated variable (and
    some unnecessary hash-declarations)
    
    Change-Id: I0a84dc28f369931ee31a1cf12849fde2b63f1ca2
    (cherry picked from commit 249b6a552b00637ae7ad3dcb8d797befba1734ad)
    (cherry picked from commit 7193a4a1a0df775a0eb2ef222871d46b3c8b92b0)

diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index 4ad9f013935f..2e42d468b40d 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -4,6 +4,7 @@
 #!/usr/bin/perl
 
 use strict;
+use warnings;
 use LWP::UserAgent;
 use utf8;
 use File::Temp;
@@ -157,26 +158,24 @@ sub load_git_log($$$$$$$)
 #    }
 
     open (GIT, "$cmd 2>&1|") || die "Can't run $cmd: $!";
-    %{$pdata->{$module}} = ();
 
     while (my $line = <GIT>) {
         chomp $line;
 
         if ( $line =~ m/^commit ([0-9a-z]{20})/ ) {
-            $commit_id = "$1";
+            $commit_id = $1;
             $summary=undef;
-            %{$pdata->{$module}{"$commit_id"}} = ();
             next;
         }
 
         if ( $line =~ /^Author:\s*([^\<]*)\<([^\>]*)>/ ) {
             # get rid of extra empty spaces;
-            my $name = "$1";
+            my $name = $1;
+            my $email = $2;
             $name =~ s/\s+$//;
             die "Error: Author already defined for the commit {$commit_id}\n" if defined ($pdata->{$module}{$commit_id}{'author'});
-            %{$pdata->{$module}{$commit_id}{'author'}} = ();
-            $pdata->{$module}{$commit_id}{'author'}{'name'} = "$name";
-            $pdata->{$module}{$commit_id}{'author'}{'email'} = "$2";
+            $pdata->{$module}{$commit_id}{'author'}{'name'} = $name;
+            $pdata->{$module}{$commit_id}{'author'}{'email'} = $email;
             next;
         }
 
@@ -506,7 +505,6 @@ my $branch_name;
 my $git_command = "git log";
 my $git_cherry;
 my $git_args = "";
-my $branch_name;
 my %data;
 my %bugs = ();
 
@@ -555,7 +553,7 @@ foreach my $arg (@ARGV) {
 }
 
 # default log
-if (%generate_log == 0) {
+unless (%generate_log) {
     $generate_log{"commits"} = 1;
 }
 
commit 991deefd33572202a3d0f1f324c7c7ec4f063f82
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Sat Apr 29 18:54:16 2017 +0200

    lo-commit-stat: improve sort in buglists (by number within a tracker)
    
    Change-Id: I8eb5a3d3141fcc76bf5caffe0a7b30d5ec2b0c8c
    (cherry picked from commit 0b8cccdc20f7e9209de406ee1ec01aec8bfafceb)
    (cherry picked from commit 5f9da269510ea81bc346aba7364dc39f5e42a5fd)

diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index ca3aa638644b..4ad9f013935f 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -402,7 +402,9 @@ sub print_bugs($$$$)
 {
     my ($pbugs, $log, $wiki) = @_;
 
-    foreach my $bug ( sort { $a cmp $b } keys %{$pbugs}) {
+    # sort alphabetically by bugzilla-type, but whithin that numerically
+    foreach my $bug ( sort { ($a =~ /(\D+)/)[0] cmp ($b =~ /(\D+)/)[0] ||
+                             ($a =~ /(\d+)/)[0] <=> ($b =~ /(\d+)/)[0] } keys %{$pbugs}) {
         my $summary = $pbugs->{$bug}{'summary'};
 
         my $authors = "";
commit 22b9e5e4f567097b9ee6d2a010bfd53ba55b070c
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Sat Apr 29 18:26:20 2017 +0200

    lo-commit-stat: default to utf8, adjust regex for tdf bugzilla
    
    Change-Id: I61960512e297417eb096b3bc921974aa43f74ccc
    (cherry picked from commit 9c83796f45e634afd770b772a16209e1dbed7068)
    (cherry picked from commit cbd3c09e29df72a05025c117def44fbcc1163f20)

diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index a4e3f7d1ae32..ca3aa638644b 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -7,6 +7,9 @@ use strict;
 use LWP::UserAgent;
 use utf8;
 use File::Temp;
+use Encode;
+use open ':encoding(utf8)';
+use open ':std' => ':encoding(utf8)';
 
 my %module_dirname = (
     "core"              => "",
@@ -381,19 +384,16 @@ sub get_bug_name($$)
         $ua->env_proxy;
         my $response = $ua->get($url);
         if ($response->is_success) {
-            my $title = $response->title;
-            if ( $title =~ s/^Bug \d+ \S+ // ) {
+            my $title = decode('utf8', $response->title);
+            if ( $title =~ s/^(?:Bug $bug_number \S+|$bug_number –) // ) {
                 print "$title\n";
                 return $title;
             } else {
-                print "warning: not found; using commit message (only got $title)\n";
+                print "warning: not found; using commit message (only got $title)";
             }
-        } else {
-            print "\n";
         }
-    } else {
-        print "\n";
     }
+    print "\n";
 
     return $summary;
 }
commit 2f328efcf1f1ae9f04cdafc72ac2ab28aba37c8b
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Sat Apr 29 17:00:09 2017 +0200

    lo-commit-stat: drop unnecessary check whether hash is defined
    
    besides using deprecated syntax – "if (defined %hash)" (or "if (defined
    @array)" for that matter) – just using "if (%hash)" (or "if (@array)")
    would do, it is also unnecessary to create the hash if it doesn't exist
    (autovivification will take care of that)
    
    Change-Id: Ib5704b2d609ae3658f3c166f9e26a051957149f8
    (cherry picked from commit 146258f82fc15d0a5f8779447a4919429496e9e3)
    (cherry picked from commit 39092ed597bbe3653638736f61748843ddc1cc99)

diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index e33ca798f41e..a4e3f7d1ae32 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -68,7 +68,6 @@ sub search_bugs($$$$)
         # someone mistyped fdo as fd0
         $bug =~ s/^fd0\#/fdo#/;
         # save the bug number
-        %{$pdata->{$module}{$commit_id}{'bugs'}} = () if (! defined %{$pdata->{$module}{$commit_id}{'bugs'}});
         $pdata->{$module}{$commit_id}{'bugs'}{$bug} = 1;
     }
 
@@ -262,7 +261,6 @@ sub get_bug_list($$$)
     foreach my $module ( keys %{$pdata}) {
         foreach my $id ( keys %{$pdata->{$module}}) {
             foreach my $bug (keys %{$pdata->{$module}{$id}{'bugs'}}) {
-                %{$pbugs->{$bug}} = () if (! defined %{$pbugs->{$bug}});
                 my $author = $pdata->{$module}{$id}{'author'}{'name'};
                 my $summary = $pdata->{$module}{$id}{'summary'};
                 $pbugs->{$bug}{'summary'} = $summary;
commit 639ace836d589b9873b2a54e2b2071a767b525da
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Wed Jul 26 10:50:05 2017 +0200

    tdf#107723 Import font name from text portions in shapes
    
    Reviewed-on: https://gerrit.libreoffice.org/40439
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 178b361c6379bc963c8a48925f1807c583f2d09f)
    Reviewed-on: https://gerrit.libreoffice.org/40529
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 07e656c99f86a59039decd462f66fa272ee2fbed)
    
    Change-Id: Ib9b73b5c05ec2e6846ea3adc950ccab5d1c0a9b0

diff --git a/include/oox/vml/vmltextbox.hxx b/include/oox/vml/vmltextbox.hxx
index 0f0828c88797..8b32713c1dae 100644
--- a/include/oox/vml/vmltextbox.hxx
+++ b/include/oox/vml/vmltextbox.hxx
@@ -49,6 +49,8 @@ struct TextParagraphModel
 struct OOX_DLLPUBLIC TextFontModel
 {
     OptValue< OUString > moName;     ///< Font name.
+    OptValue< OUString > moNameAsian; ///< Asian font name.
+    OptValue< OUString > moNameComplex; ///< Complex font name.
     OptValue< OUString > moColor;    ///< Font color, HTML encoded, sort of.
     OptValue< sal_Int32 > monSize;          ///< Font size in twips.
     OptValue< sal_Int32 > monUnderline;     ///< Single or double underline.
diff --git a/oox/source/vml/vmltextbox.cxx b/oox/source/vml/vmltextbox.cxx
index 395bf1e3c1ea..533f55257c73 100644
--- a/oox/source/vml/vmltextbox.cxx
+++ b/oox/source/vml/vmltextbox.cxx
@@ -82,6 +82,20 @@ void TextBox::convert(const uno::Reference<drawing::XShape>& xShape) const
         std::vector<beans::PropertyValue> aPropVec;
         const TextParagraphModel& rParagraph = aIt->maParagraph;
         const TextFontModel& rFont = aIt->maFont;
+        if (rFont.moName.has())
+        {
+            aPropertyValue.Name = "CharFontName";
+            aPropertyValue.Value <<= rFont.moName.get();
+            aPropVec.push_back(aPropertyValue);
+
+            aPropertyValue.Name = "CharFontNameAsian";
+            aPropertyValue.Value <<= rFont.moNameAsian.get();
+            aPropVec.push_back(aPropertyValue);
+
+            aPropertyValue.Name = "CharFontNameComplex";
+            aPropertyValue.Value <<= rFont.moNameComplex.get();
+            aPropVec.push_back(aPropertyValue);
+        }
         if (rFont.mobBold.has())
         {
             aPropertyValue.Name = "CharWeight";
diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx
index 239e53c3a655..c46ff71b98a5 100644
--- a/oox/source/vml/vmltextboxcontext.cxx
+++ b/oox/source/vml/vmltextboxcontext.cxx
@@ -139,6 +139,12 @@ void TextPortionContext::onStartElement(const AttributeList& rAttribs)
         case W_TOKEN(rPr):
         case W_TOKEN(t):
         break;
+        case W_TOKEN(rFonts):
+            // See https://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing.runfonts(v=office.14).aspx
+            maFont.moName = rAttribs.getString(W_TOKEN(ascii));
+            maFont.moNameAsian = rAttribs.getString(W_TOKEN(eastAsia));
+            maFont.moNameComplex = rAttribs.getString(W_TOKEN(cs));
+        break;
         default:
             SAL_INFO("oox", "unhandled: 0x" << std::hex<< getCurrentElement());
         break;
diff --git a/sw/qa/extras/ooxmlimport/data/groupshape-fontname.docx b/sw/qa/extras/ooxmlimport/data/groupshape-fontname.docx
new file mode 100644
index 000000000000..025f737e0556
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/groupshape-fontname.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 8b0ad8f3b512..942917f67eb8 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1512,6 +1512,17 @@ DECLARE_OOXMLIMPORT_TEST(testTdf109524, "tdf109524.docx")
     CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xTables->getByIndex(0), "RelativeWidth"));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testGroupShapeFontName, "groupshape-fontname.docx")
+{
+    // Font names inside a group shape were not imported
+    uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
+    uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY)->getText();
+
+    CPPUNIT_ASSERT_EQUAL(OUString("Calibri"), getProperty<OUString>(getRun(getParagraphOfText(1, xText), 1), "CharFontName"));
+    CPPUNIT_ASSERT_EQUAL(OUString("Calibri"), getProperty<OUString>(getRun(getParagraphOfText(1, xText), 1), "CharFontNameComplex"));
+    CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(getRun(getParagraphOfText(1, xText), 1), "CharFontNameAsian"));
+}
+
 // tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit bcc36b18a76ca66f46dee97102fc0c516d969223
Author: Justin Luth <justin_luth at sil.org>
Date:   Sat Jul 29 11:38:10 2017 -0400

    tdf#108944 writerfilter: fix missing footnote separator
    
    Fix regression from e79ef12b7a904f17d4147fa409d055c12b70f952
       tdf#107033 DOCX import: fix unexpected missing footnote separator.
    Initially related to tdf#68787.
    
    If HandleMarginsHeaderFooter was called twice, then it automatically
    would have disabled the separator. Clearing the HasFtn/HasFtnSep flags
    also shouldn't be run when in the footnote sections.
    
    Reviewed-on: https://gerrit.libreoffice.org/40551
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 6f57c09aadd40009173f8ae3654004dd0cad9fb8)
    
    Change-Id: I00cbd1cbc8dc86edf426f852c59c3f943e373b13
    Reviewed-on: https://gerrit.libreoffice.org/40590
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 234df2fb5901588ccf20cb35cb4c5922aeb89817)

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 08fafb1f25b3..6844e3ead9fc 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -117,6 +117,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92470_footnoteRestart, "tdf92470_footnoteRestart
     SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
     CPPUNIT_ASSERT( pDoc );
     CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote doesn't restart every Page", FTNNUM_PAGE, pDoc->GetFootnoteInfo().eNum );
+
+    uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(25), getProperty<sal_Int32>(xPageStyle, "FootnoteLineRelativeWidth"));
 }
 
 DECLARE_OOXMLEXPORT_TEST(testCharacterBorder, "charborder.odt")
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 9f263ab22630..8b84e318bc67 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1037,17 +1037,12 @@ void SectionPropertyMap::HandleMarginsHeaderFooter(bool bFirstPage, DomainMapper
 
     if (rDM_Impl.m_oBackgroundColor)
         Insert(PROP_BACK_COLOR, uno::makeAny(*rDM_Impl.m_oBackgroundColor));
-    if (rDM_Impl.m_bHasFtn)
+    // Check for missing footnote separator only in case there is at least
+    // one footnote.
+    if (rDM_Impl.m_bHasFtn && !rDM_Impl.m_bHasFtnSep)
     {
-        // Check for missing footnote separator only in case there is at least
-        // one footnote.
-        if (!rDM_Impl.m_bHasFtnSep)
-        {
-            // Set footnote line width to zero, document has no footnote separator.
-            Insert(PROP_FOOTNOTE_LINE_RELATIVE_WIDTH, uno::makeAny(sal_Int32(0)));
-            rDM_Impl.m_bHasFtn = false;
-        }
-        rDM_Impl.m_bHasFtnSep = false;
+        // Set footnote line width to zero, document has no footnote separator.
+        Insert(PROP_FOOTNOTE_LINE_RELATIVE_WIDTH, uno::makeAny(sal_Int32(0)));
     }
 
     /*** if headers/footers are available then the top/bottom margins of the
@@ -1463,6 +1458,12 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
     }
     rDM_Impl.SetIsLastSectionGroup(false);
     rDM_Impl.SetIsFirstParagraphInSection(true);
+
+    if ( !rDM_Impl.IsInFootOrEndnote() )
+    {
+        rDM_Impl.m_bHasFtn = false;
+        rDM_Impl.m_bHasFtnSep = false;
+    }
 }
 
 // Clear the flag that says we should take the header/footer content from
commit 72e3148f50af7dd85c489c7bf641963a3194cab6
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date:   Sat Jul 29 21:43:41 2017 +0200

    tdf#109223: PPTX: Vertical flip of child shape is not imported correctly
    
    Group shape level vertical flip is not handled well. Recent handling
    of group shape's transformation makes it hard to import this attribute,
    but we can import the right text direction at least.
    
    Reviewed-on: https://gerrit.libreoffice.org/40554
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    (cherry picked from commit d742c0019435d0bc90c9342492583636099a057f)
    
    Change-Id: Ib9e39e3dcb28a95fabc61c13152a3f7296fbd4c3
    Reviewed-on: https://gerrit.libreoffice.org/40556
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit c49f2c00067cbe5de714525807290b71aec57ea3)

diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 67f9a9b48afd..b7f1d162d7bb 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -138,6 +138,7 @@ public:
 
     void                            setRotation( sal_Int32 nRotation ) { mnRotation = nRotation; }
     void                            setFlip( bool bFlipH, bool bFlipV ) { mbFlipH = bFlipH; mbFlipV = bFlipV; }
+    void                            applyParentTextFlipV(bool bTextFlipV) { mbInheritedTextFlipV = bTextFlipV; }
     void                            addChild( const ShapePtr& rChildPtr ) { maChildren.push_back( rChildPtr ); }
     std::vector< ShapePtr >&        getChildren() { return maChildren; }
 
@@ -315,6 +316,7 @@ private:
     sal_Int32                       mnRotation;
     bool                            mbFlipH;
     bool                            mbFlipV;
+    bool                            mbInheritedTextFlipV; // Used by group shapes only
     bool                            mbHidden;
     bool                            mbHiddenMasterShape; // master shapes can be hidden in layout slides
                                                          // we need separate flag because we don't want
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index cd564964af35..2090057cb2b1 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -116,6 +116,7 @@ Shape::Shape( const sal_Char* pServiceName, bool bDefaultHeight )
 , mnRotation( 0 )
 , mbFlipH( false )
 , mbFlipV( false )
+, mbInheritedTextFlipV(false)
 , mbHidden( false )
 , mbHiddenMasterShape( false )
 , mbLockedCanvas( false )
@@ -157,6 +158,7 @@ Shape::Shape( const ShapePtr& pSourceShape )
 , mnRotation( pSourceShape->mnRotation )
 , mbFlipH( pSourceShape->mbFlipH )
 , mbFlipV( pSourceShape->mbFlipV )
+, mbInheritedTextFlipV(pSourceShape->mbInheritedTextFlipV)
 , mbHidden( pSourceShape->mbHidden )
 , mbHiddenMasterShape( pSourceShape->mbHiddenMasterShape )
 , mbLockedCanvas( pSourceShape->mbLockedCanvas )
@@ -314,6 +316,7 @@ void Shape::applyShapeReference( const Shape& rReferencedShape, bool bUseText )
     mnRotation = rReferencedShape.mnRotation;
     mbFlipH = rReferencedShape.mbFlipH;
     mbFlipV = rReferencedShape.mbFlipV;
+    mbInheritedTextFlipV = rReferencedShape.mbInheritedTextFlipV;
     mbHidden = rReferencedShape.mbHidden;
 }
 
@@ -393,6 +396,7 @@ void Shape::addChildren(
     std::vector< ShapePtr >::iterator aIter( rMaster.maChildren.begin() );
     while( aIter != rMaster.maChildren.end() ) {
         (*aIter)->setMasterTextListStyle( mpMasterTextListStyle );
+        (*aIter)->applyParentTextFlipV(mbInheritedTextFlipV != mbFlipV);
         (*aIter++)->addShape( rFilterBase, pTheme, rxShapes, aChildTransformation, getFillProperties(), nullptr, pShapeMap );
     }
 }
@@ -1079,6 +1083,8 @@ Reference< XShape > const & Shape::createAndInsert(
             if( getTextBody() )
             {
                 sal_Int32 nTextRotateAngle = static_cast< sal_Int32 >( getTextBody()->getTextProperties().moRotation.get( 0 ) );
+                if(mbInheritedTextFlipV)
+                    nTextRotateAngle -= 180 * 60000;
                 /* OOX measures text rotation clockwise in 1/60000th degrees,
                    relative to the containing shape. setTextRotateAngle wants
                    degrees anticlockwise. */
diff --git a/sd/qa/unit/data/pptx/tdf109223.pptx b/sd/qa/unit/data/pptx/tdf109223.pptx
new file mode 100755
index 000000000000..0f68796e8e14
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf109223.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 65d036d32831..593881d48ee4 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -146,6 +146,7 @@ public:
     void testTdf100926();
     void testTdf89064();
     void testTdf108925();
+    void testTdf109223();
 
     bool checkPattern(sd::DrawDocShellRef& rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
     void testPatternImport();
@@ -212,6 +213,7 @@ public:
     CPPUNIT_TEST(testTdf100926);
     CPPUNIT_TEST(testTdf89064);
     CPPUNIT_TEST(testTdf108925);
+    CPPUNIT_TEST(testTdf109223);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -2169,6 +2171,38 @@ void SdImportTest::testTdf108925()
     xDocShRef->DoClose();
 }
 
+void SdImportTest::testTdf109223()
+{
+    // In the test document flipV attribute is defined for a group shape
+    // This transformation is not applied on child shapes
+    // To make the text direction right at least I added an additional text rotation when parent shape is flipped.
+    sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf109223.pptx"), PPTX);
+    uno::Reference< container::XIndexAccess > xGroupShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW);
+    uno::Reference< beans::XPropertySet > xShape(xGroupShape->getByIndex(1), uno::UNO_QUERY);
+
+    // Check the shape text to make sure we test the right shape
+    OUString sText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getString();
+    CPPUNIT_ASSERT_EQUAL(OUString("Tested child shape"), sText);
+
+    // Check the attribute inherited from parent shape
+    bool bAttributeFound = false;
+    uno::Sequence<beans::PropertyValue> aProps;
+    CPPUNIT_ASSERT(xShape->getPropertyValue("CustomShapeGeometry") >>= aProps);
+    for (sal_Int32 i = 0; i < aProps.getLength(); ++i)
+    {
+        const beans::PropertyValue& rProp = aProps[i];
+        if (rProp.Name == "TextPreRotateAngle")
+        {
+            CPPUNIT_ASSERT_EQUAL(sal_Int32(180), rProp.Value.get<sal_Int32>());
+            bAttributeFound = true;
+            break;
+        }
+    }
+
+    CPPUNIT_ASSERT_EQUAL(true, bAttributeFound);
+    xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit 281b2c65b32dfcc312f4e662e33f73a867aa75f0
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jul 28 23:44:53 2017 +0200

    tdf#105705 sw: sort bookmarks in ContentIdxStoreImpl::RestoreBkmks()
    
    The problem here is that the SplitNode() calls in SwRTFReader::Read()
    destroy the order of the bookmarks, which causes an assert later
    from the std::lower_bound() when a new mark is created.
    
    The 2 marks that cause the problem are:
    SwPosition (node 5, offset 0)
    SwPosition (node 5, offset 0), SwPosition (node 5, offset 0)
    
    During the 2 SplitNode calls, the second one is corrected by
    ContentIdxStore and remains on 5, but the first one is not and
    becomes:
    SwPosition (node 7, offset 0)
    
    ContentIdxStoreImpl::SaveBkmks() does different things when a
    mark position is exactly on the parameter position: if it has
    only one position, it is ignored, but if it has a second
    position, then both its positions are corrected.
    
    It is not possible to change the sort order so that marks with
    one position are sorted behind marks with 2 positions, because
    while SplitNode() corrects marks "backward", JoinNode() uses
    ContentIdxStore to correct marks "forward"; hence manually sort
    the marks.
    
    Change-Id: If5b35f18bfd47ffe98c0f67e84d380ca801411a3
    (cherry picked from commit f2d2093b2198bd4c65475a60329a5a6a7a8575f1)
    Reviewed-on: https://gerrit.libreoffice.org/40544
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 75a1dce57f7038bc88c74c4e50dd22306be8cf61)

diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx
index fafb771ab490..dee0a89f5c0a 100644
--- a/sw/source/core/doc/CntntIdxStore.cxx
+++ b/sw/source/core/doc/CntntIdxStore.cxx
@@ -22,6 +22,7 @@
 #include <doc.hxx>
 #include <IDocumentRedlineAccess.hxx>
 #include <IDocumentLayoutAccess.hxx>
+#include <MarkManager.hxx>
 #include <docary.hxx>
 #include <editsh.hxx>
 #include <fmtanchr.hxx>
@@ -265,6 +266,11 @@ void ContentIdxStoreImpl::RestoreBkmks(SwDoc* pDoc, updater_t& rUpdater)
             SetRightMarkPos(pMark, aEntry.m_bOther, &aNewPos);
         }
     }
+    if (!m_aBkmkEntries.empty())
+    {   // tdf#105705 sort bookmarks because SaveBkmks special handling of
+        // "bMarkPosEqual" may destroy sort order
+        dynamic_cast<sw::mark::MarkManager*>(pMarkAccess)->sortMarks();
+    }
 }
 
 void ContentIdxStoreImpl::SaveRedlines(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nContent)
diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx
index bc0aecd6064a..093e11855bcb 100644
--- a/sw/source/core/inc/MarkManager.hxx
+++ b/sw/source/core/inc/MarkManager.hxx
@@ -101,7 +101,9 @@ namespace sw {
 
             // make names
             OUString getUniqueMarkName(const OUString& rName) const;
+        public: // FIXME should be private, needs refactor
             void sortMarks();
+        private:
             void sortSubsetMarks();
 
             // container for all marks
commit 9f441698dbc423ba72b71d9b361c3a91cb2d519e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Aug 1 11:34:22 2017 +0100

    Related: tdf#109856 redo 'insert multiple tabs after' inserts too many tabs
    
    Change-Id: I50e8941408343f8fa9acf017d7c195279952916d
    Reviewed-on: https://gerrit.libreoffice.org/40628
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit def36294754a7263101b421166195eb1b95d6d6f)

diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 7245cc99a1f6..7a8311525e8a 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -226,7 +226,6 @@ void ScUndoInsertTables::Redo()
 
     pDocShell->SetInUndo( true );               //! BeginRedo
     bDrawIsInUndo = true;
-    pViewShell->SetTabNo(nTab);
     pViewShell->InsertTables( aNameList, nTab, static_cast<SCTAB>(aNameList.size()),false );
 
     bDrawIsInUndo = false;
commit b52c271928bc1d9630fa180bc3e275fc274c613d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Aug 1 09:16:28 2017 +0100

    Resolves: tdf#109856 undo 'insert multiple tabs after' doesn't work
    
    Change-Id: I534536358b2a949667c1c258bf27e13763c0de57
    Reviewed-on: https://gerrit.libreoffice.org/40622
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit b8db40fb2eb39c4330de475a7cc8155d16479218)

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 3b968eb79e02..54cb77bafedc 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -786,7 +786,7 @@ void ScDocument::ClearTabs()
 bool ScDocument::DeleteTabs( SCTAB nTab, SCTAB nSheets )
 {
     bool bValid = false;
-    if (ValidTab(nTab) && (nTab + nSheets) < static_cast<SCTAB>(maTabs.size()))
+    if (ValidTab(nTab) && (nTab + nSheets) <= static_cast<SCTAB>(maTabs.size()))
     {
         if (maTabs[nTab])
         {
commit 46b5c00ae76385722416819efc15c4116a2872f8
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date:   Thu Jul 20 16:39:07 2017 +0200

    tdf#109228: FILESAVE: ODT: Anchor changed to 'to character' after RT
    
    Ignore frames without names, becuase the code does not handle
    them well. It does not affect those use case for which the
    deduplication code was added.
    
    Reviewed-on: https://gerrit.libreoffice.org/40222
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    (cherry picked from commit 615c2a2c54d3e7aefb4986ae7d8de81a42022988)
    
    Change-Id: I08ad062b8b11cc06323467329d8c4e97bc4932dd
    Reviewed-on: https://gerrit.libreoffice.org/40236
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit de5afba4c116792d795339f7e773e302259d8bf0)

diff --git a/sw/qa/extras/odfimport/data/tdf109228.odt b/sw/qa/extras/odfimport/data/tdf109228.odt
new file mode 100755
index 000000000000..0f3368e1b201
Binary files /dev/null and b/sw/qa/extras/odfimport/data/tdf109228.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 3b1c7af2c5a8..990d2e00ae28 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -20,6 +20,7 @@
 #include <com/sun/star/text/XTextSection.hpp>
 #include <com/sun/star/text/XTextTable.hpp>
 #include <com/sun/star/text/PageNumberType.hpp>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
 
 #include <wrtsh.hxx>
 #include <ndtxt.hxx>
@@ -820,5 +821,11 @@ DECLARE_ODFIMPORT_TEST(testTdf109080_style_ns, "tdf109080_style_ns.odt")
         parseDump("/root/page[2]/footer/txt/text()"));
 }
 
+DECLARE_ODFIMPORT_TEST(testTdf109228, "tdf109228.odt")
+{
+    //  Embedded object with no frame name was imported incorrectly, it was achored 'to character' instead of 'as character'
+    CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index a86d6d3d214c..a17db0cae566 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -569,6 +569,7 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ )
 
     // Skip duplicated frames
     if(!mbMultipleContent && // It's allowed to have multiple image for the same frame
+       !sName.isEmpty() &&
        xTextImportHelper->IsDuplicateFrame(sName, nX, nY, nWidth, nHeight))
     {
         bCreateFailed = true;


More information about the Libreoffice-commits mailing list