summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2010-01-26 16:17:30 +0100
committerIvo Hinkelmann <ihi@openoffice.org>2010-01-26 16:17:30 +0100
commit47469c389bb8161eb7458f617997e9e08147c5a6 (patch)
treefa6545c91d8f68e2500854e2083137a419672e1f /sd
parent5c2d284b0f9973aada365a8f464f1152671bd629 (diff)
parentb15930156ffd1eae186c9996f8d2979c2e097685 (diff)
CWS-TOOLING: integrate CWS impress181
Diffstat (limited to 'sd')
-rw-r--r--sd/source/filter/eppt/epptso.cxx114
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx47
-rw-r--r--sd/source/ui/view/sdview4.cxx3
3 files changed, 100 insertions, 64 deletions
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 361970345430..74cb802d2c01 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -1963,54 +1963,68 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool
}
}
- if ( nScriptType != com::sun::star::i18n::ScriptType::COMPLEX )
+ rtl::OUString aCharHeightName, aCharWeightName, aCharLocaleName, aCharPostureName;
+ switch( nScriptType )
{
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ), bGetPropStateValue ) )
+ case com::sun::star::i18n::ScriptType::ASIAN :
{
- float fFloat;
- mAny >>= fFloat;
- if ( fFloat >= ::com::sun::star::awt::FontWeight::SEMIBOLD )
- mnCharAttr |= 1;
+ aCharHeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharHeightAsian" ) );
+ aCharWeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharWeightAsian" ) );
+ aCharLocaleName = String( RTL_CONSTASCII_USTRINGPARAM( "CharLocaleAsian" ) );
+ aCharPostureName = String( RTL_CONSTASCII_USTRINGPARAM( "CharPostureAsian" ) );
+ break;
+ }
+ case com::sun::star::i18n::ScriptType::COMPLEX :
+ {
+ aCharHeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharHeightComplex" ) );
+ aCharWeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharWeightComplex" ) );
+ aCharLocaleName = String( RTL_CONSTASCII_USTRINGPARAM( "CharLocaleComplex" ) );
+ aCharPostureName = String( RTL_CONSTASCII_USTRINGPARAM( "CharPostureComplex" ) );
+ break;
+ }
+ default:
+ {
+ aCharHeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) );
+ aCharWeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) );
+ aCharLocaleName = String( RTL_CONSTASCII_USTRINGPARAM( "CharLocale" ) );
+ aCharPostureName = String( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) );
+ break;
}
}
- else
+
+ mnCharHeight = 24;
+ if ( GetPropertyValue( mAny, mXPropSet, aCharHeightName, sal_False ) )
{
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharWeightComplex" ) ), bGetPropStateValue ) )
+ float fVal;
+ if ( mAny >>= fVal )
{
- float fFloat;
- mAny >>= fFloat;
- if ( fFloat >= ::com::sun::star::awt::FontWeight::SEMIBOLD )
- mnCharAttr |= 1;
+ mnCharHeight = (sal_uInt16)( fVal + 0.5 );
+ meCharHeight = GetPropertyState( mXPropSet, aCharHeightName );
}
}
-
- if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
- mnCharAttrHard |= 1;
-
- if ( nScriptType != com::sun::star::i18n::ScriptType::COMPLEX )
+ if ( GetPropertyValue( mAny, mXPropSet, aCharWeightName, sal_False ) )
{
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ), bGetPropStateValue ) )
+ float fFloat;
+ if ( mAny >>= fFloat )
{
- ::com::sun::star::awt::FontSlant aFS;
- mAny >>= aFS;
- switch ( aFS )
- {
- case ::com::sun::star::awt::FontSlant_OBLIQUE :
- case ::com::sun::star::awt::FontSlant_ITALIC :
- mnCharAttr |= 2;
- break;
- default:
- break;
- }
+ if ( fFloat >= ::com::sun::star::awt::FontWeight::SEMIBOLD )
+ mnCharAttr |= 1;
+ if ( GetPropertyState( mXPropSet, aCharWeightName ) == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
+ mnCharAttrHard |= 1;
}
}
- else
+ if ( GetPropertyValue( mAny, mXPropSet, aCharLocaleName, sal_False ) )
{
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharPostureComplex" ) ), bGetPropStateValue ) )
+ com::sun::star::lang::Locale eLocale;
+ if ( mAny >>= eLocale )
+ meCharLocale = eLocale;
+ }
+ if ( GetPropertyValue( mAny, mXPropSet, aCharPostureName, sal_False ) )
+ {
+ ::com::sun::star::awt::FontSlant aFS;
+ if ( mAny >>= aFS )
{
- ::com::sun::star::awt::FontSlant aFS;
- mAny >>= aFS;
- switch ( aFS )
+ switch( aFS )
{
case ::com::sun::star::awt::FontSlant_OBLIQUE :
case ::com::sun::star::awt::FontSlant_ITALIC :
@@ -2019,12 +2033,11 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool
default:
break;
}
+ if ( GetPropertyState( mXPropSet, aCharPostureName ) == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
+ mnCharAttrHard |= 2;
}
}
- if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
- mnCharAttrHard |= 2;
-
if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharUnderline" ) ), bGetPropStateValue ) )
{
sal_Int16 nVal;
@@ -2050,13 +2063,6 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool
if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
mnCharAttrHard |= 16;
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharLocale" ) ), bGetPropStateValue ) )
- {
- com::sun::star::lang::Locale eLocale;
- if ( mAny >>= eLocale )
- meCharLocale = eLocale;
- }
-
if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharRelief" ) ), bGetPropStateValue ) )
{
sal_Int16 nVal;
@@ -2067,15 +2073,6 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool
if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
mnCharAttrHard |= 512;
- mnCharHeight = 24;
- if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ), bGetPropStateValue ) )
- {
- float fVal;
- mAny >>= fVal;
- mnCharHeight = (sal_uInt16)( fVal + 0.5 );
- }
- meCharHeight = ePropState;
-
if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharColor" ) ), bGetPropStateValue ) )
{
sal_uInt32 nSOColor = *( (sal_uInt32*)mAny.getValue() );
@@ -2421,15 +2418,10 @@ void ParagraphObj::CalculateGraphicBulletSize( sal_uInt16 nFontHeight )
// from sw/source/filter/ww8/wrtw8num.cxx for default bullets to export to MS intact
static void lcl_SubstituteBullet(String& rNumStr, rtl_TextEncoding& rChrSet, String& rFontName)
{
- StarSymbolToMSMultiFont *pConvert = 0;
- FontFamily eFamily = FAMILY_DECORATIVE;
-
- if (!pConvert)
- {
- pConvert = CreateStarSymbolToMSMultiFont();
- }
sal_Unicode cChar = rNumStr.GetChar(0);
+ StarSymbolToMSMultiFont *pConvert = CreateStarSymbolToMSMultiFont();
String sFont = pConvert->ConvertChar(cChar);
+ delete pConvert;
if (sFont.Len())
{
rNumStr = static_cast< sal_Unicode >(cChar | 0xF000);
@@ -2445,7 +2437,6 @@ static void lcl_SubstituteBullet(String& rNumStr, rtl_TextEncoding& rChrSet, Str
let words own font substitution kick in
*/
rChrSet = RTL_TEXTENCODING_UNICODE;
- eFamily = FAMILY_SWISS;
rFontName = ::GetFontToken(rFontName, 0);
}
else
@@ -2458,7 +2449,6 @@ static void lcl_SubstituteBullet(String& rNumStr, rtl_TextEncoding& rChrSet, Str
rFontName.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Wingdings"));
rNumStr = static_cast< sal_Unicode >(0x6C);
}
- delete pConvert;
}
void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int16 nNumberingDepth, sal_Bool bIsBullet, sal_Bool bGetPropStateValue )
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 2e753fd859d1..0222f972938e 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -65,6 +65,7 @@
#include <svx/unofill.hxx>
#include <svx/unopool.hxx>
#include <svx/svdorect.hxx>
+#include <svx/flditem.hxx>
#include <vos/mutex.hxx>
#include <toolkit/awt/vclxdevice.hxx>
@@ -111,6 +112,12 @@
#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
+#include <com/sun/star/office/XAnnotation.hpp>
+#include <com/sun/star/office/XAnnotationAccess.hpp>
+#include <com/sun/star/office/XAnnotationEnumeration.hpp>
+#include <com/sun/star/geometry/RealPoint2D.hpp>
+#include <com/sun/star/util/DateTime.hpp>
+
using ::rtl::OUString;
#include <drawinglayer/primitive2d/structuretagprimitive2d.hxx>
@@ -1602,6 +1609,42 @@ sal_Int32 ImplPDFGetBookmarkPage( const String& rBookmark, SdDrawDocument& rDoc
return nPage;
}
+void ImplPDFExportComments( uno::Reference< drawing::XDrawPage > xPage, vcl::PDFExtOutDevData& rPDFExtOutDevData )
+{
+ try
+ {
+ uno::Reference< office::XAnnotationAccess > xAnnotationAccess( xPage, uno::UNO_QUERY_THROW );
+ uno::Reference< office::XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() );
+
+ LanguageType eLanguage = Application::GetSettings().GetLanguage();
+ while( xAnnotationEnumeration->hasMoreElements() )
+ {
+ uno::Reference< office::XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement() );
+
+ geometry::RealPoint2D aRealPoint2D( xAnnotation->getPosition() );
+ uno::Reference< text::XText > xText( xAnnotation->getTextRange() );
+// rtl::OUString sInitials( getInitials( sAuthor ) );
+ util::DateTime aDateTime( xAnnotation->getDateTime() );
+
+ Date aDate( aDateTime.Day, aDateTime.Month, aDateTime.Year );
+ Time aTime;
+ String aStr( SvxDateTimeField::GetFormatted( aDate, aTime, SVXDATEFORMAT_B, *(SD_MOD()->GetNumberFormatter()), eLanguage ) );
+
+ vcl::PDFNote aNote;
+ String sTitle( xAnnotation->getAuthor() );
+ sTitle.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ", " ) );
+ sTitle += aStr;
+ aNote.Title = sTitle;
+ aNote.Contents = xText->getString();
+ rPDFExtOutDevData.CreateNote( Rectangle( Point( static_cast< long >( aRealPoint2D.X * 100 ),
+ static_cast< long >( aRealPoint2D.Y * 100 ) ), Size( 1000, 1000 ) ), aNote );
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+}
+
void ImplPDFExportShapeInteraction( uno::Reference< drawing::XShape > xShape, SdDrawDocument& rDoc, vcl::PDFExtOutDevData& rPDFExtOutDevData )
{
const rtl::OUString sGroup ( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.GroupShape" ) );
@@ -1844,7 +1887,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
for( sal_Int32 nProperty = 0, nPropertyCount = rxOptions.getLength(); nProperty < nPropertyCount; ++nProperty )
{
if( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ) )
- rxOptions[ nProperty].Value >>= xRenderDevice;
+ rxOptions[ nProperty ].Value >>= xRenderDevice;
else if ( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ) )
{
rxOptions[ nProperty].Value >>= bExportNotesPages;
@@ -1940,6 +1983,8 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
uno::Reference< drawing::XDrawPage > xPage( uno::Reference< drawing::XDrawPage >::query( pPage->getUnoPage() ) );
if ( xPage.is() )
{
+ if ( pPDFExtOutDevData->GetIsExportNotes() )
+ ImplPDFExportComments( xPage, *pPDFExtOutDevData );
uno::Reference< beans::XPropertySet > xPagePropSet( xPage, uno::UNO_QUERY );
if( xPagePropSet.is() )
{
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 9d301368418c..1bca4450c4bf 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -377,9 +377,10 @@ IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG )
if( !pGraphicFilter->ImportGraphic( aGraphic, aURL ) )
{
sal_Int8 nTempAction = ( aIter == maDropFileVector.begin() ) ? mnAction : 0;
+ const bool bLink = ( ( nTempAction & DND_ACTION_LINK ) != 0 );
SdrGrafObj* pGrafObj = InsertGraphic( aGraphic, nTempAction, maDropPos, NULL, NULL );
- if( pGrafObj )
+ if( pGrafObj && bLink )
pGrafObj->SetGraphicLink( aCurrentDropFile, String() );
// return action from first inserted graphic