sc/qa/unit/data/ods/tdf62268.ods |binary sc/qa/unit/subsequent_filters-test.cxx | 25 +++++++++++++++++++++---- sc/source/filter/xml/xmlimprt.cxx | 12 ++++++++++++ vcl/unx/kde5/KDE5SalGraphics.cxx | 28 ++++++++++++++-------------- 4 files changed, 47 insertions(+), 18 deletions(-)
New commits: commit d7f60e4f888ddd1cbad9291b58177755c1df607b Author: Katarina Behrens <katarina.behr...@cib.de> Date: Wed Apr 25 15:42:59 2018 +0200 Render tooltips natively with this, all widgets that used to be rendered natively with kde4 are rendered natively also in kde5 Change-Id: If814b121e928a9d743c74836f000b3230b946caf diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 931b6a2d23b8..1685a772a88b 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -83,7 +83,7 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa case ControlType::Pushbutton: case ControlType::Radiobutton: case ControlType::Checkbox: - /*case ControlType::Tooltip:*/ + case ControlType::Tooltip: case ControlType::Progress: case ControlType::ListNode: return (part == ControlPart::Entire); @@ -528,12 +528,12 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CE_RadioButton, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } - /*else if (type == ControlType::Tooltip) + else if (type == ControlType::Tooltip) { QStyleOption option; draw( QStyle::PE_PanelTipLabel, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); - }*/ + } else if (type == ControlType::Frame) { lcl_drawFrame( QStyle::PE_Frame, m_image.get(), commit 6a0e5d1f14c2e06812fe54d3e27fe593fd913387 Author: Katarina Behrens <katarina.behr...@cib.de> Date: Wed Apr 25 15:19:28 2018 +0200 Render scrollbars natively Change-Id: I7f7e5bb8cf6e7307b0563a9ef84845a99dc54e1e diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 4c5a70a89a77..931b6a2d23b8 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -95,7 +95,7 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa case ControlType::Combobox: case ControlType::Toolbar: case ControlType::Frame: - /*case ControlType::Scrollbar:*/ + case ControlType::Scrollbar: case ControlType::WindowBackground: case ControlType::Fixedline: return true; @@ -457,7 +457,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, vclStateValue2StateFlag(nControlState, value) ); //m_image->save("/tmp/checkbox.png"); } - /*else if (type == ControlType::Scrollbar) + else if (type == ControlType::Scrollbar) { if ((part == ControlPart::DrawBackgroundVert) || (part == ControlPart::DrawBackgroundHorz)) { @@ -495,7 +495,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, { returnVal = false; } - }*/ + } else if (type == ControlType::Spinbox) { QStyleOptionSpinBox option; @@ -857,7 +857,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } break; } - /*case ControlType::Scrollbar: + case ControlType::Scrollbar: { // core can't handle 3-button scrollbars well, so we fix that in hitTestNativeControl(), // for the rest also provide the track area (i.e. area not taken by buttons) @@ -889,7 +889,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part retVal = true; } break; - }*/ + } default: break; } @@ -910,7 +910,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } /** Test whether the position is in the native widget. - If the return value is TRUE, bIsInside contains information whether + If the return value is true, bIsInside contains information whether aPos was or was not inside the native widget specified by the nType/nPart combination. */ @@ -918,15 +918,15 @@ bool KDE5SalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart const tools::Rectangle& rControlRegion, const Point& rPos, bool& rIsInside ) { - /*if ( nType == ControlType::Scrollbar ) + if ( nType == ControlType::Scrollbar ) { if( nPart != ControlPart::ButtonUp && nPart != ControlPart::ButtonDown && nPart != ControlPart::ButtonLeft && nPart != ControlPart::ButtonRight ) { // we adjust only for buttons (because some scrollbars have 3 buttons, // and LO core doesn't handle such scrollbars well) - return FALSE; + return false; } - rIsInside = FALSE; + rIsInside = false; bool bHorizontal = ( nPart == ControlPart::ButtonLeft || nPart == ControlPart::ButtonRight ); QRect rect = toQRect( rControlRegion ); QPoint pos( rPos.X(), rPos.Y()); @@ -952,8 +952,8 @@ bool KDE5SalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart rIsInside = ( control == QStyle::SC_ScrollBarSubLine ); else // DOWN, RIGHT rIsInside = ( control == QStyle::SC_ScrollBarAddLine ); - return TRUE; - }*/ + return true; + } return false; } commit 43010156f6a8327286c14556a0b3db5e8e17a43c Author: Vasily Melenchuk <vasily.melenc...@cib.de> Date: Fri Apr 6 20:19:10 2018 +0300 tdf#62268: allow row height recalculation on document load During load of document rows with style:use-optimal-row-height="true" should recalculate height. Partial revert of cd2f8a1cabbfb924c62d7af2aac3ac09288c2d4c Change-Id: Ib38b5b753d9ff8352116d77851d228c5d77bd530 diff --git a/sc/qa/unit/data/ods/tdf62268.ods b/sc/qa/unit/data/ods/tdf62268.ods new file mode 100644 index 000000000000..da88adfd25cd Binary files /dev/null and b/sc/qa/unit/data/ods/tdf62268.ods differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 3ec2982ada04..b3da5defa5e3 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -245,6 +245,7 @@ public: void testBorderColorsXLSXML(); void testHiddenRowsColumnsXLSXML(); void testColumnWidthRowHeightXLSXML(); + void testTdf62268(); CPPUNIT_TEST_SUITE(ScFiltersTest); CPPUNIT_TEST(testBooleanFormatXLSX); @@ -376,6 +377,7 @@ public: CPPUNIT_TEST(testHiddenRowsColumnsXLSXML); CPPUNIT_TEST(testColumnWidthRowHeightXLSXML); CPPUNIT_TEST(testCondFormatFormulaListenerXLSX); + CPPUNIT_TEST(testTdf62268); CPPUNIT_TEST_SUITE_END(); @@ -2652,8 +2654,8 @@ void ScFiltersTest::testMiscRowHeights() TestParam::RowData MultiLineOptData[] = { - // Row 0 is 12.63 mm and optimal flag is set - { 0, 0, 0, 1263, CHECK_OPTIMAL, true }, + // Row 0 is 12.63 mm, but optimal flag is set + { 0, 0, 0, 1236, CHECK_OPTIMAL, true }, // Row 1 is 11.99 mm and optimal flag is NOT set { 1, 1, 0, 1199, CHECK_OPTIMAL, false }, }; @@ -2685,8 +2687,8 @@ void ScFiltersTest::testOptimalHeightReset() ScDocument& rDoc = xDocSh->GetDocument(); // open document in read/write mode ( otherwise optimal height stuff won't // be triggered ) *and* you can't delete cell contents. - int nHeight = sc::TwipsToHMM ( rDoc.GetRowHeight(nRow, nTab, false) ); - CPPUNIT_ASSERT_EQUAL(1263, nHeight); + int nHeight = rDoc.GetRowHeight(nRow, nTab, false); + CPPUNIT_ASSERT_EQUAL(701, nHeight); ScDocFunc &rFunc = xDocSh->GetDocFunc(); @@ -4059,6 +4061,21 @@ void ScFiltersTest::testCondFormatFormulaListenerXLSX() xDocSh->DoClose(); } +void ScFiltersTest::testTdf62268() +{ + ScDocShellRef xDocSh = loadDoc("tdf62268.", FORMAT_ODS); + ScDocument& rDoc = xDocSh->GetDocument(); + int nHeight; + + SCTAB nTab = 0; + nHeight = rDoc.GetRowHeight(0, nTab, false); + CPPUNIT_ASSERT_EQUAL(256, nHeight); + nHeight = rDoc.GetRowHeight(1, nTab, false); + CPPUNIT_ASSERT_EQUAL(1905, nHeight); + + xDocSh->DoClose(); +} + ScFiltersTest::ScFiltersTest() : ScBootstrapFixture( "sc/qa/unit/data" ) { diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 4e2c3bb56531..32833b4306aa 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -1861,6 +1861,18 @@ void SAL_CALL ScXMLImport::endDocument() pDoc->SetStreamValid( nTab, true ); } } + + if (pDoc->IsAdjustHeightLocked()) + { + pDoc->UnlockAdjustHeight(); + ScModelObj::getImplementation(GetModel())->UpdateAllRowHeights(); + pDoc->LockAdjustHeight(); + } + else + { + ScModelObj::getImplementation(GetModel())->UpdateAllRowHeights(); + } + aTables.FixupOLEs(); } if (GetModel().is()) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits