[Libreoffice-commits] core.git: 2 commits - include/sfx2 oox/source sfx2/source sw/qa

Zolnai Tamás tamas.zolnai at collabora.com
Fri Jan 24 21:49:22 PST 2014


 include/sfx2/recentdocsview.hxx                       |    2 +
 include/sfx2/thumbnailview.hxx                        |    2 -
 oox/source/drawingml/textbodycontext.cxx              |    3 +
 sfx2/source/control/recentdocsview.cxx                |   35 +++++++++++++-----
 sfx2/source/dialog/backingcomp.cxx                    |   12 ++++++
 sfx2/source/dialog/backingwindow.cxx                  |    1 
 sw/qa/extras/ooxmlimport/data/dml-groupshape-sdt.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx              |    7 +++
 8 files changed, 53 insertions(+), 9 deletions(-)

New commits:
commit ba697931a74e047206739c1935dc06a0890c5661
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Sat Jan 25 00:13:36 2014 +0100

    drawingML import: parse shape text run inside w:sdt and s:sdtContent
    
    Change-Id: I6dc5939ae66967785cdc5dab318024b8cb17d1cd

diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx
index 77b5e7a..b9921e0 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -86,6 +86,9 @@ ContextHandlerRef TextParagraphContext::onCreateContext( sal_Int32 aElementToken
         return new TextParagraphPropertiesContext( *this, rAttribs, mrParagraph.getProperties() );
     case A_TOKEN( endParaRPr ):
         return new TextCharacterPropertiesContext( *this, rAttribs, mrParagraph.getEndProperties() );
+    case OOX_TOKEN( doc, sdt ):
+    case OOX_TOKEN( doc, sdtContent ):
+        return this;
     }
 
     return 0;
diff --git a/sw/qa/extras/ooxmlimport/data/dml-groupshape-sdt.docx b/sw/qa/extras/ooxmlimport/data/dml-groupshape-sdt.docx
new file mode 100644
index 0000000..7314d87
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/dml-groupshape-sdt.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 4dabefe..ab69ced 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1727,6 +1727,13 @@ DECLARE_OOXMLIMPORT_TEST(testFdo73389,"fdo73389.docx")
     // This was 9340, i.e. the width of the inner table was too large.
     CPPUNIT_ASSERT_EQUAL(sal_Int32(2842), getProperty<sal_Int32>(xTables->getByIndex(0), "Width"));
 }
+
+DECLARE_OOXMLIMPORT_TEST(testDMLGroupshapeSdt, "dml-groupshape-sdt.docx")
+{
+    uno::Reference<drawing::XShapes> xGroupShape(getShape(1), uno::UNO_QUERY);
+    // The text in the groupshape was missing due to the w:sdt and w:sdtContent wrapper around it.
+    CPPUNIT_ASSERT_EQUAL(OUString("sdt and sdtContent inside groupshape"), uno::Reference<text::XTextRange>(xGroupShape->getByIndex(1), uno::UNO_QUERY)->getString());
+}
 #endif
 
 
commit 9808306875fff4b97db6acb1182a153c874f15c5
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Thu Jan 23 13:34:48 2014 +0100

    Related fdo#65826: Set StartCenter's min width to display one column of docs
    
    If there is document to display. Otherwise set minimum to the width
    of greating background text.
    
    Updating minimum size is needed only when the list is cleared.
    
    Change-Id: Ic089571fd21d5ab9ded0f4cde7e1aa72fd508d32

diff --git a/include/sfx2/recentdocsview.hxx b/include/sfx2/recentdocsview.hxx
index 63a067d..1706935 100644
--- a/include/sfx2/recentdocsview.hxx
+++ b/include/sfx2/recentdocsview.hxx
@@ -56,6 +56,8 @@ public:
 
     int     mnFileTypes;
 
+    virtual void Clear();
+
     DECL_STATIC_LINK( RecentDocsView, ExecuteHdl_Impl, LoadRecentFile* );
 
 protected:
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 3ee7a45..139a838 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -192,7 +192,7 @@ public:
 
     void RemoveItem( sal_uInt16 nItemId );
 
