[ooo-build-commit] .: filter/inc filter/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Tue Sep 14 07:25:54 PDT 2010


 filter/inc/filter/msfilter/msocximex.hxx |   34 ++++++++++
 filter/source/msfilter/msocximex.cxx     |  100 ++++++++++++++++++++++++++++++-
 2 files changed, 133 insertions(+), 1 deletion(-)

New commits:
commit c3021283557ae52aa6929492b9546259564955b3
Author: Florian Reuter <freuter at novell.com>
Date:   Tue Sep 14 16:12:59 2010 +0200

    sw-import-html-controls.diff:
    
    n#485609

diff --git a/filter/inc/filter/msfilter/msocximex.hxx b/filter/inc/filter/msfilter/msocximex.hxx
index b8733b1..c50c5a4 100644
--- a/filter/inc/filter/msfilter/msocximex.hxx
+++ b/filter/inc/filter/msfilter/msocximex.hxx
@@ -1417,4 +1417,38 @@ public:
                                 const com::sun::star::awt::Size& rSize );
 };
 
+
+class HTML_TextBox : public OCX_ModernControl
+{
+public:
+    HTML_TextBox() : OCX_ModernControl(rtl::OUString::createFromAscii("TextBox")) {
+        msFormType = rtl::OUString::createFromAscii("com.sun.star.form.component.TextField");
+        msDialogType = rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlEditModel");
+        mnBackColor = 0x80000005L;
+        mnForeColor = 0x80000008L;
+        nBorderColor = 0x80000006L;
+        aFontData.SetHasAlign(TRUE);
+    }
+
+    using OCX_ModernControl::Import; // to not hide the other two import methods
+    virtual sal_Bool Import(com::sun::star::uno::Reference<
+        com::sun::star::beans::XPropertySet> &rPropSet);
+  /*
+    sal_Bool Export(SotStorageRef &rObj,
+        const com::sun::star::uno::Reference<
+        com::sun::star::beans::XPropertySet> &rPropSet,
+        const com::sun::star::awt::Size& rSize);
+    sal_Bool WriteContents(SotStorageStreamRef &rObj,
+        const com::sun::star::uno::Reference<
+        com::sun::star::beans::XPropertySet> &rPropSet,
+        const com::sun::star::awt::Size& rSize);
+  */
+    static OCX_Control *Create() { return new HTML_TextBox;}
+
+        virtual sal_Bool Read(SotStorageStream *pS);
+        virtual sal_Bool ReadFontData(SotStorageStream *pS);
+};
+
+
+
 #endif
diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx
index 0391c5c..174781a 100644
--- a/filter/source/msfilter/msocximex.cxx
+++ b/filter/source/msfilter/msocximex.cxx
@@ -4444,7 +4444,8 @@ OCX_map aOCXTab[] =
     {&OCX_GroupBox::Create,"",
         form::FormComponentType::GROUPBOX,""},
     {&OCX_ProgressBar::Create,"",
-        form::FormComponentType::CONTROL,""}
+        form::FormComponentType::CONTROL,""},
+    {&HTML_TextBox::Create,"5512D124-5CC6-11CF-8d67-00aa00bdce1d", form::FormComponentType::TEXTFIELD,"TextBox"},
 };
 
 const int NO_OCX = sizeof( aOCXTab ) / sizeof( *aOCXTab );
@@ -5142,6 +5143,103 @@ sal_Bool OCX_FontData::Export(SvStorageStreamRef &rContent,
     return sal_True;
 }
 
+
+sal_Bool HTML_TextBox::Import(com::sun::star::uno::Reference<
+    com::sun::star::beans::XPropertySet> &rPropSet)
+{
+    uno::Any aTmp(&sName,getCppuType((OUString *)0));
+    rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp );
+
+    aTmp = bool2any( fEnabled != 0 );
+    rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp);
+
+    aTmp = bool2any( fLocked != 0 );
+    rPropSet->setPropertyValue( WW8_ASCII2STR("ReadOnly"), aTmp);
+
+    aTmp = bool2any( fHideSelection != 0 );
+    rPropSet->setPropertyValue( WW8_ASCII2STR( "HideInactiveSelection" ), aTmp);
+
+    aTmp <<= ImportColor(mnForeColor);
+    rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp);
+
+    aTmp <<= ImportColor(mnBackColor);
+    rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
+
+    aTmp <<= ImportBorder(nSpecialEffect,nBorderStyle);
+    rPropSet->setPropertyValue( WW8_ASCII2STR("Border"), aTmp);
+
+    aTmp <<= ImportColor( nBorderColor );
+    rPropSet->setPropertyValue( WW8_ASCII2STR("BorderColor"), aTmp);
+
+    aTmp = bool2any( fMultiLine != 0 );
+    rPropSet->setPropertyValue( WW8_ASCII2STR("MultiLine"), aTmp);
+
+    sal_uInt16 nTmp = static_cast<sal_uInt16>(nMaxLength);
+    aTmp <<= nTmp;
+    rPropSet->setPropertyValue( WW8_ASCII2STR("MaxTextLen"), aTmp);
+
+
+    sal_Bool bTemp1,bTemp2;
+    uno::Any aBarsH,aBarsV;
+    switch(nScrollBars)
+    {
+        case 1:
+            bTemp1 = sal_True;
+            bTemp2 = sal_False;
+            break;
+        case 2:
+            bTemp1 = sal_False;
+            bTemp2 = sal_True;
+            break;
+        case 3:
+            bTemp1 = sal_True;
+            bTemp2 = sal_True;
+            break;
+        case 0:
+        default:
+            bTemp1 = sal_False;
+            bTemp2 = sal_False;
+            break;
+    }
+
+    aBarsH = bool2any(bTemp1);
+    aBarsV = bool2any(bTemp2);
+    rPropSet->setPropertyValue( WW8_ASCII2STR("HScroll"), aBarsH);
+    rPropSet->setPropertyValue( WW8_ASCII2STR("VScroll"), aBarsV);
+
+    nTmp = nPasswordChar;
+    aTmp <<= nTmp;
+    rPropSet->setPropertyValue( WW8_ASCII2STR("EchoChar"), aTmp);
+
+    if (pValue)
+    {
+        aTmp <<= lclCreateOUString( pValue, nValueLen );
+        // DefaultText seems to no longer be in UnoEditControlModel
+        if ( bSetInDialog )
+        {
+            rPropSet->setPropertyValue( WW8_ASCII2STR("Text"), aTmp);
+        }
+        else
+        {
+            rPropSet->setPropertyValue( WW8_ASCII2STR("DefaultText"), aTmp);
+        }
+    }
+
+    //	aFontData.Import(rPropSet);
+    return sal_True;
+}
+
+sal_Bool HTML_TextBox::Read(SotStorageStream *pS)
+{
+  return sal_True;
+}
+
+sal_Bool HTML_TextBox::ReadFontData(SotStorageStream *pS)
+{
+  return sal_True;
+}
+
+
 // Doesn't really read anything but just skips the
 // record.
 sal_Bool OCX_TabStrip::Read(SotStorageStream *pS)


More information about the ooo-build-commit mailing list