diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-04-01 20:12:09 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-04-02 05:48:41 +0200 |
commit | 4bdbf0f898e8642b0a34195537d1516cc8eee819 (patch) | |
tree | c3227c1785873f4579f73c89f0e9f74e7b7a0292 /sd | |
parent | 6027c219444ade7274841a5ba45e62bdc1ea3238 (diff) |
editeng: combine scaling parameters into ScalingParameters struct
This makes dealing with scaling parameters much clearer and it
improves readability.
Change-Id: I327b6530ef5587972cc0075390704754a33563a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165632
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/TextFittingTest.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/dlg/NotesChildWindow.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drtxtob.cxx | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/sd/qa/unit/TextFittingTest.cxx b/sd/qa/unit/TextFittingTest.cxx index 998a33dba8c9..5a9c37730e69 100644 --- a/sd/qa/unit/TextFittingTest.cxx +++ b/sd/qa/unit/TextFittingTest.cxx @@ -73,16 +73,16 @@ CPPUNIT_TEST_FIXTURE(TextFittingTest, testTest) Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT_EQUAL(sal_Int32(4), rEditEngine.GetParagraphCount()); - CPPUNIT_ASSERT_DOUBLES_EQUAL(87.49, rEditEngine.getGlobalFontScale().getY(), 1E-2); - CPPUNIT_ASSERT_DOUBLES_EQUAL(90.0, rEditEngine.getGlobalSpacingScale().getY(), 1E-2); + CPPUNIT_ASSERT_DOUBLES_EQUAL(87.49, rEditEngine.getScalingParameters().fFontY, 1E-2); + CPPUNIT_ASSERT_DOUBLES_EQUAL(90.0, rEditEngine.getScalingParameters().fSpacingY, 1E-2); // Add paragraph 5 rEditView.SetSelection(ESelection(4, 0, 4, 0)); rEditView.InsertText(u"\nD5"_ustr); CPPUNIT_ASSERT_EQUAL(sal_Int32(5), rEditEngine.GetParagraphCount()); - CPPUNIT_ASSERT_DOUBLES_EQUAL(54.68, rEditEngine.getGlobalFontScale().getY(), 1E-2); - CPPUNIT_ASSERT_DOUBLES_EQUAL(100.0, rEditEngine.getGlobalSpacingScale().getY(), 1E-2); + CPPUNIT_ASSERT_DOUBLES_EQUAL(54.68, rEditEngine.getScalingParameters().fFontY, 1E-2); + CPPUNIT_ASSERT_DOUBLES_EQUAL(100.0, rEditEngine.getScalingParameters().fSpacingY, 1E-2); // Add paragraph 6 rEditView.SetSelection(ESelection(5, 0, 5, 0)); @@ -105,8 +105,8 @@ CPPUNIT_TEST_FIXTURE(TextFittingTest, testTest) CPPUNIT_ASSERT_EQUAL(sal_Int32(3), rEditEngine.GetParagraphCount()); // not ideal - scaling should be 100%, but close enough - CPPUNIT_ASSERT_DOUBLES_EQUAL(99.05, rEditEngine.getGlobalFontScale().getY(), 1E-2); - CPPUNIT_ASSERT_DOUBLES_EQUAL(100.0, rEditEngine.getGlobalSpacingScale().getY(), 1E-2); + CPPUNIT_ASSERT_DOUBLES_EQUAL(99.05, rEditEngine.getScalingParameters().fFontY, 1E-2); + CPPUNIT_ASSERT_DOUBLES_EQUAL(100.0, rEditEngine.getScalingParameters().fSpacingY, 1E-2); // are we still in text edit mode? CPPUNIT_ASSERT_EQUAL(true, pView1->IsTextEdit()); diff --git a/sd/source/ui/dlg/NotesChildWindow.cxx b/sd/source/ui/dlg/NotesChildWindow.cxx index 9b037757a2dd..79c0bdaaa95b 100644 --- a/sd/source/ui/dlg/NotesChildWindow.cxx +++ b/sd/source/ui/dlg/NotesChildWindow.cxx @@ -180,7 +180,7 @@ void NotesEditWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea) // For setGlobalScale to work correctly EEControlBits::STRETCHING must be set. mrParentWindow.GetOutliner()->SetControlWord(mrParentWindow.GetOutliner()->GetControlWord() | EEControlBits::STRETCHING); - mrParentWindow.GetOutliner()->setGlobalScale(30.0, 30.0); + mrParentWindow.GetOutliner()->setScalingParameters({ 30.0, 30.0 }); provideNoteText(); diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index 01a1e94d74bf..3b15ceaef650 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -188,7 +188,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) pOLV = pOView->GetViewByWindow(mpViewShell->GetActiveWindow()); if (pOutliner) - pOutliner->getGlobalScale(o3tl::temporary(double()), stretchY, o3tl::temporary(double()), o3tl::temporary(double())); + stretchY = pOutliner->getScalingParameters().fFontY; if(pOLV && !pOLV->GetSelection().HasRange()) { |