summaryrefslogtreecommitdiff
path: root/oox/source/drawingml
diff options
context:
space:
mode:
authorRelease Engineers <releng@openoffice.org>2009-08-05 17:01:07 +0000
committerRelease Engineers <releng@openoffice.org>2009-08-05 17:01:07 +0000
commit40553b5e383ee02726eeafa8cc44082086399af7 (patch)
treed7e06c7ca505f2a7173d71d95a3d560f3244222b /oox/source/drawingml
parent3280419c5ad24d65beced46ee55a189f993926cc (diff)
CWS-TOOLING: integrate CWS impress172
2009-07-30 15:29:39 +0200 cl r274492 : #i102921# remove reference to inssrc.obj which was moved to svx 2009-07-29 11:40:35 +0200 wg r274445 : i103869 2009-07-22 14:39:13 +0200 sj r274241 : #i102713# fixed cloud shape 2009-07-07 15:28:04 +0200 sj r273800 : fixed build problem 2009-07-07 13:27:13 +0200 cl r273792 : #i102921# moved insert col/rows dialog to svx 2009-07-07 10:36:05 +0200 cl r273782 : fixed compiler warnings 2009-07-02 10:40:21 +0200 sj r273626 : fixed build problem 2009-07-02 10:27:56 +0200 cl r273624 : fixed merge problem 2009-07-02 10:27:19 +0200 cl r273623 : fixed compiler warning 2009-07-01 10:04:58 +0200 cl r273550 : CWS-TOOLING: rebase CWS impress172 to trunk@273468 (milestone: DEV300:m51) 2009-06-30 16:22:02 +0200 cl r273518 : #i102921# added insert table row/col dialog for impress tables 2009-06-30 16:20:46 +0200 cl r273517 : #i102921# added insert table row/col dialog for impress tables 2009-06-30 16:20:28 +0200 cl r273516 : #i102921# added insert table row/col dialog for impress tables 2009-06-30 16:19:49 +0200 cl r273515 : #i102921# added insert table row/col dialog for impress tables 2009-06-30 16:19:28 +0200 cl r273514 : #i102921# added insert table row/col dialog for impress tables 2009-06-30 16:17:38 +0200 cl r273513 : #i102921# added insert table row/col dialog for impress tables 2009-06-30 15:45:44 +0200 cl r273511 : #i102921# added insert table row/col dialog for impress tables 2009-06-30 15:37:16 +0200 cl r273510 : #i102921# added insert table row/col dialog for impress tables 2009-06-30 15:33:47 +0200 cl r273509 : #i102921# added insert table row/col dialog for impress tables 2009-06-30 15:32:10 +0200 cl r273508 : #i102921# added insert table row/col dialog for impress tables 2009-06-30 15:30:05 +0200 cl r273507 : #i102921# added insert table row/col dialog for impress tables 2009-06-29 12:32:42 +0200 sj r273465 : #158632# fixed textrange hyperlinks to specific pages, added slide names 2009-06-24 15:17:59 +0200 sj r273349 : #158636# fixed text range hyperlink to first/last slide 2009-06-22 13:18:30 +0200 sj r273224 : #158651# fixed header footer import 2009-06-19 15:18:24 +0200 sj r273160 : #158614# default text of presentation objects now cleared 2009-06-16 15:54:19 +0200 sj r273023 : #i101545# fixed crash - bracketing of graphic links has been done twice leading to a broken graphic state stack 2009-06-15 16:26:26 +0200 sj r272998 : #158635# importing bookmark interactions: firstslide, lastslide, nextslide, previousslide 2009-06-15 16:25:26 +0200 sj r272997 : #158635# added bookmark interactions: firstslide, lastslide, nextslide, previousslide 2009-06-12 13:17:32 +0200 sj r272915 : #i102713# fixed cloud shape 2009-06-10 18:36:58 +0200 sj r272833 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow 2009-06-08 19:52:28 +0200 sj r272746 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow 2009-06-04 15:28:32 +0200 cl r272640 : #i102358# applied patch to remove warnings 2009-06-04 14:39:45 +0200 cl r272630 : #i99423# applied path to change impress wizard create button to open when opening exisitng documents 2009-06-03 18:21:26 +0200 sj r272601 : #158635# now using the correct paragraph bottom spacing. using font independent linespacing for impress text objects 2009-06-03 15:47:27 +0200 cl r272583 : #i101817# added color collection based on scribus 2009-06-03 14:43:59 +0200 cl r272580 : #i102163# use weak ref to SdrObject instead of listening to the model 2009-06-03 12:39:29 +0200 cl r272556 : #i93308# correct namespace for com.sun.star.text.textfields 2009-06-03 12:27:00 +0200 cl r272555 : #i93308# correct namespace for com.sun.star.text.textfields 2009-06-03 11:33:44 +0200 cl r272553 : #i23221# allow all settings (that make sense) for presentation styles 2009-06-03 11:30:59 +0200 cl r272552 : #i23221# allow all settings (that make sense) for presentation styles 2009-06-03 11:30:22 +0200 cl r272551 : #i23221# allow all settings (that make sense) for presentation styles 2009-06-02 18:41:07 +0200 sj r272527 : #i28358# applied patch (better conversion of dotted lines) 2009-06-02 11:52:13 +0200 cl r272491 : #i98668# applied patch to fix possible endless loop if exception occours 2009-05-28 17:02:55 +0200 sj r272416 : #i102336# retaining graphic file names unchanged 2009-05-28 17:00:25 +0200 sj r272415 : #i102336# retaining graphic file names unchanged 2009-05-28 17:00:10 +0200 sj r272414 : #i102336# retaining graphic file names unchanged 2009-05-25 12:43:58 +0200 sj r272232 : #i102069# added patch from thb (fixed rotated group objects)
Diffstat (limited to 'oox/source/drawingml')
-rw-r--r--oox/source/drawingml/hyperlinkcontext.cxx103
-rw-r--r--oox/source/drawingml/shape.cxx16
-rw-r--r--oox/source/drawingml/textrun.cxx11
3 files changed, 112 insertions, 18 deletions
diff --git a/oox/source/drawingml/hyperlinkcontext.cxx b/oox/source/drawingml/hyperlinkcontext.cxx
index 2c83aedeff82..f1c87d2507dc 100644
--- a/oox/source/drawingml/hyperlinkcontext.cxx
+++ b/oox/source/drawingml/hyperlinkcontext.cxx
@@ -55,33 +55,106 @@ HyperLinkContext::HyperLinkContext( ContextHandler& rParent,
: ContextHandler( rParent )
, maProperties(aProperties)
{
+ OUString sURL, sHref;
OUString aRelId = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_id );
- OSL_TRACE("OOX: URI rId %s", ::rtl::OUStringToOString (aRelId, RTL_TEXTENCODING_UTF8).pData->buffer);
- const OUString& sHref = getRelations().getExternalTargetFromRelId( aRelId );
- if( sHref.getLength() > 0 )
+ if ( aRelId.getLength() )
{
- OSL_TRACE("OOX: URI href %s", ::rtl::OUStringToOString (sHref, RTL_TEXTENCODING_UTF8).pData->buffer);
- maProperties[ PROP_URL ] <<= getFilter().getAbsoluteUrl( sHref );
- OUString sTooltip = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tooltip );
+ OSL_TRACE("OOX: URI rId %s", ::rtl::OUStringToOString (aRelId, RTL_TEXTENCODING_UTF8).pData->buffer);
+ sHref = getRelations().getTargetFromRelId( aRelId );
+ if( sHref.getLength() > 0 )
+ {
+ OSL_TRACE("OOX: URI href %s", ::rtl::OUStringToOString (sHref, RTL_TEXTENCODING_UTF8).pData->buffer);
+ sURL = getFilter().getAbsoluteUrl( sHref );
+ }
+ }
+ OUString sTooltip = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tooltip );
+ if ( sTooltip.getLength() )
maProperties[ PROP_Representation ] <<= sTooltip;
+ OUString sFrame = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tgtFrame );
+ if( sFrame.getLength() )
+ maProperties[ PROP_TargetFrame ] <<= sFrame;
+ OUString aAction = xAttributes->getOptionalValue( XML_action );
+ if ( aAction.getLength() )
+ {
+ // reserved values of the unrestricted string aAction:
+ // ppaction://customshow?id=SHOW_ID // custom presentation
+ // ppaction://hlinkfile // external file via r:id
+ // ppaction://hlinkpres?slideindex=SLIDE_NUM // external presentation via r:id
+ // ppaction://hlinkshowjump?jump=endshow
+ // ppaction://hlinkshowjump?jump=firstslide
+ // ppaction://hlinkshowjump?jump=lastslide
+ // ppaction://hlinkshowjump?jump=lastslideviewed
+ // ppaction://hlinkshowjump?jump=nextslide
+ // ppaction://hlinkshowjump?jump=previousslide
+ // ppaction://hlinksldjump
+ // ppaction://macro?name=MACRO_NAME
+ // ppaction://program
- OUString sFrame = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tgtFrame );
- if( sFrame.getLength() )
- maProperties[ PROP_TargetFrame ] <<= sFrame;
+ const OUString sPPAction( CREATE_OUSTRING( "ppaction://" ) );
+ if ( aAction.matchIgnoreAsciiCase( sPPAction, 0 ) )
+ {
+ OUString aPPAct( aAction.copy( sPPAction.getLength() ) );
+ sal_Int32 nIndex = aPPAct.indexOf( '?', 0 );
+ OUString aPPAction( nIndex > 0 ? aPPAct.copy( 0, nIndex ) : aPPAct );
-// sValue = OUString( RTL_CONSTASCII_USTRINGPARAM( "" ) );
-// const rtl::OUString sUnvisitedCharStyleName( CREATE_OUSTRING( "UnvisitedCharStyleName" ) );
-// maProperties[ sUnvisitedCharStyleName ] <<= sValue;
-// const rtl::OUString sVisitedCharStyleName( CREATE_OUSTRING( "VisitedCharStyleName" ) );
-// maProperties[ sVisitedCharStyleName ] <<= sValue;
+ const OUString sHlinkshowjump( CREATE_OUSTRING( "hlinkshowjump" ) );
+ const OUString sHlinksldjump( CREATE_OUSTRING( "hlinksldjump" ) );
+ if ( aPPAction.match( sHlinkshowjump ) )
+ {
+ const OUString sJump( CREATE_OUSTRING( "jump=" ) );
+ if ( aPPAct.match( sJump, nIndex + 1 ) )
+ {
+ OUString aDestination( aPPAct.copy( nIndex + 1 + sJump.getLength() ) );
+ sURL = sURL.concat( CREATE_OUSTRING( "#action?jump=" ) );
+ sURL = sURL.concat( aDestination );
+ }
+ }
+ else if ( aPPAction.match( sHlinksldjump ) )
+ {
+ sURL = OUString();
+ sal_Int32 nIndex2 = 0;
+ while ( nIndex2 < sHref.getLength() )
+ {
+ sal_Unicode nChar = sHref[ nIndex2 ];
+ if ( ( nChar >= '0' ) && ( nChar <= '9' ) )
+ break;
+ nIndex2++;
+ }
+ if ( nIndex2 && ( nIndex2 != sHref.getLength() ) )
+ {
+ sal_Int32 nLength = 1;
+ while( ( nIndex2 + nLength ) < sHref.getLength() )
+ {
+ sal_Unicode nChar = sHref[ nIndex2 + nLength ];
+ if ( ( nChar < '0' ) || ( nChar > '9' ) )
+ break;
+ nLength++;
+ }
+ sal_Int32 nPageNumber = sHref.copy( nIndex2, nLength ).toInt32();
+ if ( nPageNumber )
+ {
+ const OUString sSlide( CREATE_OUSTRING( "slide" ) );
+ const OUString sNotesSlide( CREATE_OUSTRING( "notesSlide" ) );
+ const OUString aSlideType( sHref.copy( 0, nIndex2 ) );
+ if ( aSlideType.match( sSlide ) )
+ sURL = CREATE_OUSTRING( "#Slide " ).concat( rtl::OUString::valueOf( nPageNumber ) );
+ else if ( aSlideType.match( sNotesSlide ) )
+ sURL = CREATE_OUSTRING( "#Notes " ).concat( rtl::OUString::valueOf( nPageNumber ) );
+// else: todo for other types such as notesMaster or slideMaster as they can't be referenced easily
+ }
+ }
+ }
+ }
}
+ if ( sURL.getLength() )
+ maProperties[ PROP_URL ] <<= sURL;
+
// TODO unhandled
// XML_invalidUrl
// XML_history
// XML_highlightClick
// XML_endSnd
- // XML_action
}
HyperLinkContext::~HyperLinkContext()
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 08f6d63f0ee5..329aa6b36226 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -148,7 +148,7 @@ void Shape::addShape(
rtl::OUString sServiceName( msServiceName );
if( sServiceName.getLength() )
{
- Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, rxTheme, rxShapes, pShapeRect ) );
+ Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, rxTheme, rxShapes, pShapeRect, sal_False ) );
if( pShapeMap && msId.getLength() )
{
@@ -247,7 +247,8 @@ Reference< XShape > Shape::createAndInsert(
const rtl::OUString& rServiceName,
const ThemePtr& rxTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
- const awt::Rectangle* pShapeRect )
+ const awt::Rectangle* pShapeRect,
+ sal_Bool bClearText )
{
awt::Size aSize( pShapeRect ? awt::Size( pShapeRect->Width, pShapeRect->Height ) : maSize );
awt::Point aPosition( pShapeRect ? awt::Point( pShapeRect->X, pShapeRect->Y ) : maPosition );
@@ -367,6 +368,17 @@ Reference< XShape > Shape::createAndInsert(
}
rxShapes->add( mxShape );
+ // sj: removing default text of placeholder objects such as SlideNumberShape or HeaderShape
+ if ( bClearText )
+ {
+ uno::Reference< text::XText > xText( mxShape, uno::UNO_QUERY );
+ if ( xText.is() )
+ {
+ OUString aEmpty;
+ xText->setString( aEmpty );
+ }
+ }
+
LineProperties aLineProperties;
aLineProperties.maLineFill.moFillType = XML_noFill;
sal_Int32 nLinePhClr = -1;
diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx
index 2d8422b2f018..04dcb68c053f 100644
--- a/oox/source/drawingml/textrun.cxx
+++ b/oox/source/drawingml/textrun.cxx
@@ -91,12 +91,21 @@ void TextRun::insertAt(
Reference< XTextField > xField( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.text.TextField.URL" ) ), UNO_QUERY );
if( xField.is() )
{
+ Reference< XTextCursor > xTextFieldCursor = xText->createTextCursor();
+ xTextFieldCursor->gotoEnd( sal_False );
+
PropertySet aFieldProps( xField );
aFieldProps.setProperties( maTextCharacterProperties.maHyperlinkPropertyMap );
aFieldProps.setProperty( PROP_Representation, getText() );
-
Reference< XTextContent > xContent( xField, UNO_QUERY);
xText->insertTextContent( xStart, xContent, sal_False );
+
+ xTextFieldCursor->gotoEnd( sal_True );
+ oox::core::TextField aTextField;
+ aTextField.xText = xText;
+ aTextField.xTextCursor = xTextFieldCursor;
+ aTextField.xTextField = xField;
+ rFilterBase.getTextFieldStack().push_back( aTextField );
}
else
{