Kaydet (Commit) 99f026d6 authored tarafından Frank Schönheit's avatar Frank Schönheit

#86712# +m_sControlDataStyleName - track the data style name of an associated control

üst 14d4e4d2
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: XMLShapeStyleContext.cxx,v $ * $RCSfile: XMLShapeStyleContext.cxx,v $
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* *
* last change: $Author: cl $ $Date: 2001-01-16 16:30:52 $ * last change: $Author: fs $ $Date: 2001-05-28 15:07:00 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -70,6 +70,10 @@ ...@@ -70,6 +70,10 @@
#include "XMLShapePropertySetContext.hxx" #include "XMLShapePropertySetContext.hxx"
#endif #endif
#ifndef _COM_SUN_STAR_DRAWING_XCONTROLSHAPE_HPP_
#include <com/sun/star/drawing/XControlShape.hpp>
#endif
#ifndef _XMLOFF_XMLIMP_HXX #ifndef _XMLOFF_XMLIMP_HXX
#include "xmlimp.hxx" #include "xmlimp.hxx"
#endif #endif
...@@ -82,6 +86,10 @@ ...@@ -82,6 +86,10 @@
#include <xmlnmspe.hxx> #include <xmlnmspe.hxx>
#endif #endif
#ifndef _XMLOFF_XMLTOKEN_HXX
#include "xmltoken.hxx"
#endif
#include "sdpropls.hxx" #include "sdpropls.hxx"
using namespace ::rtl; using namespace ::rtl;
...@@ -107,6 +115,18 @@ XMLShapeStyleContext::~XMLShapeStyleContext() ...@@ -107,6 +115,18 @@ XMLShapeStyleContext::~XMLShapeStyleContext()
{ {
} }
void XMLShapeStyleContext::SetAttribute( sal_uInt16 nPrefixKey, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
{
if ((0 == m_sControlDataStyleName.getLength()) && (::xmloff::token::GetXMLToken(::xmloff::token::XML_DATA_STYLE_NAME) == rLocalName))
{
m_sControlDataStyleName = rValue;
}
else
{
XMLPropStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
}
}
SvXMLImportContext *XMLShapeStyleContext::CreateChildContext( SvXMLImportContext *XMLShapeStyleContext::CreateChildContext(
sal_uInt16 nPrefix, sal_uInt16 nPrefix,
const OUString& rLocalName, const OUString& rLocalName,
...@@ -133,6 +153,27 @@ SvXMLImportContext *XMLShapeStyleContext::CreateChildContext( ...@@ -133,6 +153,27 @@ SvXMLImportContext *XMLShapeStyleContext::CreateChildContext(
return pContext; return pContext;
} }
void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet > & rPropSet )
{
XMLPropStyleContext::FillPropertySet(rPropSet);
if (m_sControlDataStyleName.getLength())
{ // we had a data-style-name attribute
// set the formatting on the control model of the control shape
uno::Reference< drawing::XControlShape > xControlShape(rPropSet, uno::UNO_QUERY);
DBG_ASSERT(xControlShape.is(), "XMLShapeStyleContext::FillPropertySet: data style for a non-control shape!");
if (xControlShape.is())
{
uno::Reference< beans::XPropertySet > xControlModel(xControlShape->getControl(), uno::UNO_QUERY);
DBG_ASSERT(xControlModel.is(), "XMLShapeStyleContext::FillPropertySet: no control model for the shape!");
if (xControlModel.is())
{
GetImport().GetFormImport()->applyControlNumberStyle(xControlModel, m_sControlDataStyleName);
}
}
}
}
void XMLShapeStyleContext::Finish( sal_Bool bOverwrite ) void XMLShapeStyleContext::Finish( sal_Bool bOverwrite )
{ {
const UniReference< XMLPropertySetMapper >&rMapper = GetStyles()->GetImportPropertyMapper( GetFamily() )->getPropertySetMapper(); const UniReference< XMLPropertySetMapper >&rMapper = GetStyles()->GetImportPropertyMapper( GetFamily() )->getPropertySetMapper();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment