Kaydet (Commit) 52c81384 authored tarafından Katarina Behrens's avatar Katarina Behrens Kaydeden (comit) Thorsten Behrens

Add PPTX import of shape description

Which was skipped before.

Change-Id: I7fcd5608a8cdbeea9ea15c9c9aa32c9020154750
üst 9547c0ed
...@@ -148,6 +148,7 @@ public: ...@@ -148,6 +148,7 @@ public:
const OUString& getInternalName() const { return msInternalName; } const OUString& getInternalName() const { return msInternalName; }
void setId( const OUString& rId ) { msId = rId; } void setId( const OUString& rId ) { msId = rId; }
const OUString& getId() { return msId; } const OUString& getId() { return msId; }
void setDescription( const OUString& rDescr ) { msDescription = rDescr; }
void setHidden( bool bHidden ) { mbHidden = bHidden; } void setHidden( bool bHidden ) { mbHidden = bHidden; }
void setHiddenMasterShape( bool bHiddenMasterShape ) { mbHiddenMasterShape = bHiddenMasterShape; } void setHiddenMasterShape( bool bHiddenMasterShape ) { mbHiddenMasterShape = bHiddenMasterShape; }
void setSubType( sal_Int32 nSubType ) { mnSubType = nSubType; } void setSubType( sal_Int32 nSubType ) { mnSubType = nSubType; }
...@@ -291,6 +292,7 @@ protected: ...@@ -291,6 +292,7 @@ protected:
OUString msName; OUString msName;
OUString msInternalName; // used by diagram; not displayed in UI OUString msInternalName; // used by diagram; not displayed in UI
OUString msId; OUString msId;
OUString msDescription;
sal_Int32 mnSubType; // if this type is not zero, then the shape is a placeholder sal_Int32 mnSubType; // if this type is not zero, then the shape is a placeholder
OptValue< sal_Int32 > moSubTypeIndex; OptValue< sal_Int32 > moSubTypeIndex;
......
...@@ -832,6 +832,11 @@ Reference< XShape > const & Shape::createAndInsert( ...@@ -832,6 +832,11 @@ Reference< XShape > const & Shape::createAndInsert(
if( xNamed.is() ) if( xNamed.is() )
xNamed->setName( msName ); xNamed->setName( msName );
} }
if( !msDescription.isEmpty() )
{
const OUString sDescription( "Description" );
xSet->setPropertyValue( sDescription, Any( msDescription ) );
}
if (aServiceName != "com.sun.star.text.TextFrame") if (aServiceName != "com.sun.star.text.TextFrame")
rxShapes->add( mxShape ); rxShapes->add( mxShape );
......
...@@ -74,6 +74,7 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 aElementToken, const ...@@ -74,6 +74,7 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 aElementToken, const
mpShapePtr->setHidden( rAttribs.getBool( XML_hidden, false ) ); mpShapePtr->setHidden( rAttribs.getBool( XML_hidden, false ) );
mpShapePtr->setId( rAttribs.getString( XML_id ).get() ); mpShapePtr->setId( rAttribs.getString( XML_id ).get() );
mpShapePtr->setName( rAttribs.getString( XML_name ).get() ); mpShapePtr->setName( rAttribs.getString( XML_name ).get() );
mpShapePtr->setDescription( rAttribs.getString( XML_descr ).get() );
break; break;
} }
case XML_hlinkMouseOver: case XML_hlinkMouseOver:
......
...@@ -193,6 +193,7 @@ public: ...@@ -193,6 +193,7 @@ public:
void testTdf120028(); void testTdf120028();
void testTdf120028b(); void testTdf120028b();
void testTdf44223(); void testTdf44223();
void testDescriptionImport();
CPPUNIT_TEST_SUITE(SdImportTest); CPPUNIT_TEST_SUITE(SdImportTest);
...@@ -277,6 +278,7 @@ public: ...@@ -277,6 +278,7 @@ public:
CPPUNIT_TEST(testTdf120028); CPPUNIT_TEST(testTdf120028);
CPPUNIT_TEST(testTdf120028b); CPPUNIT_TEST(testTdf120028b);
CPPUNIT_TEST(testTdf44223); CPPUNIT_TEST(testTdf44223);
CPPUNIT_TEST(testDescriptionImport);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
}; };
...@@ -2619,6 +2621,22 @@ void SdImportTest::testTdf44223() ...@@ -2619,6 +2621,22 @@ void SdImportTest::testTdf44223()
xDocShRef->DoClose(); xDocShRef->DoClose();
} }
void SdImportTest::testDescriptionImport()
{
sd::DrawDocShellRef xDocShRef
= loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/altdescription.pptx"), PPTX);
uno::Reference<beans::XPropertySet> xPropertySet(
getShapeFromPage(/*nShape=*/2, /*nPage=*/0, xDocShRef));
OUString sDesc;
xPropertySet->getPropertyValue("Description") >>= sDesc;
CPPUNIT_ASSERT_EQUAL(OUString("We Can Do It!"), sDesc);
xDocShRef->DoClose();
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
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