-    void Clear();
+    virtual void Clear();
 
     // Change current thumbnail item list with new one (invalidates all pointers to a thumbnail item)
     void updateItems(const std::vector<ThumbnailViewItem *> &items);
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 69b6059..9ed9a96 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -54,14 +54,6 @@ RecentDocsView::RecentDocsView( Window* pParent )
     SetStyle(GetStyle() | WB_VSCROLL);
     setItemMaxTextLength( mnItemMaxTextLength );
     setItemDimensions( mnItemMaxSize, mnItemMaxSize, mnTextHeight, mnItemPadding );
-
-    // Set prefered width so text lines will not be cut off
-    Font aOldFont(GetFont());
-    Font aNewFont(aOldFont);
-    aNewFont.SetHeight(20);
-    SetFont(aNewFont);
-    set_width_request(std::max(GetTextWidth(maWelcomeLine1),GetTextWidth(maWelcomeLine2)));
-    SetFont(aOldFont);
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeRecentDocsView(Window *pParent, VclBuilder::stringmap &)
@@ -185,6 +177,21 @@ void RecentDocsView::loadRecentDocs()
 
     CalculateItemPositions();
     Invalidate();
+
+    // Set prefered width
+    if( mFilteredItemList.empty() )
+    {
+        Font aOldFont(GetFont());
+        Font aNewFont(aOldFont);
+        aNewFont.SetHeight(20);
+        SetFont(aNewFont);
+        set_width_request(std::max(GetTextWidth(maWelcomeLine1),GetTextWidth(maWelcomeLine2)));
+        SetFont(aOldFont);
+    }
+    else
+    {
+        set_width_request(mnItemMaxSize);
+    }
 }
 
 void RecentDocsView::MouseButtonDown( const MouseEvent& rMEvt )
@@ -304,6 +311,18 @@ long RecentDocsView::GetThumbnailSize() const
     return mnItemMaxSize;
 }
 
+void RecentDocsView::Clear()
+{
+    Font aOldFont(GetFont());
+    Font aNewFont(aOldFont);
+    aNewFont.SetHeight(20);
+    SetFont(aNewFont);
+    set_width_request(std::max(GetTextWidth(maWelcomeLine1),GetTextWidth(maWelcomeLine2)));
+    SetFont(aOldFont);
+
+    ThumbnailView::Clear();
+}
+
 IMPL_STATIC_LINK_NOINSTANCE( RecentDocsView, ExecuteHdl_Impl, LoadRecentFile*, pLoadRecentFile )
 {
     try
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index d79c545..7d51151 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -808,7 +808,19 @@ void SAL_CALL BackingComp::dispatch( const css::util::URL& aURL, const css::uno:
         Window* pWindow = VCLUnoHelper::GetWindow(m_xWindow);
         BackingWindow* pBack = dynamic_cast<BackingWindow*>(pWindow );
         if( pBack )
+        {
             pBack->clearRecentFileList();
+
+            // Recalculate minimum width
+            css::uno::Reference< css::awt::XWindow > xParentWindow = m_xFrame->getContainerWindow();
+            WorkWindow* pParent = (WorkWindow*)VCLUnoHelper::GetWindow(xParentWindow);
+            if( pParent )
+            {
+                pParent->SetMinOutputSizePixel( Size(
+                        pBack->get_width_request(),
+                        pParent->GetMinOutputSizePixel().Height()) );
+            }
+        }
     }
 }
 
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index bf128f0..daa3d10 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -557,5 +557,6 @@ Size BackingWindow::GetOptimalSize() const
 void BackingWindow::clearRecentFileList()
 {
     mpAllRecentThumbnails->Clear();
+    set_width_request(mpAllRecentThumbnails->get_width_request() + mpAllButtonsBox->GetOptimalSize().Width());
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab:*/


More information about the Libreoffice-commits mailing list