summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/outdev.hxx6
-rw-r--r--sc/source/ui/view/output2.cxx2
-rw-r--r--sw/qa/uitest/data/date_picker.docxbin0 -> 5936 bytes
-rw-r--r--sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py15
-rw-r--r--toolkit/source/awt/vclxgraphics.cxx2
-rw-r--r--vcl/inc/calendar.hxx2
-rw-r--r--vcl/source/control/calendar.cxx7
7 files changed, 26 insertions, 8 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index b1b47d60c1a0..14c1675e7eed 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1038,9 +1038,9 @@ public:
void DrawTextArray( const Point& rStartPt, const OUString& rStr,
o3tl::span<const sal_Int32> pDXAry,
- o3tl::span<const sal_Bool> pKashidaAry={},
- sal_Int32 nIndex = 0,
- sal_Int32 nLen = -1,
+ o3tl::span<const sal_Bool> pKashidaAry,
+ sal_Int32 nIndex,
+ sal_Int32 nLen,
SalLayoutFlags flags = SalLayoutFlags::NONE,
const SalLayoutGlyphs* pLayoutCache = nullptr);
tools::Long GetTextArray( const OUString& rStr, std::vector<sal_Int32>* pDXAry,
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 07f9f750ffe0..28d448fc69b9 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2111,7 +2111,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
}
if (bPaint)
- mpDev->DrawTextArray(aDrawTextPos, aShort, aDX);
+ mpDev->DrawTextArray(aDrawTextPos, aShort, aDX, {}, 0, nLen);
}
else
{
diff --git a/sw/qa/uitest/data/date_picker.docx b/sw/qa/uitest/data/date_picker.docx
new file mode 100644
index 000000000000..3100c8db6920
--- /dev/null
+++ b/sw/qa/uitest/data/date_picker.docx
Binary files differ
diff --git a/sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py b/sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py
index 7eaa7b255247..eb43912782bc 100644
--- a/sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py
+++ b/sw/qa/uitest/writer_tests5/DateFormFieldPropertiesDialog.py
@@ -8,6 +8,7 @@
#
from uitest.framework import UITestCase
from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+from libreoffice.uno.propertyvalue import mkPropertyValues
class dateFormFieldDialog(UITestCase):
@@ -125,4 +126,18 @@ class dateFormFieldDialog(UITestCase):
# a placeholder text is not changed by format change
self.assertEqual(writer_doc.getText().getString(), "Jul 17, 2019")
+ def test_date_picker_drop_down(self):
+ with self.ui_test.load_file(get_url_for_data_file("date_picker.docx")) as writer_doc:
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+
+ # open the dialog (cursor is at the field)
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ESC"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ self.assertEqual(writer_doc.getText().getString(), "\nClick to choose a date")
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx
index a8409a5cf7da..673c44eb09f2 100644
--- a/toolkit/source/awt/vclxgraphics.cxx
+++ b/toolkit/source/awt/vclxgraphics.cxx
@@ -468,7 +468,7 @@ void VCLXGraphics::drawTextArray( sal_Int32 x, sal_Int32 y, const OUString& rTex
{
aDXA[i] = rLongs[i];
}
- mpOutputDevice->DrawTextArray( Point( x, y ), rText, aDXA );
+ mpOutputDevice->DrawTextArray( Point( x, y ), rText, aDXA , {}, 0, rText.getLength());
}
}
diff --git a/vcl/inc/calendar.hxx b/vcl/inc/calendar.hxx
index 500b97f47cd1..a40f1ffdf323 100644
--- a/vcl/inc/calendar.hxx
+++ b/vcl/inc/calendar.hxx
@@ -126,7 +126,7 @@ class Calendar final : public Control
tools::Rectangle maPrevRect;
tools::Rectangle maNextRect;
OUString maDayOfWeekText;
- sal_Int32 mnDayOfWeekAry[7];
+ sal_Int32 mnDayOfWeekAry[8];
Date maOldFormatFirstDate;
Date maOldFormatLastDate;
Date maFirstDate;
diff --git a/vcl/source/control/calendar.cxx b/vcl/source/control/calendar.cxx
index 0227db0c3e79..3995aa142bae 100644
--- a/vcl/source/control/calendar.cxx
+++ b/vcl/source/control/calendar.cxx
@@ -260,6 +260,9 @@ void Calendar::ImplFormat()
nDay %= 7;
}
+ // header position for the last day of week
+ mnDayOfWeekAry[7] = mnMonthWidth;
+
mbCalc = false;
}
@@ -705,9 +708,9 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext)
Point aStartPos(nDayX, nDeltaY);
rRenderContext.DrawLine(aStartPos, Point(nDayX + (7 * mnDayWidth), nDeltaY));
std::vector<sal_Int32> aTmp;
- for (int k=0; k<6; ++k)
+ for (int k=0; k<7; ++k)
aTmp.push_back(mnDayOfWeekAry[k+1]);
- rRenderContext.DrawTextArray(Point(nDayX + mnDayOfWeekAry[0], nDayY), maDayOfWeekText, aTmp);
+ rRenderContext.DrawTextArray(Point(nDayX + mnDayOfWeekAry[0], nDayY), maDayOfWeekText, aTmp, {}, 0, aTmp.size());
// display days
sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth();