cui/source/dialogs/sdrcelldlg.cxx | 7 ++++++- cui/source/inc/border.hxx | 1 + cui/source/inc/sdrcelldlg.hxx | 1 + cui/source/tabpages/border.cxx | 5 ++++- editeng/source/editeng/impedit2.cxx | 6 ++++-- editeng/source/editeng/impedit3.cxx | 7 +++++++ svx/source/table/tablecontroller.cxx | 2 +- 7 files changed, 24 insertions(+), 5 deletions(-)
New commits: commit 339e5d44a2afa0f5309a970f1ff11968103e336a Author: Matúš Kukan <matus.ku...@collabora.com> Date: Wed Jun 11 16:59:59 2014 +0200 bnc#882631: keep line visible if proportional line spacing is < 100%. If line height is smaller than text height, we still want to see whole first line, so add the difference where necessary. This also helps to see paragraphs as separate to each other. Change-Id: I51a87edf0cc03d5b5e130290c90347099a581d4e (cherry picked from commit e42c05c1f96832572e525d85d89590f56f5a29dd) Signed-off-by: Andras Timar <andras.ti...@collabora.com> diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 764d4fa..9e9790b 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -4032,7 +4032,9 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) { OSL_ENSURE( pPortion->GetLines().Count(), "Paragraph with no lines in ParaPortion::CalcHeight" ); for (sal_Int32 nLine = 0; nLine < pPortion->GetLines().Count(); ++nLine) - pPortion->nHeight += pPortion->GetLines()[nLine]->GetHeight(); + // Use GetTxtHeight() for first line, otherwise height is small + // if the paragraph has proportional line spacing less than 100%. + pPortion->nHeight += nLine ? pPortion->GetLines()[nLine]->GetHeight() : pPortion->GetLines()[nLine]->GetTxtHeight(); if ( !aStatus.IsOutliner() ) { @@ -4175,7 +4177,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex, Rectangle aEditCursor; aEditCursor.Top() = nY; - nY += pLine->GetHeight(); + nY += pLine->GetTxtHeight(); aEditCursor.Bottom() = nY-1; // Search within the line... diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 2881a81..7678ef1 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -2924,6 +2924,13 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt aTmpPos.X() += pLine->GetStartPosX(); aTmpPos.Y() += pLine->GetMaxAscent(); aStartPos.Y() += pLine->GetHeight(); + if (nLine == 0) + { + // First line needs to be visible, so add more space if text height is bigger. + const sal_Int32 nDiff = pLine->GetTxtHeight() - pLine->GetHeight(); + aTmpPos.Y() += nDiff; + aStartPos.Y() += nDiff; + } if (nLine != nLastLine) aStartPos.Y() += nVertLineSpacing; } commit 440e2031ce8cffc8dc573e359a330236f9c11dfb Author: Matúš Kukan <matus.ku...@collabora.com> Date: Tue Jun 3 14:11:39 2014 +0200 bnc#882627: Allow to edit spacing to contents even with no borders visible. SfxItemSet::MergeValue changes some items from SFX_ITEM_DEFAULT state to SFX_ITEM_SET which I think is a bug but this patch avoids the problem too. The issue was: visible changes in some tables, after changing e.g. borders spacing, because the cells had wrong SfxItemSet after the process. Change-Id: I676b211e1a4a1d7341c385d63503aa740718ed5d (cherry picked from commit b1d8df61b47e84bf0de64342556049673dd9c543) Signed-off-by: Andras Timar <andras.ti...@collabora.com> diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx index 79f9249..400e9a8 100644 --- a/cui/source/dialogs/sdrcelldlg.cxx +++ b/cui/source/dialogs/sdrcelldlg.cxx @@ -38,7 +38,7 @@ SvxFormatCellsDialog::SvxFormatCellsDialog( Window* pParent, const SfxItemSet* p { AddTabPage("name", RID_SVXPAGE_CHAR_NAME); AddTabPage("effects", RID_SVXPAGE_CHAR_EFFECTS); - AddTabPage("border", RID_SVXPAGE_BORDER ); + m_nBorderPageId = AddTabPage("border", RID_SVXPAGE_BORDER ); m_nAreaPageId = AddTabPage("area", RID_SVXPAGE_AREA); } @@ -57,6 +57,11 @@ void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) rAreaPage.Construct(); rAreaPage.ActivatePage( mrOutAttrs ); } + else if (nId == m_nBorderPageId) + { + SvxBorderTabPage& rBorderPage = ((SvxBorderTabPage&)rPage); + rBorderPage.SetTableMode(); + } else SfxTabDialog::PageCreated( nId, rPage ); } diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx index a8eb384..eec484f 100644 --- a/cui/source/inc/border.hxx +++ b/cui/source/inc/border.hxx @@ -52,6 +52,7 @@ public: void HideShadowControls(); virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE; + void SetTableMode(); protected: virtual int DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE; virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; diff --git a/cui/source/inc/sdrcelldlg.hxx b/cui/source/inc/sdrcelldlg.hxx index 9aafbab..bcae0d8 100644 --- a/cui/source/inc/sdrcelldlg.hxx +++ b/cui/source/inc/sdrcelldlg.hxx @@ -36,6 +36,7 @@ private: XBitmapListRef mpBitmapList; sal_uInt16 m_nAreaPageId; + sal_uInt16 m_nBorderPageId; protected: virtual void Apply(); diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index 476b7b3..6e9e778 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -1219,6 +1219,9 @@ void SvxBorderTabPage::PageCreated(const SfxAllItemSet& aSet) HideShadowControls(); } - +void SvxBorderTabPage::SetTableMode() +{ + nSWMode = SW_BORDER_MODE_TABLE; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 69fb4e3..86c4f95 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -738,7 +738,7 @@ void SvxTableController::onFormatTable( SfxRequest& rReq ) SvxBoxInfoItem aBoxInfoItem( static_cast< const SvxBoxInfoItem& >( aNewAttr.Get( SDRATTR_TABLE_BORDER_INNER ) ) ); - MergeAttrFromSelectedCells(aNewAttr, false); + MergeAttrFromSelectedCells(aNewAttr, true); FillCommonBorderAttrFromSelectedCells( aBoxItem, aBoxInfoItem ); aNewAttr.Put( aBoxItem ); aNewAttr.Put( aBoxInfoItem );
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits