summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2018-01-18 17:07:43 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-01-30 12:57:49 +0100
commitf839ea98181a1c6970fe25a82cf798dc151ed332 (patch)
tree6b52b5bb035b55fc9ec377b675c00163708bdac3 /sc/source/ui
parent9e7344ae5776117e94684713767fae1b0afbb6b9 (diff)
fix tdf#114934 borderline feature regressions
squashing some master commits, fixes the following bugs: - tdf#114934 which contains: - tdf#115169: Calc: Rotated Cells not shown rotated when using Print/PDF/PrintPreview - tdf#113751: Borders for Merged Cells are Partially Shown - tdf#114625: Calc can not print right border of merged cells from LO 6.0 - tdf#114824: Export to PDF and Printing: Borders of Merged Cells Flow to Page Footer BorderlineFix: Need to redesign Borderline paint for Calc To fix some errors, need to change svx::frame::Array conversion to Primitives, especially regarding handling of merged cells. These make problems in the currtent form where the full extended merged cell tries to be converted. This is bad for cropped stuff and also wrong for double-line stuff attaching to a merged cell. The solution is to handle cells single and merge created primitives which is more expensive but will work. This will involve special handling for X-Ed (crossed) and 'roated' Cells. Also need to be very careful since all this is used in the meantime for all visualizations of Tables in multiple apps/situations. Change-Id: If0652a3ba97a6f27dd5d782ea22b1514303f3710 BorderlineFix: Corrected missing borders in print In Print/PDF/PrintPreview border lines were missing, this happened for merged cells. It has to do with access to the involved Styles and/or 'Clip' set (to avoid creating everything). Thus a 'mixed' usage of cell and merged-cell stuff was needed. As it turns out support for this is already there, need to use it. Change-Id: Ic16085b97eef5c79a4501279432f43491bca350e BorderlineFix: Avoid BorderLines to be too prolonged For MergedCells there was an effect that the BorderLines were painted too far in PrintPreview/Print/PDF visualization, found reason and changed. Checked (hopefully) all usages, looks good. Change-Id: I0acf8dcb20548a98533f3ab317ac72c0d0f0a947 BorderlineFix: Corrected handling for 'rotated' CellBorders CellBorders can be rotated (including their Text) and need special visualization that is based on an own sheared/rotated coordinate system. Currently only possible for single cells (not merged ones) and needs to handle all borders (also bottom-right directly in the rotated cell, not in the neighboured ones to have the geometry, plus avoiding these in the non-rotated neighbour cells. Also corrected adding CellRotation data to svx::frame::Array in calc using SetCellRotations() which now gets called in the ScOutputData constructor to ensure it gets called in all places where it is used. Change-Id: I47bdfc29ba5ca76bbc07d98cb64733f867b1ee20 BorderlineFix: Fixed visual updates when scrolling For Cells with DoubleLine the connections to perpendicular DoubleLine-Styles may have to be displayed in a Cell which is 'around' the orig cell in a Cell-Border of one. To represent that and to avoid repaint errors when scrolling in, the preparation of Primitives has to take accordingly more neighbour cells into account. Tested this change with the usages in Calc, UI (Dialogs) and Calc exports Print/PrintPreview/PDF. This does not affect Tables in Writer and/or Draw/Impress. Change-Id: I3bcc68cdf7b4fc1825a87a9773892c359421024e BorderlineFix: Fix WriterPaint if scrolling CellTableBorders Similar to CalcBorders in Writer the overlap regions for FrameBorders have to be taken into account when repainting the CellBordes of WriterTables Change-Id: I488ba158e1de579bfb06b9c8353adaa2cac706c6 BorderlineFix: Corrected Draw/Impress TableStyle accesses In Draw/Impress the indices for accessing the correct neighbouring TableStyles were wrong and thus created wrong visualizations, corrected that. Change-Id: Iebc5f294adb62fa4c6358e2f8c27d29cc3163fbc BorderlineFix: Use svx::frame::Array tooling in Draw/Impress For creating the needed BorderPrimitives for TableCells for the Tables used in Draw/Impress, adapt the ViewContactOfTableObj doing this to use svx::frame::Array tooling now. This will correct the error for not taking the neighboured connects for merged cells into account and unify one more space to the same tooling. Change-Id: I2e6f732985e9b963359f156628bd29ddfec1a80c BorderlineFix: Corrected wrong indexing in Array initialization Change-Id: I4222ef1c82620a05cea9f6db1a0664196cfb3bd4 Reviewed-on: https://gerrit.libreoffice.org/48891 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/inc/output.hxx7
-rw-r--r--sc/source/ui/miscdlgs/autofmt.cxx4
-rw-r--r--sc/source/ui/view/gridwin4.cxx4
-rw-r--r--sc/source/ui/view/output.cxx3
4 files changed, 10 insertions, 8 deletions
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index 2237b7daa560..8165bfda86d0 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -252,6 +252,11 @@ private:
bool AdjustAreaParamClipRect(OutputAreaParam& rAreaParam);
+ // Check for and set cell rotations at OutputData to have it available
+ // in the svx tooling to render the borders. Moved to private section
+ // and the single call to end of constructor to be sure this always happens
+ void SetCellRotations();
+
public:
/**
* @param nNewScrX: X-Offset in the output device for the table
@@ -308,8 +313,6 @@ public:
// with logic MapMode set!
void DrawEdit(bool bPixelToLogic);
-
- void SetCellRotations();
void DrawRotated(bool bPixelToLogic); // logical
void DrawClear();
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index e5276b3f8803..399edd9b25b6 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -250,7 +250,7 @@ void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCo
Size aStrSize;
sal_uInt16 nFmtIndex = GetFormatIndex( nCol, nRow );
- const basegfx::B2DRange cellRange(maArray.GetCellRange( nCol, nRow ));
+ const basegfx::B2DRange cellRange(maArray.GetCellRange( nCol, nRow, true ));
Point aPos = Point(basegfx::fround(cellRange.getMinX()), basegfx::fround(cellRange.getMinY()));
sal_uInt16 nRightX = 0;
bool bJustify = pCurData->GetIncludeJustify();
@@ -374,7 +374,7 @@ void ScAutoFmtPreview::DrawBackground(vcl::RenderContext& rRenderContext)
rRenderContext.SetLineColor();
rRenderContext.SetFillColor( pItem->GetColor() );
- const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow ));
+ const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow, true ));
rRenderContext.DrawRect(
tools::Rectangle(
basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()),
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 9387c1e6d79c..92b0eee6cc96 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -696,10 +696,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
pContentDev->SetMapMode(aCurrentMapMode);
}
- // check for and set cell rotations at OutputData to have it available
- // in the svx tooling to render the borders
- aOutputData.SetCellRotations();
-
if ( rDoc.HasBackgroundDraw( nTab, aDrawingRectLogic ) )
{
pContentDev->SetMapMode(MapMode(MapUnit::MapPixel));
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 6cfa4c2861b1..6e0fa1a77e5c 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -214,6 +214,9 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType,
bTabProtected = mpDoc->IsTabProtected( nTab );
bLayoutRTL = mpDoc->IsLayoutRTL( nTab );
+
+ // always needed, so call at the end of the constructor
+ SetCellRotations();
}
ScOutputData::~ScOutputData()