[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - 2 commits - include/svx svx/source

Michael Stahl mstahl at redhat.com
Tue Nov 25 09:19:21 PST 2014


 include/svx/rulritem.hxx       |   10 ++++++++++
 svx/source/dialog/rulritem.cxx |    5 +++--
 2 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 74b5a0e2c4f54f97bbbc53170fa9bfc033261f58
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Nov 25 15:14:22 2014 +0100

    svx: add debug printing of SvxColumnDescription
    
    Change-Id: I009e3a506d9b3418215341cb7f3e232e7fcfa04b
    (cherry picked from commit 19576d843af13df618bad500d2e92cf9bca0a062)

diff --git a/include/svx/rulritem.hxx b/include/svx/rulritem.hxx
index 9671f85..a114e2a 100644
--- a/include/svx/rulritem.hxx
+++ b/include/svx/rulritem.hxx
@@ -146,6 +146,16 @@ struct SVX_DLLPUBLIC SvxColumnDescription
     long GetWidth() const;
 };
 
+template<typename charT, typename traits>
+inline std::basic_ostream<charT, traits> & operator <<(
+    std::basic_ostream<charT, traits> & stream, SvxColumnDescription const& dsc)
+{
+    return stream << "{ nStart " << dsc.nStart << " nEnd " << dsc.nEnd
+        << " bVisible " << dsc.bVisible  << " nEndMin " << dsc.nEndMin
+        << " nEndMax " << dsc.nEndMax << " }";
+}
+
+
 class SVX_DLLPUBLIC SvxColumnItem : public SfxPoolItem
 {
     typedef std::vector<SvxColumnDescription> SvxColumnDescriptionVector;
commit a6b8f5a4541f2dc6375c0c449b9bc83235ed4193
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Nov 25 16:36:45 2014 +0100

    fdo#85858: svx: fix mouse dragging of table row separators in Writer
    
    Add a work-around for Writer's usage of LONG_MAX to SvxColumnDescription:
    on 64-bit platforms the LONG_MAX added in SwView::StateTabWin() for
    SID_RULER_ROWS will overflow in vcl's LogicToPixel mapping and that
    causes wrong positioning of the row highlight lines.
    
    Probably Writer should use something other than LONG_MAX (no reason why
    these types need to be bigger than 32-bit anyway) but that needs a
    bigger cleanup.
    
    (regression from 4c60f722afdc0be5c129ce5f5ed6786d09d0051e)
    
    Change-Id: I08147462356368d48959a85a85ef7dd8dcae0943
    (cherry picked from commit d288ee633d7964cf89a32a96e6e0af8c3c3e0db9)

diff --git a/svx/source/dialog/rulritem.cxx b/svx/source/dialog/rulritem.cxx
index 11efac1..f993d69 100644
--- a/svx/source/dialog/rulritem.cxx
+++ b/svx/source/dialog/rulritem.cxx
@@ -670,8 +670,9 @@ SvxColumnDescription::SvxColumnDescription(long start, long end, long endMin, lo
     nStart   (start),
     nEnd     (end),
     bVisible (bVis),
-    nEndMin  (endMin),
-    nEndMax  (endMax)
+    // fdo#85858 hack: clamp these to smaller value to prevent overflow
+    nEndMin(std::min<long>(endMin, std::numeric_limits<unsigned short>::max())),
+    nEndMax(std::min<long>(endMax, std::numeric_limits<unsigned short>::max()))
 {}
 
 bool SvxColumnDescription::operator==(const SvxColumnDescription& rCmp) const


More information about the Libreoffice-commits mailing list