[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - editeng/source
editeng/source/editeng/impedit.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit 02a3c0e471272b78db17b4e1d10ea349e4bc53da Author: Tor Lillqvist AuthorDate: Tue Jul 30 11:48:19 2019 +0300 Commit: Miklos Vajna CommitDate: Tue Jul 30 11:36:30 2019 +0200 tdf#125568: We need the selection string also when not "in selection mode" Apparently being "in selection mode" has nothing to do with whether we have a selection that we are enlarging by dragging the end marker? Change-Id: I546a1685bd3a0102e16c1f8bc6e721819ed986e2 Reviewed-on: https://gerrit.libreoffice.org/76588 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 8e5c8c71540f..dafbb3939fae 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -411,7 +412,10 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion, OString sRectangle; // If we are not in selection mode, then the exported own selection should be empty. -if (pEditEngine->pImpEditEngine->IsInSelectionMode() || mpOtherShell) +// This is needed always in Online, regardless whether in "selection mode" (whatever +// that is) or not, for tdf#125568, but I don't have the clout to make this completely +// unconditional also for desktop LO. +if (comphelper::LibreOfficeKit::isActive() || pEditEngine->pImpEditEngine->IsInSelectionMode() || mpOtherShell) { std::vector aRectangles; pRegion->GetRegionRectangles(aRectangles); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - editeng/source sw/qa sw/source
editeng/source/items/frmitems.cxx |8 +- sw/qa/extras/ooxmlexport/data/tdf112118.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx| 72 ++ sw/qa/extras/ww8export/data/tdf112118.doc |binary sw/qa/extras/ww8export/ww8export2.cxx | 68 sw/source/core/tox/ToxTabStopTokenHandler.cxx |4 - sw/source/filter/ww8/docxattributeoutput.cxx |4 - sw/source/filter/ww8/ww8atr.cxx |4 - sw/source/filter/ww8/ww8par6.cxx |2 9 files changed, 108 insertions(+), 54 deletions(-) New commits: commit 784d8fceceb5378cfb7661c2f4294a0a22f0397c Author: Mike Kaganski AuthorDate: Sat Mar 17 23:49:37 2018 +0300 Commit: Jan Holesovsky CommitDate: Fri Jul 20 12:15:18 2018 +0200 tdf#112118: use correct border when calculating margin This is a longstanding (at least since 2000: already present in commit 7b0b5cdf) error where left border linespace was used when calculating right margin. It was copypasted from ww8 import to ooxml code verbatim. The problem only manifests itself when left and right border spacings are not the same; and since we had other errors in the borders import, that additional problem simply wasn't apparent. Also use scaled border width in border distance/margin calculations. Unit tests updated. Change-Id: I70961e1bde29471def69e1ef944ba2779cffe307 Reviewed-on: https://gerrit.libreoffice.org/51474 Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-on: https://gerrit.libreoffice.org/57705 Tested-by: Mike Kaganski Reviewed-by: Jan Holesovsky diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index ec08134ef2eb..3e311a3c8975 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -2679,10 +2679,10 @@ void BorderDistancesToWord(const SvxBoxItem& rBox, const WordPageMargins& rMargi const SvxBorderLine* pLnR = rBox.GetLine(SvxBoxItemLine::RIGHT); // We need to take border widths into account -const long nWidthT = pLnT ? pLnT->GetWidth() : 0; -const long nWidthL = pLnL ? pLnL->GetWidth() : 0; -const long nWidthB = pLnB ? pLnB->GetWidth() : 0; -const long nWidthR = pLnR ? pLnR->GetWidth() : 0; +const long nWidthT = pLnT ? pLnT->GetScaledWidth() : 0; +const long nWidthL = pLnL ? pLnL->GetScaledWidth() : 0; +const long nWidthB = pLnB ? pLnB->GetScaledWidth() : 0; +const long nWidthR = pLnR ? pLnR->GetScaledWidth() : 0; // Resulting distances from text to borders const sal_Int32 nT2BT = pLnT ? nT : 0; diff --git a/sw/qa/extras/ooxmlexport/data/tdf112118.docx b/sw/qa/extras/ooxmlexport/data/tdf112118.docx index dc3e14ae82c7..3ddb06839492 100644 Binary files a/sw/qa/extras/ooxmlexport/data/tdf112118.docx and b/sw/qa/extras/ooxmlexport/data/tdf112118.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index fae9b0cbeff2..a00d8f4f546d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -256,33 +256,63 @@ DECLARE_OOXMLEXPORT_TEST(testTdf116801, "tdf116801.docx") DECLARE_OOXMLEXPORT_TEST(testTdf112118_DOCX, "tdf112118.docx") { +// The resulting left margin width (2081) differs from its DOC counterpart from ww8export2.cxx, +// because DOCX import does two conversions between mm/100 and twips on the route, loosing one +// twip on the road and arriving with a value that is 2 mm/100 less. I don't see an obvious way +// to avoid that. +struct { +const char* styleName; +struct { +const char* sideName; +sal_Int32 nMargin; +sal_Int32 nBorderDistance; +sal_Int32 nBorderWidth; +} sideParams[4]; +} styleParams[] = { // Margin (MS-style), border distance, border width +{ +"Standard", +{ +{ "Top", 496, 847, 159 },// 851 twip, 24 pt (from text), 4.5 pt +{ "Left", 2081, 706, 212 }, // 1701 twip, 20 pt (from text), 6.0 pt +{ "Bottom", 1401, 564, 35 }, // 1134 twip, 16 pt (from text), 1.0 pt +{ "Right", 3471, 423, 106 } // 2268 twip, 12 pt (from text), 3.0 pt +} +}, +{ +"Converted1", +{ +{ "Top", 847, 496, 159 },// 851 twip, 24 pt (from edge), 4.5 pt +{ "Left", 706, 2081, 212 }, // 1701 twip, 20 pt (from edge), 6.0 pt +{ "Bottom", 564, 1401, 35 }, // 1134 twip, 16 pt (from edge), 1.0 pt +{ "Right", 423, 3471, 106 } // 2268 twip, 12 pt (from edge), 3.0 pt +} +} +}; auto xStyles = getStyles("PageStyles"); -auto testProc = [&](const OUString& sStyleName, sal_Int32 nMargin, sal_Int32
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - editeng/source include/editeng sw/qa sw/source writerfilter/source
editeng/source/items/frmitems.cxx| 125 + include/editeng/boxitem.hxx | 30 ++ sw/qa/extras/ooxmlexport/data/tdf112118.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx |2 sw/qa/extras/ww8export/data/tdf112118.doc|binary sw/qa/extras/ww8export/ww8export2.cxx| 31 ++ sw/source/filter/ww8/docxattributeoutput.cxx | 131 +++ sw/source/filter/ww8/docxattributeoutput.hxx | 21 sw/source/filter/ww8/wrtw8sty.cxx|4 sw/source/filter/ww8/ww8atr.cxx | 40 +--- sw/source/filter/ww8/ww8attributeoutput.hxx |6 + sw/source/filter/ww8/ww8par6.cxx | 81 writerfilter/source/dmapper/PropertyMap.cxx | 34 +-- 13 files changed, 272 insertions(+), 233 deletions(-) New commits: commit ed6bcf7185cd2a650f304a065aa60114ac2d3fb7 Author: Mike Kaganski AuthorDate: Thu Mar 15 20:48:53 2018 +0300 Commit: Jan Holesovsky CommitDate: Fri Jul 20 12:13:51 2018 +0200 tdf#112118: DOC: properly import/export border distance DOCX part was done in fb959e581c900b392efd0bb329b7cf30c8ed56a5. This commit fixes DOC part. Line width wasn't taken into account on import; and export was done only with "from text" distance, which gave poor interoperability with Word, where the borders were close to page edge. The common code is moved to editeng/source/items/frmitems.cxx and include/editeng/boxitem.hxx. Change-Id: I3d1d1312cb9dc9a9e00d9847ec11234cd787df60 Reviewed-on: https://gerrit.libreoffice.org/51366 Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-on: https://gerrit.libreoffice.org/57704 Tested-by: Mike Kaganski Reviewed-by: Jan Holesovsky diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index bb61ccaccc86..ec08134ef2eb 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -2610,6 +2610,131 @@ bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) return true; } + +namespace editeng +{ + +void BorderDistanceFromWord(bool bFromEdge, sal_Int32& nMargin, sal_Int32& nBorderDistance, +sal_Int32 nBorderWidth) +{ +// See https://wiki.openoffice.org/wiki/Writer/MSInteroperability/PageBorder + +sal_Int32 nNewMargin = nMargin; +sal_Int32 nNewBorderDistance = nBorderDistance; + +if (bFromEdge) +{ +nNewMargin = nBorderDistance; +nNewBorderDistance = nMargin - nBorderDistance - nBorderWidth; +} +else +{ +nNewMargin -= nBorderDistance + nBorderWidth; +} + +// Ensure correct distance from page edge to text in cases not supported by us: +// when border is outside entire page area (!bFromEdge && BorderDistance > Margin), +// and when border is inside page body area (bFromEdge && BorderDistance > Margin) +if (nNewMargin < 0) +{ +nNewMargin = 0; +nNewBorderDistance = std::max(nMargin - nBorderWidth, 0); +} +else if (nNewBorderDistance < 0) +{ +nNewMargin = std::max(nMargin - nBorderWidth, 0); +nNewBorderDistance = 0; +} + +nMargin = nNewMargin; +nBorderDistance = nNewBorderDistance; +} + +// Heuristics to decide if we need to use "from edge" offset of borders +// +// There are two cases when we can safely use "from text" or "from edge" offset without distorting +// border position (modulo rounding errors): +// 1. When distance of all borders from text is no greater than 31 pt, we use "from text" +// 2. Otherwise, if distance of all borders from edge is no greater than 31 pt, we use "from edge" +// In all other cases, the position of borders would be distirted on export, because Word doesn't +// support the offset of >31 pts (https://msdn.microsoft.com/en-us/library/ff533820), and we need +// to decide which type of offset would provide less wrong result (i.e., the result would look +// closer to original). Here, we just check sum of distances from text to borders, and if it is +// less than sum of distances from borders to edges. The alternative would be to compare total areas +// between text-and-borders and between borders-and-edges (taking into account different lengths of +// borders, and visual impact of that). +void BorderDistancesToWord(const SvxBoxItem& rBox, const WordPageMargins& rMargins, +WordBorderDistances& rDistances) +{ +// Use signed sal_Int32 that can hold sal_uInt16, to prevent overflow at substraction below +const sal_Int32 nT = rBox.GetDistance(SvxBoxItemLine::TOP); +const sal_Int32 nL = rBox.GetDistance(SvxBoxItemLine::LEFT); +const sal_Int32 nB = rBox.GetDistance(SvxBoxItemLine::BOTTOM); +const sal_Int32 nR = rBox.GetDistance(SvxBoxItemLine::RIGHT); + +// Only take into account existing borders +const SvxBorderLine* pLnT = rBox.GetLine(SvxBoxItemLine::TOP); +
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - editeng/source include/vcl sc/source
editeng/source/editeng/impedit2.cxx | 12 ++ include/vcl/ITiledRenderable.hxx|2 sc/source/core/data/global.cxx |6 - sc/source/ui/view/gridwin.cxx | 153 +++- 4 files changed, 96 insertions(+), 77 deletions(-) New commits: commit d37cbe0254ae64b7de303ff186045ec7b2dbc2f5 Author: Marco Cecchetti Date: Fri May 11 22:33:00 2018 +0200 lok: sc: ctrl-clicking links doesn't work I think there is no reason for not execuring the code below if ((bDouble || bIsTiledRendering) && ) { ... } for both desktop and online. So since the code for open the clicked URL is below such if clause, I changed the code so that we return only when it's really a double click event. Moreover I reverted back the code for executing the list validation pop-up to its original place, since there is no more the need to have it executed in two places. Change-Id: Idbec2e6e45cd7ee8282005169e1132a11d4cac33 Reviewed-on: https://gerrit.libreoffice.org/54150 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index d66bf4e6e973..67fa9f3e0fed 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -595,7 +595,17 @@ bool ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView ) { if ( ( rMEvt.GetClicks() == 1 ) && rMEvt.IsLeft() && !rMEvt.IsMod2() ) { -const SvxFieldItem* pFld = pView->GetFieldUnderMousePointer(); + +const SvxFieldItem* pFld; +if ( comphelper::LibreOfficeKit::isActive() ) +{ +Point aLogicClick = pView->GetWindow()->PixelToLogic( rMEvt.GetPosPixel() ); +pFld = pView->GetField( aLogicClick ); +} +else +{ +pFld = pView->GetFieldUnderMousePointer(); +} if ( pFld ) { EditPaM aPaM( aCurSel.Max() ); diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx index 46ad7677e910..7f8f7ce4c332 100644 --- a/include/vcl/ITiledRenderable.hxx +++ b/include/vcl/ITiledRenderable.hxx @@ -59,7 +59,7 @@ namespace vcl { PointerStyle::HSizeBar, "col-resize" }, { PointerStyle::VSizeBar, "row-resize" }, { PointerStyle::Hand, "grab" }, -{ PointerStyle::RefHand, "grabbing" }, +{ PointerStyle::RefHand, "pointer" }, // Pen, Magnify, Fill, Rotate // HShear, VShear // Mirror, Crook, Crop, MovePoint, MoveBezierWeight diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 83c95286c0fa..4febc35ff02c 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -789,12 +789,6 @@ bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1, void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget) { -if (comphelper::LibreOfficeKit::isActive()) -{ -if(SfxViewShell* pViewShell = SfxViewShell::Current()) - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr()); -} - // OpenURL is always called in the GridWindow by mouse clicks in some way or another. // That's why pScActiveViewShell and nScClickMouseModifier are correct. // SvtSecurityOptions to access Libreoffice global security parameters diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 23a6144b66da..6040d41e9ba0 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1794,56 +1794,6 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta } } -void lcl_executeList( ScViewData* pViewData, ScModule* pScMod, ScMarkData& rMark ) -{ -pViewData->GetView()->SelectionChanged(); - -SfxDispatcher* pDisp = pViewData->GetViewShell()->GetDispatcher(); -bool bFormulaMode = pScMod->IsFormulaMode(); -OSL_ENSURE( pDisp || bFormulaMode, "Cursor moved on inactive View ?" ); - -// #i14927# execute SID_CURRENTCELL (for macro recording) only if there is no -// multiple selection, so the argument string completely describes the selection, -// and executing the slot won't change the existing selection (executing the slot -// here and from a recorded macro is treated equally) -if ( pDisp && !bFormulaMode && !rMark.IsMultiMarked() ) -{ -OUString aAddr; // CurrentCell -if( rMark.IsMarked() ) -{ -ScRange aScRange; -rMark.GetMarkArea( aScRange ); -aAddr = aScRange.Format(ScRefFlags::RANGE_ABS); -if ( aScRange.aStart == aScRange.aEnd ) -{ -// make sure there is a range selection string even for a single cell -aAddr = aAddr + ":" + aAddr; -}
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - editeng/source
editeng/source/editeng/editview.cxx |4 1 file changed, 4 insertions(+) New commits: commit 53b501ef0ed642d11de5a69821662661447eefd2 Author: Tamás ZolnaiDate: Mon Apr 16 14:38:36 2018 +0200 sd lok: Impress: Right-click menu on misspelled word locks up session Change-Id: Ib554eea7049c1ea244bc4789ee3d7d2adf87e283 Reviewed-on: https://gerrit.libreoffice.org/52991 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index eca6a6098365..c5e1d17af0b4 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -66,6 +66,7 @@ #include #include #include +#include #include @@ -1025,6 +1026,9 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, LinkpEditEngine->pImpEditEngine->CreateEPaM(aPaM); EPaM aP2 = pImpEditView->pEditEngine->pImpEditEngine->CreateEPaM(aPaM2); + +if (comphelper::LibreOfficeKit::isActive()) +aPopupMenu->SetLOKNotifier(SfxViewShell::Current()); sal_uInt16 nId = aPopupMenu->Execute(pImpEditView->GetWindow(), aTempRect, PopupMenuFlags::NoMouseUpClose); aPaM2 = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP2); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits