[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sc/source
sc/source/ui/src/globstr.src |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 9a6aa402dcfd38194f0d9c661692ffefc0ba7357 Author: Andras TimarDate: Thu Apr 6 16:14:55 2017 +0200 changed wording of cell merge warning Change-Id: I3b57f63eded0c925589f6baabcd09a72971943ae diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src index cefa78904381..0db8c35a8c07 100644 --- a/sc/source/ui/src/globstr.src +++ b/sc/source/ui/src/globstr.src @@ -923,7 +923,7 @@ Resource RID_GLOBSTR }; String STR_MERGE_NOTEMPTY { -Text [ en-US ] = "After the merge only the upper-left cell will remain visible. Should the contents of the hidden cells be moved there?" ; +Text [ en-US ] = "Should the contents of the cells be moved into the first cell?" ; }; String STR_CELL_FILTER { ___ 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.1' - sc/source
sc/source/ui/src/globstr.src |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 4ea53461a8b573d5254c25eab2ffdd5c88032c6b Author: Andras TimarDate: Fri Mar 24 15:22:13 2017 +0100 changed wording of cell merge warning Change-Id: Ib2773d1aca6ff0ca8bfad2263b59daf1450fff6a diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src index 8ebb2c6fd710..cefa78904381 100644 --- a/sc/source/ui/src/globstr.src +++ b/sc/source/ui/src/globstr.src @@ -923,7 +923,7 @@ Resource RID_GLOBSTR }; String STR_MERGE_NOTEMPTY { -Text [ en-US ] = "Should the contents of the hidden cells be moved into the first cell?" ; +Text [ en-US ] = "After the merge only the upper-left cell will remain visible. Should the contents of the hidden cells be moved there?" ; }; String STR_CELL_FILTER { ___ 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.1' - sc/source
sc/source/ui/drawfunc/fuins1.cxx | 27 --- sc/source/ui/view/tabvwsh4.cxx | 25 + 2 files changed, 1 insertion(+), 51 deletions(-) New commits: commit 57402a5c2d2ba1635c43ef2a97d71e17652b707d Author: Marco CecchettiDate: Sun Jan 1 20:32:51 2017 +0100 Revert "Invalidate the entire sheet after having inserted the image." This reverts commit fe87a31885dc870a9a8e4c4dcb105a4a5627164f Change-Id: I8fb9b67696913c1de0778d22b242673c89b07813 Reviewed-on: https://gerrit.libreoffice.org/32689 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index 9dc65bf..c7fd4c9 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -42,10 +41,6 @@ #include "sc.hrc" #include "globstr.hrc" -#include -#include -#include - using namespace ::com::sun::star; void ScLimitSizeOnDrawPage( Size& rSize, Point& rPos, const Size& rPage ) @@ -256,28 +251,6 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh, if ( nError == GRFILTER_OK ) { lcl_InsertGraphic( aGraphic, aFileName, aFilterName, bAsLink, true, pViewSh, pWindow, pView ); - -// FIXME HACK: The ViewObjectContact sdr thing is not set up well -// enough for the invalidate to work here automagically, because -// we set it up for each tile, and it does not survive for too -// long. Luckily for inserting an image, we can live with a full -// invalidate, so let's just do it for now. -if (comphelper::LibreOfficeKit::isActive()) -{ -std::stringstream ss; -ss << "EMPTY"; -if (comphelper::LibreOfficeKit::isPartInInvalidation()) -ss << ", " << pViewSh->getPart(); -OString aPayload = ss.str().c_str(); - -SfxViewShell* pCurView = SfxViewShell::GetFirst(); -while (pCurView) -{ - pCurView->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, aPayload.getStr()); - -pCurView = SfxViewShell::GetNext(*pCurView); -} -} } } else diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index aa6f763..4ef54ad 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -572,30 +572,7 @@ void ScTabViewShell::UpdateDrawShell() SdrView* pDrView = GetSdrView(); if ( pDrView && !pDrView->AreObjectsMarked() && !IsDrawSelMode() ) -{ -SetDrawShell(false); - -// FIXME HACK: The ViewObjectContact sdr thing is not set up well -// enough for the invalidate to work here automagically, because -// we set it up for each tile, and it does not survive for too -// long. -if (comphelper::LibreOfficeKit::isActive()) -{ -std::stringstream ss; -ss << "EMPTY"; -if (comphelper::LibreOfficeKit::isPartInInvalidation()) -ss << ", " << getPart(); -OString aPayload = ss.str().c_str(); - -SfxViewShell* pCurView = SfxViewShell::GetFirst(); -while (pCurView) -{ - pCurView->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, aPayload.getStr()); - -pCurView = SfxViewShell::GetNext(*pCurView); -} -} -} +SetDrawShell( false ); } void ScTabViewShell::SetDrawShellOrSub() ___ 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.1' - sc/source
sc/source/ui/unoobj/docuno.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit f75cb76de358de4392446d7d292492dc34d5b202 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/34761 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 1c13004..cc0ac9b 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -970,11 +970,15 @@ void ScModelObj::setClientVisibleArea(const Rectangle& rRectangle) pViewData->ForcePageUpDownOffset(rRectangle.GetHeight()); } - 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
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sc/source
sc/source/core/data/table1.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 5bc6a514f5cf1b8b08aa5795781dd2c6567b1383 Author: Kohei YoshidaDate: Sat Feb 11 13:38:58 2017 -0500 tdf#86470: Let's not forget to move onto the next column. Change-Id: I451f521723458b5d6fe9d9fa8b41855fe17def64 Reviewed-on: https://gerrit.libreoffice.org/34159 Tested-by: Jenkins Reviewed-by: Kohei Yoshida (cherry picked from commit bcdde13996e3e33f9d4c41be25d062560c72636b) diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 8991299..2d99711 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1418,9 +1418,9 @@ bool ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMa ++it; if (it == rCells.end()) { -// No more block. +// No more block. Move on to the next column. rRow = MAXROW + 1; -return false; +continue; } } ___ 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.1' - sc/source
sc/source/ui/view/viewfunc.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit a25e047a562516e72ccd93ac2600aef308de32e0 Author: Kohei YoshidaDate: Fri Feb 10 22:48:41 2017 -0500 tdf#95306: Be sure to specify the entire range. Especially in presence of multiple disjointed selections. Change-Id: I8e7779824109c30e69fd43a2448ae900beaf28d3 Reviewed-on: https://gerrit.libreoffice.org/34140 Tested-by: Jenkins Reviewed-by: Kohei Yoshida (cherry picked from commit 6d450aad0a8f82ee0320ffc3e76eefb43c16addb) diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index c370320..9ae6dcb 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1869,8 +1869,8 @@ void ScViewFunc::SetWidthOrHeight( return; } -SCCOLROW nStart = rRanges[0].mnStart; -SCCOLROW nEnd = rRanges[0].mnEnd; +SCCOLROW nStart = rRanges.front().mnStart; +SCCOLROW nEnd = rRanges.back().mnEnd; bool bFormula = false; if ( eMode == SC_SIZE_OPTIMAL ) ___ 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.1' - sc/source
sc/source/core/tool/token.cxx | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) New commits: commit 3b6eaa2db7d7014b94d13a5f8e1ab34b9e263fa0 Author: Kohei YoshidaDate: Wed Feb 8 21:43:01 2017 -0500 tdf#103890: Fix the logic on setting 3D flag on reference. This is a backport commit that combines 3 original commits from the master branch. (cherry picked from commit bf8d4fb60da5e583b3a90639af45b901e19cb5aa) (cherry picked from commit 6e1efe7b6bd16e3183cdb7c87d786cb714a61959) (cherry picked from commit aeb465a458fc7ba02e3b1ca6b4193488defef511) Change-Id: I401d379be058cc45a5715a4a8a8f72aa56208655 diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 3a5f1a6..2e2d81c 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -3068,8 +3068,6 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove( assert(!"can't move"); } -bool b3DFlag = rOldPos.Tab() != rNewPos.Tab() || rCxt.mnTabDelta; - TokenPointers aPtrs( pCode, nLen, pRPN, nRPN); for (size_t j=0; j<2; ++j) { @@ -3096,8 +3094,7 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove( } rRef.SetAddress(aAbs, rNewPos); -if (b3DFlag) -rRef.SetFlag3D(b3DFlag); +rRef.SetFlag3D(aAbs.Tab() != rNewPos.Tab() || !rRef.IsTabRel()); } break; case svDoubleRef: @@ -3113,8 +3110,12 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove( } rRef.SetRange(aAbs, rNewPos); -if (b3DFlag) -rRef.Ref1.SetFlag3D(true); +// Absolute sheet reference => set 3D flag. +// More than one sheet referenced => has to have both 3D flags. +// If end part has 3D flag => start part must have it too. +rRef.Ref2.SetFlag3D(aAbs.aStart.Tab() != aAbs.aEnd.Tab() || !rRef.Ref2.IsTabRel()); +rRef.Ref1.SetFlag3D(aAbs.aStart.Tab() != rNewPos.Tab() || !rRef.Ref1.IsTabRel() || +rRef.Ref2.IsFlag3D()); } break; case svExternalSingleRef: ___ 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.1' - sc/source
sc/source/core/data/table3.cxx | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-) New commits: commit 42423c4130d7d607fe175a9c170bc000f5208c3c Author: Kohei YoshidaDate: Mon Jan 30 22:01:45 2017 -0500 tdf#105629: Let's move the advanced-filter specific stuff ... to the place where we actually parse the filtering rules for advanced filter queries. Change-Id: I87650227e15fa54303efd720530d31ecf9827226 Reviewed-on: https://gerrit.libreoffice.org/33816 Tested-by: Jenkins Reviewed-by: Kohei Yoshida (cherry picked from commit 42e472b5870278058537d43d03d457dc80b16166) diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 5a9d7f3..c3775fb 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -2829,26 +2829,15 @@ public: void operator() (ScQueryEntry::Item& rItem) { -if (rItem.meType != ScQueryEntry::ByString && rItem.meType != ScQueryEntry::ByDate) +// Double-check if the query by date is really appropriate. + +if (rItem.meType != ScQueryEntry::ByDate) return; sal_uInt32 nIndex = 0; bool bNumber = mrDoc.GetFormatTable()-> IsNumberFormat(rItem.maString.getString(), nIndex, rItem.mfVal); -// Advanced Filter creates only ByString queries that need to be -// converted to ByValue if appropriate. rItem.mfVal now holds the value -// if bNumber==true. - -if (rItem.meType == ScQueryEntry::ByString) -{ -if (bNumber) -rItem.meType = ScQueryEntry::ByValue; -return; -} - -// Double-check if the query by date is really appropriate. - if (bNumber && ((nIndex % SV_COUNTRY_LANGUAGE_OFFSET) != 0)) { const SvNumberformat* pEntry = mrDoc.GetFormatTable()->GetEntry(nIndex); @@ -3215,12 +3204,22 @@ bool ScTable::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow if (!bValid) bValid = CreateExcelQuery(nCol1, nRow1, nCol2, nRow2, rQueryParam); +SvNumberFormatter* pFormatter = pDocument->GetFormatTable(); nCount = rQueryParam.GetEntryCount(); + if (bValid) { // bQueryByString must be set for (i=0; i < nCount; i++) -rQueryParam.GetEntry(i).GetQueryItem().meType = ScQueryEntry::ByString; +{ +ScQueryEntry::Item& rItem = rQueryParam.GetEntry(i).GetQueryItem(); + +sal_uInt32 nIndex = 0; +bool bNumber = pFormatter->IsNumberFormat( +rItem.maString.getString(), nIndex, rItem.mfVal); + +rItem.meType = bNumber ? ScQueryEntry::ByValue : ScQueryEntry::ByString; +} } 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.1' - sc/source
sc/source/ui/drawfunc/fuins1.cxx | 27 +++ sc/source/ui/view/tabvwsh4.cxx | 25 - 2 files changed, 51 insertions(+), 1 deletion(-) New commits: commit fe87a31885dc870a9a8e4c4dcb105a4a5627164f Author: Jan HolesovskyDate: Mon Dec 5 22:45:43 2016 +0100 Invalidate the entire sheet after having inserted the image. This is a hack; but the ViewObjectContacts are unreliable with tiled rendering, and we are missing invalidates due to that. Change-Id: Ia2475d4a042be1db0ea6f170cf66f271397ee299 Reviewed-on: https://gerrit.libreoffice.org/31659 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index c7fd4c9..9dc65bf 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -41,6 +42,10 @@ #include "sc.hrc" #include "globstr.hrc" +#include +#include +#include + using namespace ::com::sun::star; void ScLimitSizeOnDrawPage( Size& rSize, Point& rPos, const Size& rPage ) @@ -251,6 +256,28 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh, if ( nError == GRFILTER_OK ) { lcl_InsertGraphic( aGraphic, aFileName, aFilterName, bAsLink, true, pViewSh, pWindow, pView ); + +// FIXME HACK: The ViewObjectContact sdr thing is not set up well +// enough for the invalidate to work here automagically, because +// we set it up for each tile, and it does not survive for too +// long. Luckily for inserting an image, we can live with a full +// invalidate, so let's just do it for now. +if (comphelper::LibreOfficeKit::isActive()) +{ +std::stringstream ss; +ss << "EMPTY"; +if (comphelper::LibreOfficeKit::isPartInInvalidation()) +ss << ", " << pViewSh->getPart(); +OString aPayload = ss.str().c_str(); + +SfxViewShell* pCurView = SfxViewShell::GetFirst(); +while (pCurView) +{ + pCurView->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, aPayload.getStr()); + +pCurView = SfxViewShell::GetNext(*pCurView); +} +} } } else diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 4ef54ad..aa6f763 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -572,7 +572,30 @@ void ScTabViewShell::UpdateDrawShell() SdrView* pDrView = GetSdrView(); if ( pDrView && !pDrView->AreObjectsMarked() && !IsDrawSelMode() ) -SetDrawShell( false ); +{ +SetDrawShell(false); + +// FIXME HACK: The ViewObjectContact sdr thing is not set up well +// enough for the invalidate to work here automagically, because +// we set it up for each tile, and it does not survive for too +// long. +if (comphelper::LibreOfficeKit::isActive()) +{ +std::stringstream ss; +ss << "EMPTY"; +if (comphelper::LibreOfficeKit::isPartInInvalidation()) +ss << ", " << getPart(); +OString aPayload = ss.str().c_str(); + +SfxViewShell* pCurView = SfxViewShell::GetFirst(); +while (pCurView) +{ + pCurView->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, aPayload.getStr()); + +pCurView = SfxViewShell::GetNext(*pCurView); +} +} +} } void ScTabViewShell::SetDrawShellOrSub() ___ 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.1' - sc/source
sc/source/ui/view/tabview.cxx |3 +++ sc/source/ui/view/tabview3.cxx |7 +-- 2 files changed, 8 insertions(+), 2 deletions(-) New commits: commit 8410eb14febecfc186674064f276ca61ac4c2325 Author: Marco CecchettiDate: Fri Dec 2 17:34:18 2016 +0100 LOK - Calc: row header message must include less than MAXTILEDROW rows On the contrary we can have performance issues on the client. Change-Id: Id9b27c80c3bfc0ada17818ee39ff65da245b3b7a Reviewed-on: https://gerrit.libreoffice.org/31567 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 c5895ff..b4b5cea 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2290,6 +2290,9 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle& rRectangle) SCROW nEndRow = 0; pDoc->GetTiledRenderingArea(aViewData.GetTabNo(), nEndCol, nEndRow); +if (nEndCol > MAXCOL) nEndCol = MAXCOL; +if (nEndRow >= MAXTILEDROW) nEndRow = MAXTILEDROW - 1; + rtl::OUStringBuffer aBuffer(256 + (50 * nEndRow) + (50 * nEndCol)); aBuffer.append("{ \"commandName\": \".uno:ViewRowColumnHeaders\",\n"); diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index e3f5f75..c1e7bbc 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -331,6 +331,9 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew ) // DeactivateIP only for MarkListHasChanged +if (comphelper::LibreOfficeKit::isActive()) +nPosY = std::min(nPosY, MAXTILEDROW); + if ( nPosX != nOldX || nPosY != nOldY || bNew ) { ScTabViewShell* pViewShell = aViewData.GetViewShell(); @@ -360,10 +363,10 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew ) aOldSize = pModelObj->getDocumentSize(); if (nPosX > aViewData.GetMaxTiledCol() - 10) -aViewData.SetMaxTiledCol(std::max(nPosX, aViewData.GetMaxTiledCol()) + 10); +aViewData.SetMaxTiledCol(std::min(std::max(nPosX, aViewData.GetMaxTiledCol()) + 10, MAXCOL)); if (nPosY > aViewData.GetMaxTiledRow() - 25) -aViewData.SetMaxTiledRow(std::max(nPosY, aViewData.GetMaxTiledRow()) + 25); +aViewData.SetMaxTiledRow(std::min(std::max(nPosY, aViewData.GetMaxTiledRow()) + 25, MAXTILEDROW)); Size aNewSize(0, 0); if (pModelObj) ___ 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.1' - sc/source sc/uiconfig
sc/source/ui/dialogs/searchresults.cxx | 73 + sc/source/ui/inc/searchresults.hxx |1 sc/uiconfig/scalc/ui/searchresults.ui |7 +++ 3 files changed, 74 insertions(+), 7 deletions(-) New commits: commit 4b7f659b36d474ec2dbc5b4ddbe3e577dab8c1bf Author: Michael MeeksDate: Fri Nov 4 20:19:12 2016 + tdf#92160 - sc: limit search results to 1000 entries. Very large replace results give huge space consumption in the display widget, and are of dubious usefulness. Change-Id: Ib8ad01a673ea52976befaf958f8f695aca2190ae Reviewed-on: https://gerrit.libreoffice.org/30574 Reviewed-by: Michael Meeks Tested-by: Michael Meeks diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx index 9f6b547..742c472 100644 --- a/sc/source/ui/dialogs/searchresults.cxx +++ b/sc/source/ui/dialogs/searchresults.cxx @@ -26,6 +26,8 @@ SearchResultsDlg::SearchResultsDlg( SfxBindings* _pBindings, vcl::Window* pParen ModelessDialog(pParent, "SearchResultsDialog", "modules/scalc/ui/searchresults.ui"), mpBindings(_pBindings), mpDoc(nullptr) { +get(mpLabel, "skipped"); + SvSimpleTableContainer *pContainer = get("results"); Size aControlSize(150, 120); aControlSize = pContainer->LogicToPixel(aControlSize, MAP_APPFONT); @@ -47,16 +49,73 @@ SearchResultsDlg::~SearchResultsDlg() void SearchResultsDlg::dispose() { mpList.disposeAndClear(); +mpLabel.disposeAndClear(); ModelessDialog::dispose(); } +namespace +{ +class ListWrapper { +size_t mnCount; +const size_t mnMaximum; +OUStringBuffer maName; +VclPtr mpLabel; +VclPtr mpList; +public: +ListWrapper(const VclPtr , +const VclPtr ) : +mnCount(0), +mnMaximum(1000), +mpLabel(pLabel), +mpList(pList) +{ +mpList->Clear(); +mpList->SetUpdateMode(false); +} +void Insert(const OUString , +const ScAddress , +formula::FormulaGrammar::AddressConvention eConvention, +const OUString ) +{ +if (mnCount++ < mnMaximum) +{ +maName.append(aTabName); +maName.append("\t"); +maName.append(rPos.Format(SCA_ABS, nullptr, eConvention)); +maName.append("\t"); +maName.append(aText); +mpList->InsertEntry(maName.makeStringAndClear()); +} +} +void Update() +{ +if (mnCount > mnMaximum) +{ +if (mpLabel) +{ +size_t nSkipped = mnCount - mnMaximum; +OUString aSkipped(mpLabel->GetText()); +mpList->InsertEntry( +aSkipped.replaceFirst("$1", OUString::number(nSkipped))); +} +} +mpList->SetUpdateMode(true); +} +}; +} + void SearchResultsDlg::FillResults( ScDocument* pDoc, const ScRangeList ) { -mpList->Clear(); -mpList->SetUpdateMode(false); +ListWrapper aList(mpList, mpLabel); std::vector aTabNames = pDoc->GetAllTableNames(); SCTAB nTabCount = aTabNames.size(); -for (size_t i = 0, n = rMatchedRanges.size(); i < n; ++i) + +// tdf#92160 - too many results blow the widget's mind +size_t nMatchMax = rMatchedRanges.size(); +if (nMatchMax > 1000) +nMatchMax = 1000; + +for (size_t i = 0, n = nMatchMax; i < n; ++i) { ScCellIterator aIter(pDoc, *rMatchedRanges[i]); for (bool bHas = aIter.first(); bHas; bHas = aIter.next()) @@ -66,12 +125,12 @@ void SearchResultsDlg::FillResults( ScDocument* pDoc, const ScRangeList // Out-of-bound sheet index. continue; -OUString aPosStr = aPos.Format(SCA_ABS, nullptr, pDoc->GetAddressConvention()); -mpList->InsertEntry(aTabNames[aPos.Tab()] + "\t" + aPosStr + "\t" + pDoc->GetString(aPos)); +aList.Insert(aTabNames[aPos.Tab()], aPos, + pDoc->GetAddressConvention(), + pDoc->GetString(aPos)); } } -mpList->SetUpdateMode(true); - +aList.Update(); mpDoc = pDoc; } diff --git a/sc/source/ui/inc/searchresults.hxx b/sc/source/ui/inc/searchresults.hxx index 8143c48..ea3a91b 100644 --- a/sc/source/ui/inc/searchresults.hxx +++ b/sc/source/ui/inc/searchresults.hxx @@ -23,6 +23,7 @@ namespace sc { class SearchResultsDlg : public ModelessDialog { VclPtr mpList; +VclPtr mpLabel; SfxBindings* mpBindings; ScDocument* mpDoc; diff --git a/sc/uiconfig/scalc/ui/searchresults.ui b/sc/uiconfig/scalc/ui/searchresults.ui index c39408a..9ae8637
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sc/source
sc/source/ui/app/inputwin.cxx | 27 ++- sc/source/ui/inc/tabvwsh.hxx |2 +- sc/source/ui/view/cellsh1.cxx | 28 ++-- sc/source/ui/view/tabvwshc.cxx | 37 + 4 files changed, 50 insertions(+), 44 deletions(-) New commits: commit 4cb70d641e06f1252da15e194f98d4aa2835d56a Author: Henry CastroDate: Mon Oct 24 22:15:45 2016 -0400 tdf#103409: No selection outline displayed when SUM button is clicked Change-Id: I8a1bb22bd0be9717a56a90732b17c4ed8f230bf3 Reviewed-on: https://gerrit.libreoffice.org/30254 Tested-by: Jenkins Reviewed-by: Henry Castro diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index a306bd2..dfa3a98 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -335,10 +335,35 @@ void ScInputWindow::Select() ScTabViewShell* pViewSh = dynamic_cast ( SfxViewShell::Current() ); if ( pViewSh ) { -const OUString aFormula = pViewSh->DoAutoSum(); +bool bSubTotal = false; +bool bRangeFinder = false; +const OUString aFormula = pViewSh->DoAutoSum(bRangeFinder, bSubTotal); if (!aFormula.isEmpty()) { SetFuncString( aFormula ); +if (bRangeFinder && pScMod->IsEditMode()) +{ +ScInputHandler* pHdl = pScMod->GetInputHdl( pViewSh ); +if ( pHdl ) +{ +pHdl->InitRangeFinder( aFormula ); + +//! SetSelection at the InputHandler? +//! Set bSelIsRef? +const sal_Int32 nOpen = aFormula.indexOf('('); +const sal_Int32 nLen = aFormula.getLength(); +if ( nOpen != -1 && nLen > nOpen ) +{ +ESelection aSel( 0, nOpen + (bSubTotal ? 3 : 1), 0, nLen-1 ); +EditView* pTableView = pHdl->GetTableView(); +if ( pTableView ) +pTableView->SetSelection( aSel ); +EditView* pTopView = pHdl->GetTopView(); +if ( pTopView ) +pTopView->SetSelection( aSel ); +} +} +} } } } diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 6a6c3bb..6d24e07 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -383,7 +383,7 @@ public: bool IsActive() const { return bIsActive; } OUString GetFormula(ScAddress& rAddress); boolUseSubTotal(ScRangeList* pRangeList); -const OUString DoAutoSum(); +const OUString DoAutoSum(bool& rRangeFinder, bool& rSubTotal); // ugly hack to call Define Names from Manage Names voidSwitchBetweenRefDialogs(SfxModelessDialog* pDialog); diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 426ff9a..d2ff687 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2531,19 +2531,24 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_AUTO_SUM: { -const OUString aFormula = pTabViewShell->DoAutoSum(); -if (!aFormula.isEmpty()) +bool bSubTotal = false; +bool bRangeFinder = false; +const OUString aFormula = pTabViewShell->DoAutoSum( bRangeFinder, bSubTotal ); +if ( !aFormula.isEmpty() ) { -ScInputHandler* pHdl = pScMod->GetInputHdl(pTabViewShell); -if (pHdl) +const sal_Int32 nPar = aFormula.indexOf( '(' ); +const sal_Int32 nLen = aFormula.getLength(); +ScInputHandler* pHdl = pScMod->GetInputHdl( pTabViewShell ); + +if ( pHdl && nPar != -1 ) { -if (!pScMod->IsEditMode()) +if ( !pScMod->IsEditMode() ) { -pScMod->SetInputMode(SC_INPUT_TABLE); +pScMod->SetInputMode( SC_INPUT_TABLE ); } EditView *pEditView=pHdl->GetActiveView(); -if (pEditView) +if ( pEditView ) {
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sc/source
sc/source/ui/view/cellsh1.cxx | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) New commits: commit fa8eff36beb46791ce5859a44d5217ea6593588c Author: Henry CastroDate: Thu Oct 20 15:56:58 2016 -0400 sc: check SID_EDIT_POSTIT parameters Avoid crash when execute .uno:EditAnnotation with missing arguments Change-Id: Iaee8694b7481933f3672a3847264a49a6503b82e Reviewed-on: https://gerrit.libreoffice.org/30116 Tested-by: Jenkins Reviewed-by: Henry Castro diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 8258d65..426ff9a 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2197,20 +2197,28 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_INSERT_POSTIT: case SID_EDIT_POSTIT: -if ( pReqArgs ) { -const SvxPostItAuthorItem& rAuthorItem = static_cast(pReqArgs->Get( SID_ATTR_POSTIT_AUTHOR )); -const SvxPostItDateItem&rDateItem = static_cast(pReqArgs->Get( SID_ATTR_POSTIT_DATE )); -const SvxPostItTextItem&rTextItem = static_cast(pReqArgs->Get( SID_ATTR_POSTIT_TEXT )); +const SfxPoolItem* pAuthor; +const SfxPoolItem* pDate; +const SfxPoolItem* pText; -ScAddress aPos( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() ); -pTabViewShell->ReplaceNote( aPos, rTextItem.GetValue(), (), () ); +if ( pReqArgs && pReqArgs->HasItem( SID_ATTR_POSTIT_AUTHOR, ) && + pReqArgs->HasItem( SID_ATTR_POSTIT_DATE, ) && + pReqArgs->HasItem( SID_ATTR_POSTIT_TEXT, ) ) +{ +const SvxPostItAuthorItem* pAuthorItem = static_cast( pAuthor ); +const SvxPostItDateItem*pDateItem = static_cast( pDate ); +const SvxPostItTextItem*pTextItem = static_cast( pText ); + +ScAddress aPos( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() ); +pTabViewShell->ReplaceNote( aPos, pTextItem->GetValue(), >GetValue(), >GetValue() ); +} +else +{ +pTabViewShell->EditNote(); // note object to edit +} rReq.Done(); } -else -{ -pTabViewShell->EditNote(); // note object to edit -} break; case FID_NOTE_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.1' - sc/source
sc/source/ui/docshell/docfunc.cxx | 11 ++- sc/source/ui/view/viewfun6.cxx|6 +- 2 files changed, 15 insertions(+), 2 deletions(-) New commits: commit 98c8d1beb5933c7c2f04f6a0ede0d10605262cf6 Author: Marco CecchettiDate: Thu Oct 20 15:28:59 2016 +0200 Calc: fix seg fault due to commit 483a866b Change-Id: Ifd49fb3fce2b49a70db6be99e20590323e3dc518 Reviewed-on: https://gerrit.libreoffice.org/30105 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 5305b74..38790ab 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1226,7 +1226,16 @@ bool ScDocFunc::ShowNote( const ScAddress& rPos, bool bShow ) if (rDoc.IsStreamValid(rPos.Tab())) rDoc.SetStreamValid(rPos.Tab(), false); -rDocShell.GetViewData()->GetViewShell()->OnLOKNoteStateChanged(rPos); + +ScViewData* pViewData = rDocShell.GetViewData(); +if (pViewData) +{ +ScTabViewShell* pViewShell = pViewData->GetViewShell(); +if (pViewShell) +{ +pViewShell->OnLOKNoteStateChanged(rPos); +} +} rDocShell.SetDocumentModified(); return true; diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index d5513cf..20418ec 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -509,7 +509,11 @@ void ScViewFunc::EditNote() { ScrollToObject( pCaption ); // make object fully visible static_cast< FuText* >( pPoor )->SetInEditMode( pCaption ); -GetViewData().GetViewShell()->OnLOKNoteStateChanged(aPos); +ScTabViewShell* pViewShell = GetViewData().GetViewShell(); +if (pViewShell) +{ +pViewShell->OnLOKNoteStateChanged(aPos); +} } } } ___ 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.1' - sc/source
sc/source/ui/drawfunc/futext3.cxx |5 + sc/source/ui/view/viewfun6.cxx|1 + 2 files changed, 6 insertions(+) New commits: commit d7fde891671ce68dee663af5f9664c20dbc5c828 Author: Marco CecchettiDate: Wed Oct 19 22:08:06 2016 +0200 LOK: Calc: notes: on edit mode starts/ends: missing tiles invalidation On edit mode starts/ends, when a note is hidden, tiles, only the note tail belongs to, are not invalidated. Change-Id: I69487f428a121fc05da99d3b06786afd4f834766 Reviewed-on: https://gerrit.libreoffice.org/30094 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx index b5837e7..11fa3a4 100644 --- a/sc/source/ui/drawfunc/futext3.cxx +++ b/sc/source/ui/drawfunc/futext3.cxx @@ -120,6 +120,11 @@ void FuText::StopEditMode(bool /*bTextDirection*/) if( pNote ) { +pViewShell->OnLOKNoteStateChanged(aNotePos); +} + +if( pNote ) +{ // hide the caption object if it is in hidden state pNote->ShowCaptionTemp( aNotePos, false ); diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index 07bffd2..d5513cf 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -509,6 +509,7 @@ void ScViewFunc::EditNote() { ScrollToObject( pCaption ); // make object fully visible static_cast< FuText* >( pPoor )->SetInEditMode( pCaption ); +GetViewData().GetViewShell()->OnLOKNoteStateChanged(aPos); } } } ___ 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.1' - sc/source
sc/source/ui/docshell/docfunc.cxx |1 sc/source/ui/inc/tabview.hxx |1 sc/source/ui/view/tabview5.cxx| 44 ++ 3 files changed, 46 insertions(+) New commits: commit ec32631e7cf8442dc4a7f1f8a361787eeefcbfdf Author: Marco CecchettiDate: Wed Oct 19 22:00:04 2016 +0200 LOK: Calc: show/hide a note does not perform any tile invalidation Change-Id: Ia904b6bbe82c395299b269ddbde523d19bf486bc Reviewed-on: https://gerrit.libreoffice.org/30093 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 604af85..5305b74 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1226,6 +1226,7 @@ bool ScDocFunc::ShowNote( const ScAddress& rPos, bool bShow ) if (rDoc.IsStreamValid(rPos.Tab())) rDoc.SetStreamValid(rPos.Tab(), false); +rDocShell.GetViewData()->GetViewShell()->OnLOKNoteStateChanged(rPos); rDocShell.SetDocumentModified(); return true; diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 43aaf7d..cbb26bf 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -581,6 +581,7 @@ public: void SetAutoSpellData( SCCOL nPosX, SCROW nPosY, const std::vector* pRanges ); /// @see ScModelObj::getRowColumnHeaders(). OUString getRowColumnHeaders(const Rectangle& rRectangle); +void OnLOKNoteStateChanged(const ScAddress& rPos); }; #endif diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx index 83d9094..49650b6 100644 --- a/sc/source/ui/view/tabview5.cxx +++ b/sc/source/ui/view/tabview5.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -48,6 +49,7 @@ #include "AccessibilityHints.hxx" #include "docsh.hxx" #include "viewuno.hxx" +#include "postit.hxx" #include #include @@ -648,4 +650,46 @@ void ScTabView::ResetBrushDocument() } } +void ScTabView::OnLOKNoteStateChanged(const ScAddress& rPos) +{ +ScDocument* pDoc = GetViewData().GetDocument(); +if (!pDoc) return; +ScPostIt* pNote = pDoc->GetNote(rPos); +if (!pNote) return; +SdrCaptionObj* pCaption = pNote->GetCaption(); +if (!pCaption) return; + +if (comphelper::LibreOfficeKit::isActive()) +{ +Rectangle aRect = pCaption->GetLogicRect(); +basegfx::B2DRange aTailRange = pCaption->getTailPolygon().getB2DRange(); +Rectangle aTailRect(aTailRange.getMinX(), aTailRange.getMinY(), +aTailRange.getMaxX(), aTailRange.getMaxY()); +aRect.Union( aTailRect ); +static const int nBorderSize = 200; + +SfxViewShell* pViewShell = SfxViewShell::GetFirst(); +while (pViewShell) +{ +ScTabViewShell* pTabViewShell = dynamic_cast (pViewShell); +if (pTabViewShell) +{ +for (auto& pWin: pTabViewShell->pGridWin) +{ +if (pWin && pWin->IsVisible()) +{ +Rectangle aInvalidRect = aRect; +aInvalidRect.Left() -= nBorderSize; +aInvalidRect.Right() += nBorderSize; +aInvalidRect.Top() -= nBorderSize; +aInvalidRect.Bottom() += nBorderSize; +pWin->Invalidate(aInvalidRect); +} +} +} +pViewShell = SfxViewShell::GetNext(*pViewShell); +} +} +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ 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.1' - sc/source
sc/source/ui/view/gridwin4.cxx | 14 ++ 1 file changed, 14 insertions(+) New commits: commit 02bf72f7513aa4e28e2d544a34a8c8b3465b9e39 Author: Marco CecchettiDate: Wed Oct 19 21:57:18 2016 +0200 LOK: Calc: notes: when edit mode begins the text content is misplaced Change-Id: Ia8efcee6fbeb75dd712d3ac480e355c2972875f3 Reviewed-on: https://gerrit.libreoffice.org/30092 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 bc35620..e9b9e67 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -890,6 +890,20 @@ void ScGridWindow::DrawContent(OutputDevice , const ScTableInfo& rTableI { MapMode aCurrentMapMode(pContentDev->GetMapMode()); pContentDev->SetMapMode(aDrawMode); + +if (bIsTiledRendering) +{ +auto aOrigin = aOriginalMode.GetOrigin(); +aOrigin.setX(aOrigin.getX() / TWIPS_PER_PIXEL + aOutputData.nScrX); +aOrigin.setY(aOrigin.getY() / TWIPS_PER_PIXEL + aOutputData.nScrY); +static const double twipFactor = 15 * 1.7639; // 26.4585 +aOrigin = Point(aOrigin.getX() * twipFactor, +aOrigin.getY() * twipFactor); +MapMode aNew = rDevice.GetMapMode(); +aNew.SetOrigin(aOrigin); +rDevice.SetMapMode(aNew); +} + SdrView* pDrawView = pTabViewShell->GetSdrView(); if(pDrawView) ___ 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.1' - sc/source
sc/source/ui/inc/viewdata.hxx |2 ++ sc/source/ui/view/viewdata.cxx | 19 ++- 2 files changed, 20 insertions(+), 1 deletion(-) New commits: commit 004ca8f6558c71909551d15e077c4e835ebd6391 Author: Marco CecchettiDate: Wed Oct 12 21:41:26 2016 +0200 tdf#103211 Calc: it is insane to call EditGrowX/Y while the edit view is growing. That could occur because of the call to SetDefaultItem later. We end up with wrong start/end edit columns and the changes to the output area performed by the inner call to EditGrowX are useless since they are discarded by the outer call. In the inner call the output area is not the new one computed by the outer call, on the contrary the data field `nEditStartCol` and `nEditEndCol` have been already modified, so the inner call would modify them using the wrong output area width. Maybe the call to SetDefaultItem should be performed in another place, anyway the outer call takes into account the correct horizontal adjust when computing the new start/end edit columns and the new left/right output area. Change-Id: I56d038f33ab9d1933c4c6cd1db6d9cd012fb6db1 Reviewed-on: https://gerrit.libreoffice.org/29741 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 3ed3e7c..f61b0bf 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -216,6 +216,8 @@ private: boolbSelCtrlMouseClick:1; // special selection handling for ctrl-mouse-click boolbMoveArea:1; +boolbGrowing; + longm_nLOKPageUpDownOffset; DECL_DLLPRIVATE_LINK_TYPED( EditEngineHdl, EditStatus&, void ); diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index b14d846..dc9a48c 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -60,10 +60,10 @@ #include #include #include +#include #include #include #include -#include #include #include @@ -352,6 +352,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) : bPagebreak ( false ), bSelCtrlMouseClick( false ), bMoveArea ( false ), +bGrowing (false), m_nLOKPageUpDownOffset( 0 ) { mpMarkData->SelectOneTable(0); // Sync with nTabNo @@ -443,6 +444,7 @@ ScViewData::ScViewData( const ScViewData& rViewData ) : bPagebreak ( rViewData.bPagebreak ), bSelCtrlMouseClick( rViewData.bSelCtrlMouseClick ), bMoveArea ( rViewData.bMoveArea ), +bGrowing( rViewData.bGrowing ), m_nLOKPageUpDownOffset( rViewData.m_nLOKPageUpDownOffset ) { @@ -1175,6 +1177,16 @@ IMPL_LINK_TYPED( ScViewData, EditEngineHdl, EditStatus&, rStatus, void ) void ScViewData::EditGrowX() { +// It is insane to call EditGrowX while the output area is already growing. +// That could occur because of the call to SetDefaultItem later. +// We end up with wrong start/end edit columns and the changes +// to the output area performed by the inner call to this method are +// useless since they are discarded by the outer call. +if (bGrowing) +return; + +comphelper::FlagRestorationGuard aFlagGuard(bGrowing, true); + ScDocument* pLocalDoc = GetDocument(); ScSplitPos eWhich = GetActivePart(); @@ -1360,6 +1372,11 @@ void ScViewData::EditGrowX() void ScViewData::EditGrowY( bool bInitial ) { +if (bGrowing) +return; + +comphelper::FlagRestorationGuard aFlagGuard(bGrowing, true); + ScSplitPos eWhich = GetActivePart(); ScVSplitPos eVWhich = WhichV(eWhich); EditView* pCurView = pEditView[eWhich]; ___ 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.1' - sc/source
sc/source/core/tool/compiler.cxx | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) New commits: commit 79bf2fd7d6b740fbf2919d33165cb99434bdd550 Author: Kohei YoshidaDate: Sat Oct 1 21:07:20 2016 -0400 tdf#93894: Get column labels to work with formula groups. Change-Id: Ia2a09981dceae2e9809c76570300de8ca1927c1b Reviewed-on: https://gerrit.libreoffice.org/29514 Reviewed-by: Kohei Yoshida Tested-by: Kohei Yoshida diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index b51c8f4..595059d 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -5137,10 +5137,8 @@ bool ScCompiler::HandleColRowName() { ScSingleRefData aRefData; aRefData.InitAddress( aRange.aStart ); -if ( bColName ) -aRefData.SetColRel( true ); -else -aRefData.SetRowRel( true ); +aRefData.SetColRel( true ); +aRefData.SetRowRel( true ); aRefData.SetAddress(aRange.aStart, aPos); pNew->AddSingleReference( aRefData ); } @@ -5148,16 +5146,10 @@ bool ScCompiler::HandleColRowName() { ScComplexRefData aRefData; aRefData.InitRange( aRange ); -if ( bColName ) -{ -aRefData.Ref1.SetColRel( true ); -aRefData.Ref2.SetColRel( true ); -} -else -{ -aRefData.Ref1.SetRowRel( true ); -aRefData.Ref2.SetRowRel( true ); -} +aRefData.Ref1.SetColRel( true ); +aRefData.Ref2.SetColRel( true ); +aRefData.Ref1.SetRowRel( true ); +aRefData.Ref2.SetRowRel( true ); aRefData.SetRange(aRange, aPos); if ( bInList ) pNew->AddDoubleReference( aRefData ); ___ 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.1' - sc/source
sc/source/ui/app/inputhdl.cxx | 10 +- sc/source/ui/inc/viewdata.hxx |5 + sc/source/ui/view/viewdata.cxx | 13 +++-- 3 files changed, 17 insertions(+), 11 deletions(-) New commits: commit 3ee94eab7ce4c856bfe7c3c1f604858a7d9f4178 Author: Marco CecchettiDate: Sun Oct 9 22:08:51 2016 +0200 LOK: Calc: in the numeric content case, the used alignment can be wrong -description: in the numeric content case, the used horizontal alignment can be wrong when input content goes further than the cell border; - reason: (very odd) bMoveArea and nEditAdjust are global variables in viewdata.cxx instead of being data members of ScViewdata; - solution: now bMoveArea and nEditAdjust are data members of ScViewdata. Change-Id: I58a4ec26ca290fd328ef28a92c3c590462c7231a Reviewed-on: https://gerrit.libreoffice.org/29628 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 9978071..1d6ce11 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -90,8 +90,6 @@ using namespace formula; bool ScInputHandler::bOptLoaded = false;// Evaluate App options bool ScInputHandler::bAutoComplete = false; // Is set in KeyInput -extern sal_uInt16 nEditAdjust; //! Member of ViewData - namespace { // Formula data replacement character for a pair of parentheses at end of @@ -1795,8 +1793,10 @@ void ScInputHandler::UpdateAdjust( sal_Unicode cTyped ) pEditDefaults->Put( SvxAdjustItem( eSvxAdjust, EE_PARA_JUST ) ); pEngine->SetDefaults( *pEditDefaults ); -nEditAdjust = sal::static_int_cast(eSvxAdjust); //! set at ViewData or with PostEditView - +if ( pActiveViewSh ) +{ +pActiveViewSh->GetViewData().SetEditAdjust( eSvxAdjust ); +} pEngine->SetVertical( bAsianVertical ); } @@ -2140,7 +2140,7 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, bool bSetModified ) { ScViewData& rViewData = pActiveViewSh->GetViewData(); -bool bNeedGrow = ( nEditAdjust != SVX_ADJUST_LEFT ); // Always right-aligned +bool bNeedGrow = ( rViewData.GetEditAdjust() != SVX_ADJUST_LEFT ); // Always right-aligned if (!bNeedGrow) { // Cursor before the end? diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 14b26a9..3ed3e7c 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -207,12 +207,14 @@ private: ScSplitPos eEditActivePart;// the part that was active when edit mode was started ScFillMode nFillMode; +SvxAdjust eEditAdjust; boolbEditActive[4]; // Active? boolbActive:1; // Active Window ? boolbIsRefMode:1; // Reference input boolbDelMarkValid:1;// Only valid at SC_REFTYPE_FILL boolbPagebreak:1; // Page break preview mode boolbSelCtrlMouseClick:1; // special selection handling for ctrl-mouse-click +boolbMoveArea:1; longm_nLOKPageUpDownOffset; @@ -355,6 +357,9 @@ public: boolIsFillMode(){ return nFillMode == ScFillMode::FILL; } ScFillMode GetFillMode() { return nFillMode; } +SvxAdjust GetEditAdjust() const {return eEditAdjust; } +voidSetEditAdjust( SvxAdjust eNewEditAdjust ) { eEditAdjust = eNewEditAdjust; } + // TRUE: Cell is merged boolGetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, long& rSizeYPix ) const; boolGetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWhich, diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index f61b5d7..e45a1d5 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -75,9 +75,6 @@ using namespace com::sun::star; #define TAG_TABBARWIDTH "tw:" -static bool bMoveArea = false; // Member? -sal_uInt16 nEditAdjust = SVX_ADJUST_LEFT; // Member! - namespace { void lcl_LOKRemoveEditView(ScTabViewShell* pTabViewShell, ScSplitPos eWhich) @@ -348,11 +345,13 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) : nPasteFlags ( SC_PASTE_NONE ), eEditActivePart( SC_SPLIT_BOTTOMLEFT ), nFillMode ( ScFillMode::NONE ), +eEditAdjust ( SVX_ADJUST_LEFT ), bActive ( true ), // how to initialize? bIsRefMode ( false ), bDelMarkValid( false ), bPagebreak ( false ), bSelCtrlMouseClick( false ), +bMoveArea ( false ),
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sc/source
sc/source/ui/inc/tabview.hxx | 60 sc/source/ui/view/tabview.cxx |1 sc/source/ui/view/tabview3.cxx | 197 - sc/source/ui/view/tabvwsh4.cxx | 12 -- 4 files changed, 141 insertions(+), 129 deletions(-) New commits: commit 5fa5fff0ac058fbd081bf010a3680207d3238e2c Author: Marco CecchettiDate: Thu Oct 6 23:29:40 2016 +0200 LOK: Calc: parallel cell editing: small code improvements - A single instance of ScExtraEditViewManager is created per ScTabView; - On destruction a counter is checked in order to be sure that all created edit views have been destroyed. - BoolLock has been replaced by comphelper::FlagRestorationGuard Change-Id: I6b0293c4d2e9151dff8b13601d0074c4b2567b25 Reviewed-on: https://gerrit.libreoffice.org/29582 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index d2cc7fc..01e097a 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -80,6 +80,64 @@ public: virtual voidDataChanged( const DataChangedEvent& rDCEvt ) override; }; +class ScExtraEditViewManager +{ +public: +ScExtraEditViewManager(ScTabViewShell* pThisViewShell, VclPtr* pGridWin) +: mpThisViewShell(pThisViewShell) +, mpGridWin(pGridWin) +, mpOtherEditView(nullptr) +, mpOtherEngine(nullptr) +, maSameEditViewChecker() +, nTotalActiveEditViews(0) +{} + +~ScExtraEditViewManager(); + +void Add(SfxViewShell* pViewShell, ScSplitPos eWhich) +{ +Apply(pViewShell, eWhich, ::Adder); +} + +void Remove(SfxViewShell* pViewShell, ScSplitPos eWhich) +{ +Apply(pViewShell, eWhich, ::Remover); +} + +private: +class SameEditViewChecker +{ +public: +SameEditViewChecker() +: mpOtherEditView(nullptr) +, mpWindow(nullptr) +{} +void SetEditView(EditView* pOtherEditView) { mpOtherEditView = pOtherEditView; } +void SetWindow(ScGridWindow* pWindow) { mpWindow = pWindow; } +bool operator() (const EditView* pView) const; + +private: +EditView* mpOtherEditView; +ScGridWindow* mpWindow; +}; + +private: +typedef void (ScExtraEditViewManager::* FuncType)(ScGridWindow* ); + +void Apply(SfxViewShell* pViewShell, ScSplitPos eWhich, FuncType fHandler); +void Adder(ScGridWindow* pWin); +void Remover(ScGridWindow* pWin); + +private: +ScTabViewShell* mpThisViewShell; +VclPtr* mpGridWin; +EditView* mpOtherEditView; +EditEngine* mpOtherEngine; +SameEditViewChecker maSameEditViewChecker; +int nTotalActiveEditViews; +}; + + class ScTabView : boost::noncopyable { private: @@ -130,6 +188,8 @@ private: VclPtr pTimerWindow; MouseEvent aTimerMEvt; +ScExtraEditViewManager aExtraEditViewManager; + sal_uLong nTipVisible; longnPrevDragPos; diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 8f8a66f..c5895ff 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -211,6 +211,7 @@ ScTabView::ScTabView( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pBrushDocument( nullptr ), pDrawBrushSet( nullptr ), pTimerWindow( nullptr ), +aExtraEditViewManager( pViewShell, pGridWin ), nTipVisible( 0 ), nPrevDragPos( 0 ), meBlockMode(None), diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index af57d3a..cd85deb 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -97,6 +97,83 @@ ScRange lcl_getSubRangeByIndex( const ScRange& rRange, sal_Int32 nIndex ) using namespace com::sun::star; +ScExtraEditViewManager::~ScExtraEditViewManager() +{ +assert(nTotalActiveEditViews == 0); +} + +void ScExtraEditViewManager::Apply(SfxViewShell* pViewShell, ScSplitPos eWhich, FuncType fHandler) +{ +ScTabViewShell* pOtherViewShell = dynamic_cast (pViewShell); +if (pOtherViewShell != nullptr && pOtherViewShell != mpThisViewShell) +{ +mpOtherEditView = pOtherViewShell->GetViewData().GetEditView(eWhich); +if (mpOtherEditView != nullptr) +{ +mpOtherEngine = mpOtherEditView->GetEditEngine(); +if (mpOtherEngine != nullptr) +{ +maSameEditViewChecker.SetEditView(mpOtherEditView); +for (int i = 0; i < 4; ++i) +{ +(this->*fHandler)(mpGridWin[i].get()); +} +} +} +} +} + +void ScExtraEditViewManager::Adder(ScGridWindow* pWin) +{ +if (pWin != nullptr) +{ +EditEngine::ViewsType& rEditViews = mpOtherEngine->GetEditViews(); +
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sc/source
sc/source/ui/unoobj/docuno.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 26cded05a45d28d4ed70d6e747c42312b2d55207 Author: Michael MeeksDate: Fri Oct 7 19:59:24 2016 +0100 sc: Allow paste to overwrite existing data in tiled editin mode. Change-Id: Ibb7a4697a509d011dd8a6a1793f41d4c73d1f253 diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 68efb4c..1c13004 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -978,6 +978,7 @@ void ScModelObj::initializeForTiledRendering(const css::uno::SequenceGetInputOptions()); aInputOptions.SetTextWysiwyg(true); +aInputOptions.SetReplaceCellsWarn(false); SC_MOD()->SetInputOptions(aInputOptions); pDocShell->CalcOutputFactor(); ___ 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.1' - sc/source
sc/source/ui/view/gridwin4.cxx | 39 +++ 1 file changed, 15 insertions(+), 24 deletions(-) New commits: commit 1922c8b1d46e0067ed21a18d249f04da6f3b0160 Author: Marco CecchettiDate: Sun Oct 2 14:01:47 2016 +0200 LOK: Calc: clear cell background in other views on editing Change-Id: Ia61bcdf7db0994b6681607403c56be707a9f17d9 Reviewed-on: https://gerrit.libreoffice.org/29456 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 53d46db..800cc9e 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -972,7 +972,8 @@ void ScGridWindow::DrawContent(OutputDevice , const ScTableInfo& rTableI pCrsr->Show(); } -if (comphelper::LibreOfficeKit::isActive()) +// paint in-place editing on other views +if (bIsTiledRendering) { ScTabViewShell* pThisViewShell = pViewData->GetViewShell(); SfxViewShell* pViewShell = SfxViewShell::GetFirst(); @@ -999,14 +1000,6 @@ void ScGridWindow::DrawContent(OutputDevice , const ScTableInfo& rTableI EditView* pOtherEditView = rOtherViewData.GetEditView(eOtherWhich); if (pOtherEditView) { -// TODO: implement the RTL layout case -//Point aOtherScrPos = rOtherViewData.GetScrPos( nX1, nY1, eOtherWhich ); -//if ( bLayoutRTL ) -//{ -//long nEndPixel = rOtherViewData.GetScrPos( nX2+1, maVisibleRange.mnRow1, eWhich ).X(); -//aOtherScrPos.X() = nEndPixel + 1; -//} - long nScreenX = aOutputData.nScrX; long nScreenY = aOutputData.nScrY; long nScreenW = aOutputData.GetScrW(); @@ -1024,27 +1017,25 @@ void ScGridWindow::DrawContent(OutputDevice , const ScTableInfo& rTableI Rectangle aBackground(aStart, aEnd); -aBackground += Point(nScreenX, nScreenY); +// Need to draw the background in absolute coords. +auto aOrigin = aOriginalMode.GetOrigin(); +aOrigin.setX(aOrigin.getX() / TWIPS_PER_PIXEL + nScreenX); +aOrigin.setY(aOrigin.getY() / TWIPS_PER_PIXEL + nScreenY); +aBackground += aOrigin; rDevice.SetMapMode(aDrawMode); +static const double twipFactor = 15 * 1.7639; // 26.4585 +aOrigin = Point(aOrigin.getX() * twipFactor, +aOrigin.getY() * twipFactor); +MapMode aNew = rDevice.GetMapMode(); +aNew.SetOrigin(aOrigin); +rDevice.SetMapMode(aNew); // paint the background rDevice.DrawRect(rDevice.PixelToLogic(aBackground)); -if (bIsTiledRendering) -{ -auto 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() * twipFactor, -aOrigin.getY() * twipFactor); -MapMode aNew = rDevice.GetMapMode(); -aNew.SetOrigin(aOrigin); -rDevice.SetMapMode(aNew); -} - - pOtherEditView->Paint(rDevice.PixelToLogic(Rectangle(Point(nScreenX, nScreenY), Size(nScreenW, nScreenH))), ); +Rectangle aEditRect(Point(nScreenX, nScreenY), Size(nScreenW, nScreenH)); + pOtherEditView->Paint(rDevice.PixelToLogic(aEditRect), ); rDevice.SetMapMode(MAP_PIXEL); } } ___ 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.1' - sc/source
sc/source/ui/view/gridwin4.cxx | 79 + sc/source/ui/view/tabview3.cxx |4 +- 2 files changed, 43 insertions(+), 40 deletions(-) New commits: commit eeac6e6cc5f343193bf2942f203237d09c070eec Author: Marco CecchettiDate: Fri Sep 30 23:31:15 2016 +0200 Calc: fixed bug in parallel cell editing The background color by the wrong edit view was used causing a segmentation fault. Change-Id: Ife489989e382d6f4f905f0ca305928e64bbce588 diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 1adf3f0..a3a171c 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -993,55 +993,58 @@ void ScGridWindow::DrawContent(OutputDevice , const ScTableInfo& rTableI if (bOtherEditMode && rOtherViewData.GetRefTabNo() == nTab) { EditView* pOtherEditView = rOtherViewData.GetEditView(eOtherWhich); -Point aOtherScrPos = rOtherViewData.GetScrPos( nX1, nY1, eOtherWhich ); -if ( bLayoutRTL ) +if (pOtherEditView) { -long nEndPixel = pViewData->GetScrPos( nX2+1, maVisibleRange.mnRow1, eWhich ).X(); -aOtherScrPos.X() = nEndPixel + 1; -} +// TODO: implement the RTL layout case +//Point aOtherScrPos = rOtherViewData.GetScrPos( nX1, nY1, eOtherWhich ); +//if ( bLayoutRTL ) +//{ +//long nEndPixel = rOtherViewData.GetScrPos( nX2+1, maVisibleRange.mnRow1, eWhich ).X(); +//aOtherScrPos.X() = nEndPixel + 1; +//} -long nScreenX = aOutputData.nScrX; -long nScreenY = aOutputData.nScrY; -long nScreenW = aOutputData.GetScrW(); -long nScreenH = aOutputData.GetScrH(); +long nScreenX = aOutputData.nScrX; +long nScreenY = aOutputData.nScrY; +long nScreenW = aOutputData.GetScrW(); +long nScreenH = aOutputData.GetScrH(); -rDevice.SetLineColor(); -rDevice.SetFillColor(pEditView->GetBackgroundColor()); -Point aStart = rOtherViewData.GetScrPos( nCol1, nRow1, eOtherWhich ); -Point aEnd = rOtherViewData.GetScrPos( nCol2+1, nRow2+1, eOtherWhich ); +rDevice.SetLineColor(); + rDevice.SetFillColor(pOtherEditView->GetBackgroundColor()); +Point aStart = rOtherViewData.GetScrPos( nCol1, nRow1, eOtherWhich ); +Point aEnd = rOtherViewData.GetScrPos( nCol2+1, nRow2+1, eOtherWhich ); -// don't overwrite grid -long nLayoutSign = bLayoutRTL ? -1 : 1; -aEnd.X() -= 2 * nLayoutSign; -aEnd.Y() -= 2; +// don't overwrite grid +long nLayoutSign = bLayoutRTL ? -1 : 1; +aEnd.X() -= 2 * nLayoutSign; +aEnd.Y() -= 2; -Rectangle aBackground(aStart, aEnd); +Rectangle aBackground(aStart, aEnd); -aBackground += Point(nScreenX, nScreenY); -rDevice.SetMapMode(aDrawMode); +aBackground += Point(nScreenX, nScreenY); +rDevice.SetMapMode(aDrawMode); -// paint the background -rDevice.DrawRect(rDevice.PixelToLogic(aBackground)); +// paint the background + rDevice.DrawRect(rDevice.PixelToLogic(aBackground)); -if (bIsTiledRendering) -{ -auto 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() * twipFactor, -aOrigin.getY() * twipFactor); -MapMode aNew = rDevice.GetMapMode(); -aNew.SetOrigin(aOrigin); -rDevice.SetMapMode(aNew); -} +if (bIsTiledRendering) +
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sc/source
sc/source/ui/view/gridwin4.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit c066607fdef76f6a33d29182a465e7cf215c731f Author: Andras TimarDate: Wed Sep 21 09:12:21 2016 +0200 Linux x86 build fix Change-Id: I1464c429dd41feaeab97f2792eed40a9dfbadde3 diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 7ce585c..03a124d 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1087,8 +1087,8 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, nTopLeftTileCol = std::min(nTopLeftTileCol, (sal_Int32)nEndCol); nTopLeftTileRow = std::min(nTopLeftTileRow, (sal_Int32)nEndRow); -nTopLeftTileCol = std::max(nTopLeftTileCol, 0); -nTopLeftTileRow = std::max(nTopLeftTileRow, 0); +nTopLeftTileCol = std::max(nTopLeftTileCol, sal_Int32(0)); +nTopLeftTileRow = std::max(nTopLeftTileRow, sal_Int32(0)); nBottomRightTileCol = std::min(nBottomRightTileCol, (sal_Int32)nEndCol); nBottomRightTileRow = std::min(nBottomRightTileRow, (sal_Int32)nEndRow); nTopLeftTileColOrigin = nTopLeftTileColOrigin * TWIPS_PER_PIXEL; ___ 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.1' - sc/source
sc/source/ui/view/cellsh3.cxx | 30 -- 1 file changed, 24 insertions(+), 6 deletions(-) New commits: commit 756c4ae5dcb948d6e675287e322720ab890c3e6b Author: Henry CastroDate: Tue Aug 23 14:13:57 2016 -0400 sc lok: fix re-sizing several rows/columns at once Reviewed-on: https://gerrit.libreoffice.org/28351 Tested-by: Jenkins Reviewed-by: Henry Castro Conflicts: sc/source/ui/view/cellsh3.cxx Change-Id: I7b3760432aa4b3120bfd586a1abc42a46fff0df8 diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 036c45e..32aa3cd 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -547,10 +547,19 @@ void ScCellShell::Execute( SfxRequest& rReq ) pReqArgs->HasItem( FN_PARAM_2, ) ) { std::vector aRanges; -SCCOLROW nRow = static_cast(pRow)->GetValue() - 1; -sal_uInt16 nHeight = static_cast(pHeight)->GetValue(); +SCCOLROW nRow = static_cast(pRow)->GetValue() - 1; +sal_uInt16 nHeight = static_cast(pHeight)->GetValue(); +ScMarkData& rMark = GetViewData()->GetMarkData(); + +if ( rMark.IsRowMarked( static_cast(nRow) ) ) +{ +aRanges = rMark.GetMarkedRowSpans(); +} +else +{ +aRanges.push_back(sc::ColRowSpan(nRow, nRow)); +} -aRanges.push_back(sc::ColRowSpan(nRow, nRow)); pTabViewShell->SetWidthOrHeight(false, aRanges, SC_SIZE_DIRECT, nHeight); } else if ( pReqArgs ) @@ -643,10 +652,19 @@ void ScCellShell::Execute( SfxRequest& rReq ) pReqArgs->HasItem( FN_PARAM_2, ) ) { std::vector aRanges; -SCCOLROW nColumn = static_cast(pColumn)->GetValue() - 1; -sal_uInt16 nWidth = static_cast(pWidth)->GetValue(); +SCCOLROW nColumn = static_cast(pColumn)->GetValue() - 1; +sal_uInt16 nWidth = static_cast(pWidth)->GetValue(); +ScMarkData& rMark = GetViewData()->GetMarkData(); + +if ( rMark.IsColumnMarked( static_cast(nColumn) ) ) +{ +aRanges = rMark.GetMarkedColSpans(); +} +else +{ +aRanges.push_back(sc::ColRowSpan(nColumn, nColumn)); +} -aRanges.push_back(sc::ColRowSpan(nColumn, nColumn)); pTabViewShell->SetWidthOrHeight(true, aRanges, SC_SIZE_DIRECT, nWidth); } else if ( pReqArgs ) ___ 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.1' - sc/source
sc/source/ui/inc/tabcont.hxx |2 +- sc/source/ui/inc/tabview.hxx |1 + sc/source/ui/unoobj/docuno.cxx | 20 sc/source/ui/view/tabview3.cxx |5 + 4 files changed, 11 insertions(+), 17 deletions(-) New commits: commit d514ce90b843e06b3157077d81e52db180c6b8e6 Author: Henry CastroDate: Tue Jan 12 15:37:25 2016 -0400 sc lokit: refactor setPart Change-Id: I01786551aef0274ae11fe673cc5b0c250e8817cc Reviewed-on: https://gerrit.libreoffice.org/21403 Tested-by: Jenkins Reviewed-by: Henry Castro (cherry picked from commit ab95fb7a19d7847dd1cbfad0059cc175a809a50f) diff --git a/sc/source/ui/inc/tabcont.hxx b/sc/source/ui/inc/tabcont.hxx index 246a794..31503b4 100644 --- a/sc/source/ui/inc/tabcont.hxx +++ b/sc/source/ui/inc/tabcont.hxx @@ -44,7 +44,6 @@ private: DECL_LINK_TYPED(ShowPageList, const CommandEvent&, void); -void SwitchToPageId(sal_uInt16 nId); protected: virtual voidSelect() override; virtual voidCommand( const CommandEvent& rCEvt ) override; @@ -73,6 +72,7 @@ public: voidUpdateStatus(); voidSetSheetLayoutRTL( bool bSheetRTL ); +voidSwitchToPageId( sal_uInt16 nId ); }; #endif diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index ddc89ee..244073f 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -386,6 +386,7 @@ public: SC_DLLPUBLIC void SetTabNo( SCTAB nTab, bool bNew = false, bool bExtendSelection = false, bool bSameTabButMoved = false ); voidSelectNextTab( short nDir, bool bExtendSelection = false ); +voidSelectTabPage( const sal_uInt16 nTab ); voidActivateView( bool bActivate, bool bFirst ); voidActivatePart( ScSplitPos eWhich ); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 728cd89..5a65e3b 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -495,22 +495,10 @@ void ScModelObj::paintTile( VirtualDevice& rDevice, void ScModelObj::setPart( int nPart ) { ScViewData* pViewData = ScDocShell::GetViewData(); -SfxUInt16Item aItem( SID_CURRENTTAB, nPart + 1 ); -SfxDispatcher& rDisp = pViewData->GetDispatcher(); - -rDisp.Execute( SID_CURRENTTAB, SfxCallMode::SLOT | SfxCallMode::RECORD, , nullptr ); - -SfxBindings& rBind = pViewData->GetBindings(); -rBind.Invalidate( FID_FILL_TAB ); -rBind.Invalidate( FID_TAB_DESELECTALL ); -rBind.Invalidate( FID_INS_TABLE ); -rBind.Invalidate( FID_TAB_APPEND ); -rBind.Invalidate( FID_TAB_MOVE ); -rBind.Invalidate( FID_TAB_RENAME ); -rBind.Invalidate( FID_DELETE_TABLE ); -rBind.Invalidate( FID_TABLE_SHOW ); -rBind.Invalidate( FID_TABLE_HIDE ); -rBind.Invalidate( FID_TAB_SET_TAB_BG_COLOR ); +ScTabView* pTabView = dynamic_cast< ScTabView* >( pViewData->GetView() ); + +if (pTabView) +pTabView->SelectTabPage(nPart + 1); } int ScModelObj::getParts() diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 7e18b88..d6e31a5 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -1525,6 +1525,11 @@ void ScTabView::SelectNextTab( short nDir, bool bExtendSelection ) PaintExtras(); } +void ScTabView::SelectTabPage( const sal_uInt16 nTab ) +{ +pTabControl->SwitchToPageId( nTab ); +} + // SetTabNo - set the displayed sheet void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSameTabButMoved ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits