[Libreoffice-commits] core.git: 2 commits - sw/source vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Mar 10 10:15:33 UTC 2019


 sw/source/core/crsr/DropDownFormFieldButton.cxx |    5 +++--
 sw/source/ui/fldui/DropDownFormFieldDialog.cxx  |    3 ++-
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx     |    6 +++---
 3 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit a66e0f83cb488e024319f67add61b08528a39596
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Mar 9 14:57:28 2019 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sun Mar 10 11:15:18 2019 +0100

    widget theme: adjust draw positions of editbox, combobox, listbox
    
    Change-Id: Id14b5530c994e10bb9f45f036b43025c73c7ac83
    Reviewed-on: https://gerrit.libreoffice.org/68977
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index 17b7c2c833db..4fb2fd315f8d 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -734,6 +734,7 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
                        std::max(rBoundingControlRegion.GetHeight(), 32L));
             rNativeContentRegion = tools::Rectangle(aLocation, aSize);
             rNativeBoundingRegion = rNativeContentRegion;
+            rNativeBoundingRegion.expand(2);
             return true;
         }
         break;
@@ -764,7 +765,7 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
             {
                 Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
                                  - aComboButtonSize.Width(),
-                             aLocation.Y());
+                             aLocation.Y() + 1);
                 rNativeContentRegion = tools::Rectangle(aPoint, aComboButtonSize);
                 rNativeBoundingRegion = rNativeContentRegion;
                 return true;
@@ -773,8 +774,7 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
             {
                 Size aSize(rBoundingControlRegion.GetWidth() - aComboButtonSize.Width(),
                            aComboButtonSize.Height());
-                rNativeContentRegion = tools::Rectangle(aLocation, aSize);
-                rNativeContentRegion.expand(1);
+                rNativeContentRegion = tools::Rectangle(aLocation + Point(1, 1), aSize);
                 rNativeBoundingRegion = rNativeContentRegion;
                 return true;
             }
commit aa3b3ee8c2aad6af69f0710c7531ef2cf9fb1fc1
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sun Mar 10 09:45:56 2019 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Sun Mar 10 11:15:12 2019 +0100

    MSForms: Fix handling of drop-down form field after DOC import
    
    In the properties dialog, code expected that the ODF_FORMDROPDOWN_RESULT
    is not set in case of an empty list. This caused a crash.
    The field popup window code expected that the list is not specified
    when it is empty, but DOC import code sets ODF_FORMDROPDOWN_LISTENTRY
    even if the list is empty.
    
    Change-Id: If4c86fc5a08cdc578150afaa42ad7e86bdba9150
    Reviewed-on: https://gerrit.libreoffice.org/68963
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/sw/source/core/crsr/DropDownFormFieldButton.cxx b/sw/source/core/crsr/DropDownFormFieldButton.cxx
index a4614da8932e..bef4c873dace 100644
--- a/sw/source/core/crsr/DropDownFormFieldButton.cxx
+++ b/sw/source/core/crsr/DropDownFormFieldButton.cxx
@@ -53,14 +53,15 @@ SwFieldDialog::SwFieldDialog(SwEditWin* parent, sw::mark::IFieldmark* fieldBM, l
         OUString sListKey = ODF_FORMDROPDOWN_LISTENTRY;
         sw::mark::IFieldmark::parameter_map_t::const_iterator pListEntries
             = pParameters->find(sListKey);
+        css::uno::Sequence<OUString> vListEntries;
         if (pListEntries != pParameters->end())
         {
-            css::uno::Sequence<OUString> vListEntries;
             pListEntries->second >>= vListEntries;
             for (OUString const& i : vListEntries)
                 aListBox->InsertEntry(i);
         }
-        else
+
+        if (vListEntries.getLength() == 0)
         {
             aListBox->InsertEntry(SwResId(STR_DROP_DOWN_EMPTY_LIST));
         }
diff --git a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
index e52907fd6c74..dd187704aa7a 100644
--- a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
+++ b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
@@ -119,7 +119,8 @@ void DropDownFormFieldDialog::InitControls()
             {
                 sal_Int32 nSelection = -1;
                 pResult->second >>= nSelection;
-                m_xListItemsTreeView->select_text(vListEntries[nSelection]);
+                if (vListEntries.getLength() > nSelection)
+                    m_xListItemsTreeView->select_text(vListEntries[nSelection]);
             }
         }
     }


More information about the Libreoffice-commits mailing list