[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - 8 commits - cui/source cui/uiconfig officecfg/registry sc/sdi sc/source sw/qa sw/source vcl/source

Thomas Beck thomas.beck at cib.de
Mon Nov 20 03:54:00 UTC 2017


Rebased ref, commits from common ancestor:
commit 25fd3cdb8670e042d8095fed85cf446978a62b19
Author: Thomas Beck <thomas.beck at cib.de>
Date:   Mon Nov 13 14:11:36 2017 +0100

    tdf#108947 Added Unittest.
    
    Added different branches for Windows/Linux because of differences in
    linebreaks. Recommit with ifdef guard for preventing tinderbox failure
    
    Reviewed-on: https://gerrit.libreoffice.org/44677
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    
    Conflicts:
            sw/qa/extras/rtfimport/rtfimport.cxx
    
    Change-Id: I08c45e3e653990a47a85aee6f63f063b2f9385a7

diff --git a/sw/qa/extras/rtfimport/data/tdf108947.rtf b/sw/qa/extras/rtfimport/data/tdf108947.rtf
new file mode 100755
index 000000000000..77c2418705d5
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf108947.rtf
@@ -0,0 +1,113 @@
+{\rtf1\ansi\ansicpg1252\deff0
+{\fonttbl
+{\f0\fnil\fcharset0\fprq0\fttruetype Tahoma;}
+{\f1\fnil\fcharset0\fprq0\fttruetype NULL;}
+{\f2\fnil\fcharset0\fprq0\fttruetype Dingbats;}
+{\f3\fnil\fcharset0\fprq0\fttruetype Symbol;}
+{\f4\fnil\fcharset0\fprq0\fttruetype Arial;}
+{\f5\fnil\fcharset0\fprq0\fttruetype Times New Roman;}
+{\f6\fnil\fcharset0\fprq0\fttruetype Courier New;}}
+{\colortbl
+\red0\green0\blue0;
+\red255\green255\blue255;}
+{\stylesheet
+{\s34\fi-431\li720 Tick List;}
+{\s21\fi-431\li720\sbasedon23 Lower Roman List;}
+{\s25\tx431\sbasedon15\snext23 Numbered Heading 1;}
+{\s26\tx431\sbasedon16\snext23 Numbered Heading 2;}
+{\s7\fi-431\li720 Diamond List;}
+{\*\cs9\sbasedon23 Endnote Text;}
+{\s10\tqc\tx4320\tqc\tx8640\f5\fs24\lang4105\sbasedon23\snext10 Footer;}
+{\s22\f5\fs20\lang0\snext22 No List;}
+{\s27\tx431\sbasedon17\snext23 Numbered Heading 3;}
+{\s28\fi-431\li720 Numbered List;}
+{\*\cs8\fs20\super Endnote Reference;}
+{\s14\tqc\tx4320\tqc\tx8640\f5\fs24\lang4105\sbasedon23\snext14 Header;}
+{\s4\tx1584\sbasedon25\snext23 Chapter Heading;}
+{\*\cs6\f5\fs20\lang0 Default Paragraph Font;}
+{\s31\fi-431\li720 Square List;}
+{\s5\fi-431\li720 Dashed List;}
+{\s37\fi-431\li720\sbasedon28 Upper Roman List;}
+{\s18\fi-431\li720 Heart List;}
+{\s24\sb100\f4\fs20\lang1033\sbasedon23\snext24 Normal (Web);}
+{\s3\fi-431\li720 Bullet List;}
+{\s13\fi-431\li720 Hand List;}
+{\*\cs12\fs20\sbasedon23 Footnote Text;}
+{\s15\sb440\sa60\f4\fs34\b\sbasedon23\snext23 Heading 1;}
+{\s16\sb440\sa60\f4\fs28\b\sbasedon23\snext23 Heading 2;}
+{\s17\sb440\sa60\f4\fs24\b\sbasedon23\snext23 Heading 3;}
+{\s33\f5\fs20\lang0\snext33 Table Normal;}
+{\s23\f5\fs24\lang4105\snext23 Normal;}
+{\s20\fi-431\li720\sbasedon28 Lower Case List;}
+{\s1\li1440\ri1440\sa120\sbasedon23 Block Text;}
+{\s36\fi-431\li720\sbasedon28 Upper Case List;}
+{\*\cs11\fs20\super Footnote Reference;}
+{\s30\tx1584\sbasedon25\snext23 Section Heading;}
+{\s19\fi-431\li720 Implies List;}
+{\s2\fi-431\li720 Box List;}
+{\s32\fi-431\li720 Star List;}
+{\s29\f6\sbasedon23 Plain Text;}
+{\s35\fi-431\li720 Triangle List;}}
+\kerning0\cf0\ftnbj\fet2\ftnstart1\ftnnar\aftnnar\ftnstart1\facingp\titlepg{\info}\deftab720\viewkind1\paperw12240\paperh15840\margl1440\margr1440\widowctl
+{\headerl\pard\plain
+\pard\plain\ltrpar\ql\s14\itap0\tqc\tx4320\tqc\tx8640{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0\par}{\f5\fs24\lang4105{\*\listtag0}}
+\sectd\sbknone\colsx360\marglsxn1800\margrsxn1800\pgncont\ltrsect
+\pard\plain\ltrpar\qc\s23\itap0{\f0\fs24\ul\lang4105{\*\listtag0}\abinodiroverride\ltrch Sublet Agreement}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Between}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\ul\lang4105{\*\listtag0}\abinodiroverride\ltrch Joe Drew}{\f0\fs24\lang4105{\*\listtag0}\line (Hereinafter called the "TENANT" of the first part).\line }
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch And}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch \line }{\f0\fs24\ul\lang4105{\*\listtag0}John Horn}{\f0\fs24\lang4105{\*\listtag0} }
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch (Hereinafter called the "SUBTENANT" of the second part).\line \line The TENANT hereby agrees to rent to the SUBTENANT and the SUBTENANT agrees to rent from the TENANT the premises being:}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\ul\lang4105{\*\listtag0}\abinodiroverride\ltrch 511 Albert Street, Unit 111, Waterloo ON Canada N2L 5A7}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch (hereinafter referred to as the \uc1\u8220\'93the premises\uc1\u8221\'94) situated in the Municipality of Waterloo, said premises to be used by the SUBTENANT for residential purposes only, upon the following terms and conditions: }
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch To have and to hold the  premises for and during the term of }{\f0\fs24\ul\lang4105{\*\listtag0}4 months}{\f0\fs24\lang4105{\*\listtag0} to be computed from the }{\f0\fs24\ul\lang4105{\*\listtag0}15}{\f0\fs24\ul\super\lang4105{\*\listtag0}th}{\f0\fs24\ul\lang4105{\*\listtag0} day of August 2004}{\f0\fs24\lang4105{\*\listtag0} and ending on the }{\f0\fs24\ul\lang4105{\*\listtag0}15}{\f0\fs24\ul\super\lang4105{\*\listtag0}th}{\f0\fs24\ul\lang4105{\*\listtag0} day of December 2004. }{\f0\fs24\lang4105{\*\listtag0}The SUBTENANT agrees to give up vacant possession to the original tenant or landlord at the expiry of the sublease.}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch The SUBTENANT and TENANT agree that all terms and conditions existing in the Tenancy Agreement dated February 2001 shall govern the relationship between the TENANT and the SUBTENANT and the TENANT and SUBTENANT agree that the SUBTENANT shall be bound by all of the terms and conditions in the aforementioned Tenancy Agreement.\~ \line \line Yielding and paying therefore monthly and every month during the said term unto the said TENANT the sum of }{\f0\fs24\ul\lang4105{\*\listtag0}$ 375.00}{\f0\fs24\lang4105{\*\listtag0} of lawful money of Canada, without any deduction, defalcation or abatement whatsoever on the 15}{\f0\fs24\super\lang4105{\*\listtag0}th}{\f0\fs24\lang4105{\*\listtag0} day of each month. }
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch The SUBTENANT covenants with the TENANT to pay rent to the tenant and agree to all the terms of the original lease entered into by the original tenant & landlord.}
+\par\pard\plain\ltrpar\ql\sb240\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch The SUBTENANT is to pay water rates and charges for electricity, Internet, cable and phone charges directly to the appropriate utility, with the exception of water which is paid directly to the TENANT.}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}}
+{\headerl\pard\plain
+\par\pard\plain\ltrpar\ql\s14\itap0\tqc\tx4320\tqc\tx8640{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Header Page 2}{\fldrslt {\noproof  ?}}}{\f0\fs24\lang4105{\*\listtag0} }
+\par\pard\plain\ltrpar\ql\s23\itap0\par}{\f5\fs24\lang4105{\*\listtag0}}
+\sect\sectd\sbknone\cols2\marglsxn1800\margrsxn1800\pgncont\ltrsect
+\pard\plain\ltrpar\ql\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch _________________________\line Subtenant Name (Print Please)}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch _________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch _________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Subtenants Permanent Address}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch ________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Subtenants Signature}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch ________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Tenant\uc1\u8217\'92s Name (Print Please)}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch _________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch _________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Tenant\uc1\u8217\'92s  Permanent Address}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch ________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Tenants Signature}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}}
+{\headerl\pard\plain
+\par\pard\plain\ltrpar\ql\s14\itap0\tqc\tx4320\tqc\tx8640{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Header Page 2}{\fldrslt {\noproof  ?}}}{\f0\fs24\lang4105{\*\listtag0} }
+\par\pard\plain\ltrpar\ql\s23\itap0\par}{\f5\fs24\lang4105{\*\listtag0}}
+\sect\sectd\sbknone\colsx360\marglsxn1800\margrsxn1800\pgncont\ltrsect
+\pard\plain\ltrpar\ql\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}
+\par}\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch _________________________}
+\par\pard\plain\ltrpar\ql\s23\itap0{\f0\fs24\lang4105{\*\listtag0}\abinodiroverride\ltrch Date}}
\ No newline at end of file
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 2e1f44d32bf3..2d1b1b4b32cb 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2756,6 +2756,27 @@ DECLARE_RTFIMPORT_TEST(testImportHeaderFooter, "tdf108055.rtf")
     CPPUNIT_ASSERT_EQUAL(OUString("Footer uneven"), aActual);
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf108947, "tdf108947.rtf")
+{
+    //Check page count
+    CPPUNIT_ASSERT_EQUAL(2, getPages());
+
+    //Check if Headers/Footers contain what they should in this document
+    uno::Reference<text::XText> xHeaderTextRight = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Default Style"), "HeaderTextRight");
+    OUString aActual = xHeaderTextRight->getString();
+    CPPUNIT_ASSERT_EQUAL(OUString(""), aActual);
+
+    //Document is very fragile, hence we need this guard.
+#if HAVE_MORE_FONTS
+    OUString aExpected = SAL_NEWLINE_STRING;
+    aExpected += SAL_NEWLINE_STRING;
+    aExpected += "Header Page 2 ?";
+    uno::Reference<text::XText> xHeaderTextLeft = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Default Style"), "HeaderTextLeft");
+    aActual = xHeaderTextLeft->getString();
+    CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
+#endif
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 78ffa02fc7769e1c971fb32dee259741259cc02f
Author: Serge Krot <Serge.Krot at cib.de>
Date:   Fri Nov 17 16:21:31 2017 +0100

    tdf#50746 Make "paste unformatted text" work for Calc
    
    The same command with the same Ctrl+Shift+Alt+V hot-key
    was already added inside Writer. So now Calc has it too.
    
    Reviewed-on: https://gerrit.libreoffice.org/44886
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    
    Conflicts:
            sc/sdi/cellsh.sdi
    
    Change-Id: I2b2d1b02e33288bc058c773431f029fb1d33d3be

diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
index 2f6a4dcaccae..595bc0c716ad 100644
--- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
@@ -1273,6 +1273,12 @@
             <value xml:lang="en-US">.uno:PasteSpecial</value>
           </prop>
         </node>
+        <node oor:name="V_SHIFT_MOD1_MOD2" oor:op="replace">
+          <prop oor:name="Command">
+            <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+            <value xml:lang="en-US">.uno:PasteUnformatted</value>
+          </prop>
+        </node>
         <node oor:name="Z_SHIFT_MOD1" oor:op="replace">
           <prop oor:name="Command">
             <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index cf94574c44fc..f2dc1e020451 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -171,6 +171,7 @@ interface CellSelection
     SID_PASTE           [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
     SID_PASTE_SPECIAL   [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
     SID_PASTE_ONLY   [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
+    SID_PASTE_UNFORMATTED [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
     SID_PASTE_ONLY_TEXT   [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
     SID_PASTE_ONLY_FORMULA   [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
     SID_PASTE_ONLY_VALUE   [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ]
diff --git a/sc/sdi/drtxtob.sdi b/sc/sdi/drtxtob.sdi
index 928ffd61bdfa..1c0d5d6f0245 100644
--- a/sc/sdi/drtxtob.sdi
+++ b/sc/sdi/drtxtob.sdi
@@ -52,6 +52,7 @@ interface TableDrawText
     SID_COPY            [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
     SID_PASTE           [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
     SID_PASTE_SPECIAL   [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
+    SID_PASTE_UNFORMATTED [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
     SID_CLIPBOARD_FORMAT_ITEMS [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
     SID_SELECTALL       [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
     SID_CHARMAP         [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
diff --git a/sc/sdi/editsh.sdi b/sc/sdi/editsh.sdi
index 7b0bbff9dc50..7eb1767b0db1 100644
--- a/sc/sdi/editsh.sdi
+++ b/sc/sdi/editsh.sdi
@@ -32,6 +32,7 @@ interface TableText
     SID_COPY            [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
     SID_PASTE           [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
     SID_PASTE_SPECIAL   [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
+    SID_PASTE_UNFORMATTED [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
     SID_CLIPBOARD_FORMAT_ITEMS [ ExecMethod = Execute; StateMethod = GetClipState; Export = FALSE; ]
     SID_SELECTALL       [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
     SID_CHARMAP         [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 087477f69c6f..390b1ca35492 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -168,6 +168,7 @@ void ScDLL::Init()
     SvxFrameLineStyleToolBoxControl ::RegisterControl(SID_FRAME_LINESTYLE,      pMod);
     SvxColorToolBoxControl          ::RegisterControl(SID_FRAME_LINECOLOR,      pMod);
     SvxClipBoardControl             ::RegisterControl(SID_PASTE,                pMod );
+    SvxClipBoardControl             ::RegisterControl(SID_PASTE_UNFORMATTED,    pMod );
     SvxUndoRedoControl              ::RegisterControl(SID_UNDO,                 pMod );
     SvxUndoRedoControl              ::RegisterControl(SID_REDO,                 pMod );
     svx::ParaLineSpacingPopup       ::RegisterControl(SID_ATTR_PARA_LINESPACE,  pMod );
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index ee4d1ec01480..7519cf7ef591 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -200,6 +200,10 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
             ExecutePasteContents( rReq );
             break;
 
+        case SID_PASTE_UNFORMATTED:
+            pOutView->Paste();
+            break;
+
         case SID_SELECTALL:
             {
                 sal_Int32 nCount = pOutliner->GetParagraphCount();
@@ -480,6 +484,7 @@ IMPL_LINK_TYPED( ScDrawTextObjectBar, ClipboardChanged, TransferableDataHelper*,
     SfxBindings& rBindings = pViewData->GetBindings();
     rBindings.Invalidate( SID_PASTE );
     rBindings.Invalidate( SID_PASTE_SPECIAL );
+    rBindings.Invalidate( SID_PASTE_UNFORMATTED );
     rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
 }
 
@@ -513,6 +518,7 @@ void ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet )
         {
             case SID_PASTE:
             case SID_PASTE_SPECIAL:
+            case SID_PASTE_UNFORMATTED:
                 if( !bPastePossible )
                     rSet.DisableItem( nWhich );
                 break;
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index 9a97a6aed7af..e16ffd716dd2 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -75,6 +75,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
 
         case SID_PASTE:
         case SID_PASTE_SPECIAL:
+        case SID_PASTE_UNFORMATTED:
         case SID_CLIPBOARD_FORMAT_ITEMS:
         case SID_HYPERLINK_SETLINK:
             {
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index f8bcb6f6e4ce..d4b78caa5fbb 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -220,6 +220,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
 
             case SID_PASTE:
             case SID_PASTE_SPECIAL:
+            case SID_PASTE_UNFORMATTED:
             case SID_PASTE_ONLY_VALUE:
             case SID_PASTE_ONLY_TEXT:
             case SID_PASTE_ONLY_FORMULA:
@@ -492,6 +493,7 @@ IMPL_LINK_TYPED( ScCellShell, ClipboardChanged, TransferableDataHelper*, pDataHe
     SfxBindings& rBindings = GetViewData()->GetBindings();
     rBindings.Invalidate( SID_PASTE );
     rBindings.Invalidate( SID_PASTE_SPECIAL );
+    rBindings.Invalidate( SID_PASTE_UNFORMATTED );
     rBindings.Invalidate( SID_PASTE_ONLY_VALUE );
     rBindings.Invalidate( SID_PASTE_ONLY_TEXT );
     rBindings.Invalidate( SID_PASTE_ONLY_FORMULA );
@@ -548,6 +550,7 @@ void ScCellShell::GetClipState( SfxItemSet& rSet )
 {
 // SID_PASTE
 // SID_PASTE_SPECIAL
+// SID_PASTE_UNFORMATTED
 // SID_CLIPBOARD_FORMAT_ITEMS
 
     if ( !pImpl->m_pClipEvtLstnr )
@@ -584,6 +587,7 @@ void ScCellShell::GetClipState( SfxItemSet& rSet )
     {
         rSet.DisableItem( SID_PASTE );
         rSet.DisableItem( SID_PASTE_SPECIAL );
+        rSet.DisableItem( SID_PASTE_UNFORMATTED );
         rSet.DisableItem( SID_PASTE_ONLY_VALUE );
         rSet.DisableItem( SID_PASTE_ONLY_TEXT );
         rSet.DisableItem( SID_PASTE_ONLY_FORMULA );
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 19a1618545bd..5e4d470c8373 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1640,6 +1640,22 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
             pTabViewShell->CellContentChanged();        // => PasteFromSystem() ???
             break;
 
+        case SID_PASTE_UNFORMATTED:
+            // differentiate between own cell data and draw objects/external data
+            // this makes FID_INS_CELL_CONTENTS superfluous
+            {
+                WaitObject aWait( GetViewData()->GetDialogParent() );
+                bool bRet = pTabViewShell->PasteFromSystem(SotClipboardFormatId::STRING, true); // TRUE: no error messages
+                if ( bRet )
+                {
+                    rReq.SetReturnValue(SfxInt16Item(nSlot, bRet ? 1 : 0)); // 1 = success, 0 = fail
+                    rReq.Done();
+                }
+
+                pTabViewShell->CellContentChanged();        // => PasteFromSystem() ???
+            }
+            break;
+
         //  other
 
         case FID_INS_ROWBRK:
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 92f211e13d71..5f4084cb8dde 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -307,6 +307,18 @@ void ScEditShell::Execute( SfxRequest& rReq )
             }
             break;
 
+        case SID_PASTE_UNFORMATTED:
+            {
+                pTableView->Paste();
+
+                if (pTopView)
+                {
+                    pTopView->Paste();
+                    pTopView->GetWindow()->GrabFocus();
+                }
+            }
+            break;
+
         case SID_SELECTALL:
             {
                 sal_Int32 nPar = pEngine->GetParagraphCount();
@@ -804,6 +816,7 @@ IMPL_LINK_TYPED( ScEditShell, ClipboardChanged, TransferableDataHelper*, pDataHe
     SfxBindings& rBindings = pViewData->GetBindings();
     rBindings.Invalidate( SID_PASTE );
     rBindings.Invalidate( SID_PASTE_SPECIAL );
+    rBindings.Invalidate( SID_PASTE_UNFORMATTED );
     rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
 }
 
@@ -830,6 +843,7 @@ void ScEditShell::GetClipState( SfxItemSet& rSet )
         {
             case SID_PASTE:
             case SID_PASTE_SPECIAL:
+            case SID_PASTE_UNFORMATTED:
                 if( !bPastePossible )
                     rSet.DisableItem( nWhich );
                 break;
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index ef6ac76f0721..57bf4d68b290 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -448,6 +448,7 @@ void ScTabView::SelectionChanged()
     rBindings.Invalidate( SID_COPY );
     rBindings.Invalidate( SID_PASTE );
     rBindings.Invalidate( SID_PASTE_SPECIAL );
+    rBindings.Invalidate( SID_PASTE_UNFORMATTED );
 
     rBindings.Invalidate( FID_INS_ROW );
     rBindings.Invalidate( FID_INS_COLUMN );
commit 2c5f3df998f36814e5bbd2abf28480f758b01365
Author: Vasily Melenchuk <Vasily.Melenchuk at cib.de>
Date:   Wed Nov 15 13:10:40 2017 +0300

    tdf#113861: Less aggressive expansion of chart headers.
    
    For sheets with low data density (many empty cells) created charts with
    checked "First row as label" or "First column as label" can get too much
    extra rows/columns from data range (if they contain no data).
    
    New approach is to treat empty cells as belonging to data, not to headers.
    
    Change-Id: Ib5fd47636b80e0b8807f75d9eb582eed0ef68627
    Reviewed-on: https://gerrit.libreoffice.org/44755
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 3af8a4faf5e20ccae2386052697713da160afb16)
    Reviewed-on: https://gerrit.libreoffice.org/44904

diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index afe109d3159f..d3dbb1f77e3b 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -243,8 +243,8 @@ vector<ScTokenRef> TokenTable::getAllRanges() const
     return aTokens;
 }
 
-typedef std::map<sal_uInt32, FormulaToken*> FormulaTokenMap;
-typedef std::map<sal_uInt32, FormulaTokenMap*> FormulaTokenMapMap;
+typedef std::map<SCROW, FormulaToken*> FormulaTokenMap;
+typedef std::map<SCCOL, FormulaTokenMap*> FormulaTokenMapMap;
 
 class Chart2PositionMap
 {
@@ -288,67 +288,66 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount,  SCROW nAllRowCount,
     SCROW nHeaderRowCount = (bFillColumnHeader && nAllColCount && nAllRowCount) ? 1 : 0;
     SCCOL nHeaderColCount = (bFillRowHeader && nAllColCount && nAllRowCount) ? 1 : 0;
 
-    if( nHeaderColCount || nHeaderRowCount )
+    if( pDoc && (nHeaderColCount || nHeaderRowCount ) )
     {
-        const SCCOL nInitialHeaderColCount = nHeaderColCount;
         //check whether there is more than one text column or row that should be added to the headers
-        SCROW nSmallestValueRowIndex = nAllRowCount;
-        bool bFoundValues = false;
-        bool bFoundAnything = false;
-        FormulaTokenMapMap::const_iterator it1 = rCols.begin();
-        for (SCCOL nCol = 0; nCol < nAllColCount; ++nCol)
+        SCROW nMaxHeaderRow = nAllRowCount;
+        for ( const auto & rCol : rCols )
         {
-            if (it1 != rCols.end() && nCol>=nHeaderColCount)
+            // Skip header columns
+            if ( rCol.first < nHeaderColCount )
+                continue;
+
+            bool bFoundValuesInCol = false;
+            bool bFoundAnythingInCol = false;
+            for ( const auto & rCell : *rCol.second )
             {
-                bool bFoundValuesInRow = false;
-                FormulaTokenMap* pCol = it1->second;
-                FormulaTokenMap::const_iterator it2 = pCol->begin();
-                for (SCROW nRow = 0; !bFoundValuesInRow && nRow < nSmallestValueRowIndex && it2 != pCol->end(); ++nRow)
+                // Skip header rows
+                if (rCell.first < nHeaderRowCount )
+                    continue;
+
+                ScRange aRange;
+                bool bExternal = false;
+                StackVar eType = rCell.second->GetType();
+                if( eType==svExternal || eType==svExternalSingleRef || eType==svExternalDoubleRef || eType==svExternalName )
+                    bExternal = true;//lllll todo correct?
+                ScTokenRef pSharedToken(rCell.second->Clone());
+                ScRefTokenHelper::getRangeFromToken(aRange, pSharedToken, ScAddress(), bExternal);
+                SCCOL nCol1=0, nCol2=0;
+                SCROW nRow1=0, nRow2=0;
+                SCTAB nTab1=0, nTab2=0;
+                aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
+                if ( pDoc->HasValueData( nCol1, nRow1, nTab1 ) )
                 {
-                    FormulaToken* pToken = it2->second;
-                    if (pToken && nRow>=nHeaderRowCount)
-                    {
-                        ScRange aRange;
-                        bool bExternal = false;
-                        StackVar eType = pToken->GetType();
-                        if( eType==svExternal || eType==svExternalSingleRef || eType==svExternalDoubleRef || eType==svExternalName )
-                            bExternal = true;//lllll todo correct?
-                        ScTokenRef pSharedToken(pToken->Clone());
-                        ScRefTokenHelper::getRangeFromToken(aRange, pSharedToken, ScAddress(), bExternal);
-                        SCCOL nCol1=0, nCol2=0;
-                        SCROW nRow1=0, nRow2=0;
-                        SCTAB nTab1=0, nTab2=0;
-                        aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
-                        if (pDoc && pDoc->HasValueData( nCol1, nRow1, nTab1 ))
-                        {
-                            bFoundValuesInRow = bFoundValues = bFoundAnything = true;
-                            nSmallestValueRowIndex = std::min( nSmallestValueRowIndex, nRow );
-                        }
-                        if( !bFoundAnything )
-                        {
-                            if (pDoc && pDoc->HasData( nCol1, nRow1, nTab1 ) )
-                                bFoundAnything = true;
-                        }
-                    }
-                    ++it2;
+                    // Found some numeric data
+                    bFoundValuesInCol = true;
+                    nMaxHeaderRow = std::min(nMaxHeaderRow, nRow1);
+                    break;
+                }
+                if ( pDoc->HasData( nCol1, nRow1, nTab1 ) )
+                {
+                    // Found some other data (non-numeric)
+                    bFoundAnythingInCol = true;
+                }
+                else
+                {
+                    // If cell is empty, it belongs to data
+                    nMaxHeaderRow = std::min(nMaxHeaderRow, nRow1);
                 }
-                if(!bFoundValues && nHeaderColCount>0)
-                    nHeaderColCount++;
             }
-            ++it1;
-        }
-        if( bFoundAnything )
-        {
-            if(nHeaderRowCount>0)
+
+            if (nHeaderColCount && !bFoundValuesInCol && bFoundAnythingInCol && rCol.first == nHeaderColCount)
             {
-                if( bFoundValues )
-                    nHeaderRowCount = nSmallestValueRowIndex;
-                else if( nAllRowCount>1 )
-                    nHeaderRowCount = nAllRowCount-1;
+                // There is no values in row, but some data. And this column is next to header
+                // So lets put it to header
+                nHeaderColCount++;
             }
         }
-        else //if the cells are completely empty, just use single header rows and columns
-            nHeaderColCount = nInitialHeaderColCount;
+
+        if (nHeaderRowCount)
+        {
+            nHeaderRowCount = nMaxHeaderRow;
+        }
     }
 
     mnDataColCount = nAllColCount - nHeaderColCount;
commit 85f66c100c134f03e37a74921d29ef11cb468fe9
Author: Vasily Melenchuk <Vasily.Melenchuk at cib.de>
Date:   Thu Nov 16 20:55:03 2017 +0300

    tdf#43017: Fix unittest failure after backport
    
    This testcase works fine in master but for some reasons fails
    in 5.2. Testcase behavior was modified because:
    
    1. tdf#76163 case is verified and is not reproducing with
       or without tdf#43017 fix.
    
    2. After saving document there are no visual differences after reopen in
       LO.
    
    3. Same story as p. 2 but with MS Word
    
    4. So let's adjust the XPath query to find the right element
    
    Change-Id: I5710395e8c029fa9f75789a7aa1512da26612aac

diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 35525460b678..0c6fcf2d917f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -432,7 +432,7 @@ DECLARE_OOXMLEXPORT_TEST(testFDO76163 , "fdo76163.docx")
     if (!pXmlDoc)
         return;
     //docx file after RT is getting corrupted.
-    assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:hyperlink/w:r[11]/w:fldChar", "fldCharType", "end" );
+    assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:hyperlink/w:r[13]/w:fldChar", "fldCharType", "end" );
 }
 
 DECLARE_OOXMLEXPORT_TEST(testFDO78659, "fdo78659.docx")
commit 93deee0433ecc3235fbdc5ea05e68fd40deb30b3
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Nov 16 13:48:35 2017 +0200

    tdf#113875: Properly export 1bpp greylevel (but not B&W) PNG images to PDF
    
    No idea whether 1bpp non-greylevel (i.e. with two palette entries that aren't shades
    of grey) PNG images are mishandled.
    
    Change-Id: I72173c7398db7f0e93c19679e3e392949bf1f4d2
    Reviewed-on: https://gerrit.libreoffice.org/44815
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index e138f3869965..d1ce1e0b28d5 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -11291,10 +11291,29 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
             if( aBitmap.GetBitCount() == 1 )
             {
                 // #i47395# 1 bit bitmaps occasionally have an inverted grey palette
-                sal_Int32 nBlackIndex = pAccess->GetBestPaletteIndex( BitmapColor( Color( COL_BLACK ) ) );
-                DBG_ASSERT( nBlackIndex == 0 || nBlackIndex == 1, "wrong black index" );
-                if( nBlackIndex == 1 )
-                    aLine.append( "/Decode[1 0]\n" );
+                sal_uInt16 nBlackIndex = pAccess->GetBestPaletteIndex( BitmapColor( Color( COL_BLACK ) ) );
+                assert( nBlackIndex == 0 || nBlackIndex == 1);
+                sal_uInt16 nWhiteIndex = pAccess->GetBestPaletteIndex( BitmapColor( Color( COL_WHITE ) ) );
+                if( pAccess->GetPalette()[nBlackIndex] == BitmapColor( Color( COL_BLACK ) ) &&
+                    pAccess->GetPalette()[nWhiteIndex] == BitmapColor( Color( COL_WHITE ) ) )
+                {
+                    // It is black and white
+                    if( nBlackIndex == 1 )
+                        aLine.append( "/Decode[1 0]\n" );
+                }
+                else
+                {
+                    // It is two levels of grey
+                    aLine.append( "/Decode[" );
+                    assert( pAccess->GetPalette()[0].GetRed() == pAccess->GetPalette()[0].GetGreen() &&
+                            pAccess->GetPalette()[0].GetRed() == pAccess->GetPalette()[0].GetBlue() &&
+                            pAccess->GetPalette()[1].GetRed() == pAccess->GetPalette()[1].GetGreen() &&
+                            pAccess->GetPalette()[1].GetRed() == pAccess->GetPalette()[1].GetBlue() );
+                    aLine.append( pAccess->GetPalette()[0].GetRed() / 255.0 );
+                    aLine.append( " " );
+                    aLine.append( pAccess->GetPalette()[1].GetRed() / 255.0 );
+                    aLine.append( "]\n" );
+                }
             }
         }
         else
commit 427aba3d1ca69f248bf2cbde52ff07eb80aa3489
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 15 15:44:20 2017 +0000

    crashtesting: assert on export of fdo59645-3.odt to docx
    
    probably since...
    
    commit 3f2e84b4bd0bbd936e0af845ba7cbf68cb2803d6
    Date:   Tue Oct 31 23:39:26 2017 +0100
    
        tdf#38778 Fix output of the font in DOC run
    
        The font information should be output before field declaration.
        Added unit test.
    
        tdf#38778 DOCX output: no double output of the font info
    
    need to also not double output the complex script font info as well
    as the western and ctl info
    
    I misread hAnsi as Asian the last time so thought CJK was already
    handled, handle it for real this time
    
    Change-Id: If57a3ca3f96a7b76f1fb8702a0d5071c0b3e5cd9
    Reviewed-on: https://gerrit.libreoffice.org/44771
    Reviewed-by: Serge Krot (CIB) <Serge.Krot at cib.de>
    Tested-by: Serge Krot (CIB) <Serge.Krot at cib.de>
    Reviewed-on: https://gerrit.libreoffice.org/44779
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 0ffdd716b88c..96c593983795 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6731,6 +6731,14 @@ void DocxAttributeOutput::CharBackground( const SvxBrushItem& rBrush )
 
 void DocxAttributeOutput::CharFontCJK( const SvxFontItem& rFont )
 {
+    if (m_pFontsAttrList.is() && m_pFontsAttrList->hasAttribute(FSNS(XML_w, XML_eastAsia)))
+    {
+        // tdf#38778: do to fields output into DOC the font could be added before and after field declaration
+        // that all sub runs of the field will have correct font inside.
+        // For DOCX we should do not add the same font information twice in the same node
+        return;
+    }
+
     const OUString& sFontName(rFont.GetFamilyName());
     OString sFontNameUtf8 = OUStringToOString(sFontName, RTL_TEXTENCODING_UTF8);
     AddToAttrList( m_pFontsAttrList, FSNS( XML_w, XML_eastAsia ), sFontNameUtf8.getStr() );
commit 612e84787a0415723d58ee5e49d3090feba3ad43
Author: Bernhard Widl <bernhard.widl at cib.de>
Date:   Fri Oct 20 14:34:53 2017 +0200

    tdf#113444 removed capping of default font size
    
    Change-Id: Ic2ef7eeea7dd9306b57d55952ab716d6255f9576
    Reviewed-on: https://gerrit.libreoffice.org/43605
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit cb151051d79a7ec176e769a33a56e7d906fc1425)
    (cherry picked from commit 606393be5fdbded38d986db60cdba6f0353f22ef)

diff --git a/vcl/source/window/settings.cxx b/vcl/source/window/settings.cxx
index c9a8fd1c7ba0..7a14740bc85e 100644
--- a/vcl/source/window/settings.cxx
+++ b/vcl/source/window/settings.cxx
@@ -152,18 +152,9 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, bool bCallHdl )
     ImplGetFrame()->UpdateSettings( rSettings );
 
     StyleSettings aStyleSettings = rSettings.GetStyleSettings();
-    // #97047: Force all fonts except Menu and Help to a fixed height
-    // to avoid UI scaling due to large fonts
-    // - but allow bigger fonts on bigger screens (i16682, i21238)
-    //   dialogs were designed to fit 800x600 with an 8pt font, so scale accordingly
-    int maxFontheight = 9; // #107886#: 9 is default for some asian systems, so always allow if requested
-    if( GetDesktopRectPixel().getHeight() > 600 )
-        maxFontheight = (int) ((( 8.0 * (double) GetDesktopRectPixel().getHeight()) / 600.0) + 1.5);
 
     vcl::Font aFont = aStyleSettings.GetMenuFont();
     int defFontheight = aFont.GetFontHeight();
-    if( defFontheight > maxFontheight )
-        defFontheight = maxFontheight;
 
     // if the UI is korean, chinese or another locale
     // where the system font size is kown to be often too small to
commit d3f8e9b8ed08c8d4afd1cdf3290ee59319658cd7
Author: Serge Krot <Serge.Krot at cib.de>
Date:   Mon Nov 13 17:35:48 2017 +0100

    tdf#113807 Enable clicking on pathfile-names in "Links" dialog
    
    Improved:
    * Very long pathfilename now do not overwrite its label on the dialog
    * Full pathfilename could be clicked to show attachment/image
    with default viewer.
    
    Change-Id: I6e5398ed2a2013aae0d9b51a719e694b3206dcce
    Reviewed-on: https://gerrit.libreoffice.org/44689
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Reviewed-on: https://gerrit.libreoffice.org/44726
    (cherry picked from commit 8f26c68a96d34684a8377adb3ac17ffb81fe313e)

diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index 011f09173c33..108dbb6ab985 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -245,6 +245,7 @@ IMPL_LINK_TYPED( SvBaseLinksDlg, LinksSelectHdl, SvTreeListBox *, pSvTabListBox,
         sfx2::LinkManager::GetDisplayNames( pLink, &sType, &aFileName, pLinkNm, pFilter );
         aFileName = INetURLObject::decode(aFileName, INetURLObject::DECODE_UNAMBIGUOUS);
         m_pFtFullFileName->SetText( aFileName );
+        m_pFtFullFileName->SetURL( aFileName );
         m_pFtFullSourceName->SetText( sLink );
         m_pFtFullTypeName->SetText( sType );
     }
diff --git a/cui/source/inc/linkdlg.hxx b/cui/source/inc/linkdlg.hxx
index 1bc2f1cc4181..18809c129580 100644
--- a/cui/source/inc/linkdlg.hxx
+++ b/cui/source/inc/linkdlg.hxx
@@ -26,6 +26,7 @@
 #include <vcl/edit.hxx>
 #include <vcl/lstbox.hxx>
 #include <vcl/idle.hxx>
+#include <vcl/fixedhyper.hxx>
 
 #include <svtools/svmedit.hxx>
 #include <svtools/svtabbx.hxx>
@@ -45,7 +46,7 @@ class SvBaseLinksDlg : public ModalDialog
     using Window::SetType;
 
     VclPtr<SvTabListBox> m_pTbLinks;
-    VclPtr<FixedText> m_pFtFullFileName;
+    VclPtr<FixedHyperlink> m_pFtFullFileName;
     VclPtr<FixedText> m_pFtFullSourceName;
     VclPtr<FixedText> m_pFtFullTypeName;
     VclPtr<RadioButton> m_pRbAutomatic;
diff --git a/cui/uiconfig/ui/baselinksdialog.ui b/cui/uiconfig/ui/baselinksdialog.ui
index 1d77a0a68c54..a8fb9069dfef 100644
--- a/cui/uiconfig/ui/baselinksdialog.ui
+++ b/cui/uiconfig/ui/baselinksdialog.ui
@@ -297,16 +297,38 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel" id="FULL_FILE_NAME">
+                  <object class="GtkBox" id="box_hexpand">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
+                    <property name="hexpand">True</property>
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkLinkButton" id="FULL_FILE_NAME">
+                        <property name="label"></property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="relief">none</property>
+                        <property name="focus_on_click">False</property>
+                        <property name="xalign">0</property>
+                        <property name="uri"></property>
+                      </object>
+                      <packing>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="top_attach">0</property>
                     <property name="width">1</property>
                     <property name="height">1</property>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
                   </packing>
                 </child>
                 <child>


More information about the Libreoffice-commits mailing list