core.git: slideshow/source
slideshow/source/engine/shapes/drawshape.cxx | 62 + slideshow/source/engine/shapes/drawshape.hxx | 37 +++ slideshow/source/engine/shapes/gdimtftools.cxx | 248 --- slideshow/source/engine/shapes/gdimtftools.hxx | 24 ++ slideshow/source/engine/shapes/shapeimporter.cxx |7 5 files changed, 251 insertions(+), 127 deletions(-) New commits: commit 89998a744f9ee8efa40c0e1cb7bdbc783d3414fa Author: Attila Szűcs AuthorDate: Thu Apr 25 01:43:05 2024 +0200 Commit: Caolán McNamara CommitDate: Thu Apr 25 14:05:13 2024 +0200 tdf#153162 Animation load optimization Loading a big GIF animation can freeze LO for a long time, so: changed getAnimationFromGraphic, it can load parts of a big animation. It can be called several times to load the whole animation. Now it can load animation while it is playing. It may still load smaller animations at once before it is rendered. At first it load frames that sum maximum 5 million pixels. (But minimum 10 frame.) Changed the Graphic parameter to shared_ptr, so it won’t be deleted until the whole animation is loaded. Change-Id: I5ac16d7ee4883dbaefb604cd07757d19e5aa2939 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166608 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx index 185b76cc23d3..de89822dac58 100644 --- a/slideshow/source/engine/shapes/drawshape.cxx +++ b/slideshow/source/engine/shapes/drawshape.cxx @@ -343,6 +343,7 @@ namespace slideshow::internal mxPage( xContainingPage ), maAnimationFrames(), // empty, we don't have no intrinsic animation mnCurrFrame(0), +mpGraphicLoader(), mpCurrMtf(), mnCurrMtfLoadFlags( bForeignSource ? MTF_LOAD_FOREIGN_SOURCE : MTF_LOAD_NONE ), @@ -418,12 +419,13 @@ namespace slideshow::internal DrawShape::DrawShape( const uno::Reference< drawing::XShape >& xShape, uno::Reference< drawing::XDrawPage > xContainingPage, double nPrio, - const Graphic& rGraphic, + std::shared_ptr pGraphic, const SlideShowContext& rContext ) : mxShape( xShape ), mxPage(std::move( xContainingPage )), maAnimationFrames(), mnCurrFrame(0), +mpGraphicLoader(), mpCurrMtf(), mnCurrMtfLoadFlags( MTF_LOAD_NONE ), maCurrentShapeUnitBounds(), @@ -450,12 +452,25 @@ namespace slideshow::internal mbDrawingLayerAnim( false ), mbContainsPageField( false ) { -ENSURE_OR_THROW( rGraphic.IsAnimated(), +ENSURE_OR_THROW( pGraphic->IsAnimated(), "DrawShape::DrawShape(): Graphic is no animation" ); -getAnimationFromGraphic( maAnimationFrames, - mnAnimationLoopCount, - rGraphic ); +::Animation aAnimation(pGraphic->GetAnimation()); +const Size aAnimSize(aAnimation.GetDisplaySizePixel()); +tools::Long nBitmapPixels = aAnimSize.getWidth() * aAnimSize.getHeight(); + +tools::Long nFramesToLoad = aAnimation.Count(); + +// if the Animation is bigger then 5 million pixels, we do not load the +// whole animation now. +if (nBitmapPixels * aAnimation.Count() > 500) +{ +nFramesToLoad = 500 / nBitmapPixels; +if (nFramesToLoad < 10) +nFramesToLoad = 10; +} +mpGraphicLoader = ::std::make_unique(pGraphic); +getSomeAnimationFramesFromGraphic(nFramesToLoad); ENSURE_OR_THROW( !maAnimationFrames.empty() && maAnimationFrames.front().mpMtf, @@ -475,6 +490,7 @@ namespace slideshow::internal maAnimationFrames(), // don't copy animations for subsets, // only the current frame! mnCurrFrame(0), +mpGraphicLoader(), mpCurrMtf( rSrc.mpCurrMtf ), mnCurrMtfLoadFlags( rSrc.mnCurrMtfLoadFlags ), maCurrentShapeUnitBounds(), @@ -550,13 +566,13 @@ namespace slideshow::internal const uno::Reference< drawing::XShape >&xShape, const uno::Reference< drawing::XDrawPage >& xContainingPage, double nPrio, -const Graphic& rGraphic, +
core.git: vcl/source
vcl/source/filter/igif/gifread.cxx | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) New commits: commit 110eb4f6f8ed43faf7d2a4e74bfdcb93934f6439 Author: Attila Szűcs AuthorDate: Mon Mar 25 01:04:14 2024 +0100 Commit: Caolán McNamara CommitDate: Thu Mar 28 10:19:23 2024 +0100 tdf#153162 Gif load transparency optimization Converting a bitmap from transparency to alpha can be very slow. fortunately it can be avoided. Inverted the transparency colors (cTransIndex1, cNonTransIndex1) that are used to create aBmp1 in GIFReader::FillImages. It create the transparency bitmap inverted, so no need to invert it. Change-Id: I14714fe4b8bbcd7849db57b2824a7077dda40f81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165261 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Caolán McNamara diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index 8f56edaee77f..cfb4e84f2363 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -220,18 +220,22 @@ void GIFReader::CreateBitmaps(tools::Long nWidth, tools::Long nHeight, BitmapPal if (bGCTransparent) { const Color aWhite(COL_WHITE); +const Color aBlack(COL_BLACK); aBmp1 = Bitmap(aSize, vcl::PixelFormat::N8_BPP, ::GetGreyPalette(256)); if (!aAnimation.Count()) -aBmp1.Erase(aWhite); +aBmp1.Erase(aBlack); pAcc1 = aBmp1; if (pAcc1) { -cTransIndex1 = static_cast(pAcc1->GetBestPaletteIndex(aWhite)); -cNonTransIndex1 = cTransIndex1 ? 0 : 1; +// We have to make an AlphaMask from it, that needs to be inverted from transparency. +// It is faster to invert it here. +// So Non-Transparent color should be 0xff , and Transparent should be 0. +cNonTransIndex1 = static_cast(pAcc1->GetBestPaletteIndex(aWhite)); +cTransIndex1 = static_cast(pAcc1->GetBestPaletteIndex(aBlack)); } else { @@ -671,7 +675,8 @@ void GIFReader::CreateNewBitmaps() { pAcc1.reset(); AlphaMask aAlphaMask(aBmp1); -aAlphaMask.Invert(); // convert from transparency to alpha +// No need to convert from transparency to alpha +// aBmp1 is already inverted aAnimationFrame.maBitmapEx = BitmapEx( aBmp8, aAlphaMask ); } else
core.git: svx/inc svx/source
svx/inc/sdr/primitive2d/sdrgrafprimitive2d.hxx|4 ++- svx/source/sdr/contact/viewcontactofgraphic.cxx |3 +- svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx | 24 ++ 3 files changed, 25 insertions(+), 6 deletions(-) New commits: commit d323976fd6d560a9b91da3e7833dfbe9f6b78f39 Author: Attila Szűcs AuthorDate: Thu Mar 21 01:57:59 2024 +0100 Commit: Attila Szűcs CommitDate: Fri Mar 22 15:25:23 2024 +0100 tdf#159258 SD: SS: disable placeholdertext in image Changed the text creation to use ExclusiveEditViewPrimitive2D in case we are in a placeholder image. Had to make a flag to send the information if we are in a placeholderimage.. because this function also called on other primitives. Unfortunatelly we cannot do it in CreateObjectSpecificViewObjectContact as in case of the icon... because the Primitive2DContainer that will (later) contain the text will also contain the rectangle as well, and we want to display the rectange. Follow-up to commit I307f4b0fe7f8faf98789787f216cac7be86a0515 "Provide tooling for EditView exclusive Primitives". Change-Id: If24aaa330c7b0b6dbaa72c9900774959ef24da4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165087 Tested-by: Jenkins Reviewed-by: Attila Szűcs diff --git a/svx/inc/sdr/primitive2d/sdrgrafprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrgrafprimitive2d.hxx index 91f1d9d2d4d8..3e19d5b6dce8 100644 --- a/svx/inc/sdr/primitive2d/sdrgrafprimitive2d.hxx +++ b/svx/inc/sdr/primitive2d/sdrgrafprimitive2d.hxx @@ -33,6 +33,7 @@ private: attribute::SdrLineFillEffectsTextAttribute maSdrLFSTAttribute; GraphicObject maGraphicObject; GraphicAttr maGraphicAttr; +bool mbPlaceholderImage = false; // local decomposition. virtual Primitive2DReference @@ -41,7 +42,8 @@ private: public: SdrGrafPrimitive2D(::basegfx::B2DHomMatrix aTransform, const attribute::SdrLineFillEffectsTextAttribute& rSdrLFSTAttribute, - const GraphicObject& rGraphicObject, const GraphicAttr& rGraphicAttr); + const GraphicObject& rGraphicObject, const GraphicAttr& rGraphicAttr, + bool bPlaceholderImage = false); // data access const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; } diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index f3a18d8e6462..b9f7755b5a03 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -84,7 +84,8 @@ namespace sdr::contact rObjectMatrix, rAttribute, aEmptyGraphicObject, -aEmptyGraphicAttr)); +aEmptyGraphicAttr, +true)); xRetval = drawinglayer::primitive2d::Primitive2DContainer { xReferenceA }; // SdrGrafPrimitive2D with content (which is the preview graphic) scaled to smaller size and diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx index ff91bc67462d..dadc8d06326e 100644 --- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -103,9 +104,22 @@ Primitive2DReference SdrGrafPrimitive2D::create2DDecomposition( // add text if (!getSdrLFSTAttribute().getText().isDefault()) { - aRetval.push_back(createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), - getSdrLFSTAttribute().getText(), - getSdrLFSTAttribute().getLine(), false, false)); +const drawinglayer::primitive2d::Primitive2DReference xReferenceA = createTextPrimitive( +basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), getSdrLFSTAttribute().getText(), +getSdrLFSTAttribute().getLine(), false, false); + +if (!mbPlaceholderImage) +{ +aRetval.push_back(xReferenceA); +} +else +{ +const drawinglayer::primitive2d::Primitive2DReference aEmbedded( +new drawinglayer::primitive2d::ExclusiveEditViewPrimitive2D( +drawinglayer::primitive2d::Primitive2DContainer{ xReferenceA })); + +aRetval.push_back(aEmbedded); +} } // tdf#132199: put glow before shadow, to have shadow of the glow, not the opposite @@ -128,11 +142,13 @@ Primitive2DReference SdrGrafPrimitive2D::create2DDecomposition( SdrGrafPrimitive2D::SdrGrafPrimitive2D( basegfx::B2DHomMatrix aTransform, const attribute::SdrLineFillEffectsTextAttribute& rSdrLFSTAttribute, -const GraphicObject& rGraphicObject, const
core.git: oox/source
oox/source/drawingml/shape.cxx | 41 + 1 file changed, 41 insertions(+) New commits: commit 0079f0e77e74a355d57b24d3a6b6d1a29f45eb79 Author: Attila Szűcs AuthorDate: Mon Feb 26 10:04:23 2024 +0100 Commit: Attila Szűcs CommitDate: Tue Feb 27 09:51:43 2024 +0100 tdf#67347 pptx import: stacked + horz/vert aligment In case of Stacked, PP calculates in the vertical direction with the horizontal alignment. We simulate it by setting TextVerticalAdjust at import time (from PPTX) based on the ParagraphAdjust of the 1. paragraph It is not perfect, because we have 1 TextVerticalAdjust / 1 shape, and it does not support justified, while we can have many ParagraphAdjust / 1 shape (if the shape have more paragraphs) For a better solution we should re-implement the entire stacked thing, but that is a much bigger task. Change-Id: I4011be0f118b870ab7f9e2ddc15c6dc5a21f8a89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163934 Reviewed-by: Caolán McNamara Tested-by: Jenkins Reviewed-by: Attila Szűcs diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 8f3aedf3488a..d9a3f8b8db59 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -90,6 +90,7 @@ #include #include #include +#include #include #include @@ -1354,6 +1355,46 @@ Reference< XShape > const & Shape::createAndInsert( // add properties from textbody to shape properties if( mpTextBody ) { +// tdf#67347: In case of Stacked, PP calculates in the vertical direction with the +// horizontal alignment. +// In LO, we simulate it by setting TextVerticalAdjust based on the ParagraphAdjust +// of the 1. paragraph +// It is not perfect, because we have 1 TextVerticalAdjust / 1 shape, and it +// does not support justified, while we can have many ParagraphAdjust / 1 shape +// (if the shape have more paragraphs) +if (mpTextBody->getTextProperties().maPropertyMap.hasProperty(PROP_WritingMode) +&& mpTextBody->getTextProperties().maPropertyMap.getProperty(PROP_WritingMode) + == uno::Any(text::WritingMode2::STACKED) +&& mpTextBody->getParagraphs().size() > 0 +&& aServiceName != "com.sun.star.drawing.GroupShape") +{ +std::optional& oParaAdjust += mpTextBody->getParagraphs()[0]->getProperties().getParaAdjust(); + +if (oParaAdjust) +{ +switch (*oParaAdjust) +{ +case ParagraphAdjust::ParagraphAdjust_LEFT: +mpTextBody->getTextProperties().meVA += TextVerticalAdjust::TextVerticalAdjust_TOP; +break; +case ParagraphAdjust::ParagraphAdjust_CENTER: +mpTextBody->getTextProperties().meVA += TextVerticalAdjust::TextVerticalAdjust_CENTER; +break; +case ParagraphAdjust::ParagraphAdjust_RIGHT: +mpTextBody->getTextProperties().meVA += TextVerticalAdjust::TextVerticalAdjust_BOTTOM; +break; +default: +break; +} +mpTextBody->getTextProperties().maPropertyMap.setProperty( +PROP_TextVerticalAdjust, mpTextBody->getTextProperties().meVA); +} +} + mpTextBody->getTextProperties().pushTextDistances(Size(aShapeRectHmm.Width, aShapeRectHmm.Height)); aShapeProps.assignUsed( mpTextBody->getTextProperties().maPropertyMap ); // Push char properties as well - specifically useful when this is a placeholder
core.git: editeng/source include/editeng
editeng/source/editeng/editstt2.hxx |4 +++- editeng/source/editeng/impedit3.cxx |6 +++--- include/editeng/editstat.hxx|5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) New commits: commit 57ac7b73e898cf8889819d7f3beb3608e61b179b Author: Attila Szűcs AuthorDate: Wed Feb 21 10:57:14 2024 +0100 Commit: Caolán McNamara CommitDate: Wed Feb 21 15:13:32 2024 +0100 tdf#67347 fix regression stacked text in calc Added a new element (STACKED) to EEControlBits. It would be better to use only ONECHARPERLINE, but calc and impress used it from different places, and couldn't recognise each other, so they may overwrite each other. With this fix they both set a separate flag, and editeng check if any of the flags are set. regression was made by: I535da45e3a2f2d1550bad2a40e9909e0d561d0ef Change-Id: I60496059f3ce2773b232970bf2c3b7264ce64c5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163682 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/editeng/source/editeng/editstt2.hxx b/editeng/source/editeng/editstt2.hxx index 334622b23495..09e7f02e1831 100644 --- a/editeng/source/editeng/editstt2.hxx +++ b/editeng/source/editeng/editstt2.hxx @@ -47,7 +47,9 @@ public: { return bool( nControlBits & EEControlBits::UNDOATTRIBS ); } boolOneCharPerLine() const -{ return bool( nControlBits & EEControlBits::ONECHARPERLINE ); } +{ +return bool(nControlBits & (EEControlBits::ONECHARPERLINE | EEControlBits::STACKED)); +} boolIsOutliner() const { return bool( nControlBits & EEControlBits::OUTLINER ); } diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 8bbcebcebf2a..0c8b9bae8223 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -695,13 +695,13 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) return false; } -//If the paragraph SvxFrameDirection is Stacked, use ONECHARPERLINE +//If the paragraph SvxFrameDirection is Stacked, use STACKED const SvxFrameDirectionItem* pFrameDirItem = (nPara, EE_PARA_WRITINGDIR); bool bStacked = pFrameDirItem->GetValue() == SvxFrameDirection::Stacked; if (bStacked) -maStatus.TurnOnFlags(EEControlBits::ONECHARPERLINE); +maStatus.TurnOnFlags(EEControlBits::STACKED); else -maStatus.TurnOffFlags(EEControlBits::ONECHARPERLINE); +maStatus.TurnOffFlags(EEControlBits::STACKED); // Initialization... diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx index 29653d5eec4f..4e839254df1c 100644 --- a/include/editeng/editstat.hxx +++ b/include/editeng/editstat.hxx @@ -32,7 +32,7 @@ enum class EEControlBits PASTESPECIAL = 0x0010, // Allow PasteSpecial AUTOINDENTING = 0x0020, // Automatic indenting UNDOATTRIBS= 0x0040, // Undo for Attributes... -ONECHARPERLINE = 0x0080, // One character per line +ONECHARPERLINE = 0x0080, // One character per line (used in calc) NOCOLORS = 0x0100, // Engine: No Color OUTLINER = 0x0200, // Special treatment Outliner/Outline mode OUTLINER2 = 0x0400, // Special treatment Outliner/Page @@ -51,10 +51,11 @@ enum class EEControlBits FORMAT100 = 0x0100, // Always format to 100% ULSPACESUMMATION = 0x0200, // MS Compat: sum SA and SB, not maximum value SINGLELINE = 0x0400, // One line for all text +STACKED= 0x0800, // Same as ONECHARPERLINE (used in impress) }; namespace o3tl { -template<> struct typed_flags : is_typed_flags {}; +template<> struct typed_flags : is_typed_flags {}; } enum class EVControlBits
core.git: editeng/source include/editeng
editeng/source/editeng/impedit3.cxx |4 ++-- editeng/source/items/svxfont.cxx|4 ++-- include/editeng/svxfont.hxx |2 +- 3 files changed, 5 insertions(+), 5 deletions(-) New commits: commit 684d63e133fddeca68055a83d85f75bd73319d39 Author: Attila Szűcs AuthorDate: Tue Feb 20 03:19:09 2024 +0100 Commit: Caolán McNamara CommitDate: Tue Feb 20 18:38:00 2024 +0100 tdf#67347 fix stacked text kern problems Disabled some kerning calculations in case of stacked text. Without this: -x position of characters was strange, and the last characters was different. -thin characters, like 'j', 'i', ' ', ... could result issues at editing the text. (if width of character + kern was < 0) Change-Id: I40a23ef445fc9683a1cfd619ea23f1536c525d1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163608 Tested-by: Jenkins Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index b54e1328a0ac..8bbcebcebf2a 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -1249,14 +1249,14 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) if (bContinueLastPortion) { - Size aSize = aTmpFont.QuickGetTextSize( GetRefDevice(), rParaPortion.GetNode()->GetString(), nTmpPos, nPortionLen, ); + Size aSize = aTmpFont.QuickGetTextSize( GetRefDevice(), rParaPortion.GetNode()->GetString(), nTmpPos, nPortionLen, , bStacked); pPortion->adjustSize(aSize.Width(), 0); if (pPortion->GetSize().Height() < aSize.Height()) pPortion->setHeight(aSize.Height()); } else { -Size aSize = aTmpFont.QuickGetTextSize(GetRefDevice(), rParaPortion.GetNode()->GetString(), nTmpPos, nPortionLen, ); +Size aSize = aTmpFont.QuickGetTextSize(GetRefDevice(), rParaPortion.GetNode()->GetString(), nTmpPos, nPortionLen, , bStacked); pPortion->SetSize(aSize); } diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx index 876bc06868f8..a4367de4680e 100644 --- a/editeng/source/items/svxfont.cxx +++ b/editeng/source/items/svxfont.cxx @@ -442,7 +442,7 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut ) } Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const OUString , - const sal_Int32 nIdx, const sal_Int32 nLen, KernArray* pDXArray ) const + const sal_Int32 nIdx, const sal_Int32 nLen, KernArray* pDXArray, bool bStacked ) const { if ( !IsCaseMap() && !IsFixKerning() ) { @@ -477,7 +477,7 @@ Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const OUString , } SAL_INFO( "editeng.quicktextsize", "SvxFont::QuickGetTextSize after GetTextArray(): Text length: " << nLen << " Text size: " << aTxtSize.Width() << "x" << aTxtSize.Height()); -if( IsFixKerning() && ( nLen > 1 ) ) +if( IsFixKerning() && ( nLen > 1 ) && !bStacked) { auto nKern = GetFixKerning(); tools::Long nOldValue = (*pDXArray)[0]; diff --git a/include/editeng/svxfont.hxx b/include/editeng/svxfont.hxx index a86e2097f80a..126b56f8f65f 100644 --- a/include/editeng/svxfont.hxx +++ b/include/editeng/svxfont.hxx @@ -101,7 +101,7 @@ public: Size QuickGetTextSize( const OutputDevice *pOut, const OUString , const sal_Int32 nIdx, const sal_Int32 nLen, - KernArray* pDXArray = nullptr ) const; + KernArray* pDXArray = nullptr, bool bStacked = false ) const; void DrawPrev( OutputDevice* pOut, Printer* pPrinter, const Point , const OUString ,
core.git: editeng/inc editeng/qa editeng/source
editeng/inc/EditLine.hxx|3 editeng/qa/unit/core-test.cxx | 60 ++ editeng/source/editeng/EditLine.cxx |1 editeng/source/editeng/impedit3.cxx | 147 ++-- 4 files changed, 172 insertions(+), 39 deletions(-) New commits: commit 9ed6d80622174826f8b7413529320ccd94782296 Author: Attila Szűcs AuthorDate: Wed Jan 24 12:03:28 2024 +0100 Commit: Caolán McNamara CommitDate: Fri Feb 16 18:10:51 2024 +0100 tdf#154248 sd: change multiline field wrapping Modified ImpEditEngine::CreateLines and ImpEditEngine::Paint to wrap multiline fields (hyperlinks) to wrap better: Multiline hyperlinks can start/end in the middle of a line. like this: text hyperlink-start hyperlink-line2. hyperlink-end text Start of the lines of the multiline hyperlinks now follow the line start (for example if the 1. line has a bullet/indent, and the 2. line does not then the multiline hyperlink 2. line will start where normal 2. line would start) Changed the way how fields wrapped while editing.. (we didn't split fields into lines, when its textbox is edited, but now we do) This way it is more a WYSIWYG editor. (when we edit, we see what we will get) Changed the constant reference rLine to non-constant pointer pLine, because this hack change the actual line to the next line at the end of a muliline hyperlink, so the algotithm will continue calculating with the next line, as if it would be still the previous line. Change-Id: I2c67f4ae1b86ee9c73f01ae0c045f02e56a09c1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162503 Tested-by: Jenkins Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/editeng/inc/EditLine.hxx b/editeng/inc/EditLine.hxx index 165f3fcf0a59..7d4a43e0e639 100644 --- a/editeng/inc/EditLine.hxx +++ b/editeng/inc/EditLine.hxx @@ -35,6 +35,7 @@ private: std::vector aKashidaPositions; sal_Int32 nTxtWidth = 0; sal_Int32 nStartPosX = 0; +sal_Int32 nNextLinePosXDiff = 0; sal_Int32 nStart = 0; // could be replaced by nStartPortion sal_Int32 nEnd = 0; // could be replaced by nEndPortion sal_Int32 nStartPortion = 0; @@ -97,6 +98,8 @@ public: sal_Int32 GetStartPosX() const { return nStartPosX; } void SetStartPosX(sal_Int32 start); +sal_Int32 GetNextLinePosXDiff() const { return nNextLinePosXDiff; } +void SetNextLinePosXDiff(sal_Int32 diff) { nNextLinePosXDiff = diff; } Size CalcTextSize(ParaPortion& rParaPortion); bool IsInvalid() const { return bInvalid; } diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index 59f5c0ac7839..177310dd6b82 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -122,6 +122,7 @@ public: void testSingleLine(); void testMoveParagraph(); void testCreateLines(); +void testTdf154248MultilineFieldWrapping(); DECL_STATIC_LINK( Test, CalcFieldValueHdl, EditFieldInfo*, void ); @@ -152,6 +153,7 @@ public: CPPUNIT_TEST(testSingleLine); CPPUNIT_TEST(testMoveParagraph); CPPUNIT_TEST(testCreateLines); +CPPUNIT_TEST(testTdf154248MultilineFieldWrapping); CPPUNIT_TEST_SUITE_END(); private: @@ -2238,6 +2240,64 @@ void Test::testCreateLines() // CPPUNIT_ASSERT_MESSAGE("INTENTIONALLY FALSE", false); } +void Test::testTdf154248MultilineFieldWrapping() +{ +// If field wrapping changes, this test may need to be updated + +// Create Outliner instance +Outliner aOutliner(mpItemPool.get(), OutlinerMode::TextObject); +aOutliner.SetCalcFieldValueHdl(LINK(nullptr, Test, CalcFieldValueHdl)); + +// Create EditEngine's instance +EditEngine& aEditEngine = const_cast(aOutliner.GetEditEngine()); +aEditEngine.SetPaperSize(Size(2000, 2000)); +aEditEngine.SetText("ABC DEF ABC DEFGH"); +// Positions Ref *4 + +// Get Field Item for inserting URLs in text +SvxURLField aURLField("http://not.a.real.link;, + "Really long hyperlink text that wont fit in 1 line, no matter what.", + SvxURLFormat::Repr); +SvxFieldItem aField(aURLField, EE_FEATURE_FIELD); + +// Insert URL +EditDoc& rDoc = aEditEngine.GetEditDoc(); +ContentNode* pNode = rDoc.GetObject(0); +EditSelection aSel(EditPaM(pNode, 4), EditPaM(pNode, 4)); +aEditEngine.InsertField(aSel, aField); + +// Assert Field Count +CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), aEditEngine.GetFieldCount(0)); + +aEditEngine.QuickFormatDoc(false); +CPPUNIT_ASSERT_EQUAL(true, aEditEngine.IsFormatted()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aEditEngine.GetParagraphCount()); +CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aEditEngine.GetLineCount(0)); + +ParaPortionList& rParagraphPortionList = aEditEngine.GetParaPortions(); +EditLineList& rLines =
core.git: 2 commits - download.lst editeng/source include/editeng offapi/com oox/source
download.lst |4 ++-- editeng/source/editeng/impedit3.cxx|9 + editeng/source/items/frmitems.cxx |6 ++ include/editeng/frmdir.hxx |3 +++ offapi/com/sun/star/text/WritingMode2.idl | 10 ++ oox/source/drawingml/textbodypropertiescontext.cxx |7 ++- oox/source/drawingml/textparagraph.cxx | 10 ++ oox/source/export/drawingml.cxx|2 ++ oox/source/shape/WpsContext.cxx| 14 ++ 9 files changed, 58 insertions(+), 7 deletions(-) New commits: commit f846efa507252b0584d2753a251f2dd99c34541a Author: Attila Szűcs AuthorDate: Thu Feb 8 15:46:07 2024 +0100 Commit: Caolán McNamara CommitDate: Fri Feb 16 13:07:18 2024 +0100 tdf#67347 pptx import: stacked text, minimal impl. Display Stacked text, and Import/Export Stacked property from/to pptx. It is a minimal implementation, it does not import/export to .odp, there is no user interface to set this property. Multiline Stacked text is rendered as 1 line text. XML_wordArtVertRtl is mapped to XML_wordArtVert. Editing of text containing space character seems to not work correctly. Change-Id: I535da45e3a2f2d1550bad2a40e9909e0d561d0ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163121 Tested-by: Jenkins Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 51c922ce0b3f..54a7745eca7a 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -694,6 +695,14 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) return false; } +//If the paragraph SvxFrameDirection is Stacked, use ONECHARPERLINE +const SvxFrameDirectionItem* pFrameDirItem = (nPara, EE_PARA_WRITINGDIR); +bool bStacked = pFrameDirItem->GetValue() == SvxFrameDirection::Stacked; +if (bStacked) +maStatus.TurnOnFlags(EEControlBits::ONECHARPERLINE); +else +maStatus.TurnOffFlags(EEControlBits::ONECHARPERLINE); + // Initialization... // Always format for 100%: diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index e84ae2140e33..fa393ff4ccd8 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -4675,6 +4675,9 @@ bool SvxFrameDirectionItem::PutValue( const css::uno::Any& rVal, case text::WritingMode2::PAGE: SetValue( SvxFrameDirection::Environment ); break; +case text::WritingMode2::STACKED: +SetValue(SvxFrameDirection::Stacked); +break; default: bRet = false; break; @@ -4714,6 +4717,9 @@ bool SvxFrameDirectionItem::QueryValue( css::uno::Any& rVal, case SvxFrameDirection::Environment: nVal = text::WritingMode2::PAGE; break; +case SvxFrameDirection::Stacked: +nVal = text::WritingMode2::STACKED; +break; default: OSL_FAIL("Unknown SvxFrameDirection value!"); bRet = false; diff --git a/include/editeng/frmdir.hxx b/include/editeng/frmdir.hxx index 270ab62c626d..94972ebff0b0 100644 --- a/include/editeng/frmdir.hxx +++ b/include/editeng/frmdir.hxx @@ -56,6 +56,9 @@ enum class SvxFrameDirection /** Vertical, from top to bottom, from right to left (vert="vert"). */ Vertical_RL_TB90 = css::text::WritingMode2::TB_RL90, + +/** Stacked, from top to bottom, 1 char per line (vert="wordArtVert"). */ +Stacked = css::text::WritingMode2::STACKED, }; TranslateId getFrmDirResId(size_t nIndex); diff --git a/offapi/com/sun/star/text/WritingMode2.idl b/offapi/com/sun/star/text/WritingMode2.idl index f75108337a69..065912858de5 100644 --- a/offapi/com/sun/star/text/WritingMode2.idl +++ b/offapi/com/sun/star/text/WritingMode2.idl @@ -91,6 +91,16 @@ published constants WritingMode2 @since LibreOffice 7.5 */ const short TB_RL90 = 6; + +/** 'T' text within a line is written top-to-bottom, but characters are +'E' not rotated. +'X' This is like LR_TB where 1 Character fit in every line. +'T' Only 1 line display is implemented. +This corresponds to OOXML attribute vert="wordArtVert" for shapes. + +@since LibreOffice 24.8 +*/ +const short STACKED = 7; }; diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 46576c069c8e..a08ae8fb9f6d 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++
core.git: include/comphelper
include/comphelper/oslfile2streamwrap.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0f4002378d7cbf20ed5f33cbdc4e3c8e01e0338d Author: Attila Szűcs AuthorDate: Wed Feb 14 03:54:05 2024 +0100 Commit: Noel Grandin CommitDate: Wed Feb 14 07:57:24 2024 +0100 fix windows UNLESS_MERGELIBS it was needed to fix a linker error in my system Change-Id: I5eeebf0db569289aace32f61535ae2ba7148de48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163327 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/comphelper/oslfile2streamwrap.hxx b/include/comphelper/oslfile2streamwrap.hxx index 79bd808af452..84122624c8f7 100644 --- a/include/comphelper/oslfile2streamwrap.hxx +++ b/include/comphelper/oslfile2streamwrap.hxx @@ -58,7 +58,7 @@ private: class OSLOutputStreamWrapper final : public ::cppu::WeakImplHelper { public: -UNLESS_MERGELIBS(COMPHELPER_DLLPUBLIC) OSLOutputStreamWrapper(::osl::File& _rFile); +COMPHELPER_DLLPUBLIC OSLOutputStreamWrapper(::osl::File& _rFile); private: virtual ~OSLOutputStreamWrapper() override;
core.git: Branch 'libreoffice-24-2' - oox/qa oox/source
oox/qa/unit/data/tdf134401_ExportAutoGrowToTextWordWrap.odp |binary oox/qa/unit/export.cxx | 17 oox/source/export/drawingml.cxx | 16 +++ 3 files changed, 33 insertions(+) New commits: commit 1c7c0cdb90f703b963ec88180d12324e4b3afa2e Author: Attila Szűcs AuthorDate: Tue Jan 16 04:29:49 2024 +0100 Commit: Andras Timar CommitDate: Fri Jan 19 14:01:36 2024 +0100 tdf#134401 SD: export to pptx: autoGrow->textWordWrap PPTX doesn't have autoGrowWidth and autoGrowHeight, but it does have TextWordWrap which is similar. If autoGrowWidth and autoGrowHeight are set in the document, then they are exported to PPTX as TextWordWrap = "none". Without this patch, PowerPoint may wrap some texts into more lines as Impress does. This is because some text may rendered at sligtly different sizes in PowerPoint as in Impress. (maybe it is just a rounding difference) Even 1% (or less) size difference is enought, because when autoGrowthWidth and autoGrowthHeight is set, then there is a good chance, the textbox rectangle is exactly as big as the text. Change-Id: I2cdba68c66c43507c5007a9e395b87ddeeea2372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162152 Tested-by: Jenkins Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit dc5a761df436f5d9de781d1fa6cf7d010f8be0e8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162210 Reviewed-by: Andras Timar diff --git a/oox/qa/unit/data/tdf134401_ExportAutoGrowToTextWordWrap.odp b/oox/qa/unit/data/tdf134401_ExportAutoGrowToTextWordWrap.odp new file mode 100644 index ..9fcebfe0f448 Binary files /dev/null and b/oox/qa/unit/data/tdf134401_ExportAutoGrowToTextWordWrap.odp differ diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx index 415c5fe8d02f..aa9690efdb4a 100644 --- a/oox/qa/unit/export.cxx +++ b/oox/qa/unit/export.cxx @@ -1345,6 +1345,23 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157289CircularArrowExport) assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo[1]"_ostr, "wR"_ostr, "6750"); assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo[1]"_ostr, "hR"_ostr, "6750"); } + +CPPUNIT_TEST_FIXTURE(Test, testTdf134401_ExportAutoGrowToTextWordWrap) +{ +// pptx doesn't have autoGrowWidth and autoGrowHeight, but it does have TextWordWrap +// which is similar. If autoGrowWidth and autoGrowHeight are set in the document, +// then they are exported to pptx as TextWordWrap = "none". +loadFromFile(u"tdf134401_ExportAutoGrowToTextWordWrap.odp"); +save("Impress Office Open XML"); + +// There are 2 shapes in the test file. +// The 1. shape is without autoGrowWidth/Height. +// The 2. shape is with autoGrowWidth/Height. +// Check if wrap="none" is exported for shape 2, but no wrap is exported for shape 1. +xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); +assertXPathNoAttribute(pXmlDoc, "//p:sp[1]/p:txBody/a:bodyPr"_ostr, "wrap"_ostr); +assertXPath(pXmlDoc, "//p:sp[2]/p:txBody/a:bodyPr"_ostr, "wrap"_ostr, "none"); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 05c96c9ad798..a3e5356c0523 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -4061,6 +4061,22 @@ void DrawingML::WriteText(const Reference& rXIface, bool bBodyPr, bo bHasWrap = true; } +// tdf#134401: If AUTOGROWWIDTH and AUTOGROWHEIGHT are set, then export it as TextWordWrap +if (SvxShapeText* pShpTxt = dynamic_cast(rXIface.get())) +{ +const sdr::properties::BaseProperties& rProperties += pShpTxt->GetSdrObject()->GetProperties(); + +const SdrOnOffItem& rSdrTextFitWidth = rProperties.GetItem(SDRATTR_TEXT_AUTOGROWWIDTH); +const SdrOnOffItem& rSdrTextFitHeight = rProperties.GetItem(SDRATTR_TEXT_AUTOGROWHEIGHT); + +if (rSdrTextFitWidth.GetValue() == true && rSdrTextFitHeight.GetValue() == true) +{ +bHasWrap = true; +bWrap = false; +} +} + if (bBodyPr) { const char* pWrap = (bHasWrap && !bWrap) || bIsFontworkShape ? "none" : nullptr;
core.git: sc/source
sc/source/ui/inc/content.hxx|2 ++ sc/source/ui/navipi/content.cxx | 18 +- 2 files changed, 19 insertions(+), 1 deletion(-) New commits: commit ebda38ef860970bea2996f3122660339ef2ddacd Author: Attila Szűcs AuthorDate: Tue Nov 7 15:03:33 2023 +0100 Commit: Andras Timar CommitDate: Wed Jan 17 17:32:11 2024 +0100 SC navigator: fix changing language of contenttree Save the actual language, when ScContentTree is created, and use that language to localise its text. Note: Saving language in ScContentTree::ScContentTree caused problems, so it is better to save the language when this tree is filled with text the first time. In case of LOK, there can be separate views, with different languages, that means there can be 2+ ScContentTrees, e.g. one has text in English and the other in German. When a new item is created that is listed in navigator, then every ScContentTree is updated at once... but that would use the global language, not the one what was used when the actual ScContentTree was created. Change-Id: I2dedf293e0ad9fb8f3cdd1090e1e1707a9f6cfa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159077 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162192 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx index 2e8c6757e202..b57e49eb55f2 100644 --- a/sc/source/ui/inc/content.hxx +++ b/sc/source/ui/inc/content.hxx @@ -55,6 +55,8 @@ class ScContentTree o3tl::enumarray pPosList; // for the sequence +std::unique_ptr m_pResLocaleForLOK; //it needed only in case of LOK + ScDocShell* GetManualOrCurrent(); voidInitRoot(ScContentId nType); diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index af8b64b6fdba..588476d97ed9 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -188,7 +188,23 @@ void ScContentTree::InitRoot( ScContentId nType ) } auto const & aImage = aContentBmps[static_cast(nType) - 1]; -OUString aName(ScResId(SCSTR_CONTENT_ARY[static_cast(nType)])); + +OUString aName; +if(comphelper::LibreOfficeKit::isActive()) +{ +//In case of LOK we may have many different ScContentTrees in different languages. +//At creation time, we store what language we use, and then use it later too. +//It does not work in the constructor, that is why it is here. +if (!m_pResLocaleForLOK) +{ +m_pResLocaleForLOK = std::make_unique(SC_MOD()->GetResLocale()); +} +aName = Translate::get(SCSTR_CONTENT_ARY[static_cast(nType)], *m_pResLocaleForLOK); +} +else +{ +aName = ScResId(SCSTR_CONTENT_ARY[static_cast(nType)]); +} // back to the correct position: sal_uInt16 nPos = nRootType != ScContentId::ROOT ? 0 : pPosList[nType]-1; m_aRootNodes[nType] = m_xTreeView->make_iterator();
core.git: Branch 'distro/collabora/co-24.04' - 4 commits - editeng/inc editeng/source sfx2/source
editeng/inc/editattr.hxx|2 + editeng/inc/editdoc.hxx |1 editeng/source/editeng/editdoc.cxx | 13 + editeng/source/editeng/impedit3.cxx |6 +++- sfx2/source/view/lokhelper.cxx | 49 ++-- 5 files changed, 51 insertions(+), 20 deletions(-) New commits: commit 5bbda05d6f2abf87422190a3790db014edd748d1 Author: Attila Szűcs AuthorDate: Tue Jan 9 17:45:19 2024 +0100 Commit: Andras Timar CommitDate: Wed Jan 17 11:36:08 2024 +0100 tdf#154248 Impress: fix color of hyperlink Added a new FindAttrib method that searches in the attribs a bit different. The original FindAttrib searches in attribs as if their position intervals are closed from both side [Start,End]. However, the actual attribs array was created using PaMs as positions, and these are right-opened intervals [Start,End) Change-Id: I9a46b6b27ce447366fc20af1b46fd60b5c745359 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161836 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/editeng/inc/editattr.hxx b/editeng/inc/editattr.hxx index 3a619a5e85b8..985a586c7fe3 100644 --- a/editeng/inc/editattr.hxx +++ b/editeng/inc/editattr.hxx @@ -105,6 +105,8 @@ public: boolIsIn( sal_Int32 nIndex ) const { return ( ( nStart <= nIndex ) && ( nEnd >= nIndex ) ); } +boolIsInLeftClosedRightOpen( sal_Int32 nIndex ) const +{ return ( ( nStart <= nIndex ) && ( nEnd > nIndex ) ); } boolIsInside( sal_Int32 nIndex ) const { return ( ( nStart < nIndex ) && ( nEnd > nIndex ) ); } boolIsEmpty() const diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx index 16eaf157a91f..80e3cc34243c 100644 --- a/editeng/inc/editdoc.hxx +++ b/editeng/inc/editdoc.hxx @@ -199,6 +199,7 @@ public: const EditCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_Int32 nPos ) const; EditCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_Int32 nPos ); +EditCharAttrib* FindAttribRightOpen( sal_uInt16 nWhich, sal_Int32 nPos ); const EditCharAttrib* FindNextAttrib( sal_uInt16 nWhich, sal_Int32 nFromPos ) const; EditCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_Int32 nPos ); const EditCharAttrib* FindFeature( sal_Int32 nPos ) const; diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index d892bd1c3a25..2472d8362957 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -2841,6 +2841,19 @@ EditCharAttrib* CharAttribList::FindAttrib( sal_uInt16 nWhich, sal_Int32 nPos ) return nullptr; } +EditCharAttrib* CharAttribList::FindAttribRightOpen( sal_uInt16 nWhich, sal_Int32 nPos ) +{ +AttribsType::reverse_iterator it = std::find_if(aAttribs.rbegin(), aAttribs.rend(), +[, ](AttribsType::value_type& rxAttr) { +return rxAttr->Which() == nWhich && rxAttr->IsInLeftClosedRightOpen(nPos); }); +if (it != aAttribs.rend()) +{ +EditCharAttrib& rAttr = **it; +return +} +return nullptr; +} + const EditCharAttrib* CharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_Int32 nFromPos ) const { assert(nWhich); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index b24cc004011c..17699870c6e4 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -2939,7 +2939,11 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo // #i1550# hard color attrib should win over text color from field if ( pAttrib->Which() == EE_FEATURE_FIELD ) { -EditCharAttrib* pColorAttr = pNode->GetCharAttribs().FindAttrib( EE_CHAR_COLOR, nPos ); +// These Attribs positions come from PaMs, so their interval is right-open and left-closed +// when SeekCursor is called, nPos is incremented by 1. I do not know why... +// probably designed to be a nEndPos, and like in a PaM, it is the position after the actual character. +sal_Int32 nPosActual = nPos > 0 ? nPos - 1 : 0; +EditCharAttrib* pColorAttr = pNode->GetCharAttribs().FindAttribRightOpen( EE_CHAR_COLOR, nPosActual ); if ( pColorAttr ) pColorAttr->SetFont( rFont, pOut ); } commit b97af5c60f379f45021bc6692dcba890dc80dc97 Author: Aron Budea AuthorDate: Tue Jan 9 12:39:56 2024 +1030 Commit: Andras Timar CommitDate: Wed Jan 17 11:34:45 2024 +0100 lok: Replace loop with std::find_if(...) Change-Id: Icfe912f7b79454b9d208c39382ba187d0a0c16c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161810 Tested-by: Jenkins CollaboraOffice
core.git: Branch 'distro/collabora/co-24.04' - sc/source
sc/source/ui/inc/content.hxx|2 ++ sc/source/ui/navipi/content.cxx | 18 +- 2 files changed, 19 insertions(+), 1 deletion(-) New commits: commit a9a578610f51f708725afa698a946b6837c0d9ef Author: Attila Szűcs AuthorDate: Tue Nov 7 15:03:33 2023 +0100 Commit: Andras Timar CommitDate: Wed Jan 17 11:30:55 2024 +0100 SC navigator: fix changing language of contenttree Save the actual language, when ScContentTree is created, and use that language to localise its text. Note: Saving language in ScContentTree::ScContentTree caused problems, so it is better to save the language when this tree is filled with text the first time. In case of LOK, there can be separate views, with different languages, that means there can be 2+ ScContentTrees, e.g. one has text in English and the other in German. When a new item is created that is listed in navigator, then every ScContentTree is updated at once... but that would use the global language, not the one what was used when the actual ScContentTree was created. Change-Id: I2dedf293e0ad9fb8f3cdd1090e1e1707a9f6cfa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159077 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx index 2e8c6757e202..b57e49eb55f2 100644 --- a/sc/source/ui/inc/content.hxx +++ b/sc/source/ui/inc/content.hxx @@ -55,6 +55,8 @@ class ScContentTree o3tl::enumarray pPosList; // for the sequence +std::unique_ptr m_pResLocaleForLOK; //it needed only in case of LOK + ScDocShell* GetManualOrCurrent(); voidInitRoot(ScContentId nType); diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 89d77642558a..d16f61411016 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -186,7 +186,23 @@ void ScContentTree::InitRoot( ScContentId nType ) } auto const & aImage = aContentBmps[static_cast(nType) - 1]; -OUString aName(ScResId(SCSTR_CONTENT_ARY[static_cast(nType)])); + +OUString aName; +if(comphelper::LibreOfficeKit::isActive()) +{ +//In case of LOK we may have many different ScContentTrees in different languages. +//At creation time, we store what language we use, and then use it later too. +//It does not work in the constructor, that is why it is here. +if (!m_pResLocaleForLOK) +{ +m_pResLocaleForLOK = std::make_unique(SC_MOD()->GetResLocale()); +} +aName = Translate::get(SCSTR_CONTENT_ARY[static_cast(nType)], *m_pResLocaleForLOK); +} +else +{ +aName = ScResId(SCSTR_CONTENT_ARY[static_cast(nType)]); +} // back to the correct position: sal_uInt16 nPos = nRootType != ScContentId::ROOT ? 0 : pPosList[nType]-1; m_aRootNodes[nType] = m_xTreeView->make_iterator();
core.git: oox/qa oox/source
oox/qa/unit/data/tdf134401_ExportAutoGrowToTextWordWrap.odp |binary oox/qa/unit/export.cxx | 17 oox/source/export/drawingml.cxx | 16 +++ 3 files changed, 33 insertions(+) New commits: commit dc5a761df436f5d9de781d1fa6cf7d010f8be0e8 Author: Attila Szűcs AuthorDate: Tue Jan 16 04:29:49 2024 +0100 Commit: Caolán McNamara CommitDate: Wed Jan 17 10:55:09 2024 +0100 tdf#134401 SD: export to pptx: autoGrow->textWordWrap PPTX doesn't have autoGrowWidth and autoGrowHeight, but it does have TextWordWrap which is similar. If autoGrowWidth and autoGrowHeight are set in the document, then they are exported to PPTX as TextWordWrap = "none". Without this patch, PowerPoint may wrap some texts into more lines as Impress does. This is because some text may rendered at sligtly different sizes in PowerPoint as in Impress. (maybe it is just a rounding difference) Even 1% (or less) size difference is enought, because when autoGrowthWidth and autoGrowthHeight is set, then there is a good chance, the textbox rectangle is exactly as big as the text. Change-Id: I2cdba68c66c43507c5007a9e395b87ddeeea2372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162152 Tested-by: Jenkins Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/oox/qa/unit/data/tdf134401_ExportAutoGrowToTextWordWrap.odp b/oox/qa/unit/data/tdf134401_ExportAutoGrowToTextWordWrap.odp new file mode 100644 index ..9fcebfe0f448 Binary files /dev/null and b/oox/qa/unit/data/tdf134401_ExportAutoGrowToTextWordWrap.odp differ diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx index 415c5fe8d02f..aa9690efdb4a 100644 --- a/oox/qa/unit/export.cxx +++ b/oox/qa/unit/export.cxx @@ -1345,6 +1345,23 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf157289CircularArrowExport) assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo[1]"_ostr, "wR"_ostr, "6750"); assertXPath(pXmlDoc, "//a:pathLst/a:path/a:arcTo[1]"_ostr, "hR"_ostr, "6750"); } + +CPPUNIT_TEST_FIXTURE(Test, testTdf134401_ExportAutoGrowToTextWordWrap) +{ +// pptx doesn't have autoGrowWidth and autoGrowHeight, but it does have TextWordWrap +// which is similar. If autoGrowWidth and autoGrowHeight are set in the document, +// then they are exported to pptx as TextWordWrap = "none". +loadFromFile(u"tdf134401_ExportAutoGrowToTextWordWrap.odp"); +save("Impress Office Open XML"); + +// There are 2 shapes in the test file. +// The 1. shape is without autoGrowWidth/Height. +// The 2. shape is with autoGrowWidth/Height. +// Check if wrap="none" is exported for shape 2, but no wrap is exported for shape 1. +xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); +assertXPathNoAttribute(pXmlDoc, "//p:sp[1]/p:txBody/a:bodyPr"_ostr, "wrap"_ostr); +assertXPath(pXmlDoc, "//p:sp[2]/p:txBody/a:bodyPr"_ostr, "wrap"_ostr, "none"); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 05c96c9ad798..a3e5356c0523 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -4061,6 +4061,22 @@ void DrawingML::WriteText(const Reference& rXIface, bool bBodyPr, bo bHasWrap = true; } +// tdf#134401: If AUTOGROWWIDTH and AUTOGROWHEIGHT are set, then export it as TextWordWrap +if (SvxShapeText* pShpTxt = dynamic_cast(rXIface.get())) +{ +const sdr::properties::BaseProperties& rProperties += pShpTxt->GetSdrObject()->GetProperties(); + +const SdrOnOffItem& rSdrTextFitWidth = rProperties.GetItem(SDRATTR_TEXT_AUTOGROWWIDTH); +const SdrOnOffItem& rSdrTextFitHeight = rProperties.GetItem(SDRATTR_TEXT_AUTOGROWHEIGHT); + +if (rSdrTextFitWidth.GetValue() == true && rSdrTextFitHeight.GetValue() == true) +{ +bHasWrap = true; +bWrap = false; +} +} + if (bBodyPr) { const char* pWrap = (bHasWrap && !bWrap) || bIsFontworkShape ? "none" : nullptr;
core.git: Branch 'distro/collabora/co-23.05' - editeng/inc editeng/source
editeng/inc/editattr.hxx|2 ++ editeng/inc/editdoc.hxx |1 + editeng/source/editeng/editdoc.cxx | 13 + editeng/source/editeng/impedit3.cxx |6 +- 4 files changed, 21 insertions(+), 1 deletion(-) New commits: commit 9dd58f32e2a3b327f2a82387783d71af09d526bd Author: Attila Szűcs AuthorDate: Tue Jan 9 17:45:19 2024 +0100 Commit: Caolán McNamara CommitDate: Fri Jan 12 11:18:44 2024 +0100 tdf#154248 Impress: fix color of hyperlink Added a new FindAttrib method that searches in the attribs a bit different. The original FindAttrib searches in attribs as if their position intervals are closed from both side [Start,End]. However, the actual attribs array was created using PaMs as positions, and these are right-opened intervals [Start,End) Change-Id: I9a46b6b27ce447366fc20af1b46fd60b5c745359 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161836 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/editeng/inc/editattr.hxx b/editeng/inc/editattr.hxx index 502a5b084605..62d0a0ab5a70 100644 --- a/editeng/inc/editattr.hxx +++ b/editeng/inc/editattr.hxx @@ -101,6 +101,8 @@ public: boolIsIn( sal_Int32 nIndex ) const { return ( ( nStart <= nIndex ) && ( nEnd >= nIndex ) ); } +boolIsInLeftClosedRightOpen( sal_Int32 nIndex ) const +{ return ( ( nStart <= nIndex ) && ( nEnd > nIndex ) ); } boolIsInside( sal_Int32 nIndex ) const { return ( ( nStart < nIndex ) && ( nEnd > nIndex ) ); } boolIsEmpty() const diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx index e5c3abbef0cf..13969badac36 100644 --- a/editeng/inc/editdoc.hxx +++ b/editeng/inc/editdoc.hxx @@ -200,6 +200,7 @@ public: const EditCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_Int32 nPos ) const; EditCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_Int32 nPos ); +EditCharAttrib* FindAttribRightOpen( sal_uInt16 nWhich, sal_Int32 nPos ); const EditCharAttrib* FindNextAttrib( sal_uInt16 nWhich, sal_Int32 nFromPos ) const; EditCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_Int32 nPos ); const EditCharAttrib* FindFeature( sal_Int32 nPos ) const; diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 9fff222d9368..38641b95efa4 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -2869,6 +2869,19 @@ EditCharAttrib* CharAttribList::FindAttrib( sal_uInt16 nWhich, sal_Int32 nPos ) return nullptr; } +EditCharAttrib* CharAttribList::FindAttribRightOpen( sal_uInt16 nWhich, sal_Int32 nPos ) +{ +AttribsType::reverse_iterator it = std::find_if(aAttribs.rbegin(), aAttribs.rend(), +[, ](AttribsType::value_type& rxAttr) { +return rxAttr->Which() == nWhich && rxAttr->IsInLeftClosedRightOpen(nPos); }); +if (it != aAttribs.rend()) +{ +EditCharAttrib& rAttr = **it; +return +} +return nullptr; +} + const EditCharAttrib* CharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_Int32 nFromPos ) const { assert(nWhich); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 8a6ff9d63e6e..0541dfbc91b9 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -2981,7 +2981,11 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo // #i1550# hard color attrib should win over text color from field if ( pAttrib->Which() == EE_FEATURE_FIELD ) { -EditCharAttrib* pColorAttr = pNode->GetCharAttribs().FindAttrib( EE_CHAR_COLOR, nPos ); +// These Attribs positions come from PaMs, so their interval is right-open and left-closed +// when SeekCursor is called, nPos is incremented by 1. I do not know why... +// probably designed to be a nEndPos, and like in a PaM, it is the position after the actual character. +sal_Int32 nPosActual = nPos > 0 ? nPos - 1 : 0; +EditCharAttrib* pColorAttr = pNode->GetCharAttribs().FindAttribRightOpen( EE_CHAR_COLOR, nPosActual ); if ( pColorAttr ) pColorAttr->SetFont( rFont, pOut ); }
core.git: sfx2/source
sfx2/source/view/lokhelper.cxx | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) New commits: commit f97dc9d815ad8fdd75cbcd9c18b2e585ecf39ca5 Author: Attila Szűcs AuthorDate: Tue Jan 9 20:23:44 2024 +0100 Commit: Caolán McNamara CommitDate: Thu Jan 11 20:47:30 2024 +0100 LOK: fix language warning in setView Made the warning before the new language set. This way we log the old (wrong) and new (good) language. Elseway we could save the old languages to a temporal variable, set the language, and do the warning with the saved variable, but i think the extra variables would be a waste of memory. Change-Id: I0b69f49d07e9130bf1538c2c8e1d0b09cf82091f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161841 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit e09b3f5f4cd662a596b5d8d6ad4d5e2778e315f4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161916 Tested-by: Jenkins diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 711e12209e8a..02cc7fe25230 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -194,10 +194,6 @@ void SfxLokHelper::setView(int nId) if (bIsCurrShell && comphelper::LibreOfficeKit::getLanguageTag().getBcp47() == pViewShell->GetLOKLanguageTag().getBcp47()) return; -// update the current LOK language and locale for the dialog tunneling - comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag()); -comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale()); - if (bIsCurrShell) { // If we wanted to set the SfxViewShell that is actually set, we could skip it. @@ -206,9 +202,15 @@ void SfxLokHelper::setView(int nId) SAL_WARN("lok", "LANGUAGE mismatch at setView! ... old (wrong) lang:" << comphelper::LibreOfficeKit::getLanguageTag().getBcp47() << " new lang:" << pViewShell->GetLOKLanguageTag().getBcp47()); -return; } +// update the current LOK language and locale for the dialog tunneling + comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag()); +comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale()); + +if (bIsCurrShell) +return; + SfxViewFrame& rViewFrame = pViewShell->GetViewFrame(); rViewFrame.MakeActive_Impl(false);
core.git: sfx2/source
sfx2/source/view/lokhelper.cxx | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) New commits: commit e78bce3c1dbef3bbc0a18d9c17e458a69c2a8e46 Author: Attila Szűcs AuthorDate: Fri Dec 1 15:20:58 2023 +0100 Commit: Caolán McNamara CommitDate: Thu Jan 11 14:54:51 2024 +0100 LOK: fix setView language problem Fix some mis-localization problem by checking for wrong language at setView(...). setView does not change current localization, if the view we want to set is the current view. But in some cases the language - view is not in a consistent state. Maybe the language changed but the view did not, or the current view changed without language change (I found examples for both). Changed setView(...) so that it checks, if the current language matches to the current view, and if it does not, then we set the view, even if we want to set to the current view. This won't fix everything, but hopefully it helps a lot. I think we should make sure that current view - current Language are always changed at the same time (or at least we make sure they always match). Change-Id: Ie177b9b55f7befcbcf7cd1f62e402700f0e1aa60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160219 Reviewed-by: Andras Timar Tested-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161915 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index f21457e1b16d..711e12209e8a 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -190,13 +190,25 @@ void SfxLokHelper::setView(int nId) { DisableCallbacks dc; -if (pViewShell == SfxViewShell::Current()) +bool bIsCurrShell = (pViewShell == SfxViewShell::Current()); +if (bIsCurrShell && comphelper::LibreOfficeKit::getLanguageTag().getBcp47() == pViewShell->GetLOKLanguageTag().getBcp47()) return; // update the current LOK language and locale for the dialog tunneling comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag()); comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale()); +if (bIsCurrShell) +{ +// If we wanted to set the SfxViewShell that is actually set, we could skip it. +// But it looks like that the language can go wrong, so we have to fix that. +// This can happen, when someone sets the language or SfxViewShell::Current() separately. +SAL_WARN("lok", "LANGUAGE mismatch at setView! ... old (wrong) lang:" +<< comphelper::LibreOfficeKit::getLanguageTag().getBcp47() +<< " new lang:" << pViewShell->GetLOKLanguageTag().getBcp47()); +return; +} + SfxViewFrame& rViewFrame = pViewShell->GetViewFrame(); rViewFrame.MakeActive_Impl(false);
core.git: Branch 'distro/collabora/co-23.05' - sfx2/source
sfx2/source/view/lokhelper.cxx | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) New commits: commit e09b3f5f4cd662a596b5d8d6ad4d5e2778e315f4 Author: Attila Szűcs AuthorDate: Tue Jan 9 20:23:44 2024 +0100 Commit: Caolán McNamara CommitDate: Wed Jan 10 11:10:51 2024 +0100 LOK: fix language warning in setView Made the warning before the new language set. This way we log the old (wrong) and new (good) language. Elseway we could save the old languages to a temporal variable, set the language, and do the warning with the saved variable, but i think the extra variables would be a waste of memory. Change-Id: I0b69f49d07e9130bf1538c2c8e1d0b09cf82091f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161841 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 1ee8f262906c..c54551b1637f 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -195,10 +195,6 @@ void SfxLokHelper::setView(int nId) if (bIsCurrShell && comphelper::LibreOfficeKit::getLanguageTag().getBcp47() == pViewShell->GetLOKLanguageTag().getBcp47()) return; -// update the current LOK language and locale for the dialog tunneling - comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag()); -comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale()); - if (bIsCurrShell) { // If we wanted to set the SfxViewShell that is actually set, we could skip it. @@ -207,9 +203,15 @@ void SfxLokHelper::setView(int nId) SAL_WARN("lok", "LANGUAGE mismatch at setView! ... old (wrong) lang:" << comphelper::LibreOfficeKit::getLanguageTag().getBcp47() << " new lang:" << pViewShell->GetLOKLanguageTag().getBcp47()); -return; } +// update the current LOK language and locale for the dialog tunneling + comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag()); +comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale()); + +if (bIsCurrShell) +return; + SfxViewFrame* pViewFrame = pViewShell->GetViewFrame(); pViewFrame->MakeActive_Impl(false);
core.git: Branch 'distro/collabora/co-23.05' - sfx2/source
sfx2/source/view/lokhelper.cxx | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) New commits: commit 12bb3f3dd5bd29718b60697aa4f7e76c4698cd96 Author: Attila Szűcs AuthorDate: Fri Dec 1 15:20:58 2023 +0100 Commit: Andras Timar CommitDate: Sun Dec 10 12:33:44 2023 +0100 LOK: fix setView language problem Fix some mis-localization problem by checking for wrong language at setView(...). setView does not change current localization, if the view we want to set is the current view. But in some cases the language - view is not in a consistent state. Maybe the language changed but the view did not, or the current view changed without language change (I found examples for both). Changed setView(...) so that it checks, if the current language matches to the current view, and if it does not, then we set the view, even if we want to set to the current view. This won't fix everything, but hopefully it helps a lot. I think we should make sure that current view - current Language are always changed at the same time (or at least we make sure they always match). Change-Id: Ie177b9b55f7befcbcf7cd1f62e402700f0e1aa60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160219 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 0d3843632f13..2436c7cbe85d 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -180,13 +180,25 @@ void SfxLokHelper::setView(int nId) { DisableCallbacks dc; -if (pViewShell == SfxViewShell::Current()) +bool bIsCurrShell = (pViewShell == SfxViewShell::Current()); +if (bIsCurrShell && comphelper::LibreOfficeKit::getLanguageTag().getBcp47() == pViewShell->GetLOKLanguageTag().getBcp47()) return; // update the current LOK language and locale for the dialog tunneling comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag()); comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale()); +if (bIsCurrShell) +{ +// If we wanted to set the SfxViewShell that is actually set, we could skip it. +// But it looks like that the language can go wrong, so we have to fix that. +// This can happen, when someone sets the language or SfxViewShell::Current() separately. +SAL_WARN("lok", "LANGUAGE mismatch at setView! ... old (wrong) lang:" +<< comphelper::LibreOfficeKit::getLanguageTag().getBcp47() +<< " new lang:" << pViewShell->GetLOKLanguageTag().getBcp47()); +return; +} + SfxViewFrame* pViewFrame = pViewShell->GetViewFrame(); pViewFrame->MakeActive_Impl(false);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/svx include/tools oox/qa sc/source sd/qa sd/source svx/qa svx/source sw/source
include/svx/compatflags.hxx |2 include/tools/poly.hxx |1 oox/qa/unit/shape.cxx |4 sc/source/ui/docshell/docsh.cxx |2 sd/qa/unit/export-tests-ooxml3.cxx |2 sd/source/ui/docshell/docshel4.cxx |2 svx/qa/unit/data/tdf148000_CurvedTextWidth.pptx |binary svx/qa/unit/data/tdf148000_CurvedTextWidth_Legacy.odp |binary svx/qa/unit/data/tdf148000_CurvedTextWidth_New.odp |binary svx/qa/unit/svdraw.cxx | 39 ++ svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 275 +--- svx/source/svdraw/svdmodel.cxx | 18 - sw/source/uibase/app/docshini.cxx |2 13 files changed, 296 insertions(+), 51 deletions(-) New commits: commit 3d7dad88c409fecd3ba4a3f27f8e2e6e2e5f14d7 Author: Attila Szűcs AuthorDate: Wed Nov 15 07:04:32 2023 +0100 Commit: Andras Timar CommitDate: Sun Nov 26 15:07:35 2023 +0100 tdf#148000 impress: improve fontwork text placement. Improved the calculation of positions of text characters for multi-line texts. The previous version only fitted the text to the basic outline (curve), and then scale them to the appropriate text line. This means that the text will be wider or shorter, depending on the shape of the curve, and which line it is on Now it calculates a curve for each paragraph and fits text on it. Text will be approximately the same width on each line. Except if the text is wider as the curve. Because then it shrinks the text to fit on the curve. (this can only happens on inner curves) Reused the same compat flag that was used in bug148000, now it serves as a Powerpoint compatible mode for FontWork, so no need to create new compat flag every time FontWork has improve. That means that the Fontwork in old documents has remains the same Refactored horizontal/vertical alignment, but had to keep the old hacks as well. Note: if there are too many lines of text, and the vertical alignment causes internal curves, then curves can shrink to 0 length (center point of a circle) or even to negative length, These cases are impossible to display normally, so it will be glitchy similar to how it was before this patch. MS PowerPoint avoid these cases by not allowing vertical alignments that would result internal (smaller) curves. Added unittest to check legacy-odb / new-odp / pptx file. It change the display of fontwork, so in some cases it may feel like a regression. Squashed a lot of typo fix commits by Andrea Gelmini. Change-Id: Iac2d9bc751bbc2b6f747c33958f969cb3543fae5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159776 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159975 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/include/svx/compatflags.hxx b/include/svx/compatflags.hxx index f7d021f17bf7..9a64bd2bab80 100644 --- a/include/svx/compatflags.hxx +++ b/include/svx/compatflags.hxx @@ -11,7 +11,7 @@ enum class SdrCompatibilityFlag { AnchoredTextOverflowLegacy, ///< for tdf#99729 -LegacySingleLineFontwork, ///< for tdf#148000 +LegacyFontwork, ///< for tdf#148000 false == Fontwork works in PowerPoint compat mode ConnectorUseSnapRect, ///< for tdf#149756 IgnoreBreakAfterMultilineField, ///< for tdf#148966 }; diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx index d9f2a4544901..fd653ec724b7 100644 --- a/include/tools/poly.hxx +++ b/include/tools/poly.hxx @@ -114,6 +114,7 @@ public: voidSetSize( sal_uInt16 nNewSize ); sal_uInt16 GetSize() const; +sal_uInt16 size() const { return GetSize(); } //for vector compatibility voidClear(); diff --git a/oox/qa/unit/shape.cxx b/oox/qa/unit/shape.cxx index 4db45f7451be..d2475095e716 100644 --- a/oox/qa/unit/shape.cxx +++ b/oox/qa/unit/shape.cxx @@ -178,9 +178,9 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testTdf125582_TextOnCircle) { SdrObjCustomShape& rSdrCustomShape( static_cast(*SdrObject::getSdrObjectFromXShape(xShape))); -// Without the fix in place width was 3639, but should be 4824 for 96dpi. +// Without the fix in place width was 3639, but should be 4784 for 96dpi. tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect()); -CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(4824), aBoundRect.GetWidth(), 5); +CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(4784), aBoundRect.GetWidth(), 5); } drawing::TextVerticalAdjust eAdjust; diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/svx include/tools oox/qa sc/source sd/qa sd/source svx/qa svx/source sw/source
include/svx/compatflags.hxx |2 include/tools/poly.hxx |1 oox/qa/unit/shape.cxx |2 sc/source/ui/docshell/docsh.cxx |2 sd/qa/unit/export-tests-ooxml3.cxx |2 sd/source/ui/docshell/docshel4.cxx |2 svx/qa/unit/data/tdf148000_CurvedTextWidth.pptx |binary svx/qa/unit/data/tdf148000_CurvedTextWidth_Legacy.odp |binary svx/qa/unit/data/tdf148000_CurvedTextWidth_New.odp |binary svx/qa/unit/svdraw.cxx | 39 ++ svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 275 +--- svx/source/svdraw/svdmodel.cxx | 18 - sw/source/uibase/app/docshini.cxx |2 13 files changed, 295 insertions(+), 50 deletions(-) New commits: commit 202f2d6f6529a8fe5a12dded879bafb546d9add3 Author: Attila Szűcs AuthorDate: Wed Nov 15 07:04:32 2023 +0100 Commit: Caolán McNamara CommitDate: Thu Nov 23 10:02:19 2023 +0100 tdf#148000 impress: improve fontwork text placement. Improved the calculation of positions of text characters for multi-line texts. The previous version only fitted the text to the basic outline (curve), and then scale them to the appropriate text line. This means that the text will be wider or shorter, depending on the shape of the curve, and which line it is on Now it calculates a curve for each paragraph and fits text on it. Text will be approximately the same width on each line. Except if the text is wider as the curve. Because then it shrinks the text to fit on the curve. (this can only happens on inner curves) Reused the same compat flag that was used in bug148000, now it serves as a Powerpoint compatible mode for FontWork, so no need to create new compat flag every time FontWork has improve. That means that the Fontwork in old documents has remains the same Refactored horizontal/vertical alignment, but had to keep the old hacks as well. Note: if there are too many lines of text, and the vertical alignment causes internal curves, then curves can shrink to 0 length (center point of a circle) or even to negative length, These cases are impossible to display normally, so it will be glitchy similar to how it was before this patch. MS PowerPoint avoid these cases by not allowing vertical alignments that would result internal (smaller) curves. Added unittest to check legacy-odb / new-odp / pptx file. It change the display of fontwork, so in some cases it may feel like a regression. Change-Id: Iac2d9bc751bbc2b6f747c33958f969cb3543fae5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159428 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/include/svx/compatflags.hxx b/include/svx/compatflags.hxx index f7d021f17bf7..9a64bd2bab80 100644 --- a/include/svx/compatflags.hxx +++ b/include/svx/compatflags.hxx @@ -11,7 +11,7 @@ enum class SdrCompatibilityFlag { AnchoredTextOverflowLegacy, ///< for tdf#99729 -LegacySingleLineFontwork, ///< for tdf#148000 +LegacyFontwork, ///< for tdf#148000 false == Fontwork works in PowerPoint compat mode ConnectorUseSnapRect, ///< for tdf#149756 IgnoreBreakAfterMultilineField, ///< for tdf#148966 }; diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx index d9f2a4544901..dff37a51b436 100644 --- a/include/tools/poly.hxx +++ b/include/tools/poly.hxx @@ -114,6 +114,7 @@ public: voidSetSize( sal_uInt16 nNewSize ); sal_uInt16 GetSize() const; +sal_uInt16 size() const { return GetSize(); } //for vector compability voidClear(); diff --git a/oox/qa/unit/shape.cxx b/oox/qa/unit/shape.cxx index c0bae9cbb536..64730eedd4ca 100644 --- a/oox/qa/unit/shape.cxx +++ b/oox/qa/unit/shape.cxx @@ -166,7 +166,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testTdf125582_TextOnCircle) static_cast(*SdrObject::getSdrObjectFromXShape(xShape))); // Without the fix in place width was 3639, but should be 4824 for 96dpi. tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect()); -CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(4824), aBoundRect.GetWidth(), 5); +CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(4784), aBoundRect.GetWidth(), 5); } drawing::TextVerticalAdjust eAdjust; diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 41035532cb27..a0d45efd23a6 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -613,7 +613,7 @@ bool ScDocShell::Load( SfxMedium& rMedium ) {
[Libreoffice-commits] core.git: include/svx include/tools oox/qa sc/source sd/qa sd/source svx/qa svx/source sw/source
include/svx/compatflags.hxx |2 include/tools/poly.hxx |1 oox/qa/unit/shape.cxx |4 sc/source/ui/docshell/docsh.cxx |2 sd/qa/unit/export-tests-ooxml3.cxx |2 sd/source/ui/docshell/docshel4.cxx |2 svx/qa/unit/data/tdf148000_CurvedTextWidth.pptx |binary svx/qa/unit/data/tdf148000_CurvedTextWidth_Legacy.odp |binary svx/qa/unit/data/tdf148000_CurvedTextWidth_New.odp |binary svx/qa/unit/svdraw.cxx | 39 ++ svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 275 +--- svx/source/svdraw/svdmodel.cxx | 18 - sw/source/uibase/app/docshini.cxx |2 13 files changed, 296 insertions(+), 51 deletions(-) New commits: commit 3a5cc107efb843b01193230c56dc8d9c0072348a Author: Attila Szűcs AuthorDate: Wed Nov 15 07:04:32 2023 +0100 Commit: Caolán McNamara CommitDate: Wed Nov 22 11:10:08 2023 +0100 tdf#148000 impress: improve fontwork text placement. Improved the calculation of positions of text characters for multi-line texts. The previous version only fitted the text to the basic outline (curve), and then scale them to the appropriate text line. This means that the text will be wider or shorter, depending on the shape of the curve, and which line it is on Now it calculates a curve for each paragraph and fits text on it. Text will be approximately the same width on each line. Except if the text is wider as the curve. Because then it shrinks the text to fit on the curve. (this can only happens on inner curves) Reused the same compat flag that was used in bug148000, now it serves as a Powerpoint compatible mode for FontWork, so no need to create new compat flag every time FontWork has improve. That means that the Fontwork in old documents has remains the same Refactored horizontal/vertical alignment, but had to keep the old hacks as well. Note: if there are too many lines of text, and the vertical alignment causes internal curves, then curves can shrink to 0 length (center point of a circle) or even to negative length, These cases are impossible to display normally, so it will be glitchy similar to how it was before this patch. MS PowerPoint avoid these cases by not allowing vertical alignments that would result internal (smaller) curves. Added unittest to check legacy-odb / new-odp / pptx file. It change the display of fontwork, so in some cases it may feel like a regression. Change-Id: Iac2d9bc751bbc2b6f747c33958f969cb3543fae5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159776 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/include/svx/compatflags.hxx b/include/svx/compatflags.hxx index f7d021f17bf7..9a64bd2bab80 100644 --- a/include/svx/compatflags.hxx +++ b/include/svx/compatflags.hxx @@ -11,7 +11,7 @@ enum class SdrCompatibilityFlag { AnchoredTextOverflowLegacy, ///< for tdf#99729 -LegacySingleLineFontwork, ///< for tdf#148000 +LegacyFontwork, ///< for tdf#148000 false == Fontwork works in PowerPoint compat mode ConnectorUseSnapRect, ///< for tdf#149756 IgnoreBreakAfterMultilineField, ///< for tdf#148966 }; diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx index 77653d23bda7..24705f6c9e3c 100644 --- a/include/tools/poly.hxx +++ b/include/tools/poly.hxx @@ -114,6 +114,7 @@ public: voidSetSize( sal_uInt16 nNewSize ); sal_uInt16 GetSize() const; +sal_uInt16 size() const { return GetSize(); } //for vector compability voidClear(); diff --git a/oox/qa/unit/shape.cxx b/oox/qa/unit/shape.cxx index 54ea52cce19c..d3a971cd58db 100644 --- a/oox/qa/unit/shape.cxx +++ b/oox/qa/unit/shape.cxx @@ -178,9 +178,9 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testTdf125582_TextOnCircle) { SdrObjCustomShape& rSdrCustomShape( static_cast(*SdrObject::getSdrObjectFromXShape(xShape))); -// Without the fix in place width was 3639, but should be 4824 for 96dpi. +// Without the fix in place width was 3639, but should be 4784 for 96dpi. tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect()); -CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(4824), aBoundRect.GetWidth(), 5); +CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(4784), aBoundRect.GetWidth(), 5); } drawing::TextVerticalAdjust eAdjust; diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index c951814ce77f..77cf975166de 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -612,7 +612,7 @@ bool ScDocShell::Load( SfxMedium& rMedium )
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source
sc/source/ui/inc/content.hxx|2 ++ sc/source/ui/navipi/content.cxx | 18 +- 2 files changed, 19 insertions(+), 1 deletion(-) New commits: commit 3dff3a50dfda011c8bfb5502f6a8d1e7f8b95d59 Author: Attila Szűcs AuthorDate: Tue Nov 7 15:03:33 2023 +0100 Commit: Tomaž Vajngerl CommitDate: Thu Nov 16 04:02:36 2023 +0100 SC navigator: fix changing language of contenttree Saved the actual language, when ScContentTree is created, and use that language to localise is text. Note: Saving language in ScContentTree::ScContentTree caused problems, so it replaced into where this tree filled with text at the first time. In case of LOK, there can be seapate views, with different languages, that means there can be 2+ ScContentTree, one have text in English and the other in German. When new item is created that is listed in navigator, then every ScContentTree is updated at once... but that would use the global laguage, not the one what was used when the actual ScContentTree was created. Change-Id: I2dedf293e0ad9fb8f3cdd1090e1e1707a9f6cfa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159077 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx index 9cd7e977319d..3f179860cce7 100644 --- a/sc/source/ui/inc/content.hxx +++ b/sc/source/ui/inc/content.hxx @@ -59,6 +59,8 @@ class ScContentTree o3tl::enumarray pPosList; // for the sequence +std::unique_ptr m_pResLocaleForLOK; //it needed only in case of LOK + ScDocShell* GetManualOrCurrent(); voidInitRoot(ScContentId nType); diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 1387abd44346..7c3d2b7d022b 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -188,7 +188,23 @@ void ScContentTree::InitRoot( ScContentId nType ) } auto const aImage(aContentBmps[static_cast(nType) - 1]); -OUString aName(ScResId(SCSTR_CONTENT_ARY[static_cast(nType)])); + +OUString aName; +if(comphelper::LibreOfficeKit::isActive()) +{ +//In case of LOK we may have many different languaged ScContentTree +//At creation time, we store what language we use, and then use it later too. +//It not work in the constructor, that is why it is here. +if (!m_pResLocaleForLOK) +{ +m_pResLocaleForLOK = std::make_unique(SC_MOD()->GetResLocale()); +} +aName = Translate::get(SCSTR_CONTENT_ARY[static_cast(nType)], *m_pResLocaleForLOK); +} +else +{ +aName = ScResId(SCSTR_CONTENT_ARY[static_cast(nType)]); +} // back to the correct position: sal_uInt16 nPos = nRootType != ScContentId::ROOT ? 0 : pPosList[nType]-1; m_aRootNodes[nType] = m_xTreeView->make_iterator();
[Libreoffice-commits] core.git: sw/source
sw/source/core/doc/docredln.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit bfeb6375a96d75ed7117f1581b0a0d7cb0d236ca Author: Attila Szűcs AuthorDate: Thu Oct 26 23:11:03 2023 +0200 Commit: Caolán McNamara CommitDate: Tue Oct 31 16:27:25 2023 +0100 tdf#157662 SW: fix connected area calculation Reset pRedline to its origin value between the 2 loops, because the 1. loop may change it. without this fix, if it discover neightbours in the 1. direction, it will not discover them in the other direction. Change-Id: Ia1ab357ada17cb7574907a3aa1bf0dd4d7a90255 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158517 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158721 Tested-by: Jenkins diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 0472343d8eb3..8ef699787b3f 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -846,6 +846,7 @@ void SwRedlineTable::getConnectedArea(size_type nPosOrigin, size_type& rPosStart rPosStart--; pRedline = pOther; } +pRedline = pOrigin; while (rPosEnd + 1 < size() && (pOther = (*this)[rPosEnd + 1]) && lcl_CanCombineWithRange(pOrigin, pRedline, pOther, false, bCheckChilds)) {
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/IDocumentRedlineAccess.hxx |3 +- sw/source/core/doc/DocumentRedlineManager.cxx | 33 +- sw/source/core/doc/docnum.cxx |2 - sw/source/core/inc/DocumentRedlineManager.hxx |5 +++ 4 files changed, 39 insertions(+), 4 deletions(-) New commits: commit b40e469887d973e1eea242749a90c3c2370da3a5 Author: Attila Szűcs AuthorDate: Thu Oct 26 01:51:40 2023 +0200 Commit: Caolán McNamara CommitDate: Mon Oct 30 01:55:54 2023 +0100 tdf#157663 SW: fix redline continueing a move Subsequent moves generated new MoveID's, like if they were separete moves. That cause moves to forgot their other parts. Now, if we move a redline that was moved by us it will re-use its moveID as if it was just the continue of the previous movement. It does not work if we move more then 1 of our own movement redlines Note: There are complex cases what it cannot handle.. in those case it just use the new ID, so the newly moved part, will forgot its relation with the old move oroginal parts. Complex case is like.. if we move 2 of our own move redlines, that means there will be 2 MoveId we would want to continue, but only 1 insert redline to write that MoveID. But as long as we moved only 1 of our redlines it will work, even if there are more text redlines, even move redlines of other author. Other move redlines will be separate move anyway. Note2: In complex cases, we may could connect movements. Or we could split the new inserted move part. but those are design questions, they may be not good idea.. and the split one is probably more work to implement. Change-Id: Icb2adf43272181c6a63a4a84750352f4b163383a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158473 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158615 Tested-by: Jenkins diff --git a/sw/inc/IDocumentRedlineAccess.hxx b/sw/inc/IDocumentRedlineAccess.hxx index 6e28f1340deb..9d97eb43ff7e 100644 --- a/sw/inc/IDocumentRedlineAccess.hxx +++ b/sw/inc/IDocumentRedlineAccess.hxx @@ -147,7 +147,8 @@ public: MERGED if pNewRedl was deleted but has been merged with existing one IGNORED if pNewRedl was deleted and ignored/invalid */ -virtual AppendResult AppendRedline(/*[in]*/SwRangeRedline* pNewRedl, /*[in]*/bool bCallDelete) = 0; +virtual AppendResult AppendRedline(/*[in]*/ SwRangeRedline* pNewRedl, /*[in]*/ bool bCallDelete, + /*[in]*/ sal_uInt32 nMoveIDToDelete = 0) = 0; virtual bool AppendTableRowRedline(/*[in]*/SwTableRowRedline* pPtr) = 0; virtual bool AppendTableCellRedline(/*[in]*/SwTableCellRedline* pPtr) = 0; diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 468449ecfbe9..8d52c814e81a 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -1309,7 +1309,8 @@ Behaviour of Delete-Redline: the Delete */ IDocumentRedlineAccess::AppendResult -DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCallDelete) +DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCallDelete, + sal_uInt32 nMoveIDToDelete) { CHECK_REDLINE( *this ) @@ -1330,6 +1331,9 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall return AppendResult::IGNORED; } +// Collect MoveID's of the redlines we delete. +// If there is only 1, then we should use its ID. (continuing the move) +std::set deletedMoveIDs; bool bMerged = false; @@ -1807,6 +1811,16 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall // and anonymized insertion, i.e. with the same dummy timestamp !pRedl->GetRedlineData(0).IsAnonymized() ) { +// Collect MoveID's of the redlines we delete. +if (nMoveIDToDelete > 1 && maRedlineTable[n]->GetMoved() > 0 +&& (eCmpPos == SwComparePosition::Equal +|| eCmpPos == SwComparePosition::Inside +|| eCmpPos == SwComparePosition::Outside +|| eCmpPos == SwComparePosition::OverlapBefore +|| eCmpPos == SwComparePosition::OverlapBehind)) +{ +deletedMoveIDs.insert(maRedlineTable[n]->GetMoved()); +} // Set to NONE, so that the Delete::Redo merges the Redline data correctly! // The ShowMode needs to be retained! @@ -2421,6 +2435,23 @@
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/IDocumentRedlineAccess.hxx |9 ++ sw/source/core/doc/DocumentContentOperationsManager.cxx |9 ++ sw/source/core/doc/DocumentRedlineManager.cxx | 53 +++- sw/source/core/inc/DocumentRedlineManager.hxx | 10 +++ 4 files changed, 78 insertions(+), 3 deletions(-) New commits: commit 5e726afaf08c8cc59124d9551bb083220a38821e Author: Attila Szűcs AuthorDate: Wed Oct 25 12:46:10 2023 +0200 Commit: Caolán McNamara CommitDate: Mon Oct 30 00:39:30 2023 +0100 SW: fixed redline SwPosition update problem When nodes are removed, SwPosition nNode is updated, but its nContent is not. If nNode change from a non-ContentNodo to a ContentNode, then it is a problem, as nContent 's m_pContentNode remains nullptr, so the Position seems to be inconsistent. Now when redline remove nodes, it check what redlines may effected it, and update them after the node deletion happened. Probably this bug should be handled deeper, as this problem probably effect every SwPosition.. not sure if it can be a problem elsewhere. A special case when it happens, if there is a Table between 2 text. And there are 2 redlines.. 1: any redline positioned 'text start'-'table start' 2: delete redline: 'table begin'-'table end' now if we accept the 2. redline .. that remove the table the 1. redline position will change to: 'text start'-'next text start' but its end's nContent.m_pContentNode remain nullptr so lcl_CheckPosition(...) will assert Change-Id: I2981fd0218a375994d3f55cb5d3463b17ca35849 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158456 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158614 Tested-by: Jenkins diff --git a/sw/inc/IDocumentRedlineAccess.hxx b/sw/inc/IDocumentRedlineAccess.hxx index c2b71aa1005a..6e28f1340deb 100644 --- a/sw/inc/IDocumentRedlineAccess.hxx +++ b/sw/inc/IDocumentRedlineAccess.hxx @@ -168,6 +168,11 @@ public: /*[in]*/const SwNode& rNode, /*[in]*/RedlineType nType) const = 0; +virtual SwRedlineTable::size_type GetRedlineEndPos( +/*[in]*/ SwRedlineTable::size_type nStartPos, +/*[in]*/ const SwNode& rNode, +/*[in]*/ RedlineType nType) const = 0; + virtual bool HasRedline( /*[in]*/const SwPaM& rPam, /*[in]*/RedlineType nType, @@ -226,6 +231,10 @@ public: virtual void SetRedlinePassword( /*[in]*/const css::uno::Sequence & rNewPassword) = 0; +virtual void UpdateRedlineContentNode(/*[in]*/ SwRedlineTable::size_type nStartPos, + /*[in]*/ SwRedlineTable::size_type nEndPos) const = 0; + + protected: virtual ~IDocumentRedlineAccess() {}; }; diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 60f9d1b96890..3f4c99a8f487 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -2142,8 +2142,17 @@ void DocumentContentOperationsManager::DeleteDummyChar( void DocumentContentOperationsManager::DeleteRange( SwPaM & rPam ) { +// Seek all redlines that are in that PaM to be deleted.. +SwRedlineTable::size_type nRedlStart = m_rDoc.getIDocumentRedlineAccess().GetRedlinePos( +rPam.Start()->GetNode(), RedlineType::Any); +SwRedlineTable::size_type nRedlEnd = m_rDoc.getIDocumentRedlineAccess().GetRedlineEndPos( +nRedlStart, rPam.End()->GetNode(), RedlineType::Any); + lcl_DoWithBreaks(*this, rPam, SwDeleteFlags::Default, ::DeleteRangeImpl); +// update all redlines was in the Pam that is +m_rDoc.getIDocumentRedlineAccess().UpdateRedlineContentNode(nRedlStart, nRedlEnd); + if (!m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty()) { diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index b09ad5bedcaa..468449ecfbe9 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -54,9 +54,8 @@ using namespace com::sun::star; // 2. check that position is valid and doesn't point after text void lcl_CheckPosition( const SwPosition* pPos ) { -// Commented out because of a random problem, that happened even before my patch -//assert(dynamic_cast(>GetNode()) -//== pPos->GetContentNode()); +assert(dynamic_cast(>GetNode()) +== pPos->GetContentNode()); SwTextNode* pTextNode = pPos->GetNode().GetTextNode(); if( pTextNode == nullptr ) @@ -2801,6 +2800,54 @@ SwRedlineTable::size_type
[Libreoffice-commits] core.git: 2 commits - sw/source
sw/source/core/doc/docredln.cxx|8 ++-- sw/source/uibase/misc/redlndlg.cxx |7 +-- 2 files changed, 7 insertions(+), 8 deletions(-) New commits: commit a1c3ac4205226f192b94a36a912e915b959043d7 Author: Attila Szűcs AuthorDate: Wed Oct 25 13:09:22 2023 +0200 Commit: Caolán McNamara CommitDate: Mon Oct 30 00:39:22 2023 +0100 SW: small fix for manage changes dialog. Fixed a continue, as it was planned to effect the outer loop. (probably when it was replaced to an inner loop it was forgot to handle) fixed a nullptr check also. These problems may not result real problem right now, but when interdependedt redlines will be improved, they will result in problems. Change-Id: Ie139f9a657abbacea9450176d2fe138392beddfa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158457 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158613 Tested-by: Caolán McNamara diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index b68bacbbef5c..532ea120ca2a 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -440,13 +440,16 @@ void SwRedlineAcceptDlg::Activate() { while (pRedlineData) { -if (pRedlineData != pBackupData->pChild) +if (!pBackupData || pRedlineData != pBackupData->pChild) { // Redline-Children were inserted, changed or deleted i = CalcDiff(i, true); if (i == SwRedlineTable::npos) return; -continue; + +// here was a continue; targetted to the outer loop +// now a break will do, as there is nothing after it in the outer loop +break; } pBackupData = pBackupData->pNext; pRedlineData = pRedlineData->Next(); commit 2c3f731992a294d4f35b41193af034fe9a6dd65c Author: Attila Szűcs AuthorDate: Wed Oct 25 11:40:23 2023 +0200 Commit: Caolán McNamara CommitDate: Mon Oct 30 00:39:12 2023 +0100 tdf#157663 SW: reenable move recognition improvements Re-enabled the improvement of move recognition in redlines, that is able to recognize movements split into more redlines. Probably it does not effect performance too much, but if in some cases it would become a problem then this small patch can be reverted easily. Change-Id: I6598d4d4f98f472f3972aec41b82ec26d90db860 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158455 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158612 diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 02ded9bc1acd..26a3c7bc24df 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -908,11 +908,7 @@ bool SwRedlineTable::isMoved(size_type rPos) const if (isMovedImpl(rPos, false)) return true; else -{ -// Commented out because of probably performance issue -//return isMovedImpl(rPos, true); -return false; -} +return isMovedImpl(rPos, true); } bool SwRedlineTable::isMovedImpl(size_type rPos, bool bTryCombined) const @@ -982,7 +978,7 @@ bool SwRedlineTable::isMovedImpl(size_type rPos, bool bTryCombined) const size_type nStart = rPos > nLookahead ? rPos - nLookahead : 0; // first, try to compare to single redlines // next, try to compare to combined redlines -for (int nPass = 0; nPass < (bTryCombined ? 2 : 1) && !bRet; nPass++) +for (int nPass = 0; nPass < 2 && !bRet; nPass++) { for (size_type nPosAct = nStart; nPosAct < nEnd && !bRet; ++nPosAct) {
[Libreoffice-commits] core.git: include/xmloff schema/libreoffice sw/inc sw/qa sw/source writerfilter/source xmloff/source
include/xmloff/txtimp.hxx |2 include/xmloff/xmltoken.hxx |1 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |9 sw/inc/IDocumentContentOperations.hxx |2 sw/inc/crsrsh.hxx |2 sw/inc/docary.hxx |8 sw/inc/redline.hxx | 21 sw/inc/unoprnms.hxx |1 sw/qa/extras/layout/layout2.cxx |7 sw/qa/extras/uiwriter/data/tdf157663_redlineMove.odt|binary sw/qa/extras/uiwriter/uiwriter5.cxx | 136 + sw/source/core/doc/DocumentContentOperationsManager.cxx |9 sw/source/core/doc/DocumentRedlineManager.cxx | 201 --- sw/source/core/doc/doccomp.cxx |4 sw/source/core/doc/docnum.cxx |8 sw/source/core/doc/docredln.cxx | 304 +--- sw/source/core/inc/DocumentContentOperationsManager.hxx |2 sw/source/core/inc/DocumentRedlineManager.hxx | 14 sw/source/core/unocore/unocrsrhelper.cxx| 11 sw/source/core/unocore/unoredline.cxx |4 sw/source/filter/basflt/fltshell.cxx|1 sw/source/filter/ww8/writerhelper.cxx |2 sw/source/filter/xml/XMLRedlineImportHelper.cxx | 15 sw/source/filter/xml/XMLRedlineImportHelper.hxx |1 sw/source/filter/xml/xmltexti.cxx |3 sw/source/filter/xml/xmltexti.hxx |1 writerfilter/source/dmapper/DomainMapper_Impl.cxx | 45 + writerfilter/source/dmapper/DomainMapper_Impl.hxx |4 xmloff/source/core/xmltoken.cxx |1 xmloff/source/text/XMLChangeInfoContext.cxx |7 xmloff/source/text/XMLChangeInfoContext.hxx |1 xmloff/source/text/XMLChangedRegionImportContext.cxx|5 xmloff/source/text/XMLChangedRegionImportContext.hxx|3 xmloff/source/text/XMLRedlineExport.cxx |9 xmloff/source/text/txtimp.cxx |1 xmloff/source/token/tokens.txt |1 36 files changed, 666 insertions(+), 180 deletions(-) New commits: commit e4fb4937b3f75ce3544f8de354ed92f7dd314511 Author: Attila Szűcs AuthorDate: Tue Oct 17 09:31:22 2023 +0200 Commit: Caolán McNamara CommitDate: Sun Oct 29 19:30:43 2023 +0100 tdf#157663 SW: Tracked change improve move Made accept/reject handle move redlines other pair, (moveto-movefrom) and handle the whole move redline, even if it is split into small pieces that separated from each other. Added unique ID to every move redline to help find their other parts. This move ID is generated in case of: move recognition moveing a paragraph. (directly create move redline with unique id without calling the recognition it is faster and more stable) (there are other cases that could be improved to not use recognition, but generate ID directly, like moveing selected partial text with mouse) Implemented the odt export/import of this move ID. it is a tag like this: "4" next to creator/date Improved the docx import to generate this move ID, so move redlines can find their other parts (Not changed Docx export... it works a bit, but far from perfect) Improved move reckognition: It can find them even if they are split into multiple parts differently. (like "ab"+"cd" == "a"+"bcd") Disabled this because of probably performance issue. made a complex unit test for it. Note: Left the move recognition on every place, to avoid as much regressions as possible.. but in the future, we may can disable it in some cases. Note2: We will have to keep move recognitnion, because there are documents from past, saved without any move informations in the file, and users expect to see move redlines there. (generated by the recognition.) Change-Id: If968d4235b676c5e538cfaf4187a4482a86eae9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157740 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158611 Tested-by: Jenkins diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx index 24caf36e53d7..c04e577c6573 100644 --- a/include/xmloff/txtimp.hxx +++ b/include/xmloff/txtimp.hxx @@ -381,6 +381,8 @@ public: const OUString& rComment, /// date+time const css::util::DateTime& rDateTime, +/// move
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source
sw/source/core/doc/docredln.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit ff767b645077c1b10dc541ee2a202ff94446f604 Author: Attila Szűcs AuthorDate: Thu Oct 26 23:11:03 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Oct 27 10:15:18 2023 +0200 tdf#157662 SW: fix connected area calculation Reset pRedline to its origin value between the 2 loops, because the 1. loop may change it. without this fix, if it discover neightbours in the 1. direction, it will not discover them in the other direction. Change-Id: Ia1ab357ada17cb7574907a3aa1bf0dd4d7a90255 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158517 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 4d3493515d6a..c5a6b6885a71 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -811,6 +811,7 @@ void SwRedlineTable::getConnectedArea(size_type nPosOrigin, size_type& rPosStart rPosStart--; pRedline = pOther; } +pRedline = pOrigin; while (rPosEnd + 1 < size() && (pOther = (*this)[rPosEnd + 1]) && lcl_CanCombineWithRange(pOrigin, pRedline, pOther, false, bCheckChilds)) {
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/inc sw/source
sw/inc/IDocumentRedlineAccess.hxx |3 +- sw/source/core/doc/DocumentRedlineManager.cxx | 33 +- sw/source/core/doc/docnum.cxx |2 - sw/source/core/inc/DocumentRedlineManager.hxx |5 +++ 4 files changed, 39 insertions(+), 4 deletions(-) New commits: commit c48bf3432dc894069090a4bd874c294d99224585 Author: Attila Szűcs AuthorDate: Thu Oct 26 01:51:40 2023 +0200 Commit: Caolán McNamara CommitDate: Thu Oct 26 11:45:59 2023 +0200 tdf#157663 SW: fix redline continueing a move Subsequent moves generated new MoveID's, like if they were separete moves. That cause moves to forgot their other parts. Now, if we move a redline that was moved by us it will re-use its moveID as if it was just the continue of the previous movement. It does not work if we move more then 1 of our own movement redlines Note: There are complex cases what it cannot handle.. in those case it just use the new ID, so the newly moved part, will forgot its relation with the old move oroginal parts. Complex case is like.. if we move 2 of our own move redlines, that means there will be 2 MoveId we would want to continue, but only 1 insert redline to write that MoveID. But as long as we moved only 1 of our redlines it will work, even if there are more text redlines, even move redlines of other author. Other move redlines will be separate move anyway. Note2: In complex cases, we may could connect movements. Or we could split the new inserted move part. but those are design questions, they may be not good idea.. and the split one is probably more work to implement. Change-Id: Icb2adf43272181c6a63a4a84750352f4b163383a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158473 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sw/inc/IDocumentRedlineAccess.hxx b/sw/inc/IDocumentRedlineAccess.hxx index e163eb16a6c6..07961a02d9e3 100644 --- a/sw/inc/IDocumentRedlineAccess.hxx +++ b/sw/inc/IDocumentRedlineAccess.hxx @@ -148,7 +148,8 @@ public: MERGED if pNewRedl was deleted but has been merged with existing one IGNORED if pNewRedl was deleted and ignored/invalid */ -virtual AppendResult AppendRedline(/*[in]*/SwRangeRedline* pNewRedl, /*[in]*/bool bCallDelete) = 0; +virtual AppendResult AppendRedline(/*[in]*/ SwRangeRedline* pNewRedl, /*[in]*/ bool bCallDelete, + /*[in]*/ sal_uInt32 nMoveIDToDelete = 0) = 0; virtual bool AppendTableRowRedline(/*[in]*/SwTableRowRedline* pPtr) = 0; virtual bool AppendTableCellRedline(/*[in]*/SwTableCellRedline* pPtr) = 0; diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 531e76614622..657a67a61720 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -1265,7 +1265,8 @@ Behaviour of Delete-Redline: the Delete */ IDocumentRedlineAccess::AppendResult -DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCallDelete) +DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCallDelete, + sal_uInt32 nMoveIDToDelete) { CHECK_REDLINE( *this ) @@ -1286,6 +1287,9 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall return AppendResult::IGNORED; } +// Collect MoveID's of the redlines we delete. +// If there is only 1, then we should use its ID. (continuing the move) +std::set deletedMoveIDs; bool bMerged = false; @@ -1763,6 +1767,16 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall // and anonymized insertion, i.e. with the same dummy timestamp !pRedl->GetRedlineData(0).IsAnonymized() ) { +// Collect MoveID's of the redlines we delete. +if (nMoveIDToDelete > 1 && maRedlineTable[n]->GetMoved() > 0 +&& (eCmpPos == SwComparePosition::Equal +|| eCmpPos == SwComparePosition::Inside +|| eCmpPos == SwComparePosition::Outside +|| eCmpPos == SwComparePosition::OverlapBefore +|| eCmpPos == SwComparePosition::OverlapBehind)) +{ +deletedMoveIDs.insert(maRedlineTable[n]->GetMoved()); +} // Set to NONE, so that the Delete::Redo merges the Redline data correctly! // The ShowMode needs to be retained! @@ -2378,6 +2392,23 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } } +// If we deleted
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/inc sw/source
sw/inc/IDocumentRedlineAccess.hxx |9 ++ sw/source/core/doc/DocumentContentOperationsManager.cxx |9 ++ sw/source/core/doc/DocumentRedlineManager.cxx | 53 +++- sw/source/core/inc/DocumentRedlineManager.hxx | 10 +++ 4 files changed, 78 insertions(+), 3 deletions(-) New commits: commit 9e94583a481b217694bfa21cf4136adc6ab3203b Author: Attila Szűcs AuthorDate: Wed Oct 25 12:46:10 2023 +0200 Commit: Caolán McNamara CommitDate: Thu Oct 26 09:35:04 2023 +0200 SW: fixed redline SwPosition update problem When nodes are removed, SwPosition nNode is updated, but its nContent is not. If nNode change from a non-ContentNodo to a ContentNode, then it is a problem, as nContent 's m_pContentNode remains nullptr, so the Position seems to be inconsistent. Now when redline remove nodes, it check what redlines may effected it, and update them after the node deletion happened. Probably this bug should be handled deeper, as this problem probably effect every SwPosition.. not sure if it can be a problem elsewhere. A special case when it happens, if there is a Table between 2 text. And there are 2 redlines.. 1: any redline positioned 'text start'-'table start' 2: delete redline: 'table begin'-'table end' now if we accept the 2. redline .. that remove the table the 1. redline position will change to: 'text start'-'next text start' but its end's nContent.m_pContentNode remain nullptr so lcl_CheckPosition(...) will assert Change-Id: I2981fd0218a375994d3f55cb5d3463b17ca35849 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158456 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sw/inc/IDocumentRedlineAccess.hxx b/sw/inc/IDocumentRedlineAccess.hxx index f5367715354f..e163eb16a6c6 100644 --- a/sw/inc/IDocumentRedlineAccess.hxx +++ b/sw/inc/IDocumentRedlineAccess.hxx @@ -169,6 +169,11 @@ public: /*[in]*/const SwNode& rNode, /*[in]*/RedlineType nType) const = 0; +virtual SwRedlineTable::size_type GetRedlineEndPos( +/*[in]*/ SwRedlineTable::size_type nStartPos, +/*[in]*/ const SwNode& rNode, +/*[in]*/ RedlineType nType) const = 0; + virtual bool HasRedline( /*[in]*/const SwPaM& rPam, /*[in]*/RedlineType nType, @@ -227,6 +232,10 @@ public: virtual void SetRedlinePassword( /*[in]*/const css::uno::Sequence & rNewPassword) = 0; +virtual void UpdateRedlineContentNode(/*[in]*/ SwRedlineTable::size_type nStartPos, + /*[in]*/ SwRedlineTable::size_type nEndPos) const = 0; + + protected: virtual ~IDocumentRedlineAccess() {}; }; diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 51314f1a7fe1..e2ba9748c503 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -2141,8 +2141,17 @@ void DocumentContentOperationsManager::DeleteDummyChar( void DocumentContentOperationsManager::DeleteRange( SwPaM & rPam ) { +// Seek all redlines that are in that PaM to be deleted.. +SwRedlineTable::size_type nRedlStart = m_rDoc.getIDocumentRedlineAccess().GetRedlinePos( +rPam.Start()->GetNode(), RedlineType::Any); +SwRedlineTable::size_type nRedlEnd = m_rDoc.getIDocumentRedlineAccess().GetRedlineEndPos( +nRedlStart, rPam.End()->GetNode(), RedlineType::Any); + lcl_DoWithBreaks(*this, rPam, SwDeleteFlags::Default, ::DeleteRangeImpl); +// update all redlines was in the Pam that is +m_rDoc.getIDocumentRedlineAccess().UpdateRedlineContentNode(nRedlStart, nRedlEnd); + if (!m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty()) { diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 0a5367e89107..531e76614622 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -53,9 +53,8 @@ using namespace com::sun::star; // 2. check that position is valid and doesn't point after text void lcl_CheckPosition( const SwPosition* pPos ) { -// Commented out because of a random problem, that happened even before my patch -//assert(dynamic_cast(>GetNode()) -//== pPos->GetContentNode()); +assert(dynamic_cast(>GetNode()) +== pPos->GetContentNode()); SwTextNode* pTextNode = pPos->GetNode().GetTextNode(); if( pTextNode == nullptr ) @@ -2758,6 +2757,54 @@ SwRedlineTable::size_type DocumentRedlineManager::GetRedlinePos( const SwNode& r // #TODO - add 'SwExtraRedlineTable' also ? }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source
sw/source/uibase/misc/redlndlg.cxx |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit 6c3cf5c000ce8c1e82bd834995d1ee52f8c2baeb Author: Attila Szűcs AuthorDate: Wed Oct 25 13:09:22 2023 +0200 Commit: Caolán McNamara CommitDate: Thu Oct 26 09:32:18 2023 +0200 SW: small fix for manage changes dialog. Fixed a continue, as it was planned to effect the outer loop. (probably when it was replaced to an inner loop it was forgot to handle) fixed a nullptr check also. These problems may not result real problem right now, but when interdependedt redlines will be improved, they will result in problems. Change-Id: Ie139f9a657abbacea9450176d2fe138392beddfa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158457 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index de5310de0311..401998451fc4 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -434,13 +434,16 @@ void SwRedlineAcceptDlg::Activate() { while (pRedlineData) { -if (pRedlineData != pBackupData->pChild) +if (!pBackupData || pRedlineData != pBackupData->pChild) { // Redline-Children were inserted, changed or deleted i = CalcDiff(i, true); if (i == SwRedlineTable::npos) return; -continue; + +// here was a continue; targetted to the outer loop +// now a break will do, as there is nothing after it in the outer loop +break; } pBackupData = pBackupData->pNext; pRedlineData = pRedlineData->Next();
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source
sw/source/core/doc/docredln.cxx |8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) New commits: commit 94d578ea6009cfc44cc512171fd453bb0286888b Author: Attila Szűcs AuthorDate: Wed Oct 25 11:40:23 2023 +0200 Commit: Caolán McNamara CommitDate: Thu Oct 26 09:30:11 2023 +0200 tdf#157663 SW: reenable move recognition improvements Re-enabled the improvement of move recognition in redlines, that is able to recognize movements split into more redlines. Probably it does not effect performance too much, but if in some cases it would become a problem then this small patch can be reverted easily. Change-Id: I6598d4d4f98f472f3972aec41b82ec26d90db860 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158455 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 95498d625c90..4d3493515d6a 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -873,11 +873,7 @@ bool SwRedlineTable::isMoved(size_type rPos) const if (isMovedImpl(rPos, false)) return true; else -{ -// Commented out because of probably performance issue -//return isMovedImpl(rPos, true); -return false; -} +return isMovedImpl(rPos, true); } bool SwRedlineTable::isMovedImpl(size_type rPos, bool bTryCombined) const @@ -947,7 +943,7 @@ bool SwRedlineTable::isMovedImpl(size_type rPos, bool bTryCombined) const size_type nStart = rPos > nLookahead ? rPos - nLookahead : 0; // first, try to compare to single redlines // next, try to compare to combined redlines -for (int nPass = 0; nPass < (bTryCombined ? 2 : 1) && !bRet; nPass++) +for (int nPass = 0; nPass < 2 && !bRet; nPass++) { for (size_type nPosAct = nStart; nPosAct < nEnd && !bRet; ++nPosAct) {
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/xmloff schema/libreoffice sw/inc sw/qa sw/source writerfilter/source xmloff/source
include/xmloff/txtimp.hxx |2 include/xmloff/xmltoken.hxx |1 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |9 sw/inc/IDocumentContentOperations.hxx |2 sw/inc/crsrsh.hxx |2 sw/inc/docary.hxx |8 sw/inc/redline.hxx | 21 sw/inc/unoprnms.hxx |1 sw/qa/extras/layout/layout2.cxx |7 sw/qa/extras/uiwriter/data/tdf157663_redlineMove.odt|binary sw/qa/extras/uiwriter/uiwriter5.cxx | 134 + sw/source/core/doc/DocumentContentOperationsManager.cxx |9 sw/source/core/doc/DocumentRedlineManager.cxx | 201 --- sw/source/core/doc/doccomp.cxx |4 sw/source/core/doc/docnum.cxx |8 sw/source/core/doc/docredln.cxx | 302 +--- sw/source/core/inc/DocumentContentOperationsManager.hxx |2 sw/source/core/inc/DocumentRedlineManager.hxx | 14 sw/source/core/unocore/unocrsrhelper.cxx| 11 sw/source/core/unocore/unoredline.cxx |4 sw/source/filter/basflt/fltshell.cxx|1 sw/source/filter/ww8/writerhelper.cxx |2 sw/source/filter/xml/XMLRedlineImportHelper.cxx | 15 sw/source/filter/xml/XMLRedlineImportHelper.hxx |1 sw/source/filter/xml/xmltexti.cxx |3 sw/source/filter/xml/xmltexti.hxx |1 writerfilter/source/dmapper/DomainMapper_Impl.cxx | 45 + writerfilter/source/dmapper/DomainMapper_Impl.hxx |4 xmloff/source/core/xmltoken.cxx |1 xmloff/source/text/XMLChangeInfoContext.cxx |7 xmloff/source/text/XMLChangeInfoContext.hxx |1 xmloff/source/text/XMLChangedRegionImportContext.cxx|5 xmloff/source/text/XMLChangedRegionImportContext.hxx|3 xmloff/source/text/XMLRedlineExport.cxx |9 xmloff/source/text/txtimp.cxx |1 xmloff/source/token/tokens.txt |1 36 files changed, 663 insertions(+), 179 deletions(-) New commits: commit bf5cbc6adfd7cfcd0d59277a8b1899642038ac88 Author: Attila Szűcs AuthorDate: Tue Oct 17 09:31:22 2023 +0200 Commit: Caolán McNamara CommitDate: Wed Oct 25 09:43:16 2023 +0200 tdf#157663 SW: Tracked change improve move Made accept/reject handle move redlines other pair, (moveto-movefrom) and handle the whole move redline, even if it is split into small pieces that separated from each other. Added unique ID to every move redline to help find their other parts. This move ID is generated in case of: move recognition moveing a paragraph. (directly create move redline with unique id without calling the recognition it is faster and more stable) (there are other cases that could be improved to not use recognition, but generate ID directly, like moveing selected partial text with mouse) Implemented the odt export/import of this move ID. it is a tag like this: "4" next to creator/date Improved the docx import to generate this move ID, so move redlines can find their other parts (Not changed Docx export... it works a bit, but far from perfect) Improved move reckognition: It can find them even if they are split into multiple parts differently. (like "ab"+"cd" == "a"+"bcd") Disabled this because of probably performance issue. made a complex unit test for it. Note: Left the move recognition on every place, to avoid as much regressions as possible.. but in the future, we may can disable it in some cases. Note2: We will have to keep move recognitnion, because there are documents from past, saved without any move informations in the file, and users expect to see move redlines there. (generated by the recognition.) Change-Id: If968d4235b676c5e538cfaf4187a4482a86eae9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157740 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx index 218db6fa7acd..0320c5360aa6 100644 --- a/include/xmloff/txtimp.hxx +++ b/include/xmloff/txtimp.hxx @@ -381,6 +381,8 @@ public: const OUString& rComment, /// date+time const css::util::DateTime& rDateTime, +/// move id, to find other parts (moveFrom/MoveTo) +const OUString& rMoveId,
[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source vcl/jsdialog vcl/source
sw/inc/view.hxx|1 + sw/source/uibase/inc/conttree.hxx |3 +++ sw/source/uibase/utlui/content.cxx | 29 + sw/source/uibase/utlui/navipi.cxx | 10 ++ vcl/jsdialog/executor.cxx | 10 ++ vcl/source/treelist/svtabbx.cxx|4 6 files changed, 53 insertions(+), 4 deletions(-) New commits: commit 3649dc202bedf72e37c77993a1f7027bfdfc6d9e Author: Attila Szűcs AuthorDate: Thu Jun 29 18:32:27 2023 +0200 Commit: Caolán McNamara CommitDate: Mon Oct 16 11:39:39 2023 +0200 LOK: Navigator: fix expand problems Save/load content types' expanded status to view, and make sure it is synchronized with client. Treeviews now receive/send collapse event/status from/to client. I've rewritten the way how headings are opened by default (because synch of collapsed status broke that, as sub-headings were not expanded at core side). Change-Id: I80f5b4d99fe5224391a92c4609f94ddbcf37b8ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153771 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit b95750af717e0693a13c3ef3529e1394e0ae) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158016 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index c5967bb4e213..523f86cc8468 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -355,6 +355,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell public: // #i123922# Needs to be called from a 2nd place now as a helper method SAL_DLLPRIVATE bool InsertGraphicDlg( SfxRequest& ); +sal_Int32 m_nNaviExpandedStatus = -1; protected: diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index 495cdfa91353..9c6db5b5a5eb 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -274,6 +274,8 @@ public: // return true if it has any children bool RequestingChildren(const weld::TreeIter& rParent); +void ExpandAllHeadings(); + virtual void Notify(SfxBroadcaster& rBC, SfxHint const& rHint) override; sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index d047251ea958..02d3a661e4d1 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1135,6 +1135,12 @@ SwContentTree::SwContentTree(std::unique_ptr xTreeView, SwNaviga OUString sDocTitle = pView->GetDocShell()->GetTitle(); if (lcl_DocOutLineExpandStateMap.find(sDocTitle) != lcl_DocOutLineExpandStateMap.end()) mOutLineNodeMap = lcl_DocOutLineExpandStateMap[sDocTitle]; +if (comphelper::LibreOfficeKit::isActive()) { +if (pView->m_nNaviExpandedStatus < 0) +m_nActiveBlock = 1; +else +m_nActiveBlock = pView->m_nNaviExpandedStatus; +} } m_aUpdTimer.SetInvokeHandler(LINK(this, SwContentTree, TimerUpdate)); @@ -1149,6 +1155,8 @@ SwContentTree::~SwContentTree() { OUString sDocTitle = pView->GetDocShell()->GetTitle(); lcl_DocOutLineExpandStateMap[sDocTitle] = mOutLineNodeMap; +if (comphelper::LibreOfficeKit::isActive()) +pView->m_nNaviExpandedStatus = m_nActiveBlock; } clear(); // If applicable erase content types previously. m_aUpdTimer.Stop(); @@ -2225,6 +2233,19 @@ bool SwContentTree::RequestingChildren(const weld::TreeIter& rParent) return false; } +void SwContentTree::ExpandAllHeadings() +{ +if (HasHeadings()) +{ +std::unique_ptr xEntry = GetEntryAtAbsPos(0); +if (xEntry) +{ +if (!IsAllExpanded(*m_xTreeView, *xEntry)) +ExpandOrCollapseAll(*m_xTreeView, *xEntry); +} +} +} + SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt) { SdrObject *pRetObj = nullptr; diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index c868592e904d..3fd5b7f9b682 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -736,12 +736,11 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xGlobalTree->HideTree(); //Open Headings by default -if (m_xContentTree->HasHeadings()) +SwView *pView = GetCreateView(); +if (pView->m_nNaviExpandedStatus < 0) { -auto& pTreeView = m_xContentTree->get_widget(); -std::unique_ptr itEntry(pTreeView.make_iterator()); -pTreeView.get_iter_first(*itEntry); -pTreeView.expand_row(*itEntry); +pView->m_nNaviExpandedStatus = 1; +m_xContentTree->ExpandAllHeadings(); } } } diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 17c56d78e61e..46d5fb675366 100644 ---
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/content.cxx | 29 + 1 file changed, 29 insertions(+) New commits: commit 52500239e8a5a8c897a1af25b40e6b4d004eb21b Author: Attila Szűcs AuthorDate: Thu Jun 8 11:21:16 2023 +0200 Commit: Caolán McNamara CommitDate: Sun Oct 15 11:25:51 2023 +0200 LOK: navigator: hide empty contentTypes In case of LOK, do not insert empty contenttype to tree, and implement new way to find changes in contents, in hidden contentTypes, because the original checked only on the tree. Change-Id: Ib1e4da5e05b2ad4161c6a66a9c54111d558f66f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152735 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit ed3bb61461e4e394bd476b4ec57ff3025eca153f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157983 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 64e2c4aad25b..ca4e431f8038 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include #include #include #include @@ -2616,6 +2617,13 @@ void SwContentTree::Display( bool bActive ) OUString aImage(GetImageIdForContentTypeId(nCntType)); bool bChOnDemand = 0 != rpContentT->GetMemberCount(); + +// In case of LOK, empty content types must be hidden in the contenttree +if (comphelper::LibreOfficeKit::isActive() && !bChOnDemand) +{ +continue; +} + OUString sId(weld::toId(rpContentT.get())); insert(nullptr, rpContentT->GetName(), sId, bChOnDemand, xEntry.get()); m_xTreeView->set_image(*xEntry, aImage); @@ -3010,6 +3018,27 @@ bool SwContentTree::HasContentChanged() // is detected only fill member lists for remaining content types. The Display function // will clear and recreate the treeview from the content type member arrays if content has // changed. + +if (comphelper::LibreOfficeKit::isActive()) +{ +// In case of LOK, empty contentTypes are hidden, even in all content view +// so it is not enough to check only the m_xTreeView. +bool bCountChanged = false; +for (ContentTypeId i : o3tl::enumrange()) +{ +if (m_aActiveContentArr[i]) +{ +auto nLastTMCount = m_aActiveContentArr[i]->GetMemberCount(); +m_aActiveContentArr[i]->FillMemberList(); +// If the member count of a type is changed, then the content is surely changed +if (m_aActiveContentArr[i]->GetMemberCount() != nLastTMCount) +bCountChanged = true; +} +} +if (bCountChanged) +return true; +} + std::unique_ptr xEntry(m_xTreeView->make_iterator()); // lambda function to find the next content type entry
[Libreoffice-commits] core.git: sw/inc sw/qa sw/source
sw/inc/IDocumentRedlineAccess.hxx | 16 sw/inc/redline.hxx |2 sw/qa/extras/uiwriter/data/tdf157662_redlineNestedInsertDelete.odt |binary sw/qa/extras/uiwriter/uiwriter5.cxx| 62 ++ sw/source/core/doc/DocumentRedlineManager.cxx | 274 +- sw/source/core/doc/docredln.cxx| 35 + sw/source/core/edit/edredln.cxx|4 sw/source/core/inc/DocumentRedlineManager.hxx | 19 sw/source/core/inc/UndoCore.hxx|4 sw/source/core/inc/UndoRedline.hxx | 10 sw/source/core/undo/undobj.cxx |4 sw/source/core/undo/unredln.cxx| 25 12 files changed, 419 insertions(+), 36 deletions(-) New commits: commit 52fa7aed48632166e064e6a227e034f0981c4205 Author: Attila Szűcs AuthorDate: Mon Aug 28 07:40:20 2023 +0200 Commit: Caolán McNamara CommitDate: Sat Oct 14 11:55:27 2023 +0200 tdf#157662 SW: redline: accept/reject done for all parts Tracked changes divided into smaller parts when they are overlapping. But if the Author, and Change time, and some more is equal, then they can be combined into 1 change later.. Modified AcceptRedline / RejectRedline, to seek for all these parts that are neightbour to each other, and can be combined, and reject/accept them all at once. Even those that are deepen in the tree. i.e.: insert that have a delete redline too. when rejecting an insert redline, that have a delete redline too, the delete redline is accepted instead. (have the same result.) when accepting an insert redline, that have a delete redline too, The delete redline remains, while the insert is deleted. (=accepted) made some limitations to lessen the probability of regression: No anonym, No table, No seqNo, and dont use it in RejectAll/AcceptAll Added unittest to check that accept/reject handle more redlines at once, but not too many.. Change-Id: Ibd0a39f7847b22b279a797babb30ba162e70a513 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157950 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sw/inc/IDocumentRedlineAccess.hxx b/sw/inc/IDocumentRedlineAccess.hxx index 73f87fa8c799..c2b71aa1005a 100644 --- a/sw/inc/IDocumentRedlineAccess.hxx +++ b/sw/inc/IDocumentRedlineAccess.hxx @@ -183,15 +183,23 @@ public: virtual void SetRedlineMove(/*[in]*/bool bFlag) = 0; -virtual bool AcceptRedline(/*[in]*/SwRedlineTable::size_type nPos, /*[in]*/bool bCallDelete) = 0; +virtual bool AcceptRedline(/*[in]*/ SwRedlineTable::size_type nPos, /*[in]*/ bool bCallDelete, + /*[in]*/ bool bRange = false) += 0; -virtual bool AcceptRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete) = 0; +virtual bool AcceptRedline(/*[in]*/ const SwPaM& rPam, /*[in]*/ bool bCallDelete, + /*[in]*/ sal_Int8 nDepth = 0) += 0; virtual void AcceptRedlineParagraphFormatting(/*[in]*/const SwPaM& rPam ) = 0; -virtual bool RejectRedline(/*[in]*/SwRedlineTable::size_type nPos, /*[in]*/bool bCallDelete) = 0; +virtual bool RejectRedline(/*[in]*/ SwRedlineTable::size_type nPos, + /*[in]*/ bool bCallDelete, /*[in]*/ bool bRange = false) += 0; -virtual bool RejectRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete) = 0; +virtual bool RejectRedline(/*[in]*/ const SwPaM& rPam, /*[in]*/ bool bCallDelete, + /*[in]*/ sal_Int8 nDepth = 0) += 0; virtual const SwRangeRedline* SelNextRedline(/*[in]*/SwPaM& rPam) const = 0; diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx index 7ef6b9cad20f..d8eba6480618 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -144,6 +144,7 @@ public: void SetMoved() { m_bMoved = true; } bool IsMoved() const { return m_bMoved; } bool CanCombine( const SwRedlineData& rCmp ) const; +bool CanCombineForAcceptReject( const SwRedlineData& rCmp ) const; // ExtraData gets copied, the pointer is therefore not taken over by // the RedlineObject @@ -261,6 +262,7 @@ public: void PushData( const SwRangeRedline& rRedl, bool bOwnAsNext = true ); bool PopData(); +bool PopAllDataAfter(int depth); /** Returns textual description of a redline data element of diff --git a/sw/qa/extras/uiwriter/data/tdf157662_redlineNestedInsertDelete.odt b/sw/qa/extras/uiwriter/data/tdf157662_redlineNestedInsertDelete.odt new file mode 100644 index ..d97521559a84 Binary files /dev/null and
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/inc sw/qa sw/source
sw/inc/IDocumentRedlineAccess.hxx | 16 sw/inc/redline.hxx |2 sw/qa/extras/uiwriter/data/tdf157662_redlineNestedInsertDelete.odt |binary sw/qa/extras/uiwriter/uiwriter5.cxx| 62 ++ sw/source/core/doc/DocumentRedlineManager.cxx | 274 +- sw/source/core/doc/docredln.cxx| 35 + sw/source/core/edit/edredln.cxx|4 sw/source/core/inc/DocumentRedlineManager.hxx | 19 sw/source/core/inc/UndoCore.hxx|4 sw/source/core/inc/UndoRedline.hxx | 10 sw/source/core/undo/undobj.cxx |4 sw/source/core/undo/unredln.cxx| 25 12 files changed, 419 insertions(+), 36 deletions(-) New commits: commit 4fccf983f0750a576fc99712877e41fb34300897 Author: Attila Szűcs AuthorDate: Mon Aug 28 07:40:20 2023 +0200 Commit: Caolán McNamara CommitDate: Fri Oct 13 13:51:44 2023 +0200 tdf#157662 SW: redline: accept/reject done for all parts Tracked changes divided into smaller parts when they are overlapping. But if the Author, and Change time, and some more is equal, then they can be combined into 1 change later.. Modified AcceptRedline / RejectRedline, to seek for all these parts that are neightbour to each other, and can be combined, and reject/accept them all at once. Even those that are deepen in the tree. i.e.: insert that have a delete redline too. when rejecting an insert redline, that have a delete redline too, the delete redline is accepted instead. (have the same result.) when accepting an insert redline, that have a delete redline too, The delete redline remains, while the insert is deleted. (=accepted) made some limitations to lessen the probability of regression: No anonym, No table, No seqNo, and dont use it in RejectAll/AcceptAll Added unittest to check that accept/reject handle more redlines at once, but not too many.. Change-Id: Ibd0a39f7847b22b279a797babb30ba162e70a513 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156179 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sw/inc/IDocumentRedlineAccess.hxx b/sw/inc/IDocumentRedlineAccess.hxx index 24073b25930c..f5367715354f 100644 --- a/sw/inc/IDocumentRedlineAccess.hxx +++ b/sw/inc/IDocumentRedlineAccess.hxx @@ -184,15 +184,23 @@ public: virtual void SetRedlineMove(/*[in]*/bool bFlag) = 0; -virtual bool AcceptRedline(/*[in]*/SwRedlineTable::size_type nPos, /*[in]*/bool bCallDelete) = 0; +virtual bool AcceptRedline(/*[in]*/ SwRedlineTable::size_type nPos, /*[in]*/ bool bCallDelete, + /*[in]*/ bool bRange = false) += 0; -virtual bool AcceptRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete) = 0; +virtual bool AcceptRedline(/*[in]*/ const SwPaM& rPam, /*[in]*/ bool bCallDelete, + /*[in]*/ sal_Int8 nDepth = 0) += 0; virtual void AcceptRedlineParagraphFormatting(/*[in]*/const SwPaM& rPam ) = 0; -virtual bool RejectRedline(/*[in]*/SwRedlineTable::size_type nPos, /*[in]*/bool bCallDelete) = 0; +virtual bool RejectRedline(/*[in]*/ SwRedlineTable::size_type nPos, + /*[in]*/ bool bCallDelete, /*[in]*/ bool bRange = false) += 0; -virtual bool RejectRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete) = 0; +virtual bool RejectRedline(/*[in]*/ const SwPaM& rPam, /*[in]*/ bool bCallDelete, + /*[in]*/ sal_Int8 nDepth = 0) += 0; virtual const SwRangeRedline* SelNextRedline(/*[in]*/SwPaM& rPam) const = 0; diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx index 1fccb405e192..8dfb81fd140b 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -144,6 +144,7 @@ public: void SetMoved() { m_bMoved = true; } bool IsMoved() const { return m_bMoved; } bool CanCombine( const SwRedlineData& rCmp ) const; +bool CanCombineForAcceptReject( const SwRedlineData& rCmp ) const; // ExtraData gets copied, the pointer is therefore not taken over by // the RedlineObject @@ -259,6 +260,7 @@ public: void PushData( const SwRangeRedline& rRedl, bool bOwnAsNext = true ); bool PopData(); +bool PopAllDataAfter(int depth); /** Returns textual description of a redline data element of diff --git a/sw/qa/extras/uiwriter/data/tdf157662_redlineNestedInsertDelete.odt b/sw/qa/extras/uiwriter/data/tdf157662_redlineNestedInsertDelete.odt new file mode 100644 index ..d97521559a84 Binary files /dev/null and
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/sfx2 officecfg/registry sc/inc sc/qa sc/source sc/uiconfig
include/sfx2/docfilt.hxx |1 officecfg/registry/schema/org/openoffice/Office/Calc.xcs |7 sc/inc/appoptio.hxx |4 sc/inc/sc.hrc |1 sc/qa/uitest/calc_tests9/tdf156611_hyperlink_interoper.py | 124 ++ sc/source/core/tool/appoptio.cxx | 13 + sc/source/ui/app/scmod.cxx| 10 + sc/source/ui/inc/editsh.hxx |1 sc/source/ui/inc/tpcompatibility.hxx |1 sc/source/ui/optdlg/tpcompatibility.cxx | 15 + sc/source/ui/view/editsh.cxx | 95 +- sc/uiconfig/scalc/ui/optcompatibilitypage.ui | 60 ++ 12 files changed, 316 insertions(+), 16 deletions(-) New commits: commit e75f5bdaea570696e1a4fad9c95310781bf60009 Author: Attila Szűcs AuthorDate: Mon Jul 31 04:37:07 2023 +0200 Commit: Andras Timar CommitDate: Sat Aug 26 11:34:38 2023 +0200 tdf#156611 SC: hyperlink option for MS behaviour Added an options that can limit Calc to behave like MS excel in case of inserting hyperlinks, when MS format document is used. Tools -> Options -> LibreOfficeDev Calc -> Compatibility -> Hyperlinks In MS excel, only cells can have a hyperlink, and only 1. In Calc even textfields in a cell can have hyperlinks, so it can have multiple links in a cell, but once saved as MS format, and reloaded, textfield links will become cell links, if there was 1 link in the cell. If there was more links in the cell, then all will be lost. So, when MS excel format document is edited in calc, the ability to make text field links is useless can be missleading, and confuse users. If this option is set, and an MS file format is opened, then insering a hyperlink will work like if we selected the whole cell to insert the hyperlink. Change-Id: I7174216d10cf250d48f23f71ae681c46f7610bbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155079 Tested-by: Jenkins Reviewed-by: Caolán McNamara Reviewed-by: Tomaž Vajngerl (cherry picked from commit 24cd55341bc3f3e8ed9d5ff23efd47a53532f283) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156009 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx index 9dbbb37b87d2..45dd0efb9b29 100644 --- a/include/sfx2/docfilt.hxx +++ b/include/sfx2/docfilt.hxx @@ -80,6 +80,7 @@ public: bool GetSupportsSigning() const { return bool(nFormatType & SfxFilterFlags::SUPPORTSSIGNING); } bool GetGpgEncryption() const { return bool(nFormatType & SfxFilterFlags::GPGENCRYPTION); } bool IsOwnTemplateFormat() const { return bool(nFormatType & SfxFilterFlags::TEMPLATEPATH); } +bool IsMSOFormat() const { return aTypeName.startsWith("MS"); } /// not our built-in format bool IsAlienFormat() const { return bool(nFormatType & SfxFilterFlags::ALIEN); } /// an unusual/legacy file to be loading diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs index dce8685a0a05..030cc51733ac 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs @@ -1864,6 +1864,13 @@ + + + Insert link for the cell, instead of text fields in a cell.(Excel iteropability options) + Links like Excel + +false + diff --git a/sc/inc/appoptio.hxx b/sc/inc/appoptio.hxx index 793dc707a67f..d9e22c9cba78 100644 --- a/sc/inc/appoptio.hxx +++ b/sc/inc/appoptio.hxx @@ -77,6 +77,9 @@ public: ScOptionsUtil::KeyBindingType GetKeyBindingType() const { return meKeyBindingType; } voidSetKeyBindingType( ScOptionsUtil::KeyBindingType e ) { meKeyBindingType = e; } +voidSetLinksInsertedLikeMSExcel(bool bNew) { mbLinksInsertedLikeMSExcel = bNew; } +boolGetLinksInsertedLikeMSExcel() const { return mbLinksInsertedLikeMSExcel; } + ScAppOptions& operator= ( const ScAppOptions& rOpt ); private: @@ -99,6 +102,7 @@ private: sal_Int32 nDefaultObjectSizeHeight; boolmbShowSharedDocumentWarning; ScOptionsUtil::KeyBindingType meKeyBindingType; +boolmbLinksInsertedLikeMSExcel; }; // Config Item containing app options diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 39892c4fb6ec..fa9b55dd8c87 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -621,6 +621,7 @@ static_assert(SID_PREVIEW_END < SID_KEYFUNC_START, "calc slots ids trampling inf #define SID_GROUP_SPARKLINES(SID_NEW_SLOTS+114) #define SID_UNGROUP_SPARKLINES (SID_NEW_SLOTS+115) #define
[Libreoffice-commits] core.git: include/sfx2 officecfg/registry sc/inc sc/qa sc/source sc/uiconfig
include/sfx2/docfilt.hxx |1 officecfg/registry/schema/org/openoffice/Office/Calc.xcs |7 sc/inc/appoptio.hxx |4 sc/inc/sc.hrc |1 sc/qa/uitest/calc_tests9/tdf156611_hyperlink_interoper.py | 124 ++ sc/source/core/tool/appoptio.cxx | 13 + sc/source/ui/app/scmod.cxx| 10 + sc/source/ui/inc/editsh.hxx |1 sc/source/ui/inc/tpcompatibility.hxx |1 sc/source/ui/optdlg/tpcompatibility.cxx | 15 + sc/source/ui/view/editsh.cxx | 95 +- sc/uiconfig/scalc/ui/optcompatibilitypage.ui | 60 ++ 12 files changed, 316 insertions(+), 16 deletions(-) New commits: commit 24cd55341bc3f3e8ed9d5ff23efd47a53532f283 Author: Attila Szűcs AuthorDate: Mon Jul 31 04:37:07 2023 +0200 Commit: Tomaž Vajngerl CommitDate: Wed Aug 23 15:23:16 2023 +0200 tdf#156611 SC: hyperlink option for MS behaviour Added an options that can limit Calc to behave like MS excel in case of inserting hyperlinks, when MS format document is used. Tools -> Options -> LibreOfficeDev Calc -> Compatibility -> Hyperlinks In MS excel, only cells can have a hyperlink, and only 1. In Calc even textfields in a cell can have hyperlinks, so it can have multiple links in a cell, but once saved as MS format, and reloaded, textfield links will become cell links, if there was 1 link in the cell. If there was more links in the cell, then all will be lost. So, when MS excel format document is edited in calc, the ability to make text field links is useless can be missleading, and confuse users. If this option is set, and an MS file format is opened, then insering a hyperlink will work like if we selected the whole cell to insert the hyperlink. Change-Id: I7174216d10cf250d48f23f71ae681c46f7610bbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155079 Tested-by: Jenkins Reviewed-by: Caolán McNamara Reviewed-by: Tomaž Vajngerl diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx index 9dbbb37b87d2..45dd0efb9b29 100644 --- a/include/sfx2/docfilt.hxx +++ b/include/sfx2/docfilt.hxx @@ -80,6 +80,7 @@ public: bool GetSupportsSigning() const { return bool(nFormatType & SfxFilterFlags::SUPPORTSSIGNING); } bool GetGpgEncryption() const { return bool(nFormatType & SfxFilterFlags::GPGENCRYPTION); } bool IsOwnTemplateFormat() const { return bool(nFormatType & SfxFilterFlags::TEMPLATEPATH); } +bool IsMSOFormat() const { return aTypeName.startsWith("MS"); } /// not our built-in format bool IsAlienFormat() const { return bool(nFormatType & SfxFilterFlags::ALIEN); } /// an unusual/legacy file to be loading diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs index eff7ac7aa80a..a41de7a36b8a 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs @@ -1861,6 +1861,13 @@ + + + Insert link for the cell, instead of text fields in a cell.(Excel iteropability options) + Links like Excel + +false + diff --git a/sc/inc/appoptio.hxx b/sc/inc/appoptio.hxx index 793dc707a67f..d9e22c9cba78 100644 --- a/sc/inc/appoptio.hxx +++ b/sc/inc/appoptio.hxx @@ -77,6 +77,9 @@ public: ScOptionsUtil::KeyBindingType GetKeyBindingType() const { return meKeyBindingType; } voidSetKeyBindingType( ScOptionsUtil::KeyBindingType e ) { meKeyBindingType = e; } +voidSetLinksInsertedLikeMSExcel(bool bNew) { mbLinksInsertedLikeMSExcel = bNew; } +boolGetLinksInsertedLikeMSExcel() const { return mbLinksInsertedLikeMSExcel; } + ScAppOptions& operator= ( const ScAppOptions& rOpt ); private: @@ -99,6 +102,7 @@ private: sal_Int32 nDefaultObjectSizeHeight; boolmbShowSharedDocumentWarning; ScOptionsUtil::KeyBindingType meKeyBindingType; +boolmbLinksInsertedLikeMSExcel; }; // Config Item containing app options diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 534ff7ab6795..d1b13b767eb0 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -621,6 +621,7 @@ static_assert(SID_PREVIEW_END < SID_KEYFUNC_START, "calc slots ids trampling inf #define SID_GROUP_SPARKLINES(SID_NEW_SLOTS+114) #define SID_UNGROUP_SPARKLINES (SID_NEW_SLOTS+115) #define SID_EDIT_SPARKLINE (SID_NEW_SLOTS+116) +#define SID_SC_OPT_LINKSTypedWhichId(SID_NEW_SLOTS + 117) // idl parameter diff --git a/sc/qa/uitest/calc_tests9/tdf156611_hyperlink_interoper.py
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source
sw/source/uibase/utlui/navipi.cxx | 21 ++--- 1 file changed, 18 insertions(+), 3 deletions(-) New commits: commit a4d6f4183ba76c3d03312a9ed16f286e60e3a7c5 Author: Attila Szűcs AuthorDate: Mon Aug 7 04:00:39 2023 +0200 Commit: Caolán McNamara CommitDate: Thu Aug 17 15:07:48 2023 +0200 SW: LOK: crashfix for ios navigator Added conditions to check if m_pNavigateByComboBox exist, because on ios, navigator does not have thit combobox. Change-Id: If5411a1687338caaa9fd76ae5471be4648ab61de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155388 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit c6250e82472f0d36c0c0c4b33c76882c94da8170) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155771 Tested-by: Jenkins CollaboraOffice diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 0f6d2ac78923..bd53813ac64b 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -132,6 +132,8 @@ IMPL_LINK(SwNavigationPI, DocListBoxSelectHdl, weld::ComboBox&, rBox, void) void SwNavigationPI::UpdateNavigateBy() { +if (!m_pNavigateByComboBox) +return; SfxUInt32Item aParam(FN_NAV_ELEMENT, m_pNavigateByComboBox->get_active_id().toUInt32()); const SfxPoolItem* aArgs[2]; aArgs[0] = @@ -543,8 +545,17 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xContent2Dispatch->GetControllerForCommand(".uno:NavElement"); NavElementToolBoxControl* pToolBoxControl = dynamic_cast(xController.get()); -assert(pToolBoxControl); -m_pNavigateByComboBox = pToolBoxControl->GetComboBox(); + +// In case of LOK, the xController may not a NavElementToolBoxControl +if (comphelper::LibreOfficeKit::isActive() && !pToolBoxControl) +{ +m_pNavigateByComboBox = nullptr; +} +else +{ +assert(pToolBoxControl); +m_pNavigateByComboBox = pToolBoxControl->GetComboBox(); +} // Restore content tree settings before calling UpdateInitShow. UpdateInitShow calls Fillbox, // which calls Display and UpdateTracking. Incorrect outline levels could be displayed and @@ -652,7 +663,9 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xInsertMenu->connect_activate(LINK(this, SwNavigationPI, GlobalMenuSelectHdl)); m_xGlobalToolBox->connect_menu_toggled(LINK(this, SwNavigationPI, ToolBoxClickHdl)); m_xGlobalToolBox->set_item_active("globaltoggle", true); -m_pNavigateByComboBox->connect_changed(LINK(this, SwNavigationPI, NavigateByComboBoxSelectHdl)); +if (m_pNavigateByComboBox) +m_pNavigateByComboBox->connect_changed( +LINK(this, SwNavigationPI, NavigateByComboBoxSelectHdl)); // set toolbar of both modes to widest of each m_xGlobalToolBox->set_size_request(m_xContent1ToolBox->get_preferred_size().Width() + @@ -1138,6 +1151,8 @@ IMPL_LINK_NOARG(SwNavigationPI, ChangePageHdl, Timer *, void) void SwNavigationPI::SelectNavigateByContentType(const OUString& rContentTypeName) { +if (!m_pNavigateByComboBox) +return; if (auto nPos = m_pNavigateByComboBox->find_text(rContentTypeName); nPos != -1) { m_pNavigateByComboBox->set_active(nPos);
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/utlui/navipi.cxx | 21 ++--- 1 file changed, 18 insertions(+), 3 deletions(-) New commits: commit c6250e82472f0d36c0c0c4b33c76882c94da8170 Author: Attila Szűcs AuthorDate: Mon Aug 7 04:00:39 2023 +0200 Commit: Caolán McNamara CommitDate: Thu Aug 17 14:08:18 2023 +0200 SW: LOK: crashfix for ios navigator Added conditions to check if m_pNavigateByComboBox exist, because on ios, navigator does not have thit combobox. Change-Id: If5411a1687338caaa9fd76ae5471be4648ab61de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155388 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 2506b5c83793..460d4347766f 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -132,6 +132,8 @@ IMPL_LINK(SwNavigationPI, DocListBoxSelectHdl, weld::ComboBox&, rBox, void) void SwNavigationPI::UpdateNavigateBy() { +if (!m_pNavigateByComboBox) +return; SfxUInt32Item aParam(FN_NAV_ELEMENT, m_pNavigateByComboBox->get_active_id().toUInt32()); const SfxPoolItem* aArgs[2]; aArgs[0] = @@ -571,8 +573,17 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xContent2Dispatch->GetControllerForCommand(".uno:NavElement"); NavElementToolBoxControl* pToolBoxControl = dynamic_cast(xController.get()); -assert(pToolBoxControl); -m_pNavigateByComboBox = pToolBoxControl->GetComboBox(); + +// In case of LOK, the xController may not a NavElementToolBoxControl +if (comphelper::LibreOfficeKit::isActive() && !pToolBoxControl) +{ +m_pNavigateByComboBox = nullptr; +} +else +{ +assert(pToolBoxControl); +m_pNavigateByComboBox = pToolBoxControl->GetComboBox(); +} // Restore content tree settings before calling UpdateInitShow. UpdateInitShow calls Fillbox, // which calls Display and UpdateTracking. Incorrect outline levels could be displayed and @@ -681,7 +692,9 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xInsertMenu->connect_activate(LINK(this, SwNavigationPI, GlobalMenuSelectHdl)); m_xGlobalToolBox->connect_menu_toggled(LINK(this, SwNavigationPI, ToolBoxClickHdl)); m_xGlobalToolBox->set_item_active("globaltoggle", true); -m_pNavigateByComboBox->connect_changed(LINK(this, SwNavigationPI, NavigateByComboBoxSelectHdl)); +if (m_pNavigateByComboBox) +m_pNavigateByComboBox->connect_changed( +LINK(this, SwNavigationPI, NavigateByComboBoxSelectHdl)); // set toolbar of both modes to widest of each m_xGlobalToolBox->set_size_request(m_xContent1ToolBox->get_preferred_size().Width() + @@ -1159,6 +1172,8 @@ IMPL_LINK_NOARG(SwNavigationPI, ChangePageHdl, Timer *, void) void SwNavigationPI::SelectNavigateByContentType(const OUString& rContentTypeName) { +if (!m_pNavigateByComboBox) +return; if (auto nPos = m_pNavigateByComboBox->find_text(rContentTypeName); nPos != -1) { m_pNavigateByComboBox->set_active(nPos);
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/inc sw/source vcl/jsdialog vcl/source
sw/inc/view.hxx|1 + sw/source/uibase/inc/conttree.hxx |2 ++ sw/source/uibase/utlui/content.cxx | 21 + sw/source/uibase/utlui/navipi.cxx |9 - vcl/jsdialog/executor.cxx | 10 ++ vcl/source/treelist/svtabbx.cxx|4 6 files changed, 42 insertions(+), 5 deletions(-) New commits: commit b95750af717e0693a13c3ef3529e1394e0ae Author: Attila Szűcs AuthorDate: Thu Jun 29 18:32:27 2023 +0200 Commit: Andras Timar CommitDate: Sat Jul 1 16:51:44 2023 +0200 LOK: Navigator: fix expand problems Save/load content types' expanded status to view, and make sure it is synchronized with client. Treeviews now receive/send collapse event/status from/to client. I've rewritten the way how headings are opened by default (because synch of collapsed status broke that, as sub-headings were not expanded at core side). Change-Id: I80f5b4d99fe5224391a92c4609f94ddbcf37b8ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153771 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index b556c2c53f39..9e31e337206b 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -350,6 +350,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell public: // #i123922# Needs to be called from a 2nd place now as a helper method SAL_DLLPRIVATE bool InsertGraphicDlg( SfxRequest& ); +sal_Int32 m_nNaviExpandedStatus = -1; protected: diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index e2cf31028171..c397a15bb20b 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -266,6 +266,8 @@ public: // return true if it has any children bool RequestingChildren(const weld::TreeIter& rParent); +void ExpandAllHeadings(); + virtual void Notify(SfxBroadcaster& rBC, SfxHint const& rHint) override; sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 5367627cad03..c837124b723c 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1130,6 +1130,12 @@ SwContentTree::SwContentTree(std::unique_ptr xTreeView, SwNaviga OUString sDocTitle = pView->GetDocShell()->GetTitle(); if (lcl_DocOutLineExpandStateMap.find(sDocTitle) != lcl_DocOutLineExpandStateMap.end()) mOutLineNodeMap = lcl_DocOutLineExpandStateMap[sDocTitle]; +if (comphelper::LibreOfficeKit::isActive()) { +if (pView->m_nNaviExpandedStatus < 0) +m_nActiveBlock = 1; +else +m_nActiveBlock = pView->m_nNaviExpandedStatus; +} } m_aUpdTimer.SetInvokeHandler(LINK(this, SwContentTree, TimerUpdate)); @@ -1144,6 +1150,8 @@ SwContentTree::~SwContentTree() { OUString sDocTitle = pView->GetDocShell()->GetTitle(); lcl_DocOutLineExpandStateMap[sDocTitle] = mOutLineNodeMap; +if (comphelper::LibreOfficeKit::isActive()) +pView->m_nNaviExpandedStatus = m_nActiveBlock; } clear(); // If applicable erase content types previously. m_aUpdTimer.Stop(); @@ -2177,6 +2185,19 @@ bool SwContentTree::RequestingChildren(const weld::TreeIter& rParent) return bChild; } +void SwContentTree::ExpandAllHeadings() +{ +if (HasHeadings()) +{ +std::unique_ptr xEntry = GetEntryAtAbsPos(0); +if (xEntry) +{ +if (!IsAllExpanded(*m_xTreeView, *xEntry)) +ExpandOrCollapseAll(*m_xTreeView, *xEntry); +} +} +} + SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt) { SdrObject *pRetObj = nullptr; diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index fb3f461f8f64..0f6d2ac78923 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -694,12 +694,11 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xGlobalTree->HideTree(); //Open Headings by default -if (m_xContentTree->HasHeadings()) +SwView *pView = GetCreateView(); +if (pView->m_nNaviExpandedStatus < 0) { -auto& pTreeView = m_xContentTree->get_widget(); -std::unique_ptr itEntry(pTreeView.make_iterator()); -pTreeView.get_iter_first(*itEntry); -pTreeView.expand_row(*itEntry); +pView->m_nNaviExpandedStatus = 1; +m_xContentTree->ExpandAllHeadings(); } } } diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 1accb3bc1de0..750b10c0b606 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -474,6 +474,16 @@ bool ExecuteAction(const std::string& nWindowId, const OString& rWidget, StringM
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source
sw/source/uibase/inc/conttree.hxx |1 + sw/source/uibase/utlui/content.cxx |8 sw/source/uibase/utlui/navipi.cxx | 11 +++ 3 files changed, 16 insertions(+), 4 deletions(-) New commits: commit 61e2022110d3088bc1653713dc270beaacae4c74 Author: Attila Szűcs AuthorDate: Fri Jun 9 05:56:31 2023 +0200 Commit: Andras Timar CommitDate: Fri Jun 9 07:29:30 2023 +0200 LOK: fix for navigator: hide empty contentTypes fixed that opening heading by default, first check if headings are not hidden, because it blindly opened the 1. type, but from now, that can be an other type, or nothing Change-Id: I86cac472d8cba9a46befc5a84ef073c01fa7243d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152779 Tested-by: Andras Timar Reviewed-by: Andras Timar diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index ec0dbc7c84e8..e2cf31028171 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -236,6 +236,7 @@ public: { return State::HIDDEN == m_eState ? m_pHiddenShell : m_pActiveShell; } boolIsInDrag() const; +boolHasHeadings() const; sal_uInt8 GetOutlineLevel()const {return m_nOutlineLevel;} voidSetOutlineLevel(sal_uInt8 nSet); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 6325347a930e..5367627cad03 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1256,6 +1256,14 @@ bool SwContentTree::IsInDrag() const return m_xTreeView->get_drag_source() == m_xTreeView.get(); } +bool SwContentTree::HasHeadings() const +{ +const std::unique_ptr& rpContentT = m_aActiveContentArr[ContentTypeId::OUTLINE]; +if (rpContentT && rpContentT->GetMemberCount() > 0) +return true; +return false; +} + // QueryDrop will be executed in the navigator sal_Int8 SwContentTree::AcceptDrop(const AcceptDropEvent& rEvt) { diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 61ada3408bbc..fb3f461f8f64 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -694,10 +694,13 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xGlobalTree->HideTree(); //Open Headings by default -auto& pTreeView = m_xContentTree->get_widget(); -std::unique_ptr itEntry(pTreeView.make_iterator()); -pTreeView.get_iter_first(*itEntry); -pTreeView.expand_row(*itEntry); +if (m_xContentTree->HasHeadings()) +{ +auto& pTreeView = m_xContentTree->get_widget(); +std::unique_ptr itEntry(pTreeView.make_iterator()); +pTreeView.get_iter_first(*itEntry); +pTreeView.expand_row(*itEntry); +} } }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source
sw/source/uibase/utlui/content.cxx | 30 ++ 1 file changed, 30 insertions(+) New commits: commit ed3bb61461e4e394bd476b4ec57ff3025eca153f Author: Attila Szűcs AuthorDate: Thu Jun 8 11:21:16 2023 +0200 Commit: Andras Timar CommitDate: Thu Jun 8 21:51:43 2023 +0200 LOK: navigator: hide empty contentTypes In case of LOK, do not insert empty contenttype to tree, and implement new way to find changes in contents, in hidden contentTypes, because the original checked only on the tree. Change-Id: Ib1e4da5e05b2ad4161c6a66a9c54111d558f66f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152735 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index c54ec983d157..6325347a930e 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -111,6 +111,8 @@ #include #include +#include + #define CTYPE_CNT 0 #define CTYPE_CTT 1 @@ -2544,6 +2546,13 @@ void SwContentTree::Display( bool bActive ) OUString aImage(GetImageIdForContentTypeId(nCntType)); bool bChOnDemand = 0 != rpContentT->GetMemberCount(); + +// In case of LOK, empty content types must be hidden in the contenttree +if (comphelper::LibreOfficeKit::isActive() && !bChOnDemand) +{ +continue; +} + OUString sId(weld::toId(rpContentT.get())); insert(nullptr, rpContentT->GetName(), sId, bChOnDemand, xEntry.get()); m_xTreeView->set_image(*xEntry, aImage); @@ -2947,6 +2956,27 @@ bool SwContentTree::HasContentChanged() // is detected only fill member lists for remaining content types. The Display function // will clear and recreate the treeview from the content type member arrays if content has // changed. + +if (comphelper::LibreOfficeKit::isActive()) +{ +// In case of LOK, empty contentTypes are hidden, even in all content view +// so it is not enough to check only the m_xTreeView. +bool bCountChanged = false; +for (ContentTypeId i : o3tl::enumrange()) +{ +if (m_aActiveContentArr[i]) +{ +auto nLastTMCount = m_aActiveContentArr[i]->GetMemberCount(); +m_aActiveContentArr[i]->FillMemberList(); +// If the member count of a type is changed, then the content is surely changed +if (m_aActiveContentArr[i]->GetMemberCount() != nLastTMCount) +bCountChanged = true; +} +} +if (bCountChanged) +return true; +} + std::unique_ptr xEntry(m_xTreeView->make_iterator()); // lambda function to find the next content type entry
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source
sw/source/uibase/utlui/navipi.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 09c40d669cac5f167fa68cb5c6ad94a6a9e2a844 Author: Attila Szűcs AuthorDate: Thu May 18 10:36:38 2023 +0200 Commit: Szymon Kłos CommitDate: Mon May 22 15:26:34 2023 +0200 LOK: Navigator: headings expanded by default Called an expand_row for the first element of the contetnTree in the navigator constructor. Right now contructor is called every time when navigator is opened, it may change later. (desktop app do it only if navigator opens in a new window, not on sidebar) Change-Id: Ibe4b71e6a6ddb573269178f83c295b0c2cbd53b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151939 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 99f87a13a055..61ada3408bbc 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -692,6 +692,12 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xGlobalBox->hide(); m_xGlobalToolBox->hide(); m_xGlobalTree->HideTree(); + +//Open Headings by default +auto& pTreeView = m_xContentTree->get_widget(); +std::unique_ptr itEntry(pTreeView.make_iterator()); +pTreeView.get_iter_first(*itEntry); +pTreeView.expand_row(*itEntry); } }
[Libreoffice-commits] core.git: sd/source sfx2/source vcl/jsdialog
sd/source/ui/view/drviews2.cxx | 29 - sfx2/source/sidebar/ResourceManager.cxx |3 +-- sfx2/source/view/viewfrm.cxx| 11 +++ vcl/jsdialog/enabled.cxx|6 +++--- vcl/jsdialog/jsdialogbuilder.cxx|9 ++--- 5 files changed, 41 insertions(+), 17 deletions(-) New commits: commit 4ad89dd8166fac837d7ed6887c17f9255f06285e Author: Attila Szűcs AuthorDate: Wed May 3 04:24:35 2023 +0200 Commit: Szymon Kłos CommitDate: Mon May 15 09:03:04 2023 +0200 LOK: Navi-1 open/close on sidebar Enabling Navigator sidebar in case of LOKit. Change-Id: I3a656fa12822e5866c2cd4fbf82627a88f26903a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151307 Tested-by: Szymon Kłos Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151704 Tested-by: Jenkins diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 7f1b762d6e48..5c5aa56e960d 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -3343,16 +3343,27 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_NAVIGATOR: { -if ( rReq.GetArgs() ) -GetViewFrame()->SetChildWindow(SID_NAVIGATOR, -static_cast(rReq.GetArgs()-> -Get(SID_NAVIGATOR)).GetValue()); -else -GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR ); +if (comphelper::LibreOfficeKit::isActive()) +{ +GetViewFrame()->ShowChildWindow(SID_SIDEBAR); +OUString panelId = "SdNavigatorPanel"; +::sfx2::sidebar::Sidebar::TogglePanel( +panelId, GetViewFrame()->GetFrame().GetFrameInterface()); -GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR); -Cancel(); -rReq.Ignore (); +Cancel(); +rReq.Done(); +} else { +if ( rReq.GetArgs() ) +GetViewFrame()->SetChildWindow(SID_NAVIGATOR, +static_cast(rReq.GetArgs()-> +Get(SID_NAVIGATOR)).GetValue()); +else +GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR ); + +GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR); +Cancel(); +rReq.Ignore (); +} } break; diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index cfc5437037cc..5974e20af488 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -260,8 +260,7 @@ void ResourceManager::ReadDeckList() if (comphelper::LibreOfficeKit::isActive()) { // Hide these decks in LOK as they aren't fully functional. -if (aDeckName == "GalleryDeck" || aDeckName == "NavigatorDeck" -|| aDeckName == "StyleListDeck") +if (aDeckName == "GalleryDeck" || aDeckName == "StyleListDeck") continue; } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index d62090bad118..bf42fc5de078 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -3414,6 +3414,17 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest ) rReq.Done(); return; } +if (nSID == SID_NAVIGATOR) +{ +if (comphelper::LibreOfficeKit::isActive()) +{ +ShowChildWindow(SID_SIDEBAR); +OUString panelId = "SdNavigatorPanel"; +::sfx2::sidebar::Sidebar::TogglePanel(panelId, GetFrame().GetFrameInterface()); +rReq.Done(); +return; +} +} bool bHasChild = HasChildWindow(nSID); bool bShow = pShowItem ? pShowItem->GetValue() : !bHasChild; diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index 73a4eedf96b4..36707140b927 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -299,7 +299,7 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile) { if (// scalc rUIFile == u"modules/scalc/ui/functionpanel.ui" -//|| rUIFile == u"modules/scalc/ui/navigatorpanel.ui" +|| rUIFile == u"modules/scalc/ui/navigatorpanel.ui" || rUIFile == u"modules/scalc/ui/sidebaralignment.ui" || rUIFile == u"modules/scalc/ui/sidebarcellappearance.ui" || rUIFile == u"modules/scalc/ui/sidebarnumberformat.ui" @@ -316,7 +316,7 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile) || rUIFile == u"modules/simpress/ui/masterpagepanel.ui" || rUIFile == u"modules/simpress/ui/masterpagepanelall.ui" || rUIFile == u"modules/simpress/ui/masterpagepanelrecent.ui" -
[Libreoffice-commits] core.git: vcl/inc vcl/jsdialog
vcl/inc/jsdialog/jsdialogbuilder.hxx |4 vcl/jsdialog/executor.cxx| 10 -- vcl/jsdialog/jsdialogbuilder.cxx | 35 +-- 3 files changed, 45 insertions(+), 4 deletions(-) New commits: commit 6be76f54a4e94b952975dfded25afff60257c6dd Author: Attila Szűcs AuthorDate: Wed May 3 04:30:55 2023 +0200 Commit: Szymon Kłos CommitDate: Fri May 12 17:25:36 2023 +0200 LOK: Navi-4 tree dblclick Removed sendUpdate that was called 1/sec, so selection dont revert 1/sec. Put sendUpdate into set_cursor(), that seems to be a better spot. Fixed set_cursor usage in executor, that caused slection to not work in dblclick at all. Because set_cursor(int) use not absolute position, but relative to parent And root was used as parent, so it picked SwContent from the 1. lvl, but the 1. lvl items are not real items, just SwContentTypes .. e.g.:Headings.. that cannot be activated.. so never happened anything. Change-Id: Iea373af3a0832a4f97202122bd36022eddf26efe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151308 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151703 Tested-by: Jenkins diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index 27ac31784228..4d38d66fe9f1 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -749,6 +749,10 @@ public: virtual void expand_row(const weld::TreeIter& rIter) override; virtual void collapse_row(const weld::TreeIter& rIter) override; +virtual void set_cursor(const weld::TreeIter& rIter) override; +void set_cursor_without_notify(const weld::TreeIter& rIter); +virtual void set_cursor(int pos) override; + using SalInstanceTreeView::remove; virtual void remove(int pos) override; virtual void remove(const weld::TreeIter& rIter) override; diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 2784acf0cae8..af514bc70dde 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -441,7 +441,8 @@ bool ExecuteAction(const OUString& nWindowId, const OUString& rWidget, StringMap std::unique_ptr itEntry(pTreeView->make_iterator()); pTreeView->get_iter_abs_pos(*itEntry, nAbsPos); pTreeView->select(*itEntry); -pTreeView->set_cursor(*itEntry); +pTreeView->set_cursor_without_notify(*itEntry); +pTreeView->grab_focus(); LOKTrigger::trigger_changed(*pTreeView); return true; } @@ -450,8 +451,11 @@ bool ExecuteAction(const OUString& nWindowId, const OUString& rWidget, StringMap sal_Int32 nRow = o3tl::toInt32(rData["data"]); pTreeView->unselect_all(); +std::unique_ptr itEntry(pTreeView->make_iterator()); +pTreeView->get_iter_abs_pos(*itEntry, nRow); pTreeView->select(nRow); -pTreeView->set_cursor(nRow); +pTreeView->set_cursor_without_notify(*itEntry); +pTreeView->grab_focus(); LOKTrigger::trigger_changed(*pTreeView); LOKTrigger::trigger_row_activated(*pTreeView); return true; @@ -461,6 +465,8 @@ bool ExecuteAction(const OUString& nWindowId, const OUString& rWidget, StringMap sal_Int32 nAbsPos = o3tl::toInt32(rData["data"]); std::unique_ptr itEntry(pTreeView->make_iterator()); pTreeView->get_iter_abs_pos(*itEntry, nAbsPos); +pTreeView->set_cursor_without_notify(*itEntry); +pTreeView->grab_focus(); pTreeView->expand_row(*itEntry); return true; } diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index ed3a0893dbcb..a3c55e28ddfb 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -2016,16 +2016,47 @@ void JSTreeView::clear() sendUpdate(); } +void JSTreeView::set_cursor_without_notify(const weld::TreeIter& rIter) +{ +SalInstanceTreeView::set_cursor(rIter); +} + +void JSTreeView::set_cursor(const weld::TreeIter& rIter) +{ +SalInstanceTreeView::set_cursor(rIter); +sendUpdate(); +} + +void JSTreeView::set_cursor(int pos) +{ +SalInstanceTreeView::set_cursor(pos); +sendUpdate(); +} + void JSTreeView::expand_row(const weld::TreeIter& rIter) { +bool bNotify = false; +const SalInstanceTreeIter& rVclIter = static_cast(rIter); +if (!m_xTreeView->IsExpanded(rVclIter.iter)) +bNotify = true; + SalInstanceTreeView::expand_row(rIter); -sendUpdate(); + +if (bNotify) +
[Libreoffice-commits] core.git: sc/source sc/uiconfig sd/source sw/source sw/uiconfig
sc/source/ui/navipi/navipi.cxx |6 ++ sc/uiconfig/scalc/ui/navigatorpanel.ui |2 +- sd/source/ui/dlg/navigatr.cxx|6 ++ sw/source/uibase/utlui/navipi.cxx| 29 - sw/uiconfig/swriter/ui/navigatorpanel.ui |2 +- 5 files changed, 38 insertions(+), 7 deletions(-) New commits: commit 39b25518ce96a50f54459f681edcb95057507251 Author: Attila Szűcs AuthorDate: Thu May 4 16:59:54 2023 +0200 Commit: Szymon Kłos CommitDate: Fri May 12 14:02:59 2023 +0200 LOK: Navi-10 hide not needed controls Hide controls we dont need in navigator now. Change-Id: Ibf6843be2976bcd4d90e67130dd0cc08d0988c0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151397 Tested-by: Szymon Kłos Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151702 Tested-by: Jenkins diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 92a6c5f6c94a..d7682d93a101 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -423,6 +423,12 @@ ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, weld::Widget* pParent, SfxNaviga else eNavMode = NAV_LMODE_AREAS; SetListMode(eNavMode); + +if(comphelper::LibreOfficeKit::isActive()) +{ +m_xBuilder->weld_container("gridbuttons")->hide(); +m_xLbDocuments->hide(); +} } weld::Window* ScNavigatorDlg::GetFrameWeld() const diff --git a/sc/uiconfig/scalc/ui/navigatorpanel.ui b/sc/uiconfig/scalc/ui/navigatorpanel.ui index 9e02f0ba5588..a5b9b3038be6 100644 --- a/sc/uiconfig/scalc/ui/navigatorpanel.ui +++ b/sc/uiconfig/scalc/ui/navigatorpanel.ui @@ -101,7 +101,7 @@ 12 - + True False True diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index be0f5919afa9..2bdfaefde410 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -48,6 +48,7 @@ #include #include +#include /** * SdNavigatorWin - FloatingWindow @@ -93,6 +94,11 @@ SdNavigatorWin::SdNavigatorWin(weld::Widget* pParent, SfxBindings* pInBindings, mxToolbox->connect_key_press(LINK(this, SdNavigatorWin, KeyInputHdl)); mxTlbObjects->connect_key_press(LINK(this, SdNavigatorWin, KeyInputHdl)); mxLbDocs->connect_key_press(LINK(this, SdNavigatorWin, KeyInputHdl)); +if(comphelper::LibreOfficeKit::isActive()) +{ +mxToolbox->hide(); +mxLbDocs->hide(); +} } void SdNavigatorWin::FirstFocus() diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index e609aa539e4c..0489f5146ae9 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -49,6 +49,8 @@ #include +#include + using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; @@ -682,6 +684,14 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xDocListBox->set_accessible_name(m_aStatusArr[3]); m_aExpandedSize = m_xContainer->get_preferred_size(); + +if(comphelper::LibreOfficeKit::isActive()) +{ +m_xBuilder->weld_container("gridcontent16")->hide(); +m_xDocListBox->hide(); +m_xGlobalBox->hide(); +m_xGlobalToolBox->hide(); +} } weld::Window* SwNavigationPI::GetFrameWeld() const @@ -765,12 +775,15 @@ void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState /*eState*/, } else if (nSID == FN_STAT_PAGE) { -SwView *pActView = GetCreateView(); -if(pActView) +if(!comphelper::LibreOfficeKit::isActive()) { -SwWrtShell = pActView->GetWrtShell(); -m_xEdit->set_max(rSh.GetPageCnt()); -m_xEdit->set_width_chars(3); +SwView *pActView = GetCreateView(); +if(pActView) +{ +SwWrtShell = pActView->GetWrtShell(); +m_xEdit->set_max(rSh.GetPageCnt()); +m_xEdit->set_width_chars(3); +} } } } @@ -1045,6 +1058,12 @@ void SwNavigationPI::SetRegionDropMode(RegionMode nNewMode) void SwNavigationPI::ToggleTree() { +if (comphelper::LibreOfficeKit::isActive()) +{ +m_xGlobalTree->HideTree(); +return; +} + bool bGlobalDoc = IsGlobalDoc(); if (!IsGlobalMode() && bGlobalDoc) { diff --git a/sw/uiconfig/swriter/ui/navigatorpanel.ui b/sw/uiconfig/swriter/ui/navigatorpanel.ui index 7c3fd820e2d3..d34e58af1260 100644 --- a/sw/uiconfig/swriter/ui/navigatorpanel.ui +++ b/sw/uiconfig/swriter/ui/navigatorpanel.ui @@ -244,7 +244,7 @@ 6 12 - + True False True
[Libreoffice-commits] core.git: vcl/jsdialog
vcl/jsdialog/executor.cxx |4 1 file changed, 4 insertions(+) New commits: commit 9c8e38ef8c69d519d72737b404d54d6413a98518 Author: Attila Szűcs AuthorDate: Wed May 3 04:46:20 2023 +0200 Commit: Szymon Kłos CommitDate: Fri May 12 13:47:22 2023 +0200 LOK: Navi-6 page selector SpinField Grab the focus back to the spinfield in sidebar, so the document will be able to scroll to the right page. It seems there is a condition check, on move to page, that focus must be not on document, or else it does not move. AFAIK in lok code we dont try to simulate the focus of the core, but maybe we should, for cases like this. Change-Id: Ie9a30e6bd944cfa1729861eb0ac1924b946f4185 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151309 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151701 Tested-by: Jenkins diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index f387a64ffc37..2784acf0cae8 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -310,6 +310,10 @@ bool ExecuteAction(const OUString& nWindowId, const OUString& rWidget, StringMap if (rData["data"] == "undefined") return true; +// The Document will not scroll if that is in focus +// maybe we could send a message with: sAction == "grab_focus" +pWidget->grab_focus(); + double nValue = o3tl::toDouble(rData["data"]); pSpinField->set_value(nValue * weld::SpinButton::Power10(pSpinField->get_digits()));
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sd/source sfx2/source vcl/jsdialog
sd/source/ui/view/drviews2.cxx | 29 - sfx2/source/sidebar/ResourceManager.cxx |3 +-- sfx2/source/view/viewfrm.cxx| 11 +++ vcl/jsdialog/enabled.cxx|6 +++--- vcl/jsdialog/jsdialogbuilder.cxx|9 ++--- 5 files changed, 41 insertions(+), 17 deletions(-) New commits: commit 6b734f99a1ca9165b86f6588a720de6dc90d3f7b Author: Attila Szűcs AuthorDate: Wed May 3 04:24:35 2023 +0200 Commit: Szymon Kłos CommitDate: Fri May 5 12:14:04 2023 +0200 LOK: Navi-1 open/close on sidebar Enabling Navigator sidebar in case of LOKit. Change-Id: I3a656fa12822e5866c2cd4fbf82627a88f26903a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151307 Tested-by: Szymon Kłos Reviewed-by: Szymon Kłos diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 94207a01653e..d5bcbec91eaa 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -3350,16 +3350,27 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_NAVIGATOR: { -if ( rReq.GetArgs() ) -GetViewFrame()->SetChildWindow(SID_NAVIGATOR, -static_cast(rReq.GetArgs()-> -Get(SID_NAVIGATOR)).GetValue()); -else -GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR ); +if (comphelper::LibreOfficeKit::isActive()) +{ +GetViewFrame()->ShowChildWindow(SID_SIDEBAR); +OUString panelId = "SdNavigatorPanel"; +::sfx2::sidebar::Sidebar::TogglePanel( +panelId, GetViewFrame()->GetFrame().GetFrameInterface()); -GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR); -Cancel(); -rReq.Ignore (); +Cancel(); +rReq.Done(); +} else { +if ( rReq.GetArgs() ) +GetViewFrame()->SetChildWindow(SID_NAVIGATOR, +static_cast(rReq.GetArgs()-> +Get(SID_NAVIGATOR)).GetValue()); +else +GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR ); + +GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR); +Cancel(); +rReq.Ignore (); +} } break; diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index cfc5437037cc..5974e20af488 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -260,8 +260,7 @@ void ResourceManager::ReadDeckList() if (comphelper::LibreOfficeKit::isActive()) { // Hide these decks in LOK as they aren't fully functional. -if (aDeckName == "GalleryDeck" || aDeckName == "NavigatorDeck" -|| aDeckName == "StyleListDeck") +if (aDeckName == "GalleryDeck" || aDeckName == "StyleListDeck") continue; } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 6ac5653db267..e082d651073e 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -3335,6 +3335,17 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest ) rReq.Done(); return; } +if (nSID == SID_NAVIGATOR) +{ +if (comphelper::LibreOfficeKit::isActive()) +{ +ShowChildWindow(SID_SIDEBAR); +OUString panelId = "SdNavigatorPanel"; +::sfx2::sidebar::Sidebar::TogglePanel(panelId, GetFrame().GetFrameInterface()); +rReq.Done(); +return; +} +} bool bHasChild = HasChildWindow(nSID); bool bShow = pShowItem ? pShowItem->GetValue() : !bHasChild; diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index 0fd8f6e94293..807f1d14a580 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -292,7 +292,7 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile) { if (// scalc rUIFile == u"modules/scalc/ui/functionpanel.ui" -//|| rUIFile == u"modules/scalc/ui/navigatorpanel.ui" +|| rUIFile == u"modules/scalc/ui/navigatorpanel.ui" || rUIFile == u"modules/scalc/ui/sidebaralignment.ui" || rUIFile == u"modules/scalc/ui/sidebarcellappearance.ui" || rUIFile == u"modules/scalc/ui/sidebarnumberformat.ui" @@ -309,7 +309,7 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile) || rUIFile == u"modules/simpress/ui/masterpagepanel.ui" || rUIFile == u"modules/simpress/ui/masterpagepanelall.ui" || rUIFile == u"modules/simpress/ui/masterpagepanelrecent.ui" -//|| rUIFile == u"modules/simpress/ui/navigatorpanel.ui" +|| rUIFile ==
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - vcl/inc vcl/jsdialog
vcl/inc/jsdialog/jsdialogbuilder.hxx |4 vcl/jsdialog/executor.cxx| 10 -- vcl/jsdialog/jsdialogbuilder.cxx | 35 +-- 3 files changed, 45 insertions(+), 4 deletions(-) New commits: commit a863bd126ee9a19f305542c836644f7daaa784a7 Author: Attila Szűcs AuthorDate: Wed May 3 04:30:55 2023 +0200 Commit: Szymon Kłos CommitDate: Fri May 5 10:53:26 2023 +0200 LOK: Navi-4 tree dblclick Removed sendUpdate that was called 1/sec, so selection dont revert 1/sec. Put sendUpdate into set_cursor(), that seems to be a better spot. Fixed set_cursor usage in executor, that caused slection to not work in dblclick at all. Because set_cursor(int) use not absolute position, but relative to parent And root was used as parent, so it picked SwContent from the 1. lvl, but the 1. lvl items are not real items, just SwContentTypes .. e.g.:Headings.. that cannot be activated.. so never happened anything. Change-Id: Iea373af3a0832a4f97202122bd36022eddf26efe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151308 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index 75ea450ec4c8..25281fb33236 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -749,6 +749,10 @@ public: virtual void expand_row(const weld::TreeIter& rIter) override; virtual void collapse_row(const weld::TreeIter& rIter) override; +virtual void set_cursor(const weld::TreeIter& rIter) override; +void set_cursor_without_notify(const weld::TreeIter& rIter); +virtual void set_cursor(int pos) override; + using SalInstanceTreeView::remove; virtual void remove(int pos) override; virtual void remove(const weld::TreeIter& rIter) override; diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 737ae2f961b9..1accb3bc1de0 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -445,7 +445,8 @@ bool ExecuteAction(const std::string& nWindowId, const OString& rWidget, StringM std::unique_ptr itEntry(pTreeView->make_iterator()); pTreeView->get_iter_abs_pos(*itEntry, nAbsPos); pTreeView->select(*itEntry); -pTreeView->set_cursor(*itEntry); +pTreeView->set_cursor_without_notify(*itEntry); +pTreeView->grab_focus(); LOKTrigger::trigger_changed(*pTreeView); return true; } @@ -454,8 +455,11 @@ bool ExecuteAction(const std::string& nWindowId, const OString& rWidget, StringM sal_Int32 nRow = o3tl::toInt32(rData["data"]); pTreeView->unselect_all(); +std::unique_ptr itEntry(pTreeView->make_iterator()); +pTreeView->get_iter_abs_pos(*itEntry, nRow); pTreeView->select(nRow); -pTreeView->set_cursor(nRow); +pTreeView->set_cursor_without_notify(*itEntry); +pTreeView->grab_focus(); LOKTrigger::trigger_changed(*pTreeView); LOKTrigger::trigger_row_activated(*pTreeView); return true; @@ -465,6 +469,8 @@ bool ExecuteAction(const std::string& nWindowId, const OString& rWidget, StringM sal_Int32 nAbsPos = o3tl::toInt32(rData["data"]); std::unique_ptr itEntry(pTreeView->make_iterator()); pTreeView->get_iter_abs_pos(*itEntry, nAbsPos); +pTreeView->set_cursor_without_notify(*itEntry); +pTreeView->grab_focus(); pTreeView->expand_row(*itEntry); return true; } diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index ef59d1eb1e8f..3f094891c6eb 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -2021,16 +2021,47 @@ void JSTreeView::clear() sendUpdate(); } +void JSTreeView::set_cursor_without_notify(const weld::TreeIter& rIter) +{ +SalInstanceTreeView::set_cursor(rIter); +} + +void JSTreeView::set_cursor(const weld::TreeIter& rIter) +{ +SalInstanceTreeView::set_cursor(rIter); +sendUpdate(); +} + +void JSTreeView::set_cursor(int pos) +{ +SalInstanceTreeView::set_cursor(pos); +sendUpdate(); +} + void JSTreeView::expand_row(const weld::TreeIter& rIter) { +bool bNotify = false; +const SalInstanceTreeIter& rVclIter = static_cast(rIter); +if (!m_xTreeView->IsExpanded(rVclIter.iter)) +bNotify = true; + SalInstanceTreeView::expand_row(rIter); -sendUpdate(); + +if (bNotify) +sendUpdate(); } void JSTreeView::collapse_row(const weld::TreeIter& rIter) { +
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source sc/uiconfig sd/source sw/source sw/uiconfig
sc/source/ui/navipi/navipi.cxx |6 ++ sc/uiconfig/scalc/ui/navigatorpanel.ui |2 +- sd/source/ui/dlg/navigatr.cxx|6 ++ sw/source/uibase/utlui/navipi.cxx| 29 - sw/uiconfig/swriter/ui/navigatorpanel.ui |2 +- 5 files changed, 38 insertions(+), 7 deletions(-) New commits: commit fa93ddc87b86432ab68e43353cd872439895898f Author: Attila Szűcs AuthorDate: Thu May 4 16:59:54 2023 +0200 Commit: Szymon Kłos CommitDate: Fri May 5 10:01:10 2023 +0200 LOK: Navi-10 hide not needed controls Hide controls we dont need in navigator now. Change-Id: Ibf6843be2976bcd4d90e67130dd0cc08d0988c0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151397 Tested-by: Szymon Kłos Reviewed-by: Szymon Kłos diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 6340c1a80f33..1934b14ca374 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -423,6 +423,12 @@ ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, weld::Widget* pParent, SfxNaviga else eNavMode = NAV_LMODE_AREAS; SetListMode(eNavMode); + +if(comphelper::LibreOfficeKit::isActive()) +{ +m_xBuilder->weld_container("gridbuttons")->hide(); +m_xLbDocuments->hide(); +} } weld::Window* ScNavigatorDlg::GetFrameWeld() const diff --git a/sc/uiconfig/scalc/ui/navigatorpanel.ui b/sc/uiconfig/scalc/ui/navigatorpanel.ui index 9e02f0ba5588..a5b9b3038be6 100644 --- a/sc/uiconfig/scalc/ui/navigatorpanel.ui +++ b/sc/uiconfig/scalc/ui/navigatorpanel.ui @@ -101,7 +101,7 @@ 12 - + True False True diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index cdc2db1f5a81..459051b9aed4 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -48,6 +48,7 @@ #include #include +#include /** * SdNavigatorWin - FloatingWindow @@ -93,6 +94,11 @@ SdNavigatorWin::SdNavigatorWin(weld::Widget* pParent, SfxBindings* pInBindings, mxToolbox->connect_key_press(LINK(this, SdNavigatorWin, KeyInputHdl)); mxTlbObjects->connect_key_press(LINK(this, SdNavigatorWin, KeyInputHdl)); mxLbDocs->connect_key_press(LINK(this, SdNavigatorWin, KeyInputHdl)); +if(comphelper::LibreOfficeKit::isActive()) +{ +mxToolbox->hide(); +mxLbDocs->hide(); +} } void SdNavigatorWin::FirstFocus() diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index fc92d2d6edda..4f60ba96e874 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -49,6 +49,8 @@ #include +#include + using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; @@ -682,6 +684,14 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xDocListBox->set_accessible_name(m_aStatusArr[3]); m_aExpandedSize = m_xContainer->get_preferred_size(); + +if(comphelper::LibreOfficeKit::isActive()) +{ +m_xBuilder->weld_container("gridcontent16")->hide(); +m_xDocListBox->hide(); +m_xGlobalBox->hide(); +m_xGlobalToolBox->hide(); +} } weld::Window* SwNavigationPI::GetFrameWeld() const @@ -765,12 +775,15 @@ void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState /*eState*/, } else if (nSID == FN_STAT_PAGE) { -SwView *pActView = GetCreateView(); -if(pActView) +if(!comphelper::LibreOfficeKit::isActive()) { -SwWrtShell = pActView->GetWrtShell(); -m_xEdit->set_max(rSh.GetPageCnt()); -m_xEdit->set_width_chars(3); +SwView *pActView = GetCreateView(); +if(pActView) +{ +SwWrtShell = pActView->GetWrtShell(); +m_xEdit->set_max(rSh.GetPageCnt()); +m_xEdit->set_width_chars(3); +} } } } @@ -1045,6 +1058,12 @@ void SwNavigationPI::SetRegionDropMode(RegionMode nNewMode) void SwNavigationPI::ToggleTree() { +if (comphelper::LibreOfficeKit::isActive()) +{ +m_xGlobalTree->HideTree(); +return; +} + bool bGlobalDoc = IsGlobalDoc(); if (!IsGlobalMode() && bGlobalDoc) { diff --git a/sw/uiconfig/swriter/ui/navigatorpanel.ui b/sw/uiconfig/swriter/ui/navigatorpanel.ui index f38518649c9a..71718d71d572 100644 --- a/sw/uiconfig/swriter/ui/navigatorpanel.ui +++ b/sw/uiconfig/swriter/ui/navigatorpanel.ui @@ -244,7 +244,7 @@ 6 12 - + True False True
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - vcl/jsdialog
vcl/jsdialog/executor.cxx |4 1 file changed, 4 insertions(+) New commits: commit d9d2e4b1c1b660e4727edd21b0c83b7534b6171c Author: Attila Szűcs AuthorDate: Wed May 3 04:46:20 2023 +0200 Commit: Szymon Kłos CommitDate: Fri May 5 09:38:00 2023 +0200 LOK: Navi-6 page selector SpinField Grab the focus back to the spinfield in sidebar, so the document will be able to scroll to the right page. It seems there is a condition check, on move to page, that focus must be not on document, or else it does not move. AFAIK in lok code we dont try to simulate the focus of the core, but maybe we should, for cases like this. Change-Id: Ie9a30e6bd944cfa1729861eb0ac1924b946f4185 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151309 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index a178d60fc2c3..737ae2f961b9 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -311,6 +311,10 @@ bool ExecuteAction(const std::string& nWindowId, const OString& rWidget, StringM if (rData["data"] == "undefined") return true; +// The Document will not scroll if that is in focus +// maybe we could send a message with: sAction == "grab_focus" +pWidget->grab_focus(); + double nValue = o3tl::toDouble(rData["data"]); pSpinField->set_value(nValue * weld::SpinButton::Power10(pSpinField->get_digits()));
[Libreoffice-commits] core.git: include/package package/inc package/qa package/source sc/qa tools/source unotools/source
include/package/Deflater.hxx |2 package/inc/ByteChucker.hxx| 30 package/inc/ZipFile.hxx|4 package/inc/ZipOutputStream.hxx|3 package/qa/cppunit/data/export64.zip |binary package/qa/cppunit/test_package.cxx| 49 +++ package/source/zipapi/ByteChucker.cxx |2 package/source/zipapi/Deflater.cxx | 18 ++ package/source/zipapi/MemoryByteGrabber.hxx| 32 package/source/zipapi/ZipFile.cxx | 143 +++-- package/source/zipapi/ZipOutputStream.cxx | 69 +- sc/qa/unit/data/xlsx/tdf82984_zip64XLSXImport.xlsx |binary sc/qa/unit/subsequent_filters_test3.cxx|6 tools/source/stream/strmwnt.cxx| 23 ++- unotools/source/streaming/streamwrap.cxx |2 15 files changed, 303 insertions(+), 80 deletions(-) New commits: commit abda72eeac19b18c22f57d5443c3955a463605d7 Author: Attila Szűcs AuthorDate: Mon Feb 20 00:32:22 2023 +0100 Commit: Michael Meeks CommitDate: Wed Mar 8 14:53:57 2023 + tdf#82984 tdf#94915 zip64 support (import + export) Implemented import + export for "Zip64 Extended Information Extra Field", (in "Local file header" and "Central directory file header") and for Data descriptor. Focused only to be able to handle files with over 4GB uncompressed size, in the zip archive. The 64k filecount, and the 4GB compressed size limit is probably still present Tried to follow pkware .ZIP File Format Specification, Some cases were not clear to me and/or some zip compressing tool may not perfectly follow the standard, like 'extra field' should be 28 bytes long, but its reader now can read shorter (or longer) 'extra field'. Replaced some 32bit codes with 64bit codes, in stream handling, in deflater. Tested with an ods file that contained a content.xml that bigger then 4BG+ (import + export + reimport) on windows. I think 4GB+ files import/export would be too slow fot unittest. So, for unit test, used the small but zip64 format files, that was attached to the bugzilla tickets Note: It helps with Bug 128244 too (1 of the unittest tests it), but that ods file missing manifest.xml, so LO won't be able to import it. Change-Id: Idfeb90594388fd34ae719677f5d268ca9a484fb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147306 Tested-by: Jenkins Reviewed-by: Michael Meeks diff --git a/include/package/Deflater.hxx b/include/package/Deflater.hxx index 3cd528bf5afd..2a5c9d103260 100644 --- a/include/package/Deflater.hxx +++ b/include/package/Deflater.hxx @@ -36,6 +36,8 @@ class DLLPUBLIC_PACKAGE Deflater final boolbFinish; boolbFinished; sal_Int64 nOffset, nLength; +// zlib total_in / total_out may be stored in 32bit, so they can overflow in case of 4gb files +sal_uInt64 nTotalOut64, nTotalIn64; // save the overflowed value here. std::unique_ptr pStream; void init (sal_Int32 nLevel, bool bNowrap); diff --git a/package/inc/ByteChucker.hxx b/package/inc/ByteChucker.hxx index 707b678ff2a5..c502ad6b5c42 100644 --- a/package/inc/ByteChucker.hxx +++ b/package/inc/ByteChucker.hxx @@ -29,8 +29,8 @@ class ByteChucker final { css::uno::Reference < css::io::XOutputStream > xStream; css::uno::Reference < css::io::XSeekable > xSeek; -css::uno::Sequence < sal_Int8 > a2Sequence, a4Sequence; -sal_Int8 * const p2Sequence, * const p4Sequence; +css::uno::Sequence < sal_Int8 > a2Sequence, a4Sequence, a8Sequence; +sal_Int8 * const p2Sequence, * const p4Sequence, * const p8Sequence; public: ByteChucker (css::uno::Reference const & xOstream); @@ -70,6 +70,32 @@ public: p4Sequence[3] = static_cast < sal_Int8 > ((nuInt32 >> 24 ) & 0xFF); WriteBytes( a4Sequence ); } + +void WriteInt64(sal_Int64 nInt64) +{ +p8Sequence[0] = static_cast((nInt64 >> 0) & 0xFF); +p8Sequence[1] = static_cast((nInt64 >> 8) & 0xFF); +p8Sequence[2] = static_cast((nInt64 >> 16) & 0xFF); +p8Sequence[3] = static_cast((nInt64 >> 24) & 0xFF); +p8Sequence[4] = static_cast((nInt64 >> 32) & 0xFF); +p8Sequence[5] = static_cast((nInt64 >> 40) & 0xFF); +p8Sequence[6] = static_cast((nInt64 >> 48) & 0xFF); +p8Sequence[7] = static_cast((nInt64 >> 56) & 0xFF); +WriteBytes( a8Sequence ); +} + +void WriteUInt64(sal_uInt64 nuInt64) +{ +p8Sequence[0] = static_cast((nuInt64 >> 0) & 0xFF); +p8Sequence[1] = static_cast((nuInt64 >> 8) & 0xFF); +p8Sequence[2] = static_cast((nuInt64 >> 16) & 0xFF); +p8Sequence[3] = static_cast((nuInt64 >> 24) & 0xFF); +p8Sequence[4] =
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - include/svx sc/source sd/source svx/qa svx/source sw/source
include/svx/svdmodel.hxx|4 + sc/source/ui/docshell/docsh.cxx |2 sd/source/ui/docshell/docshel4.cxx |1 svx/qa/unit/data/tdf148000_EOLinCurvedText.pptx |binary svx/qa/unit/data/tdf148000_EOLinCurvedText_Legacy.odp |binary svx/qa/unit/data/tdf148000_EOLinCurvedText_New.odp |binary svx/qa/unit/svdraw.cxx | 42 +++ svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 57 svx/source/svdraw/svdmodel.cxx | 42 +++ sw/source/uibase/app/docshini.cxx | 10 +- 10 files changed, 142 insertions(+), 16 deletions(-) New commits: commit 497298874961fb335caf4cc91e531667394588bc Author: Attila Szűcs AuthorDate: Fri Jan 13 04:49:33 2023 +0100 Commit: Andras Timar CommitDate: Mon Jan 23 12:47:04 2023 + tdf#148000 impress: Handle linebreaks on fontwork. Split text lines in a paragraph, right before polygons are created for rendering, so eol will brake line in fontwork just like eop. Change-Id: Ie9e6764f9f91c2e19afd43dc9a212bd18c41c99d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145425 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit f9d6dd788e82a1964dab9cc0d0436c8c54b775c0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145804 Reviewed-by: Andras Timar diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 7c23b5a24712..b5d93fa53eb7 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -575,6 +575,10 @@ public: void SetAnchoredTextOverflowLegacy(bool bEnabled); bool IsAnchoredTextOverflowLegacy() const; +// tdf#148000 compatibility flag +void SetLegacySingleLineFontwork(bool bEnabled); +bool IsLegacySingleLineFontwork() const; + void ReformatAllTextObjects(); std::unique_ptr createOutliner( OutlinerMode nOutlinerMode ); diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 2f2f3521ae4e..458feb6dea2a 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -590,6 +590,8 @@ bool ScDocShell::Load( SfxMedium& rMedium ) { if (m_pDocument->GetDrawLayer()) m_pDocument->GetDrawLayer()->SetAnchoredTextOverflowLegacy(true); +if (m_pDocument->GetDrawLayer()) +m_pDocument->GetDrawLayer()->SetLegacySingleLineFontwork(true); //for tdf#148000 } GetUndoManager()->Clear(); diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 13b08deafa1a..0bdfef02b7db 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -269,6 +269,7 @@ bool DrawDocShell::Load( SfxMedium& rMedium ) if (IsOwnStorageFormat(rMedium)) { mpDoc->SetAnchoredTextOverflowLegacy(true); +mpDoc->SetLegacySingleLineFontwork(true); //for tdf#148000 } bool bRet = false; diff --git a/svx/qa/unit/data/tdf148000_EOLinCurvedText.pptx b/svx/qa/unit/data/tdf148000_EOLinCurvedText.pptx new file mode 100644 index ..137fc816697a Binary files /dev/null and b/svx/qa/unit/data/tdf148000_EOLinCurvedText.pptx differ diff --git a/svx/qa/unit/data/tdf148000_EOLinCurvedText_Legacy.odp b/svx/qa/unit/data/tdf148000_EOLinCurvedText_Legacy.odp new file mode 100644 index ..13e7cc4e5c8a Binary files /dev/null and b/svx/qa/unit/data/tdf148000_EOLinCurvedText_Legacy.odp differ diff --git a/svx/qa/unit/data/tdf148000_EOLinCurvedText_New.odp b/svx/qa/unit/data/tdf148000_EOLinCurvedText_New.odp new file mode 100644 index ..7ebdb9431b72 Binary files /dev/null and b/svx/qa/unit/data/tdf148000_EOLinCurvedText_New.odp differ diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx index c2a7f244b8ab..7bf1ceb9d4a1 100644 --- a/svx/qa/unit/svdraw.cxx +++ b/svx/qa/unit/svdraw.cxx @@ -382,6 +382,48 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testFontWorks) "32"); } +CPPUNIT_TEST_FIXTURE(SvdrawTest, testTdf148000_EOLinCurvedText) +{ +std::vector aFilenames += { u"tdf148000_EOLinCurvedText.pptx", u"tdf148000_EOLinCurvedText_New.odp", +u"tdf148000_EOLinCurvedText_Legacy.odp" }; + +for (int i = 0; i < 3; i++) +{ +loadFromURL(aFilenames[i]); + +SdrPage* pSdrPage = getFirstDrawPageWithAssert(); + +xmlDocUniquePtr pXmlDoc = lcl_dumpAndParseFirstObjectWithAssert(pSdrPage); + +OString aBasePath += "/primitive2D/objectinfo[4]/unhandled/unhandled/polypolygoncolor/polypolygon/"; + +// The text is: "O" + eop + "O" + eol + "O" +// It should be displayed as 3 line of text. (1 "O" letter in every line) +sal_Int32 nY1 = getXPath(pXmlDoc, aBasePath + "polygon[1]/point[1]", "y").toInt32(); +sal_Int32 nY2 = getXPath(pXmlDoc,
[Libreoffice-commits] core.git: include/svx sc/source sd/source svx/qa svx/source sw/source
include/svx/svdmodel.hxx|4 + sc/source/ui/docshell/docsh.cxx |2 sd/source/ui/docshell/docshel4.cxx |1 svx/qa/unit/data/tdf148000_EOLinCurvedText.pptx |binary svx/qa/unit/data/tdf148000_EOLinCurvedText_Legacy.odp |binary svx/qa/unit/data/tdf148000_EOLinCurvedText_New.odp |binary svx/qa/unit/svdraw.cxx | 42 +++ svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 57 svx/source/svdraw/svdmodel.cxx | 42 +++ sw/source/uibase/app/docshini.cxx | 10 +- 10 files changed, 142 insertions(+), 16 deletions(-) New commits: commit f9d6dd788e82a1964dab9cc0d0436c8c54b775c0 Author: Attila Szűcs AuthorDate: Fri Jan 13 04:49:33 2023 +0100 Commit: Miklos Vajna CommitDate: Fri Jan 20 07:56:29 2023 + tdf#148000 impress: Handle linebreaks on fontwork. Split text lines in a paragraph, right before polygons are created for rendering, so eol will brake line in fontwork just like eop. Change-Id: Ie9e6764f9f91c2e19afd43dc9a212bd18c41c99d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145425 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 7c23b5a24712..b5d93fa53eb7 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -575,6 +575,10 @@ public: void SetAnchoredTextOverflowLegacy(bool bEnabled); bool IsAnchoredTextOverflowLegacy() const; +// tdf#148000 compatibility flag +void SetLegacySingleLineFontwork(bool bEnabled); +bool IsLegacySingleLineFontwork() const; + void ReformatAllTextObjects(); std::unique_ptr createOutliner( OutlinerMode nOutlinerMode ); diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 071c2530f61b..1f58bf43f1b7 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -589,6 +589,8 @@ bool ScDocShell::Load( SfxMedium& rMedium ) { if (m_pDocument->GetDrawLayer()) m_pDocument->GetDrawLayer()->SetAnchoredTextOverflowLegacy(true); +if (m_pDocument->GetDrawLayer()) +m_pDocument->GetDrawLayer()->SetLegacySingleLineFontwork(true); //for tdf#148000 } GetUndoManager()->Clear(); diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 99d6890fe1f0..4df8aee97a4a 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -269,6 +269,7 @@ bool DrawDocShell::Load( SfxMedium& rMedium ) if (IsOwnStorageFormat(rMedium)) { mpDoc->SetAnchoredTextOverflowLegacy(true); +mpDoc->SetLegacySingleLineFontwork(true); //for tdf#148000 } bool bRet = false; diff --git a/svx/qa/unit/data/tdf148000_EOLinCurvedText.pptx b/svx/qa/unit/data/tdf148000_EOLinCurvedText.pptx new file mode 100644 index ..137fc816697a Binary files /dev/null and b/svx/qa/unit/data/tdf148000_EOLinCurvedText.pptx differ diff --git a/svx/qa/unit/data/tdf148000_EOLinCurvedText_Legacy.odp b/svx/qa/unit/data/tdf148000_EOLinCurvedText_Legacy.odp new file mode 100644 index ..13e7cc4e5c8a Binary files /dev/null and b/svx/qa/unit/data/tdf148000_EOLinCurvedText_Legacy.odp differ diff --git a/svx/qa/unit/data/tdf148000_EOLinCurvedText_New.odp b/svx/qa/unit/data/tdf148000_EOLinCurvedText_New.odp new file mode 100644 index ..7ebdb9431b72 Binary files /dev/null and b/svx/qa/unit/data/tdf148000_EOLinCurvedText_New.odp differ diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx index c2a7f244b8ab..7bf1ceb9d4a1 100644 --- a/svx/qa/unit/svdraw.cxx +++ b/svx/qa/unit/svdraw.cxx @@ -382,6 +382,48 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testFontWorks) "32"); } +CPPUNIT_TEST_FIXTURE(SvdrawTest, testTdf148000_EOLinCurvedText) +{ +std::vector aFilenames += { u"tdf148000_EOLinCurvedText.pptx", u"tdf148000_EOLinCurvedText_New.odp", +u"tdf148000_EOLinCurvedText_Legacy.odp" }; + +for (int i = 0; i < 3; i++) +{ +loadFromURL(aFilenames[i]); + +SdrPage* pSdrPage = getFirstDrawPageWithAssert(); + +xmlDocUniquePtr pXmlDoc = lcl_dumpAndParseFirstObjectWithAssert(pSdrPage); + +OString aBasePath += "/primitive2D/objectinfo[4]/unhandled/unhandled/polypolygoncolor/polypolygon/"; + +// The text is: "O" + eop + "O" + eol + "O" +// It should be displayed as 3 line of text. (1 "O" letter in every line) +sal_Int32 nY1 = getXPath(pXmlDoc, aBasePath + "polygon[1]/point[1]", "y").toInt32(); +sal_Int32 nY2 = getXPath(pXmlDoc, aBasePath + "polygon[3]/point[1]", "y").toInt32(); +sal_Int32 nY3 = getXPath(pXmlDoc, aBasePath + "polygon[5]/point[1]", "y").toInt32(); + +sal_Int32 nDiff21
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - oox/source sd/qa
oox/source/ppt/slidepersist.cxx | 72 +- sd/qa/unit/data/pptx/tdf153036_resizedConnectorL.pptx |binary sd/qa/unit/import-tests.cxx | 17 3 files changed, 69 insertions(+), 20 deletions(-) New commits: commit 379866dd23be2cd3eb9952fbc6b106daaec0cdea Author: Attila Szűcs AuthorDate: Mon Jan 16 04:13:07 2023 +0100 Commit: Xisco Fauli CommitDate: Thu Jan 19 13:29:10 2023 + tdf#153036 PPTX import resized connector broken Fixed the EdgeLine1Delta calculation in case of bentConnector2. (when L shape imported as a special Z shape) Co-authored-by: Tibor Nagy (NISZ) Change-Id: I08c92e63adc744322061e4e433bfdc512745eda1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145548 Tested-by: Jenkins Reviewed-by: Andras Timar (cherry picked from commit 17c68fad2aef917adfdd3d4d651da786e620699c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145766 Reviewed-by: Xisco Fauli diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index 657703fff239..dc068b0b699e 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -342,6 +342,36 @@ void SlidePersist::hideShapesAsMasterShapes() } } +// This angle determines in the direction of the line +static sal_Int32 lcl_GetAngle(uno::Reference& rXShape, awt::Point& rPt) +{ +SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rXShape); +tools::Rectangle aR(pObj->GetSnapRect()); +sal_Int32 nLeftX = rPt.X - aR.Left(); +sal_Int32 nTopY = rPt.Y - aR.Top(); +sal_Int32 nRightX = aR.Right() - rPt.X; +sal_Int32 nBottomY = aR.Bottom() - rPt.Y; +sal_Int32 nX = std::min(nLeftX, nRightX); +sal_Int32 nY = std::min(nTopY, nBottomY); + +sal_Int32 nAngle; +if (nX < nY) +{ +if (nLeftX < nRightX) +nAngle = 180; // Left +else +nAngle = 0; // Right +} +else +{ +if (nTopY < nBottomY) +nAngle = 270; // Top +else +nAngle = 90; // Bottom +} +return nAngle; +} + Reference SlidePersist::getAnimationNode(const OUString& sId) const { const auto& pIter = maAnimNodesMap.find(sId); @@ -373,6 +403,8 @@ static void lcl_SetEdgeLineValue(uno::Reference& rXConnector, SdrObject* pEndObj = xEndSp.is() ? SdrObject::getSdrObjectFromXShape(xEndSp) : nullptr; sal_Int32 nStartSpLineW = 0; +sal_Int32 nStartA = -1; +sal_Int32 nEndA = -1; if (pStartObj) { aStartRect = pStartObj->GetSnapRect(); @@ -380,6 +412,7 @@ static void lcl_SetEdgeLineValue(uno::Reference& rXConnector, xPropxStartSp->getPropertyValue("LineWidth") >>= nStartSpLineW; if (nStartSpLineW) nStartSpLineW = nStartSpLineW / 2; +nStartA = lcl_GetAngle(xStartSp, aStartPt); } sal_Int32 nEndSpLineW = 0; if (pEndObj) @@ -389,6 +422,7 @@ static void lcl_SetEdgeLineValue(uno::Reference& rXConnector, xPropxEndSp->getPropertyValue("LineWidth") >>= nEndSpLineW; if (nEndSpLineW) nEndSpLineW = nEndSpLineW / 2; +nEndA = lcl_GetAngle(xEndSp, aEndPt); } const OUString sConnectorName = rShapePtr->getConnectorName(); @@ -397,27 +431,25 @@ static void lcl_SetEdgeLineValue(uno::Reference& rXConnector, awt::Size aConnSize = rXConnector->getSize(); if (xStartSp.is() || xEndSp.is()) { -if (aConnSize.Height < aConnSize.Width) +if (nStartA >= 0) { -if (xStartSp.is()) -nEdge = (aStartPt.Y > aEndPt.Y) -? (nStartSpLineW - (aStartRect.Top() - aEndPt.Y)) -: ((aEndPt.Y - aStartRect.Bottom()) - nStartSpLineW); -else -nEdge = (aStartPt.Y > aEndPt.Y) -? ((aStartPt.Y - aEndRect.Bottom()) - nEndSpLineW) -: (nEndSpLineW - (aEndRect.Top() - aStartPt.Y)); -} -else -{ -if (xStartSp.is()) -nEdge = (aStartPt.X > aEndPt.X) -? (nStartSpLineW - (aStartRect.Left() - aEndPt.X)) -: ((aEndPt.X - aStartRect.Right()) - nStartSpLineW); -else -nEdge = (aStartPt.X > aEndPt.X) -? ((aStartPt.X - aEndRect.Right()) - nEndSpLineW) -: (nEndSpLineW - (aEndRect.Left() - aStartPt.X)); +switch (nStartA) +{ +case 0: nEdge = aEndPt.X - aStartRect.Right(); break; +case 180: nEdge = aEndPt.X - aStartRect.Left(); break; +case 90:nEdge = aEndPt.Y - aStartRect.Bottom(); break; +case 270: nEdge = aEndPt.Y -
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - oox/source sd/qa
oox/source/ppt/slidepersist.cxx | 72 +- sd/qa/unit/data/pptx/tdf153036_resizedConnectorL.pptx |binary sd/qa/unit/import-tests.cxx | 16 3 files changed, 68 insertions(+), 20 deletions(-) New commits: commit a44ab07e05521b987c842265184240661e330ea4 Author: Attila Szűcs AuthorDate: Mon Jan 16 04:13:07 2023 +0100 Commit: Xisco Fauli CommitDate: Thu Jan 19 11:13:11 2023 + tdf#153036 PPTX import resized connector broken Fixed the EdgeLine1Delta calculation in case of bentConnector2. (when L shape imported as a special Z shape) Co-authored-by: Tibor Nagy (NISZ) Change-Id: I08c92e63adc744322061e4e433bfdc512745eda1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145548 Tested-by: Jenkins Reviewed-by: Andras Timar (cherry picked from commit 17c68fad2aef917adfdd3d4d651da786e620699c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145728 diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index c875239aac46..ca296561a52f 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -341,6 +341,36 @@ void SlidePersist::hideShapesAsMasterShapes() } } +// This angle determines in the direction of the line +static sal_Int32 lcl_GetAngle(uno::Reference& rXShape, awt::Point& rPt) +{ +SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rXShape); +tools::Rectangle aR(pObj->GetSnapRect()); +sal_Int32 nLeftX = rPt.X - aR.Left(); +sal_Int32 nTopY = rPt.Y - aR.Top(); +sal_Int32 nRightX = aR.Right() - rPt.X; +sal_Int32 nBottomY = aR.Bottom() - rPt.Y; +sal_Int32 nX = std::min(nLeftX, nRightX); +sal_Int32 nY = std::min(nTopY, nBottomY); + +sal_Int32 nAngle; +if (nX < nY) +{ +if (nLeftX < nRightX) +nAngle = 180; // Left +else +nAngle = 0; // Right +} +else +{ +if (nTopY < nBottomY) +nAngle = 270; // Top +else +nAngle = 90; // Bottom +} +return nAngle; +} + Reference SlidePersist::getAnimationNode(const OUString& sId) const { const auto& pIter = maAnimNodesMap.find(sId); @@ -372,6 +402,8 @@ static void lcl_SetEdgeLineValue(uno::Reference& rXConnector, SdrObject* pEndObj = xEndSp.is() ? SdrObject::getSdrObjectFromXShape(xEndSp) : nullptr; sal_Int32 nStartSpLineW = 0; +sal_Int32 nStartA = -1; +sal_Int32 nEndA = -1; if (pStartObj) { aStartRect = pStartObj->GetSnapRect(); @@ -379,6 +411,7 @@ static void lcl_SetEdgeLineValue(uno::Reference& rXConnector, xPropxStartSp->getPropertyValue("LineWidth") >>= nStartSpLineW; if (nStartSpLineW) nStartSpLineW = nStartSpLineW / 2; +nStartA = lcl_GetAngle(xStartSp, aStartPt); } sal_Int32 nEndSpLineW = 0; if (pEndObj) @@ -388,6 +421,7 @@ static void lcl_SetEdgeLineValue(uno::Reference& rXConnector, xPropxEndSp->getPropertyValue("LineWidth") >>= nEndSpLineW; if (nEndSpLineW) nEndSpLineW = nEndSpLineW / 2; +nEndA = lcl_GetAngle(xEndSp, aEndPt); } const OUString sConnectorName = rShapePtr->getConnectorName(); @@ -396,27 +430,25 @@ static void lcl_SetEdgeLineValue(uno::Reference& rXConnector, awt::Size aConnSize = rXConnector->getSize(); if (xStartSp.is() || xEndSp.is()) { -if (aConnSize.Height < aConnSize.Width) +if (nStartA >= 0) { -if (xStartSp.is()) -nEdge = (aStartPt.Y > aEndPt.Y) -? (nStartSpLineW - (aStartRect.Top() - aEndPt.Y)) -: ((aEndPt.Y - aStartRect.Bottom()) - nStartSpLineW); -else -nEdge = (aStartPt.Y > aEndPt.Y) -? ((aStartPt.Y - aEndRect.Bottom()) - nEndSpLineW) -: (nEndSpLineW - (aEndRect.Top() - aStartPt.Y)); -} -else -{ -if (xStartSp.is()) -nEdge = (aStartPt.X > aEndPt.X) -? (nStartSpLineW - (aStartRect.Left() - aEndPt.X)) -: ((aEndPt.X - aStartRect.Right()) - nStartSpLineW); -else -nEdge = (aStartPt.X > aEndPt.X) -? ((aStartPt.X - aEndRect.Right()) - nEndSpLineW) -: (nEndSpLineW - (aEndRect.Left() - aStartPt.X)); +switch (nStartA) +{ +case 0: nEdge = aEndPt.X - aStartRect.Right(); break; +case 180: nEdge = aEndPt.X - aStartRect.Left(); break; +case 90:nEdge = aEndPt.Y - aStartRect.Bottom(); break; +case 270: nEdge = aEndPt.Y - aStartRect.Top();break; +
[Libreoffice-commits] core.git: oox/source sd/qa
oox/source/ppt/slidepersist.cxx | 72 +- sd/qa/unit/data/pptx/tdf153036_resizedConnectorL.pptx |binary sd/qa/unit/import-tests.cxx | 16 3 files changed, 68 insertions(+), 20 deletions(-) New commits: commit 17c68fad2aef917adfdd3d4d651da786e620699c Author: Attila Szűcs AuthorDate: Mon Jan 16 04:13:07 2023 +0100 Commit: Andras Timar CommitDate: Thu Jan 19 08:27:39 2023 + tdf#153036 PPTX import resized connector broken Fixed the EdgeLine1Delta calculation in case of bentConnector2. (when L shape imported as a special Z shape) Co-authored-by: Tibor Nagy (NISZ) Change-Id: I08c92e63adc744322061e4e433bfdc512745eda1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145548 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index c875239aac46..ca296561a52f 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -341,6 +341,36 @@ void SlidePersist::hideShapesAsMasterShapes() } } +// This angle determines in the direction of the line +static sal_Int32 lcl_GetAngle(uno::Reference& rXShape, awt::Point& rPt) +{ +SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rXShape); +tools::Rectangle aR(pObj->GetSnapRect()); +sal_Int32 nLeftX = rPt.X - aR.Left(); +sal_Int32 nTopY = rPt.Y - aR.Top(); +sal_Int32 nRightX = aR.Right() - rPt.X; +sal_Int32 nBottomY = aR.Bottom() - rPt.Y; +sal_Int32 nX = std::min(nLeftX, nRightX); +sal_Int32 nY = std::min(nTopY, nBottomY); + +sal_Int32 nAngle; +if (nX < nY) +{ +if (nLeftX < nRightX) +nAngle = 180; // Left +else +nAngle = 0; // Right +} +else +{ +if (nTopY < nBottomY) +nAngle = 270; // Top +else +nAngle = 90; // Bottom +} +return nAngle; +} + Reference SlidePersist::getAnimationNode(const OUString& sId) const { const auto& pIter = maAnimNodesMap.find(sId); @@ -372,6 +402,8 @@ static void lcl_SetEdgeLineValue(uno::Reference& rXConnector, SdrObject* pEndObj = xEndSp.is() ? SdrObject::getSdrObjectFromXShape(xEndSp) : nullptr; sal_Int32 nStartSpLineW = 0; +sal_Int32 nStartA = -1; +sal_Int32 nEndA = -1; if (pStartObj) { aStartRect = pStartObj->GetSnapRect(); @@ -379,6 +411,7 @@ static void lcl_SetEdgeLineValue(uno::Reference& rXConnector, xPropxStartSp->getPropertyValue("LineWidth") >>= nStartSpLineW; if (nStartSpLineW) nStartSpLineW = nStartSpLineW / 2; +nStartA = lcl_GetAngle(xStartSp, aStartPt); } sal_Int32 nEndSpLineW = 0; if (pEndObj) @@ -388,6 +421,7 @@ static void lcl_SetEdgeLineValue(uno::Reference& rXConnector, xPropxEndSp->getPropertyValue("LineWidth") >>= nEndSpLineW; if (nEndSpLineW) nEndSpLineW = nEndSpLineW / 2; +nEndA = lcl_GetAngle(xEndSp, aEndPt); } const OUString sConnectorName = rShapePtr->getConnectorName(); @@ -396,27 +430,25 @@ static void lcl_SetEdgeLineValue(uno::Reference& rXConnector, awt::Size aConnSize = rXConnector->getSize(); if (xStartSp.is() || xEndSp.is()) { -if (aConnSize.Height < aConnSize.Width) +if (nStartA >= 0) { -if (xStartSp.is()) -nEdge = (aStartPt.Y > aEndPt.Y) -? (nStartSpLineW - (aStartRect.Top() - aEndPt.Y)) -: ((aEndPt.Y - aStartRect.Bottom()) - nStartSpLineW); -else -nEdge = (aStartPt.Y > aEndPt.Y) -? ((aStartPt.Y - aEndRect.Bottom()) - nEndSpLineW) -: (nEndSpLineW - (aEndRect.Top() - aStartPt.Y)); -} -else -{ -if (xStartSp.is()) -nEdge = (aStartPt.X > aEndPt.X) -? (nStartSpLineW - (aStartRect.Left() - aEndPt.X)) -: ((aEndPt.X - aStartRect.Right()) - nStartSpLineW); -else -nEdge = (aStartPt.X > aEndPt.X) -? ((aStartPt.X - aEndRect.Right()) - nEndSpLineW) -: (nEndSpLineW - (aEndRect.Left() - aStartPt.X)); +switch (nStartA) +{ +case 0: nEdge = aEndPt.X - aStartRect.Right(); break; +case 180: nEdge = aEndPt.X - aStartRect.Left(); break; +case 90:nEdge = aEndPt.Y - aStartRect.Bottom(); break; +case 270: nEdge = aEndPt.Y - aStartRect.Top();break; +} +nEdge += nStartSpLineW * (nStartA >= 180 ? +1 : -1); +} else { +switch
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - oox/source sd/qa
oox/source/drawingml/shape.cxx |6 +++ sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx |binary sd/qa/unit/import-tests2.cxx | 25 +++ 3 files changed, 31 insertions(+) New commits: commit 0b91db7bdd624bd5351d132fee0b3eadf637b716 Author: Attila Szűcs AuthorDate: Thu Jan 5 13:29:32 2023 +0100 Commit: Andras Timar CommitDate: Sun Jan 8 16:37:53 2023 + tdf#149588 pptx import: transparency at SolidFill When copied color (RGB) property from text content to shape, copy alpha component as well. (If text color have alpha component) Change-Id: Ib86c48ab7b2d3c5f9491a2211b05e90b2c2ea10f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145079 Tested-by: Jenkins Reviewed-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145140 Tested-by: Jenkins CollaboraOffice diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index bbea8f21abab..7740c2e153be 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -545,6 +545,12 @@ static void lcl_createPresetShape(const uno::Reference& xShape, const sal_Int32 aFillColor = static_cast( pProperties.maFillProperties.maFillColor.getColor( rGraphicHelper ).GetRGBColor() ); xSet->setPropertyValue( UNO_NAME_FILLCOLOR, uno::makeAny( aFillColor ) ); + +if (pProperties.maFillProperties.maFillColor.hasTransparency()) +{ +const sal_Int16 aTransparence = pProperties.maFillProperties.maFillColor.getTransparency(); +xSet->setPropertyValue(UNO_NAME_FILL_TRANSPARENCE, uno::Any(aTransparence)); +} } else { diff --git a/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx b/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx new file mode 100644 index ..8967590b9284 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 41b3a77cf5ab..da74fafb6a9c 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -177,6 +177,7 @@ public: void testCropToZero(); void testTdf144092TableHeight(); void testTdf151547TransparentWhiteText(); +void testTdf149588TransparentSolidFill(); CPPUNIT_TEST_SUITE(SdImportTest2); @@ -246,6 +247,7 @@ public: CPPUNIT_TEST(testCropToZero); CPPUNIT_TEST(testTdf144092TableHeight); CPPUNIT_TEST(testTdf151547TransparentWhiteText); +CPPUNIT_TEST(testTdf149588TransparentSolidFill); CPPUNIT_TEST_SUITE_END(); }; @@ -2040,6 +2042,29 @@ void SdImportTest2::testTdf151547TransparentWhiteText() xDocShRef->DoClose(); } +void SdImportTest2::testTdf149588TransparentSolidFill() +{ +sd::DrawDocShellRef xDocShRef = loadURL( + m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx"), +PPTX); + +xDocShRef = saveAndReload(xDocShRef.get(), PPTX); + +uno::Reference xShape(getShapeFromPage(6, 0, xDocShRef)); +uno::Reference xParagraph(getParagraphFromShape(0, xShape)); +uno::Reference xRun(getRunFromParagraph(0, xParagraph)); +uno::Reference xPropSet(xRun, uno::UNO_QUERY_THROW); + +Color nCharColor; +xPropSet->getPropertyValue("CharColor") >>= nCharColor; +// Without the accompanying fix in place, this test would have failed with: +// - Expected: Color: R:99 G:99 B:99 A 51 (T:204) +// - Actual : Color: R:99 G:99 B:99 A: 255 (T: 0) +CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0xCC636363), nCharColor); + +xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2); CPPUNIT_PLUGIN_IMPLEMENT();
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - oox/source sd/qa
oox/source/drawingml/shape.cxx |6 sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx |binary sd/qa/unit/import-tests2.cxx | 20 +++ 3 files changed, 26 insertions(+) New commits: commit c27ba904366a966c2f4cc8fe2a04d47a41b3cc1d Author: Attila Szűcs AuthorDate: Wed Jan 4 00:40:23 2023 +0100 Commit: Andras Timar CommitDate: Fri Jan 6 09:29:22 2023 + tdf#149588 pptx import: transparency at SolidFill When copied color (RGB) property from text content to shape, copy alpha component as well. (If text color have alpha component) Change-Id: Ib86c48ab7b2d3c5f9491a2211b05e90b2c2ea10f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145031 Tested-by: Jenkins Reviewed-by: Andras Timar (cherry picked from commit 0cc9aaae5dc6655490513e8e4a93967f6248e23c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145004 diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index a9b869e86af2..059785edf6e5 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -852,6 +852,12 @@ static void lcl_copyCharPropsToShape(const uno::Reference& xSha aFillColor = static_cast( rCharProps.maFillProperties.maFillColor.getColor(rFilter.getGraphicHelper()) .GetRGBColor()); +if (rCharProps.maFillProperties.maFillColor.hasTransparency()) +{ +const sal_Int16 aTransparence += rCharProps.maFillProperties.maFillColor.getTransparency(); +xSet->setPropertyValue(UNO_NAME_FILL_TRANSPARENCE, uno::Any(aTransparence)); +} } xSet->setPropertyValue(UNO_NAME_FILLCOLOR, uno::Any(aFillColor)); diff --git a/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx b/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx new file mode 100644 index ..8967590b9284 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index b258c535e2c6..5d5864a2891e 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -145,6 +145,7 @@ public: void testTdf89928BlackWhiteThreshold(); void testTdf151547TransparentWhiteText(); void testTdf149961AutofitIndentation(); +void testTdf149588TransparentSolidFill(); CPPUNIT_TEST_SUITE(SdImportTest2); @@ -223,6 +224,7 @@ public: CPPUNIT_TEST(testTdf89928BlackWhiteThreshold); CPPUNIT_TEST(testTdf151547TransparentWhiteText); CPPUNIT_TEST(testTdf149961AutofitIndentation); +CPPUNIT_TEST(testTdf149588TransparentSolidFill); CPPUNIT_TEST_SUITE_END(); }; @@ -2009,6 +2011,24 @@ void SdImportTest2::testTdf149961AutofitIndentation() } } +void SdImportTest2::testTdf149588TransparentSolidFill() +{ +createSdImpressDoc("pptx/tdf149588_transparentSolidFill.pptx"); +saveAndReload("Impress MS PowerPoint 2007 XML"); + +uno::Reference xShape(getShapeFromPage(6, 0)); +uno::Reference xParagraph(getParagraphFromShape(0, xShape)); +uno::Reference xRun(getRunFromParagraph(0, xParagraph)); +uno::Reference xPropSet(xRun, uno::UNO_QUERY_THROW); + +Color nCharColor; +xPropSet->getPropertyValue("CharColor") >>= nCharColor; +// Without the accompanying fix in place, this test would have failed with: +// - Expected: Color: R:99 G:99 B:99 A 51 (T:204) +// - Actual : Color: R:99 G:99 B:99 A: 255 (T: 0) +CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0xCC636363), nCharColor); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2); CPPUNIT_PLUGIN_IMPLEMENT();
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - oox/source sd/qa
oox/source/drawingml/shape.cxx |6 +++ sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx |binary sd/qa/unit/import-tests2.cxx | 25 +++ 3 files changed, 31 insertions(+) New commits: commit 2e3cf5e21c9a4aba8623e89e5e472efa6586619d Author: Attila Szűcs AuthorDate: Thu Jan 5 13:29:32 2023 +0100 Commit: Andras Timar CommitDate: Fri Jan 6 09:29:32 2023 + tdf#149588 pptx import: transparency at SolidFill When copied color (RGB) property from text content to shape, copy alpha component as well. (If text color have alpha component) Change-Id: Ib86c48ab7b2d3c5f9491a2211b05e90b2c2ea10f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145079 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 1dd4eb319c26..8fefc18fdbf6 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -662,6 +662,12 @@ static void lcl_createPresetShape(const uno::Reference& xShape, const sal_Int32 aFillColor = static_cast( pProperties.maFillProperties.maFillColor.getColor( rGraphicHelper ).GetRGBColor() ); xSet->setPropertyValue( UNO_NAME_FILLCOLOR, uno::Any( aFillColor ) ); + +if (pProperties.maFillProperties.maFillColor.hasTransparency()) +{ +const sal_Int16 aTransparence = pProperties.maFillProperties.maFillColor.getTransparency(); +xSet->setPropertyValue(UNO_NAME_FILL_TRANSPARENCE, uno::Any(aTransparence)); +} } else { diff --git a/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx b/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx new file mode 100644 index ..8967590b9284 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 969eb250fb80..e9f2ce067740 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -141,6 +141,7 @@ public: void testTdf89928BlackWhiteThreshold(); void testTdf151547TransparentWhiteText(); void testTdf149961AutofitIndentation(); +void testTdf149588TransparentSolidFill(); CPPUNIT_TEST_SUITE(SdImportTest2); @@ -216,6 +217,7 @@ public: CPPUNIT_TEST(testTdf89928BlackWhiteThreshold); CPPUNIT_TEST(testTdf151547TransparentWhiteText); CPPUNIT_TEST(testTdf149961AutofitIndentation); +CPPUNIT_TEST(testTdf149588TransparentSolidFill); CPPUNIT_TEST_SUITE_END(); }; @@ -2206,6 +2208,29 @@ void SdImportTest2::testTdf149961AutofitIndentation() } } +void SdImportTest2::testTdf149588TransparentSolidFill() +{ +sd::DrawDocShellRef xDocShRef = loadURL( + m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx"), +PPTX); + +xDocShRef = saveAndReload(xDocShRef.get(), PPTX); + +uno::Reference xShape(getShapeFromPage(6, 0, xDocShRef)); +uno::Reference xParagraph(getParagraphFromShape(0, xShape)); +uno::Reference xRun(getRunFromParagraph(0, xParagraph)); +uno::Reference xPropSet(xRun, uno::UNO_QUERY_THROW); + +Color nCharColor; +xPropSet->getPropertyValue("CharColor") >>= nCharColor; +// Without the accompanying fix in place, this test would have failed with: +// - Expected: Color: R:99 G:99 B:99 A 51 (T:204) +// - Actual : Color: R:99 G:99 B:99 A: 255 (T: 0) +CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0xCC636363), nCharColor); + +xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2); CPPUNIT_PLUGIN_IMPLEMENT();
[Libreoffice-commits] core.git: oox/source sd/qa
oox/source/drawingml/shape.cxx |6 sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx |binary sd/qa/unit/import-tests2.cxx | 20 +++ 3 files changed, 26 insertions(+) New commits: commit 0cc9aaae5dc6655490513e8e4a93967f6248e23c Author: Attila Szűcs AuthorDate: Wed Jan 4 00:40:23 2023 +0100 Commit: Andras Timar CommitDate: Wed Jan 4 20:38:38 2023 + tdf#149588 pptx import: transparency at SolidFill When copied color (RGB) property from text content to shape, copy alpha component as well. (If text color have alpha component) Change-Id: Ib86c48ab7b2d3c5f9491a2211b05e90b2c2ea10f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145031 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index fcc1e9016170..7cd02f77f91f 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -708,6 +708,12 @@ static void lcl_copyCharPropsToShape(const uno::Reference& xSha aFillColor = static_cast( rCharProps.maFillProperties.maFillColor.getColor(rFilter.getGraphicHelper()) .GetRGBColor()); +if (rCharProps.maFillProperties.maFillColor.hasTransparency()) +{ +const sal_Int16 aTransparence += rCharProps.maFillProperties.maFillColor.getTransparency(); +xSet->setPropertyValue(UNO_NAME_FILL_TRANSPARENCE, uno::Any(aTransparence)); +} } xSet->setPropertyValue(UNO_NAME_FILLCOLOR, uno::Any(aFillColor)); diff --git a/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx b/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx new file mode 100644 index ..8967590b9284 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index b258c535e2c6..5d5864a2891e 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -145,6 +145,7 @@ public: void testTdf89928BlackWhiteThreshold(); void testTdf151547TransparentWhiteText(); void testTdf149961AutofitIndentation(); +void testTdf149588TransparentSolidFill(); CPPUNIT_TEST_SUITE(SdImportTest2); @@ -223,6 +224,7 @@ public: CPPUNIT_TEST(testTdf89928BlackWhiteThreshold); CPPUNIT_TEST(testTdf151547TransparentWhiteText); CPPUNIT_TEST(testTdf149961AutofitIndentation); +CPPUNIT_TEST(testTdf149588TransparentSolidFill); CPPUNIT_TEST_SUITE_END(); }; @@ -2009,6 +2011,24 @@ void SdImportTest2::testTdf149961AutofitIndentation() } } +void SdImportTest2::testTdf149588TransparentSolidFill() +{ +createSdImpressDoc("pptx/tdf149588_transparentSolidFill.pptx"); +saveAndReload("Impress MS PowerPoint 2007 XML"); + +uno::Reference xShape(getShapeFromPage(6, 0)); +uno::Reference xParagraph(getParagraphFromShape(0, xShape)); +uno::Reference xRun(getRunFromParagraph(0, xParagraph)); +uno::Reference xPropSet(xRun, uno::UNO_QUERY_THROW); + +Color nCharColor; +xPropSet->getPropertyValue("CharColor") >>= nCharColor; +// Without the accompanying fix in place, this test would have failed with: +// - Expected: Color: R:99 G:99 B:99 A 51 (T:204) +// - Actual : Color: R:99 G:99 B:99 A: 255 (T: 0) +CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0xCC636363), nCharColor); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2); CPPUNIT_PLUGIN_IMPLEMENT();
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sc/qa sc/source
sc/qa/unit/data/xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx |binary sc/qa/unit/subsequent_export_test2.cxx | 15 + sc/source/filter/excel/xeroot.cxx|1 sc/source/filter/excel/xestyle.cxx | 16 ++ sc/source/filter/inc/xestyle.hxx |3 + 5 files changed, 35 insertions(+) New commits: commit 3e9e457f931502b9a64fd8b58b37ad1fe4c9ebbe Author: Attila Szűcs AuthorDate: Mon Dec 19 05:35:36 2022 +0100 Commit: Xisco Fauli CommitDate: Tue Dec 20 14:45:23 2022 + tdf#152581 SC: fix export of conditional border color Call XclExpDxf::mpBorder->SetFinalColors(..) during export, before SaveXml(). It will calculate the prepered colors from mnLeftColorId to mnLeftColor, so saveXml() will be able to save it. Change-Id: I1a1ed621c6d0e883cb9016e60ae0b344bf90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144576 Tested-by: Jenkins Reviewed-by: Andras Timar (cherry picked from commit b66e35c721742d2ad1c8c2cc3251661b6ce81952) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144600 Reviewed-by: Xisco Fauli diff --git a/sc/qa/unit/data/xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx b/sc/qa/unit/data/xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx new file mode 100644 index ..2423f4cc0243 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx differ diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 40fb4f360536..ce7ac0c43d2f 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -167,6 +167,7 @@ public: void testTdf144642_RowHeightRounding(); void testTdf145129_DefaultRowHeightRounding(); void testTdf151755_stylesLostOnXLSXExport(); +void testTdf152581_bordercolorNotExportedToXLSX(); void testTdf140431(); void testCheckboxFormControlXlsxExport(); void testButtonFormControlXlsxExport(); @@ -295,6 +296,7 @@ public: CPPUNIT_TEST(testTdf144642_RowHeightRounding); CPPUNIT_TEST(testTdf145129_DefaultRowHeightRounding); CPPUNIT_TEST(testTdf151755_stylesLostOnXLSXExport); +CPPUNIT_TEST(testTdf152581_bordercolorNotExportedToXLSX); CPPUNIT_TEST(testTdf140431); CPPUNIT_TEST(testCheckboxFormControlXlsxExport); CPPUNIT_TEST(testButtonFormControlXlsxExport); @@ -2290,6 +2292,19 @@ void ScExportTest2::testTdf151755_stylesLostOnXLSXExport() assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[4]", "s", aCellStyleId); } +void ScExportTest2::testTdf152581_bordercolorNotExportedToXLSX() +{ +createScDoc("xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx"); + +// Resave the xlsx file without any modification. +save("Calc Office Open XML"); +xmlDocUniquePtr pStyles = parseExport("xl/styles.xml"); +CPPUNIT_ASSERT(pStyles); + +// Check if conditional format border color is exported +assertXPath(pStyles, "/x:styleSheet/x:dxfs/x:dxf/x:border/x:left/x:color", "rgb", "FFED7D31"); +} + void ScExportTest2::testTdf140431() { createScDoc("xlsx/129969-min.xlsx"); diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index 38884c48415c..807a24aae60b 100644 --- a/sc/source/filter/excel/xeroot.cxx +++ b/sc/source/filter/excel/xeroot.cxx @@ -276,6 +276,7 @@ void XclExpRoot::InitializeSave() { GetPalette().Finalize(); GetXFBuffer().Finalize(); +GetDxfs().Finalize(); } XclExpRecordRef XclExpRoot::CreateRecord( sal_uInt16 nRecId ) const diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index cb1c3c8fe26a..3e335a50110c 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -3210,6 +3210,14 @@ void XclExpDxfs::SaveXml( XclExpXmlStream& rStrm ) rStyleSheet->endElement( XML_dxfs ); } +void XclExpDxfs::Finalize() +{ +for (auto& rxDxf : maDxf) +{ +rxDxf->SetFinalColors(); +} +} + XclExpDxf::XclExpDxf( const XclExpRoot& rRoot, std::unique_ptr pAlign, std::unique_ptr pBorder, std::unique_ptr pFont, std::unique_ptr pNumberFmt, std::unique_ptr pProt, std::unique_ptr pColor) @@ -3233,6 +3241,14 @@ XclExpDxf::~XclExpDxf() { } +void XclExpDxf::SetFinalColors() +{ +if (mpBorder) +{ +mpBorder->SetFinalColors(GetPalette()); +} +} + void XclExpDxf::SaveXml( XclExpXmlStream& rStrm ) { sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream(); diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx index 7857e215557b..8c3493d352f3 100644 --- a/sc/source/filter/inc/xestyle.hxx +++ b/sc/source/filter/inc/xestyle.hxx @@ -734,6 +734,7 @@ public: virtual void SaveXml( XclExpXmlStream& rStrm ) override; void SaveXmlExt( XclExpXmlStream&
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/qa sc/source
sc/qa/unit/data/xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx |binary sc/qa/unit/subsequent_export_test2.cxx | 16 ++ sc/source/filter/excel/xeroot.cxx|1 sc/source/filter/excel/xestyle.cxx | 16 ++ sc/source/filter/inc/xestyle.hxx |4 ++ 5 files changed, 37 insertions(+) New commits: commit 77449c9877bff4979e4d9ff0fe489f61e340c975 Author: Attila Szűcs AuthorDate: Mon Dec 19 03:48:13 2022 +0100 Commit: Andras Timar CommitDate: Tue Dec 20 12:57:24 2022 + tdf#152581 SC: fix export of conditional border color Call XclExpDxf::mpBorder->SetFinalColors(..) during export, before SaveXml(). It will calculate the prepered colors from mnLeftColorId to mnLeftColor, so saveXml() will be able to save it. Change-Id: I1a1ed621c6d0e883cb9016e60ae0b344bf90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144411 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sc/qa/unit/data/xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx b/sc/qa/unit/data/xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx new file mode 100644 index ..2423f4cc0243 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx differ diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index bcf262dd42e9..329210a6d9eb 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -205,6 +205,7 @@ public: void testTdf144642_RowHeightRounding(); void testTdf145129_DefaultRowHeightRounding(); void testTdf151755_stylesLostOnXLSXExport(); +void testTdf152581_bordercolorNotExportedToXLSX(); void testTdf140431(); void testCheckboxFormControlXlsxExport(); void testButtonFormControlXlsxExport(); @@ -324,6 +325,7 @@ public: CPPUNIT_TEST(testTdf144642_RowHeightRounding); CPPUNIT_TEST(testTdf145129_DefaultRowHeightRounding); CPPUNIT_TEST(testTdf151755_stylesLostOnXLSXExport); +CPPUNIT_TEST(testTdf152581_bordercolorNotExportedToXLSX); CPPUNIT_TEST(testTdf140431); CPPUNIT_TEST(testCheckboxFormControlXlsxExport); CPPUNIT_TEST(testButtonFormControlXlsxExport); @@ -2628,6 +2630,20 @@ void ScExportTest2::testTdf151755_stylesLostOnXLSXExport() pShell->DoClose(); } +void ScExportTest2::testTdf152581_bordercolorNotExportedToXLSX() +{ +ScDocShellRef pShell = loadDoc(u"tdf152581_bordercolorNotExportedToXLSX.", FORMAT_XLSX); + +// Resave the xlsx file without any modification. +std::shared_ptr pXPathFile = ScBootstrapFixture::exportTo(*pShell, FORMAT_XLSX); +xmlDocUniquePtr pStyles = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/styles.xml"); +CPPUNIT_ASSERT(pStyles); + +// Check if conditional format border color is exported +assertXPath(pStyles, "/x:styleSheet/x:dxfs/x:dxf/x:border/x:left/x:color", "rgb", "FFED7D31"); +pShell->DoClose(); +} + void ScExportTest2::testTdf140431() { ScDocShellRef xShell = loadDoc(u"129969-min.", FORMAT_XLSX); diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index b0ac71643674..ea6ad3098a29 100644 --- a/sc/source/filter/excel/xeroot.cxx +++ b/sc/source/filter/excel/xeroot.cxx @@ -277,6 +277,7 @@ void XclExpRoot::InitializeSave() { GetPalette().Finalize(); GetXFBuffer().Finalize(); +GetDxfs().Finalize(); } XclExpRecordRef XclExpRoot::CreateRecord( sal_uInt16 nRecId ) const diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 1dd6401a79eb..63386c63555c 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -3210,6 +3210,14 @@ void XclExpDxfs::SaveXml( XclExpXmlStream& rStrm ) rStyleSheet->endElement( XML_dxfs ); } +void XclExpDxfs::Finalize() +{ +for (auto& rxDxf : maDxf) +{ +rxDxf->SetFinalColors(); +} +} + XclExpDxf::XclExpDxf( const XclExpRoot& rRoot, std::unique_ptr pAlign, std::unique_ptr pBorder, std::unique_ptr pFont, std::unique_ptr pNumberFmt, std::unique_ptr pProt, std::unique_ptr pColor) @@ -3233,6 +3241,14 @@ XclExpDxf::~XclExpDxf() { } +void XclExpDxf::SetFinalColors() +{ +if (mpBorder) +{ +mpBorder->SetFinalColors(GetPalette()); +} +} + void XclExpDxf::SaveXml( XclExpXmlStream& rStrm ) { sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream(); diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx index 26ba9fcf8e39..84b03dc846a7 100644 --- a/sc/source/filter/inc/xestyle.hxx +++ b/sc/source/filter/inc/xestyle.hxx @@ -734,6 +734,8 @@ public: virtual void SaveXml( XclExpXmlStream& rStrm ) override; void SaveXmlExt( XclExpXmlStream& rStrm); +void SetFinalColors(); + private:
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/data/xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx |binary sc/qa/unit/subsequent_export_test2.cxx | 15 + sc/source/filter/excel/xeroot.cxx|1 sc/source/filter/excel/xestyle.cxx | 16 ++ sc/source/filter/inc/xestyle.hxx |3 + 5 files changed, 35 insertions(+) New commits: commit b66e35c721742d2ad1c8c2cc3251661b6ce81952 Author: Attila Szűcs AuthorDate: Mon Dec 19 05:35:36 2022 +0100 Commit: Andras Timar CommitDate: Tue Dec 20 12:57:14 2022 + tdf#152581 SC: fix export of conditional border color Call XclExpDxf::mpBorder->SetFinalColors(..) during export, before SaveXml(). It will calculate the prepered colors from mnLeftColorId to mnLeftColor, so saveXml() will be able to save it. Change-Id: I1a1ed621c6d0e883cb9016e60ae0b344bf90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144576 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/sc/qa/unit/data/xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx b/sc/qa/unit/data/xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx new file mode 100644 index ..2423f4cc0243 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx differ diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 9717f3579972..5a1ebc5c2d3c 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -167,6 +167,7 @@ public: void testTdf144642_RowHeightRounding(); void testTdf145129_DefaultRowHeightRounding(); void testTdf151755_stylesLostOnXLSXExport(); +void testTdf152581_bordercolorNotExportedToXLSX(); void testTdf140431(); void testCheckboxFormControlXlsxExport(); void testButtonFormControlXlsxExport(); @@ -295,6 +296,7 @@ public: CPPUNIT_TEST(testTdf144642_RowHeightRounding); CPPUNIT_TEST(testTdf145129_DefaultRowHeightRounding); CPPUNIT_TEST(testTdf151755_stylesLostOnXLSXExport); +CPPUNIT_TEST(testTdf152581_bordercolorNotExportedToXLSX); CPPUNIT_TEST(testTdf140431); CPPUNIT_TEST(testCheckboxFormControlXlsxExport); CPPUNIT_TEST(testButtonFormControlXlsxExport); @@ -2290,6 +2292,19 @@ void ScExportTest2::testTdf151755_stylesLostOnXLSXExport() assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[4]", "s", aCellStyleId); } +void ScExportTest2::testTdf152581_bordercolorNotExportedToXLSX() +{ +createScDoc("xlsx/tdf152581_bordercolorNotExportedToXLSX.xlsx"); + +// Resave the xlsx file without any modification. +save("Calc Office Open XML"); +xmlDocUniquePtr pStyles = parseExport("xl/styles.xml"); +CPPUNIT_ASSERT(pStyles); + +// Check if conditional format border color is exported +assertXPath(pStyles, "/x:styleSheet/x:dxfs/x:dxf/x:border/x:left/x:color", "rgb", "FFED7D31"); +} + void ScExportTest2::testTdf140431() { createScDoc("xlsx/129969-min.xlsx"); diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index 38884c48415c..807a24aae60b 100644 --- a/sc/source/filter/excel/xeroot.cxx +++ b/sc/source/filter/excel/xeroot.cxx @@ -276,6 +276,7 @@ void XclExpRoot::InitializeSave() { GetPalette().Finalize(); GetXFBuffer().Finalize(); +GetDxfs().Finalize(); } XclExpRecordRef XclExpRoot::CreateRecord( sal_uInt16 nRecId ) const diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index cb1c3c8fe26a..3e335a50110c 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -3210,6 +3210,14 @@ void XclExpDxfs::SaveXml( XclExpXmlStream& rStrm ) rStyleSheet->endElement( XML_dxfs ); } +void XclExpDxfs::Finalize() +{ +for (auto& rxDxf : maDxf) +{ +rxDxf->SetFinalColors(); +} +} + XclExpDxf::XclExpDxf( const XclExpRoot& rRoot, std::unique_ptr pAlign, std::unique_ptr pBorder, std::unique_ptr pFont, std::unique_ptr pNumberFmt, std::unique_ptr pProt, std::unique_ptr pColor) @@ -3233,6 +3241,14 @@ XclExpDxf::~XclExpDxf() { } +void XclExpDxf::SetFinalColors() +{ +if (mpBorder) +{ +mpBorder->SetFinalColors(GetPalette()); +} +} + void XclExpDxf::SaveXml( XclExpXmlStream& rStrm ) { sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream(); diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx index 7857e215557b..8c3493d352f3 100644 --- a/sc/source/filter/inc/xestyle.hxx +++ b/sc/source/filter/inc/xestyle.hxx @@ -734,6 +734,7 @@ public: virtual void SaveXml( XclExpXmlStream& rStrm ) override; void SaveXmlExt( XclExpXmlStream& rStrm); +void SetFinalColors(); private: std::unique_ptr mpAlign; @@ -755,6 +756,8 @@ public: void AddColor(Color aColor); virtual void SaveXml(
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sc/qa sc/source
sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx |binary sc/qa/unit/subsequent_export_test2.cxx | 22 + sc/source/filter/excel/xetable.cxx |8 ++-- 3 files changed, 27 insertions(+), 3 deletions(-) New commits: commit 8a6851964134915d29cfbcd409ac80dc7f257261 Author: Attila Szűcs AuthorDate: Tue Nov 29 09:45:36 2022 +0100 Commit: Xisco Fauli CommitDate: Mon Dec 19 15:12:28 2022 + tdf#151755 fix export of borders of contentless cells Change-Id: I650aeebb4d021911c1f14d4867c5beee84020155 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143880 Tested-by: Jenkins Reviewed-by: Andras Timar (cherry picked from commit c57d113e9ef8608f5690e8707a97879cb4f6a185) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144424 Reviewed-by: Xisco Fauli Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144459 diff --git a/sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx b/sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx new file mode 100644 index ..e48562022af8 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx differ diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 7e9282e6a53c..ce53077fc451 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -175,6 +175,7 @@ public: void testTdf142854_GridVisibilityImportXlsxInHeadlessMode(); void testTdf144642_RowHeightRounding(); void testTdf145129_DefaultRowHeightRounding(); +void testTdf151755_stylesLostOnXLSXExport(); void testTdf140431(); void testCheckboxFormControlXlsxExport(); void testButtonFormControlXlsxExport(); @@ -299,6 +300,7 @@ public: CPPUNIT_TEST(testTdf142854_GridVisibilityImportXlsxInHeadlessMode); CPPUNIT_TEST(testTdf144642_RowHeightRounding); CPPUNIT_TEST(testTdf145129_DefaultRowHeightRounding); +CPPUNIT_TEST(testTdf151755_stylesLostOnXLSXExport); CPPUNIT_TEST(testTdf140431); CPPUNIT_TEST(testCheckboxFormControlXlsxExport); CPPUNIT_TEST(testButtonFormControlXlsxExport); @@ -2542,6 +2544,26 @@ void ScExportTest2::testTdf145129_DefaultRowHeightRounding() xShell->DoClose(); } +void ScExportTest2::testTdf151755_stylesLostOnXLSXExport() +{ +// Check if empty cells with custom sytle are exported, even if +// there is other empty cells with default style, left of it. +ScDocShellRef xShell = loadDoc(u"tdf151755_stylesLostOnXLSXExport.", FORMAT_XLSX); + +// Resave the xlsx file without any modification. +std::shared_ptr pXPathFile = ScBootstrapFixture::exportTo(*xShell, FORMAT_XLSX); +xmlDocUniquePtr pSheet += XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml"); +CPPUNIT_ASSERT(pSheet); + +// Check if all the 3 empty cells with styles are saved, and have the same style id. +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c", 4); +OUString aCellStyleId = getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[2]", "s"); +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[2]", "s", aCellStyleId); +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[3]", "s", aCellStyleId); +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[4]", "s", aCellStyleId); +} + void ScExportTest2::testTdf140431() { ScDocShellRef xShell = loadDoc(u"129969-min.", FORMAT_XLSX); diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 83c7f5048d6a..728ea23397d2 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1310,12 +1310,14 @@ void XclExpMultiCellBase::RemoveUnusedXFIndexes( const ScfUInt16Vec& rXFIndexes, sal_uInt16 XclExpMultiCellBase::GetStartColAllDefaultCell() const { sal_uInt16 col = GetXclCol(); +sal_uInt16 nMaxNonDefCol = col; for( const auto& rXFId : maXFIds ) { -if( rXFId.mnXFIndex != EXC_XF_DEFAULTCELL ) -col += rXFId.mnCount; +col += rXFId.mnCount; +if (rXFId.mnXFIndex != EXC_XF_DEFAULTCELL) +nMaxNonDefCol = col; } -return col; +return nMaxNonDefCol; } XclExpBlankCell::XclExpBlankCell( const XclAddress& rXclPos, const XclExpMultiXFId& rXFId ) :
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sc/qa sc/source
sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx |binary sc/qa/unit/subsequent_export_test2.cxx | 21 + sc/source/filter/excel/xetable.cxx |8 +++- 3 files changed, 26 insertions(+), 3 deletions(-) New commits: commit c79bd967dc26259115bf2a5f36e60f34575fbd97 Author: Attila Szűcs AuthorDate: Tue Nov 29 09:45:36 2022 +0100 Commit: Xisco Fauli CommitDate: Mon Dec 19 09:30:49 2022 + tdf#151755 fix export of borders of contentless cells Change-Id: I650aeebb4d021911c1f14d4867c5beee84020155 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143880 Tested-by: Jenkins Reviewed-by: Andras Timar (cherry picked from commit c57d113e9ef8608f5690e8707a97879cb4f6a185) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144424 Reviewed-by: Xisco Fauli diff --git a/sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx b/sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx new file mode 100644 index ..e48562022af8 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx differ diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 4010cc9dce1f..40fb4f360536 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -166,6 +166,7 @@ public: void testTdf139258_rotated_image(); void testTdf144642_RowHeightRounding(); void testTdf145129_DefaultRowHeightRounding(); +void testTdf151755_stylesLostOnXLSXExport(); void testTdf140431(); void testCheckboxFormControlXlsxExport(); void testButtonFormControlXlsxExport(); @@ -293,6 +294,7 @@ public: CPPUNIT_TEST(testTdf139258_rotated_image); CPPUNIT_TEST(testTdf144642_RowHeightRounding); CPPUNIT_TEST(testTdf145129_DefaultRowHeightRounding); +CPPUNIT_TEST(testTdf151755_stylesLostOnXLSXExport); CPPUNIT_TEST(testTdf140431); CPPUNIT_TEST(testCheckboxFormControlXlsxExport); CPPUNIT_TEST(testButtonFormControlXlsxExport); @@ -2269,6 +2271,25 @@ void ScExportTest2::testTdf145129_DefaultRowHeightRounding() CPPUNIT_ASSERT_EQUAL(tools::Long(555 * 52), pDoc->GetRowHeight(0, 51, 0, true)); } +void ScExportTest2::testTdf151755_stylesLostOnXLSXExport() +{ +// Check if empty cells with custom sytle are exported, even if +// there is other empty cells with default style, left of it. +createScDoc("xlsx/tdf151755_stylesLostOnXLSXExport.xlsx"); + +// Resave the xlsx file without any modification. +save("Calc Office Open XML"); +xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml"); +CPPUNIT_ASSERT(pSheet); + +// Check if all the 3 empty cells with styles are saved, and have the same style id. +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c", 4); +OUString aCellStyleId = getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[2]", "s"); +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[2]", "s", aCellStyleId); +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[3]", "s", aCellStyleId); +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[4]", "s", aCellStyleId); +} + void ScExportTest2::testTdf140431() { createScDoc("xlsx/129969-min.xlsx"); diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 146f6a06833b..e7abb111c63e 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1310,12 +1310,14 @@ void XclExpMultiCellBase::RemoveUnusedXFIndexes( const ScfUInt16Vec& rXFIndexes, sal_uInt16 XclExpMultiCellBase::GetStartColAllDefaultCell() const { sal_uInt16 col = GetXclCol(); +sal_uInt16 nMaxNonDefCol = col; for( const auto& rXFId : maXFIds ) { -if( rXFId.mnXFIndex != EXC_XF_DEFAULTCELL ) -col += rXFId.mnCount; +col += rXFId.mnCount; +if (rXFId.mnXFIndex != EXC_XF_DEFAULTCELL) +nMaxNonDefCol = col; } -return col; +return nMaxNonDefCol; } XclExpBlankCell::XclExpBlankCell( const XclAddress& rXclPos, const XclExpMultiXFId& rXFId ) :
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx |binary sc/qa/unit/subsequent_export_test2.cxx | 21 + sc/source/filter/excel/xetable.cxx |8 +++- 3 files changed, 26 insertions(+), 3 deletions(-) New commits: commit c57d113e9ef8608f5690e8707a97879cb4f6a185 Author: Attila Szűcs AuthorDate: Tue Nov 29 09:45:36 2022 +0100 Commit: Andras Timar CommitDate: Mon Dec 19 06:16:08 2022 + tdf#151755 fix export of borders of contentless cells Change-Id: I650aeebb4d021911c1f14d4867c5beee84020155 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143880 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx b/sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx new file mode 100644 index ..e48562022af8 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx differ diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 4010cc9dce1f..40fb4f360536 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -166,6 +166,7 @@ public: void testTdf139258_rotated_image(); void testTdf144642_RowHeightRounding(); void testTdf145129_DefaultRowHeightRounding(); +void testTdf151755_stylesLostOnXLSXExport(); void testTdf140431(); void testCheckboxFormControlXlsxExport(); void testButtonFormControlXlsxExport(); @@ -293,6 +294,7 @@ public: CPPUNIT_TEST(testTdf139258_rotated_image); CPPUNIT_TEST(testTdf144642_RowHeightRounding); CPPUNIT_TEST(testTdf145129_DefaultRowHeightRounding); +CPPUNIT_TEST(testTdf151755_stylesLostOnXLSXExport); CPPUNIT_TEST(testTdf140431); CPPUNIT_TEST(testCheckboxFormControlXlsxExport); CPPUNIT_TEST(testButtonFormControlXlsxExport); @@ -2269,6 +2271,25 @@ void ScExportTest2::testTdf145129_DefaultRowHeightRounding() CPPUNIT_ASSERT_EQUAL(tools::Long(555 * 52), pDoc->GetRowHeight(0, 51, 0, true)); } +void ScExportTest2::testTdf151755_stylesLostOnXLSXExport() +{ +// Check if empty cells with custom sytle are exported, even if +// there is other empty cells with default style, left of it. +createScDoc("xlsx/tdf151755_stylesLostOnXLSXExport.xlsx"); + +// Resave the xlsx file without any modification. +save("Calc Office Open XML"); +xmlDocUniquePtr pSheet = parseExport("xl/worksheets/sheet1.xml"); +CPPUNIT_ASSERT(pSheet); + +// Check if all the 3 empty cells with styles are saved, and have the same style id. +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c", 4); +OUString aCellStyleId = getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[2]", "s"); +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[2]", "s", aCellStyleId); +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[3]", "s", aCellStyleId); +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[4]", "s", aCellStyleId); +} + void ScExportTest2::testTdf140431() { createScDoc("xlsx/129969-min.xlsx"); diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 146f6a06833b..e7abb111c63e 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1310,12 +1310,14 @@ void XclExpMultiCellBase::RemoveUnusedXFIndexes( const ScfUInt16Vec& rXFIndexes, sal_uInt16 XclExpMultiCellBase::GetStartColAllDefaultCell() const { sal_uInt16 col = GetXclCol(); +sal_uInt16 nMaxNonDefCol = col; for( const auto& rXFId : maXFIds ) { -if( rXFId.mnXFIndex != EXC_XF_DEFAULTCELL ) -col += rXFId.mnCount; +col += rXFId.mnCount; +if (rXFId.mnXFIndex != EXC_XF_DEFAULTCELL) +nMaxNonDefCol = col; } -return col; +return nMaxNonDefCol; } XclExpBlankCell::XclExpBlankCell( const XclAddress& rXclPos, const XclExpMultiXFId& rXFId ) :
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sc/qa sc/source
sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx |binary sc/qa/unit/subsequent_export_test2.cxx | 23 + sc/source/filter/excel/xetable.cxx |8 ++-- 3 files changed, 28 insertions(+), 3 deletions(-) New commits: commit 9934947c36bf1a1e548f667c72fba1891bbb2cff Author: Attila Szűcs AuthorDate: Tue Nov 29 09:45:36 2022 +0100 Commit: Andras Timar CommitDate: Tue Dec 13 15:51:35 2022 + tdf#151755 fix export of borders of contentless cells Change-Id: I650aeebb4d021911c1f14d4867c5beee84020155 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143431 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx b/sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx new file mode 100644 index ..e48562022af8 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf151755_stylesLostOnXLSXExport.xlsx differ diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index c958f40402ef..bcf262dd42e9 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -204,6 +204,7 @@ public: void testTdf142854_GridVisibilityImportXlsxInHeadlessMode(); void testTdf144642_RowHeightRounding(); void testTdf145129_DefaultRowHeightRounding(); +void testTdf151755_stylesLostOnXLSXExport(); void testTdf140431(); void testCheckboxFormControlXlsxExport(); void testButtonFormControlXlsxExport(); @@ -322,6 +323,7 @@ public: CPPUNIT_TEST(testTdf142854_GridVisibilityImportXlsxInHeadlessMode); CPPUNIT_TEST(testTdf144642_RowHeightRounding); CPPUNIT_TEST(testTdf145129_DefaultRowHeightRounding); +CPPUNIT_TEST(testTdf151755_stylesLostOnXLSXExport); CPPUNIT_TEST(testTdf140431); CPPUNIT_TEST(testCheckboxFormControlXlsxExport); CPPUNIT_TEST(testButtonFormControlXlsxExport); @@ -2605,6 +2607,27 @@ void ScExportTest2::testTdf145129_DefaultRowHeightRounding() xShell->DoClose(); } +void ScExportTest2::testTdf151755_stylesLostOnXLSXExport() +{ +// Check if empty cells with custom sytle are exported, even if +// there is other empty cells with default style, left of it. +ScDocShellRef pShell = loadDoc(u"tdf151755_stylesLostOnXLSXExport.", FORMAT_XLSX); + +// Resave the xlsx file without any modification. +std::shared_ptr pXPathFile = ScBootstrapFixture::exportTo(*pShell, FORMAT_XLSX); +xmlDocUniquePtr pSheet += XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml"); +CPPUNIT_ASSERT(pSheet); + +// Check if all the 3 empty cells with styles are saved, and have the same style id. +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c", 4); +OUString aCellStyleId = getXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[2]", "s"); +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[2]", "s", aCellStyleId); +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[3]", "s", aCellStyleId); +assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]/x:c[4]", "s", aCellStyleId); +pShell->DoClose(); +} + void ScExportTest2::testTdf140431() { ScDocShellRef xShell = loadDoc(u"129969-min.", FORMAT_XLSX); diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index dcbcba7251bb..804c09bd447f 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1310,12 +1310,14 @@ void XclExpMultiCellBase::RemoveUnusedXFIndexes( const ScfUInt16Vec& rXFIndexes, sal_uInt16 XclExpMultiCellBase::GetStartColAllDefaultCell() const { sal_uInt16 col = GetXclCol(); +sal_uInt16 nMaxNonDefCol = col; for( const auto& rXFId : maXFIds ) { -if( rXFId.mnXFIndex != EXC_XF_DEFAULTCELL ) -col += rXFId.mnCount; +col += rXFId.mnCount; +if (rXFId.mnXFIndex != EXC_XF_DEFAULTCELL) +nMaxNonDefCol = col; } -return col; +return nMaxNonDefCol; } XclExpBlankCell::XclExpBlankCell( const XclAddress& rXclPos, const XclExpMultiXFId& rXFId ) :
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/core/text/data/tdf43100_tdf120715_cursorOnSpacesOverMargin.docx |binary sw/qa/core/text/text.cxx | 68 ++ sw/source/core/text/guess.cxx | 10 + sw/source/core/text/guess.hxx |4 sw/source/core/text/itrcrsr.cxx | 48 +++ sw/source/core/text/itrpaint.cxx |1 sw/source/core/text/itrtxt.hxx|1 sw/source/core/text/porlin.hxx|7 - sw/source/core/text/portxt.cxx| 20 ++ sw/source/core/text/portxt.hxx|1 10 files changed, 132 insertions(+), 28 deletions(-) New commits: commit 690d4eb71509649ad147cfe60f5b97e2cfaaa519 Author: Attila Szűcs AuthorDate: Wed Jun 15 09:16:32 2022 +0200 Commit: László Németh CommitDate: Mon Jul 4 15:34:57 2022 +0200 tdf#43100 tdf#104683 tdf#120715 sw: cursor on spaces over margin Allow cursor movement on spaces over margin (or clicking it it to position the cursor), like MSO does instead of stopping cursor before the stripped (from the typesetting) spaces. This way it's possible to follow the modification of these characters, e.g. removing spaces or inserting other characters at the cursor position. Follow-up to commit 8741fd0e0ae9e346de2e09887f0668b831c9b48b "tdf#43244 sw: show stripped line-end spaces on margin". Details: extend SwHolePortion to calculate its width, that can be used for cursor movement, even over the right margin. Removed some code that not allowed cursor to be positioned over the right margin. Layout calculation uses m_nWidth variable (that was 0) to make frames. To keep the layout unchanged, this new width calculated into m_nExtraBlankWidth temporarily, and this extra width is added to m_nWidth only after the layout calculation is finished. (Ideally this 2 width values could be stored and used separately, but that would require a bigger refactor of the cursor calculation.) Known regression: lost selection at Search & Replace, e.g. searching double spaces: there was a narrow selection at end of the line showing the position. Other issues: when a different character inserted on the margin resulting new line break, space formatting marks aren't updated according to the less spaces. Removing the inserted character by Backspace results losing of the cursor movement on the spaces. Co-authored-by: Tibor Nagy (NISZ) Change-Id: I342b3ac68bef508389f1e227e52a03a22919301e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136613 Reviewed-by: László Németh Tested-by: László Németh diff --git a/sw/qa/core/text/data/tdf43100_tdf120715_cursorOnSpacesOverMargin.docx b/sw/qa/core/text/data/tdf43100_tdf120715_cursorOnSpacesOverMargin.docx new file mode 100644 index ..474d805d893e Binary files /dev/null and b/sw/qa/core/text/data/tdf43100_tdf120715_cursorOnSpacesOverMargin.docx differ diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index 2db4d6dab348..99d80f649fef 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -470,6 +470,74 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRedlineDelete) pDoc->getIDocumentRedlineAccess().GetRedlineTable().size()); } +CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf120715_CursorMoveWhenTypingSpaceAtCenteredLineEnd) +{ +SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf43100_tdf120715_cursorOnSpacesOverMargin.docx"); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + +// Make a paint to force the call of AddExtraBlankWidth, that calculate width for holePortions. +pDoc->GetDocShell()->GetPreviewBitmap(); + +// Move the cursor to the last character of the document. +pWrtShell->EndOfSection(); + +//Press space and check if the cursor move right with the additional space. +sal_Int32 nOldCursorPos = pWrtShell->GetCharRect().Left(); +pWrtShell->Insert(" "); +sal_Int32 nNewCursorPos = pWrtShell->GetCharRect().Left(); +CPPUNIT_ASSERT_GREATER(nOldCursorPos, nNewCursorPos); +} + +CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf43100_CursorMoveToSpacesOverMargin) +{ +// Test the cursor movement over the right margin in several different paragraphs. +// These differences are based on its paragraphs +// - alignment (left, center, right, justified), +// - line count (1 line, 2 lines, blank line containing only spaces) +SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf43100_tdf120715_cursorOnSpacesOverMargin.docx"); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + +// Make a paint to force the call of AddExtraBlankWidth, that
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/core/text/data/tdf43100_tdf120715_cursorOnSpacesOverMargin.docx |binary sw/qa/core/text/text.cxx | 68 ++ sw/source/core/text/guess.cxx | 10 + sw/source/core/text/guess.hxx |4 sw/source/core/text/itrcrsr.cxx | 46 +++--- sw/source/core/text/itrpaint.cxx |1 sw/source/core/text/itrtxt.hxx|1 sw/source/core/text/porlin.hxx|7 - sw/source/core/text/portxt.cxx| 20 ++ sw/source/core/text/portxt.hxx|1 10 files changed, 131 insertions(+), 27 deletions(-) New commits: commit 7ef9c3ef30023cc40068e1f735aa4bec4811288b Author: Attila Szűcs AuthorDate: Wed Jun 15 09:16:32 2022 +0200 Commit: László Németh CommitDate: Fri Jun 24 14:14:58 2022 +0200 tdf#43100 tdf#104683 tdf#120715 sw: cursor on spaces over margin Allow cursor movement on spaces over margin (or clicking it it to position the cursor), like MSO does instead of stopping cursor before the stripped (from the typesetting) spaces. This way it's possible to follow the modification of these characters, e.g. removing spaces or inserting other characters at the cursor position. Follow-up to commit 8741fd0e0ae9e346de2e09887f0668b831c9b48b "tdf#43244 sw: show stripped line-end spaces on margin". Details: extend SwHolePortion to calculate its width, that can be used for cursor movement, even over the right margin. Removed some code that not allowed cursor to be positioned over the right margin. Layout calculation uses m_nWidth variable (that was 0) to make frames. To keep the layout unchanged, this new width calculated into m_nExtraBlankWidth temporarily, and this extra width is added to m_nWidth only after the layout calculation is finished. (Ideally this 2 width values could be stored and used separately, but that would require a bigger refactor of the cursor calculation.) Known regression: lost selection at Search & Replace, e.g. searching double spaces: there was a narrow selection at end of the line showing the position. Other issues: when a different character inserted on the margin resulting new line break, space formatting marks aren't updated according to the less spaces. Removing the inserted character by Backspace results losing of the cursor movement on the spaces. Co-authored-by: Tibor Nagy (NISZ) Change-Id: I94b4ed40b8c560e1ef32f4d0d3537e070c08666f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135895 Reviewed-by: László Németh Tested-by: László Németh diff --git a/sw/qa/core/text/data/tdf43100_tdf120715_cursorOnSpacesOverMargin.docx b/sw/qa/core/text/data/tdf43100_tdf120715_cursorOnSpacesOverMargin.docx new file mode 100644 index ..474d805d893e Binary files /dev/null and b/sw/qa/core/text/data/tdf43100_tdf120715_cursorOnSpacesOverMargin.docx differ diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index 2db4d6dab348..99d80f649fef 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -470,6 +470,74 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRedlineDelete) pDoc->getIDocumentRedlineAccess().GetRedlineTable().size()); } +CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf120715_CursorMoveWhenTypingSpaceAtCenteredLineEnd) +{ +SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf43100_tdf120715_cursorOnSpacesOverMargin.docx"); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + +// Make a paint to force the call of AddExtraBlankWidth, that calculate width for holePortions. +pDoc->GetDocShell()->GetPreviewBitmap(); + +// Move the cursor to the last character of the document. +pWrtShell->EndOfSection(); + +//Press space and check if the cursor move right with the additional space. +sal_Int32 nOldCursorPos = pWrtShell->GetCharRect().Left(); +pWrtShell->Insert(" "); +sal_Int32 nNewCursorPos = pWrtShell->GetCharRect().Left(); +CPPUNIT_ASSERT_GREATER(nOldCursorPos, nNewCursorPos); +} + +CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf43100_CursorMoveToSpacesOverMargin) +{ +// Test the cursor movement over the right margin in several different paragraphs. +// These differences are based on its paragraphs +// - alignment (left, center, right, justified), +// - line count (1 line, 2 lines, blank line containing only spaces) +SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf43100_tdf120715_cursorOnSpacesOverMargin.docx"); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + +// Make a paint to force the call of AddExtraBlankWidth, that
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sc/source
sc/source/ui/view/viewdata.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit cb232588e15e9b80cbba1ce698a962eb02e15e5e Author: Attila Szűcs AuthorDate: Tue Jun 21 15:27:35 2022 +0200 Commit: Xisco Fauli CommitDate: Fri Jun 24 13:48:41 2022 +0200 tdf#149574 sc: fix missing nullptr check Regression from commit 605b4ba57b2daa447af9d43d3759079e15df8148 "tdf#43958 sc: fix fill by selecting merged cell". Check if GetPattern(actual cell) is not nullptr, before using it. This is not the real problem of Bug 149574, but it is a problem anyway, and it fixes this bug. The real problem is the wrong ViewData::nTabNo, that point to an already deleted table, (fixed in 954d119db932434dc976ef739c643be0d9c7023c "tdf#149502 sc: crash fix: Change in Table destruction"). Co-authored-by: Tibor Nagy (NISZ) Change-Id: I26fc629ccf354c9e0c2662d61254d01be91d08f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136230 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit c4c827e1d370dcc351c4dddc601b3c37fc71564b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136322 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 88d57f106a3b..69ebe09d22d4 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1155,7 +1155,7 @@ ScMarkType ScViewData::GetSimpleArea( ScRange & rRange, ScMarkData & rNewMark ) if (eMarkType == SC_MARK_NONE) eMarkType = SC_MARK_SIMPLE; const ScPatternAttr* pMarkPattern = mrDoc.GetPattern(GetCurX(), GetCurY(), GetTabNo()); -if (pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, false) == SfxItemState::SET) +if (pMarkPattern && pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, false) == SfxItemState::SET) { SCROW nRow = pMarkPattern->GetItem(ATTR_MERGE).GetRowMerge(); SCCOL nCol = pMarkPattern->GetItem(ATTR_MERGE).GetColMerge();
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 38 commits - basctl/source chart2/source drawinglayer/source emfio/qa external/breakpad external/liborcus external/pdfium external/
basctl/source/basicide/iderdll.cxx| 1 basctl/source/basicide/macrodlg.cxx | 7 chart2/source/controller/dialogs/dlg_DataEditor.cxx | 4 drawinglayer/source/tools/emfpbrush.cxx | 12 drawinglayer/source/tools/emfphelperdata.cxx | 55 drawinglayer/source/tools/primitive2dxmldump.cxx | 42 emfio/qa/cppunit/emf/EmfImportTest.cxx| 24 emfio/qa/cppunit/emf/data/TestEmfPlusBrushPathGradientWithBlendColors.emf |binary external/breakpad/UnpackedTarball_breakpad.mk | 1 external/breakpad/include.patch | 10 external/liborcus/UnpackedTarball_liborcus.mk | 1 external/liborcus/include.patch.0 | 20 external/pdfium/UnpackedTarball_pdfium.mk | 2 external/pdfium/include.patch | 11 external/zxing/UnpackedTarball_zxing.mk | 1 external/zxing/include.patch.0| 10 formula/source/core/api/token.cxx | 8 framework/source/dispatch/closedispatcher.cxx | 13 icon-themes/breeze/cmd/32/numberformatstandard.png |binary icon-themes/breeze/cmd/lc_numberformatstandard.png |binary icon-themes/breeze/cmd/sc_numberformatstandard.png |binary icon-themes/breeze_dark/cmd/32/numberformatstandard.png |binary icon-themes/breeze_dark/cmd/lc_numberformatstandard.png |binary icon-themes/breeze_dark/cmd/sc_numberformatstandard.png |binary icon-themes/breeze_dark_svg/cmd/32/numberformatstandard.svg | 2 icon-themes/breeze_dark_svg/cmd/lc_numberformatstandard.svg | 2 icon-themes/breeze_dark_svg/cmd/sc_numberformatstandard.svg | 2 icon-themes/breeze_svg/cmd/32/numberformatstandard.svg| 2 icon-themes/breeze_svg/cmd/lc_numberformatstandard.svg| 2 icon-themes/breeze_svg/cmd/sc_numberformatstandard.svg| 2 icon-themes/elementary/cmd/32/objecttitledescription.png |binary icon-themes/elementary/cmd/lc_objecttitledescription.png |binary icon-themes/elementary/cmd/sc_objecttitledescription.png |binary icon-themes/elementary/links.txt | 4 icon-themes/elementary/vcl/res/fatcross.png |binary icon-themes/elementary_svg/cmd/32/objecttitledescription.svg | 1 icon-themes/elementary_svg/cmd/lc_objecttitledescription.svg | 1 icon-themes/elementary_svg/cmd/sc_objecttitledescription.svg | 8 icon-themes/elementary_svg/vcl/res/fatcross.svg | 1 icon-themes/karasa_jaga/cmd/32/objecttitledescription.png |binary icon-themes/karasa_jaga/cmd/lc_objecttitledescription.png |binary icon-themes/karasa_jaga/cmd/sc_objecttitledescription.png |binary icon-themes/karasa_jaga/links.txt | 3 icon-themes/karasa_jaga_svg/cmd/32/objecttitledescription.svg | 1 icon-themes/karasa_jaga_svg/cmd/lc_objecttitledescription.svg | 1 icon-themes/karasa_jaga_svg/cmd/sc_objecttitledescription.svg | 1 icon-themes/sifr/cmd/32/objecttitledescription.png |binary icon-themes/sifr/cmd/lc_objecttitledescription.png |binary icon-themes/sifr/cmd/sc_objecttitledescription.png |binary icon-themes/sifr/links.txt| 5 icon-themes/sifr/vcl/res/fatcross.png |binary icon-themes/sifr_dark/cmd/32/objecttitledescription.png |binary icon-themes/sifr_dark/cmd/lc_objecttitledescription.png |binary icon-themes/sifr_dark/cmd/sc_objecttitledescription.png |binary icon-themes/sifr_dark/links.txt | 5 icon-themes/sifr_dark/vcl/res/fatcross.png |binary icon-themes/sifr_dark_svg/cmd/32/objecttitledescription.svg | 1 icon-themes/sifr_dark_svg/cmd/lc_objecttitledescription.svg | 1 icon-themes/sifr_dark_svg/cmd/sc_objecttitledescription.svg | 1
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sc/qa sc/source
sc/qa/unit/uicalc/data/tdf149502_HangOnDeletingSheet1.ods |binary sc/qa/unit/uicalc/uicalc.cxx | 17 ++ sc/source/core/data/document.cxx |7 + 3 files changed, 24 insertions(+) New commits: commit e0e59aae287268cb633df340e565647ec8c14cb2 Author: Attila Szűcs AuthorDate: Wed Jun 22 14:43:04 2022 +0200 Commit: Xisco Fauli CommitDate: Fri Jun 24 11:34:46 2022 +0200 tdf#149502 sc: crash fix: Change in Table destruction Postpone ScTable destruction a bit, when ScTable::nTab is synchronized with ScDocument::maTabs[] to avoid crashing. Before the fix random crashing occurred if the ScTable::nTab was already updated when ~ScTable() called, but the ScDocument::maTabs[] was not reordered yet, so nTab could have pointed to the actually deleted table in mTabs[]. Co-authored-by: Tibor Nagy (NISZ) Change-Id: I2ac1450e3483ab334b4e20ac2598c2191e0135c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136284 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit c84c43320cc66152b00c0c0dad8b65de8a4b9015) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136320 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/qa/unit/uicalc/data/tdf149502_HangOnDeletingSheet1.ods b/sc/qa/unit/uicalc/data/tdf149502_HangOnDeletingSheet1.ods new file mode 100644 index ..e34a75c32308 Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf149502_HangOnDeletingSheet1.ods differ diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index a6f648ce9766..2e48f42f2e73 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -1512,6 +1512,23 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf86166) CPPUNIT_ASSERT_EQUAL(static_cast(1), pDoc->GetTableCount()); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf149502_HangOnDeletingSheet1) +{ +ScModelObj* pModelObj = createDoc("tdf149502_HangOnDeletingSheet1.ods"); +ScDocument* pDoc = pModelObj->GetDocument(); +CPPUNIT_ASSERT(pDoc); + +CPPUNIT_ASSERT_EQUAL(static_cast(4), pDoc->GetTableCount()); + +uno::Sequence aArgs( +comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(0)) } })); + +// Before the fix in place, this test frozen here +dispatchCommand(mxComponent, ".uno:Remove", aArgs); + +CPPUNIT_ASSERT_EQUAL(static_cast(3), pDoc->GetTableCount()); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf149503) { ScModelObj* pModelObj = createDoc("tdf149503.xls"); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index a458f4d765e6..beb3e049d94c 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -727,7 +727,14 @@ bool ScDocument::DeleteTab( SCTAB nTab ) if (pTab) pTab->UpdateDeleteTab(aCxt); +// tdf#149502 make sure ScTable destructor called after the erase is finished, when +// maTabs[x].nTab==x is true again, as it should be always true. +// In the end of maTabs.erase, maTabs indexes change, but nTab updated before erase. +// ~ScTable expect that maTabs[x].nTab==x so it shouldn't be called during erase. +ScTableUniquePtr pErasedTab = std::move(maTabs[nTab]); maTabs.erase(maTabs.begin() + nTab); +delete pErasedTab.release(); + // UpdateBroadcastAreas must be called between UpdateDeleteTab, // which ends listening, and StartAllListeners, to not modify // areas that are to be inserted by starting listeners.
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sc/source
sc/source/ui/view/viewdata.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit dc8d912884f4893f2a3f553ecfe732a234d04e0d Author: Attila Szűcs AuthorDate: Tue Jun 21 15:27:35 2022 +0200 Commit: Xisco Fauli CommitDate: Fri Jun 24 11:33:13 2022 +0200 tdf#149574 sc: fix missing nullptr check Regression from commit 605b4ba57b2daa447af9d43d3759079e15df8148 "tdf#43958 sc: fix fill by selecting merged cell". Check if GetPattern(actual cell) is not nullptr, before using it. This is not the real problem of Bug 149574, but it is a problem anyway, and it fixes this bug. The real problem is the wrong ViewData::nTabNo, that point to an already deleted table, (fixed in 954d119db932434dc976ef739c643be0d9c7023c "tdf#149502 sc: crash fix: Change in Table destruction"). Co-authored-by: Tibor Nagy (NISZ) Change-Id: I26fc629ccf354c9e0c2662d61254d01be91d08f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136230 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit c4c827e1d370dcc351c4dddc601b3c37fc71564b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136323 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 6ac95430a84e..5cee19f21eb7 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1153,7 +1153,7 @@ ScMarkType ScViewData::GetSimpleArea( ScRange & rRange, ScMarkData & rNewMark ) if (eMarkType == SC_MARK_NONE) eMarkType = SC_MARK_SIMPLE; const ScPatternAttr* pMarkPattern = mrDoc.GetPattern(GetCurX(), GetCurY(), GetTabNo()); -if (pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, false) == SfxItemState::SET) +if (pMarkPattern && pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, false) == SfxItemState::SET) { SCROW nRow = pMarkPattern->GetItem(ATTR_MERGE).GetRowMerge(); SCCOL nCol = pMarkPattern->GetItem(ATTR_MERGE).GetColMerge();
[Libreoffice-commits] core.git: sc/source
sc/source/ui/view/viewdata.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 12fd3f7ba73d2fd03b88513160545fab8edc8a20 Author: Attila Szűcs AuthorDate: Tue Jun 21 15:27:35 2022 +0200 Commit: László Németh CommitDate: Thu Jun 23 15:43:00 2022 +0200 tdf#149574 sc: fix missing nullptr check Regression from commit 605b4ba57b2daa447af9d43d3759079e15df8148 "tdf#43958 sc: fix fill by selecting merged cell". Check if GetPattern(actual cell) is not nullptr, before using it. This is not the real problem of Bug 149574, but it is a problem anyway, and it fixes this bug. The real problem is the wrong ViewData::nTabNo, that point to an already deleted table, (fixed in 954d119db932434dc976ef739c643be0d9c7023c "tdf#149502 sc: crash fix: Change in Table destruction"). Co-authored-by: Tibor Nagy (NISZ) Change-Id: I26fc629ccf354c9e0c2662d61254d01be91d08f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136230 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 88d57f106a3b..69ebe09d22d4 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1155,7 +1155,7 @@ ScMarkType ScViewData::GetSimpleArea( ScRange & rRange, ScMarkData & rNewMark ) if (eMarkType == SC_MARK_NONE) eMarkType = SC_MARK_SIMPLE; const ScPatternAttr* pMarkPattern = mrDoc.GetPattern(GetCurX(), GetCurY(), GetTabNo()); -if (pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, false) == SfxItemState::SET) +if (pMarkPattern && pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, false) == SfxItemState::SET) { SCROW nRow = pMarkPattern->GetItem(ATTR_MERGE).GetRowMerge(); SCCOL nCol = pMarkPattern->GetItem(ATTR_MERGE).GetColMerge();
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/uicalc/data/tdf149502_HangOnDeletingSheet1.ods |binary sc/qa/unit/uicalc/uicalc.cxx | 17 ++ sc/source/core/data/document.cxx |7 + 3 files changed, 24 insertions(+) New commits: commit 954d119db932434dc976ef739c643be0d9c7023c Author: Attila Szűcs AuthorDate: Wed Jun 22 14:43:04 2022 +0200 Commit: László Németh CommitDate: Thu Jun 23 15:34:02 2022 +0200 tdf#149502 sc: crash fix: Change in Table destruction Postpone ScTable destruction a bit, when ScTable::nTab is synchronized with ScDocument::maTabs[] to avoid crashing. Before the fix random crashing occurred if the ScTable::nTab was already updated when ~ScTable() called, but the ScDocument::maTabs[] was not reordered yet, so nTab could have pointed to the actually deleted table in mTabs[]. Co-authored-by: Tibor Nagy (NISZ) Change-Id: I2ac1450e3483ab334b4e20ac2598c2191e0135c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136284 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sc/qa/unit/uicalc/data/tdf149502_HangOnDeletingSheet1.ods b/sc/qa/unit/uicalc/data/tdf149502_HangOnDeletingSheet1.ods new file mode 100644 index ..e34a75c32308 Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf149502_HangOnDeletingSheet1.ods differ diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index a6f648ce9766..2e48f42f2e73 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -1512,6 +1512,23 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf86166) CPPUNIT_ASSERT_EQUAL(static_cast(1), pDoc->GetTableCount()); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf149502_HangOnDeletingSheet1) +{ +ScModelObj* pModelObj = createDoc("tdf149502_HangOnDeletingSheet1.ods"); +ScDocument* pDoc = pModelObj->GetDocument(); +CPPUNIT_ASSERT(pDoc); + +CPPUNIT_ASSERT_EQUAL(static_cast(4), pDoc->GetTableCount()); + +uno::Sequence aArgs( +comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(0)) } })); + +// Before the fix in place, this test frozen here +dispatchCommand(mxComponent, ".uno:Remove", aArgs); + +CPPUNIT_ASSERT_EQUAL(static_cast(3), pDoc->GetTableCount()); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf149503) { ScModelObj* pModelObj = createDoc("tdf149503.xls"); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 15f44a1ef4d5..db6500e5b390 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -727,7 +727,14 @@ bool ScDocument::DeleteTab( SCTAB nTab ) if (pTab) pTab->UpdateDeleteTab(aCxt); +// tdf#149502 make sure ScTable destructor called after the erase is finished, when +// maTabs[x].nTab==x is true again, as it should be always true. +// In the end of maTabs.erase, maTabs indexes change, but nTab updated before erase. +// ~ScTable expect that maTabs[x].nTab==x so it shouldn't be called during erase. +ScTableUniquePtr pErasedTab = std::move(maTabs[nTab]); maTabs.erase(maTabs.begin() + nTab); +delete pErasedTab.release(); + // UpdateBroadcastAreas must be called between UpdateDeleteTab, // which ends listening, and StartAllListeners, to not modify // areas that are to be inserted by starting listeners.
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/tiledrendering/data/tdf43244_SpacesOnMargin.odt |binary sw/qa/extras/tiledrendering/tiledrendering.cxx | 46 +++ sw/source/core/text/portxt.cxx | 15 +++ 3 files changed, 59 insertions(+), 2 deletions(-) New commits: commit 8741fd0e0ae9e346de2e09887f0668b831c9b48b Author: Attila Szűcs AuthorDate: Fri May 27 13:12:27 2022 +0200 Commit: László Németh CommitDate: Tue Jun 7 19:28:48 2022 +0200 tdf#43244 sw: show stripped line-end spaces on margin in View->Formatting Marks mode instead of hiding them This way it's possible to avoid interoperability issues better, when these (now visible) spaces are stripped only in Writer, but not in MSO, resulting different layout, i.e. bad paragraph alignment, because the users can notice the extra spaces and remove them in Writer. Extend SwHolePortion::Paint() to paint its text, what is probably just a bunch of spaces. It's an initial fix for tdf#43100, tdf#120715 and tdf#104683 (cursor movement on the hidden spaces, end of paragraph sign before the hidden spaces, unable to select spaces after the margin). Follow-up to commit 93d7bdcb855362b88cdcfcb18ea401d89da973fb "fdo#33167, i#20878: Show spaces at the end of line". Co-authored-by: Tibor Nagy (NISZ) Change-Id: I48df3b41af37c77fd594bb6776ca30e845c51490 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135104 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/qa/extras/tiledrendering/data/tdf43244_SpacesOnMargin.odt b/sw/qa/extras/tiledrendering/data/tdf43244_SpacesOnMargin.odt new file mode 100644 index ..76c293dc0bd5 Binary files /dev/null and b/sw/qa/extras/tiledrendering/data/tdf43244_SpacesOnMargin.odt differ diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index 42f7f9e21889..7354782563c4 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -2809,6 +2809,52 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testPilcrowRedlining) comphelper::dispatchCommand(".uno:ControlCodes", {}); } +CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testTdf43244_SpacesOnMargin) +{ +// Load a document where the top left tile contains +// paragraph and line break symbols with redlining. +SwXTextDocument* pXTextDocument = createDoc("tdf43244_SpacesOnMargin.odt"); + +// show non printing characters, including pilcrow and +// line break symbols with redlining +comphelper::dispatchCommand(".uno:ControlCodes", {}); + +// Render a larger area, and then get the colors from the right side of the page. +size_t nCanvasWidth = 1024; +size_t nCanvasHeight = 512; +size_t nTileSize = 64; +std::vector aPixmap(nCanvasWidth * nCanvasHeight * 4, 0); +ScopedVclPtrInstance pDevice(DeviceFormat::DEFAULT); +pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); +pDevice->SetOutputSizePixelScaleOffsetAndBuffer(Size(nCanvasWidth, nCanvasHeight), +Fraction(1.0), Point(), aPixmap.data()); +pXTextDocument->paintTile(*pDevice, nCanvasWidth, nCanvasHeight, /*nTilePosX=*/0, +/*nTilePosY=*/0, /*nTileWidth=*/15360, /*nTileHeight=*/7680); +pDevice->EnableMapMode(false); +Bitmap aBitmap = pDevice->GetBitmap(Point(730, 120), Size(nTileSize, nTileSize)); +Bitmap::ScopedReadAccess pAccess(aBitmap); + +//Test if we see any spaces on the right margin in a 47x48 rectangle +bool bSpaceFound = false; +for (int i = 1; i < 48 && !bSpaceFound; i++) +{ +for (int j = 0; j < i; j++) +{ +Color aColor2(pAccess->GetPixel(j, i)); +Color aColor1(pAccess->GetPixel(i, j + 1)); + +if (aColor1.GetRed() < 255 || aColor2.GetRed() < 255) +{ +bSpaceFound = true; +break; +} +} +} +CPPUNIT_ASSERT(bSpaceFound); + +comphelper::dispatchCommand(".uno:ControlCodes", {}); +} + CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testClipText) { // Load a document where the top left tile contains table text with diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 140e29c168cc..a5ae0ea7e287 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -760,8 +760,10 @@ void SwHolePortion::Paint( const SwTextPaintInfo ) const if( !rInf.GetOut() ) return; +bool bPDFExport = rInf.GetVsh()->GetViewOptions()->IsPDFExport(); + // #i16816# export stuff only needed for tagged pdf support -if (!SwTaggedPDFHelper::IsExportTaggedPDF( *rInf.GetOut()) ) +if (bPDFExport && !SwTaggedPDFHelper::IsExportTaggedPDF( *rInf.GetOut()) ) return; // #i68503# the hole must have no decoration for a consistent visual appearance @@ -779,7 +781,16 @@ void
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3-1' - sw/qa sw/source
sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt |binary sw/qa/extras/layout/layout.cxx |9 + sw/source/core/layout/findfrm.cxx |3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) New commits: commit 76ff5c9dc5a4525067da3de485ac9d0924ab6172 Author: Attila Szűcs AuthorDate: Mon Feb 14 08:43:08 2022 +0100 Commit: Christian Lohmaier CommitDate: Wed Feb 23 12:49:37 2022 +0100 tdf#146704 sw: fix regression of endnote layout in sections Endnotes collected at the end of sections moved to a new page. Regression from commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88 "tdf#139336 sw: fix extra pages of multicolumn sections with footnotes". Co-authored-by: Tibor Nagy (NISZ) Change-Id: I36568e33b04ba8024ceef6b3ea84b71fb375e2a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129896 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 9a457c24ab2731c99f1a5fa1d28f68788e6977f3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129936 Tested-by: Jenkins (cherry picked from commit dbfa2662a6d9a9b53f95198313374f5529978836) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129941 Reviewed-by: Michael Stahl Reviewed-by: Xisco Fauli Reviewed-by: Christian Lohmaier Tested-by: Christian Lohmaier diff --git a/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt b/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt new file mode 100644 index ..660dcb70df0b Binary files /dev/null and b/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 3ef61970f5ae..85a685ff2b44 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3719,6 +3719,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf135035) CPPUNIT_ASSERT_GREATER(nParentWidth, nFly3Width); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf146704_EndnoteInSection) +{ +SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf146704_EndnoteInSection.odt"); +CPPUNIT_ASSERT(pDoc); +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); +// Without the fix, the endnote placed to 2. page +assertXPath(pXmlDoc, "/root/page", 1); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage) { SwDoc* pDoc diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 445d3e29dcd6..d100e24526a4 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -458,8 +458,9 @@ SwFootnoteBossFrame* SwFrame::FindFootnoteBossFrame( bool bFootnotes ) // similar case can be reached with a page break + FootnoteAtEnd setting SwSectionFrame* pSectframe = pRet->FindSctFrame(); bool bMoveToPageFrame = false; +// tdf146704: only if it is really a footnote, not an endnote. // tdf54465: compatibility flag to make old odt files keep these full page sections. -if (pSectframe +if (bFootnotes && pSectframe && pSectframe->GetFormat()->getIDocumentSettingAccess().get( DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND)) {
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa sw/source
sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt |binary sw/qa/extras/layout/layout.cxx |9 + sw/source/core/layout/findfrm.cxx |3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) New commits: commit dbfa2662a6d9a9b53f95198313374f5529978836 Author: Attila Szűcs AuthorDate: Mon Feb 14 08:43:08 2022 +0100 Commit: László Németh CommitDate: Tue Feb 15 20:49:35 2022 +0100 tdf#146704 sw: fix regression of endnote layout in sections Endnotes collected at the end of sections moved to a new page. Regression from commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88 "tdf#139336 sw: fix extra pages of multicolumn sections with footnotes". Co-authored-by: Tibor Nagy (NISZ) Change-Id: I36568e33b04ba8024ceef6b3ea84b71fb375e2a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129896 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 9a457c24ab2731c99f1a5fa1d28f68788e6977f3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129936 Tested-by: Jenkins diff --git a/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt b/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt new file mode 100644 index ..660dcb70df0b Binary files /dev/null and b/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 3ef61970f5ae..85a685ff2b44 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3719,6 +3719,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf135035) CPPUNIT_ASSERT_GREATER(nParentWidth, nFly3Width); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf146704_EndnoteInSection) +{ +SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf146704_EndnoteInSection.odt"); +CPPUNIT_ASSERT(pDoc); +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); +// Without the fix, the endnote placed to 2. page +assertXPath(pXmlDoc, "/root/page", 1); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage) { SwDoc* pDoc diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 445d3e29dcd6..d100e24526a4 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -458,8 +458,9 @@ SwFootnoteBossFrame* SwFrame::FindFootnoteBossFrame( bool bFootnotes ) // similar case can be reached with a page break + FootnoteAtEnd setting SwSectionFrame* pSectframe = pRet->FindSctFrame(); bool bMoveToPageFrame = false; +// tdf146704: only if it is really a footnote, not an endnote. // tdf54465: compatibility flag to make old odt files keep these full page sections. -if (pSectframe +if (bFootnotes && pSectframe && pSectframe->GetFormat()->getIDocumentSettingAccess().get( DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND)) {
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt |binary sw/qa/extras/layout/layout.cxx |9 + sw/source/core/layout/findfrm.cxx |3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) New commits: commit 9a457c24ab2731c99f1a5fa1d28f68788e6977f3 Author: Attila Szűcs AuthorDate: Mon Feb 14 08:43:08 2022 +0100 Commit: László Németh CommitDate: Tue Feb 15 15:53:24 2022 +0100 tdf#146704 sw: fix regression of endnote layout in sections Endnotes collected at the end of sections moved to a new page. Regression from commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88 "tdf#139336 sw: fix extra pages of multicolumn sections with footnotes". Co-authored-by: Tibor Nagy (NISZ) Change-Id: I36568e33b04ba8024ceef6b3ea84b71fb375e2a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129896 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt b/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt new file mode 100644 index ..660dcb70df0b Binary files /dev/null and b/sw/qa/extras/layout/data/tdf146704_EndnoteInSection.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 74638e413d59..1618b86a1363 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3728,6 +3728,15 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf135035) CPPUNIT_ASSERT_GREATER(nParentWidth, nFly3Width); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf146704_EndnoteInSection) +{ +SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf146704_EndnoteInSection.odt"); +CPPUNIT_ASSERT(pDoc); +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); +// Without the fix, the endnote placed to 2. page +assertXPath(pXmlDoc, "/root/page", 1); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage) { SwDoc* pDoc diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 445d3e29dcd6..d100e24526a4 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -458,8 +458,9 @@ SwFootnoteBossFrame* SwFrame::FindFootnoteBossFrame( bool bFootnotes ) // similar case can be reached with a page break + FootnoteAtEnd setting SwSectionFrame* pSectframe = pRet->FindSctFrame(); bool bMoveToPageFrame = false; +// tdf146704: only if it is really a footnote, not an endnote. // tdf54465: compatibility flag to make old odt files keep these full page sections. -if (pSectframe +if (bFootnotes && pSectframe && pSectframe->GetFormat()->getIDocumentSettingAccess().get( DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND)) {
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf119952_negativeMargins.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 83 +++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 38 - writerfilter/source/dmapper/DomainMapper_Impl.cxx| 63 writerfilter/source/dmapper/DomainMapper_Impl.hxx|3 writerfilter/source/dmapper/PropertyMap.cxx | 78 -- writerfilter/source/dmapper/PropertyMap.hxx |7 7 files changed, 190 insertions(+), 82 deletions(-) New commits: commit 4a539a150d5f9f606aabca11633f2c7104fb2a13 Author: Attila Szűcs AuthorDate: Fri Jun 25 10:37:47 2021 +0200 Commit: Miklos Vajna CommitDate: Fri Jan 28 18:18:07 2022 +0100 tdf#119952 DOCX import: fix negative page margins DOCX body text can overlap with header/footer, if top/bottom page margin is negative. To support this, convert header/footer text content to textbox anchored to header/footer, if needed. Note: possible improvements: 1) Skip this hack, if the header is small enough to not overlap with the body, calculate only the height of the header at the import time. 2) This hack does not fix the case when the top of the header is under the top of the body. (A problem in DOC import, too.) This could be achieved by repositioning the dummy header to the top, and lower the textbox by the same amount. (This would still not resolve the extreme situation, when the body start from 0 mm (in LibreOffice, header must be at least 1 mm). 3) Import of VertOrientation::BOTTOM property seems to be bad, or at least the footer loses this property after a DOCX round-trip, resulting bad footer position. 4) after a round-trip, the 1 mm height of the dummy header increases to 1 line height. Also the "Autofit height" and "Use dynamic spacing" settings are changed, likely related to their missing DOCX export. Co-authored-by: Tibor Nagy (NISZ) (cherry picked from commit d656191ec308d4280b93c7169372e543a255d108) Change-Id: I8319c93c6c5a980878ee9956c8ab2953da60409e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129102 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/ooxmlexport/data/tdf119952_negativeMargins.docx b/sw/qa/extras/ooxmlexport/data/tdf119952_negativeMargins.docx new file mode 100644 index ..9b5a98d3f1aa Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf119952_negativeMargins.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 1638d93cf878..4523b19e5311 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -1424,6 +1424,89 @@ DECLARE_OOXMLEXPORT_TEST(testTdf124678_case2, "tdf124678_with_leading_paragraph. CPPUNIT_ASSERT_EQUAL_MESSAGE("Second page header text", OUString("HEADER"), parseDump("/root/page[2]/header/txt")); } +static bool lcl_nearEqual(const sal_Int32 nNumber1, const sal_Int32 nNumber2, sal_Int32 nMaxDiff = 5) +{ +return std::abs(nNumber1 - nNumber2) < nMaxDiff; +} + +DECLARE_OOXMLEXPORT_TEST(testTdf119952_negativeMargins, "tdf119952_negativeMargins.docx") +{ +// With negative margins (in MS Word) one can set up header (or footer) that overlaps with the body. +// LibreOffice unable to display that, so when importing negative margins, +// the header (or footer) converted to a flyframe, anchored to the header.. +// that can overlap with the body, and will appear like in Word. +// This conversion modifies the document [i.e. replacing header text with a textbox...] +// but its DOCX export looks the same, as the original document in Word, too. +xmlDocUniquePtr pDump = parseLayoutDump(); + +//Check layout positions / sizes +sal_Int32 nLeftHead = getXPath(pDump, "//page[1]/header/infos/bounds", "left").toInt32(); +sal_Int32 nLeftBody = getXPath(pDump, "//page[1]/body/infos/bounds", "left").toInt32(); +sal_Int32 nLeftFoot = getXPath(pDump, "//page[1]/footer/infos/bounds", "left").toInt32(); +sal_Int32 nLeftHFly = getXPath(pDump, "//page[1]/header/txt/anchored/fly/infos/bounds", "left").toInt32(); +sal_Int32 nLeftFFly = getXPath(pDump, "//page[1]/footer/txt/anchored/fly/infos/bounds", "left").toInt32(); + +sal_Int32 nTopHead = getXPath(pDump, "//page[1]/header/infos/bounds", "top").toInt32(); +sal_Int32 nTopBody = getXPath(pDump, "//page[1]/body/infos/bounds", "top").toInt32(); +sal_Int32 nTopFoot = getXPath(pDump, "//page[1]/footer/infos/bounds", "top").toInt32(); +sal_Int32 nTopHFly = getXPath(pDump, "//page[1]/header/txt/anchored/fly/infos/bounds", "top").toInt32(); +sal_Int32 nTopFFly = getXPath(pDump, "//page[1]/footer/txt/anchored/fly/infos/bounds", "top").toInt32(); + +
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - 2 commits - scaddins/source sc/qa sw/inc sw/qa sw/source writerfilter/source
sc/qa/unit/data/functions/date_time/fods/weeks.fods | 652 +- scaddins/source/datefunc/datefunc.cxx | 71 - sw/inc/IDocumentSettingAccess.hxx |3 sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt |binary sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt |binary sw/qa/extras/layout/layout.cxx | 24 sw/source/core/doc/DocumentSettingManager.cxx | 15 sw/source/core/inc/DocumentSettingManager.hxx |1 sw/source/core/layout/findfrm.cxx |6 sw/source/filter/ww8/ww8par.cxx |2 sw/source/uibase/app/docshini.cxx |1 sw/source/uibase/uno/SwXDocumentSettings.cxx | 18 writerfilter/source/dmapper/DomainMapper.cxx |1 13 files changed, 727 insertions(+), 67 deletions(-) New commits: commit 8a82c6f3f1e85c941ac05b48416450cec813a04e Author: Attila Szűcs AuthorDate: Thu Nov 18 11:02:01 2021 +0100 Commit: Xisco Fauli CommitDate: Tue Nov 30 10:08:34 2021 +0100 tdf#54465 tdf#139336 sw: add compat. flag for footnote in column Add compatibility option FOOTNOTE_IN_COLUMN_TO_PAGEEND to keep layout of old ODT files, where multicolumn sections have footnotes in columns, growing sections to the full page. Note: Multicolumn page styles or not evenly distributed multicolumn sections, or footnotes not collected at the end of the sections still use footnotes in columns, so they don't need this compatibility option. Follow-up to commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88 "tdf#139336 sw: fix extra pages of multicolumn sections with footnotes". Co-authored-by: Tibor Nagy (NISZ) Change-Id: I7d6a1f804b555dc5372767014b8fb5e3fa57ba9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125442 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 41cc1d2c0c0c3bfa5ba341311f68df05375859fb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126001 Reviewed-by: Attila Szűcs Reviewed-by: Xisco Fauli Tested-by: Jenkins diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx index 310f6a773c3d..d20130dbd3e5 100644 --- a/sw/inc/IDocumentSettingAccess.hxx +++ b/sw/inc/IDocumentSettingAccess.hxx @@ -114,6 +114,9 @@ enum class DocumentSettingId HEADER_SPACING_BELOW_LAST_PARA, FRAME_AUTOWIDTH_WITH_MORE_PARA, GUTTER_AT_TOP, +// footnoteContainer default position is the page end instead of the column end +// only if "evenly distributed" is set, and "collected at the end" is not set +FOOTNOTE_IN_COLUMN_TO_PAGEEND, }; /** Provides access to settings of a document diff --git a/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt b/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt new file mode 100644 index ..28a19263053a Binary files /dev/null and b/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt differ diff --git a/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt b/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt new file mode 100644 index ..426e684937b3 Binary files /dev/null and b/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 9050a00a86cf..3ef61970f5ae 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3733,6 +3733,30 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf139336_ColumnsWithFootnoteDoNotOccup assertXPath(pXmlDoc, "/root/page", 2); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage) +{ +// Old odt files should keep their original layout, as it was before Tdf139336 fix. +// The new odt file is only 1 page long, while the old odt file (with the same content) +// was more then 1 page long. +// Note: Somewhy this test miscalculates the layout of the old odt file. +// It will be 4 pages long, while opened in Writer it is 5 pages long. +SwDoc* pDoc += createSwDoc(DATA_DIRECTORY, "tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt"); +CPPUNIT_ASSERT(pDoc); +Scheduler::ProcessEventsToIdle(); +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); +xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc,
[Libreoffice-commits] core.git: sw/inc sw/qa sw/source writerfilter/source
sw/inc/IDocumentSettingAccess.hxx |3 + sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt |binary sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt |binary sw/qa/extras/layout/layout.cxx | 24 ++ sw/source/core/doc/DocumentSettingManager.cxx | 15 +- sw/source/core/inc/DocumentSettingManager.hxx |1 sw/source/core/layout/findfrm.cxx |6 ++ sw/source/filter/ww8/ww8par.cxx |2 sw/source/uibase/app/docshini.cxx |1 sw/source/uibase/uno/SwXDocumentSettings.cxx | 18 +++ writerfilter/source/dmapper/DomainMapper.cxx |1 11 files changed, 68 insertions(+), 3 deletions(-) New commits: commit 41cc1d2c0c0c3bfa5ba341311f68df05375859fb Author: Attila Szűcs AuthorDate: Thu Nov 18 11:02:01 2021 +0100 Commit: László Németh CommitDate: Mon Nov 29 09:34:07 2021 +0100 tdf#54465 tdf#139336 sw: add compat. flag for footnote in column Add compatibility option FOOTNOTE_IN_COLUMN_TO_PAGEEND to keep layout of old ODT files, where multicolumn sections have footnotes in columns, growing sections to the full page. Note: Multicolumn page styles or not evenly distributed multicolumn sections, or footnotes not collected at the end of the sections still use footnotes in columns, so they don't need this compatibility option. Follow-up to commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88 "tdf#139336 sw: fix extra pages of multicolumn sections with footnotes". Co-authored-by: Tibor Nagy (NISZ) Change-Id: I7d6a1f804b555dc5372767014b8fb5e3fa57ba9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125442 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx index 310f6a773c3d..d20130dbd3e5 100644 --- a/sw/inc/IDocumentSettingAccess.hxx +++ b/sw/inc/IDocumentSettingAccess.hxx @@ -114,6 +114,9 @@ enum class DocumentSettingId HEADER_SPACING_BELOW_LAST_PARA, FRAME_AUTOWIDTH_WITH_MORE_PARA, GUTTER_AT_TOP, +// footnoteContainer default position is the page end instead of the column end +// only if "evenly distributed" is set, and "collected at the end" is not set +FOOTNOTE_IN_COLUMN_TO_PAGEEND, }; /** Provides access to settings of a document diff --git a/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt b/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt new file mode 100644 index ..28a19263053a Binary files /dev/null and b/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt differ diff --git a/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt b/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt new file mode 100644 index ..426e684937b3 Binary files /dev/null and b/sw/qa/extras/layout/data/tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 9050a00a86cf..3ef61970f5ae 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3733,6 +3733,30 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf139336_ColumnsWithFootnoteDoNotOccup assertXPath(pXmlDoc, "/root/page", 2); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage) +{ +// Old odt files should keep their original layout, as it was before Tdf139336 fix. +// The new odt file is only 1 page long, while the old odt file (with the same content) +// was more then 1 page long. +// Note: Somewhy this test miscalculates the layout of the old odt file. +// It will be 4 pages long, while opened in Writer it is 5 pages long. +SwDoc* pDoc += createSwDoc(DATA_DIRECTORY, "tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_Old.odt"); +CPPUNIT_ASSERT(pDoc); +Scheduler::ProcessEventsToIdle(); +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); +xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/root/page"); +xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; +CPPUNIT_ASSERT_GREATER(1, xmlXPathNodeSetGetLength(pXmlNodes)); +xmlXPathFreeObject(pXmlObj); + +discardDumpedLayout(); +pDoc = createSwDoc(DATA_DIRECTORY, "tdf54465_ColumnsWithFootnoteDoNotOccupyEntirePage_New.odt"); +CPPUNIT_ASSERT(pDoc); +pXmlDoc = parseLayoutDump(); +assertXPath(pXmlDoc,
[Libreoffice-commits] core.git: sw/source
sw/source/core/layout/findfrm.cxx |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) New commits: commit 9fdb9c5fd71e61ae673c79064e3249ce7207031a Author: Attila Szűcs AuthorDate: Fri Nov 12 11:30:42 2021 +0100 Commit: László Németh CommitDate: Fri Nov 12 15:43:02 2021 +0100 tdf#145611 sw: fix regression: undoing page breaks at pages with endnotes. Added a nullptr check for section to avoid crash on Linux. It seems, SwSectionFrame::m_pSection can be nullptr at that point. Regression from commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88 "tdf#139336 sw: fix extra pages of multicolumn sections with footnotes". Co-authored-by: Tibor Nagy (NISZ) Change-Id: Iec4ff93df6720d0e62af59117cd03bd3902c0f64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125095 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 1eae79d9cd60..52d7e9627a1e 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -459,9 +459,12 @@ SwFootnoteBossFrame* SwFrame::FindFootnoteBossFrame( bool bFootnotes ) bool bMoveToPageFrame = false; if (pSectframe) { -bool bNoBalance = pSectframe->GetSection()->GetFormat()->GetBalancedColumns().GetValue(); -bool bFAtEnd = pSectframe->IsFootnoteAtEnd(); -bMoveToPageFrame = !bFAtEnd && !bNoBalance; +SwSection* pSect = pSectframe->GetSection(); +if (pSect) { +bool bNoBalance = pSect->GetFormat()->GetBalancedColumns().GetValue(); +bool bFAtEnd = pSectframe->IsFootnoteAtEnd(); +bMoveToPageFrame = !bFAtEnd && !bNoBalance; +} } while (pRet && ((!bMoveToPageFrame && !pRet->IsFootnoteBossFrame())
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/layout/data/tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx |binary sw/qa/extras/layout/layout.cxx | 14 + sw/source/core/layout/findfrm.cxx | 27 +- sw/source/core/layout/wsfrm.cxx |1 4 files changed, 41 insertions(+), 1 deletion(-) New commits: commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88 Author: Attila Szűcs AuthorDate: Wed Sep 8 15:51:16 2021 +0200 Commit: László Németh CommitDate: Tue Nov 2 16:31:24 2021 +0100 tdf#139336 sw: fix extra pages of multicolumn sections with footnotes Adding footnotes to multicolumn sections resulted page-long section layout, not regarding to the amount of its text content. E.g. a page with n multicolumn sections and footnotes could load as n (mostly empty) pages. The problem is related to the footnotes showed under columns of sections, which can be ambiguous at different column number of the different sections on the same page. As a workaround for interoperability, show footnotes per pages to remove the extra pages, e.g. allowing to show the separated sections on a single page, like MSO does. Note: a compatibility option will be added to avoid regressions. Note: This fix doesn't change multicolumn page styles or not evenly distributed multicolumn sections or footnotes not collected at the end of the sections. Test: choose Edit Section... in local menu of the sections of the unit test document. In Options..., see checkbox "Evenly distribute contents to all columns" on page Columns, and Footnotes/"Collect at end of text" on page Footnotes/Endnotes. To see the result of the new settings, save and reload the document. Note: DOCX format doesn't support "Collect at end of text", only OpenDocument. Note: In MSO, it's possible to set multimulticolumn footnotes separately from section column number. It's column number can be 1–4, or "auto", which uses the column number of the first section of the page. See also tdf#138508 (Single column footnotes on multi-column pages). Change-Id: I6a3534ac043971479275a3e8bb0713bd3d8ceaa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121822 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/qa/extras/layout/data/tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx b/sw/qa/extras/layout/data/tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx new file mode 100644 index ..a44ff4047111 Binary files /dev/null and b/sw/qa/extras/layout/data/tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 1b7ad51d71c2..9050a00a86cf 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3719,6 +3719,20 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf135035) CPPUNIT_ASSERT_GREATER(nParentWidth, nFly3Width); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage) +{ +SwDoc* pDoc += createSwDoc(DATA_DIRECTORY, "tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx"); +CPPUNIT_ASSERT(pDoc); +xmlDocUniquePtr pXmlDoc = parseLayoutDump(); +// Without the fix, it would be 5 pages, but with the fix the whole document +// would fit into 1 page, but it will be 2 pages right now, because +// when writer import (from docx) the last section with columns, then it does not set +// the evenly distributed settings, and this settings is required for the fix now, to +// avoid some regression. +assertXPath(pXmlDoc, "/root/page", 2); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index e90ee98c1fdf..1eae79d9cd60 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -39,6 +40,7 @@ #include #include + /// Searches the first ContentFrame in BodyText below the page. SwLayoutFrame *SwFootnoteBossFrame::FindBodyCont() { @@ -440,7 +442,30 @@ SwFootnoteBossFrame* SwFrame::FindFootnoteBossFrame( bool bFootnotes ) // don't contain footnote texts there if( pRet->IsInTab() ) pRet = pRet->FindTabFrame(); -while ( pRet && !pRet->IsFootnoteBossFrame() ) + +// tdf139336: put the footnotes into the page frame (instead of a column frame) +// to avoid maximizing the section to the full page if: +// - it is in a section +// - collect footnotes at section end (FootnoteAtEnd) is not set +// - columns are evenly distributed (=balanced) is not set +// Note 1: at page end, the
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/unit/data/xlsx/tdf145129_DefaultRowHeight_28.35pt_SavedByExcel.xlsx |binary sc/qa/unit/subsequent_export_test2.cxx| 17 ++ sc/source/filter/oox/worksheetfragment.cxx| 7 +++- 3 files changed, 23 insertions(+), 1 deletion(-) New commits: commit 69424f0fd66a74dbabba66c9c7fb1420aa1ff4e9 Author: Attila Szűcs AuthorDate: Fri Oct 15 13:55:36 2021 +0200 Commit: László Németh CommitDate: Tue Oct 26 11:13:45 2021 +0200 tdf#145129 XLSX import: round down default row height like table layout of MSO does, e.g. 20 pt to 19.5 pt. Same as tdf#144642, but with default row height. Follow-up to commit 537cb82be8fa021fd9382cca874645c75daaef20 "tdf#144642 XLSX import: round down row height to 0.75 pt". Co-authored-by: Tibor Nagy (NISZ) Change-Id: Iefb615b56e5ddc11a5e839cf6d90516b18646045 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123655 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sc/qa/unit/data/xlsx/tdf145129_DefaultRowHeight_28.35pt_SavedByExcel.xlsx b/sc/qa/unit/data/xlsx/tdf145129_DefaultRowHeight_28.35pt_SavedByExcel.xlsx new file mode 100644 index ..f8041d58eb65 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf145129_DefaultRowHeight_28.35pt_SavedByExcel.xlsx differ diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 2be6a07c4af8..53aaedb48288 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -200,6 +200,7 @@ public: void testTdf139258_rotated_image(); void testTdf142854_GridVisibilityImportXlsxInHeadlessMode(); void testTdf144642_RowHeightRounding(); +void testTdf145129_DefaultRowHeightRounding(); void testTdf140431(); void testCheckboxFormControlXlsxExport(); void testButtonFormControlXlsxExport(); @@ -311,6 +312,7 @@ public: CPPUNIT_TEST(testTdf139258_rotated_image); CPPUNIT_TEST(testTdf142854_GridVisibilityImportXlsxInHeadlessMode); CPPUNIT_TEST(testTdf144642_RowHeightRounding); +CPPUNIT_TEST(testTdf145129_DefaultRowHeightRounding); CPPUNIT_TEST(testTdf140431); CPPUNIT_TEST(testCheckboxFormControlXlsxExport); CPPUNIT_TEST(testButtonFormControlXlsxExport); @@ -2572,6 +2574,21 @@ void ScExportTest2::testTdf144642_RowHeightRounding() xShell->DoClose(); } +void ScExportTest2::testTdf145129_DefaultRowHeightRounding() +{ +// MS Excel round down row heights to 0.75pt +// Same as Tdf144642 but with default row height. + +ScDocShellRef xShell += loadDoc(u"tdf145129_DefaultRowHeight_28.35pt_SavedByExcel.", FORMAT_XLSX); +CPPUNIT_ASSERT(xShell.is()); +ScDocument& rDoc = xShell->GetDocument(); +// 555twips == 27.75pt == 9.79mm +CPPUNIT_ASSERT_EQUAL(sal_uInt16(555), rDoc.GetRowHeight(0, 0)); +CPPUNIT_ASSERT_EQUAL(sal_uLong(555 * 52), rDoc.GetRowHeight(0, 51, 0, true)); +xShell->DoClose(); +} + void ScExportTest2::testTdf140431() { ScDocShellRef xShell = loadDoc(u"129969-min.", FORMAT_XLSX); diff --git a/sc/source/filter/oox/worksheetfragment.cxx b/sc/source/filter/oox/worksheetfragment.cxx index a0e01c915dcf..218ab447545b 100644 --- a/sc/source/filter/oox/worksheetfragment.cxx +++ b/sc/source/filter/oox/worksheetfragment.cxx @@ -667,8 +667,13 @@ void WorksheetFragment::importSheetFormatPr( const AttributeList& rAttribs ) // XML_outlineLevelRow // XML_outlineLevelCol // as it will be updated during export to OOXML +double fDefaultRowHeight = rAttribs.getDouble(XML_defaultRowHeight, 0.0); +if (getFilter().isMSODocument()) +{ +fDefaultRowHeight -= fmod(fDefaultRowHeight, 0.75); //round down to 0.75pt +} setDefaultRowSettings( -rAttribs.getDouble( XML_defaultRowHeight, 0.0 ), +fDefaultRowHeight, rAttribs.getBool( XML_customHeight, false ), rAttribs.getBool( XML_zeroHeight, false ), rAttribs.getBool( XML_thickTop, false ),
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sc/CppunitTest_sc_subsequent_export_test.mk sc/qa sc/source
sc/CppunitTest_sc_subsequent_export_test.mk |1 sc/qa/unit/data/ods/tdf126541_GridOffGlobally.ods |binary sc/qa/unit/data/xlsx/tdf126541_GridOff.xlsx |binary sc/qa/unit/subsequent_export-test.cxx | 48 +- sc/source/filter/oox/viewsettings.cxx |2 5 files changed, 49 insertions(+), 2 deletions(-) New commits: commit 0bdcb59b760b06beee77e9be036f00feb1bf7010 Author: Attila Szűcs AuthorDate: Tue May 25 10:28:05 2021 +0200 Commit: Balazs Varga CommitDate: Thu Oct 21 09:45:34 2021 +0200 tdf#126541 XLSX import: fix View grid lines It was not possible to enable the disabled grid with View->View grid lines, as intended, because document-level grid visibility was set to the visibility of the actual sheet's grid (which already imported correctly) instead of keeping its default true value. Note: document-level or global grid visibility is unknown for XLSX, but handled by Writer/ODS, see Tools->Options->Calc->View->Grid lines. Co-authored-by: Tibor Nagy (NISZ) Change-Id: Iccab3e2b9f617cdcd678071f73c7c2d6db0bc161 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116096 Tested-by: László Németh Reviewed-by: László Németh Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123952 Tested-by: Balazs Varga Reviewed-by: Balazs Varga diff --git a/sc/CppunitTest_sc_subsequent_export_test.mk b/sc/CppunitTest_sc_subsequent_export_test.mk index 604dbabeadc8..9d5fb86cb56e 100644 --- a/sc/CppunitTest_sc_subsequent_export_test.mk +++ b/sc/CppunitTest_sc_subsequent_export_test.mk @@ -96,6 +96,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_subsequent_export_test,\ sfx2/util/sfx \ sot/util/sot \ svl/util/svl \ +svl/source/fsstor/fsstorage \ svtools/util/svt \ toolkit/util/tk \ ucb/source/core/ucb1 \ diff --git a/sc/qa/unit/data/ods/tdf126541_GridOffGlobally.ods b/sc/qa/unit/data/ods/tdf126541_GridOffGlobally.ods new file mode 100644 index ..389fe347d493 Binary files /dev/null and b/sc/qa/unit/data/ods/tdf126541_GridOffGlobally.ods differ diff --git a/sc/qa/unit/data/xlsx/tdf126541_GridOff.xlsx b/sc/qa/unit/data/xlsx/tdf126541_GridOff.xlsx new file mode 100644 index ..e27089b01603 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf126541_GridOff.xlsx differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index c83dd75a6c49..3c1a44a51423 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -288,6 +289,7 @@ public: void testDateStandardfilterXLSX(); void testTdf142929_filterLessThanXLSX(); void testAutofilterTop10XLSX(); +void testTdf126541_SheetVisibilityImportXlsx(); CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); @@ -471,13 +473,16 @@ public: CPPUNIT_TEST(testTdf136721_paper_size); CPPUNIT_TEST(testTdf139258_rotated_image); CPPUNIT_TEST(testTdf140431); - +CPPUNIT_TEST(testTdf126541_SheetVisibilityImportXlsx); CPPUNIT_TEST(testDateStandardfilterXLSX); CPPUNIT_TEST(testTdf142929_filterLessThanXLSX); CPPUNIT_TEST(testAutofilterTop10XLSX); + CPPUNIT_TEST_SUITE_END(); private: + +ScDocShellRef loadDocAndSetupModelViewController(std::u16string_view rFileName, sal_Int32 nFormat, bool bReadWrite); void testExcelCellBorders( sal_uLong nFormatType ); uno::Reference m_xCalcComponent; @@ -5980,6 +5985,47 @@ void ScExportTest::testAutofilterTop10XLSX() xDocSh->DoClose(); } +ScDocShellRef ScExportTest::loadDocAndSetupModelViewController(std::u16string_view rFileName, sal_Int32 nFormat, bool bReadWrite) +{ +uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(::comphelper::getProcessComponentContext()); +CPPUNIT_ASSERT(xDesktop.is()); + +// create a frame +Reference< frame::XFrame > xTargetFrame = xDesktop->findFrame("_blank", 0); +CPPUNIT_ASSERT(xTargetFrame.is()); + +// 1. Open the document +ScDocShellRef xDocSh = loadDoc(rFileName, nFormat, bReadWrite); +CPPUNIT_ASSERT_MESSAGE(OString("Failed to load " + OUStringToOString(rFileName, RTL_TEXTENCODING_UTF8)).getStr(), xDocSh.is()); + +uno::Reference< frame::XModel2 > xModel2 = xDocSh->GetModel(); +CPPUNIT_ASSERT(xModel2.is()); + +Reference< frame::XController2 > xController = xModel2->createDefaultViewController(xTargetFrame); +CPPUNIT_ASSERT(xController.is()); + +// introduce model/view/controller to each other +xController->attachModel(xModel2); +xModel2->connectController(xController); +xTargetFrame->setComponent(xController->getComponentWindow(), xController); +xController->attachFrame(xTargetFrame); +xModel2->setCurrentController(xController); + +return xDocSh; +} + +void
[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sw/qa writerfilter/source
sw/qa/extras/ooxmlimport/data/tdf74367_MarginsZeroed.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 15 ++ writerfilter/source/dmapper/BorderHandler.hxx |1 writerfilter/source/dmapper/PageBordersHandler.cxx|5 +++- 4 files changed, 20 insertions(+), 1 deletion(-) New commits: commit 2d57a16d239b731af39b86aba489a97629820401 Author: Attila Szűcs AuthorDate: Wed Feb 3 16:50:30 2021 +0100 Commit: Balazs Varga CommitDate: Thu Oct 21 09:35:58 2021 +0200 tdf#74367 DOCX: fix page margins imported as border padding Trying to import non-existing "none" borders of w:pgBorders zeroed page margins, removing their values to border padding. Note: according to OOXML standard 2.6.10. pgBorders (Page Borders), "nil" should be treated the same. Co-authored-by: Tibor Nagy (NISZ) Change-Id: Ibbc9375b2f8b3daf7b4bdea84e078676ce588586 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110396 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit b35f48d806f9e5ec689eda3828f1e4503644873b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123853 Reviewed-by: Attila Szűcs Reviewed-by: Balazs Varga Tested-by: Balazs Varga diff --git a/sw/qa/extras/ooxmlimport/data/tdf74367_MarginsZeroed.docx b/sw/qa/extras/ooxmlimport/data/tdf74367_MarginsZeroed.docx new file mode 100644 index ..9b9eb1c43965 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf74367_MarginsZeroed.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 6732a63a5679..8adf21567300 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -457,6 +457,21 @@ DECLARE_OOXMLIMPORT_TEST(testN758883, "n758883.docx") CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, eAnchorType); } +DECLARE_OOXMLIMPORT_TEST(testTdf74367_MarginsZeroed, "tdf74367_MarginsZeroed.docx") +{ +// Do not import page borders with 'None' style, or else it will change the page margins. +uno::Reference xPropertySet(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); +sal_Int32 nValue = 0; +xPropertySet->getPropertyValue("TopMargin") >>= nValue; +CPPUNIT_ASSERT_EQUAL(sal_Int32(2501), nValue); +xPropertySet->getPropertyValue("RightMargin") >>= nValue; +CPPUNIT_ASSERT_EQUAL(sal_Int32(2501), nValue); +xPropertySet->getPropertyValue("BottomMargin") >>= nValue; +CPPUNIT_ASSERT_EQUAL(sal_Int32(2501), nValue); +xPropertySet->getPropertyValue("LeftMargin") >>= nValue; +CPPUNIT_ASSERT_EQUAL(sal_Int32(2501), nValue); +} + DECLARE_OOXMLIMPORT_TEST(testBnc773061, "bnc773061.docx") { uno::Reference< text::XTextRange > paragraph = getParagraph( 1 ); diff --git a/writerfilter/source/dmapper/BorderHandler.hxx b/writerfilter/source/dmapper/BorderHandler.hxx index 9e8aa7a62a90..1261416760b3 100644 --- a/writerfilter/source/dmapper/BorderHandler.hxx +++ b/writerfilter/source/dmapper/BorderHandler.hxx @@ -69,6 +69,7 @@ public: PropertyMapPtr getProperties(); css::table::BorderLine2 getBorderLine(); sal_Int32 getLineDistance() const { return m_nLineDistance;} +sal_Int32 getLineType() const { return m_nLineType;} boolgetShadow() const { return m_bShadow;} void enableInteropGrabBag(const OUString& aName); css::beans::PropertyValue getInteropGrabBag(const OUString& aName = OUString()); diff --git a/writerfilter/source/dmapper/PageBordersHandler.cxx b/writerfilter/source/dmapper/PageBordersHandler.cxx index d6a0fdd1f502..89548eb351ee 100644 --- a/writerfilter/source/dmapper/PageBordersHandler.cxx +++ b/writerfilter/source/dmapper/PageBordersHandler.cxx @@ -119,7 +119,10 @@ void PageBordersHandler::lcl_sprm( Sprm& rSprm ) aPgBorder.m_nDistance = pBorderHandler->getLineDistance( ); aPgBorder.m_ePos = ePos; aPgBorder.m_bShadow = pBorderHandler->getShadow(); -m_aBorders.push_back( aPgBorder ); +if (pBorderHandler->getLineType() != NS_ooxml::LN_Value_ST_Border_none) +{ +m_aBorders.push_back( aPgBorder ); +} } } break;
[Libreoffice-commits] core.git: include/oox oox/source sc/qa sc/source
include/oox/core/xmlfilterbase.hxx |2 oox/source/core/xmlfilterbase.cxx |9 +++ sc/qa/unit/data/xlsx/tdf144642_RowHeight_10mm_SavedByCalc.xlsx |binary sc/qa/unit/data/xlsx/tdf144642_RowHeight_28.35pt_SavedByExcel.xlsx |binary sc/qa/unit/subsequent_export_test.cxx |2 sc/qa/unit/subsequent_export_test2.cxx | 25 ++ sc/source/filter/oox/sheetdatacontext.cxx |6 ++ 7 files changed, 42 insertions(+), 2 deletions(-) New commits: commit 537cb82be8fa021fd9382cca874645c75daaef20 Author: Attila Szűcs AuthorDate: Wed Sep 22 13:19:23 2021 +0200 Commit: László Németh CommitDate: Wed Oct 13 16:57:35 2021 +0200 tdf#144642 XLSX import: round down row height to 0.75 pt like table layout of MSO does, e.g. 20 pt to 19.5 pt. Changing table row height is only for interoperability. To avoid of regressions, apply this workaround only for documents created in MSO. Note: likely this is an old adjustment for low-resolution monitors, where 0.75 is the factor between 96 ppi of Windows resolution and (originally) 72 ppi of monitor resolutions. Co-authored-by: Tibor Nagy (NISZ) Change-Id: Ie1e2c781d21174a877b18cd3250eb445222bd1c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122428 Tested-by: László Németh Reviewed-by: László Németh diff --git a/include/oox/core/xmlfilterbase.hxx b/include/oox/core/xmlfilterbase.hxx index 7c1cada284d2..15de6ce680c9 100644 --- a/include/oox/core/xmlfilterbase.hxx +++ b/include/oox/core/xmlfilterbase.hxx @@ -246,6 +246,7 @@ public: static FastParser* createParser(); bool isMSO2007Document() const; +bool isMSODocument() const; /// Signal that an MSO 2007-created SmartArt was found, need to warn the /// user about it. @@ -281,6 +282,7 @@ private: sal_Int32 mnRelId; sal_Int32 mnMaxDocId; bool mbMSO2007; +bool mbMSO; protected: bool mbMissingExtDrawing; }; diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 371439b022a2..7f4ff6bd0f0c 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -200,6 +200,7 @@ XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext ) mnRelId( 1 ), mnMaxDocId( 0 ), mbMSO2007(false), +mbMSO(false), mbMissingExtDrawing(false) { } @@ -218,9 +219,10 @@ XmlFilterBase::~XmlFilterBase() void XmlFilterBase::checkDocumentProperties(const Reference& xDocProps) { -mbMSO2007 = false; +mbMSO2007 = mbMSO = false; if (!xDocProps->getGenerator().startsWithIgnoreAsciiCase("Microsoft")) return; +mbMSO = true; uno::Reference xUserDefProps(xDocProps->getUserDefinedProperties(), uno::UNO_QUERY); if (!xUserDefProps.is()) @@ -1020,6 +1022,11 @@ bool XmlFilterBase::isMSO2007Document() const return mbMSO2007; } +bool XmlFilterBase::isMSODocument() const +{ +return mbMSO; +} + void XmlFilterBase::setMissingExtDrawing() { mbMissingExtDrawing = true; diff --git a/sc/qa/unit/data/xlsx/tdf144642_RowHeight_10mm_SavedByCalc.xlsx b/sc/qa/unit/data/xlsx/tdf144642_RowHeight_10mm_SavedByCalc.xlsx new file mode 100644 index ..d85d94c107fc Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf144642_RowHeight_10mm_SavedByCalc.xlsx differ diff --git a/sc/qa/unit/data/xlsx/tdf144642_RowHeight_28.35pt_SavedByExcel.xlsx b/sc/qa/unit/data/xlsx/tdf144642_RowHeight_28.35pt_SavedByExcel.xlsx new file mode 100644 index ..367922d6581f Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf144642_RowHeight_28.35pt_SavedByExcel.xlsx differ diff --git a/sc/qa/unit/subsequent_export_test.cxx b/sc/qa/unit/subsequent_export_test.cxx index aa2a12f69d33..ad27741d4ad8 100644 --- a/sc/qa/unit/subsequent_export_test.cxx +++ b/sc/qa/unit/subsequent_export_test.cxx @@ -1564,7 +1564,7 @@ void ScExportTest::testMiscRowHeightExport() static const TestParam::RowData DfltRowData[] = { { 0, 4, 0, 529, 0, false }, { 5, 10, 0, 1058, 0, false }, -{ 17, 20, 0, 1767, 0, false }, +{ 17, 20, 0, 1746, 0, false }, // check last couple of row in document to ensure // they are 5.29mm ( effective default row xlsx height ) { 1048573, 1048575, 0, 529, 0, false }, diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index cea7c5e00628..2be6a07c4af8 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -199,6 +199,7 @@ public: void testTdf136721_paper_size(); void testTdf139258_rotated_image(); void testTdf142854_GridVisibilityImportXlsxInHeadlessMode(); +void testTdf144642_RowHeightRounding(); void testTdf140431(); void
[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sw/inc sw/qa sw/source writerfilter/source
sw/inc/unotextbodyhf.hxx | 2 sw/inc/unotextrange.hxx | 3 sw/qa/extras/ooxmlexport/data/tdf143384_tableInFoot_negativeMargins.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 7 + sw/source/core/unocore/unoframe.cxx | 8 + sw/source/core/unocore/unoobj2.cxx | 15 ++ sw/source/core/unocore/unotext.cxx | 56 +++--- writerfilter/source/dmapper/DomainMapper_Impl.cxx| 8 + writerfilter/source/dmapper/PropertyIds.cxx | 1 writerfilter/source/dmapper/PropertyIds.hxx | 1 10 files changed, 83 insertions(+), 18 deletions(-) New commits: commit 7ec91bcb7d248c38522375c31f2b6f640b1b84e2 Author: Attila Szűcs AuthorDate: Tue Jul 27 11:45:58 2021 +0200 Commit: Xisco Fauli CommitDate: Mon Sep 6 23:54:47 2021 +0200 tdf#143384 DOCX import: fix SAXException at header with table Regression from commit d656191ec308d4280b93c7169372e543a255d108 "tdf#119952 DOCX import: fix negative page margins". Add SwXHeadFootText::CreateTextCursor(bool bIgnoreTables = false) (modeled after SwXBodyText::CreateTextCursor) to create text cursor for copying the header/footer also started with table during fly frame creation in convertoToTextFrame(). Note: add hidden property PROP_CURSOR_NOT_IGNORE_TABLES_IN_HF to use the new feature in domainmapper (followed commit af4e5ee0f93c1ff442d08caed5c875f2b2c1fd43 "tdf#97128 DOCX import: fix frame direction"). Co-authored-by: Tibor Nagy (NISZ) Change-Id: I96e2cf2dddcecd146c53c12d7fdb44fc4d90fa0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119549 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit c1ad429d925855c1baacbdeca1ef42f4486eb9c2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120985 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx index fbccc982ef04..99887c6beb5c 100644 --- a/sw/inc/unotextbodyhf.hxx +++ b/sw/inc/unotextbodyhf.hxx @@ -115,6 +115,8 @@ public: static css::uno::Reference< css::text::XText > CreateXHeadFootText(SwFrameFormat & rHeadFootFormat, const bool bIsHeader); +css::uno::Reference CreateTextCursor(const bool bIgnoreTables = false); + // XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType) override; diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index f3ed06fb4a06..4d8ed2df2c06 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -57,7 +57,8 @@ namespace sw { enum class TextRangeMode { RequireTextNode, -AllowNonTextNode +AllowNonTextNode, +AllowTableNode }; void DeepCopyPaM(SwPaM const & rSource, SwPaM & rTarget); diff --git a/sw/qa/extras/ooxmlexport/data/tdf143384_tableInFoot_negativeMargins.docx b/sw/qa/extras/ooxmlexport/data/tdf143384_tableInFoot_negativeMargins.docx new file mode 100644 index ..918c1029fb4a Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf143384_tableInFoot_negativeMargins.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 431d5d71753d..17f05d1dcd16 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -1599,6 +1599,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119952_negativeMargins, "tdf119952_negativeMargi CPPUNIT_ASSERT_EQUAL(OUString(" "), parseDump("/root/page[3]/header/txt/anchored/fly")); } +DECLARE_OOXMLEXPORT_TEST(testTdf143384_tableInFoot_negativeMargins, "tdf143384_tableInFoot_negativeMargins.docx") +{ +// There should be no crash during loading of the document +// so, let's check just how much pages we have +CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index a430d92f5b7f..8fd930322a38 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1417,7 +1417,13 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& const ::SfxItemPropertyMapEntry* pEntry = m_pPropSet->getPropertyMap().getByName(rPropertyName); if (!pEntry) -throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); +{ +// Hack to skip the dummy CursorNotIgnoreTables property +if
[Libreoffice-commits] core.git: sw/inc sw/qa sw/source writerfilter/source
sw/inc/unotextbodyhf.hxx | 2 sw/inc/unotextrange.hxx | 3 sw/qa/extras/ooxmlexport/data/tdf143384_tableInFoot_negativeMargins.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 7 + sw/source/core/unocore/unoframe.cxx | 8 + sw/source/core/unocore/unoobj2.cxx | 15 ++ sw/source/core/unocore/unotext.cxx | 56 +++--- writerfilter/source/dmapper/DomainMapper_Impl.cxx| 8 + writerfilter/source/dmapper/PropertyIds.cxx | 1 writerfilter/source/dmapper/PropertyIds.hxx | 1 10 files changed, 83 insertions(+), 18 deletions(-) New commits: commit c1ad429d925855c1baacbdeca1ef42f4486eb9c2 Author: Attila Szűcs AuthorDate: Tue Jul 27 11:45:58 2021 +0200 Commit: László Németh CommitDate: Wed Aug 25 13:45:23 2021 +0200 tdf#143384 DOCX import: fix SAXException at header with table Regression from commit d656191ec308d4280b93c7169372e543a255d108 "tdf#119952 DOCX import: fix negative page margins". Add SwXHeadFootText::CreateTextCursor(bool bIgnoreTables = false) (modeled after SwXBodyText::CreateTextCursor) to create text cursor for copying the header/footer also started with table during fly frame creation in convertoToTextFrame(). Note: add hidden property PROP_CURSOR_NOT_IGNORE_TABLES_IN_HF to use the new feature in domainmapper (followed commit af4e5ee0f93c1ff442d08caed5c875f2b2c1fd43 "tdf#97128 DOCX import: fix frame direction"). Co-authored-by: Tibor Nagy (NISZ) Change-Id: I96e2cf2dddcecd146c53c12d7fdb44fc4d90fa0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119549 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx index fbccc982ef04..99887c6beb5c 100644 --- a/sw/inc/unotextbodyhf.hxx +++ b/sw/inc/unotextbodyhf.hxx @@ -115,6 +115,8 @@ public: static css::uno::Reference< css::text::XText > CreateXHeadFootText(SwFrameFormat & rHeadFootFormat, const bool bIsHeader); +css::uno::Reference CreateTextCursor(const bool bIgnoreTables = false); + // XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType) override; diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index f3ed06fb4a06..4d8ed2df2c06 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -57,7 +57,8 @@ namespace sw { enum class TextRangeMode { RequireTextNode, -AllowNonTextNode +AllowNonTextNode, +AllowTableNode }; void DeepCopyPaM(SwPaM const & rSource, SwPaM & rTarget); diff --git a/sw/qa/extras/ooxmlexport/data/tdf143384_tableInFoot_negativeMargins.docx b/sw/qa/extras/ooxmlexport/data/tdf143384_tableInFoot_negativeMargins.docx new file mode 100644 index ..918c1029fb4a Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf143384_tableInFoot_negativeMargins.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index de3eea4c0659..08e0cbd9f8f7 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -1618,6 +1618,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119952_negativeMargins, "tdf119952_negativeMargi CPPUNIT_ASSERT_EQUAL(OUString(" "), parseDump("/root/page[3]/header/txt/anchored/fly")); } +DECLARE_OOXMLEXPORT_TEST(testTdf143384_tableInFoot_negativeMargins, "tdf143384_tableInFoot_negativeMargins.docx") +{ +// There should be no crash during loading of the document +// so, let's check just how much pages we have +CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 74d366d9961d..8b9250671d78 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1418,7 +1418,13 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& const ::SfxItemPropertyMapEntry* pEntry = m_pPropSet->getPropertyMap().getByName(rPropertyName); if (!pEntry) -throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); +{ +// Hack to skip the dummy CursorNotIgnoreTables property +if (rPropertyName == "CursorNotIgnoreTables") +return; +else +throw beans::UnknownPropertyException("Unknown property: " + rPropertyName, static_cast (this)); +}
[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/qa sc/source
sc/qa/extras/scpdfexport.cxx| 19 sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods |binary sc/source/ui/view/printfun.cxx |7 - 3 files changed, 24 insertions(+), 2 deletions(-) New commits: commit 81f4d72a827942ce482e381e55302a1e6700049e Author: Attila Szűcs AuthorDate: Thu Jul 15 15:50:09 2021 +0200 Commit: Xisco Fauli CommitDate: Mon Aug 9 19:24:05 2021 +0200 tdf#64703 sc: fix regression of printing page breaks After hidden rows or rows hidden by Autofilter, printing removed the page breaks between the visible rows, too. Now Calc supports WYSWYG: it prints all the visible page breaks, which includes the page breaks between the visible rows, and page breaks between the hidden rows (multiple page breaks of a hidden row sequence converted to a single page break). This was a regression since LO 3.6, introducing Autofilter with multichoice. Co-authored-by: Tibor Nagy (NISZ) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118984 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 8b2a2de2481843502f0566e773ed11532520bc70) Check nNextPageBreak for ScRowBreakIterator::NOT_FOUND, tdf#64703 follow-up Ifa0fd1b53da70018d8d14abd4f8ba347908d5ea9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119732 Reviewed-by: Eike Rathke Tested-by: Jenkins Change-Id: I87858d36fc62b8a5952cfd5bc39dbe90f1452ac0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119620 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sc/qa/extras/scpdfexport.cxx b/sc/qa/extras/scpdfexport.cxx index b98ee774b7ee..e06620827e4f 100644 --- a/sc/qa/extras/scpdfexport.cxx +++ b/sc/qa/extras/scpdfexport.cxx @@ -65,11 +65,13 @@ public: void testExportRange_Tdf120161(); void testExportFitToPage_Tdf103516(); void testUnoCommands_Tdf120161(); +void testTdf64703_hiddenPageBreak(); CPPUNIT_TEST_SUITE(ScPDFExportTest); CPPUNIT_TEST(testExportRange_Tdf120161); CPPUNIT_TEST(testExportFitToPage_Tdf103516); CPPUNIT_TEST(testUnoCommands_Tdf120161); +CPPUNIT_TEST(testTdf64703_hiddenPageBreak); CPPUNIT_TEST_SUITE_END(); }; @@ -438,6 +440,23 @@ void ScPDFExportTest::testUnoCommands_Tdf120161() } } +void ScPDFExportTest::testTdf64703_hiddenPageBreak() +{ +mxComponent = loadFromDesktop(m_directories.getURLFromSrc(DATA_DIRECTORY) + + "tdf64703_hiddenPageBreak.ods", + "com.sun.star.sheet.SpreadsheetDocument"); +uno::Reference xModel(mxComponent, uno::UNO_QUERY); + +// A1:A11: 4-page export +{ +ScRange range1(0, 0, 0, 0, 10, 0); +std::shared_ptr pPDFFile = exportToPDF(xModel, range1); +bool bFound = false; +CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "/Count 4>>", bFound)); +CPPUNIT_ASSERT_EQUAL(true, bFound); +} +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScPDFExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods b/sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods new file mode 100644 index ..87f110915d69 Binary files /dev/null and b/sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods differ diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 950fa944a183..782af0a440bf 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -3197,8 +3197,11 @@ void PrintPageRanges::calculate(ScDocument& rDoc, nLastVisibleRow = nLastRow; } else -// skip all hidden rows. -nRow = nLastRow; +{ +// Skip all hidden rows until next pagebreak. +nRow = ((nNextPageBreak == ScRowBreakIterator::NOT_FOUND) ? nLastRow : +std::min(nLastRow, nNextPageBreak - 1)); +} } if (!bVisRow)
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/extras/scpdfexport.cxx| 19 sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods |binary sc/source/ui/view/printfun.cxx |6 +++-- 3 files changed, 23 insertions(+), 2 deletions(-) New commits: commit 8b2a2de2481843502f0566e773ed11532520bc70 Author: Attila Szűcs AuthorDate: Thu Jul 15 15:50:09 2021 +0200 Commit: László Németh CommitDate: Fri Jul 30 16:30:52 2021 +0200 tdf#64703 sc: fix regression of printing page breaks After hidden rows or rows hidden by Autofilter, printing removed the page breaks between the visible rows, too. Now Calc supports WYSWYG: it prints all the visible page breaks, which includes the page breaks between the visible rows, and page breaks between the hidden rows (multiple page breaks of a hidden row sequence converted to a single page break). This was a regression since LO 3.6, introducing Autofilter with multichoice. Co-authored-by: Tibor Nagy (NISZ) Change-Id: I87858d36fc62b8a5952cfd5bc39dbe90f1452ac0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118984 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sc/qa/extras/scpdfexport.cxx b/sc/qa/extras/scpdfexport.cxx index 6dfa426fddc0..825c4e248403 100644 --- a/sc/qa/extras/scpdfexport.cxx +++ b/sc/qa/extras/scpdfexport.cxx @@ -65,11 +65,13 @@ public: void testExportRange_Tdf120161(); void testExportFitToPage_Tdf103516(); void testUnoCommands_Tdf120161(); +void testTdf64703_hiddenPageBreak(); CPPUNIT_TEST_SUITE(ScPDFExportTest); CPPUNIT_TEST(testExportRange_Tdf120161); CPPUNIT_TEST(testExportFitToPage_Tdf103516); CPPUNIT_TEST(testUnoCommands_Tdf120161); +CPPUNIT_TEST(testTdf64703_hiddenPageBreak); CPPUNIT_TEST_SUITE_END(); }; @@ -437,6 +439,23 @@ void ScPDFExportTest::testUnoCommands_Tdf120161() } } +void ScPDFExportTest::testTdf64703_hiddenPageBreak() +{ +mxComponent = loadFromDesktop(m_directories.getURLFromSrc(DATA_DIRECTORY) + + "tdf64703_hiddenPageBreak.ods", + "com.sun.star.sheet.SpreadsheetDocument"); +uno::Reference xModel(mxComponent, uno::UNO_QUERY); + +// A1:A11: 4-page export +{ +ScRange range1(0, 0, 0, 0, 10, 0); +std::shared_ptr pPDFFile = exportToPDF(xModel, range1); +bool bFound = false; +CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "/Count 4>>", bFound)); +CPPUNIT_ASSERT_EQUAL(true, bFound); +} +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScPDFExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods b/sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods new file mode 100644 index ..87f110915d69 Binary files /dev/null and b/sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods differ diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index e02e4badcab6..0fc79a76b397 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -3197,8 +3197,10 @@ void PrintPageRanges::calculate(ScDocument& rDoc, nLastVisibleRow = nLastRow; } else -// skip all hidden rows. -nRow = nLastRow; +{ +// Skip all hidden rows until next pagebreak. +nRow = std::min(nLastRow, nNextPageBreak - 1); +} } if (!bVisRow)
[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf142693_hugePaperSizeImport.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport13.cxx |7 +++ writerfilter/source/dmapper/ConversionHelper.cxx |5 + writerfilter/source/dmapper/ConversionHelper.hxx |1 + writerfilter/source/dmapper/DomainMapper.cxx |4 ++-- 5 files changed, 15 insertions(+), 2 deletions(-) New commits: commit 446771fe3e91eb7d154e86b9c6a614374110e9ca Author: Attila Szűcs AuthorDate: Wed Jul 14 16:24:01 2021 +0200 Commit: László Németh CommitDate: Tue Jul 27 10:32:10 2021 +0200 tdf#142693 DOCX import: fix zeroing huge page sizes which bigger than 2^15 twips (> ~57.8 cm). Regression from commit 4d1621136c464b462a598571ecdcfe2ae119d8c7 "Fix ignoring large twips values like MSO does (cp#187)". Note: Writer could export page size up to 600 cm × 600 cm, and now it can import it back as well. It can even import page sizes in kilometers, and display that, but there will be other issues about its display. MS Word couldn't save page size over 2^15, but can import, and display them till up to 2^16 (that is about 116 cm). Co-authored-by: Tibor Nagy (NISZ) Change-Id: Icc1bd708d53036768a7be94cb1ebe18c1c4c8487 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118940 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit d5d9795968771651c57c661d95b6992c3c778eca) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119441 Tested-by: Jenkins diff --git a/sw/qa/extras/ooxmlexport/data/tdf142693_hugePaperSizeImport.docx b/sw/qa/extras/ooxmlexport/data/tdf142693_hugePaperSizeImport.docx new file mode 100644 index ..6ec35a7684d7 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf142693_hugePaperSizeImport.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 0c7c1984f421..3e7b38f8df75 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -1226,6 +1226,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127741, "tdf127741.docx") CPPUNIT_ASSERT(visitedStyleName.equalsIgnoreAsciiCase("Visited Internet Link")); } +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf142693_hugePaperSizeImport, "tdf142693_hugePaperSizeImport.docx") +{ +xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); +assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "w", "90369"); +assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "h", "104372"); +} + DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127925, "tdf127925.odt") { CPPUNIT_ASSERT_EQUAL(1, getPages()); diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx index 12cac7c8f1b3..cf41150ea548 100644 --- a/writerfilter/source/dmapper/ConversionHelper.cxx +++ b/writerfilter/source/dmapper/ConversionHelper.cxx @@ -423,6 +423,11 @@ sal_Int32 convertTwipToMM100(sal_Int32 _t) return ::convertTwipToMm100( _t ); } +sal_Int32 convertTwipToMM100WithoutLimit(sal_Int32 _t) +{ +return ::convertTwipToMm100(_t); +} + double convertTwipToMM100Double(sal_Int32 _t) { // It appears that MSO handles large twip values specially, probably legacy 16bit handling, diff --git a/writerfilter/source/dmapper/ConversionHelper.hxx b/writerfilter/source/dmapper/ConversionHelper.hxx index 72c0efe0d540..619c93c9b8af 100644 --- a/writerfilter/source/dmapper/ConversionHelper.hxx +++ b/writerfilter/source/dmapper/ConversionHelper.hxx @@ -46,6 +46,7 @@ namespace writerfilter::dmapper::ConversionHelper{ OUString ConvertMSFormatStringToSO(const OUString& rFormat, css::lang::Locale& rLocale, bool bHijri); // export just for test SAL_DLLPUBLIC_EXPORT sal_Int32 convertTwipToMM100(sal_Int32 _t); +SAL_DLLPUBLIC_EXPORT sal_Int32 convertTwipToMM100WithoutLimit(sal_Int32 _t); SAL_DLLPUBLIC_EXPORT double convertTwipToMM100Double(sal_Int32 _t); SAL_DLLPUBLIC_EXPORT sal_uInt32 convertTwipToMM100Unsigned(sal_Int32 _t); sal_Int16 convertTableJustification( sal_Int32 nIntValue ); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 232650c7f8ea..3a78e3db5a66 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -625,7 +625,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) break; case NS_ooxml::LN_CT_PageSz_h: { -sal_Int32 nHeight = ConversionHelper::convertTwipToMM100(nIntValue); +sal_Int32 nHeight = ConversionHelper::convertTwipToMM100WithoutLimit(nIntValue); CT_PageSz.h = PaperInfo::sloppyFitPageDimension(nHeight); } break; @@ -634,7 +634,7 @@ void
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/tdf142693_hugePaperSizeImport.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport13.cxx |7 +++ writerfilter/source/dmapper/ConversionHelper.cxx |5 + writerfilter/source/dmapper/ConversionHelper.hxx |1 + writerfilter/source/dmapper/DomainMapper.cxx |4 ++-- 5 files changed, 15 insertions(+), 2 deletions(-) New commits: commit d5d9795968771651c57c661d95b6992c3c778eca Author: Attila Szűcs AuthorDate: Wed Jul 14 16:24:01 2021 +0200 Commit: László Németh CommitDate: Mon Jul 26 17:05:38 2021 +0200 tdf#142693 DOCX import: fix zeroing huge page sizes which bigger than 2^15 twips (> ~57.8 cm). Regression from commit 4d1621136c464b462a598571ecdcfe2ae119d8c7 "Fix ignoring large twips values like MSO does (cp#187)". Note: Writer could export page size up to 600 cm × 600 cm, and now it can import it back as well. It can even import page sizes in kilometers, and display that, but there will be other issues about its display. MS Word couldn't save page size over 2^15, but can import, and display them till up to 2^16 (that is about 116 cm). Co-authored-by: Tibor Nagy (NISZ) Change-Id: Icc1bd708d53036768a7be94cb1ebe18c1c4c8487 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118940 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sw/qa/extras/ooxmlexport/data/tdf142693_hugePaperSizeImport.docx b/sw/qa/extras/ooxmlexport/data/tdf142693_hugePaperSizeImport.docx new file mode 100644 index ..6ec35a7684d7 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf142693_hugePaperSizeImport.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 0c7c1984f421..3e7b38f8df75 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -1226,6 +1226,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf127741, "tdf127741.docx") CPPUNIT_ASSERT(visitedStyleName.equalsIgnoreAsciiCase("Visited Internet Link")); } +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf142693_hugePaperSizeImport, "tdf142693_hugePaperSizeImport.docx") +{ +xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); +assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "w", "90369"); +assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgSz", "h", "104372"); +} + DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf127925, "tdf127925.odt") { CPPUNIT_ASSERT_EQUAL(1, getPages()); diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx index c5b1d3e5d027..6cb238b5a21f 100644 --- a/writerfilter/source/dmapper/ConversionHelper.cxx +++ b/writerfilter/source/dmapper/ConversionHelper.cxx @@ -423,6 +423,11 @@ sal_Int32 convertTwipToMM100(sal_Int32 _t) return ::convertTwipToMm100( _t ); } +sal_Int32 convertTwipToMM100WithoutLimit(sal_Int32 _t) +{ +return ::convertTwipToMm100(_t); +} + double convertTwipToMM100Double(sal_Int32 _t) { // It appears that MSO handles large twip values specially, probably legacy 16bit handling, diff --git a/writerfilter/source/dmapper/ConversionHelper.hxx b/writerfilter/source/dmapper/ConversionHelper.hxx index 72c0efe0d540..619c93c9b8af 100644 --- a/writerfilter/source/dmapper/ConversionHelper.hxx +++ b/writerfilter/source/dmapper/ConversionHelper.hxx @@ -46,6 +46,7 @@ namespace writerfilter::dmapper::ConversionHelper{ OUString ConvertMSFormatStringToSO(const OUString& rFormat, css::lang::Locale& rLocale, bool bHijri); // export just for test SAL_DLLPUBLIC_EXPORT sal_Int32 convertTwipToMM100(sal_Int32 _t); +SAL_DLLPUBLIC_EXPORT sal_Int32 convertTwipToMM100WithoutLimit(sal_Int32 _t); SAL_DLLPUBLIC_EXPORT double convertTwipToMM100Double(sal_Int32 _t); SAL_DLLPUBLIC_EXPORT sal_uInt32 convertTwipToMM100Unsigned(sal_Int32 _t); sal_Int16 convertTableJustification( sal_Int32 nIntValue ); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 7a9ac75306ff..52a4c9d5aae0 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -625,7 +625,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) break; case NS_ooxml::LN_CT_PageSz_h: { -sal_Int32 nHeight = ConversionHelper::convertTwipToMM100(nIntValue); +sal_Int32 nHeight = ConversionHelper::convertTwipToMM100WithoutLimit(nIntValue); CT_PageSz.h = PaperInfo::sloppyFitPageDimension(nHeight); } break; @@ -634,7 +634,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) break; case NS_ooxml::LN_CT_PageSz_w: { -sal_Int32 nWidth =
[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/qa sc/source
sc/qa/uitest/calc_tests9/tdf126541_GridVisibilityImportXlsx.py | 30 ++ sc/qa/uitest/data/tdf126541_GridOff.xlsx |binary sc/qa/uitest/data/tdf126541_GridOffGlobally.ods|binary sc/qa/unit/subsequent_export-test2.cxx | 14 ++-- sc/source/filter/oox/viewsettings.cxx | 18 +- 5 files changed, 55 insertions(+), 7 deletions(-) New commits: commit c3dd27d24dec0c581ed731acf8ff3504a4068b03 Author: Attila Szűcs AuthorDate: Thu Jul 8 08:45:00 2021 +0200 Commit: Xisco Fauli CommitDate: Wed Jul 21 23:50:46 2021 +0200 tdf#142854 XLSX import: fix grid visibility in headless mode Fix regression from commit 759103fd65f82fc131679eba0de05f2ddc7294c8 (tdf#126541 XLSX import: fix View grid lines). Sheet based grid visibility shouldn't overwrite the global grid visibility, except for headless mode (i.e. for command line batch mode, see --convert-to in ./soffice --help, otherwise we could get a regression here: The sheet based grid visibility (bShowGrid) is stored in view settings. Headless mode means not to export view setting, including sheet based grid visibility. As the old workaround, use global visibility to keep the losing sheet visibility. FIXME: headless mode only works correctly if all sheets have the same grid visibility. The sheet based bShowGrid should be moved to another location, which is supported by the headless mode, too. Note: now the modified tdf#126541 unit test checks the fix for the regression of the headless mode, and the new Python UI test checks the (now improved) fix for tdf#126541 on the desktop. Co-authored-by: Tibor Nagy (NISZ) Change-Id: I93551d22cc5d858dc64f93a46cd8aa202b4b2df5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118599 Tested-by: László Németh Reviewed-by: László Németh Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119314 Tested-by: Jenkins diff --git a/sc/qa/uitest/calc_tests9/tdf126541_GridVisibilityImportXlsx.py b/sc/qa/uitest/calc_tests9/tdf126541_GridVisibilityImportXlsx.py new file mode 100644 index ..0e916ad38ea1 --- /dev/null +++ b/sc/qa/uitest/calc_tests9/tdf126541_GridVisibilityImportXlsx.py @@ -0,0 +1,30 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from uitest.framework import UITestCase +from uitest.uihelper.common import get_url_for_data_file + +class tdf126541(UITestCase): + +def test_tdf126541_GridVisibilityImportXlsx(self): +# Import an ods file with 'Hide' global grid visibility setting. + self.ui_test.load_file(get_url_for_data_file("tdf126541_GridOffGlobally.ods")) +document = self.ui_test.get_component() +controller = document.getCurrentController() +grid = controller.ShowGrid +self.assertEqual(grid, False) +self.ui_test.close_doc() + +# Importing xlsx file should set the global grid visibility setting to 'Show' +# Sheet based grid line visibility setting should not overwrite the global setting. +self.ui_test.load_file(get_url_for_data_file("tdf126541_GridOff.xlsx")) +document = self.ui_test.get_component() +controller = document.getCurrentController() +grid = controller.ShowGrid +self.assertEqual(grid, True) +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/data/tdf126541_GridOff.xlsx b/sc/qa/uitest/data/tdf126541_GridOff.xlsx new file mode 100644 index ..e27089b01603 Binary files /dev/null and b/sc/qa/uitest/data/tdf126541_GridOff.xlsx differ diff --git a/sc/qa/uitest/data/tdf126541_GridOffGlobally.ods b/sc/qa/uitest/data/tdf126541_GridOffGlobally.ods new file mode 100644 index ..389fe347d493 Binary files /dev/null and b/sc/qa/uitest/data/tdf126541_GridOffGlobally.ods differ diff --git a/sc/qa/unit/subsequent_export-test2.cxx b/sc/qa/unit/subsequent_export-test2.cxx index 2b1dda267fed..6cc0ece437d6 100644 --- a/sc/qa/unit/subsequent_export-test2.cxx +++ b/sc/qa/unit/subsequent_export-test2.cxx @@ -187,7 +187,7 @@ public: void testTdf84874(); void testTdf136721_paper_size(); void testTdf139258_rotated_image(); -void testTdf126541_SheetVisibilityImportXlsx(); +void testTdf142854_GridVisibilityImportXlsxInHeadlessMode(); void testTdf140431(); void testTdf142929_filterLessThanXLSX(); @@ -285,7 +285,7 @@ public: CPPUNIT_TEST(testTdf84874); CPPUNIT_TEST(testTdf136721_paper_size); CPPUNIT_TEST(testTdf139258_rotated_image); -
[Libreoffice-commits] core.git: sc/qa sc/source
sc/qa/uitest/calc_tests9/tdf126541_GridVisibilityImportXlsx.py | 26 ++ sc/qa/uitest/data/tdf126541_GridOff.xlsx |binary sc/qa/uitest/data/tdf126541_GridOffGlobally.ods|binary sc/qa/unit/subsequent_export-test2.cxx | 14 +++-- sc/source/filter/oox/viewsettings.cxx | 18 ++ 5 files changed, 51 insertions(+), 7 deletions(-) New commits: commit ad4e6f8c8f3d9d96586967f8e9a813bf29c3033a Author: Attila Szűcs AuthorDate: Thu Jul 8 08:45:00 2021 +0200 Commit: László Németh CommitDate: Wed Jul 21 11:35:53 2021 +0200 tdf#142854 XLSX import: fix grid visibility in headless mode Fix regression from commit 759103fd65f82fc131679eba0de05f2ddc7294c8 (tdf#126541 XLSX import: fix View grid lines). Sheet based grid visibility shouldn't overwrite the global grid visibility, except for headless mode (i.e. for command line batch mode, see --convert-to in ./soffice --help, otherwise we could get a regression here: The sheet based grid visibility (bShowGrid) is stored in view settings. Headless mode means not to export view setting, including sheet based grid visibility. As the old workaround, use global visibility to keep the losing sheet visibility. FIXME: headless mode only works correctly if all sheets have the same grid visibility. The sheet based bShowGrid should be moved to another location, which is supported by the headless mode, too. Note: now the modified tdf#126541 unit test checks the fix for the regression of the headless mode, and the new Python UI test checks the (now improved) fix for tdf#126541 on the desktop. Co-authored-by: Tibor Nagy (NISZ) Change-Id: I93551d22cc5d858dc64f93a46cd8aa202b4b2df5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118599 Tested-by: László Németh Reviewed-by: László Németh diff --git a/sc/qa/uitest/calc_tests9/tdf126541_GridVisibilityImportXlsx.py b/sc/qa/uitest/calc_tests9/tdf126541_GridVisibilityImportXlsx.py new file mode 100644 index ..a5acb2fbf39b --- /dev/null +++ b/sc/qa/uitest/calc_tests9/tdf126541_GridVisibilityImportXlsx.py @@ -0,0 +1,26 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from uitest.framework import UITestCase +from uitest.uihelper.common import get_url_for_data_file + +class tdf126541(UITestCase): + +def test_tdf126541_GridVisibilityImportXlsx(self): +# Import an ods file with 'Hide' global grid visibility setting. +with self.ui_test.load_file(get_url_for_data_file("tdf126541_GridOffGlobally.ods")) as document: +controller = document.getCurrentController() +grid = controller.ShowGrid +self.assertEqual(grid, False) + +# Importing xlsx file should set the global grid visibility setting to 'Show' +# Sheet based grid line visibility setting should not overwrite the global setting. +with self.ui_test.load_file(get_url_for_data_file("tdf126541_GridOff.xlsx")) as document: +controller = document.getCurrentController() +grid = controller.ShowGrid +self.assertEqual(grid, True) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/data/tdf126541_GridOff.xlsx b/sc/qa/uitest/data/tdf126541_GridOff.xlsx new file mode 100644 index ..e27089b01603 Binary files /dev/null and b/sc/qa/uitest/data/tdf126541_GridOff.xlsx differ diff --git a/sc/qa/uitest/data/tdf126541_GridOffGlobally.ods b/sc/qa/uitest/data/tdf126541_GridOffGlobally.ods new file mode 100644 index ..389fe347d493 Binary files /dev/null and b/sc/qa/uitest/data/tdf126541_GridOffGlobally.ods differ diff --git a/sc/qa/unit/subsequent_export-test2.cxx b/sc/qa/unit/subsequent_export-test2.cxx index 4eab1c9bf1e9..030e4a4ae7df 100644 --- a/sc/qa/unit/subsequent_export-test2.cxx +++ b/sc/qa/unit/subsequent_export-test2.cxx @@ -188,7 +188,7 @@ public: void testTdf84874(); void testTdf136721_paper_size(); void testTdf139258_rotated_image(); -void testTdf126541_SheetVisibilityImportXlsx(); +void testTdf142854_GridVisibilityImportXlsxInHeadlessMode(); void testTdf140431(); void testCheckboxFormControlXlsxExport(); void testButtonFormControlXlsxExport(); @@ -290,7 +290,7 @@ public: CPPUNIT_TEST(testTdf84874); CPPUNIT_TEST(testTdf136721_paper_size); CPPUNIT_TEST(testTdf139258_rotated_image); -CPPUNIT_TEST(testTdf126541_SheetVisibilityImportXlsx); +CPPUNIT_TEST(testTdf142854_GridVisibilityImportXlsxInHeadlessMode); CPPUNIT_TEST(testTdf140431); CPPUNIT_TEST(testCheckboxFormControlXlsxExport);