[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sc/source
sc/source/filter/excel/xichart.cxx | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) New commits: commit 0c78ff5de2ac1e10e68876ef586c0f2d9d5d626a Author: Kohei Yoshida kohei.yosh...@suse.com Date: Fri Feb 24 20:42:09 2012 + fdo#40320: Insert only a placeholder since the caller relies on this behavior. Signed-off-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 7d5f7d9..e83b8d8 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -2135,8 +2135,9 @@ XclImpChTextRef* XclImpChSeries::GetDataLabelRef( sal_uInt16 nPointIdx ) XclImpChTextMap::iterator itr = maLabels.lower_bound(nPointIdx); if (itr == maLabels.end() || maLabels.key_comp()(nPointIdx, itr-first)) { -// No object exists at this point index position. Insert a new one. -XclImpChTextRef p(new XclImpChText(GetChRoot())); +// No object exists at this point index position. Insert a new +// placeholder. +XclImpChTextRef p; itr = maLabels.insert(itr, XclImpChTextMap::value_type(nPointIdx, p)); } return itr-second; commit 1f2cf45c6f423c3ad1e12307e8f02a5014a3b913 Author: Kohei Yoshida kohei.yosh...@suse.com Date: Fri Feb 24 19:44:43 2012 + fdo#40320: Correctly import data point formats in data series. Signed-off-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 8cf884d..7d5f7d9 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -2118,8 +2118,9 @@ XclImpChDataFormatRef* XclImpChSeries::GetDataFormatRef( sal_uInt16 nPointIdx ) XclImpChDataFormatMap::iterator itr = maPointFmts.lower_bound(nPointIdx); if (itr == maPointFmts.end() || maPointFmts.key_comp()(nPointIdx, itr-first)) { -// No object exists at this point index position. Insert a new one. -XclImpChDataFormatRef p(new XclImpChDataFormat(GetChRoot())); +// No object exists at this point index position. Insert a new +// placeholder. +XclImpChDataFormatRef p; itr = maPointFmts.insert(itr, XclImpChDataFormatMap::value_type(nPointIdx, p)); } return itr-second; ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sc/source
sc/source/filter/xml/xmlstyli.cxx |5 +++-- sc/source/ui/unoobj/cellsuno.cxx |4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) New commits: commit 6e891a42560c6811e490fc68c90b8477e71d281a Author: Eike Rathke er...@redhat.com Date: Thu Jan 26 14:03:13 2012 +0100 resolved fdo#38595 border width lost in ODF import diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index b22bbf4..c20f6e9 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -170,12 +170,14 @@ void ScXMLCellImportPropertyMapper::finished(::std::vector XMLPropertyState pBorders[i]-maValue = aBorderLine; if( pBorderWidths[i] ) { +// Merge style:border-line-width values to fo:border values. Do +// not override fo:border line width or line style with an +// empty value! table::BorderLine2 aBorderLineWidth; pBorderWidths[i]-maValue = aBorderLineWidth; aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth; aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth; aBorderLine.LineDistance = aBorderLineWidth.LineDistance; -aBorderLine.LineWidth = aBorderLineWidth.LineWidth; pBorders[i]-maValue = aBorderLine; } } @@ -194,7 +196,6 @@ void ScXMLCellImportPropertyMapper::finished(::std::vector XMLPropertyState aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth; aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth; aBorderLine.LineDistance = aBorderLineWidth.LineDistance; -aBorderLine.LineWidth = aBorderLineWidth.LineWidth; pDiagBorders[i]-maValue = aBorderLine; if (pDiagBorderWidths[i]) pDiagBorderWidths[i]-mnIndex = -1; commit b1718b9dd74e13cd0f7aeccdb1187729c68687f3 Author: Eike Rathke er...@redhat.com Date: Thu Jan 26 14:03:12 2012 +0100 cast from BorderLine to BorderLine2 is not valid Don't access a css::table::BorderLine struct as if it was a css::table::BorderLine2 struct, which it isn't. A proper implementation would need to pass BorderLine2 structs around for which it would need a css::table::TableBorder2 struct that holds BorderLine2 instead of BorderLine, and adapt various places for API compatibility to support both. For now use the default table::BorderLineStyle::SOLID to set the line style at ::editeng::SvxBorderLine diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index fc38a45..423e324 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -59,6 +59,7 @@ #include com/sun/star/table/ShadowFormat.hpp #include com/sun/star/table/TableBorder.hpp #include com/sun/star/table/BorderLine2.hpp +#include com/sun/star/table/BorderLineStyle.hpp #include com/sun/star/sheet/CellFlags.hpp #include com/sun/star/sheet/FormulaResult.hpp #include com/sun/star/beans/PropertyAttribute.hpp @@ -952,8 +953,7 @@ ScSubTotalFunc lcl_SummaryToSubTotal( sheet::GeneralFunction eSummary ) const ::editeng::SvxBorderLine* ScHelperFunctions::GetBorderLine( ::editeng::SvxBorderLine rLine, const table::BorderLine rStruct ) { // Calc needs Twips, and there are 1/100mm in the Uno structure -const table::BorderLine2 rBorder2 = static_cast const table::BorderLine2 ( rStruct ); -rLine.SetStyle( ::editeng::SvxBorderStyle( rBorder2.LineStyle ) ); +rLine.SetStyle( ::editeng::SvxBorderStyle( table::BorderLineStyle::SOLID ) ); rLine.GuessLinesWidths( rLine.GetStyle(), (sal_uInt16)HMMToTwips( rStruct.OuterLineWidth ), (sal_uInt16)HMMToTwips( rStruct.InnerLineWidth ), ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sc/source
sc/source/core/data/dptablecache.cxx | 17 + 1 file changed, 17 insertions(+) New commits: commit 54731b6a25ea7f049a866e9a3c78d0684f7e1bc4 Author: Kohei Yoshida kohei.yosh...@suse.com Date: Fri Jan 13 11:56:35 2012 -0500 Use a copy; the container gets modified during iteration. diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx index 1baec31..a65785b 100644 --- a/sc/source/core/data/dptablecache.cxx +++ b/sc/source/core/data/dptablecache.cxx @@ -447,8 +447,11 @@ struct ClearObjectSource : std::unary_functionScDPObject*, void ScDPCache::~ScDPCache() { -// Make sure no live ScDPObject instances hold reference to this cache any more. -std::for_each(maRefObjects.begin(), maRefObjects.end(), ClearObjectSource()); +// Make sure no live ScDPObject instances hold reference to this cache any +// more. We need to use a copied set because the referencing objects will +// modify the original when clearing their source. +ObjectSetType aRefs(maRefObjects); +std::for_each(aRefs.begin(), aRefs.end(), ClearObjectSource()); } bool ScDPCache::IsValid() const commit 405cd1b404faaed034b1188806a0f7f3ff899664 Author: Kohei Yoshida kohei.yosh...@suse.com Date: Fri Jan 13 10:52:56 2012 -0500 Make sure no live ScDPObject instances hold reference to the deleted cache. diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx index 57f6ce1..1baec31 100644 --- a/sc/source/core/data/dptablecache.cxx +++ b/sc/source/core/data/dptablecache.cxx @@ -433,8 +433,22 @@ ScDPCache::ScDPCache(ScDocument* pDoc) : { } +namespace { + +struct ClearObjectSource : std::unary_functionScDPObject*, void +{ +void operator() (ScDPObject* p) const +{ +p-ClearSource(); +} +}; + +} + ScDPCache::~ScDPCache() { +// Make sure no live ScDPObject instances hold reference to this cache any more. +std::for_each(maRefObjects.begin(), maRefObjects.end(), ClearObjectSource()); } bool ScDPCache::IsValid() const ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sc/source
sc/source/core/data/documen9.cxx |1 - sc/source/core/data/drwlayer.cxx |6 ++ sc/source/core/data/table1.cxx |3 --- 3 files changed, 6 insertions(+), 4 deletions(-) New commits: commit 779884e790461eb173c6aa1324240d6d13a5 Author: Kohei Yoshida kohei.yosh...@suse.com Date: Sat Jan 7 18:44:21 2012 -0500 Reset sheet index of drawing objects when moving sheet too. If not, cell-anchored objects would get stuck on the old sheet position, which is not good. diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 2bbd35e..69f289a 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -421,6 +421,8 @@ void ScDrawLayer::ScRenamePage( SCTAB nTab, const String rNewName ) void ScDrawLayer::ScMovePage( sal_uInt16 nOldPos, sal_uInt16 nNewPos ) { MovePage( nOldPos, nNewPos ); +sal_uInt16 nMinPos = std::min(nOldPos, nNewPos); +ResetTab(nMinPos, pDoc-GetTableCount()-1); } void ScDrawLayer::ScCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos, sal_Bool bAlloc ) commit 292cec8ff30181a7c3c253362cd5e2a93cc134db Author: Kohei Yoshida kohei.yosh...@suse.com Date: Sat Jan 7 18:38:12 2012 -0500 Better to internalize the sheet ID reset within ScDrawLayer... diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index d701597..b8cca4c 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -257,7 +257,6 @@ void ScDocument::DrawCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos ) { // angelegt wird die Page schon im ScTable ctor pDrawLayer-ScCopyPage( nOldPos, nNewPos, false ); -pDrawLayer-ResetTab(static_castSCTAB(nNewPos), static_castSCTAB(maTabs.size()-1)); } void ScDocument::DeleteObjectsInArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 91820f4..2bbd35e 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -407,6 +407,8 @@ void ScDrawLayer::ScRemovePage( SCTAB nTab ) } else DeletePage( static_castsal_uInt16(nTab) ); // einfach weg damit + +ResetTab(nTab, pDoc-GetTableCount()-1); } void ScDrawLayer::ScRenamePage( SCTAB nTab, const String rNewName ) @@ -470,6 +472,8 @@ void ScDrawLayer::ScCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos, sal_Bool b if (bAlloc) InsertPage(pNewPage, nNewPos); + +ResetTab(static_castSCTAB(nNewPos), pDoc-GetTableCount()-1); } void ScDrawLayer::ResetTab( SCTAB nStart, SCTAB nEnd ) diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 2464340..06b8203 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -331,10 +331,7 @@ ScTable::~ScTable() ScDrawLayer* pDrawLayer = pDocument-GetDrawLayer(); if (pDrawLayer) -{ pDrawLayer-ScRemovePage( nTab ); -pDrawLayer-ResetTab(nTab, pDocument-GetTableCount()-1); -} } delete[] pColWidth; ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sc/source
sc/source/ui/inc/datafdlg.hrc |2 - sc/source/ui/inc/datafdlg.hxx |6 +-- sc/source/ui/miscdlgs/datafdlg.cxx | 60 +++-- sc/source/ui/src/datafdlg.src |4 +- 4 files changed, 37 insertions(+), 35 deletions(-) New commits: commit 81b5a2d152f1e19a5c4f0001e7314a67b531a164 Author: Kohei Yoshida kohei.yosh...@suse.com Date: Fri Jan 6 11:03:05 2012 -0500 The data range may not always start at row 0, use 'n' prefix for int. diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx index fbad64e..5600d2c 100644 --- a/sc/source/ui/inc/datafdlg.hxx +++ b/sc/source/ui/inc/datafdlg.hxx @@ -67,7 +67,7 @@ private: ScTabViewShell* pTabViewShell; ScDocument* pDoc; sal_uInt16 aColLength; -SCROW aCurrentRow; +SCROW nCurrentRow; SCCOL nStartCol; SCCOL nEndCol; SCROW nStartRow; diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx index f5926c2..698eb7b 100644 --- a/sc/source/ui/miscdlgs/datafdlg.cxx +++ b/sc/source/ui/miscdlgs/datafdlg.cxx @@ -159,7 +159,7 @@ ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell* pTabViewShellOri nEndRow = nStartRow; } -aCurrentRow = nStartRow + 1; +nCurrentRow = nStartRow + 1; String aFieldName; @@ -213,7 +213,7 @@ ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell* pTabViewShellOri aSlider.SetSizePixel(nScrollSize); } -FillCtrls(aCurrentRow); +FillCtrls(nCurrentRow); aSlider.SetPageSize( 10 ); aSlider.SetVisibleSize( 1 ); @@ -246,9 +246,9 @@ void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/) { if (!maEdits.is_null(i)) { -if (aCurrentRow=nEndRow) +if (nCurrentRow=nEndRow) { -pDoc-GetString( i + nStartCol, aCurrentRow, nTab, aFieldName ); +pDoc-GetString( i + nStartCol, nCurrentRow, nTab, aFieldName ); maEdits[i].SetText(aFieldName); } else @@ -256,10 +256,10 @@ void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/) } } -if (aCurrentRow = nEndRow) +if (nCurrentRow = nEndRow) { OUStringBuffer aBuf; -aBuf.append(static_castsal_Int32(aCurrentRow - nStartRow)); +aBuf.append(static_castsal_Int32(nCurrentRow - nStartRow)); aBuf.appendAscii( / ); aBuf.append(static_castsal_Int32(nEndRow - nStartRow)); aFixedText.SetText(aBuf.makeStringAndClear()); @@ -267,7 +267,7 @@ void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/) else aFixedText.SetText(String(ScResId(STR_NEW_RECORD))); -aSlider.SetThumbPos(aCurrentRow-nStartRow-1); +aSlider.SetThumbPos(nCurrentRow-nStartRow-1); } IMPL_LINK( ScDataFormDlg, Impl_DataModifyHdl, Edit*, pEdit) @@ -295,15 +295,15 @@ IMPL_LINK( ScDataFormDlg, Impl_NewHdl, PushButton*, EMPTYARG ) if ( bHasData ) { -pTabViewShell-DataFormPutData( aCurrentRow , nStartRow , nStartCol , nEndRow , nEndCol , maEdits , aColLength ); -aCurrentRow++; -if (aCurrentRow = nEndRow + 2) +pTabViewShell-DataFormPutData( nCurrentRow , nStartRow , nStartCol , nEndRow , nEndCol , maEdits , aColLength ); +nCurrentRow++; +if (nCurrentRow = nEndRow + 2) { nEndRow ++ ; aSlider.SetRange( Range( 0, nEndRow - nStartRow + 1) ); } SetButtonState(); -FillCtrls(aCurrentRow); +FillCtrls(nCurrentRow); pDocSh-SetDocumentModified(); pDocSh-PostPaintGridAll(); } @@ -315,11 +315,11 @@ IMPL_LINK( ScDataFormDlg, Impl_PrevHdl, PushButton*, EMPTYARG ) { if (pDoc) { -if ( aCurrentRow nStartRow +1 ) -aCurrentRow--; +if ( nCurrentRow nStartRow +1 ) +nCurrentRow--; SetButtonState(); -FillCtrls(aCurrentRow); +FillCtrls(nCurrentRow); } return 0; } @@ -328,11 +328,11 @@ IMPL_LINK( ScDataFormDlg, Impl_NextHdl, PushButton*, EMPTYARG ) { if (pDoc) { -if ( aCurrentRow = nEndRow) -aCurrentRow++; +if ( nCurrentRow = nEndRow) +nCurrentRow++; SetButtonState(); -FillCtrls(aCurrentRow); +FillCtrls(nCurrentRow); } return 0; } @@ -341,7 +341,7 @@ IMPL_LINK( ScDataFormDlg, Impl_RestoreHdl, PushButton*, EMPTYARG ) { if (pDoc) { -FillCtrls(aCurrentRow); +FillCtrls(nCurrentRow); } return 0; } @@ -352,14 +352,14 @@ IMPL_LINK( ScDataFormDlg, Impl_DeleteHdl, PushButton*, EMPTYARG ) ScDocShell* pDocSh = pViewData-GetDocShell(); if (pDoc) { -ScRange aRange(nStartCol, aCurrentRow, nTab, nEndCol,
[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sc/source unusedcode.easy
sc/source/ui/app/inputwin.cxx | 10 +++--- sc/source/ui/inc/inputwin.hxx |1 - unusedcode.easy |1 - 3 files changed, 3 insertions(+), 9 deletions(-) New commits: commit 9cd03b7a91c63066cb061966b474ee736ceddbdd Author: Noel Power noel.po...@novell.com Date: Wed Dec 14 14:02:29 2011 + remove unused ScInputBarGroup::GainFocus diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 2588cae..1793fae 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -987,13 +987,6 @@ void ScInputBarGroup::Resize() Invalidate(); } - -void ScInputBarGroup::GainFocus() -{ -aMultiTextWnd.GrabFocus(); -} - - void ScInputBarGroup::StopEditEngine( sal_Bool bAll ) { aMultiTextWnd.StopEditEngine( bAll ); diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx index 1f200c1..7b5bc28 100644 --- a/sc/source/ui/inc/inputwin.hxx +++ b/sc/source/ui/inc/inputwin.hxx @@ -223,7 +223,6 @@ public: virtual const String GetTextString() const; virtual voidStopEditEngine( sal_Bool bAll ); voidInitEditEngine(SfxObjectShell* pObjSh); -voidGainFocus(); voidSetFormulaMode( sal_Bool bSet ); boolIsFocus(); voidMakeDialogEditView(); diff --git a/unusedcode.easy b/unusedcode.easy index b6db194..7ef3336 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -392,7 +392,6 @@ ScHTMLColOffset_SAR::Replace(unsigned long const, unsigned short) ScHTMLColOffset_SAR::Replace(unsigned long const*, unsigned short, unsigned short) ScHTMLColOffset_SAR::_ForEach(unsigned short, unsigned short, unsigned char (*)(unsigned long const, void*), void*) ScHorizontalValueIterator::GetCurNumFmtInfo(short, unsigned long) -ScInputBarGroup::GainFocus() ScJobSetup::ScJobSetup(SfxPrinter*) ScLeftFooterEditPage::GetRanges() ScLeftHeaderEditPage::GetRanges() commit ea925e2415bb751488f510ca48b96d5702fa87f9 Author: Noel Power noel.po...@novell.com Date: Wed Dec 14 12:49:28 2011 + if editing in formulabar restore focus to inputline after expand/collapse diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index b9ab412..2588cae 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1061,6 +1061,9 @@ IMPL_LINK( ScInputBarGroup, ClickHdl, PushButton*, EMPTYARG ) aMultiTextWnd.SetNumLines( aMultiTextWnd.GetLastNumExpandedLines() ); } TriggerToolboxLayout(); +// Restore focus to input line(s) if necessary +if ( SC_MOD()-GetInputHdl()-IsTopMode() ) +aMultiTextWnd.GrabFocus(); return 0; } ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sc/source vcl/inc vcl/source
sc/source/ui/app/inputwin.cxx | 29 + sc/source/ui/inc/inputwin.hxx |4 +++- vcl/inc/vcl/toolbox.hxx | 11 +-- vcl/source/window/toolbox.cxx |6 -- 4 files changed, 37 insertions(+), 13 deletions(-) New commits: commit cefd323936db42b3414c01c4a6dfe1550b364ed3 Author: Noel Power noel.po...@novell.com Date: Wed Dec 14 10:49:10 2011 + stop formulabar controls being repositioned vertically in multiline mode diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index a324994..b9ab412 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -534,6 +534,18 @@ void ScInputWindow::Resize() aTextWindow.Resize(); Size aSize = GetSizePixel(); aSize.Height() = CalcWindowSizePixel().Height(); +ScInputBarGroup* pGroupBar = dynamic_cast ScInputBarGroup* ( pRuntimeWindow.get() ); +if ( pGroupBar ) +{ +// To ensure smooth display and prevent the items in the toolbar being +// repositioned ( vertically ) we lock the vertical positioning of the toolbox +// items when we are displaying 1 line. +// So, we need to adjust the height of the toolbox accordingly. If we don't +// then the largest item ( e.g. the GroupBar window ) will actually be +// positioned such that the toolbar will cut off the bottom of that item +if ( pGroupBar-GetNumLines() 1 ) +aSize.Height() += pGroupBar-GetVertOffset(); +} SetSizePixel(aSize); Invalidate(); } @@ -861,7 +873,8 @@ ScInputBarGroup::ScInputBarGroup(Window* pParent, ScTabViewShell* pViewSh) : ScTextWndBase( pParent, WinBits(WB_HIDE | WB_TABSTOP ) ), aMultiTextWnd( this, pViewSh ), aButton ( this, WB_TABSTOP | WB_RECTSTYLE ), -aScrollBar ( this, WB_TABSTOP | WB_VERT | WB_DRAG ) +aScrollBar ( this, WB_TABSTOP | WB_VERT | WB_DRAG ), +nVertOffset ( 0 ) { aMultiTextWnd.Show(); aMultiTextWnd.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) ); @@ -1057,6 +1070,13 @@ void ScInputBarGroup::TriggerToolboxLayout() ScInputWindow *pParent; pParent=dynamic_castScInputWindow*(w); SfxViewFrame* pViewFrm = SfxViewFrame::Current(); + +// Capture the vertical position of this window in the toolbar, when we increase +// the size of the toolbar to accomadate expanded line input we need to take this +// into account +if ( !nVertOffset ) +nVertOffset = pParent-GetItemPosRect( pParent-GetItemCount() - 1 ).Top(); + if ( pViewFrm ) { Reference com::sun::star::beans::XPropertySet xPropSet( pViewFrm-GetFrame().GetFrameInterface(), UNO_QUERY ); @@ -1071,7 +1091,7 @@ void ScInputBarGroup::TriggerToolboxLayout() if ( xLayoutManager.is() ) { if ( aMultiTextWnd.GetNumLines() 1) -pParent-SetToolbarLayoutMode( TBX_LAYOUT_TOP ); +pParent-SetToolbarLayoutMode( TBX_LAYOUT_LOCKVERT ); else pParent-SetToolbarLayoutMode( TBX_LAYOUT_NORMAL ); xLayoutManager-lock(); diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx index 1e896e7..1f200c1 100644 --- a/sc/source/ui/inc/inputwin.hxx +++ b/sc/source/ui/inc/inputwin.hxx @@ -231,12 +231,14 @@ public: ScrollBar GetScrollBar() { return aScrollBar; } voidIncrementVerticalSize(); voidDecrementVerticalSize(); +longGetNumLines() { return aMultiTextWnd.GetNumLines(); } +longGetVertOffset() { return nVertOffset; } private: voidTriggerToolboxLayout(); ScMultiTextWnd aMultiTextWnd; PushButton aButton; ScrollBar aScrollBar; - +longnVertOffset; DECL_LINK( ClickHdl,PushButton* ); DECL_LINK( Impl_ScrollHdl, ScrollBar* ); diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx index 8b39005..039a0e3 100644 --- a/vcl/inc/vcl/toolbox.hxx +++ b/vcl/inc/vcl/toolbox.hxx @@ -160,12 +160,11 @@ enum ToolBoxButtonSize { TOOLBOX_BUTTONSIZE_DONTCARE, TOOLBOX_BUTTONSIZE_SMALL, // used for internal sizing calculations enum FloatingSizeMode { FSMODE_AUTO, FSMODE_FAVOURWIDTH, FSMODE_FAVOURHEIGHT }; -// TBX_LAYOUT_NORMAL - traditional layout, items are centered in the toolbar -// TBX_LAYOUT_TOP- special mode (currently used for calc input/formula bar) -// where items are aligned with the top of highest item -// ( currently only valid for docked, single line, horizontal -// toolbars ) -enum ToolBoxLayoutMode { TBX_LAYOUT_NORMAL, TBX_LAYOUT_TOP }; +// TBX_LAYOUT_NORMAL - traditional layout, items are centered in the toolbar +// TBX_LAYOUT_LOCKVERT - special mode (currently used for
[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sc/source
sc/source/ui/app/inputhdl.cxx |3 ++- sc/source/ui/app/inputwin.cxx | 33 +++-- sc/source/ui/inc/inputwin.hxx |2 +- 3 files changed, 18 insertions(+), 20 deletions(-) New commits: commit 1b28a657678f2cc64861030cbe3bea13d1bebd95 Author: Noel Power noel.po...@novell.com Date: Mon Dec 12 00:59:52 2011 + double check pEditView ( appears some re-entrency foo can zap it ) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 2983c44..649050b 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -,7 +,9 @@ ScMultiTextWnd::~ScMultiTextWnd() void ScMultiTextWnd::Paint( const Rectangle rRec ) { -GetEditView()-Paint( rRec ); +EditView* pView = GetEditView(); +if ( pView ) +pView-Paint( rRec ); } EditView* ScMultiTextWnd::GetEditView() commit 445d348837aca032b81edc92a23fee128758ee0f Author: Noel Power noel.po...@novell.com Date: Sun Dec 11 16:40:52 2011 + fix autocorrection sync problem with input/formulabar also, * make the GetEditView explicitly create EditEngine/EditView *always* * remove the bogus GetLine method * reset NotifyHdl when stopping the edit engine diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index f4fe965..98cfac2 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -2046,7 +2046,8 @@ void ScInputHandler::SyncViews( EditView* pSourceView ) if (pTableView pTableView != pSourceView) lcl_SetTopSelection( pTableView, aSel ); } -else if (pTopView pTableView) +// Only sync selection from topView if we are actually editiing there +else if ( ( eMode == SC_INPUT_TOP ) pTopView pTableView) { aSel = pTopView-GetSelection(); lcl_SetTopSelection( pTableView, aSel ); diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 83bdb8a..2983c44 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1109,29 +1109,18 @@ ScMultiTextWnd::~ScMultiTextWnd() { } -int ScMultiTextWnd::GetLineCount() +void ScMultiTextWnd::Paint( const Rectangle rRec ) { - if(pEditView) - { - return pEditEngine-GetLineCount(0); - } - return 1; +GetEditView()-Paint( rRec ); } -void ScMultiTextWnd::Paint( const Rectangle rRec ) +EditView* ScMultiTextWnd::GetEditView() { -// We always use edit engine to draw text at all times. -if (!pEditEngine) -InitEditEngine(SfxObjectShell::Current()); -//StartEditEngine(); - -if (pEditView) -{ -pEditView-Paint(rRec); -} +if ( !pEditView ) +InitEditEngine( SfxObjectShell::Current() ); +return pEditView; } - long ScMultiTextWnd::GetPixelHeightForLines( long nLines ) { long height = ( LogicToPixel(Size(0,GetTextHeight())).Height() ); @@ -1229,7 +1218,6 @@ ScMultiTextWnd::DoScroll() void ScMultiTextWnd::StartEditEngine() { // Bei eigener Modalitaet (Doc-modale Dialoge) nicht aktivieren - SfxObjectShell* pObjSh = SfxObjectShell::Current(); if ( pObjSh pObjSh-IsInModalMode() ) return; @@ -1393,11 +1381,18 @@ void ScMultiTextWnd::InitEditEngine(SfxObjectShell* pObjSh) void ScMultiTextWnd::StopEditEngine( sal_Bool bAll ) { +if ( pEditEngine ) +pEditEngine-SetNotifyHdl(Link()); ScTextWnd::StopEditEngine( bAll ); } void ScMultiTextWnd::SetTextString( const String rNewString ) { +// Ideally it would be best to create on demand the EditEngine/EditView here, but... for +// the initialisation scenario where a cell is first clicked on we end up with the text in the +// inputbar window scrolled to the bottom if we do that here ( because the tableview and topview +// are synced I guess ). +// should fix that I suppose :-/ need to look a bit further into that if ( pEditView ) pEditView-Invalidate(); ScTextWnd::SetTextString( rNewString ); diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx index c0f4234..9f70ecb 100644 --- a/sc/source/ui/inc/inputwin.hxx +++ b/sc/source/ui/inc/inputwin.hxx @@ -176,8 +176,8 @@ public: virtual ~ScMultiTextWnd(); virtual void StartEditEngine(); virtual void StopEditEngine( sal_Bool bAll ); -int GetLineCount(); virtual void Resize(); +virtual EditView* GetEditView(); long GetPixelHeightForLines( long nLines ); long GetEditEngTxtHeight(); ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sc/source
sc/source/ui/app/inputwin.cxx | 24 ++-- sc/source/ui/inc/inputwin.hxx |2 +- 2 files changed, 11 insertions(+), 15 deletions(-) New commits: commit 2e580e9b1b0d095cda7991614f58681c75336a83 Author: Noel Power noel.po...@novell.com Date: Wed Dec 7 15:53:20 2011 + remove unused variable diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index a04451f..a271487 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1157,7 +1157,6 @@ void ScMultiTextWnd::Resize() if(pEditView) { Size aOutputSize = GetOutputSizePixel(); -Size aLineSize = Size(0,aTextBoxSize.Height()); Point aPos1(TEXT_STARTPOS,0); Point aPos2(aOutputSize.Width(),aOutputSize.Height()); commit d65ca4394166675335a8c3061c6c0f179271f65e Author: Noel Power noel.po...@novell.com Date: Wed Dec 7 15:40:28 2011 + better sizing of inputbar ( removed weird calculations I didn't understand ) gsoc input bar now (should) snuggly wrap the text when collapsed, if multilines exist then scrolling with the keys should be clean and no spill from upper or lower lines visible. Removed some strange ( pseudo padding ) apparently for taking into account the window border and reorganized the resize logic so the padding is added ( and commented why ) in just one place. diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 8b32bc9..a04451f 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -864,7 +864,7 @@ ScInputBarGroup::ScInputBarGroup(Window* pParent) // too bad at the size from 'Settings' for me // set button width to scrollbar width then for the moment aButton.SetClickHdl ( LINK( this, ScInputBarGroup, ClickHdl ) ); - aButton.SetSizePixel(Size(GetSettings().GetStyleSettings().GetScrollBarSize(), TBX_WINDOW_HEIGHT) ); + aButton.SetSizePixel(Size(GetSettings().GetStyleSettings().GetScrollBarSize(), aMultiTextWnd.GetPixelHeightForLines(1)) ); aButton.Enable(); aButton.SetSymbol( SYMBOL_SPIN_DOWN ); aButton.SetQuickHelpText( ScResId( SCSTR_QHELP_EXPAND_FORMULA ) ); @@ -1123,18 +1123,16 @@ void ScMultiTextWnd::Paint( const Rectangle rRec ) } } -long ScMultiTextWnd::GetPixelTextHeight() + +long ScMultiTextWnd::GetPixelHeightForLines( long nLines ) { long height = ( LogicToPixel(Size(0,GetTextHeight())).Height() ); // need to figure out why GetTextHeight is not set up when I need it // some initialisation timing issue ? -return Max ( long( 14 ), height ); -} - - -long ScMultiTextWnd::GetPixelHeightForLines( long nLines ) -{ -return nLines * GetPixelTextHeight(); +height = Max ( long( 14 ), height ); +// add padding ( for the borders of the window I guess ) otherwise we +// chop slightly the top and bottom of whatever is in the inputbox +return ( nLines * height ) + 4; } void ScMultiTextWnd::SetNumLines( long nLines ) @@ -1153,14 +1151,14 @@ void ScMultiTextWnd::Resize() // parent/container window Size aTextBoxSize = GetSizePixel(); -aTextBoxSize.Height()=( GetPixelHeightForLines( mnLines ) ) + 8; +aTextBoxSize.Height()=( GetPixelHeightForLines( mnLines ) ); +SetSizePixel(aTextBoxSize); if(pEditView) { Size aOutputSize = GetOutputSizePixel(); -Size aLineSize = Size(0,GetPixelTextHeight()); -int nDiff = (aOutputSize.Height() - ( mnLines *aLineSize.Height()))/2; -Point aPos1(TEXT_STARTPOS,nDiff); +Size aLineSize = Size(0,aTextBoxSize.Height()); +Point aPos1(TEXT_STARTPOS,0); Point aPos2(aOutputSize.Width(),aOutputSize.Height()); pEditView-SetOutputArea( @@ -1170,7 +1168,6 @@ void ScMultiTextWnd::Resize() } SetScrollBarRange(); -SetSizePixel(aTextBoxSize); } IMPL_LINK(ScMultiTextWnd, ModifyHdl, EENotify*, pNotify) diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx index 76730b6..7a1da05 100644 --- a/sc/source/ui/inc/inputwin.hxx +++ b/sc/source/ui/inc/inputwin.hxx @@ -176,7 +176,6 @@ public: virtual void StopEditEngine( sal_Bool bAll ); int GetLineCount(); virtual void Resize(); -long GetPixelTextHeight(); long GetPixelHeightForLines( long nLines ); long GetEditEngTxtHeight(); @@ -193,6 +192,7 @@ protected: DECL_LINK( NotifyHdl, EENotify* ); DECL_LINK( ModifyHdl, EENotify* ); private: +long GetPixelTextHeight(); ScInputBarGroup mrGroupBar; long mnLines; long mnLastExpandedLines; ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits