[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source
sc/source/ui/inc/viewdata.hxx |6 ++ sc/source/ui/view/viewdata.cxx | 89 +++-- 2 files changed, 74 insertions(+), 21 deletions(-) New commits: commit 0722934920d7b743d82e55c793d4abbf6c9bc11d Author: Dennis Francis AuthorDate: Sat May 23 12:22:56 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 19:19:52 2020 +0200 Allow cell coordinates calculation in print twips too Change-Id: Ie8f23bd7ba8de57d7aab104add99501a54f08819 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97961 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index e5833dec5d32..45aacdee6bd1 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -503,6 +503,7 @@ public: // TRUE: Cell is merged boolGetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, long& rSizeYPix ) const; +boolGetMergeSizePrintTwips( SCCOL nX, SCROW nY, long& rSizeXTwips, long& rSizeYTwips ) const; voidGetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWhich, SCCOL& rPosX, SCROW& rPosY, bool bTestMerge = true, bool bRepair = false ); @@ -603,10 +604,13 @@ public: bool bAllowNeg = false ) const; Point GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScHSplitPos eWhich ) const; Point GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScVSplitPos eWhich ) const; +/// returns the position (top-left corner) of the requested cell in print twips coordinates. +Point GetPrintTwipsPos( SCCOL nCol, SCROW nRow ) const; /// return json for our cursor position. OString describeCellCursor() const { return describeCellCursorAt(GetCurX(), GetCurY()); } -OString describeCellCursorAt( SCCOL nCol, SCROW nRow ) const; +OString describeCellCursorInPrintTwips() const { return describeCellCursorAt(GetCurX(), GetCurY(), false); } +OString describeCellCursorAt( SCCOL nCol, SCROW nRow, bool bPixelAligned = true ) const; SCCOL CellsAtX( SCCOL nPosX, SCCOL nDir, ScHSplitPos eWhichX, sal_uInt16 nScrSizeY = SC_SIZE_NONE ) const; SCROW CellsAtY( SCROW nPosY, SCROW nDir, ScVSplitPos eWhichY, sal_uInt16 nScrSizeX = SC_SIZE_NONE ) const; diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 6849c11e314a..5b5b4baf3b83 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -2208,33 +2208,66 @@ Point ScViewData::GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich, return Point( nScrPosX, nScrPosY ); } -OString ScViewData::describeCellCursorAt(SCCOL nX, SCROW nY) const +Point ScViewData::GetPrintTwipsPos(SCCOL nCol, SCROW nRow) const { -Point aScrPos = GetScrPos( nX, nY, SC_SPLIT_BOTTOMRIGHT, true ); +// hidden ones are given 0 sizes by these by default. +// TODO: rewrite this to loop over spans (matters for jumbosheets). +long nPosX = nCol ? pDoc->GetColWidth(0, nCol - 1, nTabNo) : 0; +// This is now fast as it loops over spans. +long nPosY = nRow ? pDoc->GetRowHeight(0, nRow - 1, nTabNo) : 0; +// TODO: adjust for RTL layout case. -long nSizeXPix; -long nSizeYPix; -GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix ); +return Point(nPosX, nPosY); +} + +OString ScViewData::describeCellCursorAt(SCCOL nX, SCROW nY, bool bPixelAligned) const +{ +const bool bPosSizeInPixels = bPixelAligned; +Point aCellPos = bPosSizeInPixels ? GetScrPos( nX, nY, SC_SPLIT_BOTTOMRIGHT, true ) : +GetPrintTwipsPos(nX, nY); + +long nSizeX; +long nSizeY; +if (bPosSizeInPixels) +GetMergeSizePixel( nX, nY, nSizeX, nSizeY ); +else +GetMergeSizePrintTwips(nX, nY, nSizeX, nSizeY); -double fPPTX = GetPPTX(); -double fPPTY = GetPPTY(); +std::stringstream ss; +if (bPosSizeInPixels) +{ +double fPPTX = GetPPTX(); +double fPPTY = GetPPTY(); -// make it a slim cell cursor, but not empty -if (nSizeXPix == 0) -nSizeXPix = 1; +// make it a slim cell cursor, but not empty +if (nSizeX == 0) +nSizeX = 1; -if (nSizeYPix == 0) -nSizeYPix = 1; +if (nSizeY == 0) +nSizeY = 1; -long nPosXTw = rtl::math::round(aScrPos.getX() / fPPTX); -long nPosYTw = rtl::math::round(aScrPos.getY() / fPPTY); -// look at Rectangle( const Point& rLT, const Size& rSize ) for the '- 1' -long nSizeXTw = rtl::math::round(nSizeXPix / fPPTX) - 1; -long nSizeYTw = rtl::math::round(nSizeYPix / fPPTY) - 1; +long nPosXTw = rtl::math::round(aCellPos.getX() / fPPTX); +long nPosYTw = rtl::math::round(aCel
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.ColumnHeader.js |7 ++ loleaflet/src/control/Control.RowHeader.js|7 ++ loleaflet/src/layer/tile/CalcTileLayer.js | 30 +++--- 3 files changed, 36 insertions(+), 8 deletions(-) New commits: commit 3f97c85218705f29206a0c22eea6419c5698066a Author: Dennis Francis AuthorDate: Sun May 10 01:57:01 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 18:06:03 2020 +0200 Do not rely on js ordering of multi event execution On getting a .uno:ViewRowColumnHeaders message, the order of header painting should be the headers elements first, then the cursor indication on the header, then the selection area indication on the header if any. More importantly none of these painting will be correct if the data in the tickMap member of both headers is stale. As of now all three of these are executed by three different events. Lets avoid depending on the implicit ordering of execution of these and do these synchronously as part of the main event ('viewrowcolumnheaders') handler. Change-Id: I4da29ba893c408af45159073e4389481b2eaecc7 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97937 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js index 8c049fd93..f9d3feedb 100644 --- a/loleaflet/src/control/Control.ColumnHeader.js +++ b/loleaflet/src/control/Control.ColumnHeader.js @@ -378,6 +378,13 @@ L.Control.ColumnHeader = L.Control.Header.extend({ viewRowColumnHeaders: function (e) { if (e.data.columns && e.data.columns.length > 0) { this.fillColumns(e.data.columns, e.data.columnGroups, e.converter, e.context); + this._onUpdateCurrentColumn(e.cursor); + if (e.selection && e.selection.hasSelection) { + this._onUpdateSelection(e.selection); + } + else { + this._onClearSelection(); + } } }, diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js index d1f475723..0bf1fcb38 100644 --- a/loleaflet/src/control/Control.RowHeader.js +++ b/loleaflet/src/control/Control.RowHeader.js @@ -367,6 +367,13 @@ L.Control.RowHeader = L.Control.Header.extend({ viewRowColumnHeaders: function (e) { if (e.data.rows && e.data.rows.length) { this.fillRows(e.data.rows, e.data.rowGroups, e.converter, e.context); + this._onUpdateCurrentRow(e.cursor); + if (e.selection && e.selection.hasSelection) { + this._onUpdateSelection(e.selection); + } + else { + this._onClearSelection(); + } } }, diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index 1e82f2598..684d559c1 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -373,6 +373,10 @@ L.CalcTileLayer = L.TileLayer.extend({ }, _onUpdateCurrentHeader: function() { + this._map.fire('updatecurrentheader', this._getCursorPosSize()); + }, + + _getCursorPosSize: function () { var x = -1, y = -1; if (this._cellCursorXY) { x = this._cellCursorXY.x + 1; @@ -382,20 +386,30 @@ L.CalcTileLayer = L.TileLayer.extend({ if (this._cellCursor && !this._isEmptyRectangle(this._cellCursor)) { size = this._cellCursorTwips.getSize(); } - this._map.fire('updatecurrentheader', {curX: x, curY: y, width: size.x, height: size.y}); + + return { curX: x, curY: y, width: size.x, height: size.y }; }, _onUpdateSelectionHeader: function () { + var selectionHeaderData = this._getSelectionHeaderData(); + if (selectionHeaderData.hasSelection) { + this._map.fire('updateselectionheader', selectionHeaderData); + return; + } + + this._map.fire('clearselectionheader'); + }, + + _getSelectionHeaderData: function() { var layers = this._selections.getLayers(); var layer = layers.pop(); if (layers.length === 0 && layer && layer.getLatLngs().length === 1) { var start = this._latLngToTwips(layer.getBounds().getNorthWest()).add([1, 1]); var end = this._lat
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/tabview.cxx | 81 +- 1 file changed, 2 insertions(+), 79 deletions(-) New commits: commit e6eeecbe72a1d0e305369b103f05da887ca99016 Author: Dennis Francis AuthorDate: Sat May 23 11:00:19 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 16:37:14 2020 +0200 use lcl_ExtendTiledDimension() in getRowColumnHeaders() to avoid code repetitions. Change-Id: If83b42175fb53132174fa33d169806e17a4a5cbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96973 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit 3c6c039685870ed23d2f25cbfd984d3b54c4b60d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97959 Tested-by: Jenkins diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 86b1f4e0e46c..f7557ec08c70 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2669,45 +2669,7 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J /// 2) if we are approaching current max tiled row, signal a size changed event ///and invalidate the involved area - -if (nEndRow > aViewData.GetMaxTiledRow() - nVisibleRows) -{ -ScDocShell* pDocSh = aViewData.GetDocShell(); -ScModelObj* pModelObj = pDocSh ? comphelper::getUnoTunnelImplementation( pDocSh->GetModel() ) : nullptr; -Size aOldSize(0, 0); -if (pModelObj) -aOldSize = pModelObj->getDocumentSize(); - -aViewData.SetMaxTiledRow(std::min(std::max(nEndRow, aViewData.GetMaxTiledRow()) + nVisibleRows, long(MAXTILEDROW))); - -Size aNewSize(0, 0); -if (pModelObj) -aNewSize = pModelObj->getDocumentSize(); - -SAL_INFO("sc.lok.header", "Row Header: a new height: " << aNewSize.Height()); -if (pDocSh) -{ -// New area extended to the bottom of the sheet after last row -// excluding overlapping area with aNewColArea -tools::Rectangle aNewRowArea(0, aOldSize.getHeight(), aOldSize.getWidth(), aNewSize.getHeight()); - -// Only invalidate if spreadsheet extended to the bottom -if (aNewRowArea.getHeight()) -{ -UpdateSelectionOverlay(); -SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), aNewRowArea.toString()); -} - -// Provide size in the payload, so clients don't have to -// call lok::Document::getDocumentSize(). -std::stringstream ss; -ss << aNewSize.Width() << ", " << aNewSize.Height(); -OString sSize = ss.str().c_str(); -ScModelObj* pModel = comphelper::getUnoTunnelImplementation(aViewData.GetViewShell()->GetCurrentDocument()); -SfxLokHelper::notifyDocumentSizeChanged(aViewData.GetViewShell(), sSize, pModel, false); -} -} - +lcl_ExtendTiledDimension(/* bColumn */ false, nEndRow, nVisibleRows, *this, aViewData); /// 3) create string data for rows @@ -2802,46 +2764,7 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J /// 2) if we are approaching current max tiled column, signal a size changed event ///and invalidate the involved area - -if (nEndCol > aViewData.GetMaxTiledCol() - nVisibleCols) -{ -ScDocShell* pDocSh = aViewData.GetDocShell(); -ScModelObj* pModelObj = pDocSh ? comphelper::getUnoTunnelImplementation( pDocSh->GetModel() ) : nullptr; -Size aOldSize(0, 0); -if (pModelObj) -aOldSize = pModelObj->getDocumentSize(); - -aViewData.SetMaxTiledCol(std::min(std::max(nEndCol, aViewData.GetMaxTiledCol()) + nVisibleCols, long(pDoc->MaxCol(; - -Size aNewSize(0, 0); -if (pModelObj) -aNewSize = pModelObj->getDocumentSize(); - -if (pDocSh) -{ -// New area extended to the right of the sheet after last column -// including overlapping area with aNewRowArea -tools::Rectangle aNewColArea(aOldSize.getWidth(), 0, aNewSize.getWidth(), aNewSize.getHeight()); - -// Only invalidate if spreadsheet extended to the bottom -if (aNewColArea.getWidth()) -{ -UpdateSelectionOverlay(); -SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), aNewColArea.toString()); -} - -if (aOldSize != aNewSize) -{ -// Provide size in the payload, so clients don't have to -// call lok::Document::getDocumentSize(). -std::stringstream ss; -ss << aNewSize.Width() << ", " << aNewSize.Height(); -OString sSize = ss.str().c_str(); -
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/tabview.cxx | 32 ++-- 1 file changed, 10 insertions(+), 22 deletions(-) New commits: commit adf1182bbd865206d412274027c942071e760127 Author: Dennis Francis AuthorDate: Sat May 23 10:47:10 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 15:32:52 2020 +0200 use helper-class ScRangeProvider in getRowColumnHeader() and avoid some code repetitions. Change-Id: I3e006bc8d9880f3e1ec892aa8f2423edbf9bbf14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96972 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit c888a2d7dc3fd770a8e95d0bd23e84f307f1355c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97958 Tested-by: Jenkins diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 495848f46e50..86b1f4e0e46c 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2621,6 +2621,10 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J mnLOKStartHeaderCol + 1, mnLOKStartHeaderRow + 1, mnLOKEndHeaderCol, mnLOKEndHeaderRow); +ScRangeProvider aRangeProvider(rRectangle, /* bInPixels */ false, aViewData, + /* nEnlargeX */ 2, /* nEnlargeY */ 2); +const ScRange& rCellRange = aRangeProvider.getCellRange(); + /// *** start collecting ROWS *** /// 1) compute start and end rows @@ -2629,17 +2633,9 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J { SAL_INFO("sc.lok.header", "Row Header: compute start/end rows."); long nEndHeightPx = 0; -long nRectTopPx = rRectangle.Top() * aViewData.GetPPTX(); -long nRectBottomPx = rRectangle.Bottom() * aViewData.GetPPTY(); - -const auto& rTopNearest = aViewData.GetLOKHeightHelper().getNearestByPosition(nRectTopPx); -const auto& rBottomNearest = aViewData.GetLOKHeightHelper().getNearestByPosition(nRectBottomPx); - -ScBoundsProvider aBoundingRowsProvider(aViewData, nTab, /*bColumnHeader: */ false); -aBoundingRowsProvider.Compute(rTopNearest, rBottomNearest, nRectTopPx, nRectBottomPx); -aBoundingRowsProvider.EnlargeBy(2); -aBoundingRowsProvider.GetStartIndexAndPosition(nStartRow, nStartHeightPx); -aBoundingRowsProvider.GetEndIndexAndPosition(nEndRow, nEndHeightPx); +nStartRow = rCellRange.aStart.Row(); +nEndRow = rCellRange.aEnd.Row(); +aRangeProvider.getRowPositions(nStartHeightPx, nEndHeightPx); aViewData.GetLOKHeightHelper().removeByIndex(mnLOKStartHeaderRow); aViewData.GetLOKHeightHelper().removeByIndex(mnLOKEndHeaderRow); @@ -2773,17 +2769,9 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J { SAL_INFO("sc.lok.header", "Column Header: compute start/end columns."); long nEndWidthPx = 0; -long nRectLeftPx = rRectangle.Left() * aViewData.GetPPTX(); -long nRectRightPx = rRectangle.Right() * aViewData.GetPPTY(); - -const auto& rLeftNearest = aViewData.GetLOKWidthHelper().getNearestByPosition(nRectLeftPx); -const auto& rRightNearest = aViewData.GetLOKWidthHelper().getNearestByPosition(nRectRightPx); - -ScBoundsProvider aBoundingColsProvider(aViewData, nTab, /*bColumnHeader: */ true); -aBoundingColsProvider.Compute(rLeftNearest, rRightNearest, nRectLeftPx, nRectRightPx); -aBoundingColsProvider.EnlargeBy(2); -aBoundingColsProvider.GetStartIndexAndPosition(nStartCol, nStartWidthPx); -aBoundingColsProvider.GetEndIndexAndPosition(nEndCol, nEndWidthPx); +nStartCol = rCellRange.aStart.Col(); +nEndCol = rCellRange.aEnd.Col(); +aRangeProvider.getColPositions(nStartWidthPx, nEndWidthPx); aViewData.GetLOKWidthHelper().removeByIndex(mnLOKStartHeaderCol); aViewData.GetLOKWidthHelper().removeByIndex(mnLOKEndHeaderCol); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/ui/inc/tabview.hxx |1 sc/source/ui/unoobj/docuno.cxx |9 + sc/source/ui/view/tabview.cxx | 260 + 3 files changed, 270 insertions(+) New commits: commit 954ec00ccd500ac7dc153032cb5dff7e7ba008b2 Author: Dennis Francis AuthorDate: Tue May 19 10:41:53 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 15:29:47 2020 +0200 lokit: scPrintTwipsMsgs: Extend the tiled-area limits... if the client visible area is "close" to these limits. Also send tile-invalidations for the new area uncovered. ** All this is done only if the flag scPrintTwipsMsgs is set. Change-Id: I3d6b8c6aaae1eb934030c5bdbc1094dc8be16a9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96971 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit d64a5efdb8a2db38a5339ae04eb13807ba944ea0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97957 Tested-by: Jenkins diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index f7986b20cf2d..4f2a0aee30c5 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -596,6 +596,7 @@ public: /// @see ScModelObj::getSheetGeometryData() OString getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden, bool bFiltered, bool bGroups); +void extendTiledAreaIfNeeded(); static void OnLOKNoteStateChanged(const ScPostIt* pNote); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index cd14cf8d0879..774509870c02 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include @@ -1001,6 +1002,14 @@ void ScModelObj::setClientVisibleArea(const tools::Rectangle& rRectangle) // Store the visible area so that we can use at places like shape insertion pViewData->setLOKVisibleArea(rRectangle); + +if (comphelper::LibreOfficeKit::isCompatFlagSet( +comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs)) +{ +ScTabView* pTabView = pViewData->GetView(); +if (pTabView) +pTabView->extendTiledAreaIfNeeded(); +} } void ScModelObj::setOutlineState(bool bColumn, int nLevel, int nIndex, bool bHidden) diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index c21f60e61eb3..495848f46e50 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2433,6 +2433,167 @@ void lcl_createGroupsData( } } +class ScRangeProvider +{ +public: +ScRangeProvider(const tools::Rectangle& rArea, bool bInPixels, +ScViewData& rViewData, SCCOLROW nEnlargeX = 0, +SCCOLROW nEnlargeY = 0): +mrViewData(rViewData), +mnEnlargeX(nEnlargeX), +mnEnlargeY(nEnlargeY) +{ +tools::Rectangle aAreaPx = bInPixels ? rArea : +tools::Rectangle(rArea.Left() * mrViewData.GetPPTX(), + rArea.Top() * mrViewData.GetPPTY(), + rArea.Right() * mrViewData.GetPPTX(), + rArea.Bottom() * mrViewData.GetPPTY()); +calculateBounds(aAreaPx); +} + +const ScRange& getCellRange() const +{ +return maRange; +} + +void getColPositions(long& rStartColPos, long& rEndColPos) const +{ +rStartColPos = maBoundPositions.Left(); +rEndColPos = maBoundPositions.Right(); +} + +void getRowPositions(long& rStartRowPos, long& rEndRowPos) const +{ +rStartRowPos = maBoundPositions.Top(); +rEndRowPos = maBoundPositions.Bottom(); +} + +private: +void calculateBounds(const tools::Rectangle& rAreaPx) +{ +long nLeftPx = 0, nRightPx = 0; +SCCOLROW nStartCol = -1, nEndCol = -1; +calculateDimensionBounds(rAreaPx.Left(), rAreaPx.Right(), true, + nStartCol, nEndCol, nLeftPx, nRightPx, + mnEnlargeX, mrViewData); +long nTopPx = 0, nBottomPx = 0; +SCCOLROW nStartRow = -1, nEndRow = -1; +calculateDimensionBounds(rAreaPx.Top(), rAreaPx.Bottom(), false, + nStartRow, nEndRow, nTopPx, nBottomPx, + mnEnlargeY, mrViewData); + +maRange.aStart.Set(nStartCol, nStartRow, mrViewData.GetTabNo()); +maRange.aEnd.Set(nEndCol, nEndRow, mrViewData.GetTabNo()); + +maBoundPositions.SetLeft(nLeftPx); +maBoundPositions.SetRight(nRightPx); +maBoundPositions.SetTop(nTopPx); +maBoundPositions.SetBottom(nBottomPx); +} + +// All positions are in pixels. +static void calculateDimensionBounds(const long nStartPos, const long nEndPos, +
[Libreoffice-commits] core.git: desktop/source include/LibreOfficeKit libreofficekit/source sc/source
desktop/source/lib/init.cxx |1 include/LibreOfficeKit/LibreOfficeKitEnums.h | 16 + libreofficekit/source/gtk/lokdocview.cxx |1 sc/source/ui/inc/tabvwsh.hxx |4 ++ sc/source/ui/undo/undoblk.cxx| 36 +- sc/source/ui/undo/undoblk2.cxx |7 +++- sc/source/ui/undo/undodat.cxx| 28 + sc/source/ui/view/dbfunc.cxx |5 +++ sc/source/ui/view/dbfunc3.cxx| 42 + sc/source/ui/view/tabvwshc.cxx | 44 +++ sc/source/ui/view/viewfun2.cxx | 17 +- sc/source/ui/view/viewfunc.cxx | 21 +++- 12 files changed, 210 insertions(+), 12 deletions(-) New commits: commit 2c798d6715194e910cef9cad1039f464d86dc06f Author: Dennis Francis AuthorDate: Tue May 19 12:42:33 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 15:27:29 2020 +0200 lokit: add new callback type LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY This is to notify the clients about changes in current sheet's geometry data. Use this to notify clients of various sheet geometry invalidations if the new feature flag scPrintTwipsMsgs is set. Change-Id: I478d2e646606320399905d7b15881a165a53146d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96969 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit 7d0181f519f83b978b9040986738ad0cedc020ba) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97956 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index e20fc2f5e37f..767204cf05ee 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1410,6 +1410,7 @@ void CallbackFlushHandler::queue(const int type, const char* data) case LOK_CALLBACK_INVALIDATE_HEADER: case LOK_CALLBACK_WINDOW: case LOK_CALLBACK_CALC_FUNCTION_LIST: +case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY: { const auto& pos = std::find_if(m_queue.rbegin(), m_queue.rend(), [type] (const queue_type::value_type& elem) { return (elem.Type == type); }); diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 8a741d5f62e2..dfafd94656d9 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -752,6 +752,20 @@ typedef enum * } */ LOK_CALLBACK_FORM_FIELD_BUTTON = 49, + +/** + * This is Calc specific. Indicates that some or all of the current sheet's + * geometry data has changed. Clients must request a full or partial sheet + * geometry data set. + * + * The payload specifies what part of the sheet geometry data has changed. + * The payload format is: + * 'all|rows|columns [sizes [hidden [filtered [groups' + * + * For example, the payload 'rows sizes groups' indicates that the row heights + * and row-groups data have changed. + */ +LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY = 50, } LibreOfficeKitCallbackType; @@ -880,6 +894,8 @@ static inline const char* lokCallbackTypeToString(int nType) return "LOK_CALLBACK_TAB_STOP_LIST"; case LOK_CALLBACK_FORM_FIELD_BUTTON: return "LOK_CALLBACK_FORM_FIELD_BUTTON"; +case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY: +return "LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY"; } assert(!"Unknown LibreOfficeKitCallbackType type."); diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index ae2c00bcaa08..559b03fcc189 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -1401,6 +1401,7 @@ callback (gpointer pData) case LOK_CALLBACK_CALC_FUNCTION_LIST: case LOK_CALLBACK_TAB_STOP_LIST: case LOK_CALLBACK_FORM_FIELD_BUTTON: +case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY: { // TODO: Implement me break; diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index ee7b6e18cb49..7a9b32c32729 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -390,6 +390,10 @@ public: /// Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views whose current tab is equal to nCurrentTabIndex static void notifyAllViewsHeaderInvalidation(SfxViewShell* pForViewShell, HeaderType eHeaderType, SCTAB nCurrentTabIndex); static bool isAnyEditViewInRange(SfxViewShell* pForViewShell, bool bColumns, SCCOLROW nStart, SCCOLROW nEnd); +/// Emits a LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY for all views whose current tab +/// is equal to nCurrentTabIndex +static void notifyAllViewsSheetGeomInvalidation(SfxViewShell* pForV
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source
sc/source/ui/view/tabview.cxx | 81 +- 1 file changed, 2 insertions(+), 79 deletions(-) New commits: commit 3c6c039685870ed23d2f25cbfd984d3b54c4b60d Author: Dennis Francis AuthorDate: Sat May 23 11:00:19 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 12:33:50 2020 +0200 use lcl_ExtendTiledDimension() in getRowColumnHeaders() to avoid code repetitions. Change-Id: If83b42175fb53132174fa33d169806e17a4a5cbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96973 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 834bc01b9af6..3b11b23d7cf0 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2669,45 +2669,7 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle) /// 2) if we are approaching current max tiled row, signal a size changed event ///and invalidate the involved area - -if (nEndRow > aViewData.GetMaxTiledRow() - nVisibleRows) -{ -ScDocShell* pDocSh = aViewData.GetDocShell(); -ScModelObj* pModelObj = pDocSh ? comphelper::getUnoTunnelImplementation( pDocSh->GetModel() ) : nullptr; -Size aOldSize(0, 0); -if (pModelObj) -aOldSize = pModelObj->getDocumentSize(); - -aViewData.SetMaxTiledRow(std::min(std::max(nEndRow, aViewData.GetMaxTiledRow()) + nVisibleRows, long(MAXTILEDROW))); - -Size aNewSize(0, 0); -if (pModelObj) -aNewSize = pModelObj->getDocumentSize(); - -SAL_INFO("sc.lok.header", "Row Header: a new height: " << aNewSize.Height()); -if (pDocSh) -{ -// New area extended to the bottom of the sheet after last row -// excluding overlapping area with aNewColArea -tools::Rectangle aNewRowArea(0, aOldSize.getHeight(), aOldSize.getWidth(), aNewSize.getHeight()); - -// Only invalidate if spreadsheet extended to the bottom -if (aNewRowArea.getHeight()) -{ -UpdateSelectionOverlay(); -SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), aNewRowArea.toString()); -} - -// Provide size in the payload, so clients don't have to -// call lok::Document::getDocumentSize(). -std::stringstream ss; -ss << aNewSize.Width() << ", " << aNewSize.Height(); -OString sSize = ss.str().c_str(); -ScModelObj* pModel = comphelper::getUnoTunnelImplementation(aViewData.GetViewShell()->GetCurrentDocument()); -SfxLokHelper::notifyDocumentSizeChanged(aViewData.GetViewShell(), sSize, pModel, false); -} -} - +lcl_ExtendTiledDimension(/* bColumn */ false, nEndRow, nVisibleRows, *this, aViewData); /// 3) create string data for rows @@ -2803,46 +2765,7 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle) /// 2) if we are approaching current max tiled column, signal a size changed event ///and invalidate the involved area - -if (nEndCol > aViewData.GetMaxTiledCol() - nVisibleCols) -{ -ScDocShell* pDocSh = aViewData.GetDocShell(); -ScModelObj* pModelObj = pDocSh ? comphelper::getUnoTunnelImplementation( pDocSh->GetModel() ) : nullptr; -Size aOldSize(0, 0); -if (pModelObj) -aOldSize = pModelObj->getDocumentSize(); - -aViewData.SetMaxTiledCol(std::min(std::max(nEndCol, aViewData.GetMaxTiledCol()) + nVisibleCols, long(pDoc->MaxCol(; - -Size aNewSize(0, 0); -if (pModelObj) -aNewSize = pModelObj->getDocumentSize(); - -if (pDocSh) -{ -// New area extended to the right of the sheet after last column -// including overlapping area with aNewRowArea -tools::Rectangle aNewColArea(aOldSize.getWidth(), 0, aNewSize.getWidth(), aNewSize.getHeight()); - -// Only invalidate if spreadsheet extended to the bottom -if (aNewColArea.getWidth()) -{ -UpdateSelectionOverlay(); -SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), aNewColArea.toString()); -} - -if (aOldSize != aNewSize) -{ -// Provide size in the payload, so clients don't have to -// call lok::Document::getDocumentSize(). -std::stringstream ss; -ss << aNewSize.Width() << ", " << aNewSize.Height(); -OString sSize = ss.str().c_str(); -ScModelObj* pModel = comphelper::getUnoTunnelImplementation(aViewData.GetViewShell()->GetCu
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source
sc/source/ui/view/tabview.cxx | 32 ++-- 1 file changed, 10 insertions(+), 22 deletions(-) New commits: commit c888a2d7dc3fd770a8e95d0bd23e84f307f1355c Author: Dennis Francis AuthorDate: Sat May 23 10:47:10 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 12:32:44 2020 +0200 use helper-class ScRangeProvider in getRowColumnHeader() and avoid some code repetitions. Change-Id: I3e006bc8d9880f3e1ec892aa8f2423edbf9bbf14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96972 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index f2ff907bfbb5..834bc01b9af6 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2621,6 +2621,10 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle) mnLOKStartHeaderCol + 1, mnLOKStartHeaderRow + 1, mnLOKEndHeaderCol, mnLOKEndHeaderRow); +ScRangeProvider aRangeProvider(rRectangle, /* bInPixels */ false, aViewData, + /* nEnlargeX */ 2, /* nEnlargeY */ 2); +const ScRange& rCellRange = aRangeProvider.getCellRange(); + /// *** start collecting ROWS *** /// 1) compute start and end rows @@ -2629,17 +2633,9 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle) { SAL_INFO("sc.lok.header", "Row Header: compute start/end rows."); long nEndHeightPx = 0; -long nRectTopPx = rRectangle.Top() * aViewData.GetPPTX(); -long nRectBottomPx = rRectangle.Bottom() * aViewData.GetPPTY(); - -const auto& rTopNearest = aViewData.GetLOKHeightHelper().getNearestByPosition(nRectTopPx); -const auto& rBottomNearest = aViewData.GetLOKHeightHelper().getNearestByPosition(nRectBottomPx); - -ScBoundsProvider aBoundingRowsProvider(aViewData, nTab, /*bColumnHeader: */ false); -aBoundingRowsProvider.Compute(rTopNearest, rBottomNearest, nRectTopPx, nRectBottomPx); -aBoundingRowsProvider.EnlargeBy(2); -aBoundingRowsProvider.GetStartIndexAndPosition(nStartRow, nStartHeightPx); -aBoundingRowsProvider.GetEndIndexAndPosition(nEndRow, nEndHeightPx); +nStartRow = rCellRange.aStart.Row(); +nEndRow = rCellRange.aEnd.Row(); +aRangeProvider.getRowPositions(nStartHeightPx, nEndHeightPx); aViewData.GetLOKHeightHelper().removeByIndex(mnLOKStartHeaderRow); aViewData.GetLOKHeightHelper().removeByIndex(mnLOKEndHeaderRow); @@ -2772,17 +2768,9 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle) { SAL_INFO("sc.lok.header", "Column Header: compute start/end columns."); long nEndWidthPx = 0; -long nRectLeftPx = rRectangle.Left() * aViewData.GetPPTX(); -long nRectRightPx = rRectangle.Right() * aViewData.GetPPTY(); - -const auto& rLeftNearest = aViewData.GetLOKWidthHelper().getNearestByPosition(nRectLeftPx); -const auto& rRightNearest = aViewData.GetLOKWidthHelper().getNearestByPosition(nRectRightPx); - -ScBoundsProvider aBoundingColsProvider(aViewData, nTab, /*bColumnHeader: */ true); -aBoundingColsProvider.Compute(rLeftNearest, rRightNearest, nRectLeftPx, nRectRightPx); -aBoundingColsProvider.EnlargeBy(2); -aBoundingColsProvider.GetStartIndexAndPosition(nStartCol, nStartWidthPx); -aBoundingColsProvider.GetEndIndexAndPosition(nEndCol, nEndWidthPx); +nStartCol = rCellRange.aStart.Col(); +nEndCol = rCellRange.aEnd.Col(); +aRangeProvider.getColPositions(nStartWidthPx, nEndWidthPx); aViewData.GetLOKWidthHelper().removeByIndex(mnLOKStartHeaderCol); aViewData.GetLOKWidthHelper().removeByIndex(mnLOKEndHeaderCol); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: kit/ChildSession.cpp
kit/ChildSession.cpp |4 1 file changed, 4 insertions(+) New commits: commit b976a4bfc969361dd4cb8162944b007ade9b758a Author: Dennis Francis AuthorDate: Tue May 19 18:51:11 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 12:30:16 2020 +0200 handle LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY Change-Id: I2f894f32d4c9e852d89159a55c0dd9effb45c09e Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97955 Tested-by: Dennis Francis Reviewed-by: Dennis Francis diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 6d6344cef..c2644e68a 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -2282,6 +2282,7 @@ void ChildSession::rememberEventsForInactiveUser(const int type, const std::stri type == LOK_CALLBACK_GRAPHIC_SELECTION || type == LOK_CALLBACK_DOCUMENT_SIZE_CHANGED || type == LOK_CALLBACK_INVALIDATE_HEADER || + type == LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY || type == LOK_CALLBACK_CELL_ADDRESS || type == LOK_CALLBACK_REFERENCE_MARKS) { @@ -2606,6 +2607,9 @@ void ChildSession::loKitCallback(const int type, const std::string& payload) case LOK_CALLBACK_FORM_FIELD_BUTTON: sendTextFrame("formfieldbutton: " + payload); break; +case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY: +sendTextFrame("invalidatesheetgeometry: " + payload); +break; #if !ENABLE_DEBUG // we want a compilation-time failure in the debug builds; but ERR in the ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source
sc/source/ui/inc/tabview.hxx |1 sc/source/ui/unoobj/docuno.cxx |9 + sc/source/ui/view/tabview.cxx | 260 + 3 files changed, 270 insertions(+) New commits: commit d64a5efdb8a2db38a5339ae04eb13807ba944ea0 Author: Dennis Francis AuthorDate: Tue May 19 10:41:53 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 12:24:41 2020 +0200 lokit: scPrintTwipsMsgs: Extend the tiled-area limits... if the client visible area is "close" to these limits. Also send tile-invalidations for the new area uncovered. ** All this is done only if the flag scPrintTwipsMsgs is set. Change-Id: I3d6b8c6aaae1eb934030c5bdbc1094dc8be16a9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96971 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 1116a4fa161a..da1663cab83b 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -607,6 +607,7 @@ public: /// @see ScModelObj::getSheetGeometryData() OString getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden, bool bFiltered, bool bGroups); +void extendTiledAreaIfNeeded(); static void OnLOKNoteStateChanged(const ScPostIt* pNote); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index a29a5d7eea3b..416357b35bea 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include @@ -994,6 +995,14 @@ void ScModelObj::setClientVisibleArea(const tools::Rectangle& rRectangle) // Store the visible area so that we can use at places like shape insertion pViewData->setLOKVisibleArea(rRectangle); + +if (comphelper::LibreOfficeKit::isCompatFlagSet( +comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs)) +{ +ScTabView* pTabView = pViewData->GetView(); +if (pTabView) +pTabView->extendTiledAreaIfNeeded(); +} } void ScModelObj::setOutlineState(bool bColumn, int nLevel, int nIndex, bool bHidden) diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index ff88024319c8..f2ff907bfbb5 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2432,6 +2432,167 @@ void lcl_createGroupsData( } } +class ScRangeProvider +{ +public: +ScRangeProvider(const tools::Rectangle& rArea, bool bInPixels, +ScViewData& rViewData, SCCOLROW nEnlargeX = 0, +SCCOLROW nEnlargeY = 0): +mrViewData(rViewData), +mnEnlargeX(nEnlargeX), +mnEnlargeY(nEnlargeY) +{ +tools::Rectangle aAreaPx = bInPixels ? rArea : +tools::Rectangle(rArea.Left() * mrViewData.GetPPTX(), + rArea.Top() * mrViewData.GetPPTY(), + rArea.Right() * mrViewData.GetPPTX(), + rArea.Bottom() * mrViewData.GetPPTY()); +calculateBounds(aAreaPx); +} + +const ScRange& getCellRange() const +{ +return maRange; +} + +void getColPositions(long& rStartColPos, long& rEndColPos) const +{ +rStartColPos = maBoundPositions.Left(); +rEndColPos = maBoundPositions.Right(); +} + +void getRowPositions(long& rStartRowPos, long& rEndRowPos) const +{ +rStartRowPos = maBoundPositions.Top(); +rEndRowPos = maBoundPositions.Bottom(); +} + +private: +void calculateBounds(const tools::Rectangle& rAreaPx) +{ +long nLeftPx = 0, nRightPx = 0; +SCCOLROW nStartCol = -1, nEndCol = -1; +calculateDimensionBounds(rAreaPx.Left(), rAreaPx.Right(), true, + nStartCol, nEndCol, nLeftPx, nRightPx, + mnEnlargeX, mrViewData); +long nTopPx = 0, nBottomPx = 0; +SCCOLROW nStartRow = -1, nEndRow = -1; +calculateDimensionBounds(rAreaPx.Top(), rAreaPx.Bottom(), false, + nStartRow, nEndRow, nTopPx, nBottomPx, + mnEnlargeY, mrViewData); + +maRange.aStart.Set(nStartCol, nStartRow, mrViewData.GetTabNo()); +maRange.aEnd.Set(nEndCol, nEndRow, mrViewData.GetTabNo()); + +maBoundPositions.SetLeft(nLeftPx); +maBoundPositions.SetRight(nRightPx); +maBoundPositions.SetTop(nTopPx); +maBoundPositions.SetBottom(nBottomPx); +} + +// All positions are in pixels. +static void calculateDimensionBounds(const long nStartPos, const long nEndPos, + bool bColumns, SCCOLROW& rStartIndex, + SCCOLROW& rEndIndex, long& rBoundStart, +
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - desktop/source include/LibreOfficeKit libreofficekit/source sc/source
desktop/source/lib/init.cxx |1 include/LibreOfficeKit/LibreOfficeKitEnums.h | 16 + libreofficekit/source/gtk/lokdocview.cxx |1 sc/source/ui/inc/tabvwsh.hxx |4 ++ sc/source/ui/undo/undoblk.cxx| 36 +- sc/source/ui/undo/undoblk2.cxx |7 +++- sc/source/ui/undo/undodat.cxx| 28 + sc/source/ui/view/dbfunc.cxx |5 +++ sc/source/ui/view/dbfunc3.cxx| 42 + sc/source/ui/view/tabvwshc.cxx | 44 +++ sc/source/ui/view/viewfun2.cxx | 17 +- sc/source/ui/view/viewfunc.cxx | 21 +++- 12 files changed, 210 insertions(+), 12 deletions(-) New commits: commit 7d0181f519f83b978b9040986738ad0cedc020ba Author: Dennis Francis AuthorDate: Tue May 19 12:42:33 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 12:18:34 2020 +0200 lokit: add new callback type LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY This is to notify the clients about changes in current sheet's geometry data. Use this to notify clients of various sheet geometry invalidations if the new feature flag scPrintTwipsMsgs is set. Change-Id: I478d2e646606320399905d7b15881a165a53146d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96969 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 68c5430113bc..730c105434fe 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1447,6 +1447,7 @@ void CallbackFlushHandler::queue(const int type, const char* data) case LOK_CALLBACK_INVALIDATE_HEADER: case LOK_CALLBACK_WINDOW: case LOK_CALLBACK_CALC_FUNCTION_LIST: +case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY: { const auto& pos = std::find_if(m_queue.rbegin(), m_queue.rend(), [type] (const queue_type::value_type& elem) { return (elem.Type == type); }); diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 9a1ca4c2acf6..86ca9de556af 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -752,6 +752,20 @@ typedef enum * } */ LOK_CALLBACK_FORM_FIELD_BUTTON = 49, + +/** + * This is Calc specific. Indicates that some or all of the current sheet's + * geometry data has changed. Clients must request a full or partial sheet + * geometry data set. + * + * The payload specifies what part of the sheet geometry data has changed. + * The payload format is: + * 'all|rows|columns [sizes [hidden [filtered [groups' + * + * For example, the payload 'rows sizes groups' indicates that the row heights + * and row-groups data have changed. + */ +LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY = 50, } LibreOfficeKitCallbackType; @@ -880,6 +894,8 @@ static inline const char* lokCallbackTypeToString(int nType) return "LOK_CALLBACK_TAB_STOP_LIST"; case LOK_CALLBACK_FORM_FIELD_BUTTON: return "LOK_CALLBACK_FORM_FIELD_BUTTON"; +case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY: +return "LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY"; } assert(!"Unknown LibreOfficeKitCallbackType type."); diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index e77e0ddc8e9d..2b2e4b85e89c 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -1384,6 +1384,7 @@ callback (gpointer pData) case LOK_CALLBACK_CALC_FUNCTION_LIST: case LOK_CALLBACK_TAB_STOP_LIST: case LOK_CALLBACK_FORM_FIELD_BUTTON: +case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY: { // TODO: Implement me break; diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index bf00763a42a1..cffc7cf1bb3c 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -392,6 +392,10 @@ public: /// Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views whose current tab is equal to nCurrentTabIndex static void notifyAllViewsHeaderInvalidation(SfxViewShell* pForViewShell, HeaderType eHeaderType, SCTAB nCurrentTabIndex); static bool isAnyEditViewInRange(SfxViewShell* pForViewShell, bool bColumns, SCCOLROW nStart, SCCOLROW nEnd); +/// Emits a LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY for all views whose current tab +/// is equal to nCurrentTabIndex +static void notifyAllViewsSheetGeomInvalidation(SfxViewShell* pForViewShell, bool bColumns, bool bRows, bool bSizes, +bool bHidden, bool bFiltered, bool bGroups, SCTAB nCurrentTabInd
[Libreoffice-commits] core.git: desktop/source include/comphelper
desktop/source/lib/init.cxx |3 +++ include/comphelper/lok.hxx |1 + 2 files changed, 4 insertions(+) New commits: commit b6d8dd62dd0892b9a2eeac68fe2e2ee366d59057 Author: Dennis Francis AuthorDate: Tue May 19 13:37:04 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 12:04:55 2020 +0200 lokit: Introduce new flag "sc_print_twips_msgs"... for conditioning all changes needed to allow calc messages in print twips coordinates. Change-Id: I407b4d4d4e0a1dfb2c4339cafa10b368b437c82d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96904 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit 8f382dcee04588ac1e95f03f55df2b87883ce259) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96967 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index bc6a0e18ed92..e20fc2f5e37f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -6052,6 +6052,9 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char else if (it == "sc_no_grid_bg") comphelper::LibreOfficeKit::setCompatFlag( comphelper::LibreOfficeKit::Compat::scNoGridBackground); +else if (it == "sc_print_twips_msgs") +comphelper::LibreOfficeKit::setCompatFlag( +comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs); } } diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx index 88901a24d991..dfbc1a2ce6c0 100644 --- a/include/comphelper/lok.hxx +++ b/include/comphelper/lok.hxx @@ -86,6 +86,7 @@ enum Compat : sal_uInt32 { none = 0, scNoGridBackground = 1, +scPrintTwipsMsgs = 2, }; /// Set compatibility flags COMPHELPER_DLLPUBLIC void setCompatFlag(Compat flag); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/tabview.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 9f7cf0907e5a5d2b571e9c859f6be7648341da72 Author: Dennis Francis AuthorDate: Wed May 13 22:33:44 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 12:03:18 2020 +0200 add row/col limits to the JSON Change-Id: I92cead8212f30d0cc9b811be21b6639830e84fa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96903 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit fcb176a46c6ad9fa5bf09830141e01e204290aaf) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96966 Tested-by: Jenkins diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 2658db649d40..c21f60e61eb3 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2762,6 +2762,8 @@ OString ScTabView::getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, { boost::property_tree::ptree aTree; aTree.put("commandName", ".uno:SheetGeometryData"); +aTree.put("maxtiledcolumn", MAXCOL); +aTree.put("maxtiledrow", MAXTILEDROW); auto getJSONString = [](const boost::property_tree::ptree& rTree) { std::stringstream aStream; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/core/data/olinetab.cxx |4 1 file changed, 4 insertions(+) New commits: commit 568d0e13adb71c72eb07255a507b0ce922f43917 Author: Dennis Francis AuthorDate: Tue May 12 10:40:37 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 12:01:56 2020 +0200 lokit: table-outline: skip empty collections... while encoding the information as string. Change-Id: I890efc4a9b60125c68c663a69569864308fdbdcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96902 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit 2a7d29c51dca6d23a677f1e12ae68b6d7fc71ad5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96965 Tested-by: Jenkins diff --git a/sc/source/core/data/olinetab.cxx b/sc/source/core/data/olinetab.cxx index 84b9c59af3be..ddcc4c4ed6ad 100644 --- a/sc/source/core/data/olinetab.cxx +++ b/sc/source/core/data/olinetab.cxx @@ -747,7 +747,11 @@ OString ScOutlineArray::dumpAsString() const OString aOutput; const char* const pLevelSep = " "; for (const auto& rCollection : aCollections) +{ +if (rCollection.empty()) +continue; aOutput += rCollection.dumpAsString() + pLevelSep; +} return aOutput; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/qa
sc/qa/unit/tiledrendering/tiledrendering.cxx | 347 +++ 1 file changed, 347 insertions(+) New commits: commit d24d7e21860ce390496c7aa4d61b347e0158ac51 Author: Dennis Francis AuthorDate: Fri May 8 13:27:50 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 09:48:57 2020 +0200 Unit tests for ITiledRenderable::getSheetGeometryData() (Testing of groups/ouline case is not included) Change-Id: Ia53e5489c376d2d86461a9fd3db4f5b7dc963b99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96898 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit 4b7333da7fde7816ef874df9f5a6dc340aac40cf) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96964 Tested-by: Jenkins diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 2d4739a628c6..1956f1851422 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -107,6 +107,8 @@ public: void testGetRowColumnHeadersInvalidation(); void testJumpHorizontallyInvalidation(); void testJumpToLastRowInvalidation(); +void testSheetGeometryDataInvariance(); +void testSheetGeometryDataCorrectness(); CPPUNIT_TEST_SUITE(ScTiledRenderingTest); CPPUNIT_TEST(testRowColumnHeaders); @@ -148,6 +150,8 @@ public: CPPUNIT_TEST(testGetRowColumnHeadersInvalidation); CPPUNIT_TEST(testJumpHorizontallyInvalidation); CPPUNIT_TEST(testJumpToLastRowInvalidation); +CPPUNIT_TEST(testSheetGeometryDataInvariance); +CPPUNIT_TEST(testSheetGeometryDataCorrectness); CPPUNIT_TEST_SUITE_END(); private: @@ -1894,6 +1898,349 @@ void ScTiledRenderingTest::testRowColumnHeaders() SfxViewShell::Current()->registerLibreOfficeKitViewCallback(nullptr, nullptr); } +// Helper structs for setup and testing of ScModelObj::getSheetGeometryData() +struct SpanEntry +{ +size_t nVal; +SCCOLROW nEnd; +}; + +struct SheetDimData +{ +typedef std::vector SpanList; +SpanList aSizes; +SpanList aHidden; +SpanList aFiltered; +// TODO: Add group info too to test. + +void setDataToDoc(ScDocument* pDoc, bool bCol) const +{ +SCCOLROW nStart = 0; +// sizes +for (const auto& rSpan : aSizes) +{ +if (bCol) +{ +for (SCCOLROW nIdx = nStart; nIdx <= rSpan.nEnd; ++nIdx) +pDoc->SetColWidthOnly(nIdx, 0, rSpan.nVal); +} +else +pDoc->SetRowHeightOnly(nStart, rSpan.nEnd, 0, rSpan.nVal); + +nStart = rSpan.nEnd + 1; +} + +nStart = 0; +// hidden +for (const auto& rSpan : aHidden) +{ +if (bCol) +pDoc->SetColHidden(nStart, rSpan.nEnd, 0, !!rSpan.nVal); +else +pDoc->SetRowHidden(nStart, rSpan.nEnd, 0, !!rSpan.nVal); + +nStart = rSpan.nEnd + 1; +} + +// There is no ScDocument interface to set ScTable::mpFilteredCols +// It seems ScTable::mpFilteredCols is not really used !? +if (bCol) +return; + +nStart = 0; +// filtered +for (const auto& rSpan : aFiltered) +{ +pDoc->SetRowFiltered(nStart, rSpan.nEnd, 0, !!rSpan.nVal); +nStart = rSpan.nEnd + 1; +} +} + +void testPropertyTree(const boost::property_tree::ptree& rTree, bool bCol) const +{ +struct SpanListWithKey +{ +OString aKey; +const SpanList& rSpanList; +}; + +const SpanListWithKey aPairList[] = { +{ "sizes",aSizes}, +{ "hidden", aHidden }, +{ "filtered", aFiltered } +}; + +for (const auto& rEntry : aPairList) +{ +// There is no ScDocument interface to set ScTable::mpFilteredCols +// It seems ScTable::mpFilteredCols is not really used !? +if (bCol && rEntry.aKey == "filtered") +continue; + +bool bBooleanValue = rEntry.aKey != "sizes"; +OString aExpectedEncoding; +bool bFirst = true; +for (const auto& rSpan : rEntry.rSpanList) +{ +size_t nVal = rSpan.nVal; +if (bBooleanValue && bFirst) +nVal = static_cast(!!nVal); +if (!bBooleanValue || bFirst) +aExpectedEncoding += OString::number(nVal) + ":"; +aExpectedEncoding += OString::number(rSpan.nEnd) + " "; +bFirst = false; +} + +// Get the tree's value for the property key ("sizes"/"hidden"/"filtered"). +
[Libreoffice-commits] core.git: desktop/source include/vcl sc/inc sc/source
desktop/source/lib/init.cxx | 67 +++ include/vcl/ITiledRenderable.hxx| 25 sc/inc/document.hxx | 19 ++ sc/inc/docuno.hxx |4 + sc/inc/olinetab.hxx |6 ++ sc/inc/segmenttree.hxx |7 ++ sc/inc/table.hxx| 16 + sc/source/core/data/document10.cxx |9 +++ sc/source/core/data/olinetab.cxx| 27 + sc/source/core/data/segmenttree.cxx | 59 sc/source/core/data/table7.cxx | 104 sc/source/ui/inc/tabview.hxx|4 + sc/source/ui/unoobj/docuno.cxx | 15 + sc/source/ui/view/tabview.cxx | 77 ++ 14 files changed, 439 insertions(+) New commits: commit 777f9cec0985f99451ecb804d5ae139a0be32253 Author: Dennis Francis AuthorDate: Tue May 5 01:55:37 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jul 4 09:47:30 2020 +0200 Introduce ITiledRenderable::getSheetGeometryData() ITiledRenderable::getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden, bool bFiltered, bool bGroups) and implement it for the Calc derivation (ScModelObj). The aim is to use it actively in LOOL instead of the interface: ITiledRenderable::getRowColumnHeaders(const tools::Rectangle& /*rRectangle*/) This is used by the LOOL to fetch the sheet geometry data for just the current view-area in the clients, so LOOL queries this everytime some client's view-area changes. Like the existing interface, the new one will provide all 'kinds' of sheet geometry info [col/row sizes(twips), hidden/filtered and grouping]. But the difference is, it generates data for the whole sheet (not view-area specific). So the method need not be queried every time the view area changes in the LOOL clients, and more importantly it enables the clients to locate any cell at any zoom level without any further help from the core. This means core needn't send various client(zoom) specific positioning messages in pixel aligned twips. It just can send all positioning messages in print twips uniformly to all clients. Conflicts: sc/source/core/data/segmenttree.cxx sc/source/ui/inc/tabview.hxx sc/source/ui/unoobj/docuno.cxx Change-Id: Ib6aee9a0c92746b1576ed244e98cb54b572778c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96892 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit 9faf7b5e7abe39c287f28f83fd14a364e959c881) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96963 Tested-by: Jenkins diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index a34565e9d0c1..bc6a0e18ed92 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4875,6 +4875,7 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo OString aCommand(pCommand); static const OString aViewRowColumnHeaders(".uno:ViewRowColumnHeaders"); +static const OString aSheetGeometryData(".uno:SheetGeometryData"); static const OString aCellCursor(".uno:CellCursor"); static const OString aFontSubset(".uno:FontSubset="); @@ -4970,6 +4971,72 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo pDoc->getRowColumnHeaders(aRectangle, aJsonWriter); return aJsonWriter.extractData(); } +else if (aCommand.startsWith(aSheetGeometryData)) +{ +ITiledRenderable* pDoc = getTiledRenderable(pThis); +if (!pDoc) +{ +SetLastExceptionMsg("Document doesn't support tiled rendering"); +return nullptr; +} + +bool bColumns = true; +bool bRows = true; +bool bSizes = true; +bool bHidden = true; +bool bFiltered = true; +bool bGroups = true; +if (aCommand.getLength() > aSheetGeometryData.getLength()) +{ +bColumns = bRows = bSizes = bHidden = bFiltered = bGroups = false; + +OString aArguments = aCommand.copy(aSheetGeometryData.getLength() + 1); +sal_Int32 nParamIndex = 0; +do +{ +OString aParamToken = aArguments.getToken(0, '&', nParamIndex); +sal_Int32 nIndex = 0; +OString aKey; +OString aValue; +do +{ +OString aToken = aParamToken.getToken(0, '=', nIndex); +if (!aKey.getLength()) +aKey = aToken; +else +aValue = aToken; + +
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source
sc/source/core/data/segmenttree.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 503358ae84d8fbeafcc4d30e9cc51382baf6b0bd Author: Dennis Francis AuthorDate: Tue Jun 23 03:04:04 2020 +0530 Commit: Dennis Francis CommitDate: Tue Jun 23 00:10:31 2020 +0200 fix tinderbox_windows compile error Change-Id: Ibe3651b6c9f37ddac6cc628f9f3ade46f102c2dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96906 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/source/core/data/segmenttree.cxx b/sc/source/core/data/segmenttree.cxx index 57600bbe39bd..4000e15d3599 100644 --- a/sc/source/core/data/segmenttree.cxx +++ b/sc/source/core/data/segmenttree.cxx @@ -421,7 +421,7 @@ OString ScFlatBoolRowSegments::dumpAsString() while (getRangeData(nRow, aRange)) { if (!nRow) -aSegment = OStringLiteral(aRange.mbValue ? "1" : "0") + ":"; +aSegment = (aRange.mbValue ? OStringLiteral("1") : OStringLiteral("0")) + OStringLiteral(":"); else aSegment.clear(); @@ -488,7 +488,7 @@ OString ScFlatBoolColSegments::dumpAsString() while (getRangeData(nCol, aRange)) { if (!nCol) -aSegment = OStringLiteral(aRange.mbValue ? "1" : "0") + ":"; +aSegment = (aRange.mbValue ? OStringLiteral("1") : OStringLiteral("0")) + OStringLiteral(":"); else aSegment.clear(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - desktop/source include/comphelper
desktop/source/lib/init.cxx |3 +++ include/comphelper/lok.hxx |1 + 2 files changed, 4 insertions(+) New commits: commit 8f382dcee04588ac1e95f03f55df2b87883ce259 Author: Dennis Francis AuthorDate: Tue May 19 13:37:04 2020 +0530 Commit: Dennis Francis CommitDate: Mon Jun 22 22:34:24 2020 +0200 lokit: Introduce new flag "sc_print_twips_msgs"... for conditioning all changes needed to allow calc messages in print twips coordinates. Change-Id: I407b4d4d4e0a1dfb2c4339cafa10b368b437c82d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96904 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index b1732dc1bbea..0c171784d40f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5998,6 +5998,9 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char else if (it == "sc_no_grid_bg") comphelper::LibreOfficeKit::setCompatFlag( comphelper::LibreOfficeKit::Compat::scNoGridBackground); +else if (it == "sc_print_twips_msgs") +comphelper::LibreOfficeKit::setCompatFlag( +comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs); } } diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx index 88901a24d991..dfbc1a2ce6c0 100644 --- a/include/comphelper/lok.hxx +++ b/include/comphelper/lok.hxx @@ -86,6 +86,7 @@ enum Compat : sal_uInt32 { none = 0, scNoGridBackground = 1, +scPrintTwipsMsgs = 2, }; /// Set compatibility flags COMPHELPER_DLLPUBLIC void setCompatFlag(Compat flag); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source
sc/source/ui/view/tabview.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit fcb176a46c6ad9fa5bf09830141e01e204290aaf Author: Dennis Francis AuthorDate: Wed May 13 22:33:44 2020 +0530 Commit: Dennis Francis CommitDate: Mon Jun 22 22:32:36 2020 +0200 add row/col limits to the JSON Change-Id: I92cead8212f30d0cc9b811be21b6639830e84fa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96903 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 4df6a2d60a05..ff88024319c8 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2765,6 +2765,8 @@ OString ScTabView::getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, { boost::property_tree::ptree aTree; aTree.put("commandName", ".uno:SheetGeometryData"); +aTree.put("maxtiledcolumn", MAXCOL); +aTree.put("maxtiledrow", MAXTILEDROW); auto getJSONString = [](const boost::property_tree::ptree& rTree) { std::stringstream aStream; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source
sc/source/core/data/olinetab.cxx |4 1 file changed, 4 insertions(+) New commits: commit 2a7d29c51dca6d23a677f1e12ae68b6d7fc71ad5 Author: Dennis Francis AuthorDate: Tue May 12 10:40:37 2020 +0530 Commit: Dennis Francis CommitDate: Mon Jun 22 22:30:41 2020 +0200 lokit: table-outline: skip empty collections... while encoding the information as string. Change-Id: I890efc4a9b60125c68c663a69569864308fdbdcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96902 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/source/core/data/olinetab.cxx b/sc/source/core/data/olinetab.cxx index 84b9c59af3be..ddcc4c4ed6ad 100644 --- a/sc/source/core/data/olinetab.cxx +++ b/sc/source/core/data/olinetab.cxx @@ -747,7 +747,11 @@ OString ScOutlineArray::dumpAsString() const OString aOutput; const char* const pLevelSep = " "; for (const auto& rCollection : aCollections) +{ +if (rCollection.empty()) +continue; aOutput += rCollection.dumpAsString() + pLevelSep; +} return aOutput; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/qa
sc/qa/unit/tiledrendering/tiledrendering.cxx | 347 +++ 1 file changed, 347 insertions(+) New commits: commit 4b7333da7fde7816ef874df9f5a6dc340aac40cf Author: Dennis Francis AuthorDate: Fri May 8 13:27:50 2020 +0530 Commit: Dennis Francis CommitDate: Mon Jun 22 21:08:08 2020 +0200 Unit tests for ITiledRenderable::getSheetGeometryData() (Testing of groups/ouline case is not included) Change-Id: Ia53e5489c376d2d86461a9fd3db4f5b7dc963b99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96898 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index c0386f16cd38..a8acc44c6627 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -106,6 +106,8 @@ public: void testGetRowColumnHeadersInvalidation(); void testJumpHorizontallyInvalidation(); void testJumpToLastRowInvalidation(); +void testSheetGeometryDataInvariance(); +void testSheetGeometryDataCorrectness(); CPPUNIT_TEST_SUITE(ScTiledRenderingTest); CPPUNIT_TEST(testRowColumnHeaders); @@ -147,6 +149,8 @@ public: CPPUNIT_TEST(testGetRowColumnHeadersInvalidation); CPPUNIT_TEST(testJumpHorizontallyInvalidation); CPPUNIT_TEST(testJumpToLastRowInvalidation); +CPPUNIT_TEST(testSheetGeometryDataInvariance); +CPPUNIT_TEST(testSheetGeometryDataCorrectness); CPPUNIT_TEST_SUITE_END(); private: @@ -1893,6 +1897,349 @@ void ScTiledRenderingTest::testRowColumnHeaders() SfxViewShell::Current()->registerLibreOfficeKitViewCallback(nullptr, nullptr); } +// Helper structs for setup and testing of ScModelObj::getSheetGeometryData() +struct SpanEntry +{ +size_t nVal; +SCCOLROW nEnd; +}; + +struct SheetDimData +{ +typedef std::vector SpanList; +SpanList aSizes; +SpanList aHidden; +SpanList aFiltered; +// TODO: Add group info too to test. + +void setDataToDoc(ScDocument* pDoc, bool bCol) const +{ +SCCOLROW nStart = 0; +// sizes +for (const auto& rSpan : aSizes) +{ +if (bCol) +{ +for (SCCOLROW nIdx = nStart; nIdx <= rSpan.nEnd; ++nIdx) +pDoc->SetColWidthOnly(nIdx, 0, rSpan.nVal); +} +else +pDoc->SetRowHeightOnly(nStart, rSpan.nEnd, 0, rSpan.nVal); + +nStart = rSpan.nEnd + 1; +} + +nStart = 0; +// hidden +for (const auto& rSpan : aHidden) +{ +if (bCol) +pDoc->SetColHidden(nStart, rSpan.nEnd, 0, !!rSpan.nVal); +else +pDoc->SetRowHidden(nStart, rSpan.nEnd, 0, !!rSpan.nVal); + +nStart = rSpan.nEnd + 1; +} + +// There is no ScDocument interface to set ScTable::mpFilteredCols +// It seems ScTable::mpFilteredCols is not really used !? +if (bCol) +return; + +nStart = 0; +// filtered +for (const auto& rSpan : aFiltered) +{ +pDoc->SetRowFiltered(nStart, rSpan.nEnd, 0, !!rSpan.nVal); +nStart = rSpan.nEnd + 1; +} +} + +void testPropertyTree(const boost::property_tree::ptree& rTree, bool bCol) const +{ +struct SpanListWithKey +{ +OString aKey; +const SpanList& rSpanList; +}; + +const SpanListWithKey aPairList[] = { +{ "sizes",aSizes}, +{ "hidden", aHidden }, +{ "filtered", aFiltered } +}; + +for (const auto& rEntry : aPairList) +{ +// There is no ScDocument interface to set ScTable::mpFilteredCols +// It seems ScTable::mpFilteredCols is not really used !? +if (bCol && rEntry.aKey == "filtered") +continue; + +bool bBooleanValue = rEntry.aKey != "sizes"; +OString aExpectedEncoding; +bool bFirst = true; +for (const auto& rSpan : rEntry.rSpanList) +{ +size_t nVal = rSpan.nVal; +if (bBooleanValue && bFirst) +nVal = static_cast(!!nVal); +if (!bBooleanValue || bFirst) +aExpectedEncoding += OString::number(nVal) + ":"; +aExpectedEncoding += OString::number(rSpan.nEnd) + " "; +bFirst = false; +} + +// Get the tree's value for the property key ("sizes"/"hidden"/"filtered"). +OString aTreeValue = rTree.get(rEntry.aKey.getStr()).c_str(); + +CPPUNIT_ASSERT_EQUAL(aExpectedEncoding, aTreeValue); +} +} +}; + +cla
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - desktop/source include/vcl sc/inc sc/source
desktop/source/lib/init.cxx | 67 +++ include/vcl/ITiledRenderable.hxx| 25 sc/inc/document.hxx | 19 ++ sc/inc/docuno.hxx |4 + sc/inc/olinetab.hxx |6 ++ sc/inc/segmenttree.hxx |7 ++ sc/inc/table.hxx| 16 + sc/source/core/data/document10.cxx |9 +++ sc/source/core/data/olinetab.cxx| 27 + sc/source/core/data/segmenttree.cxx | 59 sc/source/core/data/table7.cxx | 104 sc/source/ui/inc/tabview.hxx|4 + sc/source/ui/unoobj/docuno.cxx | 15 + sc/source/ui/view/tabview.cxx | 77 ++ 14 files changed, 439 insertions(+) New commits: commit 9faf7b5e7abe39c287f28f83fd14a364e959c881 Author: Dennis Francis AuthorDate: Tue May 5 01:55:37 2020 +0530 Commit: Dennis Francis CommitDate: Mon Jun 22 19:08:25 2020 +0200 Introduce ITiledRenderable::getSheetGeometryData() ITiledRenderable::getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden, bool bFiltered, bool bGroups) and implement it for the Calc derivation (ScModelObj). The aim is to use it actively in LOOL instead of the interface: ITiledRenderable::getRowColumnHeaders(const tools::Rectangle& /*rRectangle*/) This is used by the LOOL to fetch the sheet geometry data for just the current view-area in the clients, so LOOL queries this everytime some client's view-area changes. Like the existing interface, the new one will provide all 'kinds' of sheet geometry info [col/row sizes(twips), hidden/filtered and grouping]. But the difference is, it generates data for the whole sheet (not view-area specific). So the method need not be queried every time the view area changes in the LOOL clients, and more importantly it enables the clients to locate any cell at any zoom level without any further help from the core. This means core needn't send various client(zoom) specific positioning messages in pixel aligned twips. It just can send all positioning messages in print twips uniformly to all clients. Change-Id: Ib6aee9a0c92746b1576ed244e98cb54b572778c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96892 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 67ce622436ee..b1732dc1bbea 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4825,6 +4825,7 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo OString aCommand(pCommand); static const OString aViewRowColumnHeaders(".uno:ViewRowColumnHeaders"); +static const OString aSheetGeometryData(".uno:SheetGeometryData"); static const OString aCellCursor(".uno:CellCursor"); static const OString aFontSubset(".uno:FontSubset="); @@ -4922,6 +4923,72 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo else return convertOUString(aHeaders); } +else if (aCommand.startsWith(aSheetGeometryData)) +{ +ITiledRenderable* pDoc = getTiledRenderable(pThis); +if (!pDoc) +{ +SetLastExceptionMsg("Document doesn't support tiled rendering"); +return nullptr; +} + +bool bColumns = true; +bool bRows = true; +bool bSizes = true; +bool bHidden = true; +bool bFiltered = true; +bool bGroups = true; +if (aCommand.getLength() > aSheetGeometryData.getLength()) +{ +bColumns = bRows = bSizes = bHidden = bFiltered = bGroups = false; + +OString aArguments = aCommand.copy(aSheetGeometryData.getLength() + 1); +sal_Int32 nParamIndex = 0; +do +{ +OString aParamToken = aArguments.getToken(0, '&', nParamIndex); +sal_Int32 nIndex = 0; +OString aKey; +OString aValue; +do +{ +OString aToken = aParamToken.getToken(0, '=', nIndex); +if (!aKey.getLength()) +aKey = aToken; +else +aValue = aToken; + +} while (nIndex >= 0); + +bool bEnableFlag = aValue.isEmpty() || +aValue.equalsIgnoreAsciiCase("true") || aValue.toInt32() > 0; +if (!bEnableFlag) +continue; + +if (aKey == "columns") +bColumns = true; +els
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - common/Message.hpp
common/Message.hpp |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 962edaafd2807f5f3a5819b5b87b147f876280f9 Author: Dennis Francis AuthorDate: Mon Jun 15 19:56:59 2020 +0530 Commit: Michael Meeks CommitDate: Tue Jun 16 11:35:35 2020 +0200 jsonString: allow json messages without white-spaces after '{' The json generated by boost::property_tree::write_json() has no white-spaces around { , : } json-characters. We use write_json() extensively in core.git. Without this patch we will need work-arounds like inserting spaces in the json strings thus generated to work with online's Message::jsonString() Change-Id: I0f0631088f4a8b727301bde449884e03163093f0 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96383 Reviewed-by: Michael Meeks Tested-by: Jenkins CollaboraOffice (cherry picked from commit bc7a0b262664032769b2dde3a31151f23ffd5235) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96417 diff --git a/common/Message.hpp b/common/Message.hpp index cb27e2c97..7bbadd172 100644 --- a/common/Message.hpp +++ b/common/Message.hpp @@ -97,7 +97,7 @@ public: /// Returns the json part of the message, if any. std::string jsonString() const { -if (_tokens.size() > 1 && _tokens[1] == "{") +if (_tokens.size() > 1 && _tokens[1].size() && _tokens[1][0] == '{') { const size_t firstTokenSize = _tokens[0].size(); return std::string(_data.data() + firstTokenSize, _data.size() - firstTokenSize); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: common/Message.hpp
common/Message.hpp |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit bc7a0b262664032769b2dde3a31151f23ffd5235 Author: Dennis Francis AuthorDate: Mon Jun 15 19:56:59 2020 +0530 Commit: Dennis Francis CommitDate: Tue Jun 16 08:02:27 2020 +0200 jsonString: allow json messages without white-spaces after '{' The json generated by boost::property_tree::write_json() has no white-spaces around { , : } json-characters. We use write_json() extensively in core.git. Without this patch we will need work-arounds like inserting spaces in the json strings thus generated to work with online's Message::jsonString() Change-Id: I0f0631088f4a8b727301bde449884e03163093f0 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96383 Reviewed-by: Michael Meeks Tested-by: Jenkins CollaboraOffice diff --git a/common/Message.hpp b/common/Message.hpp index cb27e2c97..7bbadd172 100644 --- a/common/Message.hpp +++ b/common/Message.hpp @@ -97,7 +97,7 @@ public: /// Returns the json part of the message, if any. std::string jsonString() const { -if (_tokens.size() > 1 && _tokens[1] == "{") +if (_tokens.size() > 1 && _tokens[1].size() && _tokens[1][0] == '{') { const size_t firstTokenSize = _tokens[0].size(); return std::string(_data.data() + firstTokenSize, _data.size() - firstTokenSize); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/gridwin.cxx | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) New commits: commit 0310c591eb5f4010de8f6d12298491d9c13634a3 Author: Dennis Francis AuthorDate: Fri May 1 05:39:53 2020 +0530 Commit: Dennis Francis CommitDate: Wed Jun 10 08:21:25 2020 +0200 lokit: fix autofilter window position... when client zoom is not 100%. The fix and the reasoning is same as that in lokit: fix validation dropdown's wrong position 3405f7f1b19738cad57b58259105ec87c1108466 Conflicts: sc/source/ui/view/gridwin.cxx Change-Id: I04837721d82b1e178cf5aa1130bbdaf77d13edae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93240 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit 86019fc76473cde457ecf1634bcff9df60ad7cbf) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95965 Tested-by: Jenkins diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index ce9df4fe4c33..85f2cd517085 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -628,6 +628,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) { SCTAB nTab = pViewData->GetTabNo(); ScDocument* pDoc = pViewData->GetDocument(); +bool bLOKActive = comphelper::LibreOfficeKit::isActive(); mpAutoFilterPopup.disposeAndClear(); int nColWidth = ScViewData::ToPixel(pDoc->GetColWidth(nCol, nTab), pViewData->GetPPTX()); @@ -638,7 +639,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) // If NWF renders the focus rects itself, that breaks double-buffering. mpAutoFilterPopup->RequestDoubleBuffering(true); -if (comphelper::LibreOfficeKit::isActive()) +if (bLOKActive) mpAutoFilterPopup->SetLOKNotifier(SfxViewShell::Current()); mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, AutoFilterMode::Normal)); mpAutoFilterPopup->setPopupEndAction( @@ -650,6 +651,18 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) long nSizeX = 0; long nSizeY = 0; pViewData->GetMergeSizePixel(nCol, nRow, nSizeX, nSizeY); +if (bLOKActive) +{ +// Reverse the zoom factor from aPos and nSize[X|Y] +// before letting the autofilter window convert the to twips +// with no zoom information. +double fZoomX(pViewData->GetZoomX()); +double fZoomY(pViewData->GetZoomY()); +aPos.setX(aPos.getX() / fZoomX); +aPos.setY(aPos.getY() / fZoomY); +nSizeX = nSizeX / fZoomX; +nSizeY = nSizeY / fZoomY; +} tools::Rectangle aCellRect(OutputToScreenPixel(aPos), Size(nSizeX, nSizeY)); ScDBData* pDBData = pDoc->GetDBAtCursor(nCol, nRow, nTab, ScDBDataPortion::AREA); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - sc/source sfx2/source
sc/source/ui/view/gridwin.cxx| 16 +++- sfx2/source/sidebar/SidebarDockingWindow.cxx | 11 +++ 2 files changed, 22 insertions(+), 5 deletions(-) New commits: commit cd7539be13dee445c643e43547313c57e01f9391 Author: Dennis Francis AuthorDate: Fri May 1 05:39:53 2020 +0530 Commit: Michael Meeks CommitDate: Fri May 29 22:01:57 2020 +0100 lokit: fix autofilter window position... when client zoom is not 100%. The fix and the reasoning is same as that in lokit: fix validation dropdown's wrong position 3405f7f1b19738cad57b58259105ec87c1108466 Change-Id: I04837721d82b1e178cf5aa1130bbdaf77d13edae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93240 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 4e90c3c26127..4751dcb77b63 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -627,6 +627,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) { SCTAB nTab = pViewData->GetTabNo(); ScDocument* pDoc = pViewData->GetDocument(); +bool bLOKActive = comphelper::LibreOfficeKit::isActive(); mpAutoFilterPopup.disposeAndClear(); int nColWidth = ScViewData::ToPixel(pDoc->GetColWidth(nCol, nTab), pViewData->GetPPTX()); @@ -637,7 +638,8 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) // If NWF renders the focus rects itself, that breaks double-buffering. mpAutoFilterPopup->RequestDoubleBuffering(true); -if (comphelper::LibreOfficeKit::isActive()) +mpAutoFilterPopup.reset(VclPtr::Create(this, pDoc)); +if (bLOKActive) mpAutoFilterPopup->SetLOKNotifier(SfxViewShell::Current()); mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, AutoFilterMode::Normal)); mpAutoFilterPopup->setPopupEndAction( @@ -649,6 +651,18 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) long nSizeX = 0; long nSizeY = 0; pViewData->GetMergeSizePixel(nCol, nRow, nSizeX, nSizeY); +if (bLOKActive) +{ +// Reverse the zoom factor from aPos and nSize[X|Y] +// before letting the autofilter window convert the to twips +// with no zoom information. +double fZoomX(pViewData->GetZoomX()); +double fZoomY(pViewData->GetZoomY()); +aPos.setX(aPos.getX() / fZoomX); +aPos.setY(aPos.getY() / fZoomY); +nSizeX = nSizeX / fZoomX; +nSizeY = nSizeY / fZoomY; +} tools::Rectangle aCellRect(OutputToScreenPixel(aPos), Size(nSizeX, nSizeY)); ScDBData* pDBData = pDoc->GetDBAtCursor(nCol, nRow, nTab, ScDBDataPortion::AREA); commit 1ebc370887a88bda4ffa7b213b281cb893b8ad4d Author: Ashod Nakashian AuthorDate: Sun May 10 16:34:25 2020 -0400 Commit: Michael Meeks CommitDate: Fri May 29 21:53:35 2020 +0100 sfx2: lok: separate sidebar notifications to mobile and desktop If we have two notifiers for mobile and non-mobile, we should check them separately, so we can support one without the other. Also, correctly check for null before dereferencing. Change-Id: I3f21d2f4d5d430b7c876aaf4e90d5b4e55df04ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93944 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx index 0544c998b8aa..8bb1f164c125 100644 --- a/sfx2/source/sidebar/SidebarDockingWindow.cxx +++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx @@ -58,13 +58,12 @@ public: void Invoke() override { -auto pNotifier = m_rSidebarDockingWin.GetLOKNotifier(); -auto pMobileNotifier = SfxViewShell::Current(); -if (!pNotifier || (!pMobileNotifier && !comphelper::LibreOfficeKit::isActive())) +if (!comphelper::LibreOfficeKit::isActive()) return; try { +auto pMobileNotifier = SfxViewShell::Current(); if (pMobileNotifier && pMobileNotifier->isLOKMobilePhone()) { // Mobile. @@ -81,7 +80,11 @@ public: } // Notify the sidebar is created, and its LOKWindowId, which -// is needed on both Mobile and Desktop. +// is needed on mobile phones, tablets, and desktop. +auto pNotifier = m_rSidebarDockingWin.GetLOKNotifier(); +if (!pNotifier) +return; + const Point pos(m_rSidebarDockingWin.GetOutOffXPixel(), m_rSidebarDockingWin.GetOutOffYPixel()); const OString posMessage = pos.toString(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 10 commits - chart2/source editeng/source include/editeng sc/source sfx2/source svx/sdi svx/source sw/source vcl/source
chart2/source/controller/main/ChartController_Window.cxx | 11 editeng/source/editeng/editview.cxx | 10 editeng/source/editeng/impedit.cxx | 97 --- editeng/source/editeng/impedit.hxx | 10 include/editeng/editview.hxx |2 sc/source/ui/app/inputhdl.cxx| 21 + sc/source/ui/inc/gridwin.hxx | 29 +- sc/source/ui/inc/tabview.hxx |2 sc/source/ui/inc/viewdata.hxx|2 sc/source/ui/unoobj/docuno.cxx |4 sc/source/ui/view/gridwin.cxx| 202 +++ sc/source/ui/view/gridwin4.cxx | 136 +- sc/source/ui/view/tabvwshc.cxx |2 sc/source/ui/view/viewdata.cxx |1 sfx2/source/control/unoctitm.cxx |5 svx/sdi/svx.sdi | 12 svx/source/xoutdev/xattr.cxx | 13 sw/source/uibase/shells/drawdlg.cxx | 40 ++ sw/source/uibase/shells/frmsh.cxx| 23 + vcl/source/app/help.cxx | 19 - 20 files changed, 523 insertions(+), 118 deletions(-) New commits: commit c75d894ae66c306df765315a07e0dad3e78ea60b Author: Dennis Francis AuthorDate: Tue Apr 14 14:49:23 2020 +0530 Commit: Dennis Francis CommitDate: Tue May 26 23:17:27 2020 +0530 lokit: fix edit-text/view-cursor position in case of views with heterogeneous zooms. 1. EditText render position fix The EditView has an 'output-area' which is used to clip the rectangle we pass to the Paint() call. It also holds on to the ScGridWindow instance where the edit started. The 'output-area' of the EditView is in the coordinates/units of the MapMode of the ScGridWindow it holds. So we need to temporarily change the MapMode and 'output-area' of the EditView in agreement to the device(with the current view's zoom settings) where we are going to paint to. After we call the Paint(), we rollback the original settings of the EditView. 2. EditViewCursor position fix Before this change the cursor position in twips (calculated based on pixel aligned cell position in the view where editing occurred) is broadcasted to all the client-views. If the clients have different zooms, then simply scaling this common cursor position in the client for its zoom is not going to be accurate enough (due to the non-linear Logic->Pixel->Logic transformation involving pixel rounding). This is very visible if you are editing far away from A1 (like Z50). The fix is to turn off this broadcast for calc-cell editing and send view specific edit-cursor invalidation messages. This is accompanied by a online.git patch that removes unnessecary broadcast of view-cursor invalidation messages which messes up things again. "Do not broadcast view-cursor invalidation messages" Change-Id: Ib2fbbe4b6f93f26fc85d6adaa8684dd4397d886f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92631 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks (cherry picked from commit d58f1e334245f9e136750fbba267c2a941a213cc) Conflicts: editeng/source/editeng/impedit.hxx diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index eaa9fe05e932..be91080cceb8 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -475,6 +475,16 @@ void EditView::Command( const CommandEvent& rCEvt ) pImpEditView->Command( rCEvt ); } +void EditView::SetBroadcastLOKViewCursor(bool bSet) +{ +pImpEditView->SetBroadcastLOKViewCursor(bSet); +} + +tools::Rectangle EditView::GetEditCursor() const +{ +return pImpEditView->GetEditCursor(); +} + void EditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor, bool bActivate ) { if ( pImpEditView->pEditEngine->HasView( this ) ) diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 7a2a3e412301..6c7360d41fea 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -82,6 +82,7 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, vcl::Window* pWindo eSelectionMode = EESelectionMode::Std; eAnchorMode = EEAnchorMode::TopLeft; mpEditViewCallbacks = nullptr; +mbBroadcastLOKViewCursor = comphelper::LibreOfficeKit::isActive(); nInvMore= 1; nTravelXPos = TRAVEL_X_DONTKNOW; nControl= EVControlBits::AUTOSCROLL | EVControlBits::ENABLEPASTE; @@ -914,6 +915,69 @@ OString buildHyperli
[Libreoffice-commits] core.git: Branch 'feature/calc-coordinates' - 2 commits - sc/source
sc/source/ui/docshell/docsh4.cxx | 33 +++-- sc/source/ui/inc/gridwin.hxx |3 + sc/source/ui/view/gridwin.cxx| 74 ++- sc/source/ui/view/gridwin4.cxx | 34 ++--- 4 files changed, 109 insertions(+), 35 deletions(-) New commits: commit 4f157cd93d52665ca7799f506d4832bc24e56fe6 Author: Dennis Francis AuthorDate: Mon May 25 23:53:21 2020 +0530 Commit: Dennis Francis CommitDate: Tue May 26 22:08:56 2020 +0530 lokit: scPrintTwipsMsgs: LOK_CALLBACK_COMMENT Allow print twips coordinates in LOK_CALLBACK_COMMENT Change-Id: I052dacb311c651c49d61fd9937951fa5b81b32d5 diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 226fad060971..7ead65a06037 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2499,17 +2499,28 @@ void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocu ScViewData* pViewData = GetViewData(); if (pViewData && pViewData->GetActiveWin()) { -Point aScrPos = pViewData->GetScrPos(rPos.Col(), rPos.Row(), pViewData->GetActivePart(), true); -long nSizeXPix; -long nSizeYPix; -pViewData->GetMergeSizePixel(rPos.Col(), rPos.Row(), nSizeXPix, nSizeYPix); - -const double fPPTX = pViewData->GetPPTX(); -const double fPPTY = pViewData->GetPPTY(); -tools::Rectangle aRect(Point(aScrPos.getX() / fPPTX, aScrPos.getY() / fPPTY), -Size(nSizeXPix / fPPTX, nSizeYPix / fPPTY)); - -aAnnotation.put("cellPos", aRect.toString()); +bool bInPrintTwips = comphelper::LibreOfficeKit::isCompatFlagSet( +comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs); +OString aRectString; +if (bInPrintTwips) +{ +Point aTopLeft = pViewData->GetPrintTwipsPos(rPos.Col(), rPos.Row()); +long nSizeX, nSizeY; +pViewData->GetMergeSizePrintTwips(rPos.Col(), rPos.Row(), nSizeX, nSizeY); +aRectString = tools::Rectangle(aTopLeft, Size(nSizeX, nSizeY)).toString(); +} +else +{ +Point aTopLeft = pViewData->GetScrPos(rPos.Col(), rPos.Row(), +pViewData->GetActivePart(), true); +long nSizeXPix, nSizeYPix; +pViewData->GetMergeSizePixel(rPos.Col(), rPos.Row(), nSizeXPix, nSizeYPix); +const double fPPTX = pViewData->GetPPTX(); +const double fPPTY = pViewData->GetPPTY(); +aRectString = tools::Rectangle(Point(aTopLeft.getX() / fPPTX, aTopLeft.getY() / fPPTY), + Size(nSizeXPix / fPPTX, nSizeYPix / fPPTY)).toString(); +} +aAnnotation.put("cellPos", aRectString); } } commit 11f4a63732602db6c8feb03b5252b3d99fa331ea Author: Dennis Francis AuthorDate: Mon May 25 17:55:19 2020 +0530 Commit: Dennis Francis CommitDate: Tue May 26 22:08:55 2020 +0530 lokit: scPrintTwipsMsgs: LOK_CALLBACK_*SELECTION* Allow print twips coordinates in the below messages: LOK_CALLBACK_CELL_SELECTION_AREA LOK_CALLBACK_TEXT_SELECTION LOK_CALLBACK_TEXT_VIEW_SELECTION Change-Id: I267a636bbeab434b305a45abe3e21cb5afc4c1e9 diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 5f0844a1547f..96fb7e632775 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -298,8 +298,11 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::Window, public DropTargetHel voidSelectForContextMenu( const Point& rPosPixel, SCCOL nCellX, SCROW nCellY ); voidGetSelectionRects( ::std::vector< tools::Rectangle >& rPixelRects ) const; +voidGetSelectionRectsPrintTwips(::std::vector< tools::Rectangle >& rRects) const; voidGetPixelRectsFor( const ScMarkData , ::std::vector< tools::Rectangle >& rPixelRects ) const; +voidGetRectsAnyFor(const ScMarkData , + ::std::vector< tools::Rectangle >& rRects, bool bInPrintTwips) const; voidUpdateKitSelection(const std::vector& rRectangles, std::vector* pLogicRects = nullptr); boolNeedLOKCursorInvalidation(const tools::Rectangle& rCursorRect, diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 405dd5e7de1a..7947045b3854 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5990,13 +5990,24 @@ void ScGridWindow::UpdateKitSelection(const std::vector& rRe
[Libreoffice-commits] online.git: Branch 'feature/calc-coordinates' - 35 commits - cypress_test/integration_tests kit/ChildSession.cpp kit/Kit.cpp loleaflet/css loleaflet/src wsd/LOOLWSD.cpp
Rebased ref, commits from common ancestor: commit aef75914e5f711f98e9489e64223911a6fcae45e Author: Dennis Francis AuthorDate: Sun May 24 22:58:36 2020 +0530 Commit: Dennis Francis CommitDate: Mon May 25 00:52:45 2020 +0530 Handle print-twips 'cellviewcursor' msg correctly Change-Id: I744a24aa54768f12ea8801f6ceabdd4c79fa483a diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index fde1d4796..e474ebc28 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1352,9 +1352,11 @@ L.TileLayer = L.GridLayer.extend({ var topLeftTwips = new L.Point(parseInt(strTwips[0]), parseInt(strTwips[1])); var offset = new L.Point(parseInt(strTwips[2]), parseInt(strTwips[3])); var bottomRightTwips = topLeftTwips.add(offset); + var boundsTwips = this._convertToTileTwipsSheetArea( + new L.Bounds(topLeftTwips, bottomRightTwips)); this._cellViewCursors[viewId].bounds = new L.LatLngBounds( - this._twipsToLatLng(topLeftTwips, this._map.getZoom()), - this._twipsToLatLng(bottomRightTwips, this._map.getZoom())); + this._twipsToLatLng(boundsTwips.getTopLeft(), this._map.getZoom()), + this._twipsToLatLng(boundsTwips.getBottomRight(), this._map.getZoom())); } this._cellViewCursors[viewId].part = parseInt(obj.part); commit 0c05ad4725f8c4c4365ff7a79b627cbaa1a462b3 Author: Dennis Francis AuthorDate: Sun May 24 20:34:25 2020 +0530 Commit: Dennis Francis CommitDate: Mon May 25 00:52:45 2020 +0530 Handle print-twips referencemarks msg correctly Change-Id: I53f283e267a5fd84cf3232cc346921b67d3487bc diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index f74adf613..fde1d4796 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1742,10 +1742,10 @@ L.TileLayer = L.GridLayer.extend({ for (var i = 0; i < strTwips.length; i += 4) { var topLeftTwips = new L.Point(parseInt(strTwips[i]), parseInt(strTwips[i + 1])); var offset = new L.Point(parseInt(strTwips[i + 2]), parseInt(strTwips[i + 3])); - var topRightTwips = topLeftTwips.add(new L.Point(offset.x, 0)); - var bottomLeftTwips = topLeftTwips.add(new L.Point(0, offset.y)); - var bottomRightTwips = topLeftTwips.add(offset); - rectangles.push([bottomLeftTwips, bottomRightTwips, topLeftTwips, topRightTwips]); + var boundsTwips = this._convertToTileTwipsSheetArea( + new L.Bounds(topLeftTwips, topLeftTwips.add(offset))); + rectangles.push([boundsTwips.getBottomLeft(), boundsTwips.getBottomRight(), + boundsTwips.getTopLeft(), boundsTwips.getTopRight()]); } var polygons = L.PolyUtil.rectanglesToPolygons(rectangles, this); commit 5f735f3085f53f2306edeb1d85ae9e26df9a9a55 Author: Dennis Francis AuthorDate: Sun May 24 18:26:05 2020 +0530 Commit: Dennis Francis CommitDate: Mon May 25 00:52:45 2020 +0530 Handle print-twips 'cellcursor' msg from correctly This is conditioned on the flag printTwipsMsgsEnabled. Change-Id: I61a9165a9f81ce7473c3fa6579947f34552dbdaf diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index 852df733b..e5ef90114 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -6,7 +6,9 @@ /* global */ L.CalcTileLayer = L.TileLayer.extend({ options: { - sheetGeometryDataEnabled: true + // TODO: sync these automatically from SAL_LOK_OPTIONS + sheetGeometryDataEnabled: true, + printTwipsMsgsEnabled: true }, STD_EXTRA_WIDTH: 113, /* 2mm extra for optimal width, diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index ded1b572c..f74adf613 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1132,10 +1132,11 @@ L.TileLayer = L.GridLayer.extend({ var topLeftTwips = new L.Point(parseInt(strTwips[0]), parseInt(strTwips[1])); var offset = new L.Point(parseInt(strTwips[2]), parseInt(strTwips[3])); var bottomRightTw
[Libreoffice-commits] core.git: Branch 'feature/calc-coordinates' - 53 commits - chart2/qa chart2/source chart2/workbench codemaker/source compilerplugins/clang config_host/config_skia.h.in configmgr/
Rebased ref, commits from common ancestor: commit e7546301e8569847b9236bd859792079e97e0c50 Author: Dennis Francis AuthorDate: Sun May 24 22:40:51 2020 +0530 Commit: Dennis Francis CommitDate: Mon May 25 00:40:01 2020 +0530 lokit: scPrintTwipsMsgs: LOK_CALLBACK_CELL_VIEW_CURSOR Allow print twips coordinates in LOK_CALLBACK_CELL_VIEW_CURSOR Change-Id: I0373cbd2b87b4d1088af41453ab548274de6ca23 diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index b1da568c3128..405dd5e7de1a 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5754,8 +5754,13 @@ void ScGridWindow::notifyKitCellViewCursor(const SfxViewShell* pForShell) const assert(pForTabView); if (!pForTabView) return; -aCursor = pForTabView->GetViewData().describeCellCursorAt( -pViewData->GetCurX(), pViewData->GetCurY()); // our position. + +if (comphelper::LibreOfficeKit::isCompatFlagSet( +comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs)) +aCursor = pViewData->describeCellCursorInPrintTwips(); +else +aCursor = pForTabView->GetViewData().describeCellCursorAt( +pViewData->GetCurX(), pViewData->GetCurY()); // our position. } SfxLokHelper::notifyOtherView(pViewShell, pForShell, LOK_CALLBACK_CELL_VIEW_CURSOR, "rectangle", aCursor); } @@ -5765,9 +5770,33 @@ void ScGridWindow::notifyKitCellViewCursor(const SfxViewShell* pForShell) const // event, and others a cell_view_cursor event. // // NB. we need to re-construct the cursor details for each other view in their -// own zoomed co-ordinate system. +// own zoomed co-ordinate system (but not in scPrintTwipsMsgs mode). void ScGridWindow::updateKitCellCursor(const SfxViewShell* pForShell) const { +if (comphelper::LibreOfficeKit::isCompatFlagSet( +comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs)) +{ +ScTabViewShell* pViewShell = pViewData->GetViewShell(); +// Generate the cursor info string just once and directly send to all. +// Calling notifyKitCellViewCursor() would regenerate the +// cursor-string unnecessarily. +OString aCursor = getCellCursor(); + +if (pForShell) +{ +SfxLokHelper::notifyOtherView(pViewShell, pForShell, +LOK_CALLBACK_CELL_VIEW_CURSOR, "rectangle", aCursor); +} +else +{ +notifyKitCellCursor(); +SfxLokHelper::notifyOtherViews(pViewShell, +LOK_CALLBACK_CELL_VIEW_CURSOR, "rectangle", aCursor); +} + +return; +} + if (!pForShell) { for (SfxViewShell* it = SfxViewShell::GetFirst(); it; commit 07cb2b5b8ab7624868e19e0aa687d36195400fd7 Author: Dennis Francis AuthorDate: Sun May 24 20:31:52 2020 +0530 Commit: Dennis Francis CommitDate: Mon May 25 00:40:01 2020 +0530 lokit: scPrintTwipsMsgs: LOK_CALLBACK_REFERENCE_MARKS Allow print twips coordinates in LOK_CALLBACK_REFERENCE_MARKS Change-Id: I1bf84c5aebe84ee034ac27932fa8a01d0a3ae831 diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 83079851a552..6f66e14e9b68 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -434,6 +434,25 @@ ReferenceMark ScInputHandler::GetReferenceMark( ScViewData& rViewData, ScDocShel { ScSplitPos eWhich = rViewData.GetActivePart(); +// This method is LOK specific. +if (comphelper::LibreOfficeKit::isCompatFlagSet( +comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs)) +{ +SCCOL nCol1 = nX1, nCol2 = nX2; +SCROW nRow1 = nY1, nRow2 = nY2; +PutInOrder(nCol1, nCol2); +PutInOrder(nRow1, nRow2); +if (nCol1 == nCol2 && nRow1 == nRow2) +pDocSh->GetDocument().ExtendMerge(nCol1, nRow1, nCol2, nRow2, nTab); + +Point aTopLeft = rViewData.GetPrintTwipsPos(nCol1, nRow1); +Point aBottomRight = rViewData.GetPrintTwipsPos(nCol2 + 1, nRow2 + 1); +long nSizeX = aBottomRight.X() - aTopLeft.X() - 1; +long nSizeY = aBottomRight.Y() - aTopLeft.Y() - 1; + +return ReferenceMark(aTopLeft.X(), aTopLeft.Y(), nSizeX, nSizeY, nTab, rColor); +} + Point aScrPos = rViewData.GetScrPos( nX1, nY1, eWhich ); long nScrX = aScrPos.X(); long nScrY = aScrPos.Y(); commit 69a8d8bb6bbeb0e94fe7c4d0314ca937dad52c34 Author: Dennis Francis AuthorDate: Sun May 24 17:21:59 2020 +0530 Commit: Dennis Francis CommitDate: Mon May 25 00:40:00 2020 +0530 lokit: do not set an artificial cursor size when it is zero... when we send the message in print twips coordinates. It is important for the client to know the exact position and coordinates to allow client side print-twips -> tile-twips conversion when/if it
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 6 commits - basegfx/source cui/source drawinglayer/source include/basegfx include/vcl sc/source vcl/headless vcl/inc vcl/opengl vcl/q
basegfx/source/tools/systemdependentdata.cxx| 59 cui/source/dialogs/screenshotannotationdlg.cxx |1 drawinglayer/source/primitive2d/polygonprimitive2d.cxx |2 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 92 - include/basegfx/polygon/b2dlinegeometry.hxx |3 include/basegfx/polygon/b2dpolygon.hxx | 10 include/basegfx/polygon/b2dpolypolygon.hxx | 10 include/vcl/outdev.hxx |1 sc/source/ui/view/gridwin.cxx | 22 vcl/headless/svpgdi.cxx | 278 ++- vcl/inc/headless/svpgdi.hxx |2 vcl/inc/openglgdiimpl.hxx |1 vcl/inc/qt5/Qt5Graphics.hxx |7 vcl/inc/quartz/salgdi.h |1 vcl/inc/salgdi.hxx |2 vcl/inc/salgdiimpl.hxx |1 vcl/inc/skia/gdiimpl.hxx| 286 +++ vcl/inc/unx/genpspgraphics.h|1 vcl/inc/unx/salgdi.h|1 vcl/inc/win/salbmp.h| 10 vcl/inc/win/salgdi.h|1 vcl/opengl/gdiimpl.cxx | 70 vcl/qt5/Qt5Graphics_GDI.cxx | 50 vcl/quartz/salgdicommon.cxx | 72 vcl/skia/gdiimpl.cxx| 1287 vcl/source/gdi/FileDefinitionWidgetDraw.cxx |4 vcl/source/gdi/salgdilayout.cxx |4 vcl/source/outdev/line.cxx |2 vcl/source/outdev/polygon.cxx |3 vcl/source/outdev/polyline.cxx |5 vcl/source/outdev/textline.cxx | 13 vcl/source/outdev/transparent.cxx |2 vcl/unx/generic/gdi/gdiimpl.cxx | 90 + vcl/unx/generic/gdi/gdiimpl.hxx |1 vcl/unx/generic/gdi/salgdi.cxx |3 vcl/unx/generic/print/genpspgraphics.cxx|1 vcl/win/gdi/gdiimpl.cxx | 102 + vcl/win/gdi/gdiimpl.hxx |1 vcl/win/gdi/salgdi_gdiplus.cxx |2 39 files changed, 2218 insertions(+), 285 deletions(-) New commits: commit 19ab4ebce6750792274c9b6e9bbf07b987f6037f Author: Dennis Francis AuthorDate: Sun Apr 26 05:38:01 2020 +0530 Commit: Michael Meeks CommitDate: Sat May 23 17:28:21 2020 +0100 lokit: trim validation dropdown height to content The validation dropdown looks ugly for lists with small number of items as its height is hardcoded to SC_FILTERLISTBOX_LINES(=12) * TextHeight Instead lets use the number of entries in the list to determine the height if this count is less than SC_FILTERLISTBOX_LINES Change-Id: If026140044e6665159cd616c13a2eb57356ae53f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92914 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit adf10bae8aecd8b765a21660b31056292276bdb2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93066 Tested-by: Jenkins diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index a52f07ef43db..996e7c90b787 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1129,9 +1129,13 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) // minimum width in pixel const long nMinLOKWinWidth = static_cast(1.3 * STD_COL_WIDTH * pViewData->GetPPTX()); -if (comphelper::LibreOfficeKit::isActive() && nSizeX < nMinLOKWinWidth) +bool bLOKActive = comphelper::LibreOfficeKit::isActive(); +if (bLOKActive && nSizeX < nMinLOKWinWidth) nSizeX = nMinLOKWinWidth; +if (bLOKActive && aStrings.size() < SC_FILTERLISTBOX_LINES) +nHeight = nHeight * (aStrings.size() + 1) / SC_FILTERLISTBOX_LINES; + Size aParentSize = GetParent()->GetOutputSizePixel(); Size aSize( nSizeX, nHeight ); commit 7738ef73fbffb806bc7eec77b825391ff066e86e Author: Dennis Francis AuthorDate: Sun Apr 26 04:56:11 2020 +0530 Commit: Michael Meeks CommitDate: Sat May 23 17:27:58 2020 +0100 lokit: fix validation dropdown's wrong position Reverse the zoom scale on the position of the dropdown before letting the vcl::FloatingWindow convert this to twips without any scale information. Without this reverse scaling, the dropdown will be incorrect due to double application of the same
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - desktop/source sc/source
desktop/source/lib/init.cxx | 10 ++ sc/source/ui/view/output.cxx |9 + 2 files changed, 15 insertions(+), 4 deletions(-) New commits: commit be84f24a42ee0b5b94a0daa75cc01c053bb76881 Author: Dennis Francis AuthorDate: Wed Apr 1 20:20:19 2020 +0530 Commit: Andras Timar CommitDate: Mon May 18 17:17:14 2020 +0200 tdf#127158 :lokit: preload liblocaledata_others.so ...even if LOK_WHITELIST_LANGUAGES does not contain an Asian language. Not preloading this module causes locale-fallbacks for example when a calc-cell with Asian locale has some date with number-formatting, LOOL displays the date with the fallback locale(en_US). (more details in comments) Change-Id: Id8a31565f7f0f0262c044028f55fdf4fe33ecec8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91510 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index c86b2eb72dd4..ddb42e0f3860 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -93,6 +93,8 @@ #include #include +#include +#include #include #include @@ -5722,6 +5724,14 @@ static void preloadData() } std::cerr << "\n"; +// Hack to load and cache the module liblocaledata_others.so which is not loaded normally +// (when loading dictionaries of just non-Asian locales). Creating a XCalendar4 of one Asian locale +// will cheaply load this missing "others" locale library. Appending an Asian locale in +// LOK_WHITELIST_LANGUAGES env-var also works but at the cost of loading that dictionary. +css::uno::Reference< css::i18n::XCalendar4 > xCal = css::i18n::LocaleCalendar2::create(comphelper::getProcessComponentContext()); +css::lang::Locale aAsianLocale = {"hi", "IN", ""}; +xCal->loadDefaultCalendar(aAsianLocale); + // preload all available thesauri css::uno::Reference xThesaurus(xLngSvcMgr->getThesaurus()); css::uno::Reference xThesLocales(xSpellChecker, css::uno::UNO_QUERY_THROW); commit 3c4e4cc92d0850d53b2a875bc4ffd09883521c7f Author: Dennis Francis AuthorDate: Tue Jan 21 22:11:19 2020 +0530 Commit: Andras Timar CommitDate: Mon May 18 17:17:13 2020 +0200 tdf#130112 lok: Do not apply zoom-factor twice... ... in ScOutputData::FillReferenceMarks(). mnPPT[XY] already has the factor aZoom[XY] in it. Refer ScViewData::CalcPPT() to see how PPT[XY] are derived. Change-Id: I3f9b5c01cb53514450fad5f7b2b6861b112effdb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87158 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks (cherry picked from commit 3f62c10548466119ec6b1a662ab339e5dbe0b05f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87170 Tested-by: Jenkins Reviewed-by: Dennis Francis diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index e14647bd7954..ced84e795ecd 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -1958,10 +1958,11 @@ ReferenceMark ScOutputData::FillReferenceMark( SCCOL nRefStartX, SCROW nRefStart if (bTop && bBottom && bLeft && bRight) { -aResult = ReferenceMark( nMinX / mnPPTX * double( aZoomX ), - nMinY / mnPPTY * double( aZoomY ), - ( nMaxX - nMinX ) / mnPPTX * double( aZoomX ), - ( nMaxY - nMinY ) / mnPPTY * double( aZoomY ), +// mnPPT[XY] already has the factor aZoom[XY] in it. +aResult = ReferenceMark( nMinX / mnPPTX, + nMinY / mnPPTY, + ( nMaxX - nMinX ) / mnPPTX, + ( nMaxY - nMinY ) / mnPPTY, nTab, rColor ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'feature/calc-coordinates' - 17 commits - loleaflet/src
Rebased ref, commits from common ancestor: commit 258ea819be684e7de102fd8b3c0bc9fe4eb01b91 Author: Dennis Francis AuthorDate: Sat May 16 18:36:04 2020 +0530 Commit: Dennis Francis CommitDate: Sun May 17 17:34:22 2020 +0530 Initialize outlines ds on empty outline Change-Id: If845991272a05f026fad7819d39ff4b23622abae diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index 272db0cb9..096ba66c4 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -1469,6 +1469,7 @@ L.DimensionOutlines = L.Class.extend({ var levels = encoding.split(' '); if (levels.length < 2) { // No outline. + this._outlines = []; return true; } commit 65c255d8722bdb1dc1da068de2d9de51730f5749 Author: Dennis Francis AuthorDate: Sat May 16 18:07:56 2020 +0530 Commit: Dennis Francis CommitDate: Sun May 17 17:34:22 2020 +0530 call refreshViewData() on setpart message... if the part is not hidden. The member _selectedPart is already set to the new part in Parts.js's setPart(), as a result the code inside the if was never getting executed. There is no need to call map.setPart() as this was also done in Parts.js setPart(), and finally there are no handler for 'setpart' event as of now, so lets remove the fire() call too. All of this was not a problem when the '.uno:ViewRowColumnHeader' data source was used, because that data was getting requested unintentionally as part of related scroll events during a sheet switch. Change-Id: I3ea3916ba738d9616e822659fc64903eda8f99cf diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index 2b29e734b..272db0cb9 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -364,9 +364,7 @@ L.CalcTileLayer = L.TileLayer.extend({ _onSetPartMsg: function (textMsg) { var part = parseInt(textMsg.match(/\d+/g)[0]); - if (part !== this._selectedPart && !this.isHiddenPart(part)) { - this._map.setPart(part, true); - this._map.fire('setpart', {selectedPart: this._selectedPart}); + if (!this.isHiddenPart(part)) { this.refreshViewData(undefined, true /* sheetGeometryChanged */); } }, commit ac8f72f6cc14b89a5bb7cb2b5b2a670e5e96e1b1 Author: Dennis Francis AuthorDate: Sat May 16 16:41:29 2020 +0530 Commit: Dennis Francis CommitDate: Sun May 17 17:34:22 2020 +0530 Add ability to get first match in binarySearch (more details in the comments) This can help in a corner case (very improbable though) when we query for the exact end-position of a span with trailing empty span. Lets do the right thing, even if that does happen only extremely rarely. Change-Id: Ib1370811c257e6ef3d52d29caf2963641bad8e40 diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index cfadbb2be..2b29e734b 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -1300,7 +1300,9 @@ L.SpanList = L.Class.extend({ } return (testValue < valueStart) ? -1 : (valueEnd < testValue) ? 1 : 0; - }); + }, true /* find the first match in case of duplicates */); + // About the last argument: duplicates can happen, for instance if the + // custom field represents positions, and there are spans with zero sizes (hidden/filtered). } }); @@ -1582,6 +1584,9 @@ L.DimensionOutlines = L.Class.extend({ // Of course, this assumes that the array is sorted (w.r.t to the semantics of // the directionProvider when it is provided). // It returns the index of the match if successful else returns -1. +// 'firstMatch' if true, some additional work is done to ensure that the index of +// the first match (from the 0 index of the array) is returned in case there are +// duplicates. // // directionProvider will be provided the following parameters : // (key, previousArrayElement, currentArrayElement, nextArrayElement) @@ -1592,19 +1597,21 @@ L.DimensionOutlines = L.Class.extend({ // 1: to try searching upper half, // -1: to try searching lower half -function binarySearch(array, key, directionProvider) { +function binarySearch(array, key, directionProvider, firstMatch) { if (!Array.isArray(array) || !array.length) { return -1; } if (typeof directionProvider != 'function') { - directionProvider = function (key, testvalue) { +
[Libreoffice-commits] online.git: Changes to 'feature/calc-coordinates'
New branch 'feature/calc-coordinates' available with the following commits: commit fd906af8060d786516f0a5b2c53c86d4a74d2306 Author: Dennis Francis Date: Sat May 16 18:36:04 2020 +0530 Initialize outlines ds on empty outline Change-Id: If845991272a05f026fad7819d39ff4b23622abae commit 0322608d0f85a988c62e4e498e6087eafc7f4eed Author: Dennis Francis Date: Sat May 16 18:07:56 2020 +0530 call refreshViewData() on setpart message... if the part is not hidden. The member _selectedPart is already set to the new part in Parts.js's setPart(), as a result the code inside the if was never getting executed. There is no need to call map.setPart() as this was also done in Parts.js setPart(), and finally there are no handler for 'setpart' event as of now, so lets remove the fire() call too. All of this was not a problem when the '.uno:ViewRowColumnHeader' data source was used, because that data was getting requested unintentionally as part of related scroll events during a sheet switch. Change-Id: I3ea3916ba738d9616e822659fc64903eda8f99cf commit d8df7c1e314b8bf9131d998af7a5a0dfee7299b8 Author: Dennis Francis Date: Sat May 16 16:41:29 2020 +0530 Add ability to get first match in binarySearch (more details in the comments) This can help in a corner case (very improbable though) when we query for the exact end-position of a span with trailing empty span. Lets do the right thing, even if that does happen only extremely rarely. Change-Id: Ib1370811c257e6ef3d52d29caf2963641bad8e40 commit cc349b742513ce175d54351e2f0ba0da0a5c34a5 Author: Dennis Francis Date: Sat May 16 15:09:51 2020 +0530 Make the newly added interfaces more robust against wrong argument counts/types. Change-Id: Ibfed2ba4f3e907ef8a038a3b13b3081cc6248c20 commit 2c6413f209a862a2b7cf06bdf25ba05a19d837d6 Author: Dennis Francis Date: Sat May 16 14:12:10 2020 +0530 Reuse binarySearch routine in L.SpanList search functions Change-Id: I2f5411ef4da6b236978c08e3ea03ee05f9c8dabc commit 7f8bbe6cfb1a261bf1f082b9c955f938eb3eb3bb Author: Dennis Francis Date: Sat May 16 11:14:17 2020 +0530 Restore the scope of 'offset' tampering code as it was before 317afcecb4 This 'adjustment' was just meant for refreshViewData() or whatever it was called before, to indicate that both column/row headers/gridlines should be updated, no matter what the actual offset is (probably only meant for zoom changes?). The offset passed to refreshViewData is only going to be used as a boolean flag. This patch fixes the row/col headers getting a off-by-one pixel when changing zooms with the new data-source (.uno:SheetGeometryData). If using the older source (.uno:ViewRowColumnHeader), this bug is hidden because of the delay for fetching the JSON everytime before painting the headers. TODO: Refactor all calls of refreshViewData to get rid of the 'offset' and this adjustment code and only send the boolean flags to refreshViewData(). Change-Id: I4c30e8f06a6a2d58b9a9a89e283d7a214d00b99c commit 1b91a8d16f61698acf21820805a4e342eb8df268 Author: Dennis Francis Date: Fri May 15 23:12:16 2020 +0530 enforce bound-checks on setViewArea() Change-Id: Ic129181095c301ce27421bac5d3f1f94d1932248 commit 85b687bf8721e72ef374689e6f30ac592d527f2a Author: Dennis Francis Date: Fri May 15 22:43:19 2020 +0530 call refreshViewData after 'scrolloffset' is fired otherwise the header controls won't have the right position info when refreshViewData causes an ~immediate header/gridline rendering (.uno:SheetGeometryData source). This was not a problem in case of .uno:ViewRowColumnHeader source, because of the roundtrip delay for getting the msg from core. Change-Id: I48298dbfb8d62acc64adbfd662a5304b856d702a commit 4abb6c004cd46dc8f062e455053562f80e23c5a2 Author: Dennis Francis Date: Fri May 15 22:05:44 2020 +0530 Don't ask core for sheet-geometry data for invalidateheader msgs We may need to have a dedicated sheetgeometrychanged msg for geometry changes like change of col/row sizes, hidden/filtered, groups/outline states. Change-Id: I45a8038546c66797aed4b58f11c6450cbe6e2965 commit 7887f9c537fb94e5d5e50f9a9c5f03d5d219337a Author: Dennis Francis Date: Fri May 15 08:12:03 2020 +0530 use SheetGeometry data to draw headers/gridlines if enabled Change-Id: If146512a50c24f5fd81f6df7e0a3746f70bf21f9 commit 238d9f5d0984732be914ee25192f81d1e6081148 Author: Dennis Francis Date: Thu May 14 23:11:07 2020 +0530 Round down when computing row/col index from tile-twips position And lets not unnecessarily extend the cellrange in the view as the computation is accurate. Change-Id: I62de80ce42430c62a399d4e39bafab7896217bf1 commit
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 4 commits - bin/lo-all-static-libs chart2/source sc/source sw/source
bin/lo-all-static-libs |1 + chart2/source/controller/main/ControllerCommandDispatch.cxx | 10 ++ sc/source/ui/view/tabvwshb.cxx |5 - sw/source/uibase/shells/drwtxtsh.cxx|2 +- sw/source/uibase/uiview/viewdraw.cxx|2 ++ 5 files changed, 18 insertions(+), 2 deletions(-) New commits: commit acbb1b92d53ba77528b941254e5a08b3a39a89b4 Author: Dennis Francis AuthorDate: Tue Mar 24 18:26:16 2020 +0530 Commit: Michael Meeks CommitDate: Sat May 16 19:46:42 2020 +0100 lokit: Mark document as modified on chart insert/edit... immediately at least in the case when LOKit is active. This is to allow prompt emission of .uno:ModifiedStatus=true statechange message from lokit to the client. Without this, in online the chart insert/modify related changes may not get saved on client exit. (cherry picked from commit 75adb624dfff4659e6f3099a1720fbd697560f9c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91036 Tested-by: Jenkins Reviewed-by: Dennis Francis Change-Id: I8c38a37cc455f74a70d43b6aaa3e5035b283d47f diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index f8474959a619..4508a83adb4d 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -36,6 +36,9 @@ #include #include #include +#include +#include +#include #include #include @@ -806,6 +809,13 @@ void SAL_CALL ControllerCommandDispatch::modified( const lang::EventObject& aEve if( bUpdateCommandAvailability ) updateCommandAvailability(); +if (comphelper::LibreOfficeKit::isActive()) +{ +if (SfxViewShell* pViewShell = SfxViewShell::Current()) +if (SfxObjectShell* pObjSh = pViewShell->GetObjectShell()) +pObjSh->SetModified(); +} + CommandDispatch::modified( aEvent ); } diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 967f18f7f280..614dc1a3a083 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -362,7 +362,10 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) break; case SID_INSERT_DIAGRAM: -FuInsertChart(*this, pWin, pView, pDrModel, rReq, LINK( this, ScTabViewShell, DialogClosedHdl )); +FuInsertChart(*this, pWin, pView, pDrModel, rReq, + LINK( this, ScTabViewShell, DialogClosedHdl )); +if (comphelper::LibreOfficeKit::isActive()) +pDocSh->SetModified(); break; case SID_INSERT_OBJECT: commit 4306eb8775e322c6ff0fd52f9b099723ac1a35a5 Author: Ashod Nakashian AuthorDate: Sun Mar 22 11:45:08 2020 -0400 Commit: Michael Meeks CommitDate: Sat May 16 19:45:33 2020 +0100 sw: keep the cursor visible after creating SwDrawTextShell For some mysterious reason the cursor was forced to become hidden after creating SwDrawTextShell, which is used to edit the text on shapes. Doing this didn't have a negative effect on desktop, because the cursor was shown anyway at a later point. However, for LOK, the cursor was not restored. This was unexpected as the clients didn't know editing was possible (and on mobile wouldn't even show the keyboard). There doesn't seem to be any ill-effect to leaving the cursor enabled in all cases after creating an SwDrawTextShell instance. Change-Id: Ifae8d533ef48b2146a451d58d729e46f5248be71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90897 Tested-by: Jenkins CollaboraOffice Reviewed-by: Ashod Nakashian (cherry picked from commit a50d20b114b4d418cebb968af4b40645dfac087a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90947 Tested-by: Jenkins diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index 674ed73378bf..9715313196e6 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -130,9 +130,9 @@ SwDrawTextShell::SwDrawTextShell(SwView ) : SwWrtShell = GetShell(); SetPool(rSh.GetAttrPool().GetSecondaryPool()); +// Initialize and show cursor to start editing. Init(); -rSh.NoEdit(); SetName("ObjectText"); SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::DrawText)); } commit 82f79a4158ef5a6796f622bb535f15a0615aa29e Author: Ashod Nakashian AuthorDate: Sat Mar 21 11:48:40 2020 -0400 Commit: Michael Meeks CommitDate: Sat May 16 19:45:20 2020 +0100 sw: check for null SdrObject before accessing Change-Id: I30f1cc658450982232feea10dbe9c5bfefe07d91 Reviewed-on: https://gerrit.lib
[Libreoffice-commits] core.git: Changes to 'feature/calc-coordinates'
New branch 'feature/calc-coordinates' available with the following commits: commit 146b18e04d5cfd0e5b6cda124e2407264ea08029 Author: Dennis Francis Date: Fri May 8 13:27:50 2020 +0530 Unit tests for ITiledRenderable::getSheetGeometryData() (Testing of groups/ouline case is not included) Change-Id: Ia53e5489c376d2d86461a9fd3db4f5b7dc963b99 commit 517e7d1058c6676a2e1e35077b1b865c9c9cf7d7 Author: Dennis Francis Date: Tue May 5 01:55:37 2020 +0530 Introduce ITiledRenderable::getSheetGeometryData() ITiledRenderable::getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden, bool bFiltered, bool bGroups) and implement it for the Calc derivation (ScModelObj). The aim is to use it actively in LOOL instead of the interface: ITiledRenderable::getRowColumnHeaders(const tools::Rectangle& /*rRectangle*/) This is used by the LOOL to fetch the sheet geometry data for just the current view-area in the clients, so LOOL queries this everytime some client's view-area changes. Like the existing interface, the new one will provide all 'kinds' of sheet geometry info [col/row sizes(twips), hidden/filtered and grouping]. But the difference is, it generates data for the whole sheet (not view-area specific). So the method need not be queried every time the view area changes in the LOOL clients, and more importantly it enables the clients to locate any cell at any zoom level without any further help from the core. This means core needn't send various client(zoom) specific positioning messages in pixel aligned twips. It just can send all positioning messages in print twips uniformly to all clients. Change-Id: Ib6aee9a0c92746b1576ed244e98cb54b572778c0 improvements: squash to 9d11daebb Change-Id: I55eafcde514573c3701756da6e7c888a2faaa6e7 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/gridwin.cxx | 23 +++ 1 file changed, 3 insertions(+), 20 deletions(-) New commits: commit a202f29155aa60e479774a0972a88e232394a85e Author: Dennis Francis AuthorDate: Fri May 1 04:23:09 2020 +0530 Commit: Dennis Francis CommitDate: Fri May 1 07:28:27 2020 +0200 Revert "lokit: scale the validation dropdown with client zoom" The scaling of the float window containg the listbox is unfortunately far from ideal at certain zoom levels and entry sizes. There are issues like too much extra spaces around the entries and around scrollbar if present. These issues need more work to fix. Until then lets revert this. Another issue is that we don't really want to zoom adjust any popups in mobile or android as this does not match the design of jsdialogs. This reverts the commit : 7787bac16cbe63698f56a9a70d9b1b217f3ea860 (master) a87e78df635d4a8e745bfffcf33d022d2a498afa (cp62) Change-Id: Ic31040b491e25b5113dfc8e70d3f73de204862e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93239 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit 84200fc5e1b807629de2d975acaa3ffb81640d1f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93137 Tested-by: Jenkins diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 59a4d6b60d35..26c2d6eb7b7f 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1073,7 +1073,6 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich ); bool bLOKActive = comphelper::LibreOfficeKit::isActive(); -double fListWindowZoom = 1.0; if (bLOKActive) { @@ -1086,17 +1085,8 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) double fZoomY(pViewData->GetZoomY()); aPos.setX(aPos.getX() / fZoomX); aPos.setY(aPos.getY() / fZoomY); -// Reverse the zooms from sizes too -// nSizeX : because we need to rescale with another (trimmed) zoom level below. nSizeX = nSizeX / fZoomX; -// nSizeY : because this is used by vcl::FloatingWindow later to compute its vertical position -// since we pass the flag FloatWinPopupFlags::Down setup the popup. nSizeY = nSizeY / fZoomY; -// Limit zoom scale for Listwindow in the dropdown. -fListWindowZoom = std::max(std::min(fZoomY, 2.0), 0.5); -// nSizeX is only used in setting the width of dropdown, so rescale with -// the trimmed zoom. -nSizeX = nSizeX * fListWindowZoom; } if ( bLayoutRTL ) @@ -1114,8 +1104,6 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) } mpFilterFloat->SetPopupModeEndHdl(LINK( this, ScGridWindow, PopupModeEndHdl)); mpFilterBox.reset(VclPtr::Create(mpFilterFloat.get(), this, nCol, nRow, ScFilterBoxMode::DataSelect)); -if (bLOKActive) -mpFilterBox->SetZoom(Fraction(fListWindowZoom)); // Fix for bug fdo#44925 if (AllSettings::GetLayoutRTL() != bLayoutRTL) mpFilterBox->EnableMirroring(); @@ -1150,17 +1138,12 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) //! Check first if the entries fit (width) // minimum width in pixel -const long nMinLOKWinWidth = static_cast(1.3 * STD_COL_WIDTH * pViewData->GetPPTX()); +const long nMinLOKWinWidth = static_cast(1.3 * STD_COL_WIDTH / TWIPS_PER_PIXEL); if (bLOKActive && nSizeX < nMinLOKWinWidth) nSizeX = nMinLOKWinWidth; -if (bLOKActive) -{ -if (aStrings.size() < SC_FILTERLISTBOX_LINES) -nHeight = nHeight * (aStrings.size() + 1) / SC_FILTERLISTBOX_LINES; - -nHeight = nHeight * fListWindowZoom; -} +if (bLOKActive && aStrings.size() < SC_FILTERLISTBOX_LINES) +nHeight = nHeight * (aStrings.size() + 1) / SC_FILTERLISTBOX_LINES; Size aParentSize = GetParent()->GetOutputSizePixel(); Size aSize( nSizeX, nHeight ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source
sc/source/ui/view/gridwin.cxx | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) New commits: commit 86019fc76473cde457ecf1634bcff9df60ad7cbf Author: Dennis Francis AuthorDate: Fri May 1 05:39:53 2020 +0530 Commit: Dennis Francis CommitDate: Fri May 1 06:44:23 2020 +0200 lokit: fix autofilter window position... when client zoom is not 100%. The fix and the reasoning is same as that in lokit: fix validation dropdown's wrong position 3405f7f1b19738cad57b58259105ec87c1108466 Change-Id: I04837721d82b1e178cf5aa1130bbdaf77d13edae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93240 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 97a73632ee22..c0fd0034c55c 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -641,10 +641,11 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) { SCTAB nTab = pViewData->GetTabNo(); ScDocument* pDoc = pViewData->GetDocument(); +bool bLOKActive = comphelper::LibreOfficeKit::isActive(); mpAutoFilterPopup.disposeAndClear(); mpAutoFilterPopup.reset(VclPtr::Create(this, pDoc)); -if (comphelper::LibreOfficeKit::isActive()) +if (bLOKActive) mpAutoFilterPopup->SetLOKNotifier(SfxViewShell::Current()); mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, AutoFilterMode::Normal)); mpAutoFilterPopup->setPopupEndAction( @@ -656,6 +657,18 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) long nSizeX = 0; long nSizeY = 0; pViewData->GetMergeSizePixel(nCol, nRow, nSizeX, nSizeY); +if (bLOKActive) +{ +// Reverse the zoom factor from aPos and nSize[X|Y] +// before letting the autofilter window convert the to twips +// with no zoom information. +double fZoomX(pViewData->GetZoomX()); +double fZoomY(pViewData->GetZoomY()); +aPos.setX(aPos.getX() / fZoomX); +aPos.setY(aPos.getY() / fZoomY); +nSizeX = nSizeX / fZoomX; +nSizeY = nSizeY / fZoomY; +} tools::Rectangle aCellRect(OutputToScreenPixel(aPos), Size(nSizeX, nSizeY)); ScDBData* pDBData = pDoc->GetDBAtCursor(nCol, nRow, nTab, ScDBDataPortion::AREA); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source
sc/source/ui/view/gridwin.cxx | 23 +++ 1 file changed, 3 insertions(+), 20 deletions(-) New commits: commit 84200fc5e1b807629de2d975acaa3ffb81640d1f Author: Dennis Francis AuthorDate: Fri May 1 04:23:09 2020 +0530 Commit: Dennis Francis CommitDate: Fri May 1 06:38:13 2020 +0200 Revert "lokit: scale the validation dropdown with client zoom" The scaling of the float window containg the listbox is unfortunately far from ideal at certain zoom levels and entry sizes. There are issues like too much extra spaces around the entries and around scrollbar if present. These issues need more work to fix. Until then lets revert this. Another issue is that we don't really want to zoom adjust any popups in mobile or android as this does not match the design of jsdialogs. This reverts the commit : 7787bac16cbe63698f56a9a70d9b1b217f3ea860 (master) a87e78df635d4a8e745bfffcf33d022d2a498afa (cp62) Change-Id: Ic31040b491e25b5113dfc8e70d3f73de204862e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93239 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 14d96448f283..97a73632ee22 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1062,7 +1062,6 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich ); bool bLOKActive = comphelper::LibreOfficeKit::isActive(); -double fListWindowZoom = 1.0; if (bLOKActive) { @@ -1075,17 +1074,8 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) double fZoomY(pViewData->GetZoomY()); aPos.setX(aPos.getX() / fZoomX); aPos.setY(aPos.getY() / fZoomY); -// Reverse the zooms from sizes too -// nSizeX : because we need to rescale with another (trimmed) zoom level below. nSizeX = nSizeX / fZoomX; -// nSizeY : because this is used by vcl::FloatingWindow later to compute its vertical position -// since we pass the flag FloatWinPopupFlags::Down setup the popup. nSizeY = nSizeY / fZoomY; -// Limit zoom scale for Listwindow in the dropdown. -fListWindowZoom = std::max(std::min(fZoomY, 2.0), 0.5); -// nSizeX is only used in setting the width of dropdown, so rescale with -// the trimmed zoom. -nSizeX = nSizeX * fListWindowZoom; } if ( bLayoutRTL ) @@ -1103,8 +1093,6 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) } mpFilterFloat->SetPopupModeEndHdl(LINK( this, ScGridWindow, PopupModeEndHdl)); mpFilterBox.reset(VclPtr::Create(mpFilterFloat.get(), this, nCol, nRow, ScFilterBoxMode::DataSelect)); -if (bLOKActive) -mpFilterBox->SetZoom(Fraction(fListWindowZoom)); // Fix for bug fdo#44925 if (AllSettings::GetLayoutRTL() != bLayoutRTL) mpFilterBox->EnableMirroring(); @@ -1139,17 +1127,12 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) //! Check first if the entries fit (width) // minimum width in pixel -const long nMinLOKWinWidth = static_cast(1.3 * STD_COL_WIDTH * pViewData->GetPPTX()); +const long nMinLOKWinWidth = static_cast(1.3 * STD_COL_WIDTH / TWIPS_PER_PIXEL); if (bLOKActive && nSizeX < nMinLOKWinWidth) nSizeX = nMinLOKWinWidth; -if (bLOKActive) -{ -if (aStrings.size() < SC_FILTERLISTBOX_LINES) -nHeight = nHeight * (aStrings.size() + 1) / SC_FILTERLISTBOX_LINES; - -nHeight = nHeight * fListWindowZoom; -} +if (bLOKActive && aStrings.size() < SC_FILTERLISTBOX_LINES) +nHeight = nHeight * (aStrings.size() + 1) / SC_FILTERLISTBOX_LINES; Size aParentSize = GetParent()->GetOutputSizePixel(); Size aSize( nSizeX, nHeight ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.LokDialog.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 1a4322a940073c2a4f461f971a3f04ced65007b1 Author: Dennis Francis AuthorDate: Fri May 1 02:23:30 2020 +0530 Commit: Dennis Francis CommitDate: Fri May 1 04:30:23 2020 +0200 loleaflet: mobile: center the dialog horizontally Before this the dialogs (in mobile) like 'autofilter/validation list' were not centered horizontally and looked awkward. However as for vertical positioning, it is correctly glued to the top of the map as said in the comments. Change-Id: I2f31075742ac8f40b3fd4d4016dbfef635b5f805 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93238 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index bcdf1f4fa..dd0a78113 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -1238,7 +1238,7 @@ L.Control.LokDialog = L.Control.extend({ // on mobile, force the positioning to the top, so that it is not // covered by the virtual keyboard if (window.mode.isMobile()) { - $(dialogContainer).dialog('option', 'position', { my: 'left top', at: 'let top', of: '#document-container' }); + $(dialogContainer).dialog('option', 'position', { my: 'center top', at: 'center top', of: '#document-container' }); transformation.origin = 'center top'; transformation.translate.y = 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/layer/tile/TileLayer.js |3 +++ loleaflet/src/map/handler/Map.TouchGesture.js |9 + 2 files changed, 12 insertions(+) New commits: commit 485e849459f998a6aea0e5978562a9b05f458c85 Author: Dennis Francis AuthorDate: Thu Apr 30 18:07:06 2020 +0530 Commit: Dennis Francis CommitDate: Fri May 1 04:22:31 2020 +0200 The validity dropdown button should react to taps too Change-Id: I5c689106a2d995c37f28d652e8b0e39c0644ec8b Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93212 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 2918f8bf0..9836590ba 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -338,6 +338,9 @@ L.TileLayer = L.GridLayer.extend({ this._cellResizeMarkerEnd.on('dragstart drag dragend', this._onCellResizeMarkerDrag, this); this._cellAutofillMarker.on('dragstart drag dragend', this._onCellResizeMarkerDrag, this); this._dropDownButton.on('click', this._onDropDownButtonClick, this); + // The 'tap' events are not broadcasted by L.Map.TouchGesture, A specialized 'dropdownmarkertapped' event is + // generated just for the validity-dropdown-icon. + map.on('dropdownmarkertapped', this._onDropDownButtonClick, this); map.setPermission(this.options.permission); diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js index 6120a8d1a..cff7eeffe 100644 --- a/loleaflet/src/map/handler/Map.TouchGesture.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -311,6 +311,15 @@ L.Map.TouchGesture = L.Handler.extend({ this._map.fire('closepopups'); this._map.fire('closemobilewizard'); + + // The validity dropdown marker icon (exists only in calc) needs to be notified of tap events if it is the target. + var dropDownMarkers = document.getElementsByClassName('leaflet-marker-icon spreadsheet-drop-down-marker'); + if (dropDownMarkers.length == 1 && dropDownMarkers[0] && e.target && e.target == dropDownMarkers[0]) { + this._map.fire('dropdownmarkertapped'); + // don't send the mouse-event to core + return; + } + this._map.fire('editorgotfocus'); var docLayer = this._map._docLayer; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/layer/tile/TileLayer.js | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) New commits: commit 2e0f1402028d60344247605223e8a63fed70e7d4 Author: Dennis Francis AuthorDate: Thu Apr 30 17:28:39 2020 +0530 Commit: Dennis Francis CommitDate: Fri May 1 04:16:09 2020 +0200 fix validation dropdown icon size There is no need to have a 'maxHeight' for the icon as we don't mirror the core's button anymore. The height of the icon follows the cell height, and lets make the width follow it too, so that the icon is nicely scaled with zoom (the icon used has a 1:1 aspect ratio). Change-Id: I175ad98f6a1306fabd003eee7fda9652f5835995 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93211 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index adf022776..2918f8bf0 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -3038,18 +3038,12 @@ L.TileLayer = L.GridLayer.extend({ this._map.removeLayer(this._dropDownButton); }, - _getDropDownMarker: function (height) { - if (height) { - var maxHeight = 27; // it matches the max height of the same control in core - var topMargin = 0; - if (height > maxHeight) { - topMargin = height - maxHeight; - height = maxHeight; - } + _getDropDownMarker: function (dropDownSize) { + if (dropDownSize) { var icon = L.divIcon({ className: 'spreadsheet-drop-down-marker', - iconSize: [undefined, height], - iconAnchor: [0, -topMargin] + iconSize: [dropDownSize, dropDownSize], + iconAnchor: [0, 0] }); this._dropDownButton.setIcon(icon); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/layer/tile/TileLayer.js |9 - 1 file changed, 8 insertions(+), 1 deletion(-) New commits: commit 903488a7821872234c5f6b8cce5325ca97ef829a Author: Dennis Francis AuthorDate: Thu Apr 30 11:46:16 2020 +0530 Commit: Dennis Francis CommitDate: Fri May 1 04:13:09 2020 +0200 Lets make 'dropdown marker' icon active Before this, the dropdown marker icon was just trying to mirror the exact shape and position of the validity list button in core. It is a lot easier just to have the js icon according to our styling and in its click handler, sent '.uno:DataSelect' command to core. It saves us the trouble of mirroring the core's button which apparently is not zoom adjusted. With non-default dpiscale, it takes more effort to mirror it exactly. Change-Id: Ibe15293e9052dfacf01be94ed4950d1842e46c4b Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93210 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 7662b71a2..adf022776 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -156,7 +156,7 @@ L.TileLayer = L.GridLayer.extend({ className: 'spreadsheet-drop-down-marker', iconSize: null }), - interactive: false + interactive: true }); this._cellResizeMarkerStart = L.marker(new L.LatLng(0, 0), { @@ -337,6 +337,7 @@ L.TileLayer = L.GridLayer.extend({ this._cellResizeMarkerStart.on('dragstart drag dragend', this._onCellResizeMarkerDrag, this); this._cellResizeMarkerEnd.on('dragstart drag dragend', this._onCellResizeMarkerDrag, this); this._cellAutofillMarker.on('dragstart drag dragend', this._onCellResizeMarkerDrag, this); + this._dropDownButton.on('click', this._onDropDownButtonClick, this); map.setPermission(this.options.permission); @@ -2830,6 +2831,12 @@ L.TileLayer = L.GridLayer.extend({ } }, + _onDropDownButtonClick: function () { + if (this._validatedCellXY && this._cellCursorXY && this._validatedCellXY.equals(this._cellCursorXY)) { + this._map.sendUnoCommand('.uno:DataSelect'); + } + }, + // Update group layer selection handler. _onUpdateGraphicSelection: function () { if (this._graphicSelection && !this._isEmptyRectangle(this._graphicSelection)) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/gridwin.cxx | 27 ++- 1 file changed, 22 insertions(+), 5 deletions(-) New commits: commit 7787bac16cbe63698f56a9a70d9b1b217f3ea860 Author: Dennis Francis AuthorDate: Sun Apr 26 07:45:53 2020 +0530 Commit: Dennis Francis CommitDate: Wed Apr 29 20:02:17 2020 +0200 lokit: scale the validation dropdown with client zoom For zoom > 2.0 and zoom < 0.5 the scaled dropdown looks either too oversized or tiny and makes the ui look unpolished, so the zoom factor is trimmed between this range and then used to scale the validation window. Change-Id: Ic69383f273cb32670b6012f59715250dbfcf627c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92915 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit a87e78df635d4a8e745bfffcf33d022d2a498afa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93067 Tested-by: Jenkins diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 98b025f6cf61..59a4d6b60d35 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1072,8 +1072,10 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) long nHeight = 0; pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich ); +bool bLOKActive = comphelper::LibreOfficeKit::isActive(); +double fListWindowZoom = 1.0; -if (comphelper::LibreOfficeKit::isActive()) +if (bLOKActive) { // aPos is now view-zoom adjusted and in pixels an more importantly this is pixel aligned to the view-zoom, // but once we use this to set the position of the floating window, it has no information of view-zoom level @@ -1084,8 +1086,17 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) double fZoomY(pViewData->GetZoomY()); aPos.setX(aPos.getX() / fZoomX); aPos.setY(aPos.getY() / fZoomY); +// Reverse the zooms from sizes too +// nSizeX : because we need to rescale with another (trimmed) zoom level below. nSizeX = nSizeX / fZoomX; +// nSizeY : because this is used by vcl::FloatingWindow later to compute its vertical position +// since we pass the flag FloatWinPopupFlags::Down setup the popup. nSizeY = nSizeY / fZoomY; +// Limit zoom scale for Listwindow in the dropdown. +fListWindowZoom = std::max(std::min(fZoomY, 2.0), 0.5); +// nSizeX is only used in setting the width of dropdown, so rescale with +// the trimmed zoom. +nSizeX = nSizeX * fListWindowZoom; } if ( bLayoutRTL ) @@ -1097,12 +1108,14 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) aPos.AdjustY( nSizeY - 1 ); mpFilterFloat.reset(VclPtr::Create(this, WinBits(WB_BORDER))); -if (comphelper::LibreOfficeKit::isActive()) +if (bLOKActive) { mpFilterFloat->SetLOKNotifier(SfxViewShell::Current()); } mpFilterFloat->SetPopupModeEndHdl(LINK( this, ScGridWindow, PopupModeEndHdl)); mpFilterBox.reset(VclPtr::Create(mpFilterFloat.get(), this, nCol, nRow, ScFilterBoxMode::DataSelect)); +if (bLOKActive) +mpFilterBox->SetZoom(Fraction(fListWindowZoom)); // Fix for bug fdo#44925 if (AllSettings::GetLayoutRTL() != bLayoutRTL) mpFilterBox->EnableMirroring(); @@ -1138,12 +1151,16 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) // minimum width in pixel const long nMinLOKWinWidth = static_cast(1.3 * STD_COL_WIDTH * pViewData->GetPPTX()); -bool bLOKActive = comphelper::LibreOfficeKit::isActive(); if (bLOKActive && nSizeX < nMinLOKWinWidth) nSizeX = nMinLOKWinWidth; -if (bLOKActive && aStrings.size() < SC_FILTERLISTBOX_LINES) -nHeight = nHeight * (aStrings.size() + 1) / SC_FILTERLISTBOX_LINES; +if (bLOKActive) +{ +if (aStrings.size() < SC_FILTERLISTBOX_LINES) +nHeight = nHeight * (aStrings.size() + 1) / SC_FILTERLISTBOX_LINES; + +nHeight = nHeight * fListWindowZoom; +} Size aParentSize = GetParent()->GetOutputSizePixel(); Size aSize( nSizeX, nHeight ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/gridwin.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit 7e841c7e6546a6a3861c2d45ffc28fd427d0c597 Author: Dennis Francis AuthorDate: Sun Apr 26 05:38:01 2020 +0530 Commit: Dennis Francis CommitDate: Wed Apr 29 19:55:15 2020 +0200 lokit: trim validation dropdown height to content The validation dropdown looks ugly for lists with small number of items as its height is hardcoded to SC_FILTERLISTBOX_LINES(=12) * TextHeight Instead lets use the number of entries in the list to determine the height if this count is less than SC_FILTERLISTBOX_LINES Change-Id: If026140044e6665159cd616c13a2eb57356ae53f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92914 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit adf10bae8aecd8b765a21660b31056292276bdb2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93066 Tested-by: Jenkins diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index b14ffb1f9a43..98b025f6cf61 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1138,9 +1138,13 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) // minimum width in pixel const long nMinLOKWinWidth = static_cast(1.3 * STD_COL_WIDTH * pViewData->GetPPTX()); -if (comphelper::LibreOfficeKit::isActive() && nSizeX < nMinLOKWinWidth) +bool bLOKActive = comphelper::LibreOfficeKit::isActive(); +if (bLOKActive && nSizeX < nMinLOKWinWidth) nSizeX = nMinLOKWinWidth; +if (bLOKActive && aStrings.size() < SC_FILTERLISTBOX_LINES) +nHeight = nHeight * (aStrings.size() + 1) / SC_FILTERLISTBOX_LINES; + Size aParentSize = GetParent()->GetOutputSizePixel(); Size aSize( nSizeX, nHeight ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/gridwin.cxx | 16 1 file changed, 16 insertions(+) New commits: commit 3405f7f1b19738cad57b58259105ec87c1108466 Author: Dennis Francis AuthorDate: Sun Apr 26 04:56:11 2020 +0530 Commit: Dennis Francis CommitDate: Wed Apr 29 19:53:11 2020 +0200 lokit: fix validation dropdown's wrong position Reverse the zoom scale on the position of the dropdown before letting the vcl::FloatingWindow convert this to twips without any scale information. Without this reverse scaling, the dropdown will be incorrect due to double application of the same zoom (one in core and one in client). Change-Id: I73de12593b13e1bc9fb0514bec23c20d440d8923 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92913 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis (cherry picked from commit a68bfe87f6c720dd2b4721edf869c6801fa2d967) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93008 Tested-by: Jenkins diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 4fcda857a4ca..b14ffb1f9a43 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1072,6 +1072,22 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) long nHeight = 0; pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich ); + +if (comphelper::LibreOfficeKit::isActive()) +{ +// aPos is now view-zoom adjusted and in pixels an more importantly this is pixel aligned to the view-zoom, +// but once we use this to set the position of the floating window, it has no information of view-zoom level +// so if we don't reverse the zoom now, a simple PixelToLogic(aPos, MapMode(MapUnit::MapTwip)) employed in +// FloatingWindow::ImplCalcPos will produce a 'scaled' twips position which will again get zoom scaled in the +// client (effective double scaling) causing wrong positioning/size. +double fZoomX(pViewData->GetZoomX()); +double fZoomY(pViewData->GetZoomY()); +aPos.setX(aPos.getX() / fZoomX); +aPos.setY(aPos.getY() / fZoomY); +nSizeX = nSizeX / fZoomX; +nSizeY = nSizeY / fZoomY; +} + if ( bLayoutRTL ) aPos.AdjustX( -nSizeX ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source
sc/source/ui/view/gridwin.cxx | 27 ++- 1 file changed, 22 insertions(+), 5 deletions(-) New commits: commit a87e78df635d4a8e745bfffcf33d022d2a498afa Author: Dennis Francis AuthorDate: Sun Apr 26 07:45:53 2020 +0530 Commit: Dennis Francis CommitDate: Tue Apr 28 14:24:06 2020 +0200 lokit: scale the validation dropdown with client zoom For zoom > 2.0 and zoom < 0.5 the scaled dropdown looks either too oversized or tiny and makes the ui look unpolished, so the zoom factor is trimmed between this range and then used to scale the validation window. Change-Id: Ic69383f273cb32670b6012f59715250dbfcf627c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92915 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 2b2590918b71..0e7701fb913a 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1061,8 +1061,10 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) long nHeight = 0; pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich ); +bool bLOKActive = comphelper::LibreOfficeKit::isActive(); +double fListWindowZoom = 1.0; -if (comphelper::LibreOfficeKit::isActive()) +if (bLOKActive) { // aPos is now view-zoom adjusted and in pixels an more importantly this is pixel aligned to the view-zoom, // but once we use this to set the position of the floating window, it has no information of view-zoom level @@ -1073,8 +1075,17 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) double fZoomY(pViewData->GetZoomY()); aPos.setX(aPos.getX() / fZoomX); aPos.setY(aPos.getY() / fZoomY); +// Reverse the zooms from sizes too +// nSizeX : because we need to rescale with another (trimmed) zoom level below. nSizeX = nSizeX / fZoomX; +// nSizeY : because this is used by vcl::FloatingWindow later to compute its vertical position +// since we pass the flag FloatWinPopupFlags::Down setup the popup. nSizeY = nSizeY / fZoomY; +// Limit zoom scale for Listwindow in the dropdown. +fListWindowZoom = std::max(std::min(fZoomY, 2.0), 0.5); +// nSizeX is only used in setting the width of dropdown, so rescale with +// the trimmed zoom. +nSizeX = nSizeX * fListWindowZoom; } if ( bLayoutRTL ) @@ -1086,12 +1097,14 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) aPos.AdjustY( nSizeY - 1 ); mpFilterFloat.reset(VclPtr::Create(this, WinBits(WB_BORDER))); -if (comphelper::LibreOfficeKit::isActive()) +if (bLOKActive) { mpFilterFloat->SetLOKNotifier(SfxViewShell::Current()); } mpFilterFloat->SetPopupModeEndHdl(LINK( this, ScGridWindow, PopupModeEndHdl)); mpFilterBox.reset(VclPtr::Create(mpFilterFloat.get(), this, nCol, nRow, ScFilterBoxMode::DataSelect)); +if (bLOKActive) +mpFilterBox->SetZoom(Fraction(fListWindowZoom)); // Fix for bug fdo#44925 if (AllSettings::GetLayoutRTL() != bLayoutRTL) mpFilterBox->EnableMirroring(); @@ -1127,12 +1140,16 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) // minimum width in pixel const long nMinLOKWinWidth = static_cast(1.3 * STD_COL_WIDTH * pViewData->GetPPTX()); -bool bLOKActive = comphelper::LibreOfficeKit::isActive(); if (bLOKActive && nSizeX < nMinLOKWinWidth) nSizeX = nMinLOKWinWidth; -if (bLOKActive && aStrings.size() < SC_FILTERLISTBOX_LINES) -nHeight = nHeight * (aStrings.size() + 1) / SC_FILTERLISTBOX_LINES; +if (bLOKActive) +{ +if (aStrings.size() < SC_FILTERLISTBOX_LINES) +nHeight = nHeight * (aStrings.size() + 1) / SC_FILTERLISTBOX_LINES; + +nHeight = nHeight * fListWindowZoom; +} Size aParentSize = GetParent()->GetOutputSizePixel(); Size aSize( nSizeX, nHeight ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source
sc/source/ui/view/gridwin.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit adf10bae8aecd8b765a21660b31056292276bdb2 Author: Dennis Francis AuthorDate: Sun Apr 26 05:38:01 2020 +0530 Commit: Dennis Francis CommitDate: Tue Apr 28 14:18:58 2020 +0200 lokit: trim validation dropdown height to content The validation dropdown looks ugly for lists with small number of items as its height is hardcoded to SC_FILTERLISTBOX_LINES(=12) * TextHeight Instead lets use the number of entries in the list to determine the height if this count is less than SC_FILTERLISTBOX_LINES Change-Id: If026140044e6665159cd616c13a2eb57356ae53f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92914 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 495c74db0522..2b2590918b71 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1127,9 +1127,13 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) // minimum width in pixel const long nMinLOKWinWidth = static_cast(1.3 * STD_COL_WIDTH * pViewData->GetPPTX()); -if (comphelper::LibreOfficeKit::isActive() && nSizeX < nMinLOKWinWidth) +bool bLOKActive = comphelper::LibreOfficeKit::isActive(); +if (bLOKActive && nSizeX < nMinLOKWinWidth) nSizeX = nMinLOKWinWidth; +if (bLOKActive && aStrings.size() < SC_FILTERLISTBOX_LINES) +nHeight = nHeight * (aStrings.size() + 1) / SC_FILTERLISTBOX_LINES; + Size aParentSize = GetParent()->GetOutputSizePixel(); Size aSize( nSizeX, nHeight ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source
sc/source/ui/view/gridwin.cxx | 16 1 file changed, 16 insertions(+) New commits: commit a68bfe87f6c720dd2b4721edf869c6801fa2d967 Author: Dennis Francis AuthorDate: Sun Apr 26 04:56:11 2020 +0530 Commit: Dennis Francis CommitDate: Tue Apr 28 14:11:04 2020 +0200 lokit: fix validation dropdown's wrong position Reverse the zoom scale on the position of the dropdown before letting the vcl::FloatingWindow convert this to twips without any scale information. Without this reverse scaling, the dropdown will be incorrect due to double application of the same zoom (one in core and one in client). Change-Id: I73de12593b13e1bc9fb0514bec23c20d440d8923 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92913 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index a3e3cc793118..495c74db0522 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1061,6 +1061,22 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) long nHeight = 0; pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich ); + +if (comphelper::LibreOfficeKit::isActive()) +{ +// aPos is now view-zoom adjusted and in pixels an more importantly this is pixel aligned to the view-zoom, +// but once we use this to set the position of the floating window, it has no information of view-zoom level +// so if we don't reverse the zoom now, a simple PixelToLogic(aPos, MapMode(MapUnit::MapTwip)) employed in +// FloatingWindow::ImplCalcPos will produce a 'scaled' twips position which will again get zoom scaled in the +// client (effective double scaling) causing wrong positioning/size. +double fZoomX(pViewData->GetZoomX()); +double fZoomY(pViewData->GetZoomY()); +aPos.setX(aPos.getX() / fZoomX); +aPos.setY(aPos.getY() / fZoomY); +nSizeX = nSizeX / fZoomX; +nSizeY = nSizeY / fZoomY; +} + if ( bLayoutRTL ) aPos.AdjustX( -nSizeX ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: kit/Kit.cpp
kit/Kit.cpp |5 - 1 file changed, 5 deletions(-) New commits: commit 986bcce1c961df09169ff87dd22c1f84e4be036c Author: Dennis Francis AuthorDate: Sun Apr 26 08:08:58 2020 +0530 Commit: Dennis Francis CommitDate: Tue Apr 28 13:30:22 2020 +0200 kit: Do not broadcast cell-cursor invalidation messages is a follow up of 217dd2de5458cb91c6b9dffeb7db84e9cde88c0c "Do not broadcast view-cursor invalidation messages" But this change is implicitly Calc specific because LOK_CALLBACK_CELL_VIEW_CURSOR is used only in Calc. This patch fixes the following bug: Suppose there are at least three clients each with a different zoom and the all client's cursors are placed in same tab-view and away from A1. Now it can be seen at once that the cursors of other clients in each client are rendered incorrectly. The commit c6b18508aec0e609b4c3c000faf89c21e93620bd in core.git "lok: send other views our cursor position in their view co-ordinates" does the right thing by sending view specific cell-cursor positions. But the broadcast of these messages in Kit.cpp means every client will get the messages intended for others and possibly end up using the wrong messages to draw the cell-cursors. Change-Id: I6e9534c2e562f34b5c1fe37242b36e076b9319c8 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92916 Tested-by: Jenkins CollaboraOffice Reviewed-by: Dennis Francis diff --git a/kit/Kit.cpp b/kit/Kit.cpp index 46eaf55c9..ae775fee3 100644 --- a/kit/Kit.cpp +++ b/kit/Kit.cpp @@ -1388,11 +1388,6 @@ public: // all views have to be in sync tileQueue->put("callback all " + std::to_string(type) + ' ' + payload); } -else if (type == LOK_CALLBACK_CELL_VIEW_CURSOR) -{ -// these should go to all views but the one that that triggered it -tileQueue->put("callback except-" + targetViewId + ' ' + std::to_string(type) + ' ' + payload); -} else tileQueue->put("callback " + std::to_string(descriptor->getViewId()) + ' ' + std::to_string(type) + ' ' + payload); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: editeng/source include/editeng sc/source
editeng/source/editeng/editview.cxx | 10 ++ editeng/source/editeng/impedit.cxx | 99 +++- editeng/source/editeng/impedit.hxx | 10 ++ include/editeng/editview.hxx|2 sc/source/ui/inc/gridwin.hxx| 15 sc/source/ui/view/gridwin4.cxx | 125 +--- sc/source/ui/view/viewdata.cxx |1 7 files changed, 224 insertions(+), 38 deletions(-) New commits: commit 0aaf94d75410cb41b572a64935db767f586ffa73 Author: Dennis Francis AuthorDate: Tue Apr 14 14:49:23 2020 +0530 Commit: Dennis Francis CommitDate: Thu Apr 23 09:35:51 2020 +0200 lokit: fix edit-text/view-cursor position in case of views with heterogeneous zooms. 1. EditText render position fix The EditView has an 'output-area' which is used to clip the rectangle we pass to the Paint() call. It also holds on to the ScGridWindow instance where the edit started. The 'output-area' of the EditView is in the coordinates/units of the MapMode of the ScGridWindow it holds. So we need to temporarily change the MapMode and 'output-area' of the EditView in agreement to the device(with the current view's zoom settings) where we are going to paint to. After we call the Paint(), we rollback the original settings of the EditView. 2. EditViewCursor position fix Before this change the cursor position in twips (calculated based on pixel aligned cell position in the view where editing occurred) is broadcasted to all the client-views. If the clients have different zooms, then simply scaling this common cursor position in the client for its zoom is not going to be accurate enough (due to the non-linear Logic->Pixel->Logic transformation involving pixel rounding). This is very visible if you are editing far away from A1 (like Z50). The fix is to turn off this broadcast for calc-cell editing and send view specific edit-cursor invalidation messages. This is accompanied by a online.git patch that removes unnessecary broadcast of view-cursor invalidation messages which messes up things again. "Do not broadcast view-cursor invalidation messages" (cherry picked from commit d58f1e334245f9e136750fbba267c2a941a213cc) Conflicts: editeng/source/editeng/impedit.cxx editeng/source/editeng/impedit.hxx Change-Id: Ib2fbbe4b6f93f26fc85d6adaa8684dd4397d886f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92631 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92721 Tested-by: Jenkins Reviewed-by: Dennis Francis diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 531fad3e12c2..34509b4d4e74 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -470,6 +470,16 @@ void EditView::Command( const CommandEvent& rCEvt ) pImpEditView->Command( rCEvt ); } +void EditView::SetBroadcastLOKViewCursor(bool bSet) +{ +pImpEditView->SetBroadcastLOKViewCursor(bSet); +} + +tools::Rectangle EditView::GetEditCursor() const +{ +return pImpEditView->GetEditCursor(); +} + void EditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor, bool bActivate ) { if ( !pImpEditView->pEditEngine->HasView( this ) ) diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index e0ee7a52b24d..b5be152d6ece 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -81,7 +81,8 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, vcl::Window* pWindo aOutArea( Point(), pEng->GetPaperSize() ), eSelectionMode(EESelectionMode::Std), eAnchorMode(EEAnchorMode::TopLeft), -mpEditViewCallbacks(nullptr) +mpEditViewCallbacks(nullptr), +mbBroadcastLOKViewCursor(comphelper::LibreOfficeKit::isActive()) { aEditSelection.Min() = pEng->GetEditDoc().GetStartPaM(); aEditSelection.Max() = pEng->GetEditDoc().GetEndPaM(); @@ -913,6 +914,69 @@ OString buildHyperlinkJSON(const OUString& sText, const OUString& sLink) } // End of anon namespace +tools::Rectangle ImpEditView::ImplGetEditCursor(EditPaM& aPaM, GetCursorFlags nShowCursorFlags, sal_Int32& nTextPortionStart, +const ParaPortion* pParaPortion) const +{ +tools::Rectangle aEditCursor = pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, nShowCursorFlags ); +if ( !IsInsertMode() && !aEditSelection.HasRange() ) +{ +if ( aPaM.GetNode()->Len() && ( aPaM.GetIndex() < aPaM.GetNode()->Len() ) ) +{ +// If we are behind a portion, and the next portion has other direction, we must change position... +aEditCursor.SetLeft( pEditEngine->pImpEditEngi
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - editeng/source include/editeng sc/source
editeng/source/editeng/editview.cxx | 10 ++ editeng/source/editeng/impedit.cxx | 97 +++ editeng/source/editeng/impedit.hxx | 10 ++ include/editeng/editview.hxx|2 sc/source/ui/inc/gridwin.hxx| 15 sc/source/ui/view/gridwin4.cxx | 125 +--- sc/source/ui/view/viewdata.cxx |1 7 files changed, 223 insertions(+), 37 deletions(-) New commits: commit d58f1e334245f9e136750fbba267c2a941a213cc Author: Dennis Francis AuthorDate: Tue Apr 14 14:49:23 2020 +0530 Commit: Michael Meeks CommitDate: Wed Apr 22 11:29:27 2020 +0200 lokit: fix edit-text/view-cursor position in case of views with heterogeneous zooms. 1. EditText render position fix The EditView has an 'output-area' which is used to clip the rectangle we pass to the Paint() call. It also holds on to the ScGridWindow instance where the edit started. The 'output-area' of the EditView is in the coordinates/units of the MapMode of the ScGridWindow it holds. So we need to temporarily change the MapMode and 'output-area' of the EditView in agreement to the device(with the current view's zoom settings) where we are going to paint to. After we call the Paint(), we rollback the original settings of the EditView. 2. EditViewCursor position fix Before this change the cursor position in twips (calculated based on pixel aligned cell position in the view where editing occurred) is broadcasted to all the client-views. If the clients have different zooms, then simply scaling this common cursor position in the client for its zoom is not going to be accurate enough (due to the non-linear Logic->Pixel->Logic transformation involving pixel rounding). This is very visible if you are editing far away from A1 (like Z50). The fix is to turn off this broadcast for calc-cell editing and send view specific edit-cursor invalidation messages. This is accompanied by a online.git patch that removes unnessecary broadcast of view-cursor invalidation messages which messes up things again. "Do not broadcast view-cursor invalidation messages" Change-Id: Ib2fbbe4b6f93f26fc85d6adaa8684dd4397d886f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92631 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 24d0947d7de5..c598f36afbfa 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -471,6 +471,16 @@ void EditView::Command( const CommandEvent& rCEvt ) pImpEditView->Command( rCEvt ); } +void EditView::SetBroadcastLOKViewCursor(bool bSet) +{ +pImpEditView->SetBroadcastLOKViewCursor(bSet); +} + +tools::Rectangle EditView::GetEditCursor() const +{ +return pImpEditView->GetEditCursor(); +} + void EditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor, bool bActivate ) { if ( pImpEditView->pEditEngine->HasView( this ) ) diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index c9ad00241a55..ee9b40b0e97a 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -79,6 +79,7 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, vcl::Window* pWindo eSelectionMode = EESelectionMode::Std; eAnchorMode = EEAnchorMode::TopLeft; mpEditViewCallbacks = nullptr; +mbBroadcastLOKViewCursor = comphelper::LibreOfficeKit::isActive(); nInvMore= 1; nTravelXPos = TRAVEL_X_DONTKNOW; nControl= EVControlBits::AUTOSCROLL | EVControlBits::ENABLEPASTE; @@ -911,6 +912,69 @@ OString buildHyperlinkJSON(const OUString& sText, const OUString& sLink) } // End of anon namespace +tools::Rectangle ImpEditView::ImplGetEditCursor(EditPaM& aPaM, GetCursorFlags nShowCursorFlags, sal_Int32& nTextPortionStart, +const ParaPortion* pParaPortion) const +{ +tools::Rectangle aEditCursor = pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, nShowCursorFlags ); +if ( !IsInsertMode() && !aEditSelection.HasRange() ) +{ +if ( aPaM.GetNode()->Len() && ( aPaM.GetIndex() < aPaM.GetNode()->Len() ) ) +{ +// If we are behind a portion, and the next portion has other direction, we must change position... +aEditCursor.SetLeft( pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, GetCursorFlags::TextOnly|GetCursorFlags::PreferPortionStart ).Left() ); +aEditCursor.SetRight( aEditCursor.Left() ); + +sal_Int32 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, true ); +const TextPortion& rTextPortion = pParaPortion
[Libreoffice-commits] online.git: kit/Kit.cpp
kit/Kit.cpp |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 217dd2de5458cb91c6b9dffeb7db84e9cde88c0c Author: Dennis Francis AuthorDate: Tue Apr 21 14:40:30 2020 +0530 Commit: Michael Meeks CommitDate: Wed Apr 22 09:48:55 2020 +0200 Do not broadcast view-cursor invalidation messages in kit as these are sent by core to specific view(s) by ultimately calling either (as seen from the usages of LOK_CALLBACK_INVALIDATE_VIEW_CURSOR in core) 1. SfxLokHelper::notifyOtherView() where it sends to particular view. or 2. SfxLokHelper::notifyOtherViews() where it sends to all views except the current view. The core makes the decision to broadcast or not, and if it does, then the kit's broadcast of broadcasted messages can only cause a blowup of messaging complexiity w.r.t number of views. It also does not make sense to send view-cursor messages meant for a view to be sent to others in Calc with clients of hetrogeneous zooms. Change-Id: Ib07c5fbba9bb05c59048561d2c26aed00f3be598 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92633 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/kit/Kit.cpp b/kit/Kit.cpp index a34b91334..3801af4bd 100644 --- a/kit/Kit.cpp +++ b/kit/Kit.cpp @@ -1322,8 +1322,7 @@ public: // all views have to be in sync tileQueue->put("callback all " + std::to_string(type) + ' ' + payload); } -else if (type == LOK_CALLBACK_INVALIDATE_VIEW_CURSOR || - type == LOK_CALLBACK_CELL_VIEW_CURSOR) +else if (type == LOK_CALLBACK_CELL_VIEW_CURSOR) { // these should go to all views but the one that that triggered it tileQueue->put("callback except-" + targetViewId + ' ' + std::to_string(type) + ' ' + payload); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx | 10 ++ 1 file changed, 10 insertions(+) New commits: commit dff729704687889f960562f0ac6fa62b47897cf9 Author: Dennis Francis AuthorDate: Wed Apr 1 20:20:19 2020 +0530 Commit: Andras Timar CommitDate: Thu Apr 2 11:14:37 2020 +0200 tdf#127158 :lokit: preload liblocaledata_others.so ...even if LOK_WHITELIST_LANGUAGES does not contain an Asian language. Not preloading this module causes locale-fallbacks for example when a calc-cell with Asian locale has some date with number-formatting, LOOL displays the date with the fallback locale(en_US). (more details in comments) Change-Id: Id8a31565f7f0f0262c044028f55fdf4fe33ecec8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91510 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index c54fb771080c..4cf69495f10c 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -91,6 +91,8 @@ #include #include +#include +#include #include #include @@ -5661,6 +5663,14 @@ static void preloadData() } std::cerr << "\n"; +// Hack to load and cache the module liblocaledata_others.so which is not loaded normally +// (when loading dictionaries of just non-Asian locales). Creating a XCalendar4 of one Asian locale +// will cheaply load this missing "others" locale library. Appending an Asian locale in +// LOK_WHITELIST_LANGUAGES env-var also works but at the cost of loading that dictionary. +css::uno::Reference< css::i18n::XCalendar4 > xCal = css::i18n::LocaleCalendar2::create(comphelper::getProcessComponentContext()); +css::lang::Locale aAsianLocale = {"hi", "IN", ""}; +xCal->loadDefaultCalendar(aAsianLocale); + // preload all available thesauri css::uno::Reference xThesaurus(xLngSvcMgr->getThesaurus()); css::uno::Reference xThesLocales(xSpellChecker, css::uno::UNO_QUERY_THROW); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source
desktop/source/lib/init.cxx | 10 ++ 1 file changed, 10 insertions(+) New commits: commit 6e5cf6d3aafaede128dd762be273729a271462f8 Author: Dennis Francis AuthorDate: Wed Apr 1 20:20:19 2020 +0530 Commit: Andras Timar CommitDate: Thu Apr 2 09:54:57 2020 +0200 tdf#127158 :lokit: preload liblocaledata_others.so ...even if LOK_WHITELIST_LANGUAGES does not contain an Asian language. Not preloading this module causes locale-fallbacks for example when a calc-cell with Asian locale has some date with number-formatting, LOOL displays the date with the fallback locale(en_US). (more details in comments) Change-Id: Id8a31565f7f0f0262c044028f55fdf4fe33ecec8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91529 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index c544984ade50..612b6a51ceac 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -95,6 +95,8 @@ #include #include +#include +#include #include #include @@ -5662,6 +5664,14 @@ static void preloadData() } std::cerr << "\n"; +// Hack to load and cache the module liblocaledata_others.so which is not loaded normally +// (when loading dictionaries of just non-Asian locales). Creating a XCalendar4 of one Asian locale +// will cheaply load this missing "others" locale library. Appending an Asian locale in +// LOK_WHITELIST_LANGUAGES env-var also works but at the cost of loading that dictionary. +css::uno::Reference< css::i18n::XCalendar4 > xCal = css::i18n::LocaleCalendar2::create(comphelper::getProcessComponentContext()); +css::lang::Locale aAsianLocale = {"hi", "IN", ""}; +xCal->loadDefaultCalendar(aAsianLocale); + // preload all available thesauri css::uno::Reference xThesaurus(xLngSvcMgr->getThesaurus()); css::uno::Reference xThesLocales(xSpellChecker, css::uno::UNO_QUERY_THROW); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: chart2/source sc/source
chart2/source/controller/main/ControllerCommandDispatch.cxx | 10 ++ sc/source/ui/view/tabvwshb.cxx |2 ++ 2 files changed, 12 insertions(+) New commits: commit d90b0305e0769c89c5644854c216e0849df3313e Author: Dennis Francis AuthorDate: Tue Mar 24 18:26:16 2020 +0530 Commit: Dennis Francis CommitDate: Wed Mar 25 14:17:17 2020 +0100 lokit: Mark document as modified on chart insert/edit... immediately at least in the case when LOKit is active. This is to allow prompt emission of .uno:ModifiedStatus=true statechange message from lokit to the client. Without this, in online the chart insert/modify related changes may not get saved on client exit. Change-Id: I8c38a37cc455f74a70d43b6aaa3e5035b283d47f (cherry picked from commit 75adb624dfff4659e6f3099a1720fbd697560f9c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91036 Tested-by: Jenkins Reviewed-by: Dennis Francis diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index f8474959a619..4508a83adb4d 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -36,6 +36,9 @@ #include #include #include +#include +#include +#include #include #include @@ -806,6 +809,13 @@ void SAL_CALL ControllerCommandDispatch::modified( const lang::EventObject& aEve if( bUpdateCommandAvailability ) updateCommandAvailability(); +if (comphelper::LibreOfficeKit::isActive()) +{ +if (SfxViewShell* pViewShell = SfxViewShell::Current()) +if (SfxObjectShell* pObjSh = pViewShell->GetObjectShell()) +pObjSh->SetModified(); +} + CommandDispatch::modified( aEvent ); } diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 157ab4967484..9ebb98f8e24d 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -334,6 +334,8 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) case SID_INSERT_DIAGRAM: FuInsertChart(*this, pWin, pView, pDrModel, rReq); +if (comphelper::LibreOfficeKit::isActive()) +pDocSh->SetModified(); break; case SID_INSERT_OBJECT: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - chart2/source sc/source
chart2/source/controller/main/ControllerCommandDispatch.cxx | 10 ++ sc/source/ui/view/tabvwshb.cxx |2 ++ 2 files changed, 12 insertions(+) New commits: commit 3e4fd7330b382a42e3dd2e1b8fd0b1f78a34b28d Author: Dennis Francis AuthorDate: Tue Mar 24 18:26:16 2020 +0530 Commit: Andras Timar CommitDate: Wed Mar 25 00:04:43 2020 +0100 lokit: Mark document as modified on chart insert/edit... immediately at least in the case when LOKit is active. This is to allow prompt emission of .uno:ModifiedStatus=true statechange message from lokit to the client. Without this, in online the chart insert/modify related changes may not get saved on client exit. Change-Id: I8c38a37cc455f74a70d43b6aaa3e5035b283d47f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90987 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index 0dac15954de8..a1857e7c08e5 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -35,6 +35,9 @@ #include #include +#include +#include +#include #include #include @@ -812,6 +815,13 @@ void SAL_CALL ControllerCommandDispatch::modified( const lang::EventObject& aEve if( bUpdateCommandAvailability ) updateCommandAvailability(); +if (comphelper::LibreOfficeKit::isActive()) +{ +if (SfxViewShell* pViewShell = SfxViewShell::Current()) +if (SfxObjectShell* pObjSh = pViewShell->GetObjectShell()) +pObjSh->SetModified(); +} + CommandDispatch::modified( aEvent ); } diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 7ac16fa1a0dc..2f2eb1bda630 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -337,6 +337,8 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) case SID_INSERT_DIAGRAM: pFuInsertChart.reset(new FuInsertChart(*this, pWin, pView, pDrModel, rReq)); +if (comphelper::LibreOfficeKit::isActive()) +pDocSh->SetModified(); break; case SID_INSERT_OBJECT: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svx/source sw/source
svx/source/xoutdev/xattr.cxx| 13 +++ sw/source/uibase/shells/drawdlg.cxx | 41 2 files changed, 54 insertions(+) New commits: commit f08bbb5648c06a387e69f3a0e0a6a9a1eda7fc37 Author: Dennis Francis AuthorDate: Sun Mar 22 19:43:03 2020 +0530 Commit: Dennis Francis CommitDate: Tue Mar 24 18:52:47 2020 +0100 lokit: unify fill transparency items Online just listens to .uno:FillFloatTransparence but the set-item in core it corresponds to, does not represent the fill-transparency types like 'None' and 'Solid'. This is represented by another item called XFillTransparencyItem. As a result the mobile wizard does not show the correct transparency fill type always. To solve this, this patch encodes the constant transparency percentage in case of Solid and None(always 0%) as an intensity and stores this info in the statechange message of .uno:FillFloatTransparence whenever there is no gradient type and corrects the 'style' attribute of the message appropriately. More detailed information is provided as comments at appropriate places in the patch. Change-Id: I443ef4ce349badf28f6c2c702b1014868d9c6ed5 (cherry picked from commit 34969e9c04f9305d19826c72a29e38e26794cbe3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90986 Tested-by: Jenkins Reviewed-by: Dennis Francis diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 4b11483e8e3a..2fc8ff28f861 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2502,6 +2502,19 @@ boost::property_tree::ptree XFillFloatTransparenceItem::dumpAsJSON() const boost::property_tree::ptree aTree = XFillGradientItem::dumpAsJSON(); aTree.put("commandName", ".uno:FillFloatTransparence"); +if (!bEnabled) +{ +boost::property_tree::ptree& rState = aTree.get_child("state"); +// When gradient fill is disabled, the intensity fields contain the +// constant encoded percent-transparency. However we use that here to just +// distinguish between 'None' and 'Solid' types and correct the 'style' +// property appropriately. +if (GetGradientValue().GetStartIntens() == 100) +rState.put("style", "NONE"); +else +rState.put("style", "SOLID"); +} + return aTree; } diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx index 78c49e0e5488..9e5939697602 100644 --- a/sw/source/uibase/shells/drawdlg.cxx +++ b/sw/source/uibase/shells/drawdlg.cxx @@ -36,6 +36,9 @@ #include #include #include +#include +#include +#include using namespace com::sun::star::drawing; @@ -314,6 +317,40 @@ void SwDrawShell::ExecDrawAttrArgs(SfxRequest const & rReq) pView->GetModel()->SetChanged(); } +static void lcl_unifyFillTransparencyItems(SfxItemSet& rSet) +{ +// Transparent fill options are None, Solid, Linear, Axial, Radial, Elliptical, Quadratic, Square. +// But this is represented across two items namely XFillTransparenceItem (for None and Solid) +// and XFillFloatTransparenceItem (for the rest). To simplify the representation in LOKit case let's +// use XFillFloatTransparenceItem to carry the information of XFillTransparenceItem when gradients +// are disabled. When gradient transparency is disabled, all fields of XFillFloatTransparenceItem are invalid +// and not used. So convert XFillTransparenceItem's constant transparency percentage as an intensity +// and assign this to the XFillFloatTransparenceItem's start-intensity and end-intensity fields. +// Now the LOK clients need only listen to statechange messages of XFillFloatTransparenceItem +// to get fill-transparency settings instead of listening to two separate items. + +XFillFloatTransparenceItem* pFillFloatTranspItem = +const_cast + (rSet.GetItem(XATTR_FILLFLOATTRANSPARENCE)); +if (!pFillFloatTranspItem || pFillFloatTranspItem->IsEnabled()) +return; + +const XFillTransparenceItem* pFillTranspItem = +rSet.GetItem(XATTR_FILLTRANSPARENCE); + +if (!pFillTranspItem) +return; + +XGradient aTmpGradient = pFillFloatTranspItem->GetGradientValue(); +sal_uInt16 nTranspPercent = pFillTranspItem->GetValue(); +// Encode transparancy percentage as intensity +sal_uInt16 nIntensity = 100 - std::min +(std::max(nTranspPercent, 0), 100); +aTmpGradient.SetStartIntens(nIntensity); +aTmpGradient.SetEndIntens(nIntensity); +pFillFloatTranspItem->SetGradientValue(aTmpGradient); +} + void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet) { SdrView* pSdrView = GetShell().GetDrawView(); @@ -323,7 +360,11 @@ void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet) bool
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js |6 ++ 1 file changed, 6 insertions(+) New commits: commit 466934a53c24fcf1834b89545f407342c52d1f70 Author: Dennis Francis AuthorDate: Sun Mar 22 19:56:22 2020 +0530 Commit: Andras Timar CommitDate: Mon Mar 23 12:52:07 2020 +0100 loleaflet: handle all transparency fill types Also handle 'NONE' and 'SOLID' style types now emitted as part of .uno:FillFloatTransparence statechange message. Without this the mobile wizard does not show the transparency fill types correctly for these cases. Change-Id: Iffecc6dbfbac097310c9c5f53ba3b4dfe39e4756 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90879 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index cb0b607ee..6a8a3d9be 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -147,6 +147,12 @@ L.Control.JSDialogBuilder = L.Control.extend({ _gradientStyleToLabel: function(state) { switch (state) { + case 'NONE': + return _('None'); + + case 'SOLID': + return _('Solid'); + case 'LINEAR': return _('Linear'); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - svx/source sw/source
svx/source/xoutdev/xattr.cxx| 13 +++ sw/source/uibase/shells/drawdlg.cxx | 40 2 files changed, 53 insertions(+) New commits: commit 8f062cdae1c71c9dd2a1e3f81617b08ac7463c5d Author: Dennis Francis AuthorDate: Sun Mar 22 19:43:03 2020 +0530 Commit: Andras Timar CommitDate: Mon Mar 23 12:51:42 2020 +0100 lokit: unify fill transparency items Online just listens to .uno:FillFloatTransparence but the set-item in core it corresponds to, does not represent the fill-transparency types like 'None' and 'Solid'. This is represented by another item called XFillTransparencyItem. As a result the mobile wizard does not show the correct transparency fill type always. To solve this, this patch encodes the constant transparency percentage in case of Solid and None(always 0%) as an intensity and stores this info in the statechange message of .uno:FillFloatTransparence whenever there is no gradient type and corrects the 'style' attribute of the message appropriately. More detailed information is provided as comments at appropriate places in the patch. Change-Id: I443ef4ce349badf28f6c2c702b1014868d9c6ed5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90878 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 83e052231b58..1de52ad51ee5 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2532,6 +2532,19 @@ boost::property_tree::ptree XFillFloatTransparenceItem::dumpAsJSON() const boost::property_tree::ptree aTree = XFillGradientItem::dumpAsJSON(); aTree.put("commandName", ".uno:FillFloatTransparence"); +if (!bEnabled) +{ +boost::property_tree::ptree& rState = aTree.get_child("state"); +// When gradient fill is disabled, the intensity fields contain the +// constant encoded percent-transparency. However we use that here to just +// distinguish between 'None' and 'Solid' types and correct the 'style' +// property appropriately. +if (GetGradientValue().GetStartIntens() == 100) +rState.put("style", "NONE"); +else +rState.put("style", "SOLID"); +} + return aTree; } diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx index 8b42f0ebb732..66176aca79e6 100644 --- a/sw/source/uibase/shells/drawdlg.cxx +++ b/sw/source/uibase/shells/drawdlg.cxx @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include #include @@ -320,6 +322,40 @@ void SwDrawShell::ExecDrawAttrArgs(SfxRequest const & rReq) pView->GetModel()->SetChanged(); } +void lcl_unifyFillTransparencyItems(SfxItemSet& rSet) +{ +// Transparent fill options are None, Solid, Linear, Axial, Radial, Elliptical, Quadratic, Square. +// But this is represented across two items namely XFillTransparenceItem (for None and Solid) +// and XFillFloatTransparenceItem (for the rest). To simplify the representation in LOKit case let's +// use XFillFloatTransparenceItem to carry the information of XFillTransparenceItem when gradients +// are disabled. When gradient transparency is disabled, all fields of XFillFloatTransparenceItem are invalid +// and not used. So convert XFillTransparenceItem's constant transparency percentage as an intensity +// and assign this to the XFillFloatTransparenceItem's start-intensity and end-intensity fields. +// Now the LOK clients need only listen to statechange messages of XFillFloatTransparenceItem +// to get fill-transparency settings instead of listening to two separate items. + +XFillFloatTransparenceItem* pFillFloatTranspItem = +const_cast + (rSet.GetItem(XATTR_FILLFLOATTRANSPARENCE)); +if (!pFillFloatTranspItem || pFillFloatTranspItem->IsEnabled()) +return; + +const XFillTransparenceItem* pFillTranspItem = +rSet.GetItem(XATTR_FILLTRANSPARENCE); + +if (!pFillTranspItem) +return; + +XGradient aTmpGradient = pFillFloatTranspItem->GetGradientValue(); +sal_uInt16 nTranspPercent = pFillTranspItem->GetValue(); +// Encode transparancy percentage as intensity +sal_uInt16 nIntensity = 100 - std::min +(std::max(nTranspPercent, 0), 100); +aTmpGradient.SetStartIntens(nIntensity); +aTmpGradient.SetEndIntens(nIntensity); +pFillFloatTranspItem->SetGradientValue(aTmpGradient); +} + void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet) { SdrView* pSdrView = GetShell().GetDrawView(); @@ -329,7 +365,11 @@ void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet) bool bDisable = Disable( rSet ); if( !bDisable ) +
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Scroll.js |2 ++ 1 file changed, 2 insertions(+) New commits: commit 01f152ad98d9229a4357f924ee068ea8d039a741 Author: Dennis Francis AuthorDate: Fri Feb 28 21:54:59 2020 +0530 Commit: Henry Castro CommitDate: Tue Mar 17 23:30:39 2020 +0100 Let Hammer for scroll-container listen for 'swipe' too and delegate it to L.Map.TouchGesture's swipe handlers which does 'ergonomic' scrolling (added in 7338e3d8185170dbedcc3b40a15c4a6adcc47ef1). With this we get better/smoother swipe response when the swipe starts at the right edge of the sheet (where the scroll widgets are). This is a follow-up improvement of : commit 0ca8e3b63946862dad47163e448fca84741421d2 Author: Dennis Francis Date: Fri Feb 14 18:11:37 2020 +0530 Lets have Hammer pan listeners on scroll-container... Change-Id: Ib5260f540434ae6af649102a1f6d6eae57e4659e Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89728 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro diff --git a/loleaflet/src/control/Control.Scroll.js b/loleaflet/src/control/Control.Scroll.js index 8988df9ea..650f69ce4 100644 --- a/loleaflet/src/control/Control.Scroll.js +++ b/loleaflet/src/control/Control.Scroll.js @@ -68,6 +68,7 @@ L.Control.Scroll = L.Control.extend({ this._hammer.get('pan').set({ direction: Hammer.DIRECTION_ALL }); + this._hammer.get('swipe').set({ threshold: 5 }); if (L.Browser.touch) { L.DomEvent.on(this._scrollContainer, 'touchmove', L.DomEvent.preventDefault); @@ -77,6 +78,7 @@ L.Control.Scroll = L.Control.extend({ this._hammer.on('panstart', L.bind(mapTouchGesture._onPanStart, mapTouchGesture)); this._hammer.on('pan', L.bind(mapTouchGesture._onPan, mapTouchGesture)); this._hammer.on('panend', L.bind(mapTouchGesture._onPanEnd, mapTouchGesture)); + this._hammer.on('swipe', L.bind(mapTouchGesture._onSwipe, mapTouchGesture)); } }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Tabs.js|8 +++- loleaflet/src/control/Control.Toolbar.js |2 +- 2 files changed, 8 insertions(+), 2 deletions(-) New commits: commit 98258da7189fb14f0aae88d5073d64fce71ae764 Author: Dennis Francis AuthorDate: Sat Mar 7 17:39:12 2020 +0530 Commit: Andras Timar CommitDate: Mon Mar 16 15:55:30 2020 +0100 Scroll to last tab when a new sheet is inserted Before the patch on inserting a new sheet using '+' button in a spreadsheet with lots of sheets, the scroll position remains unchanged. With this change, it scrolls to the newly inserted tab at the end. Change-Id: Iaa343aac51636043ab4629a847e2315e5076c4ab Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90159 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.Tabs.js b/loleaflet/src/control/Control.Tabs.js index 8c56372da..182a154c0 100644 --- a/loleaflet/src/control/Control.Tabs.js +++ b/loleaflet/src/control/Control.Tabs.js @@ -165,7 +165,13 @@ L.Control.Tabs = L.Control.extend({ // Restore horizontal scroll position scrollDiv = L.DomUtil.get('spreadsheet-tab-scroll'); if (scrollDiv) { - scrollDiv.scrollLeft = horizScrollPos; + if (this._map.insertPage && this._map.insertPage.scrollToEnd) { + this._map.insertPage.scrollToEnd = false; + scrollDiv.scrollLeft = scrollDiv.scrollWidth; + } + else { + scrollDiv.scrollLeft = horizScrollPos; + } } } }, diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index a26a63304..9e8d87d8c 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -252,7 +252,7 @@ function onClick(e, id, item, subItem) { else if (id === 'insertsheet') { var nPos = $('#spreadsheet-tab-scroll')[0].childElementCount; map.insertPage(nPos); - $('#spreadsheet-tab-scroll').scrollLeft($('#spreadsheet-tab-scroll').prop('scrollWidth')); + map.insertPage.scrollToEnd = true; } else if (id === 'firstrecord') { $('#spreadsheet-tab-scroll').scrollLeft(0); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/css loleaflet/src
loleaflet/css/spreadsheet.css |3 ++- loleaflet/src/control/Control.LokDialog.js | 24 loleaflet/src/control/Control.Tabs.js |1 + 3 files changed, 27 insertions(+), 1 deletion(-) New commits: commit 3c4e3d8c4362de777d9dde2362211b4468e2f4dd Author: Dennis Francis AuthorDate: Tue Mar 3 21:17:05 2020 +0530 Commit: Michael Meeks CommitDate: Tue Mar 10 10:37:02 2020 +0100 Do not let sidebar cover calc-tabs-bar (partially) In desktop-browser-online-calc, when the sidebar is shown, the tabs/sheets bar is partly covered by it. This is a problem when there are many sheets in the calc document because it is impossible to switch to last few sheets because sidebar covers those entries in the tabs-bar. This patch adjusts the tab-bar container's width according to sidebar width changes just like how formula-input canvas width is adjusted. This also includes some css adjustments neccessary to hide the ugly browser induced vertical-scrollbar for the child of tabs container when adjusting the width of the container. Change-Id: Iea3a658926d6f563a970bb9b6da9807818d36c26 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89897 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro Reviewed-by: Michael Meeks diff --git a/loleaflet/css/spreadsheet.css b/loleaflet/css/spreadsheet.css index 35b8863a7..bf70c9663 100644 --- a/loleaflet/css/spreadsheet.css +++ b/loleaflet/css/spreadsheet.css @@ -35,7 +35,8 @@ width: 100%; height: 100%; overflow: auto; - padding-bottom: 20px; /* to hide the scroolbar */ + padding-bottom: 20px; /* to hide the horizontal scrollbar */ + padding-right: 5px; /* to hide the vertical scrollbar */ margin-left: 6px; } diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index d106b1504..a58766c21 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -1368,6 +1368,7 @@ L.Control.LokDialog = L.Control.extend({ spreadsheetRowColumnFrame.style.right = width.toString() + 'px'; this._adjustCalcInputBar(deckOffset); + this._adjustTabsBar(width); // If we didn't have the focus, don't steal it form the editor. if ($('#' + this._currentDeck.strId + '-cursor').css('display') === 'none') { if (this._map.editorHasFocus()) { @@ -1395,6 +1396,29 @@ L.Control.LokDialog = L.Control.extend({ } }, + _adjustTabsBar: function(deckNewWidth) { + + if (this._map.getDocType() !== 'spreadsheet') { + return; + } + + // This is called only if sidebar is made visible or hidden, so no need of + // special-casing for mobile where that never happens. + // In the case of tablets, when sidebar is made visible/hidden the below adjustments + // will work correctly like in desktop-online (verified with chrome-tablet emulator). + + var tabsContainer = L.DomUtil.get('spreadsheet-tabs-container-id'); + if (!tabsContainer) { + return; + } + + var docWidth = L.DomUtil.get('spreadsheet-toolbar').getBoundingClientRect().width; + var tabsContainerLeft = tabsContainer.getBoundingClientRect().left; + var deckMargin = (deckNewWidth === 0) ? 0 : 10; + + tabsContainer.style.width = (docWidth - tabsContainerLeft - deckNewWidth - deckMargin) + 'px'; + }, + _onDialogChildClose: function(dialogId) { $('#' + this._toStrId(dialogId) + '-floating').remove(); if (!this._isSidebar(dialogId) && !this._isCalcInputBar(dialogId)) { diff --git a/loleaflet/src/control/Control.Tabs.js b/loleaflet/src/control/Control.Tabs.js index 0997d7dd9..8c56372da 100644 --- a/loleaflet/src/control/Control.Tabs.js +++ b/loleaflet/src/control/Control.Tabs.js @@ -42,6 +42,7 @@ L.Control.Tabs = L.Control.extend({ var map = this._map; var docContainer = map.options.documentContainer; this._tabsCont = L.DomUtil.create('div', 'spreadsheet-tabs-container', docContainer.parentElement); + this._tabsCont.id = 'spreadsheet-tabs-container-id'; this._menuItem = { 'insertsheetbefore': {name: _('Insert sheet before this'), ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Toolbar.js |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 824f48c447ff2af8814a5ae28bb58ce820357430 Author: Dennis Francis AuthorDate: Wed Mar 4 14:57:23 2020 +0530 Commit: Henry Castro CommitDate: Fri Mar 6 14:15:10 2020 +0100 On clicking last-sheet button, scroll to last tab Before this patch, it used to scroll a fixed 120 px and does not guarantee the visibility of the last tab especially if there are lots of sheets in the document. For scrolling to last tab, just use native scrollLeft attribute rather than relying on jquery. On setting native scrollLeft to a very high value, it ensures that it scrolls to the maximum possible level (and shows the last tab) according to MDN scrollLeft documentation. https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft Sadly jquery documentation for its scrollLeft() does not mention anything about the behaviour on setting a very high value(more than maximum scroll), even though it appears to work. Change-Id: I05142c1d3d63551fa2dc8359e41e30edc78a7d09 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89948 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 95c36dedd..5bd13e147 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -265,7 +265,9 @@ function onClick(e, id, item, subItem) { $('#spreadsheet-tab-scroll').scrollLeft($('#spreadsheet-tab-scroll').scrollLeft() - 30); } else if (id === 'lastrecord') { - $('#spreadsheet-tab-scroll').scrollLeft($('#spreadsheet-tab-scroll').scrollLeft() + 120); + // Set a very high value, so that scroll is set to the maximum possible value internally. + // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft + L.DomUtil.get('spreadsheet-tab-scroll').scrollLeft = 10; } else if (id === 'insertgraphic' || item.id === 'localgraphic') { L.DomUtil.get('insertgraphic').click(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Tabs.js | 15 +++ 1 file changed, 15 insertions(+) New commits: commit 9d412a164e3931b154b0c6d348bb4576609d882a Author: Dennis Francis AuthorDate: Wed Mar 4 13:38:42 2020 +0530 Commit: Henry Castro CommitDate: Fri Mar 6 13:33:32 2020 +0100 Remember the horizontal scroll position of calc tab-bar Whenever the tab-bar contents are updated, restore the last known scroll position. This fixes a very annoying problem while selecting a sheet in a document with many many sheets. Everytime the user selects a sheet (closer to the last sheet), the tab-bar's scroll position is reset to sheet#1, so if the user wants to select another sheet near the last sheet, they have to scroll again a lot to see it. Change-Id: I7e79b6e1a7b19223e1dbd9b3aab6c6f2b4d422b2 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89946 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro diff --git a/loleaflet/src/control/Control.Tabs.js b/loleaflet/src/control/Control.Tabs.js index 7d5e12e94..0997d7dd9 100644 --- a/loleaflet/src/control/Control.Tabs.js +++ b/loleaflet/src/control/Control.Tabs.js @@ -98,7 +98,16 @@ L.Control.Tabs = L.Control.extend({ }, this), 100); this._tabsInitialized = true; } + + // Save scroll position + var horizScrollPos = 0; + var scrollDiv = L.DomUtil.get('spreadsheet-tab-scroll'); + if (scrollDiv) { + horizScrollPos = scrollDiv.scrollLeft; + } + if ('partNames' in e) { + while (this._tabsCont.firstChild) { this._tabsCont.removeChild(this._tabsCont.firstChild); } @@ -151,6 +160,12 @@ L.Control.Tabs = L.Control.extend({ L.DomUtil.addClass(this._spreadsheetTabs[key], 'spreadsheet-tab-selected'); } } + + // Restore horizontal scroll position + scrollDiv = L.DomUtil.get('spreadsheet-tab-scroll'); + if (scrollDiv) { + scrollDiv.scrollLeft = horizScrollPos; + } } }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: chart2/source
chart2/source/controller/sidebar/ChartColorWrapper.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 5f193d851e3567e1018a61763846698e02ce38ec Author: Dennis Francis AuthorDate: Sun Feb 23 22:38:15 2020 +0530 Commit: Andras Timar CommitDate: Fri Feb 28 22:54:43 2020 +0100 chart2: Fix the color uno command in ChartColorWrapper The uno command for color depends on the property name. For LineColor it should be .uno:XLineColor and the only other case is FillColor for which it should be .uno:FillColor. Without this fix, on selecting the chart for editing the first time, the sidebar line-color control is disabled as a side-effect. Change-Id: Ia71ed2f6d9e0f31523f1415f3ee089fd9d7d1b2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89304 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit 9a80969f3115fc33778005861442f91127344dc0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89677 Tested-by: Jenkins diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx b/chart2/source/controller/sidebar/ChartColorWrapper.cxx index 9a8c568a863d..d9903b12c275 100644 --- a/chart2/source/controller/sidebar/ChartColorWrapper.cxx +++ b/chart2/source/controller/sidebar/ChartColorWrapper.cxx @@ -96,12 +96,15 @@ void ChartColorWrapper::updateModel(const css::uno::Reference xPropSet = getPropSet(mxModel); if (!xPropSet.is()) return; css::util::URL aUrl; -aUrl.Complete = ".uno:FillColor"; +aUrl.Complete = (maPropertyName == aLineColor) ? aCommands[0] : aCommands[1]; css::frame::FeatureStateEvent aEvent; aEvent.FeatureURL = aUrl; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: chart2/source
chart2/source/controller/main/ChartController_Window.cxx | 11 --- 1 file changed, 11 deletions(-) New commits: commit 88aadbaf9f28c4c0b78f70dc23911f085f158280 Author: Dennis Francis AuthorDate: Fri Feb 21 17:02:32 2020 +0530 Commit: Andras Timar CommitDate: Fri Feb 28 15:07:11 2020 +0100 Remove unused lokit-only selection properties in.. CID string for charts. This is messing up the parsing of CID string in ObjectIdentifier::getObjectType() and elsewhere where parsing CID is attempted, which inturn causes at least the sidebar's chart line properties listboxes not getting updated. The selection properties insertion in chart CID was introduced in commit 3d705b98ca7f40a44f632f5565407274322ffde3 but these are not even used in online as of present. Change-Id: Ic8040d84e1ad16f182fc7bdc3a9f533ad9664458 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89300 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89697 Tested-by: Jenkins diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index c7b753dda1dc..e7b999eb604e 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -1693,17 +1693,6 @@ uno::Any SAL_CALL ChartController::getSelection() OUString aCID( m_aSelection.getSelectedCID() ); if ( !aCID.isEmpty() ) { -if ( comphelper::LibreOfficeKit::isActive() ) -{ -sal_Int32 nPos = aCID.lastIndexOf('/'); -OUString sFirst = aCID.copy(0, nPos); -OUString sSecond = aCID.copy(nPos); -aCID = sFirst + -"/Draggable=" + OUString::number(static_cast(isSelectedObjectDraggable())) + -":Resizable=" + OUString::number(static_cast(isSelectedObjectResizable())) + -":Rotatable=" + OUString::number(static_cast(isSelectedObjectRotatable())) + -sSecond; -} aReturn <<= aCID; } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js |4 1 file changed, 4 insertions(+) New commits: commit c22b29f864c8ce8b6a1a41251f3a7039de91b88b Author: Dennis Francis AuthorDate: Wed Feb 26 21:50:03 2020 +0530 Commit: Jan Holesovsky CommitDate: Thu Feb 27 18:12:00 2020 +0100 Fix js crash when jsdialog invoked on piecharts For some reason, the parsed jsdialog message for piecharts in calc has element(s) with children that evaluates to undefined. Although we need to fix why there is such an child for any ui object, this is a quick fix that skips such entries, so that the chart dialog is shown without a crash in the console. Else the dialog wont appear. Change-Id: Iff11051bf775ece63ac9f0ca180b3c76d7d14e84 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89563 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 45a00d502..27781a8f8 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1595,6 +1595,8 @@ L.Control.JSDialogBuilder = L.Control.extend({ } for (var idx = 0; idx < data.length; ++idx) { + if (!data[idx]) + continue; var controlId = data[idx].id; if (controlId && this._missingLabelData.hasOwnProperty(controlId)) { data.splice(idx, 0, this._missingLabelData[controlId]); @@ -1613,6 +1615,8 @@ L.Control.JSDialogBuilder = L.Control.extend({ this._amendJSDialogData(data); for (var childIndex in data) { var childData = data[childIndex]; + if (!childData) + continue; this._parentize(childData); var childType = childData.type; var processChildren = true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-0' - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js |4 1 file changed, 4 insertions(+) New commits: commit 19190f539e10358dd7584e34438d8d11f9ec2498 Author: Dennis Francis AuthorDate: Wed Feb 26 21:50:03 2020 +0530 Commit: Jan Holesovsky CommitDate: Wed Feb 26 21:58:06 2020 +0100 Fix js crash when jsdialog invoked on piecharts For some reason, the parsed jsdialog message for piecharts in calc has element(s) with children that evaluates to undefined. Although we need to fix why there is such an child for any ui object, this is a quick fix that skips such entries, so that the chart dialog is shown without a crash in the console. Else the dialog wont appear. Change-Id: Iff11051bf775ece63ac9f0ca180b3c76d7d14e84 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89574 Tested-by: Jan Holesovsky Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 45a00d502..27781a8f8 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1595,6 +1595,8 @@ L.Control.JSDialogBuilder = L.Control.extend({ } for (var idx = 0; idx < data.length; ++idx) { + if (!data[idx]) + continue; var controlId = data[idx].id; if (controlId && this._missingLabelData.hasOwnProperty(controlId)) { data.splice(idx, 0, this._missingLabelData[controlId]); @@ -1613,6 +1615,8 @@ L.Control.JSDialogBuilder = L.Control.extend({ this._amendJSDialogData(data); for (var childIndex in data) { var childData = data[childIndex]; + if (!childData) + continue; this._parentize(childData); var childType = childData.type; var processChildren = true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - chart2/source
chart2/source/controller/main/ChartController_Window.cxx | 11 --- 1 file changed, 11 deletions(-) New commits: commit eea0bc558fc1ac8d5c1537df2cf95f73720f3620 Author: Dennis Francis AuthorDate: Fri Feb 21 17:02:32 2020 +0530 Commit: Andras Timar CommitDate: Mon Feb 24 14:13:29 2020 +0100 Remove unused lokit-only selection properties in.. CID string for charts. This is messing up the parsing of CID string in ObjectIdentifier::getObjectType() and elsewhere where parsing CID is attempted, which inturn causes at least the sidebar's chart line properties listboxes not getting updated. The selection properties insertion in chart CID was introduced in commit 3d705b98ca7f40a44f632f5565407274322ffde3 but these are not even used in online as of present. Change-Id: Ic8040d84e1ad16f182fc7bdc3a9f533ad9664458 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89300 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index e3d65bd670d7..8cd01a2e1e09 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -1691,17 +1691,6 @@ uno::Any SAL_CALL ChartController::getSelection() OUString aCID( m_aSelection.getSelectedCID() ); if ( !aCID.isEmpty() ) { -if ( comphelper::LibreOfficeKit::isActive() ) -{ -sal_Int32 nPos = aCID.lastIndexOf('/'); -OUString sFirst = aCID.copy(0, nPos); -OUString sSecond = aCID.copy(nPos); -aCID = sFirst; -aCID += "/Draggable=" + OUString::number(static_cast(isSelectedObjectDraggable())); -aCID += ":Resizable=" + OUString::number(static_cast(isSelectedObjectResizable())); -aCID += ":Rotatable=" + OUString::number(static_cast(isSelectedObjectRotatable())); -aCID += sSecond; -} aReturn <<= aCID; } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - chart2/source
chart2/source/controller/sidebar/ChartColorWrapper.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 9a80969f3115fc33778005861442f91127344dc0 Author: Dennis Francis AuthorDate: Sun Feb 23 22:38:15 2020 +0530 Commit: Andras Timar CommitDate: Mon Feb 24 14:12:41 2020 +0100 chart2: Fix the color uno command in ChartColorWrapper The uno command for color depends on the property name. For LineColor it should be .uno:XLineColor and the only other case is FillColor for which it should be .uno:FillColor. Without this fix, on selecting the chart for editing the first time, the sidebar line-color control is disabled as a side-effect. Change-Id: Ia71ed2f6d9e0f31523f1415f3ee089fd9d7d1b2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89304 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx b/chart2/source/controller/sidebar/ChartColorWrapper.cxx index 49a3cf5b9eba..b47d6fd6c2aa 100644 --- a/chart2/source/controller/sidebar/ChartColorWrapper.cxx +++ b/chart2/source/controller/sidebar/ChartColorWrapper.cxx @@ -94,12 +94,15 @@ void ChartColorWrapper::updateModel(const css::uno::Reference xPropSet = getPropSet(mxModel); if (!xPropSet.is()) return; css::util::URL aUrl; -aUrl.Complete = ".uno:FillColor"; +aUrl.Complete = (maPropertyName == aLineColor) ? aCommands[0] : aCommands[1]; css::frame::FeatureStateEvent aEvent; aEvent.FeatureURL = aUrl; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 36 +++ 1 file changed, 36 insertions(+) New commits: commit 075142ece04262c7e110828937bca64fb02bdbcb Author: Dennis Francis AuthorDate: Wed Feb 19 10:49:16 2020 +0530 Commit: Andras Timar CommitDate: Fri Feb 21 14:49:17 2020 +0100 Add Label for the line-style listbox in jsdialog The Line-style listbox selector(shape properties) in mobile online is missing a label, so to make it clear lets add a label for it. Adding an invisible label for line-style listbox in core.git does not work as invisible widgets are not dumped by core to generate jsdialog messages. So the next option is to splice in a label entry to the parsed jsdialog message at the appropriate place. This also makes it easier for adding any missing labels, by just needing to add the id of the control and the label text. Change-Id: I45913ec25278e8566092a738c08cfdd8bc46e39f Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88994 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 809de4333..0bd17ce36 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1574,7 +1574,43 @@ L.Control.JSDialogBuilder = L.Control.extend({ data.parent = parent; }, + _addMissingLabels: function(data) { + if (!this._missingLabelData) { + this._missingLabelData = {}; + var labelData = { + // This adds a label widget just before the + // control with id 'linestyle' + 'linestyle' : _('Line style') + }; + + var mLD = this._missingLabelData; + Object.keys(labelData).forEach(function(controlId) { + mLD[controlId] = { + id: controlId + 'label', + type: 'fixedtext', + text: labelData[controlId], + enabled: 'true' + }; + }); + } + + for (var idx = 0; idx < data.length; ++idx) { + var controlId = data[idx].id; + if (controlId && this._missingLabelData.hasOwnProperty(controlId)) { + data.splice(idx, 0, this._missingLabelData[controlId]); + ++idx; + } + } + }, + + _amendJSDialogData: function(data) { + // Called from build() which is already recursive, + // so no need to recurse here over 'data'. + this._addMissingLabels(data); + }, + build: function(parent, data) { + this._amendJSDialogData(data); for (var childIndex in data) { var childData = data[childIndex]; this._parentize(childData); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Scroll.js | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) New commits: commit 0ca8e3b63946862dad47163e448fca84741421d2 Author: Dennis Francis AuthorDate: Fri Feb 14 18:11:37 2020 +0530 Commit: Dennis Francis CommitDate: Fri Feb 14 15:26:07 2020 +0100 Lets have Hammer pan listeners on scroll-container... and delegate the pan events to L.Map.TouchGesture's pan handlers. This solves the problem that if one starts to pan the sheet from near the right edge (where the vertical scroll div exists), no panning takes place. This is because the vertical scroll div is managed by custom jquery plugin and has a high z-index and mapPane is not an ancestor of it, so mapPane will not get the touch events even with event bubble-up. But its ancestor div 'scroll-container' still gets touch/move events and has the same size and location as that of mapPane. So we just need to register Hammer for pan events for scroll-container and delegate these events to the original pan handlers of mapPane without any change to the event coordinates. The scroll widget and the drag-rail still function as usual as they are succesors of scroll-container and they get all the events they need to handle. Change-Id: Ie4ffe07a0889c5710b2c6d09e4eb90f0671b5ad0 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88712 Reviewed-by: Michael Meeks Tested-by: Jenkins CollaboraOffice diff --git a/loleaflet/src/control/Control.Scroll.js b/loleaflet/src/control/Control.Scroll.js index 91da67f41..8988df9ea 100644 --- a/loleaflet/src/control/Control.Scroll.js +++ b/loleaflet/src/control/Control.Scroll.js @@ -3,7 +3,7 @@ * L.Control.Scroll handles scrollbars */ -/* global $ clearTimeout setTimeout */ +/* global $ clearTimeout setTimeout Hammer */ L.Control.Scroll = L.Control.extend({ onAdd: function (map) { @@ -62,6 +62,22 @@ L.Control.Scroll = L.Control.extend({ alwaysTriggerOffsets: false } }); + + if (!this._hammer && map.touchGesture) { + this._hammer = new Hammer(this._scrollContainer); + this._hammer.get('pan').set({ + direction: Hammer.DIRECTION_ALL + }); + + if (L.Browser.touch) { + L.DomEvent.on(this._scrollContainer, 'touchmove', L.DomEvent.preventDefault); + } + + var mapTouchGesture = map.touchGesture; + this._hammer.on('panstart', L.bind(mapTouchGesture._onPanStart, mapTouchGesture)); + this._hammer.on('pan', L.bind(mapTouchGesture._onPan, mapTouchGesture)); + this._hammer.on('panend', L.bind(mapTouchGesture._onPanEnd, mapTouchGesture)); + } }, _onCalcScroll: function (e) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/dochdl/swdtflvr.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 7155d0011ecde39c9ea27ef19d475686d80574ee Author: Dennis Francis AuthorDate: Fri Feb 7 12:08:21 2020 +0530 Commit: Andras Timar CommitDate: Wed Feb 12 21:27:58 2020 +0100 Classify shape(s) selections as 'complex'... in isComplex() of XTransferable2 implementation SwTransferable. This method is used by online via doc_getSelectionType() to determine the type of selection. In writer this method used to classify shape objects as non-complex which translates to 'text' in online, so if a shape is selected in online, the js code there would treat it as text. This is problematic when you want to send the correct align uno commands based on selection type. So returning true in isComplex() for writer would correctly treat the shape selections as 'complex' in online Writer. Change-Id: I09fcd9e4fab48aa0d7e7d04c88bae9e1281a1b0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88158 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky (cherry picked from commit c7178a12e6e57e3d85cecd09e9c0373ececbb33f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88495 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index a0230ef3630a..6dbb5c50046b 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -455,6 +455,9 @@ sal_Bool SAL_CALL SwTransferable::isComplex() } } +if (m_pWrtShell->GetSelectionType() == SelectionType::DrawObject) +return true; // Complex + // Simple return false; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/shells/drwbassh.cxx | 53 +-- 1 file changed, 44 insertions(+), 9 deletions(-) New commits: commit f5f39903f44f131c6d583ae056412dadee265d10 Author: Dennis Francis AuthorDate: Fri Feb 7 12:49:59 2020 +0530 Commit: Andras Timar CommitDate: Wed Feb 12 14:25:17 2020 +0100 Get the align states of draw-shapes in... SwDrawBaseShell::GetState() so that the align buttons are informed (in core desktop and online via statechange messages) Change-Id: Ic69fb03bc98f39b1a6a389d50d3d6404fefd7f29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88159 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88453 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index cb44b8955e31..18fce24f2c94 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -691,18 +691,53 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet) case SID_OBJECT_ALIGN_MIDDLE: case SID_OBJECT_ALIGN_DOWN: case SID_OBJECT_ALIGN: -if ( !rSh.IsAlignPossible() || bProtected ) -rSet.DisableItem( nWhich ); -else if ( rSh.GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { +bool bDisableThis = false; +bool bDisableHoriz = false; +bool bHoriz = (nWhich == SID_OBJECT_ALIGN_LEFT || nWhich == SID_OBJECT_ALIGN_CENTER || +nWhich == SID_OBJECT_ALIGN_RIGHT); const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); -//if only one object is selected it can only be vertically -// aligned because it is character bound -if( rMarkList.GetMarkCount() == 1 ) +if ( !rSh.IsAlignPossible() || bProtected ) +{ +bDisableThis = true; +rSet.DisableItem( nWhich ); +} +else if ( rSh.GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { -rSet.DisableItem(SID_OBJECT_ALIGN_LEFT); -rSet.DisableItem(SID_OBJECT_ALIGN_CENTER); -rSet.DisableItem(SID_OBJECT_ALIGN_RIGHT); +//if only one object is selected it can only be vertically +// aligned because it is character bound +if( rMarkList.GetMarkCount() == 1 ) +{ +bDisableHoriz = true; +rSet.DisableItem(SID_OBJECT_ALIGN_LEFT); +rSet.DisableItem(SID_OBJECT_ALIGN_CENTER); +rSet.DisableItem(SID_OBJECT_ALIGN_RIGHT); +} +} + +if (bHoriz && !bDisableThis && !bDisableHoriz && +rMarkList.GetMarkCount() == 1) +{ +sal_Int16 nHoriOrient = -1; +switch(nWhich) +{ +case SID_OBJECT_ALIGN_LEFT: +nHoriOrient = text::HoriOrientation::LEFT; +break; +case SID_OBJECT_ALIGN_CENTER: +nHoriOrient = text::HoriOrientation::CENTER; +break; +case SID_OBJECT_ALIGN_RIGHT: +nHoriOrient = text::HoriOrientation::RIGHT; +break; +default: +break; +} + +SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); +SwFrameFormat* pFrameFormat = FindFrameFormat(pObj); +SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT)); +rSet.Put(SfxBoolItem(nWhich, aHOrient.GetHoriOrient() == nHoriOrient)); } } break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source sfx2/source svx/sdi sw/source
desktop/source/lib/init.cxx |5 - sfx2/source/control/unoctitm.cxx |5 - svx/sdi/svx.sdi | 12 ++-- sw/source/uibase/shells/frmsh.cxx | 23 +++ 4 files changed, 37 insertions(+), 8 deletions(-) New commits: commit da076834794a1fa00c51ffeb09ee3f724001dc89 Author: Dennis Francis AuthorDate: Thu Feb 6 12:23:21 2020 +0530 Commit: Andras Timar CommitDate: Wed Feb 12 14:24:52 2020 +0100 Allow boolean valued statechange messages for... object align commands : ObjectAlignLeft [SID_OBJECT_ALIGN_LEFT] ObjectAlignRight [SID_OBJECT_ALIGN_RIGHT] AlignCenter [SID_OBJECT_ALIGN_CENTER] What is pending is to set correct align state items for Impress in DrawViewShell::GetMenuStateSel(). For doing that we need to store the object align state somewhere when we execute SID_OBJECT_ALIGN_* in DrawViewShell::FuTemporary(). For Writer the align state information was already available in frame-format-manager object. Change-Id: I86fcf59cfc66af98097611277201ecaa3b8c22cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88077 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88452 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 90989c45df96..34b6155975c5 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2655,7 +2655,10 @@ static void doc_iniUnoCommands () OUString(".uno:InsertSymbol"), OUString(".uno:EditRegion"), OUString(".uno:ThesaurusDialog"), -OUString(".uno:Orientation") +OUString(".uno:Orientation"), +OUString(".uno:ObjectAlignLeft"), +OUString(".uno:ObjectAlignRight"), +OUString(".uno:AlignCenter") }; util::URL aCommandURL; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 28276ddf3df7..1eac0a9c7964 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1006,7 +1006,10 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c aEvent.FeatureURL.Path == "AlignLeft" || aEvent.FeatureURL.Path == "AlignHorizontalCenter" || aEvent.FeatureURL.Path == "AlignRight" || -aEvent.FeatureURL.Path == "DocumentRepair") +aEvent.FeatureURL.Path == "DocumentRepair" || +aEvent.FeatureURL.Path == "ObjectAlignLeft" || +aEvent.FeatureURL.Path == "ObjectAlignRight" || +aEvent.FeatureURL.Path == "AlignCenter") { bool bTemp = false; aEvent.State >>= bTemp; diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 2567e08906b0..d8a8af6c71e6 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -106,10 +106,10 @@ SfxBoolItem Polygon SID_DRAW_POLYGON GroupId = SfxGroupId::Drawing; ] -SfxVoidItem AlignCenter SID_OBJECT_ALIGN_CENTER +SfxBoolItem AlignCenter SID_OBJECT_ALIGN_CENTER () [ -AutoUpdate = FALSE, +AutoUpdate = TRUE, FastCall = FALSE, ReadOnlyDoc = FALSE, Toggle = FALSE, @@ -142,10 +142,10 @@ SfxVoidItem AlignDown SID_OBJECT_ALIGN_DOWN ] -SfxVoidItem ObjectAlignLeft SID_OBJECT_ALIGN_LEFT +SfxBoolItem ObjectAlignLeft SID_OBJECT_ALIGN_LEFT () [ -AutoUpdate = FALSE, +AutoUpdate = TRUE, FastCall = FALSE, ReadOnlyDoc = FALSE, Toggle = FALSE, @@ -197,10 +197,10 @@ SfxVoidItem AlignMiddle SID_OBJECT_ALIGN_MIDDLE ] -SfxVoidItem ObjectAlignRight SID_OBJECT_ALIGN_RIGHT +SfxBoolItem ObjectAlignRight SID_OBJECT_ALIGN_RIGHT () [ -AutoUpdate = FALSE, +AutoUpdate = TRUE, FastCall = FALSE, ReadOnlyDoc = FALSE, Toggle = FALSE, diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 3f139e81f0cc..61ab59bfc00e 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -793,7 +793,30 @@ void SwFrameShell::GetState(SfxItemSet& rSet) bProtect || ((nWhich == FN_FRAME_ALIGN_HORZ_CENTER || nWhich == SID_OBJECT_ALIGN_CENTER) && bHtmlMode )) +{ rSet.DisableItem( nWhich ); +} +else +{ +sal_Int16 nHoriOrient = -1; +switch(nWhich) +{ +case SID_OBJECT_ALIGN_LEFT: +nHoriOrient = text::HoriOrientation::LEFT; +break; +case SID_OBJECT_ALIGN_CENT
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.ContextMenu.js | 27 +-- loleaflet/src/unocommands.js |5 + 2 files changed, 26 insertions(+), 6 deletions(-) New commits: commit 5460aa108c10f044a20863b5fe82efa921a51291 Author: Dennis Francis AuthorDate: Tue Feb 11 15:34:41 2020 +0530 Commit: Andras Timar CommitDate: Wed Feb 12 11:18:40 2020 +0100 Add 'Delete' to context menu on non-text selection The context menu items are obtained from core. Add a 'Delete' entry to the context-menu json data just after 'Paste' only if the selection is graphic and online is in Mobile mode. Change-Id: Ie5810038bbca5d8ace01b236508b2dd4d31ca2a7 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88510 Tested-by: Andras Timar Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index 83a57730c..9912729ce 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -20,7 +20,7 @@ L.Control.ContextMenu = L.Control.extend({ * in following list is just for reference and ease of locating uno command * from context menu structure. */ - general: ['Cut', 'Copy', 'Paste', + general: ['Cut', 'Copy', 'Paste', 'Delete', 'NumberingStart', 'ContinueNumbering', 'IncrementLevel', 'DecrementLevel', 'OpenHyperlinkOnCursor', 'CopyHyperlinkLocation', 'RemoveHyperlink', 'AnchorMenu', 'SetAnchorToPage', 'SetAnchorToPara', 'SetAnchorAtChar', @@ -104,6 +104,8 @@ L.Control.ContextMenu = L.Control.extend({ this._onClosePopup(); } + this._amendContextMenuData(obj); + var contextMenu = this._createContextMenuStructure(obj); var spellingContextMenu = false; for (var menuItem in contextMenu) { @@ -154,6 +156,27 @@ L.Control.ContextMenu = L.Control.extend({ } }, + _amendContextMenuData: function(obj) { + + // Add a 'delete' entry for mobile when selection is ole/image/shape + if (this._map._clip && this._map._clip._selectionType === 'complex' && + window.mode.isMobile()) { + + var insertIndex = -1; + obj.menu.forEach(function(item, index) { + if (item.command === '.uno:Paste') { + insertIndex = index + 1; + } + }); + + if (insertIndex != -1) { + obj.menu.splice(insertIndex, 0, + { text: _('Delete'), type: 'command', command: '.uno:Delete', enabled: true }); + } + } + + }, + _createContextMenuStructure: function(obj) { var docType = this._map.getDocType(); var contextMenu = {}; @@ -205,7 +228,7 @@ L.Control.ContextMenu = L.Control.extend({ item.command = '.uno:HideNote'; } - if (hasParam || commandName === 'None' || commandName === 'FontDialogForParagraph') { + if (hasParam || commandName === 'None' || commandName === 'FontDialogForParagraph' || commandName === 'Delete') { itemName = window.removeAccessKey(item.text); itemName = itemName.replace(' ', '\u00a0'); } else { diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js index 08335e9f1..82a07e0a9 100644 --- a/loleaflet/src/unocommands.js +++ b/loleaflet/src/unocommands.js @@ -57,6 +57,7 @@ var unoCommandsArray = { DefaultBullet:{global:{context:_('Toggle Bulleted List'),menu:_('~Bulleted List'),},}, DefaultNumbering:{global:{context:_('Toggle Numbered List'),menu:_('~Numbered List'),},}, DelBreakMenu:{spreadsheet:{menu:_('Delete Page ~Break'),},}, + Delete:{global:{menu:_('Delete C~ontents...'),},spreadsheet:{context:_('Cl~ear Contents...'),menu:_('Cle~ar Cells...'),},}, DeleteAllNotes:{global:{menu:_('Delete All Comments'),},spreadsheet:{menu:_('Delete All Comments'),},}, DeleteAuthor:{global:{menu:_('Delete All Comments by This Author'),},}, DeleteAxis:{global:{menu:_('Delete Axis'),},}, @@ -117,7 +118,6 @@ var unoCommandsArray = { FormatYErrorBars:{global:{menu:_('Format Y Error Bars...'),},}, FormattingMarkMenu:{global:{menu:_('Formatting Mark'),},}, Fu
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.ColumnHeader.js | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) New commits: commit 002691d56c215f1df535f0fe342145f1f9964494 Author: Dennis Francis AuthorDate: Fri Feb 7 13:44:03 2020 +0530 Commit: Jan Holesovsky CommitDate: Tue Feb 11 09:45:05 2020 +0100 zoom-adjust header-height only when we have edit permissions The patch : - commit ab64d2e0c315d26c358ff99548bb7353708eab6b Author: Dennis Francis Date: Wed Jan 29 13:38:16 2020 +0530 Adjust column-header height with zoom-level too -- introduced adjusting of column header height with zoom level. But that messes up the positions of headers in the below scenario: 1. First zoom-in or out in mobile mode before enabling edit permissions 2. Then enable edit permissions, and now the header positions are all messed up. This happens because the formulabar ui is show only while in edit-mode and the resize() method is not very robust(it adjusts 'top' style attribute with height deltas) and does not consider the introduction of formula-bar div into account when one changes the permission of the sheet from 'readonly' to 'edit' in mobile mode. So lets not do resize() of the column-header container before entering edit mode and avoid complications of adjusting for the introduction of the formula-bar. Change-Id: Ib03f89ad7a34cbd2a3cbfb65af2a9a016b47c125 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88175 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js index 76c536e17..8c049fd93 100644 --- a/loleaflet/src/control/Control.ColumnHeader.js +++ b/loleaflet/src/control/Control.ColumnHeader.js @@ -389,12 +389,14 @@ L.Control.ColumnHeader = L.Control.Header.extend({ this._setCanvasWidth(); this._setCanvasHeight(); this._canvasContext.clearRect(0, 0, canvas.width, canvas.height); - // Adjust (column) _headerHeight according to zoomlevel. This is used below to call resize() - // where column/corner header are resized. Besides the document container and row header container - // are moved up or down as required so that there is no gap/overlap below column header. - // Limit zoomScale so that the column header is not too small (unreadable) or too big. - this._headerHeight = Math.ceil(this._canvasBaseHeight * - this.getHeaderZoomScale(/* lowerBound */ 0.74, /* upperBound */ 1.15)); + if (this._map._permission === 'edit') { + // Adjust (column) _headerHeight according to zoomlevel. This is used below to call resize() + // where column/corner header are resized. Besides the document container and row header container + // are moved up or down as required so that there is no gap/overlap below column header. + // Limit zoomScale so that the column header is not too small (unreadable) or too big. + this._headerHeight = Math.ceil(this._canvasBaseHeight * + this.getHeaderZoomScale(/* lowerBound */ 0.74, /* upperBound */ 1.15)); + } // Reset state this._current = -1; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/source
sw/source/uibase/dochdl/swdtflvr.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit c7178a12e6e57e3d85cecd09e9c0373ececbb33f Author: Dennis Francis AuthorDate: Fri Feb 7 12:08:21 2020 +0530 Commit: Jan Holesovsky CommitDate: Mon Feb 10 12:51:39 2020 +0100 Classify shape(s) selections as 'complex'... in isComplex() of XTransferable2 implementation SwTransferable. This method is used by online via doc_getSelectionType() to determine the type of selection. In writer this method used to classify shape objects as non-complex which translates to 'text' in online, so if a shape is selected in online, the js code there would treat it as text. This is problematic when you want to send the correct align uno commands based on selection type. So returning true in isComplex() for writer would correctly treat the shape selections as 'complex' in online Writer. Change-Id: I09fcd9e4fab48aa0d7e7d04c88bae9e1281a1b0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88158 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index ea12ee91601a..b9cce5ee9579 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -415,6 +415,9 @@ sal_Bool SAL_CALL SwTransferable::isComplex() } } +if (m_pWrtShell->GetSelectionType() == SelectionType::DrawObject) +return true; // Complex + // Simple return false; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Toolbar.js | 35 +++ 1 file changed, 35 insertions(+) New commits: commit a43c8c304dc7580982f374d7360ea0c408333bcf Author: Dennis Francis AuthorDate: Thu Feb 6 14:36:57 2020 +0530 Commit: Jan Holesovsky CommitDate: Mon Feb 10 12:07:13 2020 +0100 Use the correct align statechange messages... from core to control the state of toolbar's align buttons (based on the current selection type). Change-Id: I1c4c4ce1776091c05196d7c8257ea59f8248284a Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88160 Tested-by: Jan Holesovsky Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 6c718af9b..536c9c09c 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -1279,6 +1279,11 @@ function updateToolbarItem(toolbar, id, html) { function unoCmdToToolbarId(commandname) { var id = commandname.toLowerCase().substr(5); + var selectionType = 'text'; + + if (map._clip && map._clip._selectionType) + selectionType = map._clip._selectionType; + if (map.getDocType() === 'spreadsheet') { switch (id) { case 'alignleft': @@ -1292,6 +1297,32 @@ function unoCmdToToolbarId(commandname) break; } } + else if (selectionType == 'complex') { + + // ignore the text align state messages. + if (id === 'leftpara' || id === 'rightpara' || + id === 'centerpara') { + id = ''; + } + + // convert the object align statemessages to align button ids. + switch (id) { + case 'objectalignleft': + id = 'leftpara'; + break; + case 'aligncenter': + id = 'centerpara'; + break; + case 'objectalignright': + id = 'rightpara'; + break; + } + } + else if (id === 'objectalignleft' || id === 'aligncenter' || + id === 'objectalignright') { + // selectionType is 'text', so ignore object align state messages. + id = ''; + } return id; } @@ -1979,6 +2010,10 @@ function onCommandStateChanged(e) { } var id = unoCmdToToolbarId(commandName); + // id is set to '' by unoCmdToToolbarId() if the statechange message should be ignored. + if (id === '') + return; + if (state === 'true') { if (map._permission === 'edit') { toolbar.enable(id); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/source
sw/source/uibase/shells/drwbassh.cxx | 53 +-- 1 file changed, 44 insertions(+), 9 deletions(-) New commits: commit 4a885a4da2e7baaa8c1827a1483b76894d3c0967 Author: Dennis Francis AuthorDate: Fri Feb 7 12:49:59 2020 +0530 Commit: Miklos Vajna CommitDate: Mon Feb 10 12:02:54 2020 +0100 Get the align states of draw-shapes in... SwDrawBaseShell::GetState() so that the align buttons are informed (in core desktop and online via statechange messages) Change-Id: Ic69fb03bc98f39b1a6a389d50d3d6404fefd7f29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88159 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index 6f405026b071..21c6f9395a90 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -695,18 +695,53 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet) case SID_OBJECT_ALIGN_MIDDLE: case SID_OBJECT_ALIGN_DOWN: case SID_OBJECT_ALIGN: -if ( !rSh.IsAlignPossible() || bProtected ) -rSet.DisableItem( nWhich ); -else if ( rSh.GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { +bool bDisableThis = false; +bool bDisableHoriz = false; +bool bHoriz = (nWhich == SID_OBJECT_ALIGN_LEFT || nWhich == SID_OBJECT_ALIGN_CENTER || +nWhich == SID_OBJECT_ALIGN_RIGHT); const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); -//if only one object is selected it can only be vertically -// aligned because it is character bound -if( rMarkList.GetMarkCount() == 1 ) +if ( !rSh.IsAlignPossible() || bProtected ) +{ +bDisableThis = true; +rSet.DisableItem( nWhich ); +} +else if ( rSh.GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { -rSet.DisableItem(SID_OBJECT_ALIGN_LEFT); -rSet.DisableItem(SID_OBJECT_ALIGN_CENTER); -rSet.DisableItem(SID_OBJECT_ALIGN_RIGHT); +//if only one object is selected it can only be vertically +// aligned because it is character bound +if( rMarkList.GetMarkCount() == 1 ) +{ +bDisableHoriz = true; +rSet.DisableItem(SID_OBJECT_ALIGN_LEFT); +rSet.DisableItem(SID_OBJECT_ALIGN_CENTER); +rSet.DisableItem(SID_OBJECT_ALIGN_RIGHT); +} +} + +if (bHoriz && !bDisableThis && !bDisableHoriz && +rMarkList.GetMarkCount() == 1) +{ +sal_Int16 nHoriOrient = -1; +switch(nWhich) +{ +case SID_OBJECT_ALIGN_LEFT: +nHoriOrient = text::HoriOrientation::LEFT; +break; +case SID_OBJECT_ALIGN_CENTER: +nHoriOrient = text::HoriOrientation::CENTER; +break; +case SID_OBJECT_ALIGN_RIGHT: +nHoriOrient = text::HoriOrientation::RIGHT; +break; +default: +break; +} + +SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); +SwFrameFormat* pFrameFormat = FindFrameFormat(pObj); +SwFormatHoriOrient aHOrient(pFrameFormat->GetFormatAttr(RES_HORI_ORIENT)); +rSet.Put(SfxBoolItem(nWhich, aHOrient.GetHoriOrient() == nHoriOrient)); } } break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Toolbar.js | 31 ++- loleaflet/src/layer/tile/ImpressTileLayer.js |9 +-- loleaflet/src/layer/tile/WriterTileLayer.js | 12 +++--- 3 files changed, 41 insertions(+), 11 deletions(-) New commits: commit 1054dce67bf134f301aa2d3305f3aed3a99fb6fe Author: Dennis Francis AuthorDate: Thu Jan 30 19:00:37 2020 +0530 Commit: Jan Holesovsky CommitDate: Mon Feb 10 12:00:56 2020 +0100 Adapt align commands based on selection type Use map._clip._selectionType to decide what align command to send when one clicks on one of the toolbar align buttons. selectionType is either 'text' or 'complex'; 'complex' by definition is set for non-text selections like images and charts. What is to be done next ? 1. Need to setup statechange: messages from core.git for .uno:ObjectAlignLeft, .uno:AlignCenter, .uno:ObjectAlignRight from sw/ sd/ in Get*State() methods of the relevant shells. After this we need to make online toolbar align buttons to react to the correct statechange messages based on selectionType. 2. _selectionType is not always correct. In Impress it is always 'text' regardless of selection type. In Writer, for shape selection, it is set to 'text'. SelectionType comes from XTransferable2::isComplex(). Its implementations in sw/ and sd/ in core.git need fixing. PS: In Calc, aligning images/objects does not make sense w.r.t to the sheet in general. The align buttons are disabled in core-desktop when an image is selected. Change-Id: I8223cd03f864fa92523224bf88ccb992edfc2686 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87739 Tested-by: Jan Holesovsky Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 80c4bd57f..6c718af9b 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -103,6 +103,21 @@ function _cancelSearch() { map._onGotFocus(); } +function getUNOCommand(unoData) { + if (typeof unoData !== 'object') + return unoData; + + if (!map._clip) + return unoData.textCommand; + + var selectionType = map._clip._selectionType; + + if (!selectionType || selectionType === 'text') + return unoData.textCommand; + + return unoData.objectCommand; +} + function onClick(e, id, item, subItem) { if (w2ui['editbar'].get(id) !== null) { var toolbar = w2ui['editbar']; @@ -152,7 +167,7 @@ function onClick(e, id, item, subItem) { map.toggleCommandState(item.unosheet); } else { - map.toggleCommandState(item.uno); + map.toggleCommandState(getUNOCommand(item.uno)); } } else if (id === 'print') { @@ -884,9 +899,15 @@ function initNormalToolbar() { {type: 'color', id: 'backcolor', img: 'backcolor', hint: _UNO('.uno:BackColor', 'text'), hidden: true}, {type: 'color', id: 'backgroundcolor', img: 'backgroundcolor', hint: _UNO('.uno:BackgroundColor'), hidden: true}, {type: 'break' , id: 'breakcolor', mobile:false}, - {type: 'button', id: 'leftpara', img: 'alignleft', hint: _UNO('.uno:LeftPara', '', true), uno: 'LeftPara', hidden: true, unosheet: 'AlignLeft', disabled: true}, - {type: 'button', id: 'centerpara', img: 'alignhorizontal', hint: _UNO('.uno:CenterPara', '', true), uno: 'CenterPara', hidden: true, unosheet: 'AlignHorizontalCenter', disabled: true}, - {type: 'button', id: 'rightpara', img: 'alignright', hint: _UNO('.uno:RightPara', '', true), uno: 'RightPara', hidden: true, unosheet: 'AlignRight', disabled: true}, + {type: 'button', id: 'leftpara', img: 'alignleft', hint: _UNO('.uno:LeftPara', '', true), + uno: {textCommand: 'LeftPara', objectCommand: 'ObjectAlignLeft'}, + hidden: true, unosheet: 'AlignLeft', disabled: true}, + {type: 'button', id: 'centerpara', img: 'alignhorizontal', hint: _UNO('.uno:CenterPara', '', true), + uno: {textCommand: 'CenterPara', objectCommand: 'AlignCenter'}, + hidden: true, unosheet: 'AlignHorizontalCenter', disabled: true}, + {type: 'button', id: 'rightpara', img: 'alignright', hint: _UNO('.uno:RightPara', '', true), + uno: {textCommand: 'RightPara', objectCommand: 'ObjectAlignRight'}, + hidden: true, unosheet: 'AlignRight', disabled: true}, {type: 'button', id: 'justifypara', img: 'alignblock', hint: _UNO('.uno:JustifyPara', '', true), uno: 'JustifyPara', hidden: true, unosheet: '', disabled: true}, {type
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - desktop/source sfx2/source svx/sdi sw/source
desktop/source/lib/init.cxx |5 - sfx2/source/control/unoctitm.cxx |5 - svx/sdi/svx.sdi | 12 ++-- sw/source/uibase/shells/frmsh.cxx | 23 +++ 4 files changed, 37 insertions(+), 8 deletions(-) New commits: commit 00e1597c9a8a3451ae4d67ac0d1257c5ccac6a16 Author: Dennis Francis AuthorDate: Thu Feb 6 12:23:21 2020 +0530 Commit: Jan Holesovsky CommitDate: Mon Feb 10 11:49:54 2020 +0100 Allow boolean valued statechange messages for... object align commands : ObjectAlignLeft [SID_OBJECT_ALIGN_LEFT] ObjectAlignRight [SID_OBJECT_ALIGN_RIGHT] AlignCenter [SID_OBJECT_ALIGN_CENTER] What is pending is to set correct align state items for Impress in DrawViewShell::GetMenuStateSel(). For doing that we need to store the object align state somewhere when we execute SID_OBJECT_ALIGN_* in DrawViewShell::FuTemporary(). For Writer the align state information was already available in frame-format-manager object. Change-Id: I86fcf59cfc66af98097611277201ecaa3b8c22cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88077 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 8916065bc273..aa6452e3d2cd 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2656,7 +2656,10 @@ static void doc_iniUnoCommands () OUString(".uno:InsertSymbol"), OUString(".uno:EditRegion"), OUString(".uno:ThesaurusDialog"), -OUString(".uno:Orientation") +OUString(".uno:Orientation"), +OUString(".uno:ObjectAlignLeft"), +OUString(".uno:ObjectAlignRight"), +OUString(".uno:AlignCenter") }; util::URL aCommandURL; diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index b95ed01dc784..7bc2cad90b63 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1006,7 +1006,10 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c aEvent.FeatureURL.Path == "AlignLeft" || aEvent.FeatureURL.Path == "AlignHorizontalCenter" || aEvent.FeatureURL.Path == "AlignRight" || -aEvent.FeatureURL.Path == "DocumentRepair") +aEvent.FeatureURL.Path == "DocumentRepair" || +aEvent.FeatureURL.Path == "ObjectAlignLeft" || +aEvent.FeatureURL.Path == "ObjectAlignRight" || +aEvent.FeatureURL.Path == "AlignCenter") { bool bTemp = false; aEvent.State >>= bTemp; diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 9429689d8e81..4774f61fa44e 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -106,10 +106,10 @@ SfxBoolItem Polygon SID_DRAW_POLYGON GroupId = SfxGroupId::Drawing; ] -SfxVoidItem AlignCenter SID_OBJECT_ALIGN_CENTER +SfxBoolItem AlignCenter SID_OBJECT_ALIGN_CENTER () [ -AutoUpdate = FALSE, +AutoUpdate = TRUE, FastCall = FALSE, ReadOnlyDoc = FALSE, Toggle = FALSE, @@ -142,10 +142,10 @@ SfxVoidItem AlignDown SID_OBJECT_ALIGN_DOWN ] -SfxVoidItem ObjectAlignLeft SID_OBJECT_ALIGN_LEFT +SfxBoolItem ObjectAlignLeft SID_OBJECT_ALIGN_LEFT () [ -AutoUpdate = FALSE, +AutoUpdate = TRUE, FastCall = FALSE, ReadOnlyDoc = FALSE, Toggle = FALSE, @@ -197,10 +197,10 @@ SfxVoidItem AlignMiddle SID_OBJECT_ALIGN_MIDDLE ] -SfxVoidItem ObjectAlignRight SID_OBJECT_ALIGN_RIGHT +SfxBoolItem ObjectAlignRight SID_OBJECT_ALIGN_RIGHT () [ -AutoUpdate = FALSE, +AutoUpdate = TRUE, FastCall = FALSE, ReadOnlyDoc = FALSE, Toggle = FALSE, diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 12f0f8216ede..a34ca5783b87 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -808,7 +808,30 @@ void SwFrameShell::GetState(SfxItemSet& rSet) bProtect || ((nWhich == FN_FRAME_ALIGN_HORZ_CENTER || nWhich == SID_OBJECT_ALIGN_CENTER) && bHtmlMode )) +{ rSet.DisableItem( nWhich ); +} +else +{ +sal_Int16 nHoriOrient = -1; +switch(nWhich) +{ +case SID_OBJECT_ALIGN_LEFT: +nHoriOrient = text::HoriOrientation::LEFT; +break; +case SID_OBJECT_ALIGN_CENTER: +nHoriOrient = text::HoriOrientation::CENTER; +br
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.ColumnHeader.js | 13 - loleaflet/src/control/Control.Header.js | 21 + 2 files changed, 29 insertions(+), 5 deletions(-) New commits: commit ab64d2e0c315d26c358ff99548bb7353708eab6b Author: Dennis Francis AuthorDate: Wed Jan 29 13:38:16 2020 +0530 Commit: Jan Holesovsky CommitDate: Wed Feb 5 14:02:17 2020 +0100 Adjust column-header height with zoom-level too Introduce a new method 'getHeaderZoomScale' to L.Control.Header that returns current zoom-scale w.r.t to 100% zoom. It also lets you limit the zoomScale between a upper and lower bound. Use this method to scale column header height. Reuse this method to scale font-size too. Change-Id: I841ef2d73752cdc2206549d540633e179f19677f Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87671 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js index 174901b15..76c536e17 100644 --- a/loleaflet/src/control/Control.ColumnHeader.js +++ b/loleaflet/src/control/Control.ColumnHeader.js @@ -36,6 +36,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({ this._canvasContext = this._canvas.getContext('2d'); this._setCanvasWidth(); this._setCanvasHeight(); + this._canvasBaseHeight = this._canvasHeight; var scale = L.getDpiScaleFactor(); this._canvasContext.scale(scale, scale); @@ -388,6 +389,12 @@ L.Control.ColumnHeader = L.Control.Header.extend({ this._setCanvasWidth(); this._setCanvasHeight(); this._canvasContext.clearRect(0, 0, canvas.width, canvas.height); + // Adjust (column) _headerHeight according to zoomlevel. This is used below to call resize() + // where column/corner header are resized. Besides the document container and row header container + // are moved up or down as required so that there is no gap/overlap below column header. + // Limit zoomScale so that the column header is not too small (unreadable) or too big. + this._headerHeight = Math.ceil(this._canvasBaseHeight * + this.getHeaderZoomScale(/* lowerBound */ 0.74, /* upperBound */ 1.15)); // Reset state this._current = -1; @@ -648,7 +655,11 @@ L.Control.ColumnHeader = L.Control.Header.extend({ var rowHdrTop = parseInt(L.DomUtil.getStyle(rowHeader, 'top')) + deltaTop; var docTop = parseInt(L.DomUtil.getStyle(document, 'top')) + deltaTop; L.DomUtil.setStyle(rowHeader, 'top', rowHdrTop + 'px'); - L.DomUtil.setStyle(document, 'top', docTop + 'px'); + // L.DomUtil.setStyle does not seem to affect the attributes when + // one of the media queries of document-container element are + // active (non-desktop case). Using style.setProperty directly + // seems to work as expected for both mobile/desktop. + document.style.setProperty('top', docTop + 'px', 'important'); this._setCanvasHeight(height); diff --git a/loleaflet/src/control/Control.Header.js b/loleaflet/src/control/Control.Header.js index 37d03062c..167a782ad 100644 --- a/loleaflet/src/control/Control.Header.js +++ b/loleaflet/src/control/Control.Header.js @@ -72,17 +72,16 @@ L.Control.Header = L.Control.extend({ var fontHeight = parseInt(L.DomUtil.getStyle(elem, 'line-height')); var rate = fontHeight / fontSize; this._font = { - _map: this._map, + _hdr: this, _baseFontSize: fontSize, _fontSizeRate: rate, _fontFamily: fontFamily, getFont: function() { - var zoomScale = this._map.getZoomScale(this._map.getZoom(), - this._map.options.defaultZoom); // Limit zoomScale to 115%. At 120% the row ids at the bottom eat all // horizontal margins and it looks ugly. Beyond 120% the row ids get // clipped out visibly. - zoomScale = Math.min(zoomScale, 1.15); + var zoomScale = this._hdr.getHeaderZoomScale( + /* lowerBound */ 0.5, /* upperBound */ 1.15); return Math.floor(this._baseFontSize * zoomScale) + 'px/' + @@ -743,6 +742,20 @@ L.Control.Header = L.Control.extend({ } }, + getHeaderZoomScale : function(lowerBound, upperBound
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.ColumnHeader.js |4 ++-- loleaflet/src/control/Control.Header.js | 21 - loleaflet/src/control/Control.RowHeader.js|4 ++-- 3 files changed, 24 insertions(+), 5 deletions(-) New commits: commit 3ce8389e8211562ab8f2548ba014cc2c3bb662ef Author: Dennis Francis AuthorDate: Tue Jan 28 14:36:18 2020 +0530 Commit: Dennis Francis CommitDate: Tue Jan 28 11:11:54 2020 +0100 Adjust the row/col header fontSize with zoom-level Change-Id: I5eda8b1af1c10bc83714a63595aba8062070115a Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87591 Reviewed-by: Jan Holesovsky Tested-by: Jenkins CollaboraOffice diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js index 19282b97e..d0d7290b7 100644 --- a/loleaflet/src/control/Control.ColumnHeader.js +++ b/loleaflet/src/control/Control.ColumnHeader.js @@ -256,7 +256,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({ } // draw text content ctx.fillStyle = isHighlighted ? this._selectionTextColor : this._textColor; - ctx.font = this._font; + ctx.font = this._font.getFont(); ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; // The '+ 1' below is a hack - it's currently not possible to measure @@ -348,7 +348,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({ ctx.strokeRect(startPar, startOrt, ctrlHeadSize, ctrlHeadSize); // draw level number ctx.fillStyle = this._textColor; - ctx.font = this._font; + ctx.font = this._font.getFont(); ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; ctx.fillText(level + 1, startPar + (ctrlHeadSize / 2), startOrt + (ctrlHeadSize / 2)); diff --git a/loleaflet/src/control/Control.Header.js b/loleaflet/src/control/Control.Header.js index 76eea58ee..37d03062c 100644 --- a/loleaflet/src/control/Control.Header.js +++ b/loleaflet/src/control/Control.Header.js @@ -71,7 +71,26 @@ L.Control.Header = L.Control.extend({ var fontSize = parseInt(L.DomUtil.getStyle(elem, 'font-size')); var fontHeight = parseInt(L.DomUtil.getStyle(elem, 'line-height')); var rate = fontHeight / fontSize; - this._font = fontSize + 'px/' + rate + ' ' + fontFamily; + this._font = { + _map: this._map, + _baseFontSize: fontSize, + _fontSizeRate: rate, + _fontFamily: fontFamily, + getFont: function() { + var zoomScale = this._map.getZoomScale(this._map.getZoom(), + this._map.options.defaultZoom); + // Limit zoomScale to 115%. At 120% the row ids at the bottom eat all + // horizontal margins and it looks ugly. Beyond 120% the row ids get + // clipped out visibly. + zoomScale = Math.min(zoomScale, 1.15); + + return Math.floor(this._baseFontSize * zoomScale) + + 'px/' + + this._fontSizeRate + + ' ' + + this._fontFamily; + } + }; this._borderColor = L.DomUtil.getStyle(elem, 'border-top-color'); var borderWidth = L.DomUtil.getStyle(elem, 'border-top-width'); this._borderWidth = Math.round(parseFloat(borderWidth)); diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js index 8709a72c5..15c783220 100644 --- a/loleaflet/src/control/Control.RowHeader.js +++ b/loleaflet/src/control/Control.RowHeader.js @@ -249,7 +249,7 @@ L.Control.RowHeader = L.Control.Header.extend({ } // draw text content ctx.fillStyle = isHighlighted ? this._selectionTextColor : this._textColor; - ctx.font = this._font; + ctx.font = this._font.getFont(); ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; ctx.fillText(content, startOrt + (width / 2), endPar - (height / 2)); @@ -337,7 +337,7 @@ L.Control.RowHeader = L.Control.Header.extend({ ctx.strokeRect(startOrt, startPar, ctrlHeadSize, ctrlHeadSize); // draw level number ctx.fillStyle = this._textColor; - ctx.font = this._font; + ctx.font = this._font.getFont(); ctx.textAlign = 'center'; ctx.textBaseline = 'middle
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js |3 +++ 1 file changed, 3 insertions(+) New commits: commit dd48efc7ca5417a8fe4e4606b75764cc9a8a2c03 Author: Dennis Francis AuthorDate: Sat Jan 25 14:52:11 2020 +0530 Commit: Michael Meeks CommitDate: Sat Jan 25 12:29:45 2020 +0100 [MobileWizard] Do not display broken-image icon in firefox In the mobile wizard, if there are no icons for a menu entry, firefox will display a broken image even if we set alt='' in img tag. Lets add an error event handler for img(icon) element to not display anything. This seems to be the general solution that works both in Chrome and Firefox. TODO: We may want a css-only solution probably by having a custom transparent icon to override the broken-image icon. Change-Id: I879035ca847c4c52611eccfc20834866c0144e02 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87373 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index e5c48f53e..3660dc2fa 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1429,6 +1429,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ icon = L.DomUtil.create('img', '', iconSpan); icon.src = iconPath; icon.alt = ''; + icon.addEventListener('error', function() { + icon.style.display = 'none'; + }); } if (data.checked && data.checked === true) { L.DomUtil.addClass(menuEntry, 'menu-entry-checked'); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.ContextMenu.js |2 +- loleaflet/src/unocommands.js |2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) New commits: commit acccf779ce3f5f568fb50593985e0c76b40b866a Author: Dennis Francis AuthorDate: Thu Jan 23 11:49:35 2020 +0530 Commit: Dennis Francis CommitDate: Fri Jan 24 07:20:31 2020 +0100 Show missing anchor submenu items in the context menu This is about the context menu related to shapes. The core is already sending data about all anchor menu items but they were not whitelisted. After whitelisting them, they work well except that the 'anchor' overlay image is not shown over the cell the shape is anchored to. Change-Id: I9c2c84e58047d92132329d09a4a2569272d804ff Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87232 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index c00434629..83a57730c 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -50,7 +50,7 @@ L.Control.ContextMenu = L.Control.extend({ 'SpellCheckIgnore', 'SpellCheckIgnoreAll', 'SpellCheckApplySuggestion'], spreadsheet: ['MergeCells', 'SplitCell', 'RecalcPivotTable', 'FormatCellDialog', - 'ShowNote', 'DeleteNote'], + 'ShowNote', 'DeleteNote', 'SetAnchorToCell', 'SetAnchorToCellResize'], presentation: [], drawing: [] diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js index 37ca25205..08335e9f1 100644 --- a/loleaflet/src/unocommands.js +++ b/loleaflet/src/unocommands.js @@ -264,6 +264,8 @@ var unoCommandsArray = { SelectTable:{presentation:{menu:_('~Select...'),},text:{menu:_('~Table'),},}, SendToBack:{global:{menu:_('~Send to Back'),},}, SetAnchorAtChar:{text:{menu:_('To ~Character'),},}, + SetAnchorToCell:{spreadsheet:{menu:_('To ~Cell'),},}, + SetAnchorToCellResize:{spreadsheet:{menu:_('To Cell (~resize with cell)'),},}, SetAnchorToChar:{text:{menu:_('As C~haracter'),},}, SetAnchorToFrame:{text:{menu:_('To ~Frame'),},}, SetAnchorToPage:{spreadsheet:{menu:_('To P~age'),},text:{menu:_('To P~age'),},}, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/output.cxx |9 + 1 file changed, 5 insertions(+), 4 deletions(-) New commits: commit be32a6390d0fc4ebf60d553b31e402ca9fbdec5d Author: Dennis Francis AuthorDate: Tue Jan 21 22:11:19 2020 +0530 Commit: Dennis Francis CommitDate: Wed Jan 22 09:41:49 2020 +0100 tdf#130112 lok: Do not apply zoom-factor twice... ... in ScOutputData::FillReferenceMarks(). mnPPT[XY] already has the factor aZoom[XY] in it. Refer ScViewData::CalcPPT() to see how PPT[XY] are derived. Change-Id: I3f9b5c01cb53514450fad5f7b2b6861b112effdb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87158 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks (cherry picked from commit 3f62c10548466119ec6b1a662ab339e5dbe0b05f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87170 Tested-by: Jenkins Reviewed-by: Dennis Francis diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 605057ef91e0..35cd545b2a6e 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -1958,10 +1958,11 @@ ReferenceMark ScOutputData::FillReferenceMark( SCCOL nRefStartX, SCROW nRefStart if (bTop && bBottom && bLeft && bRight) { -aResult = ReferenceMark( nMinX / mnPPTX * double( aZoomX ), - nMinY / mnPPTY * double( aZoomY ), - ( nMaxX - nMinX ) / mnPPTX * double( aZoomX ), - ( nMaxY - nMinY ) / mnPPTY * double( aZoomY ), +// mnPPT[XY] already has the factor aZoom[XY] in it. +aResult = ReferenceMark( nMinX / mnPPTX, + nMinY / mnPPTY, + ( nMaxX - nMinX ) / mnPPTX, + ( nMaxY - nMinY ) / mnPPTY, nTab, rColor ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source
sc/source/ui/view/output.cxx |9 + 1 file changed, 5 insertions(+), 4 deletions(-) New commits: commit 3f62c10548466119ec6b1a662ab339e5dbe0b05f Author: Dennis Francis AuthorDate: Tue Jan 21 22:11:19 2020 +0530 Commit: Dennis Francis CommitDate: Wed Jan 22 06:43:10 2020 +0100 tdf#130112 lok: Do not apply zoom-factor twice... ... in ScOutputData::FillReferenceMarks(). mnPPT[XY] already has the factor aZoom[XY] in it. Refer ScViewData::CalcPPT() to see how PPT[XY] are derived. Change-Id: I3f9b5c01cb53514450fad5f7b2b6861b112effdb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87158 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 54e2dfa7613c..803817e25a39 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -1931,10 +1931,11 @@ ReferenceMark ScOutputData::FillReferenceMark( SCCOL nRefStartX, SCROW nRefStart if (bTop && bBottom && bLeft && bRight) { -aResult = ReferenceMark( nMinX / mnPPTX * double( aZoomX ), - nMinY / mnPPTY * double( aZoomY ), - ( nMaxX - nMinX ) / mnPPTX * double( aZoomX ), - ( nMaxY - nMinY ) / mnPPTY * double( aZoomY ), +// mnPPT[XY] already has the factor aZoom[XY] in it. +aResult = ReferenceMark( nMinX / mnPPTX, + nMinY / mnPPTY, + ( nMaxX - nMinX ) / mnPPTX, + ( nMaxY - nMinY ) / mnPPTY, nTab, rColor ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/layer/tile/CalcTileLayer.js |1 + loleaflet/src/layer/tile/GridLayer.js |3 +++ 2 files changed, 4 insertions(+) New commits: commit 3af2346bbb97f9b8588099b2ab6d0eb9117c84b3 Author: Dennis Francis AuthorDate: Fri Jan 17 16:59:02 2020 +0530 Commit: Dennis Francis CommitDate: Sat Jan 18 17:42:24 2020 +0100 Request comment positions when zooming/view reset The twips coordinates sent by core in CommentsPos message are already correct w.r.t zoom level (See ScModelObj::getPostItsPos() in core.git). In addition these values are view specific (each client user). Change-Id: I18c2971f34362de0eba5181f9dbe3e662c223575 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86986 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index a1847dd8e..697622b35 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -577,6 +577,7 @@ L.CalcTileLayer = L.TileLayer.extend({ this._sendClientZoom(); // TODO: test it! this._map.fire('updaterowcolumnheaders'); + this._map._socket.sendMessage('commandvalues command=.uno:ViewAnnotationsPosition'); }, _onUpdateCurrentHeader: function() { diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js index 4db50a473..ee8b4c9de 100644 --- a/loleaflet/src/layer/tile/GridLayer.js +++ b/loleaflet/src/layer/tile/GridLayer.js @@ -322,6 +322,9 @@ L.GridLayer = L.Layer.extend({ _viewReset: function (e) { this._reset(this._map.getCenter(), this._map.getZoom(), e && e.hard); + if (this._docType === 'spreadsheet' && this._annotations !== 'undefined') { + this._map._socket.sendMessage('commandvalues command=.uno:ViewAnnotationsPosition'); + } }, _animateZoom: function (e) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: package/inc package/source
package/inc/ThreadedDeflater.hxx | 29 --- package/source/zipapi/ThreadedDeflater.cxx | 118 +++-- package/source/zipapi/ZipOutputEntry.cxx | 32 ++- 3 files changed, 109 insertions(+), 70 deletions(-) New commits: commit 353d4528b8ad8abca9a13f3016632e42bab7afde Author: Dennis Francis AuthorDate: Sat Jan 11 11:51:34 2020 +0530 Commit: Dennis Francis CommitDate: Mon Jan 13 12:11:44 2020 +0100 tdf#125662: do parallel-zip in batches In this approach the input stream is read one batch (of constant size) at a time and each batch is compressed by ThreadedDeflater. After we are done with a batch, the deflated buffer is processed straightaway (directed to file backed storage). Change-Id: I2d42f86cf5898e4d746836d94bf6009a8d3b0230 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86596 Tested-by: Jenkins Reviewed-by: Luboš Luňák diff --git a/package/inc/ThreadedDeflater.hxx b/package/inc/ThreadedDeflater.hxx index 3bd7e4bc966a..f22a40a0c941 100644 --- a/package/inc/ThreadedDeflater.hxx +++ b/package/inc/ThreadedDeflater.hxx @@ -21,37 +21,48 @@ #define INCLUDED_PACKAGE_THREADEDDEFLATER_HXX #include +#include +#include #include #include #include #include +#include +#include namespace ZipUtils { /// Parallel compression a stream using the libz deflate algorithm. /// -/// Almost a replacement for the Deflater class. Call startDeflate() with the data, -/// check with finished() or waitForTasks() and retrieve result with getOutput(). -/// The class will internally split into multiple threads. +/// Call deflateWrite() with the input stream and input/output processing functions. +/// This will use multiple threads for compression on each batch of data from the stream. class ThreadedDeflater final { class Task; // Note: All this should be lock-less. Each task writes only to its part -// of the data, flags are atomic. +// of the data. std::vector> outBuffers; std::shared_ptr threadTaskTag; css::uno::Sequence inBuffer; +css::uno::Sequence prevDataBlock; +std::function&, sal_Int32)> maProcessOutputFunc; +sal_Int64 totalIn; +sal_Int64 totalOut; int zlibLevel; -std::atomic pendingTasksCount; public: // Unlike with Deflater class, bNoWrap is always true. ThreadedDeflater(sal_Int32 nSetLevel); ~ThreadedDeflater() COVERITY_NOEXCEPT_FALSE; -void startDeflate(const css::uno::Sequence& rBuffer); -void waitForTasks(); -bool finished() const; -css::uno::Sequence getOutput() const; +void deflateWrite( +const css::uno::Reference& xInStream, +std::function&, sal_Int32)> aProcessInputFunc, +std::function&, sal_Int32)> aProcessOutputFunc); +sal_Int64 getTotalIn() const { return totalIn; } +sal_Int64 getTotalOut() const { return totalOut; } + +private: +void processDeflatedBuffers(); void clear(); }; diff --git a/package/source/zipapi/ThreadedDeflater.cxx b/package/source/zipapi/ThreadedDeflater.cxx index 19bbda01bbb7..73725c580c02 100644 --- a/package/source/zipapi/ThreadedDeflater.cxx +++ b/package/source/zipapi/ThreadedDeflater.cxx @@ -44,14 +44,19 @@ class ThreadedDeflater::Task : public comphelper::ThreadTask ThreadedDeflater* deflater; int sequence; int blockSize; +bool firstTask : 1; +bool lastTask : 1; public: -Task(ThreadedDeflater* deflater_, int sequence_, int blockSize_) +Task(ThreadedDeflater* deflater_, int sequence_, int blockSize_, bool firstTask_, + bool lastTask_) : comphelper::ThreadTask(deflater_->threadTaskTag) , stream() , deflater(deflater_) , sequence(sequence_) , blockSize(blockSize_) +, firstTask(firstTask_) +, lastTask(lastTask_) { } @@ -61,58 +66,83 @@ private: ThreadedDeflater::ThreadedDeflater(sal_Int32 nSetLevel) : threadTaskTag(comphelper::ThreadPool::createThreadTaskTag()) +, totalIn(0) +, totalOut(0) , zlibLevel(nSetLevel) -, pendingTasksCount(0) { } -ThreadedDeflater::~ThreadedDeflater() COVERITY_NOEXCEPT_FALSE -{ -waitForTasks(); -clear(); -} +ThreadedDeflater::~ThreadedDeflater() COVERITY_NOEXCEPT_FALSE { clear(); } -void ThreadedDeflater::startDeflate(const uno::Sequence& rBuffer) +void ThreadedDeflater::deflateWrite( +const css::uno::Reference& xInStream, +std::function&, sal_Int32)> aProcessInputFunc, +std::function&, sal_Int32)> aProcessOutputFunc) { -inBuffer = rBuffer; -sal_Int64 size = inBuffer.getLength(); -int tasksCount = (size + MaxBlockSize - 1) / MaxBlockSize; -tasksCount = std::max(tasksCount, 1); -pendingTasksCount = tasksCount; -outBuffers.resize(pendingTasksCount); -for (int sequence = 0; sequence < tasksCount; ++sequence) +sal_Int64 nThreadCount = c
[Libreoffice-commits] core.git: comphelper/Library_comphelper.mk comphelper/source include/comphelper package/source
comphelper/Library_comphelper.mk |1 comphelper/source/misc/meminfo.cxx | 140 - include/comphelper/meminfo.hxx | 37 -- package/source/zippackage/ZipPackageStream.cxx |5 4 files changed, 1 insertion(+), 182 deletions(-) New commits: commit d98cc8f881673f64f0a1fa35eea8610fb5b083e3 Author: Dennis Francis AuthorDate: Sat Jan 11 11:48:42 2020 +0530 Commit: Dennis Francis CommitDate: Mon Jan 13 12:09:28 2020 +0100 Revert "tdf#125662: disable parallel-zip if the memory..." This reverts commit 0b8ae8725083eb0526a262d434cc06fb3f3e7336. A better fix will follow this patch. Change-Id: I4ff8d71bf2401bae2e2071c369e3746b8b7c72bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86595 Tested-by: Jenkins Reviewed-by: Dennis Francis diff --git a/comphelper/Library_comphelper.mk b/comphelper/Library_comphelper.mk index b5de3f58b36a..e0bf1a8574f5 100644 --- a/comphelper/Library_comphelper.mk +++ b/comphelper/Library_comphelper.mk @@ -117,7 +117,6 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\ comphelper/source/misc/listenernotification \ comphelper/source/misc/logging \ comphelper/source/misc/lok \ -comphelper/source/misc/meminfo \ comphelper/source/misc/mimeconfighelper \ comphelper/source/misc/namedvaluecollection \ comphelper/source/misc/numberedcollection \ diff --git a/comphelper/source/misc/meminfo.cxx b/comphelper/source/misc/meminfo.cxx deleted file mode 100644 index 72a55addd4d5.. --- a/comphelper/source/misc/meminfo.cxx +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include -#include - -#if defined(_WIN32) - -#define WIN32_LEAN_AND_MEAN -#include -#include - -#elif defined(UNX) - -#if defined(MACOSX) -#include -#include -#include -#include - -#else // Linux -#include -#include -#endif - -#endif - -namespace comphelper -{ -// Returns the virtual memory used currently by the process. -static sal_Int64 getMemUsedBySelf() -{ -#if defined(UNX) -#if defined(MACOSX) - -vm_size_t pageSize; -struct task_basic_info tInfo; -mach_msg_type_number_t tInfoCount = TASK_BASIC_INFO_COUNT; - -if (host_page_size(mach_host_self(), ) != KERN_SUCCESS) -return -1; - -if (task_info(mach_task_self(), TASK_BASIC_INFO, reinterpret_cast(), - ) -!= KERN_SUCCESS) -return -1; - -return static_cast(tInfo.virtual_size) * pageSize; - -#elif defined(LINUX) - -sal_Int64 pageSize = sysconf(_SC_PAGESIZE); -if (pageSize <= 0) -return -1; - -std::ifstream ifs("/proc/self/statm", std::ifstream::in); -if (!ifs.is_open()) -return -1; - -sal_Int64 vmSize; -if (ifs >> vmSize) -return vmSize * pageSize; - -return -1; - -#else - -return -1; - -#endif - -#elif defined(_WIN32) - -PROCESS_MEMORY_COUNTERS_EX pmc; -GetProcessMemoryInfo(GetCurrentProcess(), reinterpret_cast(), - sizeof(pmc)); -return static_cast(pmc.PrivateUsage); - -#else - -return -1; - -#endif -} - -static sal_Int64 getMaxAddressableMemLimit() -{ -#if defined(_WIN64) -return 8796093022208ll; // 8 TB -#elif defined(_WIN32) -return 2147483648ll; // 2 GB -#elif defined(__x86_64__) -// TODO: check for artificial limits imposed by 'ulimit -Sv' too for UNX ? -return 140737488355328ll; // 128 TB -#elif defined(__i386__) -return 3221225472ll; // 3 GB -#else -return 2147483648ll; // 2 GB -#endif -} - -// canAlloc() checks whether allocSize bytes can be allocated without exceeding -// addressable memory limit. This is useful in case of 32-bit systems where -// process addressable memory limit is less than physical memory limit. -bool canAlloc(sal_Int64 allocSize) -{ -if (allocSize <= 0) -return true; - -sal_Int64 vmSize = getMemUsedBySelf(); -if (vmSize < 0) -return true; - -sal_Int64 maxSize = getMaxAddressableMemLimit(); - -if (vmSize
[Libreoffice-commits] core.git: comphelper/Library_comphelper.mk comphelper/source include/comphelper package/source
comphelper/Library_comphelper.mk |1 comphelper/source/misc/meminfo.cxx | 139 + include/comphelper/meminfo.hxx | 37 ++ package/source/zippackage/ZipPackageStream.cxx |5 4 files changed, 181 insertions(+), 1 deletion(-) New commits: commit 0b8ae8725083eb0526a262d434cc06fb3f3e7336 Author: Dennis Francis AuthorDate: Wed Dec 4 15:29:06 2019 +0530 Commit: Dennis Francis CommitDate: Sat Jan 4 07:58:06 2020 +0100 tdf#125662: disable parallel-zip if the memory... required to carry it out will cause a breach of addressable memory limit. This can happen in 32bit OSes, where the physical memory limit is more than the process addressable memory limit. For example in Win32, a process can address only upto 2GB. More specifically, avoid using ZipOutputEntryParallel which rougly needs twice the memory compared to its counterparts. Change-Id: I4d1abbf75e928188bcf806fcf1e5872b1e51b502 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84394 Tested-by: Jenkins Reviewed-by: Dennis Francis diff --git a/comphelper/Library_comphelper.mk b/comphelper/Library_comphelper.mk index e0bf1a8574f5..b5de3f58b36a 100644 --- a/comphelper/Library_comphelper.mk +++ b/comphelper/Library_comphelper.mk @@ -117,6 +117,7 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\ comphelper/source/misc/listenernotification \ comphelper/source/misc/logging \ comphelper/source/misc/lok \ +comphelper/source/misc/meminfo \ comphelper/source/misc/mimeconfighelper \ comphelper/source/misc/namedvaluecollection \ comphelper/source/misc/numberedcollection \ diff --git a/comphelper/source/misc/meminfo.cxx b/comphelper/source/misc/meminfo.cxx new file mode 100644 index ..d6508e9de567 --- /dev/null +++ b/comphelper/source/misc/meminfo.cxx @@ -0,0 +1,139 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +#if defined(_WIN32) + +#define WIN32_LEAN_AND_MEAN +#include +#include "psapi.h" + +#elif defined(UNX) + +#if defined(MACOSX) +#include +#include +#include +#include + +#else // Linux +#include +#include +#endif + +#endif + +namespace comphelper +{ +// Returns the virtual memory used currently by the process. +static sal_Int64 getMemUsedBySelf() +{ +#if defined(UNX) +#if defined(MACOSX) + +vm_size_t pageSize; +struct task_basic_info tInfo; +mach_msg_type_number_t tInfoCount = TASK_BASIC_INFO_COUNT; + +if (host_page_size(mach_host_self(), ) != KERN_SUCCESS) +return -1; + +if (task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t), ) +!= KERN_SUCCESS) +return -1; + +return static_cast(tInfo.virtual_size) * pageSize; + +#elif defined(LINUX) + +sal_Int64 pageSize = sysconf(_SC_PAGESIZE); +if (pageSize <= 0) +return -1; + +std::ifstream ifs("/proc/self/statm", std::ifstream::in); +if (!ifs.is_open()) +return -1; + +sal_Int64 vmSize; +if (ifs >> vmSize) +return vmSize * pageSize; + +return -1; + +#else + +return -1; + +#endif + +#elif defined(_WIN32) + +PROCESS_MEMORY_COUNTERS_EX pmc; +GetProcessMemoryInfo(GetCurrentProcess(), reinterpret_cast(), + sizeof(pmc)); +return static_cast(pmc.PrivateUsage); + +#else + +return -1; + +#endif +} + +static sal_Int64 getMaxAddressableMemLimit() +{ +#if defined(_WIN64) +return 8796093022208ll; // 8 TB +#elif defined(_WIN32) +return 2147483648ll; // 2 GB +#elif defined(__x86_64__) +// TODO: check for artificial limits imposed by 'ulimit -Sv' too for UNX ? +return 140737488355328ll; // 128 TB +#elif defined(__i386__) +return 3221225472ll; // 3 GB +#else +return 2147483648ll; // 2 GB +#endif +} + +// canAlloc() checks whether allocSize bytes can be allocated without exceeding +// addressable memory limit. This is useful in case of 32-bit systems where +// process addressable memory limit is less than physical memory li
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sc/qa sc/source
sc/qa/unit/data/xls/tdf129127.xls |binary sc/qa/unit/filters-test.cxx | 33 + sc/source/core/data/column4.cxx |2 ++ 3 files changed, 35 insertions(+) New commits: commit cd74c9a3f328618ab7b8cd392ff9dfe55cb77213 Author: Dennis Francis AuthorDate: Thu Dec 12 22:22:48 2019 +0530 Commit: Xisco Faulí CommitDate: Wed Dec 18 10:57:39 2019 +0100 Resolves tdf#129127: do a safe swap of patterns Following swap of patterns is not safe : """ const ScPatternAttr* pPat1 = GetPattern(nRow); const ScPatternAttr* pPat2 = rOther.GetPattern(nRow); SetPattern(nRow, *pPat2); rOther.SetPattern(nRow, *pPat1); """ as the first SetPattern can cause deallocation of the pattern object pointed to by pPat1 if it had a reference count of 1 to begin with. In such cases, increase the reference count of first pattern by putting it into document pool, thereby evading deallocation. The stacktrace of the crash without the fix looks like : Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault. 602 SfxPoolItem *pPoolItem = rItem.Clone(pImpl->mpMaster); 0 0x74ad2905 in SfxItemPool::PutImpl(SfxPoolItem const&, unsigned short, bool) (this=0x16c6830, rItem=..., nWhich=39321, bPassingOwnership=false) at /ssd1/work/dennis/core/svl/source/items/itempool.cxx:602 1 0x7fffd179e5a5 in ScDocumentPool::PutImpl(SfxPoolItem const&, unsigned short, bool) (this=0x16c6830, rItem=..., nWhich=0, bPassingOwnership=false) at /ssd1/work/dennis/core/sc/source/core/data/docpool.cxx:333 2 0x7fffd14e88fb in SfxItemPool::Put(ScPatternAttr const&, unsigned short) (this=0x16c6830, rItem=..., nWhich=0) at /ssd1/work/dennis/core/include/svl/itempool.hxx:154 3 0x7fffd14dd228 in ScAttrArray::SetPatternAreaImpl(int, int, ScPatternAttr const*, bool, ScEditDataArray*, bool) (this=0x2cbc020, nStartRow=9, nEndRow=9, pPattern=0x2da5d80, bPutToPool=true, pDataArray=0x0, bPassingOwnership=false) at /ssd1/work/dennis/core/sc/source/core/data/attarray.cxx:464 4 0x7fffd1653fcd in ScAttrArray::SetPattern(int, ScPatternAttr const*, bool) (this=0x2cbc020, nRow=9, pPattern=0x2da5d80, bPutToPool=true) at /ssd1/work/dennis/core/sc/inc/attarray.hxx:142 5 0x7fffd163cd41 in ScColumn::SetPattern(int, ScPatternAttr const&) (this=0x2cb4610, nRow=9, rPatAttr=...) at /ssd1/work/dennis/core/sc/source/core/data/column.cxx:694 6 0x7fffd170e65b in ScColumn::Swap(ScColumn&, int, int, bool) (this=0x2339270, rOther=..., nRow1=0, nRow2=9, bPattern=true) at /ssd1/work/dennis/core/sc/source/core/data/column4.cxx:1112 7 0x7fffd1ada654 in ScTable::SortReorderByColumn(ScSortInfoArray const*, int, int, bool, ScProgress*) (this=0x2cb9ea0, pArray=0x5ef71a0, nRow1=0, nRow2=9, bPattern=true, pProgress=0x7fff09a0) at /ssd1/work/dennis/core/sc/source/core/data/table3.cxx:922 8 0x7fffd1adf991 in ScTable::Sort(ScSortParam const&, bool, bool, ScProgress*, sc::ReorderParam*) (this=0x2cb9ea0, rSortParam=..., bKeepQuery=false, bUpdateRefs=false, pProgress=0x7fff09a0, pUndo=0x7fff0950) at /ssd1/work/dennis/core/sc/source/core/data/table3.cxx:1750 9 0x7fffd17cc70a in ScDocument::Sort(short, ScSortParam const&, bool, bool, ScProgress*, sc::ReorderParam*) ( this=0x2cc4db0, nTab=0, rSortParam=..., bKeepQuery=false, bUpdateRefs=false, pProgress=0x7fff09a0, pUndo=0x7fff0950) at /ssd1/work/dennis/core/sc/source/core/data/documen3.cxx:1411 10 0x7fffd22a2f76 in ScDBDocFunc::Sort(short, ScSortParam const&, bool, bool, bool) (this=0x7fff0b50, nTab=0, rSortParam=..., bRecord=true, bPaint=true, bApi=false) at /ssd1/work/dennis/core/sc/source/ui/docshell/dbdocfun.cxx:578 11 0x7fffd2744e29 in ScDBFunc::Sort(ScSortParam const&, bool, bool) (this=0x2e3b560, rSortParam=..., bRecord=true, bPaint=true) at /ssd1/work/dennis/core/sc/source/ui/view/dbfunc.cxx:217 12 0x7fffd2744d7b in ScDBFunc::UISort(ScSortParam const&) (this=0x2e3b560, rSortParam=...) at /ssd1/work/dennis/core/sc/source/ui/view/dbfunc.cxx:208 13 0x7fffd2735e3d in ScCellShell::ExecuteDB(SfxRequest&) (this=0x1e42330, rReq=...) at /ssd1/work/dennis/core/sc/source/ui/view/cellsh2.cxx:528 Change-Id: I70f8b95a6ff59f372b909fd173117a114906deff Reviewed-on: https://gerrit.libreoffice.org/85072 Tested-by: Jenkins Reviewed-by: Dennis Francis (cherry picked from commit f86824cca0c442d371379d2ea0bff2241f18ab3d) Reviewed-on: https://gerrit.libreoffice.org/85279 Reviewed-by: Eike Rathke (cherry picked from commit c8079949bcccb20caf7fc91ee4567d811606c8e4) Reviewed-on: https://gerrit.libreoffice.org/85360 Reviewed-by: Xisco Faulí diff --git a/sc/qa/unit/data/xls/tdf129127.xls b/
[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sc/qa sc/source
sc/qa/unit/data/xls/tdf129127.xls |binary sc/qa/unit/filters-test.cxx | 33 + sc/source/core/data/column4.cxx |2 ++ 3 files changed, 35 insertions(+) New commits: commit c8079949bcccb20caf7fc91ee4567d811606c8e4 Author: Dennis Francis AuthorDate: Thu Dec 12 22:22:48 2019 +0530 Commit: Eike Rathke CommitDate: Wed Dec 18 01:14:01 2019 +0100 Resolves tdf#129127: do a safe swap of patterns Following swap of patterns is not safe : """ const ScPatternAttr* pPat1 = GetPattern(nRow); const ScPatternAttr* pPat2 = rOther.GetPattern(nRow); SetPattern(nRow, *pPat2); rOther.SetPattern(nRow, *pPat1); """ as the first SetPattern can cause deallocation of the pattern object pointed to by pPat1 if it had a reference count of 1 to begin with. In such cases, increase the reference count of first pattern by putting it into document pool, thereby evading deallocation. The stacktrace of the crash without the fix looks like : Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault. 602 SfxPoolItem *pPoolItem = rItem.Clone(pImpl->mpMaster); 0 0x74ad2905 in SfxItemPool::PutImpl(SfxPoolItem const&, unsigned short, bool) (this=0x16c6830, rItem=..., nWhich=39321, bPassingOwnership=false) at /ssd1/work/dennis/core/svl/source/items/itempool.cxx:602 1 0x7fffd179e5a5 in ScDocumentPool::PutImpl(SfxPoolItem const&, unsigned short, bool) (this=0x16c6830, rItem=..., nWhich=0, bPassingOwnership=false) at /ssd1/work/dennis/core/sc/source/core/data/docpool.cxx:333 2 0x7fffd14e88fb in SfxItemPool::Put(ScPatternAttr const&, unsigned short) (this=0x16c6830, rItem=..., nWhich=0) at /ssd1/work/dennis/core/include/svl/itempool.hxx:154 3 0x7fffd14dd228 in ScAttrArray::SetPatternAreaImpl(int, int, ScPatternAttr const*, bool, ScEditDataArray*, bool) (this=0x2cbc020, nStartRow=9, nEndRow=9, pPattern=0x2da5d80, bPutToPool=true, pDataArray=0x0, bPassingOwnership=false) at /ssd1/work/dennis/core/sc/source/core/data/attarray.cxx:464 4 0x7fffd1653fcd in ScAttrArray::SetPattern(int, ScPatternAttr const*, bool) (this=0x2cbc020, nRow=9, pPattern=0x2da5d80, bPutToPool=true) at /ssd1/work/dennis/core/sc/inc/attarray.hxx:142 5 0x7fffd163cd41 in ScColumn::SetPattern(int, ScPatternAttr const&) (this=0x2cb4610, nRow=9, rPatAttr=...) at /ssd1/work/dennis/core/sc/source/core/data/column.cxx:694 6 0x7fffd170e65b in ScColumn::Swap(ScColumn&, int, int, bool) (this=0x2339270, rOther=..., nRow1=0, nRow2=9, bPattern=true) at /ssd1/work/dennis/core/sc/source/core/data/column4.cxx:1112 7 0x7fffd1ada654 in ScTable::SortReorderByColumn(ScSortInfoArray const*, int, int, bool, ScProgress*) (this=0x2cb9ea0, pArray=0x5ef71a0, nRow1=0, nRow2=9, bPattern=true, pProgress=0x7fff09a0) at /ssd1/work/dennis/core/sc/source/core/data/table3.cxx:922 8 0x7fffd1adf991 in ScTable::Sort(ScSortParam const&, bool, bool, ScProgress*, sc::ReorderParam*) (this=0x2cb9ea0, rSortParam=..., bKeepQuery=false, bUpdateRefs=false, pProgress=0x7fff09a0, pUndo=0x7fff0950) at /ssd1/work/dennis/core/sc/source/core/data/table3.cxx:1750 9 0x7fffd17cc70a in ScDocument::Sort(short, ScSortParam const&, bool, bool, ScProgress*, sc::ReorderParam*) ( this=0x2cc4db0, nTab=0, rSortParam=..., bKeepQuery=false, bUpdateRefs=false, pProgress=0x7fff09a0, pUndo=0x7fff0950) at /ssd1/work/dennis/core/sc/source/core/data/documen3.cxx:1411 10 0x7fffd22a2f76 in ScDBDocFunc::Sort(short, ScSortParam const&, bool, bool, bool) (this=0x7fff0b50, nTab=0, rSortParam=..., bRecord=true, bPaint=true, bApi=false) at /ssd1/work/dennis/core/sc/source/ui/docshell/dbdocfun.cxx:578 11 0x7fffd2744e29 in ScDBFunc::Sort(ScSortParam const&, bool, bool) (this=0x2e3b560, rSortParam=..., bRecord=true, bPaint=true) at /ssd1/work/dennis/core/sc/source/ui/view/dbfunc.cxx:217 12 0x7fffd2744d7b in ScDBFunc::UISort(ScSortParam const&) (this=0x2e3b560, rSortParam=...) at /ssd1/work/dennis/core/sc/source/ui/view/dbfunc.cxx:208 13 0x7fffd2735e3d in ScCellShell::ExecuteDB(SfxRequest&) (this=0x1e42330, rReq=...) at /ssd1/work/dennis/core/sc/source/ui/view/cellsh2.cxx:528 Change-Id: I70f8b95a6ff59f372b909fd173117a114906deff Reviewed-on: https://gerrit.libreoffice.org/85072 Tested-by: Jenkins Reviewed-by: Dennis Francis (cherry picked from commit f86824cca0c442d371379d2ea0bff2241f18ab3d) Reviewed-on: https://gerrit.libreoffice.org/85279 Reviewed-by: Eike Rathke diff --git a/sc/qa/unit/data/xls/tdf129127.xls b/sc/qa/unit/data/xls/tdf129127.xls new file mode 100644 index ..4862d2319691 Binary files /dev/null and b/sc/qa/unit/data/xls/tdf129127.xls differ di
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/data/xls/tdf129127.xls |binary sc/qa/unit/filters-test.cxx | 33 + sc/source/core/data/column4.cxx |2 ++ 3 files changed, 35 insertions(+) New commits: commit f86824cca0c442d371379d2ea0bff2241f18ab3d Author: Dennis Francis AuthorDate: Thu Dec 12 22:22:48 2019 +0530 Commit: Dennis Francis CommitDate: Tue Dec 17 09:54:27 2019 +0100 Resolves tdf#129127: do a safe swap of patterns Following swap of patterns is not safe : """ const ScPatternAttr* pPat1 = GetPattern(nRow); const ScPatternAttr* pPat2 = rOther.GetPattern(nRow); SetPattern(nRow, *pPat2); rOther.SetPattern(nRow, *pPat1); """ as the first SetPattern can cause deallocation of the pattern object pointed to by pPat1 if it had a reference count of 1 to begin with. In such cases, increase the reference count of first pattern by putting it into document pool, thereby evading deallocation. The stacktrace of the crash without the fix looks like : Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault. 602 SfxPoolItem *pPoolItem = rItem.Clone(pImpl->mpMaster); 0 0x74ad2905 in SfxItemPool::PutImpl(SfxPoolItem const&, unsigned short, bool) (this=0x16c6830, rItem=..., nWhich=39321, bPassingOwnership=false) at /ssd1/work/dennis/core/svl/source/items/itempool.cxx:602 1 0x7fffd179e5a5 in ScDocumentPool::PutImpl(SfxPoolItem const&, unsigned short, bool) (this=0x16c6830, rItem=..., nWhich=0, bPassingOwnership=false) at /ssd1/work/dennis/core/sc/source/core/data/docpool.cxx:333 2 0x7fffd14e88fb in SfxItemPool::Put(ScPatternAttr const&, unsigned short) (this=0x16c6830, rItem=..., nWhich=0) at /ssd1/work/dennis/core/include/svl/itempool.hxx:154 3 0x7fffd14dd228 in ScAttrArray::SetPatternAreaImpl(int, int, ScPatternAttr const*, bool, ScEditDataArray*, bool) (this=0x2cbc020, nStartRow=9, nEndRow=9, pPattern=0x2da5d80, bPutToPool=true, pDataArray=0x0, bPassingOwnership=false) at /ssd1/work/dennis/core/sc/source/core/data/attarray.cxx:464 4 0x7fffd1653fcd in ScAttrArray::SetPattern(int, ScPatternAttr const*, bool) (this=0x2cbc020, nRow=9, pPattern=0x2da5d80, bPutToPool=true) at /ssd1/work/dennis/core/sc/inc/attarray.hxx:142 5 0x7fffd163cd41 in ScColumn::SetPattern(int, ScPatternAttr const&) (this=0x2cb4610, nRow=9, rPatAttr=...) at /ssd1/work/dennis/core/sc/source/core/data/column.cxx:694 6 0x7fffd170e65b in ScColumn::Swap(ScColumn&, int, int, bool) (this=0x2339270, rOther=..., nRow1=0, nRow2=9, bPattern=true) at /ssd1/work/dennis/core/sc/source/core/data/column4.cxx:1112 7 0x7fffd1ada654 in ScTable::SortReorderByColumn(ScSortInfoArray const*, int, int, bool, ScProgress*) (this=0x2cb9ea0, pArray=0x5ef71a0, nRow1=0, nRow2=9, bPattern=true, pProgress=0x7fff09a0) at /ssd1/work/dennis/core/sc/source/core/data/table3.cxx:922 8 0x7fffd1adf991 in ScTable::Sort(ScSortParam const&, bool, bool, ScProgress*, sc::ReorderParam*) (this=0x2cb9ea0, rSortParam=..., bKeepQuery=false, bUpdateRefs=false, pProgress=0x7fff09a0, pUndo=0x7fff0950) at /ssd1/work/dennis/core/sc/source/core/data/table3.cxx:1750 9 0x7fffd17cc70a in ScDocument::Sort(short, ScSortParam const&, bool, bool, ScProgress*, sc::ReorderParam*) ( this=0x2cc4db0, nTab=0, rSortParam=..., bKeepQuery=false, bUpdateRefs=false, pProgress=0x7fff09a0, pUndo=0x7fff0950) at /ssd1/work/dennis/core/sc/source/core/data/documen3.cxx:1411 10 0x7fffd22a2f76 in ScDBDocFunc::Sort(short, ScSortParam const&, bool, bool, bool) (this=0x7fff0b50, nTab=0, rSortParam=..., bRecord=true, bPaint=true, bApi=false) at /ssd1/work/dennis/core/sc/source/ui/docshell/dbdocfun.cxx:578 11 0x7fffd2744e29 in ScDBFunc::Sort(ScSortParam const&, bool, bool) (this=0x2e3b560, rSortParam=..., bRecord=true, bPaint=true) at /ssd1/work/dennis/core/sc/source/ui/view/dbfunc.cxx:217 12 0x7fffd2744d7b in ScDBFunc::UISort(ScSortParam const&) (this=0x2e3b560, rSortParam=...) at /ssd1/work/dennis/core/sc/source/ui/view/dbfunc.cxx:208 13 0x7fffd2735e3d in ScCellShell::ExecuteDB(SfxRequest&) (this=0x1e42330, rReq=...) at /ssd1/work/dennis/core/sc/source/ui/view/cellsh2.cxx:528 Change-Id: I70f8b95a6ff59f372b909fd173117a114906deff Reviewed-on: https://gerrit.libreoffice.org/85072 Tested-by: Jenkins Reviewed-by: Dennis Francis diff --git a/sc/qa/unit/data/xls/tdf129127.xls b/sc/qa/unit/data/xls/tdf129127.xls new file mode 100644 index ..4862d2319691 Binary files /dev/null and b/sc/qa/unit/data/xls/tdf129127.xls differ diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 4551ee4d9fb7..dc097180cbbd 100644 --- a/sc/qa/unit
[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/qa sw/source
sw/qa/extras/layout/data/tdf105481.odt |binary sw/qa/extras/layout/layout.cxx | 63 + sw/source/core/text/frmform.cxx|3 - 3 files changed, 64 insertions(+), 2 deletions(-) New commits: commit 7dd84a761202097c3afda7fe8296604791b58d2f Author: Dennis Francis AuthorDate: Sun Nov 24 16:09:47 2019 +0530 Commit: Miklos Vajna CommitDate: Wed Dec 4 17:40:23 2019 +0100 tdf#105481 : Do not skip invalidation of as-char anchored objects inside a growing text-frame after doing recalc of positions of other frames (visually above current) in the tree. Otherwise the as-char anchored objects gets wrong reference (base) position (more accurately the base Y position) and hence get displayed at wrong vertical positions (in case of the bug document, it goes out of the page area). Some notes about the bug: Above mentioned problem is visible (at least) when you have a frame anchored to the bottom of the page with auto-height and it contains one or more with at least one of them having a draw object like a shape or math formula with 'as-char' anchoring. Only the draw object in the last is affected by the bug possibly because this text-frame is the cause of growth of the parent (upper) frame. Change-Id: If968c8c00aa57d26b1000e3250b352b24df47cf6 Reviewed-on: https://gerrit.libreoffice.org/83603 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit 318229900fe6d30d9b82256d908dadda8b2f4d61) Reviewed-on: https://gerrit.libreoffice.org/84260 diff --git a/sw/qa/extras/layout/data/tdf105481.odt b/sw/qa/extras/layout/data/tdf105481.odt new file mode 100644 index ..73cd892620a6 Binary files /dev/null and b/sw/qa/extras/layout/data/tdf105481.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index d1517323b581..70dd29b73cc1 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3454,6 +3454,69 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128399) CPPUNIT_ASSERT_EQUAL(nExpected, aPosition.nNode.GetIndex()); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf105481) +{ +createDoc("tdf105481.odt"); +xmlDocPtr pXmlDoc = parseLayoutDump(); +CPPUNIT_ASSERT(pXmlDoc); + +// Without the accompanying fix in place, this test would have failed +// because the vertical position of the as-char shape object and the +// as-char math object will be wrong (below/beyond the text frame's bottom). + +SwTwips nTxtTop = getXPath(pXmlDoc, + "/root/page/anchored/fly/txt[2]" + "/infos/bounds", + "top") + .toInt32(); +SwTwips nTxtBottom = nTxtTop + + getXPath(pXmlDoc, +"/root/page/anchored/fly/txt[2]" +"/infos/bounds", +"height") + .toInt32(); + +SwTwips nFormula1Top = getXPath(pXmlDoc, +"/root/page/anchored/fly/txt[2]" +"/anchored/fly[1]/infos/bounds", +"top") + .toInt32(); +SwTwips nFormula1Bottom = nFormula1Top + + getXPath(pXmlDoc, + "/root/page/anchored/fly/txt[2]" + "/anchored/fly[1]/infos/bounds", + "height") +.toInt32(); + +SwTwips nFormula2Top = getXPath(pXmlDoc, +"/root/page/anchored/fly/txt[2]" +"/anchored/fly[2]/infos/bounds", +"top") + .toInt32(); +SwTwips nFormula2Bottom = nFormula2Top + + getXPath(pXmlDoc, + "/root/page/anchored/fly/txt[2]" + "/anchored/fly[2]/infos/bounds", + "height") +.toInt32(); + +// Ensure that the two formula positions are at least between top and bottom of the text frame. +// The below two are satisfied even without the fix. +CPPUNIT_ASSERT_GREATEREQUAL(nTxtTop, nFormula1Top); +CPPUNIT_ASSERT_GREATEREQUAL(nTxtTop, nFormula2Top); + +// Without the accompanying fix in place, this test would have failed with: +// - Expected less than or equal to : 14423 +// - Actual : 14828 +//
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/layout/data/tdf105481.odt |binary sw/qa/extras/layout/layout.cxx | 63 + sw/source/core/text/frmform.cxx|3 - 3 files changed, 64 insertions(+), 2 deletions(-) New commits: commit 318229900fe6d30d9b82256d908dadda8b2f4d61 Author: Dennis Francis AuthorDate: Sun Nov 24 16:09:47 2019 +0530 Commit: Miklos Vajna CommitDate: Mon Dec 2 12:16:21 2019 +0100 tdf#105481 : Do not skip invalidation of as-char anchored objects inside a growing text-frame after doing recalc of positions of other frames (visually above current) in the tree. Otherwise the as-char anchored objects gets wrong reference (base) position (more accurately the base Y position) and hence get displayed at wrong vertical positions (in case of the bug document, it goes out of the page area). Some notes about the bug: Above mentioned problem is visible (at least) when you have a frame anchored to the bottom of the page with auto-height and it contains one or more with at least one of them having a draw object like a shape or math formula with 'as-char' anchoring. Only the draw object in the last is affected by the bug possibly because this text-frame is the cause of growth of the parent (upper) frame. Change-Id: If968c8c00aa57d26b1000e3250b352b24df47cf6 Reviewed-on: https://gerrit.libreoffice.org/83603 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/layout/data/tdf105481.odt b/sw/qa/extras/layout/data/tdf105481.odt new file mode 100644 index ..73cd892620a6 Binary files /dev/null and b/sw/qa/extras/layout/data/tdf105481.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 82febf907297..f02a69ae042e 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3480,6 +3480,69 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128399) CPPUNIT_ASSERT_EQUAL(nExpected, aPosition.nNode.GetIndex()); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf105481) +{ +createDoc("tdf105481.odt"); +xmlDocPtr pXmlDoc = parseLayoutDump(); +CPPUNIT_ASSERT(pXmlDoc); + +// Without the accompanying fix in place, this test would have failed +// because the vertical position of the as-char shape object and the +// as-char math object will be wrong (below/beyond the text frame's bottom). + +SwTwips nTxtTop = getXPath(pXmlDoc, + "/root/page/anchored/fly/txt[2]" + "/infos/bounds", + "top") + .toInt32(); +SwTwips nTxtBottom = nTxtTop + + getXPath(pXmlDoc, +"/root/page/anchored/fly/txt[2]" +"/infos/bounds", +"height") + .toInt32(); + +SwTwips nFormula1Top = getXPath(pXmlDoc, +"/root/page/anchored/fly/txt[2]" +"/anchored/fly[1]/infos/bounds", +"top") + .toInt32(); +SwTwips nFormula1Bottom = nFormula1Top + + getXPath(pXmlDoc, + "/root/page/anchored/fly/txt[2]" + "/anchored/fly[1]/infos/bounds", + "height") +.toInt32(); + +SwTwips nFormula2Top = getXPath(pXmlDoc, +"/root/page/anchored/fly/txt[2]" +"/anchored/fly[2]/infos/bounds", +"top") + .toInt32(); +SwTwips nFormula2Bottom = nFormula2Top + + getXPath(pXmlDoc, + "/root/page/anchored/fly/txt[2]" + "/anchored/fly[2]/infos/bounds", + "height") +.toInt32(); + +// Ensure that the two formula positions are at least between top and bottom of the text frame. +// The below two are satisfied even without the fix. +CPPUNIT_ASSERT_GREATEREQUAL(nTxtTop, nFormula1Top); +CPPUNIT_ASSERT_GREATEREQUAL(nTxtTop, nFormula2Top); + +// Without the accompanying fix in place, this test would have failed with: +// - Expected less than or equal to : 14423 +// - Actual : 14828 +// that is, the formula is below the text-frame's y bound. +CPPUNIT_ASSERT_LESSEQUAL(nTxtBottom, nFormula1Bottom); +// Simila
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 2 commits - sc/qa sc/source
sc/qa/unit/data/xlsx/shared-formula/refupdate.xlsx |binary sc/qa/unit/filters-test.cxx| 31 + sc/source/filter/ftools/sharedformulagroups.cxx| 16 +- sc/source/filter/inc/sharedformulagroups.hxx | 24 +++- sc/source/filter/oox/formulabuffer.cxx | 23 --- 5 files changed, 87 insertions(+), 7 deletions(-) New commits: commit be02eeffd9bf49891c0fff0d358c1d8a2bd877bd Author: Dennis Francis AuthorDate: Thu Nov 21 14:17:22 2019 +0530 Commit: Andras Timar CommitDate: Wed Nov 27 14:52:19 2019 +0100 tdf#128894: unit test for the bugfix Reviewed-on: https://gerrit.libreoffice.org/83362 Tested-by: Jenkins Reviewed-by: Dennis Francis (cherry picked from commit 626d1527267ab856e516f2424173104f781b8f09) Change-Id: Ic6d3910f12409f5af541c887760caefcb78b30f9 Reviewed-on: https://gerrit.libreoffice.org/83855 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sc/qa/unit/data/xlsx/shared-formula/refupdate.xlsx b/sc/qa/unit/data/xlsx/shared-formula/refupdate.xlsx new file mode 100644 index ..fa386d3a4384 Binary files /dev/null and b/sc/qa/unit/data/xlsx/shared-formula/refupdate.xlsx differ diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 021eeb9e9952..a0738e9cf3b1 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -80,6 +80,7 @@ public: void testContentGnumeric(); void testSharedFormulaXLS(); void testSharedFormulaXLSX(); +void testSharedFormulaRefUpdateXLSX(); void testSheetNamesXLSX(); void testLegacyCellAnchoredRotatedShape(); void testEnhancedProtectionXLS(); @@ -104,6 +105,7 @@ public: CPPUNIT_TEST(testContentGnumeric); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLSX); +CPPUNIT_TEST(testSharedFormulaRefUpdateXLSX); CPPUNIT_TEST(testSheetNamesXLSX); CPPUNIT_TEST(testLegacyCellAnchoredRotatedShape); CPPUNIT_TEST(testEnhancedProtectionXLS); @@ -431,6 +433,35 @@ void ScFiltersTest::testSharedFormulaXLSX() xDocSh->DoClose(); } +void ScFiltersTest::testSharedFormulaRefUpdateXLSX() +{ +ScDocShellRef xDocSh = loadDoc("shared-formula/refupdate.", FORMAT_XLSX); +ScDocument& rDoc = xDocSh->GetDocument(); +sc::AutoCalcSwitch aACSwitch(rDoc, true); // turn auto calc on. +rDoc.DeleteRow(ScRange(0, 4, 0, MAXCOL, 4, 0)); // delete row 5. + +struct TestCase { +ScAddress aPos; +const char* pExpectedFormula; +const char* pErrorMsg; +}; + +TestCase aCases[4] = { +{ ScAddress(1, 0, 0), "B29+1", "Wrong formula in B1" }, +{ ScAddress(2, 0, 0), "C29+1", "Wrong formula in C1" }, +{ ScAddress(3, 0, 0), "D29+1", "Wrong formula in D1" }, +{ ScAddress(4, 0, 0), "E29+1", "Wrong formula in E1" }, +}; + +for (size_t nIdx = 0; nIdx < 4; ++nIdx) +{ +TestCase& rCase = aCases[nIdx]; +ASSERT_FORMULA_EQUAL(rDoc, rCase.aPos, rCase.pExpectedFormula, rCase.pErrorMsg); +} + +xDocSh->DoClose(); +} + void ScFiltersTest::testSheetNamesXLSX() { ScDocShellRef xDocSh = loadDoc("sheet-names.", FORMAT_XLSX); commit 686462e52d0314fe9e14edd048fbe6f0894f620f Author: Dennis Francis AuthorDate: Wed Nov 20 13:24:48 2019 +0530 Commit: Andras Timar CommitDate: Wed Nov 27 14:51:54 2019 +0100 tdf#128894: xlsx-import : Do not share tokens between cells... which are part of a xlsx-shared-formula along a *row*. If we do, any reference-updates on these cells while editing will mess things up. For example a shared formula "=A30+1" used for a few cells in the first row (say, A1, B1, C1 and D1) and on deleting a row, say row#5, the reference update operation will decrement the row index of all tokens in A1, B1, C1 and D1. But if they share tokens, they all end up pointing to row#26 instead of row#29 as each cell is updated which amounts to decrementing 4 times instead of once. However shared formulas along columns are not affected by this bug, when tokens are shared since we use formula-groups which only keeps one copy of token array for the entire group and reference-update code is designed to correctly work with formula-groups. Reviewed-on: https://gerrit.libreoffice.org/83361 Tested-by: Jenkins Reviewed-by: Luboš Luňák Reviewed-by: Eike Rathke (cherry picked from commit b30251ca0d102ced36799ee18d4bbcd9e8530fa0) Change-Id: Ic0fe84d12fef18fbf21658664e2b2b86409bca27 Reviewed-on: https://gerrit.libreoffice.org/83854 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sc/source/filter/ftools/sharedformulag
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 2 commits - sc/qa sc/source
sc/qa/unit/data/xlsx/shared-formula/refupdate.xlsx |binary sc/qa/unit/filters-test.cxx| 31 + sc/source/filter/ftools/sharedformulagroups.cxx| 16 +- sc/source/filter/inc/sharedformulagroups.hxx | 22 ++ sc/source/filter/oox/formulabuffer.cxx | 23 --- 5 files changed, 85 insertions(+), 7 deletions(-) New commits: commit beccda79a92db402aeba577beadae8563953297c Author: Dennis Francis AuthorDate: Thu Nov 21 14:17:22 2019 +0530 Commit: Andras Timar CommitDate: Wed Nov 27 14:51:31 2019 +0100 tdf#128894: unit test for the bugfix Reviewed-on: https://gerrit.libreoffice.org/83362 Tested-by: Jenkins Reviewed-by: Dennis Francis (cherry picked from commit 626d1527267ab856e516f2424173104f781b8f09) Change-Id: Ic6d3910f12409f5af541c887760caefcb78b30f9 (cherry picked from commit b53374e26c1aa95461bbcdaf4a985ff4847b6e28) Reviewed-on: https://gerrit.libreoffice.org/83882 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sc/qa/unit/data/xlsx/shared-formula/refupdate.xlsx b/sc/qa/unit/data/xlsx/shared-formula/refupdate.xlsx new file mode 100644 index ..fa386d3a4384 Binary files /dev/null and b/sc/qa/unit/data/xlsx/shared-formula/refupdate.xlsx differ diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 24250db69aed..5f86c6581746 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -77,6 +77,7 @@ public: void testContentGnumeric(); void testSharedFormulaXLS(); void testSharedFormulaXLSX(); +void testSharedFormulaRefUpdateXLSX(); void testSheetNamesXLSX(); void testLegacyCellAnchoredRotatedShape(); void testEnhancedProtectionXLS(); @@ -100,6 +101,7 @@ public: CPPUNIT_TEST(testContentGnumeric); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLSX); +CPPUNIT_TEST(testSharedFormulaRefUpdateXLSX); CPPUNIT_TEST(testSheetNamesXLSX); CPPUNIT_TEST(testLegacyCellAnchoredRotatedShape); CPPUNIT_TEST(testEnhancedProtectionXLS); @@ -419,6 +421,35 @@ void ScFiltersTest::testSharedFormulaXLSX() xDocSh->DoClose(); } +void ScFiltersTest::testSharedFormulaRefUpdateXLSX() +{ +ScDocShellRef xDocSh = loadDoc("shared-formula/refupdate.", FORMAT_XLSX); +ScDocument& rDoc = xDocSh->GetDocument(); +sc::AutoCalcSwitch aACSwitch(rDoc, true); // turn auto calc on. +rDoc.DeleteRow(ScRange(0, 4, 0, MAXCOL, 4, 0)); // delete row 5. + +struct TestCase { +ScAddress aPos; +const char* pExpectedFormula; +const char* pErrorMsg; +}; + +TestCase aCases[4] = { +{ ScAddress(1, 0, 0), "B29+1", "Wrong formula in B1" }, +{ ScAddress(2, 0, 0), "C29+1", "Wrong formula in C1" }, +{ ScAddress(3, 0, 0), "D29+1", "Wrong formula in D1" }, +{ ScAddress(4, 0, 0), "E29+1", "Wrong formula in E1" }, +}; + +for (size_t nIdx = 0; nIdx < 4; ++nIdx) +{ +TestCase& rCase = aCases[nIdx]; +ASSERT_FORMULA_EQUAL(rDoc, rCase.aPos, rCase.pExpectedFormula, rCase.pErrorMsg); +} + +xDocSh->DoClose(); +} + void ScFiltersTest::testSheetNamesXLSX() { ScDocShellRef xDocSh = loadDoc("sheet-names.", FORMAT_XLSX); commit 541af6456cd2f0598378f772e25f621d3cf3f6bb Author: Dennis Francis AuthorDate: Wed Nov 20 13:24:48 2019 +0530 Commit: Andras Timar CommitDate: Wed Nov 27 14:51:18 2019 +0100 tdf#128894: xlsx-import : Do not share tokens between cells... which are part of a xlsx-shared-formula along a *row*. If we do, any reference-updates on these cells while editing will mess things up. For example a shared formula "=A30+1" used for a few cells in the first row (say, A1, B1, C1 and D1) and on deleting a row, say row#5, the reference update operation will decrement the row index of all tokens in A1, B1, C1 and D1. But if they share tokens, they all end up pointing to row#26 instead of row#29 as each cell is updated which amounts to decrementing 4 times instead of once. However shared formulas along columns are not affected by this bug, when tokens are shared since we use formula-groups which only keeps one copy of token array for the entire group and reference-update code is designed to correctly work with formula-groups. Reviewed-on: https://gerrit.libreoffice.org/83361 Tested-by: Jenkins Reviewed-by: Luboš Luňák Reviewed-by: Eike Rathke (cherry picked from commit b30251ca0d102ced36799ee18d4bbcd9e8530fa0) (cherry picked from commit 5a1cb68d574e0788a0bad4859acdd5005babb860) Change-Id: Ic0fe84d12fef18fbf21658664e2b2b86409bca27 Reviewed-on: https://gerrit.