[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 3 commits - officecfg/registry svx/source writerfilter/source
Oliver-Rainer Wittmann
orw at apache.org
Mon Jun 10 05:07:26 PDT 2013
officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu | 2
svx/source/sidebar/area/AreaPropertyPanel.cxx | 7 +
svx/source/sidebar/line/LinePropertyPanel.cxx | 7 +
writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 12 --
writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx | 62 ++++++-----
writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx | 11 -
6 files changed, 57 insertions(+), 44 deletions(-)
New commits:
commit 22e334845346f4e3189c72e706d744385953af19
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Mon Jun 10 11:11:00 2013 +0000
Correct the XML document handler which is used to parse Microsoft Word OOXML documents in case of unknown XML elements
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index 811817b..fc743f8 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -68,10 +68,8 @@ void OOXMLDocumentImpl::resolveFastSubStream(Stream & rStreamHandler,
{
uno::Reference<uno::XComponentContext> xContext(mpStream->getContext());
OOXMLFastDocumentHandler * pDocHandler =
- new OOXMLFastDocumentHandler(xContext);
- pDocHandler->setStream(&rStreamHandler);
- pDocHandler->setDocument(this);
- pDocHandler->setXNoteId(msXNoteId);
+ new OOXMLFastDocumentHandler(
+ xContext, &rStreamHandler, this, msXNoteId );
uno::Reference < xml::sax::XFastDocumentHandler > xDocumentHandler
(pDocHandler);
@@ -317,10 +315,8 @@ void OOXMLDocumentImpl::resolve(Stream & rStream)
uno::Reference<uno::XComponentContext> xContext(mpStream->getContext());
OOXMLFastDocumentHandler * pDocHandler =
- new OOXMLFastDocumentHandler(xContext);
- pDocHandler->setStream(&rStream);
- pDocHandler->setDocument(this);
- pDocHandler->setXNoteId(msXNoteId);
+ new OOXMLFastDocumentHandler(
+ xContext, &rStream, this, msXNoteId );
pDocHandler->setIsSubstream( mbIsSubstream );
uno::Reference < xml::sax::XFastDocumentHandler > xDocumentHandler
(pDocHandler);
diff --git a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx
index a13ac78..792b611 100644
--- a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx
@@ -39,10 +39,28 @@ using namespace ::com::sun::star;
using namespace ::std;
-OOXMLFastDocumentHandler::OOXMLFastDocumentHandler
-(uno::Reference< uno::XComponentContext > const & context)
-: m_xContext(context)
-{}
+OOXMLFastDocumentHandler::OOXMLFastDocumentHandler(
+ uno::Reference< uno::XComponentContext > const & context,
+ Stream* pStream,
+ OOXMLDocument* pDocument,
+ const ::rtl::OUString& rXNoteId )
+ : m_xContext(context)
+ , mpStream( pStream )
+#ifdef DEBUG_ELEMENT
+ , mpTmpStream()
+#endif
+ , mpDocument( pDocument )
+ , msXNoteId( rXNoteId )
+ , mpContextHandler()
+{
+#ifdef DEBUG_PROTOCOL
+ if ( pStream )
+ {
+ mpTmpStream.reset( new StreamProtocol( pStream, debug_logger ) );
+ mpStream = mpTmpStream.get();
+ }
+#endif
+}
// ::com::sun::star::xml::sax::XFastContextHandler:
void SAL_CALL OOXMLFastDocumentHandler::startFastElement
@@ -145,6 +163,13 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
<< endl;
#endif
+ if ( mpStream == 0 && mpDocument == 0 )
+ {
+ // document handler has been created as unknown child - see <OOXMLFastDocumentHandler::createUnknownChildContext(..)>
+ // --> do not provide a child context
+ return NULL;
+ }
+
return OOXMLFactory::getInstance()->createFastChildContextFromStart(getContextHandler().get(), Element);
}
@@ -171,13 +196,12 @@ Name
#endif
return uno::Reference< xml::sax::XFastContextHandler >
- (new OOXMLFastDocumentHandler(m_xContext));
+ ( new OOXMLFastDocumentHandler( m_xContext, 0, 0, ::rtl::OUString() ) );
}
void SAL_CALL OOXMLFastDocumentHandler::characters(const ::rtl::OUString & /*aChars*/)
throw (uno::RuntimeException, xml::sax::SAXException)
{
- // TODO: Insert your implementation for "characters" here.
}
// ::com::sun::star::xml::sax::XFastDocumentHandler:
@@ -195,32 +219,14 @@ void SAL_CALL OOXMLFastDocumentHandler::setDocumentLocator
(const uno::Reference< xml::sax::XLocator > & /*xLocator*/)
throw (uno::RuntimeException, xml::sax::SAXException)
{
- // TODO: Insert your implementation for "setDocumentLocator" here.
-}
-
-void OOXMLFastDocumentHandler::setStream(Stream * pStream)
-{
-#ifdef DEBUG_PROTOCOL
- mpTmpStream.reset(new StreamProtocol(pStream, debug_logger));
- mpStream = mpTmpStream.get();
-#else
- mpStream = pStream;
-#endif
-}
-
-void OOXMLFastDocumentHandler::setDocument(OOXMLDocument * pDocument)
-{
- mpDocument = pDocument;
-}
-
-void OOXMLFastDocumentHandler::setXNoteId(const ::rtl::OUString & rXNoteId)
-{
- msXNoteId = rXNoteId;
}
void OOXMLFastDocumentHandler::setIsSubstream( bool bSubstream )
{
- getContextHandler( )->getParserState( )->setInSectionGroup( bSubstream );
+ if ( mpStream != 0 && mpDocument != 0 )
+ {
+ getContextHandler( )->getParserState( )->setInSectionGroup( bSubstream );
+ }
}
}}
diff --git a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx
index 92bb4dc..ead44ed 100644
--- a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx
@@ -44,8 +44,11 @@ class OOXMLFastDocumentHandler:
xml::sax::XFastDocumentHandler>
{
public:
- OOXMLFastDocumentHandler
- (uno::Reference< uno::XComponentContext > const & context);
+ OOXMLFastDocumentHandler(
+ uno::Reference< uno::XComponentContext > const & context,
+ Stream* pStream,
+ OOXMLDocument* pDocument,
+ const ::rtl::OUString& rXNoteId );
virtual ~OOXMLFastDocumentHandler() {}
// ::com::sun::star::xml::sax::XFastDocumentHandler:
@@ -87,10 +90,6 @@ public:
virtual void SAL_CALL characters(const ::rtl::OUString & aChars)
throw (uno::RuntimeException, xml::sax::SAXException);
- void setStream(Stream * pStream);
- void setDocument(OOXMLDocument * pDocument);
- void setXNoteId(const ::rtl::OUString & rXNoteId);
-
void setIsSubstream( bool bSubstream );
private:
commit 7fb9e99fcc522731165f3ad20aae43d81bb7df65
Author: Armin Le Grand <alg at apache.org>
Date: Mon Jun 10 10:45:46 2013 +0000
i122493 Removed Line/AreaPropertyPanel on Writer OLE context
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index d05cdae..4fb60d5 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -351,7 +351,6 @@
DrawImpress, TextObject, hidden ;
DrawImpress, OLE, hidden ;
WriterVariants, Draw, visible ;
- WriterVariants, OLE, hidden, .uno:FrameDialog ;
</value>
</prop>
<prop oor:name="ImplementationURL" oor:type="xs:string">
@@ -386,7 +385,6 @@
DrawImpress, TextObject, hidden ;
DrawImpress, OLE, hidden ;
WriterVariants, Draw, visible ;
- WriterVariants, OLE, hidden, .uno:FrameDialog ;
</value>
</prop>
<prop oor:name="ImplementationURL" oor:type="xs:string">
commit 2890568e3ac8e140d12f05d8ac74f3be50ffa45d
Author: Armin Le Grand <alg at apache.org>
Date: Mon Jun 10 10:39:36 2013 +0000
i122493 Corrected Enable/Disable for some DropDowns/Texts in Line/AreaPropertyPanel
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index 072c6ff..e07c6bb 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -667,6 +667,7 @@ void AreaPropertyPanel::ImpUpdateTransparencies()
else if(nValue <= 100)
{
mpLBTransType->Enable();
+ mpTrspTextFT->Enable();
mpLBTransType->SelectEntryPos(1);
mpBTNGradient->Hide();
mpMTRTransparent->Show();
@@ -690,6 +691,7 @@ void AreaPropertyPanel::ImpUpdateTransparencies()
Image* pImage = 0;
mpLBTransType->Enable();
+ mpTrspTextFT->Enable();
mpMTRTransparent->Hide();
mpBTNGradient->Enable();
mpBTNGradient->Show();
@@ -747,6 +749,7 @@ void AreaPropertyPanel::ImpUpdateTransparencies()
if(bZeroValue)
{
mpLBTransType->Enable();
+ mpTrspTextFT->Enable();
mpLBTransType->SelectEntryPos(0);
mpBTNGradient->Hide();
mpMTRTransparent->Enable();
@@ -758,6 +761,8 @@ void AreaPropertyPanel::ImpUpdateTransparencies()
{
// no transparency at all
mpLBTransType->SetNoSelection();
+ mpLBTransType->Disable();
+ mpTrspTextFT->Disable();
mpMTRTransparent->Disable();
mpMTRTransparent->Show();
mpBTNGradient->Disable();
@@ -840,6 +845,7 @@ void AreaPropertyPanel::NotifyItemUpdate(
if(bDisabled)
{
mpLbFillType->Disable();
+ mpColorTextFT->Disable();
mpLbFillType->SetNoSelection();
mpLbFillAttr->Show();
mpLbFillAttr->Disable();
@@ -857,6 +863,7 @@ void AreaPropertyPanel::NotifyItemUpdate(
{
mpStyleItem.reset(dynamic_cast< XFillStyleItem* >(pItem->Clone()));
mpLbFillType->Enable();
+ mpColorTextFT->Enable();
XFillStyle eXFS = (XFillStyle)mpStyleItem->GetValue();
meLastXFS = eXFS;
mpLbFillType->SelectEntryPos(sal::static_int_cast< sal_uInt16 >(eXFS));
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index 75c7166..4284481 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -618,10 +618,12 @@ void LinePropertyPanel::NotifyItemUpdate(
if(bDisabled)
{
mpLBEdgeStyle->Disable();
+ mpFTEdgeStyle->Disable();
}
else
{
mpLBEdgeStyle->Enable();
+ mpFTEdgeStyle->Enable();
}
if(eState >= SFX_ITEM_DEFAULT)
@@ -676,10 +678,12 @@ void LinePropertyPanel::NotifyItemUpdate(
if(bDisabled)
{
mpLBCapStyle->Disable();
+ mpFTCapStyle->Disable();
}
else
{
mpLBCapStyle->Enable();
+ mpLBCapStyle->Enable();
}
if(eState >= SFX_ITEM_DEFAULT)
@@ -1093,6 +1097,7 @@ void LinePropertyPanel::SelectLineStyle()
if( !mpStyleItem.get() || !mpDashItem.get() )
{
mpLBStyle->SetNoSelection();
+ mpLBStyle->Disable();
return;
}
@@ -1138,6 +1143,7 @@ void LinePropertyPanel::SelectEndStyle(bool bStart)
if( !mpStartItem.get() )
{
mpLBStart->SetNoSelection();
+ mpLBStart->Disable();
return;
}
@@ -1166,6 +1172,7 @@ void LinePropertyPanel::SelectEndStyle(bool bStart)
if( !mpEndItem.get() )
{
mpLBEnd->SetNoSelection();
+ mpLBEnd->Disable();
return;
}
More information about the Libreoffice-commits
mailing list