INTEGRATION: CWS sdwarningsbegone (1.74.32); FILE MERGED
2006/11/27 13:48:00 cl 1.74.32.3: #i69285# warning free code changes for sd project 2006/11/22 15:03:22 cl 1.74.32.2: RESYNC: (1.74-1.75); FILE MERGED 2006/11/22 12:41:49 cl 1.74.32.1: #i69285# warning free code changes for unxlngi6.pro
This commit is contained in:
@@ -4,9 +4,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: docshel4.cxx,v $
|
* $RCSfile: docshel4.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.75 $
|
* $Revision: 1.76 $
|
||||||
*
|
*
|
||||||
* last change: $Author: ihi $ $Date: 2006-11-14 14:26:45 $
|
* last change: $Author: kz $ $Date: 2006-12-12 17:12:22 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to
|
* The Contents of this file are made available subject to
|
||||||
* the terms of GNU Lesser General Public License Version 2.1.
|
* the terms of GNU Lesser General Public License Version 2.1.
|
||||||
@@ -152,7 +152,6 @@
|
|||||||
#ifndef SD_WINDOW_HXX
|
#ifndef SD_WINDOW_HXX
|
||||||
#include "Window.hxx"
|
#include "Window.hxx"
|
||||||
#endif
|
#endif
|
||||||
//CHINA001 #include "new_foil.hxx"
|
|
||||||
#include "sdmod.hxx"
|
#include "sdmod.hxx"
|
||||||
#ifndef SD_OUTLINE_VIEW_SHELL_HXX
|
#ifndef SD_OUTLINE_VIEW_SHELL_HXX
|
||||||
#include "OutlineViewShell.hxx"
|
#include "OutlineViewShell.hxx"
|
||||||
@@ -175,7 +174,7 @@ namespace sd {
|
|||||||
|
|
||||||
SfxPrinter* DrawDocShell::GetPrinter(BOOL bCreate)
|
SfxPrinter* DrawDocShell::GetPrinter(BOOL bCreate)
|
||||||
{
|
{
|
||||||
if (bCreate && !pPrinter)
|
if (bCreate && !mpPrinter)
|
||||||
{
|
{
|
||||||
// ItemSet mit speziellem Poolbereich anlegen
|
// ItemSet mit speziellem Poolbereich anlegen
|
||||||
SfxItemSet* pSet = new SfxItemSet( GetPool(),
|
SfxItemSet* pSet = new SfxItemSet( GetPool(),
|
||||||
@@ -185,23 +184,23 @@ SfxPrinter* DrawDocShell::GetPrinter(BOOL bCreate)
|
|||||||
0 );
|
0 );
|
||||||
// PrintOptionsSet setzen
|
// PrintOptionsSet setzen
|
||||||
SdOptionsPrintItem aPrintItem( ATTR_OPTIONS_PRINT,
|
SdOptionsPrintItem aPrintItem( ATTR_OPTIONS_PRINT,
|
||||||
SD_MOD()->GetSdOptions(pDoc->GetDocumentType()));
|
SD_MOD()->GetSdOptions(mpDoc->GetDocumentType()));
|
||||||
SfxFlagItem aFlagItem( SID_PRINTER_CHANGESTODOC );
|
SfxFlagItem aFlagItem( SID_PRINTER_CHANGESTODOC );
|
||||||
USHORT nFlags = 0;
|
USHORT nFlags = 0;
|
||||||
|
|
||||||
nFlags = (aPrintItem.IsWarningSize() ? SFX_PRINTER_CHG_SIZE : 0) |
|
nFlags = (aPrintItem.GetOptionsPrint().IsWarningSize() ? SFX_PRINTER_CHG_SIZE : 0) |
|
||||||
(aPrintItem.IsWarningOrientation() ? SFX_PRINTER_CHG_ORIENTATION : 0);
|
(aPrintItem.GetOptionsPrint().IsWarningOrientation() ? SFX_PRINTER_CHG_ORIENTATION : 0);
|
||||||
aFlagItem.SetValue( nFlags );
|
aFlagItem.SetValue( nFlags );
|
||||||
|
|
||||||
pSet->Put( aPrintItem );
|
pSet->Put( aPrintItem );
|
||||||
pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aPrintItem.IsWarningPrinter() ) );
|
pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aPrintItem.GetOptionsPrint().IsWarningPrinter() ) );
|
||||||
pSet->Put( aFlagItem );
|
pSet->Put( aFlagItem );
|
||||||
|
|
||||||
pPrinter = new SfxPrinter(pSet);
|
mpPrinter = new SfxPrinter(pSet);
|
||||||
bOwnPrinter = TRUE;
|
mbOwnPrinter = TRUE;
|
||||||
|
|
||||||
// Ausgabequalitaet setzen
|
// Ausgabequalitaet setzen
|
||||||
UINT16 nQuality = aPrintItem.GetOutputQuality();
|
UINT16 nQuality = aPrintItem.GetOptionsPrint().GetOutputQuality();
|
||||||
|
|
||||||
ULONG nMode = DRAWMODE_DEFAULT;
|
ULONG nMode = DRAWMODE_DEFAULT;
|
||||||
|
|
||||||
@@ -210,14 +209,14 @@ SfxPrinter* DrawDocShell::GetPrinter(BOOL bCreate)
|
|||||||
else if( nQuality == 2 )
|
else if( nQuality == 2 )
|
||||||
nMode = DRAWMODE_BLACKLINE | DRAWMODE_BLACKTEXT | DRAWMODE_WHITEFILL | DRAWMODE_GRAYBITMAP | DRAWMODE_WHITEGRADIENT;
|
nMode = DRAWMODE_BLACKLINE | DRAWMODE_BLACKTEXT | DRAWMODE_WHITEFILL | DRAWMODE_GRAYBITMAP | DRAWMODE_WHITEGRADIENT;
|
||||||
|
|
||||||
pPrinter->SetDrawMode( nMode );
|
mpPrinter->SetDrawMode( nMode );
|
||||||
|
|
||||||
MapMode aMM (pPrinter->GetMapMode());
|
MapMode aMM (mpPrinter->GetMapMode());
|
||||||
aMM.SetMapUnit(MAP_100TH_MM);
|
aMM.SetMapUnit(MAP_100TH_MM);
|
||||||
pPrinter->SetMapMode(aMM);
|
mpPrinter->SetMapMode(aMM);
|
||||||
UpdateRefDevice();
|
UpdateRefDevice();
|
||||||
}
|
}
|
||||||
return pPrinter;
|
return mpPrinter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@@ -228,35 +227,35 @@ SfxPrinter* DrawDocShell::GetPrinter(BOOL bCreate)
|
|||||||
|
|
||||||
void DrawDocShell::SetPrinter(SfxPrinter *pNewPrinter)
|
void DrawDocShell::SetPrinter(SfxPrinter *pNewPrinter)
|
||||||
{
|
{
|
||||||
if ( pViewShell )
|
if ( mpViewShell )
|
||||||
{
|
{
|
||||||
::sd::View* pView = pViewShell->GetView();
|
::sd::View* pView = mpViewShell->GetView();
|
||||||
if ( pView->IsTextEdit() )
|
if ( pView->IsTextEdit() )
|
||||||
pView->SdrEndTextEdit();
|
pView->SdrEndTextEdit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( pPrinter && bOwnPrinter && (pPrinter != pNewPrinter) )
|
if ( mpPrinter && mbOwnPrinter && (mpPrinter != pNewPrinter) )
|
||||||
{
|
{
|
||||||
delete pPrinter;
|
delete mpPrinter;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPrinter = pNewPrinter;
|
mpPrinter = pNewPrinter;
|
||||||
bOwnPrinter = TRUE;
|
mbOwnPrinter = TRUE;
|
||||||
if ( pDoc->GetPrinterIndependentLayout() == ::com::sun::star::document::PrinterIndependentLayout::DISABLED )
|
if ( mpDoc->GetPrinterIndependentLayout() == ::com::sun::star::document::PrinterIndependentLayout::DISABLED )
|
||||||
UpdateFontList();
|
UpdateFontList();
|
||||||
UpdateRefDevice();
|
UpdateRefDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawDocShell::UpdateFontList()
|
void DrawDocShell::UpdateFontList()
|
||||||
{
|
{
|
||||||
delete pFontList;
|
delete mpFontList;
|
||||||
OutputDevice* pRefDevice = NULL;
|
OutputDevice* pRefDevice = NULL;
|
||||||
if ( pDoc->GetPrinterIndependentLayout() == ::com::sun::star::document::PrinterIndependentLayout::DISABLED )
|
if ( mpDoc->GetPrinterIndependentLayout() == ::com::sun::star::document::PrinterIndependentLayout::DISABLED )
|
||||||
pRefDevice = GetPrinter(TRUE);
|
pRefDevice = GetPrinter(TRUE);
|
||||||
else
|
else
|
||||||
pRefDevice = SD_MOD()->GetVirtualRefDevice();
|
pRefDevice = SD_MOD()->GetVirtualRefDevice();
|
||||||
pFontList = new FontList( pRefDevice, NULL, FALSE );
|
mpFontList = new FontList( pRefDevice, NULL, FALSE );
|
||||||
SvxFontListItem aFontListItem( pFontList );
|
SvxFontListItem aFontListItem( mpFontList );
|
||||||
PutItem( aFontListItem );
|
PutItem( aFontListItem );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,25 +277,25 @@ Printer* DrawDocShell::GetDocumentPrinter()
|
|||||||
void DrawDocShell::OnDocumentPrinterChanged(Printer* pNewPrinter)
|
void DrawDocShell::OnDocumentPrinterChanged(Printer* pNewPrinter)
|
||||||
{
|
{
|
||||||
// if we already have a printer, see if its the same
|
// if we already have a printer, see if its the same
|
||||||
if( pPrinter )
|
if( mpPrinter )
|
||||||
{
|
{
|
||||||
// easy case
|
// easy case
|
||||||
if( pPrinter == pNewPrinter )
|
if( mpPrinter == pNewPrinter )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// compare if its the same printer with the same job setup
|
// compare if its the same printer with the same job setup
|
||||||
if( (pPrinter->GetName() == pNewPrinter->GetName()) &&
|
if( (mpPrinter->GetName() == pNewPrinter->GetName()) &&
|
||||||
(pPrinter->GetJobSetup() == pNewPrinter->GetJobSetup()))
|
(mpPrinter->GetJobSetup() == pNewPrinter->GetJobSetup()))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (pPrinter->IsA(SfxPrinter))
|
// if (mpPrinter->IsA(SfxPrinter))
|
||||||
{
|
{
|
||||||
// Da kein RTTI verfuegbar, wird hart gecasted (...)
|
// Da kein RTTI verfuegbar, wird hart gecasted (...)
|
||||||
SetPrinter((SfxPrinter*) pNewPrinter);
|
SetPrinter((SfxPrinter*) pNewPrinter);
|
||||||
|
|
||||||
// Printer gehoert dem Container
|
// Printer gehoert dem Container
|
||||||
bOwnPrinter = FALSE;
|
mbOwnPrinter = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,14 +306,14 @@ void DrawDocShell::OnDocumentPrinterChanged(Printer* pNewPrinter)
|
|||||||
\************************************************************************/
|
\************************************************************************/
|
||||||
void DrawDocShell::UpdateRefDevice()
|
void DrawDocShell::UpdateRefDevice()
|
||||||
{
|
{
|
||||||
if( pDoc )
|
if( mpDoc )
|
||||||
{
|
{
|
||||||
// Determine the device for which the output will be formatted.
|
// Determine the device for which the output will be formatted.
|
||||||
OutputDevice* pRefDevice = NULL;
|
OutputDevice* pRefDevice = NULL;
|
||||||
switch (pDoc->GetPrinterIndependentLayout())
|
switch (mpDoc->GetPrinterIndependentLayout())
|
||||||
{
|
{
|
||||||
case ::com::sun::star::document::PrinterIndependentLayout::DISABLED:
|
case ::com::sun::star::document::PrinterIndependentLayout::DISABLED:
|
||||||
pRefDevice = pPrinter;
|
pRefDevice = mpPrinter;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ::com::sun::star::document::PrinterIndependentLayout::ENABLED:
|
case ::com::sun::star::document::PrinterIndependentLayout::ENABLED:
|
||||||
@@ -327,17 +326,17 @@ void DrawDocShell::UpdateRefDevice()
|
|||||||
// as a fall-back.
|
// as a fall-back.
|
||||||
DBG_ASSERT(false, "DrawDocShell::UpdateRefDevice(): Unexpected printer layout mode");
|
DBG_ASSERT(false, "DrawDocShell::UpdateRefDevice(): Unexpected printer layout mode");
|
||||||
|
|
||||||
pRefDevice = pPrinter;
|
pRefDevice = mpPrinter;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pDoc->SetRefDevice( pRefDevice );
|
mpDoc->SetRefDevice( pRefDevice );
|
||||||
|
|
||||||
::sd::Outliner* pOutl = pDoc->GetOutliner( FALSE );
|
::sd::Outliner* pOutl = mpDoc->GetOutliner( FALSE );
|
||||||
|
|
||||||
if( pOutl )
|
if( pOutl )
|
||||||
pOutl->SetRefDevice( pRefDevice );
|
pOutl->SetRefDevice( pRefDevice );
|
||||||
|
|
||||||
::sd::Outliner* pInternalOutl = pDoc->GetInternalOutliner( FALSE );
|
::sd::Outliner* pInternalOutl = mpDoc->GetInternalOutliner( FALSE );
|
||||||
|
|
||||||
if( pInternalOutl )
|
if( pInternalOutl )
|
||||||
pInternalOutl->SetRefDevice( pRefDevice );
|
pInternalOutl->SetRefDevice( pRefDevice );
|
||||||
@@ -361,8 +360,8 @@ BOOL DrawDocShell::InitNew( const ::com::sun::star::uno::Reference< ::com::sun::
|
|||||||
|
|
||||||
if (bRet)
|
if (bRet)
|
||||||
{
|
{
|
||||||
if( !bSdDataObj )
|
if( !mbSdDataObj )
|
||||||
pDoc->NewOrLoadCompleted(NEW_DOC); // otherwise calling
|
mpDoc->NewOrLoadCompleted(NEW_DOC); // otherwise calling
|
||||||
// NewOrLoadCompleted(NEW_LOADED) in
|
// NewOrLoadCompleted(NEW_LOADED) in
|
||||||
// SdDrawDocument::AllocModel()
|
// SdDrawDocument::AllocModel()
|
||||||
}
|
}
|
||||||
@@ -402,14 +401,14 @@ BOOL DrawDocShell::Load( SfxMedium& rMedium )
|
|||||||
{
|
{
|
||||||
if( ( SFX_ITEM_SET == pSet->GetItemState(SID_PREVIEW ) ) && ( (SfxBoolItem&) ( pSet->Get( SID_PREVIEW ) ) ).GetValue() )
|
if( ( SFX_ITEM_SET == pSet->GetItemState(SID_PREVIEW ) ) && ( (SfxBoolItem&) ( pSet->Get( SID_PREVIEW ) ) ).GetValue() )
|
||||||
{
|
{
|
||||||
pDoc->SetStarDrawPreviewMode( TRUE );
|
mpDoc->SetStarDrawPreviewMode( TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( SFX_ITEM_SET == pSet->GetItemState(SID_DOC_STARTPRESENTATION)&&
|
if( SFX_ITEM_SET == pSet->GetItemState(SID_DOC_STARTPRESENTATION)&&
|
||||||
( (SfxBoolItem&) ( pSet->Get( SID_DOC_STARTPRESENTATION ) ) ).GetValue() )
|
( (SfxBoolItem&) ( pSet->Get( SID_DOC_STARTPRESENTATION ) ) ).GetValue() )
|
||||||
{
|
{
|
||||||
bStartPresentation = true;
|
bStartPresentation = true;
|
||||||
pDoc->SetStartWithPresentation( true );
|
mpDoc->SetStartWithPresentation( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -430,7 +429,7 @@ BOOL DrawDocShell::Load( SfxMedium& rMedium )
|
|||||||
//TODO/LATER: looks a little bit strange!
|
//TODO/LATER: looks a little bit strange!
|
||||||
if( ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) && SfxObjectShell::GetVisArea( ASPECT_CONTENT ).IsEmpty() )
|
if( ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) && SfxObjectShell::GetVisArea( ASPECT_CONTENT ).IsEmpty() )
|
||||||
{
|
{
|
||||||
SdPage* pPage = pDoc->GetSdPage( 0, PK_STANDARD );
|
SdPage* pPage = mpDoc->GetSdPage( 0, PK_STANDARD );
|
||||||
|
|
||||||
if( pPage )
|
if( pPage )
|
||||||
SetVisArea( Rectangle( pPage->GetAllObjBoundRect() ) );
|
SetVisArea( Rectangle( pPage->GetAllObjBoundRect() ) );
|
||||||
@@ -452,9 +451,9 @@ BOOL DrawDocShell::Load( SfxMedium& rMedium )
|
|||||||
// tell SFX to change viewshell when in preview mode
|
// tell SFX to change viewshell when in preview mode
|
||||||
if( IsPreview() || bStartPresentation )
|
if( IsPreview() || bStartPresentation )
|
||||||
{
|
{
|
||||||
SfxItemSet *pSet = GetMedium()->GetItemSet();
|
SfxItemSet *pMediumSet = GetMedium()->GetItemSet();
|
||||||
if( pSet )
|
if( pMediumSet )
|
||||||
pSet->Put( SfxUInt16Item( SID_VIEW_ID, bStartPresentation ? 1 : 5 ) );
|
pMediumSet->Put( SfxUInt16Item( SID_VIEW_ID, bStartPresentation ? 1 : 5 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return bRet;
|
return bRet;
|
||||||
@@ -471,8 +470,8 @@ BOOL DrawDocShell::LoadFrom( SfxMedium& rMedium )
|
|||||||
mbNewDocument = sal_False;
|
mbNewDocument = sal_False;
|
||||||
|
|
||||||
WaitObject* pWait = NULL;
|
WaitObject* pWait = NULL;
|
||||||
if( pViewShell )
|
if( mpViewShell )
|
||||||
pWait = new WaitObject( (Window*) pViewShell->GetActiveWindow() );
|
pWait = new WaitObject( (Window*) mpViewShell->GetActiveWindow() );
|
||||||
|
|
||||||
BOOL bRet = FALSE;
|
BOOL bRet = FALSE;
|
||||||
|
|
||||||
@@ -501,9 +500,9 @@ BOOL DrawDocShell::LoadFrom( SfxMedium& rMedium )
|
|||||||
}
|
}
|
||||||
} */
|
} */
|
||||||
|
|
||||||
pDoc->NewOrLoadCompleted( NEW_DOC );
|
mpDoc->NewOrLoadCompleted( NEW_DOC );
|
||||||
pDoc->CreateFirstPages();
|
mpDoc->CreateFirstPages();
|
||||||
pDoc->StopWorkStartupDelay();
|
mpDoc->StopWorkStartupDelay();
|
||||||
|
|
||||||
// TODO/LATER: nobody is interested in the error code?!
|
// TODO/LATER: nobody is interested in the error code?!
|
||||||
ErrCode nError = ERRCODE_NONE;
|
ErrCode nError = ERRCODE_NONE;
|
||||||
@@ -545,28 +544,28 @@ BOOL DrawDocShell::ConvertFrom( SfxMedium& rMedium )
|
|||||||
{
|
{
|
||||||
if( ( SFX_ITEM_SET == pSet->GetItemState(SID_PREVIEW ) ) && ( (SfxBoolItem&) ( pSet->Get( SID_PREVIEW ) ) ).GetValue() )
|
if( ( SFX_ITEM_SET == pSet->GetItemState(SID_PREVIEW ) ) && ( (SfxBoolItem&) ( pSet->Get( SID_PREVIEW ) ) ).GetValue() )
|
||||||
{
|
{
|
||||||
pDoc->SetStarDrawPreviewMode( TRUE );
|
mpDoc->SetStarDrawPreviewMode( TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( SFX_ITEM_SET == pSet->GetItemState(SID_DOC_STARTPRESENTATION)&&
|
if( SFX_ITEM_SET == pSet->GetItemState(SID_DOC_STARTPRESENTATION)&&
|
||||||
( (SfxBoolItem&) ( pSet->Get( SID_DOC_STARTPRESENTATION ) ) ).GetValue() )
|
( (SfxBoolItem&) ( pSet->Get( SID_DOC_STARTPRESENTATION ) ) ).GetValue() )
|
||||||
{
|
{
|
||||||
bStartPresentation = true;
|
bStartPresentation = true;
|
||||||
pDoc->SetStartWithPresentation( true );
|
mpDoc->SetStartWithPresentation( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aFilterName == pFilterPowerPoint97 || aFilterName == pFilterPowerPoint97Template)
|
if( aFilterName == pFilterPowerPoint97 || aFilterName == pFilterPowerPoint97Template)
|
||||||
{
|
{
|
||||||
pDoc->StopWorkStartupDelay();
|
mpDoc->StopWorkStartupDelay();
|
||||||
bRet = SdPPTFilter( rMedium, *this, sal_True ).Import();
|
bRet = SdPPTFilter( rMedium, *this, sal_True ).Import();
|
||||||
}
|
}
|
||||||
else if (aFilterName.SearchAscii("impress8" ) != STRING_NOTFOUND ||
|
else if (aFilterName.SearchAscii("impress8" ) != STRING_NOTFOUND ||
|
||||||
aFilterName.SearchAscii("draw8") != STRING_NOTFOUND )
|
aFilterName.SearchAscii("draw8") != STRING_NOTFOUND )
|
||||||
{
|
{
|
||||||
// TODO/LATER: nobody is interested in the error code?!
|
// TODO/LATER: nobody is interested in the error code?!
|
||||||
pDoc->CreateFirstPages();
|
mpDoc->CreateFirstPages();
|
||||||
pDoc->StopWorkStartupDelay();
|
mpDoc->StopWorkStartupDelay();
|
||||||
ErrCode nError = ERRCODE_NONE;
|
ErrCode nError = ERRCODE_NONE;
|
||||||
bRet = SdXMLFilter( rMedium, *this, sal_True ).Import( nError );
|
bRet = SdXMLFilter( rMedium, *this, sal_True ).Import( nError );
|
||||||
|
|
||||||
@@ -574,21 +573,21 @@ BOOL DrawDocShell::ConvertFrom( SfxMedium& rMedium )
|
|||||||
else if (aFilterName.SearchAscii("StarOffice XML (Draw)" ) != STRING_NOTFOUND || aFilterName.SearchAscii("StarOffice XML (Impress)") != STRING_NOTFOUND )
|
else if (aFilterName.SearchAscii("StarOffice XML (Draw)" ) != STRING_NOTFOUND || aFilterName.SearchAscii("StarOffice XML (Impress)") != STRING_NOTFOUND )
|
||||||
{
|
{
|
||||||
// TODO/LATER: nobody is interested in the error code?!
|
// TODO/LATER: nobody is interested in the error code?!
|
||||||
pDoc->CreateFirstPages();
|
mpDoc->CreateFirstPages();
|
||||||
pDoc->StopWorkStartupDelay();
|
mpDoc->StopWorkStartupDelay();
|
||||||
ErrCode nError = ERRCODE_NONE;
|
ErrCode nError = ERRCODE_NONE;
|
||||||
bRet = SdXMLFilter( rMedium, *this, sal_True, SDXMLMODE_Normal, SOFFICE_FILEFORMAT_60 ).Import( nError );
|
bRet = SdXMLFilter( rMedium, *this, sal_True, SDXMLMODE_Normal, SOFFICE_FILEFORMAT_60 ).Import( nError );
|
||||||
}
|
}
|
||||||
else if( aFilterName.EqualsAscii( "CGM - Computer Graphics Metafile" ) )
|
else if( aFilterName.EqualsAscii( "CGM - Computer Graphics Metafile" ) )
|
||||||
{
|
{
|
||||||
pDoc->CreateFirstPages();
|
mpDoc->CreateFirstPages();
|
||||||
pDoc->StopWorkStartupDelay();
|
mpDoc->StopWorkStartupDelay();
|
||||||
bRet = SdCGMFilter( rMedium, *this, sal_True ).Import();
|
bRet = SdCGMFilter( rMedium, *this, sal_True ).Import();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pDoc->CreateFirstPages();
|
mpDoc->CreateFirstPages();
|
||||||
pDoc->StopWorkStartupDelay();
|
mpDoc->StopWorkStartupDelay();
|
||||||
bRet = SdGRFFilter( rMedium, *this ).Import();
|
bRet = SdGRFFilter( rMedium, *this ).Import();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,19 +596,19 @@ BOOL DrawDocShell::ConvertFrom( SfxMedium& rMedium )
|
|||||||
// tell SFX to change viewshell when in preview mode
|
// tell SFX to change viewshell when in preview mode
|
||||||
if( IsPreview() )
|
if( IsPreview() )
|
||||||
{
|
{
|
||||||
SfxItemSet *pSet = GetMedium()->GetItemSet();
|
SfxItemSet *pMediumSet = GetMedium()->GetItemSet();
|
||||||
|
|
||||||
if( pSet )
|
if( pMediumSet )
|
||||||
pSet->Put( SfxUInt16Item( SID_VIEW_ID, 5 ) );
|
pMediumSet->Put( SfxUInt16Item( SID_VIEW_ID, 5 ) );
|
||||||
}
|
}
|
||||||
SetWaitCursor( FALSE );
|
SetWaitCursor( FALSE );
|
||||||
|
|
||||||
// tell SFX to change viewshell when in preview mode
|
// tell SFX to change viewshell when in preview mode
|
||||||
if( IsPreview() || bStartPresentation )
|
if( IsPreview() || bStartPresentation )
|
||||||
{
|
{
|
||||||
SfxItemSet *pSet = GetMedium()->GetItemSet();
|
SfxItemSet *pMediumSet = GetMedium()->GetItemSet();
|
||||||
if( pSet )
|
if( pMediumSet )
|
||||||
pSet->Put( SfxUInt16Item( SID_VIEW_ID, bStartPresentation ? 1 : 5 ) );
|
pMediumSet->Put( SfxUInt16Item( SID_VIEW_ID, bStartPresentation ? 1 : 5 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return bRet;
|
return bRet;
|
||||||
@@ -623,7 +622,7 @@ BOOL DrawDocShell::ConvertFrom( SfxMedium& rMedium )
|
|||||||
|
|
||||||
BOOL DrawDocShell::Save()
|
BOOL DrawDocShell::Save()
|
||||||
{
|
{
|
||||||
pDoc->StopWorkStartupDelay();
|
mpDoc->StopWorkStartupDelay();
|
||||||
|
|
||||||
//TODO/LATER: why this?!
|
//TODO/LATER: why this?!
|
||||||
if( GetCreateMode() == SFX_CREATE_MODE_STANDARD )
|
if( GetCreateMode() == SFX_CREATE_MODE_STANDARD )
|
||||||
@@ -650,7 +649,7 @@ BOOL DrawDocShell::Save()
|
|||||||
|
|
||||||
BOOL DrawDocShell::SaveAs( SfxMedium& rMedium )
|
BOOL DrawDocShell::SaveAs( SfxMedium& rMedium )
|
||||||
{
|
{
|
||||||
pDoc->StopWorkStartupDelay();
|
mpDoc->StopWorkStartupDelay();
|
||||||
|
|
||||||
//TODO/LATER: why this?!
|
//TODO/LATER: why this?!
|
||||||
if( GetCreateMode() == SFX_CREATE_MODE_STANDARD )
|
if( GetCreateMode() == SFX_CREATE_MODE_STANDARD )
|
||||||
@@ -682,7 +681,7 @@ BOOL DrawDocShell::ConvertTo( SfxMedium& rMedium )
|
|||||||
{
|
{
|
||||||
BOOL bRet = FALSE;
|
BOOL bRet = FALSE;
|
||||||
|
|
||||||
if( pDoc->GetPageCount() )
|
if( mpDoc->GetPageCount() )
|
||||||
{
|
{
|
||||||
const SfxFilter* pMediumFilter = rMedium.GetFilter();
|
const SfxFilter* pMediumFilter = rMedium.GetFilter();
|
||||||
const String aTypeName( pMediumFilter->GetTypeName() );
|
const String aTypeName( pMediumFilter->GetTypeName() );
|
||||||
@@ -720,12 +719,13 @@ BOOL DrawDocShell::ConvertTo( SfxMedium& rMedium )
|
|||||||
|
|
||||||
if( pFilter )
|
if( pFilter )
|
||||||
{
|
{
|
||||||
const ULONG nOldSwapMode = pDoc->GetSwapGraphicsMode();
|
const ULONG nOldSwapMode = mpDoc->GetSwapGraphicsMode();
|
||||||
|
|
||||||
pDoc->SetSwapGraphicsMode( SDR_SWAPGRAPHICSMODE_TEMP );
|
mpDoc->SetSwapGraphicsMode( SDR_SWAPGRAPHICSMODE_TEMP );
|
||||||
|
|
||||||
if( !( bRet = pFilter->Export() ) )
|
bRet = pFilter->Export();
|
||||||
pDoc->SetSwapGraphicsMode( nOldSwapMode );
|
if( !bRet )
|
||||||
|
mpDoc->SetSwapGraphicsMode( nOldSwapMode );
|
||||||
|
|
||||||
delete pFilter;
|
delete pFilter;
|
||||||
}
|
}
|
||||||
@@ -747,18 +747,18 @@ BOOL DrawDocShell::SaveCompleted( const ::com::sun::star::uno::Reference< ::com:
|
|||||||
|
|
||||||
if( SfxObjectShell::SaveCompleted(xStorage) )
|
if( SfxObjectShell::SaveCompleted(xStorage) )
|
||||||
{
|
{
|
||||||
pDoc->NbcSetChanged( FALSE );
|
mpDoc->NbcSetChanged( FALSE );
|
||||||
|
|
||||||
if( pViewShell )
|
if( mpViewShell )
|
||||||
{
|
{
|
||||||
if( pViewShell->ISA( OutlineViewShell ) )
|
if( mpViewShell->ISA( OutlineViewShell ) )
|
||||||
static_cast<OutlineView*>(pViewShell->GetView())
|
static_cast<OutlineView*>(mpViewShell->GetView())
|
||||||
->GetOutliner()->ClearModifyFlag();
|
->GetOutliner()->ClearModifyFlag();
|
||||||
|
|
||||||
SdrOutliner* pOutl = pViewShell->GetView()->GetTextEditOutliner();
|
SdrOutliner* pOutl = mpViewShell->GetView()->GetTextEditOutliner();
|
||||||
if( pOutl )
|
if( pOutl )
|
||||||
{
|
{
|
||||||
SdrObject* pObj = pViewShell->GetView()->GetTextEditObject();
|
SdrObject* pObj = mpViewShell->GetView()->GetTextEditObject();
|
||||||
if( pObj )
|
if( pObj )
|
||||||
pObj->NbcSetOutlinerParaObject( pOutl->CreateParaObject() );
|
pObj->NbcSetOutlinerParaObject( pOutl->CreateParaObject() );
|
||||||
|
|
||||||
@@ -768,8 +768,8 @@ BOOL DrawDocShell::SaveCompleted( const ::com::sun::star::uno::Reference< ::com:
|
|||||||
|
|
||||||
bRet = TRUE;
|
bRet = TRUE;
|
||||||
|
|
||||||
SfxViewFrame* pFrame = ( pViewShell && pViewShell->GetViewFrame() ) ?
|
SfxViewFrame* pFrame = ( mpViewShell && mpViewShell->GetViewFrame() ) ?
|
||||||
pViewShell->GetViewFrame() :
|
mpViewShell->GetViewFrame() :
|
||||||
SfxViewFrame::Current();
|
SfxViewFrame::Current();
|
||||||
|
|
||||||
if( pFrame )
|
if( pFrame )
|
||||||
@@ -786,7 +786,7 @@ BOOL DrawDocShell::SaveCompleted( const ::com::sun::star::uno::Reference< ::com:
|
|||||||
|
|
||||||
SdDrawDocument* DrawDocShell::GetDoc()
|
SdDrawDocument* DrawDocShell::GetDoc()
|
||||||
{
|
{
|
||||||
return pDoc;
|
return mpDoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@@ -797,7 +797,7 @@ SdDrawDocument* DrawDocShell::GetDoc()
|
|||||||
|
|
||||||
SfxStyleSheetBasePool* DrawDocShell::GetStyleSheetPool()
|
SfxStyleSheetBasePool* DrawDocShell::GetStyleSheetPool()
|
||||||
{
|
{
|
||||||
return( (SfxStyleSheetBasePool*) pDoc->GetStyleSheetPool() );
|
return( (SfxStyleSheetBasePool*) mpDoc->GetStyleSheetPool() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@@ -812,21 +812,21 @@ BOOL DrawDocShell::GotoBookmark(const String& rBookmark)
|
|||||||
::rtl::OUStringToOString(rBookmark, RTL_TEXTENCODING_UTF8).getStr());
|
::rtl::OUStringToOString(rBookmark, RTL_TEXTENCODING_UTF8).getStr());
|
||||||
BOOL bFound = FALSE;
|
BOOL bFound = FALSE;
|
||||||
|
|
||||||
if (pViewShell && pViewShell->ISA(DrawViewShell))
|
if (mpViewShell && mpViewShell->ISA(DrawViewShell))
|
||||||
{
|
{
|
||||||
DrawViewShell* pDrViewSh = static_cast<DrawViewShell*>(pViewShell);
|
DrawViewShell* pDrViewSh = static_cast<DrawViewShell*>(mpViewShell);
|
||||||
|
|
||||||
String aBookmark( rBookmark );
|
String aBookmark( rBookmark );
|
||||||
|
|
||||||
// Ist das Bookmark eine Seite?
|
// Ist das Bookmark eine Seite?
|
||||||
BOOL bIsMasterPage;
|
BOOL bIsMasterPage;
|
||||||
USHORT nPgNum = pDoc->GetPageByName( aBookmark, bIsMasterPage );
|
USHORT nPgNum = mpDoc->GetPageByName( aBookmark, bIsMasterPage );
|
||||||
SdrObject* pObj = NULL;
|
SdrObject* pObj = NULL;
|
||||||
|
|
||||||
if (nPgNum == SDRPAGE_NOTFOUND)
|
if (nPgNum == SDRPAGE_NOTFOUND)
|
||||||
{
|
{
|
||||||
// Ist das Bookmark ein Objekt?
|
// Ist das Bookmark ein Objekt?
|
||||||
pObj = pDoc->GetObj(aBookmark);
|
pObj = mpDoc->GetObj(aBookmark);
|
||||||
|
|
||||||
if (pObj)
|
if (pObj)
|
||||||
{
|
{
|
||||||
@@ -841,25 +841,25 @@ BOOL DrawDocShell::GotoBookmark(const String& rBookmark)
|
|||||||
bFound = TRUE;
|
bFound = TRUE;
|
||||||
SdPage* pPage;
|
SdPage* pPage;
|
||||||
if (bIsMasterPage)
|
if (bIsMasterPage)
|
||||||
pPage = (SdPage*) pDoc->GetMasterPage(nPgNum);
|
pPage = (SdPage*) mpDoc->GetMasterPage(nPgNum);
|
||||||
else
|
else
|
||||||
pPage = (SdPage*) pDoc->GetPage(nPgNum);
|
pPage = (SdPage*) mpDoc->GetPage(nPgNum);
|
||||||
|
|
||||||
// 1.) Change the view shell to the edit view, the notes view,
|
// 1.) Change the view shell to the edit view, the notes view,
|
||||||
// or the handout view.
|
// or the handout view.
|
||||||
PageKind eNewPageKind = pPage->GetPageKind();
|
PageKind eNewPageKind = pPage->GetPageKind();
|
||||||
|
|
||||||
if( (eNewPageKind != PK_STANDARD) && (pDoc->GetDocumentType() == DOCUMENT_TYPE_DRAW) )
|
if( (eNewPageKind != PK_STANDARD) && (mpDoc->GetDocumentType() == DOCUMENT_TYPE_DRAW) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (eNewPageKind != pDrViewSh->GetPageKind())
|
if (eNewPageKind != pDrViewSh->GetPageKind())
|
||||||
{
|
{
|
||||||
// Arbeitsbereich wechseln
|
// Arbeitsbereich wechseln
|
||||||
GetFrameView()->SetPageKind(eNewPageKind);
|
GetFrameView()->SetPageKind(eNewPageKind);
|
||||||
if (pViewShell != NULL)
|
if (mpViewShell != NULL)
|
||||||
{
|
{
|
||||||
ViewShell::ShellType eShellType(
|
ViewShell::ShellType eShellType(
|
||||||
pViewShell->GetShellType());
|
mpViewShell->GetShellType());
|
||||||
switch (eNewPageKind)
|
switch (eNewPageKind)
|
||||||
{
|
{
|
||||||
case PK_STANDARD:
|
case PK_STANDARD:
|
||||||
@@ -874,13 +874,13 @@ BOOL DrawDocShell::GotoBookmark(const String& rBookmark)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pViewShell->GetViewShellBase().GetPaneManager()
|
mpViewShell->GetViewShellBase().GetPaneManager()
|
||||||
.RequestMainViewShellChange(
|
.RequestMainViewShellChange(
|
||||||
eShellType,
|
eShellType,
|
||||||
PaneManager::CM_SYNCHRONOUS);
|
PaneManager::CM_SYNCHRONOUS);
|
||||||
}
|
}
|
||||||
// Die aktuelle ViewShell hat sich geaendert!
|
// Die aktuelle ViewShell hat sich geaendert!
|
||||||
pDrViewSh = static_cast<DrawViewShell*>(pViewShell);
|
pDrViewSh = static_cast<DrawViewShell*>(mpViewShell);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2.) Set the edit mode to either the normal edit mode or the
|
// 2.) Set the edit mode to either the normal edit mode or the
|
||||||
@@ -930,8 +930,8 @@ BOOL DrawDocShell::GotoBookmark(const String& rBookmark)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SfxBindings& rBindings = ( ( pViewShell && pViewShell->GetViewFrame() ) ?
|
SfxBindings& rBindings = ( ( mpViewShell && mpViewShell->GetViewFrame() ) ?
|
||||||
pViewShell->GetViewFrame() : SfxViewFrame::Current() )->GetBindings();
|
mpViewShell->GetViewFrame() : SfxViewFrame::Current() )->GetBindings();
|
||||||
|
|
||||||
rBindings.Invalidate(SID_NAVIGATOR_STATE, TRUE, FALSE);
|
rBindings.Invalidate(SID_NAVIGATOR_STATE, TRUE, FALSE);
|
||||||
rBindings.Invalidate(SID_NAVIGATOR_PAGENAME);
|
rBindings.Invalidate(SID_NAVIGATOR_PAGENAME);
|
||||||
@@ -979,8 +979,8 @@ BOOL DrawDocShell::SaveAsOwnFormat( SfxMedium& rMedium )
|
|||||||
|
|
||||||
if( aLayoutName.Len() )
|
if( aLayoutName.Len() )
|
||||||
{
|
{
|
||||||
String aOldPageLayoutName = pDoc->GetSdPage(0, PK_STANDARD)->GetLayoutName();
|
String aOldPageLayoutName = mpDoc->GetSdPage(0, PK_STANDARD)->GetLayoutName();
|
||||||
pDoc->RenameLayoutTemplate(aOldPageLayoutName, aLayoutName);
|
mpDoc->RenameLayoutTemplate(aOldPageLayoutName, aLayoutName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -995,14 +995,14 @@ BOOL DrawDocShell::SaveAsOwnFormat( SfxMedium& rMedium )
|
|||||||
|
|
||||||
void DrawDocShell::FillClass(SvGlobalName* pClassName,
|
void DrawDocShell::FillClass(SvGlobalName* pClassName,
|
||||||
sal_uInt32* pFormat,
|
sal_uInt32* pFormat,
|
||||||
String* pAppName,
|
String* ,
|
||||||
String* pFullTypeName,
|
String* pFullTypeName,
|
||||||
String* pShortTypeName,
|
String* pShortTypeName,
|
||||||
sal_Int32 nFileFormat ) const
|
sal_Int32 nFileFormat ) const
|
||||||
{
|
{
|
||||||
if (nFileFormat == SOFFICE_FILEFORMAT_60)
|
if (nFileFormat == SOFFICE_FILEFORMAT_60)
|
||||||
{
|
{
|
||||||
if ( eDocType == DOCUMENT_TYPE_DRAW )
|
if ( meDocType == DOCUMENT_TYPE_DRAW )
|
||||||
{
|
{
|
||||||
*pClassName = SvGlobalName(SO3_SDRAW_CLASSID_60);
|
*pClassName = SvGlobalName(SO3_SDRAW_CLASSID_60);
|
||||||
*pFormat = SOT_FORMATSTR_ID_STARDRAW_60;
|
*pFormat = SOT_FORMATSTR_ID_STARDRAW_60;
|
||||||
@@ -1017,7 +1017,7 @@ void DrawDocShell::FillClass(SvGlobalName* pClassName,
|
|||||||
}
|
}
|
||||||
else if (nFileFormat == SOFFICE_FILEFORMAT_8)
|
else if (nFileFormat == SOFFICE_FILEFORMAT_8)
|
||||||
{
|
{
|
||||||
if ( eDocType == DOCUMENT_TYPE_DRAW )
|
if ( meDocType == DOCUMENT_TYPE_DRAW )
|
||||||
{
|
{
|
||||||
*pClassName = SvGlobalName(SO3_SDRAW_CLASSID_60);
|
*pClassName = SvGlobalName(SO3_SDRAW_CLASSID_60);
|
||||||
*pFormat = SOT_FORMATSTR_ID_STARDRAW_8;
|
*pFormat = SOT_FORMATSTR_ID_STARDRAW_8;
|
||||||
@@ -1031,7 +1031,7 @@ void DrawDocShell::FillClass(SvGlobalName* pClassName,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*pShortTypeName = String(SdResId( (eDocType == DOCUMENT_TYPE_DRAW) ?
|
*pShortTypeName = String(SdResId( (meDocType == DOCUMENT_TYPE_DRAW) ?
|
||||||
STR_GRAPHIC_DOCUMENT : STR_IMPRESS_DOCUMENT ));
|
STR_GRAPHIC_DOCUMENT : STR_IMPRESS_DOCUMENT ));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1040,8 +1040,8 @@ OutputDevice* DrawDocShell::GetDocumentRefDev (void)
|
|||||||
OutputDevice* pReferenceDevice = SfxObjectShell::GetDocumentRefDev ();
|
OutputDevice* pReferenceDevice = SfxObjectShell::GetDocumentRefDev ();
|
||||||
// Only when our parent does not have a reference device then we return
|
// Only when our parent does not have a reference device then we return
|
||||||
// our own.
|
// our own.
|
||||||
if (pReferenceDevice == NULL && pDoc != NULL)
|
if (pReferenceDevice == NULL && mpDoc != NULL)
|
||||||
pReferenceDevice = pDoc->GetRefDevice ();
|
pReferenceDevice = mpDoc->GetRefDevice ();
|
||||||
return pReferenceDevice;
|
return pReferenceDevice;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1053,7 +1053,7 @@ void DrawDocShell::OpenBookmark( const String& rBookmarkURL )
|
|||||||
SfxStringItem aReferer( SID_REFERER, GetMedium()->GetName() );
|
SfxStringItem aReferer( SID_REFERER, GetMedium()->GetName() );
|
||||||
SfxBoolItem aBrowseItem( SID_BROWSE, TRUE );
|
SfxBoolItem aBrowseItem( SID_BROWSE, TRUE );
|
||||||
|
|
||||||
( pViewShell ? pViewShell->GetViewFrame() : SfxViewFrame::Current() )->GetDispatcher()->
|
( mpViewShell ? mpViewShell->GetViewFrame() : SfxViewFrame::Current() )->GetDispatcher()->
|
||||||
Execute(SID_OPENDOC, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aStrItem, &aBrowseItem, &aReferer, 0L );
|
Execute(SID_OPENDOC, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, &aStrItem, &aBrowseItem, &aReferer, 0L );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user