Bugzilla – Attachment 187330 Details for
Bug 154005
FILEOPEN ODS Dropdown form control becomes wider
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch intended for LO 7.5
0001-tdf-154005-Treat-resize-with-cell-plus-protect-as-To.patch (text/plain), 5.25 KB, created by
Regina Henschel
on 2023-05-16 13:08:32 UTC
(
hide
)
Description:
Patch intended for LO 7.5
Filename:
MIME Type:
Creator:
Regina Henschel
Created:
2023-05-16 13:08:32 UTC
Size:
5.25 KB
patch
obsolete
>From 6fb447c4c09b72bb21a7e7433f944a3571a0017c Mon Sep 17 00:00:00 2001 >From: Regina Henschel <rb.henschel@t-online.de> >Date: Tue, 16 May 2023 14:45:07 +0200 >Subject: [PATCH] tdf#154005 Treat 'resize with cell' plus protect as 'To Cell' > >The current fix only affects controls and does not solve the general >problem. This patch replaces it with a more general solution. See the >bug report for discussion the problem. > >Change-Id: I9313d5f03301247dd45cff751c7bbd336c477de0 >--- > sc/source/core/data/drwlayer.cxx | 21 ++++++++++----------- > sc/source/filter/xml/xmlexprt.cxx | 8 ++++++-- > 2 files changed, 16 insertions(+), 13 deletions(-) > >diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx >index 134c7258ed4a..22c7a6520218 100644 >--- a/sc/source/core/data/drwlayer.cxx >+++ b/sc/source/core/data/drwlayer.cxx >@@ -776,15 +776,6 @@ void lcl_SetLogicRectFromAnchor(SdrObject* pObj, const ScDrawObjData& rAnchor, c > if (!pObj || !pDoc || !rAnchor.maEnd.IsValid() || !rAnchor.maStart.IsValid()) > return; > >- SCROW nHiddenRows = 0; >- SCCOL nHiddenCols = 0; >- // tdf#154005: Handle hidden row/col: remove hidden row/cols size from the ScDrawObjData shape size in case of forms >- if (pObj->GetObjIdentifier() == SdrObjKind::UNO && pObj->GetObjInventor() == SdrInventor::FmForm) >- { >- nHiddenRows = pDoc->CountHiddenRows(rAnchor.maStart.Row(), rAnchor.maEnd.Row(), rAnchor.maStart.Tab()); >- nHiddenCols = pDoc->CountHiddenCols(rAnchor.maStart.Col(), rAnchor.maEnd.Col(), rAnchor.maStart.Tab()); >- } >- > // In case of a vertical mirrored custom shape, LibreOffice uses internally an additional 180deg > // in aGeo.nRotationAngle and in turn has a different logic rectangle position. We remove flip, > // set the logic rectangle, and apply flip again. You cannot simple use a 180deg-rotated >@@ -808,8 +799,8 @@ void lcl_SetLogicRectFromAnchor(SdrObject* pObj, const ScDrawObjData& rAnchor, c > aStartPoint.AdjustY(rAnchor.maStartOffset.getY()); > > const tools::Rectangle aEndCellRect( >- pDoc->GetMMRect(rAnchor.maEnd.Col() - nHiddenCols, rAnchor.maEnd.Row() - nHiddenRows, rAnchor.maEnd.Col() - nHiddenCols, >- rAnchor.maEnd.Row() - nHiddenRows, rAnchor.maEnd.Tab(), false /*bHiddenAsZero*/)); >+ pDoc->GetMMRect(rAnchor.maEnd.Col(), rAnchor.maEnd.Row(), rAnchor.maEnd.Col(), >+ rAnchor.maEnd.Row(), rAnchor.maEnd.Tab(), false /*bHiddenAsZero*/)); > Point aEndPoint(aEndCellRect.Left(), aEndCellRect.Top()); > aEndPoint.AdjustX(rAnchor.maEndOffset.getX()); > aEndPoint.AdjustY(rAnchor.maEndOffset.getY()); >@@ -1057,6 +1048,14 @@ void ScDrawLayer::InitializeCellAnchoredObj(SdrObject* pObj, ScDrawObjData& rDat > GetCellAnchorFromPosition(aObjRect, rNoRotatedAnchor, *pDoc, rData.maStart.Tab(), > false /*bHiddenAsZero*/); > } >+ else if (pObj->IsResizeProtect()) >+ { >+ // tdf#154005: This is a workaround for documents created with LO 6 and older. >+ rNoRotatedAnchor.mbResizeWithCell = false; >+ rData.mbResizeWithCell = false; >+ UpdateCellAnchorFromPositionEnd(*pObj, rNoRotatedAnchor, *pDoc, nTab1, >+ true /*bUseLogicRect*/); >+ } > else > { > // In case there are hidden rows or cols, versions 7.0 and earlier have written width and >diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx >index a552de5f0ddf..2553577e6f87 100644 >--- a/sc/source/filter/xml/xmlexprt.cxx >+++ b/sc/source/filter/xml/xmlexprt.cxx >@@ -3526,7 +3526,9 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell) > // tdf#137033 In case the shape is anchored "To Cell (resize with cell)" hiding rows or > // columns inside the snap rect has not only changed size of the shape but rotate and shear > // angle too. We resize the shape to full size. That will recover the original angles too. >- if (rShape.bResizeWithCell && pObjData) // implies pObj & aSnapStartAddress = pObjData->maStart >+ // tdf#154005: We treat the combination of "To cell (resize with cell)" with 'size protected' >+ // as being "To cell". >+ if (rShape.bResizeWithCell && pObjData && !pObj->IsResizeProtect()) // implies pObj & aSnapStartAddress = pObjData->maStart > { > // Get original size from anchor > const Point aSnapStartOffset = pObjData->maStartOffset; >@@ -3567,8 +3569,10 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell) > } > > // We only write the end address if we want the shape to resize with the cell >+ // tdf#154005: We treat the combination of "To Cell (resize with cell)" anchor with 'size >+ // protected' property as being "To cell" anchor. > if ( rShape.bResizeWithCell && >- rShape.xShape->getShapeType() != "com.sun.star.drawing.CaptionShape" ) >+ rShape.xShape->getShapeType() != "com.sun.star.drawing.CaptionShape" && !pObj->IsResizeProtect()) > { > OUString sEndAddress; > ScRangeStringConverter::GetStringFromAddress(sEndAddress, rShape.aEndAddress, pDoc, FormulaGrammar::CONV_OOO); >-- >2.21.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 154005
:
185784
|
185785
|
185786
|
185788
|
187214
| 187330 |
187461
|
187462
|
187463
|
187464