Cleanup
diff --git a/main/sd/source/ui/dlg/sdtreelb.cxx b/main/sd/source/ui/dlg/sdtreelb.cxx
index 2f57bf6..6441e85 100644
--- a/main/sd/source/ui/dlg/sdtreelb.cxx
+++ b/main/sd/source/ui/dlg/sdtreelb.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
@@ -65,26 +63,25 @@
class SdPageObjsTLB::IconProvider
{
public:
- IconProvider (void);
+ IconProvider (void);
- // Regular icons.
- Image maImgPage;
- Image maImgPageExcl;
- Image maImgPageObjsExcl;
- Image maImgPageObjs;
- Image maImgObjects;
- Image maImgGroup;
+ // Regular icons.
+ Image maImgPage;
+ Image maImgPageExcl;
+ Image maImgPageObjsExcl;
+ Image maImgPageObjs;
+ Image maImgObjects;
+ Image maImgGroup;
- // High contrast icons.
- Image maImgPageH;
- Image maImgPageExclH;
- Image maImgPageObjsExclH;
- Image maImgPageObjsH;
- Image maImgObjectsH;
- Image maImgGroupH;
+ // High contrast icons.
+ Image maImgPageH;
+ Image maImgPageExclH;
+ Image maImgPageObjsExclH;
+ Image maImgPageObjsH;
+ Image maImgObjectsH;
+ Image maImgGroupH;
};
-
sal_Bool SD_DLLPRIVATE SdPageObjsTLB::bIsInDrag = sal_False;
sal_Bool SdPageObjsTLB::IsInDrag()
@@ -99,23 +96,20 @@
// -----------------------------------------
SdPageObjsTLB::SdPageObjsTransferable::SdPageObjsTransferable(
- SdPageObjsTLB& rParent,
- const INetBookmark& rBookmark,
- ::sd::DrawDocShell& rDocShell,
- NavigatorDragType eDragType,
- const ::com::sun::star::uno::Any& rTreeListBoxData )
- : SdTransferable(rDocShell.GetDoc(), NULL, sal_True),
- mrParent( rParent ),
- maBookmark( rBookmark ),
- mrDocShell( rDocShell ),
- meDragType( eDragType ),
- maTreeListBoxData( rTreeListBoxData )
+ SdPageObjsTLB& rParent,
+ const INetBookmark& rBookmark,
+ ::sd::DrawDocShell& rDocShell,
+ NavigatorDragType eDragType,
+ const ::com::sun::star::uno::Any& rTreeListBoxData )
+ : SdTransferable(rDocShell.GetDoc(), NULL, sal_True),
+ mrParent( rParent ),
+ maBookmark( rBookmark ),
+ mrDocShell( rDocShell ),
+ meDragType( eDragType ),
+ maTreeListBoxData( rTreeListBoxData )
{
}
-
-
-
SdPageObjsTLB::SdPageObjsTransferable::~SdPageObjsTransferable()
{
}
@@ -124,9 +118,9 @@
void SdPageObjsTLB::SdPageObjsTransferable::AddSupportedFormats()
{
- AddFormat(SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK);
- AddFormat(SOT_FORMATSTR_ID_TREELISTBOX);
- AddFormat(GetListBoxDropFormatId());
+ AddFormat(SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK);
+ AddFormat(SOT_FORMATSTR_ID_TREELISTBOX);
+ AddFormat(GetListBoxDropFormatId());
}
// -----------------------------------------------------------------------------
@@ -134,19 +128,19 @@
sal_Bool SdPageObjsTLB::SdPageObjsTransferable::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
{
sal_uLong nFormatId = SotExchange::GetFormat( rFlavor );
- switch (nFormatId)
- {
- case SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK:
- SetINetBookmark( maBookmark, rFlavor );
- return sal_True;
+ switch (nFormatId)
+ {
+ case SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK:
+ SetINetBookmark( maBookmark, rFlavor );
+ return sal_True;
- case SOT_FORMATSTR_ID_TREELISTBOX:
- SetAny(maTreeListBoxData, rFlavor);
- return sal_True;
+ case SOT_FORMATSTR_ID_TREELISTBOX:
+ SetAny(maTreeListBoxData, rFlavor);
+ return sal_True;
- default:
- return sal_False;
- }
+ default:
+ return sal_False;
+ }
}
// -----------------------------------------------------------------------------
@@ -154,36 +148,36 @@
void SdPageObjsTLB::SdPageObjsTransferable::DragFinished( sal_Int8 nDropAction )
{
mrParent.OnDragFinished( nDropAction );
- SdTransferable::DragFinished(nDropAction);
+ SdTransferable::DragFinished(nDropAction);
}
// -----------------------------------------------------------------------------
::sd::DrawDocShell& SdPageObjsTLB::SdPageObjsTransferable::GetDocShell() const
{
- return mrDocShell;
+ return mrDocShell;
}
// -----------------------------------------------------------------------------
NavigatorDragType SdPageObjsTLB::SdPageObjsTransferable::GetDragType() const
{
- return meDragType;
+ return meDragType;
}
// -----------------------------------------------------------------------------
sal_Int64 SAL_CALL SdPageObjsTLB::SdPageObjsTransferable::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException )
{
- sal_Int64 nRet;
+ sal_Int64 nRet;
- if( ( rId.getLength() == 16 ) &&
- ( 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) )
- {
- nRet = (sal_Int64)(sal_IntPtr)this;
- }
- else
- nRet = SdTransferable::getSomething(rId);
+ if( ( rId.getLength() == 16 ) &&
+ ( 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) )
+ {
+ nRet = (sal_Int64)(sal_IntPtr)this;
+ }
+ else
+ nRet = SdTransferable::getSomething(rId);
return nRet;
}
@@ -192,82 +186,76 @@
const ::com::sun::star::uno::Sequence< sal_Int8 >& SdPageObjsTLB::SdPageObjsTransferable::getUnoTunnelId()
{
- static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq;
+ static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq;
if( !aSeq.getLength() )
{
- static osl::Mutex aCreateMutex;
- osl::MutexGuard aGuard( aCreateMutex );
+ static osl::Mutex aCreateMutex;
+ osl::MutexGuard aGuard( aCreateMutex );
aSeq.realloc( 16 );
- rtl_createUuid( reinterpret_cast< sal_uInt8* >( aSeq.getArray() ), 0, sal_True );
+ rtl_createUuid( reinterpret_cast< sal_uInt8* >( aSeq.getArray() ), 0, sal_True );
}
- return aSeq;
+ return aSeq;
}
// -----------------------------------------------------------------------------
SdPageObjsTLB::SdPageObjsTransferable* SdPageObjsTLB::SdPageObjsTransferable::getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData )
- throw()
+ throw()
{
- try
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > xUnoTunnel( rxData, ::com::sun::star::uno::UNO_QUERY_THROW );
+ try
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > xUnoTunnel( rxData, ::com::sun::star::uno::UNO_QUERY_THROW );
return reinterpret_cast<SdPageObjsTLB::SdPageObjsTransferable*>(
sal::static_int_cast<sal_uIntPtr>(
xUnoTunnel->getSomething( SdPageObjsTLB::SdPageObjsTransferable::getUnoTunnelId()) ) );
- }
- catch( const ::com::sun::star::uno::Exception& )
+ }
+ catch( const ::com::sun::star::uno::Exception& )
{
}
return 0;
}
-
sal_uInt32 SdPageObjsTLB::SdPageObjsTransferable::GetListBoxDropFormatId (void)
{
- if (mnListBoxDropFormatId == SAL_MAX_UINT32)
- mnListBoxDropFormatId = SotExchange::RegisterFormatMimeType(
- ::rtl::OUString::createFromAscii(
- "application/x-openoffice-treelistbox-moveonly;"
- "windows_formatname=\"SV_LBOX_DD_FORMAT_MOVE\""));
- return mnListBoxDropFormatId;
+ if (mnListBoxDropFormatId == SAL_MAX_UINT32)
+ mnListBoxDropFormatId = SotExchange::RegisterFormatMimeType(
+ ::rtl::OUString::createFromAscii(
+ "application/x-openoffice-treelistbox-moveonly;"
+ "windows_formatname=\"SV_LBOX_DD_FORMAT_MOVE\""));
+ return mnListBoxDropFormatId;
}
-
-
-
/*************************************************************************
-|*
|* Ctor1 SdPageObjsTLB
-|*
\************************************************************************/
SdPageObjsTLB::SdPageObjsTLB( Window* pParentWin, const SdResId& rSdResId )
-: SvTreeListBox ( pParentWin, rSdResId )
-, bisInSdNavigatorWin ( sal_False )
-, mpParent ( pParentWin )
-, mpDoc ( NULL )
-, mpBookmarkDoc ( NULL )
-, mpMedium ( NULL )
-, mpOwnMedium ( NULL )
-, maImgOle ( BitmapEx( SdResId( BMP_OLE ) ) )
-, maImgGraphic ( BitmapEx( SdResId( BMP_GRAPHIC ) ) )
-, maImgOleH ( BitmapEx( SdResId( BMP_OLE_H ) ) )
-, maImgGraphicH ( BitmapEx( SdResId( BMP_GRAPHIC_H ) ) )
-, mbLinkableSelected ( sal_False )
+: SvTreeListBox ( pParentWin, rSdResId )
+, bisInSdNavigatorWin ( sal_False )
+, mpParent ( pParentWin )
+, mpDoc ( NULL )
+, mpBookmarkDoc ( NULL )
+, mpMedium ( NULL )
+, mpOwnMedium ( NULL )
+, maImgOle ( BitmapEx( SdResId( BMP_OLE ) ) )
+, maImgGraphic ( BitmapEx( SdResId( BMP_GRAPHIC ) ) )
+, maImgOleH ( BitmapEx( SdResId( BMP_OLE_H ) ) )
+, maImgGraphicH ( BitmapEx( SdResId( BMP_GRAPHIC_H ) ) )
+, mbLinkableSelected ( sal_False )
, mpDropNavWin ( NULL )
-, mbShowAllShapes ( false )
-, mbShowAllPages ( false )
+, mbShowAllShapes ( false )
+, mbShowAllPages ( false )
{
// Tree-ListBox mit Linien versehen
SetStyle( GetStyle() | WB_TABSTOP | WB_BORDER | WB_HASLINES |
WB_HASBUTTONS | // WB_HASLINESATROOT |
WB_HSCROLL | // #31562#
WB_HASBUTTONSATROOT |
- WB_QUICK_SEARCH /* i31275 */ );
+ WB_QUICK_SEARCH /* i31275 */ );
SetNodeBitmaps( Bitmap( SdResId( BMP_EXPAND ) ),
Bitmap( SdResId( BMP_COLLAPSE ) ) );
@@ -275,24 +263,22 @@
Bitmap( SdResId( BMP_COLLAPSE_H ) ),
BMP_COLOR_HIGHCONTRAST );
- SetDragDropMode(
+ SetDragDropMode(
SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY |
- SV_DRAGDROP_APP_MOVE | SV_DRAGDROP_APP_COPY | SV_DRAGDROP_APP_DROP );
+ SV_DRAGDROP_APP_MOVE | SV_DRAGDROP_APP_COPY | SV_DRAGDROP_APP_DROP );
}
/*************************************************************************
-|*
|* Dtor SdPageObjsTLB
-|*
\************************************************************************/
SdPageObjsTLB::~SdPageObjsTLB()
{
- if ( mpBookmarkDoc )
- CloseBookmarkDoc();
- else
- // no document was created from mpMedium, so this object is still the owner of it
- delete mpMedium;
+ if ( mpBookmarkDoc )
+ CloseBookmarkDoc();
+ else
+ // no document was created from mpMedium, so this object is still the owner of it
+ delete mpMedium;
}
// helper function for GetEntryAltText and GetEntryLongDescription
@@ -303,19 +289,18 @@
SdrObject* pObj = NULL;
SdPage* pPage = NULL;
-
String ParentName = GetEntryText( GetRootLevelParent( pEntry ) );
- for( pageNo = 0; pageNo < maxPages; pageNo++ )
+ for( pageNo = 0; pageNo < maxPages; pageNo++ )
{
pPage = (SdPage*) mpDoc->GetPage( pageNo );
if( pPage->GetPageKind() != PK_STANDARD ) continue;
- if( pPage->GetName() != ParentName ) continue;
+ if( pPage->GetName() != ParentName ) continue;
SdrObjListIter aIter( *pPage, IM_FLAT );
while( aIter.IsMore() )
{
pObj = aIter.Next();
- if( GetEntryText(pEntry) == GetObjectName( pObj ) )
+ if( GetEntryText(pEntry) == GetObjectName( pObj ) )
{
if( isAltText )
return pObj->GetTitle();
@@ -338,7 +323,7 @@
return getAltLongDescText( pEntry, sal_False);
}
-void SdPageObjsTLB::MarkCurEntry( const String& rName )
+void SdPageObjsTLB::MarkCurEntry( const String& rName )
{
if( rName.Len() )
@@ -348,13 +333,13 @@
String aTmp1;
String aTmp2;
- if( GetParent(pCurEntry)==NULL )
- {
- aTmp1 = GetEntryText( pCurEntry );
- for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) )
+ if( GetParent(pCurEntry)==NULL )
+ {
+ aTmp1 = GetEntryText( pCurEntry );
+ for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) )
{
- if(GetParent( pEntry )==NULL)
- continue;
+ if(GetParent( pEntry )==NULL)
+ continue;
aTmp2 = GetEntryText( GetParent( pEntry ));
if( aTmp1 != aTmp2)
{
@@ -363,10 +348,10 @@
}
}
- }
- else
- {
- for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) )
+ }
+ else
+ {
+ for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) )
{
aTmp2 = GetEntryText( pEntry );
if( aTmp2 == rName)
@@ -375,20 +360,20 @@
}
else
{
- pEntry->SetMarked(sal_False);
+ pEntry->SetMarked(sal_False);
}
}
- }
+ }
}
Invalidate();
}
-void SdPageObjsTLB:: FreshCurEntry()
+void SdPageObjsTLB:: FreshCurEntry()
{
- SvLBoxEntry* pEntry =NULL;
- for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) )
+ SvLBoxEntry* pEntry =NULL;
+ for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) )
{
- pEntry->SetMarked(sal_False);
+ pEntry->SetMarked(sal_False);
}
Invalidate();
}
@@ -459,7 +444,7 @@
}
void SdPageObjsTLB::Clear()
{
- //Save the expanded tree item
+ // Save the expanded tree item
if (mbSaveTreeItemState)
{
maSelectionEntryText = String();
@@ -472,41 +457,37 @@
return SvTreeListBox::Clear();
}
/*************************************************************************
-|*
|* return name of object
-|*
\************************************************************************/
String SdPageObjsTLB::GetObjectName(
- const SdrObject* pObject,
- const bool bCreate) const
+ const SdrObject* pObject,
+ const bool bCreate) const
{
- String aRet;
+ String aRet;
- if ( pObject )
- {
- aRet = pObject->GetName();
+ if ( pObject )
+ {
+ aRet = pObject->GetName();
- if( !aRet.Len() && pObject->ISA( SdrOle2Obj ) )
- aRet = static_cast< const SdrOle2Obj* >( pObject )->GetPersistName();
- }
+ if( !aRet.Len() && pObject->ISA( SdrOle2Obj ) )
+ aRet = static_cast< const SdrOle2Obj* >( pObject )->GetPersistName();
+ }
- if (bCreate
- && mbShowAllShapes
- && aRet.Len() == 0
- && pObject!=NULL)
- {
- aRet = SdResId(STR_NAVIGATOR_SHAPE_BASE_NAME);
- aRet.SearchAndReplaceAscii("%1", String::CreateFromInt32(pObject->GetOrdNum() + 1));
- }
+ if (bCreate
+ && mbShowAllShapes
+ && aRet.Len() == 0
+ && pObject!=NULL)
+ {
+ aRet = SdResId(STR_NAVIGATOR_SHAPE_BASE_NAME);
+ aRet.SearchAndReplaceAscii("%1", String::CreateFromInt32(pObject->GetOrdNum() + 1));
+ }
- return aRet;
+ return aRet;
}
/*************************************************************************
-|*
|* In TreeLB Eintrag selektieren
-|*
\************************************************************************/
sal_Bool SdPageObjsTLB::SelectEntry( const String& rName )
@@ -532,9 +513,7 @@
}
/*************************************************************************
-|*
-|* Gibt zurueck, ob Childs des uebergebenen Strings selektiert sind
-|*
+|* Gibt zurück, ob Childs des übergebenen Strings selektiert sind
\************************************************************************/
sal_Bool SdPageObjsTLB::HasSelectedChilds( const String& rName )
@@ -563,11 +542,8 @@
return( bChilds );
}
-
/*************************************************************************
-|*
-|* TreeLB mit Seiten und Objekten fuellen
-|*
+|* TreeLB mit Seiten und Objekten füllen
\************************************************************************/
void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, sal_Bool bAllPages,
@@ -582,12 +558,12 @@
mpDoc = pInDoc;
maDocName = rDocName;
- mbShowAllPages = (bAllPages == sal_True);
+ mbShowAllPages = (bAllPages == sal_True);
mpMedium = NULL;
SdPage* pPage = NULL;
- IconProvider aIconProvider;
+ IconProvider aIconProvider;
// first insert all pages including objects
sal_uInt16 nPage = 0;
@@ -596,20 +572,20 @@
while( nPage < nMaxPages )
{
pPage = (SdPage*) mpDoc->GetPage( nPage );
- if( (mbShowAllPages || pPage->GetPageKind() == PK_STANDARD)
- && !(pPage->GetPageKind()==PK_HANDOUT) ) //#94954# never list the normal handout page ( handout-masterpage is used instead )
+ if( (mbShowAllPages || pPage->GetPageKind() == PK_STANDARD)
+ && !(pPage->GetPageKind()==PK_HANDOUT) ) //#94954# never list the normal handout page ( handout-masterpage is used instead )
{
sal_Bool bPageExluded = pPage->IsExcluded();
- bool bPageBelongsToShow = PageBelongsToCurrentShow (pPage);
- bPageExluded |= !bPageBelongsToShow;
+ bool bPageBelongsToShow = PageBelongsToCurrentShow (pPage);
+ bPageExluded |= !bPageBelongsToShow;
- AddShapeList(*pPage, NULL, pPage->GetName(), bPageExluded, NULL, aIconProvider);
+ AddShapeList(*pPage, NULL, pPage->GetName(), bPageExluded, NULL, aIconProvider);
}
nPage++;
}
- // dann alle MasterPages incl. Objekte einfuegen
+ // dann alle MasterPages incl. Objekte einfügen
if( mbShowAllPages )
{
nPage = 0;
@@ -618,7 +594,7 @@
while( nPage < nMaxMasterPages )
{
pPage = (SdPage*) mpDoc->GetMasterPage( nPage );
- AddShapeList(*pPage, NULL, pPage->GetName(), false, NULL, aIconProvider);
+ AddShapeList(*pPage, NULL, pPage->GetName(), false, NULL, aIconProvider);
nPage++;
}
}
@@ -631,9 +607,7 @@
}
/*************************************************************************
-|*
-|* Es wird nur der erste Eintrag eingefuegt. Childs werden OnDemand erzeugt
-|*
+|* Es wird nur der erste Eintrag eingefügt. Childs werden OnDemand erzeugt
\************************************************************************/
void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, SfxMedium* pInMedium,
@@ -641,7 +615,7 @@
{
mpDoc = pInDoc;
- // this object now owns the Medium
+ // this object now owns the Medium
mpMedium = pInMedium;
maDocName = rDocName;
@@ -650,12 +624,12 @@
Image aImgDocOpenH=Image( BitmapEx( SdResId( BMP_DOC_OPEN_H ) ) );
Image aImgDocClosedH=Image( BitmapEx( SdResId( BMP_DOC_CLOSED_H ) ) );
- // Dokumentnamen einfuegen
+ // Dokumentnamen einfügen
SvLBoxEntry* pFileEntry = InsertEntry( maDocName,
- aImgDocOpen,
- aImgDocClosed,
- NULL,
- sal_True,
+ aImgDocOpen,
+ aImgDocClosed,
+ NULL,
+ sal_True,
LIST_APPEND,
reinterpret_cast< void* >( 1 ) );
@@ -663,52 +637,49 @@
SetCollapsedEntryBmp( pFileEntry, aImgDocClosedH, BMP_COLOR_HIGHCONTRAST );
}
-
-
-
void SdPageObjsTLB::AddShapeList (
- const SdrObjList& rList,
- SdrObject* pShape,
- const ::rtl::OUString& rsName,
- const bool bIsExcluded,
- SvLBoxEntry* pParentEntry,
- const IconProvider& rIconProvider)
+ const SdrObjList& rList,
+ SdrObject* pShape,
+ const ::rtl::OUString& rsName,
+ const bool bIsExcluded,
+ SvLBoxEntry* pParentEntry,
+ const IconProvider& rIconProvider)
{
- Image aIcon (rIconProvider.maImgPage);
- if (bIsExcluded)
- aIcon = rIconProvider.maImgPageExcl;
- else if (pShape != NULL)
- aIcon = rIconProvider.maImgGroup;
+ Image aIcon (rIconProvider.maImgPage);
+ if (bIsExcluded)
+ aIcon = rIconProvider.maImgPageExcl;
+ else if (pShape != NULL)
+ aIcon = rIconProvider.maImgGroup;
- void* pUserData (reinterpret_cast<void*>(1));
- if (pShape != NULL)
- pUserData = pShape;
+ void* pUserData (reinterpret_cast<void*>(1));
+ if (pShape != NULL)
+ pUserData = pShape;
SvLBoxEntry* pEntry = InsertEntry(
- rsName,
- aIcon,
- aIcon,
- pParentEntry,
- sal_False,
- LIST_APPEND,
- pUserData);
+ rsName,
+ aIcon,
+ aIcon,
+ pParentEntry,
+ sal_False,
+ LIST_APPEND,
+ pUserData);
- SetExpandedEntryBmp(
- pEntry,
- bIsExcluded ? rIconProvider.maImgPageExclH : rIconProvider.maImgPageH,
- BMP_COLOR_HIGHCONTRAST );
- SetCollapsedEntryBmp(
- pEntry,
- bIsExcluded ? rIconProvider.maImgPageExclH : rIconProvider.maImgPageH,
- BMP_COLOR_HIGHCONTRAST );
+ SetExpandedEntryBmp(
+ pEntry,
+ bIsExcluded ? rIconProvider.maImgPageExclH : rIconProvider.maImgPageH,
+ BMP_COLOR_HIGHCONTRAST );
+ SetCollapsedEntryBmp(
+ pEntry,
+ bIsExcluded ? rIconProvider.maImgPageExclH : rIconProvider.maImgPageH,
+ BMP_COLOR_HIGHCONTRAST );
- SdrObjListIter aIter(
- rList,
- !rList.HasObjectNavigationOrder() /* use navigation order, if available */,
- IM_FLAT,
- sal_False /*not reverse*/);
+ SdrObjListIter aIter(
+ rList,
+ !rList.HasObjectNavigationOrder() /* use navigation order, if available */,
+ IM_FLAT,
+ sal_False /*not reverse*/);
- sal_Bool bMarked=sal_False;
+ sal_Bool bMarked=sal_False;
if(bisInSdNavigatorWin)
{
Window* pWindow=NULL;
@@ -730,20 +701,20 @@
pEntry->SetMarked( sal_False );
}
}
- while( aIter.IsMore() )
- {
- SdrObject* pObj = aIter.Next();
- OSL_ASSERT(pObj!=NULL);
+ while( aIter.IsMore() )
+ {
+ SdrObject* pObj = aIter.Next();
+ OSL_ASSERT(pObj!=NULL);
- // Get the shape name.
- String aStr (GetObjectName( pObj ) );
+ // Get the shape name.
+ String aStr (GetObjectName( pObj ) );
- if( aStr.Len() )
- {
- if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_OLE2 )
- {
- SvLBoxEntry* pNewEntry = InsertEntry( aStr, maImgOle, maImgOle, pEntry,
- sal_False, LIST_APPEND, pObj);
+ if( aStr.Len() )
+ {
+ if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_OLE2 )
+ {
+ SvLBoxEntry* pNewEntry = InsertEntry( aStr, maImgOle, maImgOle, pEntry,
+ sal_False, LIST_APPEND, pObj);
if(bisInSdNavigatorWin)
{
Window* pWindow=NULL;
@@ -765,13 +736,13 @@
pNewEntry->SetMarked( sal_False );
}
}
- SetExpandedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST );
- SetCollapsedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST );
- }
- else if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_GRAF )
- {
- SvLBoxEntry* pNewEntry = InsertEntry( aStr, maImgGraphic, maImgGraphic, pEntry,
- sal_False, LIST_APPEND, pObj );
+ SetExpandedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST );
+ SetCollapsedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST );
+ }
+ else if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_GRAF )
+ {
+ SvLBoxEntry* pNewEntry = InsertEntry( aStr, maImgGraphic, maImgGraphic, pEntry,
+ sal_False, LIST_APPEND, pObj );
if(bisInSdNavigatorWin)
{
Window* pWindow=NULL;
@@ -797,23 +768,23 @@
}
}
}
- SetExpandedEntryBmp( pNewEntry, maImgGraphicH, BMP_COLOR_HIGHCONTRAST );
- SetCollapsedEntryBmp( pNewEntry, maImgGraphicH, BMP_COLOR_HIGHCONTRAST );
- }
- else if (pObj->IsGroupObject())
- {
- AddShapeList(
- *pObj->GetSubList(),
- pObj,
- aStr,
- false,
- pEntry,
- rIconProvider);
- }
- else
- {
- SvLBoxEntry* pNewEntry = InsertEntry( aStr, rIconProvider.maImgObjects, rIconProvider.maImgObjects, pEntry,
- sal_False, LIST_APPEND, pObj );
+ SetExpandedEntryBmp( pNewEntry, maImgGraphicH, BMP_COLOR_HIGHCONTRAST );
+ SetCollapsedEntryBmp( pNewEntry, maImgGraphicH, BMP_COLOR_HIGHCONTRAST );
+ }
+ else if (pObj->IsGroupObject())
+ {
+ AddShapeList(
+ *pObj->GetSubList(),
+ pObj,
+ aStr,
+ false,
+ pEntry,
+ rIconProvider);
+ }
+ else
+ {
+ SvLBoxEntry* pNewEntry = InsertEntry( aStr, rIconProvider.maImgObjects, rIconProvider.maImgObjects, pEntry,
+ sal_False, LIST_APPEND, pObj );
if(bisInSdNavigatorWin)
{
Window* pWindow=NULL;
@@ -839,28 +810,28 @@
}
}
}
- SetExpandedEntryBmp( pNewEntry, rIconProvider.maImgObjectsH, BMP_COLOR_HIGHCONTRAST );
- SetCollapsedEntryBmp( pNewEntry, rIconProvider.maImgObjectsH, BMP_COLOR_HIGHCONTRAST );
- }
- }
- }
+ SetExpandedEntryBmp( pNewEntry, rIconProvider.maImgObjectsH, BMP_COLOR_HIGHCONTRAST );
+ SetCollapsedEntryBmp( pNewEntry, rIconProvider.maImgObjectsH, BMP_COLOR_HIGHCONTRAST );
+ }
+ }
+ }
- if( pEntry->HasChilds() )
- {
- SetExpandedEntryBmp(
- pEntry,
- bIsExcluded ? rIconProvider.maImgPageObjsExcl : rIconProvider.maImgPageObjs);
- SetCollapsedEntryBmp(
- pEntry,
- bIsExcluded ? rIconProvider.maImgPageObjsExcl : rIconProvider.maImgPageObjs);
- SetExpandedEntryBmp(
- pEntry,
- bIsExcluded ? rIconProvider.maImgPageObjsExclH : rIconProvider.maImgPageObjsH,
- BMP_COLOR_HIGHCONTRAST);
- SetCollapsedEntryBmp(
- pEntry,
- bIsExcluded ? rIconProvider.maImgPageObjsExclH : rIconProvider.maImgPageObjsH,
- BMP_COLOR_HIGHCONTRAST);
+ if( pEntry->HasChilds() )
+ {
+ SetExpandedEntryBmp(
+ pEntry,
+ bIsExcluded ? rIconProvider.maImgPageObjsExcl : rIconProvider.maImgPageObjs);
+ SetCollapsedEntryBmp(
+ pEntry,
+ bIsExcluded ? rIconProvider.maImgPageObjsExcl : rIconProvider.maImgPageObjs);
+ SetExpandedEntryBmp(
+ pEntry,
+ bIsExcluded ? rIconProvider.maImgPageObjsExclH : rIconProvider.maImgPageObjsH,
+ BMP_COLOR_HIGHCONTRAST);
+ SetCollapsedEntryBmp(
+ pEntry,
+ bIsExcluded ? rIconProvider.maImgPageObjsExclH : rIconProvider.maImgPageObjsH,
+ BMP_COLOR_HIGHCONTRAST);
if (mbSaveTreeItemState)
{
vector<String>:: iterator iteStart = maTreeItem.begin();
@@ -877,44 +848,33 @@
}
else
Expand( pEntry );
- }
+ }
}
-
-
-
void SdPageObjsTLB::SetShowAllShapes (
- const bool bShowAllShapes,
- const bool bFillList)
+ const bool bShowAllShapes,
+ const bool bFillList)
{
- mbShowAllShapes = bShowAllShapes;
- if (bFillList)
- {
- if (mpMedium == NULL)
- Fill(mpDoc, mbShowAllPages, maDocName);
- else
- Fill(mpDoc, mpMedium, maDocName);
- }
+ mbShowAllShapes = bShowAllShapes;
+ if (bFillList)
+ {
+ if (mpMedium == NULL)
+ Fill(mpDoc, mbShowAllPages, maDocName);
+ else
+ Fill(mpDoc, mpMedium, maDocName);
+ }
}
-
-
-
bool SdPageObjsTLB::GetShowAllShapes (void) const
{
- return mbShowAllShapes;
+ return mbShowAllShapes;
}
-
-
-
/*************************************************************************
-|*
-|* Prueft, ob die Seiten (PK_STANDARD) und die darauf befindlichen Objekte
+|* Prüft, ob die Seiten (PK_STANDARD) und die darauf befindlichen Objekte
|* des Docs und der TreeLB identisch sind.
-|* Wird ein Doc uebergeben, wird dieses zum aktuellem Doc (Wichtig bei
-|* mehreren Documenten).
-|*
+|* Wird ein Doc übergeben, wird dieses zum aktuellem Doc (Wichtig bei
+|* mehreren Dokumenten).
\************************************************************************/
sal_Bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc )
@@ -949,22 +909,22 @@
pEntry = Next( pEntry );
SdrObjListIter aIter(
- *pPage,
- !pPage->HasObjectNavigationOrder() /* use navigation order, if available */,
- IM_DEEPWITHGROUPS );
+ *pPage,
+ !pPage->HasObjectNavigationOrder() /* use navigation order, if available */,
+ IM_DEEPWITHGROUPS );
while( aIter.IsMore() )
{
pObj = aIter.Next();
- const String aObjectName( GetObjectName( pObj ) );
+ const String aObjectName( GetObjectName( pObj ) );
if( aObjectName.Len() )
{
if( !pEntry )
return( sal_False );
- aName = GetEntryText( pEntry );
+ aName = GetEntryText( pEntry );
if( aObjectName != aName )
return( sal_False );
@@ -975,15 +935,13 @@
}
nPage++;
}
- // Wenn noch Eintraege in der Listbox vorhanden sind, wurden
- // Objekte (mit Namen) oder Seiten geloescht
+ // Wenn noch Einträge in der Listbox vorhanden sind, wurden
+ // Objekte (mit Namen) oder Seiten gelöscht
return( !pEntry );
}
/*************************************************************************
-|*
-|* Selectierten String zurueckgeben
-|*
+|* Selectierten String zurückgeben
\************************************************************************/
String SdPageObjsTLB::GetSelectEntry()
@@ -992,11 +950,9 @@
}
/*************************************************************************
-|*
-|* Selektierte Eintrage zurueckgeben
+|* Selektierte Eintrage zurückgeben
|* nDepth == 0 -> Seiten
|* nDepth == 1 -> Objekte
-|*
\************************************************************************/
List* SdPageObjsTLB::GetSelectEntryList( sal_uInt16 nDepth )
@@ -1022,9 +978,7 @@
}
/*************************************************************************
-|*
-|* Eintraege werden erst auf Anforderung (Doppelklick) eingefuegt
-|*
+|* Einträge werden erst auf Anforderung (Doppelklick) eingefügt
\************************************************************************/
void SdPageObjsTLB::RequestingChilds( SvLBoxEntry* pFileEntry )
@@ -1056,12 +1010,12 @@
if( pPage->GetPageKind() == PK_STANDARD )
{
pPageEntry = InsertEntry( pPage->GetName(),
- aImgPage,
- aImgPage,
- pFileEntry,
- sal_False,
- LIST_APPEND,
- reinterpret_cast< void* >( 1 ) );
+ aImgPage,
+ aImgPage,
+ pFileEntry,
+ sal_False,
+ LIST_APPEND,
+ reinterpret_cast< void* >( 1 ) );
SetExpandedEntryBmp( pPageEntry, aImgPageH, BMP_COLOR_HIGHCONTRAST );
SetCollapsedEntryBmp( pPageEntry, aImgPageH, BMP_COLOR_HIGHCONTRAST );
@@ -1078,7 +1032,6 @@
{
SvLBoxEntry* pNewEntry = InsertEntry(aStr, maImgOle, maImgOle, pPageEntry);
-
SetExpandedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST );
SetCollapsedEntryBmp( pNewEntry, maImgOleH, BMP_COLOR_HIGHCONTRAST );
}
@@ -1115,58 +1068,56 @@
}
/*************************************************************************
-|*
-|* Prueft, ob es sich um eine Draw-Datei handelt und oeffnet anhand des
-|* uebergebenen Docs das BookmarkDoc
-|*
+|* Prüft, ob es sich um eine Draw-Datei handelt und öffnet anhand des
+|* übergebenen Docs das BookmarkDoc
\************************************************************************/
SdDrawDocument* SdPageObjsTLB::GetBookmarkDoc(SfxMedium* pMed)
{
if (
- !mpBookmarkDoc ||
+ !mpBookmarkDoc ||
(pMed && (!mpOwnMedium || mpOwnMedium->GetName() != pMed->GetName()))
- )
+ )
{
- // create a new BookmarkDoc if now one exists or if a new Medium is provided
- if (mpOwnMedium != pMed)
+ // create a new BookmarkDoc if now one exists or if a new Medium is provided
+ if (mpOwnMedium != pMed)
{
CloseBookmarkDoc();
}
if (pMed)
{
- // it looks that it is undefined if a Medium was set by Fill() already
- DBG_ASSERT( !mpMedium, "SfxMedium confusion!" );
- delete mpMedium;
- mpMedium = NULL;
+ // it looks like it is undefined if a Medium was set by Fill() already
+ DBG_ASSERT( !mpMedium, "SfxMedium confusion!" );
+ delete mpMedium;
+ mpMedium = NULL;
- // take over this Medium (currently used only be Navigator)
+ // take over this Medium (currently used only be Navigator)
mpOwnMedium = pMed;
- }
+ }
- DBG_ASSERT( mpMedium || pMed, "No SfxMedium provided!" );
+ DBG_ASSERT( mpMedium || pMed, "No SfxMedium provided!" );
- if( pMed )
- {
- // in this mode the document is also owned and controlled by this instance
- mxBookmarkDocShRef = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD, sal_True);
- if (mxBookmarkDocShRef->DoLoad(pMed))
- mpBookmarkDoc = mxBookmarkDocShRef->GetDoc();
- else
- mpBookmarkDoc = NULL;
- }
- else if ( mpMedium )
- // in this mode the document is owned and controlled by the SdDrawDocument
- // it can be released by calling the corresponding CloseBookmarkDoc method
- // successful creation of a document makes this the owner of the medium
- mpBookmarkDoc = ((SdDrawDocument*) mpDoc)->OpenBookmarkDoc(*mpMedium);
+ if( pMed )
+ {
+ // in this mode the document is also owned and controlled by this instance
+ mxBookmarkDocShRef = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD, sal_True);
+ if (mxBookmarkDocShRef->DoLoad(pMed))
+ mpBookmarkDoc = mxBookmarkDocShRef->GetDoc();
+ else
+ mpBookmarkDoc = NULL;
+ }
+ else if ( mpMedium )
+ // in this mode the document is owned and controlled by the SdDrawDocument
+ // it can be released by calling the corresponding CloseBookmarkDoc method
+ // successful creation of a document makes this the owner of the medium
+ mpBookmarkDoc = ((SdDrawDocument*) mpDoc)->OpenBookmarkDoc(*mpMedium);
- if ( !mpBookmarkDoc )
+ if ( !mpBookmarkDoc )
{
ErrorBox aErrorBox( this, WB_OK, String( SdResId( STR_READ_DATA_ERROR ) ) );
aErrorBox.Execute();
- mpMedium = 0; //On failure the SfxMedium is invalid
+ mpMedium = 0; //On failure the SfxMedium is invalid
}
}
@@ -1174,9 +1125,7 @@
}
/*************************************************************************
-|*
-|* Bookmark-Dokument schlieáen und loeschen
-|*
+|* Bookmark-Dokument schließen und löschen
\************************************************************************/
void SdPageObjsTLB::CloseBookmarkDoc()
@@ -1184,35 +1133,33 @@
if (mxBookmarkDocShRef.Is())
{
mxBookmarkDocShRef->DoClose();
- mxBookmarkDocShRef.Clear();
+ mxBookmarkDocShRef.Clear();
- // Medium is owned by document, so it's destroyed already
- mpOwnMedium = 0;
+ // Medium is owned by document, so it's destroyed already
+ mpOwnMedium = 0;
}
- else if ( mpBookmarkDoc )
+ else if ( mpBookmarkDoc )
{
- DBG_ASSERT( !mpOwnMedium, "SfxMedium confusion!" );
- if ( mpDoc )
- {
- // The document owns the Medium, so the Medium will be invalid after closing the document
+ DBG_ASSERT( !mpOwnMedium, "SfxMedium confusion!" );
+ if ( mpDoc )
+ {
+ // The document owns the Medium, so the Medium will be invalid after closing the document
((SdDrawDocument*) mpDoc)->CloseBookmarkDoc();
- mpMedium = 0;
- }
+ mpMedium = 0;
+ }
}
- else
- {
- // perhaps mpOwnMedium provided, but no successful creation of BookmarkDoc
- delete mpOwnMedium;
- mpOwnMedium = NULL;
- }
+ else
+ {
+ // perhaps mpOwnMedium provided, but no successful creation of BookmarkDoc
+ delete mpOwnMedium;
+ mpOwnMedium = NULL;
+ }
mpBookmarkDoc = NULL;
}
/*************************************************************************
|*
-|*
-|*
\************************************************************************/
void SdPageObjsTLB::SelectHdl()
@@ -1223,8 +1170,8 @@
while( pEntry && mbLinkableSelected )
{
- if( NULL == pEntry->GetUserData() )
- mbLinkableSelected = sal_False;
+ if( NULL == pEntry->GetUserData() )
+ mbLinkableSelected = sal_False;
pEntry = NextSelected( pEntry );
}
@@ -1233,9 +1180,7 @@
}
/*************************************************************************
-|*
-|* Ueberlaedt RETURN mit der Funktionsweise von DoubleClick
-|*
+|* Überlädt RETURN mit der Funktionsweise von DoubleClick
\************************************************************************/
void SdPageObjsTLB::KeyInput( const KeyEvent& rKEvt )
@@ -1277,8 +1222,8 @@
pSdDrawDocShell->GotoTreeBookmark(aStr);
bMarked=pSdDrawDocShell->GetObjectIsmarked(aStr);
}
- //Removed by yanjun for sym2_6385
- //The symphony2.0 can support morn than one level tree list, also support to select tow or more items in different level.
+ // Removed by yanjun for sym2_6385
+ // The symphony2.0 can support more than one level tree list, also support to select tow or more items in different level.
/*
SvLBoxEntry* pBeginEntry = First();
if( pBeginEntry )
@@ -1313,65 +1258,61 @@
}
/*************************************************************************
-|*
|* StartDrag-Request
-|*
\************************************************************************/
void SdPageObjsTLB::StartDrag( sal_Int8 nAction, const Point& rPosPixel)
{
- (void)nAction;
- (void)rPosPixel;
+ (void)nAction;
+ (void)rPosPixel;
SdNavigatorWin* pNavWin = NULL;
- SvLBoxEntry* pEntry = GetEntry(rPosPixel);
+ SvLBoxEntry* pEntry = GetEntry(rPosPixel);
if( mpFrame->HasChildWindow( SID_NAVIGATOR ) )
pNavWin = (SdNavigatorWin*) ( mpFrame->GetChildWindow( SID_NAVIGATOR )->GetContextWindow( SD_MOD() ) );
if (pEntry != NULL
- && pNavWin !=NULL
- && pNavWin == mpParent
- && pNavWin->GetNavigatorDragType() != NAVIGATOR_DRAGTYPE_NONE )
+ && pNavWin !=NULL
+ && pNavWin == mpParent
+ && pNavWin->GetNavigatorDragType() != NAVIGATOR_DRAGTYPE_NONE )
{
- // Mark only the children of the page under the mouse as drop
- // targets. This prevents moving shapes from one page to another.
+ // Mark only the children of the page under the mouse as drop
+ // targets. This prevents moving shapes from one page to another.
- // Select all entries and disable them as drop targets.
- SetSelectionMode(MULTIPLE_SELECTION);
- SetCursor(NULL, sal_False);
- SelectAll(sal_True, sal_False);
- EnableSelectionAsDropTarget(sal_False, sal_True);
+ // Select all entries and disable them as drop targets.
+ SetSelectionMode(MULTIPLE_SELECTION);
+ SetCursor(NULL, sal_False);
+ SelectAll(sal_True, sal_False);
+ EnableSelectionAsDropTarget(sal_False, sal_True);
- // Enable only the entries as drop targets that are children of the
- // page under the mouse.
- SvLBoxEntry* pParent = GetRootLevelParent(pEntry);
- if (pParent != NULL)
- {
- SelectAll(sal_False, sal_False);
- Select(pParent, sal_True);
- // for (SvLBoxEntry*pChild=FirstChild(pParent); pChild!=NULL; pChild=NextSibling(pChild))
- // Select(pChild, sal_True);
- EnableSelectionAsDropTarget(sal_True, sal_True);//sal_False);
- }
+ // Enable only the entries as drop targets that are children of the
+ // page under the mouse.
+ SvLBoxEntry* pParent = GetRootLevelParent(pEntry);
+ if (pParent != NULL)
+ {
+ SelectAll(sal_False, sal_False);
+ Select(pParent, sal_True);
+ //for (SvLBoxEntry*pChild=FirstChild(pParent); pChild!=NULL; pChild=NextSibling(pChild))
+ //Select(pChild, sal_True);
+ EnableSelectionAsDropTarget(sal_True, sal_True);//sal_False);
+ }
- // Set selection back to the entry under the mouse.
- SelectAll(sal_False,sal_False);
- SetSelectionMode(SINGLE_SELECTION);
- Select(pEntry, sal_True);
+ // Set selection back to the entry under the mouse.
+ SelectAll(sal_False,sal_False);
+ SetSelectionMode(SINGLE_SELECTION);
+ Select(pEntry, sal_True);
- // Aus dem ExecuteDrag heraus kann der Navigator geloescht werden
- // (beim Umschalten auf einen anderen Dokument-Typ), das wuerde aber
- // den StarView MouseMove-Handler, der Command() aufruft, umbringen.
- // Deshalb Drag&Drop asynchron:
- Application::PostUserEvent( STATIC_LINK( this, SdPageObjsTLB, ExecDragHdl ) );
+ // Aus dem ExecuteDrag heraus kann der Navigator gelöscht werden
+ // (beim Umschalten auf einen anderen Dokument-Typ), das würde aber
+ // den StarView MouseMove-Handler, der Command() aufruft, umbringen.
+ // Deshalb Drag&Drop asynchron:
+ Application::PostUserEvent( STATIC_LINK( this, SdPageObjsTLB, ExecDragHdl ) );
}
}
/*************************************************************************
-|*
|* Begin drag
-|*
\************************************************************************/
void SdPageObjsTLB::DoDrag()
@@ -1383,7 +1324,7 @@
if( mpDropNavWin )
{
::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh();
- String aURL = INetURLObject( pDocShell->GetMedium()->GetPhysicalName(), INET_PROT_FILE ).GetMainURL( INetURLObject::NO_DECODE );
+ String aURL = INetURLObject( pDocShell->GetMedium()->GetPhysicalName(), INET_PROT_FILE ).GetMainURL( INetURLObject::NO_DECODE );
NavigatorDragType eDragType = mpDropNavWin->GetNavigatorDragType();
aURL.Append( '#' );
@@ -1394,81 +1335,79 @@
if( eDragType == NAVIGATOR_DRAGTYPE_LINK )
nDNDActions = DND_ACTION_LINK; // #93240# Either COPY *or* LINK, never both!
- else if (mpDoc->GetSdPageCount(PK_STANDARD) == 1)
- {
- // Can not move away the last slide in a document.
- nDNDActions = DND_ACTION_COPY;
- }
+ else if (mpDoc->GetSdPageCount(PK_STANDARD) == 1)
+ {
+ // Can not move away the last slide in a document.
+ nDNDActions = DND_ACTION_COPY;
+ }
SvTreeListBox::ReleaseMouse();
bIsInDrag = sal_True;
- SvLBoxDDInfo aDDInfo;
- memset(&aDDInfo,0,sizeof(SvLBoxDDInfo));
- aDDInfo.pApp = GetpApp();
- aDDInfo.pSource = this;
- // aDDInfo.pDDStartEntry = pEntry;
+ SvLBoxDDInfo aDDInfo;
+ memset(&aDDInfo,0,sizeof(SvLBoxDDInfo));
+ aDDInfo.pApp = GetpApp();
+ aDDInfo.pSource = this;
+ // aDDInfo.pDDStartEntry = pEntry;
::com::sun::star::uno::Sequence<sal_Int8> aSequence (sizeof(SvLBoxDDInfo));
memcpy(aSequence.getArray(), (sal_Char*)&aDDInfo, sizeof(SvLBoxDDInfo));
::com::sun::star::uno::Any aTreeListBoxData (aSequence);
// object is destroyed by internal reference mechanism
SdTransferable* pTransferable = new SdPageObjsTLB::SdPageObjsTransferable(
- *this, aBookmark, *pDocShell, eDragType, aTreeListBoxData);
+ *this, aBookmark, *pDocShell, eDragType, aTreeListBoxData);
- // Get the view.
- ::sd::ViewShell* pViewShell = GetViewShellForDocShell(*pDocShell);
- if (pViewShell == NULL)
- {
- OSL_ASSERT(pViewShell!=NULL);
- return;
- }
- sd::View* pView = pViewShell->GetView();
- if (pView == NULL)
- {
- OSL_ASSERT(pView!=NULL);
- return;
- }
+ // Get the view.
+ ::sd::ViewShell* pViewShell = GetViewShellForDocShell(*pDocShell);
+ if (pViewShell == NULL)
+ {
+ OSL_ASSERT(pViewShell!=NULL);
+ return;
+ }
+ sd::View* pView = pViewShell->GetView();
+ if (pView == NULL)
+ {
+ OSL_ASSERT(pView!=NULL);
+ return;
+ }
- SdrObject* pObject = NULL;
- void* pUserData = GetCurEntry()->GetUserData();
- if (pUserData != NULL && pUserData != (void*)1)
- pObject = reinterpret_cast<SdrObject*>(pUserData);
- if (pObject != NULL)
- {
- // For shapes without a user supplied name (the automatically
- // created name does not count), a different drag and drop technique
- // is used.
- if (GetObjectName(pObject, false).Len() == 0)
- {
- AddShapeToTransferable(*pTransferable, *pObject);
- pTransferable->SetView(pView);
- SD_MOD()->pTransferDrag = pTransferable;
- }
+ SdrObject* pObject = NULL;
+ void* pUserData = GetCurEntry()->GetUserData();
+ if (pUserData != NULL && pUserData != (void*)1)
+ pObject = reinterpret_cast<SdrObject*>(pUserData);
+ if (pObject != NULL)
+ {
+ // For shapes without a user supplied name (the automatically
+ // created name does not count), a different drag and drop technique
+ // is used.
+ if (GetObjectName(pObject, false).Len() == 0)
+ {
+ AddShapeToTransferable(*pTransferable, *pObject);
+ pTransferable->SetView(pView);
+ SD_MOD()->pTransferDrag = pTransferable;
+ }
- // Unnamed shapes have to be selected to be recognized by the
- // current drop implementation. In order to have a consistent
- // behaviour for all shapes, every shape that is to be dragged is
- // selected first.
- SdrPageView* pPageView = pView->GetSdrPageView();
- pView->UnmarkAllObj(pPageView);
- pView->MarkObj(pObject, pPageView);
- }
- else
- {
- pTransferable->SetView(pView);
- SD_MOD()->pTransferDrag = pTransferable;
- }
+ // Unnamed shapes have to be selected to be recognized by the
+ // current drop implementation. In order to have a consistent
+ // behavior for all shapes, every shape that is to be dragged is
+ // selected first.
+ SdrPageView* pPageView = pView->GetSdrPageView();
+ pView->UnmarkAllObj(pPageView);
+ pView->MarkObj(pObject, pPageView);
+ }
+ else
+ {
+ pTransferable->SetView(pView);
+ SD_MOD()->pTransferDrag = pTransferable;
+ }
- pTransferable->StartDrag( this, nDNDActions );
+ pTransferable->StartDrag( this, nDNDActions );
}
}
/*************************************************************************
-|*
|* Drag finished
-|*
\************************************************************************/
void SdPageObjsTLB::OnDragFinished( sal_uInt8 )
@@ -1489,383 +1428,359 @@
}
/*************************************************************************
-|*
|* AcceptDrop-Event
-|*
\************************************************************************/
sal_Int8 SdPageObjsTLB::AcceptDrop (const AcceptDropEvent& rEvent)
{
- sal_Int8 nResult (DND_ACTION_NONE);
+ sal_Int8 nResult (DND_ACTION_NONE);
if ( !bIsInDrag && IsDropFormatSupported( FORMAT_FILE ) )
- {
- nResult = rEvent.mnAction;
- }
- else
- {
- SvLBoxEntry* pEntry = GetDropTarget(rEvent.maPosPixel);
- if (rEvent.mbLeaving || !CheckDragAndDropMode( this, rEvent.mnAction ))
- {
- ImplShowTargetEmphasis( pTargetEntry, sal_False );
- }
- else if( !nDragDropMode )
- {
- DBG_ERRORFILE( "SdPageObjsTLB::AcceptDrop(): no target" );
- }
- else if (IsDropAllowed(pEntry))
- {
- nResult = DND_ACTION_MOVE;
+ {
+ nResult = rEvent.mnAction;
+ }
+ else
+ {
+ SvLBoxEntry* pEntry = GetDropTarget(rEvent.maPosPixel);
+ if (rEvent.mbLeaving || !CheckDragAndDropMode( this, rEvent.mnAction ))
+ {
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
+ }
+ else if( !nDragDropMode )
+ {
+ DBG_ERRORFILE( "SdPageObjsTLB::AcceptDrop(): no target" );
+ }
+ else if (IsDropAllowed(pEntry))
+ {
+ nResult = DND_ACTION_MOVE;
- // Draw emphasis.
- if (pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS))
- {
- ImplShowTargetEmphasis( pTargetEntry, sal_False );
- pTargetEntry = pEntry;
- ImplShowTargetEmphasis( pTargetEntry, sal_True );
- }
- }
- }
+ // Draw emphasis.
+ if (pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS))
+ {
+ ImplShowTargetEmphasis( pTargetEntry, sal_False );
+ pTargetEntry = pEntry;
+ ImplShowTargetEmphasis( pTargetEntry, sal_True );
+ }
+ }
+ }
- // Hide emphasis when there is no valid drop action.
- if (nResult == DND_ACTION_NONE)
- ImplShowTargetEmphasis(pTargetEntry, sal_False);
+ // Hide emphasis when there is no valid drop action.
+ if (nResult == DND_ACTION_NONE)
+ ImplShowTargetEmphasis(pTargetEntry, sal_False);
- return nResult;
+ return nResult;
}
/*************************************************************************
-|*
|* ExecuteDrop-Event
-|*
\************************************************************************/
sal_Int8 SdPageObjsTLB::ExecuteDrop( const ExecuteDropEvent& rEvt )
{
sal_Int8 nRet = DND_ACTION_NONE;
- try
- {
- if( !bIsInDrag )
- {
- SdNavigatorWin* pNavWin = NULL;
- sal_uInt16 nId = SID_NAVIGATOR;
+ try
+ {
+ if( !bIsInDrag )
+ {
+ SdNavigatorWin* pNavWin = NULL;
+ sal_uInt16 nId = SID_NAVIGATOR;
- if( mpFrame->HasChildWindow( nId ) )
- pNavWin = (SdNavigatorWin*)( mpFrame->GetChildWindow( nId )->GetContextWindow( SD_MOD() ) );
+ if( mpFrame->HasChildWindow( nId ) )
+ pNavWin = (SdNavigatorWin*)( mpFrame->GetChildWindow( nId )->GetContextWindow( SD_MOD() ) );
- if( pNavWin && ( pNavWin == mpParent ) )
- {
- TransferableDataHelper aDataHelper( rEvt.maDropEvent.Transferable );
- String aFile;
+ if( pNavWin && ( pNavWin == mpParent ) )
+ {
+ TransferableDataHelper aDataHelper( rEvt.maDropEvent.Transferable );
+ String aFile;
- if( aDataHelper.GetString( FORMAT_FILE, aFile ) &&
- ( (SdNavigatorWin*) mpParent)->InsertFile( aFile ) )
- {
- nRet = rEvt.mnAction;
- }
- }
- }
- }
- catch (com::sun::star::uno::Exception&)
- {
- DBG_UNHANDLED_EXCEPTION();
- }
+ if( aDataHelper.GetString( FORMAT_FILE, aFile ) &&
+ ( (SdNavigatorWin*) mpParent)->InsertFile( aFile ) )
+ {
+ nRet = rEvt.mnAction;
+ }
+ }
+ }
+ }
+ catch (com::sun::star::uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
- if (nRet == DND_ACTION_NONE)
- SvTreeListBox::ExecuteDrop(rEvt, this);
-
+ if (nRet == DND_ACTION_NONE)
+ SvTreeListBox::ExecuteDrop(rEvt, this);
return nRet;
}
/*************************************************************************
-|*
-|* Handler fuers Dragging
-|*
+|* Handler for dragging
\************************************************************************/
IMPL_STATIC_LINK(SdPageObjsTLB, ExecDragHdl, void*, EMPTYARG)
{
// als Link, damit asynchron ohne ImpMouseMoveMsg auf dem Stack auch der
- // Navigator geloescht werden darf
+ // Navigator gelöscht werden darf
pThis->DoDrag();
return 0;
}
-
bool SdPageObjsTLB::PageBelongsToCurrentShow (const SdPage* pPage) const
{
- // Return <TRUE/> as default when there is no custom show or when none
- // is used. The page does then belong to the standard show.
- bool bBelongsToShow = true;
+ // Return <TRUE/> as default when there is no custom show or when none
+ // is used. The page does then belong to the standard show.
+ bool bBelongsToShow = true;
- if (mpDoc->getPresentationSettings().mbCustomShow)
- {
- // Get the current custom show.
- SdCustomShow* pCustomShow = NULL;
- List* pShowList = const_cast<SdDrawDocument*>(mpDoc)->GetCustomShowList();
- if (pShowList != NULL)
- {
- sal_uLong nCurrentShowIndex = pShowList->GetCurPos();
- void* pObject = pShowList->GetObject(nCurrentShowIndex);
- pCustomShow = static_cast<SdCustomShow*>(pObject);
- }
+ if (mpDoc->getPresentationSettings().mbCustomShow)
+ {
+ // Get the current custom show.
+ SdCustomShow* pCustomShow = NULL;
+ List* pShowList = const_cast<SdDrawDocument*>(mpDoc)->GetCustomShowList();
+ if (pShowList != NULL)
+ {
+ sal_uLong nCurrentShowIndex = pShowList->GetCurPos();
+ void* pObject = pShowList->GetObject(nCurrentShowIndex);
+ pCustomShow = static_cast<SdCustomShow*>(pObject);
+ }
- // Check whether the given page is part of that custom show.
- if (pCustomShow != NULL)
- {
- bBelongsToShow = false;
- sal_uLong nPageCount = pCustomShow->Count();
- for (sal_uInt16 i=0; i<nPageCount && !bBelongsToShow; i++)
- if (pPage == static_cast<SdPage*>(pCustomShow->GetObject (i)))
- bBelongsToShow = true;
- }
- }
+ // Check whether the given page is part of that custom show.
+ if (pCustomShow != NULL)
+ {
+ bBelongsToShow = false;
+ sal_uLong nPageCount = pCustomShow->Count();
+ for (sal_uInt16 i=0; i<nPageCount && !bBelongsToShow; i++)
+ if (pPage == static_cast<SdPage*>(pCustomShow->GetObject (i)))
+ bBelongsToShow = true;
+ }
+ }
- return bBelongsToShow;
+ return bBelongsToShow;
}
-
-
-
sal_Bool SdPageObjsTLB::NotifyMoving(
- SvLBoxEntry* pTarget,
- SvLBoxEntry* pEntry,
- SvLBoxEntry*& rpNewParent,
- sal_uLong& rNewChildPos)
+ SvLBoxEntry* pTarget,
+ SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent,
+ sal_uLong& rNewChildPos)
{
- SvLBoxEntry* pDestination = pTarget;
- while (GetParent(pDestination) != NULL && GetParent(GetParent(pDestination)) != NULL)
- pDestination = GetParent(pDestination);
+ SvLBoxEntry* pDestination = pTarget;
+ while (GetParent(pDestination) != NULL && GetParent(GetParent(pDestination)) != NULL)
+ pDestination = GetParent(pDestination);
- SdrObject* pTargetObject = reinterpret_cast<SdrObject*>(pDestination->GetUserData());
- SdrObject* pSourceObject = reinterpret_cast<SdrObject*>(pEntry->GetUserData());
- if (pSourceObject == reinterpret_cast<SdrObject*>(1))
- pSourceObject = NULL;
+ SdrObject* pTargetObject = reinterpret_cast<SdrObject*>(pDestination->GetUserData());
+ SdrObject* pSourceObject = reinterpret_cast<SdrObject*>(pEntry->GetUserData());
+ if (pSourceObject == reinterpret_cast<SdrObject*>(1))
+ pSourceObject = NULL;
- if (pTargetObject != NULL && pSourceObject != NULL)
- {
- SdrPage* pObjectList = pSourceObject->GetPage();
- if (pObjectList != NULL)
- {
- sal_uInt32 nNewPosition;
- if (pTargetObject == reinterpret_cast<SdrObject*>(1))
- nNewPosition = 0;
- else
- nNewPosition = pTargetObject->GetNavigationPosition() + 1;
- pObjectList->SetObjectNavigationPosition(*pSourceObject, nNewPosition);
- }
+ if (pTargetObject != NULL && pSourceObject != NULL)
+ {
+ SdrPage* pObjectList = pSourceObject->GetPage();
+ if (pObjectList != NULL)
+ {
+ sal_uInt32 nNewPosition;
+ if (pTargetObject == reinterpret_cast<SdrObject*>(1))
+ nNewPosition = 0;
+ else
+ nNewPosition = pTargetObject->GetNavigationPosition() + 1;
+ pObjectList->SetObjectNavigationPosition(*pSourceObject, nNewPosition);
+ }
- // Update the tree list.
- if (pTarget == NULL)
- {
- rpNewParent = 0;
- rNewChildPos = 0;
- return sal_True;
- }
- else if (GetParent(pDestination) == NULL)
- {
- rpNewParent = pDestination;
- rNewChildPos = 0;
- }
- else
- {
- rpNewParent = GetParent(pDestination);
- rNewChildPos = pModel->GetRelPos(pDestination) + 1;
- rNewChildPos += nCurEntrySelPos;
- nCurEntrySelPos++;
- }
- return sal_True;
- }
- else
- return sal_False;
+ // Update the tree list.
+ if (pTarget == NULL)
+ {
+ rpNewParent = 0;
+ rNewChildPos = 0;
+ return sal_True;
+ }
+ else if (GetParent(pDestination) == NULL)
+ {
+ rpNewParent = pDestination;
+ rNewChildPos = 0;
+ }
+ else
+ {
+ rpNewParent = GetParent(pDestination);
+ rNewChildPos = pModel->GetRelPos(pDestination) + 1;
+ rNewChildPos += nCurEntrySelPos;
+ nCurEntrySelPos++;
+ }
+ return sal_True;
+ }
+ else
+ return sal_False;
}
-
-
-
SvLBoxEntry* SdPageObjsTLB::GetDropTarget (const Point& rLocation)
{
- SvLBoxEntry* pEntry = SvTreeListBox::GetDropTarget(rLocation);
- if (pEntry == NULL)
- return NULL;
+ SvLBoxEntry* pEntry = SvTreeListBox::GetDropTarget(rLocation);
+ if (pEntry == NULL)
+ return NULL;
- if (GetParent(pEntry) == NULL)
- {
- // Use page entry as insertion position.
- }
- else
- {
- // Go to second hierarchy level, i.e. top level shapes,
- // i.e. children of pages.
- while (GetParent(pEntry) != NULL && GetParent(GetParent(pEntry)) != NULL)
- pEntry = GetParent(pEntry);
+ if (GetParent(pEntry) == NULL)
+ {
+ // Use page entry as insertion position.
+ }
+ else
+ {
+ // Go to second hierarchy level, i.e. top level shapes,
+ // i.e. children of pages.
+ while (GetParent(pEntry) != NULL && GetParent(GetParent(pEntry)) != NULL)
+ pEntry = GetParent(pEntry);
- // Advance to next sibling.
- SvLBoxEntry* pNext;
- sal_uInt16 nDepth (0);
- while (pEntry != NULL)
- {
- pNext = dynamic_cast<SvLBoxEntry*>(NextVisible(pEntry, &nDepth));
- if (pNext != NULL && nDepth > 0 && nDepth!=0xffff)
- pEntry = pNext;
- else
- break;
- }
- }
+ // Advance to next sibling.
+ SvLBoxEntry* pNext;
+ sal_uInt16 nDepth (0);
+ while (pEntry != NULL)
+ {
+ pNext = dynamic_cast<SvLBoxEntry*>(NextVisible(pEntry, &nDepth));
+ if (pNext != NULL && nDepth > 0 && nDepth!=0xffff)
+ pEntry = pNext;
+ else
+ break;
+ }
+ }
- return pEntry;
+ return pEntry;
}
-
-
-
bool SdPageObjsTLB::IsDropAllowed (SvLBoxEntry* pEntry)
{
- if (pEntry == NULL)
- return false;
+ if (pEntry == NULL)
+ return false;
- if ( ! IsDropFormatSupported(SdPageObjsTransferable::GetListBoxDropFormatId()))
- return false;
+ if ( ! IsDropFormatSupported(SdPageObjsTransferable::GetListBoxDropFormatId()))
+ return false;
- if ((pEntry->GetFlags() & SV_ENTRYFLAG_DISABLE_DROP) != 0)
- return false;
+ if ((pEntry->GetFlags() & SV_ENTRYFLAG_DISABLE_DROP) != 0)
+ return false;
- return true;
+ return true;
}
-
-
-
void SdPageObjsTLB::AddShapeToTransferable (
- SdTransferable& rTransferable,
- SdrObject& rObject) const
+ SdTransferable& rTransferable,
+ SdrObject& rObject) const
{
TransferableObjectDescriptor aObjectDescriptor;
- bool bIsDescriptorFillingPending (true);
+ bool bIsDescriptorFillingPending (true);
- const SdrOle2Obj* pOleObject = dynamic_cast<const SdrOle2Obj*>(&rObject);
- if (pOleObject != NULL && pOleObject->GetObjRef().is())
- {
- // If object has no persistence it must be copied as part of the document
- try
- {
- uno::Reference< embed::XEmbedPersist > xPersObj (pOleObject->GetObjRef(), uno::UNO_QUERY );
- if (xPersObj.is() && xPersObj->hasEntry())
- {
- SvEmbedTransferHelper::FillTransferableObjectDescriptor(
- aObjectDescriptor,
- pOleObject->GetObjRef(),
- pOleObject->GetGraphic(),
- pOleObject->GetAspect());
- bIsDescriptorFillingPending = false;
- }
- }
- catch( uno::Exception& )
- {
- }
+ const SdrOle2Obj* pOleObject = dynamic_cast<const SdrOle2Obj*>(&rObject);
+ if (pOleObject != NULL && pOleObject->GetObjRef().is())
+ {
+ // If object has no persistence it must be copied as part of the document
+ try
+ {
+ uno::Reference< embed::XEmbedPersist > xPersObj (pOleObject->GetObjRef(), uno::UNO_QUERY );
+ if (xPersObj.is() && xPersObj->hasEntry())
+ {
+ SvEmbedTransferHelper::FillTransferableObjectDescriptor(
+ aObjectDescriptor,
+ pOleObject->GetObjRef(),
+ pOleObject->GetGraphic(),
+ pOleObject->GetAspect());
+ bIsDescriptorFillingPending = false;
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
}
- ::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh();
+ ::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh();
if (bIsDescriptorFillingPending && pDocShell!=NULL)
- {
- bIsDescriptorFillingPending = false;
- pDocShell->FillTransferableObjectDescriptor(aObjectDescriptor);
- }
+ {
+ bIsDescriptorFillingPending = false;
+ pDocShell->FillTransferableObjectDescriptor(aObjectDescriptor);
+ }
- Point aDragPos (rObject.GetCurrentBoundRect().Center());
- //Point aDragPos (0,0);
+ Point aDragPos (rObject.GetCurrentBoundRect().Center());
+ //Point aDragPos (0,0);
aObjectDescriptor.maDragStartPos = aDragPos;
- // aObjectDescriptor.maSize = GetAllMarkedRect().GetSize();
- if (pDocShell != NULL)
- aObjectDescriptor.maDisplayName = pDocShell->GetMedium()->GetURLObject().GetURLNoPass();
- else
- aObjectDescriptor.maDisplayName = String();
+ // aObjectDescriptor.maSize = GetAllMarkedRect().GetSize();
+ if (pDocShell != NULL)
+ aObjectDescriptor.maDisplayName = pDocShell->GetMedium()->GetURLObject().GetURLNoPass();
+ else
+ aObjectDescriptor.maDisplayName = String();
aObjectDescriptor.mbCanLink = sal_False;
rTransferable.SetStartPos(aDragPos);
rTransferable.SetObjectDescriptor( aObjectDescriptor );
}
-
-
-
::sd::ViewShell* SdPageObjsTLB::GetViewShellForDocShell (::sd::DrawDocShell& rDocShell)
{
- {
- ::sd::ViewShell* pViewShell = rDocShell.GetViewShell();
- if (pViewShell != NULL)
- return pViewShell;
- }
+ {
+ ::sd::ViewShell* pViewShell = rDocShell.GetViewShell();
+ if (pViewShell != NULL)
+ return pViewShell;
+ }
- try
- {
- // Get a component enumeration from the desktop and search it for documents.
- uno::Reference<lang::XMultiServiceFactory> xFactory (
- ::comphelper::getProcessServiceFactory ());
- if ( ! xFactory.is())
- return NULL;
+ try
+ {
+ // Get a component enumeration from the desktop and search it for documents.
+ uno::Reference<lang::XMultiServiceFactory> xFactory (
+ ::comphelper::getProcessServiceFactory ());
+ if ( ! xFactory.is())
+ return NULL;
- uno::Reference<frame::XDesktop> xDesktop (xFactory->createInstance (
- ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), uno::UNO_QUERY);
- if ( ! xDesktop.is())
- return NULL;
+ uno::Reference<frame::XDesktop> xDesktop (xFactory->createInstance (
+ ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), uno::UNO_QUERY);
+ if ( ! xDesktop.is())
+ return NULL;
- uno::Reference<frame::XFramesSupplier> xFrameSupplier (xDesktop, uno::UNO_QUERY);
- if ( ! xFrameSupplier.is())
- return NULL;
+ uno::Reference<frame::XFramesSupplier> xFrameSupplier (xDesktop, uno::UNO_QUERY);
+ if ( ! xFrameSupplier.is())
+ return NULL;
- uno::Reference<container::XIndexAccess> xFrameAccess (xFrameSupplier->getFrames(), uno::UNO_QUERY);
- if ( ! xFrameAccess.is())
- return NULL;
+ uno::Reference<container::XIndexAccess> xFrameAccess (xFrameSupplier->getFrames(), uno::UNO_QUERY);
+ if ( ! xFrameAccess.is())
+ return NULL;
- for (sal_Int32 nIndex=0,nCount=xFrameAccess->getCount(); nIndex<nCount; ++nIndex)
- {
- uno::Reference<frame::XFrame> xFrame;
- if ( ! (xFrameAccess->getByIndex(nIndex) >>= xFrame))
- continue;
+ for (sal_Int32 nIndex=0,nCount=xFrameAccess->getCount(); nIndex<nCount; ++nIndex)
+ {
+ uno::Reference<frame::XFrame> xFrame;
+ if ( ! (xFrameAccess->getByIndex(nIndex) >>= xFrame))
+ continue;
- ::sd::DrawController* pController = dynamic_cast<sd::DrawController*>(xFrame->getController().get());
- if (pController == NULL)
- continue;
- ::sd::ViewShellBase* pBase = pController->GetViewShellBase();
- if (pBase == NULL)
- continue;
- if (pBase->GetDocShell() != &rDocShell)
- continue;
+ ::sd::DrawController* pController = dynamic_cast<sd::DrawController*>(xFrame->getController().get());
+ if (pController == NULL)
+ continue;
+ ::sd::ViewShellBase* pBase = pController->GetViewShellBase();
+ if (pBase == NULL)
+ continue;
+ if (pBase->GetDocShell() != &rDocShell)
+ continue;
- const ::boost::shared_ptr<sd::ViewShell> pViewShell (pBase->GetMainViewShell());
- if (pViewShell)
- return pViewShell.get();
- }
- }
- catch (uno::Exception e)
- {
- // When there is an exception then simply use the default value of
- // bIsEnabled and disable the controls.
- }
- return NULL;
+ const ::boost::shared_ptr<sd::ViewShell> pViewShell (pBase->GetMainViewShell());
+ if (pViewShell)
+ return pViewShell.get();
+ }
+ }
+ catch (uno::Exception e)
+ {
+ // When there is an exception then simply use the default value of
+ // bIsEnabled and disable the controls.
+ }
+ return NULL;
}
-
-
-
//===== IconProvider ==========================================================
SdPageObjsTLB::IconProvider::IconProvider (void)
- : maImgPage( BitmapEx( SdResId( BMP_PAGE ) ) ),
- maImgPageExcl( BitmapEx( SdResId( BMP_PAGE_EXCLUDED ) ) ),
- maImgPageObjsExcl( BitmapEx( SdResId( BMP_PAGEOBJS_EXCLUDED ) ) ),
- maImgPageObjs( BitmapEx( SdResId( BMP_PAGEOBJS ) ) ),
- maImgObjects( BitmapEx( SdResId( BMP_OBJECTS ) ) ),
- maImgGroup( BitmapEx( SdResId( BMP_GROUP ) ) ),
+ : maImgPage( BitmapEx( SdResId( BMP_PAGE ) ) ),
+ maImgPageExcl( BitmapEx( SdResId( BMP_PAGE_EXCLUDED ) ) ),
+ maImgPageObjsExcl( BitmapEx( SdResId( BMP_PAGEOBJS_EXCLUDED ) ) ),
+ maImgPageObjs( BitmapEx( SdResId( BMP_PAGEOBJS ) ) ),
+ maImgObjects( BitmapEx( SdResId( BMP_OBJECTS ) ) ),
+ maImgGroup( BitmapEx( SdResId( BMP_GROUP ) ) ),
- maImgPageH( BitmapEx( SdResId( BMP_PAGE_H ) ) ),
- maImgPageExclH( BitmapEx( SdResId( BMP_PAGE_EXCLUDED_H ) ) ),
- maImgPageObjsExclH( BitmapEx( SdResId( BMP_PAGEOBJS_EXCLUDED_H ) ) ),
- maImgPageObjsH( BitmapEx( SdResId( BMP_PAGEOBJS_H ) ) ),
- maImgObjectsH( BitmapEx( SdResId( BMP_OBJECTS_H ) ) ),
- maImgGroupH( BitmapEx( SdResId( BMP_GROUP_H ) ) )
+ maImgPageH( BitmapEx( SdResId( BMP_PAGE_H ) ) ),
+ maImgPageExclH( BitmapEx( SdResId( BMP_PAGE_EXCLUDED_H ) ) ),
+ maImgPageObjsExclH( BitmapEx( SdResId( BMP_PAGEOBJS_EXCLUDED_H ) ) ),
+ maImgPageObjsH( BitmapEx( SdResId( BMP_PAGEOBJS_H ) ) ),
+ maImgObjectsH( BitmapEx( SdResId( BMP_OBJECTS_H ) ) ),
+ maImgGroupH( BitmapEx( SdResId( BMP_GROUP_H ) ) )
{
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sd/source/ui/view/sdwindow.cxx b/main/sd/source/ui/view/sdwindow.cxx
index c2ec154..3a90979 100644
--- a/main/sd/source/ui/view/sdwindow.cxx
+++ b/main/sd/source/ui/view/sdwindow.cxx
@@ -47,36 +47,33 @@
namespace sd {
-#define SCROLL_LINE_FACT 0.05 // Faktor fuer Zeilenscrolling
-#define SCROLL_PAGE_FACT 0.5 // Faktor fuer Seitenscrolling
-#define SCROLL_SENSITIVE 20 // Sensitiver Bereich (Pixel)
-#define ZOOM_MULTIPLICATOR 10000 // Multiplikator um Rundungsfehler zu vermeiden
-#define MIN_ZOOM 5 // Minimaler Zoomfaktor
-#define MAX_ZOOM 3000 // Maximaler Zoomfaktor
-
+#define SCROLL_LINE_FACT 0.05 // Faktor für Zeilenscrolling
+#define SCROLL_PAGE_FACT 0.5 // Faktor für Seitenscrolling
+#define SCROLL_SENSITIVE 20 // Sensitiver Bereich (Pixel)
+#define ZOOM_MULTIPLICATOR 10000 // Multiplikator um Rundungsfehler zu vermeiden
+#define MIN_ZOOM 5 // Minimaler Zoomfaktor
+#define MAX_ZOOM 3000 // Maximaler Zoomfaktor
/*************************************************************************
-|*
|* Konstruktor
-|*
\************************************************************************/
Window::Window(::Window* pParent)
- : ::Window(pParent, WinBits(WB_CLIPCHILDREN | WB_DIALOGCONTROL)),
+ : ::Window(pParent, WinBits(WB_CLIPCHILDREN | WB_DIALOGCONTROL)),
DropTargetHelper( this ),
- mpShareWin(NULL),
- maWinPos(0, 0), // vorsichtshalber; die Werte sollten aber
- maViewOrigin(0, 0), // vom Besitzer des Fensters neu gesetzt
- maViewSize(1000, 1000), // werden
- mnMinZoom(MIN_ZOOM),
- mnMaxZoom(MAX_ZOOM),
+ mpShareWin(NULL),
+ maWinPos(0, 0), // vorsichtshalber; die Werte sollten aber
+ maViewOrigin(0, 0), // vom Besitzer des Fensters neu gesetzt
+ maViewSize(1000, 1000), // werden
+ mnMinZoom(MIN_ZOOM),
+ mnMaxZoom(MAX_ZOOM),
mbMinZoomAutoCalc(false),
- mbCalcMinZoomByMinSide(true),
- mbCenterAllowed(true),
- mnTicks (0),
- mbDraggedFrom(false),
- mpViewShell(NULL),
- mbUseDropScroll (true)
+ mbCalcMinZoomByMinSide(true),
+ mbCenterAllowed(true),
+ mnTicks (0),
+ mbDraggedFrom(false),
+ mpViewShell(NULL),
+ mbUseDropScroll (true)
{
SetDialogControlFlags( WINDOW_DLGCTRL_RETURN | WINDOW_DLGCTRL_WANTFOCUS );
@@ -89,9 +86,9 @@
// adjust contrast mode initially
bool bUseContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- SetDrawMode( bUseContrast
- ? ViewShell::OUTPUT_DRAWMODE_CONTRAST
- : ViewShell::OUTPUT_DRAWMODE_COLOR );
+ SetDrawMode( bUseContrast
+ ? ViewShell::OUTPUT_DRAWMODE_CONTRAST
+ : ViewShell::OUTPUT_DRAWMODE_COLOR );
// Hilfe-ID setzen
// SetHelpId(HID_SD_WIN_DOCUMENT);
@@ -102,52 +99,47 @@
}
/*************************************************************************
-|*
|* Destruktor
-|*
\************************************************************************/
Window::~Window (void)
{
- if (mpViewShell != NULL)
- {
- WindowUpdater* pWindowUpdater = mpViewShell->GetWindowUpdater();
- if (pWindowUpdater != NULL)
- pWindowUpdater->UnregisterWindow (this);
- }
+ if (mpViewShell != NULL)
+ {
+ WindowUpdater* pWindowUpdater = mpViewShell->GetWindowUpdater();
+ if (pWindowUpdater != NULL)
+ pWindowUpdater->UnregisterWindow (this);
+ }
}
-
-
-
void Window::SetViewShell (ViewShell* pViewSh)
{
- WindowUpdater* pWindowUpdater = NULL;
- // Unregister at device updater of old view shell.
- if (mpViewShell != NULL)
- {
- pWindowUpdater = mpViewShell->GetWindowUpdater();
- if (pWindowUpdater != NULL)
- pWindowUpdater->UnregisterWindow (this);
- }
+ WindowUpdater* pWindowUpdater = NULL;
+ // Unregister at device updater of old view shell.
+ if (mpViewShell != NULL)
+ {
+ pWindowUpdater = mpViewShell->GetWindowUpdater();
+ if (pWindowUpdater != NULL)
+ pWindowUpdater->UnregisterWindow (this);
+ }
- mpViewShell = pViewSh;
+ mpViewShell = pViewSh;
- // Register at device updater of new view shell
- if (mpViewShell != NULL)
- {
- pWindowUpdater = mpViewShell->GetWindowUpdater();
- if (pWindowUpdater != NULL)
- pWindowUpdater->RegisterWindow (this);
- }
+ // Register at device updater of new view shell
+ if (mpViewShell != NULL)
+ {
+ pWindowUpdater = mpViewShell->GetWindowUpdater();
+ if (pWindowUpdater != NULL)
+ pWindowUpdater->RegisterWindow (this);
+ }
}
void Window::CalcMinZoom()
{
- // Are we entitled to change the minimal zoom factor?
+ // Are we entitled to change the minimal zoom factor?
if ( mbMinZoomAutoCalc )
{
- // Get current zoom factor.
+ // Get current zoom factor.
long nZoom = GetZoom();
if ( mpShareWin )
@@ -157,70 +149,55 @@
}
else
{
- // Get the rectangle of the output area in logical coordinates
- // and calculate the scaling factors that would lead to the view
- // area (also called application area) to completely fill the
- // window.
+ // Get the rectangle of the output area in logical coordinates
+ // and calculate the scaling factors that would lead to the view
+ // area (also called application area) to completely fill the
+ // window.
Size aWinSize = PixelToLogic(GetOutputSizePixel());
sal_uLong nX = (sal_uLong) ((double) aWinSize.Width()
- * (double) ZOOM_MULTIPLICATOR / (double) maViewSize.Width());
+ * (double) ZOOM_MULTIPLICATOR / (double) maViewSize.Width());
sal_uLong nY = (sal_uLong) ((double) aWinSize.Height()
- * (double) ZOOM_MULTIPLICATOR / (double) maViewSize.Height());
+ * (double) ZOOM_MULTIPLICATOR / (double) maViewSize.Height());
- // Decide whether to take the larger or the smaller factor.
+ // Decide whether to take the larger or the smaller factor.
sal_uLong nFact;
if (mbCalcMinZoomByMinSide)
- nFact = Min(nX, nY);
+ nFact = Min(nX, nY);
else
- nFact = Max(nX, nY);
+ nFact = Max(nX, nY);
- // The factor is transformed according to the current zoom factor.
+ // The factor is transformed according to the current zoom factor.
nFact = nFact * nZoom / ZOOM_MULTIPLICATOR;
mnMinZoom = Max((sal_uInt16) MIN_ZOOM, (sal_uInt16) nFact);
}
- // If the current zoom factor is smaller than the calculated minimal
- // zoom factor then set the new minimal factor as the current zoom
- // factor.
+ // If the current zoom factor is smaller than the calculated minimal
+ // zoom factor then set the new minimal factor as the current zoom
+ // factor.
if ( nZoom < (long) mnMinZoom )
SetZoomFactor(mnMinZoom);
}
}
-
-
-
void Window::SetMinZoom (long int nMin)
{
- mnMinZoom = (sal_uInt16) nMin;
+ mnMinZoom = (sal_uInt16) nMin;
}
-
-
-
long Window::GetMinZoom (void) const
{
- return mnMinZoom;
+ return mnMinZoom;
}
-
-
-
void Window::SetMaxZoom (long int nMax)
{
- mnMaxZoom = (sal_uInt16) nMax;
+ mnMaxZoom = (sal_uInt16) nMax;
}
-
-
-
long Window::GetMaxZoom (void) const
{
- return mnMaxZoom;
+ return mnMaxZoom;
}
-
-
-
long Window::GetZoom (void) const
{
if( GetMapMode().GetScaleX().GetDenominator() )
@@ -234,13 +211,8 @@
}
}
-
-
-
/*************************************************************************
-|*
|* Resize event
-|*
\************************************************************************/
void Window::Resize()
@@ -248,14 +220,12 @@
::Window::Resize();
CalcMinZoom();
- if( mpViewShell && mpViewShell->GetViewFrame() )
- mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
+ if( mpViewShell && mpViewShell->GetViewFrame() )
+ mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
}
/*************************************************************************
-|*
|* PrePaint event
-|*
\************************************************************************/
void Window::PrePaint()
@@ -265,9 +235,7 @@
}
/*************************************************************************
-|*
|* Paint event
-|*
\************************************************************************/
void Window::Paint(const Rectangle& rRect)
@@ -277,9 +245,7 @@
}
/*************************************************************************
-|*
|* Keyboard event
-|*
\************************************************************************/
void Window::KeyInput(const KeyEvent& rKEvt)
@@ -288,7 +254,7 @@
{
if (mpViewShell && rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE)
{
- mpViewShell->GetViewShell()->Escape();
+ mpViewShell->GetViewShell()->Escape();
}
else
{
@@ -298,9 +264,7 @@
}
/*************************************************************************
-|*
|* MouseButtonDown event
-|*
\************************************************************************/
void Window::MouseButtonDown(const MouseEvent& rMEvt)
@@ -310,9 +274,7 @@
}
/*************************************************************************
-|*
|* MouseMove event
-|*
\************************************************************************/
void Window::MouseMove(const MouseEvent& rMEvt)
@@ -322,9 +284,7 @@
}
/*************************************************************************
-|*
|* MouseButtonUp event
-|*
\************************************************************************/
void Window::MouseButtonUp(const MouseEvent& rMEvt)
@@ -336,9 +296,7 @@
}
/*************************************************************************
-|*
|* Command event
-|*
\************************************************************************/
void Window::Command(const CommandEvent& rCEvt)
@@ -349,22 +307,19 @@
long Window::Notify( NotifyEvent& rNEvt )
{
- long nResult = sal_False;
- if ( mpViewShell )
- {
- nResult = mpViewShell->Notify(rNEvt, this);
- }
- if( !nResult )
- nResult = ::Window::Notify( rNEvt );
+ long nResult = sal_False;
+ if ( mpViewShell )
+ {
+ nResult = mpViewShell->Notify(rNEvt, this);
+ }
+ if( !nResult )
+ nResult = ::Window::Notify( rNEvt );
- return nResult;
+ return nResult;
}
-
/*************************************************************************
-|*
|* RequestHelp event
-|*
\************************************************************************/
void Window::RequestHelp(const HelpEvent& rEvt)
@@ -378,38 +333,24 @@
::Window::RequestHelp( rEvt );
}
-
-
-
Point Window::GetWinViewPos (void) const
{
- return maWinPos;
+ return maWinPos;
}
-
-
-
Point Window::GetViewOrigin (void) const
{
- return maViewOrigin;
+ return maViewOrigin;
}
-
-
-
Size Window::GetViewSize (void) const
{
- return maViewSize;
+ return maViewSize;
}
-
-
-
/*************************************************************************
-|*
|* Position der linken oberen Ecke des im Fenster sichtbaren Bereichs
|* setzen
-|*
\************************************************************************/
void Window::SetWinViewPos(const Point& rPnt)
@@ -418,9 +359,7 @@
}
/*************************************************************************
-|*
-|* Ursprung der Darstellung in Bezug zur gesamten Arbeitsflaeche setzen
-|*
+|* Ursprung der Darstellung in Bezug zur gesamten Arbeitsfläche setzen
\************************************************************************/
void Window::SetViewOrigin(const Point& rPnt)
@@ -429,10 +368,8 @@
}
/*************************************************************************
-|*
-|* Groesse der gesamten Arbeitsflaeche, die mit dem Fenster betrachtet
+|* Größe der gesamten Arbeitsfläche, die mit dem Fenster betrachtet
|* werden kann, setzen
-|*
\************************************************************************/
void Window::SetViewSize(const Size& rSize)
@@ -441,56 +378,50 @@
CalcMinZoom();
}
-
-
-
void Window::SetCenterAllowed (bool bIsAllowed)
{
- mbCenterAllowed = bIsAllowed;
+ mbCenterAllowed = bIsAllowed;
}
-
-
-
long Window::SetZoomFactor(long nZoom)
{
- // Clip the zoom factor to the valid range marked by nMinZoom as
- // calculated by CalcMinZoom() and the constant MAX_ZOOM.
+ // Clip the zoom factor to the valid range marked by nMinZoom as
+ // calculated by CalcMinZoom() and the constant MAX_ZOOM.
if ( nZoom > MAX_ZOOM )
- nZoom = MAX_ZOOM;
+ nZoom = MAX_ZOOM;
if ( nZoom < (long) mnMinZoom )
- nZoom = mnMinZoom;
+ nZoom = mnMinZoom;
- // Set the zoom factor at the window's map mode.
+ // Set the zoom factor at the window's map mode.
MapMode aMap(GetMapMode());
aMap.SetScaleX(Fraction(nZoom, 100));
aMap.SetScaleY(Fraction(nZoom, 100));
SetMapMode(aMap);
- // Update the map mode's origin (to what effect?).
+ // Update the map mode's origin (to what effect?).
UpdateMapOrigin();
- // Update the view's snapping to the new zoom factor.
+ // Update the view's snapping to the new zoom factor.
if ( mpViewShell && mpViewShell->ISA(DrawViewShell) )
((DrawViewShell*) mpViewShell)->GetView()->
RecalcLogicSnapMagnetic(*this);
- // Return the zoom factor just in case it has been changed above to lie
- // inside the valid range.
+ // Return the zoom factor just in case it has been changed above to lie
+ // inside the valid range.
return nZoom;
}
void Window::SetZoomIntegral(long nZoom)
{
- // Clip the zoom factor to the valid range marked by nMinZoom as
- // previously calculated by <member>CalcMinZoom()</member> and the
- // MAX_ZOOM constant.
+ // Clip the zoom factor to the valid range marked by nMinZoom as
+ // previously calculated by <member>CalcMinZoom()</member> and the
+ // MAX_ZOOM constant.
if ( nZoom > MAX_ZOOM )
- nZoom = MAX_ZOOM;
+ nZoom = MAX_ZOOM;
if ( nZoom < (long) mnMinZoom )
- nZoom = mnMinZoom;
+ nZoom = mnMinZoom;
- // Calculate the window's new origin.
+ // Calculate the window's new origin.
Size aSize = PixelToLogic(GetOutputSizePixel());
long nW = aSize.Width() * GetZoom() / nZoom;
long nH = aSize.Height() * GetZoom() / nZoom;
@@ -499,8 +430,8 @@
if ( maWinPos.X() < 0 ) maWinPos.X() = 0;
if ( maWinPos.Y() < 0 ) maWinPos.Y() = 0;
- // Finally update this window's map mode to the given zoom factor that
- // has been clipped to the valid range.
+ // Finally update this window's map mode to the given zoom factor that
+ // has been clipped to the valid range.
SetZoomFactor(nZoom);
}
@@ -508,16 +439,16 @@
{
long nRetZoom = 100;
- if( (rZoomRect.GetWidth() != 0) && (rZoomRect.GetHeight() != 0))
- {
- // Calculate the scale factors which will lead to the given
- // rectangle being fully visible (when translated accordingly) as
- // large as possible in the output area independently in both
- // coordinate directions .
+ if( (rZoomRect.GetWidth() != 0) && (rZoomRect.GetHeight() != 0))
+ {
+ // Calculate the scale factors which will lead to the given
+ // rectangle being fully visible (when translated accordingly) as
+ // large as possible in the output area independently in both
+ // coordinate directions .
sal_uLong nX(0L);
sal_uLong nY(0L);
- const Size aWinSize( PixelToLogic(GetOutputSizePixel()) );
+ const Size aWinSize( PixelToLogic(GetOutputSizePixel()) );
if(rZoomRect.GetHeight())
{
nX = (sal_uLong) ((double) aWinSize.Height()
@@ -530,38 +461,38 @@
* (double) ZOOM_MULTIPLICATOR / (double) rZoomRect.GetWidth());
}
- // Use the smaller one of both so that the zoom rectangle will be
- // fully visible with respect to both coordinate directions.
+ // Use the smaller one of both so that the zoom rectangle will be
+ // fully visible with respect to both coordinate directions.
sal_uLong nFact = Min(nX, nY);
- // Transform the current zoom factor so that it leads to the desired
- // scaling.
+ // Transform the current zoom factor so that it leads to the desired
+ // scaling.
nRetZoom = nFact * GetZoom() / ZOOM_MULTIPLICATOR;
- // Calculate the new origin.
+ // Calculate the new origin.
if ( nFact == 0 )
{
- // Don't change anything if the scale factor is degenrate.
+ // Don't change anything if the scale factor is degenrate.
nRetZoom = GetZoom();
}
else
{
- // Clip the zoom factor to the valid range marked by nMinZoom as
- // previously calculated by <member>CalcMinZoom()</member> and the
- // MAX_ZOOM constant.
- if ( nRetZoom > MAX_ZOOM )
- nRetZoom = MAX_ZOOM;
- if ( nRetZoom < (long) mnMinZoom )
- nRetZoom = mnMinZoom;
- }
- }
+ // Clip the zoom factor to the valid range marked by nMinZoom as
+ // previously calculated by <member>CalcMinZoom()</member> and the
+ // MAX_ZOOM constant.
+ if ( nRetZoom > MAX_ZOOM )
+ nRetZoom = MAX_ZOOM;
+ if ( nRetZoom < (long) mnMinZoom )
+ nRetZoom = mnMinZoom;
+ }
+ }
- return nRetZoom;
+ return nRetZoom;
}
/** Recalculate the zoom factor and translation so that the given rectangle
- is displayed centered and as large as possible while still being fully
- visible in the window.
+ is displayed centered and as large as possible while still being fully
+ visible in the window.
*/
long Window::SetZoomRect (const Rectangle& rZoomRect)
{
@@ -569,25 +500,25 @@
if (rZoomRect.GetWidth() == 0 || rZoomRect.GetHeight() == 0)
{
- // The given rectangle is degenerate. Use the default zoom factor
- // (above) of 100%.
+ // The given rectangle is degenerate. Use the default zoom factor
+ // (above) of 100%.
SetZoomIntegral(nNewZoom);
}
else
{
Point aPos = rZoomRect.TopLeft();
- // Transform the output area from pixel coordinates into logical
- // coordinates.
+ // Transform the output area from pixel coordinates into logical
+ // coordinates.
Size aWinSize = PixelToLogic(GetOutputSizePixel());
- // Paranoia! The degenerate case of zero width or height has been
- // taken care of above.
+ // Paranoia! The degenerate case of zero width or height has been
+ // taken care of above.
DBG_ASSERT(rZoomRect.GetWidth(), "ZoomRect-Breite = 0!");
DBG_ASSERT(rZoomRect.GetHeight(), "ZoomRect-Hoehe = 0!");
- // Calculate the scale factors which will lead to the given
- // rectangle being fully visible (when translated accordingly) as
- // large as possible in the output area independently in both
- // coordinate directions .
+ // Calculate the scale factors which will lead to the given
+ // rectangle being fully visible (when translated accordingly) as
+ // large as possible in the output area independently in both
+ // coordinate directions .
sal_uLong nX(0L);
sal_uLong nY(0L);
@@ -603,24 +534,24 @@
* (double) ZOOM_MULTIPLICATOR / (double) rZoomRect.GetWidth());
}
- // Use the smaller one of both so that the zoom rectangle will be
- // fully visible with respect to both coordinate directions.
+ // Use the smaller one of both so that the zoom rectangle will be
+ // fully visible with respect to both coordinate directions.
sal_uLong nFact = Min(nX, nY);
- // Transform the current zoom factor so that it leads to the desired
- // scaling.
+ // Transform the current zoom factor so that it leads to the desired
+ // scaling.
long nZoom = nFact * GetZoom() / ZOOM_MULTIPLICATOR;
- // Calculate the new origin.
+ // Calculate the new origin.
if ( nFact == 0 )
{
- // Don't change anything if the scale factor is degenrate.
+ // Don't change anything if the scale factor is degenrate.
nNewZoom = GetZoom();
}
else
{
- // Calculate the new window position that centers the given
- // rectangle on the screen.
+ // Calculate the new window position that centers the given
+ // rectangle on the screen.
if ( nZoom > MAX_ZOOM )
nFact = nFact * MAX_ZOOM / nZoom;
@@ -634,7 +565,7 @@
if ( maWinPos.X() < 0 ) maWinPos.X() = 0;
if ( maWinPos.Y() < 0 ) maWinPos.Y() = 0;
- // Adapt the window's map mode to the new zoom factor.
+ // Adapt the window's map mode to the new zoom factor.
nNewZoom = SetZoomFactor(nZoom);
}
}
@@ -642,23 +573,15 @@
return(nNewZoom);
}
-
-
-
void Window::SetMinZoomAutoCalc (bool bAuto)
{
- mbMinZoomAutoCalc = bAuto;
+ mbMinZoomAutoCalc = bAuto;
}
-
-
-
/*************************************************************************
-|*
|* Neuen MapMode-Origin berechnen und setzen; wenn aWinPos.X()/Y()
|* gleich -1 ist, wird die entsprechende Position zentriert
-|* (z.B. fuer Initialisierung)
-|*
+|* (z.B. für Initialisierung)
\************************************************************************/
void Window::UpdateMapOrigin(sal_Bool bInvalidate)
@@ -680,7 +603,7 @@
}
if ( aWinSize.Width() > maViewSize.Width() || maWinPos.X() < 0 )
{
- maWinPos.X() = maViewSize.Width() / 2 - aWinSize.Width() / 2;
+ maWinPos.X() = maViewSize.Width() / 2 - aWinSize.Width() / 2;
bChanged = sal_True;
}
if ( aWinSize.Height() > maViewSize.Height() || maWinPos.Y() < 0 )
@@ -688,70 +611,62 @@
maWinPos.Y() = maViewSize.Height() / 2 - aWinSize.Height() / 2;
bChanged = sal_True;
}
- }
+ }
- UpdateMapMode ();
+ UpdateMapMode ();
- if (bChanged && bInvalidate)
- Invalidate();
+ if (bChanged && bInvalidate)
+ Invalidate();
}
-
-
-
void Window::UpdateMapMode (void)
{
Size aWinSize = PixelToLogic(GetOutputSizePixel());
- maWinPos -= maViewOrigin;
- Size aPix(maWinPos.X(), maWinPos.Y());
- aPix = LogicToPixel(aPix);
- // Groesse muss vielfaches von BRUSH_SIZE sein, damit Muster
- // richtig dargestellt werden
- // #i2237#
- // removed old stuff here which still forced zoom to be
- // %BRUSH_SIZE which is outdated now
+ maWinPos -= maViewOrigin;
+ Size aPix(maWinPos.X(), maWinPos.Y());
+ aPix = LogicToPixel(aPix);
+ // Größe muss vielfaches von BRUSH_SIZE sein, damit Muster
+ // richtig dargestellt werden
+ // #i2237#
+ // removed old stuff here which still forced zoom to be
+ // %BRUSH_SIZE which is outdated now
- if (mpViewShell && mpViewShell->ISA(DrawViewShell))
- {
- Size aViewSizePixel = LogicToPixel(maViewSize);
- Size aWinSizePixel = LogicToPixel(aWinSize);
+ if (mpViewShell && mpViewShell->ISA(DrawViewShell))
+ {
+ Size aViewSizePixel = LogicToPixel(maViewSize);
+ Size aWinSizePixel = LogicToPixel(aWinSize);
- // Seite soll nicht am Fensterrand "kleben"
- if (aPix.Width() == 0)
- {
- // #i2237#
- // Since BRUSH_SIZE alignment is outdated now, i use the
- // former constant here directly
- aPix.Width() -= 8;
- }
- if (aPix.Height() == 0)
- {
- // #i2237#
- // Since BRUSH_SIZE alignment is outdated now, i use the
- // former constant here directly
- aPix.Height() -= 8;
- }
- }
+ // Seite soll nicht am Fensterrand "kleben"
+ if (aPix.Width() == 0)
+ {
+ // #i2237#
+ // Since BRUSH_SIZE alignment is outdated now, i use the
+ // former constant here directly
+ aPix.Width() -= 8;
+ }
+ if (aPix.Height() == 0)
+ {
+ // #i2237#
+ // Since BRUSH_SIZE alignment is outdated now, i use the
+ // former constant here directly
+ aPix.Height() -= 8;
+ }
+ }
- aPix = PixelToLogic(aPix);
- maWinPos.X() = aPix.Width();
- maWinPos.Y() = aPix.Height();
+ aPix = PixelToLogic(aPix);
+ maWinPos.X() = aPix.Width();
+ maWinPos.Y() = aPix.Height();
Point aNewOrigin (-maWinPos.X(), -maWinPos.Y());
- maWinPos += maViewOrigin;
+ maWinPos += maViewOrigin;
MapMode aMap(GetMapMode());
- aMap.SetOrigin(aNewOrigin);
- SetMapMode(aMap);
+ aMap.SetOrigin(aNewOrigin);
+ SetMapMode(aMap);
}
-
-
-
/*************************************************************************
-|*
|* X-Position des sichtbaren Bereichs als Bruchteil (< 1)
-|* der gesamten Arbeitsbereichbreite zuruegeben
-|*
+|* der gesamten Arbeitsbereichbreite zurückgeben
\************************************************************************/
double Window::GetVisibleX()
@@ -760,10 +675,8 @@
}
/*************************************************************************
-|*
|* Y-Position des sichtbaren Bereichs als Bruchteil (< 1)
-|* der gesamten Arbeitsbereichhoehe zuruegeben
-|*
+|* der gesamten Arbeitsbereichhöhe zurückgeben
\************************************************************************/
double Window::GetVisibleY()
@@ -772,11 +685,9 @@
}
/*************************************************************************
-|*
|* X- und Y-Position des sichtbaren Bereichs als Bruchteile (< 1)
-|* der gesamten Arbeitsbereichgroesse setzen
+|* der gesamten Arbeitsbereichgröße setzen
|* negative Werte werden ignoriert
-|*
\************************************************************************/
void Window::SetVisibleXY(double fX, double fY)
@@ -789,17 +700,15 @@
if ( fY >= 0 )
maWinPos.Y() = (long) (fY * maViewSize.Height());
UpdateMapOrigin(sal_False);
- // Size sz(nOldX - aWinPos.X(), nOldY - aWinPos.Y());
- // sz = LogicToPixel(sz);
+ //Size sz(nOldX - aWinPos.X(), nOldY - aWinPos.Y());
+ //sz = LogicToPixel(sz);
Scroll(nOldX - maWinPos.X(), nOldY - maWinPos.Y(), SCROLL_CHILDREN);
Update();
}
/*************************************************************************
-|*
-|* Breite des sichtbaren Bereichs im Verhaeltnis zur
-|* gesamten Arbeitsbereichbreite zuruegeben
-|*
+|* Breite des sichtbaren Bereichs im Verhältnis zur
+|* gesamten Arbeitsbereichbreite zurückgeben
\************************************************************************/
double Window::GetVisibleWidth()
@@ -811,10 +720,8 @@
}
/*************************************************************************
-|*
-|* Hoehe des sichtbaren Bereichs im Verhaeltnis zur
-|* gesamten Arbeitsbereichhoehe zuruegeben
-|*
+|* Höhe des sichtbaren Bereichs im Verhältnis zur
+|* gesamten Arbeitsbereichhöhe zurückgeben
\************************************************************************/
double Window::GetVisibleHeight()
@@ -826,10 +733,8 @@
}
/*************************************************************************
-|*
-|* Breite einer Scrollspalte im Verhaeltnis zur gesamten
-|* Arbeitsbereichbreite zuruegeben
-|*
+|* Breite einer Scrollspalte im Verhältnis zur gesamten
+|* Arbeitsbereichbreite zurückgeben
\************************************************************************/
double Window::GetScrlLineWidth()
@@ -838,10 +743,8 @@
}
/*************************************************************************
-|*
-|* Breite einer Scrollspalte im Verhaeltnis zur gesamten
-|* Arbeitsbereichhoehe zuruegeben
-|*
+|* Breite einer Scrollspalte im Verhältnis zur gesamten
+|* Arbeitsbereichhöhe zurückgeben
\************************************************************************/
double Window::GetScrlLineHeight()
@@ -850,10 +753,8 @@
}
/*************************************************************************
-|*
-|* Breite einer Scrollpage im Verhaeltnis zur gesamten
-|* Arbeitsbereichbreite zuruegeben
-|*
+|* Breite einer Scrollpage im Verhältnis zur gesamten
+|* Arbeitsbereichbreite zurückgeben
\************************************************************************/
double Window::GetScrlPageWidth()
@@ -862,10 +763,8 @@
}
/*************************************************************************
-|*
-|* Breite einer Scrollpage im Verhaeltnis zur gesamten
-|* Arbeitsbereichhoehe zuruegeben
-|*
+|* Breite einer Scrollpage im Verhältnis zur gesamten
+|* Arbeitsbereichhöhe zurückgeben
\************************************************************************/
double Window::GetScrlPageHeight()
@@ -874,34 +773,27 @@
}
/*************************************************************************
-|*
|* Fenster deaktivieren
-|*
\************************************************************************/
void Window::LoseFocus()
{
mnTicks = 0;
- ::Window::LoseFocus ();
+ ::Window::LoseFocus ();
}
/*************************************************************************
-|*
|* Fenster aktivieren
-|*
\************************************************************************/
void Window::GrabFocus()
{
mnTicks = 0;
- ::Window::GrabFocus ();
+ ::Window::GrabFocus ();
}
-
/*************************************************************************
-|*
|* DataChanged
-|*
\************************************************************************/
void Window::DataChanged( const DataChangedEvent& rDCEvt )
@@ -910,7 +802,7 @@
// PRINTER bei allen Dokumenten weglassen, die keinen Printer benutzen.
// FONTS und FONTSUBSTITUTION weglassen, wenn keine Textausgaben
- // vorhanden sind, bzw. wenn das Dokument keinen Text zulaesst.
+ // vorhanden sind, bzw. wenn das Dokument keinen Text zulässt.
if ( (rDCEvt.GetType() == DATACHANGED_PRINTER) ||
(rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
@@ -922,15 +814,15 @@
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- // When the screen zoom factor has changed then reset the zoom
- // factor of the frame to always display the whole page.
- const AllSettings* pOldSettings = rDCEvt.GetOldSettings ();
- const AllSettings& rNewSettings = GetSettings ();
- if (pOldSettings)
- if (pOldSettings->GetStyleSettings().GetScreenZoom()
- != rNewSettings.GetStyleSettings().GetScreenZoom())
- mpViewShell->GetViewFrame()->GetDispatcher()->
- Execute(SID_SIZE_PAGE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
+ // When the screen zoom factor has changed then reset the zoom
+ // factor of the frame to always display the whole page.
+ const AllSettings* pOldSettings = rDCEvt.GetOldSettings ();
+ const AllSettings& rNewSettings = GetSettings ();
+ if (pOldSettings)
+ if (pOldSettings->GetStyleSettings().GetScreenZoom()
+ != rNewSettings.GetStyleSettings().GetScreenZoom())
+ mpViewShell->GetViewFrame()->GetDispatcher()->
+ Execute(SID_SIZE_PAGE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
// ScrollBars neu anordnen bzw. Resize ausloesen, da sich
// ScrollBar-Groesse geaendert haben kann. Dazu muss dann im
@@ -942,12 +834,12 @@
// den Settings uebernommen werden. Evtl. weitere Daten neu
// berechnen, da sich auch die Aufloesung hierdurch geaendert
// haben kann.
- if( mpViewShell )
- {
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- SvtAccessibilityOptions aAccOptions;
- sal_uLong nOutputMode;
- sal_uInt16 nPreviewSlot;
+ if( mpViewShell )
+ {
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ SvtAccessibilityOptions aAccOptions;
+ sal_uLong nOutputMode;
+ sal_uInt16 nPreviewSlot;
if( rStyleSettings.GetHighContrastMode() )
nOutputMode = ViewShell::OUTPUT_DRAWMODE_CONTRAST;
@@ -959,56 +851,56 @@
else
nPreviewSlot = SID_PREVIEW_QUALITY_COLOR;
- if( mpViewShell->ISA( DrawViewShell ) )
- {
- SetDrawMode( nOutputMode );
- mpViewShell->GetFrameView()->SetDrawMode( nOutputMode );
+ if( mpViewShell->ISA( DrawViewShell ) )
+ {
+ SetDrawMode( nOutputMode );
+ mpViewShell->GetFrameView()->SetDrawMode( nOutputMode );
// #110094#-7
-// mpViewShell->GetView()->ReleaseMasterPagePaintCache();
- Invalidate();
- }
+// mpViewShell->GetView()->ReleaseMasterPagePaintCache();
+ Invalidate();
+ }
- // #103100# Overwrite window color for OutlineView
- if( mpViewShell->ISA(OutlineViewShell ) )
- {
- svtools::ColorConfig aColorConfig;
- const Color aDocColor( aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor );
+ // #103100# Overwrite window color for OutlineView
+ if( mpViewShell->ISA(OutlineViewShell ) )
+ {
+ svtools::ColorConfig aColorConfig;
+ const Color aDocColor( aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor );
SetBackground( Wallpaper( aDocColor ) );
- }
+ }
- SfxRequest aReq( nPreviewSlot, 0, mpViewShell->GetDocSh()->GetDoc()->GetItemPool() );
- mpViewShell->ExecReq( aReq );
+ SfxRequest aReq( nPreviewSlot, 0, mpViewShell->GetDocSh()->GetDoc()->GetItemPool() );
+ mpViewShell->ExecReq( aReq );
mpViewShell->Invalidate();
- mpViewShell->ArrangeGUIElements();
+ mpViewShell->ArrangeGUIElements();
// #101928# re-create handles to show new outfit
if(mpViewShell->ISA(DrawViewShell))
{
mpViewShell->GetView()->AdjustMarkHdl();
}
- }
- }
+ }
+ }
if ( (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- // Virtuelle Device die auch von der Aufloesung oder von
- // Systemeinstellungen abhaengen, sollten geupdatet werden.
+ // Virtuelle Device die auch von der Auflösung oder von
+ // Systemeinstellungen abhängen, sollten geupdatet werden.
// Ansonsten sollte zumindest bei DATACHANGED_DISPLAY
// die virtuellen Devices geupdatet werden, da es einige
- // Systeme erlauben die Aufloesung und Farbtiefe waehrend
- // der Laufzeit zu aendern oder eben bei Palettenaenderungen
- // die virtuellen Device geupdatet werden muessen, da bei
+ // Systeme erlauben die Auflösung und Farbtiefe während
+ // der Laufzeit zu ändern oder eben bei Palettenaenderungen
+ // die virtuellen Device geupdatet werden müssen, da bei
// Ausgaben ein anderes Farbmatching stattfinden kann.
}
if ( rDCEvt.GetType() == DATACHANGED_FONTS )
{
- // Wenn das Dokument Font-AuswahlBoxen anbietet, muessen
+ // Wenn das Dokument Font-AuswahlBoxen anbietet, müssen
// diese geupdatet werden. Wie dies genau aussehen muss,
// weiss ich leider auch nicht. Aber evtl. kann man das
- // ja global handeln. Dies muessten wir evtl. mal
+ // ja global handeln. Dies müssten wir evtl. mal
// mit PB absprechen, aber der ist derzeit leider Krank.
// Also bevor dies hier gehandelt wird, vorher mit
// PB und mir absprechen.
@@ -1051,13 +943,8 @@
}
}
-
-
-
/*************************************************************************
-|*
|* DropTargetHelper::AcceptDrop
-|*
\************************************************************************/
sal_Int8 Window::AcceptDrop( const AcceptDropEvent& rEvt )
@@ -1077,9 +964,7 @@
}
/*************************************************************************
-|*
|* DropTargetHelper::ExecuteDrop
-|*
\************************************************************************/
sal_Int8 Window::ExecuteDrop( const ExecuteDropEvent& rEvt )
@@ -1094,21 +979,13 @@
return nRet;
}
-
-
-
void Window::SetUseDropScroll (bool bUseDropScroll)
{
- mbUseDropScroll = bUseDropScroll;
+ mbUseDropScroll = bUseDropScroll;
}
-
-
-
/*************************************************************************
-|*
|* Scrolling bei AcceptDrop-Events
-|*
\************************************************************************/
void Window::DropScroll(const Point& rMousePos)
@@ -1146,19 +1023,16 @@
if ( (nDx || nDy) && (rMousePos.X()!=0 || rMousePos.Y()!=0 ) )
{
- if (mnTicks > 20)
- mpViewShell->ScrollLines(nDx, nDy);
+ if (mnTicks > 20)
+ mpViewShell->ScrollLines(nDx, nDy);
else
- mnTicks ++;
+ mnTicks ++;
}
}
-
-
-
::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible>
- Window::CreateAccessible (void)
+ ::com::sun::star::accessibility::XAccessible>
+ Window::CreateAccessible (void)
{
// If current viewshell is PresentationViewShell, just return empty because the correct ShowWin will be created later.
if (mpViewShell && mpViewShell->ISA(PresentationViewShell))
@@ -1170,17 +1044,17 @@
{
return xAcc;
}
- if (mpViewShell != NULL)
+ if (mpViewShell != NULL)
{
xAcc = mpViewShell->CreateAccessibleDocumentView (this);
SetAccessible(xAcc);
return xAcc;
}
- else
- {
- OSL_TRACE ("::sd::Window::CreateAccessible: no view shell");
- return ::Window::CreateAccessible ();
- }
+ else
+ {
+ OSL_TRACE ("::sd::Window::CreateAccessible: no view shell");
+ return ::Window::CreateAccessible ();
+ }
}
// MT: Removed Windows::SwitchView() introduced with IA2 CWS.
@@ -1199,36 +1073,36 @@
XubString Window::GetSurroundingText() const
{
- if ( mpViewShell->GetShellType() == ViewShell::ST_OUTLINE )
- {
- return XubString();
- }
- else if ( mpViewShell->GetView()->IsTextEdit() )
- {
- OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView();
- return pOLV->GetEditView().GetSurroundingText();
- }
- else
- {
- return XubString();
- }
+ if ( mpViewShell->GetShellType() == ViewShell::ST_OUTLINE )
+ {
+ return XubString();
+ }
+ else if ( mpViewShell->GetView()->IsTextEdit() )
+ {
+ OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView();
+ return pOLV->GetEditView().GetSurroundingText();
+ }
+ else
+ {
+ return XubString();
+ }
}
Selection Window::GetSurroundingTextSelection() const
{
- if ( mpViewShell->GetShellType() == ViewShell::ST_OUTLINE )
- {
- return Selection( 0, 0 );
- }
- else if ( mpViewShell->GetView()->IsTextEdit() )
- {
- OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView();
- return pOLV->GetEditView().GetSurroundingTextSelection();
- }
- else
- {
- return Selection( 0, 0 );
- }
+ if ( mpViewShell->GetShellType() == ViewShell::ST_OUTLINE )
+ {
+ return Selection( 0, 0 );
+ }
+ else if ( mpViewShell->GetView()->IsTextEdit() )
+ {
+ OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView();
+ return pOLV->GetEditView().GetSurroundingTextSelection();
+ }
+ else
+ {
+ return Selection( 0, 0 );
+ }
}
} // end of namespace sd
diff --git a/main/sd/source/ui/view/zoomlist.cxx b/main/sd/source/ui/view/zoomlist.cxx
index c3af4d2..80e8ad3 100644
--- a/main/sd/source/ui/view/zoomlist.cxx
+++ b/main/sd/source/ui/view/zoomlist.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
@@ -35,7 +33,6 @@
#include <sfx2/viewsh.hxx>
#endif
-
#include "ViewShell.hxx"
namespace sd {
@@ -43,9 +40,7 @@
#define MAX_ENTRYS 10
/*************************************************************************
-|*
|* Konstruktor
-|*
\************************************************************************/
ZoomList::ZoomList(ViewShell* pViewShell)
@@ -55,11 +50,8 @@
{
}
-
/*************************************************************************
-|*
|* Destruktor
-|*
\************************************************************************/
ZoomList::~ZoomList()
@@ -70,16 +62,13 @@
for (sal_uLong nObject=0; nObject<Count(); nObject++)
#endif
{
- // Ggf. ZoomRects loeschen
+ // Ggf. ZoomRects löschen
delete ((Rectangle*) GetObject(nObject));
}
}
-
/*************************************************************************
-|*
|* Neues ZoomRect aufnehmen
-|*
\************************************************************************/
void ZoomList::InsertZoomRect(const Rectangle& rRect)
@@ -109,9 +98,7 @@
}
/*************************************************************************
-|*
-|* Naechstes ZoomRect herausgeben
-|*
+|* Nächstes ZoomRect herausgeben
\************************************************************************/
Rectangle ZoomList::GetNextZoomRect()
@@ -133,9 +120,7 @@
}
/*************************************************************************
-|*
|* Letztes ZoomRect herausgeben
-|*
\************************************************************************/
Rectangle ZoomList::GetPreviousZoomRect()
@@ -154,9 +139,7 @@
}
/*************************************************************************
-|*
-|* Gibt es ein naechstes ZoomRect?
-|*
+|* Gibt es ein nächstes ZoomRect?
\************************************************************************/
sal_Bool ZoomList::IsNextPossible() const
@@ -173,9 +156,7 @@
}
/*************************************************************************
-|*
|* Gibt es ein vorheriges ZoomRect?
-|*
\************************************************************************/
sal_Bool ZoomList::IsPreviousPossible() const
@@ -191,3 +172,5 @@
}
} // end of namespace sd
+
+/* vim: set noet sw=4 ts=4: */