summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui')
-rwxr-xr-x[-rw-r--r--]sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx2
-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, 61 insertions, 20 deletions
diff --git a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx
index 6862634df9a0..97ec7b3ddee1 100644..100755
--- a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx
+++ b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx
@@ -48,7 +48,7 @@ namespace accessibility
mrWindow( rViewWindow ),
mpOutliner( &rOutliner ),
mpOutlinerView( &rOutlView ),
- mTextForwarder( rOutliner, NULL ),
+ mTextForwarder( rOutliner, 0 ),
mViewForwarder( rOutlView )
{
// register as listener - need to broadcast state change messages
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;
}