summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2010-07-13 14:02:33 +0200
committerKurt Zenker <kz@openoffice.org>2010-07-13 14:02:33 +0200
commit1d97771f1ea5dffc86a0fc5b1e1ec90a34553092 (patch)
treee8c0de8f2f2a8f7abb55aaad3437c0357f3465f9
parent4adb61dc6bb380ff31e145e6a77c92c0b26b42bd (diff)
parent6e50a95326d0eaf82cf979db6dd79f39a03ea80f (diff)
CWS-TOOLING: integrate CWS impress192_OOO330
Notes
split repo tag: impress_ooo/OOO330_m1
-rwxr-xr-xsd/source/core/sdpage.cxx12
-rwxr-xr-xsd/source/ui/unoidl/unopage.cxx16
-rwxr-xr-xsd/source/ui/unoidl/unopage.hxx1
-rwxr-xr-xsd/source/ui/view/DocumentRenderer.cxx32
-rwxr-xr-xsd/source/ui/view/drtxtob.cxx30
5 files changed, 71 insertions, 20 deletions
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 76450cf76760..82a841a199c8 100755
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -2105,7 +2105,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const Rectangle& rNewBorderR
}
}
-SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj, PresObjKind eObjKind, bool bVertical, Rectangle aRect )
+SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj, PresObjKind& eObjKind, bool bVertical, Rectangle aRect )
{
SdDrawDocument* pModel = static_cast< SdDrawDocument* >( rPage.GetModel() );
DBG_ASSERT( pModel, "sd::convertPresentationObjectImpl(), no model on page!" );
@@ -2220,6 +2220,16 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj,
SdrObject::Free( pSourceObj );
}
}
+ else if((eObjKind == PRESOBJ_OUTLINE) && (pSourceObj->GetObjIdentifier() != OBJ_OUTLINETEXT) )
+ {
+ switch( pSourceObj->GetObjIdentifier() )
+ {
+ case OBJ_TABLE: eObjKind = PRESOBJ_TABLE; break;
+ case OBJ_MEDIA: eObjKind = PRESOBJ_MEDIA; break;
+ case OBJ_GRAF: eObjKind = PRESOBJ_GRAPHIC; break;
+ case OBJ_OLE2: eObjKind = PRESOBJ_OBJECT; break;
+ }
+ }
return pNewObj;
}
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 379344667a0c..fb356087245a 100755
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -382,6 +382,7 @@ SdGenericDrawPage::SdGenericDrawPage( SdXImpressDocument* _pModel, SdPage* pInPa
SdUnoSearchReplaceShape(this),
mpModel ( _pModel ),
mpSdrModel(0),
+ mnTempPageNumber(0),
mpPropSet ( _pSet ),
mbIsImpressDocument(false)
{
@@ -924,9 +925,18 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName
break;
}
+ case WID_PAGE_NUMBER:
+ if( (GetPage()->GetPageKind() == PK_HANDOUT) && !GetPage()->IsMasterPage() )
+ {
+ if( !(aValue >>= mnTempPageNumber) )
+ throw lang::IllegalArgumentException();
+
+ break;
+ }
+ throw beans::PropertyVetoException();
+
case WID_PAGE_LDBITMAP:
case WID_PAGE_LDNAME:
- case WID_PAGE_NUMBER:
case WID_PAGE_ISDARK:
throw beans::PropertyVetoException();
@@ -1053,9 +1063,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName )
}
else
{
- // for pages with number 0 (Handout Master, Handout page)
- // return 0
- aAny <<= (sal_Int16)0;
+ aAny <<= mnTempPageNumber;
}
}
break;
diff --git a/sd/source/ui/unoidl/unopage.hxx b/sd/source/ui/unoidl/unopage.hxx
index 5d525b0f0f04..e3fda70c0f11 100755
--- a/sd/source/ui/unoidl/unopage.hxx
+++ b/sd/source/ui/unoidl/unopage.hxx
@@ -74,6 +74,7 @@ class SdGenericDrawPage : public SvxFmDrawPage,
private:
SdXImpressDocument* mpModel;
SdrModel* mpSdrModel;
+ sal_Int16 mnTempPageNumber; // for printing handouts
protected:
friend class SdXImpressDocument;
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index 0689dc0e3851..1660c05a124f 100755
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -27,6 +27,8 @@
#include "precompiled_sd.hxx"
+#include <com/sun/star/beans/XPropertySet.hpp>
+
#include "DocumentRenderer.hxx"
#include "DocumentRenderer.hrc"
@@ -997,6 +999,9 @@ namespace {
{
SdPage& rHandoutPage (*rDocument.GetSdPage(0, PK_HANDOUT));
+ Reference< com::sun::star::beans::XPropertySet > xHandoutPage( rHandoutPage.getUnoPage(), UNO_QUERY );
+ const rtl::OUString sPageNumber( RTL_CONSTASCII_USTRINGPARAM( "Number" ) );
+
// Collect the page objects of the handout master.
std::vector<SdrPageObj*> aHandoutPageObjects;
SdrObjListIter aShapeIter (rHandoutPage);
@@ -1051,7 +1056,15 @@ namespace {
}
}
- rViewShell.SetPrintedHandoutPageNum(mnHandoutPageIndex + 1);
+ if( xHandoutPage.is() ) try
+ {
+ xHandoutPage->setPropertyValue( sPageNumber, Any( static_cast<sal_Int16>(mnHandoutPageIndex) ) );
+ }
+ catch( Exception& )
+ {
+ }
+ rViewShell.SetPrintedHandoutPageNum( mnHandoutPageIndex + 1 );
+
MapMode aMap (rPrinter.GetMapMode());
rPrinter.SetMapMode(maMap);
@@ -1068,6 +1081,13 @@ namespace {
msPageString,
maPageStringOffset);
+ if( xHandoutPage.is() ) try
+ {
+ xHandoutPage->setPropertyValue( sPageNumber, Any( static_cast<sal_Int16>(0) ) );
+ }
+ catch( Exception& )
+ {
+ }
rViewShell.SetPrintedHandoutPageNum(1);
// Restore outlines.
@@ -1081,7 +1101,8 @@ namespace {
pPathObj->SetMergedItem(XLineStyleItem(XLINE_SOLID));
}
}
- }
+
+ }
private:
const USHORT mnHandoutPageIndex;
@@ -1887,12 +1908,17 @@ private:
++nShapeCount;
}
+ const USHORT nPageCount = mrBase.GetDocument()->GetSdPageCount(PK_STANDARD);
+ const USHORT nHandoutPageCount = nShapeCount ? (nPageCount + nShapeCount - 1) / nShapeCount : 0;
+ pViewShell->SetPrintedHandoutPageCount( nHandoutPageCount );
+ mrBase.GetDocument()->setHandoutPageCount( nHandoutPageCount );
+
// Distribute pages to handout pages.
::std::vector<USHORT> aPageIndices;
std::vector<SdPage*> aPagesVector;
for (USHORT
nIndex=0,
- nCount=mrBase.GetDocument()->GetSdPageCount(PK_STANDARD),
+ nCount= nPageCount,
nHandoutPageIndex=0;
nIndex <= nCount;
++nIndex)
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 8b88be3682e3..9eb0a3b2ff8c 100755
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -384,19 +384,25 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
case SID_THES:
{
- EditView & rEditView = mpView->GetTextEditOutlinerView()->GetEditView();;
- String aStatusVal;
- LanguageType nLang = LANGUAGE_NONE;
- bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, rEditView );
- rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
-
- // disable "Thesaurus" context menu entry if there is nothing to look up
- lang::Locale aLocale( SvxCreateLocale( nLang ) );
- uno::Reference< linguistic2::XThesaurus > xThes( LinguMgr::GetThesaurus() );
- if (!bIsLookUpWord ||
- !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
+ if( mpView && mpView->GetTextEditOutlinerView() )
+ {
+ EditView & rEditView = mpView->GetTextEditOutlinerView()->GetEditView();;
+ String aStatusVal;
+ LanguageType nLang = LANGUAGE_NONE;
+ bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, rEditView );
+ rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
+
+ // disable "Thesaurus" context menu entry if there is nothing to look up
+ lang::Locale aLocale( SvxCreateLocale( nLang ) );
+ uno::Reference< linguistic2::XThesaurus > xThes( LinguMgr::GetThesaurus() );
+ if (!bIsLookUpWord ||
+ !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
+ rSet.DisableItem( SID_THES );
+ }
+ else
+ {
rSet.DisableItem( SID_THES );
-
+ }
//! avoid puting the same item as SfxBoolItem at the end of this function
nSlotId = 0;
}