[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - include/sfx2 sfx2/source
include/sfx2/recentdocsview.hxx|3 ++- sfx2/source/control/recentdocsview.cxx | 23 --- sfx2/source/control/templateview.hrc |5 +++-- sfx2/source/control/templateview.src |9 +++-- 4 files changed, 28 insertions(+), 12 deletions(-) New commits: commit 83b041f33d1ab84a8a152475b68dfa71deafce42 Author: Jan Holesovsky Date: Fri Dec 13 18:03:19 2013 +0100 startcenter: The welcome text was too long, split it to 2 lines. Change-Id: I23d6a4bf8d9c3b2531dd95e4ea293ce7225bf8f1 diff --git a/include/sfx2/recentdocsview.hxx b/include/sfx2/recentdocsview.hxx index ac52e67..63a067d 100644 --- a/include/sfx2/recentdocsview.hxx +++ b/include/sfx2/recentdocsview.hxx @@ -72,7 +72,8 @@ protected: longmnItemMaxTextLength; Image maWelcomeImage; -OUString maWelcomeText; +OUString maWelcomeLine1; +OUString maWelcomeLine2; }; #endif // INCLUDED_SFX2_RECENTDOCSVIEW_HXX diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx index afadb04..1b63ba4 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -46,7 +46,8 @@ RecentDocsView::RecentDocsView( Window* pParent ) , mnItemPadding(5) , mnItemMaxTextLength(30) , maWelcomeImage(SfxResId(IMG_WELCOME)) -, maWelcomeText(SfxResId(STR_WELCOME)) +, maWelcomeLine1(SfxResId(STR_WELCOME_LINE1)) +, maWelcomeLine2(SfxResId(STR_WELCOME_LINE2)) { SetStyle(GetStyle() | WB_VSCROLL); setItemMaxTextLength( mnItemMaxTextLength ); @@ -254,17 +255,25 @@ void RecentDocsView::Paint( const Rectangle &aRect ) aNewFont.SetHeight(20); SetFont(aNewFont); -long nTextWidth = GetTextWidth(maWelcomeText); long nTextHeight = GetTextHeight(); + +long nTextWidth1 = GetTextWidth(maWelcomeLine1); +long nTextWidth2 = GetTextWidth(maWelcomeLine2); + const Size & rImgSize = maWelcomeImage.GetSizePixel(); -const Size & rScreenSize = GetSizePixel(); -const int nX = (rScreenSize.Width() - rImgSize.Width())/2; -const int nY = (rScreenSize.Height() - nTextHeight*1.5 - rImgSize.Height())/2; + +const Size & rSize = GetSizePixel(); + +const int nX = (rSize.Width() - rImgSize.Width())/2; +const int nY = (rSize.Height() - 3 * nTextHeight - rImgSize.Height())/2; + Point aImgPoint(nX, nY); -Point aStrPoint((rScreenSize.Width() - nTextWidth)/2, nY + rImgSize.Height() + nTextHeight/2); +Point aStr1Point((rSize.Width() - nTextWidth1)/2, nY + rImgSize.Height() + nTextHeight/2); +Point aStr2Point((rSize.Width() - nTextWidth2)/2, nY + rImgSize.Height() + nTextHeight + nTextHeight/2); DrawImage(aImgPoint, rImgSize, maWelcomeImage, IMAGE_DRAW_SEMITRANSPARENT); -DrawText(aStrPoint, maWelcomeText); +DrawText(aStr1Point, maWelcomeLine1); +DrawText(aStr2Point, maWelcomeLine2); SetFont(aOldFont); } diff --git a/sfx2/source/control/templateview.hrc b/sfx2/source/control/templateview.hrc index f0c4dae..e5608c9 100644 --- a/sfx2/source/control/templateview.hrc +++ b/sfx2/source/control/templateview.hrc @@ -10,7 +10,8 @@ #define BTN_ALL_TEMPLATES 256 #define CONTROL_BUTTONS 257 #define FT_NAME 258 -#define STR_WELCOME 259 -#define IMG_WELCOME 260 +#define STR_WELCOME_LINE1 259 +#define STR_WELCOME_LINE2 260 +#define IMG_WELCOME 261 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/templateview.src b/sfx2/source/control/templateview.src index 3b866bd..49fe015 100644 --- a/sfx2/source/control/templateview.src +++ b/sfx2/source/control/templateview.src @@ -23,9 +23,14 @@ FixedText FT_NAME Size = MAP_APPFONT( 238, 12 ); }; -String STR_WELCOME +String STR_WELCOME_LINE1 { -Text [ en-US ] = "Welcome to %PRODUCTNAME. Use the sidebar to open or create a file."; +Text [ en-US ] = "Welcome to %PRODUCTNAME."; +}; + +String STR_WELCOME_LINE2 +{ +Text [ en-US ] = "Use the sidebar to open or create a file."; }; Image IMG_WELCOME ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - include/sfx2 sfx2/source
include/sfx2/thumbnailview.hxx|3 -- sfx2/source/control/thumbnailview.cxx | 35 +- 2 files changed, 3 insertions(+), 35 deletions(-) New commits: commit a55ec81ad75b280edea8aa30f2a31a14489d2036 Author: Zolnai Tamás Date: Thu Jan 9 14:34:35 2014 +0100 fdo#71628 Startcenter: remove thumbnail selection when focus is moved away mnHighItemId is never assaigned with a valid value and there is no sense to store one selected element's index anyway, because there can be more. The bMove parameter of ImplGetItem is never used and doesn' work so remove it. Change-Id: I91d6bc3fd13a2b44e6961fea66d02702a8f31c2b (cherry picked from commit 0314034d8b23d5b69399cfcdf6b2f2add73f9f47) Reviewed-on: https://gerrit.libreoffice.org/7340 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx index ceaea4e..ccd25dc 100644 --- a/include/sfx2/thumbnailview.hxx +++ b/include/sfx2/thumbnailview.hxx @@ -300,7 +300,7 @@ protected: SFX2_DLLPRIVATE void ImplInitScrollBar(); SFX2_DLLPRIVATE void ImplDeleteItems(); SFX2_DLLPRIVATE void ImplDraw(); -SFX2_DLLPRIVATE size_t ImplGetItem( const Point& rPoint, bool bMove = false ) const; +SFX2_DLLPRIVATE size_t ImplGetItem( const Point& rPoint ) const; SFX2_DLLPRIVATE ThumbnailViewItem*ImplGetItem( size_t nPos ); SFX2_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const; SFX2_DLLPRIVATE ThumbnailViewItem*ImplGetVisibleItem( sal_uInt16 nVisiblePos ); @@ -328,7 +328,6 @@ protected: int mnFineness; -sal_uInt16 mnHighItemId; sal_uInt16 mnCols; sal_uInt16 mnFirstLine; sal_uInt16 mnSpacing; diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 4942150..1fe98f1 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -149,7 +149,6 @@ void ThumbnailView::ImplInit() mnLines = 0; mnFineness = 5; mnFirstLine = 0; -mnHighItemId= 0; mnCols = 0; mnSpacing = 0; mbScroll= false; @@ -450,7 +449,7 @@ void ThumbnailView::CalculateItemPositions () delete pDelScrBar; } -size_t ThumbnailView::ImplGetItem( const Point& rPos, bool bMove ) const +size_t ThumbnailView::ImplGetItem( const Point& rPos ) const { if ( !mbHasVisibleItems ) { @@ -464,13 +463,6 @@ size_t ThumbnailView::ImplGetItem( const Point& rPos, bool bMove ) const if (mFilteredItemList[i]->isVisible() && mFilteredItemList[i]->getDrawArea().IsInside(rPos)) return i; } - -// return the previously selected item if spacing is set and -// the mouse hasn't left the window yet -if ( bMove && mnSpacing && mnHighItemId ) -{ -return GetItemPos( mnHighItemId ); -} } return THUMBNAILVIEW_ITEM_NOTFOUND; @@ -926,22 +918,7 @@ void ThumbnailView::GetFocus() void ThumbnailView::LoseFocus() { -if (mnHighItemId) -{ -size_t nPos = GetItemPos(mnHighItemId); - -if (nPos != THUMBNAILVIEW_ITEM_NOTFOUND) -{ -ThumbnailViewItem *pOld = mItemList[nPos]; - -pOld->setHighlight(false); - -if (!pOld->isSelected()) -DrawItem(pOld); -} - -mnHighItemId = 0; -} +deselectItems(); Control::LoseFocus(); @@ -1049,12 +1026,6 @@ void ThumbnailView::RemoveItem( sal_uInt16 nItemId ) mpStartSelRange = mFilteredItemList.end(); } -// reset variables -if ( mnHighItemId == nItemId ) -{ -mnHighItemId= 0; -} - CalculateItemPositions(); if ( IsReallyVisible() && IsUpdateMode() ) @@ -1067,7 +1038,6 @@ void ThumbnailView::Clear() // reset variables mnFirstLine = 0; -mnHighItemId= 0; CalculateItemPositions(); @@ -1081,7 +1051,6 @@ void ThumbnailView::updateItems (const std::vector &items) // reset variables mnFirstLine = 0; -mnHighItemId= 0; mItemList = items; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - include/sfx2 sfx2/source
include/sfx2/recentdocsviewitem.hxx|3 +++ sfx2/source/control/recentdocsviewitem.cxx |6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) New commits: commit 943dd8bfd8695f11773b90fbfebd4179eee9f492 Author: Zolnai Tamás Date: Fri Jan 10 03:31:46 2014 +0100 fdo#72947 Startcenter: display more userfriendly file urls in tooltips Use INetURLObject to get a readable url (it displayes special characters too). It is a side effect that 'file:///' prefix disappear which seems a good thing. Plus some cleanup: remove second INetURLObject. Change-Id: I4aab5e2546ae70e5a3d85b12e26e021bfa244999 (cherry picked from commit 31dfeee42e9b08ed7031b6c50d0c674122d5245c) Reviewed-on: https://gerrit.libreoffice.org/7366 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/include/sfx2/recentdocsviewitem.hxx b/include/sfx2/recentdocsviewitem.hxx index be94b78..410e74b 100644 --- a/include/sfx2/recentdocsviewitem.hxx +++ b/include/sfx2/recentdocsviewitem.hxx @@ -23,6 +23,9 @@ public: virtual OUString getHelpText() const; OUString maURL; + +private: +OUString m_sHelpText; }; #endif // INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index c35c16b..d741675 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -21,6 +21,7 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR { OUString aTitle(rTitle); INetURLObject aURLObj(rURL); +m_sHelpText = aURLObj.GetURLPath(); RecentDocsView& rRecentView = dynamic_cast(rView); long nThumbnailSize = rRecentView.GetThumbnailSize(); @@ -38,10 +39,9 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR Size aExtSize(aExt.GetSizePixel()); // attempt to make it appear as if it is on a piece of paper -INetURLObject aUrl(rURL); long nPaperHeight; long nPaperWidth; -if( RecentDocsView::typeMatchesExtension(TYPE_IMPRESS, aUrl.getExtension()) ) +if( RecentDocsView::typeMatchesExtension(TYPE_IMPRESS, aURLObj.getExtension()) ) { // Swap width and height (PAPER_SCREEN_4_3 definition make it needed) PaperInfo aInfo(PAPER_SCREEN_4_3); @@ -86,7 +86,7 @@ void RecentDocsViewItem::setEditTitle (bool edit, bool bChangeFocus) OUString RecentDocsViewItem::getHelpText() const { -return maURL; +return m_sHelpText; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - include/sfx2 sfx2/source
include/sfx2/thumbnailview.hxx|2 +- sfx2/source/control/thumbnailview.cxx | 15 +++ 2 files changed, 12 insertions(+), 5 deletions(-) New commits: commit ed2d6ab389c169330f3c359463ce503eafcee253 Author: Andrzej Hunt Date: Tue Apr 15 16:22:53 2014 +0100 fdo#72287 Scroll automatically to show selected item when keyboard used. 806919adf9c9bafbaba92c2d2ab35d2e2f9863f8 added finer-grained scrolling using the scrollbar / scrollwheel, but inadvertently prevents the display from scrolling when an item is selected that is currently offscreen (e.g. by using the down-arrow button on the keyboard). Change-Id: Iaa3a7dc6d214741d37cf4ec78c00ed0034ed1e42 (cherry picked from commit 717aa1ac75ddd54fdf72cd4de6551f1fb536da9b) Reviewed-on: https://gerrit.libreoffice.org/9017 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx index e21b87b..851eba0 100644 --- a/include/sfx2/thumbnailview.hxx +++ b/include/sfx2/thumbnailview.hxx @@ -292,7 +292,7 @@ protected: using Control::ImplInitSettings; using Window::ImplInit; -void CalculateItemPositions (); +void CalculateItemPositions (bool bScrollBarUsed = false); void MakeItemVisible( sal_uInt16 nId ); SFX2_DLLPRIVATE void ImplInit(); diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index a4e38a7..814a8d7 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -275,7 +275,7 @@ void ThumbnailView::OnItemDblClicked (ThumbnailViewItem*) return new ThumbnailViewAcc( this, mbIsTransientChildrenDisabled ); } -void ThumbnailView::CalculateItemPositions () +void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed) { if (!mnItemHeight || !mnItemWidth) return; @@ -300,7 +300,7 @@ void ThumbnailView::CalculateItemPositions () // calculate window scroll ratio float nScrollRatio; -if( mpScrBar ) +if( bScrollBarUsed && mpScrBar ) nScrollRatio = static_cast(mpScrBar->GetThumbPos()) / static_cast(mpScrBar->GetRangeMax()-2); else @@ -356,7 +356,12 @@ void ThumbnailView::CalculateItemPositions () nHiddenLines * nItemHeightOffset; // draw items -size_t nFirstItem = nHiddenLines * mnCols; +// Unless we are scrolling (via scrollbar) we just use the precalculated +// mnFirstLine -- our nHiddenLines calculation takes into account only +// what the user has done with the scrollbar but not any changes of selection +// using the keyboard, meaning we could accidentally hide the selected item +// if we believe the scrollbar (fdo#72287). +size_t nFirstItem = (bScrollBarUsed ? nHiddenLines : mnFirstLine) * mnCols; size_t nLastItem = nFirstItem + (mnVisLines + 1) * mnCols; maItemListRect.Left() = x; @@ -438,6 +443,8 @@ void ThumbnailView::CalculateItemPositions () mpScrBar->SetPosSizePixel( aPos, aSize ); mpScrBar->SetRangeMax( (nCurCount+mnCols-1)*mnFineness/mnCols); mpScrBar->SetVisibleSize( mnVisLines ); +if (!bScrollBarUsed) +mpScrBar->SetThumbPos( (long)mnFirstLine*mnFineness ); long nPageSize = mnVisLines; if ( nPageSize < 1 ) nPageSize = 1; @@ -520,7 +527,7 @@ IMPL_LINK( ThumbnailView,ImplScrollHdl, ScrollBar*, pScrollBar ) { if ( pScrollBar->GetDelta() ) { -CalculateItemPositions(); +CalculateItemPositions(true); if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - include/sfx2 sfx2/source
include/sfx2/thumbnailview.hxx|1 - sfx2/source/control/thumbnailview.cxx | 14 +++--- 2 files changed, 3 insertions(+), 12 deletions(-) New commits: commit 325f51e94639f1a9e0d0c60159bfcf3070409640 Author: Andrzej Hunt Date: Mon May 5 20:48:58 2014 +0100 fdo#76261 Get rid of unneeded and malfunctioning maItemListRect. maItemListRect serves as a sort of bounding box for what items /could/ be visible on screen, however it is only used for determining the id of an item we have just clicked on -- given that we already know that we are clicking inside the visible area this is an unnecessary check. In fact this check is erronous as we no longer limit ourselves to "whole" rows as of 806919adf9c9bafbaba92c2d2ab35d2e2f9863f8 -- i.e. the previous assumption was that a view large enough for n rows will show precisely n (whole) rows, whereas we might be showing (n-1) complete rows, and a fraction of a row at the top and bottom of the screen, i.e. a total of n+1 rows, where maItemRect only encloses the top n rows, meaning we were erronously ignoring clicks on the (partly visible) lowest n+1 row. Change-Id: Ia52ed2e0d217a9f077cef86ee9c1847252844995 (cherry picked from commit fb0ca7eff0e16fa8dd1a4c8d75fef23830903a3f) Reviewed-on: https://gerrit.libreoffice.org/9255 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx index 851eba0..bac63c0 100644 --- a/include/sfx2/thumbnailview.hxx +++ b/include/sfx2/thumbnailview.hxx @@ -316,7 +316,6 @@ protected: ThumbnailValueItemList mFilteredItemList; ///< Cache to store the filtered items ThumbnailValueItemList::iterator mpStartSelRange; ScrollBar* mpScrBar; -Rectangle maItemListRect; long mnHeaderHeight; long mnItemWidth; long mnItemHeight; diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 814a8d7..c97ecd6 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -364,11 +364,6 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed) size_t nFirstItem = (bScrollBarUsed ? nHiddenLines : mnFirstLine) * mnCols; size_t nLastItem = nFirstItem + (mnVisLines + 1) * mnCols; -maItemListRect.Left() = x; -maItemListRect.Top() = y; -maItemListRect.Right() = x + mnCols*(mnItemWidth+nHItemSpace) - nHItemSpace - 1; -maItemListRect.Bottom() = y + mnVisLines*(mnItemHeight+nVItemSpace) - nVItemSpace - 1; - // If want also draw parts of items in the last line, // then we add one more line if parts of these line are // visible @@ -463,13 +458,10 @@ size_t ThumbnailView::ImplGetItem( const Point& rPos ) const return THUMBNAILVIEW_ITEM_NOTFOUND; } -if ( maItemListRect.IsInside( rPos ) ) +for (size_t i = 0; i < mFilteredItemList.size(); ++i) { -for (size_t i = 0; i < mFilteredItemList.size(); ++i) -{ -if (mFilteredItemList[i]->isVisible() && mFilteredItemList[i]->getDrawArea().IsInside(rPos)) -return i; -} +if (mFilteredItemList[i]->isVisible() && mFilteredItemList[i]->getDrawArea().IsInside(rPos)) +return i; } return THUMBNAILVIEW_ITEM_NOTFOUND; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - include/sfx2 sfx2/source
include/sfx2/recentdocsview.hxx|2 ++ sfx2/source/control/recentdocsview.cxx |7 +++ sfx2/source/control/thumbnailview.cxx |2 -- 3 files changed, 9 insertions(+), 2 deletions(-) New commits: commit b071644756772d0b6930ac2e6d27237b67e7febc Author: Zolnai Tamás Date: Fri Mar 7 10:57:52 2014 +0100 fdo#74787, rhbz#1072553: Fix deselection problems of template view deselectItems() were added to make recent docs view work, but it is unneccessary to affect template view too. (regression from 0314034d8b23d5b69399cfcdf6b2f2add73f9f47) Conflicts: sfx2/source/control/recentdocsview.cxx Change-Id: I0c805774321939991e308e9c8c669604e81dbad5 Reviewed-on: https://gerrit.libreoffice.org/8490 Tested-by: Michael Stahl Reviewed-by: Michael Stahl diff --git a/include/sfx2/recentdocsview.hxx b/include/sfx2/recentdocsview.hxx index 1706935..d9ad72d 100644 --- a/include/sfx2/recentdocsview.hxx +++ b/include/sfx2/recentdocsview.hxx @@ -66,6 +66,8 @@ protected: void OpenItem( const ThumbnailViewItem *pItem ); virtual void Paint( const Rectangle& rRect ); +virtual void LoseFocus(); + bool isAcceptedFile(const OUString &rURL) const; longmnItemMaxSize; diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx index e462172..13f7dc3 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -302,6 +302,13 @@ void RecentDocsView::Paint( const Rectangle &aRect ) ThumbnailView::Paint(aRect); } +void RecentDocsView::LoseFocus() +{ +deselectItems(); + +ThumbnailView::LoseFocus(); +} + void RecentDocsView::SetThumbnailSize(long thumbnailSize) { mnItemMaxSize = thumbnailSize; diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 3c6d094..a4e38a7 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -918,8 +918,6 @@ void ThumbnailView::GetFocus() void ThumbnailView::LoseFocus() { -deselectItems(); - Control::LoseFocus(); // Tell the accessible object that we lost the focus. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - include/sfx2 sfx2/source vcl/source
include/sfx2/dinfdlg.hxx | 14 + sfx2/source/dialog/dinfdlg.cxx | 63 - vcl/source/window/tabpage.cxx | 11 --- 3 files changed, 60 insertions(+), 28 deletions(-) New commits: commit aeef56b3731e746406b441550aea217dcb39371d Author: Caolán McNamara Date: Tue Jul 22 14:20:33 2014 +0100 Related: fdo#81457 skip setting an empty allocation if the dimension is 0, don't bother calculating a bunch of <= 0 sizes, rely on the parents clipping to hide the lot instead (cherry picked from commit 13807fbf9f3a4aae6767da8bcf796bea4b065159) and Related: fdo#81457 quadratic time required when setting a11y name when calling SetAccessibleName GetAccessibleName is called in order to send a name changed a11y event. Getting an Accessible Name is very slow in a non-layout aware widget because it scans for a "nearby" label and there is none in this widget, but it has a huge pile of other widgets to iterate over. call add_mnemonic_label before hand to cut off that entire branch. While we're at it, only call InitControl to adjust to a new width if the new width is different from the old width (cherry picked from commit aff263c8b814c6bf352312403d3c1e448c8013a3) Conflicts: include/sfx2/dinfdlg.hxx Change-Id: Ie4ba1276127226e49442278e46447b84bbeb1cde Reviewed-on: https://gerrit.libreoffice.org/10463 Reviewed-by: David Tardon Tested-by: David Tardon diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx index a4d6acd..81b57bc 100644 --- a/include/sfx2/dinfdlg.hxx +++ b/include/sfx2/dinfdlg.hxx @@ -407,6 +407,10 @@ struct CustomPropertyLine class CustomPropertiesWindow : public Window { private: +FixedText* m_pHeaderAccName; +FixedText* m_pHeaderAccType; +FixedText* m_pHeaderAccValue; + ComboBoxm_aNameBox; ListBox m_aTypeBox; Editm_aValueEdit; @@ -441,13 +445,13 @@ private: public: CustomPropertiesWindow(Window* pParent, -const OUString &rHeaderAccName, -const OUString &rHeaderAccType, -const OUString &rHeaderAccValue); +FixedText *pHeaderAccName, +FixedText *pHeaderAccType, +FixedText *pHeaderAccValue); ~CustomPropertiesWindow(); -voidInitControls( HeaderBar* pHeaderBar, const ScrollBar* pScrollBar ); -sal_uInt16 GetVisibleLineCount() const; +boolInitControls( HeaderBar* pHeaderBar, const ScrollBar* pScrollBar ); +sal_uInt16 GetVisibleLineCount() const; inline sal_Int32GetLineHeight() const { return m_nLineHeight; } voidAddLine( const OUString& sName, com::sun::star::uno::Any& rAny ); boolAreAllLinesValid() const; diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index a7c6c95..4a278c1 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1401,10 +1401,13 @@ void CustomPropertyLine::SetRemoved() } CustomPropertiesWindow::CustomPropertiesWindow(Window* pParent, -const OUString &rHeaderAccName, -const OUString &rHeaderAccType, -const OUString &rHeaderAccValue) : +FixedText *pHeaderAccName, +FixedText *pHeaderAccType, +FixedText *pHeaderAccValue) : Window(pParent), +m_pHeaderAccName(pHeaderAccName), +m_pHeaderAccType(pHeaderAccType), +m_pHeaderAccValue(pHeaderAccValue), m_aNameBox ( this, SfxResId( SFX_CB_PROPERTY_NAME ) ), m_aTypeBox ( this, SfxResId( SFX_LB_PROPERTY_TYPE ) ), m_aValueEdit( this, SfxResId( SFX_ED_PROPERTY_VALUE ) ), @@ -1424,9 +1427,12 @@ CustomPropertiesWindow::CustomPropertiesWindow(Window* pParent, m_aBoxLoseFocusTimer.SetTimeout( 300 ); m_aBoxLoseFocusTimer.SetTimeoutHdl( LINK( this, CustomPropertiesWindow, BoxTimeoutHdl ) ); -m_aNameBox.SetAccessibleName(rHeaderAccName); -m_aTypeBox.SetAccessibleName(rHeaderAccType); -m_aValueEdit.SetAccessibleName(rHeaderAccValue); +m_aNameBox.add_mnemonic_label(m_pHeaderAccName); +m_aNameBox.SetAccessibleName(m_pHeaderAccName->GetText()); +m_aTypeBox.add_mnemonic_label(m_pHeaderAccType); +m_aTypeBox.SetAccessibleName(m_pHeaderAccType->GetText()); +m_aValueEdit.add_mnemonic_label(m_pHeaderAccValue); +m_aValueEdit.SetAccessibleName(m_pHeaderAccValue->GetText()); m_aNameBox.Hide(); m_aTypeBox.Hide(); @@ -1592,8 +1598,10 @@ void CustomPropertiesWindow::ValidateLine( CustomPropertyLine* pLine, bool bIsFr } } -void CustomPropertiesWindow::InitControls( HeaderBar* pHeaderBar, const ScrollBar* pScrollBar ) +bool CustomPropertiesWindow::InitControls( HeaderBar* pHeaderBar, const ScrollBar*
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - include/sfx2 sfx2/source sw/source
include/sfx2/styledlg.hxx |3 +++ sfx2/source/dialog/mgetempl.cxx | 16 +--- sfx2/source/dialog/styledlg.cxx | 14 ++ sw/source/ui/app/docst.cxx |6 +- 4 files changed, 27 insertions(+), 12 deletions(-) New commits: commit 30ef30970073b969430011da25e9412ffc217e8b Author: Caolán McNamara Date: Thu Jul 24 11:55:46 2014 +0100 Related: fdo#81641 create new styles with an initial name instead of creating with a blank name and changing it later this way undo of a style creation is initialized with its name and so create a style followed by deleting a style and undoing all those steps doesn't crash (cherry picked from commit e904562af54545684b32d2042ded6bdb9459edca) Conflicts: include/sfx2/styledlg.hxx sw/source/uibase/app/docst.cxx Change-Id: Ida7a34410d5d7b05edcb86950aabb3c672b82c8f style category listbox depends on being unsorted regression from commit 6ecfbf153a7c11c63d208630ac6a27064058099d Author: Caolán McNamara Date: Wed Mar 13 15:10:25 2013 + drop unused resources and toggle label to activate replacement widget Change-Id: I65ca8ec58ed984120f3c2e7ba68507cbf8acf089 (cherry picked from commit 11fab6b705638359b2ca0e3e85590aa7cc70a03a) Related: fdo#81641 exclude 'all styles' category from organizer page it doesn't make sense to be able to assign a style to 'all styles' Change-Id: I632c62f293b553e436ceb8da0baf2bb39941fd39 (cherry picked from commit 2223ff6cb99df097a357674801835c7a260b551d) Resolves: fdo#81641 the new style shouldn't be a conditional style regression from commit 715d79bcc59d68c77dc84a1038998dd873df92e9 Author: Cédric Bosdonnat Date: Fri Nov 30 11:51:46 2012 +0100 Styles & Formatting: added SFXSTYLEBIT_ALL_VISIBLE and show hidden styles commit 2fd9c2bf9af0c50dae3af3dbe5e22965ccdb4ae7 Author: Cédric Bosdonnat Date: Sun Nov 25 15:24:42 2012 +0100 Allow to hide styles in the "Styles & Formating" dialog In its current state, the feature only hides the styles. Things to sort out are: + Add some automatic filter to show hidden styles + Make the visibility persist in the file format (cherry picked from commit 1af0e46102350114dd5e854b7692c640dae2727f) Conflicts: sw/source/uibase/app/docst.cxx Change-Id: I7244d424765db0d5ed3aeaf380a8e1af56aa7eaf Reviewed-on: https://gerrit.libreoffice.org/10503 Reviewed-by: Michael Stahl Tested-by: Michael Stahl diff --git a/include/sfx2/styledlg.hxx b/include/sfx2/styledlg.hxx index b53e8cd..473 100644 --- a/include/sfx2/styledlg.hxx +++ b/include/sfx2/styledlg.hxx @@ -25,6 +25,7 @@ #include class SfxStyleSheetBase; +class SfxStyleSheetBasePool; class SFX2_DLLPUBLIC SfxStyleDialog: public SfxTabDialog { @@ -45,6 +46,8 @@ public: const SfxStyleSheetBase&GetStyleSheet() const { return *pStyle; } virtual short Ok(); + +static OUString GenerateUnusedName(SfxStyleSheetBasePool &rPool); }; #endif diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index cedbdc1..97dcf81 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -67,7 +67,9 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(Window* pParent, const SfxItemS m_pBaseLb->setMaxWidthChars(nMaxWidth); get(m_pFilterFt, "categoryft"); get(m_pFilterLb, "category"); -m_pFilterLb->SetStyle(m_pFilterLb->GetStyle() | WB_SORT); +//note that the code depends on categories not being lexically +//sorted, so if its changed to sorted, the code needs to +//be adapted to be position unaware m_pFilterLb->setMaxWidthChars(nMaxWidth); get(m_pDescFt, "desc"); @@ -94,16 +96,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(Window* pParent, const SfxItemS if ( pStyle->GetName().isEmpty() && pPool ) { // NullString as Name -> generate Name -OUString aNoName( SfxResId(STR_NONAME).toString() ); -sal_uInt16 nNo = 1; -OUString aNo( aNoName ); -aNoName += OUString::number( nNo ); -while ( pPool->Find( aNoName ) ) -{ -++nNo; -aNoName = aNo; -aNoName += OUString::number( nNo ); -} +OUString aNoName(SfxStyleDialog::GenerateUnusedName(*pPool)); pStyle->SetName( aNoName ); aName = aNoName; aFollow = pStyle->GetFollow(); @@ -193,6 +186,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(Window* pParent, const SfxItemS if ( pTupel->nFlags != SFXSTYLEBIT_AUTO && pTupel->nFlags != SFXSTYLEBIT_USED && + pTupel->nFlags != SFXSTYLEBIT_ALL_VISIBLE && pTupel->nFlags != SFXSTYLEBIT_ALL