[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
sc/source/ui/view/viewdata.cxx | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) New commits: commit abe9a9b023d1b08384f2f529e442e9a59de10f8c Author: Eike Rathke Date: Wed Jun 21 17:42:42 2017 +0200 Resolves: tdf#108654 check nTabNo against maTabData size ScViewData::DeleteTab() and DeleteTabs() never did that and worked by accident for which commit 73dec49802ef8fc42c5719efaa42a33cde68e569 removed the grounding.. squash this into it too: assert(nTab < static_cast(maTabData.size())); cause of tdf#108796 Have a dev friendly abort instead of a deep throw in case of the unexpected. Change-Id: I95460cd017d558c073df7891551d0251009dc1d4 Reviewed-on: https://gerrit.libreoffice.org/56261 Reviewed-by: Aron Budea Tested-by: Aron Budea diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index d2e5b461e9ed..b1b092d85fd3 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -903,9 +903,15 @@ void ScViewData::InsertTabs( SCTAB nTab, SCTAB nNewSheets ) void ScViewData::DeleteTab( SCTAB nTab ) { +assert(nTab < static_cast(maTabData.size())); delete maTabData.at(nTab); - maTabData.erase(maTabData.begin() + nTab); + +if (static_cast(nTabNo) >= maTabData.size()) +{ +EnsureTabDataSize(1); +nTabNo = maTabData.size() - 1; +} UpdateCurrentTab(); mpMarkData->DeleteTab( nTab ); } @@ -919,6 +925,11 @@ void ScViewData::DeleteTabs( SCTAB nTab, SCTAB nSheets ) } maTabData.erase(maTabData.begin() + nTab, maTabData.begin()+ nTab+nSheets); +if (static_cast(nTabNo) >= maTabData.size()) +{ +EnsureTabDataSize(1); +nTabNo = maTabData.size() - 1; +} UpdateCurrentTab(); } ___ 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-5.3' - sc/source
sc/source/ui/view/output2.cxx | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) New commits: commit b1d003af24447a60d1e372caded54e30501b9fd6 Author: Marco Cecchetti Date: Thu Jun 14 12:32:48 2018 +0200 tdf#105720: lok: sc: currency symbol is displayed in the preceding cell Now in online the currency symbol is placed exactly as in the desktop case. Essentially there was a mapping issue. Change-Id: I6175cfeab3d8bc3a757c8522aa9c7a7e49c4bf2b Reviewed-on: https://gerrit.libreoffice.org/55806 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index ce51ee47bf0f..61d5211ec5bf 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -66,6 +66,7 @@ #include #include +#include #include #include @@ -565,13 +566,21 @@ void ScDrawStringsVars::RepeatToFill( long nColWidth ) if ( nRepeatPos == -1 || nRepeatPos > aString.getLength() ) return; +const bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive(); + long nCharWidth = pOutput->pFmtDevice->GetTextWidth(OUString(nRepeatChar)); -if ( nCharWidth < 1) return; + +if ( nCharWidth < 1 || (bIsTiledRendering && nCharWidth < TWIPS_PER_PIXEL)) return; + if (bPixelToLogic) nColWidth = pOutput->mpRefDevice->PixelToLogic(Size(nColWidth,0)).Width(); + // Are there restrictions on the cell type we should filter out here ? -long nSpaceToFill = ( nColWidth - aTextSize.Width() ); +long nTextWidth = aTextSize.Width(); +if ( bIsTiledRendering ) +nTextWidth = pOutput->mpRefDevice->PixelToLogic(Size(nTextWidth,0)).Width(); +long nSpaceToFill = ( nColWidth - nTextWidth ); if ( nSpaceToFill <= nCharWidth ) return; ___ 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-5.3' - sc/source
sc/source/ui/view/gridwin.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit b35f1af6e1c111ec9d138236a37d71106550af1f Author: Marco CecchettiDate: Tue Mar 13 21:39:26 2018 +0100 lok - sc: set a min width for valid list window Change-Id: If22dbc9f0f0512d4b05e9b16c8c6414af33fb9d4 Reviewed-on: https://gerrit.libreoffice.org/51608 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 6bf960dcd45e..e8eaad8e9403 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1135,6 +1135,11 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) // Adjust position and size to Window //! Check first if the entries fit (width) +// minimum width in pixel +const long nMinLOKWinWidth = static_cast(1.3 * STD_COL_WIDTH * pViewData->GetPPTX()); +if (comphelper::LibreOfficeKit::isActive() && nSizeX < nMinLOKWinWidth) +nSizeX = nMinLOKWinWidth; + 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-5.3' - sc/source
sc/source/ui/view/tabvwshf.cxx | 28 +--- 1 file changed, 17 insertions(+), 11 deletions(-) New commits: commit 952a3a62090a8bd2a28798d2f1b4e26d37ac7399 Author: Henry CastroDate: Sun Mar 11 18:44:58 2018 -0400 lokdialog: convert the show sheet dialog to async exec To trigger this dialog: Sheet -> Show Sheet... Change-Id: I501d9444ef9798a26b4db06ab51e4fb691144b17 Reviewed-on: https://gerrit.libreoffice.org/51094 Tested-by: Jenkins Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/51095 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 35d89eb15acb..ff3c764c89f4 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -131,7 +131,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); -ScopedVclPtr pDlg(pFact->CreateScShowTabDlg(GetDialogParent())); +VclPtr pDlg(pFact->CreateScShowTabDlg(GetDialogParent())); OSL_ENSURE(pDlg, "Dialog create fail!"); OUString aTabName; @@ -146,18 +146,24 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) } } -if ( pDlg->Execute() == RET_OK ) -{ -const sal_Int32 nCount = pDlg->GetSelectEntryCount(); -for (sal_Int32 nPos=0; nPos StartExecuteAsync([this, pDlg, pReq](sal_Int32 nResult){ +OUString sTable; +std::vector sTables; +if (RET_OK == nResult) { -aName = pDlg->GetSelectEntry(nPos); -rReq.AppendItem( SfxStringItem( FID_TABLE_SHOW, aName ) ); -rNames.push_back(aName); +const sal_Int32 nCount = pDlg->GetSelectEntryCount(); +for (sal_Int32 nPos=0; nPos GetSelectEntry(nPos); +pReq->AppendItem( SfxStringItem( FID_TABLE_SHOW, sTable ) ); +sTables.push_back(sTable); +} +ShowTable( sTables ); +pReq->Done(); } -ShowTable( rNames ); -rReq.Done(); -} +}); +rReq.Ignore(); } } break; ___ 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-5.3' - sc/source
sc/source/filter/oox/condformatbuffer.cxx | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) New commits: commit ad907b7b00efd889aed89cc0545472af829b6e65 Author: Aron BudeaDate: Sun Feb 18 23:04:09 2018 +0100 for listeners the range needs to be set before the formula, tdf#115530 Reviewed-on: https://gerrit.libreoffice.org/49957 Reviewed-by: Aron Budea Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard (cherry picked from commit 26b51c9550ef300e7685fc41eb9cde4dbbc11265) Reviewed-on: https://gerrit.libreoffice.org/50016 Tested-by: Jenkins Reviewed-by: Eike Rathke (cherry picked from commit 56e0895730fa289d72333d7b432122292e37b4c4) Change-Id: I001795fd456375c4babab2c2e505bedff03e991f diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index aa8fbbaa4d96..335eda125e65 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -1060,10 +1060,6 @@ void CondFormat::finalizeImport() // probably some error in the xml if we are not ready if ( !mbReadyForFinalize ) return; -ScDocument& rDoc = getScDocument(); -maRules.forEachMem( ::finalizeImport ); -SCTAB nTab = maModel.maRanges.getBaseAddress().Tab(); -sal_Int32 nIndex = getScDocument().AddCondFormat(mpFormat, nTab); ScRangeList aList; for( ::std::vector< CellRangeAddress >::const_iterator itr = maModel.maRanges.begin(); itr != maModel.maRanges.end(); ++itr) @@ -1072,8 +1068,14 @@ void CondFormat::finalizeImport() ScUnoConversion::FillScRange(aRange, *itr); aList.Append(aRange); } -rDoc.AddCondFormatData( aList, nTab, nIndex ); mpFormat->SetRange(aList); + +ScDocument& rDoc = getScDocument(); +maRules.forEachMem( ::finalizeImport ); +SCTAB nTab = maModel.maRanges.getBaseAddress().Tab(); +sal_Int32 nIndex = getScDocument().AddCondFormat(mpFormat, nTab); + +rDoc.AddCondFormatData( aList, nTab, nIndex ); } CondFormatRuleRef CondFormat::createRule() ___ 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-5.3' - sc/source
sc/source/ui/view/gridwin4.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 588f9d5860dfc2ea71a037baf9419b92be2e98ec Author: Jan HolesovskyDate: Tue Mar 13 17:47:08 2018 +0100 Fix build. Change-Id: Id81f080153070c205effe9dee86ed0363902924b Reviewed-on: https://gerrit.libreoffice.org/51234 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 5adf5a4bc52a..10b5bcca8b76 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1720,7 +1720,7 @@ void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo if ( bOtherListValButton && pRowInfo[nArrY].nRowNo == aOtherListValPos.Row() && pRowInfo[nArrY].bChanged ) { -tools::Rectangle aRect = GetListValButtonRect( aOtherListValPos ); +Rectangle aRect = GetListValButtonRect( aOtherListValPos ); aComboButton.SetPosPixel( aRect.TopLeft() ); aComboButton.SetSizePixel( aRect.GetSize() ); pContentDev->SetClipRegion(vcl::Region(aRect)); ___ 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-5.3' - sc/source
sc/source/ui/cctrl/cbuttonw.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit f11693d5f99bbb8c9ebcd407bc3b13f05bdbd075 Author: Jan HolesovskyDate: Wed Mar 7 18:30:22 2018 +0100 sc lok: Let the tiled rendering draw the List Validation dropdowns. Change-Id: I84530cdda296dc51ceb0fd695af19211631508df Reviewed-on: https://gerrit.libreoffice.org/50906 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx index f7d9729512d2..ce37dc0f3f0c 100644 --- a/sc/source/ui/cctrl/cbuttonw.cxx +++ b/sc/source/ui/cctrl/cbuttonw.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include #include #include #include @@ -63,7 +64,8 @@ void ScDDComboBoxButton::Draw( const Point& rAt, Rectangle aBtnRect( rAt, rSize ); -pOut->EnableMapMode( false ); +if (!comphelper::LibreOfficeKit::isActive()) +pOut->EnableMapMode(false); DecorationView aDecoView( pOut); ___ 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-5.3' - sc/source
sc/source/ui/src/scstring.src |5 + 1 file changed, 5 insertions(+) New commits: commit f2f3944cbf4be87bc4f9045c5f5e21570e7b1213 Author: Jan HolesovskyDate: Mon Feb 26 14:34:46 2018 +0100 Custom data validation: Add a missing string. Change-Id: Ief0891d73f0b0ecd0bfdf7092118d795d32d285e Reviewed-on: https://gerrit.libreoffice.org/50366 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src index e4e7e6ba9198..54880380fcba 100644 --- a/sc/source/ui/src/scstring.src +++ b/sc/source/ui/src/scstring.src @@ -824,6 +824,11 @@ String SCSTR_SELECT Text [ en-US ] = "Selection area"; }; +String SCSTR_VALID_FORMULA +{ +Text [ en-US ] = "~Formula"; +}; + String STR_NOFORMULASPECIFIED { Text [ en-US ] = "No formula specified." ; ___ 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-5.3' - sc/source
sc/source/ui/unoobj/docuno.cxx |6 -- 1 file changed, 6 deletions(-) New commits: commit 86ea687d3f19c04192ee2b7a82736e110c7be334 Author: Pranav KantDate: Fri Feb 23 21:27:50 2018 +0530 lok sc: This is not needed now I guess since these events are routed through vcl now. Change-Id: Ib2a44c82d76a25ac5a3341c060a665c62e3d60a7 Reviewed-on: https://gerrit.libreoffice.org/50254 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index ae635323574e..7a1af69926f3 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -688,12 +688,6 @@ void ScModelObj::postMouseEvent(int nType, int nX, int nY, int nCount, int nButt break; case LOK_MOUSEEVENT_MOUSEBUTTONUP: Application::PostMouseEvent(VCLEVENT_WINDOW_MOUSEBUTTONUP, pGridWindow, ); - -// sometimes MouseButtonDown captures mouse and starts tracking, and VCL -// will not take care of releasing that with tiled rendering -if (pGridWindow->IsTracking()) -pGridWindow->EndTracking(TrackingEventFlags::DontCallHdl); - break; case LOK_MOUSEEVENT_MOUSEMOVE: Application::PostMouseEvent(VCLEVENT_WINDOW_MOUSEMOVE, pGridWindow, ); ___ 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-5.3' - sc/source sd/source sw/source
sc/source/ui/unoobj/docuno.cxx|4 ++-- sd/source/ui/unoidl/unomodel.cxx |5 +++-- sw/source/uibase/uno/unotxdoc.cxx |4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) New commits: commit d5f0b3d725f678c1a7eb4b8b4ab3a2279742260c Author: Pranav KantDate: Thu Feb 22 17:40:35 2018 +0530 Revert posting key events on the main thread This partially reverts commit f2d3192e8a4ae743fcaab27ab6d829d57ae8fb60. Change-Id: Ic273e3f742d48dbfb73060a6ecb4feb80afdcfaa Reviewed-on: https://gerrit.libreoffice.org/50174 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index f415a7b5cd4c..b6cbc5e46fac 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -623,10 +623,10 @@ void ScModelObj::postKeyEvent(int nType, int nCharCode, int nKeyCode) switch (nType) { case LOK_KEYEVENT_KEYINPUT: -Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pWindow, ); +pWindow->KeyInput(aEvent); break; case LOK_KEYEVENT_KEYUP: -Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pWindow, ); +pWindow->KeyUp(aEvent); break; default: assert(false); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 30971a584e49..d9ea81e4982e 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2507,13 +2507,14 @@ void SdXImpressDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode) return; KeyEvent aEvent(nCharCode, nKeyCode, 0); + switch (nType) { case LOK_KEYEVENT_KEYINPUT: -Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pWindow, ); +pWindow->KeyInput(aEvent); break; case LOK_KEYEVENT_KEYUP: -Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pWindow, ); +pWindow->KeyUp(aEvent); break; default: assert(false); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 103ae13f9111..0244b3db6a2b 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3499,10 +3499,10 @@ void SwXTextDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode) switch (nType) { case LOK_KEYEVENT_KEYINPUT: -Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pWindow, ); +pWindow->KeyInput(aEvent); break; case LOK_KEYEVENT_KEYUP: -Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pWindow, ); +pWindow->KeyUp(aEvent); break; default: assert(false); ___ 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-5.3' - sc/source sd/source sw/source
sc/source/ui/unoobj/docuno.cxx| 28 sd/source/ui/unoidl/unomodel.cxx | 24 +--- sw/source/uibase/uno/unotxdoc.cxx | 23 +++ 3 files changed, 32 insertions(+), 43 deletions(-) New commits: commit f2d3192e8a4ae743fcaab27ab6d829d57ae8fb60 Author: Pranav KantDate: Tue Feb 20 21:32:34 2018 +0530 lok: Factor out the code for finding vcl::Window of a document This should also help with IME input on charts Change-Id: Ie513790a5d0c87397c39301a328a44b59d394a45 Reviewed-on: https://gerrit.libreoffice.org/50094 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 63a7b757bf9a..7df255a31ebd 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -549,10 +549,19 @@ OUString ScModelObj::getPartHash( int nPart ) VclPtr ScModelObj::getDocWindow() { SolarMutexGuard aGuard; + +// There seems to be no clear way of getting the grid window for this +// particular document, hence we need to hope we get the right window. ScViewData* pViewData = ScDocShell::GetViewData(); VclPtr pWindow; if (pViewData) pWindow = pViewData->GetActiveWin(); + +LokChartHelper aChartHelper(pViewData->GetViewShell()); +vcl::Window* pChartWindow = aChartHelper.GetWindow(); +if (pChartWindow) +pWindow = pChartWindow; + return pWindow; } @@ -594,31 +603,18 @@ void ScModelObj::postKeyEvent(int nType, int nCharCode, int nKeyCode) { SolarMutexGuard aGuard; -// There seems to be no clear way of getting the grid window for this -// particular document, hence we need to hope we get the right window. -ScViewData* pViewData = ScDocShell::GetViewData(); -vcl::Window* pWindow = pViewData->GetActiveWin(); - +VclPtr pWindow = getDocWindow(); if (!pWindow) return; KeyEvent aEvent(nCharCode, nKeyCode, 0); - -ScTabViewShell * pTabViewShell = pViewData->GetViewShell(); -LokChartHelper aChartHelper(pTabViewShell); -vcl::Window* pChartWindow = aChartHelper.GetWindow(); -if (pChartWindow) -{ -pWindow = pChartWindow; -} - switch (nType) { case LOK_KEYEVENT_KEYINPUT: -pWindow->KeyInput(aEvent); +Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pWindow, ); break; case LOK_KEYEVENT_KEYUP: -pWindow->KeyUp(aEvent); +Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pWindow, ); break; default: assert(false); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 4933b87742f9..30971a584e49 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2374,6 +2374,12 @@ VclPtr SdXImpressDocument::getDocWindow() VclPtr pWindow; if (pViewShell) pWindow = pViewShell->GetActiveWindow(); + +LokChartHelper aChartHelper(pViewShell->GetViewShell()); +VclPtr pChartWindow = aChartHelper.GetWindow(); +if (pChartWindow) +pWindow = pChartWindow; + return pWindow; } @@ -2496,30 +2502,18 @@ void SdXImpressDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode) { SolarMutexGuard aGuard; -DrawViewShell* pViewShell = GetViewShell(); -if (!pViewShell) -return; - -vcl::Window* pWindow = pViewShell->GetActiveWindow(); +VclPtr pWindow = getDocWindow(); if (!pWindow) return; -LokChartHelper aChartHelper(pViewShell->GetViewShell()); -vcl::Window* pChartWindow = aChartHelper.GetWindow(); -if (pChartWindow) -{ -pWindow = pChartWindow; -} - KeyEvent aEvent(nCharCode, nKeyCode, 0); - switch (nType) { case LOK_KEYEVENT_KEYINPUT: -pWindow->KeyInput(aEvent); +Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pWindow, ); break; case LOK_KEYEVENT_KEYUP: -pWindow->KeyUp(aEvent); +Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pWindow, ); break; default: assert(false); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 43101853987a..103ae13f9111 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3409,6 +3409,12 @@ VclPtr SwXTextDocument::getDocWindow() SwView* pView = pDocShell->GetView(); if (pView) pWindow = &(pView->GetEditWin()); + +LokChartHelper aChartHelper(pView); +VclPtr pChartWindow = aChartHelper.GetWindow(); +if (pChartWindow) +pWindow = pChartWindow; + return pWindow; } @@ -3485,25 +3491,18 @@ void SwXTextDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode) { SolarMutexGuard aGuard; -vcl::Window* pWindow = &(pDocShell->GetView()->GetEditWin()); - -
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
sc/source/ui/app/transobj.cxx | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) New commits: commit 6574ae5c8e8c89ed3b4f7e24db1b2bb8ecf60536 Author: Henry CastroDate: Tue Feb 6 17:16:03 2018 -0400 tdf#115020: Cutting a large dataset is very slow since 6.1.0.0.alpha0+ Change-Id: Icc26224055c00bd826019bd728c3f74d2ebba535 Reviewed-on: https://gerrit.libreoffice.org/49320 Tested-by: Jenkins Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/49517 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index c17ac0cc7ed1..a7b2e66a54b9 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -200,13 +201,22 @@ ScTransferObj::~ScTransferObj() ScTransferObj* ScTransferObj::GetOwnClipboard( vcl::Window* pUIWin ) { ScTransferObj* pObj = nullptr; -TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pUIWin ) ); -uno::Reference xTunnel( aDataHelper.GetTransferable(), uno::UNO_QUERY ); -if ( xTunnel.is() ) +uno::Reference xTransferable; +uno::Reference xClipboard; + +if( pUIWin ) +xClipboard = pUIWin->GetClipboard(); + +if( xClipboard.is() ) { -sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() ); -if ( nHandle ) -pObj = dynamic_cast (reinterpret_cast ( (sal_IntPtr) nHandle )); +xTransferable = xClipboard->getContents(); +uno::Reference xTunnel( xTransferable, uno::UNO_QUERY ); +if ( xTunnel.is() ) +{ +sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() ); +if ( nHandle ) +pObj = dynamic_cast (reinterpret_cast ( static_cast(nHandle) )); +} } return pObj; ___ 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-5.3' - sc/source
sc/source/ui/view/cellsh1.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a2277fddf3495ee75236b8ac167ec8cef0440cce Author: Marco CecchettiDate: Sun Feb 4 17:26:54 2018 +0100 lok: calc: grouping - workaround no more needed Now the dialog for selecting row/column group works fine Change-Id: I88660e8f49cf41ae45926a1d7299b1370bf54b93 Reviewed-on: https://gerrit.libreoffice.org/49212 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index bbce79c3564a..e8a5fecaf609 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1169,7 +1169,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) bColumns = true; else if ( !GetViewData()->SimpleColMarked() && GetViewData()->SimpleRowMarked() ) bColumns = false; -else if ( !comphelper::LibreOfficeKit::isActive() ) // TODO: handle this case in LOK too +else { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); ___ 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-5.3' - sc/source
sc/source/ui/view/tabvwsha.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 545984812e1cad17c28eb412ffd2cd9cf85cda0f Author: Caolán McNamaraDate: Thu Jan 18 21:33:19 2018 + SfxReqest::Done takes a SfxItemSet& or a boolean, not a SfxItemSet* regression from commit c40dfabd56ade10fe35690dc9810955c2e99e2c0 Date: Fri Jan 12 11:57:22 2018 + Change-Id: Ia97ba286a2da0584a2e806ad7396a3633f9d913e Reviewed-on: https://gerrit.libreoffice.org/48170 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 06c7ef175f83..97f2c252722f 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -563,7 +563,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString ApplyAttributes(pOutSet, pOldSet.get()); -pRequest->Done(pOutSet); +pRequest->Done(*pOutSet); } }, pDlg); } ___ 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-5.3' - sc/source
sc/source/ui/view/tabvwsha.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit c8baf1ba73cd4671d6ba8b9bc725209235ec0ee1 Author: Jan HolesovskyDate: Tue Jan 16 13:40:18 2018 +0100 lokdialog: Don't output anything for the incoming SfxRequest. Change-Id: I1b216b7348a46835df3c2d307ce17bca6417 Reviewed-on: https://gerrit.libreoffice.org/47987 Reviewed-by: pranavk Tested-by: pranavk diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 4753de415735..06c7ef175f83 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -546,6 +546,8 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString pDlg->SetCurPageId(rName); std::shared_ptr pRequest(new SfxRequest(rReq)); +rReq.Ignore(); // the 'old' request is not relevant any more + pDlg->StartExecuteAsync([=](sal_Int32 nResult){ bInFormatDialog = false; ___ 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-5.3' - sc/source
sc/source/ui/view/viewfun2.cxx | 17 + 1 file changed, 17 insertions(+) New commits: commit 233101a135d2e6dd67f3eaf9f54ac56d43c372cf Author: Marco CecchettiDate: Thu Jan 11 16:03:30 2018 +0100 lok: sc: invalidate cached positions and row header on font resizing Change-Id: I9678d6bd730d09d1cc47a8633368c99abe1f9bd9 Reviewed-on: https://gerrit.libreoffice.org/47763 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 3373a97264ad..45bb9e106e84 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -115,6 +115,12 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData ) aMarkedRows.push_back(sc::ColRowSpan(nCurRow, nCurRow)); } +if (comphelper::LibreOfficeKit::isActive()) +{ +SCCOLROW nStart = aMarkedRows[0].mnStart; +OnLOKSetWidthOrHeight(nStart, /*width: */ false); +} + double nPPTX = GetViewData().GetPPTX(); double nPPTY = GetViewData().GetPPTY(); Fraction aZoomX = GetViewData().GetZoomX(); @@ -158,11 +164,19 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData ) if ( bPaint && bAnyChanged ) pDocSh->UpdateOle(()); +if (comphelper::LibreOfficeKit::isActive()) +ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, GetViewData().GetTabNo()); + return bAnyChanged; } bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow ) { +if (comphelper::LibreOfficeKit::isActive()) +{ +OnLOKSetWidthOrHeight(nStartRow, /*width: */ false); +} + ScDocShell* pDocSh = GetViewData().GetDocShell(); ScDocument& rDoc = pDocSh->GetDocument(); SCTAB nTab = GetViewData().GetTabNo(); @@ -195,6 +209,9 @@ bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow ) pDocSh->PostPaint( 0, nStartRow, nTab, MAXCOL, MAXROW, nTab, PaintPartFlags::Grid | PaintPartFlags::Left ); +if (comphelper::LibreOfficeKit::isActive()) +ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, GetViewData().GetTabNo()); + return bChanged; } ___ 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-5.3' - sc/source
sc/source/ui/inc/viewdata.hxx | 52 sc/source/ui/view/gridwin4.cxx | 92 --- sc/source/ui/view/tabview.cxx | 243 - sc/source/ui/view/viewdata.cxx | 198 + 4 files changed, 301 insertions(+), 284 deletions(-) New commits: commit 2033424f6e6d8869990c4b8c69225be99a82ea23 Author: Marco CecchettiDate: Sun Jan 7 16:54:47 2018 +0100 lok: sc: exploiting cached position helper for tile rendering Change-Id: I02b21c5979d1dfb6bb60a05d891c632602fb44ee Reviewed-on: https://gerrit.libreoffice.org/47548 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 6fc2d748a670..0deff35acf90 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -147,6 +147,58 @@ public: index_type getIndex(long nPos) const; }; +class ScBoundsProvider +{ +typedef ScPositionHelper::value_type value_type; +typedef SCCOLROW index_type; + +ScDocument* pDoc; +const SCTAB nTab; +const bool bColumnHeader; +const index_type MAX_INDEX; + +index_type nFirstIndex; +index_type nSecondIndex; +long nFirstPositionPx; +long nSecondPositionPx; + +public: +ScBoundsProvider(ScDocument* pD, SCTAB nT, bool bColumnHeader); + +void GetStartIndexAndPosition(SCCOL& nIndex, long& nPosition) const; +void GetEndIndexAndPosition(SCCOL& nIndex, long& nPosition) const; +void GetStartIndexAndPosition(SCROW& nIndex, long& nPosition) const; +void GetEndIndexAndPosition(SCROW& nIndex, long& nPosition) const; + +void Compute(value_type aFirstNearest, value_type aSecondNearest, + long nFirstBound, long nSecondBound); + +void EnlargeStartBy(long nOffset); + +void EnlargeEndBy(long nOffset); + +void EnlargeBy(long nOffset) +{ +EnlargeStartBy(nOffset); +EnlargeEndBy(nOffset); +} + +private: +long GetSize(index_type nIndex) const; + +void GetIndexAndPos(index_type nNearestIndex, long nNearestPosition, +long nBound, index_type& nFoundIndex, long& nPosition, +bool bTowards, long nDiff); + +void GeIndexBackwards(index_type nNearestIndex, long nNearestPosition, + long nBound, index_type& nFoundIndex, long& nPosition, + bool bTowards); + +void GetIndexTowards(index_type nNearestIndex, long nNearestPosition, + long nBound, index_type& nFoundIndex, long& nPosition, + bool bTowards); +}; + class ScViewDataTable // per-sheet data { friend class ScViewData; diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 228f087e8790..f89deb007e0a 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1074,41 +1074,41 @@ void ScGridWindow::DrawContent(OutputDevice , const ScTableInfo& rTableI mpNoteMarker->Draw(); // Above the cursor, in drawing map mode } -namespace { -// Find the row/col just -before- the nPosition in pixels and its offset -inline void mapConservativeToRowCol(ScDocument *pDoc, -sal_Int32 *nIndex, -sal_Int32 *nOffset, -sal_Int32 *nOrigin, -sal_Int32 nTabNo, -sal_Int32 nPosition, -boolbRowNotCol, -double nPPTX, -double nPPTY) +namespace +{ +template +inline +void lcl_getBoundingRowColumnforTile(ScViewData* pViewData, +long nTileStartPosPx, long nTileEndPosPx, +sal_Int32& nTopLeftTileOffset, sal_Int32& nTopLeftTileOrigin, +sal_Int32& nTopLeftTileIndex, sal_Int32& nBottomRightTileIndex) { -long nTmp = 0; // row/col to render for nPosition -long nLastScrPos = 0, nScrPos = 0; -const long nMaxIndex = bRowNotCol ? MAXROW : MAXCOL; -while (nScrPos <= nPosition && nTmp < nMaxIndex) -{ -long nSize = bRowNotCol ? pDoc->GetRowHeight( nTmp, nTabNo ) -: pDoc->GetColWidth( nTmp, nTabNo ); -if (nSize) -{ -nLastScrPos = nScrPos; -nScrPos += ScViewData::ToPixel( nSize, bRowNotCol ? nPPTY : nPPTX ); -} // else - FIXME 'skip multiple hidden rows' +const bool bColumnHeader = std::is_same ::value; -*nIndex = nTmp; -nTmp++; -} +SCTAB nTab = pViewData->GetTabNo(); +ScDocument* pDoc =
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
sc/source/ui/undo/undodat.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 6ca469e0d53c0ab81765c4dc41f73bc3bc5c6d36 Author: Marco CecchettiDate: Sun Dec 17 14:12:15 2017 +0100 lok: sc: missing header invalidation on undo an autofilter action Change-Id: Ibfa7602221ed0c115ad469bd8a61e62baaff0bdf Reviewed-on: https://gerrit.libreoffice.org/46717 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx index 619fb238c118..57fff35c0903 100644 --- a/sc/source/ui/undo/undodat.cxx +++ b/sc/source/ui/undo/undodat.cxx @@ -853,6 +853,7 @@ void ScUndoQuery::Undo() // invalidate cache positions and update cursor and selection pViewShell->OnLOKShowHideColRow(/*bColumns*/ false, aQueryParam.nRow1 - 1); +ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, nTab); // Paint ___ 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-5.3' - sc/source
sc/source/ui/docshell/dbdocfun.cxx | 16 ++ sc/source/ui/docshell/olinefun.cxx | 40 ++--- sc/source/ui/inc/dbfunc.hxx|2 - sc/source/ui/inc/tabview.hxx |9 +++- sc/source/ui/inc/tabvwsh.hxx |8 --- sc/source/ui/undo/undoblk2.cxx |4 --- sc/source/ui/undo/undodat.cxx | 13 +--- sc/source/ui/view/dbfunc.cxx |2 - sc/source/ui/view/dbfunc3.cxx | 13 sc/source/ui/view/gridwin.cxx |3 ++ sc/source/ui/view/tabview4.cxx |5 +++- sc/source/ui/view/tabvwshc.cxx | 25 +++ sc/source/ui/view/viewfunc.cxx |4 --- 13 files changed, 83 insertions(+), 61 deletions(-) New commits: commit 7c99515b6247ca1bfc2d4d25192cde9b46670b62 Author: Marco CecchettiDate: Fri Dec 15 11:43:55 2017 +0100 lok: sc: header, cursor and selection overlays issues wrt autofilter Change-Id: I5d797b48083c24e63f7149cf3a469ebf93213311 Reviewed-on: https://gerrit.libreoffice.org/46545 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index f33efe8cf789..4cbbd06b2050 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -614,6 +614,12 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam, ScDocShellModificator aModificator( rDocShell ); ScDocument& rDoc = rDocShell.GetDocument(); + +if (ScTabViewShell::isAnyEditViewInRange(/*bColumns*/ false, rQueryParam.nRow1, rQueryParam.nRow2)) +{ +return false; +} + if (bRecord && !rDoc.IsUndoEnabled()) bRecord = false; ScDBData* pDBData = rDoc.GetDBAtArea( nTab, rQueryParam.nCol1, rQueryParam.nRow1, @@ -924,6 +930,16 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam, pOld, bDoSize, pAdvSource ) ); } +ScTabViewShell* pViewSh = rDocShell.GetBestViewShell(); +if ( pViewSh ) +{ +// could there be horizontal autofilter ? +// maybe it would be better to set bColumns to !rQueryParam.bByRow ? +// anyway at the beginning the value of bByRow is 'false' +// then after the first sort action it becomes 'true' +pViewSh->OnLOKShowHideColRow(/*bColumns*/ false, rQueryParam.nRow1 - 1); +} + if (bCopy) { SCCOL nEndX = aLocalParam.nCol2; diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx index 2e07e6d2d2c0..22dec17cae06 100644 --- a/sc/source/ui/docshell/olinefun.cxx +++ b/sc/source/ui/docshell/olinefun.cxx @@ -78,32 +78,6 @@ static void lcl_PaintWidthHeight( ScDocShell& rDocShell, SCTAB nTab, rDocShell.PostPaint( nStartCol,nStartRow,nTab, MAXCOL,MAXROW,nTab, nParts ); } -static bool lcl_IsAnyViewEditingInEntryRange(bool bColumns, SCCOLROW nStart, SCCOLROW nEnd) -{ -if (comphelper::LibreOfficeKit::isActive()) -{ -SfxViewShell* pViewShell = SfxViewShell::GetFirst(); -while (pViewShell) -{ -ScTabViewShell* pTabViewShell = dynamic_cast (pViewShell); -if (pTabViewShell) -{ -ScInputHandler* pInputHandler = pTabViewShell->GetInputHandler(); -if (pInputHandler && pInputHandler->GetActiveView()) -{ -const ScViewData& rViewData = pTabViewShell->GetViewData(); -SCCOLROW nPos = bColumns ? rViewData.GetCurX() : rViewData.GetCurY(); -if (nStart <= nPos && nPos <= nEnd) -return true; -} -} -pViewShell = SfxViewShell::GetNext(*pViewShell); -} -} -return false; -} - - void ScOutlineDocFunc::MakeOutline( const ScRange& rRange, bool bColumns, bool bRecord, bool bApi ) { SCCOL nStartCol = rRange.aStart.Col(); @@ -396,7 +370,7 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel sal_uInt16 nThisLevel = aIter.LastLevel(); bool bShow = (nThisLevel < nLevel); -if (!bShow && lcl_IsAnyViewEditingInEntryRange(bColumns, nThisStart, nThisEnd)) +if (!bShow && ScTabViewShell::isAnyEditViewInRange(bColumns, nThisStart, nThisEnd)) continue; if (bShow) // enable @@ -446,7 +420,7 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel ScTabViewShell* pViewSh = rDocShell.GetBestViewShell(); if ( pViewSh ) -pViewSh->OnLOKShowHideOutline(bColumns, nStart - 1); +pViewSh->OnLOKShowHideColRow(bColumns, nStart - 1); if (bPaint) lcl_PaintWidthHeight( rDocShell, nTab, bColumns, nStart, nEnd ); @@ -557,8 +531,8 @@
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
sc/source/ui/docshell/olinefun.cxx | 111 - 1 file changed, 84 insertions(+), 27 deletions(-) New commits: commit 1d7fc3d615f611c1a3729c92dbef363a1357f0cd Author: Marco CecchettiDate: Wed Dec 13 18:19:16 2017 +0100 lok: sc: handling conflicts btw group collapsing and cell editing Now when a cell is edited, a group including the cell in its range can't be collapsed. When whole levels are collapsed all together any group entry including an edited cell is skipped from collapsing. Undo/redo of collapsing/expanding has been (temporarily) disabled in the LOK case, since it could mess things up when a cell is edited and a group is collapsed because of an undo/redo. Change-Id: I401fa69b7a0275e3e14428b16ab48c409408a861 Reviewed-on: https://gerrit.libreoffice.org/46544 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx index c2e56231cc74..2e07e6d2d2c0 100644 --- a/sc/source/ui/docshell/olinefun.cxx +++ b/sc/source/ui/docshell/olinefun.cxx @@ -28,6 +28,7 @@ #include "sc.hrc" #include +#include #include #include @@ -77,6 +78,32 @@ static void lcl_PaintWidthHeight( ScDocShell& rDocShell, SCTAB nTab, rDocShell.PostPaint( nStartCol,nStartRow,nTab, MAXCOL,MAXROW,nTab, nParts ); } +static bool lcl_IsAnyViewEditingInEntryRange(bool bColumns, SCCOLROW nStart, SCCOLROW nEnd) +{ +if (comphelper::LibreOfficeKit::isActive()) +{ +SfxViewShell* pViewShell = SfxViewShell::GetFirst(); +while (pViewShell) +{ +ScTabViewShell* pTabViewShell = dynamic_cast (pViewShell); +if (pTabViewShell) +{ +ScInputHandler* pInputHandler = pTabViewShell->GetInputHandler(); +if (pInputHandler && pInputHandler->GetActiveView()) +{ +const ScViewData& rViewData = pTabViewShell->GetViewData(); +SCCOLROW nPos = bColumns ? rViewData.GetCurX() : rViewData.GetCurY(); +if (nStart <= nPos && nPos <= nEnd) +return true; +} +} +pViewShell = SfxViewShell::GetNext(*pViewShell); +} +} +return false; +} + + void ScOutlineDocFunc::MakeOutline( const ScRange& rRange, bool bColumns, bool bRecord, bool bApi ) { SCCOL nStartCol = rRange.aStart.Col(); @@ -333,7 +360,9 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel SCCOLROW nStart, nEnd; rArray.GetRange( nStart, nEnd ); -if ( bRecord ) +// TODO undo can mess things up when another view is editing a cell in the range of group entry +// this is a temporarily workaround +if (!comphelper::LibreOfficeKit::isActive() && bRecord ) { ScOutlineTable* pUndoTab = new ScOutlineTable( *pTable ); ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -361,9 +390,16 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel ScOutlineEntry* pEntry; while ((pEntry=aIter.GetNext()) != nullptr) { +SCCOLROW nThisStart = pEntry->GetStart(); +SCCOLROW nThisEnd = pEntry->GetEnd(); + sal_uInt16 nThisLevel = aIter.LastLevel(); bool bShow = (nThisLevel < nLevel); -if (bShow) // einblenden + +if (!bShow && lcl_IsAnyViewEditingInEntryRange(bColumns, nThisStart, nThisEnd)) +continue; + +if (bShow) // enable { pEntry->SetHidden( false ); pEntry->SetVisible( true ); @@ -375,12 +411,20 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel } else// verdeckt { -pEntry->SetVisible( false ); +if (comphelper::LibreOfficeKit::isActive() && nThisLevel > 0) +{ +pEntry->SetHidden( true ); +const ScOutlineEntry* pParentEntry = rArray.GetEntryByPos(nThisLevel - 1, nThisStart); +if (pParentEntry && pParentEntry->IsHidden()) +pEntry->SetVisible( false ); +} +else +{ +pEntry->SetVisible( false ); +} } -SCCOLROW nThisStart = pEntry->GetStart(); -SCCOLROW nThisEnd = pEntry->GetEnd(); -for (SCCOLROW i=nThisStart; i<=nThisEnd; i++) + for (SCCOLROW i=nThisStart; i<=nThisEnd; i++) { if ( bColumns ) rDoc.ShowCol( static_cast(i), nTab, bShow ); @@ -400,16 +444,16 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns,
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
sc/source/ui/view/gridwin.cxx |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) New commits: commit 5651eb34534db14851d4107435ca75e8f414124a Author: Marco CecchettiDate: Wed Dec 13 18:02:01 2017 +0100 lok: sc: append the col, row position to the cell cursor message Change-Id: I7f8c0e3685c57ff20520ee068b215037f6137389 Reviewed-on: https://gerrit.libreoffice.org/46543 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 9cd3f117118e..d0710fd96777 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5761,11 +5761,14 @@ OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoo if (nSizeYPix == 0) nSizeYPix = 1; +long nPosXTw = rtl::math::round(aScrPos.getX() / fPPTX); +long nPosYTw = rtl::math::round(aScrPos.getY() / fPPTY); long nSizeXTw = rtl::math::round(nSizeXPix / fPPTX); long nSizeYTw = rtl::math::round(nSizeYPix / fPPTY); -Rectangle aRect(Point(rtl::math::round(aScrPos.getX() / fPPTX), rtl::math::round(aScrPos.getY() / fPPTY)), -Size(nSizeXTw, nSizeYTw)); +std::stringstream ss; +ss << nPosXTw << ", " << nPosYTw << ", " << nSizeXTw << ", " << nSizeYTw << ", " + << nX << ", " << nY; pViewData->SetZoom(defaultZoomX, defaultZoomY, true); @@ -5776,7 +5779,7 @@ OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoo pViewData->GetLOKHeightHelper().insert(nY - 1, aScrPos.getY()); pViewData->SetLOKOldCurY(nY); -return aRect.toString(); +return ss.str().c_str(); } void ScGridWindow::updateLibreOfficeKitCellCursor(SfxViewShell* pOtherShell) const ___ 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-5.3' - sc/source vcl/source
sc/source/ui/cctrl/checklistmenu.src |5 + sc/source/ui/inc/checklistmenu.hrc | 15 --- sc/source/ui/view/gridwin.cxx|3 +++ vcl/source/window/floatwin.cxx |2 ++ 4 files changed, 18 insertions(+), 7 deletions(-) New commits: commit 04abf03ecb18ccf1f805faa763d6f29013efc6bb Author: Pranav KantDate: Fri Dec 15 14:52:31 2017 +0530 lokdialog: Give non-programmatic name to autofilter Change-Id: I8670a5aaa1703677cab173b2341c6e70e689f61a Reviewed-on: https://gerrit.libreoffice.org/46505 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/cctrl/checklistmenu.src b/sc/source/ui/cctrl/checklistmenu.src index 59c8eb09477b..2c65b2fbb851 100644 --- a/sc/source/ui/cctrl/checklistmenu.src +++ b/sc/source/ui/cctrl/checklistmenu.src @@ -21,6 +21,11 @@ Resource RID_POPUP_FILTER { +String STR_MENU_TITLE +{ +Text [ en-US ] = "AutoFilter" ; +}; + String STR_MENU_SORT_ASC { Text [ en-US ] = "Sort Ascending" ; diff --git a/sc/source/ui/inc/checklistmenu.hrc b/sc/source/ui/inc/checklistmenu.hrc index 7d009576f1dd..33b689887eb6 100644 --- a/sc/source/ui/inc/checklistmenu.hrc +++ b/sc/source/ui/inc/checklistmenu.hrc @@ -22,13 +22,14 @@ #include -#define STR_MENU_SORT_ASC 1 -#define STR_MENU_SORT_DESC 2 -#define STR_MENU_SORT_CUSTOM3 -#define STR_BTN_TOGGLE_ALL 4 -#define STR_BTN_SELECT_CURRENT 5 -#define STR_BTN_UNSELECT_CURRENT6 -#define STR_EDIT_SEARCH_ITEMS 7 +#define STR_MENU_TITLE 1 +#define STR_MENU_SORT_ASC 2 +#define STR_MENU_SORT_DESC 3 +#define STR_MENU_SORT_CUSTOM4 +#define STR_BTN_TOGGLE_ALL 5 +#define STR_BTN_SELECT_CURRENT 6 +#define STR_BTN_UNSELECT_CURRENT7 +#define STR_EDIT_SEARCH_ITEMS 8 #endif diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index d285f6c05287..9cd3f117118e 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -682,7 +682,10 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) mpAutoFilterPopup.disposeAndClear(); mpAutoFilterPopup.reset(VclPtr::Create(this, pDoc)); if (comphelper::LibreOfficeKit::isActive()) +{ mpAutoFilterPopup->SetLOKNotifier(SfxViewShell::Current()); +mpAutoFilterPopup->SetText(SC_STRLOAD(RID_POPUP_FILTER, STR_MENU_TITLE)); +} mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, Normal)); mpAutoFilterPopup->setPopupEndAction( new AutoFilterPopupEndAction(this, ScAddress(nCol, nRow, nTab))); diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 7a03108495b1..3ee264fad5ad 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -629,6 +629,8 @@ void FloatingWindow::StateChanged( StateChangedType nType ) } aItems.emplace_back("size", GetSizePixel().toString()); aItems.emplace_back("position", mpImplData->maPos.toString()); +if (!GetText().isEmpty()) +aItems.emplace_back("title", GetText().toUtf8()); GetLOKNotifier()->notifyWindow(GetLOKWindowId(), "created", aItems); } else if (!IsVisible() && nType == StateChangedType::Visible) ___ 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-5.3' - sc/source
sc/source/ui/docshell/docsh4.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0f685ee5a0913cab5826eec737f25328fabf256d Author: Szymon KÅosDate: Wed Dec 6 20:43:22 2017 +0100 Windows build fix - uninitialized variable docsh4.cxx(1186) : warning C4701: potentially uninitialized local variable 'eLang' used Change-Id: I9a885cb8ce26f11f43c44ac1ca602d03ef84dfed Reviewed-on: https://gerrit.libreoffice.org/45988 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index aaf28e094dea..7fa1b98b6664 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1132,7 +1132,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) if ( !aLangText.isEmpty() ) { -LanguageType eLang, eLatin, eCjk, eCtl; +LanguageType eLang = LANGUAGE_NONE, eLatin, eCjk, eCtl; const OUString aDocLangPrefix("Default_"); const OUString aNoLang("LANGUAGE_NONE"); const OUString aResetLang("RESET_LANGUAGES"); ___ 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-5.3' - sc/source
sc/source/ui/view/tabview.cxx | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) New commits: commit adac52d22b5cddaa3fd025fe13634df59a6beb49 Author: Marco CecchettiDate: Sat Dec 2 17:42:54 2017 +0100 lok: calc: fix: the last col/row headers were not collected Change-Id: I14b168dea9c1f1565dc973bf8ac07f3222b3eb9d Reviewed-on: https://gerrit.libreoffice.org/45793 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 7161edb75525..8676d1cad5c6 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2574,9 +2574,9 @@ void lcl_getGroupIndexes(const ScOutlineArray& rArray, SCCOLROW nStart, SCCOLROW { if (rArray.GetCount(nLevel)) { -// look for a group inside the [nStartRow+1, nEndRow-1] range +// look for a group inside the [nStartRow+1, nEndRow] range size_t nIndex; -bool bFound = rArray.GetEntryIndexInRange(nLevel, nStart + 1, nEnd - 1, nIndex); +bool bFound = rArray.GetEntryIndexInRange(nLevel, nStart + 1, nEnd, nIndex); if (bFound) { if (nIndex > 0) @@ -2596,8 +2596,8 @@ void lcl_getGroupIndexes(const ScOutlineArray& rArray, SCCOLROW nStart, SCCOLROW bFound = rArray.GetEntryIndex(nLevel, nStart + 1, nIndex); if (!bFound) { -// look for a group which contains nEndRow-1 -bFound = rArray.GetEntryIndex(nLevel, nEnd - 1, nIndex); +// look for a group which contains nEndRow +bFound = rArray.GetEntryIndex(nLevel, nEnd, nIndex); } } @@ -2613,7 +2613,7 @@ void lcl_getGroupIndexes(const ScOutlineArray& rArray, SCCOLROW nStart, SCCOLROW bFound = true; break; } -if (pEntry && pEntry->GetStart() > nEnd - 1) +if (pEntry && pEntry->GetStart() > nEnd) { break; } @@ -2649,16 +2649,17 @@ void lcl_createGroupsData( { rGroupStartPositions[nLevel] = nTotalTwips - nSizePx * TWIPS_PER_PIXEL; } -else if (nHeaderIndex > pEntry->GetStart() && (nHeaderIndex < nEnd - 1 && nHeaderIndex < pEntry->GetEnd())) +else if (nHeaderIndex > pEntry->GetStart() && (nHeaderIndex < nEnd && nHeaderIndex < pEntry->GetEnd())) { // for handling group started before the current view range if (rGroupStartPositions[nLevel] < 0) rGroupStartPositions[nLevel] *= -TWIPS_PER_PIXEL; break; } -if (nHeaderIndex == pEntry->GetEnd() || (nHeaderIndex == nEnd - 1 && rGroupStartPositions[nLevel] != -1)) +if (nHeaderIndex == pEntry->GetEnd() || (nHeaderIndex == nEnd && rGroupStartPositions[nLevel] != -1)) { -// nRow is the end row of a group or is the last row and a group started and not yet ended +// nHeaderIndex is the end col/row of a group or is the last col/row and a group started and not yet ended + // append a new group control data if (rGroupsBuffer.endsWith("}")) { @@ -2835,7 +2836,7 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle& rRectangle) aRowGroupsBuffer += "\"rowGroups\": [\n"; std::vector aRowGroupStartPositions(nRowGroupDepth, -nTotalPixels); long nPrevSizePx = -1; -for (SCROW nRow = nStartRow + 1; nRow < nEndRow; ++nRow) +for (SCROW nRow = nStartRow + 1; nRow <= nEndRow; ++nRow) { // nSize will be 0 for hidden rows. const long nSizePx = lcl_GetRowHeightPx(pDoc, nRow, nTab); @@ -2848,7 +2849,7 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle& rRectangle) *pRowArray, aRowGroupIndexes, aRowGroupStartPositions, aRowGroupsBuffer); } -if (nRow < nEndRow - 1 && nSizePx == nPrevSizePx) +if (nRow < nEndRow && nSizePx == nPrevSizePx) continue; nPrevSizePx = nSizePx; @@ -2974,7 +2975,7 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle& rRectangle) aColGroupsBuffer += "\"columnGroups\": [\n"; std::vector aColGroupStartPositions(nColGroupDepth, -nTotalPixels); nPrevSizePx = -1; -for (SCCOL nCol = nStartCol + 1; nCol < nEndCol; ++nCol) +for (SCCOL nCol = nStartCol + 1; nCol <= nEndCol; ++nCol) { // nSize will be 0 for hidden columns. const long nSizePx = lcl_GetColWidthPx(pDoc, nCol, nTab); @@ -2987,7 +2988,7 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle&
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
sc/source/ui/view/gridwin4.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 0b8dc9678c65451048613dba22d370bad3b5c2f7 Author: Marco CecchettiDate: Sat Dec 2 17:19:33 2017 +0100 lok: calc: fix: CTRL+RIGHT => crash Change-Id: I5c127aa4cbdca5e13d2329c1fb68f466464fe432 Reviewed-on: https://gerrit.libreoffice.org/45792 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 13b82122d6fd..4283785c4fb7 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1088,7 +1088,8 @@ namespace { { long nTmp = 0; // row/col to render for nPosition long nLastScrPos = 0, nScrPos = 0; -while (nScrPos <= nPosition && nTmp < MAXROW) +const long nMaxIndex = bRowNotCol ? MAXROW : MAXCOL; +while (nScrPos <= nPosition && nTmp < nMaxIndex) { long nSize = bRowNotCol ? pDoc->GetRowHeight( nTmp, nTabNo ) : pDoc->GetColWidth( nTmp, nTabNo ); ___ 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-5.3' - sc/source
sc/source/core/data/dpobject.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit fe96bca99cf378579a204813eb88bef143c24fe4 Author: Andras TimarDate: Wed Nov 29 13:04:32 2017 +0100 disambiguation (build fix on Windows) Change-Id: Icd42b11564b715754b125af6cbcd1d1a359eb5bd Reviewed-on: https://gerrit.libreoffice.org/45494 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 3374471d4f36..8e68900d3338 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -1317,7 +1317,7 @@ void ScDPObject::GetHeaderPositionData(const ScAddress& rPos, DataPilotTableHead DataPilotTablePositionData aPosData; pOutput->GetPositionData(rPos, aPosData); const sal_Int32 nPosType = aPosData.PositionType; -if (nPosType == COLUMN_HEADER || nPosType == ROW_HEADER) +if (nPosType == com::sun::star::sheet::DataPilotTablePositionType::COLUMN_HEADER || nPosType == com::sun::star::sheet::DataPilotTablePositionType::ROW_HEADER) aPosData.PositionData >>= rData; } ___ 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-5.3' - sc/source
sc/source/ui/view/tabview.cxx | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) New commits: commit f4c6426d28aea11743881906d8179c220fa73b9f Author: Marco CecchettiDate: Thu Nov 9 18:56:27 2017 +0100 lok: sc: subdivide headers data in range Change-Id: I984b5da5774f97172de7659ecab84675060f8301 Reviewed-on: https://gerrit.libreoffice.org/45415 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 96f10d6729de..4aef7be67b16 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2674,11 +2674,15 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle& rRectangle) aBuffer.append("\"size\": \"").append(OUString::number(nTotalPixels * TWIPS_PER_PIXEL)).append("\" }"); } +long nPrevSizePx = -1; for (SCROW nRow = nStartRow + 1; nRow < nEndRow; ++nRow) { // nSize will be 0 for hidden rows. const long nSizePx = lcl_GetRowHeightPx(pDoc, nRow, nTab); nTotalPixels += nSizePx; +if (nRow < nEndRow - 1 && nSizePx == nPrevSizePx) +continue; +nPrevSizePx = nSizePx; OUString aText = pRowBar[SC_SPLIT_BOTTOM]->GetEntryText(nRow); aBuffer.append(", "); @@ -2781,13 +2785,18 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle& rRectangle) aBuffer.append("\"size\": \"").append(OUString::number(nTotalPixels * TWIPS_PER_PIXEL)).append("\" }"); } +nPrevSizePx = -1; for (SCCOL nCol = nStartCol + 1; nCol < nEndCol; ++nCol) { // nSize will be 0 for hidden columns. const long nSizePx = lcl_GetColWidthPx(pDoc, nCol, nTab); nTotalPixels += nSizePx; +if (nCol < nEndCol - 1 && nSizePx == nPrevSizePx) +continue; +nPrevSizePx = nSizePx; + -OUString aText = pColBar[SC_SPLIT_LEFT]->GetEntryText(nCol); +OUString aText = OUString::number(nCol + 1); aBuffer.append(", "); aBuffer.append("{ \"text\": \"").append(aText).append("\", "); aBuffer.append("\"size\": \"").append(OUString::number(nTotalPixels * TWIPS_PER_PIXEL)).append("\" }"); ___ 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-5.3' - sc/source
sc/source/core/data/column.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit e2dcf7fbb5924838fb65a915639f6266e01174d8 Author: Eike RathkeDate: Thu Nov 2 12:53:14 2017 +0100 Resolves: tdf#111428 swap ScColumn::mnBlkCountFormula This is a combination of 2 commits. (cherry picked from commit 423df1fa929784c14e3a133c06468589fe9269cd) (cherry picked from commit 911e2aff3cc37cb7410292728ffea05fffbfb0b3) CellStoreEvent remembered the original ScColumn::mnBlkCountFormula, hence after inserting a column to the left the quick check of ScColumn::HasFormulaCell() whether there are any formula cells worked on the swapped in count (originally the one to the right) that happens to be empty in the scenario. Things worked correctly by accident if the next column to the right already contained a formula cell. c44fed96c49bea7365bf1200e06788860966795c Change-Id: If993856ceee657736f516a81c293506041a6b7eb Reviewed-on: https://gerrit.libreoffice.org/44210 Reviewed-by: Markus Mohrhard Tested-by: Eike Rathke Reviewed-on: https://gerrit.libreoffice.org/44493 (cherry picked from commit 7f1297d9b4f449eb9ada8008fb21b7046d1a8f19) diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index ac65f8a1b7ca..d868333c8b7a 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1891,6 +1891,9 @@ void ScColumn::SwapCol(ScColumn& rCol) maCellTextAttrs.swap(rCol.maCellTextAttrs); maCellNotes.swap(rCol.maCellNotes); +// Swap all CellStoreEvent mdds event_func related. +std::swap( mnBlkCountFormula, rCol.mnBlkCountFormula); + // notes update caption UpdateNoteCaptions(0, MAXROW); rCol.UpdateNoteCaptions(0, MAXROW); ___ 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-5.3' - sc/source
sc/source/filter/excel/xepivotxml.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit e7bdaa7113fd2b1ebd81ba392c664da8a4041bb5 Author: Tamás ZolnaiDate: Fri Oct 6 18:55:27 2017 +0200 tdf#112936: Pivot table: LO created XLSX file makes Excel to crash It's not actually clear, why Excel crashes, but setting the version makes it working. I expect that this version number (which specifies MSO Excel versions) makes MSO to handle the pivot table differently. As the internal implementation of the pivot table was changed in different versions. The name "DATA" might had a special meaning in the earlier versions (e.g. XP, MSO 2000) which leads this crash. So setting the version to MSO 2007 seems a good solution for this. Older versions not seems a target of LO exported XLSX files in these days. Also smaller values leads to the crash described in the bug report. Change-Id: I6e9edc949d1670d657e9277cfd86ff163458 Reviewed-on: https://gerrit.libreoffice.org/43208 Reviewed-by: Tamás Zolnai Tested-by: Tamás Zolnai (cherry picked from commit bab595df78bd05a45f92aa15dca058f27b86d5be) Reviewed-on: https://gerrit.libreoffice.org/43217 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx index b50182e157d8..c0932deb0377 100644 --- a/sc/source/filter/excel/xepivotxml.cxx +++ b/sc/source/filter/excel/xepivotxml.cxx @@ -222,6 +222,7 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( XclExpXmlStream& rStrm, const Entr FSNS(XML_xmlns, XML_r), "http://schemas.openxmlformats.org/officeDocument/2006/relationships;, FSNS(XML_r, XML_id), XclXmlUtils::ToOString(aRelId).getStr(), XML_recordCount, OString::number(rEntry.mpCache->GetDataSize()).getStr(), +XML_createdVersion, "3", // MS Excel 2007, tdf#112936: setting version number makes MSO to handle the pivot table differently FSEND); if (rEntry.meType == Worksheet) ___ 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-5.3' - sc/source
sc/source/core/data/dpcache.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 94109b88446b93ac2a092daf8a66986456e54725 Author: Tamás ZolnaiDate: Fri Oct 6 22:27:31 2017 +0200 tdf#112884: Error string is displayed as empty item in pivot table Need to get the right string representation of error cells. Based on the code it seems a regression from: d4cd8677889ec3807c194ef5b462f8e031807e5b Reviewed-on: https://gerrit.libreoffice.org/43146 Tested-by: Jenkins Reviewed-by: Tamás Zolnai (cherry picked from commit ee46269003aed237edcd9c086fd14ecded08bbeb) Change-Id: I30001e63cd17ae68ba4988d5825de479a4496326 Reviewed-on: https://gerrit.libreoffice.org/43215 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index 2db6ff88a8b8..c5e67657384c 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -134,7 +134,7 @@ void initFromCell( if (rCell.hasError()) { -rData.SetErrorString(rCache.InternString(aDocStr)); +rData.SetErrorString(rCache.InternString(pDoc->GetString(rPos.Col(), rPos.Row(), rPos.Tab(; } else if (rCell.hasNumeric()) { ___ 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-5.3' - sc/source
sc/source/core/data/dpoutput.cxx |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) New commits: commit ad936ab46da3a0b22aff4f5c5c00d78e323adafe Author: Tamás ZolnaiDate: Fri Sep 29 00:25:23 2017 +0200 tdf#112735: Pivot table: page field displays empty string ... instead of the "(empty)" string Change-Id: I2df84393b5213a57e941c9447e4367d7605a6b00 Reviewed-on: https://gerrit.libreoffice.org/42957 Tested-by: Jenkins Reviewed-by: Tamás Zolnai (cherry picked from commit 8a4df9376bf299beb49fe116882ffdbd10b5e02b) Reviewed-on: https://gerrit.libreoffice.org/43052 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 6f1faf87b5f2..4f46567f564a 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -1040,7 +1040,12 @@ void ScDPOutput::Output() const uno::Sequence& rRes = pPageFields[nField].aResult; sal_Int32 n = rRes.getLength(); if (n == 1) -aPageValue = rRes[0].Caption; +{ +if (rRes[0].Caption.isEmpty()) +aPageValue = ScGlobal::GetRscString(STR_EMPTYDATA); +else +aPageValue = rRes[0].Caption; +} else if (n > 1) aPageValue = ScResId(SCSTR_MULTIPLE).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-5.3' - sc/source
sc/source/ui/view/dbfunc3.cxx | 14 ++ 1 file changed, 14 insertions(+) New commits: commit bab7e8b836bbd0ab609f6f846c3fa880dcf9859c Author: Dimitri BouronDate: Thu Aug 3 11:57:48 2017 +0200 tdf#111305: Fix group name refresh in pivot table Change-Id: Ibc22bfba5765aba3014651df50afb23b893d2b5a Reviewed-on: https://gerrit.libreoffice.org/40712 Tested-by: Jenkins Reviewed-by: Eike Rathke (cherry picked from commit 3d37e10684edf9536beefe5670b144571e6c9792) diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index e8eccb1a62f2..304a1428d6bb 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -73,6 +73,8 @@ #include #include #include +#include +#include using namespace com::sun::star; using ::com::sun::star::uno::Any; @@ -1337,6 +1339,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString ) pDPObj->BuildAllDimensionMembers(); ScDPSaveData aData( *pDPObj->GetSaveData() ); bool bChange = false; +bool bNeedReloadGroups = false; sal_uInt16 nOrient = DataPilotFieldOrientation_HIDDEN; long nField = pDPObj->GetHeaderDim( rPos, nOrient ); @@ -1457,6 +1460,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString ) pSaveMember->SetName( rString ); bChange = true; +bNeedReloadGroups = true; } else nErrorId = STR_INVALIDNAME; @@ -1575,6 +1579,16 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString ) // apply changes ScDBDocFunc aFunc( *GetViewData().GetDocShell() ); pDPObj->SetSaveData( aData ); +if (bNeedReloadGroups) +{ +ScDPCollection* pDPs = pDoc->GetDPCollection(); +if (pDPs) +{ +std::set aRefs; +// tdf#111305: Reload groups in cache after modifications. +pDPs->ReloadGroupsInCache(pDPObj, aRefs); +} // pDPs +} // bNeedReloadGroups aFunc.UpdatePivotTable(*pDPObj, true, false); } 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-5.3' - sc/source
sc/source/filter/excel/xepivot.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit e0fa93ded694bd7df3c66b9c14fd75e21bdd4bb0 Author: Tamás ZolnaiDate: Mon Sep 11 17:02:55 2017 +0200 tdf#112328: Pivot table, XLS: Popup button for column fields is missing ...after round trip in Calc Wrong heading row was exported. Change-Id: I410eeeff7d7af408de1ea8128b6b21ac0cc76ea5 Reviewed-on: https://gerrit.libreoffice.org/42175 Tested-by: Jenkins Reviewed-by: Tamás Zolnai (cherry picked from commit bc9714fefb2dd2ad55a92aaacb6b246f354ed2c0) Reviewed-on: https://gerrit.libreoffice.org/42223 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index 34c5bc530e43..9876c78acc5f 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -1429,9 +1429,9 @@ void XclExpPivotTable::Finalize() maPTInfo.mnDataRows = rnXclRow2 - rnDataXclRow + 1; // first heading -maPTInfo.mnFirstHeadRow = rnXclRow1; +maPTInfo.mnFirstHeadRow = rnXclRow1 + 1; if (bExtraHeaderRow) -maPTInfo.mnFirstHeadRow += 2; +maPTInfo.mnFirstHeadRow += 1; } // records ___ 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-5.3' - sc/source
sc/source/ui/vba/vbarange.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 9d7a81991e350e5eb3216299eec13d23fab86fce Author: Dennis FrancisDate: Tue Aug 29 15:32:14 2017 +0530 tdf#111939: Fallback to getting view data from best view shell... ...when ScDocShell::GetViewData() returns nullptr. This is needed when a macro is run from the macro editor window instead of running the macro from Tools menu in the Calc window. Change-Id: I89c23c2ec08e8e9907f02eb1389236111530058b Reviewed-on: https://gerrit.libreoffice.org/41733 Tested-by: Jenkins Reviewed-by: Dennis Francis (cherry picked from commit c864fc9eab79d0b24036588cf8fc37ef51bd1907) Reviewed-on: https://gerrit.libreoffice.org/41757 Reviewed-by: Eike Rathke (cherry picked from commit 980fbcaf9de67013b1e72806de7746543040d48e) Signed-off-by: Andras Timar diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 744473c80c70..c3cee2c3549c 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -4249,6 +4249,12 @@ static void lcl_SelectAll( ScDocShell* pDocShell, ScQueryParam& aParam ) if ( pDocShell ) { ScViewData* pViewData = ScDocShell::GetViewData(); +if ( !pViewData ) +{ +ScTabViewShell* pViewSh = pDocShell->GetBestViewShell( true ); +pViewData = pViewSh ? >GetViewData() : nullptr; +} + if ( pViewData ) { OSL_TRACE("Pushing out SelectAll query"); ___ 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-5.3' - sc/source
sc/source/ui/vba/vbarange.cxx |8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) New commits: commit 60f7eee2cd7257ba5f99ec28911d3e9bb8b42168 Author: Tamas BunthDate: Fri Aug 11 01:57:55 2017 +0200 tdf#107858 oovbaapi: Autofilter always has header If AutoFilter created with vba macro, it should always use a header (because Excel does the same), regardless of the type of cells in the first row. Change-Id: I586e092ac62c893b9873cc4b988566d8f00636cc Reviewed-on: https://gerrit.libreoffice.org/40969 Tested-by: Jenkins Reviewed-by: Tamás Bunth Reviewed-on: https://gerrit.libreoffice.org/41041 Reviewed-by: Aron Budea Tested-by: Aron Budea diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index c5bade6e0dbb..98f8bc3d4696 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -4436,13 +4436,7 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const xDBRangeProps->setPropertyValue( "AutoFilter", uno::Any(true) ); // set header (autofilter always need column headers) uno::Reference< beans::XPropertySet > xFiltProps( xDataBaseRange->getFilterDescriptor(), uno::UNO_QUERY_THROW ); -bool bHasColHeader = false; -ScDocument* pDoc = pShell ? >GetDocument() : nullptr; -if (pDoc) -{ -bHasColHeader = pDoc->HasColHeader( static_cast< SCCOL >( autoFiltAddress.StartColumn ), static_cast< SCROW >( autoFiltAddress.StartRow ), static_cast< SCCOL >( autoFiltAddress.EndColumn ), static_cast< SCROW >( autoFiltAddress.EndRow ), static_cast< SCTAB >( autoFiltAddress.Sheet ) ); -} -xFiltProps->setPropertyValue( "ContainsHeader", uno::Any( bHasColHeader ) ); +xFiltProps->setPropertyValue( "ContainsHeader", uno::Any( true ) ); } sal_Int32 nField = 0; // *IS* 1 based ___ 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-5.3' - sc/source
sc/source/ui/app/inputhdl.cxx |4 sc/source/ui/docshell/docfunc.cxx | 33 + sc/source/ui/view/tabvwsh4.cxx| 13 - sc/source/ui/view/viewdata.cxx|6 +- sc/source/ui/view/viewfunc.cxx| 20 5 files changed, 46 insertions(+), 30 deletions(-) New commits: commit 7db521284cfd15585334eb73023be8afb5aa701d Author: Marco CecchettiDate: Thu Jul 13 17:22:19 2017 +0200 lok: sc: edit view gets misplaced by other view actions on row/column Change-Id: I3f9301c31f38783083fb521d056d8088fc2e508b Reviewed-on: https://gerrit.libreoffice.org/40017 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 5006d3787f7d..c2cb9d751ec4 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -2585,6 +2585,10 @@ static void lcl_SelectionToEnd( EditView* pView ) void ScInputHandler::EnterHandler( ScEnterMode nBlockMode ) { +if (!mbDocumentDisposing && comphelper::LibreOfficeKit::isActive() +&& pActiveViewSh != SfxViewShell::Current()) +return; + // Macro calls for validity can cause a lot of problems, so inhibit // nested calls of EnterHandler(). if (bInEnterHandler) return; diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 7f9d67f62104..311eb6db307d 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -2139,6 +2139,24 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, rDocShell.ErrorMessage(STR_INSERT_FULL);// Spalte/Zeile voll } +// The cursor position needs to be modified earlier than updating +// any enabled edit view which is triggered by SetDocumentModified below. +if (bSuccess) +{ +bool bInsertCols = ( eCmd == INS_INSCOLS_BEFORE || eCmd == INS_INSCOLS_AFTER); +bool bInsertRows = ( eCmd == INS_INSROWS_BEFORE || eCmd == INS_INSROWS_AFTER ); + +if (bInsertCols) +{ +pViewSh->OnLOKInsertDeleteColumn(rRange.aStart.Col(), 1); +} + +if (bInsertRows) +{ +pViewSh->OnLOKInsertDeleteRow(rRange.aStart.Row(), 1); +} +} + aModificator.SetDocumentModified(); SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) ); @@ -2665,6 +2683,21 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, } } +// The cursor position needs to be modified earlier than updating +// any enabled edit view which is triggered by SetDocumentModified below. +ScTabViewShell* pViewSh = rDocShell.GetBestViewShell(); +if (pViewSh) +{ +if (eCmd == DEL_DELCOLS) +{ +pViewSh->OnLOKInsertDeleteColumn(rRange.aStart.Col(), -1); +} +if (eCmd == DEL_DELROWS) +{ +pViewSh->OnLOKInsertDeleteRow(rRange.aStart.Row(), -1); +} +} + aModificator.SetDocumentModified(); SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) ); diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index e8f4491ae26e..058dbb2d953b 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1756,6 +1756,14 @@ ScTabViewShell::~ScTabViewShell() SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", "EMPTY"); SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_CELL_VIEW_CURSOR, "rectangle", "EMPTY"); +// all to NULL, in case the TabView-dtor tries to access them +//! (should not really! ??!?!) +if (pInputHandler) +pInputHandler->SetDocumentDisposing(true); +// We end edit mode, before destroying the input handler and the edit engine +// and before end listening (in order to call ScTabViewShell::KillEditView()) +pInputHandler->EnterHandler(); + ScDocShell* pDocSh = GetViewData().GetDocShell(); EndListening(*pDocSh); EndListening(*GetViewFrame()); @@ -1766,11 +1774,6 @@ ScTabViewShell::~ScTabViewShell() RemoveSubShell(); // all SetWindow(nullptr); -// all to NULL, in case the TabView-dtor tries to access them -//! (should not really! ??!?!) -if (pInputHandler) -pInputHandler->SetDocumentDisposing(true); - DELETEZ(pFontworkBarShell); DELETEZ(pExtrusionBarShell); DELETEZ(pCellShell); diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index d90886368522..a40413c3d1a5 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1253,10 +1253,6 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich, ScEditEngineDefaulter* pNewEngine, vcl::Window*
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
sc/source/ui/view/tabview3.cxx | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) New commits: commit 15de3808bbef05ca8f60441cdb1fab057753a23a Author: Marco CecchettiDate: Sun Jul 9 15:57:30 2017 +0200 lok: sc: missing invalidation on pasting text and deleting a cell In the desktop case we invalidate up to the right side of the visible area, however in the tiled rendering case we need to take care to invalidate also cached tiles. Change-Id: I7290ff35c155fab6bda3ce8b5d9c765624507052 Reviewed-on: https://gerrit.libreoffice.org/39729 Reviewed-by: Michael Meeks Tested-by: Michael Meeks diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 2695f013f6df..8a4ff64cdca8 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -2289,7 +2289,23 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO Point aStart = aViewData.GetScrPos( nCol1, nRow1, (ScSplitPos) i ); Point aEnd = aViewData.GetScrPos( nCol2+1, nRow2+1, (ScSplitPos) i ); if ( eMode == SC_UPDATE_ALL ) -aEnd.X() = bLayoutRTL ? 0 : (bIsTiledRendering ? aEnd.X() : pGridWin[i]->GetOutputSizePixel().Width()); +{ +if (bIsTiledRendering) +{ +// When a cell content is deleted we have no clue about +// the width of the embedded text. +// Anyway, clients will ask only for tiles that overlaps +// the visible area. +// Remember that wsd expects int and that aEnd.X() is +// in pixels and will be converted in twips, before performing +// the lok callback, so we need to avoid that an overflow occurs. +aEnd.X() = bLayoutRTL ? 0 : std::numeric_limits::max() / 1000; +} +else +{ +aEnd.X() = bLayoutRTL ? 0 : pGridWin[i]->GetOutputSizePixel().Width(); +} +} aEnd.X() -= nLayoutSign; aEnd.Y() -= 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-5.3' - sc/source
sc/source/ui/view/gridwin.cxx | 24 1 file changed, 12 insertions(+), 12 deletions(-) New commits: commit 6733094d72df98b03837a22d9a0d8f3f376b350f Author: Henry CastroDate: Sat Jul 1 11:31:24 2017 -0400 sc lok: disable items of the overlay manager They consume unnecessary CPU idle task in the tiled redenring case Change-Id: I477d17479ee83b31474675ef0d2317163d4fcee7 Reviewed-on: https://gerrit.libreoffice.org/39437 Tested-by: Jenkins Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/39439 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 039066db0387..630400b94c5b 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5844,6 +5844,8 @@ void ScGridWindow::UpdateCopySourceOverlay() DeleteCopySourceOverlay(); +if (comphelper::LibreOfficeKit::isActive()) +return; if (!pViewData->ShowPasteSource()) return; rtl::Reference xOverlayManager = getOverlayManager(); @@ -6104,9 +6106,6 @@ void ScGridWindow::UpdateCursorOverlay() xOverlayManager->add(*pOverlay); mpOOCursors.reset(new sdr::overlay::OverlayObjectList); mpOOCursors->append(*pOverlay); - -// notify the LibreOfficeKit too -updateLibreOfficeKitSelection(pViewData, aPixelRects); } } } @@ -6142,8 +6141,12 @@ void ScGridWindow::UpdateSelectionOverlay() { // #i70788# get the OverlayManager safely rtl::Reference xOverlayManager = getOverlayManager(); - -if (xOverlayManager.is()) +if (comphelper::LibreOfficeKit::isActive()) +{ +// notify the LibreOfficeKit too +updateLibreOfficeKitSelection(pViewData, aPixelRects); +} +else if (xOverlayManager.is()) { std::vector< basegfx::B2DRange > aRanges; const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation()); @@ -6180,9 +6183,6 @@ void ScGridWindow::UpdateSelectionOverlay() xOverlayManager->add(*pOverlay); mpOOSelection.reset(new sdr::overlay::OverlayObjectList); mpOOSelection->append(*pOverlay); - -// notify the LibreOfficeKit too -updateLibreOfficeKitSelection(pViewData, aPixelRects); } } else @@ -6255,7 +6255,7 @@ void ScGridWindow::UpdateAutoFillOverlay() // #i70788# get the OverlayManager safely rtl::Reference xOverlayManager = getOverlayManager(); -if (xOverlayManager.is()) +if (xOverlayManager.is() && !comphelper::LibreOfficeKit::isActive()) { Color aHandleColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor ); if (pViewData->GetActivePart() != eWhich) @@ -6383,7 +6383,7 @@ void ScGridWindow::UpdateDragRectOverlay() // #i70788# get the OverlayManager safely rtl::Reference xOverlayManager = getOverlayManager(); -if (xOverlayManager.is()) +if (xOverlayManager.is() && !comphelper::LibreOfficeKit::isActive()) { std::vector< basegfx::B2DRange > aRanges; const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation()); @@ -6431,7 +6431,7 @@ void ScGridWindow::UpdateHeaderOverlay() // #i70788# get the OverlayManager safely rtl::Reference xOverlayManager = getOverlayManager(); -if (xOverlayManager.is()) +if (xOverlayManager.is() && !comphelper::LibreOfficeKit::isActive()) { // Color aHighlight = GetSettings().GetStyleSettings().GetHighlightColor(); std::vector< basegfx::B2DRange > aRanges; @@ -6499,7 +6499,7 @@ void ScGridWindow::UpdateShrinkOverlay() // #i70788# get the OverlayManager safely rtl::Reference xOverlayManager = getOverlayManager(); -if (xOverlayManager.is()) +if (xOverlayManager.is() && !comphelper::LibreOfficeKit::isActive()) { std::vector< basegfx::B2DRange > aRanges; const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation()); ___ 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-5.3' - sc/source
sc/source/filter/excel/xepivotxml.cxx | 102 +- 1 file changed, 65 insertions(+), 37 deletions(-) New commits: commit 845a70d23a20e05a9fbc8d5c9bda04043a5a Author: Mike KaganskiDate: Thu Jun 22 18:10:14 2017 +0300 tdf#89139: pivotCache: output sharedItems children only for string fields ... to avoid "corrupted" warning from Excel. In case of string fields, Excel expects the item list to be present, and containsXXX attributes of sharedItems to be absent, otherwise it shows a warning about file corruption. For numeric fields, it doesn't expect item list, othervise it also warns about file corruption. Change-Id: I5ded5b836587bed3177eb0a6b6c418e459e6be8b Reviewed-on: https://gerrit.libreoffice.org/39114 Tested-by: Jenkins Reviewed-by: Mike Kaganski (cherry picked from commit 47f0e83989c4c03d9690229b6433a5541032a3eb) Reviewed-on: https://gerrit.libreoffice.org/39257 Tested-by: Mike Kaganski diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx index d03403aa230b..37b94168e193 100644 --- a/sc/source/filter/excel/xepivotxml.cxx +++ b/sc/source/filter/excel/xepivotxml.cxx @@ -233,52 +233,80 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( XclExpXmlStream& rStrm, const Entr ScDPCache::ScDPItemDataVec::const_iterator it = rFieldItems.begin(), itEnd = rFieldItems.end(); std::set aDPTypes; +double fMin = std::numeric_limits::infinity(), fMax = -std::numeric_limits::infinity(); for (; it != itEnd; ++it) { -aDPTypes.insert(it->GetType()); +ScDPItemData::Type eType = it->GetType(); +aDPTypes.insert(eType); +if (eType == ScDPItemData::Value) +{ +double fVal = it->GetValue(); +fMin = std::min(fMin, fVal); +fMax = std::max(fMax, fVal); +} } auto aDPTypeEnd = aDPTypes.cend(); -pDefStrm->startElement(XML_sharedItems, -XML_count, OString::number(static_cast(rFieldItems.size())).getStr(), -XML_containsMixedTypes, XclXmlUtils::ToPsz10(aDPTypes.size() > 1), -XML_containsSemiMixedTypes, XclXmlUtils::ToPsz10(aDPTypes.size() > 1), -XML_containsString, XclXmlUtils::ToPsz10(aDPTypes.find(ScDPItemData::String) != aDPTypeEnd), -XML_containsNumber, XclXmlUtils::ToPsz10(aDPTypes.find(ScDPItemData::Value) != aDPTypeEnd), -FSEND); +auto pAttList = sax_fastparser::FastSerializerHelper::createAttrList(); +// tdf#89139: Only create item list for string-only fields. +// Using containsXXX attributes in this case makes Excel think the file is corrupted. +// OTOH listing items for e.g. number fields also triggers "corrupted" warning in Excel. +bool bListItems = aDPTypes.size() == 1 && aDPTypes.find(ScDPItemData::String) != aDPTypeEnd; +if (bListItems) +{ +pAttList->add(XML_count, OString::number(static_cast(rFieldItems.size(; +} +else +{ +pAttList->add(XML_containsMixedTypes, XclXmlUtils::ToPsz10(aDPTypes.size() > 1)); +pAttList->add(XML_containsSemiMixedTypes, XclXmlUtils::ToPsz10(aDPTypes.size() > 1)); +pAttList->add(XML_containsString, XclXmlUtils::ToPsz10(aDPTypes.find(ScDPItemData::String) != aDPTypeEnd)); +if (aDPTypes.find(ScDPItemData::Value) != aDPTypeEnd) +{ +pAttList->add(XML_containsNumber, XclXmlUtils::ToPsz10(true)); +pAttList->add(XML_minValue, OString::number(fMin)); +pAttList->add(XML_maxValue, OString::number(fMax)); +} +} +sax_fastparser::XFastAttributeListRef xAttributeList(pAttList); -it = rFieldItems.begin(); -for (; it != itEnd; ++it) +pDefStrm->startElement(XML_sharedItems, xAttributeList); + +if (bListItems) { -const ScDPItemData& rItem = *it; -switch (rItem.GetType()) +it = rFieldItems.begin(); +for (; it != itEnd; ++it) { -case ScDPItemData::String: -pDefStrm->singleElement(XML_s, -XML_v, XclXmlUtils::ToOString(rItem.GetString()).getStr(), -FSEND); -break; -case ScDPItemData::Value: -pDefStrm->singleElement(XML_n, -XML_v, OString::number(rItem.GetValue()).getStr(), -FSEND); -break; -case ScDPItemData::Empty: -pDefStrm->singleElement(XML_m, FSEND); -break; -case ScDPItemData::Error: -
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
sc/source/filter/excel/xepivotxml.cxx | 102 -- 1 file changed, 97 insertions(+), 5 deletions(-) New commits: commit f2b846a1fefa0cd7a091204ed3f8aa00515b34fd Author: Mike KaganskiDate: Tue Jun 13 22:00:51 2017 +0300 tdf#89139: dump pivotField items This makes the pivot table exported to XLSX refreshable (does not crash Excel on pivot table refresh). Change-Id: Icc35795cd116e091b75bb1d4a603c52ccc71c44d Reviewed-on: https://gerrit.libreoffice.org/39018 Tested-by: Jenkins Reviewed-by: Kohei Yoshida (cherry picked from commit 430774c4edcdba3e6a4e383d9ac9345a517e227f) Reviewed-on: https://gerrit.libreoffice.org/39256 Reviewed-by: Mike Kaganski Tested-by: Mike Kaganski diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx index 1b340812cc3f..d03403aa230b 100644 --- a/sc/source/filter/excel/xepivotxml.cxx +++ b/sc/source/filter/excel/xepivotxml.cxx @@ -413,6 +413,47 @@ struct DataField DataField( long nPos, const ScDPSaveDimension* pDim ) : mnPos(nPos), mpDim(pDim) {} }; +/** Returns a OOXML subtotal function name string. See ECMA-376-1:2016 18.18.43 */ +OString GetSubtotalFuncName(sal_uInt16 eFunc) +{ +switch (eFunc) +{ +case sheet::GeneralFunction_SUM: return "sum"; +case sheet::GeneralFunction_COUNT: return "count"; +case sheet::GeneralFunction_AVERAGE: return "avg"; +case sheet::GeneralFunction_MAX: return "max"; +case sheet::GeneralFunction_MIN: return "min"; +case sheet::GeneralFunction_PRODUCT: return "product"; +case sheet::GeneralFunction_COUNTNUMS: return "countA"; +case sheet::GeneralFunction_STDEV: return "stdDev"; +case sheet::GeneralFunction_STDEVP:return "stdDevP"; +case sheet::GeneralFunction_VAR: return "var"; +case sheet::GeneralFunction_VARP: return "varP"; +default:; +} +return "default"; +} + +sal_Int32 GetSubtotalAttrToken(sal_uInt16 eFunc) +{ +switch (eFunc) +{ +case sheet::GeneralFunction_SUM: return XML_sumSubtotal; +case sheet::GeneralFunction_COUNT: return XML_countSubtotal; +case sheet::GeneralFunction_AVERAGE: return XML_avgSubtotal; +case sheet::GeneralFunction_MAX: return XML_maxSubtotal; +case sheet::GeneralFunction_MIN: return XML_minSubtotal; +case sheet::GeneralFunction_PRODUCT: return XML_productSubtotal; +case sheet::GeneralFunction_COUNTNUMS: return XML_countASubtotal; +case sheet::GeneralFunction_STDEV: return XML_stdDevSubtotal; +case sheet::GeneralFunction_STDEVP:return XML_stdDevPSubtotal; +case sheet::GeneralFunction_VAR: return XML_varSubtotal; +case sheet::GeneralFunction_VARP: return XML_varPSubtotal; +default:; +} +return XML_defaultSubtotal; +} + } void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDPObject& rDPObj, sal_Int32 nCacheId ) @@ -554,8 +595,9 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP XML_count, OString::number(static_cast(aCachedDims.size())).getStr(), FSEND); -for (const ScDPSaveDimension* pDim : aCachedDims) +for (size_t i = 0; i < nFieldCount; ++i) { +const ScDPSaveDimension* pDim = aCachedDims[i]; if (!pDim) { pPivotStrm->singleElement(XML_pivotField, @@ -585,13 +627,63 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP continue; } -pPivotStrm->startElement(XML_pivotField, -XML_axis, toOOXMLAxisType(eOrient), -XML_showAll, BS(false), +// Dump field items. +css::uno::Sequence aMemberNames; +{ +// We need to get the members in actual order, getting which requires non-const reference here +auto& dpo = const_cast (rDPObj); +dpo.GetMemberNames(i, aMemberNames); +} + +const ScDPCache::ScDPItemDataVec& rCacheFieldItems = rCache.GetDimMemberValues(i); +std::vector aMemberSequence; +for (const OUString& sMemberName : aMemberNames) +{ +auto it = std::find_if(rCacheFieldItems.begin(), rCacheFieldItems.end(), +[](const ScDPItemData& arg) -> bool { return arg.GetString() == sMemberName; }); +if (it != rCacheFieldItems.end()) +{ +aMemberSequence.push_back(it - rCacheFieldItems.begin()); +} +} + +auto pAttList = sax_fastparser::FastSerializerHelper::createAttrList(); +pAttList->add(XML_axis, toOOXMLAxisType(eOrient)); +
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
sc/source/ui/view/gridwin4.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 9f8a05069770d7293d7491a426fca9c4342aa63b Author: Tamás ZolnaiDate: Sat May 27 22:15:52 2017 +0200 tdf#107389: Wrong positioning of AutoFilter buttons in tiledrendering mode Must be a regression from this commit: 9113f17e65b1dafbc178fd269e2967c1e2632f0e Where the offset's and origin's meaning were changed, but not all code path was updated accordingly. Change-Id: Ib519303d5ca5ac7f13e74944e8147ea3220d7684 Reviewed-on: https://gerrit.libreoffice.org/38102 Tested-by: Jenkins Reviewed-by: Tamás Zolnai (cherry picked from commit ba5a9132375bcfedebd7c3d256161800da3b) Reviewed-on: https://gerrit.libreoffice.org/38107 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 7b948bcd9bb1..b4b2a910d4a1 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -763,7 +763,10 @@ void ScGridWindow::DrawContent(OutputDevice , const ScTableInfo& rTableI { // Tiled offset nScrX, nScrY MapMode aMap( MapUnit::MapPixel ); -aMap.SetOrigin(Point(nScrX, nScrY)); +Point aOrigin = aOriginalMode.GetOrigin(); +aOrigin.setX(aOrigin.getX() / TWIPS_PER_PIXEL + nScrX); +aOrigin.setY(aOrigin.getY() / TWIPS_PER_PIXEL + nScrY); +aMap.SetOrigin(aOrigin); pContentDev->SetMapMode(aMap); } 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-5.3' - sc/source
sc/source/ui/view/tabview3.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 60eede9988bcc37f3683a93bed8ffec23ef3bcc8 Author: Henry CastroDate: Mon May 22 09:15:50 2017 -0400 sc lok: prevent wrong assignment aEnd.Y() In tiled rendering case, the window size is small, and the assignment aEnd.Y() will cause wrong invalidation area. However, at this time will never happen because MAXTILEDROW < MAXROW, so better to avoid in case the last row meets the condition. Conflicts: sc/source/ui/view/tabview3.cxx Reviewed-on: https://gerrit.libreoffice.org/37908 Tested-by: Jenkins Reviewed-by: Henry Castro Conflicts: sc/source/ui/view/tabview3.cxx Change-Id: I9c6af57c0342f173195bb2f3d8ac5ef0f3964911 Reviewed-on: https://gerrit.libreoffice.org/37915 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 259b5fe2dd89..2695f013f6df 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -2294,7 +2294,7 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO aEnd.Y() -= 1; // #i85232# include area below cells (could be done in GetScrPos?) -if ( eMode == SC_UPDATE_ALL && nRow2 >= MAXROW ) +if ( eMode == SC_UPDATE_ALL && nRow2 >= MAXROW && !bIsTiledRendering ) aEnd.Y() = pGridWin[i]->GetOutputSizePixel().Height(); aStart.X() -= nLayoutSign; // include change marks ___ 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-5.3' - sc/source
sc/source/ui/view/tabview3.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 45349eb0d38e6166ec390258b3cdef9c37c5548a Author: Henry CastroDate: Wed May 17 16:19:47 2017 -0400 sc lok: fix wrong assignment aEnd.X() In tiled rendering case, the window size is small and the end point will be cut, then result wrong invalidation area Change-Id: Ief49c5f47bbc69485354ab396c7508db9548f82a Reviewed-on: https://gerrit.libreoffice.org/37737 Tested-by: Jenkins Reviewed-by: Jan Holesovsky Reviewed-on: https://gerrit.libreoffice.org/37753 Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 01c6774970c6..259b5fe2dd89 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -2216,6 +2216,7 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO SCROW nRow1; SCCOL nCol2; SCROW nRow2; +bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive(); PutInOrder( nStartCol, nEndCol ); PutInOrder( nStartRow, nEndRow ); @@ -2237,7 +2238,7 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO SCCOL nLastX = 0; SCROW nLastY = 0; -if (comphelper::LibreOfficeKit::isActive()) +if (bIsTiledRendering) { nLastX = aViewData.GetMaxTiledCol(); nLastY = aViewData.GetMaxTiledRow(); @@ -2288,7 +2289,7 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO Point aStart = aViewData.GetScrPos( nCol1, nRow1, (ScSplitPos) i ); Point aEnd = aViewData.GetScrPos( nCol2+1, nRow2+1, (ScSplitPos) i ); if ( eMode == SC_UPDATE_ALL ) -aEnd.X() = bLayoutRTL ? 0 : (pGridWin[i]->GetOutputSizePixel().Width()); +aEnd.X() = bLayoutRTL ? 0 : (bIsTiledRendering ? aEnd.X() : pGridWin[i]->GetOutputSizePixel().Width()); aEnd.X() -= nLayoutSign; aEnd.Y() -= 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-5.3' - sc/source
sc/source/ui/docshell/docsh4.cxx |2 ++ sc/source/ui/undo/undocell.cxx |2 +- 2 files changed, 3 insertions(+), 1 deletion(-) New commits: commit ed1123a9284b2230d26ed114c87df9f4d28eea07 Author: Jan HolesovskyDate: Wed May 17 15:08:25 2017 +0200 sc lok: Don't crash on comment undo. Change-Id: I3b8686e2d52359de2d99413e63d4a424ba1439d1 Reviewed-on: https://gerrit.libreoffice.org/37709 Reviewed-by: Aron Budea Tested-by: Aron Budea diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index ef4b9ef4a9c6..0bc4581359c7 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2254,8 +2254,10 @@ void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocu (nType == LOKCommentNotificationType::Remove ? "Remove" : (nType == LOKCommentNotificationType::Modify ? "Modify" : "???"; +assert(pNote); aAnnotation.put("id", pNote->GetId()); aAnnotation.put("tab", rPos.Tab()); + if (nType != LOKCommentNotificationType::Remove && pNote) { aAnnotation.put("author", pNote->GetAuthor()); diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index 44a56627b214..2cc72dd025ae 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -805,7 +805,7 @@ void ScUndoReplaceNote::DoRemoveNote( const ScNoteData& rNoteData ) caption object from the drawing layer while deleting pNote (removing the caption is done by a drawing undo action). */ pNote->ForgetCaption(); -ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Remove, , maPos, nullptr); +ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Remove, , maPos, pNote); delete pNote; } } ___ 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-5.3' - sc/source
sc/source/ui/view/tabview.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 942a5b532eca311914335e8fc104cc1d0a93c8ea Author: Marco CecchettiDate: Mon May 8 21:10:00 2017 +0200 lok: sc: selection overlay was not updated on document size changed Change-Id: I193f37d50ac3ff0ccbf7e39caab4bf25ed3c9a9c Reviewed-on: https://gerrit.libreoffice.org/37403 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index de98051ff3c5..96f10d6729de 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2652,6 +2652,7 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle& rRectangle) // Only invalidate if spreadsheet extended to the bottom if (aNewRowArea.getHeight()) { +UpdateSelectionOverlay(); SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), aNewRowArea.toString()); } } @@ -2759,6 +2760,7 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle& rRectangle) // Only invalidate if spreadsheet extended to the bottom if (aNewColArea.getWidth()) { +UpdateSelectionOverlay(); SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), aNewColArea.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-5.3' - sc/source
sc/source/ui/undo/undoblk.cxx | 44 - sc/source/ui/undo/undoblk2.cxx |3 ++ 2 files changed, 46 insertions(+), 1 deletion(-) New commits: commit c01df160eb45e1f5a386f9ad7cb3da72fc7f278f Author: Marco CecchettiDate: Wed May 3 22:57:09 2017 +0200 lok: sc: invalidate cached position on undo row/col operations Change-Id: I822ecdeda0e7c26c65096e5a249a35f7c2f3a9fe Reviewed-on: https://gerrit.libreoffice.org/37259 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index d79fd8335c0c..6af80db9eb15 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -159,6 +159,7 @@ void ScUndoInsertCells::DoChange( const bool bUndo ) // refresh of merged cells has to be after inserting/deleting +ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); switch (eCmd) { case INS_INSROWS_BEFORE: @@ -166,12 +167,19 @@ void ScUndoInsertCells::DoChange( const bool bUndo ) case INS_CELLSDOWN: for( i=0; i OnLOKInsertDeleteRow(aEffRange.aStart.Row(), nSign * (aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1)); +} } break; case INS_INSCOLS_BEFORE: @@ -185,6 +193,12 @@ void ScUndoInsertCells::DoChange( const bool bUndo ) else rDoc.InsertCol( aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i], aEffRange.aStart.Col(), static_cast(aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1)); + +if (pViewShell) +{ +const long nSign = bUndo ? -1 : 1; + pViewShell->OnLOKInsertDeleteColumn(aEffRange.aStart.Col(), nSign * (aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1)); +} } break; default: @@ -210,7 +224,7 @@ void ScUndoInsertCells::DoChange( const bool bUndo ) // Undo for displaced attributes? PaintPartFlags nPaint = PaintPartFlags::Grid; -ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); + switch (eCmd) { case INS_INSROWS_BEFORE: @@ -385,6 +399,8 @@ void ScUndoDeleteCells::DoChange( const bool bUndo ) else SetChangeTrack(); +ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); + switch (eCmd) { case DEL_DELROWS: @@ -397,6 +413,12 @@ void ScUndoDeleteCells::DoChange( const bool bUndo ) else rDoc.DeleteRow( aEffRange.aStart.Col(), pTabs[i], aEffRange.aEnd.Col(), pTabs[i]+pScenarios[i], aEffRange.aStart.Row(), static_cast(aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1)); + +if (pViewShell) +{ +const long nSign = bUndo ? 1 : -1; +pViewShell->OnLOKInsertDeleteRow(aEffRange.aStart.Row(), nSign * (aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1)); +} } break; case DEL_DELCOLS: @@ -409,6 +431,12 @@ void ScUndoDeleteCells::DoChange( const bool bUndo ) else rDoc.DeleteCol( aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i], aEffRange.aStart.Col(), static_cast(aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1)); + +if (pViewShell) +{ +const long nSign = bUndo ? 1 : -1; + pViewShell->OnLOKInsertDeleteColumn(aEffRange.aStart.Col(), nSign * (aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1)); +} } break; default: @@ -507,6 +535,20 @@ void ScUndoDeleteCells::DoChange( const bool bUndo ) pDocShell->PostDataChanged(); // CellContentChanged comes with the selection + +if (pViewShell) +{ +if (comphelper::LibreOfficeKit::isActive()) +{ +if (eCmd == DEL_DELCOLS || eCmd == DEL_CELLSLEFT) +ScTabViewShell::notifyAllViewsHeaderInvalidation("column", pViewShell->GetViewData().GetTabNo()); + +
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
sc/source/ui/inc/viewdata.hxx |7 + sc/source/ui/inc/viewfunc.hxx |5 sc/source/ui/view/viewdata.cxx | 50 +++ sc/source/ui/view/viewfunc.cxx | 274 - 4 files changed, 199 insertions(+), 137 deletions(-) New commits: commit 380737e363ea7608f1472305977ec5a16622a779 Author: Marco CecchettiDate: Wed May 3 22:37:02 2017 +0200 lok: sc: insert a row affects another view's selection on another tab Problem: - Open a spreadsheet with two views. - With view A select a cell on 2nd sheet (H10 for example). - With view B delete a row above H10. => View A's selection moves up. Similarly with insertion and with columns. The new solution takes care of the current tab each view is displaying. Change-Id: I47272ec7ef68471b530868dab57fa92091277324 Reviewed-on: https://gerrit.libreoffice.org/37258 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 2271321f400d..6fc2d748a670 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -333,6 +333,8 @@ public: SCROW GetPosY( ScVSplitPos eWhich ) const { return pThisTab->nPosY[eWhich]; } SCCOL GetCurX() const { return pThisTab->nCurX; } SCROW GetCurY() const { return pThisTab->nCurY; } +SCCOL GetCurXForTab( SCTAB nTabIndex ) const; +SCROW GetCurYForTab( SCTAB nTabIndex ) const; SCCOL GetOldCurX() const; SCROW GetOldCurY() const; SCCOL GetLOKOldCurX() const { return pThisTab->nLOKOldCurX; } @@ -343,6 +345,9 @@ public: ScPositionHelper& GetLOKWidthHelper() { return pThisTab->aWidthHelper; } ScPositionHelper& GetLOKHeightHelper() { return pThisTab->aHeightHelper; } +ScPositionHelper* GetLOKWidthHelper(SCTAB nTabIndex); +ScPositionHelper* GetLOKHeightHelper(SCTAB nTabIndex); + ScSplitMode GetHSplitMode() const { return pThisTab->eHSplitMode; } ScSplitMode GetVSplitMode() const { return pThisTab->eVSplitMode; } longGetHSplitPos() const{ return pThisTab->nHSplitPos; } @@ -360,6 +365,8 @@ public: voidSetPosY( ScVSplitPos eWhich, SCROW nNewPosY ); voidSetCurX( SCCOL nNewCurX ) { pThisTab->nCurX = nNewCurX; } voidSetCurY( SCROW nNewCurY ) { pThisTab->nCurY = nNewCurY; } +voidSetCurXForTab( SCCOL nNewCurX, SCTAB nTabIndex ); +voidSetCurYForTab( SCCOL nNewCurY, SCTAB nTabIndex ); voidSetOldCursor( SCCOL nNewX, SCROW nNewY ); voidResetOldCursor(); voidSetLOKOldCurX( SCCOL nCurX ){ pThisTab->nLOKOldCurX = nCurX; } diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index 30f402625405..489c606d9bc5 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -320,6 +320,11 @@ public: std::vector & aEdits, sal_uInt16 aColLength ); voidUpdateSelectionArea( const ScMarkData& rSel, ScPatternAttr* pAttr = nullptr ); + +voidOnLOKInsertDeleteColumn(SCCOL nStartCol, long nOffset); +voidOnLOKInsertDeleteRow(SCROW nStartRow, long nOffset); +voidOnLOKSetWidthOrHeight(SCCOLROW nStart, bool bWidth); + // Internal helper functions protected: static void UpdateLineAttrs( ::editeng::SvxBorderLine&rLine, diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 309528e3619d..d90886368522 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1122,6 +1122,38 @@ void ScViewData::ResetOldCursor() pThisTab->mbOldCursorValid = false; } +SCCOL ScViewData::GetCurXForTab( SCTAB nTabIndex ) const +{ +if (!ValidTab(nTabIndex) || !(nTabIndex < static_cast(maTabData.size( +return -1; + +return maTabData[nTabIndex]->nCurX; +} + +SCROW ScViewData::GetCurYForTab( SCTAB nTabIndex ) const +{ +if (!ValidTab(nTabIndex) || !(nTabIndex < static_cast(maTabData.size( +return -1; + +return maTabData[nTabIndex]->nCurY; +} + +void ScViewData::SetCurXForTab( SCCOL nNewCurX, SCTAB nTabIndex ) +{ +if (!ValidTab(nTabIndex) || !(nTabIndex < static_cast(maTabData.size( +return; + +maTabData[nTabIndex]->nCurX = nNewCurX; +} + +void ScViewData::SetCurYForTab( SCCOL nNewCurY, SCTAB nTabIndex ) +{ +if
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
sc/source/ui/view/gridwin.cxx | 27 +-- sc/source/ui/view/viewfunc.cxx |4 2 files changed, 25 insertions(+), 6 deletions(-) New commits: commit 8eb7d3ae11c21a3f5b10144f7b55d255b1b09d05 Author: Kohei YoshidaDate: Fri May 5 17:53:02 2017 -0400 tdf#86001: Pass on the language info from the cell to the engine. So that it can be used to set the correct language to use to check spelling (or disable it altogether). Reviewed-on: https://gerrit.libreoffice.org/37307 Tested-by: Jenkins Reviewed-by: Kohei Yoshida (cherry picked from commit eb35ead64b1371ea27420b57387ff1db0cbbbcf6) Conflicts: sc/source/ui/view/gridwin.cxx Change-Id: I4fddd9a7e08ab55476566db98476794b2fc1eb13 diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 6610d616a28b..039066db0387 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -53,6 +54,8 @@ #include #include +#include + #include #include #include @@ -5579,6 +5582,22 @@ bool ScGridWindow::ContinueOnlineSpelling() { ++nTextCellCount; +// NB: For spell-checking, we currently only use the primary +// language; not CJK nor CTL. +const ScPatternAttr* pPattern = pDoc->GetPattern(nCol, nRow, nTab); +LanguageType nCellLang = +static_cast(pPattern->GetItem(ATTR_FONT_LANGUAGE)).GetValue(); + +if (nCellLang == LANGUAGE_SYSTEM) +nCellLang = Application::GetSettings().GetLanguageTag().getLanguageType(); // never use SYSTEM for spelling + +if (nCellLang == LANGUAGE_NONE) +{ +// No need to spell check this cell. +pCell = aIter.GetNext(nCol, nRow); +continue; +} + if (!pEngine) { // ScTabEditEngine is needed @@ -5593,14 +5612,10 @@ bool ScGridWindow::ContinueOnlineSpelling() uno::Reference xXSpellChecker1(LinguMgr::GetSpellChecker()); pEngine->SetSpeller(xXSpellChecker1); + pEngine->SetDefaultLanguage(ScGlobal::GetEditDefaultLanguage()); } -const ScPatternAttr* pPattern = pDoc->GetPattern(nCol, nRow, nTab); -sal_uInt16 nCellLang = -static_cast(pPattern->GetItem(ATTR_FONT_LANGUAGE)).GetValue(); -if (nCellLang == LANGUAGE_SYSTEM) -nCellLang = Application::GetSettings().GetLanguageTag().getLanguageType(); // never use SYSTEM for spelling -pEngine->SetDefaultLanguage(nCellLang); +pEngine->SetDefaultItem(SvxLanguageItem(nCellLang, EE_CHAR_LANGUAGE)); if (eType == CELLTYPE_STRING) pEngine->SetText(pCell->mpString->getString()); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index f02ef2f6732d..e1f02513ec9b 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -906,6 +906,10 @@ void ScViewFunc::ApplyAttributes( const SfxItemSet* pDialogSet, } } +if (pDialogSet->HasItem(ATTR_FONT_LANGUAGE)) +// font language has changed. Redo the online spelling. +ResetAutoSpell(); + const SvxBoxItem* pOldOuter = static_cast (>Get( ATTR_BORDER )); const SvxBoxItem* pNewOuter = static_cast (>Get( ATTR_BORDER )); const SvxBoxInfoItem* pOldInner = static_cast (>Get( ATTR_BORDER_INNER )); ___ 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-5.3' - sc/source
sc/source/ui/view/gridwin4.cxx |6 -- 1 file changed, 6 deletions(-) New commits: commit 77b0d93c0f6ff6490e909dbd81b1994862a31b3a Author: Marco CecchettiDate: Wed May 3 18:15:11 2017 +0200 sc lok:fix up: scrolling issue: the document size is not updated in client Change-Id: Ied16f52b0a3a3be074390d60120493c75076c84d diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 5e9b2c07570a..7b948bcd9bb1 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1174,16 +1174,10 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, pDoc->GetTiledRenderingArea(nTab, nEndCol, nEndRow); if (nEndCol < nBottomRightTileCol) -{ nEndCol = nBottomRightTileCol; -pViewData->SetMaxTiledCol(nEndCol); -} if (nEndRow < nBottomRightTileRow) -{ nEndRow = nBottomRightTileRow; -pViewData->SetMaxTiledRow(nEndRow); -} nTopLeftTileCol = std::max(nTopLeftTileCol, 0); nTopLeftTileRow = std::max(nTopLeftTileRow, 0); ___ 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-5.3' - sc/source
sc/source/ui/view/tabvwsh4.cxx | 35 --- 1 file changed, 35 deletions(-) New commits: commit 7b5c7aa98901501b9f73354b3c77432287b6c8a4 Author: Jan HolesovskyDate: Wed May 3 15:36:37 2017 +0200 Revert "Calc Lok: prevent a new view from resetting tiled view dimensions" This reverts commit a70c34ccf5c446967bf9a258b8da2bd7addc9695. Change-Id: I3c6de1385e9e4f9de8c59d06fd6a02dd505c5b52 Reviewed-on: https://gerrit.libreoffice.org/37204 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 2f31b44dcfb1..e8f4491ae26e 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1684,32 +1684,6 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, pAccessibilityBroadcaster(nullptr), mbInSwitch(false) { -// FIXME this is just a workaround, the real fix is to move the -// CurMaxCol/Row to ScTable, so that we maintain them consistently -// for all the views: -// If another view had enlarged the dimensions, preserve it -// lest we reduce it to the original, and they get blank tiles -// (in the area outside the original dimensions). -long nMaxTiledRow = 0; -long nMaxTiledCol = 0; -SfxViewShell* pViewShell = SfxViewShell::GetFirst(); -while (pViewShell) -{ -ScTabViewShell* pTabViewShell = dynamic_cast (pViewShell); -if (pTabViewShell && getPart() == pTabViewShell->getPart()) -{ -ScViewData& rViewData = pTabViewShell->GetViewData(); -const long nCurMaxTiledRow = rViewData.GetMaxTiledRow(); -const long nCurMaxTiledCol = rViewData.GetMaxTiledCol(); -SAL_INFO("sc.lok.docsize", "sfxlokhelper::createview: maxTiledRow: " << - nCurMaxTiledRow << ", maxTiledCol: " << nCurMaxTiledCol); -nMaxTiledRow = std::max(nCurMaxTiledRow, nMaxTiledRow); -nMaxTiledCol = std::max(nCurMaxTiledCol, nMaxTiledCol); -} - -pViewShell = SfxViewShell::GetNext(*pViewShell); -} - const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions(); // if switching back from print preview, @@ -1770,15 +1744,6 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, //put things back as we found them if (bInstalledScTabViewObjAsTempController) GetViewData().GetDocShell()->GetModel()->setCurrentController(nullptr); - -// Set the maximum dimensions as explained above, but only if they have -// the default values. -SAL_INFO("sc.lok.docsize", "sfxlokhelper::createview: overwriting new view's maxTiledRow: " << - nMaxTiledRow << ", maxTiledCol: " << nMaxTiledCol); -if (GetViewData().GetMaxTiledRow() == 50 && nMaxTiledRow > 0) -GetViewData().SetMaxTiledRow(nMaxTiledRow); -if (GetViewData().GetMaxTiledCol() == 20 && nMaxTiledCol > 0) -GetViewData().SetMaxTiledCol(nMaxTiledCol); } ScTabViewShell::~ScTabViewShell() ___ 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-5.3' - sc/source
sc/source/ui/view/tabvwsh4.cxx | 35 +++ 1 file changed, 35 insertions(+) New commits: commit a70c34ccf5c446967bf9a258b8da2bd7addc9695 Author: Ashod NakashianDate: Tue May 2 08:21:29 2017 -0400 Calc Lok: prevent a new view from resetting tiled view dimensions When creating a new view the document tiled view dimensions are also reset to the original. When an existing view had grown said dimensions, this results in tiles that previously (before creating the new view) rendered fine to start rendering blank (transparent) as they are now outside of the doc bounds. This makes sure that the new view inherits the largest doc tiled view dimensions of all existing views. Change-Id: Ie10e85ad1eb9501ddd8a901188a2c822a0952a00 Reviewed-on: https://gerrit.libreoffice.org/37155 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index e8f4491ae26e..2f31b44dcfb1 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1684,6 +1684,32 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, pAccessibilityBroadcaster(nullptr), mbInSwitch(false) { +// FIXME this is just a workaround, the real fix is to move the +// CurMaxCol/Row to ScTable, so that we maintain them consistently +// for all the views: +// If another view had enlarged the dimensions, preserve it +// lest we reduce it to the original, and they get blank tiles +// (in the area outside the original dimensions). +long nMaxTiledRow = 0; +long nMaxTiledCol = 0; +SfxViewShell* pViewShell = SfxViewShell::GetFirst(); +while (pViewShell) +{ +ScTabViewShell* pTabViewShell = dynamic_cast (pViewShell); +if (pTabViewShell && getPart() == pTabViewShell->getPart()) +{ +ScViewData& rViewData = pTabViewShell->GetViewData(); +const long nCurMaxTiledRow = rViewData.GetMaxTiledRow(); +const long nCurMaxTiledCol = rViewData.GetMaxTiledCol(); +SAL_INFO("sc.lok.docsize", "sfxlokhelper::createview: maxTiledRow: " << + nCurMaxTiledRow << ", maxTiledCol: " << nCurMaxTiledCol); +nMaxTiledRow = std::max(nCurMaxTiledRow, nMaxTiledRow); +nMaxTiledCol = std::max(nCurMaxTiledCol, nMaxTiledCol); +} + +pViewShell = SfxViewShell::GetNext(*pViewShell); +} + const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions(); // if switching back from print preview, @@ -1744,6 +1770,15 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, //put things back as we found them if (bInstalledScTabViewObjAsTempController) GetViewData().GetDocShell()->GetModel()->setCurrentController(nullptr); + +// Set the maximum dimensions as explained above, but only if they have +// the default values. +SAL_INFO("sc.lok.docsize", "sfxlokhelper::createview: overwriting new view's maxTiledRow: " << + nMaxTiledRow << ", maxTiledCol: " << nMaxTiledCol); +if (GetViewData().GetMaxTiledRow() == 50 && nMaxTiledRow > 0) +GetViewData().SetMaxTiledRow(nMaxTiledRow); +if (GetViewData().GetMaxTiledCol() == 20 && nMaxTiledCol > 0) +GetViewData().SetMaxTiledCol(nMaxTiledCol); } ScTabViewShell::~ScTabViewShell() ___ 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-5.3' - sc/source
sc/source/ui/unoobj/docuno.cxx |4 1 file changed, 4 deletions(-) New commits: commit e95c84b9381ecd6836d94903aeed8769eda63033 Author: Pranav KantDate: Wed Apr 26 17:57:55 2017 +0530 sc lok: Do not change comment indicator setting This setting is saved to doc model when document is saved eventually. We should respect the user settings, and not play with it like this - changing this setting to false unconditionally. Originally, setting SetNotesMode to false was meant to prevent any kind of in-tile note rendering in case of LOK when it is turned off. But turns out this option is only for note indicator i.e the red button. We already have a LOK in-tile rendering guard in ScDocFunc::ShowNote that prevents popping drawinglayer note even if corresponding UNO command is sent by the LOK client. Change-Id: Id6c7b2cd30cdbefe7dacc2a701638b2488ab245d Reviewed-on: https://gerrit.libreoffice.org/36993 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 35fa76e8e669..da430dc4fc2f 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -1064,10 +1064,6 @@ void ScModelObj::initializeForTiledRendering(const css::uno::SequenceSetNotesMode(false); - // default tile size in pixels mnTilePixelWidth = 256; mnTilePixelHeight = 256; ___ 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-5.3' - sc/source
sc/source/core/tool/formularesult.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 26f1ab7e4d8407834cb1d5c1339ac29552ba220d Author: Kohei YoshidaDate: Fri Apr 21 21:42:32 2017 -0400 tdf#107310: hybrid cell is a value cell as well as a string cell. Else it would cause a legitimate calculation to fail with #VALUE!. Reviewed-on: https://gerrit.libreoffice.org/36817 Tested-by: Jenkins Reviewed-by: Kohei Yoshida (cherry picked from commit 7c80ea40fab3cb8e8893d14e80e7bb7f63f0dbb0) Reviewed-on: https://gerrit.libreoffice.org/36917 Reviewed-by: Eike Rathke Change-Id: If8d4f40859d0c87b97afc952e4a3e4268450c40c diff --git a/sc/source/core/tool/formularesult.cxx b/sc/source/core/tool/formularesult.cxx index 95b8ded0cca5..90becca556dc 100644 --- a/sc/source/core/tool/formularesult.cxx +++ b/sc/source/core/tool/formularesult.cxx @@ -294,6 +294,9 @@ inline bool isString( formula::StackVar sv ) bool ScFormulaResult::IsValue() const { +if (IsEmptyDisplayedAsString()) +return true; + return isValue(GetCellResultType()); } ___ 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-5.3' - sc/source
sc/source/core/data/column2.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 14b9d20090b9ecb75c13d1f5667b14df652cf027 Author: Pranav KantDate: Thu Apr 20 14:43:44 2017 +0530 sc lok: Notify when comment is added to destination doc This can happen, for example, when undoing a deleted comment. Change-Id: I4aff244f1263b650457a70334f5f4d2c75ad3b64 (cherry picked from commit 2373babc6888e840d44ed2db80567acccb9ba993) Reviewed-on: https://gerrit.libreoffice.org/36732 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index ba1af5e212a0..73ebc5ab6dce 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1783,6 +1783,8 @@ public: ScAddress aSrcPos(mnSrcCol, nRow, mnSrcTab); ScAddress aDestPos(mnDestCol, nDestRow, mnDestTab); miPos = mrDestNotes.set(miPos, nDestRow, p->Clone(aSrcPos, mrDestCol.GetDoc(), aDestPos, mbCloneCaption)); +// Notify our LOK clients also +ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, (), aDestPos, p); } }; ___ 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-5.3' - sc/source
sc/source/ui/view/viewdata.cxx | 133 +++-- 1 file changed, 76 insertions(+), 57 deletions(-) New commits: commit 3526b7c0db27cb8e333d30813b79982873aa4501 Author: Marco CecchettiDate: Sat Apr 15 11:37:51 2017 +0200 LOK - Calc: Selecting cells to the left/top does not work properly This patch fix a regression of commit 4b39183c5740067cc31c006214cb24b81ee0f98c "LOK - Calc: make computation of cell cursor position faster" The problem occurs when bAllowNeg is false. At present should be safe, in the LOK case, to assume that GetPosX(eWhichX) and GetPosY(eWhichX) are always 0. In the end we could always find the screen position for the left-top cell position and subtract it from the final screen position values. Change-Id: I7d4bf24cb57757e7ac05fcde48ade9feec56aba7 Reviewed-on: https://gerrit.libreoffice.org/36562 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index e1e24280e8b9..87a77ad4692d 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1879,90 +1879,109 @@ Point ScViewData::GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich, sal_uInt16 nTSize; bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive(); -SCCOL nPosX = GetPosX(eWhichX); -SCCOL nX; -long nScrPosX=0; -if (bIsTiledRendering) +SCCOL nPosX = GetPosX(eWhichX); +long nScrPosX = 0; + +if (bAllowNeg || nWhereX >= nPosX) { -const auto& rNearest = pThisTab->aWidthHelper.getNearestByIndex(nWhereX - 1); -nPosX = rNearest.first + 1; -nScrPosX = rNearest.second; -} +SCROW nStartPosX = nPosX; +if (bIsTiledRendering) +{ +OSL_ENSURE(nPosX == 0, "Unsupported case."); +const auto& rNearest = pThisTab->aWidthHelper.getNearestByIndex(nWhereX - 1); +nStartPosX = rNearest.first + 1; +nScrPosX = rNearest.second; +} -if (nWhereX >= nPosX) -for (nX = nPosX; nX < nWhereX && (bAllowNeg || bIsTiledRendering || nScrPosX <= aScrSize.Width()); nX++) +if (nWhereX >= nStartPosX) { -if ( nX > MAXCOL ) -nScrPosX = 0x7FFF; -else +for (SCCOL nX = nStartPosX; nX < nWhereX && (bAllowNeg || bIsTiledRendering || nScrPosX <= aScrSize.Width()); nX++) { -nTSize = pDoc->GetColWidth( nX, nTabNo ); -if (nTSize) +if ( nX > MAXCOL ) +nScrPosX = 0x7FFF; +else { -long nSizeXPix = ToPixel( nTSize, nPPTX ); -nScrPosX += nSizeXPix; +nTSize = pDoc->GetColWidth( nX, nTabNo ); +if (nTSize) +{ +long nSizeXPix = ToPixel( nTSize, nPPTX ); +nScrPosX += nSizeXPix; +} } } } -else if (bAllowNeg) -for (nX=nPosX; nX>nWhereX;) +else { ---nX; -nTSize = pDoc->GetColWidth( nX, nTabNo ); -if (nTSize) +for (SCCOL nX = nStartPosX; nX > nWhereX;) { -long nSizeXPix = ToPixel( nTSize, nPPTX ); -nScrPosX -= nSizeXPix; +--nX; +nTSize = pDoc->GetColWidth( nX, nTabNo ); +if (nTSize) +{ +long nSizeXPix = ToPixel( nTSize, nPPTX ); +nScrPosX -= nSizeXPix; +} } } -SCROW nPosY = GetPosY(eWhichY); -SCROW nY; +} + + +SCROW nPosY = GetPosY(eWhichY); +long nScrPosY = 0; -long nScrPosY=0; -if (bIsTiledRendering) +if (bAllowNeg || nWhereY >= nPosY) { -const auto& rNearest = pThisTab->aHeightHelper.getNearestByIndex(nWhereY - 1); -nPosY = rNearest.first + 1; -nScrPosY = rNearest.second; -} +SCROW nStartPosY = nPosY; +if (bIsTiledRendering) +{ +OSL_ENSURE(nPosY == 0, "Unsupported case."); +const auto& rNearest = pThisTab->aHeightHelper.getNearestByIndex(nWhereY - 1); +nStartPosY = rNearest.first + 1; +nScrPosY = rNearest.second; +} -if (nWhereY >= nPosY) -for (nY = nPosY; nY < nWhereY && (bAllowNeg || bIsTiledRendering || nScrPosY <= aScrSize.Height()); nY++) +if (nWhereY >= nStartPosY) { -if ( nY > MAXROW ) -nScrPosY = 0x7FFF; -else +for (SCROW nY = nStartPosY; nY < nWhereY && (bAllowNeg || bIsTiledRendering || nScrPosY <= aScrSize.Height()); nY++)
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
sc/source/ui/undo/undocell.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 0bffbac287aefd85aa1a2f31ea3fae925d3b35f3 Author: Pranav KantDate: Thu Apr 13 13:14:15 2017 +0530 sc lok: Add/Remove comment uno undo/redo Change-Id: I34a32ebecae44fd80789ed7daf13f31b181cd4c0 (cherry picked from commit 291ec5e9708352a1d98c54814dad8db7ce38fdb9) Reviewed-on: https://gerrit.libreoffice.org/36507 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index f9d082f0f902..0656483b60bd 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -778,6 +778,7 @@ void ScUndoReplaceNote::DoInsertNote( const ScNoteData& rNoteData ) OSL_ENSURE( !rDoc.GetNote(maPos), "ScUndoReplaceNote::DoInsertNote - unexpected cell note" ); ScPostIt* pNote = new ScPostIt( rDoc, maPos, rNoteData, false ); rDoc.SetNote( maPos, pNote ); +ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, , maPos, pNote); } } @@ -793,6 +794,7 @@ void ScUndoReplaceNote::DoRemoveNote( const ScNoteData& rNoteData ) caption object from the drawing layer while deleting pNote (removing the caption is done by a drawing undo action). */ pNote->ForgetCaption(); +ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Remove, , maPos, nullptr); delete pNote; } } ___ 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-5.3' - sc/source
sc/source/ui/inc/viewdata.hxx |4 ++-- sc/source/ui/view/viewdata.cxx |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit fdd74fb577c7c09d1c60f61fce572353966d6c6e Author: Marco CecchettiDate: Thu Apr 6 19:15:02 2017 +0200 LOK - Calc - fix for MSVS 2013 Change-Id: Ieda51d7a4b91d9c107aa5550e27ba11c613ae5a9 diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 06d829613c0d..2271321f400d 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -123,7 +123,7 @@ public: static_assert(std::numeric_limits::is_signed, "ScPositionCache: index type is not signed"); private: -static const index_type null = std::numeric_limits::min(); +static const index_type null; class Comp { @@ -268,7 +268,7 @@ private: boolbGrowing; longm_nLOKPageUpDownOffset; - + DECL_DLLPRIVATE_LINK( EditEngineHdl, EditStatus&, void ); diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index fb71e4c47c01..e1e24280e8b9 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -91,7 +91,7 @@ void lcl_LOKRemoveWindow(ScTabViewShell* pTabViewShell, ScSplitPos eWhich) } // anonymous namespace -const ScPositionHelper::index_type ScPositionHelper::null; // definition +const ScPositionHelper::index_type ScPositionHelper::null = std::numeric_limits::min(); // definition bool ScPositionHelper::Comp::operator() (const value_type& rValue1, const value_type& rValue2) const { ___ 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-5.3' - sc/source svx/source
sc/source/ui/view/gridwin4.cxx | 11 +-- svx/source/sdr/contact/objectcontactofpageview.cxx | 33 +++-- 2 files changed, 14 insertions(+), 30 deletions(-) New commits: commit 92716ab11b8eaf3e2d490f7005f174f90c5b2420 Author: Marco CecchettiDate: Mon Mar 13 11:42:31 2017 +0100 LOK: Calc - images are not painted below row 1000 The problem was not due to some missing tile invalidation: it was at the painting stage. There was no overlap btw the view range and the object range. Now images and shape are painted correctly. There is still problems with control forms and charts. Change-Id: Ib74e3bb79b444df21844086ae666fc206aa48906 Reviewed-on: https://gerrit.libreoffice.org/35244 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 43a7e565d77e..ec4da857d4c0 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -818,15 +818,9 @@ void ScGridWindow::DrawContent(OutputDevice , const ScTableInfo& rTableI const MapMode aOrig = pContentDev->GetMapMode(); if (bIsTiledRendering) { -MapMode aNew = aOrig; Point aOrigin = aOriginalMode.GetOrigin(); -aOrigin.setX(aOrigin.getX() / TWIPS_PER_PIXEL + nScrX); -aOrigin.setY(aOrigin.getY() / TWIPS_PER_PIXEL + nScrY); -static const double twipFactor = 15 * 1.7639; // 26.4585 -aOrigin = Point(aOrigin.getX() - aOrigin.getX() / twipFactor, -aOrigin.getY() - aOrigin.getY() / twipFactor); -aNew.SetOrigin(aOrigin); -pContentDev->SetMapMode(aNew); +Size aPixelOffset(aOrigin.getX() / TWIPS_PER_PIXEL, aOrigin.getY() / TWIPS_PER_PIXEL); +pContentDev->SetPixelOffset(aPixelOffset); comphelper::LibreOfficeKit::setLocalRendering(); } @@ -836,6 +830,7 @@ void ScGridWindow::DrawContent(OutputDevice , const ScTableInfo& rTableI if (bIsTiledRendering) { +pContentDev->SetPixelOffset(Size()); pContentDev->SetMapMode(aOrig); } diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx index efeaad6d6cac..b108ff5479ad 100644 --- a/svx/source/sdr/contact/objectcontactofpageview.cxx +++ b/svx/source/sdr/contact/objectcontactofpageview.cxx @@ -205,7 +205,6 @@ namespace sdr { // use visible pixels, but transform to world coordinates aViewRange = basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight()); - // if a clip region is set, use it if(!rDisplayInfo.GetRedrawArea().IsEmpty()) { @@ -230,16 +229,22 @@ namespace sdr aViewRange.intersect(aDiscreteClipRange); } +const MapMode aOrigMapMode = rTargetOutDev.GetMapMode(); +if (comphelper::LibreOfficeKit::isActive() && +comphelper::LibreOfficeKit::isLocalRendering()) +{ +MapMode aMapMode = aOrigMapMode; +aMapMode.SetOrigin(Point()); +rTargetOutDev.SetMapMode(aMapMode); +} + // transform to world coordinates aViewRange.transform(rTargetOutDev.GetInverseViewTransformation()); + if (comphelper::LibreOfficeKit::isActive() && comphelper::LibreOfficeKit::isLocalRendering()) { -const int TWIPS_PER_PIXEL = 15; -aViewRange = basegfx::B2DRange(aViewRange.getMinimum().getX(), - aViewRange.getMinimum().getY(), - aViewRange.getMaximum().getX() * TWIPS_PER_PIXEL, - aViewRange.getMaximum().getY() * TWIPS_PER_PIXEL); +rTargetOutDev.SetMapMode(aOrigMapMode); } } @@ -315,26 +320,10 @@ namespace sdr drawinglayer::processor2d::createProcessor2DFromOutputDevice( rTargetOutDev, getViewInformation2D())); -if (comphelper::LibreOfficeKit::isActive() && -comphelper::LibreOfficeKit::isLocalRendering()) -{ -// Restore the origin. -MapMode aMapMode = pOutDev->GetMapMode(); -aMapMode.SetOrigin(aOrigMapMode.GetOrigin()); -pOutDev->SetMapMode(aMapMode); -} - if(pProcessor2D) { pProcessor2D->process(xPrimitiveSequence); } - -if
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
sc/source/ui/unoobj/docuno.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit 917aac7aa689dc7279ee492e7102d33a9030d929 Author: Marco CecchettiDate: Wed Mar 1 18:55:11 2017 +0100 LOK: Calc: autocomplete makes view to jump to a different place We disable auto-complete feature as a workaround. Change-Id: I25fa7591231836e0673e97fdf2c3ca72ab20e1e4 Reviewed-on: https://gerrit.libreoffice.org/34835 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index ba14902..4f3b627 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -1030,11 +1030,15 @@ OUString ScModelObj::getPostIts() return OUString::fromUtf8(aStream.str().c_str()); } - void ScModelObj::initializeForTiledRendering(const css::uno::Sequence& /*rArguments*/) { SolarMutexGuard aGuard; +// disable word autocompletion +ScAppOptions aAppOptions( SC_MOD()->GetAppOptions() ); +aAppOptions.SetAutoComplete(false); +SC_MOD()->SetAppOptions(aAppOptions); + // show us the text exactly ScInputOptions aInputOptions(SC_MOD()->GetInputOptions()); aInputOptions.SetTextWysiwyg(true); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits