sfx2/source/doc/templatedlg.cxx |   40 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 38 insertions(+), 2 deletions(-)

New commits:
commit a2952b9a768915e9c0c91135fd2f9d7e742c53f6
Author: Rafael Dominguez <venccsra...@gmail.com>
Date:   Mon Jun 25 11:51:05 2012 -0430

    Add a function to create a new template depending on their type.
    
    Change-Id: Ic4a0e74e7f87d2e7772ab5f92980c54f5d06e7f8

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 96171aa..f69e74c 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -41,6 +41,8 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::frame;
 
+void lcl_createTemplate(const FILTER_APPLICATION eApp);
+
 SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
     : ModalDialog(parent, SfxResId(DLG_TEMPLATE_MANAGER)),
       aButtonAll(this,SfxResId(BTN_SELECT_ALL)),
@@ -422,4 +424,33 @@ void SfxTemplateManagerDlg::OnTemplateDelete ()
     }
 }
 
+void lcl_createTemplate(const FILTER_APPLICATION eApp)
+{
+    rtl::OUString aURL;
+
+    switch(eApp)
+    {
+    case FILTER_APP_WRITER:
+        aURL = "private:factory/swriter";
+        break;
+    case FILTER_APP_CALC:
+        aURL = "private:factory/scalc";
+        break;
+    case FILTER_APP_IMPRESS:
+        aURL = "private:factory/simpress";
+        break;
+    case FILTER_APP_DRAW:
+        aURL = "private:factory/sdraw";
+        break;
+    default:
+        break;
+    }
+
+    if (!aURL.isEmpty())
+    {
+        uno::Sequence<PropertyValue> aArgs;
+        mxDesktop->loadComponentFromURL(aURL,rtl::OUString("_blank"), 0, aArgs 
);
+    }
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit bdd1cfa4a56cdf7f8fa6b65384d379e359dbfa50
Author: Rafael Dominguez <venccsra...@gmail.com>
Date:   Sun Jun 24 17:39:32 2012 -0430

    Expand/Reduce dialog when search editbox is visible/hidden.
    
    Change-Id: Ia7f4d078b80ab2ed5c2a7d7224eee9aaea2dfb16

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index b1b6395..96171aa 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -353,18 +353,23 @@ void SfxTemplateManagerDlg::OnTemplateSearch ()
 {
     Point aPos = maView->GetPosPixel();
     bool bVisible = mpSearchEdit->IsVisible();
+    Size aWinSize = GetSizePixel();
+    long nEditHeight = mpSearchEdit->GetSizePixel().getHeight();
 
     if (bVisible)
     {
-        aPos.setY(aPos.getY() - mpSearchEdit->GetSizePixel().getHeight());
+        aWinSize.setHeight(aWinSize.getHeight() - nEditHeight );
+        aPos.setY(aPos.getY() - nEditHeight );
         mpActionBar->SetItemState(TBI_TEMPLATE_SEARCH,STATE_NOCHECK);
     }
     else
     {
-        aPos.setY(aPos.getY() + mpSearchEdit->GetSizePixel().getHeight());
+        aWinSize.setHeight(aWinSize.getHeight() + nEditHeight );
+        aPos.setY(aPos.getY() + nEditHeight );
         mpActionBar->SetItemState(TBI_TEMPLATE_SEARCH,STATE_CHECK);
     }
 
+    SetSizePixel(aWinSize);
     maView->SetPosPixel(aPos);
     mpSearchEdit->Show(!bVisible);
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to