[Libreoffice-commits] .: 4 commits - dbaccess/source offapi/type_reference solenv/gbuild svtools/inc svtools/Library_svt.mk svtools/prj svtools/source udkapi/com udkapi/UnoApi_udkapi.mk

Stephan Bergmann sbergmann at kemper.freedesktop.org
Tue Mar 13 02:41:47 PDT 2012


 dbaccess/source/ui/app/AppDetailPageHelper.cxx |    2 
 offapi/type_reference/types.rdb                |binary
 solenv/gbuild/platform/IOS_ARM_GCC.mk          |    3 
 solenv/gbuild/platform/WNT_INTEL_GCC.mk        |    3 
 solenv/gbuild/platform/macosx.mk               |    3 
 solenv/gbuild/platform/unxgcc.mk               |    3 
 svtools/Library_svt.mk                         |    1 
 svtools/inc/svtools/DocumentInfoPreview.hxx    |   67 +++++---
 svtools/prj/build.lst                          |    2 
 svtools/source/contnr/DocumentInfoPreview.cxx  |  181 +++++++++++++++++++++++
 svtools/source/contnr/fileview.cxx             |    6 
 svtools/source/contnr/fileview.hxx             |   42 +++++
 svtools/source/contnr/templwin.cxx             |  190 -------------------------
 svtools/source/contnr/templwin.hxx             |   10 -
 svtools/source/edit/texteng.cxx                |    6 
 udkapi/UnoApi_udkapi.mk                        |    4 
 udkapi/com/sun/star/script/Converter.idl       |    8 -
 17 files changed, 296 insertions(+), 235 deletions(-)

New commits:
commit 40c0ff75d2a0f987454b068a663908e6d9b87b9b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 13 10:33:10 2012 +0100

    TextEngine::SeekCursor needs to call SetFont after all
    
    10f28d5c9a072bf108a79f3b05ad8247ca0dcea5 "callcatcher: build fixes" had removed
    this with the comment "SetFont() doesn't do anything" but that is clearly wrong:
    Without this, e.g. bold text within text fields is not displayed as such (e.g.,
    "File - New - Templates and Documnets - Templates - Presentation Backgrounds -
    Black and White": the captions in the right hand pane ("Title:", "Date:", etc.)
    should be bold).

diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx
index 6baf8a9..30aef8f 100644
--- a/svtools/source/edit/texteng.cxx
+++ b/svtools/source/edit/texteng.cxx
@@ -1476,7 +1476,11 @@ void TextEngine::SeekCursor( sal_uLong nPara, sal_uInt16 nPos, Font& rFont, Outp
         if ( ( ( pAttrib->GetStart() < nPos ) && ( pAttrib->GetEnd() >= nPos ) )
                     || !pNode->GetText().Len() )
         {
-            if ( pAttrib->Which() == TEXTATTR_FONTCOLOR )
+            if ( pAttrib->Which() != TEXTATTR_FONTCOLOR )
+            {
+                pAttrib->GetAttr().SetFont(rFont);
+            }
+            else
             {
                 if ( pOutDev )
                     pOutDev->SetTextColor( ((TextAttribFontColor&)pAttrib->GetAttr()).GetColor() );
commit 760e0d2d7329ca6fc00a8439715bae38becb168a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Mar 12 23:58:25 2012 +0100

    Document reason for -Wno-non-virtual-dtor

diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk
index 3483213..d72043b 100644
--- a/solenv/gbuild/platform/IOS_ARM_GCC.mk
+++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk
@@ -59,6 +59,9 @@ gb_CFLAGS := \
 	-Wshadow \
 	-fno-strict-aliasing \
 
+# For -Wno-non-virtual-dtor see <http://markmail.org/message/664jsoqe6n6smy3b>
+# "Re: [dev] warnings01: -Wnon-virtual-dtor" message to dev at openoffice.org from
+# Feb 1, 2006:
 gb_CXXFLAGS := \
 	$(gb_CXXFLAGS_COMMON) \
 	-Wno-ctor-dtor-privacy \
diff --git a/solenv/gbuild/platform/WNT_INTEL_GCC.mk b/solenv/gbuild/platform/WNT_INTEL_GCC.mk
index 9126288..834f5e9 100644
--- a/solenv/gbuild/platform/WNT_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/WNT_INTEL_GCC.mk
@@ -58,6 +58,9 @@ gb_CFLAGS += \
 	-Wdeclaration-after-statement \
 	-fno-strict-aliasing \
 
+# For -Wno-non-virtual-dtor see <http://markmail.org/message/664jsoqe6n6smy3b>
+# "Re: [dev] warnings01: -Wnon-virtual-dtor" message to dev at openoffice.org from
+# Feb 1, 2006:
 gb_CXXFLAGS := \
 	$(gb_CXXFLAGS_COMMON) \
 	-Wno-ctor-dtor-privacy \
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 033d32e..9a91824 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -59,6 +59,9 @@ gb_CFLAGS := \
 	-fno-strict-aliasing \
     #-Wshadow \ break in compiler headers already
 
+# For -Wno-non-virtual-dtor see <http://markmail.org/message/664jsoqe6n6smy3b>
+# "Re: [dev] warnings01: -Wnon-virtual-dtor" message to dev at openoffice.org from
+# Feb 1, 2006:
 gb_CXXFLAGS := \
 	-isysroot $(gb_SDKDIR) \
 	$(gb_CXXFLAGS_COMMON) \
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 1a813d4..c709fde 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -55,6 +55,9 @@ gb_CFLAGS := \
 	-Wdeclaration-after-statement \
 	-Wshadow \
 
+# For -Wno-non-virtual-dtor see <http://markmail.org/message/664jsoqe6n6smy3b>
+# "Re: [dev] warnings01: -Wnon-virtual-dtor" message to dev at openoffice.org from
+# Feb 1, 2006:
 gb_CXXFLAGS := \
 	$(gb_CXXFLAGS_COMMON) \
 	-fPIC \
commit cbdc446e6f49ee0968f3c0765b3349f5e681018b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Mar 12 19:58:09 2012 +0100

    Clean up ODocumentInfoPreview

diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 758ca72..dcbf274 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -1116,7 +1116,7 @@ void OAppDetailPageHelper::showPreview(const Reference< XContent >& _xContent)
                 else
                 {
                     m_aPreview.Hide();
-                    m_aDocumentInfo.Clear();
+                    m_aDocumentInfo.clear();
                     m_aDocumentInfo.Show();
                     Reference<document::XDocumentProperties> xProp(
                         aPreview, UNO_QUERY);
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index 653d4ad..55b6515 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -94,6 +94,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
     svtools/source/config/miscopt \
     svtools/source/config/optionsdrawinglayer \
     svtools/source/config/printoptions \
+    svtools/source/contnr/DocumentInfoPreview \
     svtools/source/contnr/contentenumeration \
     svtools/source/contnr/fileview \
     svtools/source/contnr/imivctl1 \
diff --git a/svtools/inc/svtools/DocumentInfoPreview.hxx b/svtools/inc/svtools/DocumentInfoPreview.hxx
index 8dfb254..c48862e 100644
--- a/svtools/inc/svtools/DocumentInfoPreview.hxx
+++ b/svtools/inc/svtools/DocumentInfoPreview.hxx
@@ -25,36 +25,57 @@
  * for a copy of the LGPLv3 License.
  *
  ************************************************************************/
+
 #ifndef SVTOOLS_DOCUMENTINFOPREVIEW_HXX
 #define SVTOOLS_DOCUMENTINFOPREVIEW_HXX
 
+#include "sal/config.h"
+
+#include "boost/scoped_ptr.hpp"
+#include "com/sun/star/lang/Locale.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "svtools/svmedit2.hxx"
 #include "svtools/svtdllapi.h"
-#include <vcl/window.hxx>
-#include <com/sun/star/document/XDocumentProperties.hpp>
-#include <com/sun/star/lang/Locale.hpp>
+#include "tools/wintypes.hxx"
+#include "vcl/window.hxx"
 
-class SvtExtendedMultiLineEdit_Impl;
 class SvtDocInfoTable_Impl;
 
-namespace svtools
-{
-    class SVT_DLLPUBLIC ODocumentInfoPreview : public Window
-    {
-        SvtExtendedMultiLineEdit_Impl*  m_pEditWin;
-        SvtDocInfoTable_Impl*           m_pInfoTable;
-        com::sun::star::lang::Locale    m_aLocale;
-
-    public:
-        ODocumentInfoPreview( Window* pParent ,WinBits _nBits);
-        virtual ~ODocumentInfoPreview();
-
-        virtual void Resize();
-        void    Clear();
-        void    fill(const ::com::sun::star::uno::Reference<
-                  ::com::sun::star::document::XDocumentProperties>& i_xDocProps
-                    ,const String& i_rURL);
-        void SetAutoScroll(sal_Bool _bAutoScroll);
-    };
+namespace com { namespace sun { namespace star {
+    namespace document { class XDocumentProperties; }
+    namespace util { struct DateTime; }
+} } }
+namespace rtl { class OUString; }
+
+namespace svtools {
+
+class SVT_DLLPUBLIC ODocumentInfoPreview: public Window {
+public:
+    ODocumentInfoPreview(Window * pParent, WinBits nBits);
+
+    virtual ~ODocumentInfoPreview();
+
+    virtual void Resize();
+
+    void clear();
+
+    void fill(
+        com::sun::star::uno::Reference<
+            com::sun::star::document::XDocumentProperties > const & xDocProps,
+        rtl::OUString const & rURL);
+
+private:
+    ExtMultiLineEdit m_pEditWin;
+    boost::scoped_ptr< SvtDocInfoTable_Impl > m_pInfoTable;
+    com::sun::star::lang::Locale m_aLocale;
+
+    void insertEntry(rtl::OUString const & title, rtl::OUString const & value);
+
+    void insertNonempty(long id, rtl::OUString const & value);
+
+    void insertDateTime(long id, com::sun::star::util::DateTime const & value);
+};
+
 }
 
 #endif // SVTOOLS_DOCUMENTINFOPREVIEW_HXX
diff --git a/svtools/prj/build.lst b/svtools/prj/build.lst
index b18ec97..6ca87fc 100644
--- a/svtools/prj/build.lst
+++ b/svtools/prj/build.lst
@@ -1,2 +1,2 @@
-st	svtools	:	TRANSLATIONS:translations svl offapi toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper configmgr sal salhelper sot jvmfwk LIBXSLT:libxslt ure test NULL
+st	svtools	: TRANSLATIONS:translations svl offapi toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper configmgr sal salhelper sot jvmfwk LIBXSLT:libxslt ure test NULL
 st	svtools\prj					        nmake	-	all	st_prj NULL
diff --git a/svtools/source/contnr/DocumentInfoPreview.cxx b/svtools/source/contnr/DocumentInfoPreview.cxx
new file mode 100644
index 0000000..805ed0a
--- /dev/null
+++ b/svtools/source/contnr/DocumentInfoPreview.cxx
@@ -0,0 +1,181 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "sal/config.h"
+
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/document/XDocumentProperties.hpp"
+#include "com/sun/star/script/Converter.hpp"
+#include "com/sun/star/script/XTypeConverter.hpp"
+#include "comphelper/processfactory.hxx"
+#include "comphelper/string.hxx"
+#include "rtl/oustringostreaminserter.hxx"
+#include "svl/inettype.hxx"
+#include "svtools/DocumentInfoPreview.hxx"
+#include "svtools/imagemgr.hxx"
+#include "svtools/txtattr.hxx"
+#include "tools/datetime.hxx"
+#include "tools/urlobj.hxx"
+#include "unotools/pathoptions.hxx"
+#include "unotools/ucbhelper.hxx"
+
+#include "fileview.hxx"
+#include "templwin.hrc"
+#include "templwin.hxx"
+
+namespace svtools {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+ODocumentInfoPreview::ODocumentInfoPreview(Window * pParent, WinBits nBits):
+    Window(pParent, WB_DIALOGCONTROL), m_pEditWin(this, nBits),
+    m_pInfoTable(new SvtDocInfoTable_Impl),
+    m_aLocale(SvtPathOptions().GetLocale()) // detect application language
+{
+    m_pEditWin.SetLeftMargin(10);
+    m_pEditWin.Show();
+    m_pEditWin.EnableCursor(false);
+}
+
+ODocumentInfoPreview::~ODocumentInfoPreview() {}
+
+void ODocumentInfoPreview::Resize() {
+    m_pEditWin.SetPosSizePixel(Point(0, 0), GetOutputSize());
+}
+
+void ODocumentInfoPreview::clear() {
+    m_pEditWin.SetText(rtl::OUString());
+}
+
+void ODocumentInfoPreview::fill(
+    css::uno::Reference< css::document::XDocumentProperties > const & xDocProps,
+    rtl::OUString const & rURL)
+{
+    assert(xDocProps.is());
+
+    m_pEditWin.SetAutoScroll(false);
+
+    insertNonempty(DI_TITLE, xDocProps->getTitle());
+    insertNonempty(DI_FROM, xDocProps->getAuthor());
+    insertDateTime(DI_DATE, xDocProps->getCreationDate());
+    insertNonempty(DI_MODIFIEDBY, xDocProps->getModifiedBy());
+    insertDateTime(DI_MODIFIEDDATE, xDocProps->getModificationDate());
+    insertNonempty(DI_PRINTBY, xDocProps->getPrintedBy());
+    insertDateTime(DI_PRINTDATE, xDocProps->getPrintDate());
+    insertNonempty(DI_THEME, xDocProps->getSubject());
+    insertNonempty(
+        DI_KEYWORDS,
+        comphelper::string::convertCommaSeparated(xDocProps->getKeywords()));
+    insertNonempty(DI_DESCRIPTION, xDocProps->getDescription());
+    if (!rURL.isEmpty()) {
+        insertNonempty(
+            DI_SIZE, CreateExactSizeText(utl::UCBContentHelper::GetSize(rURL)));
+        INetContentType eTypeID = INetContentTypes::GetContentTypeFromURL(rURL);
+        insertNonempty(
+            DI_MIMETYPE,
+            (eTypeID == CONTENT_TYPE_APP_OCTSTREAM
+             ? SvFileInformationManager::GetDescription(INetURLObject(rURL))
+             : INetContentTypes::GetPresentation(eTypeID, m_aLocale)));
+    }
+
+    // User-defined (custom) properties:
+    css::uno::Reference< css::beans::XPropertySet > user(
+        xDocProps->getUserDefinedProperties(), css::uno::UNO_QUERY_THROW);
+    css::uno::Reference< css::beans::XPropertySetInfo > info(
+        user->getPropertySetInfo());
+    css::uno::Sequence< css::beans::Property > props(info->getProperties());
+    for (sal_Int32 i = 0; i < props.getLength(); ++i) {
+        rtl::OUString name(props[i].Name);
+        css::uno::Any aAny(user->getPropertyValue(name));
+        css::uno::Reference< css::script::XTypeConverter > conv(
+            css::script::Converter::create(
+                comphelper::getProcessComponentContext()));
+        rtl::OUString value;
+        try {
+            value = conv->convertToSimpleType(aAny, css::uno::TypeClass_STRING).
+                get< rtl::OUString >();
+        } catch (css::script::CannotConvertException & e) {
+            SAL_INFO("svtools", "ignored CannotConvertException " << e.Message);
+        }
+        if (!value.isEmpty()) {
+            insertEntry(name, value);
+        }
+    }
+
+    m_pEditWin.SetSelection(Selection(0, 0));
+    m_pEditWin.SetAutoScroll(true);
+}
+
+void ODocumentInfoPreview::insertEntry(
+    rtl::OUString const & title, rtl::OUString const & value)
+{
+    rtl::OUString p1(rtl::OUString("\n") + title + rtl::OUString(":"));
+    m_pEditWin.InsertText(p1);
+    m_pEditWin.SetAttrib(
+        TextAttribFontWeight(WEIGHT_BOLD), m_pEditWin.GetParagraphCount() - 1,
+        0, p1.getLength());
+    rtl::OUString p2(rtl::OUString("\n") + value);
+    m_pEditWin.InsertText(p2);
+    m_pEditWin.SetAttrib(
+        TextAttribFontWeight(WEIGHT_NORMAL),
+        m_pEditWin.GetParagraphCount() - 1, 0, p2.getLength());
+    m_pEditWin.InsertText(rtl::OUString("\n"));
+}
+
+void ODocumentInfoPreview::insertNonempty(long id, rtl::OUString const & value)
+{
+    if (!value.isEmpty()) {
+        insertEntry(m_pInfoTable->GetString(id), value);
+    }
+}
+
+void ODocumentInfoPreview::insertDateTime(
+    long id, css::util::DateTime const & value)
+{
+    DateTime aToolsDT(
+        Date(value.Day, value.Month, value.Year),
+        Time(
+            value.Hours, value.Minutes, value.Seconds, value.HundredthSeconds));
+    if (aToolsDT.IsValidAndGregorian()) {
+        LocaleDataWrapper aLocaleWrapper(
+            comphelper::getProcessServiceFactory(),
+            Application::GetSettings().GetLocale());
+        rtl::OUStringBuffer buf(aLocaleWrapper.getDate(aToolsDT));
+        buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
+        buf.append(aLocaleWrapper.getTime(aToolsDT));
+        insertEntry(m_pInfoTable->GetString(id), buf.makeStringAndClear());
+    }
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 4e1ff6e..ab3f6d8 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -26,6 +26,7 @@
  *
  ************************************************************************/
 
+#include "sal/config.h"
 
 #include <svtools/fileview.hxx>
 #include <svtools/svtdata.hxx>
@@ -34,6 +35,7 @@
 #include <svtools/svtabbx.hxx>
 #include <svtools/svtools.hrc>
 #include "fileview.hrc"
+#include "fileview.hxx"
 #include "contentenumeration.hxx"
 #include <svtools/AccessibleBrowseBoxObjType.hxx>
 #include <com/sun/star/util/DateTime.hpp>
@@ -656,7 +658,7 @@ inline void SvtFileView_Impl::EndEditing( bool _bCancel )
 
 // functions -------------------------------------------------------------
 
-OUString CreateExactSizeText_Impl( sal_Int64 nSize )
+OUString CreateExactSizeText( sal_Int64 nSize )
 {
     double fSize( ( double ) nSize );
     int nDec;
@@ -2223,7 +2225,7 @@ void SvtFileView_Impl::CreateDisplayText_Impl()
         aValue += aTab;
         // folders don't have a size
         if ( ! (*aIt)->mbIsFolder )
-            aValue += CreateExactSizeText_Impl( (*aIt)->maSize );
+            aValue += CreateExactSizeText( (*aIt)->maSize );
         aValue += aTab;
         // set the date, but volumes have no date
         if ( ! (*aIt)->mbIsFolder || ! (*aIt)->mbIsVolume )
diff --git a/svtools/source/contnr/fileview.hxx b/svtools/source/contnr/fileview.hxx
new file mode 100644
index 0000000..d0940fb
--- /dev/null
+++ b/svtools/source/contnr/fileview.hxx
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_SVTOOLS_SOURCE_CONTNR_FILEVIEW_HXX
+#define INCLUDED_SVTOOLS_SOURCE_CONTNR_FILEVIEW_HXX
+
+#include "sal/config.h"
+
+#include "sal/types.h"
+
+namespace rtl { class OUString; }
+
+rtl::OUString CreateExactSizeText(sal_Int64 nSize);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx
index d23862d..3bdb0f7 100644
--- a/svtools/source/contnr/templwin.cxx
+++ b/svtools/source/contnr/templwin.cxx
@@ -43,7 +43,6 @@
 #include <svtools/svtools.hrc>
 #include "templwin.hrc"
 #include <svtools/helpid.hrc>
-#include <unotools/pathoptions.hxx>
 #include <unotools/viewoptions.hxx>
 #include <unotools/ucbhelper.hxx>
 #include "unotools/configmgr.hxx"
@@ -97,7 +96,6 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::view;
 using namespace svtools;
 
-extern ::rtl::OUString CreateExactSizeText_Impl( sal_Int64 nSize ); // fileview.cxx
 #define aSeparatorStr   "----------------------------------"
 
 #define SPLITSET_ID         0
@@ -129,163 +127,6 @@ struct FolderHistory
 
 typedef ::std::vector< ::rtl::OUString* > NewDocList_Impl;
 
-ODocumentInfoPreview::ODocumentInfoPreview( Window* pParent ,WinBits _nBits) : Window(pParent,WB_DIALOGCONTROL)
-{
-    m_pEditWin = new SvtExtendedMultiLineEdit_Impl(this,_nBits);
-    m_pEditWin->Show();
-    m_pEditWin->EnableCursor( sal_False );
-    m_pInfoTable = new SvtDocInfoTable_Impl();
-    // detect application language
-    m_aLocale = SvtPathOptions().GetLocale();
-}
-// -----------------------------------------------------------------------------
-ODocumentInfoPreview::~ODocumentInfoPreview()
-{
-    delete m_pEditWin;
-    delete m_pInfoTable;
-}
-// -----------------------------------------------------------------------------
-void ODocumentInfoPreview::Resize()
-{
-    Size aOutputSize( GetOutputSize() );
-    m_pEditWin->SetPosSizePixel( Point(0,0),aOutputSize);
-}
-// -----------------------------------------------------------------------------
-void ODocumentInfoPreview::Clear()
-{
-    m_pEditWin->Clear();
-}
-// -----------------------------------------------------------------------------
-
-void lcl_insertDateTimeEntry(SvtExtendedMultiLineEdit_Impl* i_pEditWin,
-    const ::rtl::OUString & i_rName, const util::DateTime & i_rUDT)
-{
-    DateTime aToolsDT =
-        DateTime( Date( i_rUDT.Day, i_rUDT.Month, i_rUDT.Year ),
-                Time( i_rUDT.Hours, i_rUDT.Minutes,
-                      i_rUDT.Seconds, i_rUDT.HundredthSeconds ) );
-    if ( aToolsDT.IsValidAndGregorian() )
-    {
-        LocaleDataWrapper aLocaleWrapper(
-            ::comphelper::getProcessServiceFactory(),
-            Application::GetSettings().GetLocale() );
-        String aDateStr = aLocaleWrapper.getDate( aToolsDT );
-        aDateStr += String( RTL_CONSTASCII_USTRINGPARAM(", ") );
-        aDateStr += aLocaleWrapper.getTime( aToolsDT );
-        i_pEditWin->InsertEntry( i_rName, aDateStr );
-    }
-}
-
-void ODocumentInfoPreview::fill(
-    const Reference< XDocumentProperties >& i_xDocProps, const String& i_rURL)
-{
-    if (!i_xDocProps.is()) throw RuntimeException();
-
-    ::rtl::OUString aStr;
-    m_pEditWin->SetAutoScroll( sal_False );
-
-    aStr = i_xDocProps->getTitle();
-    if (!aStr.isEmpty()) {
-        m_pEditWin->InsertEntry( m_pInfoTable->GetString( DI_TITLE ), aStr );
-    }
-
-    aStr = i_xDocProps->getAuthor();
-    if (!aStr.isEmpty()) {
-        m_pEditWin->InsertEntry( m_pInfoTable->GetString( DI_FROM ), aStr );
-    }
-
-    lcl_insertDateTimeEntry(m_pEditWin,
-            m_pInfoTable->GetString( DI_DATE ),
-            i_xDocProps->getCreationDate());
-
-    aStr = i_xDocProps->getModifiedBy();
-    if (!aStr.isEmpty()) {
-        m_pEditWin->InsertEntry( m_pInfoTable->GetString(DI_MODIFIEDBY), aStr );
-    }
-
-    lcl_insertDateTimeEntry(m_pEditWin,
-            m_pInfoTable->GetString( DI_MODIFIEDDATE ),
-            i_xDocProps->getModificationDate());
-
-    aStr = i_xDocProps->getPrintedBy();
-    if (!aStr.isEmpty()) {
-        m_pEditWin->InsertEntry( m_pInfoTable->GetString( DI_PRINTBY ), aStr );
-    }
-
-    lcl_insertDateTimeEntry(m_pEditWin,
-            m_pInfoTable->GetString( DI_PRINTDATE ),
-            i_xDocProps->getPrintDate());
-
-    aStr = i_xDocProps->getSubject();
-    if (!aStr.isEmpty()) {
-        m_pEditWin->InsertEntry( m_pInfoTable->GetString( DI_THEME ), aStr );
-    }
-
-    aStr =
-        ::comphelper::string::convertCommaSeparated(i_xDocProps->getKeywords());
-    if (!aStr.isEmpty()) {
-        m_pEditWin->InsertEntry( m_pInfoTable->GetString( DI_KEYWORDS ), aStr );
-    }
-
-    aStr = i_xDocProps->getDescription();
-    if (!aStr.isEmpty()) {
-        m_pEditWin->InsertEntry( m_pInfoTable->GetString( DI_DESCRIPTION ),
-            aStr );
-    }
-
-    // size
-    if ( i_rURL.Len() > 0 )
-    {
-        m_pEditWin->InsertEntry(
-            m_pInfoTable->GetString( DI_SIZE ),
-            CreateExactSizeText_Impl( utl::UCBContentHelper::GetSize( i_rURL ) ) );
-    }
-
-    // MIMEType
-    if ( i_rURL.Len() > 0 )
-    {
-        INetContentType eTypeID =
-            INetContentTypes::GetContentTypeFromURL( i_rURL );
-        if ( eTypeID != CONTENT_TYPE_APP_OCTSTREAM ) {
-            aStr = INetContentTypes::GetPresentation( eTypeID, m_aLocale );
-        } else {
-            aStr = SvFileInformationManager::GetDescription(
-                        INetURLObject(i_rURL) );
-        }
-        if (!aStr.isEmpty()) {
-            m_pEditWin->InsertEntry( m_pInfoTable->GetString( DI_MIMETYPE ),
-                aStr );
-        }
-    }
-
-    // user-defined (custom) properties
-    Reference< XPropertySet > xUserDefined(
-        i_xDocProps->getUserDefinedProperties(), UNO_QUERY_THROW );
-    Reference< XPropertySetInfo > xUDInfo = xUserDefined->getPropertySetInfo();
-    Sequence< Property > props = xUDInfo->getProperties();
-    for (sal_Int32 i = 0; i < props.getLength(); ++i) {
-        const ::rtl::OUString name = props[i].Name;
-        uno::Any aAny;
-        try {
-            aAny = xUserDefined->getPropertyValue(name);
-            uno::Reference < script::XTypeConverter > xConverter(
-                comphelper::getProcessServiceFactory()->createInstance(
-                    ASCII_STR("com.sun.star.script.Converter")),
-                UNO_QUERY );
-            uno::Any aNew;
-            aNew = xConverter->convertToSimpleType( aAny, TypeClass_STRING );
-            if ((aNew >>= aStr) && !aStr.isEmpty()) {
-                m_pEditWin->InsertEntry( name, aStr);
-            }
-        } catch (uno::Exception &) {
-            // ignore
-        }
-    }
-
-    m_pEditWin->SetSelection( Selection( 0, 0 ) );
-    m_pEditWin->SetAutoScroll( sal_True );
-}
-
 // class SvtDummyHeaderBar_Impl ------------------------------------------
 
 void SvtDummyHeaderBar_Impl::UpdateBackgroundColor()
@@ -760,35 +601,6 @@ SvtDocInfoTable_Impl::SvtDocInfoTable_Impl() :
 
 {
 }
-// -----------------------------------------------------------------------------
-// class SvtExtendedMultiLineEdit_Impl --------------------------------------------
-SvtExtendedMultiLineEdit_Impl::SvtExtendedMultiLineEdit_Impl( Window* pParent,WinBits _nBits ) :
-
-    ExtMultiLineEdit( pParent, _nBits )
-
-{
-    SetLeftMargin( 10 );
-}
-// -----------------------------------------------------------------------------
-void SvtExtendedMultiLineEdit_Impl::InsertEntry( const String& rTitle, const String& rValue )
-{
-    String aText( '\n' );
-    aText += rTitle;
-    aText += ':';
-    InsertText( aText );
-    sal_uLong nPara = GetParagraphCount() - 1;
-    SetAttrib( TextAttribFontWeight( WEIGHT_BOLD ), nPara, 0, aText.Len() );
-
-    aText = '\n';
-    aText += rValue;
-    InsertText( aText );
-    nPara = GetParagraphCount() - 1;
-    SetAttrib( TextAttribFontWeight( WEIGHT_NORMAL ), nPara, 0, aText.Len() );
-
-    InsertText( String( '\n' ) );
-}
-// -----------------------------------------------------------------------------
-
 // -----------------------------------------------------------------------
 
 const String& SvtDocInfoTable_Impl::GetString( long nId ) const
@@ -896,7 +708,7 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B
         aCurrentURL = rURL;
 
     ViewNonEmptyWin();
-    pEditWin->Clear();
+    pEditWin->clear();
 
     if ( rURL.Len() > 0 && bPreview && m_xDocProps.is() )
         ShowDocInfo( rURL );
diff --git a/svtools/source/contnr/templwin.hxx b/svtools/source/contnr/templwin.hxx
index 7e2c750..207efeb 100644
--- a/svtools/source/contnr/templwin.hxx
+++ b/svtools/source/contnr/templwin.hxx
@@ -176,16 +176,6 @@ public:
     const String&   GetString( long nId ) const;
 };
 
-class SvtExtendedMultiLineEdit_Impl : public ExtMultiLineEdit
-{
-public:
-    SvtExtendedMultiLineEdit_Impl( Window* pParent,WinBits _nBits );
-    inline ~SvtExtendedMultiLineEdit_Impl() {}
-
-    inline void         Clear() { SetText( String() ); }
-    void                InsertEntry( const String& rTitle, const String& rValue );
-};
-
 class SvtFrameWindow_Impl : public Window
 {
 private:
commit 3f89190894b056639e9a323ebffe7a2e20ad4dc4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Mar 12 19:55:21 2012 +0100

    Make Converter service new-style, for easier use

diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index c12270b..19ad36b 100644
Binary files a/offapi/type_reference/types.rdb and b/offapi/type_reference/types.rdb differ
diff --git a/udkapi/UnoApi_udkapi.mk b/udkapi/UnoApi_udkapi.mk
index fb1ac94..6ba7803 100644
--- a/udkapi/UnoApi_udkapi.mk
+++ b/udkapi/UnoApi_udkapi.mk
@@ -111,7 +111,6 @@ $(eval $(call gb_UnoApiTarget_add_idlfiles_noheader,udkapi,udkapi/com/sun/star/r
 ))
 $(eval $(call gb_UnoApiTarget_add_idlfiles_noheader,udkapi,udkapi/com/sun/star/script,\
 	AllListenerAdapter \
-	Converter \
 	Engine \
 	Invocation \
 	InvocationAdapterFactory \
@@ -153,6 +152,9 @@ $(eval $(call gb_UnoApiTarget_add_idlfiles_nohdl,udkapi,udkapi/com/sun/star/io,\
 	SequenceOutputStream \
 	TempFile \
 ))
+$(eval $(call gb_UnoApiTarget_add_idlfiles_nohdl,udkapi,udkapi/com/sun/star/script,\
+	Converter \
+))
 $(eval $(call gb_UnoApiTarget_add_idlfiles_nohdl,udkapi,udkapi/com/sun/star/uri,\
 	ExternalUriReferenceTranslator \
 	UriReferenceFactory \
diff --git a/udkapi/com/sun/star/script/Converter.idl b/udkapi/com/sun/star/script/Converter.idl
index a98b49b..7e3b7e0 100644
--- a/udkapi/com/sun/star/script/Converter.idl
+++ b/udkapi/com/sun/star/script/Converter.idl
@@ -85,13 +85,7 @@
     of the destination sequence.</li>
     </ul>
 */
-published service Converter
-{
-    /** Conversion interface.
-    */
-    interface com::sun::star::script::XTypeConverter;
-
-};
+published service Converter: XTypeConverter;
 
 //=============================================================================
 


More information about the Libreoffice-commits mailing list