From 89ae9990f2c2b520445b2a27b8675c50872394f9 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Thu, 10 Feb 2011 09:09:49 +0100 Subject: impress211: #i115688# Forwarding result of ::Window::Notify(). --- sd/source/ui/view/sdwindow.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index ed5dda39037c..0ddcec80c480 100755 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -359,7 +359,7 @@ long Window::Notify( NotifyEvent& rNEvt ) nResult = mpViewShell->Notify(rNEvt, this); } if( !nResult ) - ::Window::Notify( rNEvt ); + nResult = ::Window::Notify( rNEvt ); return nResult; } -- cgit v1.2.3 From 5b5932190f97f3f2c59578b16f1d643bf269ca35 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Thu, 17 Feb 2011 10:24:49 +0100 Subject: impress211: #i114732# Revoke comphelper notification client only when it was previously registered. --- sd/source/ui/accessibility/AccessibleTreeNode.cxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/sd/source/ui/accessibility/AccessibleTreeNode.cxx b/sd/source/ui/accessibility/AccessibleTreeNode.cxx index ced9852b74c3..137ae572ead8 100755 --- a/sd/source/ui/accessibility/AccessibleTreeNode.cxx +++ b/sd/source/ui/accessibility/AccessibleTreeNode.cxx @@ -134,8 +134,11 @@ void SAL_CALL AccessibleTreeNode::disposing (void) // probably are by now more or less dead and we must not call them to // unregister. - comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( mnClientId, *this ); - mnClientId = 0; + if (mnClientId != 0) + { + comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( mnClientId, *this ); + mnClientId = 0; + } } @@ -361,9 +364,10 @@ void SAL_CALL AccessibleTreeNode::addEventListener( } else { - if ( ! mnClientId) + if (mnClientId == 0) mnClientId = comphelper::AccessibleEventNotifier::registerClient(); - comphelper::AccessibleEventNotifier::addEventListener(mnClientId, rxListener); + if (mnClientId != 0) + comphelper::AccessibleEventNotifier::addEventListener(mnClientId, rxListener); } } } @@ -387,8 +391,11 @@ void SAL_CALL AccessibleTreeNode::removeEventListener( // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client), // and at least to us not firing any events anymore, in case somebody calls // NotifyAccessibleEvent, again - comphelper::AccessibleEventNotifier::revokeClient( mnClientId ); - mnClientId = 0; + if (mnClientId != 0) + { + comphelper::AccessibleEventNotifier::revokeClient( mnClientId ); + mnClientId = 0; + } } } } -- cgit v1.2.3 From 7c580a86a804f5bf61b2d9d888f13d981f221989 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Mon, 7 Mar 2011 10:55:11 +0100 Subject: impress211: #i116339# Added call to Reschedule to compensate for missing yield. --- sd/source/ui/slideshow/slideshowimpl.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 67ac7e94cadb..cbfe02127d05 100755 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -1913,6 +1913,7 @@ IMPL_LINK( SlideshowImpl, PostYieldListener, void*, EMPTYARG ) Application::RemovePostYieldListener(LINK(this, SlideshowImpl, PostYieldListener)); if (mbDisposed) return 0; + Application::Reschedule(true); return updateSlideShow(); } -- cgit v1.2.3 From 971211f8e19173684b99e41f7229f7f33f680307 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Tue, 8 Mar 2011 17:22:13 +0100 Subject: impress211: #i88880# Fixed dragging of slides from navigator to slide sorter. --- sd/source/ui/app/sdxfer.cxx | 47 ++++++ sd/source/ui/dlg/sdtreelb.cxx | 126 ++++++++++++--- sd/source/ui/inc/sdtreelb.hxx | 16 +- sd/source/ui/inc/sdxfer.hxx | 32 +++- .../controller/SlideSorterController.cxx | 5 +- .../ui/slidesorter/controller/SlsClipboard.cxx | 178 ++++++++++++++++++--- .../controller/SlsDragAndDropContext.cxx | 19 ++- .../controller/SlsInsertionIndicatorHandler.cxx | 2 +- .../controller/SlsSelectionFunction.cxx | 2 +- .../ui/slidesorter/controller/SlsTransferable.cxx | 101 ------------ .../slidesorter/controller/SlsTransferableData.cxx | 145 +++++++++++++++++ sd/source/ui/slidesorter/controller/makefile.mk | 2 +- .../ui/slidesorter/inc/controller/SlsClipboard.hxx | 23 ++- .../controller/SlsInsertionIndicatorHandler.hxx | 4 +- .../slidesorter/inc/controller/SlsTransferable.hxx | 87 ---------- .../inc/controller/SlsTransferableData.hxx | 98 ++++++++++++ .../ui/slidesorter/inc/view/SlideSorterView.hxx | 2 + .../inc/view/SlsInsertionIndicatorOverlay.hxx | 9 +- sd/source/ui/slidesorter/view/SlideSorterView.cxx | 12 +- .../view/SlsInsertionIndicatorOverlay.cxx | 12 +- 20 files changed, 659 insertions(+), 263 deletions(-) mode change 100644 => 100755 sd/source/ui/app/sdxfer.cxx mode change 100644 => 100755 sd/source/ui/inc/sdxfer.hxx delete mode 100755 sd/source/ui/slidesorter/controller/SlsTransferable.cxx create mode 100755 sd/source/ui/slidesorter/controller/SlsTransferableData.cxx delete mode 100644 sd/source/ui/slidesorter/inc/controller/SlsTransferable.hxx create mode 100644 sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx old mode 100644 new mode 100755 index ddbc0698a341..1fda5da7da5c --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -123,6 +123,7 @@ SdTransferable::SdTransferable( SdDrawDocument* pSrcDoc, ::sd::View* pWorkView, , mbPageTransferable( FALSE ) , mbPageTransferablePersistent( FALSE ) , mbIsUnoObj( false ) +, maUserData() { if( mpSourceDoc ) StartListening( *mpSourceDoc ); @@ -798,6 +799,52 @@ sal_Int64 SAL_CALL SdTransferable::getSomething( const ::com::sun::star::uno::Se return nRet; } + + + +SdDrawDocument* SdTransferable::GetSourceDoc (void) const +{ + return mpSourceDoc; +} + + + + +void SdTransferable::AddUserData (const ::boost::shared_ptr& rpData) +{ + maUserData.push_back(rpData); +} + + + + +void SdTransferable::RemoveUserData (const ::boost::shared_ptr& rpData) +{ + maUserData.erase(::std::find(maUserData.begin(), maUserData.end(), rpData)); +} + + + + +sal_Int32 SdTransferable::GetUserDataCount (void) const +{ + return maUserData.size(); +} + + + + +::boost::shared_ptr SdTransferable::GetUserData (const sal_Int32 nIndex) const +{ + if (nIndex>=0 && nIndex(); +} + + + + // ----------------------------------------------------------------------------- const ::com::sun::star::uno::Sequence< sal_Int8 >& SdTransferable::getUnoTunnelId() diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index c0a72d539add..d561dbac588c 100755 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -53,11 +53,16 @@ #include "strings.hrc" #endif #include "res_bmp.hrc" +#include "ViewShell.hxx" +#include "DrawController.hxx" +#include "ViewShellBase.hxx" #include +#include +#include #include +#include #include -#include using namespace com::sun::star; @@ -153,6 +158,7 @@ sal_Bool SdPageObjsTLB::SdPageObjsTransferable::GetData( const ::com::sun::star: void SdPageObjsTLB::SdPageObjsTransferable::DragFinished( sal_Int8 nDropAction ) { mrParent.OnDragFinished( nDropAction ); + SdTransferable::DragFinished(nDropAction); } // ----------------------------------------------------------------------------- @@ -234,6 +240,9 @@ sal_uInt32 SdPageObjsTLB::SdPageObjsTransferable::GetListBoxDropFormatId (void) return mnListBoxDropFormatId; } + + + /************************************************************************* |* |* Ctor1 SdPageObjsTLB @@ -1049,6 +1058,11 @@ void SdPageObjsTLB::DoDrag() 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; + } SvTreeListBox::ReleaseMouse(); @@ -1066,16 +1080,15 @@ void SdPageObjsTLB::DoDrag() // object is destroyed by internal reference mechanism SdTransferable* pTransferable = new SdPageObjsTLB::SdPageObjsTransferable( *this, aBookmark, *pDocShell, eDragType, aTreeListBoxData); - OSL_TRACE("created new SdPageObjsTransferable at %x", pTransferable); // Get the view. - sd::View* pView = NULL; - if (pDocShell != NULL) + ::sd::ViewShell* pViewShell = GetViewShellForDocShell(*pDocShell); + if (pViewShell == NULL) { - ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); - if (pViewShell != NULL) - pView = pViewShell->GetView(); + OSL_ASSERT(pViewShell!=NULL); + return; } + sd::View* pView = pViewShell->GetView(); if (pView == NULL) { OSL_ASSERT(pView!=NULL); @@ -1086,27 +1099,32 @@ void SdPageObjsTLB::DoDrag() void* pUserData = GetCurEntry()->GetUserData(); if (pUserData != NULL && pUserData != (void*)1) pObject = reinterpret_cast(pUserData); - if (pObject == NULL) - return; + 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; + } - // 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) + // 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 { - 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); - pTransferable->StartDrag( this, nDNDActions ); } } @@ -1337,8 +1355,6 @@ SvLBoxEntry* SdPageObjsTLB::GetDropTarget (const Point& rLocation) if (pEntry == NULL) return NULL; - OSL_TRACE("entry is %s", - ::rtl::OUStringToOString(GetEntryText(pEntry), RTL_TEXTENCODING_UTF8).getStr()); if (GetParent(pEntry) == NULL) { // Use page entry as insertion position. @@ -1361,8 +1377,6 @@ SvLBoxEntry* SdPageObjsTLB::GetDropTarget (const Point& rLocation) else break; } - OSL_TRACE("returning %s", - ::rtl::OUStringToOString(GetEntryText(pEntry), RTL_TEXTENCODING_UTF8).getStr()); } return pEntry; @@ -1441,6 +1455,66 @@ void SdPageObjsTLB::AddShapeToTransferable ( +::sd::ViewShell* SdPageObjsTLB::GetViewShellForDocShell (::sd::DrawDocShell& rDocShell) +{ + { + ::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 xFactory ( + ::comphelper::getProcessServiceFactory ()); + if ( ! xFactory.is()) + return NULL; + + uno::Reference xDesktop (xFactory->createInstance ( + ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), uno::UNO_QUERY); + if ( ! xDesktop.is()) + return NULL; + + uno::Reference xFrameSupplier (xDesktop, uno::UNO_QUERY); + if ( ! xFrameSupplier.is()) + return NULL; + + uno::Reference xFrameAccess (xFrameSupplier->getFrames(), uno::UNO_QUERY); + if ( ! xFrameAccess.is()) + return NULL; + + for (sal_Int32 nIndex=0,nCount=xFrameAccess->getCount(); nIndex xFrame; + if ( ! (xFrameAccess->getByIndex(nIndex) >>= xFrame)) + continue; + + ::sd::DrawController* pController = dynamic_cast(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 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) diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx index 1aea2d34156e..002e58803ea4 100755 --- a/sd/source/ui/inc/sdtreelb.hxx +++ b/sd/source/ui/inc/sdtreelb.hxx @@ -40,6 +40,8 @@ #include #include #include "sdxfer.hxx" +#include +#include class SdDrawDocument; class SfxMedium; @@ -51,6 +53,8 @@ class SdPage; class SvLBoxEntry; namespace sd { +class ViewShell; + class DrawDocShell; #ifndef SV_DECL_DRAW_DOC_SHELL_DEFINED #define SV_DECL_DRAW_DOC_SHELL_DEFINED @@ -104,7 +108,6 @@ public: ::sd::DrawDocShell& mrDocShell; NavigatorDragType meDragType; const ::com::sun::star::uno::Any maTreeListBoxData; - SD_DLLPRIVATE virtual ~SdPageObjsTransferable(); SD_DLLPRIVATE virtual void AddSupportedFormats(); @@ -219,6 +222,17 @@ public: using SvLBox::ExecuteDrop; using SvTreeListBox::SelectEntry; + + /** Return the view shell that is linked to the given doc shell. + Call this method when the there is a chance that the doc shell + has been disconnected from the view shell (but not the other + way round.) + @return + May return when the link between view shell and + doc shell has been severed. + */ + static ::sd::ViewShell* GetViewShellForDocShell (::sd::DrawDocShell &rDocShell); + private: /** This flag controls whether all shapes are shown as children of pages and group shapes or only the named shapes. diff --git a/sd/source/ui/inc/sdxfer.hxx b/sd/source/ui/inc/sdxfer.hxx old mode 100644 new mode 100755 index d79e5d653ab4..e73e4a3f0ad8 --- a/sd/source/ui/inc/sdxfer.hxx +++ b/sd/source/ui/inc/sdxfer.hxx @@ -89,12 +89,41 @@ public: // SfxListener virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + virtual void DragFinished( sal_Int8 nDropAction ); + SdDrawDocument* GetSourceDoc (void) const; + + /** User data objects can be used to store information temporarily + at the transferable. The slide sorter uses this to store + previews of the slides that are referenced by the + transferable. + */ + class UserData {public:virtual~UserData(){}}; + + /** Add a user data object. When it was added before (and not + removed) then this call is ignored. + */ + void AddUserData (const ::boost::shared_ptr& rpData); + + /** Remove a previously added user data object. When the object + was never added or removed before then this call is ignored. + */ + void RemoveUserData (const ::boost::shared_ptr& rpData); + + /** Return the number of user data objects. + */ + sal_Int32 GetUserDataCount (void) const; + + /** Return the specified user data object. When the index is not + valid, ie not in the range [0,count) then an empty pointer is + returned. + */ + ::boost::shared_ptr GetUserData (const sal_Int32 nIndex) const; + protected: virtual void AddSupportedFormats(); virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - virtual void DragFinished( sal_Int8 nDropAction ); virtual void ObjectReleased(); virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException ); @@ -124,6 +153,7 @@ private: BOOL mbPageTransferable : 1; BOOL mbPageTransferablePersistent : 1; bool mbIsUnoObj : 1; + ::std::vector > maUserData; // not available SdTransferable(); diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index 8018c71e2b88..50e2a7c22ac6 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -43,7 +43,7 @@ #include "controller/SlsScrollBarManager.hxx" #include "controller/SlsSelectionManager.hxx" #include "controller/SlsSlotManager.hxx" -#include "controller/SlsTransferable.hxx" +#include "controller/SlsTransferableData.hxx" #include "controller/SlsVisibleAreaManager.hxx" #include "model/SlideSorterModel.hxx" #include "model/SlsPageEnumerationProvider.hxx" @@ -422,8 +422,7 @@ bool SlideSorterController::Command ( // indicator so that the user knows where a page insertion // would take place. mpInsertionIndicatorHandler->Start(false); - mpInsertionIndicatorHandler->UpdateIndicatorIcon( - dynamic_cast(SD_MOD()->pTransferClip)); + mpInsertionIndicatorHandler->UpdateIndicatorIcon(SD_MOD()->pTransferClip); mpInsertionIndicatorHandler->UpdatePosition( pWindow->PixelToLogic(rEvent.GetMousePosPixel()), InsertionIndicatorHandler::MoveMode); diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index 68ae50e091e7..46382032ef71 100755 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -44,11 +44,12 @@ #include "controller/SlsScrollBarManager.hxx" #include "controller/SlsFocusManager.hxx" #include "controller/SlsSelectionManager.hxx" -#include "controller/SlsTransferable.hxx" +#include "controller/SlsTransferableData.hxx" #include "controller/SlsSelectionObserver.hxx" #include "cache/SlsPageCache.hxx" #include "ViewShellBase.hxx" +#include "View.hxx" #include "DrawViewShell.hxx" #include "Window.hxx" #include "fupoor.hxx" @@ -69,6 +70,7 @@ #include "drawdoc.hxx" #include "DrawDocShell.hxx" #include "sdpage.hxx" +#include "sdtreelb.hxx" #include #include @@ -82,9 +84,12 @@ #include #include #include +#include + namespace sd { namespace slidesorter { namespace controller { + class Clipboard::UndoContext { public: @@ -412,7 +417,7 @@ void Clipboard::CreateSlideTransferable ( // previews are included into the transferable so that an insertion // indicator can be rendered. aSelectedPages.Rewind(); - ::std::vector aRepresentatives; + ::std::vector aRepresentatives; aRepresentatives.reserve(3); ::boost::shared_ptr pPreviewCache ( mrSlideSorter.GetView().GetPreviewCache()); @@ -422,7 +427,7 @@ void Clipboard::CreateSlideTransferable ( if ( ! pDescriptor || pDescriptor->GetPage()==NULL) continue; Bitmap aPreview (pPreviewCache->GetPreviewBitmap(pDescriptor->GetPage(), false)); - aRepresentatives.push_back(Transferable::Representative( + aRepresentatives.push_back(TransferableData::Representative( aPreview, pDescriptor->HasState(model::PageDescriptor::ST_Excluded))); if (aRepresentatives.size() >= 3) @@ -433,7 +438,7 @@ void Clipboard::CreateSlideTransferable ( { mrSlideSorter.GetView().BrkAction(); SdDrawDocument* pDocument = mrSlideSorter.GetModel().GetDocument(); - SdTransferable* pTransferable = new Transferable ( + SdTransferable* pTransferable = TransferableData::CreateTransferable ( pDocument, NULL, FALSE, @@ -491,6 +496,95 @@ void Clipboard::CreateSlideTransferable ( +::boost::shared_ptr Clipboard::CreateTransferableUserData (SdTransferable* pTransferable) +{ + do + { + SdPageObjsTLB::SdPageObjsTransferable* pTreeListBoxTransferable + = dynamic_cast(pTransferable); + if (pTreeListBoxTransferable == NULL) + break; + + // Find view shell for the document of the transferable. + ::sd::ViewShell* pViewShell + = SdPageObjsTLB::GetViewShellForDocShell(pTreeListBoxTransferable->GetDocShell()); + if (pViewShell == NULL) + break; + + // Find slide sorter for the document of the transferable. + SlideSorterViewShell* pSlideSorterViewShell + = SlideSorterViewShell::GetSlideSorter(pViewShell->GetViewShellBase()); + if (pSlideSorterViewShell == NULL) + break; + SlideSorter& rSlideSorter (pSlideSorterViewShell->GetSlideSorter()); + + // Get bookmark from transferable. + TransferableDataHelper aDataHelper (pTransferable); + INetBookmark aINetBookmark; + if ( ! aDataHelper.GetINetBookmark(SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark)) + break; + const rtl::OUString sURL (aINetBookmark.GetURL()); + const sal_Int32 nIndex (sURL.indexOf((sal_Unicode)'#')); + if (nIndex == -1) + break; + String sBookmark (sURL.copy(nIndex+1)); + + // Make sure that the bookmark points to a page. + SdDrawDocument* pTransferableDocument = rSlideSorter.GetModel().GetDocument(); + if (pTransferableDocument == NULL) + break; + BOOL bIsMasterPage; + const USHORT nPageIndex (pTransferableDocument->GetPageByName(sBookmark, bIsMasterPage)); + if (nPageIndex == SDRPAGE_NOTFOUND) + break; + + // Create preview. + ::std::vector aRepresentatives; + aRepresentatives.reserve(1); + ::boost::shared_ptr pPreviewCache ( + rSlideSorter.GetView().GetPreviewCache()); + model::SharedPageDescriptor pDescriptor (rSlideSorter.GetModel().GetPageDescriptor((nPageIndex-1)/2)); + if ( ! pDescriptor || pDescriptor->GetPage()==NULL) + break; + Bitmap aPreview (pPreviewCache->GetPreviewBitmap(pDescriptor->GetPage(), false)); + aRepresentatives.push_back(TransferableData::Representative( + aPreview, + pDescriptor->HasState(model::PageDescriptor::ST_Excluded))); + + // Remember the page in maPagesToRemove so that it can be removed + // when drag and drop action is "move". + Clipboard& rOtherClipboard (pSlideSorterViewShell->GetSlideSorter().GetController().GetClipboard()); + rOtherClipboard.maPagesToRemove.clear(); + rOtherClipboard.maPagesToRemove.push_back(pDescriptor->GetPage()); + + // Create the new transferable. + ::boost::shared_ptr pNewTransferable ( + new TransferableData( + pSlideSorterViewShell, + aRepresentatives)); + pTransferable->SetWorkDocument( dynamic_cast( + pTreeListBoxTransferable->GetSourceDoc()->AllocModel())); + // pTransferable->SetView(&mrSlideSorter.GetView()); + + // Set page bookmark list. + List aPageBookmarks; + aPageBookmarks.Insert(new String(sBookmark)); + pTransferable->SetPageBookmarks(aPageBookmarks, false); + + // Replace the view referenced by the transferable with the + // corresponding slide sorter view. + pTransferable->SetView(&pSlideSorterViewShell->GetSlideSorter().GetView()); + + return pNewTransferable; + } + while (false); + + return ::boost::shared_ptr(); +} + + + + void Clipboard::StartDrag ( const Point& rPosition, ::Window* pWindow) @@ -511,8 +605,6 @@ void Clipboard::StartDrag ( void Clipboard::DragFinished (sal_Int8 nDropAction) { SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; - if (pDragTransferable != NULL) - pDragTransferable->SetView (NULL); if (mnDragFinishedUserEventId == 0) { @@ -590,11 +682,12 @@ sal_Int8 Clipboard::AcceptDrop ( { sal_Int8 nAction (DND_ACTION_NONE); - const Clipboard::DropType eDropType (IsDropAccepted()); + const Clipboard::DropType eDropType (IsDropAccepted(rTargetHelper)); switch (eDropType) { case DT_PAGE: + case DT_PAGE_FROM_NAVIGATOR: { // Accept a drop. nAction = rEvent.mnAction; @@ -602,7 +695,7 @@ sal_Int8 Clipboard::AcceptDrop ( // Use the copy action when the drop action is the default, i.e. not // explicitly set to move or link, and when the source and // target models are not the same. - const SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; + SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; if (pDragTransferable != NULL && pDragTransferable->IsPageTransferable() && ((rEvent.maDragEvent.DropAction @@ -612,13 +705,12 @@ sal_Int8 Clipboard::AcceptDrop ( { nAction = DND_ACTION_COPY; } - else if (mrController.GetInsertionIndicatorHandler()->IsInsertionTrivial(nAction)) + else if (IsInsertionTrivial(pDragTransferable, nAction)) { nAction = DND_ACTION_NONE; } // Show the insertion marker and the substitution for a drop. - Point aPosition = pTargetWindow->PixelToLogic (rEvent.maPosPixel); SelectionFunction* pSelectionFunction = dynamic_cast( mrSlideSorter.GetViewShell()->GetCurrentFunction().get()); if (pSelectionFunction != NULL) @@ -641,6 +733,7 @@ sal_Int8 Clipboard::AcceptDrop ( break; default: + case DT_NONE: nAction = DND_ACTION_NONE; break; } @@ -660,12 +753,14 @@ sal_Int8 Clipboard::ExecuteDrop ( { sal_Int8 nResult = DND_ACTION_NONE; mpUndoContext.reset(); + const Clipboard::DropType eDropType (IsDropAccepted(rTargetHelper)); - switch (IsDropAccepted()) + switch (eDropType) { case DT_PAGE: + case DT_PAGE_FROM_NAVIGATOR: { - const SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; + SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; const Point aEventModelPosition ( pTargetWindow->PixelToLogic (rEvent.maPosPixel)); const sal_Int32 nXOffset (labs (pDragTransferable->GetStartPos().X() @@ -684,7 +779,7 @@ sal_Int8 Clipboard::ExecuteDrop ( // Do not process the insertion when it is trivial, // i.e. would insert pages at their original place. - if (pInsertionIndicatorHandler->IsInsertionTrivial(rEvent.mnAction)) + if (IsInsertionTrivial(pDragTransferable, rEvent.mnAction)) bContinue = false; // Tell the insertion indicator handler to hide before the model @@ -713,6 +808,19 @@ sal_Int8 Clipboard::ExecuteDrop ( // well as the ones above. } + // When the pages originated in another slide sorter then + // only that is notified automatically about the drag + // operation being finished. Because the target slide sorter + // has be notified, too, add a callback for that. + ::boost::shared_ptr pSlideSorterTransferable ( + TransferableData::GetFromTransferable(pDragTransferable)); + BOOST_ASSERT(pSlideSorterTransferable); + if (pSlideSorterTransferable + && pSlideSorterTransferable->GetSourceViewShell() != mrSlideSorter.GetViewShell()) + { + DragFinished(nResult); + } + // Notify the receiving selection function that drag-and-drop is // finished and the substitution handler can be released. ::rtl::Reference pFunction ( @@ -732,7 +840,9 @@ sal_Int8 Clipboard::ExecuteDrop ( nPage, nLayer); break; + default: + case DT_NONE: break; } @@ -742,6 +852,21 @@ sal_Int8 Clipboard::ExecuteDrop ( +bool Clipboard::IsInsertionTrivial ( + SdTransferable* pTransferable, + const sal_Int8 nDndAction) const +{ + ::boost::shared_ptr pSlideSorterTransferable ( + TransferableData::GetFromTransferable(pTransferable)); + if (pSlideSorterTransferable + && pSlideSorterTransferable->GetSourceViewShell() != mrSlideSorter.GetViewShell()) + return false; + return mrController.GetInsertionIndicatorHandler()->IsInsertionTrivial(nDndAction); +} + + + + void Clipboard::Abort (void) { if (mpSelectionObserverContext) @@ -797,25 +922,26 @@ USHORT Clipboard::InsertSlides ( -Clipboard::DropType Clipboard::IsDropAccepted (void) const +Clipboard::DropType Clipboard::IsDropAccepted (DropTargetHelper& rTargetHelper) const { - DropType eResult (DT_NONE); - const SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; - if (pDragTransferable != NULL) + if (pDragTransferable == NULL) + return DT_NONE; + + if (pDragTransferable->IsPageTransferable()) { - if (pDragTransferable->IsPageTransferable()) - { - if (mrSlideSorter.GetModel().GetEditMode() != EM_MASTERPAGE) - eResult = DT_PAGE; - } + if (mrSlideSorter.GetModel().GetEditMode() != EM_MASTERPAGE) + return DT_PAGE; else - { - eResult = DT_SHAPE; - } + return DT_NONE; } - return eResult; + const SdPageObjsTLB::SdPageObjsTransferable* pPageObjsTransferable + = dynamic_cast(pDragTransferable); + if (pPageObjsTransferable != NULL) + return DT_PAGE_FROM_NAVIGATOR; + + return DT_SHAPE; } diff --git a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx index 88b294f3202f..95392b8ccb37 100644 --- a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx +++ b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx @@ -39,10 +39,12 @@ #include "controller/SlsProperties.hxx" #include "controller/SlsSelectionFunction.hxx" #include "controller/SlsSelectionManager.hxx" -#include "controller/SlsTransferable.hxx" +#include "controller/SlsClipboard.hxx" +#include "controller/SlsTransferableData.hxx" #include "DrawDocShell.hxx" #include "drawdoc.hxx" #include "app.hrc" +#include "sdtreelb.hxx" #include #include @@ -58,8 +60,19 @@ DragAndDropContext::DragAndDropContext (SlideSorter& rSlideSorter) if (rSlideSorter.GetModel().GetEditMode() != EM_PAGE) return; - rSlideSorter.GetController().GetInsertionIndicatorHandler()->UpdateIndicatorIcon( - dynamic_cast(SD_MOD()->pTransferDrag)); + // For poperly handling transferables created by the navigator we + // need additional information. For this a user data object is + // created that contains the necessary information. + SdTransferable* pTransferable = SD_MOD()->pTransferDrag; + SdPageObjsTLB::SdPageObjsTransferable* pTreeListBoxTransferable + = dynamic_cast(pTransferable); + if (pTreeListBoxTransferable!=NULL && !TransferableData::GetFromTransferable(pTransferable)) + { + pTransferable->AddUserData( + rSlideSorter.GetController().GetClipboard().CreateTransferableUserData(pTransferable)); + } + + rSlideSorter.GetController().GetInsertionIndicatorHandler()->UpdateIndicatorIcon(pTransferable); } diff --git a/sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx b/sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx index 882adab932a8..d663d106f6bf 100644 --- a/sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx +++ b/sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx @@ -120,7 +120,7 @@ void InsertionIndicatorHandler::ForceEnd (void) -void InsertionIndicatorHandler::UpdateIndicatorIcon (const Transferable* pTransferable) +void InsertionIndicatorHandler::UpdateIndicatorIcon (const SdTransferable* pTransferable) { mpInsertionIndicatorOverlay->Create(pTransferable); maIconSize = mpInsertionIndicatorOverlay->GetSize(); diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index 1d4d075fc3ce..4c92f8965e34 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -32,7 +32,7 @@ #include "SlideSorter.hxx" #include "SlideSorterViewShell.hxx" #include "SlsDragAndDropContext.hxx" -#include "controller/SlsTransferable.hxx" +#include "controller/SlsTransferableData.hxx" #include "controller/SlideSorterController.hxx" #include "controller/SlsPageSelector.hxx" #include "controller/SlsFocusManager.hxx" diff --git a/sd/source/ui/slidesorter/controller/SlsTransferable.cxx b/sd/source/ui/slidesorter/controller/SlsTransferable.cxx deleted file mode 100755 index efda2eb1e4eb..000000000000 --- a/sd/source/ui/slidesorter/controller/SlsTransferable.cxx +++ /dev/null @@ -1,101 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sd.hxx" - -#include "controller/SlsTransferable.hxx" - -#include "SlideSorterViewShell.hxx" -#include "View.hxx" - -namespace sd { namespace slidesorter { namespace controller { - -Transferable::Transferable ( - SdDrawDocument* pSrcDoc, - ::sd::View* pWorkView, - BOOL bInitOnGetData, - SlideSorterViewShell* pViewShell, - const ::std::vector& rRepresentatives) - : SdTransferable (pSrcDoc, pWorkView, bInitOnGetData), - mpViewShell(pViewShell), - maRepresentatives(rRepresentatives) -{ - if (mpViewShell != NULL) - StartListening(*mpViewShell); -} - - - - -Transferable::~Transferable (void) -{ - if (mpViewShell != NULL) - EndListening(*mpViewShell); -} - - - - -void Transferable::DragFinished (sal_Int8 nDropAction) -{ - if (mpViewShell != NULL) - mpViewShell->DragFinished(nDropAction); -} - - - - -void Transferable::Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint) -{ - if (rHint.ISA(SfxSimpleHint) && mpViewShell!=NULL) - { - SfxSimpleHint& rSimpleHint (*PTR_CAST(SfxSimpleHint, &rHint)); - if (rSimpleHint.GetId() == SFX_HINT_DYING) - { - // This hint may come either from the ViewShell or from the - // document (registered by SdTransferable). We do not know - // which but both are sufficient to disconnect from the - // ViewShell. - EndListening(*mpViewShell); - mpViewShell = NULL; - } - } - - SdTransferable::Notify(rBroadcaster, rHint); -} - - - - -const ::std::vector& Transferable::GetRepresentatives (void) const -{ - return maRepresentatives; -} - - -} } } // end of namespace ::sd::slidesorter::controller diff --git a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx new file mode 100755 index 000000000000..1fddcd6e4ba5 --- /dev/null +++ b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sd.hxx" + +#include "controller/SlsTransferableData.hxx" + +#include "SlideSorterViewShell.hxx" +#include "View.hxx" + +namespace sd { namespace slidesorter { namespace controller { + +SdTransferable* TransferableData::CreateTransferable ( + SdDrawDocument* pSrcDoc, + ::sd::View* pWorkView, + BOOL bInitOnGetData, + SlideSorterViewShell* pViewShell, + const ::std::vector& rRepresentatives) +{ + SdTransferable* pTransferable = new SdTransferable (pSrcDoc, pWorkView, bInitOnGetData); + ::boost::shared_ptr pData (new TransferableData(pViewShell, rRepresentatives)); + pTransferable->AddUserData(pData); + return pTransferable; +} + + + + +::boost::shared_ptr TransferableData::GetFromTransferable (const SdTransferable* pTransferable) +{ + ::boost::shared_ptr pData; + for (sal_Int32 nIndex=0,nCount=pTransferable->GetUserDataCount(); nIndex(pTransferable->GetUserData(nIndex)); + if (pData) + return pData; + } + return ::boost::shared_ptr(); +} + + + + +TransferableData::TransferableData ( + SlideSorterViewShell* pViewShell, + const ::std::vector& rRepresentatives) + : mpViewShell(pViewShell), + maRepresentatives(rRepresentatives) +{ + if (mpViewShell != NULL) + StartListening(*mpViewShell); +} + + + + +TransferableData::~TransferableData (void) +{ + if (mpViewShell != NULL) + EndListening(*mpViewShell); +} + + + + +void TransferableData::DragFinished (sal_Int8 nDropAction) +{ + if (mpViewShell != NULL) + mpViewShell->DragFinished(nDropAction); + /* + for (CallbackContainer::const_iterator + iCallback(maDragFinishCallbacks.begin()), + iEnd(maDragFinishCallbacks.end()); + iCallback!=iEnd; + ++iCallback) + { + if (*iCallback) + (*iCallback)(nDropAction); + } + maDragFinishCallbacks.clear(); + */ +} + + + + +void TransferableData::Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint) +{ + if (rHint.ISA(SfxSimpleHint) && mpViewShell!=NULL) + { + SfxSimpleHint& rSimpleHint (*PTR_CAST(SfxSimpleHint, &rHint)); + if (rSimpleHint.GetId() == SFX_HINT_DYING) + { + // This hint may come either from the ViewShell or from the + // document (registered by SdTransferable). We do not know + // which but both are sufficient to disconnect from the + // ViewShell. + EndListening(*mpViewShell); + mpViewShell = NULL; + } + } +} + + + + +const ::std::vector& TransferableData::GetRepresentatives (void) const +{ + return maRepresentatives; +} + + + + +SlideSorterViewShell* TransferableData::GetSourceViewShell (void) const +{ + return mpViewShell; +} + +} } } // end of namespace ::sd::slidesorter::controller diff --git a/sd/source/ui/slidesorter/controller/makefile.mk b/sd/source/ui/slidesorter/controller/makefile.mk index 460ef16ed3f1..18479cc86aa0 100755 --- a/sd/source/ui/slidesorter/controller/makefile.mk +++ b/sd/source/ui/slidesorter/controller/makefile.mk @@ -60,7 +60,7 @@ SLOFILES = \ $(SLO)$/SlsSelectionManager.obj \ $(SLO)$/SlsSelectionObserver.obj \ $(SLO)$/SlsSlotManager.obj \ - $(SLO)$/SlsTransferable.obj \ + $(SLO)$/SlsTransferableData.obj \ $(SLO)$/SlsVisibleAreaManager.obj # --- Tagets ------------------------------------------------------- diff --git a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx index 9b7b1f5ec2d3..d610ecb5602d 100755 --- a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx @@ -30,6 +30,8 @@ #include "ViewClipboard.hxx" #include "controller/SlsSelectionObserver.hxx" +#include "sdxfer.hxx" + #include #include #include @@ -58,6 +60,8 @@ namespace sd { namespace slidesorter { namespace model { class PageDescriptor; } } } +namespace { class NavigatorDropEvent; } + namespace sd { namespace slidesorter { namespace controller { class SlideSorterController; @@ -69,6 +73,12 @@ public: Clipboard (SlideSorter& rSlideSorter); ~Clipboard (void); + /** Create a slide sorter transferable from the given sd + transferable. The returned transferable is set up with all + information necessary so that it can be dropped on a slide sorter. + */ + ::boost::shared_ptr CreateTransferableUserData (SdTransferable* pTransferable); + void HandleSlotCall (SfxRequest& rRequest); void DoCut (::Window* pWindow = 0); @@ -189,8 +199,8 @@ private: transferable is not accepted. The reason is the missing implementation of proper handling master pages copy-and-paste. */ - enum DropType { DT_PAGE, DT_SHAPE, DT_NONE }; - DropType IsDropAccepted (void) const; + enum DropType { DT_PAGE, DT_PAGE_FROM_NAVIGATOR, DT_SHAPE, DT_NONE }; + DropType IsDropAccepted (DropTargetHelper& rTargetHelper) const; /** This method contains the code for AcceptDrop() and ExecuteDrop() shapes. There are only minor differences for the two cases at this level. @@ -221,10 +231,19 @@ private: USHORT nPage, USHORT nLayer); + /** Return whether the insertion defined by the transferable is + trivial, ie would not change either source nor target document. + */ + bool IsInsertionTrivial ( + SdTransferable* pTransferable, + const sal_Int8 nDndAction) const; + /** Asynchronous part of DragFinished. The argument is the sal_Int8 nDropAction, disguised as void*. */ DECL_LINK(ProcessDragFinished, void*); + + DECL_LINK(ExecuteNavigatorDrop, NavigatorDropEvent*); }; } } } // end of namespace ::sd::slidesorter::controller diff --git a/sd/source/ui/slidesorter/inc/controller/SlsInsertionIndicatorHandler.hxx b/sd/source/ui/slidesorter/inc/controller/SlsInsertionIndicatorHandler.hxx index e257c5729b10..1492e707d42d 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsInsertionIndicatorHandler.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsInsertionIndicatorHandler.hxx @@ -31,6 +31,8 @@ #include "view/SlsInsertAnimator.hxx" #include "view/SlsLayouter.hxx" +#include "sdxfer.hxx" + namespace sd { namespace slidesorter { class SlideSorter; } } namespace sd { namespace slidesorter { namespace model { @@ -83,7 +85,7 @@ public: /** Update the indicator icon from the current transferable (from the clipboard or an active drag and drop operation.) */ - void UpdateIndicatorIcon (const Transferable* pTransferable); + void UpdateIndicatorIcon (const SdTransferable* pTransferable); /** Set the position of the insertion marker to the given coordinates. */ diff --git a/sd/source/ui/slidesorter/inc/controller/SlsTransferable.hxx b/sd/source/ui/slidesorter/inc/controller/SlsTransferable.hxx deleted file mode 100644 index 289fb1f5f072..000000000000 --- a/sd/source/ui/slidesorter/inc/controller/SlsTransferable.hxx +++ /dev/null @@ -1,87 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef SD_SLIDESORTER_TRANSFERABLE_HXX -#define SD_SLIDESORTER_TRANSFERABLE_HXX - -#include "sdxfer.hxx" - -class SdDrawDocument; -namespace sd { namespace slidesorter { -class SlideSorterViewShell; -} } - -namespace sd { namespace slidesorter { namespace controller { - - -/** This class exists to have DragFinished call the correct object: the - SlideSorterViewShell instead of the old SlideView. -*/ -class Transferable - : public SdTransferable -{ -public: - class Representative - { - public: - Representative (const Bitmap& rBitmap, const bool bIsExcluded) - : maBitmap(rBitmap), mbIsExcluded(bIsExcluded) {} - Representative (const Representative& rOther) - : maBitmap(rOther.maBitmap), mbIsExcluded(rOther.mbIsExcluded) {} - Representative operator= (Representative& rOther) - { if (&rOther != this) {maBitmap = rOther.maBitmap; mbIsExcluded = rOther.mbIsExcluded; } - return *this; - } - - Bitmap maBitmap; - bool mbIsExcluded; - }; - - - Transferable ( - SdDrawDocument* pSrcDoc, - ::sd::View* pWorkView, - BOOL bInitOnGetData, - SlideSorterViewShell* pViewShell, - const ::std::vector& rRepresentatives); - - virtual ~Transferable (void); - - virtual void DragFinished (sal_Int8 nDropAction); - - const ::std::vector& GetRepresentatives (void) const; - -private: - SlideSorterViewShell* mpViewShell; - const ::std::vector maRepresentatives; - - virtual void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint); -}; - -} } } // end of namespace ::sd::slidesorter::controller - -#endif diff --git a/sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx b/sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx new file mode 100644 index 000000000000..563c31b213fb --- /dev/null +++ b/sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx @@ -0,0 +1,98 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SD_SLIDESORTER_TRANSFERABLE_DATA_HXX +#define SD_SLIDESORTER_TRANSFERABLE_DATA_HXX + +#include "sdxfer.hxx" +#include +#include + +class SdDrawDocument; +namespace sd { namespace slidesorter { +class SlideSorterViewShell; +} } + +namespace sd { namespace slidesorter { namespace controller { + +/** Represent previews and other information so that they can be + attached to an existing transferable. +*/ +class TransferableData + : public SdTransferable::UserData, + public SfxListener +{ +public: + class Representative + { + public: + Representative (const Bitmap& rBitmap, const bool bIsExcluded) + : maBitmap(rBitmap), mbIsExcluded(bIsExcluded) {} + Representative (const Representative& rOther) + : maBitmap(rOther.maBitmap), mbIsExcluded(rOther.mbIsExcluded) {} + Representative operator= (Representative& rOther) + { if (&rOther != this) {maBitmap = rOther.maBitmap; mbIsExcluded = rOther.mbIsExcluded; } + return *this; + } + + Bitmap maBitmap; + bool mbIsExcluded; + }; + + static SdTransferable* CreateTransferable ( + SdDrawDocument* pSrcDoc, + ::sd::View* pWorkView, + BOOL bInitOnGetData, + SlideSorterViewShell* pViewShell, + const ::std::vector& rRepresentatives); + + static ::boost::shared_ptr GetFromTransferable (const SdTransferable* pTransferable); + + TransferableData ( + SlideSorterViewShell* pViewShell, + const ::std::vector& rRepresentatives); + ~TransferableData (void); + + virtual void DragFinished (sal_Int8 nDropAction); + + const ::std::vector& GetRepresentatives (void) const; + + /** Return the view shell for which the transferable was created. + */ + SlideSorterViewShell* GetSourceViewShell (void) const; + +private: + SlideSorterViewShell* mpViewShell; + const ::std::vector maRepresentatives; + typedef ::std::vector > CallbackContainer; + + virtual void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint); +}; + +} } } // end of namespace ::sd::slidesorter::controller + +#endif diff --git a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx index f28287b15a0e..8840f3732367 100644 --- a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx @@ -258,6 +258,8 @@ public: ButtonBar& GetButtonBar (void) const; ToolTip& GetToolTip (void) const; + virtual void DragFinished (sal_Int8 nDropAction); + protected: virtual void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint); diff --git a/sd/source/ui/slidesorter/inc/view/SlsInsertionIndicatorOverlay.hxx b/sd/source/ui/slidesorter/inc/view/SlsInsertionIndicatorOverlay.hxx index a9a640d978cf..a48d5fe9986a 100644 --- a/sd/source/ui/slidesorter/inc/view/SlsInsertionIndicatorOverlay.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlsInsertionIndicatorOverlay.hxx @@ -30,7 +30,8 @@ #include "model/SlsSharedPageDescriptor.hxx" #include "view/SlsILayerPainter.hxx" -#include "controller/SlsTransferable.hxx" +#include "controller/SlsTransferableData.hxx" +#include "sdxfer.hxx" #include #include @@ -71,7 +72,7 @@ public: virtual void SetLayerInvalidator (const SharedILayerInvalidator& rpInvalidator); - void Create (const controller::Transferable* pTransferable); + void Create (const SdTransferable* pTransferable); /** Given a position in model coordinates this method calculates the insertion marker both as an index in the document and as a location @@ -110,7 +111,7 @@ private: OutputDevice& rContent, const Size aPreviewSize, const sal_Int32 nOffset, - const ::std::vector& rPages) const; + const ::std::vector& rPages) const; void PaintPageCount ( OutputDevice& rDevice, const sal_Int32 nSelectionCount, @@ -120,7 +121,7 @@ private: scaled down previews of some of the selected pages. */ void Create ( - const ::std::vector& rPages, + const ::std::vector& rPages, const sal_Int32 nSelectionCount); }; diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx index f3637e55e63c..029dca7fca22 100644 --- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx +++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx @@ -43,6 +43,7 @@ #include "view/SlsToolTip.hxx" #include "controller/SlideSorterController.hxx" #include "controller/SlsProperties.hxx" +#include "controller/SlsClipboard.hxx" #include "model/SlideSorterModel.hxx" #include "model/SlsPageEnumerationProvider.hxx" #include "model/SlsPageDescriptor.hxx" @@ -177,7 +178,6 @@ SlideSorterView::SlideSorterView (SlideSorter& rSlideSorter) // Hide the page that contains the page objects. SetPageVisible (FALSE); - // Register the background painter on level 1 to avoid the creation of a // background buffer. mpLayeredDevice->RegisterPainter(mpBackgroundPainter, 1); @@ -901,6 +901,16 @@ ToolTip& SlideSorterView::GetToolTip (void) const +void SlideSorterView::DragFinished (sal_Int8 nDropAction) +{ + mrSlideSorter.GetController().GetClipboard().DragFinished(nDropAction); + + View::DragFinished(nDropAction); +} + + + + void SlideSorterView::Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint) { ::sd::DrawDocShell* pDocShell = mrModel.GetDocument()->GetDocSh(); diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx index abaa5a43b215..6b5620655dbe 100644 --- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx +++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx @@ -103,11 +103,15 @@ InsertionIndicatorOverlay::~InsertionIndicatorOverlay (void) -void InsertionIndicatorOverlay::Create (const controller::Transferable* pTransferable) +void InsertionIndicatorOverlay::Create (const SdTransferable* pTransferable) { if (pTransferable == NULL) return; + ::boost::shared_ptr pData ( + controller::TransferableData::GetFromTransferable(pTransferable)); + if ( ! pData) + return; sal_Int32 nSelectionCount (0); if (pTransferable->HasPageBookmarks()) nSelectionCount = pTransferable->GetPageBookmarks().Count(); @@ -121,14 +125,14 @@ void InsertionIndicatorOverlay::Create (const controller::Transferable* pTransfe nSelectionCount = pDataDocument->GetSdPageCount(PK_STANDARD); } } - Create(pTransferable->GetRepresentatives(), nSelectionCount); + Create(pData->GetRepresentatives(), nSelectionCount); } void InsertionIndicatorOverlay::Create ( - const ::std::vector& rRepresentatives, + const ::std::vector& rRepresentatives, const sal_Int32 nSelectionCount) { view::Layouter& rLayouter (mrSlideSorter.GetView().GetLayouter()); @@ -196,7 +200,7 @@ Point InsertionIndicatorOverlay::PaintRepresentatives ( OutputDevice& rContent, const Size aPreviewSize, const sal_Int32 nOffset, - const ::std::vector& rRepresentatives) const + const ::std::vector& rRepresentatives) const { const Point aOffset (0,rRepresentatives.size()==1 ? -nOffset : 0); -- cgit v1.2.3 From 7fbb985bf869c69e98adf330eaa576e818bcd94e Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Wed, 9 Mar 2011 11:16:39 +0100 Subject: impress211: #i110990# Fixed slide show spanning multiple displays on Windows. --- sd/source/ui/dlg/present.cxx | 22 ++++++++++++++++++---- sd/source/ui/slideshow/slideshow.cxx | 22 ---------------------- 2 files changed, 18 insertions(+), 26 deletions(-) mode change 100644 => 100755 sd/source/ui/dlg/present.cxx diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx old mode 100644 new mode 100755 index 473d2f4b452b..402ae8fd8a4d --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -214,6 +214,9 @@ void SdStartPresentationDlg::InitMonitorSettings() { } + sal_Int32 nSelected (nPrimaryIndex); + const sal_Int32 nDefaultValue ( + ( ( const SfxInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_DISPLAY ) ).GetValue()); const String sPlaceHolder( RTL_CONSTASCII_USTRINGPARAM( "%1" ) ); for( sal_Int32 nDisplay = 0; nDisplay < mnMonitors; nDisplay++ ) { @@ -221,16 +224,27 @@ void SdStartPresentationDlg::InitMonitorSettings() const String aNumber( String::CreateFromInt32( nDisplay + 1 ) ); aName.SearchAndReplace( sPlaceHolder, aNumber ); maLBMonitor.InsertEntry( aName ); + + // Store display index together with name. + const USHORT nEntryIndex (maLBMonitor.GetEntryCount()-1); + maLBMonitor.SetEntryData(nEntryIndex, (void*)nDisplay); + + // Remember to select the default display. + if (nDefaultValue == nDisplay) + nSelected = nEntryIndex; } if( !bMultiscreen ) + { maLBMonitor.InsertEntry( msAllMonitors ); + const USHORT nEntryIndex (maLBMonitor.GetEntryCount()-1); + maLBMonitor.SetEntryData(nEntryIndex, (void*)-1); + if (nDefaultValue == -1) + nSelected = nEntryIndex; + } - sal_Int32 nSelected = ( ( const SfxInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_DISPLAY ) ).GetValue(); if( nSelected <= 0 ) nSelected = nPrimaryIndex; - else - nSelected--; maLBMonitor.SelectEntryPos( (USHORT)nSelected ); } @@ -262,7 +276,7 @@ void SdStartPresentationDlg::GetAttr( SfxItemSet& rAttr ) USHORT nPos = maLBMonitor.GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) - rAttr.Put( SfxInt32Item ( ATTR_PRESENT_DISPLAY, nPos + 1 ) ); + rAttr.Put( SfxInt32Item ( ATTR_PRESENT_DISPLAY, (sal_Int32)maLBMonitor.GetEntryData(nPos)) ); nPos = aLbCustomshow.GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index 70777d8a06db..aa25d77691f7 100755 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -1228,28 +1228,6 @@ sal_Int32 SlideShow::GetDisplay() if( pOptions ) nDisplay = pOptions->GetDisplay(); - if (nDisplay <= 0 ) - { - try - { - Reference xFactory( - ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW); - Reference xMonitorProperties( - xFactory->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess"))), - UNO_QUERY_THROW); - const OUString sPropertyName (RTL_CONSTASCII_USTRINGPARAM("DefaultDisplay")); - xMonitorProperties->getPropertyValue(sPropertyName) >>= nDisplay; - } - catch( Exception& ) - { - } - } - else - { - nDisplay--; - } - return nDisplay; } -- cgit v1.2.3 From 6810c23561843bd8eed16264c0133aede64b1ea1 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Fri, 11 Feb 2011 13:40:26 +0100 Subject: impress211: #i116911# Accept -1 as special value for multi monitor support. --- vcl/source/window/wrkwin.cxx | 2 +- vcl/win/source/window/salframe.cxx | 31 ++++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx index 8fb2f2f8346a..e4be5bb8b0f7 100644 --- a/vcl/source/window/wrkwin.cxx +++ b/vcl/source/window/wrkwin.cxx @@ -183,7 +183,7 @@ void WorkWindow::ShowFullScreenMode( BOOL bFullScreenMode, sal_Int32 nDisplay ) if ( !mbFullScreenMode == !bFullScreenMode ) return; - if( (nDisplay < 0) + if( (nDisplay < -1) || (nDisplay >= static_cast(Application::GetScreenCount()) ) ) { nDisplay = GetScreenNumber(); diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 89a191c99ef6..4113379b53e4 100755 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -877,7 +877,8 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, { Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW ); Reference< XIndexAccess > xMultiMon( xFactory->createInstance(OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess" ) ) ), UNO_QUERY_THROW ); - if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < xMultiMon->getCount()) ) + sal_Int32 nMonitors = xMultiMon->getCount(); + if( (pFrame->mnDisplay >= 0) && (pFrame->mnDisplay < nMonitors) ) { Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( pFrame->mnDisplay ), UNO_QUERY_THROW ); com::sun::star::awt::Rectangle aRect; @@ -891,10 +892,28 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, } else { - nScreenX = GetSystemMetrics( SM_XVIRTUALSCREEN ); - nScreenY = GetSystemMetrics( SM_YVIRTUALSCREEN ); - nScreenDX = GetSystemMetrics( SM_CXVIRTUALSCREEN ); - nScreenDY = GetSystemMetrics( SM_CYVIRTUALSCREEN ); + Rectangle aCombined; + Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( 0 ), UNO_QUERY_THROW ); + com::sun::star::awt::Rectangle aRect; + if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect ) + { + aCombined.Left() = aRect.X; + aCombined.Top() = aRect.Y; + aCombined.Right() = aRect.X + aRect.Width; + aCombined.Bottom() = aRect.Y + aRect.Height; + for( sal_Int32 i = 1 ; i < nMonitors ; i++ ) + { + xMonitor = Reference< XPropertySet >( xMultiMon->getByIndex(i), UNO_QUERY_THROW ); + if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect ) + { + aCombined.Union( Rectangle( aRect.X, aRect.Y, aRect.X+aRect.Width, aRect.Y+aRect.Height ) ); + } + } + } + nScreenX = aCombined.Left(); + nScreenY = aCombined.Top(); + nScreenDX = aCombined.GetWidth(); + nScreenDY = aCombined.GetHeight(); } } catch( Exception& ) @@ -1003,6 +1022,8 @@ WinSalFrame::WinSalFrame() // ----------------------------------------------------------------------- void WinSalFrame::updateScreenNumber() { + if( mnDisplay == -1 ) // spans all monitors + return; WinSalSystem* pSys = static_cast(ImplGetSalSystem()); if( pSys ) { -- cgit v1.2.3 From bd721abf9422a7658614c73c37378325d800c22d Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 9 Mar 2011 13:46:28 +0100 Subject: impress211: fix some warnings, types --- sd/source/ui/app/sdxfer.cxx | 2 +- sd/source/ui/dlg/present.cxx | 4 ++-- sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index a2caf97e460d..084f2e9c2629 100755 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -836,7 +836,7 @@ sal_Int32 SdTransferable::GetUserDataCount (void) const ::boost::shared_ptr SdTransferable::GetUserData (const sal_Int32 nIndex) const { - if (nIndex>=0 && nIndex=0 && nIndex(); diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index c07817c5ff9c..566891bacbb8 100755 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -232,7 +232,7 @@ void SdStartPresentationDlg::InitMonitorSettings() maLBMonitor.InsertEntry( aName ); // Store display index together with name. - const USHORT nEntryIndex (maLBMonitor.GetEntryCount()-1); + const sal_uInt32 nEntryIndex (maLBMonitor.GetEntryCount()-1); maLBMonitor.SetEntryData(nEntryIndex, (void*)nDisplay); // Remember to select the default display. @@ -243,7 +243,7 @@ void SdStartPresentationDlg::InitMonitorSettings() if( !bMultiscreen ) { maLBMonitor.InsertEntry( msAllMonitors ); - const USHORT nEntryIndex (maLBMonitor.GetEntryCount()-1); + const sal_uInt32 nEntryIndex (maLBMonitor.GetEntryCount()-1); maLBMonitor.SetEntryData(nEntryIndex, (void*)-1); if (nDefaultValue == -1) nSelected = nEntryIndex; diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index 1547913207c0..9072849d9688 100755 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -533,8 +533,8 @@ void Clipboard::CreateSlideTransferable ( SdDrawDocument* pTransferableDocument = rSlideSorter.GetModel().GetDocument(); if (pTransferableDocument == NULL) break; - BOOL bIsMasterPage; - const USHORT nPageIndex (pTransferableDocument->GetPageByName(sBookmark, bIsMasterPage)); + sal_Bool bIsMasterPage = sal_False; + const sal_uInt16 nPageIndex (pTransferableDocument->GetPageByName(sBookmark, bIsMasterPage)); if (nPageIndex == SDRPAGE_NOTFOUND) break; @@ -604,7 +604,7 @@ void Clipboard::StartDrag ( void Clipboard::DragFinished (sal_Int8 nDropAction) { - SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; + // SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; if (mnDragFinishedUserEventId == 0) { -- cgit v1.2.3 From 53eddc13d92317035bd72e4a501ab7f0c8e911d4 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 9 Mar 2011 13:50:30 +0100 Subject: impress211: fix a warning --- sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index 9072849d9688..4545e371ea37 100755 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -922,7 +922,7 @@ sal_uInt16 Clipboard::InsertSlides ( -Clipboard::DropType Clipboard::IsDropAccepted (DropTargetHelper& rTargetHelper) const +Clipboard::DropType Clipboard::IsDropAccepted (DropTargetHelper&) const { const SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; if (pDragTransferable == NULL) -- cgit v1.2.3 From df0481515fe49217975d4d62f8ef3e6904322c64 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 9 Mar 2011 13:57:56 +0100 Subject: impress211: fix a warning --- sd/source/ui/slidesorter/controller/SlsTransferableData.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx index ef554892ff0e..682b4c7f741c 100755 --- a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx +++ b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx @@ -109,7 +109,7 @@ void TransferableData::DragFinished (sal_Int8 nDropAction) -void TransferableData::Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint) +void TransferableData::Notify (SfxBroadcaster&, const SfxHint& rHint) { if (rHint.ISA(SfxSimpleHint) && mpViewShell!=NULL) { -- cgit v1.2.3 From 68d87365e174de523492a14855c5486278b88d80 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Fri, 11 Mar 2011 15:22:17 +0100 Subject: impress211: #i110990# Fixed remaining problems with display ids and indices. --- sd/source/ui/dlg/present.cxx | 34 ++++++++++++++++++++------------- sd/source/ui/slideshow/slideshow.cxx | 37 +++++++++++++++++++++++++++++++++++- 2 files changed, 57 insertions(+), 14 deletions(-) diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index 566891bacbb8..0e8173741554 100755 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -207,26 +207,27 @@ void SdStartPresentationDlg::InitMonitorSettings() else { sal_Bool bMultiscreen = false; - sal_Int32 nPrimaryIndex = 0; + sal_Int32 nDefaultDisplay (0); Reference< XPropertySet > xMonProps( xMultiMon, UNO_QUERY ); if( xMonProps.is() ) try { const OUString sPropName1( RTL_CONSTASCII_USTRINGPARAM( "MultiDisplay" ) ); xMonProps->getPropertyValue( sPropName1 ) >>= bMultiscreen; const OUString sPropName2( RTL_CONSTASCII_USTRINGPARAM( "DefaultDisplay" ) ); - xMonProps->getPropertyValue( sPropName2 ) >>= nPrimaryIndex; + xMonProps->getPropertyValue( sPropName2 ) >>= nDefaultDisplay; } catch( Exception& ) { } - sal_Int32 nSelected (nPrimaryIndex); - const sal_Int32 nDefaultValue ( + sal_Int32 nSelectedIndex (-1); + sal_Int32 nDefaultDisplayIndex (-1); + const sal_Int32 nDefaultSelectedDisplay ( ( ( const SfxInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_DISPLAY ) ).GetValue()); const String sPlaceHolder( RTL_CONSTASCII_USTRINGPARAM( "%1" ) ); for( sal_Int32 nDisplay = 0; nDisplay < mnMonitors; nDisplay++ ) { - String aName( nDisplay == nPrimaryIndex ? msPrimaryMonitor : msMonitor ); + String aName( nDisplay == nDefaultDisplay ? msPrimaryMonitor : msMonitor ); const String aNumber( String::CreateFromInt32( nDisplay + 1 ) ); aName.SearchAndReplace( sPlaceHolder, aNumber ); maLBMonitor.InsertEntry( aName ); @@ -235,9 +236,13 @@ void SdStartPresentationDlg::InitMonitorSettings() const sal_uInt32 nEntryIndex (maLBMonitor.GetEntryCount()-1); maLBMonitor.SetEntryData(nEntryIndex, (void*)nDisplay); - // Remember to select the default display. - if (nDefaultValue == nDisplay) - nSelected = nEntryIndex; + // Remember the index of the default selection. + if (nDefaultSelectedDisplay == nDisplay) + nSelectedIndex = nEntryIndex; + + // Remember index of the default display. + if (nDisplay == nDefaultDisplay) + nDefaultDisplayIndex = nEntryIndex; } if( !bMultiscreen ) @@ -245,14 +250,17 @@ void SdStartPresentationDlg::InitMonitorSettings() maLBMonitor.InsertEntry( msAllMonitors ); const sal_uInt32 nEntryIndex (maLBMonitor.GetEntryCount()-1); maLBMonitor.SetEntryData(nEntryIndex, (void*)-1); - if (nDefaultValue == -1) - nSelected = nEntryIndex; + if (nDefaultSelectedDisplay == -1) + nSelectedIndex = nEntryIndex; } - if( nSelected <= 0 ) - nSelected = nPrimaryIndex; + if (nSelectedIndex < 0) + if (nDefaultSelectedDisplay < 0) + nSelectedIndex = 0; + else + nSelectedIndex = nDefaultDisplayIndex; - maLBMonitor.SelectEntryPos( (sal_uInt16)nSelected ); + maLBMonitor.SelectEntryPos((sal_uInt16)nSelectedIndex); } } catch( Exception& ) diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index c37d34d0f5df..0f01f0658cbb 100755 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -109,6 +109,26 @@ namespace { private: ::boost::shared_ptr mpRestarter; }; + + /** Return the default display id (or -1 when that can not be + determined.) + */ + sal_Int32 GetDefaultDisplay (void) + { + try + { + Reference< XMultiServiceFactory > xFactory(::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW ); + Reference< XPropertySet > xMonProps(xFactory->createInstance(OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess" ) ) ), UNO_QUERY_THROW ); + const OUString sPropertyName( RTL_CONSTASCII_USTRINGPARAM( "DefaultDisplay" ) ); + sal_Int32 nPrimaryIndex (-1); + if (xMonProps->getPropertyValue( sPropertyName ) >>= nPrimaryIndex) + return nPrimaryIndex; + } + catch( Exception& ) + { + } + return -1; + } } @@ -553,6 +573,14 @@ void SAL_CALL SlideShow::setPropertyValue( const OUString& aPropertyName, const sal_Int32 nDisplay = 0; if( aValue >>= nDisplay ) { + // Convert value to true display id. + if (nDisplay == 0) + nDisplay = GetDefaultDisplay(); + else if (nDisplay < 0) + nDisplay = -1; + else + --nDisplay; + bIllegalArgument = false; SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS); @@ -632,7 +660,14 @@ Any SAL_CALL SlideShow::getPropertyValue( const OUString& PropertyName ) throw(U case ATTR_PRESENT_DISPLAY: { SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS); - return Any( pOptions->GetDisplay() ); + const sal_Int32 nDisplay (pOptions->GetDisplay()); + // Convert true display id to the previously used schema. + if (nDisplay == GetDefaultDisplay()) + return Any(sal_Int32(0)); + else if (nDisplay < 0) + return Any(sal_Int32(-1)); + else + return Any(nDisplay+1); } default: -- cgit v1.2.3 From 4710f22c8b0a7fbb22b7ccf1ceb11e3895bbc134 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Fri, 11 Mar 2011 15:22:17 +0100 Subject: impress211: #i110990# Fixed remaining problems with display ids and indices. --- sdext/source/presenter/PresenterScreen.cxx | 7 +++++++ 1 file changed, 7 insertions(+) mode change 100644 => 100755 sdext/source/presenter/PresenterScreen.cxx diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx old mode 100644 new mode 100755 index 22a1b2fe623f..d47f0aea4077 --- a/sdext/source/presenter/PresenterScreen.cxx +++ b/sdext/source/presenter/PresenterScreen.cxx @@ -496,6 +496,13 @@ sal_Int32 PresenterScreen::GetScreenNumber ( sal_Int32 nDisplayNumber (-1); if ( ! (xProperties->getPropertyValue(A2S("Display")) >>= nDisplayNumber)) return -1; + if (nDisplayNumber == -1) + { + // The special value -1 indicates that the slide show + // spans all available displays. That leaves no room for + // the presenter screen. + return -1; + } Reference xContext (mxContextWeak); if ( ! xContext.is()) -- cgit v1.2.3 From f4e78866a51b3a8700bf5f9bd0027006ad5a7309 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Wed, 9 Mar 2011 11:16:39 +0100 Subject: impress211: #i110990# Fixed slide show spanning multiple displays on Windows. --- vcl/source/window/window.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 0762a07476e2..bdde4b948e48 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -9760,7 +9760,7 @@ Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSi OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.rendering.SpriteCanvas.MultiScreen" )) : OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.rendering.Canvas" )), + "com.sun.star.rendering.Canvas.MultiScreen" )), aArg ), UNO_QUERY ); -- cgit v1.2.3 From 657924e4d73d6d501c9a3ceaf62e29b8f243cead Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Wed, 9 Mar 2011 11:16:39 +0100 Subject: impress211: #i110990# Fixed slide show spanning multiple displays on Windows. --- .../registry/data/org/openoffice/Office/Canvas.xcu | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu index 00030d71bf9b..12a8268dceb1 100755 --- a/officecfg/registry/data/org/openoffice/Office/Canvas.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Canvas.xcu @@ -75,6 +75,34 @@ + + + com.sun.star.comp.rendering.Canvas.VCL + + + + com.sun.star.comp.rendering.Canvas.VCL + + + + com.sun.star.comp.rendering.Canvas.VCL + + + + + + com.sun.star.comp.rendering.SpriteCanvas.VCL + + + + com.sun.star.comp.rendering.SpriteCanvas.VCL + + + + com.sun.star.comp.rendering.SpriteCanvas.VCL + + + -- cgit v1.2.3 From 8dbc86aa82fb73668816f228779b2094de546aa0 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Thu, 31 Mar 2011 16:12:22 +0200 Subject: impress211: #i110990# Fixed 64bit compiler problem. --- sd/source/ui/dlg/present.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 sd/source/ui/dlg/present.cxx diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx old mode 100755 new mode 100644 index 0e8173741554..51f49bc03032 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -290,7 +290,7 @@ void SdStartPresentationDlg::GetAttr( SfxItemSet& rAttr ) sal_uInt16 nPos = maLBMonitor.GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) - rAttr.Put( SfxInt32Item ( ATTR_PRESENT_DISPLAY, (sal_Int32)maLBMonitor.GetEntryData(nPos)) ); + rAttr.Put( SfxInt32Item ( ATTR_PRESENT_DISPLAY, (sal_Int32)(sal_IntPtr)maLBMonitor.GetEntryData(nPos)) ); nPos = aLbCustomshow.GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) -- cgit v1.2.3 From 144c7a2e1d711e13422a5c84b34ac33b1d940034 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Wed, 23 Mar 2011 09:42:08 +0100 Subject: impress211: #i110990# Increased version number (micro) of presenter screen extension to 1.1.1. --- sdext/source/presenter/description.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdext/source/presenter/description.xml b/sdext/source/presenter/description.xml index 19fefec6de8a..fbe039e610be 100644 --- a/sdext/source/presenter/description.xml +++ b/sdext/source/presenter/description.xml @@ -17,7 +17,7 @@ - + -- cgit v1.2.3 From 595eeea7ec798007c929ae927cd46d238af54cc5 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Wed, 17 Nov 2010 12:25:56 +0100 Subject: os141: add missing component --- scripting/source/dlgprov/dlgprov.component | 3 +++ scripting/source/dlgprov/dlgprov.cxx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/scripting/source/dlgprov/dlgprov.component b/scripting/source/dlgprov/dlgprov.component index f7ceed336cf6..ba58de62fde4 100644 --- a/scripting/source/dlgprov/dlgprov.component +++ b/scripting/source/dlgprov/dlgprov.component @@ -33,4 +33,7 @@ + + + diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx index 8a577ab03e1c..e80647cb1068 100644 --- a/scripting/source/dlgprov/dlgprov.cxx +++ b/scripting/source/dlgprov/dlgprov.cxx @@ -75,7 +75,7 @@ namespace comp_DialogModelProvider ::rtl::OUString SAL_CALL _getImplementationName() { - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogModelProvider")); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.scripting.DialogModelProvider")); } uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames() -- cgit v1.2.3 From 42df38ac6e845c85d4c980a795cd59c7f3ac19cd Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Mon, 13 Dec 2010 13:34:56 +0100 Subject: impressdefaults1: #i115996# change default bullet symbol order from 'Oo-' in 'O-O-O' inside text objects --- sd/source/core/stlpool.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index ef3d5d0ebe25..4fb752d11053 100755 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -1096,32 +1096,33 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet, switch(i) { case 0: - case 1: { nFontSize = 32; nFirstLineOffset = -900; } break; - case 2: + case 1: { - nFontSize = 28; - nFirstLineOffset = -800; aNumberFormat.SetBulletChar( 0x2013 ); // StarBats: 0xF000 + 150 aNumberFormat.SetBulletRelSize(75); + nFontSize = 32; + nFirstLineOffset = -900; } break; - case 3: + case 2: { - nFontSize = 24; + nFontSize = 28; + nFirstLineOffset = -800; } break; - case 4: + case 3: { - aNumberFormat.SetBulletChar( 0x2013 ); // StarBats: 0xF000 + 150 + aNumberFormat.SetBulletChar( 0x2013 ); // StarBats: 0xF000 + 150 aNumberFormat.SetBulletRelSize(75); + nFontSize = 24; } break; } -- cgit v1.2.3 From de6b8fae9f4775b841c46e57e5b36670de90c61c Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Mon, 7 Feb 2011 17:53:47 +0100 Subject: impress210: #i116846# adding uncommited changes from cws impressdefautls1 --- sd/source/ui/slideshow/slideshow.src | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src index 78cd2aae0d9f..c3efa2ac2f32 100755 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -74,7 +74,7 @@ Menu RID_SLIDESHOW_CONTEXTMENU MenuItem { Identifier = CM_PEN_MODE; - Text [ en-US ] = "Mouse pointer as ~pen"; + Text [ en-US ] = "Mouse Pointer as ~Pen"; }; MenuItem { @@ -115,12 +115,12 @@ Menu RID_SLIDESHOW_CONTEXTMENU MenuItem { Identifier = CM_COLOR_PEN ; - Text [ en-US ] = "~Change Pen Color..." ; + Text [ en-US ] = "~Change pen Color..." ; }; MenuItem { Identifier = CM_ERASE_ALLINK ; - Text [ en-US ] = "~Erase All Ink On Slide" ; + Text [ en-US ] = "~Erase all ink on Slide" ; }; MenuItem { -- cgit v1.2.3 From 0b1653c57d847996366d23f1e1ae95275203039a Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Mon, 7 Feb 2011 17:53:47 +0100 Subject: impress210: #i116846# adding uncommited changes from cws impressdefautls1 --- svx/inc/svx/xdef.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/inc/svx/xdef.hxx b/svx/inc/svx/xdef.hxx index dd0fbd802291..9a06439f3738 100644 --- a/svx/inc/svx/xdef.hxx +++ b/svx/inc/svx/xdef.hxx @@ -36,7 +36,7 @@ |* \************************************************************************/ -#define COL_DEFAULT_SHAPE_FILLING RGB_COLORDATA( 0xCF, 0xE7, 0xE5 ) +#define COL_DEFAULT_SHAPE_FILLING RGB_COLORDATA( 0xCF, 0xE7, 0xF5 ) #define COL_DEFAULT_SHAPE_STROKE RGB_COLORDATA( 128, 128, 128 ) #define XATTR_START 1000 -- cgit v1.2.3 From 348c90a30548ca6e0e6b8762a8c2058e79a80229 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Mon, 7 Feb 2011 17:53:47 +0100 Subject: impress210: #i116846# adding uncommited changes from cws impressdefautls1 --- extras/source/palettes/standard.soc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/source/palettes/standard.soc b/extras/source/palettes/standard.soc index 83cffa5d8edd..1bc29d09ebfd 100644 --- a/extras/source/palettes/standard.soc +++ b/extras/source/palettes/standard.soc @@ -49,7 +49,7 @@ - + -- cgit v1.2.3 From f4687bedc89c9882b9fc735b2ed4b1a420892928 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Mon, 7 Feb 2011 18:05:30 +0100 Subject: impress210: #i116846# added missing commits from cws impressdefaults1 --- sd/source/ui/slideshow/slideshow.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src index c3efa2ac2f32..0b6217028d91 100755 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -74,7 +74,7 @@ Menu RID_SLIDESHOW_CONTEXTMENU MenuItem { Identifier = CM_PEN_MODE; - Text [ en-US ] = "Mouse Pointer as ~Pen"; + Text [ en-US ] = "Mouse pointer as ~Pen"; }; MenuItem { -- cgit v1.2.3 From ebdc319057fc5e86f9eb854504b84a9021520fb6 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Tue, 8 Feb 2011 12:26:33 +0100 Subject: impress210: #i115617# set zoom to fit_to_window --- avmedia/source/gstreamer/gstplayer.cxx | 33 ++++++++++++++------------ avmedia/source/gstreamer/gstplayer.hxx | 24 +++++++------------ avmedia/source/gstreamer/gstwindow.cxx | 2 +- avmedia/source/viewer/mediawindowbase_impl.cxx | 14 ++++------- avmedia/source/win/player.cxx | 13 ++++++---- avmedia/source/win/player.hxx | 11 ++++++--- avmedia/source/win/window.cxx | 2 +- 7 files changed, 49 insertions(+), 50 deletions(-) diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index f082cfc5c513..e5bff43f95cc 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -188,6 +188,7 @@ Player* Player::create( const ::rtl::OUString& rURL ) void SAL_CALL Player::start() throw( uno::RuntimeException ) { + MutexGuard aGuard(m_aMutex); if( implInitPlayer() && !isPlaying() ) { gst_element_set_state( mpPlayer, GST_STATE_PLAYING ); @@ -198,6 +199,7 @@ void SAL_CALL Player::start() void SAL_CALL Player::stop() throw( uno::RuntimeException ) { + MutexGuard aGuard(m_aMutex); if( implInitPlayer() && isPlaying() ) { gst_element_set_state( mpPlayer, GST_STATE_PAUSED ); @@ -209,7 +211,7 @@ sal_Bool SAL_CALL Player::isPlaying() throw( uno::RuntimeException ) { GstState aState = GST_STATE_NULL; - + MutexGuard aGuard(m_aMutex); if( mpPlayer ) { gst_element_get_state( mpPlayer, &aState, NULL, GST_MAX_TIMEOUT ); @@ -222,6 +224,7 @@ sal_Bool SAL_CALL Player::isPlaying() double SAL_CALL Player::getDuration() throw( uno::RuntimeException ) { + MutexGuard aGuard(m_aMutex); gint64 nDuration = 0; if( implInitPlayer() ) @@ -243,6 +246,7 @@ double SAL_CALL Player::getDuration() void SAL_CALL Player::setMediaTime( double fTime ) throw( uno::RuntimeException ) { + MutexGuard aGuard(m_aMutex); if( implInitPlayer() ) { fTime = ::std::min( ::std::max( fTime, 0.0 ), getDuration() ); @@ -258,7 +262,7 @@ double SAL_CALL Player::getMediaTime() throw( uno::RuntimeException ) { double fRet = 0.0; - + MutexGuard aGuard(m_aMutex); if( implInitPlayer() ) { GstFormat aFormat = GST_FORMAT_TIME; @@ -298,7 +302,7 @@ double SAL_CALL Player::getStopTime() Currently no need for implementation since higher levels of code don't set a stop time ATM !!! TODO: needs to be fully implemented if this functionality is needed at a later point of time */ - + MutexGuard aGuard(m_aMutex); return( getDuration() ); } @@ -329,6 +333,7 @@ double SAL_CALL Player::getRate() void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) throw( uno::RuntimeException ) { + MutexGuard aGuard(m_aMutex); if( bSet && !isPlaybackLoop() ) g_atomic_int_inc( &mnLooping ); else if( !bSet && isPlaybackLoop() ) @@ -339,6 +344,7 @@ void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) sal_Bool SAL_CALL Player::isPlaybackLoop() throw( uno::RuntimeException ) { + MutexGuard aGuard(m_aMutex); return( g_atomic_int_get( &mnLooping ) > 0 ); } @@ -346,6 +352,7 @@ sal_Bool SAL_CALL Player::isPlaybackLoop() void SAL_CALL Player::setMute( sal_Bool bSet ) throw( uno::RuntimeException ) { + MutexGuard aGuard(m_aMutex); if( implInitPlayer() && ( bSet != isMute() ) ) { if( bSet ) @@ -364,6 +371,7 @@ sal_Bool SAL_CALL Player::isMute() throw( uno::RuntimeException ) { gdouble fGstVolume = 1.0; + MutexGuard aGuard(m_aMutex); if( implInitPlayer() ) { @@ -377,6 +385,7 @@ sal_Bool SAL_CALL Player::isMute() void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) throw( uno::RuntimeException ) { + MutexGuard aGuard(m_aMutex); if( implInitPlayer() ) { g_mutex_lock( mpMutex ); @@ -395,6 +404,7 @@ void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) sal_Int16 SAL_CALL Player::getVolumeDB() throw( uno::RuntimeException ) { + MutexGuard aGuard(m_aMutex); return( static_cast< sal_Int16 >( g_atomic_int_get( &mnVolumeDB ) ) ); } @@ -403,6 +413,7 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize() throw( uno::RuntimeException ) { awt::Size aSize( 0, 0 ); + MutexGuard aGuard(m_aMutex); if( implInitPlayer() && ( g_atomic_int_get( &mnIsVideoSource ) > 0 ) ) { @@ -427,6 +438,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( const uno::Sequence< uno::Any >& rArguments ) throw( uno::RuntimeException ) { + MutexGuard aGuard(m_aMutex); uno::Reference< ::media::XPlayerWindow > xRet; awt::Size aSize( getPreferredPlayerWindowSize() ); @@ -470,6 +482,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() throw( ::com::sun::star::uno::RuntimeException ) { + MutexGuard aGuard(m_aMutex); FrameGrabber* pFrameGrabber = NULL; const awt::Size aPrefSize( getPreferredPlayerWindowSize() ); @@ -482,9 +495,9 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() } // ------------------------------------------------------------------------------ -void SAL_CALL Player::dispose() - throw( uno::RuntimeException ) +void SAL_CALL Player::disposing() { + MutexGuard aGuard(m_aMutex); if( mpPlayer ) { stop(); @@ -494,16 +507,6 @@ void SAL_CALL Player::dispose() OSL_ASSERT( NULL == mpPlayer ); } -// ------------------------------------------------------------------------------ -void SAL_CALL Player::addEventListener( const uno::Reference< lang::XEventListener >& /*rxListener*/ ) - throw( uno::RuntimeException ) -{} - -// ------------------------------------------------------------------------------ -void SAL_CALL Player::removeEventListener( const uno::Reference< lang::XEventListener >& /*rxListener*/ ) - throw( uno::RuntimeException ) -{} - // ------------------------------------------------------------------------------ ::rtl::OUString SAL_CALL Player::getImplementationName() throw( uno::RuntimeException ) diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx index d751e381258d..4b73e898a4bf 100644 --- a/avmedia/source/gstreamer/gstplayer.hxx +++ b/avmedia/source/gstreamer/gstplayer.hxx @@ -46,6 +46,8 @@ typedef struct _GOptionGroup GOptionGroup; #include #include "com/sun/star/media/XPlayer.hdl" +#include +#include namespace avmedia { @@ -57,8 +59,8 @@ class Window; // - Player_Impl - // --------------- -class Player : public ::cppu::WeakImplHelper3< ::com::sun::star::media::XPlayer, - ::com::sun::star::lang::XComponent, +class Player : public cppu::BaseMutex, + public ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer, ::com::sun::star::lang::XServiceInfo > { public: @@ -67,7 +69,7 @@ public: static Player* create( const ::rtl::OUString& rURL ); ~Player(); - +protected: // XPlayer virtual void SAL_CALL start() throw( ::com::sun::star::uno::RuntimeException ); @@ -127,18 +129,6 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XFrameGrabber > SAL_CALL createFrameGrabber() throw( ::com::sun::star::uno::RuntimeException ); - // XComponent - virtual void SAL_CALL dispose() - throw( ::com::sun::star::uno::RuntimeException ); - - virtual void SAL_CALL addEventListener( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) - throw( ::com::sun::star::uno::RuntimeException ); - - virtual void SAL_CALL removeEventListener( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) - throw( ::com::sun::star::uno::RuntimeException ); - // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); @@ -150,7 +140,9 @@ public: throw( ::com::sun::star::uno::RuntimeException ); -protected: + + // ::cppu::OComponentHelper + virtual void SAL_CALL disposing(void); Player( GString* pURI = NULL ); diff --git a/avmedia/source/gstreamer/gstwindow.cxx b/avmedia/source/gstreamer/gstwindow.cxx index 12606ad5e88b..417525c1946e 100644 --- a/avmedia/source/gstreamer/gstwindow.cxx +++ b/avmedia/source/gstreamer/gstwindow.cxx @@ -271,7 +271,7 @@ value in sequence of arguments" ); if( pParentWindow ) { - meZoomLevel = media::ZoomLevel_ORIGINAL; + meZoomLevel = media::ZoomLevel_FIT_TO_WINDOW; mpPlayerWindow = new PlayerChildWindow( pParentWindow ); mpPlayerWindow->SetBackground( Color( COL_BLACK ) ); diff --git a/avmedia/source/viewer/mediawindowbase_impl.cxx b/avmedia/source/viewer/mediawindowbase_impl.cxx index 94a6c36ed064..cd9ac849132a 100644 --- a/avmedia/source/viewer/mediawindowbase_impl.cxx +++ b/avmedia/source/viewer/mediawindowbase_impl.cxx @@ -207,17 +207,11 @@ void MediaWindowBaseImpl::setPlayerWindow( const uno::Reference< media::XPlayerW void MediaWindowBaseImpl::cleanUp() { - if( mxPlayer.is() ) - { - mxPlayer->stop(); - - uno::Reference< lang::XComponent > xComponent( mxPlayer, uno::UNO_QUERY ); + uno::Reference< lang::XComponent > xComponent( mxPlayer, uno::UNO_QUERY ); + if( xComponent.is() ) // this stops the player + xComponent->dispose(); - if( xComponent.is() ) - xComponent->dispose(); - - mxPlayer.clear(); - } + mxPlayer.clear(); mpMediaWindow = NULL; } diff --git a/avmedia/source/win/player.cxx b/avmedia/source/win/player.cxx index d27b2b55ff93..a0f678327b03 100644 --- a/avmedia/source/win/player.cxx +++ b/avmedia/source/win/player.cxx @@ -92,6 +92,15 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : Player::~Player() { + ::CoUninitialize(); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Player::disposing() +{ + MutexGuard aGuard(m_aMutex); + stop(); if( mpBA ) mpBA->Release(); @@ -121,12 +130,8 @@ Player::~Player() if( mpGB ) mpGB->Release(); - - ::CoUninitialize(); } - // ------------------------------------------------------------------------------ - bool Player::create( const ::rtl::OUString& rURL ) { HRESULT hR; diff --git a/avmedia/source/win/player.hxx b/avmedia/source/win/player.hxx index 34a567750b74..523d2800b150 100644 --- a/avmedia/source/win/player.hxx +++ b/avmedia/source/win/player.hxx @@ -30,9 +30,10 @@ #include "wincommon.hxx" -#ifndef _COM_SUN_STAR_MEDIA_XPLAYER_HDL_ #include "com/sun/star/media/XPlayer.hdl" -#endif + +#include +#include struct IGraphBuilder; struct IBaseFilter; @@ -53,7 +54,8 @@ namespace avmedia { namespace win { // - Player - // ---------- -class Player : public ::cppu::WeakImplHelper2< ::com::sun::star::media::XPlayer, +class Player : public cppu::BaseMutex, + public ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer, ::com::sun::star::lang::XServiceInfo > { public: @@ -95,6 +97,9 @@ public: virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + // ::cppu::OComponentHelper + virtual void SAL_CALL disposing(void); + private: ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr; diff --git a/avmedia/source/win/window.cxx b/avmedia/source/win/window.cxx index 1170505b440b..e077e097cc7b 100644 --- a/avmedia/source/win/window.cxx +++ b/avmedia/source/win/window.cxx @@ -374,7 +374,7 @@ bool Window::create( const uno::Sequence< uno::Any >& rArguments ) mrPlayer.setNotifyWnd( mnFrameWnd ); - meZoomLevel = media::ZoomLevel_ORIGINAL; + meZoomLevel = media::ZoomLevel_FIT_TO_WINDOW; ImplLayoutVideoWindow(); #ifdef DDRAW_TEST_OUTPUT } -- cgit v1.2.3 From 2aa75d739448d4dad44d7c09c746243cefea25e2 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Tue, 8 Feb 2011 12:29:15 +0100 Subject: impress210: #i105310# set tooltip for items and some refactoring --- svx/inc/galtheme.hrc | 2 +- svx/inc/svx/gallery.hxx | 2 +- svx/source/customshapes/EnhancedCustomShape2d.cxx | 6 ++-- .../customshapes/EnhancedCustomShapeFontWork.cxx | 4 +-- svx/source/dialog/dlgctl3d.cxx | 2 +- svx/source/form/fmshimp.cxx | 6 ++-- svx/source/gallery2/codec.cxx | 6 ++++ svx/source/gallery2/galbrws.cxx | 15 +++++++++ svx/source/gallery2/galbrws1.cxx | 38 +++++++++++++++------- svx/source/gallery2/galbrws1.hxx | 2 +- svx/source/gallery2/galbrws2.cxx | 20 ++++++++++++ svx/source/gallery2/galctrl.cxx | 19 ++++++++++- svx/source/gallery2/gallery1.cxx | 32 ++++++++++-------- svx/source/gallery2/galmisc.cxx | 10 ++++++ svx/source/gallery2/galobj.cxx | 12 +++++++ svx/source/gallery2/galtheme.cxx | 20 ++++++------ svx/source/gallery2/galtheme.src | 8 ----- svx/source/sdr/contact/objectcontact.cxx | 2 +- svx/source/sdr/contact/viewcontact.cxx | 4 +-- svx/source/sdr/contact/viewcontactofsdrobj.cxx | 2 +- svx/source/sdr/event/eventhandler.cxx | 4 +-- svx/source/sdr/overlay/overlayobjectlist.cxx | 6 ++-- svx/source/svdraw/svddrgmt.cxx | 10 +++--- svx/source/svdraw/svdedtv.cxx | 8 ++--- svx/source/svdraw/svdedtv1.cxx | 8 ++--- svx/source/svdraw/svdoashp.cxx | 2 +- svx/source/svdraw/svdobj.cxx | 4 +-- svx/source/svdraw/svdotextdecomposition.cxx | 6 ++-- svx/source/svdraw/svdotextpathdecomposition.cxx | 8 ++--- svx/source/svdraw/svdpntv.cxx | 2 +- svx/source/tbxctrls/tbcontrl.cxx | 2 +- svx/source/unodraw/UnoGraphicExporter.cxx | 6 ++-- 32 files changed, 184 insertions(+), 94 deletions(-) diff --git a/svx/inc/galtheme.hrc b/svx/inc/galtheme.hrc index 483c397983ed..b0d656430864 100644 --- a/svx/inc/galtheme.hrc +++ b/svx/inc/galtheme.hrc @@ -43,7 +43,7 @@ #define RID_GALLERYSTR_THEME_MAPS (RID_GALLERYSTR_THEME_START + 12) #define RID_GALLERYSTR_THEME_PEOPLE (RID_GALLERYSTR_THEME_START + 13) #define RID_GALLERYSTR_THEME_SURFACES (RID_GALLERYSTR_THEME_START + 14) -#define RID_GALLERYSTR_THEME_HTMLBUTTONS (RID_GALLERYSTR_THEME_START + 15) +// free #define RID_GALLERYSTR_THEME_POWERPOINT (RID_GALLERYSTR_THEME_START + 16) #define RID_GALLERYSTR_THEME_RULERS (RID_GALLERYSTR_THEME_START + 17) #define RID_GALLERYSTR_THEME_SOUNDS (RID_GALLERYSTR_THEME_START + 18) diff --git a/svx/inc/svx/gallery.hxx b/svx/inc/svx/gallery.hxx index 68a5c68539f1..38bcd6108cd5 100644 --- a/svx/inc/svx/gallery.hxx +++ b/svx/inc/svx/gallery.hxx @@ -63,7 +63,7 @@ #define GALLERY_THEME_MAPS 12 #define GALLERY_THEME_PEOPLE 13 #define GALLERY_THEME_SURFACES 14 -#define GALLERY_THEME_HTMLBUTTONS 15 +// free #define GALLERY_THEME_POWERPOINT 16 #define GALLERY_THEME_RULERS 17 #define GALLERY_THEME_SOUNDS 18 diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 6224373f9a15..c56a7917d9aa 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -2002,7 +2002,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl SdrObject* pRet = NULL; sal_uInt32 i; - if ( vObjectList.size() ) + if ( !vObjectList.empty() ) { const SfxItemSet& rCustomShapeSet = pCustomShapeObj->GetMergedItemSet(); Color aFillColor; @@ -2010,7 +2010,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl sal_uInt32 nColorIndex = 0; // #i37011# remove invisible objects - if(vObjectList.size()) + if(!vObjectList.empty()) { std::vector< SdrPathObj* > vTempList; @@ -2092,7 +2092,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl } // #i37011# - if(vObjectList.size()) + if(!vObjectList.empty()) { // copy remaining objects to pRet if(vObjectList.size() > 1L) diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 5a24cb1fd75d..eb77ba891643 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -685,7 +685,7 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW std::vector< double > vDistances; vDistances.reserve( nPointCount ); CalcDistances( rOutlinePoly, vDistances ); - if ( vDistances.size() ) + if ( !vDistances.empty() ) { std::vector< FWParagraphData >::iterator aParagraphIter( aTextAreaIter->vParagraphs.begin() ); std::vector< FWParagraphData >::iterator aParagraphIEnd( aTextAreaIter->vParagraphs.end() ); @@ -816,7 +816,7 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW SdrObject* CreateSdrObjectFromParagraphOutlines( const FWData& rFWData, const SdrObject* pCustomShape ) { SdrObject* pRet = NULL; - if ( rFWData.vTextAreas.size() ) + if ( !rFWData.vTextAreas.empty() ) { pRet = new SdrObjGroup(); // SJ: not setting model, so we save a lot of broadcasting and the model is not modified any longer diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 95c27a5dcec8..643c72689d90 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -509,7 +509,7 @@ void Svx3DLightControl::TrySelection(Point aPosPixel) std::vector< const E3dCompoundObject* > aResult; getAllHit3DObjectsSortedFrontToBack(aPoint, *mpScene, aResult); - if(aResult.size()) + if(!aResult.empty()) { // exclude expansion object which will be part of // the hits. It's invisible, but for HitTest, it's included diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 7a705dfa4aa5..eda3f138a176 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -1569,7 +1569,7 @@ void FmXFormShell::ExecuteSearch() aContextNames.swap( aValidContexts ); } - if (m_aSearchForms.size() == 0) + if (m_aSearchForms.empty() ) { // es gibt keine Controls, die alle Bedingungen fuer eine Suche erfuellen ErrorBox(NULL, WB_OK, SVX_RESSTR(RID_STR_NODATACONTROLS)).Execute(); return; @@ -2571,7 +2571,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn strFieldList.EraseTrailingChars(';'); sFieldDisplayNames.EraseTrailingChars(';'); - if (!pfmscContextInfo->arrFields.size()) + if (pfmscContextInfo->arrFields.empty()) { pfmscContextInfo->arrFields.clear(); pfmscContextInfo->xCursor = NULL; @@ -3741,7 +3741,7 @@ void FmXFormShell::viewDeactivated( FmFormView& _rCurrentView, sal_Bool _bDeacti // move all events from our queue to a new one, omit the events for the deactivated // page ::std::queue< FmLoadAction > aNewEvents; - while ( m_aLoadingPages.size() ) + while ( !m_aLoadingPages.empty() ) { FmLoadAction aAction = m_aLoadingPages.front(); m_aLoadingPages.pop(); diff --git a/svx/source/gallery2/codec.cxx b/svx/source/gallery2/codec.cxx index 7249df9c121f..6d6472f27de2 100644 --- a/svx/source/gallery2/codec.cxx +++ b/svx/source/gallery2/codec.cxx @@ -31,20 +31,26 @@ #include #include #include "codec.hxx" +#include // ---------------- // - GalleryCodec - // ---------------- +DBG_NAME(GalleryCodec) GalleryCodec::GalleryCodec( SvStream& rIOStm ) : rStm( rIOStm ) { + DBG_CTOR(GalleryCodec,NULL); + } // ----------------------------------------------------------------------------- GalleryCodec::~GalleryCodec() { + + DBG_DTOR(GalleryCodec,NULL); } // ----------------------------------------------------------------------------- diff --git a/svx/source/gallery2/galbrws.cxx b/svx/source/gallery2/galbrws.cxx index b972dccd9ab7..6cc9364914c0 100644 --- a/svx/source/gallery2/galbrws.cxx +++ b/svx/source/gallery2/galbrws.cxx @@ -57,16 +57,21 @@ public: }; // ----------------------------------------------------------------------------- +DBG_NAME(GallerySplitter) GallerySplitter::GallerySplitter( Window* pParent, const ResId& rResId ) : Splitter( pParent, rResId ) { + DBG_CTOR(GallerySplitter,NULL); + } // ----------------------------------------------------------------------------- GallerySplitter::~GallerySplitter() { + + DBG_DTOR(GallerySplitter,NULL); } // ----------------------------------------------------------------------------- @@ -80,10 +85,13 @@ void GallerySplitter::DataChanged( const DataChangedEvent& rDCEvt ) // ------------------------- // - SvxGalleryChildWindow - // ------------------------- +DBG_NAME(GalleryChildWindow) GalleryChildWindow::GalleryChildWindow( Window* _pParent, USHORT nId, SfxBindings* pBindings, SfxChildWinInfo* pInfo ) : SfxChildWindow( _pParent, nId ) { + DBG_CTOR(GalleryChildWindow,NULL); + pWindow = new GalleryBrowser( pBindings, this, _pParent, GAL_RESID( RID_SVXDLG_GALLERYBROWSER ) ); eChildAlignment = SFX_ALIGN_TOP; ( (GalleryBrowser*) pWindow )->Initialize( pInfo ); @@ -93,6 +101,8 @@ GalleryChildWindow::GalleryChildWindow( Window* _pParent, USHORT nId, SfxBinding GalleryChildWindow::~GalleryChildWindow() { + + DBG_DTOR(GalleryChildWindow,NULL); } // ----------------------------------------------------------------------------- @@ -102,11 +112,14 @@ SFX_IMPL_DOCKINGWINDOW( GalleryChildWindow, SID_GALLERY ) // ------------------ // - GalleryBrowser - // ------------------ +DBG_NAME(GalleryBrowser) GalleryBrowser::GalleryBrowser( SfxBindings* _pBindings, SfxChildWindow* pCW, Window* pParent, const ResId& rResId ) : SfxDockingWindow( _pBindings, pCW, pParent, rResId ) { + DBG_CTOR(GalleryBrowser,NULL); + mpGallery = Gallery::GetGalleryInstance(); mpBrowser1 = new GalleryBrowser1( this, GAL_RESID( GALLERY_BROWSER1 ), mpGallery ); mpSplitter = new GallerySplitter( this, GAL_RESID( GALLERY_SPLITTER ) ); @@ -132,6 +145,8 @@ GalleryBrowser::~GalleryBrowser() delete mpBrowser2; delete mpSplitter; delete mpBrowser1; + + DBG_DTOR(GalleryBrowser,NULL); } // ----------------------------------------------------------------------------- diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index 04f402804b0c..babf34a9e146 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -55,16 +55,21 @@ using namespace ::com::sun::star; // ----------------- // - GalleryButton - // ----------------- +DBG_NAME(GalleryButton) GalleryButton::GalleryButton( GalleryBrowser1* pParent, WinBits nWinBits ) : PushButton( pParent, nWinBits ) { + DBG_CTOR(GalleryButton,NULL); + } // ----------------------------------------------------------------------------- GalleryButton::~GalleryButton() { + + DBG_DTOR(GalleryButton,NULL); } // ----------------------------------------------------------------------------- @@ -78,10 +83,13 @@ void GalleryButton::KeyInput( const KeyEvent& rKEvt ) // ----------------------- // - GalleryThemeListBox - // ----------------------- +DBG_NAME(GalleryThemeListBox) GalleryThemeListBox::GalleryThemeListBox( GalleryBrowser1* pParent, WinBits nWinBits ) : ListBox( pParent, nWinBits ) { + DBG_CTOR(GalleryThemeListBox,NULL); + InitSettings(); } @@ -89,6 +97,8 @@ GalleryThemeListBox::GalleryThemeListBox( GalleryBrowser1* pParent, WinBits nWin GalleryThemeListBox::~GalleryThemeListBox() { + + DBG_DTOR(GalleryThemeListBox,NULL); } // ------------------------------------------------------------------------ @@ -137,6 +147,7 @@ long GalleryThemeListBox::PreNotify( NotifyEvent& rNEvt ) // ------------------- // - GalleryBrowser1 - // ------------------- +DBG_NAME(GalleryBrowser1) GalleryBrowser1::GalleryBrowser1( GalleryBrowser* pParent, const ResId& rResId, Gallery* pGallery ) : Control ( pParent, rResId ), @@ -150,6 +161,8 @@ GalleryBrowser1::GalleryBrowser1( GalleryBrowser* pParent, const ResId& rResId, aImgReadOnly ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_READONLY ) ), aImgImported ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_IMPORTED ) ) { + DBG_CTOR(GalleryBrowser1,NULL); + StartListening( *mpGallery ); maNewTheme.SetHelpId( HID_GALLERY_NEWTHEME ); @@ -180,6 +193,8 @@ GalleryBrowser1::~GalleryBrowser1() mpThemes = NULL; delete mpExchangeData; mpExchangeData = NULL; + + DBG_DTOR(GalleryBrowser1,NULL); } // ----------------------------------------------------------------------------- @@ -255,9 +270,8 @@ void GalleryBrowser1::ImplFillExchangeData( const GalleryTheme* pThm, ExchangeDa // ----------------------------------------------------------------------------- -::std::vector< USHORT > GalleryBrowser1::ImplGetExecuteVector() +void GalleryBrowser1::ImplGetExecuteVector(::std::vector< USHORT >& o_aExec) { - ::std::vector< USHORT > aExecVector; GalleryTheme* pTheme = mpGallery->AcquireTheme( GetSelectedTheme(), *this ); if( pTheme ) @@ -281,23 +295,21 @@ void GalleryBrowser1::ImplFillExchangeData( const GalleryTheme* pThm, ExchangeDa bUpdateAllowed = bRenameAllowed = bRemoveAllowed = TRUE; if( bUpdateAllowed && pTheme->GetObjectCount() ) - aExecVector.push_back( MN_ACTUALIZE ); + o_aExec.push_back( MN_ACTUALIZE ); if( bRenameAllowed ) - aExecVector.push_back( MN_RENAME ); + o_aExec.push_back( MN_RENAME ); if( bRemoveAllowed ) - aExecVector.push_back( MN_DELETE ); + o_aExec.push_back( MN_DELETE ); if( bIdDialog && !pTheme->IsReadOnly() && !pTheme->IsImported() ) - aExecVector.push_back( MN_ASSIGN_ID ); + o_aExec.push_back( MN_ASSIGN_ID ); - aExecVector.push_back( MN_PROPERTIES ); + o_aExec.push_back( MN_PROPERTIES ); mpGallery->ReleaseTheme( pTheme, *this ); } - - return aExecVector; } // ----------------------------------------------------------------------------- @@ -584,7 +596,8 @@ BOOL GalleryBrowser1::KeyInput( const KeyEvent& rKEvt, Window* pWindow ) if( !bRet ) { - ::std::vector< USHORT > aExecVector( ImplGetExecuteVector() ); + ::std::vector< USHORT > aExecVector; + ImplGetExecuteVector(aExecVector); USHORT nExecuteId = 0; BOOL bMod1 = rKEvt.GetKeyCode().IsMod1(); @@ -648,9 +661,10 @@ BOOL GalleryBrowser1::KeyInput( const KeyEvent& rKEvt, Window* pWindow ) IMPL_LINK( GalleryBrowser1, ShowContextMenuHdl, void*, EMPTYARG ) { - ::std::vector< USHORT > aExecVector( ImplGetExecuteVector() ); + ::std::vector< USHORT > aExecVector; + ImplGetExecuteVector(aExecVector); - if( aExecVector.size() ) + if( !aExecVector.empty() ) { PopupMenu aMenu( GAL_RESID( RID_SVXMN_GALLERY1 ) ); diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx index 2903dcabef59..0d7dc9b33ef8 100644 --- a/svx/source/gallery2/galbrws1.hxx +++ b/svx/source/gallery2/galbrws1.hxx @@ -101,7 +101,7 @@ private: void ImplAdjustControls(); ULONG ImplInsertThemeEntry( const GalleryThemeEntry* pEntry ); void ImplFillExchangeData( const GalleryTheme* pThm, ExchangeData& rData ); - ::std::vector< USHORT > ImplGetExecuteVector(); + void ImplGetExecuteVector(::std::vector< USHORT >& o_aExec); void ImplExecute( USHORT nId ); void ImplGalleryThemeProperties( const String & rThemeName, bool bCreateNew ); void ImplEndGalleryThemeProperties( VclAbstractDialog2* pDialog, bool bCreateNew ); diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 045b52aa2e53..2a8bc6410f32 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -91,12 +91,15 @@ public: }; // ------------------------------------------------------------------------ +DBG_NAME(GalleryBackgroundPopup) GalleryBackgroundPopup::GalleryBackgroundPopup( const GalleryTheme* pTheme, ULONG nObjectPos ) : SfxControllerItem ( SID_GALLERY_BG_BRUSH, SfxViewFrame::Current()->GetBindings() ), mpTheme ( pTheme ), mnObjectPos ( nObjectPos ) { + DBG_CTOR(GalleryBackgroundPopup,NULL); + SfxViewFrame::Current()->GetBindings().Update( SID_GALLERY_BG_BRUSH ); RemoveDisabledEntries(); } @@ -105,6 +108,8 @@ GalleryBackgroundPopup::GalleryBackgroundPopup( const GalleryTheme* pTheme, ULON GalleryBackgroundPopup::~GalleryBackgroundPopup() { + + DBG_DTOR(GalleryBackgroundPopup,NULL); } // ------------------------------------------------------------------------ @@ -171,6 +176,7 @@ public: }; // ------------------------------------------------------------------------ +DBG_NAME(GalleryThemePopup) GalleryThemePopup::GalleryThemePopup( const GalleryTheme* pTheme, ULONG nObjectPos, BOOL bPreview ) : PopupMenu ( GAL_RESID( RID_SVXMN_GALLERY2 ) ), @@ -180,6 +186,8 @@ GalleryThemePopup::GalleryThemePopup( const GalleryTheme* pTheme, ULONG nObjectP mnObjectPos ( nObjectPos ), mbPreview ( bPreview ) { + DBG_CTOR(GalleryThemePopup,NULL); + const SgaObjKind eObjKind = mpTheme->GetObjectKind( mnObjectPos ); PopupMenu* pAddMenu = GetPopupMenu( MN_ADDMENU ); SfxBindings& rBindings = SfxViewFrame::Current()->GetBindings(); @@ -258,6 +266,8 @@ GalleryThemePopup::GalleryThemePopup( const GalleryTheme* pTheme, ULONG nObjectP GalleryThemePopup::~GalleryThemePopup() { + + DBG_DTOR(GalleryThemePopup,NULL); } // ------------------------------------------------------------------------ @@ -278,16 +288,21 @@ void GalleryThemePopup::StateChanged( USHORT nSID, SfxItemState eState, const Sf // ------------------ // - GalleryToolBox - // ------------------ +DBG_NAME(GalleryToolBox) GalleryToolBox::GalleryToolBox( GalleryBrowser2* pParent ) : ToolBox( pParent, WB_TABSTOP ) { + DBG_CTOR(GalleryToolBox,NULL); + } // ------------------------------------------------------------------------ GalleryToolBox::~GalleryToolBox() { + + DBG_DTOR(GalleryToolBox,NULL); } // ------------------------------------------------------------------------ @@ -301,6 +316,7 @@ void GalleryToolBox::KeyInput( const KeyEvent& rKEvt ) // ------------------- // - GalleryBrowser2 - // ------------------- +DBG_NAME(GalleryBrowser2) GalleryBrowser2::GalleryBrowser2( GalleryBrowser* pParent, const ResId& rResId, Gallery* pGallery ) : Control ( pParent, rResId ), @@ -317,6 +333,8 @@ GalleryBrowser2::GalleryBrowser2( GalleryBrowser* pParent, const ResId& rResId, meLastMode ( GALLERYBROWSERMODE_NONE ), mbCurActionIsLinkage( FALSE ) { + DBG_CTOR(GalleryBrowser2,NULL); + Image aDummyImage; const Link aSelectHdl( LINK( this, GalleryBrowser2, SelectObjectHdl ) ); Font aInfoFont( maInfoBar.GetControlFont() ); @@ -361,6 +379,8 @@ GalleryBrowser2::~GalleryBrowser2() if( mpCurTheme ) mpGallery->ReleaseTheme( mpCurTheme, *this ); + + DBG_DTOR(GalleryBrowser2,NULL); } // ----------------------------------------------------------------------------- diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index d6817134fefb..6ea957ee5c8c 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -54,6 +54,7 @@ // ------------------ // - GalleryPreview - // ------------------ +DBG_NAME(GalleryPreview) GalleryPreview::GalleryPreview( GalleryBrowser2* pParent, GalleryTheme* pTheme ) : Window( pParent, WB_TABSTOP | WB_BORDER ), @@ -61,6 +62,8 @@ GalleryPreview::GalleryPreview( GalleryBrowser2* pParent, GalleryTheme* pTheme ) DragSourceHelper( this ), mpTheme( pTheme ) { + DBG_CTOR(GalleryPreview,NULL); + SetHelpId( HID_GALLERY_WINDOW ); InitSettings(); } @@ -73,6 +76,8 @@ GalleryPreview::GalleryPreview( Window* pParent, const ResId & rResId ) : DragSourceHelper( this ), mpTheme( NULL ) { + DBG_CTOR(GalleryPreview,NULL); + SetHelpId( HID_GALLERY_PREVIEW ); InitSettings(); } @@ -81,6 +86,8 @@ GalleryPreview::GalleryPreview( Window* pParent, const ResId & rResId ) : GalleryPreview::~GalleryPreview() { + + DBG_DTOR(GalleryPreview,NULL); } @@ -300,6 +307,7 @@ void GalleryPreview::PreviewMedia( const INetURLObject& rURL ) // ------------------- // - GalleryIconView - // ------------------- +DBG_NAME(GalleryIconView) GalleryIconView::GalleryIconView( GalleryBrowser2* pParent, GalleryTheme* pTheme ) : ValueSet( pParent, WB_TABSTOP | WB_3DLOOK | WB_BORDER | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_VSCROLL | WB_FLATVALUESET ), @@ -307,6 +315,8 @@ GalleryIconView::GalleryIconView( GalleryBrowser2* pParent, GalleryTheme* pTheme DragSourceHelper( this ), mpTheme ( pTheme ) { + DBG_CTOR(GalleryIconView,NULL); + EnableFullItemMode( FALSE ); SetHelpId( HID_GALLERY_WINDOW ); @@ -320,6 +330,8 @@ GalleryIconView::GalleryIconView( GalleryBrowser2* pParent, GalleryTheme* pTheme GalleryIconView::~GalleryIconView() { + + DBG_DTOR(GalleryIconView,NULL); } // ------------------------------------------------------------------------ @@ -402,7 +414,7 @@ void GalleryIconView::UserDraw( const UserDrawEvent& rUDEvt ) aGraphic.Draw( pDev, aPos, aSize ); } - SetItemText( nId, GalleryBrowser2::GetItemText( *mpTheme, *pObj, GALLERY_ITEM_THEMENAME | GALLERY_ITEM_TITLE | GALLERY_ITEM_PATH ) ); + SetItemText( nId, GalleryBrowser2::GetItemText( *mpTheme, *pObj, GALLERY_ITEM_TITLE) ); mpTheme->ReleaseObject( pObj ); } } @@ -468,6 +480,7 @@ void GalleryIconView::StartDrag( sal_Int8, const Point& ) // ------------------- // - GalleryListView - // ------------------- +DBG_NAME(GalleryListView) GalleryListView::GalleryListView( GalleryBrowser2* pParent, GalleryTheme* pTheme ) : BrowseBox( pParent, WB_TABSTOP | WB_3DLOOK | WB_BORDER ), @@ -475,6 +488,8 @@ GalleryListView::GalleryListView( GalleryBrowser2* pParent, GalleryTheme* pTheme mnCurRow( 0 ), mbInit( FALSE ) { + DBG_CTOR(GalleryListView,NULL); + SetHelpId( HID_GALLERY_WINDOW ); InitSettings(); @@ -489,6 +504,8 @@ GalleryListView::GalleryListView( GalleryBrowser2* pParent, GalleryTheme* pTheme GalleryListView::~GalleryListView() { + + DBG_DTOR(GalleryListView,NULL); } // ------------------------------------------------------------------------ diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 9198f02278bb..147f1d2b856a 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -175,6 +175,8 @@ SvStream& operator>>( SvStream& rIn, GalleryImportThemeEntry& rEntry ) // - GalleryThemeCacheEntry - // -------------------------- +class GalleryThemeCacheEntry; +DBG_NAME(GalleryThemeCacheEntry) class GalleryThemeCacheEntry { private: @@ -185,8 +187,8 @@ private: public: GalleryThemeCacheEntry( const GalleryThemeEntry* pThemeEntry, GalleryTheme* pTheme ) : - mpThemeEntry( pThemeEntry ), mpTheme( pTheme ) {} - ~GalleryThemeCacheEntry() { delete mpTheme; } + mpThemeEntry( pThemeEntry ), mpTheme( pTheme ) {DBG_CTOR(GalleryThemeCacheEntry,NULL);} + ~GalleryThemeCacheEntry() { delete mpTheme;DBG_DTOR(GalleryThemeCacheEntry,NULL); } const GalleryThemeEntry* GetThemeEntry() const { return mpThemeEntry; } GalleryTheme* GetTheme() const { return mpTheme; } @@ -195,7 +197,6 @@ public: // ----------- // - Gallery - // ----------- - Gallery::Gallery( const String& rMultiPath ) : nReadTextEncoding ( gsl_getSystemTextEncoding() ) , nLastFileNumber ( 0 ) @@ -327,16 +328,20 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR if( xContentAccess.is() ) { + static const ::rtl::OUString s_sTitle(RTL_CONSTASCII_USTRINGPARAM("Title")); + static const ::rtl::OUString s_sIsReadOnly(RTL_CONSTASCII_USTRINGPARAM("IsReadOnly")); + static const ::rtl::OUString s_sSDG_EXT(RTL_CONSTASCII_USTRINGPARAM("sdg")); + static const ::rtl::OUString s_sSDV_EXT(RTL_CONSTASCII_USTRINGPARAM("sdv")); + while( xResultSet->next() ) { INetURLObject aThmURL( xContentAccess->queryContentIdentifierString() ); if(aThmURL.GetExtension().equalsIgnoreAsciiCaseAscii("thm")) { - INetURLObject aSdgURL( aThmURL); aSdgURL.SetExtension( OUString::createFromAscii( "sdg" ) ); - INetURLObject aSdvURL( aThmURL ); aSdvURL.SetExtension( OUString::createFromAscii( "sdv" ) ); - const OUString aTitleProp( OUString::createFromAscii( "Title" ) ); - const OUString aReadOnlyProp( OUString::createFromAscii( "IsReadOnly" ) ); + INetURLObject aSdgURL( aThmURL); aSdgURL.SetExtension( s_sSDG_EXT ); + INetURLObject aSdvURL( aThmURL ); aSdvURL.SetExtension( s_sSDV_EXT ); + OUString aTitle; sal_Bool bReadOnly = sal_False; @@ -348,7 +353,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR try { - aThmCnt.getPropertyValue( aTitleProp ) >>= aTitle; + aThmCnt.getPropertyValue( s_sTitle ) >>= aTitle; } catch( const uno::RuntimeException& ) { @@ -361,7 +366,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR { try { - aThmCnt.getPropertyValue( aReadOnlyProp ) >>= bReadOnly; + aThmCnt.getPropertyValue( s_sIsReadOnly ) >>= bReadOnly; } catch( const uno::RuntimeException& ) { @@ -374,7 +379,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR { try { - aSdgCnt.getPropertyValue( aTitleProp ) >>= aTitle; + aSdgCnt.getPropertyValue( s_sTitle ) >>= aTitle; } catch( const ::com::sun::star::uno::RuntimeException& ) { @@ -387,7 +392,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR { try { - aSdgCnt.getPropertyValue( aReadOnlyProp ) >>= bReadOnly; + aSdgCnt.getPropertyValue( s_sIsReadOnly ) >>= bReadOnly; } catch( const uno::RuntimeException& ) { @@ -402,7 +407,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR { try { - aSdvCnt.getPropertyValue( aTitleProp ) >>= aTitle; + aSdvCnt.getPropertyValue( s_sTitle ) >>= aTitle; } catch( const ::com::sun::star::uno::RuntimeException& ) { @@ -415,7 +420,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR { try { - aSdvCnt.getPropertyValue( aReadOnlyProp ) >>= bReadOnly; + aSdvCnt.getPropertyValue( s_sIsReadOnly ) >>= bReadOnly; } catch( const uno::RuntimeException& ) { @@ -594,7 +599,6 @@ String Gallery::GetThemeName( ULONG nThemeId ) const case( GALLERY_THEME_3D ): aFallback = "3D"; break; case( GALLERY_THEME_BULLETS ): aFallback = "Bullets"; break; case( GALLERY_THEME_HOMEPAGE ): aFallback = "Homepage"; break; - case( GALLERY_THEME_HTMLBUTTONS ): aFallback = "private://gallery/hidden/HtmlExportButtons"; break; case( GALLERY_THEME_POWERPOINT ): aFallback = "private://gallery/hidden/imgppt"; break; case( GALLERY_THEME_FONTWORK ): aFallback = "private://gallery/hidden/fontwork"; break; case( GALLERY_THEME_FONTWORK_VERTICAL ): aFallback = "private://gallery/hidden/fontworkvertical"; break; diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index 835c7dc3e731..239f1b63888e 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -399,10 +399,13 @@ BOOL KillFile( const INetURLObject& rURL ) // ------------------- // - GalleryProgress - // ------------------- +DBG_NAME(GalleryProgress) GalleryProgress::GalleryProgress( GraphicFilter* pFilter ) : mpFilter( pFilter ) { + DBG_CTOR(GalleryProgress,NULL); + uno::Reference< lang::XMultiServiceFactory > xMgr( ::utl::getProcessServiceFactory() ); if( xMgr.is() ) @@ -442,6 +445,8 @@ GalleryProgress::~GalleryProgress() { // if( mpFilter ) // mpFilter->SetUpdatePercentHdl( Link() ); + + DBG_DTOR(GalleryProgress,NULL); } // ------------------------------------------------------------------------ @@ -455,6 +460,7 @@ void GalleryProgress::Update( ULONG nVal, ULONG nMaxVal ) // ----------------------- // - GalleryTransferable - // ----------------------- +DBG_NAME(GalleryTransferable) GalleryTransferable::GalleryTransferable( GalleryTheme* pTheme, ULONG nObjectPos, bool bLazy ) : mpTheme( pTheme ), @@ -464,6 +470,8 @@ GalleryTransferable::GalleryTransferable( GalleryTheme* pTheme, ULONG nObjectPos mpImageMap( NULL ), mpURL( NULL ) { + DBG_CTOR(GalleryTransferable,NULL); + InitData( bLazy ); } @@ -471,6 +479,8 @@ GalleryTransferable::GalleryTransferable( GalleryTheme* pTheme, ULONG nObjectPos GalleryTransferable::~GalleryTransferable() { + + DBG_DTOR(GalleryTransferable,NULL); } // ------------------------------------------------------------------------ diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index 39aceac564ad..f8c673e1bb9b 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -320,10 +320,13 @@ void SgaObjectBmp::ReadData( SvStream& rIn, UINT16& rReadVersion ) // ------------------ // - SgaObjectSound - // ------------------ +DBG_NAME(SgaObjectSound) SgaObjectSound::SgaObjectSound() : eSoundType( SOUND_STANDARD ) { + DBG_CTOR(SgaObjectSound,NULL); + } // ------------------------------------------------------------------------ @@ -331,6 +334,8 @@ SgaObjectSound::SgaObjectSound() : SgaObjectSound::SgaObjectSound( const INetURLObject& rURL ) : eSoundType( SOUND_STANDARD ) { + DBG_CTOR(SgaObjectSound,NULL); + if( FileExists( rURL ) ) { aURL = rURL; @@ -345,6 +350,8 @@ SgaObjectSound::SgaObjectSound( const INetURLObject& rURL ) : SgaObjectSound::~SgaObjectSound() { + + DBG_DTOR(SgaObjectSound,NULL); } // ------------------------------------------------------------------------ @@ -453,10 +460,13 @@ SgaObjectSvDraw::SgaObjectSvDraw( const FmFormModel& rModel, const INetURLObject } // ------------------------------------------------------------------------ +DBG_NAME(SvxGalleryDrawModel) SvxGalleryDrawModel::SvxGalleryDrawModel() : mpFormModel( 0 ) { + DBG_CTOR(SvxGalleryDrawModel,NULL); + const String sFactoryURL(RTL_CONSTASCII_USTRINGPARAM("sdraw")); mxDoc = SfxObjectShell::CreateObjectByFactoryName( sFactoryURL ); @@ -484,6 +494,8 @@ SvxGalleryDrawModel::~SvxGalleryDrawModel() { if( mxDoc.Is() ) mxDoc->DoClose(); + + DBG_DTOR(SvxGalleryDrawModel,NULL); } // ------------------------------------------------------------------------ diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 730c1179a07e..6dac8837adbb 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -72,6 +72,7 @@ using namespace ::com::sun::star; // ------------ // - SgaTheme - // ------------ +DBG_NAME(GalleryTheme) GalleryTheme::GalleryTheme( Gallery* pGallery, GalleryThemeEntry* pThemeEntry ) : pParent ( pGallery ), @@ -81,6 +82,8 @@ GalleryTheme::GalleryTheme( Gallery* pGallery, GalleryThemeEntry* pThemeEntry ) nDragPos ( 0 ), bDragging ( FALSE ) { + DBG_CTOR(GalleryTheme,NULL); + ImplCreateSvDrawStorage(); if( pThm->IsImported() ) @@ -99,6 +102,8 @@ GalleryTheme::~GalleryTheme() delete pEntry; Broadcast( GalleryHint( GALLERY_HINT_OBJECT_REMOVED, GetName(), reinterpret_cast< ULONG >( pEntry ) ) ); } + + DBG_DTOR(GalleryTheme,NULL); } // ------------------------------------------------------------------------ @@ -1187,18 +1192,13 @@ BOOL GalleryTheme::InsertFileOrDirURL( const INetURLObject& rFileOrDirURL, ULONG uno::Sequence< OUString > aProps( 1 ); aProps.getArray()[ 0 ] = OUString::createFromAscii( "Url" ); uno::Reference< sdbc::XResultSet > xResultSet( aCnt.createCursor( aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) ); - - if( xResultSet.is() ) + uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY ); + if( xContentAccess.is() ) { - uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY ); - - if( xContentAccess.is() ) + while( xResultSet->next() ) { - while( xResultSet->next() ) - { - aURL.SetSmartURL( xContentAccess->queryContentIdentifierString() ); - aURLVector.push_back( aURL ); - } + aURL.SetSmartURL( xContentAccess->queryContentIdentifierString() ); + aURLVector.push_back( aURL ); } } } diff --git a/svx/source/gallery2/galtheme.src b/svx/source/gallery2/galtheme.src index bfb1f65d0340..0c1771cac440 100644 --- a/svx/source/gallery2/galtheme.src +++ b/svx/source/gallery2/galtheme.src @@ -127,14 +127,6 @@ String RID_GALLERYSTR_THEME_SURFACES // ----------------------------------------------------------------------------- -String RID_GALLERYSTR_THEME_HTMLBUTTONS -{ - // !!! Don't translate, please !!! - Text = "private://gallery/hidden/HtmlExportButtons"; -}; - -// ----------------------------------------------------------------------------- - String RID_GALLERYSTR_THEME_POWERPOINT { // !!! Don't translate, please !!! diff --git a/svx/source/sdr/contact/objectcontact.cxx b/svx/source/sdr/contact/objectcontact.cxx index bda2e1529988..c0ba5cec6bb8 100644 --- a/svx/source/sdr/contact/objectcontact.cxx +++ b/svx/source/sdr/contact/objectcontact.cxx @@ -66,7 +66,7 @@ namespace sdr std::vector< ViewObjectContact* > aLocalVOCList(maViewObjectContactVector); maViewObjectContactVector.clear(); - while(aLocalVOCList.size()) + while(!aLocalVOCList.empty()) { ViewObjectContact* pCandidate = aLocalVOCList.back(); aLocalVOCList.pop_back(); diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx index 3057acf55df1..3d6bd2d79a5a 100644 --- a/svx/source/sdr/contact/viewcontact.cxx +++ b/svx/source/sdr/contact/viewcontact.cxx @@ -82,7 +82,7 @@ namespace sdr std::vector< ViewObjectContact* > aLocalVOCList(maViewObjectContactVector); maViewObjectContactVector.clear(); - while(aLocalVOCList.size()) + while(!aLocalVOCList.empty()) { ViewObjectContact* pCandidate = aLocalVOCList.back(); aLocalVOCList.pop_back(); @@ -147,7 +147,7 @@ namespace sdr { maViewObjectContactVector.erase(aFindResult); - if(0 == maViewObjectContactVector.size()) + if(maViewObjectContactVector.empty()) { // This may need to get asynchron later since it eventually triggers // deletes of OCs where the VOC is still added. diff --git a/svx/source/sdr/contact/viewcontactofsdrobj.cxx b/svx/source/sdr/contact/viewcontactofsdrobj.cxx index 3b002e406be1..c06bb7f25b0e 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobj.cxx @@ -173,7 +173,7 @@ namespace sdr aGluepointVector.push_back(basegfx::B2DPoint(aPosition.X(), aPosition.Y())); } - if(aGluepointVector.size()) + if(!aGluepointVector.empty()) { const basegfx::BColor aBackPen(1.0, 1.0, 1.0); const basegfx::BColor aRGBFrontColor(0.0, 0.0, 1.0); // COL_LIGHTBLUE diff --git a/svx/source/sdr/event/eventhandler.cxx b/svx/source/sdr/event/eventhandler.cxx index 967b6fefe949..e65dfe927fda 100644 --- a/svx/source/sdr/event/eventhandler.cxx +++ b/svx/source/sdr/event/eventhandler.cxx @@ -83,7 +83,7 @@ namespace sdr BaseEvent* EventHandler::GetEvent() { - if(maVector.size()) + if(!maVector.empty()) { // get the last event, that one is fastest to be removed return maVector.back(); @@ -100,7 +100,7 @@ namespace sdr EventHandler::~EventHandler() { - while(maVector.size()) + while(!maVector.empty()) { delete GetEvent(); } diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx index e9464bdee09b..0e9f61d9b03a 100644 --- a/svx/source/sdr/overlay/overlayobjectlist.cxx +++ b/svx/source/sdr/overlay/overlayobjectlist.cxx @@ -83,7 +83,7 @@ namespace sdr bool OverlayObjectList::isHitLogic(const basegfx::B2DPoint& rLogicPosition, double fLogicTolerance) const { - if(maVector.size()) + if(!maVector.empty()) { OverlayObjectVector::const_iterator aStart(maVector.begin()); sdr::overlay::OverlayObject* pFirst = *aStart; @@ -134,7 +134,7 @@ namespace sdr bool OverlayObjectList::isHitPixel(const Point& rDiscretePosition, sal_uInt32 nDiscreteTolerance) const { - if(maVector.size()) + if(!maVector.empty()) { OverlayObjectVector::const_iterator aStart(maVector.begin()); sdr::overlay::OverlayObject* pCandidate = *aStart; @@ -164,7 +164,7 @@ namespace sdr { basegfx::B2DRange aRetval; - if(maVector.size()) + if(!maVector.empty()) { OverlayObjectVector::const_iterator aStart(maVector.begin()); diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 058ba94cf3a6..7c95bfc98213 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -247,7 +247,7 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragEntryPointGlueDrag::create { drawinglayer::primitive2d::Primitive2DSequence aRetval; - if(maPositions.size()) + if(!maPositions.empty()) { basegfx::B2DPolygon aPolygon; sal_uInt32 a(0); @@ -499,7 +499,7 @@ void SdrDragMethod::createSdrDragEntries_PointDrag() } } - if(aPositions.size()) + if(!aPositions.empty()) { addSdrDragEntry(new SdrDragEntryPointGlueDrag(aPositions, true)); } @@ -543,7 +543,7 @@ void SdrDragMethod::createSdrDragEntries_GlueDrag() } } - if(aPositions.size()) + if(!aPositions.empty()) { addSdrDragEntry(new SdrDragEntryPointGlueDrag(aPositions, false)); } @@ -670,14 +670,14 @@ void SdrDragMethod::CancelSdrDrag() void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlayManager) { // create SdrDragEntries on demand - if(!maSdrDragEntries.size()) + if(maSdrDragEntries.empty()) { createSdrDragEntries(); } // if there are entries, derive OverlayObjects from the entries, including // modification from current interactive state - if(maSdrDragEntries.size()) + if(!maSdrDragEntries.empty()) { drawinglayer::primitive2d::Primitive2DSequence aResult; drawinglayer::primitive2d::Primitive2DSequence aResultTransparent; diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index d2c1e7bc52ef..5b674f7a4160 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -781,7 +781,7 @@ void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark) } // fire scene updaters - while(aUpdaters.size()) + while(!aUpdaters.empty()) { delete aUpdaters.back(); aUpdaters.pop_back(); @@ -790,7 +790,7 @@ void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark) if( !bUndo ) { // now delete removed scene objects - while(aRemoved3DObjects.size()) + while(!aRemoved3DObjects.empty()) { SdrObject::Free( aRemoved3DObjects.back() ); aRemoved3DObjects.pop_back(); @@ -836,7 +836,7 @@ void SdrEditView::DeleteMarkedObj() if(pParent) { - if(aParents.size()) + if(!aParents.empty()) { std::vector< SdrObject* >::iterator aFindResult = std::find(aParents.begin(), aParents.end(), pParent); @@ -853,7 +853,7 @@ void SdrEditView::DeleteMarkedObj() } } - if(aParents.size()) + if(!aParents.empty()) { // in a 2nd run, remove all objects which may already be scheduled for // removal. I am not sure if this can happen, but theoretically diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 9e149bd8e42d..dbd76913765c 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -318,7 +318,7 @@ void SdrEditView::RotateMarkedObj(const Point& rRef, long nWink, bool bCopy) } // fire scene updaters - while(aUpdaters.size()) + while(!aUpdaters.empty()) { delete aUpdaters.back(); aUpdaters.pop_back(); @@ -378,7 +378,7 @@ void SdrEditView::MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool b } // fire scene updaters - while(aUpdaters.size()) + while(!aUpdaters.empty()) { delete aUpdaters.back(); aUpdaters.pop_back(); @@ -1051,7 +1051,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, BOOL bReplaceAll) { SdrTextObj* pTextObj = ((SdrTextObj*)pObj); - if(0 != aCharWhichIds.size()) + if(!aCharWhichIds.empty()) { Rectangle aOldBoundRect = pTextObj->GetLastBoundRect(); @@ -1079,7 +1079,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, BOOL bReplaceAll) } // fire scene updaters - while(aUpdaters.size()) + while(!aUpdaters.empty()) { delete aUpdaters.back(); aUpdaters.pop_back(); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 6a8221136f7c..d0703e73d152 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2438,7 +2438,7 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat ) aRect1 = Rectangle( rStat.GetNow(), Size( nDefaultObjectSizeWidth, nDefaultObjectSizeHeight ) ); // subtracting the horizontal difference of the latest handle from shape position - if ( aInteractionHandles.size() ) + if ( !aInteractionHandles.empty() ) { sal_Int32 nHandlePos = aInteractionHandles[ aInteractionHandles.size() - 1 ].xInteraction->getPosition().X; aRect1.Move( aRect.Left() - nHandlePos, 0 ); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 18e04f648725..1d8b6ea06cb9 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2440,7 +2440,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas // #i102241# check for line results const std::vector< basegfx::B2DPolygon >& rHairlineVector = aExtractor.getExtractedHairlines(); - if(rHairlineVector.size()) + if(!rHairlineVector.empty()) { // for SdrObject creation, just copy all to a single Hairline-PolyPolygon for(sal_uInt32 a(0); a < rHairlineVector.size(); a++) @@ -2452,7 +2452,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, BOOL bForceLineDas // #i102241# check for fill rsults const std::vector< basegfx::B2DPolyPolygon >& rLineFillVector(aExtractor.getExtractedLineFills()); - if(rLineFillVector.size()) + if(!rLineFillVector.empty()) { // merge to a single PolyPolygon (OR) aMergedLineFillPolyPolygon = basegfx::tools::mergeToSinglePolyPolygon(rLineFillVector); diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 9bc3bbb4958c..0ef0732ac80d 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -491,7 +491,7 @@ namespace { // only create a line primitive when we had content; there is no need for // empty line primitives (contrary to paragraphs, see below). - if(maTextPortionPrimitives.size()) + if(!maTextPortionPrimitives.empty()) { drawinglayer::primitive2d::Primitive2DSequence aLineSequence(impConvertVectorToPrimitive2DSequence(maTextPortionPrimitives)); maTextPortionPrimitives.clear(); @@ -658,13 +658,13 @@ namespace drawinglayer::primitive2d::Primitive2DSequence impTextBreakupHandler::getPrimitive2DSequence() { - if(maTextPortionPrimitives.size()) + if(!maTextPortionPrimitives.empty()) { // collect non-closed lines impFlushTextPortionPrimitivesToLinePrimitives(); } - if(maLinePrimitives.size()) + if(!maLinePrimitives.empty()) { // collect non-closed paragraphs impFlushLinePrimitivesToParagraphPrimitives(); diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index 178af85d2cf4..a534ca35743f 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -200,7 +200,7 @@ namespace mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decompositionPathTextPrimitive)); mrOutliner.StripPortions(); - if(maPathTextPortions.size()) + if(!maPathTextPortions.empty()) { // sort portions by paragraph, x and y ::std::sort(maPathTextPortions.begin(), maPathTextPortions.end()); @@ -627,7 +627,7 @@ namespace // get text outlines and their object transformation pTextCandidate->getTextOutlinesAndTransformation(aB2DPolyPolyVector, aPolygonTransform); - if(aB2DPolyPolyVector.size()) + if(!aB2DPolyPolyVector.empty()) { // create stroke primitives std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aStrokePrimitives; @@ -712,7 +712,7 @@ void SdrTextObj::impDecomposePathTextPrimitive( impTextBreakupHandler aConverter(rOutliner); const ::std::vector< impPathTextPortion > rPathTextPortions = aConverter.decompositionPathTextPrimitive(); - if(rPathTextPortions.size()) + if(!rPathTextPortions.empty()) { // get FormText and polygon values const drawinglayer::attribute::SdrFormTextAttribute& rFormTextAttribute = rSdrPathTextPrimitive.getSdrFormTextAttribute(); @@ -753,7 +753,7 @@ void SdrTextObj::impDecomposePathTextPrimitive( } // handle data pair polygon/ParagraphTextPortions - if(aParagraphTextPortions.size()) + if(!aParagraphTextPortions.empty()) { aPolygonParagraphHandler.HandlePair(rPathPolyPolygon.getB2DPolygon(a), aParagraphTextPortions); } diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index 1d74ed119c33..24e66a577dff 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -308,7 +308,7 @@ SdrPaintView::~SdrPaintView() #endif // delete existing SdrPaintWindows - while(maPaintWindows.size()) + while(!maPaintWindows.empty()) { delete maPaintWindows.back(); maPaintWindows.pop_back(); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index bd0a39200dd1..70c148de0fec 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2239,7 +2239,7 @@ Window* SvxStyleToolBoxControl::CreateItemWindow( Window *pParent ) pImpl->aClearForm, pImpl->aMore, pImpl->bSpecModeWriter || pImpl->bSpecModeCalc ); - if( pImpl->aDefaultStyles.size()) + if( !pImpl->aDefaultStyles.empty()) pBox->SetDefaultStyle( pImpl->aDefaultStyles[0] ); // Set visibility listener to bind/unbind controller pBox->SetVisibilityListener( LINK( this, SvxStyleToolBoxControl, VisibilityNotification )); diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 440f6c313e20..2cd1bcc42695 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -819,11 +819,11 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, aShapes.push_back( pObj ); } - if( 0 == aShapes.size() ) + if( aShapes.empty() ) bRet = false; } - if( bRet && aShapes.size() ) + if( bRet && !aShapes.empty() ) { // special treatment for only one SdrGrafObj that has text sal_Bool bSingleGraphic = sal_False; @@ -949,7 +949,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, } } - if(aShapes.size()) + if(!aShapes.empty()) { // more effective way to paint a vector of SdrObjects. Hand over the processed page // to have it in the -- cgit v1.2.3 From 9ab3d588a12450ac9bc33db6b94b03b95592ae20 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Tue, 8 Feb 2011 12:29:15 +0100 Subject: impress210: #i105310# set tooltip for items and some refactoring --- sd/source/core/CustomAnimationPreset.cxx | 4 ++-- sd/source/filter/html/htmlex.hxx | 2 -- sd/source/ui/animations/CustomAnimationPane.cxx | 2 +- sd/source/ui/dlg/SpellDialogChildWindow.cxx | 2 +- sd/source/ui/dlg/dlgass.cxx | 4 ++-- .../configuration/ConfigurationControllerBroadcaster.cxx | 4 ++-- .../ui/framework/configuration/ConfigurationUpdater.cxx | 4 ++-- sd/source/ui/framework/configuration/ResourceId.cxx | 12 ++++++------ sd/source/ui/framework/factories/BasicViewFactory.cxx | 2 +- sd/source/ui/slidesorter/controller/SlsAnimator.cxx | 2 +- sd/source/ui/toolpanel/controls/DocumentHelper.cxx | 2 +- sd/source/ui/view/ViewTabBar.cxx | 2 +- 12 files changed, 20 insertions(+), 22 deletions(-) mode change 100644 => 100755 sd/source/core/CustomAnimationPreset.cxx diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx old mode 100644 new mode 100755 index fb02f01480e7..ab846e56aebb --- a/sd/source/core/CustomAnimationPreset.cxx +++ b/sd/source/core/CustomAnimationPreset.cxx @@ -645,7 +645,7 @@ Reference< XAnimationNode > CustomAnimationPresets::getRandomPreset( sal_Int16 n sal_Int32 nCategory = (rand() * pCategoryList->size() / RAND_MAX); PresetCategoryPtr pCategory = (*pCategoryList)[nCategory]; - if( pCategory.get() && pCategory->maEffects.size() ) + if( pCategory.get() && !pCategory->maEffects.empty() ) { sal_Int32 nDescriptor = (rand() * pCategory->maEffects.size() / RAND_MAX); CustomAnimationPresetPtr pPreset = pCategory->maEffects[nDescriptor]; @@ -654,7 +654,7 @@ Reference< XAnimationNode > CustomAnimationPresets::getRandomPreset( sal_Int16 n UStringList aSubTypes = pPreset->getSubTypes(); OUString aSubType; - if( aSubTypes.size() ) + if( !aSubTypes.empty() ) { sal_Int32 nSubType = (rand() * aSubTypes.size() / RAND_MAX); aSubType = aSubTypes[nSubType]; diff --git a/sd/source/filter/html/htmlex.hxx b/sd/source/filter/html/htmlex.hxx index 43bc12419f84..de6771bcf0c3 100755 --- a/sd/source/filter/html/htmlex.hxx +++ b/sd/source/filter/html/htmlex.hxx @@ -59,8 +59,6 @@ #define PUB_HIGHRES_WIDTH 1024 #define PUB_HIGHRES_HEIGHT 768 -#define HtmlButtonThemaStr = "private://gallery/hidden/HtmlExportButtons"; - class List; class SfxProgress; class SdrOutliner; diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 2d70316c1432..64403f24a08a 100755 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -2044,7 +2044,7 @@ void CustomAnimationPane::createPath( PathKind eKind, std::vector< Any >& rTarge void CustomAnimationPane::onRemove() { - if( maListSelection.size() ) + if( !maListSelection.empty() ) { addUndo(); diff --git a/sd/source/ui/dlg/SpellDialogChildWindow.cxx b/sd/source/ui/dlg/SpellDialogChildWindow.cxx index 7aee12f23bbd..1a4700429ca3 100755 --- a/sd/source/ui/dlg/SpellDialogChildWindow.cxx +++ b/sd/source/ui/dlg/SpellDialogChildWindow.cxx @@ -108,7 +108,7 @@ void SpellDialogChildWindow::InvalidateSpellDialog (void) // Close the spell check dialog when there are no more sentences to // check. - if (aResult.size() == 0) + if (aResult.empty()) { SfxBoolItem aItem (SID_SPELL_DIALOG, FALSE); GetBindings().GetDispatcher()->Execute( diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 4645b3540f04..3841a92f5a17 100755 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -907,7 +907,7 @@ void AssistentDlgImpl::TemplateScanDone ( // HACK! presnt directory is always initially selected. // We have to look at the first entry to get a URL. - if (pDir->maEntries.size() > 0) + if (!pDir->maEntries.empty() ) { TemplateEntry* pEntry = pDir->maEntries.front(); if (pEntry != NULL) @@ -932,7 +932,7 @@ void AssistentDlgImpl::TemplateScanDone ( // HACK! layout directory is always initially selected. // We have to look at the first entry to get a URL. - if (pDir->maEntries.size() > 0) + if (!pDir->maEntries.empty() ) { TemplateEntry* pEntry = pDir->maEntries.front(); if (pEntry != NULL) diff --git a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx index ff167f07520a..6056d434068c 100755 --- a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx @@ -184,14 +184,14 @@ void ConfigurationControllerBroadcaster::DisposeAndClear (void) { lang::EventObject aEvent; aEvent.Source = mxConfigurationController; - while (maListenerMap.size() > 0) + while (!maListenerMap.empty()) { ListenerMap::iterator iMap (maListenerMap.begin()); if (iMap == maListenerMap.end()) break; // When the first vector is empty then remove it from the map. - if (iMap->second.size() == 0) + if (iMap->second.empty()) { maListenerMap.erase(iMap); continue; diff --git a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx index 4ab361a9490d..78d1e394c94a 100755 --- a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx @@ -256,7 +256,7 @@ void ConfigurationUpdater::CleanRequestedConfiguration (void) // Request the deactivation of pure anchors that have no child. vector > aResourcesToDeactivate; CheckPureAnchors(mxRequestedConfiguration, aResourcesToDeactivate); - if (aResourcesToDeactivate.size() > 0) + if (!aResourcesToDeactivate.empty() ) { Reference xCC ( mxControllerManager->getConfigurationController()); @@ -327,7 +327,7 @@ void ConfigurationUpdater::UpdateCore (const ConfigurationClassifier& rClassifie // Deactivate pure anchors that have no child. vector > aResourcesToDeactivate; CheckPureAnchors(mxCurrentConfiguration, aResourcesToDeactivate); - if (aResourcesToDeactivate.size() > 0) + if (!aResourcesToDeactivate.empty() ) mpResourceManager->DeactivateResources(aResourcesToDeactivate, mxCurrentConfiguration); } catch(RuntimeException) diff --git a/sd/source/ui/framework/configuration/ResourceId.cxx b/sd/source/ui/framework/configuration/ResourceId.cxx index 15d7c3a6f4ec..25be1d1dfaf2 100755 --- a/sd/source/ui/framework/configuration/ResourceId.cxx +++ b/sd/source/ui/framework/configuration/ResourceId.cxx @@ -183,7 +183,7 @@ OUString SAL_CALL ResourceId::getResourceURL (void) throw(com::sun::star::uno::RuntimeException) { - if (maResourceURLs.size() > 0) + if (!maResourceURLs.empty()) return maResourceURLs[0]; else return OUString(); @@ -200,7 +200,7 @@ util::URL SAL_CALL return *mpURL; Reference xURLTransformer (mxURLTransformerWeak); - if (xURLTransformer.is() && maResourceURLs.size() > 0) + if (xURLTransformer.is() && !maResourceURLs.empty() ) { mpURL.reset(new util::URL); mpURL->Complete = maResourceURLs[0]; @@ -209,7 +209,7 @@ util::URL SAL_CALL } util::URL aURL; - if (maResourceURLs.size() > 0) + if (!maResourceURLs.empty()) aURL.Complete = maResourceURLs[0]; return aURL; } @@ -268,7 +268,7 @@ OUString SAL_CALL ResourceId::getResourceTypePrefix (void) throw (RuntimeException) { - if (maResourceURLs.size() > 0) + if (!maResourceURLs.empty() ) { // Return the "private:resource//" prefix. @@ -298,7 +298,7 @@ sal_Int16 SAL_CALL if ( ! rxResourceId.is()) { // The empty reference is interpreted as empty resource id object. - if (maResourceURLs.size() > 0) + if (!maResourceURLs.empty()) nResult = +1; else nResult = 0; @@ -610,7 +610,7 @@ void ResourceId::ParseResourceURL (void) Reference(xURLTransformer,UNO_QUERY)); } - if (xURLTransformer.is() && maResourceURLs.size() > 0) + if (xURLTransformer.is() && !maResourceURLs.empty() ) { mpURL.reset(new util::URL); mpURL->Complete = maResourceURLs[0]; diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx index 2dd7689f2b39..be9086a7b19c 100755 --- a/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -523,7 +523,7 @@ bool BasicViewFactory::IsCacheable (const ::boost::shared_ptr& r if (xResource.is()) { static ::std::vector > maCacheableResources; - if (maCacheableResources.size() == 0) + if (maCacheableResources.empty() ) { ::boost::shared_ptr pHelper (FrameworkHelper::Instance(*mpBase)); diff --git a/sd/source/ui/slidesorter/controller/SlsAnimator.cxx b/sd/source/ui/slidesorter/controller/SlsAnimator.cxx index 28756b3766d9..dfc672e33802 100755 --- a/sd/source/ui/slidesorter/controller/SlsAnimator.cxx +++ b/sd/source/ui/slidesorter/controller/SlsAnimator.cxx @@ -303,7 +303,7 @@ IMPL_LINK(Animator, TimeoutHandler, Timer*, EMPTYARG) // Unlock the draw lock. This should lead to a repaint. mpDrawLock.reset(); - if (maAnimations.size() > 0) + if (!maAnimations.empty()) RequestNextFrame(); return 0; diff --git a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx index f7d470e56333..844257b1b9e2 100755 --- a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx +++ b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx @@ -338,7 +338,7 @@ void DocumentHelper::AssignMasterPageToPageList ( aCleanedList.push_back(*iPage); } } - if (aCleanedList.size() == 0) + if (aCleanedList.empty() ) break; ::svl::IUndoManager* pUndoMgr = rTargetDocument.GetDocSh()->GetUndoManager(); diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx index a12412bf7f7d..8f14042d23b4 100755 --- a/sd/source/ui/view/ViewTabBar.cxx +++ b/sd/source/ui/view/ViewTabBar.cxx @@ -486,7 +486,7 @@ int ViewTabBar::GetHeight (void) { int nHeight (0); - if (maTabBarButtons.size() > 0) + if (!maTabBarButtons.empty()) { TabPage* pActivePage (mpTabControl->GetTabPage( mpTabControl->GetCurPageId())); -- cgit v1.2.3 From ad875044d10a74e092aa3b89989fd94f343da844 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Tue, 8 Feb 2011 12:38:25 +0100 Subject: impress210: #i115617# set zoom to fit_to_window --- avmedia/source/gstreamer/gstplayer.cxx | 1 + avmedia/source/gstreamer/gstplayer.hxx | 5 +++-- avmedia/source/win/player.cxx | 3 ++- avmedia/source/win/player.hxx | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index e5bff43f95cc..06ca9bef2ca2 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -70,6 +70,7 @@ struct GstBusSource : public GSource // - Player - // --------------- Player::Player( GString* pURI ) : + Player_BASE(m_aMutex), mpMutex( g_mutex_new() ), mpCond( g_cond_new() ), mpThread( NULL ), diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx index 4b73e898a4bf..8388f00b9f15 100644 --- a/avmedia/source/gstreamer/gstplayer.hxx +++ b/avmedia/source/gstreamer/gstplayer.hxx @@ -58,10 +58,11 @@ class Window; // --------------- // - Player_Impl - // --------------- +typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer, + ::com::sun::star::lang::XServiceInfo > Player_BASE; class Player : public cppu::BaseMutex, - public ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer, - ::com::sun::star::lang::XServiceInfo > + public Player_BASE { public: diff --git a/avmedia/source/win/player.cxx b/avmedia/source/win/player.cxx index a0f678327b03..e5c010dc258a 100644 --- a/avmedia/source/win/player.cxx +++ b/avmedia/source/win/player.cxx @@ -70,6 +70,7 @@ bool isWindowsVistaOrHigher() // ---------------- Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : + Player_BASE(m_aMutex), mxMgr( rxMgr ), mpGB( NULL ), mpOMF( NULL ), @@ -99,7 +100,7 @@ Player::~Player() void SAL_CALL Player::disposing() { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); stop(); if( mpBA ) mpBA->Release(); diff --git a/avmedia/source/win/player.hxx b/avmedia/source/win/player.hxx index 523d2800b150..d0c40e274f92 100644 --- a/avmedia/source/win/player.hxx +++ b/avmedia/source/win/player.hxx @@ -53,10 +53,11 @@ namespace avmedia { namespace win { // ---------- // - Player - // ---------- +typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer, + ::com::sun::star::lang::XServiceInfo > Player_BASE; class Player : public cppu::BaseMutex, - public ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer, - ::com::sun::star::lang::XServiceInfo > + public Player_BASE { public: -- cgit v1.2.3 From 55cf933020ad39a3b691c400ff3df855e2c0c67f Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Tue, 8 Feb 2011 13:02:48 +0100 Subject: impress210: some unix fixes --- avmedia/source/gstreamer/gstframegrabber.cxx | 8 ++++++- avmedia/source/gstreamer/gstframegrabber.hxx | 6 ++--- avmedia/source/gstreamer/gstplayer.cxx | 34 ++++++++++++++-------------- avmedia/source/gstreamer/gstplayer.hxx | 4 ++-- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx index bd55e11f8afe..432054e95ae9 100644 --- a/avmedia/source/gstreamer/gstframegrabber.cxx +++ b/avmedia/source/gstreamer/gstframegrabber.cxx @@ -42,12 +42,18 @@ const gulong GRAB_TIMEOUT = 10000000; // ---------------- FrameGrabber::FrameGrabber( GString* pURI ) : - Player( pURI ), mpFrameMutex( g_mutex_new() ), mpFrameCond( g_cond_new() ), mpLastPixbuf( NULL ), mbIsInGrabMode( false ) { + if( pURI ) + { + OSL_TRACE( ">>> --------------------------------" ); + OSL_TRACE( ">>> Creating Player object with URL: %s", pURI->str ); + + mpThread = g_thread_create( Player::implThreadFunc, this, true, NULL ); + } } // ------------------------------------------------------------------------------ diff --git a/avmedia/source/gstreamer/gstframegrabber.hxx b/avmedia/source/gstreamer/gstframegrabber.hxx index 9a7ec1b74102..fac2e298fb2c 100644 --- a/avmedia/source/gstreamer/gstframegrabber.hxx +++ b/avmedia/source/gstreamer/gstframegrabber.hxx @@ -34,6 +34,7 @@ #ifndef _COM_SUN_STAR_MEDIA_XFRAMEGRABBER_HDL_ #include "com/sun/star/media/XFrameGrabber.hdl" #endif +#include namespace avmedia { namespace gst { @@ -41,9 +42,8 @@ namespace avmedia { namespace gst { // - FrameGrabber - // ---------------- -class FrameGrabber : public Player, - public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XFrameGrabber, - ::com::sun::star::lang::XServiceInfo > +class FrameGrabber : + public ::cppu::ImplInheritanceHelper1 < Player,::com::sun::star::media::XFrameGrabber > { public: diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index 06ca9bef2ca2..0e5ffcac0f01 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -189,7 +189,7 @@ Player* Player::create( const ::rtl::OUString& rURL ) void SAL_CALL Player::start() throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() && !isPlaying() ) { gst_element_set_state( mpPlayer, GST_STATE_PLAYING ); @@ -200,7 +200,7 @@ void SAL_CALL Player::start() void SAL_CALL Player::stop() throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() && isPlaying() ) { gst_element_set_state( mpPlayer, GST_STATE_PAUSED ); @@ -212,7 +212,7 @@ sal_Bool SAL_CALL Player::isPlaying() throw( uno::RuntimeException ) { GstState aState = GST_STATE_NULL; - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( mpPlayer ) { gst_element_get_state( mpPlayer, &aState, NULL, GST_MAX_TIMEOUT ); @@ -225,7 +225,7 @@ sal_Bool SAL_CALL Player::isPlaying() double SAL_CALL Player::getDuration() throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); gint64 nDuration = 0; if( implInitPlayer() ) @@ -247,7 +247,7 @@ double SAL_CALL Player::getDuration() void SAL_CALL Player::setMediaTime( double fTime ) throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() ) { fTime = ::std::min( ::std::max( fTime, 0.0 ), getDuration() ); @@ -263,7 +263,7 @@ double SAL_CALL Player::getMediaTime() throw( uno::RuntimeException ) { double fRet = 0.0; - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() ) { GstFormat aFormat = GST_FORMAT_TIME; @@ -303,7 +303,7 @@ double SAL_CALL Player::getStopTime() Currently no need for implementation since higher levels of code don't set a stop time ATM !!! TODO: needs to be fully implemented if this functionality is needed at a later point of time */ - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); return( getDuration() ); } @@ -334,7 +334,7 @@ double SAL_CALL Player::getRate() void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( bSet && !isPlaybackLoop() ) g_atomic_int_inc( &mnLooping ); else if( !bSet && isPlaybackLoop() ) @@ -345,7 +345,7 @@ void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) sal_Bool SAL_CALL Player::isPlaybackLoop() throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); return( g_atomic_int_get( &mnLooping ) > 0 ); } @@ -353,7 +353,7 @@ sal_Bool SAL_CALL Player::isPlaybackLoop() void SAL_CALL Player::setMute( sal_Bool bSet ) throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() && ( bSet != isMute() ) ) { if( bSet ) @@ -372,7 +372,7 @@ sal_Bool SAL_CALL Player::isMute() throw( uno::RuntimeException ) { gdouble fGstVolume = 1.0; - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() ) { @@ -386,7 +386,7 @@ sal_Bool SAL_CALL Player::isMute() void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() ) { g_mutex_lock( mpMutex ); @@ -405,7 +405,7 @@ void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) sal_Int16 SAL_CALL Player::getVolumeDB() throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); return( static_cast< sal_Int16 >( g_atomic_int_get( &mnVolumeDB ) ) ); } @@ -414,7 +414,7 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize() throw( uno::RuntimeException ) { awt::Size aSize( 0, 0 ); - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( implInitPlayer() && ( g_atomic_int_get( &mnIsVideoSource ) > 0 ) ) { @@ -439,7 +439,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( const uno::Sequence< uno::Any >& rArguments ) throw( uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); uno::Reference< ::media::XPlayerWindow > xRet; awt::Size aSize( getPreferredPlayerWindowSize() ); @@ -483,7 +483,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() throw( ::com::sun::star::uno::RuntimeException ) { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); FrameGrabber* pFrameGrabber = NULL; const awt::Size aPrefSize( getPreferredPlayerWindowSize() ); @@ -498,7 +498,7 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() // ------------------------------------------------------------------------------ void SAL_CALL Player::disposing() { - MutexGuard aGuard(m_aMutex); + ::osl::MutexGuard aGuard(m_aMutex); if( mpPlayer ) { stop(); diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx index 8388f00b9f15..7d40728840a6 100644 --- a/avmedia/source/gstreamer/gstplayer.hxx +++ b/avmedia/source/gstreamer/gstplayer.hxx @@ -70,7 +70,7 @@ public: static Player* create( const ::rtl::OUString& rURL ); ~Player(); -protected: +//protected: // XPlayer virtual void SAL_CALL start() throw( ::com::sun::star::uno::RuntimeException ); @@ -166,6 +166,7 @@ protected: return( g_atomic_int_get( &mnInitialized ) > 0 ); } + static gpointer implThreadFunc( gpointer pData ); private: @@ -186,7 +187,6 @@ private: static gboolean implIdleFunc( gpointer pData ); - static gpointer implThreadFunc( gpointer pData ); static GstBusSyncReply implHandleCreateWindowFunc( GstBus* pBus, GstMessage* pMsg, -- cgit v1.2.3 From 993a6287690df39c10539c3c474608c2ce73d507 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Wed, 9 Feb 2011 15:05:02 +0100 Subject: impress210: #i110321# check if pages exists for last page --- sd/source/ui/view/DocumentRenderer.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index b0248647b3dc..ea0b511bffbb 100755 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1949,7 +1949,7 @@ private: // Distribute pages to handout pages. ::std::vector aPageIndices; - std::vector aPagesVector; + for (USHORT nIndex=0, nCount= nPageCount, @@ -1966,8 +1966,7 @@ private: // Create a printer page when we have found one page for each // placeholder or when this is the last (and special) loop. - if (aPageIndices.size() == nShapeCount - || nIndex==nCount) + if (!aPageIndices.empty() && (aPageIndices.size() == nShapeCount || nIndex==nCount)) { maPrinterPages.push_back( ::boost::shared_ptr( -- cgit v1.2.3 From d68d1c274757c9ef7b84e00478576aa9ec44d5b7 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Tue, 15 Feb 2011 10:10:51 +0100 Subject: impress210: #i106378# use datetime to get current date --- sd/source/ui/annotations/annotationmanager.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 1e64617edab8..c7a026c1950d 100755 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -48,6 +48,8 @@ #include #include +#include + #include #include #include @@ -152,11 +154,8 @@ static SfxDispatcher* getDispatcher( ViewShellBase& rBase ) com::sun::star::util::DateTime getCurrentDateTime() { - TimeValue osltime; - osl_getSystemTime( &osltime ); - oslDateTime osldt; - osl_getDateTimeFromTimeValue( &osltime, &osldt ); - return com::sun::star::util::DateTime( 0, osldt.Seconds, osldt.Minutes, osldt.Hours, osldt.Day, osldt.Month, osldt.Year ); + DateTime aCurrentDate; + return com::sun::star::util::DateTime( 0, aCurrentDate.GetSec(), aCurrentDate.GetMin(), aCurrentDate.GetHour(), aCurrentDate.GetDay(), aCurrentDate.GetMonth(), aCurrentDate.GetYear() ); } OUString getAnnotationDateTimeString( const Reference< XAnnotation >& xAnnotation ) -- cgit v1.2.3 From b180cab3b3d48c86f5981ca04e08e6c7db861cd6 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Feb 2011 09:59:39 +0100 Subject: gridfixes: USHORT -> sal_uInt16 --- basic/source/app/brkpnts.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basic/source/app/brkpnts.cxx b/basic/source/app/brkpnts.cxx index e7687222d5da..2878d736e493 100644 --- a/basic/source/app/brkpnts.cxx +++ b/basic/source/app/brkpnts.cxx @@ -108,7 +108,7 @@ void BreakpointWindow::SetBPsInModule() { pModule->SetBP( (sal_uInt16)pBrk->nLine ); #if OSL_DEBUG_LEVEL > 1 - DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( (USHORT)pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" ); + DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( (sal_uInt16)pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" ); #endif pBrk = Next(); } -- cgit v1.2.3 From c53fb2d4ac0f9eab262ab97336f9f58a3f880fb3 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Feb 2011 10:42:53 +0100 Subject: gridfixes: don't be too generous with exceptions: avoid where possible (by checking beforehand), and assert when caught --- framework/source/fwe/classes/framelistanalyzer.cxx | 10 +++++-- framework/source/helper/titlebarupdate.cxx | 32 +++++----------------- framework/source/services/frame.cxx | 8 ++++-- .../uifactory/windowcontentfactorymanager.cxx | 5 ++-- sfx2/source/notify/eventsupplier.cxx | 15 ++++++---- 5 files changed, 33 insertions(+), 37 deletions(-) diff --git a/framework/source/fwe/classes/framelistanalyzer.cxx b/framework/source/fwe/classes/framelistanalyzer.cxx index 1a33ebf91d7e..1585fb7b1342 100644 --- a/framework/source/fwe/classes/framelistanalyzer.cxx +++ b/framework/source/fwe/classes/framelistanalyzer.cxx @@ -48,6 +48,7 @@ // includes of other projects #include #include +#include //_______________________________________________ // namespace @@ -153,7 +154,7 @@ void FrameListAnalyzer::impl_analyze() // check, if the reference frame includes the backing component. // But look, if this analyze step is realy needed. - if ((m_eDetectMode & E_BACKINGCOMPONENT) == E_BACKINGCOMPONENT) + if (((m_eDetectMode & E_BACKINGCOMPONENT) == E_BACKINGCOMPONENT) && m_xReferenceFrame.is() ) { try { @@ -162,8 +163,13 @@ void FrameListAnalyzer::impl_analyze() ::rtl::OUString sModule = xModuleMgr->identify(m_xReferenceFrame); m_bReferenceIsBacking = (sModule.equals(SERVICENAME_STARTMODULE)); } + catch(const css::frame::UnknownModuleException&) + { + } catch(const css::uno::Exception&) - {} + { + DBG_UNHANDLED_EXCEPTION(); + } } // check, if the reference frame includes the help module. diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx index 9b6501af4c20..a8282c135062 100644 --- a/framework/source/helper/titlebarupdate.cxx +++ b/framework/source/helper/titlebarupdate.cxx @@ -104,37 +104,15 @@ // other includes //_________________________________________________________________________________________________________________ -#ifndef _COMPHELPER_SEQUENCEASHASHMAP_HXX #include -#endif - -#ifndef _UTL_CONFIGMGR_HXX #include -#endif - -#ifndef _UTL_BOOTSTRAP_HXX #include -#endif - -#ifndef _SV_WINDOW_HXX #include -#endif - -#ifndef _SV_SYSWIN_HXX #include -#endif - -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include -#endif - -#ifndef _SV_SVAPP_HXX #include -#endif - -#ifndef _SV_WRKWIN_HXX #include -#endif +#include //_________________________________________________________________________________________________________________ // namespace @@ -332,10 +310,14 @@ void TitleBarUpdate::impl_updateIcon(const css::uno::Reference< css::frame::XFra { try { - xSet->getPropertyValue( CONTROLLER_PROPNAME_ICONID ) >>= nIcon; + css::uno::Reference< css::beans::XPropertySetInfo > const xPSI( xSet->getPropertySetInfo(), css::uno::UNO_SET_THROW ); + if ( xPSI->hasPropertyByName( CONTROLLER_PROPNAME_ICONID ) ) + xSet->getPropertyValue( CONTROLLER_PROPNAME_ICONID ) >>= nIcon; } catch(const css::uno::Exception&) - {} + { + DBG_UNHANDLED_EXCEPTION(); + } } // c) if b) failed ... identify the used module and retrieve set icon from module config. diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index b9dd626cf06d..a2de01b9c333 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -103,6 +103,7 @@ #include #include #include +#include #ifdef ENABLE_ASSERTIONS #ifndef _RTL_STRBUF_HXX_ @@ -2882,10 +2883,13 @@ void Frame::implts_setIconOnWindow() { try { - xSet->getPropertyValue( DECLARE_ASCII("IconId") )>>= nIcon; + css::uno::Reference< css::beans::XPropertySetInfo > const xPSI( xSet->getPropertySetInfo(), css::uno::UNO_SET_THROW ); + if ( xPSI->hasPropertyByName( CONTROLLER_PROPNAME_ICONID ) ) + xSet->getPropertyValue( CONTROLLER_PROPNAME_ICONID ) >>= nIcon; } - catch( css::beans::UnknownPropertyException& ) + catch( css::uno::Exception& ) { + DBG_UNHANDLED_EXCEPTION(); } } diff --git a/framework/source/uifactory/windowcontentfactorymanager.cxx b/framework/source/uifactory/windowcontentfactorymanager.cxx index 352fc1ad21f7..1b510a294952 100644 --- a/framework/source/uifactory/windowcontentfactorymanager.cxx +++ b/framework/source/uifactory/windowcontentfactorymanager.cxx @@ -55,6 +55,7 @@ #include #include #include +#include #include //_________________________________________________________________________________________________________________ @@ -242,11 +243,9 @@ throw (uno::Exception, uno::RuntimeException) { xWindow = xFactory->createInstanceWithArgumentsAndContext( Arguments, Context ); } - catch ( uno::RuntimeException& ) - { - } catch ( uno::Exception& ) { + DBG_UNHANDLED_EXCEPTION(); } } } diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index fd1327e423ca..c2680d702414 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -39,6 +39,7 @@ #include #endif #include +#include #include #include #include @@ -842,14 +843,18 @@ void SfxGlobalEvents_Impl::implts_checkAndExecuteEventBindings(const css::docume // <- SAFE css::uno::Any aAny; - if (xEvents.is()) + if ( xEvents.is() && xEvents->hasByName( aEvent.EventName ) ) aAny = xEvents->getByName(aEvent.EventName); Execute(aAny, aEvent, 0); } - catch(const css::uno::RuntimeException& exRun) - { throw exRun; } - catch(const css::uno::Exception&) - {} + catch ( css::uno::RuntimeException const & ) + { + throw; + } + catch ( css::uno::Exception const & ) + { + DBG_UNHANDLED_EXCEPTION(); + } } //----------------------------------------------------------------------------- -- cgit v1.2.3 From de978d6bc11109be94185449687aa35c0cef1e34 Mon Sep 17 00:00:00 2001 From: sj Date: Tue, 1 Mar 2011 12:30:04 +0100 Subject: #158494# fixed text rotation for binary excel import --- svx/inc/svx/msdffdef.hxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/svx/inc/svx/msdffdef.hxx b/svx/inc/svx/msdffdef.hxx index 6869a97e424a..73c32a8969cb 100644 --- a/svx/inc/svx/msdffdef.hxx +++ b/svx/inc/svx/msdffdef.hxx @@ -579,6 +579,10 @@ enum DFF_TextHeader { #define DFF_PBit_Hidden 0x00000002 #define DFF_PBit_Print 0x00000001 +// properties of the second property set +#define DFF_Prop_metroBlob 937 // XML ZipPackage* + + //--------------------------------------------------------------------------- // Dreh- und Angelpunkt: der Shape-Typ //--------------------------------------------------------------------------- -- cgit v1.2.3 From c4a3a45d2685143e1a9b336947e10c92478f5e95 Mon Sep 17 00:00:00 2001 From: sj Date: Tue, 1 Mar 2011 12:30:04 +0100 Subject: #158494# fixed text rotation for binary excel import --- filter/inc/filter/msfilter/msdffimp.hxx | 26 ++++--- filter/source/msfilter/msdffimp.cxx | 117 +++++++++++++++++++++++++++++++- 2 files changed, 133 insertions(+), 10 deletions(-) diff --git a/filter/inc/filter/msfilter/msdffimp.hxx b/filter/inc/filter/msfilter/msdffimp.hxx index 4f11a4c2fab9..445cca65c45b 100644 --- a/filter/inc/filter/msfilter/msdffimp.hxx +++ b/filter/inc/filter/msfilter/msdffimp.hxx @@ -130,6 +130,7 @@ class MSFILTER_DLLPUBLIC DffPropertyReader : public DffPropSet DffPropSet* pDefaultPropSet; void ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const; + void CheckAndCorrectExcelTextRotation( SvStream& rIn, SfxItemSet& rSet, DffObjData& rObjData ) const; void ApplyCustomShapeAdjustmentAttributes( SfxItemSet& rSet ) const; void ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const; void ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eShapeType ) const; // #i28269# @@ -151,7 +152,7 @@ public: void SetDefaultPropSet( SvStream& rIn, UINT32 nOffDgg ) const; void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet ) const; - void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const; + void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObjData& rObjData ) const; }; @@ -345,13 +346,18 @@ struct DffObjData UINT32 nSpFlags; MSO_SPT eShapeType; - BOOL bShapeType : 1; - BOOL bClientAnchor : 1; - BOOL bClientData : 1; - BOOL bChildAnchor : 1; - BOOL bOpt : 1; - BOOL bIsAutoText : 1; - + BOOL bShapeType : 1; + BOOL bClientAnchor : 1; + BOOL bClientData : 1; + BOOL bChildAnchor : 1; + BOOL bOpt : 1; + BOOL bOpt2 : 1; // secondary property set available + BOOL bIsAutoText : 1; + BOOL bRotateTextWithShape : 1; // Word/PowerPoint is rotating text with shape, + // old Excel versions can't rotate text with shapes, up from 2003 this + // feature has been added, the corresponding property (upright in the txBody) + // can be found in the optional XML data of the shape (metroBlob 937 of the + // second property set) int nCalledByGroup; DffObjData( const DffRecordHeader& rObjHd, @@ -367,7 +373,9 @@ struct DffObjData bClientData( FALSE ), bChildAnchor( FALSE ), bOpt( FALSE ), + bOpt2( FALSE ), bIsAutoText( FALSE ), + bRotateTextWithShape( TRUE ), nCalledByGroup( nClByGroup ){} }; @@ -560,7 +568,7 @@ public: void* pSvxMSDffDummy1; void* pSvxMSDffDummy2; - void* pSvxMSDffDummy3; + DffPropertyReader* pSecPropSet; List* pEscherBlipCache; DffRecordManager maShapeRecords; diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 29874b933d85..af038d1ac62c 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -41,6 +41,8 @@ #include #include #include +#include +#include #include #include #include @@ -467,6 +469,9 @@ SvStream& operator>>( SvStream& rIn, DffPropSet& rRec ) } else // a complex property needs content aPropFlag.bSet = sal_False; // otherwise something is wrong + + if ( ( nContentEx + nContent ) > aHd.GetRecEndFilePos() ) // asure that the complex property does not + nContent = aHd.GetRecEndFilePos() - nContentEx; // point behind the propertyset itself } rRec.mpContents[ nRecType ] = nContent; rRec.mpFlags[ nRecType ] = aPropFlag; @@ -3172,7 +3177,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet ) const ApplyAttributes( rIn, rSet, aDffObjTemp ); } -void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const +void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObjData& rObjData ) const { // MapUnit eMap( rManager.GetModel()->GetScaleUnit() ); @@ -3306,6 +3311,105 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const { ApplyCustomShapeGeometryAttributes( rIn, rSet, rObjData ); ApplyCustomShapeTextAttributes( rSet ); + if ( rManager.GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_IMPORT_EXCEL ) + { + if ( mnFix16Angle || ( rObjData.nSpFlags & SP_FFLIPV ) ) + CheckAndCorrectExcelTextRotation( rIn, rSet, rObjData ); + } + } +} + +void DffPropertyReader::CheckAndCorrectExcelTextRotation( SvStream& rIn, SfxItemSet& rSet, DffObjData& rObjData ) const +{ + sal_Bool bRotateTextWithShape = rObjData.bRotateTextWithShape; + if ( rObjData.bOpt2 ) // sj: #158494# is the second property set available ? if then we have to check the xml data of + { // the shape, because the textrotation of Excel 2003 and greater versions is stored there + // (upright property of the textbox) + if ( rManager.pSecPropSet->SeekToContent( DFF_Prop_metroBlob, rIn ) ) + { + sal_uInt32 nLen = rManager.pSecPropSet->GetPropertyValue( DFF_Prop_metroBlob ); + if ( nLen ) + { + ::com::sun::star::uno::Sequence< sal_Int8 > aXMLDataSeq( nLen ); + rIn.Read( aXMLDataSeq.getArray(), nLen ); + ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream + ( new ::comphelper::SequenceInputStream( aXMLDataSeq ) ); + try + { + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); + if ( xFactory.is() ) + { + ::com::sun::star::uno::Reference< com::sun::star::embed::XStorage > xStorage + ( ::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream( + OFOPXML_STORAGE_FORMAT_STRING, xInputStream, xFactory, sal_True ) ); + if ( xStorage.is() ) + { + const rtl::OUString sDRS( RTL_CONSTASCII_USTRINGPARAM ( "drs" ) ); + ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > + xStorageDRS( xStorage->openStorageElement( sDRS, ::com::sun::star::embed::ElementModes::SEEKABLEREAD ) ); + if ( xStorageDRS.is() ) + { + const rtl::OUString sShapeXML( RTL_CONSTASCII_USTRINGPARAM ( "shapexml.xml" ) ); + ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xShapeXMLStream( xStorageDRS->openStreamElement( sShapeXML, ::com::sun::star::embed::ElementModes::SEEKABLEREAD ) ); + if ( xShapeXMLStream.is() ) + { + ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xShapeXMLInputStream( xShapeXMLStream->getInputStream() ); + if ( xShapeXMLInputStream.is() ) + { + ::com::sun::star::uno::Sequence< sal_Int8 > aSeq; + sal_Int32 nBytesRead = xShapeXMLInputStream->readBytes( aSeq, 0x7fffffff ); + if ( nBytesRead ) + { // for only one property I spare to use a XML parser at this point, this + // should be enhanced if needed + + bRotateTextWithShape = sal_True; // using the correct xml default + const char* pArry = reinterpret_cast< char* >( aSeq.getArray() ); + const char* pUpright = "upright="; + const char* pEnd = pArry + nBytesRead; + const char* pPtr = pArry; + while( ( pPtr + 12 ) < pEnd ) + { + if ( !memcmp( pUpright, pPtr, 8 ) ) + { + bRotateTextWithShape = ( pPtr[ 9 ] != '1' ) && ( pPtr[ 9 ] != 't' ); + break; + } + else + pPtr++; + } + } + } + } + } + } + } + } + catch( com::sun::star::uno::Exception& ) + { + } + } + } + } + if ( !bRotateTextWithShape ) + { + const com::sun::star::uno::Any* pAny, aAny; + SdrCustomShapeGeometryItem aGeometryItem((SdrCustomShapeGeometryItem&)rSet.Get( SDRATTR_CUSTOMSHAPE_GEOMETRY )); + const rtl::OUString sTextRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) ); + pAny = aGeometryItem.GetPropertyValueByName( sTextRotateAngle ); + double fExtraTextRotateAngle = 0.0; + if ( pAny ) + *pAny >>= fExtraTextRotateAngle; + + if ( rManager.mnFix16Angle ) + fExtraTextRotateAngle += mnFix16Angle / 100.0; + if ( rObjData.nSpFlags & SP_FFLIPV ) + fExtraTextRotateAngle -= 180.0; + + com::sun::star::beans::PropertyValue aTextRotateAngle; + aTextRotateAngle.Name = sTextRotateAngle; + aTextRotateAngle.Value <<= fExtraTextRotateAngle; + aGeometryItem.SetPropertyValue( aTextRotateAngle ); + rSet.Put( aGeometryItem ); } } @@ -4835,6 +4939,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r rHd.SeekToBegOfRecord( rSt ); DffObjData aObjData( rHd, rClientRect, nCalledByGroup ); + aObjData.bRotateTextWithShape = ( GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_IMPORT_EXCEL ) == 0; maShapeRecords.Consume( rSt, FALSE ); aObjData.bShapeType = maShapeRecords.SeekToContent( rSt, DFF_msofbtSp, SEEK_FROM_BEGINNING ); if ( aObjData.bShapeType ) @@ -4873,6 +4978,13 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r InitializePropSet(); // get the default PropSet ( (DffPropertyReader*) this )->mnFix16Angle = 0; } + aObjData.bOpt2 = maShapeRecords.SeekToContent( rSt, DFF_msofbtUDefProp, SEEK_FROM_CURRENT_AND_RESTART ); + if ( aObjData.bOpt2 ) + { + maShapeRecords.Current()->SeekToBegOfRecord( rSt ); + pSecPropSet = new DffPropertyReader( *this ); + pSecPropSet->ReadPropSet( rSt, NULL ); + } aObjData.bChildAnchor = maShapeRecords.SeekToContent( rSt, DFF_msofbtChildAnchor, SEEK_FROM_CURRENT_AND_RESTART ); if ( aObjData.bChildAnchor ) @@ -6164,6 +6276,7 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_, pStData2( pStData2_ ), nSvxMSDffSettings( 0 ), nSvxMSDffOLEConvFlags( 0 ), + pSecPropSet( NULL ), pEscherBlipCache( NULL ), mnDefaultColor( mnDefaultColor_), mpTracer( pTracer ), @@ -6216,6 +6329,7 @@ SvxMSDffManager::SvxMSDffManager( SvStream& rStCtrl_, const String& rBaseURL, MS pStData2( 0 ), nSvxMSDffSettings( 0 ), nSvxMSDffOLEConvFlags( 0 ), + pSecPropSet( NULL ), pEscherBlipCache( NULL ), mnDefaultColor( COL_DEFAULT ), mpTracer( pTracer ), @@ -6238,6 +6352,7 @@ SvxMSDffManager::~SvxMSDffManager() delete (EscherBlipCacheEntry*)pPtr; delete pEscherBlipCache; } + delete pSecPropSet; delete pBLIPInfos; delete pShapeInfos; delete pShapeOrders; -- cgit v1.2.3 From 4051dbb7fbcd893b3fa044e7f46d2751d793bb9f Mon Sep 17 00:00:00 2001 From: sj Date: Tue, 1 Mar 2011 13:28:08 +0100 Subject: #158674# some minor customshape fixes --- svx/source/customshapes/EnhancedCustomShape2d.cxx | 2 +- .../customshapes/EnhancedCustomShapeGeometry.cxx | 323 ++++++++------------- 2 files changed, 115 insertions(+), 210 deletions(-) diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index c56a7917d9aa..a0c5f7dbcfb0 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -789,7 +789,7 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) : case mso_sptCurvedLeftArrow : case mso_sptCurvedRightArrow : case mso_sptCurvedUpArrow : - case mso_sptCurvedDownArrow : nColorData = 0x2d000000; break; + case mso_sptCurvedDownArrow : nColorData = 0x20d00000; break; case mso_sptRibbon2 : nColorData = 0x30ee0000; break; case mso_sptRibbon : nColorData = 0x30ee0000; break; diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx index 2bf28c81ca18..e4f5738d531b 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -1186,30 +1186,29 @@ static const mso_CustomShape msoBentUpArrow = (SvxMSDffHandle*)mso_sptBentUpArrowHandle, sizeof( mso_sptBentUpArrowHandle ) / sizeof( SvxMSDffHandle ) }; - -static const SvxMSDffVertPair mso_sptCurvedDownVert[] = +static const SvxMSDffVertPair mso_sptCurvedRightVert[] = { - { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 0, 21600 }, { 4 MSO_I, 0 }, - { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 4 MSO_I, 0 }, { 17 MSO_I, 24 MSO_I }, - { 15 MSO_I, 0 }, { 1 MSO_I, 21 MSO_I }, { 17 MSO_I, 24 MSO_I }, { 15 MSO_I, 21600 }, - { 15 MSO_I, 0 }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 0 }, { 13 MSO_I, 2 MSO_I }, - { 14 MSO_I, 2 MSO_I }, { 8 MSO_I, 21600 }, { 12 MSO_I, 2 MSO_I }, - { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 11 MSO_I, 2 MSO_I }, { 17 MSO_I, 24 MSO_I }, - { 0, 0 }, { 3 MSO_I, 21 MSO_I }, { 17 MSO_I, 24 MSO_I }, { 4 MSO_I, 0 } + { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 22 MSO_I, 0 }, { 0, 4 MSO_I }, { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 0, 7 MSO_I }, { 2 MSO_I, 13 MSO_I }, + { 2 MSO_I, 14 MSO_I }, { 22 MSO_I, 8 MSO_I }, { 2 MSO_I, 12 MSO_I }, + { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 2 MSO_I, 11 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 22 MSO_I, 15 MSO_I }, + { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 22 MSO_I, 0 }, { 0, 4 MSO_I }, + { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 0, 4 MSO_I }, { 26 MSO_I, 17 MSO_I }, + { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 22 MSO_I, 15 MSO_I } }; -static const sal_uInt16 mso_sptCurvedDownSegm[] = +static const sal_uInt16 mso_sptCurvedRightSegm[] = { + 0xa408, + 0x0003, 0xa508, - 0xa304, 0x6000, 0x8000, - 0xa604, - 0x0003, - 0xa308, + 0xa404, + 0xa304, + 0xa504, 0x6000, 0x8000 }; -static const SvxMSDffCalculationData mso_sptCurvedDownCalc[] = +static const SvxMSDffCalculationData mso_sptCurvedRightCalc[] = { { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, @@ -1232,60 +1231,117 @@ static const SvxMSDffCalculationData mso_sptCurvedDownCalc[] = { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } }, { 0x2001, { 0x412, 1, 2 } }, { 0xa000, { 0x411, 0, 0x413 } }, + { 0x0000, { 21600, 0, 0 } }, + { 0x0000, { 21600, 0, 0 } }, { 0x0001, { 21600, 2, 1 } }, { 0xa000, { 0x411, 0, 0x404 } }, - { 0x600f, { 0x416, 0x404, 21600 } }, - { 0x8000, { 21600, 0, 0x417 } }, + { 0x600f, { 0x418, 0x404, 21600 } }, + { 0x8000, { 21600, 0, 0x419 } }, { 0x2000, { 0x408, 128, 0 } }, { 0x2001, { 0x405, 1, 2 } }, { 0x2000, { 0x405, 0, 128 } }, { 0xe000, { DFF_Prop_adjustValue, 0x411, 0x40c } }, { 0x600f, { 0x414, 0x404, 21600 } }, { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, - { 0x2001, { 0x41e, 1, 2 } }, + { 0x2001, { 0x420, 1, 2 } }, { 0x0001, { 21600, 21600, 1 } }, { 0x6001, { 0x409, 0x409, 1 } }, - { 0xa000, { 0x420, 0, 0x421 } }, - { 0x200d, { 0x422, 0, 0 } }, - { 0x2000, { 0x423, 21600, 0 } }, - { 0x8001, { 21600, 21600, 0x424 } }, - { 0x2000, { 0x425, 64, 0 } }, + { 0xa000, { 0x422, 0, 0x423 } }, + { 0x200d, { 0x424, 0, 0 } }, + { 0x2000, { 0x425, 21600, 0 } }, + { 0x8001, { 21600, 21600, 0x426 } }, + { 0x2000, { 0x427, 64, 0 } }, { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, - { 0x600f, { 0x41f, 0x427, 21600 } }, - { 0x8000, { 21600, 0, 0x428 } }, - { 0x2000, { 0x429, 64, 0 } }, + { 0x600f, { 0x421, 0x429, 21600 } }, + { 0x8000, { 21600, 0, 0x42a } }, + { 0x2000, { 0x42b, 64, 0 } }, { 0x2001, { 0x404, 1, 2 } }, - { 0xa000, { DFF_Prop_adjust2Value, 0, 0x42b } }, + { 0xa000, { DFF_Prop_adjust2Value, 0, 0x42d } }, { 0x0001, { 21600, 2195, 16384 } }, { 0x0001, { 21600, 14189, 16384 } } }; -static const sal_Int32 mso_sptCurvedDownDefault[] = +static const sal_Int32 mso_sptCurvedRightDefault[] = { 3, 12960, 19440, 14400 }; +static const SvxMSDffTextRectangles mso_sptCurvedRightTextRect[] = +{ + { { 47 MSO_I, 45 MSO_I }, { 48 MSO_I, 46 MSO_I } } +}; +static const SvxMSDffVertPair mso_sptCurvedRightGluePoints[] = +{ + { 0, 17 MSO_I }, { 2 MSO_I, 14 MSO_I }, { 22 MSO_I, 8 MSO_I }, { 2 MSO_I, 12 MSO_I }, { 22 MSO_I, 16 MSO_I } +}; +static const SvxMSDffHandle mso_sptCurvedRightHandles[] = +{ + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL, + 21600, 0x100, 10800, 10800, 0, 10800, 3 + 40, 3 + 29 }, + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL, + 21600, 0x101, 10800, 10800, 0, 10800, 3 + 27, 3 + 21 }, + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL, + 0x102, 21600, 10800, 10800, 3 + 44, 3 + 22, 3375, 21600 } +}; +static const mso_CustomShape msoCurvedRightArrow = +{ + (SvxMSDffVertPair*)mso_sptCurvedRightVert, sizeof( mso_sptCurvedRightVert ) / sizeof( SvxMSDffVertPair ), + (sal_uInt16*)mso_sptCurvedRightSegm, sizeof( mso_sptCurvedRightSegm ) >> 1, + (SvxMSDffCalculationData*)mso_sptCurvedRightCalc, sizeof( mso_sptCurvedRightCalc ) / sizeof( SvxMSDffCalculationData ), + (sal_Int32*)mso_sptCurvedRightDefault, + (SvxMSDffTextRectangles*)mso_sptCurvedRightTextRect, sizeof( mso_sptCurvedRightTextRect ) / sizeof( SvxMSDffTextRectangles ), + 21600, 21600, + 0x80000000, 0x80000000, + (SvxMSDffVertPair*)mso_sptCurvedRightGluePoints, sizeof( mso_sptCurvedRightGluePoints ) / sizeof( SvxMSDffVertPair ), + (SvxMSDffHandle*)mso_sptCurvedRightHandles, sizeof( mso_sptCurvedRightHandles ) / sizeof( SvxMSDffHandle ) +}; + +static const SvxMSDffVertPair mso_sptCurvedDownVert[] = +{ + { 0, 0 }, { 3 MSO_I, 23 MSO_I }, { 0, 22 MSO_I }, { 4 MSO_I, 0 }, + { 15 MSO_I, 0 }, { 1 MSO_I, 23 MSO_I }, { 7 MSO_I, 0 }, { 13 MSO_I, 2 MSO_I }, + { 14 MSO_I, 2 MSO_I }, { 8 MSO_I, 22 MSO_I }, { 12 MSO_I, 2 MSO_I }, + { 0, 0 }, { 3 MSO_I, 23 MSO_I }, { 11 MSO_I, 2 MSO_I }, { 17 MSO_I, 26 MSO_I }, { 15 MSO_I, 0 }, + { 1 MSO_I, 23 MSO_I }, { 17 MSO_I, 26 MSO_I }, { 15 MSO_I, 22 MSO_I }, + { 0, 0 }, { 3 MSO_I, 23 MSO_I }, { 0, 22 MSO_I }, { 4 MSO_I, 0 }, + { 0, 0 }, { 3 MSO_I, 23 MSO_I }, { 4 MSO_I, 0 }, { 17 MSO_I, 26 MSO_I }, + { 15 MSO_I, 0 }, { 1 MSO_I, 23 MSO_I }, { 17 MSO_I, 26 MSO_I }, { 15 MSO_I, 22 MSO_I } +}; +static const sal_uInt16 mso_sptCurvedDownSegm[] = +{ + 0xa608, + 0x0003, + 0xa308, + 0x6000, + 0x8000, + 0xa604, + 0xa504, + 0xa304, + 0x6000, + 0x8000 +}; static const SvxMSDffTextRectangles mso_sptCurvedDownTextRect[] = { - { { 43 MSO_I, 45 MSO_I }, { 44 MSO_I, 46 MSO_I } } + { { 45 MSO_I, 47 MSO_I }, { 46 MSO_I, 48 MSO_I } } }; static const SvxMSDffVertPair mso_sptCurvedDownGluePoints[] = { - { 17 MSO_I, 0 }, { 16 MSO_I, 21600 }, { 12 MSO_I, 2 MSO_I }, { 8 MSO_I, 21600 }, { 14 MSO_I, 2 MSO_I } + { 17 MSO_I, 0 }, { 16 MSO_I, 22 MSO_I }, { 12 MSO_I, 2 MSO_I }, { 8 MSO_I, 22 MSO_I }, { 14 MSO_I, 2 MSO_I } }; static const SvxMSDffHandle mso_sptCurvedDownHandles[] = { { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL, - 0x100, 21600, 10800, 10800, 3 + 0x26, 3 + 0x1b, 0, 10800 }, - { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL, - 0x101, 21600, 10800, 10800, 3 + 0x19, 21600, 0, 10800 }, - { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL, - 21600, 0x102, 10800, 10800, 3375, 21600, 3 + 0x2a, 21600 } + 0x100, 21600, 10800, 10800, 3 + 40, 3 + 29, 0, 10800 }, + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL, + 0x101, 21600, 10800, 10800, 3 + 27, 3 + 21, 0, 10800 }, + { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL, + 21600, 0x102, 10800, 10800, 3375, 21600, 3 + 44, 3 + 22 } }; + static const mso_CustomShape msoCurvedDownArrow = { (SvxMSDffVertPair*)mso_sptCurvedDownVert, sizeof( mso_sptCurvedDownVert ) / sizeof( SvxMSDffVertPair ), (sal_uInt16*)mso_sptCurvedDownSegm, sizeof( mso_sptCurvedDownSegm ) >> 1, - (SvxMSDffCalculationData*)mso_sptCurvedDownCalc, sizeof( mso_sptCurvedDownCalc ) / sizeof( SvxMSDffCalculationData ), - (sal_Int32*)mso_sptCurvedDownDefault, + (SvxMSDffCalculationData*)mso_sptCurvedRightCalc, sizeof( mso_sptCurvedRightCalc ) / sizeof( SvxMSDffCalculationData ), + (sal_Int32*)mso_sptCurvedRightDefault, (SvxMSDffTextRectangles*)mso_sptCurvedDownTextRect, sizeof( mso_sptCurvedDownTextRect ) / sizeof( SvxMSDffTextRectangles ), 21600, 21600, 0x80000000, 0x80000000, @@ -1296,11 +1352,13 @@ static const mso_CustomShape msoCurvedDownArrow = static const SvxMSDffVertPair mso_sptCurvedUpVert[] = { { 0, 22 MSO_I }, { 3 MSO_I, 21 MSO_I }, { 0, 0 }, { 4 MSO_I, 21 MSO_I }, - { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 21 MSO_I }, { 12 MSO_I, 2 MSO_I }, - { 13 MSO_I, 2 MSO_I }, { 8 MSO_I, 0 }, { 11 MSO_I, 2 MSO_I }, + { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 21 MSO_I }, + { 12 MSO_I, 2 MSO_I }, { 13 MSO_I, 2 MSO_I }, { 8 MSO_I, 0 }, { 11 MSO_I, 2 MSO_I }, { 0, 22 MSO_I }, { 3 MSO_I, 21 MSO_I }, { 10 MSO_I, 2 MSO_I }, { 16 MSO_I, 24 MSO_I }, { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 16 MSO_I, 24 MSO_I }, { 14 MSO_I, 0 }, - { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 21 MSO_I }, { 16 MSO_I, 24 MSO_I } + { 0, 22 MSO_I }, { 3 MSO_I, 21 MSO_I }, { 0, 0 }, { 4 MSO_I, 21 MSO_I }, + { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 7 MSO_I, 21 MSO_I }, { 16 MSO_I, 24 MSO_I }, + { 14 MSO_I, 22 MSO_I }, { 1 MSO_I, 21 MSO_I }, { 16 MSO_I, 24 MSO_I }, { 14 MSO_I, 0 } }; static const sal_uInt16 mso_sptCurvedUpSegm[] = { @@ -1309,8 +1367,10 @@ static const sal_uInt16 mso_sptCurvedUpSegm[] = 0xa508, 0x6000, 0x8000, - 0xa604, - 0xaa00, + 0xa404, + 0xa508, + 0xa504, + 0x6000, 0x8000 }; static const SvxMSDffCalculationData mso_sptCurvedUpCalc[] = @@ -1395,116 +1455,16 @@ static const mso_CustomShape msoCurvedUpArrow = (SvxMSDffHandle*)mso_sptCurvedUpHandles, sizeof( mso_sptCurvedUpHandles ) / sizeof( SvxMSDffHandle ) }; -static const SvxMSDffVertPair mso_sptCurvedRightVert[] = -{ - { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 22 MSO_I, 0 }, { 0, 4 MSO_I }, { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 0, 7 MSO_I }, { 2 MSO_I, 13 MSO_I }, - { 2 MSO_I, 14 MSO_I }, { 22 MSO_I, 8 MSO_I }, { 2 MSO_I, 12 MSO_I }, - { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 2 MSO_I, 11 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 0, 15 MSO_I }, { 23 MSO_I, 1 MSO_I }, { 26 MSO_I, 17 MSO_I }, { 22 MSO_I, 15 MSO_I }, - { 0, 0 }, { 23 MSO_I, 3 MSO_I }, { 0, 4 MSO_I }, { 26 MSO_I, 17 MSO_I } -}; -static const sal_uInt16 mso_sptCurvedRightSegm[] = -{ - 0xa408, - 0x0003, - 0xa508, - 0x6000, - 0x8000, - 0xa404, - 0xaa00, - 0x8000 -}; -static const SvxMSDffCalculationData mso_sptCurvedRightCalc[] = -{ - { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, - { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, - { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, - { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } }, - { 0x2001, { 0x403, 1, 2 } }, - { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } }, - { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } }, - { 0x2001, { 0x406, 1, 2 } }, - { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } }, - { 0x8000, { 21600, 0, DFF_Prop_adjust3Value } }, - { 0xa00f, { 0x409, 21600, 0x404 } }, - { 0x6000, { 0x404, 0x40a, 0 } }, - { 0x6000, { 0x40b, DFF_Prop_adjust2Value, 21600 } }, - { 0x6000, { 0x407, 0x40a, 0 } }, - { 0xa000, { 0x40c, 21600, DFF_Prop_adjustValue } }, - { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } }, - { 0x2001, { 0x40f, 1, 2 } }, - { 0x6002, { 0x404, 0x407, 0 } }, - { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } }, - { 0x2001, { 0x412, 1, 2 } }, - { 0xa000, { 0x411, 0, 0x413 } }, - { 0x0000, { 21600, 0, 0 } }, - { 0x0000, { 21600, 0, 0 } }, - { 0x0001, { 21600, 2, 1 } }, - { 0xa000, { 0x411, 0, 0x404 } }, - { 0x600f, { 0x418, 0x404, 21600 } }, - { 0x8000, { 21600, 0, 0x419 } }, - { 0x2000, { 0x408, 128, 0 } }, - { 0x2001, { 0x405, 1, 2 } }, - { 0x2000, { 0x405, 0, 128 } }, - { 0xe000, { DFF_Prop_adjustValue, 0x411, 0x40c } }, - { 0x600f, { 0x414, 0x404, 21600 } }, - { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, - { 0x2001, { 0x420, 1, 2 } }, - { 0x0001, { 21600, 21600, 1 } }, - { 0x6001, { 0x409, 0x409, 1 } }, - { 0xa000, { 0x422, 0, 0x423 } }, - { 0x200d, { 0x424, 0, 0 } }, - { 0x2000, { 0x425, 21600, 0 } }, - { 0x8001, { 21600, 21600, 0x426 } }, - { 0x2000, { 0x427, 64, 0 } }, - { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, - { 0x600f, { 0x421, 0x429, 21600 } }, - { 0x8000, { 21600, 0, 0x42a } }, - { 0x2000, { 0x42b, 64, 0 } }, - { 0x2001, { 0x404, 1, 2 } }, - { 0xa000, { DFF_Prop_adjust2Value, 0, 0x42d } }, - { 0x0001, { 21600, 2195, 16384 } }, - { 0x0001, { 21600, 14189, 16384 } } -}; -static const sal_Int32 mso_sptCurvedRightDefault[] = -{ - 3, 12960, 19440, 14400 -}; -static const SvxMSDffTextRectangles mso_sptCurvedRightTextRect[] = -{ - { { 47 MSO_I, 45 MSO_I }, { 48 MSO_I, 46 MSO_I } } -}; -static const SvxMSDffVertPair mso_sptCurvedRightGluePoints[] = -{ - { 0, 17 MSO_I }, { 2 MSO_I, 14 MSO_I }, { 22 MSO_I, 8 MSO_I }, { 2 MSO_I, 12 MSO_I }, { 22 MSO_I, 16 MSO_I } -}; -static const SvxMSDffHandle mso_sptCurvedRightHandles[] = -{ - { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL, - 21600, 0x100, 10800, 10800, 0, 10800, 3 + 40, 3 + 29 }, - { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_Y_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_Y_MAX_IS_SPECIAL, - 21600, 0x101, 10800, 10800, 0, 10800, 3 + 27, 3 + 21 }, - { MSDFF_HANDLE_FLAGS_RANGE | MSDFF_HANDLE_FLAGS_RANGE_X_MIN_IS_SPECIAL | MSDFF_HANDLE_FLAGS_RANGE_X_MAX_IS_SPECIAL, - 0x102, 21600, 10800, 10800, 3 + 44, 3 + 22, 3375, 21600 } -}; -static const mso_CustomShape msoCurvedRightArrow = -{ - (SvxMSDffVertPair*)mso_sptCurvedRightVert, sizeof( mso_sptCurvedRightVert ) / sizeof( SvxMSDffVertPair ), - (sal_uInt16*)mso_sptCurvedRightSegm, sizeof( mso_sptCurvedRightSegm ) >> 1, - (SvxMSDffCalculationData*)mso_sptCurvedRightCalc, sizeof( mso_sptCurvedRightCalc ) / sizeof( SvxMSDffCalculationData ), - (sal_Int32*)mso_sptCurvedRightDefault, - (SvxMSDffTextRectangles*)mso_sptCurvedRightTextRect, sizeof( mso_sptCurvedRightTextRect ) / sizeof( SvxMSDffTextRectangles ), - 21600, 21600, - 0x80000000, 0x80000000, - (SvxMSDffVertPair*)mso_sptCurvedRightGluePoints, sizeof( mso_sptCurvedRightGluePoints ) / sizeof( SvxMSDffVertPair ), - (SvxMSDffHandle*)mso_sptCurvedRightHandles, sizeof( mso_sptCurvedRightHandles ) / sizeof( SvxMSDffHandle ) -}; - static const SvxMSDffVertPair mso_sptCurvedLeftVert[] = { - { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 0, 0 }, { 21 MSO_I, 4 MSO_I }, { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 21 MSO_I, 7 MSO_I }, { 2 MSO_I, 12 MSO_I }, + { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 0, 0 }, { 21 MSO_I, 4 MSO_I }, + { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 21 MSO_I, 7 MSO_I }, { 2 MSO_I, 12 MSO_I }, { 2 MSO_I, 13 MSO_I }, { 0, 8 MSO_I }, { 2 MSO_I, 11 MSO_I }, - { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 2 MSO_I, 10 MSO_I }, { 24 MSO_I, 16 MSO_I }, { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 24 MSO_I, 16 MSO_I }, { 0, 14 MSO_I }, - { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 21 MSO_I, 7 MSO_I }, { 24 MSO_I, 16 MSO_I } + { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 2 MSO_I, 10 MSO_I }, { 24 MSO_I, 16 MSO_I }, + { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 24 MSO_I, 16 MSO_I }, { 0, 14 MSO_I }, + { 22 MSO_I, 0 }, { 21 MSO_I, 3 MSO_I }, { 0, 0 }, { 21 MSO_I, 4 MSO_I }, + { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 21 MSO_I, 7 MSO_I }, { 24 MSO_I, 16 MSO_I }, + { 22 MSO_I, 14 MSO_I }, { 21 MSO_I, 1 MSO_I }, { 24 MSO_I, 16 MSO_I }, { 0, 14 MSO_I } }; static const sal_uInt16 mso_sptCurvedLeftSegm[] = { @@ -1513,62 +1473,11 @@ static const sal_uInt16 mso_sptCurvedLeftSegm[] = 0xa308, 0x6000, 0x8000, - 0xa404, - 0xaa00, + 0xa604, + 0xa308, + 0x6000, 0x8000 }; -static const SvxMSDffCalculationData mso_sptCurvedLeftCalc[] = -{ - { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, - { 0x2000, { DFF_Prop_adjust2Value, 0, 0 } }, - { 0x2000, { DFF_Prop_adjust3Value, 0, 0 } }, - { 0xa000, { DFF_Prop_adjustValue, 21600, DFF_Prop_adjust2Value } }, - { 0x2001, { 0x403, 1, 2 } }, - { 0x6000, { DFF_Prop_adjust2Value, DFF_Prop_adjust2Value, 21600 } }, - { 0xe000, { 0x405, DFF_Prop_adjust2Value, DFF_Prop_adjustValue } }, - { 0x2001, { 0x406, 1, 2 } }, - { 0x4002, { 21600, DFF_Prop_adjustValue, 0 } }, - { 0xa00f, { DFF_Prop_adjust3Value, 21600, 0x404 } }, - { 0x6000, { 0x404, 0x409, 0 } }, - { 0x6000, { 0x40a, DFF_Prop_adjust2Value, 21600 } }, - { 0x6000, { 0x407, 0x409, 0 } }, - { 0xa000, { 0x40b, 21600, DFF_Prop_adjustValue } }, - { 0xa000, { 0x405, 0, DFF_Prop_adjustValue } }, - { 0x2001, { 0x40e, 1, 2 } }, - { 0x6002, { 0x404, 0x407, 0 } }, - { 0x6000, { DFF_Prop_adjustValue, DFF_Prop_adjust2Value, 21600 } }, - { 0x2001, { 0x411, 1, 2 } }, - { 0xa000, { 0x410, 0, 0x412 } }, - { 0x0000, { 21600, 0, 0 } }, - { 0x0000, { 21600, 0, 0 } }, - { 0x0000, { 0, 0, 21600 } }, - { 0xa000, { 0x410, 0, 0x404 } }, - { 0x600f, { 0x417, 0x404, 21600 } }, - { 0x2000, { 0x408, 128, 0 } }, - { 0x2001, { 0x405, 1, 2 } }, - { 0x2000, { 0x405, 0, 128 } }, - { 0xe000, { DFF_Prop_adjustValue, 0x410, 0x40b } }, - { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }, - { 0x2001, { 0x41d, 1, 2 } }, - { 0x0001, { 21600, 21600, 1 } }, - { 0x6001, { DFF_Prop_adjust3Value, DFF_Prop_adjust3Value, 1 } }, - { 0xa000, { 0x41f, 0, 0x420 } }, - { 0x200d, { 0x421, 0, 0 } }, - { 0x2000, { 0x422, 21600, 0 } }, - { 0x8001, { 21600, 21600, 0x423 } }, - { 0x2000, { 0x424, 64, 0 } }, - { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, - { 0x600f, { 0x41e, 0x426, 21600 } }, - { 0x2000, { 0x427, 0, 64 } }, - { 0x2001, { 0x404, 1, 2 } }, - { 0xa000, { DFF_Prop_adjust2Value, 0, 0x429 } }, - { 0x0001, { 21600, 2195, 16384 } }, - { 0x0001, { 21600, 14189, 16384 } } -}; -static const sal_Int32 mso_sptCurvedLeftDefault[] = -{ - 3, 12960, 19440, 7200 -}; static const SvxMSDffTextRectangles mso_sptCurvedLeftTextRect[] = { { { 43 MSO_I, 41 MSO_I }, { 44 MSO_I, 42 MSO_I } } @@ -1590,8 +1499,8 @@ static const mso_CustomShape msoCurvedLeftArrow = { (SvxMSDffVertPair*)mso_sptCurvedLeftVert, sizeof( mso_sptCurvedLeftVert ) / sizeof( SvxMSDffVertPair ), (sal_uInt16*)mso_sptCurvedLeftSegm, sizeof( mso_sptCurvedLeftSegm ) >> 1, - (SvxMSDffCalculationData*)mso_sptCurvedLeftCalc, sizeof( mso_sptCurvedLeftCalc ) / sizeof( SvxMSDffCalculationData ), - (sal_Int32*)mso_sptCurvedLeftDefault, + (SvxMSDffCalculationData*)mso_sptCurvedUpCalc, sizeof( mso_sptCurvedUpCalc ) / sizeof( SvxMSDffCalculationData ), + (sal_Int32*)mso_sptCurvedUpDefault, (SvxMSDffTextRectangles*)mso_sptCurvedLeftTextRect, sizeof( mso_sptCurvedLeftTextRect ) / sizeof( SvxMSDffTextRectangles ), 21600, 21600, 0x80000000, 0x80000000, @@ -1599,10 +1508,6 @@ static const mso_CustomShape msoCurvedLeftArrow = (SvxMSDffHandle*)mso_sptCurvedLeftHandles, sizeof( mso_sptCurvedLeftHandles ) / sizeof( SvxMSDffHandle ) }; - - - - static const SvxMSDffVertPair mso_sptStripedRightArrowVert[] = // adjustment1 : x 3375 - 21600 { // adjustment2 : y 0 - 10800 { 3375, 0 MSO_I }, { 1 MSO_I, 0 MSO_I }, { 1 MSO_I, 0 }, { 21600, 10800 }, -- cgit v1.2.3 From 8becbbb67be43e6a3adf7974e5a9b07dd8312386 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Mar 2011 11:29:05 +0100 Subject: gridfixes: #i117145# --- toolkit/inc/toolkit/controls/tabpagemodel.hxx | 1 - .../source/controls/controlmodelcontainerbase.cxx | 24 ++++++++++++++-------- toolkit/source/helper/registerservices.cxx | 16 +++++++++------ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/toolkit/inc/toolkit/controls/tabpagemodel.hxx b/toolkit/inc/toolkit/controls/tabpagemodel.hxx index 08938669fa58..8d180deb2f97 100644 --- a/toolkit/inc/toolkit/controls/tabpagemodel.hxx +++ b/toolkit/inc/toolkit/controls/tabpagemodel.hxx @@ -33,7 +33,6 @@ #include #include #include -#include #include "toolkit/helper/servicenames.hxx" #include "toolkit/helper/macros.hxx" #include diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index f037f10bbe31..1cd40032b31f 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -39,14 +39,14 @@ #include #include "toolkit/controls/formattedcontrol.hxx" #include "toolkit/controls/roadmapcontrol.hxx" -#ifndef TOOLKIT_INC_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX #include "toolkit/controls/tkscrollbar.hxx" -#endif +#include "toolkit/controls/tabpagemodel.hxx" #include #include #include #include #include +#include #include #include #include @@ -389,6 +389,8 @@ Reference< XInterface > ControlModelContainerBase::createInstance( const ::rtl:: pNewModel = new OGeometryControlModel< UnoGridModel >( xFactory ); else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlTabPageContainerModel ) == 0 ) pNewModel = new OGeometryControlModel< UnoControlTabPageContainerModel >( xFactory ); + else if ( aServiceSpecifier.compareToAscii( szServiceName_UnoControlTabPageModel ) == 0 ) + pNewModel = new OGeometryControlModel< UnoControlTabPageModel >( xFactory ); if ( !pNewModel ) { @@ -417,9 +419,13 @@ Reference< XInterface > ControlModelContainerBase::createInstance( const ::rtl:: return xNewModel; } -Reference< XInterface > ControlModelContainerBase::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const Sequence< Any >& /* Arguments */ ) throw(Exception, RuntimeException) +Reference< XInterface > ControlModelContainerBase::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const Sequence< Any >& i_arguments ) throw(Exception, RuntimeException) { - return createInstance( ServiceSpecifier ); + const Reference< XInterface > xInstance( createInstance( ServiceSpecifier ) ); + const Reference< XInitialization > xInstanceInit( xInstance, UNO_QUERY ); + ENSURE_OR_RETURN( xInstanceInit.is(), "ControlModelContainerBase::createInstanceWithArguments: can't pass the arguments!", xInstance ); + xInstanceInit->initialize( i_arguments ); + return xInstance; } Sequence< ::rtl::OUString > ControlModelContainerBase::getAvailableServiceNames() throw(RuntimeException) @@ -1344,7 +1350,7 @@ void ControlContainerBase::ImplInsertControl( Reference< XControlModel >& rxMode Reference < XControl > xCtrl; maContext.createComponent( aDefCtrl, xCtrl ); - DBG_ASSERT( xCtrl.is(), "UnoDialogControl::ImplInsertControl: could not create the control!" ); + DBG_ASSERT( xCtrl.is(), "ControlContainerBase::ImplInsertControl: could not create the control!" ); if ( xCtrl.is() ) { xCtrl->setModel( rxModel ); @@ -1562,7 +1568,7 @@ void ControlContainerBase::elementInserted( const ContainerEvent& Event ) throw( Event.Accessor >>= aName; Event.Element >>= xModel; - ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementInserted: illegal element!" ); + ENSURE_OR_RETURN_VOID( xModel.is(), "ControlContainerBase::elementInserted: illegal element!" ); try { ImplInsertControl( xModel, aName ); @@ -1580,7 +1586,7 @@ void ControlContainerBase::elementRemoved( const ContainerEvent& Event ) throw(R Reference< XControlModel > xModel; Event.Element >>= xModel; - ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementRemoved: illegal element!" ); + ENSURE_OR_RETURN_VOID( xModel.is(), "ControlContainerBase::elementRemoved: illegal element!" ); try { ImplRemoveControl( xModel ); @@ -1600,7 +1606,7 @@ void ControlContainerBase::elementReplaced( const ContainerEvent& Event ) throw( Event.ReplacedElement >>= xModel; try { - OSL_ENSURE( xModel.is(), "UnoDialogControl::elementReplaced: invalid ReplacedElement!" ); + OSL_ENSURE( xModel.is(), "ControlContainerBase::elementReplaced: invalid ReplacedElement!" ); if ( xModel.is() ) ImplRemoveControl( xModel ); } @@ -1613,7 +1619,7 @@ void ControlContainerBase::elementReplaced( const ContainerEvent& Event ) throw( ::rtl::OUString aName; Event.Accessor >>= aName; Event.Element >>= xModel; - ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementReplaced: invalid new element!" ); + ENSURE_OR_RETURN_VOID( xModel.is(), "ControlContainerBase::elementReplaced: invalid new element!" ); try { ImplInsertControl( xModel, aName ); diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx index 8a6b1d8de4b9..fa3afbe87af8 100644 --- a/toolkit/source/helper/registerservices.cxx +++ b/toolkit/source/helper/registerservices.cxx @@ -128,9 +128,10 @@ namespace toolkit ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) \ { return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName( i_factory ) ); } -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL UnoControlDialogModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) -{ - return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new OGeometryControlModel( i_factory ) ); +#define IMPL_CREATE_INSTANCE_WITH_GEOMETRY( ImplName ) \ + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) \ +{ \ + return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new OGeometryControlModel< ImplName >( i_factory ) ); \ } #define GET_FACTORY_WITH_IMPL_PREFIX( ClassName, ImplNamePrefix, ServiceName1, ServiceName2 ) \ @@ -212,6 +213,8 @@ IMPL_CREATEINSTANCE2( AnimatedImagesControl ) IMPL_CREATEINSTANCE2( AnimatedImagesControlModel ) IMPL_CREATEINSTANCE2( SpinningProgressControlModel ) +IMPL_CREATE_INSTANCE_WITH_GEOMETRY( UnoControlDialogModel ) + extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL TreeControl_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL TreeControlModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL MutableTreeDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); @@ -234,6 +237,7 @@ TOOLKIT_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sa *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } + TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey ) { void* pRet = NULL; @@ -313,13 +317,13 @@ TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplemen GET_FACTORY( DefaultGridColumnModel, szServiceName_DefaultGridColumnModel, NULL ); GET_FACTORY_WITH_IMPL_PREFIX( GridColumn, "org.openoffice.comp.toolkit", szServiceName_GridColumn, NULL ); GET_FACTORY_WITH_IMPL_PREFIX( SortableGridDataModel, "org.openoffice.comp.toolkit", szServiceName_SortableGridDataModel, NULL ); - GET_FACTORY_WITH_IMPL_PREFIX( AnimatedImagesControl, "org.openoffice.comp.toolkit", szServiceName_AnimatedImagesControl, NULL ) - GET_FACTORY_WITH_IMPL_PREFIX( AnimatedImagesControlModel, "org.openoffice.comp.toolkit", szServiceName_AnimatedImagesControlModel, NULL ) - GET_FACTORY_WITH_IMPL_PREFIX( SpinningProgressControlModel, "org.openoffice.comp.toolkit", szServiceName_SpinningProgressControlModel, NULL ) GET_FACTORY( UnoControlTabPageModel, szServiceName_UnoControlTabPageModel, NULL ) GET_FACTORY( UnoControlTabPage, szServiceName_UnoControlTabPage, NULL ) GET_FACTORY( UnoControlTabPageContainerModel, szServiceName_UnoControlTabPageContainerModel, NULL ) GET_FACTORY( UnoControlTabPageContainer, szServiceName_UnoControlTabPageContainer, NULL ) + GET_FACTORY_WITH_IMPL_PREFIX( AnimatedImagesControl, "org.openoffice.comp.toolkit", szServiceName_AnimatedImagesControl, NULL ) + GET_FACTORY_WITH_IMPL_PREFIX( AnimatedImagesControlModel, "org.openoffice.comp.toolkit", szServiceName_AnimatedImagesControlModel, NULL ) + GET_FACTORY_WITH_IMPL_PREFIX( SpinningProgressControlModel, "org.openoffice.comp.toolkit", szServiceName_SpinningProgressControlModel, NULL ) if ( rtl_str_compare( sImplementationName, "com.sun.star.awt.comp.AsyncCallback" ) == 0 ) return comp_AsyncCallback_component_getFactory( sImplementationName, _pServiceManager, _pRegistryKey ); -- cgit v1.2.3 From 0fe2bc39aa1911546e4dccf1eff1047e10f72932 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Mar 2011 13:13:07 +0100 Subject: gridfixes: #i117188# remove column sort when rows are inserted --- .../source/controls/grid/sortablegriddatamodel.cxx | 57 ++++++---------------- .../source/controls/grid/sortablegriddatamodel.hxx | 4 ++ 2 files changed, 20 insertions(+), 41 deletions(-) diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index 77a2ffa1637b..db16ee7ad7e2 100755 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx @@ -295,45 +295,15 @@ namespace toolkit MethodGuard aGuard( *this, rBHelper ); DBG_CHECK_ME(); - // if the data is not sorted, broadcast the event unchanged - if ( !impl_isSorted_nothrow() ) - { - GridDataEvent const aEvent( impl_createPublicEvent( i_event ) ); - impl_broadcast( &XGridDataListener::rowsInserted, aEvent, aGuard ); - return; - } - - bool needReIndex = false; - if ( i_event.FirstRow > i_event.LastRow ) - { - OSL_ENSURE( false, "SortableGridDataModel::rowsInserted: invalid event - invalid row indexes!" ); - needReIndex = true; - } - else if ( size_t( i_event.FirstRow ) > m_privateToPublicRowIndex.size() ) + if ( impl_isSorted_nothrow() ) { - OSL_ENSURE( false, "SortableGridDataModel::rowsInserted: invalid event - too large row index!" ); - needReIndex = true; - } - - if ( needReIndex ) - { - impl_rebuildIndexesAndNotify( aGuard ); - return; + // no infrastructure is in place currently to sort the new row to its proper location, + // so we remove the sorting here. + impl_removeColumnSort( aGuard ); + aGuard.reset(); } - // we do not insert the new rows into the sort order - if somebody adds rows while we're sorted, s/he has - // to resort. Instead, we simply append the rows, no matter where they were inserted in the delegator data - // model. - sal_Int32 const nPublicFirstRow = sal_Int32( m_privateToPublicRowIndex.size() ); - sal_Int32 nPublicLastRow = nPublicFirstRow; - for ( sal_Int32 newRow = i_event.FirstRow; newRow <= i_event.LastRow; ++newRow, ++nPublicLastRow ) - { - m_privateToPublicRowIndex.push_back( nPublicLastRow ); - m_publicToPrivateRowIndex.push_back( nPublicLastRow ); - } - - // broadcast the event - GridDataEvent const aEvent( *this, -1, -1, nPublicFirstRow, nPublicLastRow ); + GridDataEvent const aEvent( impl_createPublicEvent( i_event ) ); impl_broadcast( &XGridDataListener::rowsInserted, aEvent, aGuard ); } @@ -570,11 +540,8 @@ namespace toolkit } //------------------------------------------------------------------------------------------------------------------ - void SAL_CALL SortableGridDataModel::removeColumnSort( ) throw (RuntimeException) + void SortableGridDataModel::impl_removeColumnSort( MethodGuard& i_instanceLock ) { - MethodGuard aGuard( *this, rBHelper ); - DBG_CHECK_ME(); - lcl_clear( m_publicToPrivateRowIndex ); lcl_clear( m_privateToPublicRowIndex ); @@ -584,10 +551,18 @@ namespace toolkit impl_broadcast( &XGridDataListener::dataChanged, GridDataEvent( *this, -1, -1, -1, -1 ), - aGuard + i_instanceLock ); } + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL SortableGridDataModel::removeColumnSort( ) throw (RuntimeException) + { + MethodGuard aGuard( *this, rBHelper ); + DBG_CHECK_ME(); + impl_removeColumnSort( aGuard ); + } + //------------------------------------------------------------------------------------------------------------------ Pair< ::sal_Int32, ::sal_Bool > SAL_CALL SortableGridDataModel::getCurrentSortOrder( ) throw (RuntimeException) { diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.hxx b/toolkit/source/controls/grid/sortablegriddatamodel.hxx index 50f08d3a7113..0b07ff2d991a 100755 --- a/toolkit/source/controls/grid/sortablegriddatamodel.hxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.hxx @@ -180,6 +180,10 @@ namespace toolkit */ void impl_rebuildIndexesAndNotify( MethodGuard& i_instanceLock ); + /** removes the current sorting, and notifies a change of all data + */ + void impl_removeColumnSort( MethodGuard& i_instanceLock ); + private: ::comphelper::ComponentContext m_context; bool m_isInitialized; -- cgit v1.2.3 From 367067f788deaec9c8c747437597ee4c054e31eb Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 4 Mar 2011 11:56:45 +0100 Subject: gridfixes: fixed assertion --- svtools/source/table/tablecontrol.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index 01a9b667a8f7..e9d88853a8ec 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -209,7 +209,7 @@ namespace svt { namespace table void TableControl::SelectRow( RowPos const i_rowIndex, bool const i_select ) { ENSURE_OR_RETURN_VOID( ( i_rowIndex >= 0 ) && ( i_rowIndex < m_pImpl->getModel()->getRowCount() ), - "TableControl::SelectRow: no control (anymore)!" ); + "TableControl::SelectRow: invalid row index!" ); if ( i_select ) { -- cgit v1.2.3 From 4dd279e328c9f21bc435a5da9b0bb77823faae46 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Fri, 4 Mar 2011 21:31:20 +0100 Subject: impress210: #i50899# clean up fill attributes if fill style changes --- svx/inc/svx/sdr/properties/pageproperties.hxx | 3 +++ svx/inc/svx/sdr/properties/properties.hxx | 4 ++++ svx/source/sdr/properties/defaultproperties.cxx | 4 +++- svx/source/sdr/properties/pageproperties.cxx | 6 +++++ svx/source/sdr/properties/properties.cxx | 30 +++++++++++++++++++++++++ 5 files changed, 46 insertions(+), 1 deletion(-) diff --git a/svx/inc/svx/sdr/properties/pageproperties.hxx b/svx/inc/svx/sdr/properties/pageproperties.hxx index d85686b3bc5b..9dbbc645d9be 100644 --- a/svx/inc/svx/sdr/properties/pageproperties.hxx +++ b/svx/inc/svx/sdr/properties/pageproperties.hxx @@ -45,6 +45,9 @@ namespace sdr // Do the ItemChange, may do special handling virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0); + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich); + public: // basic constructor PageProperties(SdrObject& rObj); diff --git a/svx/inc/svx/sdr/properties/properties.hxx b/svx/inc/svx/sdr/properties/properties.hxx index 311c2ccfd1a5..99ebdfbb1be9 100644 --- a/svx/inc/svx/sdr/properties/properties.hxx +++ b/svx/inc/svx/sdr/properties/properties.hxx @@ -187,6 +187,10 @@ namespace sdr // default implementation returns 0 (zero) virtual sal_uInt32 getVersion() const; }; + + // checks the FillStyle item and removes unneeded Gradient, FillBitmap and Hatch items + void SVX_DLLPUBLIC CleanupFillProperties( SfxItemSet& rItemSet ); + } // end of namespace properties } // end of namespace sdr diff --git a/svx/source/sdr/properties/defaultproperties.cxx b/svx/source/sdr/properties/defaultproperties.cxx index 7d51b26a0051..41149a965248 100644 --- a/svx/source/sdr/properties/defaultproperties.cxx +++ b/svx/source/sdr/properties/defaultproperties.cxx @@ -204,8 +204,10 @@ namespace sdr { } - void DefaultProperties::PostItemChange(const sal_uInt16 /*nWhich*/) + void DefaultProperties::PostItemChange(const sal_uInt16 nWhich ) { + if( (nWhich == XATTR_FILLSTYLE) && (mpItemSet != NULL) ) + CleanupFillProperties(*mpItemSet); } void DefaultProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, sal_Bool /*bDontRemoveHardAttr*/) diff --git a/svx/source/sdr/properties/pageproperties.cxx b/svx/source/sdr/properties/pageproperties.cxx index 2fc92633b953..c1d0467b740e 100644 --- a/svx/source/sdr/properties/pageproperties.cxx +++ b/svx/source/sdr/properties/pageproperties.cxx @@ -89,6 +89,12 @@ namespace sdr return 0L; } + void PageProperties::PostItemChange(const sal_uInt16 nWhich ) + { + if( (nWhich == XATTR_FILLSTYLE) && (mpEmptyItemSet != NULL) ) + CleanupFillProperties(*mpEmptyItemSet); + } + void PageProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/) { // simply ignore item clearing on page objects diff --git a/svx/source/sdr/properties/properties.cxx b/svx/source/sdr/properties/properties.cxx index f8c307f26309..0439fd6baf4c 100644 --- a/svx/source/sdr/properties/properties.cxx +++ b/svx/source/sdr/properties/properties.cxx @@ -32,6 +32,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -182,6 +183,35 @@ namespace sdr { return 0; } + + void CleanupFillProperties( SfxItemSet& rItemSet ) + { + const bool bFillBitmap = rItemSet.GetItemState(XATTR_FILLBITMAP, sal_False) == SFX_ITEM_SET; + const bool bFillGradient = rItemSet.GetItemState(XATTR_FILLGRADIENT, sal_False) == SFX_ITEM_SET; + const bool bFillHatch = rItemSet.GetItemState(XATTR_FILLHATCH, sal_False) == SFX_ITEM_SET; + if( bFillBitmap || bFillGradient || bFillHatch ) + { + const XFillStyleItem* pFillStyleItem = dynamic_cast< const XFillStyleItem* >( rItemSet.GetItem(XATTR_FILLSTYLE) ); + if( pFillStyleItem ) + { + if( bFillBitmap && (pFillStyleItem->GetValue() != XFILL_BITMAP) ) + { + rItemSet.ClearItem( XATTR_FILLBITMAP ); + } + + if( bFillGradient && (pFillStyleItem->GetValue() != XFILL_GRADIENT) ) + { + rItemSet.ClearItem( XATTR_FILLGRADIENT ); + } + + if( bFillHatch && (pFillStyleItem->GetValue() != XFILL_HATCH) ) + { + rItemSet.ClearItem( XATTR_FILLHATCH ); + } + } + } + } + } // end of namespace properties } // end of namespace sdr -- cgit v1.2.3 From f269295e80eba9515f48f09561d04594b2652469 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Fri, 4 Mar 2011 21:31:20 +0100 Subject: impress210: #i50899# clean up fill attributes if fill style changes --- sd/source/ui/func/fupage.cxx | 27 ++++++++++++++++++--------- sd/source/ui/func/futempl.cxx | 41 +++-------------------------------------- 2 files changed, 21 insertions(+), 47 deletions(-) diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 4d068e1fde90..d8736d9b8ccb 100755 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -38,20 +38,14 @@ #include #include #include -#ifndef _MSGBOX_HXX //autogen #include -#endif #include #include #include #include #include -#ifndef _SVX_SVDORECT_HXX #include -#endif -#ifndef _SVX_SVDUNDO_HXX #include -#endif #include #include #include @@ -59,6 +53,7 @@ #include #include #include +#include #include "glob.hrc" #include @@ -393,7 +388,11 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) if(!mpPage->IsMasterPage()) { // on normal pages, switch off fill attribute usage - mpPage->getSdrPageProperties().PutItem(XFillStyleItem(XFILL_NONE)); + SdrPageProperties& rPageProperties = mpPage->getSdrPageProperties(); + rPageProperties.ClearItem( XATTR_FILLBITMAP ); + rPageProperties.ClearItem( XATTR_FILLGRADIENT ); + rPageProperties.ClearItem( XATTR_FILLHATCH ); + rPageProperties.PutItem(XFillStyleItem(XFILL_NONE)); } } } @@ -409,6 +408,7 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) StyleSheetUndoAction* pAction = new StyleSheetUndoAction(mpDoc, (SfxStyleSheet*)pStyleSheet, &(*pTempSet.get())); mpDocSh->GetUndoManager()->AddUndoAction(pAction); pStyleSheet->GetItemSet().Put( *(pTempSet.get()) ); + sdr::properties::CleanupFillProperties( pStyleSheet->GetItemSet() ); pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); } else if( bSetToAllPages ) @@ -430,6 +430,7 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) new StyleSheetUndoAction(mpDoc, (SfxStyleSheet*)pStyle, &(*pTempSet.get())); pUndoGroup->AddAction(pAction); pStyle->GetItemSet().Put( *(pTempSet.get()) ); + sdr::properties::CleanupFillProperties( pStyleSheet->GetItemSet() ); pStyle->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); } @@ -444,7 +445,13 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) { SdBackgroundObjUndoAction *pBackgroundObjUndoAction = new SdBackgroundObjUndoAction(*mpDoc, *pPage, rFillAttributes); pUndoGroup->AddAction(pBackgroundObjUndoAction); - pPage->getSdrPageProperties().PutItem(XFillStyleItem(XFILL_NONE)); + + SdrPageProperties& rPageProperties = pPage->getSdrPageProperties(); + rPageProperties.ClearItem( XATTR_FILLBITMAP ); + rPageProperties.ClearItem( XATTR_FILLGRADIENT ); + rPageProperties.ClearItem( XATTR_FILLHATCH ); + rPageProperties.PutItem(XFillStyleItem(XFILL_NONE)); + pPage->ActionChanged(); } } @@ -606,8 +613,10 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs ) delete mpBackgroundObjUndoAction; mpBackgroundObjUndoAction = new SdBackgroundObjUndoAction( *mpDoc, *mpPage, mpPage->getSdrPageProperties().GetItemSet()); + SfxItemSet aSet( *pArgs ); + sdr::properties::CleanupFillProperties(aSet); mpPage->getSdrPageProperties().ClearItem(); - mpPage->getSdrPageProperties().PutItemSet(*pArgs); + mpPage->getSdrPageProperties().PutItemSet(aSet); } } diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index d7a251cee531..363eba2f6dab 100755 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -49,6 +49,7 @@ #include #include #include +#include #include #include @@ -454,6 +455,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) sStyleName.Append( sal_Unicode( ' ' )); pStyleSheet->GetItemSet().Put(aTempSet); + SdStyleSheet* pRealSheet =((SdStyleSheet*)pStyleSheet)->GetRealStyleSheet(); pRealSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); @@ -477,45 +479,8 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) SfxItemSet& rAttr = pStyleSheet->GetItemSet(); -/* #i35937# - if ( rAttr.GetItemState( EE_PARA_LRSPACE ) == SFX_ITEM_ON ) - { - // SvxLRSpaceItem hart gesetzt: NumBulletItem anpassen - if ( aOriSet.GetItemState( EE_PARA_LRSPACE ) != SFX_ITEM_ON || - (const SvxLRSpaceItem&) aOriSet.Get( EE_PARA_LRSPACE ) != - (const SvxLRSpaceItem&) rAttr.Get( EE_PARA_LRSPACE ) ) - { - SvxNumBulletItem aNumBullet( (const SvxNumBulletItem&) rAttr.Get(EE_PARA_NUMBULLET) ); - - sal_uInt16 nLevel = 0; - if( (ePO >= PO_OUTLINE_2) && (ePO <= PO_OUTLINE_9) ) - nLevel = (sal_uInt16)(ePO - PO_OUTLINE_1 + 1); - - EditEngine::ImportBulletItem( aNumBullet, nLevel, NULL, - &(const SvxLRSpaceItem&) rAttr.Get( EE_PARA_LRSPACE ) ); + sdr::properties::CleanupFillProperties( rAttr ); - // the numbering bullet item is not valid in styles Outline 2 to Outline 9 - if( nLevel != 0 ) - { - // so put it into Outline 1 then.. - String sStyleName((SdResId(STR_PSEUDOSHEET_OUTLINE))); - sStyleName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " 1" ) ); - SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( sStyleName, SD_STYLE_FAMILY_PSEUDO); - - if(pFirstStyleSheet) - { - pFirstStyleSheet->GetItemSet().Put( aNumBullet); - SdStyleSheet* pRealSheet = ((SdStyleSheet*)pFirstStyleSheet)->GetRealStyleSheet(); - pRealSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); - } - } - else - { - ( (SfxItemSet&) rAttr).Put( aNumBullet ); - } - } - } -*/ // check for unique names of named items for xml if( rAttr.GetItemState( XATTR_FILLBITMAP ) == SFX_ITEM_SET ) { -- cgit v1.2.3 From 8eba9d593da0162c2fd2fa22d187df95fa6e5962 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Mon, 7 Mar 2011 10:36:26 +0100 Subject: impress210: #i116847# added CTRL-ALT-C as shortcut for inserting comments in calc --- officecfg/registry/data/org/openoffice/Office/Accelerators.xcu | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu index 2616566225b9..c61dc303dff1 100644 --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -863,6 +863,12 @@ .uno:Redo + + + I10N SHORTCUTS - NO TRANSLATE + .uno:InsertAnnotation + + -- cgit v1.2.3 From 734177cad7e8b91f2c76f091da4959bf1ae07e5c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 7 Mar 2011 18:45:22 +0100 Subject: gridfixes: #i117265# use a NumberFormatter for converting cell values to text. This means using the Locale setup in the Options, and allows for more value types (like Date/Time) to be supported --- svtools/inc/svtools/table/gridtablerenderer.hxx | 7 +- svtools/inc/svtools/table/tablerenderer.hxx | 21 +- svtools/source/table/cellvalueconversion.cxx | 453 ++++++++++++++++++++++-- svtools/source/table/cellvalueconversion.hxx | 16 +- svtools/source/table/gridtablerenderer.cxx | 22 +- svtools/source/table/tablecontrol_impl.cxx | 11 +- svtools/source/table/tabledatawindow.cxx | 3 +- 7 files changed, 500 insertions(+), 33 deletions(-) diff --git a/svtools/inc/svtools/table/gridtablerenderer.hxx b/svtools/inc/svtools/table/gridtablerenderer.hxx index c472fa408574..2c3c59e694f0 100644 --- a/svtools/inc/svtools/table/gridtablerenderer.hxx +++ b/svtools/inc/svtools/table/gridtablerenderer.hxx @@ -108,7 +108,12 @@ namespace svt { namespace table ColPos const i_colPos, RowPos const i_rowPos, bool const i_active, bool const i_selected, OutputDevice& i_targetDevice, Rectangle const & i_targetArea - ); + ) const; + virtual bool GetFormattedCellString( + ::com::sun::star::uno::Any const & i_cellValue, + ColPos const i_colPos, RowPos const i_rowPos, + ::rtl::OUString & o_cellString + ) const; private: struct CellRenderContext; diff --git a/svtools/inc/svtools/table/tablerenderer.hxx b/svtools/inc/svtools/table/tablerenderer.hxx index 3d50c9d70ee7..9b6aff71f959 100644 --- a/svtools/inc/svtools/table/tablerenderer.hxx +++ b/svtools/inc/svtools/table/tablerenderer.hxx @@ -259,7 +259,26 @@ namespace svt { namespace table ColPos const i_colPos, RowPos const i_rowPos, bool const i_active, bool const i_selected, OutputDevice& i_targetDevice, Rectangle const & i_targetArea - ) = 0; + ) const = 0; + + /** attempts to format the content of the given cell as string + + @param i_cellValue + the value for which an attempt for a string conversion should be made + @param i_colPos + the column position of the cell in question + @param i_rowPos + the row position of the cell in question + @param o_cellString + the cell content, formatted as string + @return + if and only if the content could be formatted as string + */ + virtual bool GetFormattedCellString( + ::com::sun::star::uno::Any const & i_cellValue, + ColPos const i_colPos, RowPos const i_rowPos, + ::rtl::OUString & o_cellString + ) const = 0; /// deletes the renderer instance virtual ~ITableRenderer() { } diff --git a/svtools/source/table/cellvalueconversion.cxx b/svtools/source/table/cellvalueconversion.cxx index 286ca505bb30..6e4d4a4ab7b9 100755 --- a/svtools/source/table/cellvalueconversion.cxx +++ b/svtools/source/table/cellvalueconversion.cxx @@ -29,8 +29,25 @@ #include "cellvalueconversion.hxx" /** === begin UNO includes === **/ +#include +#include +#include +#include +#include +#include +#include /** === end UNO includes === **/ +#include +#include +#include +#include +#include +#include + +#include +#include + //...................................................................................................................... namespace svt { @@ -38,36 +55,432 @@ namespace svt /** === begin UNO using === **/ using ::com::sun::star::uno::Any; + using ::com::sun::star::util::XNumberFormatter; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::util::XNumberFormatsSupplier; + using ::com::sun::star::beans::XPropertySet; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::util::DateTime; + using ::com::sun::star::uno::TypeClass; + using ::com::sun::star::util::XNumberFormatTypes; + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::Type; + using ::com::sun::star::uno::TypeClass_BYTE; + using ::com::sun::star::uno::TypeClass_SHORT; + using ::com::sun::star::uno::TypeClass_UNSIGNED_SHORT; + using ::com::sun::star::uno::TypeClass_LONG; + using ::com::sun::star::uno::TypeClass_UNSIGNED_LONG; + using ::com::sun::star::uno::TypeClass_HYPER; /** === end UNO using === **/ + namespace NumberFormat = ::com::sun::star::util::NumberFormat; + + typedef ::com::sun::star::util::Time UnoTime; + typedef ::com::sun::star::util::Date UnoDate; //================================================================================================================== - //= CellValueConversion + //= helper //================================================================================================================== - //------------------------------------------------------------------------------------------------------------------ - ::rtl::OUString CellValueConversion::convertToString( const Any& i_value ) + namespace { - ::rtl::OUString sConvertString; - if ( !i_value.hasValue() ) - return sConvertString; + //-------------------------------------------------------------------------------------------------------------- + double lcl_convertDateToDays( long const i_day, long const i_month, long const i_year ) + { + long const nNullDateDays = ::Date::DateToDays( 1, 1, 1900 ); + long const nValueDateDays = ::Date::DateToDays( i_day, i_month, i_year ); + + return nValueDateDays - nNullDateDays; + } + + //-------------------------------------------------------------------------------------------------------------- + double lcl_convertTimeToDays( long const i_hours, long const i_minutes, long const i_seconds, long const i_100thSeconds ) + { + return Time( i_hours, i_minutes, i_seconds, i_100thSeconds ).GetTimeInDays(); + } + } + + //================================================================================================================== + //= IValueNormalization + //================================================================================================================== + class SAL_NO_VTABLE IValueNormalization + { + public: + virtual ~IValueNormalization() { } + + /** converts the given Any into a double value to be fed into a number formatter + */ + virtual double convertToDouble( Any const & i_value ) const = 0; + + /** returns the format key to be used for formatting values + */ + virtual ::sal_Int32 getFormatKey() const = 0; + }; + + typedef ::boost::shared_ptr< IValueNormalization > PValueNormalization; + typedef ::std::hash_map< ::rtl::OUString, PValueNormalization, ::rtl::OUStringHash > NormalizerCache; + + //================================================================================================================== + //= CellValueConversion_Data + //================================================================================================================== + struct CellValueConversion_Data + { + ::comphelper::ComponentContext const aContext; + Reference< XNumberFormatter > xNumberFormatter; + bool bAttemptedFormatterCreation; + NormalizerCache aNormalizers; + + CellValueConversion_Data( ::comphelper::ComponentContext const & i_context ) + :aContext( i_context ) + ,xNumberFormatter() + ,bAttemptedFormatterCreation( false ) + ,aNormalizers() + { + } + }; + + //================================================================================================================== + //= StandardFormatNormalizer + //================================================================================================================== + class StandardFormatNormalizer : public IValueNormalization + { + protected: + StandardFormatNormalizer( Reference< XNumberFormatter > const & i_formatter, ::sal_Int32 const i_numberFormatType ) + :m_nFormatKey( 0 ) + { + try + { + ENSURE_OR_THROW( i_formatter.is(), "StandardFormatNormalizer: no formatter!" ); + Reference< XNumberFormatsSupplier > const xSupplier( i_formatter->getNumberFormatsSupplier(), UNO_SET_THROW ); + Reference< XNumberFormatTypes > const xTypes( xSupplier->getNumberFormats(), UNO_QUERY_THROW ); + m_nFormatKey = xTypes->getStandardFormat( i_numberFormatType, SvtSysLocale().GetLocale() ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + + virtual ::sal_Int32 getFormatKey() const + { + return m_nFormatKey; + } + + private: + ::sal_Int32 m_nFormatKey; + }; + + //================================================================================================================== + //= DoubleNormalization + //================================================================================================================== + class DoubleNormalization : public StandardFormatNormalizer + { + public: + DoubleNormalization( Reference< XNumberFormatter > const & i_formatter ) + :StandardFormatNormalizer( i_formatter, NumberFormat::NUMBER ) + { + } + + virtual double convertToDouble( Any const & i_value ) const + { + double returnValue(0); + ::rtl::math::setNan( &returnValue ); + OSL_VERIFY( i_value >>= returnValue ); + return returnValue; + } + + virtual ~DoubleNormalization() { } + }; + + //================================================================================================================== + //= IntegerNormalization + //================================================================================================================== + class IntegerNormalization : public StandardFormatNormalizer + { + public: + IntegerNormalization( Reference< XNumberFormatter > const & i_formatter ) + :StandardFormatNormalizer( i_formatter, NumberFormat::NUMBER ) + { + } + + virtual ~IntegerNormalization() {} + + virtual double convertToDouble( Any const & i_value ) const + { + sal_Int64 value( 0 ); + OSL_VERIFY( i_value >>= value ); + return value; + } + }; + + //================================================================================================================== + //= BooleanNormalization + //================================================================================================================== + class BooleanNormalization : public StandardFormatNormalizer + { + public: + BooleanNormalization( Reference< XNumberFormatter > const & i_formatter ) + :StandardFormatNormalizer( i_formatter, NumberFormat::LOGICAL ) + { + } + + virtual ~BooleanNormalization() {} + + virtual double convertToDouble( Any const & i_value ) const + { + bool value( false ); + OSL_VERIFY( i_value >>= value ); + return value ? 1 : 0; + } + }; + + //================================================================================================================== + //= DateTimeNormalization + //================================================================================================================== + class DateTimeNormalization : public StandardFormatNormalizer + { + public: + DateTimeNormalization( Reference< XNumberFormatter > const & i_formatter ) + :StandardFormatNormalizer( i_formatter, NumberFormat::DATETIME ) + { + } + + virtual ~DateTimeNormalization() {} + + virtual double convertToDouble( Any const & i_value ) const + { + double returnValue(0); + ::rtl::math::setNan( &returnValue ); + // extract actual UNO value + DateTime aDateTimeValue; + ENSURE_OR_RETURN( i_value >>= aDateTimeValue, "allowed for DateTime values only", returnValue ); - // TODO: use css.script.XTypeConverter? + // date part + returnValue = lcl_convertDateToDays( aDateTimeValue.Day, aDateTimeValue.Month, aDateTimeValue.Year ); - sal_Int32 nInt = 0; - sal_Bool bBool = false; - double fDouble = 0; + // time part + returnValue += lcl_convertTimeToDays( + aDateTimeValue.Hours, aDateTimeValue.Minutes, aDateTimeValue.Seconds, aDateTimeValue.HundredthSeconds ); + // done + return returnValue; + } + }; + + //================================================================================================================== + //= DateNormalization + //================================================================================================================== + class DateNormalization : public StandardFormatNormalizer + { + public: + DateNormalization( Reference< XNumberFormatter > const & i_formatter ) + :StandardFormatNormalizer( i_formatter, NumberFormat::DATE ) + { + } + + virtual ~DateNormalization() {} + + virtual double convertToDouble( Any const & i_value ) const + { + double returnValue(0); + ::rtl::math::setNan( &returnValue ); + + // extract + UnoDate aDateValue; + ENSURE_OR_RETURN( i_value >>= aDateValue, "allowed for Date values only", returnValue ); + + // convert + returnValue = lcl_convertDateToDays( aDateValue.Day, aDateValue.Month, aDateValue.Year ); + + // done + return returnValue; + } + }; + + //================================================================================================================== + //= TimeNormalization + //================================================================================================================== + class TimeNormalization : public StandardFormatNormalizer + { + public: + TimeNormalization( Reference< XNumberFormatter > const & i_formatter ) + :StandardFormatNormalizer( i_formatter, NumberFormat::TIME ) + { + } + + virtual ~TimeNormalization() {} + + virtual double convertToDouble( Any const & i_value ) const + { + double returnValue(0); + ::rtl::math::setNan( &returnValue ); + + // extract + UnoTime aTimeValue; + ENSURE_OR_RETURN( i_value >>= aTimeValue, "allowed for Time values only", returnValue ); + + // convert + returnValue += lcl_convertTimeToDays( + aTimeValue.Hours, aTimeValue.Minutes, aTimeValue.Seconds, aTimeValue.HundredthSeconds ); + + // done + return returnValue; + } + }; + + //================================================================================================================== + //= operations + //================================================================================================================== + namespace + { + //-------------------------------------------------------------------------------------------------------------- + bool lcl_ensureNumberFormatter( CellValueConversion_Data & io_data ) + { + if ( io_data.bAttemptedFormatterCreation ) + return io_data.xNumberFormatter.is(); + io_data.bAttemptedFormatterCreation = true; + + try + { + // a number formatter + Reference< XNumberFormatter > const xFormatter( + io_data.aContext.createComponent( "com.sun.star.util.NumberFormatter" ), UNO_QUERY_THROW ); + + // a supplier of number formats + Sequence< Any > aInitArgs(1); + aInitArgs[0] <<= SvtSysLocale().GetLocale(); + + Reference< XNumberFormatsSupplier > const xSupplier( + io_data.aContext.createComponentWithArguments( "com.sun.star.util.NumberFormatsSupplier", aInitArgs ), + UNO_QUERY_THROW + ); + + // ensure a NullDate we will assume later on + UnoDate const aNullDate( 1, 1, 1900 ); + Reference< XPropertySet > const xFormatSettings( xSupplier->getNumberFormatSettings(), UNO_SET_THROW ); + xFormatSettings->setPropertyValue( ::rtl::OUString::createFromAscii( "NullDate" ), makeAny( aNullDate ) ); + + // knit + xFormatter->attachNumberFormatsSupplier( xSupplier ); + + // done + io_data.xNumberFormatter = xFormatter; + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + + return io_data.xNumberFormatter.is(); + } + + //-------------------------------------------------------------------------------------------------------------- + bool lcl_getValueNormalizer( CellValueConversion_Data & io_data, Type const & i_valueType, + PValueNormalization & o_formatter ) + { + NormalizerCache::const_iterator pos = io_data.aNormalizers.find( i_valueType.getTypeName() ); + if ( pos == io_data.aNormalizers.end() ) + { + // never encountered this type before + o_formatter.reset(); + + ::rtl::OUString const sTypeName( i_valueType.getTypeName() ); + TypeClass const eTypeClass = i_valueType.getTypeClass(); + + if ( sTypeName.equals( ::cppu::UnoType< DateTime >::get().getTypeName() ) ) + { + o_formatter.reset( new DateTimeNormalization( io_data.xNumberFormatter ) ); + } + else if ( sTypeName.equals( ::cppu::UnoType< UnoDate >::get().getTypeName() ) ) + { + o_formatter.reset( new DateNormalization( io_data.xNumberFormatter ) ); + } + else if ( sTypeName.equals( ::cppu::UnoType< UnoTime >::get().getTypeName() ) ) + { + o_formatter.reset( new TimeNormalization( io_data.xNumberFormatter ) ); + } + else if ( sTypeName.equals( ::cppu::UnoType< ::sal_Bool >::get().getTypeName() ) ) + { + o_formatter.reset( new BooleanNormalization( io_data.xNumberFormatter ) ); + } + else if ( sTypeName.equals( ::cppu::UnoType< double >::get().getTypeName() ) + || sTypeName.equals( ::cppu::UnoType< float >::get().getTypeName() ) + ) + { + o_formatter.reset( new DoubleNormalization( io_data.xNumberFormatter ) ); + } + else if ( ( eTypeClass == TypeClass_BYTE ) + || ( eTypeClass == TypeClass_SHORT ) + || ( eTypeClass == TypeClass_UNSIGNED_SHORT ) + || ( eTypeClass == TypeClass_LONG ) + || ( eTypeClass == TypeClass_UNSIGNED_LONG ) + || ( eTypeClass == TypeClass_HYPER ) + ) + { + o_formatter.reset( new IntegerNormalization( io_data.xNumberFormatter ) ); + } + else + { +#if OSL_DEBUG_LEVEL > 0 + ::rtl::OStringBuffer message( "lcl_getValueNormalizer: unsupported type '" ); + message.append( ::rtl::OUStringToOString( sTypeName, RTL_TEXTENCODING_ASCII_US ) ); + message.append( "'!" ); + OSL_ENSURE( false, message.makeStringAndClear() ); +#endif + } + io_data.aNormalizers[ sTypeName ] = o_formatter; + } + else + o_formatter = pos->second; + + return !!o_formatter; + } + } + + //================================================================================================================== + //= CellValueConversion + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + CellValueConversion::CellValueConversion( ::comphelper::ComponentContext const & i_context ) + :m_pData( new CellValueConversion_Data( i_context ) ) + { + } + + //------------------------------------------------------------------------------------------------------------------ + CellValueConversion::~CellValueConversion() + { + } + + //------------------------------------------------------------------------------------------------------------------ + ::rtl::OUString CellValueConversion::convertToString( const Any& i_value ) + { ::rtl::OUString sStringValue; - if ( i_value >>= sConvertString ) - sStringValue = sConvertString; - else if ( i_value >>= nInt ) - sStringValue = sConvertString.valueOf( nInt ); - else if ( i_value >>= bBool ) - sStringValue = sConvertString.valueOf( bBool ); - else if ( i_value >>= fDouble ) - sStringValue = sConvertString.valueOf( fDouble ); - else - OSL_ENSURE( !i_value.hasValue(), "CellValueConversion::convertToString: cannot handle the given cell content type!" ); + if ( !i_value.hasValue() ) + return sStringValue; + + if ( ! ( i_value >>= sStringValue ) ) + { + if ( lcl_ensureNumberFormatter( *m_pData ) ) + { + PValueNormalization pNormalizer; + if ( lcl_getValueNormalizer( *m_pData, i_value.getValueType(), pNormalizer ) ) + { + try + { + double const formatterCompliantValue = pNormalizer->convertToDouble( i_value ); + sal_Int32 const formatKey = pNormalizer->getFormatKey(); + sStringValue = m_pData->xNumberFormatter->convertNumberToString( + formatKey, formatterCompliantValue ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + } + } return sStringValue; } diff --git a/svtools/source/table/cellvalueconversion.hxx b/svtools/source/table/cellvalueconversion.hxx index 4d6b8c8d6aac..c4d8baa98489 100755 --- a/svtools/source/table/cellvalueconversion.hxx +++ b/svtools/source/table/cellvalueconversion.hxx @@ -31,6 +31,13 @@ #include /** === end UNO includes === **/ +#include + +namespace comphelper +{ + class ComponentContext; +} + //...................................................................................................................... namespace svt { @@ -39,10 +46,17 @@ namespace svt //================================================================================================================== //= CellValueConversion //================================================================================================================== + struct CellValueConversion_Data; class CellValueConversion { public: - static ::rtl::OUString convertToString( const ::com::sun::star::uno::Any& i_cellValue ); + CellValueConversion( ::comphelper::ComponentContext const & i_context ); + ~CellValueConversion(); + + ::rtl::OUString convertToString( const ::com::sun::star::uno::Any& i_cellValue ); + + private: + ::boost::scoped_ptr< CellValueConversion_Data > m_pData; }; //...................................................................................................................... diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index 1e230d372c24..0b989c008de7 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -35,6 +35,7 @@ #include /** === end UNO includes === **/ +#include #include #include #include @@ -123,11 +124,14 @@ namespace svt { namespace table RowPos nCurrentRow; bool bUseGridLines; CachedSortIndicator aSortIndicator; + CellValueConversion aStringConverter; GridTableRenderer_Impl( ITableModel& _rModel ) :rModel( _rModel ) ,nCurrentRow( ROW_INVALID ) ,bUseGridLines( true ) + ,aSortIndicator( ) + ,aStringConverter( ::comphelper::ComponentContext( ::comphelper::getProcessServiceFactory() ) ) { } }; @@ -401,7 +405,7 @@ namespace svt { namespace table _rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() ); Any const rowHeading( m_pImpl->rModel.getRowHeading( m_pImpl->nCurrentRow ) ); - ::rtl::OUString const rowTitle( CellValueConversion::convertToString( rowHeading ) ); + ::rtl::OUString const rowTitle( m_pImpl->aStringConverter.convertToString( rowHeading ) ); if ( rowTitle.getLength() ) { ::Color const textColor = lcl_getEffectiveColor( m_pImpl->rModel.getHeaderTextColor(), _rStyle, &StyleSettings::GetFieldTextColor ); @@ -537,7 +541,7 @@ namespace svt { namespace table return; } - const ::rtl::OUString sText( CellValueConversion::convertToString( aCellContent ) ); + const ::rtl::OUString sText( m_pImpl->aStringConverter.convertToString( aCellContent ) ); impl_paintCellText( i_context, sText ); } @@ -572,7 +576,7 @@ namespace svt { namespace table //------------------------------------------------------------------------------------------------------------------ bool GridTableRenderer::FitsIntoCell( Any const & i_cellContent, ColPos const i_colPos, RowPos const i_rowPos, - bool const i_active, bool const i_selected, OutputDevice& i_targetDevice, Rectangle const & i_targetArea ) + bool const i_active, bool const i_selected, OutputDevice& i_targetDevice, Rectangle const & i_targetArea ) const { if ( !i_cellContent.hasValue() ) return true; @@ -592,7 +596,7 @@ namespace svt { namespace table return true; } - ::rtl::OUString const sText( CellValueConversion::convertToString( i_cellContent ) ); + ::rtl::OUString const sText( m_pImpl->aStringConverter.convertToString( i_cellContent ) ); if ( sText.getLength() == 0 ) return true; @@ -613,6 +617,16 @@ namespace svt { namespace table return true; } + //------------------------------------------------------------------------------------------------------------------ + bool GridTableRenderer::GetFormattedCellString( Any const & i_cellValue, ColPos const i_colPos, RowPos const i_rowPos, ::rtl::OUString & o_cellString ) const + { + o_cellString = m_pImpl->aStringConverter.convertToString( i_cellValue ); + + OSL_UNUSED( i_colPos ); + OSL_UNUSED( i_rowPos ); + return true; + } + //...................................................................................................................... } } // namespace svt::table //...................................................................................................................... diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 8e481d27d993..2309d3f3c3d5 100755 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -34,7 +34,6 @@ #include "tabledatawindow.hxx" #include "tablecontrol_impl.hxx" #include "tablegeometry.hxx" -#include "cellvalueconversion.hxx" /** === begin UNO includes === **/ #include @@ -2203,9 +2202,13 @@ namespace svt { namespace table //-------------------------------------------------------------------- ::rtl::OUString TableControl_Impl::getCellContentAsString( RowPos const i_row, ColPos const i_col ) { - ::com::sun::star::uno::Any content; - m_pModel->getCellContent( i_col, i_row, content ); - return CellValueConversion::convertToString( content ); + Any aCellValue; + m_pModel->getCellContent( i_col, i_row, aCellValue ); + + ::rtl::OUString sCellStringContent; + m_pModel->getRenderer()->GetFormattedCellString( aCellValue, i_col, i_row, sCellStringContent ); + + return sCellStringContent; } //-------------------------------------------------------------------- diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx index 11605e36c8b2..bd6f9b499444 100644 --- a/svtools/source/table/tabledatawindow.cxx +++ b/svtools/source/table/tabledatawindow.cxx @@ -32,7 +32,6 @@ #include "tabledatawindow.hxx" #include "tablecontrol_impl.hxx" #include "tablegeometry.hxx" -#include "cellvalueconversion.hxx" #include @@ -140,7 +139,7 @@ namespace svt { namespace table aCellToolTip.clear(); } - sHelpText = CellValueConversion::convertToString( aCellToolTip ); + pTableModel->getRenderer()->GetFormattedCellString( aCellToolTip, hitCol, hitRow, sHelpText ); if ( sHelpText.indexOf( '\n' ) >= 0 ) nHelpStyle = QUICKHELP_TIP_STYLE_BALLOON; -- cgit v1.2.3 From 175636c31e205c1769742a16d1ac2fc4b1ae4c3e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 7 Mar 2011 22:10:21 +0100 Subject: gridfixes: #i117625# recognize unsuccessful sorting attempts, and do not claim to be sorted afterwards --- .../source/controls/grid/sortablegriddatamodel.cxx | 28 +++++++++++++++------- .../source/controls/grid/sortablegriddatamodel.hxx | 6 ++++- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index db16ee7ad7e2..b11f65d264e9 100755 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx @@ -332,14 +332,18 @@ namespace toolkit lcl_clear( m_publicToPrivateRowIndex ); lcl_clear( m_privateToPublicRowIndex ); + // rebuild the index + if ( !impl_reIndex_nothrow( m_currentSortColumn, m_sortAscending ) ) + { + impl_removeColumnSort( i_instanceLock ); + return; + } + // broadcast an artificial event, saying that all rows have been removed GridDataEvent const aRemovalEvent( *this, -1, -1, -1, -1 ); impl_broadcast( &XGridDataListener::rowsRemoved, aRemovalEvent, i_instanceLock ); i_instanceLock.reset(); - // rebuild the index - impl_reIndex_nothrow( m_currentSortColumn, m_sortAscending ); - // broadcast an artificial event, saying that n rows have been added GridDataEvent const aAdditionEvent( *this, -1, -1, 0, m_delegator->getRowCount() - 1 ); impl_broadcast( &XGridDataListener::rowsInserted, aAdditionEvent, i_instanceLock ); @@ -475,7 +479,7 @@ namespace toolkit } //------------------------------------------------------------------------------------------------------------------ - void SortableGridDataModel::impl_reIndex_nothrow( ::sal_Int32 const i_columnIndex, sal_Bool const i_sortAscending ) + bool SortableGridDataModel::impl_reIndex_nothrow( ::sal_Int32 const i_columnIndex, sal_Bool const i_sortAscending ) { ::sal_Int32 const rowCount( getRowCount() ); ::std::vector< ::sal_Int32 > aPublicToPrivate( rowCount ); @@ -497,7 +501,7 @@ namespace toolkit // get predicate object ::std::auto_ptr< ::comphelper::IKeyPredicateLess > const pPredicate( ::comphelper::getStandardLessPredicate( dataType, m_collator ) ); - ENSURE_OR_RETURN_VOID( pPredicate.get(), "SortableGridDataModel::impl_reIndex_nothrow: no sortable data found!" ); + ENSURE_OR_RETURN_FALSE( pPredicate.get(), "SortableGridDataModel::impl_reIndex_nothrow: no sortable data found!" ); // then sort CellDataLessComparison const aComparator( aColumnData, *pPredicate, i_sortAscending ); @@ -506,7 +510,7 @@ namespace toolkit catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); - return; + return false; } // also build the "private to public" mapping @@ -516,6 +520,8 @@ namespace toolkit m_publicToPrivateRowIndex.swap( aPublicToPrivate ); m_privateToPublicRowIndex.swap( aPrivateToPublic ); + + return true; } //------------------------------------------------------------------------------------------------------------------ @@ -527,7 +533,8 @@ namespace toolkit if ( ( i_columnIndex < 0 ) || ( i_columnIndex >= getColumnCount() ) ) throw IndexOutOfBoundsException( ::rtl::OUString(), *this ); - impl_reIndex_nothrow( i_columnIndex, i_sortAscending ); + if ( !impl_reIndex_nothrow( i_columnIndex, i_sortAscending ) ) + return; m_currentSortColumn = i_columnIndex; m_sortAscending = i_sortAscending; @@ -540,14 +547,19 @@ namespace toolkit } //------------------------------------------------------------------------------------------------------------------ - void SortableGridDataModel::impl_removeColumnSort( MethodGuard& i_instanceLock ) + void SortableGridDataModel::impl_removeColumnSort_noBroadcast() { lcl_clear( m_publicToPrivateRowIndex ); lcl_clear( m_privateToPublicRowIndex ); m_currentSortColumn = -1; m_sortAscending = sal_True; + } + //------------------------------------------------------------------------------------------------------------------ + void SortableGridDataModel::impl_removeColumnSort( MethodGuard& i_instanceLock ) + { + impl_removeColumnSort_noBroadcast(); impl_broadcast( &XGridDataListener::dataChanged, GridDataEvent( *this, -1, -1, -1, -1 ), diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.hxx b/toolkit/source/controls/grid/sortablegriddatamodel.hxx index 0b07ff2d991a..6f0718fd5b17 100755 --- a/toolkit/source/controls/grid/sortablegriddatamodel.hxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.hxx @@ -155,7 +155,7 @@ namespace toolkit Neither m_currentSortColumn nor m_sortAscending are touched by this method. Also, the given column index is not checked, this is the responsibility of the caller. */ - void impl_reIndex_nothrow( ::sal_Int32 const i_columnIndex, sal_Bool const i_sortAscending ); + bool impl_reIndex_nothrow( ::sal_Int32 const i_columnIndex, sal_Bool const i_sortAscending ); /** translates the given event, obtained from our delegator, to a version which can be broadcasted to our own clients. @@ -184,6 +184,10 @@ namespace toolkit */ void impl_removeColumnSort( MethodGuard& i_instanceLock ); + /** removes the current sorting, without any broadcast + */ + void impl_removeColumnSort_noBroadcast(); + private: ::comphelper::ComponentContext m_context; bool m_isInitialized; -- cgit v1.2.3 From a60ea75d4ccbb1eedf1b5fc9160b0a43972f4647 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Mar 2011 10:01:53 +0100 Subject: gridfixes: #i117265# implement less-predicate for Date/Time structs --- comphelper/source/misc/anycompare.cxx | 130 ++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/comphelper/source/misc/anycompare.cxx b/comphelper/source/misc/anycompare.cxx index a86174daf08e..d01363e6656a 100755 --- a/comphelper/source/misc/anycompare.cxx +++ b/comphelper/source/misc/anycompare.cxx @@ -29,6 +29,9 @@ #include "comphelper/anycompare.hxx" /** === begin UNO includes === **/ +#include +#include +#include /** === end UNO includes === **/ //...................................................................................................................... @@ -63,9 +66,128 @@ namespace comphelper using ::com::sun::star::uno::TypeClass_TYPE; using ::com::sun::star::uno::TypeClass_ENUM; using ::com::sun::star::uno::TypeClass_INTERFACE; + using ::com::sun::star::uno::TypeClass_STRUCT; using ::com::sun::star::i18n::XCollator; + using ::com::sun::star::util::Date; + using ::com::sun::star::util::Time; + using ::com::sun::star::util::DateTime; /** === end UNO using === **/ + //================================================================================================================== + //= DatePredicateLess + //================================================================================================================== + class DatePredicateLess : public IKeyPredicateLess + { + public: + virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const + { + Date lhs, rhs; + if ( !( _lhs >>= lhs ) + || !( _rhs >>= rhs ) + ) + throw ::com::sun::star::lang::IllegalArgumentException(); + + if ( lhs.Year < rhs.Year ) + return true; + if ( lhs.Year > rhs.Year ) + return false; + + if ( lhs.Month < rhs.Month ) + return true; + if ( lhs.Month > rhs.Month ) + return false; + + if ( lhs.Day < rhs.Day ) + return true; + return false; + } + }; + + //================================================================================================================== + //= TimePredicateLess + //================================================================================================================== + class TimePredicateLess : public IKeyPredicateLess + { + public: + virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const + { + Time lhs, rhs; + if ( !( _lhs >>= lhs ) + || !( _rhs >>= rhs ) + ) + throw ::com::sun::star::lang::IllegalArgumentException(); + + if ( lhs.Hours < rhs.Hours ) + return true; + if ( lhs.Hours > rhs.Hours ) + return false; + + if ( lhs.Minutes < rhs.Minutes ) + return true; + if ( lhs.Minutes > rhs.Minutes ) + return false; + + if ( lhs.Seconds < rhs.Seconds ) + return true; + if ( lhs.Seconds > rhs.Seconds ) + return false; + + if ( lhs.HundredthSeconds < rhs.HundredthSeconds ) + return true; + return false; + } + }; + + //================================================================================================================== + //= DateTimePredicateLess + //================================================================================================================== + class DateTimePredicateLess : public IKeyPredicateLess + { + public: + virtual bool isLess( ::com::sun::star::uno::Any const & _lhs, ::com::sun::star::uno::Any const & _rhs ) const + { + DateTime lhs, rhs; + if ( !( _lhs >>= lhs ) + || !( _rhs >>= rhs ) + ) + throw ::com::sun::star::lang::IllegalArgumentException(); + + if ( lhs.Year < rhs.Year ) + return true; + if ( lhs.Year > rhs.Year ) + return false; + + if ( lhs.Month < rhs.Month ) + return true; + if ( lhs.Month > rhs.Month ) + return false; + + if ( lhs.Day < rhs.Day ) + return true; + if ( lhs.Day > rhs.Day ) + return false; + + if ( lhs.Hours < rhs.Hours ) + return true; + if ( lhs.Hours > rhs.Hours ) + return false; + + if ( lhs.Minutes < rhs.Minutes ) + return true; + if ( lhs.Minutes > rhs.Minutes ) + return false; + + if ( lhs.Seconds < rhs.Seconds ) + return true; + if ( lhs.Seconds > rhs.Seconds ) + return false; + + if ( lhs.HundredthSeconds < rhs.HundredthSeconds ) + return true; + return false; + } + }; + //------------------------------------------------------------------------------------------------------------------ ::std::auto_ptr< IKeyPredicateLess > getStandardLessPredicate( Type const & i_type, Reference< XCollator > const & i_collator ) { @@ -120,6 +242,14 @@ namespace comphelper case TypeClass_INTERFACE: pComparator.reset( new InterfacePredicateLess() ); break; + case TypeClass_STRUCT: + if ( i_type.equals( ::cppu::UnoType< Date >::get() ) ) + pComparator.reset( new DatePredicateLess() ); + else if ( i_type.equals( ::cppu::UnoType< Time >::get() ) ) + pComparator.reset( new TimePredicateLess() ); + else if ( i_type.equals( ::cppu::UnoType< DateTime >::get() ) ) + pComparator.reset( new DateTimePredicateLess() ); + break; default: break; } -- cgit v1.2.3 From 3d0e2f3b051fef3c4ee8cdf4fbc45be0cdffb737 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Mar 2011 11:01:23 +0100 Subject: gridfixes: let Control notify a change in its ControlFocus via StateChanged --- vcl/inc/vcl/ctrl.hxx | 6 +++++- vcl/inc/vcl/window.hxx | 1 + vcl/source/control/ctrl.cxx | 10 ++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/vcl/inc/vcl/ctrl.hxx b/vcl/inc/vcl/ctrl.hxx index 3bf529ada48b..88a4e1f08362 100644 --- a/vcl/inc/vcl/ctrl.hxx +++ b/vcl/inc/vcl/ctrl.hxx @@ -47,7 +47,7 @@ protected: ::vcl::ImplControlData* mpControlData; private: - sal_Bool mbHasFocus; + bool mbHasControlFocus; Link maGetFocusHdl; Link maLoseFocusHdl; @@ -179,6 +179,10 @@ public: void SetLoseFocusHdl( const Link& rLink ) { maLoseFocusHdl = rLink; } const Link& GetLoseFocusHdl() const { return maLoseFocusHdl; } + /** determines whether the control currently has the focus + */ + bool HasControlFocus() const { return mbHasControlFocus; } + void SetLayoutDataParent( const Control* pParent ) const; virtual Size GetOptimalSize(WindowSizeType eType) const; diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index f367be85051d..219bd4328b1b 100755 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -270,6 +270,7 @@ typedef sal_uInt16 StateChangedType; #define STATE_CHANGE_FORMAT ((StateChangedType)17) #define STATE_CHANGE_EXTENDEDSTYLE ((StateChangedType)18) #define STATE_CHANGE_MIRRORING ((StateChangedType)19) +#define STATE_CHANGE_CONTROL_FOCUS ((StateChangedType)20) #define STATE_CHANGE_USER ((StateChangedType)10000) // GetFocusFlags diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index 6bbe5bb32c38..50663d33250d 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -49,7 +49,7 @@ using namespace vcl; void Control::ImplInitControlData() { - mbHasFocus = sal_False; + mbHasControlFocus = sal_False; mpControlData = new ImplControlData; } @@ -303,9 +303,10 @@ long Control::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) { - if ( !mbHasFocus ) + if ( !mbHasControlFocus ) { - mbHasFocus = sal_True; + mbHasControlFocus = sal_True; + StateChanged( STATE_CHANGE_CONTROL_FOCUS ); if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_GETFOCUS, maGetFocusHdl, this ) ) // been destroyed within the handler return sal_True; @@ -318,7 +319,8 @@ long Control::Notify( NotifyEvent& rNEvt ) Window* pFocusWin = Application::GetFocusWindow(); if ( !pFocusWin || !ImplIsWindowOrChild( pFocusWin ) ) { - mbHasFocus = sal_False; + mbHasControlFocus = sal_False; + StateChanged( STATE_CHANGE_CONTROL_FOCUS ); if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_LOSEFOCUS, maLoseFocusHdl, this ) ) // been destroyed within the handler return sal_True; -- cgit v1.2.3 From 9216e81a0b063c5085f973671a19e44b3d60db7d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Mar 2011 11:04:49 +0100 Subject: gridfixes: when the table controls does not have the focus, use a different color to paint the selection, to be consistent with all our other controls --- svtools/inc/svtools/table/gridtablerenderer.hxx | 6 +- svtools/inc/svtools/table/tablerenderer.hxx | 24 ++--- svtools/source/table/gridtablerenderer.cxx | 19 ++-- svtools/source/table/tablecontrol.cxx | 4 + svtools/source/table/tablecontrol_impl.cxx | 132 +++++++++++------------- svtools/source/table/tablecontrol_impl.hxx | 14 ++- 6 files changed, 96 insertions(+), 103 deletions(-) diff --git a/svtools/inc/svtools/table/gridtablerenderer.hxx b/svtools/inc/svtools/table/gridtablerenderer.hxx index 2c3c59e694f0..d7196419e2e5 100644 --- a/svtools/inc/svtools/table/gridtablerenderer.hxx +++ b/svtools/inc/svtools/table/gridtablerenderer.hxx @@ -90,15 +90,15 @@ namespace svt { namespace table virtual void PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle ); - virtual void PrepareRow( RowPos _nRow, bool _bActive, bool _bSelected, + virtual void PrepareRow( RowPos _nRow, bool i_hasControlFocus, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rRowArea, const StyleSettings& _rStyle ); virtual void PaintRowHeader( - bool _bActive, bool _bSelected, + bool i_hasControlFocus, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle ); virtual void PaintCell( ColPos const i_col, - bool _bActive, bool _bSelected, + bool i_hasControlFocus, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle ); virtual void ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect); diff --git a/svtools/inc/svtools/table/tablerenderer.hxx b/svtools/inc/svtools/table/tablerenderer.hxx index 9b6aff71f959..73d41028bf1f 100644 --- a/svtools/inc/svtools/table/tablerenderer.hxx +++ b/svtools/inc/svtools/table/tablerenderer.hxx @@ -133,9 +133,8 @@ namespace svt { namespace table However, the renderer is also allowed to render any cell-independent content of this row. - @param _bActive - if and only if the row to be painted contains the - currently active cell. + @param i_hasControlFocus + if and only if the table control currently has the focus @param _bSelected if and only if the row to be prepared is selected currently. @@ -147,7 +146,7 @@ namespace svt { namespace table @param _rStyle the style to be used for drawing */ - virtual void PrepareRow( RowPos _nRow, bool _bActive, bool _bSelected, + virtual void PrepareRow( RowPos _nRow, bool i_hasControlFocus, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rRowArea, const StyleSettings& _rStyle ) = 0; @@ -156,9 +155,8 @@ namespace svt { namespace table The row to be painted is denoted by the most recent call to ->PrepareRow. - @param _bActive - if and only if the row to be painted contains the - currently active cell. + @param i_hasControlFocus + if and only if the table control currently has the focus
Note that this flag is equal to the respective flag in the previous ->PrepareRow call, it's passed here for convinience @@ -177,9 +175,9 @@ namespace svt { namespace table @param _rStyle the style to be used for drawing */ - virtual void PaintRowHeader( bool _bActive, bool _bSelected, - OutputDevice& _rDevice, const Rectangle& _rArea, - const StyleSettings& _rStyle ) = 0; + virtual void PaintRowHeader( bool i_hasControlFocus, bool _bSelected, + OutputDevice& _rDevice, Rectangle const & _rArea, + StyleSettings const & _rStyle ) = 0; /** paints a certain cell @@ -194,8 +192,8 @@ namespace svt { namespace table Note that this flag is equal to the respective flag in the previous ->PrepareRow call, it's passed here for convinience only. - @param _bActive - if the cell is currently active. + @param i_hasControlFocus + if and only if the table control currently has the focus
Note that this flag is equal to the respective flag in the previous ->PrepareRow call, it's passed here for convinience @@ -208,7 +206,7 @@ namespace svt { namespace table the style to be used for drawing */ virtual void PaintCell( ColPos const i_col, - bool _bActive, bool _bSelected, + bool i_hasControlFocus, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle ) = 0; diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index 0b989c008de7..92cf6232e7a3 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -328,7 +328,7 @@ namespace svt { namespace table } //------------------------------------------------------------------------------------------------------------------ - void GridTableRenderer::PrepareRow( RowPos _nRow, bool _bActive, bool _bSelected, + void GridTableRenderer::PrepareRow( RowPos _nRow, bool i_hasControlFocus, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rRowArea, const StyleSettings& _rStyle ) { // remember the row for subsequent calls to the other ->ITableRenderer methods @@ -344,7 +344,7 @@ namespace svt { namespace table if ( _bSelected ) { // selected rows use the background color from the style - backgroundColor = _rStyle.GetHighlightColor(); + backgroundColor = i_hasControlFocus ? _rStyle.GetHighlightColor() : _rStyle.GetDeactiveColor(); if ( !aLineColor ) lineColor = backgroundColor; } @@ -388,13 +388,10 @@ namespace svt { namespace table _rDevice.DrawRect( _rRowArea ); _rDevice.Pop(); - - (void)_bActive; - // row containing the active cell not rendered any special at the moment } //------------------------------------------------------------------------------------------------------------------ - void GridTableRenderer::PaintRowHeader( bool _bActive, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea, + void GridTableRenderer::PaintRowHeader( bool i_hasControlFocus, bool _bSelected, OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle ) { _rDevice.Push( PUSH_LINECOLOR | PUSH_TEXTCOLOR ); @@ -417,8 +414,7 @@ namespace svt { namespace table _rDevice.DrawText( aTextRect, rowTitle, nDrawTextFlags ); } - // TODO: active? selected? - (void)_bActive; + (void)i_hasControlFocus; (void)_bSelected; _rDevice.Pop(); } @@ -444,7 +440,7 @@ namespace svt { namespace table }; //------------------------------------------------------------------------------------------------------------------ - void GridTableRenderer::PaintCell( ColPos const i_column, bool _bSelected, bool _bActive, + void GridTableRenderer::PaintCell( ColPos const i_column, bool _bSelected, bool i_hasControlFocus, OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle ) { _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); @@ -461,7 +457,7 @@ namespace svt { namespace table if ( _bSelected && !aLineColor ) { // if no line color is specified by the model, use the usual selection color for lines in selected cells - lineColor = _rStyle.GetHighlightColor(); + lineColor = i_hasControlFocus ? _rStyle.GetHighlightColor() : _rStyle.GetDeactiveColor(); } _rDevice.SetLineColor( lineColor ); @@ -470,9 +466,6 @@ namespace svt { namespace table } _rDevice.Pop(); - - (void)_bActive; - // no special painting for the active cell at the moment } //------------------------------------------------------------------------------------------------------------------ diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index e9d88853a8ec..6216c19286d3 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -108,6 +108,10 @@ namespace svt { namespace table // forward certain settings to the data window switch ( i_nStateChange ) { + case STATE_CHANGE_CONTROL_FOCUS: + m_pImpl->invalidateSelectedRows(); + break; + case STATE_CHANGE_CONTROLBACKGROUND: if ( IsControlBackground() ) getDataWindow().SetControlBackground( GetControlBackground() ); diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 2309d3f3c3d5..0e31dec36f66 100755 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -1407,14 +1407,14 @@ namespace svt { namespace table if ( _rUpdateRect.GetIntersection( aRowIterator.getRect() ).IsEmpty() ) continue; - bool const isActiveRow = ( aRowIterator.getRow() == getCurrentRow() ); + bool const isControlFocused = m_rAntiImpl.HasControlFocus(); bool const isSelectedRow = isRowSelected( aRowIterator.getRow() ); Rectangle const aRect = aRowIterator.getRect().GetIntersection( aAllDataCellsArea ); // give the redenderer a chance to prepare the row pRenderer->PrepareRow( - aRowIterator.getRow(), isActiveRow, isSelectedRow, + aRowIterator.getRow(), isControlFocused, isSelectedRow, *m_pDataWindow, aRect, rStyle ); @@ -1422,7 +1422,7 @@ namespace svt { namespace table if ( m_pModel->hasRowHeaders() ) { const Rectangle aCurrentRowHeader( aRowHeaderArea.GetIntersection( aRowIterator.getRect() ) ); - pRenderer->PaintRowHeader( isActiveRow, isSelectedRow, *m_pDataWindow, aCurrentRowHeader, + pRenderer->PaintRowHeader( isControlFocused, isSelectedRow, *m_pDataWindow, aCurrentRowHeader, rStyle ); } @@ -1436,7 +1436,7 @@ namespace svt { namespace table ) { bool isSelectedColumn = false; - pRenderer->PaintCell( aCell.getColumn(), isSelectedRow || isSelectedColumn, isActiveRow, + pRenderer->PaintCell( aCell.getColumn(), isSelectedRow || isSelectedColumn, isControlFocused, *m_pDataWindow, aCell.getRect(), rStyle ); } } @@ -1468,30 +1468,25 @@ namespace svt { namespace table bool bSuccess = false; bool selectionChanged = false; - Rectangle rCells; switch ( _eAction ) { case cursorDown: - if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION) + if ( m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION ) { //if other rows already selected, deselect them - if(m_aSelectedRows.size()>0) + if ( m_aSelectedRows.size()>0 ) { - for(std::vector::iterator it=m_aSelectedRows.begin(); - it!=m_aSelectedRows.end();++it) - { - invalidateSelectedRegion(*it, *it, rCells); - } + invalidateSelectedRows(); m_aSelectedRows.clear(); } - if(m_nCurRow < m_nRowCount-1) + if ( m_nCurRow < m_nRowCount-1 ) { ++m_nCurRow; m_aSelectedRows.push_back(m_nCurRow); } else m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); + invalidateRow( m_nCurRow ); ensureVisible(m_nCurColumn,m_nCurRow,false); selectionChanged = true; bSuccess = true; @@ -1508,23 +1503,19 @@ namespace svt { namespace table { if(m_aSelectedRows.size()>0) { - for(std::vector::iterator it=m_aSelectedRows.begin(); - it!=m_aSelectedRows.end();++it) - { - invalidateSelectedRegion(*it, *it, rCells); - } + invalidateSelectedRows(); m_aSelectedRows.clear(); } if(m_nCurRow>0) { --m_nCurRow; m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); + invalidateRow( m_nCurRow ); } else { m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); + invalidateRow( m_nCurRow ); } ensureVisible(m_nCurColumn,m_nCurRow,false); selectionChanged = true; @@ -1606,7 +1597,7 @@ namespace svt { namespace table //else select the row->put it in the vector else m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); + invalidateRow( m_nCurRow ); selectionChanged = true; bSuccess = true; } @@ -1629,14 +1620,10 @@ namespace svt { namespace table //and select the current row if(m_nAnchor==-1) { - for(std::vector::iterator it=m_aSelectedRows.begin(); - it!=m_aSelectedRows.end();++it) - { - invalidateSelectedRegion(*it, *it, rCells); - } + invalidateSelectedRows(); m_aSelectedRows.clear(); m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); + invalidateRow( m_nCurRow ); } else { @@ -1654,12 +1641,12 @@ namespace svt { namespace table if(nextRow>-1 && m_aSelectedRows[nextRow] == m_nCurRow) { m_aSelectedRows.erase(m_aSelectedRows.begin()+prevRow); - invalidateSelectedRegion(m_nCurRow+1, m_nCurRow+1, rCells); + invalidateRow( m_nCurRow + 1 ); } else { m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); + invalidateRow( m_nCurRow ); } } else @@ -1669,7 +1656,7 @@ namespace svt { namespace table m_aSelectedRows.push_back(m_nCurRow); m_nCurRow--; m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells); + invalidateSelectedRegion( m_nCurRow+1, m_nCurRow ); } } } @@ -1684,12 +1671,12 @@ namespace svt { namespace table m_aSelectedRows.push_back(m_nCurRow); m_nCurRow--; m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow+1, m_nCurRow, rCells); + invalidateSelectedRegion( m_nCurRow+1, m_nCurRow ); } else { m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); + invalidateRow( m_nCurRow ); } } m_pSelEngine->SetAnchor(sal_True); @@ -1716,14 +1703,10 @@ namespace svt { namespace table //and select the current row if(m_nAnchor==-1) { - for(std::vector::iterator it=m_aSelectedRows.begin(); - it!=m_aSelectedRows.end();++it) - { - invalidateSelectedRegion(*it, *it, rCells); - } + invalidateSelectedRows(); m_aSelectedRows.clear(); m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); + invalidateRow( m_nCurRow ); } else { @@ -1741,12 +1724,12 @@ namespace svt { namespace table if(nextRow>-1 && m_aSelectedRows[nextRow] == m_nCurRow) { m_aSelectedRows.erase(m_aSelectedRows.begin()+prevRow); - invalidateSelectedRegion(m_nCurRow-1, m_nCurRow-1, rCells); + invalidateRow( m_nCurRow - 1 ); } else { m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); + invalidateRow( m_nCurRow ); } } else @@ -1756,7 +1739,7 @@ namespace svt { namespace table m_aSelectedRows.push_back(m_nCurRow); m_nCurRow++; m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells); + invalidateSelectedRegion( m_nCurRow-1, m_nCurRow ); } } } @@ -1769,12 +1752,12 @@ namespace svt { namespace table m_aSelectedRows.push_back(m_nCurRow); m_nCurRow++; m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow-1, m_nCurRow, rCells); + invalidateSelectedRegion( m_nCurRow-1, m_nCurRow ); } else { m_aSelectedRows.push_back(m_nCurRow); - invalidateSelectedRegion(m_nCurRow, m_nCurRow, rCells); + invalidateRow( m_nCurRow ); } } m_pSelEngine->SetAnchor(sal_True); @@ -1796,7 +1779,7 @@ namespace svt { namespace table { //select the region between the current and the upper row RowPos iter = m_nCurRow; - invalidateSelectedRegion(m_nCurRow, 0, rCells); + invalidateSelectedRegion( m_nCurRow, 0 ); //put the rows in vector while(iter>=0) { @@ -1822,7 +1805,7 @@ namespace svt { namespace table return bSuccess = false; //select the region between the current and the last row RowPos iter = m_nCurRow; - invalidateSelectedRegion(m_nCurRow, m_nRowCount-1, rCells); + invalidateSelectedRegion( m_nCurRow, m_nRowCount-1 ); //put the rows in the vector while(iter<=m_nRowCount) { @@ -2019,48 +2002,59 @@ namespace svt { namespace table } //------------------------------------------------------------------------------------------------------------------ - void TableControl_Impl::invalidateSelectedRegion(RowPos _nPrevRow, RowPos _nCurRow, Rectangle& _rCellRect) + void TableControl_Impl::invalidateSelectedRegion( RowPos _nPrevRow, RowPos _nCurRow ) { DBG_CHECK_ME(); - //get the visible area of the table control and set the Left and right border of the region to be repainted + // get the visible area of the table control and set the Left and right border of the region to be repainted Rectangle const aAllCells( impl_getAllVisibleCellsArea() ); - _rCellRect.Left() = aAllCells.Left(); - _rCellRect.Right() = aAllCells.Right(); - //if only one row is selected - if(_nPrevRow == _nCurRow) + + Rectangle aInvalidateRect; + aInvalidateRect.Left() = aAllCells.Left(); + aInvalidateRect.Right() = aAllCells.Right(); + // if only one row is selected + if ( _nPrevRow == _nCurRow ) { Rectangle aCellRect; impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect ); - _rCellRect.Top() = aCellRect.Top(); - _rCellRect.Bottom() = aCellRect.Bottom(); + aInvalidateRect.Top() = aCellRect.Top(); + aInvalidateRect.Bottom() = aCellRect.Bottom(); } //if the region is above the current row else if(_nPrevRow < _nCurRow ) { Rectangle aCellRect; impl_getCellRect( m_nCurColumn, _nPrevRow, aCellRect ); - _rCellRect.Top() = aCellRect.Top(); + aInvalidateRect.Top() = aCellRect.Top(); impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect ); - _rCellRect.Bottom() = aCellRect.Bottom(); + aInvalidateRect.Bottom() = aCellRect.Bottom(); } //if the region is beneath the current row else { Rectangle aCellRect; impl_getCellRect( m_nCurColumn, _nCurRow, aCellRect ); - _rCellRect.Top() = aCellRect.Top(); + aInvalidateRect.Top() = aCellRect.Top(); impl_getCellRect( m_nCurColumn, _nPrevRow, aCellRect ); - _rCellRect.Bottom() = aCellRect.Bottom(); + aInvalidateRect.Bottom() = aCellRect.Bottom(); } - m_pDataWindow->Invalidate(_rCellRect); + m_pDataWindow->Invalidate( aInvalidateRect ); } + //------------------------------------------------------------------------------------------------------------------ - void TableControl_Impl::invalidateRowRange( RowPos const i_firstRow, RowPos const i_lastRow ) + void TableControl_Impl::invalidateSelectedRows() { - if ( m_nCursorHidden == 2 ) - // WTF? what kind of hack is this? - --m_nCursorHidden; + for ( ::std::vector< RowPos >::iterator selRow = m_aSelectedRows.begin(); + selRow != m_aSelectedRows.end(); + ++selRow + ) + { + invalidateRow( *selRow ); + } + } + //------------------------------------------------------------------------------------------------------------------ + void TableControl_Impl::invalidateRowRange( RowPos const i_firstRow, RowPos const i_lastRow ) + { RowPos const firstRow = i_firstRow < m_nTopRow ? m_nTopRow : i_firstRow; RowPos const lastVisibleRow = m_nTopRow + impl_getVisibleRows( true ) - 1; RowPos const lastRow = ( ( i_lastRow == ROW_INVALID ) || ( i_lastRow > lastVisibleRow ) ) ? lastVisibleRow : i_lastRow; @@ -2669,8 +2663,7 @@ namespace svt { namespace table } m_pTableControl->setAnchor( m_pTableControl->getAnchor() - 1 ); } - Rectangle aCellRect; - m_pTableControl->invalidateSelectedRegion( m_pTableControl->getCurRow(), newRow, aCellRect ); + m_pTableControl->invalidateSelectedRegion( m_pTableControl->getCurRow(), newRow ); bHandled = sal_True; } //no region selected @@ -2693,8 +2686,7 @@ namespace svt { namespace table if ( m_pTableControl->getSelectedRowCount() > 1 && m_pTableControl->getSelEngine()->GetSelectionMode() != SINGLE_SELECTION ) m_pTableControl->getSelEngine()->AddAlways(sal_True); - Rectangle aCellRect; - m_pTableControl->invalidateSelectedRegion( newRow, newRow, aCellRect ); + m_pTableControl->invalidateRow( newRow ); bHandled = sal_True; } m_pTableControl->goTo( newCol, newRow ); @@ -2719,8 +2711,7 @@ namespace svt { namespace table void TableFunctionSet::DeselectAtPoint( const Point& rPoint ) { (void)rPoint; - Rectangle aCellRange; - m_pTableControl->invalidateSelectedRegion( m_nCurrentRow, m_nCurrentRow, aCellRange ); + m_pTableControl->invalidateRow( m_nCurrentRow ); m_pTableControl->markRowAsDeselected( m_nCurrentRow ); } @@ -2729,11 +2720,10 @@ namespace svt { namespace table { if ( m_pTableControl->hasRowSelection() ) { - Rectangle aCellRange; for ( size_t i=0; igetSelectedRowCount(); ++i ) { RowPos const rowIndex = m_pTableControl->getSelectedRowIndex(i); - m_pTableControl->invalidateSelectedRegion( rowIndex, rowIndex, aCellRange ); + m_pTableControl->invalidateRow( rowIndex ); } m_pTableControl->markAllRowsAsDeselected(); diff --git a/svtools/source/table/tablecontrol_impl.hxx b/svtools/source/table/tablecontrol_impl.hxx index bc1ac55fbe51..e768636c676e 100755 --- a/svtools/source/table/tablecontrol_impl.hxx +++ b/svtools/source/table/tablecontrol_impl.hxx @@ -226,10 +226,10 @@ namespace svt { namespace table /** returns the position of the current row in the selection vector */ int getRowSelectedNumber(const ::std::vector& selectedRows, RowPos current); - /** _rCellRect contains the region, which should be invalidate after some action e.g. selecting row*/ - void invalidateSelectedRegion(RowPos _nPrevRow, RowPos _nCurRow, Rectangle& _rCellRect ); + /** ??? */ + void invalidateSelectedRegion( RowPos _nPrevRow, RowPos _nCurRow ); - /** invalidates the part of the data window which is covered by the given row + /** invalidates the part of the data window which is covered by the given rows @param i_firstRow the index of the first row to include in the invalidation @param i_lastRow @@ -238,6 +238,14 @@ namespace svt { namespace table */ void invalidateRowRange( RowPos const i_firstRow, RowPos const i_lastRow ); + /** invalidates the part of the data window which is covered by the given row + */ + void invalidateRow( RowPos const i_row ) { invalidateRowRange( i_row, i_row ); } + + /** invalidates all selected rows + */ + void invalidateSelectedRows(); + void checkCursorPosition(); bool hasRowSelection() const { return !m_aSelectedRows.empty(); } -- cgit v1.2.3 From 458ee2acf8d08b91be5bef7fe54fc4b04049c32e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Mar 2011 11:05:00 +0100 Subject: gridfixes: make compile with debug=1 --- automation/source/simplecm/simplecm.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/source/simplecm/simplecm.cxx b/automation/source/simplecm/simplecm.cxx index 74a86f343677..55dc26665bfc 100644 --- a/automation/source/simplecm/simplecm.cxx +++ b/automation/source/simplecm/simplecm.cxx @@ -41,7 +41,7 @@ #include void debug_printf( const char *chars ) { - static BOOL bPrint = (getenv("DEBUG") != NULL); + static sal_Bool bPrint = (getenv("DEBUG") != NULL); if ( bPrint ) { printf( chars ); -- cgit v1.2.3 From 7c49208c07d27bf9208e2c58df68a4ecad5896d8 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Mar 2011 12:26:55 +0100 Subject: gridfixes: UpdateTip: need a Invalidate after setting the help text, to really show the (possibly) new text --- vcl/source/app/help.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 13fb2d3c0893..4f4db50b1120 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -301,6 +301,7 @@ void Help::UpdateTip( sal_uIntPtr nId, Window* pParent, const Rectangle& rScreen pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), &rScreenRect ); pHelpWin->SetHelpText( rText ); + pHelpWin->Invalidate(); } // ----------------------------------------------------------------------- -- cgit v1.2.3 From 803901f078481582d49b25e98c1792cbf766c8fc Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Mar 2011 12:40:21 +0100 Subject: gridfixes: #i112465# introduce HideBalloonAndQuickHelp --- vcl/inc/vcl/help.hxx | 24 +++++++++++++----------- vcl/source/app/help.cxx | 9 +++++++++ 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/vcl/inc/vcl/help.hxx b/vcl/inc/vcl/help.hxx index b80b9a86627a..b1e7f05d53a1 100644 --- a/vcl/inc/vcl/help.hxx +++ b/vcl/inc/vcl/help.hxx @@ -77,30 +77,30 @@ public: void SetHelpFile( const String& rFileName ) { maHelpFile = rFileName; } const String& GetHelpFile() const { return maHelpFile; } - virtual sal_Bool Start( const XubString& rHelpId, const Window* pWindow ); - virtual sal_Bool SearchKeyword( const XubString& rKeyWord ); + virtual sal_Bool Start( const XubString& rHelpId, const Window* pWindow ); + virtual sal_Bool SearchKeyword( const XubString& rKeyWord ); virtual void OpenHelpAgent( const rtl::OString& rHelpId ); virtual XubString GetHelpText( const String& aHelpURL, const Window* pWindow ); static void EnableContextHelp(); static void DisableContextHelp(); - static sal_Bool IsContextHelpEnabled(); - static sal_Bool StartContextHelp(); + static sal_Bool IsContextHelpEnabled(); + static sal_Bool StartContextHelp(); static void EnableExtHelp(); static void DisableExtHelp(); - static sal_Bool IsExtHelpEnabled(); - static sal_Bool StartExtHelp(); - static sal_Bool EndExtHelp(); - static sal_Bool IsExtHelpActive(); + static sal_Bool IsExtHelpEnabled(); + static sal_Bool StartExtHelp(); + static sal_Bool EndExtHelp(); + static sal_Bool IsExtHelpActive(); static void EnableBalloonHelp(); static void DisableBalloonHelp(); - static sal_Bool IsBalloonHelpEnabled(); - static sal_Bool ShowBalloon( Window* pParent, + static sal_Bool IsBalloonHelpEnabled(); + static sal_Bool ShowBalloon( Window* pParent, const Point& rScreenPos, const XubString& rHelpText ); - static sal_Bool ShowBalloon( Window* pParent, + static sal_Bool ShowBalloon( Window* pParent, const Point& rScreenPos, const Rectangle&, const XubString& rHelpText ); @@ -119,6 +119,8 @@ public: sal_uInt16 nStyle = 0 ) { return Help::ShowQuickHelp( pParent, rScreenRect, rHelpText, XubString(), nStyle ); } + static void HideBalloonAndQuickHelp(); + static sal_uLong ShowTip( Window* pParent, const Rectangle& rScreenRect, const XubString& rText, sal_uInt16 nStyle = 0 ); diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 4f4db50b1120..77cb10ee7501 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -275,6 +275,15 @@ sal_Bool Help::ShowQuickHelp( Window* pParent, // ----------------------------------------------------------------------- +void Help::HideBalloonAndQuickHelp() +{ + HelpTextWindow const * pHelpWin = ImplGetSVData()->maHelpData.mpHelpWin; + bool const bIsVisible = ( pHelpWin != NULL ) && pHelpWin->IsVisible(); + ImplDestroyHelpWindow( bIsVisible ); +} + +// ----------------------------------------------------------------------- + sal_uIntPtr Help::ShowTip( Window* pParent, const Rectangle& rScreenRect, const XubString& rText, sal_uInt16 nStyle ) { -- cgit v1.2.3 From 7239b6ce3e1df07a9c0871f01d3f10b793bab8c2 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 8 Mar 2011 12:41:07 +0100 Subject: gridfixes: #i112465# delegate RequestHelp to the base class, when we do not have own help to display --- svtools/source/table/tabledatawindow.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx index bd6f9b499444..e7b238c5998c 100644 --- a/svtools/source/table/tabledatawindow.cxx +++ b/svtools/source/table/tabledatawindow.cxx @@ -148,18 +148,27 @@ namespace svt { namespace table if ( sHelpText.getLength() ) { + // hide the standard (singleton) help window, so we do not have two help windows open at the same time + Help::HideBalloonAndQuickHelp(); + Rectangle const aControlScreenRect( OutputToScreenPixel( Point( 0, 0 ) ), GetOutputSizePixel() ); if ( m_nTipWindowHandle ) + { + OSL_TRACE( ::rtl::OUStringToOString( sHelpText, RTL_TEXTENCODING_ASCII_US ) ); Help::UpdateTip( m_nTipWindowHandle, this, aControlScreenRect, sHelpText ); + } else m_nTipWindowHandle = Help::ShowTip( this, aControlScreenRect, sHelpText, nHelpStyle ); } else + { impl_hideTipWindow(); + Window::RequestHelp( rHEvt ); + } } //------------------------------------------------------------------------------------------------------------------ -- cgit v1.2.3 From d6e7503d7e3e7dd6599e0b85fc85b35d884d3f36 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 9 Mar 2011 08:38:29 +0100 Subject: impress210: chekc readonly --- sd/source/ui/func/futext.cxx | 15 +++++++++++++++ sd/source/ui/table/tablefunction.cxx | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 2835821796a1..a1b28031d9c7 100755 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -661,9 +661,24 @@ BOOL FuText::MouseButtonUp(const MouseEvent& rMEvt) mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray ); Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) ); +sal_Bool bOldReadOnly = sal_False; + if ( mpView && mpDocSh->IsReadOnly() ) + { + if ( mpView && mpView->GetTextEditOutlinerView() ) +{ + bOldReadOnly = mpView->GetTextEditOutlinerView()->IsReadOnly(); + mpView->GetTextEditOutlinerView()->SetReadOnly(sal_True); +} + } if( (mpView && mpView->MouseButtonUp(rMEvt, mpWindow)) || rMEvt.GetClicks() == 2 ) + { + if ( mpView && mpView->GetTextEditOutlinerView() ) + mpView->GetTextEditOutlinerView()->SetReadOnly(bOldReadOnly); return (TRUE); // Event von der SdrView ausgewertet + } + if ( mpView && mpView->GetTextEditOutlinerView() ) + mpView->GetTextEditOutlinerView()->SetReadOnly(bOldReadOnly); BOOL bEmptyTextObj = FALSE; diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx index b30e259e049a..41c8e1c429f9 100755 --- a/sd/source/ui/table/tablefunction.cxx +++ b/sd/source/ui/table/tablefunction.cxx @@ -185,6 +185,7 @@ void DrawViewShell::FuTable(SfxRequest& rReq) } } + GetParentWindow()->GrabFocus(); if( pPickObj ) mpView->ReplaceObjectAtView(pPickObj, *pPV, pObj, TRUE ); else @@ -192,6 +193,10 @@ void DrawViewShell::FuTable(SfxRequest& rReq) Invalidate(SID_DRAWTBX_INSERT); rReq.Ignore(); +SfxViewShell* pViewShell = GetViewShell(); + OSL_ASSERT (pViewShell!=NULL); + SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings(); + rBindings.Invalidate( SID_INSERT_TABLE, TRUE, FALSE ); break; } case SID_TABLEDESIGN: -- cgit v1.2.3 From 7e78dded94afc6f3c6cadab1a10e2bca857c5baa Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Wed, 9 Mar 2011 18:31:46 +0100 Subject: impress210: #i41995# fixed distinct shape and page id --- xmloff/source/transform/ActionMapTypesOOo.hxx | 1 + xmloff/source/transform/AttrTransformerAction.hxx | 1 + xmloff/source/transform/OOo2Oasis.cxx | 24 +++++++++++++++++++++++ xmloff/source/transform/TransformerBase.cxx | 11 +++++++++++ 4 files changed, 37 insertions(+) diff --git a/xmloff/source/transform/ActionMapTypesOOo.hxx b/xmloff/source/transform/ActionMapTypesOOo.hxx index ff8081b025cf..a9ed15ecb74a 100644 --- a/xmloff/source/transform/ActionMapTypesOOo.hxx +++ b/xmloff/source/transform/ActionMapTypesOOo.hxx @@ -86,6 +86,7 @@ enum ActionMapTypesOOo OOO_SOURCE_SERVICE_ACTIONS, OOO_DRAW_AREA_POLYGON_ACTIONS, OOO_SCRIPT_ACTIONS, + OOO_ANIMATION_ACTIONS, MAX_OOO_ACTIONS }; diff --git a/xmloff/source/transform/AttrTransformerAction.hxx b/xmloff/source/transform/AttrTransformerAction.hxx index ffcd8b43ada0..0cfb6a116c2c 100644 --- a/xmloff/source/transform/AttrTransformerAction.hxx +++ b/xmloff/source/transform/AttrTransformerAction.hxx @@ -135,6 +135,7 @@ enum XMLAttrTransformerAction XML_ATACTION_GAMMA_OOO, // converts double value to percentage XML_ATACTION_DECODE_ID, // converts strings with non numeric characters to only numeric character ids XML_ATACTION_OPACITY_FIX, // converts transparency to opacity and back + XML_ATACTION_SHAPEID, // convert shape id XML_ATACTION_USER_DEFINED=0x40000000,// user defined actions start here XML_ATACTION_END=XML_TACTION_END }; diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx index 103202c48866..b678da6b2304 100644 --- a/xmloff/source/transform/OOo2Oasis.cxx +++ b/xmloff/source/transform/OOo2Oasis.cxx @@ -573,6 +573,14 @@ static XMLTransformerActionInit aActionTable[] = ENTRY1( TABLE, SOURCE_SERVICE, XML_ETACTION_PROC_ATTRS, OOO_SOURCE_SERVICE_ACTIONS ), + // fix id strings in old animation elements + ENTRY1( PRESENTATION, DIM, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ), + ENTRY1( PRESENTATION, PLAY, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ), + ENTRY1( PRESENTATION, SHOW_TEXT, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ), + ENTRY1( PRESENTATION, SHOW_SHAPE, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ), + ENTRY1( PRESENTATION, HIDE_TEXT, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ), + ENTRY1( PRESENTATION, HIDE_SHAPE, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ), + ENTRY0( OFFICE, TOKEN_INVALID, XML_ETACTION_EOT ) }; @@ -755,6 +763,9 @@ static XMLTransformerActionInit aShapeActionTable[] = ENTRY2( CHART, LEGEND_POSITION, XML_ATACTION_RENAME_ATTRIBUTE, RENAME_ENTRY( XML_LEFT, XML_START ), RENAME_ENTRY( XML_RIGHT, XML_END )), + ENTRY0( DRAW, ID, XML_ATACTION_SHAPEID ), + ENTRY0( DRAW, START_SHAPE, XML_ATACTION_SHAPEID ), + ENTRY0( DRAW, END_SHAPE, XML_ATACTION_SHAPEID ), ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT ) }; @@ -778,6 +789,7 @@ static XMLTransformerActionInit aConnectorActionTable[] = ENTRY1Q( FORM, ID, XML_ATACTION_RENAME, XML_NAMESPACE_DRAW, XML_CONTROL ), ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_True ), + ENTRY0( DRAW, ID, XML_ATACTION_SHAPEID ), ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT ) }; @@ -1036,6 +1048,14 @@ static XMLTransformerActionInit aSourceServiceActionTable[] = ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT ) }; +// OOO_ANIMATION_ACTIONS +static XMLTransformerActionInit aAnimationsActionTable[] = +{ + ENTRY0( DRAW, SHAPE_ID, XML_ATACTION_SHAPEID ), + ENTRY0( PRESENTATION, PATH_ID, XML_ATACTION_SHAPEID ), + ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT ) +}; + // OOO_DRAW_AREA_POLYGON_ACTIONS (to be added to OOO_SHAPE_ACTIONS) static XMLTransformerActionInit aDrawAreaPolygonActionTable[] = { @@ -1777,6 +1797,10 @@ XMLTransformerActions *OOo2OasisTransformer::GetUserDefinedActions( m_aActions[OOO_SCRIPT_ACTIONS] = new XMLTransformerActions( aScriptActionTable ); break; + case OOO_ANIMATION_ACTIONS: + m_aActions[OOO_ANIMATION_ACTIONS] = + new XMLTransformerActions( aAnimationsActionTable ); + break; } } pActions = m_aActions[n]; diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx index 61bb73120da6..f2d7af5585c0 100644 --- a/xmloff/source/transform/TransformerBase.cxx +++ b/xmloff/source/transform/TransformerBase.cxx @@ -248,6 +248,9 @@ void SAL_CALL XMLTransformerBase::startElement( const OUString& rName, { SvXMLNamespaceMap *pRewindMap = 0; + bool bRect = rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "presentation:show-shape" ) ); + (void)bRect; + // Process namespace attributes. This must happen before creating the // context, because namespace decaration apply to the element name itself. XMLMutableAttributeList *pMutableAttrList = 0; @@ -888,6 +891,14 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( } break; // <-- + case XML_ATACTION_SHAPEID: + { + OUString sNewValue( RTL_CONSTASCII_USTRINGPARAM( "shape" ) ); + sNewValue += rAttrValue; + pMutableAttrList->SetValueByIndex( i, sNewValue ); + break; + } + default: OSL_ENSURE( !this, "unknown action" ); break; -- cgit v1.2.3 From 7bd8816087332807a2320b9e7711fdda751bf204 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Wed, 9 Mar 2011 18:32:29 +0100 Subject: impress210: #i41995# fixed import of path animation from sxi files --- svx/inc/svx/svdobj.hxx | 3 ++- svx/inc/svx/svdogrp.hxx | 3 +++ svx/inc/svx/svdovirt.hxx | 2 +- svx/source/svdraw/svdobj.cxx | 6 +++--- svx/source/svdraw/svdogrp.cxx | 11 +++++++++++ svx/source/svdraw/svdovirt.cxx | 2 +- 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx index 86d6f0717bb7..ef915a43ae30 100644 --- a/svx/inc/svx/svdobj.hxx +++ b/svx/inc/svx/svdobj.hxx @@ -673,7 +673,8 @@ public: // a new method for accessing the last BoundRect. virtual const Rectangle& GetLastBoundRect() const; - virtual void RecalcBoundRect(); + // If bForced is true, the boundrect is also calculated when the model is locked + virtual void RecalcBoundRect(bool bForced = false); void BroadcastObjectChange() const; diff --git a/svx/inc/svx/svdogrp.hxx b/svx/inc/svx/svdogrp.hxx index 9cf0ad056047..bae18a85a261 100644 --- a/svx/inc/svx/svdogrp.hxx +++ b/svx/inc/svx/svdogrp.hxx @@ -79,6 +79,9 @@ public: virtual const Rectangle& GetCurrentBoundRect() const; virtual const Rectangle& GetSnapRect() const; + // If bForced is true, the boundrect is also calculated when the model is locked + virtual void RecalcBoundRect(bool bForced = false); + virtual void operator=(const SdrObject& rObj); virtual void TakeObjNameSingul(String& rName) const; diff --git a/svx/inc/svx/svdovirt.hxx b/svx/inc/svx/svdovirt.hxx index dba62f84730e..b169e9e03958 100644 --- a/svx/inc/svx/svdovirt.hxx +++ b/svx/inc/svx/svdovirt.hxx @@ -76,7 +76,7 @@ public: virtual const Rectangle& GetCurrentBoundRect() const; virtual const Rectangle& GetLastBoundRect() const; - virtual void RecalcBoundRect(); + virtual void RecalcBoundRect(bool bForced = false); virtual void SetChanged(); virtual SdrObject* Clone() const; virtual void operator=(const SdrObject& rObj); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 81ff5005d0f6..4cf78b1cebb5 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -926,14 +926,14 @@ const Rectangle& SdrObject::GetLastBoundRect() const return aOutRect; } -void SdrObject::RecalcBoundRect() +void SdrObject::RecalcBoundRect(bool bForced) { // #i101680# suppress BoundRect calculations on import(s) - if(pModel && pModel->isLocked() ) + if(pModel && pModel->isLocked() && !bForced ) return; // central new method which will calculate the BoundRect using primitive geometry - if(aOutRect.IsEmpty()) + if(aOutRect.IsEmpty() || bForced) { const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(GetViewContact().getViewIndependentPrimitive2DSequence()); diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index ede6b35178f9..c62732ed044b 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -282,6 +282,17 @@ const Rectangle& SdrObjGroup::GetCurrentBoundRect() const // <-- } +void SdrObjGroup::RecalcBoundRect(bool bForced) +{ + if( bForced ) + { + sal_uIntPtr nAnz=pSub->GetObjCount(); + for( sal_uIntPtr i=0; iGetObj(i)->RecalcBoundRect(true); + } + + SdrObject::RecalcBoundRect(bForced); +} const Rectangle& SdrObjGroup::GetSnapRect() const { diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index c6703f2305df..53d81b54d27e 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -148,7 +148,7 @@ const Rectangle& SdrVirtObj::GetLastBoundRect() const return aOutRect; } -void SdrVirtObj::RecalcBoundRect() +void SdrVirtObj::RecalcBoundRect(bool bForced) { aOutRect=rRefObj.GetCurrentBoundRect(); aOutRect+=aAnchor; -- cgit v1.2.3 From d30085b1ee435059d01a3d8d947803ebd91041c2 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Wed, 9 Mar 2011 18:32:29 +0100 Subject: impress210: #i41995# fixed import of path animation from sxi files --- sd/inc/EffectMigration.hxx | 3 +++ sd/source/core/CustomAnimationEffect.cxx | 1 + sd/source/core/EffectMigration.cxx | 26 ++++++++++++++++++++++++++ sd/source/ui/unoidl/unoobj.cxx | 27 ++++----------------------- 4 files changed, 34 insertions(+), 23 deletions(-) mode change 100644 => 100755 sd/inc/EffectMigration.hxx mode change 100644 => 100755 sd/source/core/EffectMigration.cxx diff --git a/sd/inc/EffectMigration.hxx b/sd/inc/EffectMigration.hxx old mode 100644 new mode 100755 index eb173f495de2..3dd0e0dfe8ad --- a/sd/inc/EffectMigration.hxx +++ b/sd/inc/EffectMigration.hxx @@ -36,6 +36,7 @@ class SdPage; class SvxShape; class SdAnimationInfo; class SdrObject; +class SdrPathObj; namespace sd { @@ -76,6 +77,8 @@ public: static void UpdateSoundEffect( SvxShape* pShape, SdAnimationInfo* pInfo ); static ::rtl::OUString GetSoundFile( SvxShape* pShape ); static sal_Bool GetSoundOn( SvxShape* pShape ); + + static void SetAnimationPath( SvxShape* pShape, SdrPathObj* pPathObj ); }; } // end of namespace sd diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 33b9c233909b..52d53426f133 100755 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -1738,6 +1738,7 @@ void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj SdrObject* pObj = GetSdrObjectFromXShape( getTargetShape() ); if( pObj ) { + pObj->RecalcBoundRect(true); const Rectangle aBoundRect( pObj->GetCurrentBoundRect() ); const Point aCenter( aBoundRect.Center() ); diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx old mode 100644 new mode 100755 index cbb9a1019baf..751ce0911cfc --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include "drawdoc.hxx" #include "sdpage.hxx" #include @@ -1342,3 +1343,28 @@ sal_Bool EffectMigration::GetSoundOn( SvxShape* pShape ) return GetSoundFile( pShape ).getLength() != 0; } +// -------------------------------------------------------------------- + +void EffectMigration::SetAnimationPath( SvxShape* pShape, SdrPathObj* pPathObj ) +{ + if( pShape && pPathObj ) + { + SdrObject* pObj = pShape->GetSdrObject(); + + if( pObj ) + { + sd::MainSequencePtr pMainSequence = static_cast(pObj->GetPage())->getMainSequence(); + + const Reference< XShape > xShape( pShape ); + SdPage* pPage = dynamic_cast< SdPage* >( pPathObj ? pPathObj->GetPage() : 0 ); + if( pPage ) + { + boost::shared_ptr< sd::MainSequence > pMainSequence( pPage->getMainSequence() ); + if( pMainSequence.get() ) + CustomAnimationEffectPtr pCreated( pMainSequence->append( *pPathObj, makeAny( xShape ), -1.0 ) ); + } + } + } +} + + diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index 681aad8f44ed..ddb115a21525 100755 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -658,36 +658,17 @@ void SAL_CALL SdXShape::setPropertyValue( const ::rtl::OUString& aPropertyName, case WID_MASTERDEPEND: SetMasterDepend( ::cppu::any2bool(aValue) ); break; -/* todo case WID_ANIMPATH: { - uno::Reference< drawing::XShape > xShape; - aValue >>= xShape; + uno::Reference< drawing::XShape > xShape( aValue, uno::UNO_QUERY ); + SdrPathObj* pObj = xShape.is() ? dynamic_cast< SdrPathObj* >( GetSdrObjectFromXShape( xShape ) ) : NULL; - SdrObject* pObj = NULL; - if(xShape.is()) - pObj = GetSdrObjectFromXShape( xShape ); - - if( pObj == NULL || !pObj->ISA( SdrPathObj ) ) + if( pObj == NULL ) throw lang::IllegalArgumentException(); - pInfo->mpPathObj = (SdrPathObj*)pObj; - - SdDrawDocument* pDoc = mpModel?mpModel->GetDoc():NULL; - if( pDoc ) - { - pInfo = pDoc->GetAnimationInfo(pObj); - if( pInfo == NULL ) - { - pInfo = new SdAnimationInfo(pDoc); - pObj->InsertUserData( pInfo ); - } - pInfo->mbInvisibleInPresentation = sal_True; - } - + EffectMigration::SetAnimationPath( mpShape, pObj ); break; } -*/ case WID_IMAGEMAP: { SdDrawDocument* pDoc = mpModel?mpModel->GetDoc():NULL; -- cgit v1.2.3 From fb3e8f4852851cb6387a523d9aa21f7615df74f4 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Wed, 9 Mar 2011 18:32:29 +0100 Subject: impress210: #i41995# fixed import of path animation from sxi files --- sw/inc/dcontact.hxx | 2 +- sw/source/core/draw/dcontact.cxx | 2 +- sw/source/core/draw/dflyobj.cxx | 2 +- sw/source/core/inc/dflyobj.hxx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx index 7d5fec3e37c0..a6f336d2776e 100644 --- a/sw/inc/dcontact.hxx +++ b/sw/inc/dcontact.hxx @@ -342,7 +342,7 @@ class SwDrawVirtObj : public SdrVirtObj // #108784# // All overloaded methods which need to use the offset - virtual void RecalcBoundRect(); + virtual void RecalcBoundRect(bool bForce = false); virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const; virtual ::basegfx::B2DPolyPolygon TakeContour() const; virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const; diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index c510705c533c..3893f52769f0 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -2599,7 +2599,7 @@ void SwDrawVirtObj::SetBoundRectDirty() // do nothing to not lose model information in aOutRect } -void SwDrawVirtObj::RecalcBoundRect() +void SwDrawVirtObj::RecalcBoundRect(bool) { // OD 2004-04-05 #i26791# - switch order of calling and // , because calculates diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index e8b5c378a2ec..251e2cc26281 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -563,7 +563,7 @@ const Rectangle& __EXPORT SwVirtFlyDrawObj::GetLastBoundRect() const } -void __EXPORT SwVirtFlyDrawObj::RecalcBoundRect() +void __EXPORT SwVirtFlyDrawObj::RecalcBoundRect(bool) { SetRect(); } diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx index 23216709a50a..64c987c54384 100644 --- a/sw/source/core/inc/dflyobj.hxx +++ b/sw/source/core/inc/dflyobj.hxx @@ -101,7 +101,7 @@ public: //Wir nehemen die Groessenbehandlung vollstaendig selbst in die Hand. virtual const Rectangle& GetCurrentBoundRect() const; virtual const Rectangle& GetLastBoundRect() const; - virtual void RecalcBoundRect(); + virtual void RecalcBoundRect(bool bForce = false); virtual void RecalcSnapRect(); virtual const Rectangle& GetSnapRect() const; virtual void SetSnapRect(const Rectangle& rRect); -- cgit v1.2.3 From a23bc0eddb2174103434f89e38601c2d12fa077c Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 9 Mar 2011 19:20:12 +0100 Subject: impress211: fix a rebase problem --- vcl/win/source/window/salframe.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 6a9061b9111c..f3fac2203523 100755 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -894,7 +894,7 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, else { Rectangle aCombined; - Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( 0 ), UNO_QUERY_THROW ); + uno::Reference< XPropertySet > xMonitor( xMultiMon->getByIndex( 0 ), UNO_QUERY_THROW ); com::sun::star::awt::Rectangle aRect; if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect ) { @@ -904,7 +904,7 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, aCombined.Bottom() = aRect.Y + aRect.Height; for( sal_Int32 i = 1 ; i < nMonitors ; i++ ) { - xMonitor = Reference< XPropertySet >( xMultiMon->getByIndex(i), UNO_QUERY_THROW ); + xMonitor = uno::Reference< XPropertySet >( xMultiMon->getByIndex(i), UNO_QUERY_THROW ); if( xMonitor->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ScreenArea" ) ) ) >>= aRect ) { aCombined.Union( Rectangle( aRect.X, aRect.Y, aRect.X+aRect.Width, aRect.Y+aRect.Height ) ); -- cgit v1.2.3 From 545fe253b4913ea9411b54566afd5c858a20517b Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Thu, 10 Mar 2011 14:21:52 +0100 Subject: impress210: #i117133# put new drawing layer fill and stroke styles in pool only for newly created documents --- svx/inc/svx/svdmodel.hxx | 1 + svx/source/svdraw/svdmodel.cxx | 16 ++++++++++++++++ svx/source/xoutdev/xpool.cxx | 4 ++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx index a32147a3032f..3c112bc57700 100644 --- a/svx/inc/svx/svdmodel.hxx +++ b/svx/inc/svx/svdmodel.hxx @@ -742,6 +742,7 @@ public: also during the runtime of the Undo() and Redo() methods. */ bool IsUndoEnabled() const; + void SetDrawingLayerPoolDefaults(); }; typedef tools::WeakReference< SdrModel > SdrModelWeakRef; diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 5328e5f1a3d1..eeefc7223b77 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -69,6 +69,9 @@ #include "svx/svdstr.hrc" // Objektname #include "svdoutlinercache.hxx" +#include "svx/xflclit.hxx" +#include "svx/xflhtit.hxx" +#include "svx/xlnclit.hxx" #include #include "editeng/fontitem.hxx" @@ -210,6 +213,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe pItemPool->SetPoolDefaultItem( SdrTextWordWrapItem( sal_False ) ); SetTextDefaults(); + pLayerAdmin=new SdrLayerAdmin; pLayerAdmin->SetModel(this); ImpSetUIUnit(); @@ -2167,6 +2171,18 @@ const ::com::sun::star::uno::Sequence< sal_Int8 >& SdrModel::getUnoTunnelImpleme return *pSeq; } +void SdrModel::SetDrawingLayerPoolDefaults() +{ + const String aNullStr; + const Color aNullLineCol(COL_DEFAULT_SHAPE_STROKE); + const Color aNullFillCol(COL_DEFAULT_SHAPE_FILLING); + const XHatch aNullHatch(aNullLineCol); + + pItemPool->SetPoolDefaultItem( XFillColorItem(aNullStr,aNullFillCol) ); + pItemPool->SetPoolDefaultItem( XFillHatchItem(pItemPool,aNullHatch) ); + pItemPool->SetPoolDefaultItem( XLineColorItem(aNullStr,aNullLineCol) ); +} + //////////////////////////////////////////////////////////////////////////////////////////////////// TYPEINIT1(SdrHint,SfxHint); diff --git a/svx/source/xoutdev/xpool.cxx b/svx/source/xoutdev/xpool.cxx index 305b181a65a2..a86baef14810 100644 --- a/svx/source/xoutdev/xpool.cxx +++ b/svx/source/xoutdev/xpool.cxx @@ -52,8 +52,8 @@ XOutdevItemPool::XOutdevItemPool( const XubString aNullStr; const Bitmap aNullBmp; const basegfx::B2DPolyPolygon aNullPol; - const Color aNullLineCol(RGB_Color(COL_DEFAULT_SHAPE_STROKE)); - const Color aNullFillCol(RGB_Color(COL_DEFAULT_SHAPE_FILLING)); + const Color aNullLineCol(RGB_Color(COL_BLACK)); + const Color aNullFillCol(RGB_COLORDATA( 153, 204, 255 )); const Color aNullShadowCol(RGB_Color(COL_LIGHTGRAY)); const XDash aNullDash; const XGradient aNullGrad(aNullLineCol, RGB_Color(COL_WHITE)); -- cgit v1.2.3 From 3a5fb547e14c0dcb5f7a71cb8c3650182cb31c91 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Thu, 10 Mar 2011 14:21:52 +0100 Subject: impress210: #i117133# put new drawing layer fill and stroke styles in pool only for newly created documents --- sd/source/ui/docshell/docshel4.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index f1e77526d7e3..47e8f62c6468 100755 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -298,6 +298,7 @@ sal_Bool DrawDocShell::InitNew( const ::com::sun::star::uno::Reference< ::com::s if (bRet) { + mpDoc->SetDrawingLayerPoolDefaults(); if( !mbSdDataObj ) mpDoc->NewOrLoadCompleted(NEW_DOC); // otherwise calling // NewOrLoadCompleted(NEW_LOADED) in -- cgit v1.2.3 From be5df7cfe68e5cf185ecb9754118a1f067c0deb2 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Thu, 10 Mar 2011 14:21:52 +0100 Subject: impress210: #i117133# put new drawing layer fill and stroke styles in pool only for newly created documents --- sw/inc/doc.hxx | 9 +++++++++ sw/source/core/doc/docdraw.cxx | 15 +++++++++++++++ sw/source/core/doc/docnew.cxx | 3 ++- sw/source/ui/app/docshini.cxx | 2 ++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 8ac03ff109bd..a5331ebef810 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -599,6 +599,8 @@ private: sal_Bool mbStartIdleTimer ; // idle timer mode start/stop + bool mbSetDrawDefaults; ; // set draw pool defaults for freshly created documents + static SwAutoCompleteWord *pACmpltWords; // Liste aller Worte fuers AutoComplete //---------------- private Methoden ------------------------------ @@ -2092,6 +2094,13 @@ public: ::sw::UndoManager & GetUndoManager(); ::sw::UndoManager const& GetUndoManager() const; SfxObjectShell* CreateCopy(bool bCallInitNew) const; + + /// must be called only in SwDocShell::InitNew, causes UpdateDrawDefaults to be called when drawing layer is created + void SetDrawDefaults(); + +private: + /// method to set new graphics pool defaults, must only be called by SetDrawDefaults! + void UpdateDrawDefaults(); }; diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 051efd2b0948..1eb27e101c61 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -689,6 +689,8 @@ void SwDoc::InitDrawModel() pLayout->SetDrawPage( pDrawModel->GetPage( 0 ) ); pLayout->GetDrawPage()->SetSize( pLayout->Frm().SSize() ); } + + UpdateDrawDefaults(); } /** method to notify drawing page view about the invisible layers @@ -1081,3 +1083,16 @@ namespace docfunc } // <-- +void SwDoc::SetDrawDefaults() +{ + mbSetDrawDefaults = true; + UpdateDrawDefaults(); +} + +void SwDoc::UpdateDrawDefaults() +{ + // drawing layer defaults that are set for new documents (if InitNew was called) + if ( pDrawModel && mbSetDrawDefaults ) + pDrawModel->SetDrawingLayerPoolDefaults(); +} + diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index cdf031aeb923..c64017875fd5 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -300,7 +300,8 @@ SwDoc::SwDoc() mbProtectForm(false), n32DummyCompatabilityOptions1(0), n32DummyCompatabilityOptions2(0), - mbStartIdleTimer(sal_False) + mbStartIdleTimer(sal_False), + mbSetDrawDefaults(false) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDoc::SwDoc" ); diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index 6c8e73931105..17eead88c233 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -351,6 +351,8 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) //#i16874# AutoKerning as default for new documents pDoc->SetDefault( SvxAutoKernItem( sal_True, RES_CHRATR_AUTOKERN ) ); + pDoc->SetDrawDefaults(); + // --> OD 2005-02-10 #i42080# - Due to the several calls of method // at the document instance, the document is modified. Thus, reset this // status here. Note: In method this is also done. -- cgit v1.2.3 From 6e27cd90e18a686bc54fa6b8d8590265907e46be Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Thu, 10 Mar 2011 14:21:52 +0100 Subject: impress210: #i117133# put new drawing layer fill and stroke styles in pool only for newly created documents --- sc/source/core/data/documen9.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index 534c2333bd9b..611241e3e42a 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -210,6 +210,7 @@ void ScDocument::UpdateDrawDefaults() { SfxItemPool& rDrawPool = pDrawLayer->GetItemPool(); rDrawPool.SetPoolDefaultItem( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) ); + pDrawLayer->SetDrawingLayerPoolDefaults(); } } -- cgit v1.2.3 From 4946fc632e996a438825c3eb6ddc96dba66fd743 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Thu, 10 Mar 2011 14:21:52 +0100 Subject: impress210: #i117133# put new drawing layer fill and stroke styles in pool only for newly created documents --- solenv/gbuild/platform/windows.mk | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk index a4137c077b09..d7ead14fa2ad 100755 --- a/solenv/gbuild/platform/windows.mk +++ b/solenv/gbuild/platform/windows.mk @@ -397,16 +397,20 @@ gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) gb_LinkTarget_get_pdbfile = $(call gb_LinkTarget_get_target,)pdb/$(1).pdb +define hacknative +$(patsubst $(WORKDIR)%,$(gb_Helper_WORKDIR_NATIVE)%,$(1)) +endef + define gb_LinkTarget__command $(call gb_Output_announce,$(2),$(true),LNK,4) $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(dir $(1)) && \ rm -f $(1) && \ - RESPONSEFILE=`$(gb_MKTEMP)` && \ - echo "$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ + RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100, \ + $(call hacknative,$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ - $(PCHOBJS)" > $${RESPONSEFILE} && \ + $(PCHOBJS))) && \ $(gb_LINK) \ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ $(if $(filter StaticLibrary,$(TARGETTYPE)),$(gb_StaticLibrary_TARGETTYPEFLAGS)) \ -- cgit v1.2.3 From 19402aecde9ba3af2ae5157633050e188dff7ca8 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Thu, 10 Mar 2011 16:27:14 +0100 Subject: impress210: #i117319# disconnect and reconnect to table style on change model in SdrTableObjImpl --- svx/source/table/svdotable.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 9ac652f5e025..5618a2880e31 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -330,6 +330,7 @@ void SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource ) void SdrTableObjImpl::SetModel(SdrModel* /*pOldModel*/, SdrModel* pNewModel) { // try to find new table style + disconnectTableStyle(); Reference< XIndexAccess > xNewTableStyle; if( mxTableStyle.is() ) try @@ -360,6 +361,7 @@ void SdrTableObjImpl::SetModel(SdrModel* /*pOldModel*/, SdrModel* pNewModel) mxTableStyle = xNewTableStyle; + connectTableStyle(); update(); } -- cgit v1.2.3 From b9c65fefee0ec5f4022b9a6a193671d7ec2f0136 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Fri, 11 Mar 2011 07:19:45 +0100 Subject: impress210: replace TRUE by sal_True --- sd/source/ui/table/tablefunction.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx index 48bb016ba0b1..7e017fbdbe1e 100755 --- a/sd/source/ui/table/tablefunction.cxx +++ b/sd/source/ui/table/tablefunction.cxx @@ -196,7 +196,7 @@ void DrawViewShell::FuTable(SfxRequest& rReq) SfxViewShell* pViewShell = GetViewShell(); OSL_ASSERT (pViewShell!=NULL); SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings(); - rBindings.Invalidate( SID_INSERT_TABLE, TRUE, FALSE ); + rBindings.Invalidate( SID_INSERT_TABLE, sal_True, sal_False ); break; } case SID_TABLEDESIGN: -- cgit v1.2.3 From cc2706823d5b0fe7ceab2987b933d9a5e4963184 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Mon, 14 Mar 2011 10:23:01 +0100 Subject: dr80: #i164410# optimized cell allocation in XCellRangeData::setDataArray() to improve performance of import filters --- sc/source/ui/unoobj/cellsuno.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 3737e742b441..54b1dc2d1aed 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -1098,6 +1098,11 @@ sal_Bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange, pDoc->DeleteAreaTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, IDF_CONTENTS ); + /* #164410# Use double allocation, which will speed up import filters + using XCellRangeData::setDataArray() significantly. */ + bool bDoubleAlloc = ScColumn::bDoubleAlloc; + ScColumn::bDoubleAlloc = true; + sal_Bool bError = sal_False; SCROW nDocRow = nStartRow; for (long nRow=0; nRow Date: Mon, 14 Mar 2011 16:30:33 +0100 Subject: aw084: #i112978# use GetAllMarkedBoundRect instead of GetAllMarkedRect to get fat line support --- sd/source/ui/app/sdxfer.cxx | 4 +++- sd/source/ui/view/sdview2.cxx | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index 48a1f35436e9..cf59df42c85b 100755 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -345,7 +345,9 @@ void SdTransferable::CreateData() if( 1 == mpSdDrawDocumentIntern->GetPageCount() ) { - Point aOrigin( ( maVisArea = mpSdViewIntern->GetAllMarkedRect() ).TopLeft() ); + // #112978# need to use GetAllMarkedBoundRect instead of GetAllMarkedRect to get + // fat lines correctly + Point aOrigin( ( maVisArea = mpSdViewIntern->GetAllMarkedBoundRect() ).TopLeft() ); Size aVector( -aOrigin.X(), -aOrigin.Y() ); for( sal_uLong nObj = 0, nObjCount = pPage->GetObjCount(); nObj < nObjCount; nObj++ ) diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 73f48323312f..0236af7d5fcf 100755 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -136,7 +136,9 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent pTransferable->SetWorkDocument( (SdDrawDocument*) GetAllMarkedModel() ); mpDoc->CreatingDataObj( NULL ); - const Rectangle aMarkRect( GetAllMarkedRect() ); + // #112978# need to use GetAllMarkedBoundRect instead of GetAllMarkedRect to get + // fat lines correctly + const Rectangle aMarkRect( GetAllMarkedBoundRect() ); TransferableObjectDescriptor aObjDesc; String aDisplayName; SdrOle2Obj* pSdrOleObj = NULL; -- cgit v1.2.3 From eb873a12a5cb7c62c73d8e7f87be01f6673d892b Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Mon, 14 Mar 2011 17:33:46 +0100 Subject: aw084: #i116802# Removing DBG_UNHANDLED_EXCEPTION since there is a valuable alternative alailable and not a general error happening --- drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index 6a280fcad95e..633b2c66f13f 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -401,7 +401,9 @@ namespace drawinglayer } catch(const uno::Exception&) { - DBG_UNHANDLED_EXCEPTION(); + // #i116763# removing since there is a good alternative when the xControlView + // is not found and it is allowed to happen + // DBG_UNHANDLED_EXCEPTION(); // process recursively and use the decomposition as Bitmap process(rCandidate.get2DDecomposition(getViewInformation2D())); -- cgit v1.2.3 From 104f0619a6dab6a09847e12a6ad0d5f86de854ef Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 15 Mar 2011 10:02:59 +0100 Subject: gridfixes: use long instead of sal_uInt32, to prevent problems on 64 bit platforms --- svtools/source/toolpanel/drawerlayouter.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx index 4de76107fd20..ecb808395c35 100644 --- a/svtools/source/toolpanel/drawerlayouter.cxx +++ b/svtools/source/toolpanel/drawerlayouter.cxx @@ -87,7 +87,7 @@ namespace svt const size_t nUpperBound = !!aActivePanel ? *aActivePanel : nPanelCount - 1; for ( size_t i=0; i<=nUpperBound; ++i ) { - sal_uInt32 nDrawerHeight = m_aDrawers[i]->GetPreferredHeightPixel(); + long const nDrawerHeight = m_aDrawers[i]->GetPreferredHeightPixel(); m_aDrawers[i]->SetPosSizePixel( aUpperDrawerPos, Size( nWidth, nDrawerHeight ) ); aUpperDrawerPos.Move( 0, nDrawerHeight ); @@ -97,7 +97,7 @@ namespace svt Point aLowerDrawerPos( i_rDeckPlayground.BottomLeft() ); for ( size_t j = nPanelCount - 1; j > nUpperBound; --j ) { - sal_uInt32 nDrawerHeight = m_aDrawers[j]->GetPreferredHeightPixel(); + long const nDrawerHeight = m_aDrawers[j]->GetPreferredHeightPixel(); m_aDrawers[j]->SetPosSizePixel( Point( aLowerDrawerPos.X(), aLowerDrawerPos.Y() - nDrawerHeight + 1 ), Size( nWidth, nDrawerHeight ) -- cgit v1.2.3 From 1f945adf29f5ae63d174d76252ce39d7f38f6062 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 15 Mar 2011 14:39:53 +0100 Subject: dr80: #i117388# do not try to access nonexisting document --- basic/source/classes/sb.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index f8ffa46d48a5..1a79295a63da 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -136,6 +136,7 @@ void DocBasicItem::startListening() Any aThisComp; mrDocBasic.GetUNOConstant( "ThisComponent", aThisComp ); Reference< util::XCloseBroadcaster > xCloseBC( aThisComp, UNO_QUERY ); + mbDisposed = !xCloseBC.is(); if( xCloseBC.is() ) try { xCloseBC->addCloseListener( this ); } catch( uno::Exception& ) {} } -- cgit v1.2.3 From dd7073f0eed94bb775fdf84e3dac703ec8038a52 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 15 Mar 2011 20:54:02 +0100 Subject: fs34b: #i117039# restore old behavior of SfxUndoManager::EnableUndo: don't count the calls, but maintain a simple flag. Consequently, let sw's UndoManager simply delegate now, and change the UndoManagerHelper to maintain a lock counter itself. --- framework/source/fwe/helper/undomanagerhelper.cxx | 52 +++++++++++++++++------ 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/framework/source/fwe/helper/undomanagerhelper.cxx b/framework/source/fwe/helper/undomanagerhelper.cxx index 891504adbe71..9e3b6c7265e0 100755 --- a/framework/source/fwe/helper/undomanagerhelper.cxx +++ b/framework/source/fwe/helper/undomanagerhelper.cxx @@ -220,6 +220,7 @@ namespace framework bool m_disposed; bool m_bAPIActionRunning; bool m_bProcessingEvents; + sal_Int32 m_nLockCount; ::cppu::OInterfaceContainerHelper m_aUndoListeners; ::cppu::OInterfaceContainerHelper m_aModifyListeners; IUndoManagerImplementation& m_rUndoManagerImplementation; @@ -241,6 +242,7 @@ namespace framework ,m_disposed( false ) ,m_bAPIActionRunning( false ) ,m_bProcessingEvents( false ) + ,m_nLockCount( 0 ) ,m_aUndoListeners( m_aMutex ) ,m_aModifyListeners( m_aMutex ) ,m_rUndoManagerImplementation( i_undoManagerImpl ) @@ -290,6 +292,9 @@ namespace framework void clearRedo( IMutexGuard& i_instanceLock ); void reset( IMutexGuard& i_instanceLock ); + void lock(); + void unlock(); + void addUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) { m_aUndoListeners.addInterface( i_listener ); @@ -479,6 +484,37 @@ namespace framework ); } + //------------------------------------------------------------------------------------------------------------------ + void UndoManagerHelper_Impl::lock() + { + // SYNCHRONIZED ---> + ::osl::MutexGuard aGuard( getMutex() ); + + if ( ++m_nLockCount == 1 ) + { + IUndoManager& rUndoManager = getUndoManager(); + rUndoManager.EnableUndo( false ); + } + // <--- SYNCHRONIZED + } + + //------------------------------------------------------------------------------------------------------------------ + void UndoManagerHelper_Impl::unlock() + { + // SYNCHRONIZED ---> + ::osl::MutexGuard aGuard( getMutex() ); + + if ( m_nLockCount == 0 ) + throw NotLockedException( ::rtl::OUString::createFromAscii( "Undo manager is not locked" ), getXUndoManager() ); + + if ( --m_nLockCount == 0 ) + { + IUndoManager& rUndoManager = getUndoManager(); + rUndoManager.EnableUndo( true ); + } + // <--- SYNCHRONIZED + } + //------------------------------------------------------------------------------------------------------------------ void UndoManagerHelper_Impl::impl_processRequest( ::boost::function0< void > const& i_request, IMutexGuard& i_instanceLock ) { @@ -1100,25 +1136,13 @@ namespace framework //------------------------------------------------------------------------------------------------------------------ void UndoManagerHelper::lock() { - // SYNCHRONIZED ---> - ::osl::MutexGuard aGuard( m_pImpl->getMutex() ); - - IUndoManager& rUndoManager = m_pImpl->getUndoManager(); - rUndoManager.EnableUndo( false ); - // <--- SYNCHRONIZED + m_pImpl->lock(); } //------------------------------------------------------------------------------------------------------------------ void UndoManagerHelper::unlock() { - // SYNCHRONIZED ---> - ::osl::MutexGuard aGuard( m_pImpl->getMutex() ); - - IUndoManager& rUndoManager = m_pImpl->getUndoManager(); - if ( rUndoManager.IsUndoEnabled() ) - throw NotLockedException( ::rtl::OUString::createFromAscii( "Undo manager is not locked" ), m_pImpl->getXUndoManager() ); - rUndoManager.EnableUndo( true ); - // <--- SYNCHRONIZED + m_pImpl->unlock(); } //------------------------------------------------------------------------------------------------------------------ -- cgit v1.2.3 From a013e99f22f1d412fc9802887ddfd593fb40380d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 15 Mar 2011 20:54:02 +0100 Subject: fs34b: #i117039# restore old behavior of SfxUndoManager::EnableUndo: don't count the calls, but maintain a simple flag. Consequently, let sw's UndoManager simply delegate now, and change the UndoManagerHelper to maintain a lock counter itself. --- sw/source/core/undo/docundo.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx index 2e91da080c7c..b82d67002f33 100644 --- a/sw/source/core/undo/docundo.cxx +++ b/sw/source/core/undo/docundo.cxx @@ -406,12 +406,9 @@ SwUndo * UndoManager::RemoveLastUndo() void UndoManager::EnableUndo(bool bEnable) { - // UGLY: SfxUndoManager has a counter to match enable/disable calls - // but the writer code expects that a single call switches - while (IsUndoEnabled() != bEnable) - { - SfxUndoManager::EnableUndo(bEnable); - } + // SfxUndoManager does not have a counter anymore, but reverted to the old behavior of + // having a simple boolean flag for locking. So, simply forward. + SfxUndoManager::EnableUndo(bEnable); } void UndoManager::AddUndoAction(SfxUndoAction *pAction, sal_Bool bTryMerge) -- cgit v1.2.3 From 456b31d9083141ab82d18dc2b279ae0300e8a414 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 15 Mar 2011 20:54:02 +0100 Subject: fs34b: #i117039# restore old behavior of SfxUndoManager::EnableUndo: don't count the calls, but maintain a simple flag. Consequently, let sw's UndoManager simply delegate now, and change the UndoManagerHelper to maintain a lock counter itself. --- svl/inc/svl/undo.hxx | 11 ++++++++--- svl/source/undo/undo.cxx | 17 ++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/svl/inc/svl/undo.hxx b/svl/inc/svl/undo.hxx index 3d2c46af496c..9801041e23f9 100644 --- a/svl/inc/svl/undo.hxx +++ b/svl/inc/svl/undo.hxx @@ -310,9 +310,14 @@ namespace svl /** clears the redo stack and removes the top undo action */ virtual void RemoveLastUndoAction() = 0; - // enables (true) or disables (false) recording of undo actions - // If undo actions are added while undo is disabled, they are deleted. - // Disabling undo does not clear the current undo buffer! + /** enables (true) or disables (false) recording of undo actions + + If undo actions are added while undo is disabled, they are deleted. + Disabling undo does not clear the current undo buffer! + + Multiple calls to EnableUndo are not cumulative. That is, calling EnableUndo( false ) + twice, and then calling EnableUndo( true ) means that Undo is enable afterwards. + */ virtual void EnableUndo( bool bEnable ) = 0; // returns true if undo is currently enabled diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index af22c04c79ff..d784d1bd19f8 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -186,9 +186,9 @@ struct SVL_DLLPRIVATE SfxUndoManager_Data SfxUndoArray* pActUndoArray; SfxUndoArray* pFatherUndoArray; - sal_Int32 mnLockCount; sal_Int32 mnMarks; sal_Int32 mnEmptyMark; + bool mbUndoEnabled; bool mbDoing; bool mbClearUntilTopLevel; @@ -198,9 +198,9 @@ struct SVL_DLLPRIVATE SfxUndoManager_Data :pUndoArray( new SfxUndoArray( i_nMaxUndoActionCount ) ) ,pActUndoArray( NULL ) ,pFatherUndoArray( NULL ) - ,mnLockCount( 0 ) ,mnMarks( 0 ) ,mnEmptyMark(MARK_INVALID) + ,mbUndoEnabled( true ) ,mbDoing( false ) ,mbClearUntilTopLevel( false ) { @@ -421,14 +421,9 @@ void SfxUndoManager::EnableUndo( bool i_enable ) void SfxUndoManager::ImplEnableUndo_Lock( bool const i_enable ) { - if ( !i_enable ) - ++m_pData->mnLockCount; - else - { - OSL_PRECOND( m_pData->mnLockCount > 0, "SfxUndoManager::ImplEnableUndo_NoNotify: not disabled, so why enabling?" ); - if ( m_pData->mnLockCount > 0 ) - --m_pData->mnLockCount; - } + if ( m_pData->mbUndoEnabled == i_enable ) + return; + m_pData->mbUndoEnabled = i_enable; } //------------------------------------------------------------------------ @@ -443,7 +438,7 @@ bool SfxUndoManager::IsUndoEnabled() const bool SfxUndoManager::ImplIsUndoEnabled_Lock() const { - return m_pData->mnLockCount == 0; + return m_pData->mbUndoEnabled; } //------------------------------------------------------------------------ -- cgit v1.2.3 From 4c6d7e2dacb590688d6ef74c2a6c7292c31bd8f1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 16 Mar 2011 11:08:00 +0100 Subject: gridfixes: copied #i112562#'s fix from CWS gridcontrol06 herein --- svtools/inc/svtools/accessibletable.hxx | 29 ++++++ svtools/inc/svtools/table/tablecontrol.hxx | 13 ++- svtools/source/table/tablecontrol.cxx | 149 +++++++++++++++++++++++++---- svtools/source/table/tablecontrol_impl.cxx | 58 ++++++++--- svtools/source/table/tablecontrol_impl.hxx | 10 +- svtools/source/uno/svtxgridcontrol.cxx | 66 ++++++++++++- 6 files changed, 282 insertions(+), 43 deletions(-) diff --git a/svtools/inc/svtools/accessibletable.hxx b/svtools/inc/svtools/accessibletable.hxx index d7bd98481404..186c83d75be8 100644 --- a/svtools/inc/svtools/accessibletable.hxx +++ b/svtools/inc/svtools/accessibletable.hxx @@ -111,7 +111,9 @@ public: virtual sal_Bool HasRowHeader() const= 0; virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint )= 0; virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True ) = 0; + virtual Rectangle calcHeaderCellRect( sal_Bool _bColHeader, sal_Int32 _nPos ) = 0; virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True ) = 0; + virtual Rectangle calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos ) = 0; virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex)= 0; virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)= 0; virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const= 0; @@ -165,6 +167,33 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > getTable() = 0; + /** commits the event at all listeners of the cell + @param nEventId + the event id + @param rNewValue + the new value + @param rOldValue + the old value + */ + virtual void commitCellEvent( + sal_Int16 nEventId, + const ::com::sun::star::uno::Any& rNewValue, + const ::com::sun::star::uno::Any& rOldValue + ) = 0; + /** commits the event at all listeners of the table + @param nEventId + the event id + @param rNewValue + the new value + @param rOldValue + the old value + */ + virtual void commitTableEvent( + sal_Int16 nEventId, + const ::com::sun::star::uno::Any& rNewValue, + const ::com::sun::star::uno::Any& rOldValue + ) = 0; + ///** Commits an event to all listeners. */ virtual void commitEvent( sal_Int16 nEventId, diff --git a/svtools/inc/svtools/table/tablecontrol.hxx b/svtools/inc/svtools/table/tablecontrol.hxx index 8afc2209227c..edcca9d11a9a 100644 --- a/svtools/inc/svtools/table/tablecontrol.hxx +++ b/svtools/inc/svtools/table/tablecontrol.hxx @@ -169,9 +169,14 @@ namespace svt { namespace table SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectName(AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const; SVT_DLLPRIVATE virtual sal_Bool GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow ); SVT_DLLPRIVATE virtual ::rtl::OUString GetAccessibleObjectDescription(AccessibleTableControlObjType eObjType, sal_Int32 _nPosition = -1) const; - virtual void FillAccessibleStateSet( - ::utl::AccessibleStateSetHelper& rStateSet, - AccessibleTableControlObjType eObjType ) const; + SVT_DLLPRIVATE virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet, AccessibleTableControlObjType eObjType ) const; + + // temporary methods + // Those do not really belong into the public API - they're intended for firing A11Y-related events. However, + // firing those events should be an implementation internal to the TableControl resp. TableControl_Impl, + // instead of something triggered externally. + void commitCellEventIfAccessibleAlive( sal_Int16 const i_eventID, const ::com::sun::star::uno::Any& i_newValue, const ::com::sun::star::uno::Any& i_oldValue ); + void commitTableEventIfAccessibleAlive( sal_Int16 const i_eventID, const ::com::sun::star::uno::Any& i_newValue, const ::com::sun::star::uno::Any& i_oldValue ); // ............................................................................................................. // IAccessibleTable @@ -187,7 +192,9 @@ namespace svt { namespace table virtual sal_Bool HasRowHeader() const; virtual sal_Bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint ); virtual Rectangle calcHeaderRect( sal_Bool _bIsColumnBar, sal_Bool _bOnScreen = sal_True ); + virtual Rectangle calcHeaderCellRect( sal_Bool _bIsColumnBar, sal_Int32 nPos); virtual Rectangle calcTableRect( sal_Bool _bOnScreen = sal_True ); + virtual Rectangle calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos ); virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex); virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint); virtual void FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const; diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index 6216c19286d3..ef667346d07c 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -35,6 +35,7 @@ #include #include +#include #include @@ -49,6 +50,8 @@ namespace svt { namespace table { //...................................................................................................................... + namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId; + //================================================================================================================== //= TableControl //================================================================================================================== @@ -97,6 +100,27 @@ namespace svt { namespace table { if ( !m_pImpl->getInputHandler()->KeyInput( *m_pImpl, rKEvt ) ) Control::KeyInput( rKEvt ); + else + { + if ( m_pImpl->isAccessibleAlive() ) + { + m_pImpl->commitCellEvent( AccessibleEventId::STATE_CHANGED, + makeAny( AccessibleStateType::FOCUSED ), + Any() + ); + // Huh? What the heck? Why do we unconditionally notify a STATE_CHANGE/FOCUSED after each and every + // (handled) key stroke? + + m_pImpl->commitTableEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, + Any(), + Any() + ); + // ditto: Why do we notify this unconditionally? We should find the right place to notify the + // ACTIVE_DESCENDANT_CHANGED event. + // Also, we should check if STATE_CHANGED/FOCUSED is really necessary: finally, the children are + // transient, aren't they? + } + } } @@ -295,10 +319,10 @@ namespace svt { namespace table switch( eObjType ) { case TCTYPE_GRIDCONTROL: - aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GridControl" ) ); + aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Grid control" ) ); break; case TCTYPE_TABLE: - aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Table" ) ); + aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Grid conrol" ) ); break; case TCTYPE_ROWHEADERBAR: aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowHeaderBar" ) ); @@ -307,7 +331,19 @@ namespace svt { namespace table aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnHeaderBar" ) ); break; case TCTYPE_TABLECELL: - aRetText = GetAccessibleCellText(_nRow, _nCol); + //the name of the cell constists of column name and row name if defined + //if the name is equal to cell content, it'll be read twice + if(GetModel()->hasColumnHeaders()) + { + aRetText = GetColumnName(_nCol); + aRetText += rtl::OUString::createFromAscii(" , "); + } + if(GetModel()->hasRowHeaders()) + { + aRetText += GetRowName(_nRow); + aRetText += rtl::OUString::createFromAscii(" , "); + } + //aRetText = GetAccessibleCellText(_nRow, _nCol); break; case TCTYPE_ROWHEADERCELL: aRetText = GetRowName(_nRow); @@ -328,7 +364,7 @@ namespace svt { namespace table switch( eObjType ) { case TCTYPE_GRIDCONTROL: - aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GridControl description" ) ); + aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Grid control description" ) ); break; case TCTYPE_TABLE: aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLE description" ) ); @@ -340,7 +376,17 @@ namespace svt { namespace table aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERBAR description" ) ); break; case TCTYPE_TABLECELL: - aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLECELL description" ) ); + // the description of the cell consists of column name and row name if defined + // if the name is equal to cell content, it'll be read twice + if ( GetModel()->hasColumnHeaders() ) + { + aRetText = GetColumnName( GetCurrentColumn() ); + aRetText += rtl::OUString::createFromAscii( " , " ); + } + if ( GetModel()->hasRowHeaders() ) + { + aRetText += GetRowName( GetCurrentRow() ); + } break; case TCTYPE_ROWHEADERCELL: aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERCELL description" ) ); @@ -405,44 +451,80 @@ namespace svt { namespace table case TCTYPE_TABLE: rStateSet.AddState( AccessibleStateType::FOCUSABLE ); - rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE); - if ( HasFocus() ) + + if ( m_pImpl->getSelEngine()->GetSelectionMode() == MULTIPLE_SELECTION ) + rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE); + + if ( HasChildPathFocus() ) rStateSet.AddState( AccessibleStateType::FOCUSED ); + if ( IsActive() ) rStateSet.AddState( AccessibleStateType::ACTIVE ); - if ( IsEnabled() ) + + if ( m_pImpl->getDataWindow().IsEnabled() ) + { rStateSet.AddState( AccessibleStateType::ENABLED ); + rStateSet.AddState( AccessibleStateType::SENSITIVE ); + } + if ( IsReallyVisible() ) rStateSet.AddState( AccessibleStateType::VISIBLE ); - rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS ); + if ( eObjType == TCTYPE_TABLE ) + rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS ); break; + case TCTYPE_ROWHEADERBAR: rStateSet.AddState( AccessibleStateType::VISIBLE ); rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS ); break; + case TCTYPE_COLUMNHEADERBAR: rStateSet.AddState( AccessibleStateType::VISIBLE ); rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS ); break; + case TCTYPE_TABLECELL: { + rStateSet.AddState( AccessibleStateType::FOCUSABLE ); + if ( HasChildPathFocus() ) + rStateSet.AddState( AccessibleStateType::FOCUSED ); + rStateSet.AddState( AccessibleStateType::ACTIVE ); rStateSet.AddState( AccessibleStateType::TRANSIENT ); rStateSet.AddState( AccessibleStateType::SELECTABLE); - if( GetSelectedRowCount()>0) - rStateSet.AddState( AccessibleStateType::SELECTED); + rStateSet.AddState( AccessibleStateType::VISIBLE ); + rStateSet.AddState( AccessibleStateType::SHOWING ); + if ( IsRowSelected( GetCurrentRow() ) ) + // Hmm? Wouldn't we expect the affected row to be a parameter to this function? + rStateSet.AddState( AccessibleStateType::SELECTED ); } break; + case TCTYPE_ROWHEADERCELL: rStateSet.AddState( AccessibleStateType::VISIBLE ); rStateSet.AddState( AccessibleStateType::TRANSIENT ); break; + case TCTYPE_COLUMNHEADERCELL: rStateSet.AddState( AccessibleStateType::VISIBLE ); break; } } + //------------------------------------------------------------------------------------------------------------------ + void TableControl::commitCellEventIfAccessibleAlive( sal_Int16 const i_eventID, const Any& i_newValue, const Any& i_oldValue ) + { + if ( m_pImpl->isAccessibleAlive() ) + m_pImpl->commitCellEvent( i_eventID, i_newValue, i_oldValue ); + } + + //------------------------------------------------------------------------------------------------------------------ + void TableControl::commitTableEventIfAccessibleAlive( sal_Int16 const i_eventID, const Any& i_newValue, const Any& i_oldValue ) + { + if ( m_pImpl->isAccessibleAlive() ) + m_pImpl->commitTableEvent( i_eventID, i_newValue, i_oldValue ); + } + //------------------------------------------------------------------------------------------------------------------ Rectangle TableControl::GetWindowExtentsRelative( Window *pRelativeWindow ) const { @@ -488,13 +570,12 @@ namespace svt { namespace table //------------------------------------------------------------------------------------------------------------------ sal_Int32 TableControl::GetAccessibleControlCount() const { - sal_Int32 count = 0; - if(GetRowCount()>0) - count+=1; - if(GetModel()->hasRowHeaders()) - count+=1; - if(GetModel()->hasColumnHeaders()) - count+=1; + // TC_TABLE is always defined, no matter whether empty or not + sal_Int32 count = 1; + if ( GetModel()->hasRowHeaders() ) + ++count; + if ( GetModel()->hasColumnHeaders() ) + ++count; return count; } @@ -536,10 +617,20 @@ namespace svt { namespace table //------------------------------------------------------------------------------------------------------------------ void TableControl::FillAccessibleStateSetForCell( ::utl::AccessibleStateSetHelper& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const { - if ( GetCurrentRow() == _nRow && GetCurrentColumn() == _nColumnPos ) + if ( IsRowSelected( _nRow ) ) + _rStateSet.AddState( AccessibleStateType::SELECTED ); + if ( HasChildPathFocus() ) _rStateSet.AddState( AccessibleStateType::FOCUSED ); else // only transient when column is not focused _rStateSet.AddState( AccessibleStateType::TRANSIENT ); + + _rStateSet.AddState( AccessibleStateType::VISIBLE ); + _rStateSet.AddState( AccessibleStateType::SHOWING ); + _rStateSet.AddState( AccessibleStateType::ENABLED ); + _rStateSet.AddState( AccessibleStateType::SENSITIVE ); + _rStateSet.AddState( AccessibleStateType::ACTIVE ); + + (void)_nColumnPos; } //------------------------------------------------------------------------------------------------------------------ @@ -565,6 +656,12 @@ namespace svt { namespace table return m_pImpl->calcHeaderRect( _bIsColumnBar ? false : true ); } + //------------------------------------------------------------------------------------------------------------------ + Rectangle TableControl::calcHeaderCellRect( sal_Bool _bIsColumnBar, sal_Int32 nPos ) + { + return m_pImpl->calcHeaderCellRect( _bIsColumnBar, nPos ); + } + //------------------------------------------------------------------------------------------------------------------ Rectangle TableControl::calcTableRect(sal_Bool _bOnScreen) { @@ -572,6 +669,11 @@ namespace svt { namespace table return m_pImpl->calcTableRect(); } + //------------------------------------------------------------------------------------------------------------------ + Rectangle TableControl::calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos ) + { + return m_pImpl->calcCellRect( _nRowPos, _nColPos ); + } //------------------------------------------------------------------------------------------------------------------ IMPL_LINK( TableControl, ImplSelectHdl, void*, EMPTYARG ) { @@ -597,6 +699,15 @@ namespace svt { namespace table void TableControl::Select() { ImplCallEventListenersAndHandler( VCLEVENT_TABLEROW_SELECT, m_pImpl->getSelectHandler(), this ); + + if ( m_pImpl->isAccessibleAlive() ) + { + m_pImpl->commitAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() ); + + m_pImpl->commitTableEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, Any(), Any() ); + // TODO: why do we notify this when the *selection* changed? Shouldn't we find a better place for this, + // actually, when the active descendant, i.e. the current cell, *really* changed? + } } //------------------------------------------------------------------------------------------------------------------ diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 0e31dec36f66..2c23a9c93fe3 100755 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -544,20 +544,6 @@ namespace svt { namespace table makeAny( AccessibleTableModelChange( AccessibleTableModelChangeType::INSERT, i_first, i_last, 0, m_pModel->getColumnCount() ) ), Any() ); - impl_commitAccessibleEvent( AccessibleEventId::CHILD, - makeAny( m_pAccessibleTable->getTableHeader( TCTYPE_ROWHEADERBAR ) ), - Any() - ); - -// for ( sal_Int32 i = 0 ; i <= m_pModel->getColumnCount(); ++i ) -// { -// impl_commitAccessibleEvent( -// CHILD, -// makeAny( m_pAccessibleTable->getTable() ), -// Any()); -// } - // Huh? What's that? We're notifying |columnCount| CHILD events here, claiming the *table* itself - // has been inserted. Doesn't make much sense, does it? } // schedule repaint @@ -615,7 +601,7 @@ namespace svt { namespace table // notify A11Y events if ( impl_isAccessibleAlive() ) { - impl_commitAccessibleEvent( + commitTableEvent( AccessibleEventId::TABLE_MODEL_CHANGED, makeAny( AccessibleTableModelChange( AccessibleTableModelChangeType::DELETE, @@ -2502,6 +2488,28 @@ namespace svt { namespace table return true; } + //-------------------------------------------------------------------- + void TableControl_Impl::commitAccessibleEvent( sal_Int16 const i_eventID, const Any& i_newValue, const Any& i_oldValue ) + { + impl_commitAccessibleEvent( i_eventID, i_newValue, i_oldValue ); + } + + //-------------------------------------------------------------------- + void TableControl_Impl::commitCellEvent( sal_Int16 const i_eventID, const Any& i_newValue, const Any& i_oldValue ) + { + DBG_CHECK_ME(); + if ( impl_isAccessibleAlive() ) + m_pAccessibleTable->commitCellEvent( i_eventID, i_newValue, i_oldValue ); + } + + //-------------------------------------------------------------------- + void TableControl_Impl::commitTableEvent( sal_Int16 const i_eventID, const Any& i_newValue, const Any& i_oldValue ) + { + DBG_CHECK_ME(); + if ( impl_isAccessibleAlive() ) + m_pAccessibleTable->commitTableEvent( i_eventID, i_newValue, i_oldValue ); + } + //-------------------------------------------------------------------- Rectangle TableControl_Impl::calcHeaderRect(bool bColHeader) { @@ -2513,12 +2521,32 @@ namespace svt { namespace table return Rectangle( aRectTableWithHeaders.TopLeft(), Size( m_nRowHeaderWidthPixel, aSizeTableWithHeaders.Height() ) ); } + //-------------------------------------------------------------------- + Rectangle TableControl_Impl::calcHeaderCellRect( bool bColHeader, sal_Int32 nPos ) + { + Rectangle const aHeaderRect = calcHeaderRect( bColHeader ); + TableCellGeometry const aGeometry( + *this, aHeaderRect, + bColHeader ? nPos : COL_ROW_HEADERS, + bColHeader ? ROW_COL_HEADERS : nPos + ); + return aGeometry.getRect(); + } + //-------------------------------------------------------------------- Rectangle TableControl_Impl::calcTableRect() { return impl_getAllVisibleDataCellArea(); } + //-------------------------------------------------------------------- + Rectangle TableControl_Impl::calcCellRect( sal_Int32 nRow, sal_Int32 nCol ) + { + Rectangle aCellRect; + impl_getCellRect( nRow, nCol, aCellRect ); + return aCellRect; + } + //-------------------------------------------------------------------- IMPL_LINK( TableControl_Impl, OnUpdateScrollbars, void*, /**/ ) { diff --git a/svtools/source/table/tablecontrol_impl.hxx b/svtools/source/table/tablecontrol_impl.hxx index e768636c676e..04893084fb31 100755 --- a/svtools/source/table/tablecontrol_impl.hxx +++ b/svtools/source/table/tablecontrol_impl.hxx @@ -280,6 +280,10 @@ namespace svt { namespace table void setSelectHandler( Link const & i_selectHandler ) { m_aSelectHdl = i_selectHandler; } Link const& getSelectHandler() const { return m_aSelectHdl; } + void commitAccessibleEvent( sal_Int16 const i_eventID, const com::sun::star::uno::Any& i_newValue, const com::sun::star::uno::Any& i_oldValue ); + void commitCellEvent( sal_Int16 const i_eventID, const com::sun::star::uno::Any& i_newValue, const com::sun::star::uno::Any& i_oldValue ); + void commitTableEvent( sal_Int16 const i_eventID, const com::sun::star::uno::Any& i_newValue, const com::sun::star::uno::Any& i_oldValue ); + // ITableControl virtual void hideCursor(); virtual void showCursor(); @@ -309,14 +313,18 @@ namespace svt { namespace table ScrollBar* getHorzScrollbar(); ScrollBar* getVertScrollbar(); - Rectangle calcHeaderRect(bool bColHeader); + Rectangle calcHeaderRect( bool bColHeader ); + Rectangle calcHeaderCellRect( bool bColHeader, sal_Int32 nPos ); Rectangle calcTableRect(); + Rectangle calcCellRect( sal_Int32 nRow, sal_Int32 nCol ); // A11Y ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > getAccessible( Window& i_parentWindow ); void disposeAccessible(); + inline bool isAccessibleAlive() const { return impl_isAccessibleAlive(); } + // ITableModelListener virtual void rowsInserted( RowPos first, RowPos last ); virtual void rowsRemoved( RowPos first, RowPos last ); diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index 0e826ef6bff3..61ff74fd3f0a 100644 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -43,6 +43,8 @@ #include #include #include +#include +#include #include #include @@ -686,21 +688,75 @@ void SVTXGridControl::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ::vos::OGuard aGuard( GetMutex() ); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xKeepAlive( this ); + + TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::ProcessWindowEvent: no control (anymore)!" ); + + bool handled = false; switch ( rVclWindowEvent.GetId() ) { case VCLEVENT_TABLEROW_SELECT: { - TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); - ENSURE_OR_BREAK( pTable, "SVTXGridControl::ProcessWindowEvent: no control (anymore)!" ); if ( m_aSelectionListeners.getLength() ) ImplCallItemListeners(); + handled = true; } break; - default: - VCLXWindow::ProcessWindowEvent( rVclWindowEvent ); - break; + case VCLEVENT_CONTROL_GETFOCUS: + { + // TODO: this doesn't belong here. It belongs into the TableControl/_Impl, so A11Y also + // works when the control is used outside the UNO context + if ( pTable->GetRowCount()>0 ) + { + pTable->commitCellEventIfAccessibleAlive( + AccessibleEventId::STATE_CHANGED, + makeAny( AccessibleStateType::FOCUSED ), + Any() + ); + pTable->commitTableEventIfAccessibleAlive( + AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, + Any(), + Any() + ); + } + else + { + pTable->commitTableEventIfAccessibleAlive( + AccessibleEventId::STATE_CHANGED, + makeAny( AccessibleStateType::FOCUSED ), + Any() + ); + } + } + break; + + case VCLEVENT_CONTROL_LOSEFOCUS: + { + // TODO: this doesn't belong here. It belongs into the TableControl/_Impl, so A11Y also + // works when the control is used outside the UNO context + if ( pTable->GetRowCount()>0 ) + { + pTable->commitCellEventIfAccessibleAlive( + AccessibleEventId::STATE_CHANGED, + Any(), + makeAny( AccessibleStateType::FOCUSED ) + ); + } + else + { + pTable->commitTableEventIfAccessibleAlive( + AccessibleEventId::STATE_CHANGED, + Any(), + makeAny( AccessibleStateType::FOCUSED ) + ); + } + } + break; } + + if ( !handled ) + VCLXWindow::ProcessWindowEvent( rVclWindowEvent ); } //---------------------------------------------------------------------------------------------------------------------- -- cgit v1.2.3 From 792fe06ae1d9ca29210f1aec26bd2bb28ed287cc Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 16 Mar 2011 11:08:00 +0100 Subject: gridfixes: copied #i112562#'s fix from CWS gridcontrol06 herein --- .../extended/AccessibleGridControl.hxx | 37 +++++++++- .../extended/AccessibleGridControlBase.hxx | 1 - .../extended/AccessibleGridControlTable.hxx | 10 ++- .../extended/AccessibleGridControlTableBase.hxx | 8 +++ .../extended/AccessibleGridControlTableCell.hxx | 3 - .../source/extended/AccessibleGridControl.cxx | 81 ++++++++++++++++++++++ .../source/extended/AccessibleGridControlBase.cxx | 9 +++ .../extended/AccessibleGridControlHeader.cxx | 16 ++++- .../extended/AccessibleGridControlHeaderCell.cxx | 19 ++++- .../source/extended/AccessibleGridControlTable.cxx | 61 ++++++++++++++-- .../extended/AccessibleGridControlTableCell.cxx | 18 ++++- 11 files changed, 246 insertions(+), 17 deletions(-) mode change 100755 => 100644 accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx index cb2c4f6628c8..5f8976b905a3 100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx @@ -34,7 +34,6 @@ #include #include - #include using namespace ::svt::table; @@ -111,6 +110,28 @@ protected: public: // helper functions + + /** commitCellEvent commit the event at all listeners of the table + @param nEventId + the event id + @param rNewValue + the new value + @param rOldValue + the old value + */ + void commitCellEvent(sal_Int16 nEventId, const ::com::sun::star::uno::Any& rNewValue, + const ::com::sun::star::uno::Any& rOldValue); + + /** commitTableEvent commit the event at all listeners of the table + @param nEventId + the event id + @param rNewValue + the new value + @param rOldValue + the old value + */ + void commitTableEvent(sal_Int16 nEventId, const ::com::sun::star::uno::Any& rNewValue, + const ::com::sun::star::uno::Any& rOldValue); /** returns the accessible object for the row or the column header bar */ inline ::com::sun::star::uno::Reference< @@ -242,6 +263,20 @@ protected: xAccessible = pContext->getTable(); return xAccessible; } + virtual void commitCellEvent( sal_Int16 nEventId, + const ::com::sun::star::uno::Any& rNewValue, const ::com::sun::star::uno::Any& rOldValue ) + { + AccessibleGridControl* pContext( getContext() ); + if ( pContext ) + pContext->commitCellEvent( nEventId, rNewValue, rOldValue ); + } + virtual void commitTableEvent( sal_Int16 nEventId, + const ::com::sun::star::uno::Any& rNewValue, const ::com::sun::star::uno::Any& rOldValue ) + { + AccessibleGridControl* pContext( getContext() ); + if ( pContext ) + pContext->commitTableEvent( nEventId, rNewValue, rOldValue ); + } virtual void commitEvent( sal_Int16 nEventId, const ::com::sun::star::uno::Any& rNewValue, const ::com::sun::star::uno::Any& rOldValue ) { diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx index c6a26d8c4548..651a58e182ce 100644 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx @@ -47,7 +47,6 @@ #include #include #include -#include #include #include diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx index 8058594d2938..4c13df132968 100644 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx @@ -32,6 +32,7 @@ #include "accessibility/extended/AccessibleGridControlTableBase.hxx" #include #include +#include // ============================================================================ @@ -55,7 +56,9 @@ public: protected: virtual ~AccessibleGridControlTable(); - +private: + std::vector< AccessibleGridControlTableCell* > m_pCellVector; + std::vector< com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible> > m_pAccessCellVector; public: // XAccessibleContext ----------------------------------------------------- @@ -196,6 +199,11 @@ public: virtual ::rtl::OUString SAL_CALL getImplementationName() throw ( ::com::sun::star::uno::RuntimeException ); + /**@return m_pCellVector*/ + std::vector< AccessibleGridControlTableCell* >& getCellVector(); + /**@return m_xAccessCellVector*/ + std::vector< com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible > >& getAccessibleCellVector(); + protected: // internal virtual methods ----------------------------------------------- diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx old mode 100755 new mode 100644 index bee42d85e2a2..4ea1b7826c2f --- a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx @@ -173,6 +173,14 @@ public: protected: // internal helper methods ------------------------------------------------ +// /** @attention This method requires locked mutex's and a living object. +// @param nColumn +// the position of the column in the Accessible world +// @return +// the position of the column in VCL the Accessible world +// */ +// sal_uInt16 implToVCLColumnPos( sal_Int32 nColumn ) const; + /** @attention This method requires locked mutex's and a living object. @return The number of cells of the table. */ sal_Int32 implGetChildCount() const; diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx index dd44927d7fc1..f210e7dd01e6 100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx @@ -73,9 +73,6 @@ namespace accessibility ,public AccessibleTextHelper_BASE ,public ::comphelper::OCommonAccessibleText { - private: - sal_Int32 m_nOffset; - protected: // OCommonAccessibleText virtual ::rtl::OUString implGetText(); diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx index f0aa406b62bf..208be0b5c08b 100755 --- a/accessibility/source/extended/AccessibleGridControl.cxx +++ b/accessibility/source/extended/AccessibleGridControl.cxx @@ -30,6 +30,9 @@ #include "accessibility/extended/AccessibleGridControl.hxx" #include "accessibility/extended/AccessibleGridControlTable.hxx" #include "accessibility/extended/AccessibleGridControlHeader.hxx" +#include +#include +#include #include #include #include @@ -71,6 +74,11 @@ public: Reference< ::com::sun::star::accessibility::XAccessible > m_xColumnHeaderBar; AccessibleGridControlHeader* m_pColumnHeaderBar; + + /** The table cell child. */ + Reference< + ::com::sun::star::accessibility::XAccessible > m_xCell; + AccessibleGridControlTableCell* m_pCell; }; DBG_NAME( AccessibleGridControl ) @@ -97,6 +105,7 @@ void SAL_CALL AccessibleGridControl::disposing() m_pImpl->m_pTable = NULL; m_pImpl->m_pColumnHeaderBar = NULL; m_pImpl->m_pRowHeaderBar = NULL; + m_pImpl->m_pCell = NULL; m_pImpl->m_aCreator = Reference< XAccessible >(); Reference< XAccessible > xTable = m_pImpl->m_xTable; @@ -106,7 +115,16 @@ void SAL_CALL AccessibleGridControl::disposing() { xComp->dispose(); } + Reference< XAccessible > xCell = m_pImpl->m_xCell; + + Reference< XComponent > xCellComp( m_pImpl->m_xCell, UNO_QUERY ); + if ( xCellComp.is() ) + { + xCellComp->dispose(); + } + ::comphelper::disposeComponent(m_pImpl->m_xRowHeaderBar); + ::comphelper::disposeComponent(m_pImpl->m_xColumnHeaderBar); AccessibleGridControlBase::disposing(); } // ----------------------------------------------------------------------------- @@ -156,8 +174,12 @@ AccessibleGridControl::getAccessibleChild( sal_Int32 nChildIndex ) } else { + if(!m_pImpl->m_xTable.is()) + { AccessibleGridControlTable* pTable = new AccessibleGridControlTable(m_pImpl->m_aCreator, m_aTable, svt::table::TCTYPE_TABLE); m_pImpl->m_xTable = pTable; + m_pImpl->m_pTable = pTable; + } xChild = m_pImpl->m_xTable; } } @@ -316,6 +338,65 @@ AccessibleGridControlTable* AccessibleGridControl::createAccessibleTable() DBG_ASSERT( xCreator.is(), "accessibility/extended/AccessibleGirdControl::createAccessibleTable: my creator died - how this?" ); return new AccessibleGridControlTable( xCreator, m_aTable, TCTYPE_TABLE ); } +// ----------------------------------------------------------------------------- +void AccessibleGridControl::commitCellEvent(sal_Int16 _nEventId,const Any& _rNewValue,const Any& _rOldValue) +{ + sal_Int32 nChildCount = getAccessibleChildCount(); + if(nChildCount != 0) + { + for(sal_Int32 i=0;i xAccessible = getAccessibleChild(i); + com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessibleContext > xAccessibleChild = xAccessible->getAccessibleContext(); + if(m_pImpl->m_xTable == xAccessible) + { + std::vector< AccessibleGridControlTableCell* > xCellCont = m_pImpl->m_pTable->getCellVector(); + int nIndex = m_aTable.GetCurrentRow()*m_aTable.GetColumnCount()+m_aTable.GetCurrentColumn(); + if(!xCellCont.empty() && xCellCont[nIndex]) + { + m_pImpl->m_pCell = xCellCont[nIndex]; + m_pImpl->m_pCell->commitEvent( _nEventId, _rNewValue, _rOldValue ); + } + } + } + } + else + { + if ( m_pImpl->m_xTable.is() ) + m_pImpl->m_pTable->commitEvent(_nEventId,_rNewValue,_rOldValue); + } +} +void AccessibleGridControl::commitTableEvent(sal_Int16 _nEventId,const Any& _rNewValue,const Any& _rOldValue) +{ + if ( m_pImpl->m_xTable.is() ) + { + if(_nEventId == AccessibleEventId::ACTIVE_DESCENDANT_CHANGED) + { + Reference< XAccessible > xChild = m_pImpl->m_pTable->getAccessibleChild(m_aTable.GetCurrentRow()*m_aTable.GetColumnCount()+m_aTable.GetCurrentColumn()); + m_pImpl->m_pTable->commitEvent(_nEventId, makeAny(xChild),_rOldValue); + } + else if(_nEventId == AccessibleEventId::TABLE_MODEL_CHANGED) + { + AccessibleTableModelChange aChange; + if(_rNewValue >>= aChange) + { + if(aChange.Type == AccessibleTableModelChangeType::DELETE) + { + std::vector< AccessibleGridControlTableCell* >::iterator m_pCell = m_pImpl->m_pTable->getCellVector().begin(); + std::vector< Reference< XAccessible > >::iterator m_xAccessibleVector = m_pImpl->m_pTable->getAccessibleCellVector().begin(); + int nColCount = m_aTable.GetColumnCount(); + m_pImpl->m_pTable->getCellVector().erase(m_pCell+nColCount*aChange.FirstRow, m_pCell+nColCount*aChange.LastRow ); + m_pImpl->m_pTable->getAccessibleCellVector().erase(m_xAccessibleVector+nColCount*aChange.FirstRow, m_xAccessibleVector+nColCount*aChange.LastRow); + m_pImpl->m_pTable->commitEvent(_nEventId,_rNewValue,_rOldValue); + } + else + m_pImpl->m_pTable->commitEvent(_nEventId,_rNewValue,_rOldValue); + } + } + else + m_pImpl->m_pTable->commitEvent(_nEventId,_rNewValue,_rOldValue); + } +} // ============================================================================ // = AccessibleGridControlAccess // ============================================================================ diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx index ea81bd350426..2e000c68533d 100755 --- a/accessibility/source/extended/AccessibleGridControlBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlBase.cxx @@ -86,7 +86,16 @@ AccessibleGridControlBase::~AccessibleGridControlBase() void SAL_CALL AccessibleGridControlBase::disposing() { ::osl::MutexGuard aGuard( getOslMutex() ); + + if ( getClientId( ) ) + { + AccessibleEventNotifier::TClientId nId( getClientId( ) ); + setClientId( 0 ); + AccessibleEventNotifier::revokeClientNotifyDisposing( nId, *this ); + } + m_xParent = NULL; + //m_aTable = NULL; } // XAccessibleContext --------------------------------------------------------- diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx index 1870eebc8e3e..4b59a83906ab 100755 --- a/accessibility/source/extended/AccessibleGridControlHeader.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx @@ -239,12 +239,24 @@ Sequence< sal_Int8 > SAL_CALL AccessibleGridControlHeader::getImplementationId() Rectangle AccessibleGridControlHeader::implGetBoundingBox() { - return m_aTable.calcHeaderRect(isColumnBar()); + Window* pParent = m_aTable.GetAccessibleParentWindow(); + Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( pParent ) ); + Rectangle aHeaderRect (m_aTable.calcHeaderRect(isColumnBar())); + if(isColumnBar()) + return Rectangle(aGridRect.TopLeft(), Size(aGridRect.getWidth(),aHeaderRect.getHeight())); + else + return Rectangle(aGridRect.TopLeft(), Size(aHeaderRect.getWidth(),aGridRect.getHeight())); + } Rectangle AccessibleGridControlHeader::implGetBoundingBoxOnScreen() { - return m_aTable.calcHeaderRect(isColumnBar()); + Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( NULL ) ); + Rectangle aHeaderRect (m_aTable.calcHeaderRect(isColumnBar())); + if(isColumnBar()) + return Rectangle(aGridRect.TopLeft(), Size(aGridRect.getWidth(),aHeaderRect.getHeight())); + else + return Rectangle(aGridRect.TopLeft(), Size(aHeaderRect.getWidth(),aGridRect.getHeight())); } sal_Int32 AccessibleGridControlHeader::implGetRowCount() const diff --git a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx index 485c57c40ae1..f54379970206 100755 --- a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx @@ -146,13 +146,28 @@ void SAL_CALL AccessibleGridControlHeaderCell::grabFocus() // ----------------------------------------------------------------------------- Rectangle AccessibleGridControlHeaderCell::implGetBoundingBox() { - return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle + Window* pParent = m_aTable.GetAccessibleParentWindow(); + Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( pParent ) ); + sal_Int32 nIndex = getAccessibleIndexInParent(); + Rectangle aCellRect; + if(m_eObjType == TCTYPE_COLUMNHEADERCELL) + aCellRect = m_aTable.calcHeaderCellRect(true, nIndex); + else + aCellRect = m_aTable.calcHeaderCellRect(false, nIndex); + return Rectangle(Point(aGridRect.Left()+aCellRect.Left(),aGridRect.Top()+aCellRect.Top()), aCellRect.GetSize()); } // ----------------------------------------------------------------------------- Rectangle AccessibleGridControlHeaderCell::implGetBoundingBoxOnScreen() { - return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle + Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( NULL ) ); + sal_Int32 nIndex = getAccessibleIndexInParent(); + Rectangle aCellRect; + if(m_eObjType == TCTYPE_COLUMNHEADERCELL) + aCellRect = m_aTable.calcHeaderCellRect(true, nIndex); + else + aCellRect = m_aTable.calcHeaderCellRect(false, nIndex); + return Rectangle(Point(aGridRect.Left()+aCellRect.Left(),aGridRect.Top()+aCellRect.Top()), aCellRect.GetSize()); } // ----------------------------------------------------------------------------- sal_Int32 SAL_CALL AccessibleGridControlHeaderCell::getAccessibleIndexInParent() diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx index 406baeb2973c..76e8a691c72f 100755 --- a/accessibility/source/extended/AccessibleGridControlTable.cxx +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -58,6 +58,8 @@ AccessibleGridControlTable::AccessibleGridControlTable( IAccessibleTable& rTable, AccessibleTableControlObjType _eType) : AccessibleGridControlTableBase( rxParent, rTable, _eType ) + ,m_pCellVector( ) + ,m_pAccessCellVector( ) { } @@ -75,7 +77,19 @@ AccessibleGridControlTable::getAccessibleChild( sal_Int32 nChildIndex ) ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); ensureIsValidIndex( nChildIndex ); - return new AccessibleGridControlTableCell(this, m_aTable, nChildIndex/m_aTable.GetColumnCount(), nChildIndex%m_aTable.GetColumnCount(), TCTYPE_TABLECELL); + sal_Int32 nCount = getAccessibleChildCount(); + if(m_pAccessCellVector.size() == 0 || m_pAccessCellVector.size() != (unsigned)nCount) + { + m_pAccessCellVector.resize(nCount); + m_pCellVector.resize(nCount); + } + if(!m_pAccessCellVector[nChildIndex].is()) + { + AccessibleGridControlTableCell* pCell = new AccessibleGridControlTableCell(this, m_aTable, nChildIndex/m_aTable.GetColumnCount(), nChildIndex%m_aTable.GetColumnCount(), TCTYPE_TABLECELL); + m_pCellVector[nChildIndex] = pCell; + m_pAccessCellVector[nChildIndex] = pCell; + } + return m_pAccessCellVector[nChildIndex]; } sal_Int32 SAL_CALL AccessibleGridControlTable::getAccessibleIndexInParent() @@ -105,7 +119,6 @@ AccessibleGridControlTable::getAccessibleAtPoint( const awt::Point& rPoint ) sal_Int32 nColumnPos = 0; if( m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ) ) xChild = new AccessibleGridControlTableCell(this, m_aTable, nRow, nColumnPos, TCTYPE_TABLECELL); - return xChild; } @@ -221,7 +234,20 @@ Reference< XAccessible > SAL_CALL AccessibleGridControlTable::getAccessibleCellA ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); ensureIsValidAddress( nRow, nColumn ); - return new AccessibleGridControlTableCell(this, m_aTable, nRow, nColumn, TCTYPE_TABLECELL); + sal_Int32 nCount = getAccessibleChildCount(); + sal_Int32 nChildIndex = nRow*m_aTable.GetColumnCount() + nColumn; + if(m_pAccessCellVector.size() == 0 || m_pAccessCellVector.size() != (unsigned)nCount) + { + m_pAccessCellVector.resize(nCount); + m_pCellVector.resize(nCount); + } + if(!m_pAccessCellVector[nChildIndex].is()) + { + AccessibleGridControlTableCell* pCell = new AccessibleGridControlTableCell(this, m_aTable, nRow, nColumn, TCTYPE_TABLECELL); + m_pCellVector[nChildIndex] = pCell; + m_pAccessCellVector[nChildIndex] = pCell; + } + return m_pAccessCellVector[nChildIndex]; } sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleSelected( @@ -339,12 +365,28 @@ OUString SAL_CALL AccessibleGridControlTable::getImplementationName() Rectangle AccessibleGridControlTable::implGetBoundingBox() { - return m_aTable.calcTableRect(); + Window* pParent = m_aTable.GetAccessibleParentWindow(); + DBG_ASSERT( pParent, "implGetBoundingBox - missing parent window" ); + Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( pParent )); + Rectangle aTableRect( m_aTable.calcTableRect() ); + long nX = aGridRect.Left() + aTableRect.Left(); + long nY = aGridRect.Top() + aTableRect.Top(); + long nWidth = aGridRect.GetSize().Width()-aTableRect.Left(); + long nHeight = aGridRect.GetSize().Height()-aTableRect.Top(); + Rectangle aTable( Point( nX, nY ), Size( nWidth, nHeight )); + return aTable; } Rectangle AccessibleGridControlTable::implGetBoundingBoxOnScreen() { - return m_aTable.calcTableRect(); + Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( NULL )); + Rectangle aTableRect( m_aTable.calcTableRect() ); + long nX = aGridRect.Left() + aTableRect.Left(); + long nY = aGridRect.Top() + aTableRect.Top(); + long nWidth = aGridRect.GetSize().Width()-aTableRect.Left(); + long nHeight = aGridRect.GetSize().Height()-aTableRect.Top(); + Rectangle aTable( Point( nX, nY ), Size( nWidth, nHeight )); + return aTable; } // internal helper methods ---------------------------------------------------- Reference< XAccessibleTable > AccessibleGridControlTable::implGetHeaderBar( @@ -368,6 +410,15 @@ Reference< XAccessibleTable > AccessibleGridControlTable::implGetHeaderBar( return Reference< XAccessibleTable >( xRet, uno::UNO_QUERY ); } +std::vector< AccessibleGridControlTableCell* >& AccessibleGridControlTable::getCellVector() +{ + return m_pCellVector; +} + +std::vector< Reference< XAccessible > >& AccessibleGridControlTable::getAccessibleCellVector() +{ + return m_pAccessCellVector; +} // ============================================================================ } // namespace accessibility diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx index 43b9400e9050..1efc369dfbc3 100755 --- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx @@ -360,11 +360,25 @@ namespace accessibility Rectangle AccessibleGridControlTableCell::implGetBoundingBox() { - return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle + Window* pParent = m_aTable.GetAccessibleParentWindow(); + DBG_ASSERT( pParent, "implGetBoundingBox - missing parent window" ); + Rectangle aGridRect = m_aTable.GetWindowExtentsRelative( pParent ); + sal_Int32 nIndex = getAccessibleIndexInParent(); + Rectangle aCellRect = m_aTable.calcCellRect(nIndex%m_aTable.GetColumnCount(), nIndex/m_aTable.GetColumnCount()); + long nX = aGridRect.Left() + aCellRect.Left(); + long nY = aGridRect.Top() + aCellRect.Top(); + Rectangle aCell( Point( nX, nY ), aCellRect.GetSize()); + return aCell; } // ----------------------------------------------------------------------------- Rectangle AccessibleGridControlTableCell::implGetBoundingBoxOnScreen() { - return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle + Rectangle aGridRect = m_aTable.GetWindowExtentsRelative( NULL ); + sal_Int32 nIndex = getAccessibleIndexInParent(); + Rectangle aCellRect = m_aTable.calcCellRect(nIndex%m_aTable.GetColumnCount(), nIndex/m_aTable.GetColumnCount()); + long nX = aGridRect.Left() + aCellRect.Left(); + long nY = aGridRect.Top() + aCellRect.Top(); + Rectangle aCell( Point( nX, nY ), aCellRect.GetSize()); + return aCell; } } -- cgit v1.2.3 From aff625c12986681a6799f5b44b8b9fac808ec670 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 16 Mar 2011 14:19:37 +0100 Subject: fs34b: #i89080# always apply the 'Link'/'Preview' state as read from configuration --- sfx2/source/dialog/filedlghelper.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 0f3b35648061..203e2765df1e 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -2195,19 +2195,13 @@ void FileDialogHelper_Impl::loadConfig() { // respect the last "insert as link" state sal_Bool bLink = (sal_Bool) aUserData.GetToken( 0, ' ' ).ToInt32(); - if ( !xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0 ).hasValue() ) - { - aValue <<= bLink; - xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, aValue ); - } + aValue <<= bLink; + xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, aValue ); // respect the last "show preview" state sal_Bool bShowPreview = (sal_Bool) aUserData.GetToken( 1, ' ' ).ToInt32(); - if ( !xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0 ).hasValue() ) - { - aValue <<= bShowPreview; - xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0, aValue ); - } + aValue <<= bShowPreview; + xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0, aValue ); if ( !maPath.getLength() ) displayFolder( getInitPath( aUserData, 2 ) ); -- cgit v1.2.3 From 22c6de5a63adadd59ffd1b719aea8dc007b05de8 Mon Sep 17 00:00:00 2001 From: Thorsten Bosbach Date: Wed, 16 Mar 2011 16:33:09 +0100 Subject: #112894# added update test for security tab page and enabled custom properties again --- testautomation/global/win/etab_a_d.win | 4 +++ .../graphics/required/includes/global/id_001.inc | 20 +++++++------- testautomation/math/required/includes/m_001_.inc | 27 +++++++++---------- .../writer/required/includes/w_001a_.inc | 31 +++++++++++----------- 4 files changed, 44 insertions(+), 38 deletions(-) diff --git a/testautomation/global/win/etab_a_d.win b/testautomation/global/win/etab_a_d.win index e8fb0ac7b870..1267cdae88ca 100755 --- a/testautomation/global/win/etab_a_d.win +++ b/testautomation/global/win/etab_a_d.win @@ -364,6 +364,10 @@ SaveIn sym:CUI_HID_SVX_SAVE_IN ToolbarContents sym:CUI_HID_SVX_CONFIG_TOOLBAR_CONTENTS ResetBtn sym:SFX2_HID_TABDLG_RESET_BTN +*TabCustomProperties sym:SFX2_HID_TP_CUSTOMPROPERTIES +Properties sym:SFX2_HID_CTRL_CUSTOMPROPERTIES +Add sym:sfx2:PushButton:TP_CUSTOMPROPERTIES:BTN_ADD + *TabDatabaseField sym:extensions:TabPage:RID_PAGE_OPTION_DBFIELD YesSaveIt sym:extensions:RadioButton:RID_PAGE_OPTION_DBFIELD:RB_STOREINFIELD_YES NoValueForm sym:extensions:RadioButton:RID_PAGE_OPTION_DBFIELD:RB_STOREINFIELD_NO diff --git a/testautomation/graphics/required/includes/global/id_001.inc b/testautomation/graphics/required/includes/global/id_001.inc index b878278961b1..509e35a52185 100644 --- a/testautomation/graphics/required/includes/global/id_001.inc +++ b/testautomation/graphics/required/includes/global/id_001.inc @@ -779,15 +779,17 @@ testcase tmFileProperties Kontext "TabDokumentInfo" Call DialogTest ( TabDokumentInfo ) - qaerrorlog "#i95523#" - 'Kontext - 'active.SetPage TabBenutzer - 'Kontext "TabBenutzer" - 'Call DialogTest ( TabBenutzer ) - 'Infofelder.Click - ' Kontext "InfonamenBearbeiten" - ' Call DialogTest (InfonamenBearbeiten) - 'InfonamenBearbeiten.Cancel + Kontext + '/// select tabpage 'Security' ///' + active.SetPage TabSecurityProperties + Kontext "TabSecurityProperties" + Call DialogTest ( TabSecurityProperties) + + Kontext + '/// select tabpage 'User defined' ///' + active.SetPage TabCustomProperties + Kontext "TabCustomProperties" + Call DialogTest ( TabCustomProperties ) Kontext active.SetPage TabInternet diff --git a/testautomation/math/required/includes/m_001_.inc b/testautomation/math/required/includes/m_001_.inc index 85546a0e222a..af5123591e62 100755 --- a/testautomation/math/required/includes/m_001_.inc +++ b/testautomation/math/required/includes/m_001_.inc @@ -635,29 +635,28 @@ testcase tmFileProperties Kontext "TabDokumentInfo" Call DialogTest ( TabDokumentInfo ) + Kontext + '/// select tabpage 'Security' ///' + active.SetPage TabSecurityProperties + Kontext "TabSecurityProperties" + Call DialogTest ( TabSecurityProperties) + + Kontext + '/// select tabpage 'User defined' ///' + active.SetPage TabCustomProperties + Kontext "TabCustomProperties" + Call DialogTest ( TabCustomProperties ) + Kontext '/// select tabpage 'Internet' ///' active.SetPage TabInternet Kontext "TabInternet" Call DialogTest (TabInternet) + hCloseDialog( TabInternet, "cancel" ) '/// close application ///' Call hCloseDocument - qaerrorlog "#i95523# Custom Properties is not controlable by VCL TestTool Application" - goto endsub - - Kontext - '/// select tabpage 'User defined' ///' - active.SetPage TabBenutzer - Kontext "TabBenutzer" - Call DialogTest ( TabBenutzer ) - '/// click button 'info fields' ///' - Infofelder.Click - Kontext "InfonamenBearbeiten" - Call DialogTest (InfonamenBearbeiten) - '/// close dialog 'edit field names' ///' - hCloseDialog( InfoNamenBearbeiten, "cancel" ) endcase testcase tmFilePrinterSetting diff --git a/testautomation/writer/required/includes/w_001a_.inc b/testautomation/writer/required/includes/w_001a_.inc index cb9739cd00dd..d41a89fc7d61 100644 --- a/testautomation/writer/required/includes/w_001a_.inc +++ b/testautomation/writer/required/includes/w_001a_.inc @@ -88,22 +88,23 @@ testcase tFileProperties Kontext "TabDokumentinfo" Call DialogTest (TabDokumentinfo) + Kontext + printlog " Switch to Tabpage 'Security'" + active.SetPage TabSecurityProperties + Kontext "TabSecurityProperties" + Call DialogTest ( TabSecurityProperties) + printlog " Click button 'Protect...'" + Protect.click + kontext "PasswordDLG" + Call DialogTest (PasswordDLG) + printlog " Cancel dialog 'Password'" + PasswordDLG.cancel - Warnlog "#i95523# - FileProperties - Tabpage 'User Defined' has changed. - Adaption of testcases needed." - ' printlog " Switch to Tabpage 'User defined'" - ' Kontext - ' active.SetPage TabBenutzer - ' Kontext "TabBenutzer" - ' Call DialogTest ( TabBenutzer ) - - ' Wait 500 - - ' Infofelder.Click - ' printlog " Click 'Infofields'" - ' Kontext "InfonamenBearbeiten" - ' printlog " Close upcoming dialog with 'Cancel'" - ' Call DialogTest (InfonamenBearbeiten) - ' InfonamenBearbeiten.Cancel + Kontext + printlog " Switch to Tabpage 'User defined'" + active.SetPage TabCustomProperties + Kontext "TabCustomProperties" + Call DialogTest ( TabCustomProperties ) printlog " Switch to Tabpage 'Internet'" Kontext -- cgit v1.2.3 From cb5ac0c7dd4330d91738bf9d7e4755985ce65929 Mon Sep 17 00:00:00 2001 From: Thorsten Bosbach Date: Wed, 16 Mar 2011 18:23:22 +0100 Subject: #117406# fix gridcontrol test --- .../optional/includes/basic_gridcontrol.inc | 5 +++-- .../framework/optional/input/gridcontrol.odt | Bin 12252 -> 12045 bytes testautomation/global/win/dial_d_h.win | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/testautomation/framework/optional/includes/basic_gridcontrol.inc b/testautomation/framework/optional/includes/basic_gridcontrol.inc index 95bad4d09463..68a2416bddee 100644 --- a/testautomation/framework/optional/includes/basic_gridcontrol.inc +++ b/testautomation/framework/optional/includes/basic_gridcontrol.inc @@ -32,7 +32,6 @@ '\****************************************************************************** testcase tGridcontrolLoad - const MACRO_NAME = "Show" const FILE_NAME = "framework/optional/input/gridcontrol.odt" dim i as integer @@ -42,8 +41,10 @@ testcase tGridcontrolLoad call hFileOpenLocally( gTestToolPath & FILE_NAME ) printlog "Start the macro, that performs the test" - hExecMacro( MACRO_NAME ) + Kontext "ShowGridcontrol" + ' FAILS IF DOCUMENT IS READONLY.... + ShowGridcontrol.typeKeys "" Kontext "GridControlDialog" if GridControlDialog.exists(5) then for i=1 to gridcontrolcontrol.getcolumncount diff --git a/testautomation/framework/optional/input/gridcontrol.odt b/testautomation/framework/optional/input/gridcontrol.odt index d1d52c32245f..9d175f3c73eb 100755 Binary files a/testautomation/framework/optional/input/gridcontrol.odt and b/testautomation/framework/optional/input/gridcontrol.odt differ diff --git a/testautomation/global/win/dial_d_h.win b/testautomation/global/win/dial_d_h.win index 6af13cd00f6c..75ab744dce79 100755 --- a/testautomation/global/win/dial_d_h.win +++ b/testautomation/global/win/dial_d_h.win @@ -443,8 +443,7 @@ Aktualisieren sym:SFX2_HID_TEMPLDLG_UPDATEBYEXAMPLE Vorlagenliste sym:SFX2_HID_TEMPLATE_FMT Gruppenliste sym:SFX2_HID_TEMPLATE_FILTER -*GridControlDialogStarter ACTIVE -ShowGridcontrol sym:showGridcontrol +*ShowGridcontrol sym:showgridcontrol *GridControlDialog sym:gridcontroldialog gridcontrolcontrol sym:gridcontrolself -- cgit v1.2.3 From 3968b5956fca5a5faf056fbe1f7e1bbadb099269 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Thu, 17 Mar 2011 10:38:39 +0100 Subject: dr80: #i117418# compiler warning: OptValue::maValue needs to be value-initializedinc --- oox/inc/oox/helper/helper.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oox/inc/oox/helper/helper.hxx b/oox/inc/oox/helper/helper.hxx index 84c501fae2e5..d171fc08a495 100644 --- a/oox/inc/oox/helper/helper.hxx +++ b/oox/inc/oox/helper/helper.hxx @@ -198,7 +198,7 @@ template< typename Type > class OptValue { public: - inline explicit OptValue() : mbHasValue( false ) {} + inline explicit OptValue() : maValue(), mbHasValue( false ) {} inline explicit OptValue( const Type& rValue ) : maValue( rValue ), mbHasValue( true ) {} inline explicit OptValue( bool bHasValue, const Type& rValue ) : maValue( rValue ), mbHasValue( bHasValue ) {} -- cgit v1.2.3 From 808a52e048044e604007d09783169052eb3692b5 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 17 Mar 2011 12:02:35 +0100 Subject: impress211: #i110990# support _NET_WM_FULLSCREEN_MONITORS property --- vcl/unx/gtk/window/gtkframe.cxx | 2 ++ vcl/unx/inc/wmadaptor.hxx | 5 +++ vcl/unx/source/app/wmadaptor.cxx | 66 ++++++++++++++++++++++++++++++++++++++ vcl/unx/source/window/salframe.cxx | 3 ++ 4 files changed, 76 insertions(+) diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index aa5926702731..9ddc8df4b5b4 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -1815,6 +1815,7 @@ void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen ) aNewPosSize = Rectangle( Point( 0, 0 ), pDisp->GetScreenSize(m_nScreen) ); else aNewPosSize = pDisp->GetXineramaScreens()[ nScreen ]; + gtk_window_resize( GTK_WINDOW(m_pWindow), maGeometry.nWidth = aNewPosSize.GetWidth(), maGeometry.nHeight = aNewPosSize.GetHeight() ); @@ -1829,6 +1830,7 @@ void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen ) // _NET_WM_STATE_FULLSCREEN (Metacity <-> KWin) if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) { + pDisp->getWMAdaptor()->setFullScreenMonitors( GDK_WINDOW_XWINDOW( GTK_WIDGET(m_pWindow)->window ), nScreen ); if( !(m_nStyle & SAL_FRAME_STYLE_SIZEABLE) ) gtk_window_set_resizable( GTK_WINDOW(m_pWindow), sal_True ); gtk_window_fullscreen( GTK_WINDOW( m_pWindow ) ); diff --git a/vcl/unx/inc/wmadaptor.hxx b/vcl/unx/inc/wmadaptor.hxx index e8620db29c6f..9968ea17cc12 100644 --- a/vcl/unx/inc/wmadaptor.hxx +++ b/vcl/unx/inc/wmadaptor.hxx @@ -70,6 +70,7 @@ public: NET_WM_STATE_STAYS_ON_TOP, NET_WM_STATE_STICKY, NET_WM_STATE_FULLSCREEN, + NET_WM_FULLSCREEN_MONITORS, NET_WM_STRUT, NET_WM_STRUT_PARTIAL, NET_WM_USER_TIME, @@ -347,6 +348,10 @@ public: * if reference frame is NULL the root window is used instead */ void changeReferenceFrame( X11SalFrame* pFrame, X11SalFrame* pReferenceFrame ) const; + + /* set fullscreen monitor range; takes X11 window as input since it is also used by gtk plugin + */ + virtual void setFullScreenMonitors( XLIB_Window i_aWindow, sal_Int32 i_nScreen ); }; } // namespace diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx index f816c5d1426e..93184cc1066b 100644 --- a/vcl/unx/source/app/wmadaptor.cxx +++ b/vcl/unx/source/app/wmadaptor.cxx @@ -79,6 +79,7 @@ public: int top_start_x, int top_end_x, int bottom_start_x, int bottom_end_x ) const; virtual void setUserTime( X11SalFrame* i_pFrame, long i_nUserTime ) const; + virtual void setFullScreenMonitors( XLIB_Window i_aWindow, sal_Int32 i_nScreen ); }; class GnomeWMAdaptor : public WMAdaptor @@ -119,6 +120,7 @@ static const WMAdaptorProtocol aProtocolTab[] = { "_NET_CURRENT_DESKTOP", WMAdaptor::NET_CURRENT_DESKTOP }, { "_NET_NUMBER_OF_DESKTOPS", WMAdaptor::NET_NUMBER_OF_DESKTOPS }, { "_NET_WM_DESKTOP", WMAdaptor::NET_WM_DESKTOP }, + { "_NET_WM_FULLSCREEN_MONITORS", WMAdaptor::NET_WM_FULLSCREEN_MONITORS }, { "_NET_WM_ICON_NAME", WMAdaptor::NET_WM_ICON_NAME }, { "_NET_WM_PING", WMAdaptor::NET_WM_PING }, { "_NET_WM_STATE", WMAdaptor::NET_WM_STATE }, @@ -2541,3 +2543,67 @@ void WMAdaptor::answerPing( X11SalFrame* i_pFrame, XClientMessageEvent* i_pEvent XFlush( m_pDisplay ); } } + +/* +* WMAdaptor::setFullScreenMonitors +*/ +void WMAdaptor::setFullScreenMonitors( XLIB_Window, sal_Int32 ) +{ +} + +/* +* NetWMAdaptor::setFullScreenMonitors +*/ +void NetWMAdaptor::setFullScreenMonitors( XLIB_Window i_aWindow, sal_Int32 i_nScreen ) +{ + if( m_aWMAtoms[ NET_WM_FULLSCREEN_MONITORS ] ) + { + const std::vector< Rectangle >& rScreens( m_pSalDisplay->GetXineramaScreens() ); + if( m_pSalDisplay->IsXinerama() && rScreens.size() > 1 ) + { + long nSpannedMonitors[4] = {0,0,0,0}; + if( i_nScreen == -1 ) // all screens + { + long nLeft = rScreens.front().Left(); + long nRight = rScreens.front().Right(); + long nTop = rScreens.front().Top(); + long nBottom = rScreens.front().Bottom(); + for( long i = 1; i < long(rScreens.size()); ++ i ) + { + if( rScreens[i].Left() < nLeft ) + { + nLeft = rScreens[i].Left(); + nSpannedMonitors[2] = i; + } + if( rScreens[i].Top() < nTop ) + { + nTop = rScreens[i].Top(); + nSpannedMonitors[0] = i; + } + if( rScreens[i].Bottom() > nBottom ) + { + nBottom = rScreens[i].Bottom(); + nSpannedMonitors[1] = i; + } + if( rScreens[i].Right() > nRight ) + { + nRight = rScreens[i].Right(); + nSpannedMonitors[3] = i; + } + } + } + else + { + if( i_nScreen < 0 || i_nScreen >= sal_Int32(rScreens.size()) ) + i_nScreen = 0; + nSpannedMonitors[0] = nSpannedMonitors[1] = nSpannedMonitors[2] = nSpannedMonitors[3] = i_nScreen; + } + XChangeProperty( m_pDisplay, i_aWindow, + m_aWMAtoms[ NET_WM_FULLSCREEN_MONITORS ], + XA_CARDINAL, 32, + PropModeReplace, (unsigned char*)nSpannedMonitors, 4 ); + + } + } +} + diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index 5ad3a9d94375..25b055f6204c 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -2221,7 +2221,10 @@ void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen ) if( GetDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) GetDisplay()->getWMAdaptor()->enableAlwaysOnTop( this, true ); else + { + GetDisplay()->getWMAdaptor()->setFullScreenMonitors( GetShellWindow(), nScreen ); GetDisplay()->getWMAdaptor()->showFullScreen( this, true ); + } if( bVisible ) Show(sal_True); -- cgit v1.2.3 From ffb8a2df8bba1013242f3cbec5b14ffd7e0c98f9 Mon Sep 17 00:00:00 2001 From: hde Date: Thu, 17 Mar 2011 12:47:04 +0100 Subject: #i117432#cws automationdev300m102cat0#confirmation messagebox if nothing changed --- testautomation/writer/required/includes/w_002_.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/writer/required/includes/w_002_.inc b/testautomation/writer/required/includes/w_002_.inc index e19b37514c99..0acd4d4a587c 100644 --- a/testautomation/writer/required/includes/w_002_.inc +++ b/testautomation/writer/required/includes/w_002_.inc @@ -1300,7 +1300,7 @@ testcase tEditImageMap printlog( "Check for messagebox (should not appear)" ) kontext "Active" if ( Active.exists( 1 ) ) then - Warnlog( " message displayed." ) + Warnlog( "#i117432# message displayed." ) printlog( Active.getText ) Active.no() else -- cgit v1.2.3 From f652368feff2319e789495360ed744e0b5c6b72e Mon Sep 17 00:00:00 2001 From: hde Date: Thu, 17 Mar 2011 13:45:15 +0100 Subject: #i117363#cws automationdev300m102cat0#w_updt.bas splitted in two parts --- testautomation/writer/required/w_updt_1.bas | 78 +++++++++++++++++++++++++++++ testautomation/writer/required/w_updt_2.bas | 75 +++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 testautomation/writer/required/w_updt_1.bas create mode 100644 testautomation/writer/required/w_updt_2.bas diff --git a/testautomation/writer/required/w_updt_1.bas b/testautomation/writer/required/w_updt_1.bas new file mode 100644 index 000000000000..c6f633ec7375 --- /dev/null +++ b/testautomation/writer/required/w_updt_1.bas @@ -0,0 +1,78 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : helge.delfs@oracle.com +'* +'* short description : Ressource-Test Writer Document Part 1 / 2 +'* +'\****************************************************************** + +sub main + use "writer\tools\includes\w_tools.inc" ' global subroutines for Writer-application + use "writer\tools\includes\w_tool1.inc" ' global subroutines for Writer-application + use "writer\tools\includes\w_tool2.inc" ' global subroutines for Writer-application + + use "writer\required\includes\w_001_.inc" + use "writer\required\includes\w_001a_.inc" + use "writer\required\includes\w_001b_.inc" + use "writer\required\includes\w_002_.inc" + use "writer\required\includes\w_003_.inc" + use "writer\required\includes\w_004_.inc" + use "writer\required\includes\w_004b_.inc" + use "writer\required\includes\w_005_.inc" + use "writer\required\includes\w_005b_.inc" + + Printlog "******* Ressource-Test Writer Document Part 1 / 2 *******" + + Call wChangeDefaultView() + + Call hStatusIn ( "writer", "w_updt_1.bas" ) + Call w_001_ ' Menu File + Call w_001a_ ' Menu File + Call w_001b_ ' Menu File + Call w_002_ ' Menu Edit + Call w_003_ ' Menu View + Call w_004_ ' Menu Insert + Call w_004b_ ' Menu Insert + Call w_005_ ' Menu Format + Call w_005b_ ' Menu Format (2) + Call hStatusOut + +end sub + +sub LoadIncludeFiles + use "global\system\includes\master.inc" + use "global\system\includes\gvariabl.inc" + use "global\required\includes\g_001.inc" + use "global\required\includes\g_printing.inc" + use "global\tools\includes\optional\t_xml_filter1.inc" ' global routines for XML-functionality + use "global\tools\includes\optional\t_docfuncs.inc" + use "global\tools\includes\optional\t_control_objects.inc" + + gApplication = "WRITER" + GetUseFiles () +end sub diff --git a/testautomation/writer/required/w_updt_2.bas b/testautomation/writer/required/w_updt_2.bas new file mode 100644 index 000000000000..6bbf7bb6a771 --- /dev/null +++ b/testautomation/writer/required/w_updt_2.bas @@ -0,0 +1,75 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : helge.delfs@oracle.com +'* +'* short description : Ressource-Test Writer Document Part 2 / 2 +'* +'\****************************************************************** + +sub main + use "writer\tools\includes\w_tools.inc" ' global subroutines for Writer-application + use "writer\tools\includes\w_tool1.inc" ' global subroutines for Writer-application + use "writer\tools\includes\w_tool2.inc" ' global subroutines for Writer-application + + use "writer\required\includes\w_006_.inc" + use "writer\required\includes\w_007_.inc" + use "writer\required\includes\w_008_.inc" + use "writer\required\includes\w_009_.inc" + use "writer\required\includes\w_010_.inc" + use "writer\required\includes\w_010_1.inc" + use "writer\required\includes\w_011_.inc" + use "writer\required\includes\w_020_.inc" + + Printlog "******* Ressource-Test Writer Document Part 2 / 2 *******" + + Call wChangeDefaultView() + + Call hStatusIn ( "writer", "w_updt_2.bas" ) + Call w_006_ ' Menu Table + Call w_007_ ' Menu Tools + Call w_008_ ' Menu Window + Call w_009_ ' Menu Help + Call w_010_ ' Objectbar + Call w_010_1 ' Objectbar. Part 2 + Call w_011_ ' Rest of Objectbar + Call w_020_ ' Toolbar + Call hStatusOut + +end sub + +sub LoadIncludeFiles + use "global\system\includes\master.inc" + use "global\system\includes\gvariabl.inc" + use "global\required\includes\g_option.inc" ' global subroutines for Tools / Options + use "global\required\includes\g_findbar.inc" + use "global\tools\includes\optional\t_docfuncs.inc" + use "global\tools\includes\optional\t_control_objects.inc" + + gApplication = "WRITER" + GetUseFiles () +end sub -- cgit v1.2.3 From 9371981544614b3f6ee70ba6a1693fcd874f2f76 Mon Sep 17 00:00:00 2001 From: hde Date: Thu, 17 Mar 2011 13:48:04 +0100 Subject: #i117363#cws automationdev300m102cat0#w_updt.bas splitted in two parts, therefor this file was deleted --- testautomation/writer/required/w_updt.bas | 96 ------------------------------- 1 file changed, 96 deletions(-) delete mode 100755 testautomation/writer/required/w_updt.bas diff --git a/testautomation/writer/required/w_updt.bas b/testautomation/writer/required/w_updt.bas deleted file mode 100755 index b8779647281b..000000000000 --- a/testautomation/writer/required/w_updt.bas +++ /dev/null @@ -1,96 +0,0 @@ -'encoding UTF-8 Do not remove or change this line! -'************************************************************************** -' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -' -' Copyright 2000, 2010 Oracle and/or its affiliates. -' -' OpenOffice.org - a multi-platform office productivity suite -' -' This file is part of OpenOffice.org. -' -' OpenOffice.org is free software: you can redistribute it and/or modify -' it under the terms of the GNU Lesser General Public License version 3 -' only, as published by the Free Software Foundation. -' -' OpenOffice.org is distributed in the hope that it will be useful, -' but WITHOUT ANY WARRANTY; without even the implied warranty of -' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -' GNU Lesser General Public License version 3 for more details -' (a copy is included in the LICENSE file that accompanied this code). -' -' You should have received a copy of the GNU Lesser General Public License -' version 3 along with OpenOffice.org. If not, see -' -' for a copy of the LGPLv3 License. -' -'/************************************************************************ -'* -'* owner : helge.delfs@oracle.com -'* -'* short description : Ressource-Test Writer Document -'* -'\****************************************************************** - -sub main - use "writer\tools\includes\w_tools.inc" ' global subroutines for Writer-application - use "writer\tools\includes\w_tool1.inc" ' global subroutines for Writer-application - use "writer\tools\includes\w_tool2.inc" ' global subroutines for Writer-application - - use "writer\required\includes\w_001_.inc" - use "writer\required\includes\w_001a_.inc" - use "writer\required\includes\w_001b_.inc" - use "writer\required\includes\w_002_.inc" - use "writer\required\includes\w_003_.inc" - use "writer\required\includes\w_004_.inc" - use "writer\required\includes\w_004b_.inc" - use "writer\required\includes\w_005_.inc" - use "writer\required\includes\w_005b_.inc" - use "writer\required\includes\w_006_.inc" - use "writer\required\includes\w_007_.inc" - use "writer\required\includes\w_008_.inc" - use "writer\required\includes\w_009_.inc" - use "writer\required\includes\w_010_.inc" - use "writer\required\includes\w_010_1.inc" - use "writer\required\includes\w_011_.inc" - use "writer\required\includes\w_020_.inc" - - Printlog "******* Ressource-Test Writer Document *******" - - Call wChangeDefaultView() - - Call hStatusIn ( "writer", "w_updt.bas" ) - Call w_001_ ' Menu File - Call w_001a_ ' Menu File - Call w_001b_ ' Menu File - Call w_002_ ' Menu Edit - Call w_003_ ' Menu View - Call w_004_ ' Menu Insert - Call w_004b_ ' Menu Insert - Call w_005_ ' Menu Format - Call w_005b_ ' Menu Format (2) - Call w_006_ ' Menu Table - Call w_007_ ' Menu Tools - Call w_008_ ' Menu Window - Call w_009_ ' Menu Help - Call w_010_ ' Objectbar - Call w_010_1 ' Objectbar. Part 2 - Call w_011_ ' Rest of Objectbar - Call w_020_ ' Toolbar - Call hStatusOut - -end sub - -sub LoadIncludeFiles - use "global\system\includes\master.inc" - use "global\system\includes\gvariabl.inc" - use "global\required\includes\g_001.inc" - use "global\required\includes\g_option.inc" ' global subroutines for Tools / Options - use "global\required\includes\g_printing.inc" - use "global\required\includes\g_findbar.inc" - use "global\tools\includes\optional\t_xml_filter1.inc" ' global routines for XML-functionality - use "global\tools\includes\optional\t_docfuncs.inc" - use "global\tools\includes\optional\t_control_objects.inc" - - gApplication = "WRITER" - GetUseFiles () -end sub -- cgit v1.2.3 From 2b15b98d3f5a06e6d36b543fe931d3081abbab12 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 17 Mar 2011 15:18:56 +0100 Subject: impress211: #i110990# unfortunately cannot rely on gdk_display_get_monitor_geometry anymore --- vcl/unx/gtk/app/gtkdata.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 329e6867206b..10ab92957c3e 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -208,6 +208,25 @@ void GtkSalDisplay::screenSizeChanged( GdkScreen* pScreen ) void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen ) { + /* Caution: since we support the _NET_WM_FULLSCREEN_MONITORS property now and + the EWMH spec says, the index used for that needs to be that of the + Xinerama extension, we need to ensure that the order of m_aXineramaScreens is actually intact. + + gdk_screen_get_monitor_geometry however has a different sort order that has a default monitor number + Xinerama returns the default monitor as 0. + That means if we fill in the multiple montors vector from gdk, we'll get the wrong order unless + the default monitor is incidentally the same (number 0). + + Given that XRandR (which is what gdk_screen_get_monitor_geometry is based on) is + supposed to replace Xinerama, this is bound to get a problem at some time again, + unfortunately there does not currently seem to be a way to map the returns of xinerama to + that of randr. Currently getting Xinerama values again works with updated values, given + a new enough Xserver. + */ + InitXinerama(); + (void)pScreen; + + #if 0 if( pScreen ) { if( gdk_display_get_n_screens(m_pGdkDisplay) == 1 ) @@ -234,6 +253,7 @@ void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen ) } } } + #endif } extern "C" @@ -244,6 +264,9 @@ extern "C" int GtkSalDisplay::GetDefaultMonitorNumber() const { int n = 0; + + // currently disabled, see remarks in monitorsChanged +#if 0 GdkScreen* pScreen = gdk_display_get_screen( m_pGdkDisplay, m_nDefaultScreen ); #if GTK_CHECK_VERSION(2,20,0) n = gdk_screen_get_primary_monitor(pScreen); @@ -255,6 +278,7 @@ int GtkSalDisplay::GetDefaultMonitorNumber() const #endif if( n >= 0 && size_t(n) < m_aXineramaScreenIndexMap.size() ) n = m_aXineramaScreenIndexMap[n]; +#endif return n; } -- cgit v1.2.3 From 16a74edc6139ab2b2d1a04ebe254deb6ac039570 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Fri, 18 Mar 2011 09:57:40 +0100 Subject: dr80: #i116460# performance of Excel file with many outlines --- sc/inc/unonames.hxx | 2 ++ sc/source/core/data/drwlayer.cxx | 23 ++++++++++--- sc/source/core/data/table1.cxx | 4 +++ sc/source/filter/excel/colrowst.cxx | 5 ++- sc/source/ui/docshell/olinefun.cxx | 68 +++++++++++++++++++++++++++---------- sc/source/ui/unoobj/docuno.cxx | 6 ++++ 6 files changed, 84 insertions(+), 24 deletions(-) diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index a9c08c2884fd..2b97ede1ba55 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -175,6 +175,8 @@ #define SC_UNONAME_AUTOPRINT "AutomaticPrintArea" #define SC_UNONAME_TABCOLOR "TabColor" +#define SC_UNONAME_VISFLAG "VisibleFlag" + // LinkTarget #define SC_UNO_LINKDISPBIT "LinkDisplayBitmap" #define SC_UNO_LINKDISPNAME "LinkDisplayName" diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index e3b75436f72c..9cff13d9030f 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -1114,6 +1114,15 @@ void ScDrawLayer::HeightChanged( SCTAB nTab, SCROW nRow, long nDifTwips ) if (!bAdjustEnabled) return; + SdrPage* pPage = GetPage(static_cast(nTab)); + DBG_ASSERT(pPage,"Page not found"); + if (!pPage) + return; + + // for an empty page, there's no need to calculate the row heights + if (!pPage->GetObjCount()) + return; + Rectangle aRect; Point aTopLeft; @@ -1143,6 +1152,15 @@ sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndR if ( !pDoc ) return sal_False; + SdrPage* pPage = GetPage(static_cast(nTab)); + DBG_ASSERT(pPage,"Page not found"); + if (!pPage) + return sal_False; + + // for an empty page, there's no need to calculate the row heights + if (!pPage->GetObjCount()) + return sal_False; + Rectangle aTestRect; aTestRect.Top() += pDoc->GetRowHeight( 0, nStartRow-1, nTab); @@ -1165,11 +1183,6 @@ sal_Bool ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndR if ( bNegativePage ) MirrorRectRTL( aTestRect ); - SdrPage* pPage = GetPage(static_cast(nTab)); - DBG_ASSERT(pPage,"Page nicht gefunden"); - if (!pPage) - return sal_False; - sal_Bool bFound = sal_False; Rectangle aObjRect; diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index be7cab80508b..31b9c0fb9ed6 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -337,6 +337,8 @@ sal_Bool ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16 n } } + IncRecalcLevel(); // #i116460# avoid problems with Excel files + SCROW nRngStart = 0; SCROW nRngEnd = 0; sal_uInt16 nLast = 0; @@ -391,6 +393,8 @@ sal_Bool ScTable::SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16 n if (nLast) bChanged |= SetRowHeightRange( nRngStart, nRngEnd, nLast, nPPTX, nPPTY ); + DecRecalcLevel(); // #i116460# avoid problems with Excel files + delete[] pHeight; if ( pProgress != pOuterProgress ) delete pProgress; diff --git a/sc/source/filter/excel/colrowst.cxx b/sc/source/filter/excel/colrowst.cxx index 575093f48d2a..b469ea5de49c 100644 --- a/sc/source/filter/excel/colrowst.cxx +++ b/sc/source/filter/excel/colrowst.cxx @@ -278,6 +278,7 @@ void XclImpColRowSettings::Convert( SCTAB nScTab ) void XclImpColRowSettings::ConvertHiddenFlags( SCTAB nScTab ) { ScDocument& rDoc = GetDoc(); + rDoc.IncSizeRecalcLevel( nScTab ); // #i116460# performance with many hidden rows // hide the columns for( SCCOL nScCol = 0; nScCol <= MAXCOL; ++nScCol ) @@ -304,7 +305,7 @@ void XclImpColRowSettings::ConvertHiddenFlags( SCTAB nScTab ) if( ::get_flag( maRowFlags[ nScRow ], EXC_COLROW_HIDDEN ) ) { // hide the row - rDoc.ShowRow( nScRow, nScTab, sal_False ); + rDoc.SetRowHidden(nScRow, nScRow, nScTab, true); // #i116460# SetRowHidden instead of ShowRow // #i38093# rows hidden by filter need extra flag if( (nFirstFilterScRow <= nScRow) && (nScRow <= nLastFilterScRow) ) rDoc.SetRowFiltered(nScRow, nScRow, nScTab, true); @@ -314,5 +315,7 @@ void XclImpColRowSettings::ConvertHiddenFlags( SCTAB nScTab ) // #i47438# if default row format is hidden, hide remaining rows if( ::get_flag( mnDefRowFlags, EXC_DEFROW_HIDDEN ) && (mnLastScRow < MAXROW) ) rDoc.ShowRows( mnLastScRow + 1, MAXROW, nScTab, sal_False ); + + rDoc.DecSizeRecalcLevel( nScTab ); // #i116460# performance with many hidden rows } diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx index 5e2503f94e15..f358fc4a29ab 100644 --- a/sc/source/ui/docshell/olinefun.cxx +++ b/sc/source/ui/docshell/olinefun.cxx @@ -392,6 +392,8 @@ sal_Bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, sal_Bool bColumns, sal_uInt1 bColumns, nLevel ) ); } + pDoc->IncSizeRecalcLevel( nTab ); + ScSubOutlineIterator aIter( pArray ); // alle Eintraege ScOutlineEntry* pEntry; while ((pEntry=aIter.GetNext()) != NULL) @@ -420,11 +422,19 @@ sal_Bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, sal_Bool bColumns, sal_uInt1 if ( bColumns ) pDoc->ShowCol( static_cast(i), nTab, bShow ); else - if ( !bShow || !pDoc->RowFiltered( i,nTab ) ) - pDoc->ShowRow( i, nTab, bShow ); + { + // show several rows together, don't show filtered rows + SCROW nFilterEnd = i; + bool bFiltered = pDoc->RowFiltered( i, nTab, NULL, &nFilterEnd ); + nFilterEnd = std::min( nThisEnd, nFilterEnd ); + if ( !bShow || !bFiltered ) + pDoc->ShowRows( i, nFilterEnd, nTab, bShow ); + i = nFilterEnd; + } } } + pDoc->DecSizeRecalcLevel( nTab ); pDoc->UpdatePageBreaks( nTab ); if (bPaint) @@ -478,6 +488,8 @@ sal_Bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, sal_Bool b pUndoDoc, pUndoTab, sal_True ) ); } + pDoc->IncSizeRecalcLevel( nTab ); + // Spalten nMin=MAXCOL; @@ -518,9 +530,17 @@ sal_Bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, sal_Bool b } } for ( i=nMin; i<=nMax; i++ ) - if ( !pDoc->RowFiltered( i,nTab ) ) // weggefilterte nicht einblenden - pDoc->ShowRow( i, nTab, sal_True ); + { + // show several rows together, don't show filtered rows + SCROW nFilterEnd = i; + bool bFiltered = pDoc->RowFiltered( i, nTab, NULL, &nFilterEnd ); + nFilterEnd = std::min( nMax, nFilterEnd ); + if ( !bFiltered ) + pDoc->ShowRows( i, nFilterEnd, nTab, sal_True ); + i = nFilterEnd; + } + pDoc->DecSizeRecalcLevel( nTab ); pDoc->UpdatePageBreaks( nTab ); rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID | PAINT_LEFT | PAINT_TOP ); @@ -590,6 +610,8 @@ sal_Bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, sal_Bool b pUndoDoc, pUndoTab, sal_False ) ); } + pDoc->IncSizeRecalcLevel( nTab ); + // Spalten nCount = pColArray->GetCount(nColLevel); @@ -616,6 +638,7 @@ sal_Bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, sal_Bool b HideOutline( nTab, sal_False, nRowLevel, i, sal_False, sal_False, bApi ); } + pDoc->DecSizeRecalcLevel( nTab ); pDoc->UpdatePageBreaks( nTab ); rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID | PAINT_LEFT | PAINT_TOP ); @@ -671,6 +694,8 @@ sal_Bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1 //! HideCursor(); + pDoc->IncSizeRecalcLevel( nTab ); + pEntry->SetHidden(sal_False); SCCOLROW i; for ( i = nStart; i <= nEnd; i++ ) @@ -678,8 +703,15 @@ sal_Bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1 if ( bColumns ) pDoc->ShowCol( static_cast(i), nTab, sal_True ); else - if ( !pDoc->RowFiltered( i,nTab ) ) // weggefilterte nicht einblenden - pDoc->ShowRow( i, nTab, sal_True ); + { + // show several rows together, don't show filtered rows + SCROW nFilterEnd = i; + bool bFiltered = pDoc->RowFiltered( i, nTab, NULL, &nFilterEnd ); + nFilterEnd = std::min( nEnd, nFilterEnd ); + if ( !bFiltered ) + pDoc->ShowRows( i, nFilterEnd, nTab, sal_True ); + i = nFilterEnd; + } } ScSubOutlineIterator aIter( pArray, nLevel, nEntry ); @@ -689,18 +721,17 @@ sal_Bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1 { SCCOLROW nSubStart = pEntry->GetStart(); SCCOLROW nSubEnd = pEntry->GetEnd(); - for ( i = nSubStart; i <= nSubEnd; i++ ) - { - if ( bColumns ) + if ( bColumns ) + for ( i = nSubStart; i <= nSubEnd; i++ ) pDoc->ShowCol( static_cast(i), nTab, sal_False ); - else - pDoc->ShowRow( i, nTab, sal_False ); - } + else + pDoc->ShowRows( nSubStart, nSubEnd, nTab, sal_False ); } } pArray->SetVisibleBelow( nLevel, nEntry, sal_True, sal_True ); + pDoc->DecSizeRecalcLevel( nTab ); pDoc->InvalidatePageBreaks(nTab); pDoc->UpdatePageBreaks( nTab ); @@ -755,18 +786,19 @@ sal_Bool ScOutlineDocFunc::HideOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt1 //! HideCursor(); + pDoc->IncSizeRecalcLevel( nTab ); + pEntry->SetHidden(sal_True); SCCOLROW i; - for ( i = nStart; i <= nEnd; i++ ) - { - if ( bColumns ) + if ( bColumns ) + for ( i = nStart; i <= nEnd; i++ ) pDoc->ShowCol( static_cast(i), nTab, sal_False ); - else - pDoc->ShowRow( i, nTab, sal_False ); - } + else + pDoc->ShowRows( nStart, nEnd, nTab, sal_False ); pArray->SetVisibleBelow( nLevel, nEntry, sal_False ); + pDoc->DecSizeRecalcLevel( nTab ); pDoc->InvalidatePageBreaks(nTab); pDoc->UpdatePageBreaks( nTab ); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 23eb1abd2d82..562cef5651a3 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -3281,6 +3281,12 @@ void SAL_CALL ScTableRowsObj::setPropertyValue( aFunc.SetWidthOrHeight( sal_False, 1, nRowArr, nTab, eMode, 0, sal_True, sal_True ); // SC_SIZE_DIRECT with size 0: hide } + else if ( aNameString.EqualsAscii( SC_UNONAME_VISFLAG ) ) + { + // #i116460# Shortcut to only set the flag, without drawing layer update etc. + // Should only be used from import filters. + pDoc->SetRowHidden(nStartRow, nEndRow, nTab, !ScUnoHelpFunctions::GetBoolFromAny( aValue )); + } else if ( aNameString.EqualsAscii( SC_UNONAME_CELLFILT ) ) { //! undo etc. -- cgit v1.2.3 From a4bfeb1d20a41b2fc84c2cef6cb29f0fc08a48eb Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Fri, 18 Mar 2011 09:57:40 +0100 Subject: dr80: #i116460# performance of Excel file with many outlines --- oox/source/token/properties.txt | 1 + oox/source/xls/worksheethelper.cxx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index b0726f86657e..a99718028c7a 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -473,6 +473,7 @@ VerticalSplitMode VerticalSplitPositionTwips ViewBox Visible +VisibleFlag VisibleSize VisualArea VisualEffect diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx index 48ffac388cfd..76aa8174e8b8 100644 --- a/oox/source/xls/worksheethelper.cxx +++ b/oox/source/xls/worksheethelper.cxx @@ -1631,7 +1631,9 @@ void WorksheetData::convertRows( OutlineLevelVec& orRowLevels, if( rModel.mbHidden ) { PropertySet aPropSet( getRows( nFirstRow, nLastRow ) ); - aPropSet.setProperty( PROP_IsVisible, false ); + // #i116460# Use VisibleFlag instead of IsVisible: directly set the flag, + // without drawing layer update etc. (only possible before shapes are inserted) + aPropSet.setProperty( PROP_VisibleFlag, false ); } // outline settings for this row range -- cgit v1.2.3 From 352899b106d13b18282b5ee69926d7c705cb8338 Mon Sep 17 00:00:00 2001 From: "Oliver Craemer [oc]" Date: Fri, 18 Mar 2011 15:32:29 +0100 Subject: #i91899# New tests for chart2 dataseries --- testautomation/chart2/optional/ch2_data_series.bas | 60 ++++++ .../optional/includes/ch2_lvl1_data_series1.inc | 214 +++++++++++++++++++++ 2 files changed, 274 insertions(+) create mode 100644 testautomation/chart2/optional/ch2_data_series.bas create mode 100644 testautomation/chart2/optional/includes/ch2_lvl1_data_series1.inc diff --git a/testautomation/chart2/optional/ch2_data_series.bas b/testautomation/chart2/optional/ch2_data_series.bas new file mode 100644 index 000000000000..6677c8a8c886 --- /dev/null +++ b/testautomation/chart2/optional/ch2_data_series.bas @@ -0,0 +1,60 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' +' for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : oliver.craemer@oracle.com +'* +'* short description : Function test for Data Series functions in chart +'* +'\************************************************************************************************ + +sub main + use "chart2\tools\ch_tools_common.inc" + use "chart2\tools\ch_tools_chart_type.inc" + use "chart2\tools\ch_tools_select.inc" + use "chart2\optional\includes\ch2_lvl1_data_series1.inc" + + Call hStatusIn("Chart2", "ch2_data_series.bas") + + printlog "----------------------------------------" + printlog " C h a r t 2 D a t a S e r i e s " + printlog "----------------------------------------" + printLog Chr(13) + "----------- Options ------------" + Call tPlotMissingValuesBar + Call tPlotMissingValuesLine + Call hStatusOut +end sub +' +'------------------------------------------------------------------------------- +' +sub LoadIncludeFiles + use "global\tools\includes\optional\t_set_standard_controls.inc" + use "global\system\includes\master.inc" + use "global\system\includes\gvariabl.inc" + Call GetUseFiles + gApplication = "CALC" +end sub + diff --git a/testautomation/chart2/optional/includes/ch2_lvl1_data_series1.inc b/testautomation/chart2/optional/includes/ch2_lvl1_data_series1.inc new file mode 100644 index 000000000000..b13bf14eb6d2 --- /dev/null +++ b/testautomation/chart2/optional/includes/ch2_lvl1_data_series1.inc @@ -0,0 +1,214 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' +' for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : oliver.craemer@oracle.com +'* +'* short description : Data Series dialog test cases +'* +'************************************************************************ +'* +' #1 tPlotMissingValuesBar +' #1 tPlotMissingValuesLine +'* +'\************************************************************************ + +testcase tPlotMissingValuesBar + Dim iCountTabPg as integer + iCountTabPg = 0 + Dim iTestRadio as integer + iTestRadio = 99 + printlog "Load simple chart document" + + if fLoadVerySimpleChartAndSaveLocal() > 0 then + warnlog "Loading test document seems to have failed -> Check this out!" + goto endsub + endif + printlog "Go one row down" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "" + printlog "Insert / Rows to insert one empty row in the data series" + InsertRowsCalc + printlog "Select chart using navigator" + if fSelectFirstOLE = 0 then + printlog "Edit / Object / Edit" + EditObjectEdit + printlog "Select DataSeries A by toolbar selectorbox" + call fChartSelectElement (8) + printlog "Open the properties dialog by using the FormatSelection button in the toolbar" + FormatSelection.Click + printlog "Select tab page Options" + Kontext + iCountTabPg = Active.GetPageCount + if iCountTabPg <> 4 then + warnlog "Edit / Properties on a data series should have 4 tab pages but has " & iCountTabPg & "." + endif + Active.SetPage TabDataSeriesOptions + Kontext "TabDataSeriesOptions" + call DialogTest ( TabDataSeriesOptions ) + printlog "Verify that 'Leave gap' is checked (default)" + if NOT LeaveGap.IsChecked then + warnlog "'Leave gap' should be the default setting in bar charts!" + endif + printlog "Check that 'ContinueLine' is disabled" + if ContinueLine.IsEnabled then + warnlog "Continue Line radio button is enabled but should not in bar charts!" + endif + printlog "Select 'AssumeZero' and close the dialog with OK" + iTestRadio = fSetRadioButton(AssumeZero) + if iTestRadio = 2 then + warnlog "Assume Zero radio button was not checked." + elseif iTestRadio = 11 then + warnlog "Assume Zero radio button is not visible." + elseif iTestRadio = 12 then + warnlog "Assume Zero radio button is not enabled." + endif + Kontext + printlog "Clicking OK" + TabDataSeriesOptions.OK + printlog "Invoke Format / Object Properties" + FormatSelection + Kontext + Active.SetPage TabDataSeriesOptions + Kontext "TabDataSeriesOptions" + printlog "Check if 'AssumeZero' is selected" + if NOT AssumeZero.IsChecked then + warnlog "'AssumeZero' should be selected." + endif + TabDataSeriesOptions.Cancel + else + warnlog "It was not possible to select the chart object!" + endif + printlog "Close document" + Call hCloseDocument +endcase +' +'------------------------------------------------------------------------- +' +testcase tPlotMissingValuesLine + Dim iCountTabPg as integer + iCountTabPg = 0 + Dim iTestRadio as integer + iTestRadio = 99 + + printlog "Load simple chart document" + + if fLoadVerySimpleChartAndSaveLocal() > 0 then + warnlog "Loading test document seems to have failed -> Check this out!" + goto endsub + endif + printlog "Go one row down" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "" + printlog "Insert / Rows to insert one empty row in the data series" + InsertRowsCalc + printlog "Select chart using navigator" + if fSelectFirstOLE = 0 then + printlog "Edit / Object / Edit" + EditObjectEdit + if fInvokeChartTypeDialog <> 0 then + warnlog "Impossible to invike the chart type dialog!" + goto endsub + endif + if fSetChartType("line") <> 0 then + warnlog "Selecting chart type 'line' failed!" + goto endsub + end if + if fSetChartTypeVariant(2) <> 0 then + warnlog "Selecting chart type 'line' variant 2 failed!" + goto endsub + end if + if fCloseChartTypeDialogOK <> 0 then + warnlog "Closing Chart Type dialog with OK failed!" + goto endsub + end if + printlog "Select DataSeries A by toolbar selectorbox" + call fChartSelectElement (8) + printlog "Invoke Format / Object Properties" + FormatSelection.Click + printlog "Select tab page Options" + Kontext + iCountTabPg = Active.GetPageCount + if iCountTabPg <> 2 then + warnlog "Edit / Properties on a data series of a line chart should have 2 tab pages but has " & iCountTabPg & "." + endif + Active.SetPage TabDataSeriesOptions + Kontext "TabDataSeriesOptions" + call DialogTest ( TabDataSeriesOptions ) + printlog "Verify that 'Leave gap' is checked (default)" + if NOT LeaveGap.IsChecked then + warnlog "'Leave gap' should be the default setting in line charts!" + endif + printlog "Select 'AssumeZero' and close the dialog with OK" + iTestRadio = fSetRadioButton(AssumeZero) + if iTestRadio = 2 then + warnlog "Assume Zero radio button was not checked." + elseif iTestRadio = 11 then + warnlog "Assume Zero radio button is not visible." + elseif iTestRadio = 12 then + warnlog "Assume Zero radio button is not enabled." + endif + Kontext + printlog "Clicking OK" + TabDataSeriesOptions.OK + printlog "Invoke Format / Object Properties" + FormatSelection + Kontext + Active.SetPage TabDataSeriesOptions + Kontext "TabDataSeriesOptions" + printlog "Check if 'AssumeZero' is selected" + if NOT AssumeZero.IsChecked then + warnlog "'AssumeZero' should be selected." + endif + printlog "Select 'ContinueLine' and close the dialog with OK" + iTestRadio = 99 + iTestRadio = fSetRadioButton(ContinueLine) + if iTestRadio = 2 then + warnlog "Continue Line radio button was not checked." + elseif iTestRadio = 11 then + warnlog "Continue Line radio button is not visible." + elseif iTestRadio = 12 then + warnlog "Continue Line radio button is not enabled." + endif + Kontext + TabDataSeriesOptions.OK + printlog "Invoke Format / Object Properties" + FormatSelection + Kontext + Active.SetPage TabDataSeriesOptions + Kontext "TabDataSeriesOptions" + printlog "Check if 'ContinueLine' is selected" + if NOT ContinueLine.IsChecked then + warnlog "'ContinueLine' should be selected." + endif + printlog "Close dialog with Cancel-button" + TabDataSeriesOptions.Cancel + else + warnlog "It was not possible to select the chart object!" + endif + printlog "Close document" + Call hCloseDocument +endcase -- cgit v1.2.3 From 61fdfc43d79fa0963f130a963c23b8147a04c5f2 Mon Sep 17 00:00:00 2001 From: "Oliver Craemer [oc]" Date: Fri, 18 Mar 2011 15:40:56 +0100 Subject: #i117455# check qaerrorlogs for fixed issueids --- testautomation/global/sid/e_all.sid | 1 + testautomation/spreadsheet/required/includes/c_upd_insertmenu.inc | 2 +- testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/testautomation/global/sid/e_all.sid b/testautomation/global/sid/e_all.sid index 4770eab50f1b..a09d700c6f6c 100755 --- a/testautomation/global/sid/e_all.sid +++ b/testautomation/global/sid/e_all.sid @@ -204,6 +204,7 @@ ViewToolbarsInsertFormula .uno:InsertFormula ViewToolbarsCustomize .uno:ConfigureDialog ViewToolbarsPreviewbar .uno:AvailableToolbars?Toolbar:string=previewbar ViewToolbarsDrawObjectbar .uno:AvailableToolbars?Toolbar:string=drawobjectbar +ViewToolbarsReset SYM:.cmd:RestoreVisibility ' **** Writer ViewRuler .uno:Ruler diff --git a/testautomation/spreadsheet/required/includes/c_upd_insertmenu.inc b/testautomation/spreadsheet/required/includes/c_upd_insertmenu.inc index b8c749c27cd9..b9c4b7d3b2ca 100644 --- a/testautomation/spreadsheet/required/includes/c_upd_insertmenu.inc +++ b/testautomation/spreadsheet/required/includes/c_upd_insertmenu.inc @@ -1204,7 +1204,7 @@ testcase tInsertObjectFormular Kontext "SelectionMath" call DialogTest (SelectionMath) catch - qaerrorlog "#i93427# Math Selection Dialog is not available" + warnlog "Math Selection Dialog is not available" endcatch end if '/// Close Formular with 'Esc' diff --git a/testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc b/testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc index e7568390c38a..99d8c9823776 100644 --- a/testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc +++ b/testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc @@ -173,8 +173,12 @@ testcase tViewToolbars TabCustomizeMenu.Cancel '/// Reset toolbars by 'View - Toolbars - Reset' printlog " Reset toolbars by 'View - Toolbars - Reset'" + Kontext "DocumentCalc" + DocumentCalc.UseMenu 'Selecting Menubar + hMenuSelectNr(3) 'Using third entry on Menubar (VIEW) + hMenuSelectNr(3) 'Using third entry on menu (TOOLBARS) + hMenuFindSelect(22, true, 22) 'Using last entry on menu (RESET) ' ViewToolbarsReset - qaerrorlog "Reset not possible because of #i84544" '/// Close document printlog " Close starting document" call hCloseDocument -- cgit v1.2.3 From 07b54cb2c895ea735d631a0b7c6c735e3d661ca7 Mon Sep 17 00:00:00 2001 From: "Oliver Craemer [oc]" Date: Mon, 21 Mar 2011 06:25:13 +0100 Subject: #i117455# check qaerrorlogs for fixed issueids --- .../spreadsheet/optional/includes/so7pp1/c_so7_pp1_iz.inc | 8 ++------ testautomation/spreadsheet/required/includes/c_upd_filemenu.inc | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_iz.inc b/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_iz.inc index 873ca1bddabc..4777fc60917f 100644 --- a/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_iz.inc +++ b/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_iz.inc @@ -104,11 +104,7 @@ testcase tIZ19381 sleep(2) Kontext if Active.exists(2) then - if gPlatGroup = "w95" then - warnlog "REGRESSION! #i41751# - Saving after Cut&Paste of OLE fails on windows!" - else - warnlog "OOPS, found unexpected MsgBox -> Check this out!" - end if + warnlog "OOPS, found unexpected MsgBox -> Check this out!" Active.OK call hCloseDocument goto endsub @@ -202,7 +198,7 @@ testcase tIZ21036 try printlog "OK, there are still " & GetDocumentCount & " documents open" catch - warnlog "Probably the office did crash -> #I21036#" + warnlog "Probably the office did crash" goto endsub endcatch diff --git a/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc b/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc index 33c52111c384..cf52ad4c7647 100644 --- a/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc +++ b/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc @@ -658,7 +658,7 @@ testcase tFileSaveAsDBF Kontext if Active.exists(2) then printlog " " - warnlog "#i87325# - Unexpected messagebox" + warnlog "Unexpected messagebox" Printlog Active.GetText Printlog " " Active.OK -- cgit v1.2.3 From 28c4bc7048849683e29517fb7d90add65fae01f5 Mon Sep 17 00:00:00 2001 From: "Oliver Craemer [oc]" Date: Mon, 21 Mar 2011 08:47:08 +0100 Subject: #i117483# waitslot added in f_basic_first.bas --- testautomation/framework/optional/includes/basic_macros.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/framework/optional/includes/basic_macros.inc b/testautomation/framework/optional/includes/basic_macros.inc index cc8ff04fb408..e649200a585f 100644 --- a/testautomation/framework/optional/includes/basic_macros.inc +++ b/testautomation/framework/optional/includes/basic_macros.inc @@ -351,7 +351,7 @@ testcase tMakro_Dialog printlog( "Select the last item in the treelist" ) kontext "Makro" hSelectTheLastNode( MakroAus ) - + WaitSlot(2000) printlog( "Delete the new module" ) Loeschen.Click() -- cgit v1.2.3 From 1c53b23799901923b7bdffbc86642b5dadb24540 Mon Sep 17 00:00:00 2001 From: "Oliver Craemer [oc]" Date: Mon, 21 Mar 2011 10:08:55 +0100 Subject: #i117455# check qaerrorlogs for fixed issueids --- testautomation/chart2/required/includes/ch2_toolbars.inc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/testautomation/chart2/required/includes/ch2_toolbars.inc b/testautomation/chart2/required/includes/ch2_toolbars.inc index 32eed54ee370..2ad6f3db7e46 100644 --- a/testautomation/chart2/required/includes/ch2_toolbars.inc +++ b/testautomation/chart2/required/includes/ch2_toolbars.inc @@ -48,11 +48,16 @@ testcase tDrawBar EditObjectEdit printlog " Verify that the drawbar is visible" Kontext "DrawBar" - - qaerrorlog "#i107003# disabled because of bug in toolbars" -' if Not DrawBar.Exists then + + if Not DrawBar.Exists then + warnlog "Drawbar is not enabled" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "" + printlog " Close document" + Call hCloseDocument + goto endsub ' Call hToolbarSelect("Drawing", true) -' endif + endif printlog " Check if all items on drawbar are available" if DrawBar.GetItemCount <> 16 then -- cgit v1.2.3 From 399fb2bcff0d8120dcb7ccd047caff31c9c81eb3 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Mon, 21 Mar 2011 10:30:30 +0100 Subject: dr80: #i117392# initialize VBAGlobals object if single Basic module is in VBA mode, do not expect existing parent sheet in implementation of Excel.Application.ActiveCell --- sc/source/ui/vba/vbaapplication.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 290b34a949ca..d3a38b984704 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -323,8 +323,8 @@ ScVbaApplication::getActiveCell() throw (uno::RuntimeException ) sal_Int32 nCursorX = pTabView->GetCurX(); sal_Int32 nCursorY = pTabView->GetCurY(); - uno::Reference< XHelperInterface > xParent( excel::getUnoSheetModuleObj( xRange ), uno::UNO_QUERY_THROW ); - return new ScVbaRange( xParent, mxContext, xRange->getCellRangeByPosition( nCursorX, nCursorY, nCursorX, nCursorY ) ); + // #i117392# excel::getUnoSheetModuleObj() may return null in documents without global VBA mode enabled + return new ScVbaRange( excel::getUnoSheetModuleObj( xRange ), mxContext, xRange->getCellRangeByPosition( nCursorX, nCursorY, nCursorX, nCursorY ) ); } uno::Any SAL_CALL -- cgit v1.2.3 From 2c3f5aa09a943185dbd67fda473ed7ed5e25589a Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Mon, 21 Mar 2011 10:30:30 +0100 Subject: dr80: #i117392# initialize VBAGlobals object if single Basic module is in VBA mode, do not expect existing parent sheet in implementation of Excel.Application.ActiveCell --- basic/source/classes/sbxmod.cxx | 56 ++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 15 deletions(-) mode change 100755 => 100644 basic/source/classes/sbxmod.cxx diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx old mode 100755 new mode 100644 index 592d69c514a0..931026b06660 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -450,24 +450,36 @@ TYPEINIT1(SbUserFormModule,SbObjModule) typedef std::vector HighlightPortions; -bool getDefaultVBAMode( StarBASIC* pb ) +uno::Reference< frame::XModel > getDocumentModel( StarBASIC* pb ) { - bool bResult = false; - if ( pb && pb->IsDocBasic() ) + uno::Reference< frame::XModel > xModel; + if( pb && pb->IsDocBasic() ) { uno::Any aDoc; - if ( pb->GetUNOConstant( "ThisComponent", aDoc ) ) - { - uno::Reference< beans::XPropertySet > xProp( aDoc, uno::UNO_QUERY ); - if ( xProp.is() ) - { - uno::Reference< script::vba::XVBACompatibility > xVBAMode( xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BasicLibraries") ) ), uno::UNO_QUERY ); - if ( xVBAMode.is() ) - bResult = xVBAMode->getVBACompatibilityMode() == sal_True; - } - } + if( pb->GetUNOConstant( "ThisComponent", aDoc ) ) + xModel.set( aDoc, uno::UNO_QUERY ); } - return bResult; + return xModel; +} + +uno::Reference< vba::XVBACompatibility > getVBACompatibility( const uno::Reference< frame::XModel >& rxModel ) +{ + uno::Reference< vba::XVBACompatibility > xVBACompat; + try + { + uno::Reference< beans::XPropertySet > xModelProps( rxModel, uno::UNO_QUERY_THROW ); + xVBACompat.set( xModelProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BasicLibraries" ) ) ), uno::UNO_QUERY ); + } + catch( uno::Exception& ) + { + } + return xVBACompat; +} + +bool getDefaultVBAMode( StarBASIC* pb ) +{ + uno::Reference< vba::XVBACompatibility > xVBACompat = getVBACompatibility( getDocumentModel( pb ) ); + return xVBACompat.is() && xVBACompat->getVBACompatibilityMode(); } class AsyncQuitHandler @@ -1018,8 +1030,22 @@ sal_Bool SbModule::IsVBACompat() const void SbModule::SetVBACompat( sal_Bool bCompat ) { - mbVBACompat = bCompat; + if( mbVBACompat != bCompat ) + { + mbVBACompat = bCompat; + // initialize VBA document API + if( mbVBACompat ) try + { + StarBASIC* pBasic = static_cast< StarBASIC* >( GetParent() ); + uno::Reference< lang::XMultiServiceFactory > xFactory( getDocumentModel( pBasic ), uno::UNO_QUERY_THROW ); + xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals" ) ) ); + } + catch( Exception& ) + { + } + } } + // Ausfuehren eines BASIC-Unterprogramms sal_uInt16 SbModule::Run( SbMethod* pMeth ) { -- cgit v1.2.3 From b3e6f2772e0fb4fe920051b3e0da2f4bf07dbdbd Mon Sep 17 00:00:00 2001 From: "Oliver Craemer [oc]" Date: Mon, 21 Mar 2011 10:42:31 +0100 Subject: #i117455# check qaerrorlogs for fixed issueids --- testautomation/chart2/tools/ch_tools_common.inc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/testautomation/chart2/tools/ch_tools_common.inc b/testautomation/chart2/tools/ch_tools_common.inc index ad9f2108f024..0af4cad8db5d 100644 --- a/testautomation/chart2/tools/ch_tools_common.inc +++ b/testautomation/chart2/tools/ch_tools_common.inc @@ -175,10 +175,6 @@ function fOpenTestDocumentAndSelectDataRange(sInputFile as string) as BOOLEAN WaitSlot() '///Switch to tabpage Data Range printlog "Switch to tabpage Data Range" - Kontext - 'Switching tabpages as workaround for #i77237# - Active.SetPage TabChartTypeDataSeries - QAErrorLog "#i77237#-Testtool can't access OK after switching tabpage" Active.SetPage TabChartTypeDataRange Kontext "TabChartTypeDataRange" call DialogTest ( TabChartTypeDataRange ) -- cgit v1.2.3 From c36d6acad609f3f88de5cf27c7b458fe3d5dc5b3 Mon Sep 17 00:00:00 2001 From: "Oliver Craemer [oc]" Date: Mon, 21 Mar 2011 11:25:07 +0100 Subject: #i117455# check qaerrorlogs for fixed issueids --- testautomation/chart2/optional/includes/ch2_lvl1a.inc | 13 +++++++++---- .../chart2/optional/includes/wizard/ch2_lvl1_wizard.inc | 11 +++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/testautomation/chart2/optional/includes/ch2_lvl1a.inc b/testautomation/chart2/optional/includes/ch2_lvl1a.inc index e012dd0253c8..e7154d3820cf 100755 --- a/testautomation/chart2/optional/includes/ch2_lvl1a.inc +++ b/testautomation/chart2/optional/includes/ch2_lvl1a.inc @@ -174,10 +174,15 @@ testcase tChartShapes printlog " Verify that the drawbar is visible" Kontext "DrawBar" - qaerrorlog "#i107003# disabled because of bug in toolbars" - ' if Not DrawBar.Exists then - ' Call hToolbarSelect("Drawing", true) - ' endif + if Not DrawBar.Exists then + warnlog "Drawbar is not enabled" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "" + printlog " Close document" + Call hCloseDocument + goto endsub +' Call hToolbarSelect("Drawing", true) + endif printlog " Insert a shape to the chart by " Kontext "DocumentChart" diff --git a/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc b/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc index 357fa89c4393..142e588d0079 100644 --- a/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc +++ b/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc @@ -199,7 +199,7 @@ testcase tCreateNew3DChart endif printlog "Check that 3D look is 'simple' (=default)" if Scheme3D.GetSelIndex <> 1 then - warnlog "#i112522# - Default 3D Look ('simple') has not been preserved after save and reload." + warnlog "Default 3D Look ('simple') has not been preserved after save and reload." endif printlog "Check that 3D shape 'cone' is selected" if BarColumnShape.GetSelIndex <> 3 Then @@ -222,7 +222,7 @@ testcase tCreateNew3DChart warnlog "Data range wasn't correctly preserved after save and reload and does not caontain $A$2:$E$13." endif if instr ( sControlString , "$A$17:$E$17" ) = 0 Then - warnlog "#i72241# - Data range wasn't correctly preserved after save and reload and does not contain $A$17:$E$17." + warnlog "Data range wasn't correctly preserved after save and reload and does not contain $A$17:$E$17." endif printlog "Check that radio button 'rows' is checked" if NOT Rows.IsChecked then @@ -238,7 +238,7 @@ testcase tCreateNew3DChart endif printlog "Check that 'First column as label' checkbox is checked." if NOT FirstColumnAsLabel.IsChecked then - warnlog "#i72241# - Check box 'First column as label' (enabled) wasn't preserved after save and reload." + warnlog "Check box 'First column as label' (enabled) wasn't preserved after save and reload." endif else warnlog "Tab page 'Data Range' not visible!" @@ -260,7 +260,7 @@ testcase tCreateNew3DChart sControlString = RangeFor.GetText printlog "'Range for name' is: " & sControlString if instr ( sControlString , "$A$17" ) = 0 Then - warnlog "#i72241# - 'Range for name' wasn't correctly preserved after save and reload." + warnlog "'Range for name' wasn't correctly preserved after save and reload." else printlog "Select 'Y-Values' in Data Ranges list on the right." if fSetListBoxByItem ( DataRanges , 2 ) > 0 then @@ -546,7 +546,6 @@ testcase tCreateNewLineChart FormatDataRanges printlog "Switch to tab page Data Series" Kontext - Active.SetPage TabFormatDataRangesDataRange 'Due to bug #i77237# the tabpage has to be switched once before 'OK' or 'Cancel' can be used Active.SetPage TabFormatDataRangesDataSeries Kontext "TabChartTypeDataSeries" if TabChartTypeDataSeries.Exists(2) then @@ -867,7 +866,7 @@ testcase tCreateNewBubbleChart warnlog "Data range wasn't correctly preserved after save and reload: $A$19" endif if instr ( sControlString , "$B$13:$C$16" ) = 0 Then - QAErrorlog "#i100780#Data range wasn't correctly preserved after save and reload: $B$13:$C$16" + QAErrorlog "Data range wasn't correctly preserved after save and reload: $B$13:$C$16" endif if instr ( sControlString , "$C$12" ) = 0 Then warnlog "Data range wasn't correctly preserved after save and reload: $E$1:$F$13" -- cgit v1.2.3 From 929b785d40c7f7aef334c61476b6d74eaeca79d5 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 21 Mar 2011 12:27:08 +0100 Subject: fs34b: #i117472# fix color calculation from style string --- .../sun/star/wizards/db/DatabaseObjectWizard.java | 83 ++++++++++++++++++++++ .../com/sun/star/wizards/form/CallFormWizard.java | 2 +- .../com/sun/star/wizards/form/FormDocument.java | 8 +-- wizards/com/sun/star/wizards/form/FormWizard.java | 20 +++--- .../com/sun/star/wizards/form/StyleApplier.java | 76 +++----------------- .../sun/star/wizards/query/CallQueryWizard.java | 2 +- .../com/sun/star/wizards/query/QueryWizard.java | 80 +-------------------- 7 files changed, 114 insertions(+), 157 deletions(-) diff --git a/wizards/com/sun/star/wizards/db/DatabaseObjectWizard.java b/wizards/com/sun/star/wizards/db/DatabaseObjectWizard.java index e03323c6ebbc..cd9b0771fc4e 100644 --- a/wizards/com/sun/star/wizards/db/DatabaseObjectWizard.java +++ b/wizards/com/sun/star/wizards/db/DatabaseObjectWizard.java @@ -16,7 +16,10 @@ import com.sun.star.sdbc.SQLException; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.Desktop; import com.sun.star.wizards.common.NamedValueCollection; +import com.sun.star.wizards.common.Properties; import com.sun.star.wizards.ui.WizardDialog; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; import java.util.logging.Level; import java.util.logging.Logger; @@ -73,4 +76,84 @@ public abstract class DatabaseObjectWizard extends WizardDialog Logger.getLogger( this.getClass().getName() ).log( Level.SEVERE, null, ex ); } } + + protected static void executeWizardFromCommandLine( final String i_args[], final String i_className ) + { + final String settings[] = new String[] { null, null, null }; + final int IDX_PIPE_NAME = 0; + final int IDX_LOCATION = 1; + final int IDX_DSN = 2; + + // some simple parsing + boolean failure = false; + int settingsIndex = -1; + for ( int i=0; i= 0 ) + { + settings[ settingsIndex ] = i_args[i]; + settingsIndex = -1; + continue; + } + + if ( i_args[i].equals( "--pipe-name" ) ) + { + settingsIndex = IDX_PIPE_NAME; + continue; + } + + if ( i_args[i].equals( "--database-location" ) ) + { + settingsIndex = IDX_LOCATION; + continue; + } + + if ( i_args[i].equals( "--data-source-name" ) ) + { + settingsIndex = IDX_DSN; + continue; + } + + failure = true; + } + + if ( settings[ IDX_PIPE_NAME ] == null ) + failure = true; + + if ( ( settings[ IDX_DSN ] == null ) && ( settings[ IDX_LOCATION ] == null ) ) + failure = true; + + if ( failure ) + { + System.err.println( "supported arguments: " ); + System.err.println( " --pipe-name : specifies the name of the pipe to connect to the running OOo instance" ); + System.err.println( " --database-location : specifies the URL of the database document to work with" ); + System.err.println( " --data-source-name : specifies the name of the data source to work with" ); + return; + } + + final String ConnectStr = "uno:pipe,name=" + settings[IDX_PIPE_NAME] + ";urp;StarOffice.ServiceManager"; + try + { + final XMultiServiceFactory serviceFactory = Desktop.connect(ConnectStr); + if (serviceFactory != null) + { + PropertyValue[] curproperties = new PropertyValue[1]; + if ( settings[ IDX_LOCATION ] != null ) + curproperties[0] = Properties.createProperty( "DatabaseLocation", settings[ IDX_LOCATION ] ); + else + curproperties[0] = Properties.createProperty( "DataSourceName", settings[ IDX_DSN ] ); + + final Class wizardClass = Class.forName( i_className ); + final Constructor ctor = wizardClass.getConstructor( XMultiServiceFactory.class, PropertyValue[].class ); + final Method invokeMethod = wizardClass.getMethod( "start", new Class[0] ); + final Object wizardInstance = ctor.newInstance( serviceFactory, curproperties ); + invokeMethod.invoke( wizardInstance ); + } + } + catch (java.lang.Exception jexception) + { + jexception.printStackTrace(System.out); + } + } } diff --git a/wizards/com/sun/star/wizards/form/CallFormWizard.java b/wizards/com/sun/star/wizards/form/CallFormWizard.java index 0538eb5fa1b3..69ae5d0e69ea 100644 --- a/wizards/com/sun/star/wizards/form/CallFormWizard.java +++ b/wizards/com/sun/star/wizards/form/CallFormWizard.java @@ -84,7 +84,7 @@ public class CallFormWizard if (sEvent.compareTo("start") == 0) { FormWizard CurFormWizard = new FormWizard( m_serviceFactory, m_wizardContext ); - CurFormWizard.startFormWizard(); + CurFormWizard.start(); } } catch (Exception exception) diff --git a/wizards/com/sun/star/wizards/form/FormDocument.java b/wizards/com/sun/star/wizards/form/FormDocument.java index 0070fed3ada1..feff3a2ace33 100644 --- a/wizards/com/sun/star/wizards/form/FormDocument.java +++ b/wizards/com/sun/star/wizards/form/FormDocument.java @@ -391,7 +391,7 @@ public class FormDocument extends TextDocument public void initialize(int _curArrangement, Short _NBorderType) { - boolean badaptControlStyles = false; + boolean adaptControlStyles = false; xTextDocument.lockControllers(); curArrangement = _curArrangement; if (oGridControl != null) @@ -415,14 +415,14 @@ public class FormDocument extends TextDocument if (curArrangement == FormWizard.SOGRID) { insertGridControl(_NBorderType); - badaptControlStyles = true; + adaptControlStyles = true; } else { - badaptControlStyles = !oFormController.areControlsexisting(); + adaptControlStyles = !oFormController.areControlsexisting(); oFormController.positionControls(_curArrangement, aStartPoint, getAvailableFormSize(), curUIControlArranger.getAlignValue(), _NBorderType); } - if (badaptControlStyles) + if (adaptControlStyles) { curStyleApplier.applyStyle(false, true); } diff --git a/wizards/com/sun/star/wizards/form/FormWizard.java b/wizards/com/sun/star/wizards/form/FormWizard.java index f75f3e1b84ab..adef74d631cf 100644 --- a/wizards/com/sun/star/wizards/form/FormWizard.java +++ b/wizards/com/sun/star/wizards/form/FormWizard.java @@ -29,7 +29,6 @@ package com.sun.star.wizards.form; import com.sun.star.awt.XWindowPeer; import com.sun.star.beans.PropertyValue; import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.lang.XComponent; import com.sun.star.sdb.application.DatabaseObject; import com.sun.star.wizards.common.Helper; import com.sun.star.wizards.common.PropertyNames; @@ -95,6 +94,11 @@ public class FormWizard extends DatabaseObjectWizard } } + public static void main(String i_args[]) + { + executeWizardFromCommandLine( i_args, FormWizard.class.getName() ); + } + // @Override protected void enterStep(int nOldStep, int nNewStep) { @@ -332,7 +336,7 @@ public class FormWizard extends DatabaseObjectWizard setCurrentRoadmapItemID((short) 1); } - public void startFormWizard() + public void start() { try { @@ -456,14 +460,14 @@ public class FormWizard extends DatabaseObjectWizard private void toggleMainFormSteps() { curDBCommandFieldSelection.setModified(true); - boolean benable = curDBCommandFieldSelection.getSelectedFieldNames().length > 0; - enablefromStep(SOSUBFORM_PAGE, benable); - setControlProperty("btnWizardNext", PropertyNames.PROPERTY_ENABLED, new Boolean(benable)); - if (benable) + boolean enabled = curDBCommandFieldSelection.getSelectedFieldNames().length > 0; + enablefromStep(SOSUBFORM_PAGE, enabled); + setControlProperty("btnWizardNext", PropertyNames.PROPERTY_ENABLED, enabled); + if (enabled) { if (curFormConfiguration.hasSubForm()) { - benable = toggleSubFormSteps(); + enabled = toggleSubFormSteps(); } else { @@ -471,7 +475,7 @@ public class FormWizard extends DatabaseObjectWizard setStepEnabled(SOFIELDLINKER_PAGE, false); } } - setControlProperty("btnWizardFinish", PropertyNames.PROPERTY_ENABLED, new Boolean(benable)); + setControlProperty("btnWizardFinish", PropertyNames.PROPERTY_ENABLED, enabled); } } } diff --git a/wizards/com/sun/star/wizards/form/StyleApplier.java b/wizards/com/sun/star/wizards/form/StyleApplier.java index 5098a1ffbb74..5a6f42e2c213 100644 --- a/wizards/com/sun/star/wizards/form/StyleApplier.java +++ b/wizards/com/sun/star/wizards/form/StyleApplier.java @@ -36,9 +36,7 @@ import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; import com.sun.star.wizards.common.Configuration; -import com.sun.star.wizards.common.Desktop; import com.sun.star.wizards.common.FileAccess; import com.sun.star.wizards.common.Helper; import com.sun.star.wizards.common.JavaTools; @@ -49,11 +47,9 @@ import com.sun.star.wizards.document.DatabaseControl; import com.sun.star.wizards.document.GridControl; import com.sun.star.wizards.document.TimeStampControl; import com.sun.star.wizards.text.TextStyleHandler; -import com.sun.star.wizards.ui.*; import com.sun.star.wizards.ui.UIConsts; -import java.util.ArrayList; - -// TODO: Style Templates fuer OOo? +import com.sun.star.wizards.ui.UnoDialog; +import com.sun.star.wizards.ui.WizardDialog; public class StyleApplier { @@ -64,23 +60,17 @@ public class StyleApplier private short curtabindex; private XRadioButton optNoBorder; private XRadioButton opt3DLook; - private XRadioButton optFlat; private XListBox lstStyles; - private Desktop.OfficePathRetriever curofficepath;// String[][] sLayoutFiles; private FormDocument curFormDocument; private short iOldLayoutPos; - private int SOLAYOUTLST = 0; private static final String SCHANGELAYOUT = "changeLayout"; private static final String SCHANGEBORDERTYPE = "changeBorderLayouts"; private String[] StyleNames; private String[] StyleNodeNames; private String[] FileNames; - // private String StylesPath; private final static int SOBACKGROUNDCOLOR = 0; private final static int SODBTEXTCOLOR = 1; private final static int SOLABELTEXTCOLOR = 2; -// final static int SODBCONTROLBACKGROUNDCOLOR = 3; - private final static int SOLABELBACKGROUNDCOLOR = 4; private final static int SOBORDERCOLOR = 5; private Short IBorderValue = new Short((short) 1); @@ -101,7 +91,6 @@ public class StyleApplier String s3DLook = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 30); String sFlat = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 31); String sFieldBorder = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 28); -// XInterface xUcbInterface = (XInterface) _curFormDocument.xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); setStyles(); short[] SelLayoutPos; SelLayoutPos = new short[] @@ -149,7 +138,7 @@ public class StyleApplier UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMD3DBORDER", s3DLook, new Integer(196), new Integer(53), new Short((short) 1), IStyleStep, new Short(curtabindex++), "1", new Integer(93) }); - optFlat = CurUnoDialog.insertRadioButton("otpFlat", SCHANGEBORDERTYPE, this, + CurUnoDialog.insertRadioButton("otpFlat", SCHANGEBORDERTYPE, this, new String[] { PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Tag", PropertyNames.PROPERTY_WIDTH @@ -175,13 +164,6 @@ public class StyleApplier // } } - /* public void initialize(short _iStyleindex){ - if (_iStyleindex < lstStyles.getItemCount()){ - Helper.setUnoPropertyValue(UnoDialog.getModel(lstStyles), "SelectedItems", new short[]{_iStyleindex}); - applyStyle(true, false); - } - } - */ private void setStyles() { try @@ -249,12 +231,6 @@ public class StyleApplier curFormDocument.unlockallControllers(); } - /* public void changeLayout(){ - / curFormDocument.xTextDocument.lockControllers(); - applyStyle(true, false); - curFormDocument.unlockallControllers(); - } - */ public Short getBorderType() { return IBorderValue; @@ -327,12 +303,10 @@ public class StyleApplier private int getStyleColor(String[] _sDataList, String _sHeader, String _sPropertyDescription) { - int iColor = -1; int index = JavaTools.FieldInList(_sDataList, _sHeader); if (index > -1) { String sPropName = ""; - int iStyleColor; while (((sPropName.indexOf("}") < 0) && (index < _sDataList.length - 1))) { String scurline = _sDataList[index++]; @@ -343,7 +317,7 @@ public class StyleApplier String[] sPropList = JavaTools.ArrayoutofString(scurline, ":"); String sPropValue = sPropList[1]; sPropValue = sPropValue.trim(); - if (sPropValue.indexOf("#") > 0) + if (sPropValue.indexOf("#") > -1) { sPropValue = JavaTools.replaceSubString(sPropValue, "", ";"); sPropValue = JavaTools.replaceSubString(sPropValue, "", " "); @@ -356,46 +330,20 @@ public class StyleApplier return -1; } - private XMultiServiceFactory getMSF() - { - return xMSF; - } - - private ArrayList getStylePaths() + private String getStylePath() { - ArrayList aStylePaths = new ArrayList(); + String StylesPath = ""; try { - // TODO: check different languages in header layouts - aStylePaths = FileAccess.getOfficePaths(getMSF(), "Config", "", ""); - FileAccess.combinePaths(getMSF(), aStylePaths, "/wizard/form/styles"); - - String[][] LayoutFiles = FileAccess.getFolderTitles(getMSF(), null, aStylePaths, ".css"); - + StylesPath = FileAccess.getOfficePath(xMSF, "Config", "", ""); + StylesPath = FileAccess.combinePaths(xMSF, StylesPath, "/wizard/form/styles"); } - catch (com.sun.star.wizards.common.NoValidPathException e) + catch (NoValidPathException e) { - // if there are problems, don't show anything is a little bit hard. - aStylePaths.add("default"); } - return aStylePaths; + return StylesPath; } - private String getStylePath() - { -// TODO: umstellen auf mehrere Pfade - String StylesPath = ""; - try - { - StylesPath = FileAccess.getOfficePath(xMSF, "Config", "", ""); - StylesPath = FileAccess.combinePaths(xMSF, StylesPath, "/wizard/form/styles"); - } - catch (NoValidPathException e) - { - } - return StylesPath; - } - private int[] getStyleColors(String _filename) { String sFilePath = getStylePath() + "/" + _filename; @@ -404,8 +352,6 @@ public class StyleApplier oStylePropList[SOBACKGROUNDCOLOR] = getStyleColor(sData, ".toctitle {", "background-color:"); oStylePropList[SODBTEXTCOLOR] = getStyleColor(sData, ".doctitle {", "color:"); oStylePropList[SOLABELTEXTCOLOR] = getStyleColor(sData, ".toctitle {", "color:"); -// oStylePropList[SODBCONTROLBACKGROUNDCOLOR] = getStyleColor(sData, "body {", "background-color:"); -// oStylePropList[SOLABELBACKGROUNDCOLOR] = getStyleColor(sData, ".toctitle {", "background-color:"); oStylePropList[SOBORDERCOLOR] = getStyleColor(sData, ".tcolor {", "border-color:"); return oStylePropList; } @@ -479,8 +425,6 @@ public class StyleApplier if (_iStyleColors[SOLABELTEXTCOLOR] > -1) { LabelControls[n].xPropertySet.setPropertyValue("TextColor", new Integer(_iStyleColors[SOLABELTEXTCOLOR])); -// if (_iStyleColors[SOCONTROLBACKGROUNDCOLOR] > -1) -// LabelControls[n].xPropertySet.setPropertyValue("BackgroundColor", new Integer(_iStyleColors[SOCONTROLBACKGROUNDCOLOR])); } } } diff --git a/wizards/com/sun/star/wizards/query/CallQueryWizard.java b/wizards/com/sun/star/wizards/query/CallQueryWizard.java index fe18fd13f6d0..c6f24058e759 100644 --- a/wizards/com/sun/star/wizards/query/CallQueryWizard.java +++ b/wizards/com/sun/star/wizards/query/CallQueryWizard.java @@ -93,7 +93,7 @@ public class CallQueryWizard if (sEvent.compareTo("start") == 0) { QueryWizard CurQueryWizard = new QueryWizard( m_serviceFactory, m_wizardContext ); - Command = CurQueryWizard.startQueryWizard(); + Command = CurQueryWizard.start(); } } catch (Exception exception) diff --git a/wizards/com/sun/star/wizards/query/QueryWizard.java b/wizards/com/sun/star/wizards/query/QueryWizard.java index bca4e1a6fa5f..b9d13fa5898d 100644 --- a/wizards/com/sun/star/wizards/query/QueryWizard.java +++ b/wizards/com/sun/star/wizards/query/QueryWizard.java @@ -36,10 +36,8 @@ import com.sun.star.sdbc.SQLException; import com.sun.star.uno.AnyConverter; import com.sun.star.wizards.ui.UIConsts; import com.sun.star.uno.UnoRuntime; -import com.sun.star.wizards.common.Desktop; import com.sun.star.wizards.common.Helper; import com.sun.star.wizards.common.JavaTools; -import com.sun.star.wizards.common.Properties; import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.common.Resource; import com.sun.star.wizards.db.DatabaseObjectWizard; @@ -90,79 +88,7 @@ public class QueryWizard extends DatabaseObjectWizard public static void main(String i_args[]) { - final String settings[] = new String[] { null, null, null }; - final int IDX_PIPE_NAME = 0; - final int IDX_LOCATION = 1; - final int IDX_DSN = 2; - - // some simple parsing - boolean failure = false; - int settingsIndex = -1; - for ( int i=0; i= 0 ) - { - settings[ settingsIndex ] = i_args[i]; - settingsIndex = -1; - continue; - } - - if ( i_args[i].equals( "--pipe-name" ) ) - { - settingsIndex = IDX_PIPE_NAME; - continue; - } - - if ( i_args[i].equals( "--database-location" ) ) - { - settingsIndex = IDX_LOCATION; - continue; - } - - if ( i_args[i].equals( "--data-source-name" ) ) - { - settingsIndex = IDX_DSN; - continue; - } - - failure = true; - } - - if ( settings[ IDX_PIPE_NAME ] == null ) - failure = true; - - if ( ( settings[ IDX_DSN ] == null ) && ( settings[ IDX_LOCATION ] == null ) ) - failure = true; - - if ( failure ) - { - System.err.println( "supported arguments: " ); - System.err.println( " --pipe-name : specifies the name of the pipe to connect to the running OOo instance" ); - System.err.println( " --database-location : specifies the URL of the database document to work with" ); - System.err.println( " --data-source-name : specifies the name of the data source to work with" ); - return; - } - - final String ConnectStr = "uno:pipe,name=" + settings[IDX_PIPE_NAME] + ";urp;StarOffice.ServiceManager"; - try - { - final XMultiServiceFactory serviceFactory = Desktop.connect(ConnectStr); - if (serviceFactory != null) - { - PropertyValue[] curproperties = new PropertyValue[1]; - if ( settings[ IDX_LOCATION ] != null ) - curproperties[0] = Properties.createProperty( "DatabaseLocation", settings[ IDX_LOCATION ] ); - else - curproperties[0] = Properties.createProperty( "DataSourceName", settings[ IDX_DSN ] ); - - QueryWizard CurQueryWizard = new QueryWizard( serviceFactory, curproperties ); - CurQueryWizard.startQueryWizard(); - } - } - catch (java.lang.Exception jexception) - { - jexception.printStackTrace(System.out); - } + executeWizardFromCommandLine( i_args, QueryWizard.class.getName() ); } public final XFrame getFrame() @@ -170,7 +96,7 @@ public class QueryWizard extends DatabaseObjectWizard return m_frame; } - public String startQueryWizard() + public String start() { try { @@ -453,7 +379,7 @@ public class QueryWizard extends DatabaseObjectWizard } catch (SQLException e) { - e.printStackTrace(); + e.printStackTrace( System.err ); } } } -- cgit v1.2.3 From 60232bfff4a14047a9ca551a7b27dd03f559aac1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 21 Mar 2011 15:30:43 +0100 Subject: fs34b: #i117459# fixed the test - do not create multiple children of a document, this (rightfully) throws nowadays --- forms/qa/integration/forms/XMLFormSettings.java | 11 ++++------- forms/qa/org/openoffice/xforms/Instance.java | 17 ----------------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/forms/qa/integration/forms/XMLFormSettings.java b/forms/qa/integration/forms/XMLFormSettings.java index e3881bfa861d..d7c98fdf17ce 100644 --- a/forms/qa/integration/forms/XMLFormSettings.java +++ b/forms/qa/integration/forms/XMLFormSettings.java @@ -85,17 +85,14 @@ public class XMLFormSettings extends complexlib.ComplexTestCase // create a simple structure in the DOM tree: an element with two attributes String[] modelNames = m_document.getXFormModelNames(); m_defaultModel = m_document.getXFormModel( modelNames[0] ); - Instance defaultInstance = m_defaultModel.getDefaultInstance(); + final Instance defaultInstance = m_defaultModel.getDefaultInstance(); + // remove the default root node + defaultInstance.removeNode( "instanceData" ); + // create test structures XNode stringElement = defaultInstance.createElement( "stringElement" ); XNode booleanAttrib = defaultInstance.createAttribute( stringElement, "booleanAttribute", "true" ); XNode dateAttrib = defaultInstance.createAttribute( stringElement, "dateAttribute" ); - // when it comes to saving and loading, only one child of the root element of the instance - // is handled (is this a bug? see xmloff/source/xforms/XFormsInstanceContext.cxx, method - // CreateChildContext). - // So, we remove the default node of the instance which it has all the time - defaultInstance.removeNode( "instanceData" ); - assure( "booleanAttrib's parent is wrong", UnoRuntime.areSame( stringElement, booleanAttrib.getParentNode() ) ); assure( "dateAttrib's parent is wrong", diff --git a/forms/qa/org/openoffice/xforms/Instance.java b/forms/qa/org/openoffice/xforms/Instance.java index 5e4e04741995..954ca6157f83 100644 --- a/forms/qa/org/openoffice/xforms/Instance.java +++ b/forms/qa/org/openoffice/xforms/Instance.java @@ -41,23 +41,6 @@ public class Instance return createElement( m_domInstance, _elementName, null ); } - /** creates a new element in the instance - * - * The element will be inserted immediately below the root node of the instance. - * - * @param _elementName - * the name of the to-be-created element - * @param _initialNodeValue - * the initial value to set at the node. Might be null, in this case no value is set. - * @return - * the node of the newly created element - * @throws com.sun.star.xml.dom.DOMException - */ - public XNode createElement( String _elementName, String _initialNodeValue ) throws DOMException - { - return createElement( m_domInstance, _elementName, _initialNodeValue ); - } - /** creates a new element in the instance * * The element will be inserted immediately below a given XNode. -- cgit v1.2.3 From 269da67b1a6c8dcab86335c795640cdfb9df42e9 Mon Sep 17 00:00:00 2001 From: "Oliver Craemer [oc]" Date: Tue, 22 Mar 2011 09:32:40 +0100 Subject: #i117455# check qaerrorlogs for fixed issueids --- testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc b/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc index 142e588d0079..2cc8a47568be 100644 --- a/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc +++ b/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc @@ -546,6 +546,7 @@ testcase tCreateNewLineChart FormatDataRanges printlog "Switch to tab page Data Series" Kontext + Active.SetPage TabFormatDataRangesDataRange 'Due to bug #i77237# the tabpage has to be switched once before 'OK' or 'Cancel' can be used Active.SetPage TabFormatDataRangesDataSeries Kontext "TabChartTypeDataSeries" if TabChartTypeDataSeries.Exists(2) then @@ -593,7 +594,7 @@ testcase tCreateNewLineChart if instr ( sControlString , "$A$19" ) = 0 Then warnlog "'Categories' wasn't correctly preserved after save and reload." endif - printlog "Leave tab page data series with CANCEL" + printlog "Leave tab page data series with CANCEL" TabChartTypeDataSeries.Cancel else warnlog "Tab page Data Series was not up!" -- cgit v1.2.3 From 328a271dd44dc724a90060432877fb6cf1e9a565 Mon Sep 17 00:00:00 2001 From: "Oliver Craemer [oc]" Date: Tue, 22 Mar 2011 12:09:35 +0100 Subject: #i117455# check qaerrorlogs for fixed issueids --- testautomation/chart2/tools/ch_tools_common.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testautomation/chart2/tools/ch_tools_common.inc b/testautomation/chart2/tools/ch_tools_common.inc index 0af4cad8db5d..ad9f2108f024 100644 --- a/testautomation/chart2/tools/ch_tools_common.inc +++ b/testautomation/chart2/tools/ch_tools_common.inc @@ -175,6 +175,10 @@ function fOpenTestDocumentAndSelectDataRange(sInputFile as string) as BOOLEAN WaitSlot() '///Switch to tabpage Data Range printlog "Switch to tabpage Data Range" + Kontext + 'Switching tabpages as workaround for #i77237# + Active.SetPage TabChartTypeDataSeries + QAErrorLog "#i77237#-Testtool can't access OK after switching tabpage" Active.SetPage TabChartTypeDataRange Kontext "TabChartTypeDataRange" call DialogTest ( TabChartTypeDataRange ) -- cgit v1.2.3 From 1db439d3066402ad71cd562e6cd1779ffa29f555 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 22 Mar 2011 12:48:33 +0100 Subject: fs34b: #i117492# let IntrospectionAdapter->IntrospectionAccess be a hard ref, and IntrospectionAccess->IntrospectionAdapter a weak ref. This way, we won't access a dead IntrospectionAccess when a client uses the IntrospectionAdapter after releasing the IntrospectionAccess --- stoc/source/inspect/introspection.cxx | 281 ++++++++++++++++------------------ 1 file changed, 136 insertions(+), 145 deletions(-) diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index 051ff3e2ae3c..626dfb905f2b 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -73,6 +73,7 @@ #include #include +#include #include #include @@ -87,7 +88,6 @@ using namespace com::sun::star::beans::PropertyConcept; using namespace com::sun::star::beans::MethodConcept; using namespace cppu; using namespace osl; -using namespace rtl; #define IMPLEMENTATION_NAME "com.sun.star.comp.stoc.Introspection" #define SERVICE_NAME "com.sun.star.beans.Introspection" @@ -158,7 +158,7 @@ sal_Bool isDerivedFrom( Reference xToTestClass, Reference // Hashtable fuer die Suche nach Namen struct hashName_Impl { - size_t operator()(const OUString Str) const + size_t operator()(const ::rtl::OUString Str) const { return (size_t)Str.hashCode(); } @@ -166,7 +166,7 @@ struct hashName_Impl struct eqName_Impl { - sal_Bool operator()(const OUString Str1, const OUString Str2) const + sal_Bool operator()(const ::rtl::OUString Str1, const ::rtl::OUString Str2) const { return ( Str1 == Str2 ); } @@ -174,7 +174,7 @@ struct eqName_Impl typedef std::hash_map < - OUString, + ::rtl::OUString, sal_Int32, hashName_Impl, eqName_Impl @@ -186,8 +186,8 @@ IntrospectionNameMap; // konvertierten Namen, dient zur Unterst�tzung von XExactName typedef std::hash_map < - OUString, - OUString, + ::rtl::OUString, + ::rtl::OUString, hashName_Impl, eqName_Impl > @@ -273,8 +273,8 @@ public: { delete[] mpOrgPropertyHandleArray; } - sal_Int32 getPropertyIndex( const OUString& aPropertyName ) const; - sal_Int32 getMethodIndex( const OUString& aMethodName ) const; + sal_Int32 getPropertyIndex( const ::rtl::OUString& aPropertyName ) const; + sal_Int32 getMethodIndex( const ::rtl::OUString& aMethodName ) const; void acquire() { nRefCount++; } void release() @@ -285,9 +285,9 @@ public: } // Methoden von XIntrospectionAccess (ALT, jetzt nur Impl) - void setPropertyValue(const Any& obj, const OUString& aPropertyName, const Any& aValue) const; -// void setPropertyValue(Any& obj, const OUString& aPropertyName, const Any& aValue) const; - Any getPropertyValue(const Any& obj, const OUString& aPropertyName) const; + void setPropertyValue(const Any& obj, const ::rtl::OUString& aPropertyName, const Any& aValue) const; +// void setPropertyValue(Any& obj, const ::rtl::OUString& aPropertyName, const Any& aValue) const; + Any getPropertyValue(const Any& obj, const ::rtl::OUString& aPropertyName) const; void setPropertyValueByIndex(const Any& obj, sal_Int32 nIndex, const Any& aValue) const; // void setPropertyValueByIndex(Any& obj, sal_Int32 nIndex, const Any& aValue) const; Any getPropertyValueByIndex(const Any& obj, sal_Int32 nIndex) const; @@ -331,7 +331,7 @@ IntrospectionAccessStatic_Impl::IntrospectionAccessStatic_Impl( Reference< XIdlR // Von Hand refcounten !!! -sal_Int32 IntrospectionAccessStatic_Impl::getPropertyIndex( const OUString& aPropertyName ) const +sal_Int32 IntrospectionAccessStatic_Impl::getPropertyIndex( const ::rtl::OUString& aPropertyName ) const { sal_Int32 iHashResult = -1; IntrospectionAccessStatic_Impl* pThis = (IntrospectionAccessStatic_Impl*)this; @@ -341,7 +341,7 @@ sal_Int32 IntrospectionAccessStatic_Impl::getPropertyIndex( const OUString& aPro return iHashResult; } -sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( const OUString& aMethodName ) const +sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( const ::rtl::OUString& aMethodName ) const { sal_Int32 iHashResult = -1; IntrospectionAccessStatic_Impl* pThis = (IntrospectionAccessStatic_Impl*)this; @@ -362,15 +362,15 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( const OUString& aMetho if( nFound == -1 ) break; - OUString aPureMethodName = aMethodName.copy( nFound + 1 ); + ::rtl::OUString aPureMethodName = aMethodName.copy( nFound + 1 ); aIt = pThis->maMethodNameMap.find( aPureMethodName ); if( !( aIt == pThis->maMethodNameMap.end() ) ) { // Check if it can be a type? // Problem: Does not work if package names contain _ ?! - OUString aStr = aMethodName.copy( 0, nFound ); - OUString aTypeName = aStr.replace( '_', '.' ); + ::rtl::OUString aStr = aMethodName.copy( 0, nFound ); + ::rtl::OUString aTypeName = aStr.replace( '_', '.' ); Reference< XIdlClass > xClass = mxCoreReflection->forName( aTypeName ); if( xClass.is() ) { @@ -398,8 +398,8 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( const OUString& aMetho { const Reference xMethod2 = pMethods[ i ]; - OUString aTestClassName = xMethod2->getDeclaringClass()->getName(); - OUString aTestMethodName = xMethod2->getName(); + ::rtl::OUString aTestClassName = xMethod2->getDeclaringClass()->getName(); + ::rtl::OUString aTestMethodName = xMethod2->getName(); if( xMethod2->getName() == aPureMethodName ) { @@ -427,8 +427,8 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( const OUString& aMetho return iHashResult; } -void IntrospectionAccessStatic_Impl::setPropertyValue( const Any& obj, const OUString& aPropertyName, const Any& aValue ) const -//void IntrospectionAccessStatic_Impl::setPropertyValue( Any& obj, const OUString& aPropertyName, const Any& aValue ) const +void IntrospectionAccessStatic_Impl::setPropertyValue( const Any& obj, const ::rtl::OUString& aPropertyName, const Any& aValue ) const +//void IntrospectionAccessStatic_Impl::setPropertyValue( Any& obj, const ::rtl::OUString& aPropertyName, const Any& aValue ) const { sal_Int32 i = getPropertyIndex( aPropertyName ); if( i != -1 ) @@ -476,7 +476,7 @@ void IntrospectionAccessStatic_Impl::setPropertyValueByIndex(const Any& obj, sal if( eValType == TypeClass_INTERFACE ) { Type aPropType = rProp.Type; - OUString aTypeName( aPropType.getTypeName() ); + ::rtl::OUString aTypeName( aPropType.getTypeName() ); Reference< XIdlClass > xPropClass = mxCoreReflection->forName( aTypeName ); //Reference xPropClass = rProp.Type; if( xPropClass.is() && xPropClass->getTypeClass() == TypeClass_INTERFACE ) @@ -571,7 +571,7 @@ void IntrospectionAccessStatic_Impl::setPropertyValueByIndex(const Any& obj, sal } } -Any IntrospectionAccessStatic_Impl::getPropertyValue( const Any& obj, const OUString& aPropertyName ) const +Any IntrospectionAccessStatic_Impl::getPropertyValue( const Any& obj, const ::rtl::OUString& aPropertyName ) const { sal_Int32 i = getPropertyIndex( aPropertyName ); if( i != -1 ) @@ -741,7 +741,7 @@ class ImplIntrospectionAdapter : public OWeakObject { // Parent-Objekt - ImplIntrospectionAccess* mpAccess; + ::rtl::Reference< ImplIntrospectionAccess > mpAccess; // Untersuchtes Objekt const Any& mrInspectedObject; @@ -773,17 +773,17 @@ public: // Methoden von XPropertySet virtual Reference SAL_CALL getPropertySetInfo() throw( RuntimeException ); - virtual void SAL_CALL setPropertyValue(const OUString& aPropertyName, const Any& aValue) + virtual void SAL_CALL setPropertyValue(const ::rtl::OUString& aPropertyName, const Any& aValue) throw( UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException ); - virtual Any SAL_CALL getPropertyValue(const OUString& aPropertyName) + virtual Any SAL_CALL getPropertyValue(const ::rtl::OUString& aPropertyName) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ); - virtual void SAL_CALL addPropertyChangeListener(const OUString& aPropertyName, const Reference& aListener) + virtual void SAL_CALL addPropertyChangeListener(const ::rtl::OUString& aPropertyName, const Reference& aListener) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ); - virtual void SAL_CALL removePropertyChangeListener(const OUString& aPropertyName, const Reference& aListener) + virtual void SAL_CALL removePropertyChangeListener(const ::rtl::OUString& aPropertyName, const Reference& aListener) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ); - virtual void SAL_CALL addVetoableChangeListener(const OUString& aPropertyName, const Reference& aListener) + virtual void SAL_CALL addVetoableChangeListener(const ::rtl::OUString& aPropertyName, const Reference& aListener) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ); - virtual void SAL_CALL removeVetoableChangeListener(const OUString& aPropertyName, const Reference& aListener) + virtual void SAL_CALL removeVetoableChangeListener(const ::rtl::OUString& aPropertyName, const Reference& aListener) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ); // Methoden von XFastPropertySet @@ -794,25 +794,25 @@ public: // Methoden von XPropertySetInfo virtual Sequence< Property > SAL_CALL getProperties(void) throw( RuntimeException ); - virtual Property SAL_CALL getPropertyByName(const OUString& Name) throw( RuntimeException ); - virtual sal_Bool SAL_CALL hasPropertyByName(const OUString& Name) throw( RuntimeException ); + virtual Property SAL_CALL getPropertyByName(const ::rtl::OUString& Name) throw( RuntimeException ); + virtual sal_Bool SAL_CALL hasPropertyByName(const ::rtl::OUString& Name) throw( RuntimeException ); // Methoden von XElementAccess virtual Type SAL_CALL getElementType(void) throw( RuntimeException ); virtual sal_Bool SAL_CALL hasElements(void) throw( RuntimeException ); // Methoden von XNameAccess - virtual Any SAL_CALL getByName(const OUString& Name) + virtual Any SAL_CALL getByName(const ::rtl::OUString& Name) throw( NoSuchElementException, WrappedTargetException, RuntimeException ); - virtual Sequence SAL_CALL getElementNames(void) throw( RuntimeException ); - virtual sal_Bool SAL_CALL hasByName(const OUString& Name) throw( RuntimeException ); + virtual Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( RuntimeException ); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( RuntimeException ); // Methoden von XNameContainer - virtual void SAL_CALL insertByName(const OUString& Name, const Any& Element) + virtual void SAL_CALL insertByName(const ::rtl::OUString& Name, const Any& Element) throw( IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException ); - virtual void SAL_CALL replaceByName(const OUString& Name, const Any& Element) + virtual void SAL_CALL replaceByName(const ::rtl::OUString& Name, const Any& Element) throw( IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException ); - virtual void SAL_CALL removeByName(const OUString& Name) + virtual void SAL_CALL removeByName(const ::rtl::OUString& Name) throw( NoSuchElementException, WrappedTargetException, RuntimeException ); // Methoden von XIndexAccess @@ -906,7 +906,7 @@ Any SAL_CALL ImplIntrospectionAdapter::queryInterface( const Type& rType ) // Neue Impl-Klasse im Rahmen der Introspection-Umstellung auf Instanz-gebundene // Introspection mit Property-Zugriff ueber XPropertySet. Die alte Klasse // ImplIntrospectionAccess lebt als IntrospectionAccessStatic_Impl -class ImplIntrospectionAccess : IntrospectionAccessHelper +class ImplIntrospectionAccess : public IntrospectionAccessHelper { friend class ImplIntrospection; @@ -920,7 +920,7 @@ class ImplIntrospectionAccess : IntrospectionAccessHelper IntrospectionAccessStatic_Impl* mpStaticImpl; // Adapter-Implementation - ImplIntrospectionAdapter* mpAdapter; + WeakReference< XInterface > maAdapter; // Letzte Sequence, die bei getProperties geliefert wurde (Optimierung) Sequence maLastPropertySeq; @@ -939,15 +939,15 @@ public: throw( RuntimeException ); virtual sal_Int32 SAL_CALL getSuppliedPropertyConcepts(void) throw( RuntimeException ); - virtual Property SAL_CALL getProperty(const OUString& Name, sal_Int32 PropertyConcepts) + virtual Property SAL_CALL getProperty(const ::rtl::OUString& Name, sal_Int32 PropertyConcepts) throw( NoSuchElementException, RuntimeException ); - virtual sal_Bool SAL_CALL hasProperty(const OUString& Name, sal_Int32 PropertyConcepts) + virtual sal_Bool SAL_CALL hasProperty(const ::rtl::OUString& Name, sal_Int32 PropertyConcepts) throw( RuntimeException ); virtual Sequence< Property > SAL_CALL getProperties(sal_Int32 PropertyConcepts) throw( RuntimeException ); - virtual Reference SAL_CALL getMethod(const OUString& Name, sal_Int32 MethodConcepts) + virtual Reference SAL_CALL getMethod(const ::rtl::OUString& Name, sal_Int32 MethodConcepts) throw( NoSuchMethodException, RuntimeException ); - virtual sal_Bool SAL_CALL hasMethod(const OUString& Name, sal_Int32 MethodConcepts) + virtual sal_Bool SAL_CALL hasMethod(const ::rtl::OUString& Name, sal_Int32 MethodConcepts) throw( RuntimeException ); virtual Sequence< Reference > SAL_CALL getMethods(sal_Int32 MethodConcepts) throw( RuntimeException ); @@ -961,12 +961,12 @@ public: virtual Any SAL_CALL getMaterial(void) throw(RuntimeException); // Methoden von XExactName - virtual OUString SAL_CALL getExactName( const OUString& rApproximateName ) throw( RuntimeException ); + virtual ::rtl::OUString SAL_CALL getExactName( const ::rtl::OUString& rApproximateName ) throw( RuntimeException ); }; ImplIntrospectionAccess::ImplIntrospectionAccess ( const Any& obj, IntrospectionAccessStatic_Impl* pStaticImpl_ ) - : maInspectedObject( obj ), mpStaticImpl( pStaticImpl_ ), mpAdapter( NULL ) + : maInspectedObject( obj ), mpStaticImpl( pStaticImpl_ ), maAdapter() { mpStaticImpl->acquire(); @@ -982,10 +982,6 @@ ImplIntrospectionAccess::ImplIntrospectionAccess ImplIntrospectionAccess::~ImplIntrospectionAccess() { mpStaticImpl->release(); - - // Eigene Referenz loslassen - if (mpAdapter) - mpAdapter->release(); } @@ -1000,19 +996,19 @@ Reference ImplIntrospectionAdapter::getPropertySetInfo(void) return (XPropertySetInfo *)this; } -void ImplIntrospectionAdapter::setPropertyValue(const OUString& aPropertyName, const Any& aValue) +void ImplIntrospectionAdapter::setPropertyValue(const ::rtl::OUString& aPropertyName, const Any& aValue) throw( UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException ) { mpStaticImpl->setPropertyValue( mrInspectedObject, aPropertyName, aValue ); } -Any ImplIntrospectionAdapter::getPropertyValue(const OUString& aPropertyName) +Any ImplIntrospectionAdapter::getPropertyValue(const ::rtl::OUString& aPropertyName) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { return mpStaticImpl->getPropertyValue( mrInspectedObject, aPropertyName ); } -void ImplIntrospectionAdapter::addPropertyChangeListener(const OUString& aPropertyName, const Reference& aListener) +void ImplIntrospectionAdapter::addPropertyChangeListener(const ::rtl::OUString& aPropertyName, const Reference& aListener) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { if( mxIface.is() ) @@ -1025,7 +1021,7 @@ void ImplIntrospectionAdapter::addPropertyChangeListener(const OUString& aProper } } -void ImplIntrospectionAdapter::removePropertyChangeListener(const OUString& aPropertyName, const Reference& aListener) +void ImplIntrospectionAdapter::removePropertyChangeListener(const ::rtl::OUString& aPropertyName, const Reference& aListener) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { if( mxIface.is() ) @@ -1038,7 +1034,7 @@ void ImplIntrospectionAdapter::removePropertyChangeListener(const OUString& aPro } } -void ImplIntrospectionAdapter::addVetoableChangeListener(const OUString& aPropertyName, const Reference& aListener) +void ImplIntrospectionAdapter::addVetoableChangeListener(const ::rtl::OUString& aPropertyName, const Reference& aListener) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { if( mxIface.is() ) @@ -1051,7 +1047,7 @@ void ImplIntrospectionAdapter::addVetoableChangeListener(const OUString& aProper } } -void ImplIntrospectionAdapter::removeVetoableChangeListener(const OUString& aPropertyName, const Reference& aListener) +void ImplIntrospectionAdapter::removeVetoableChangeListener(const ::rtl::OUString& aPropertyName, const Reference& aListener) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) { if( mxIface.is() ) @@ -1082,13 +1078,13 @@ Sequence< Property > ImplIntrospectionAdapter::getProperties(void) throw( Runtim return mpStaticImpl->getProperties(); } -Property ImplIntrospectionAdapter::getPropertyByName(const OUString& Name) +Property ImplIntrospectionAdapter::getPropertyByName(const ::rtl::OUString& Name) throw( RuntimeException ) { return mpAccess->getProperty( Name, PropertyConcept::ALL ); } -sal_Bool ImplIntrospectionAdapter::hasPropertyByName(const OUString& Name) +sal_Bool ImplIntrospectionAdapter::hasPropertyByName(const ::rtl::OUString& Name) throw( RuntimeException ) { return mpAccess->hasProperty( Name, PropertyConcept::ALL ); @@ -1106,38 +1102,38 @@ sal_Bool ImplIntrospectionAdapter::hasElements(void) throw( RuntimeException ) } // Methoden von XNameAccess -Any ImplIntrospectionAdapter::getByName(const OUString& Name) +Any ImplIntrospectionAdapter::getByName(const ::rtl::OUString& Name) throw( NoSuchElementException, WrappedTargetException, RuntimeException ) { return mxObjNameAccess->getByName( Name ); } -Sequence< OUString > ImplIntrospectionAdapter::getElementNames(void) +Sequence< ::rtl::OUString > ImplIntrospectionAdapter::getElementNames(void) throw( RuntimeException ) { return mxObjNameAccess->getElementNames(); } -sal_Bool ImplIntrospectionAdapter::hasByName(const OUString& Name) +sal_Bool ImplIntrospectionAdapter::hasByName(const ::rtl::OUString& Name) throw( RuntimeException ) { return mxObjNameAccess->hasByName( Name ); } // Methoden von XNameContainer -void ImplIntrospectionAdapter::insertByName(const OUString& Name, const Any& Element) +void ImplIntrospectionAdapter::insertByName(const ::rtl::OUString& Name, const Any& Element) throw( IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException ) { mxObjNameContainer->insertByName( Name, Element ); } -void ImplIntrospectionAdapter::replaceByName(const OUString& Name, const Any& Element) +void ImplIntrospectionAdapter::replaceByName(const ::rtl::OUString& Name, const Any& Element) throw( IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException ) { mxObjNameContainer->replaceByName( Name, Element ); } -void ImplIntrospectionAdapter::removeByName(const OUString& Name) +void ImplIntrospectionAdapter::removeByName(const ::rtl::OUString& Name) throw( NoSuchElementException, WrappedTargetException, RuntimeException ) { mxObjNameContainer->removeByName( Name ); @@ -1233,7 +1229,7 @@ sal_Int32 ImplIntrospectionAccess::getSuppliedPropertyConcepts(void) METHODS; } -Property ImplIntrospectionAccess::getProperty(const OUString& Name, sal_Int32 PropertyConcepts) +Property ImplIntrospectionAccess::getProperty(const ::rtl::OUString& Name, sal_Int32 PropertyConcepts) throw( NoSuchElementException, RuntimeException ) { Property aRet; @@ -1254,7 +1250,7 @@ Property ImplIntrospectionAccess::getProperty(const OUString& Name, sal_Int32 Pr return aRet; } -sal_Bool ImplIntrospectionAccess::hasProperty(const OUString& Name, sal_Int32 PropertyConcepts) +sal_Bool ImplIntrospectionAccess::hasProperty(const ::rtl::OUString& Name, sal_Int32 PropertyConcepts) throw( RuntimeException ) { sal_Int32 i = mpStaticImpl->getPropertyIndex( Name ); @@ -1319,7 +1315,7 @@ Sequence< Property > ImplIntrospectionAccess::getProperties(sal_Int32 PropertyCo /* // Property mit Concepts ausgeben - OUString aPropName = pSourceProps[ i ].Name; + ::rtl::OUString aPropName = pSourceProps[ i ].Name; String aNameStr = OOUStringToString(aPropName, CHARSET_SYSTEM); String ConceptStr; if( nConcept & PROPERTYSET ) @@ -1339,7 +1335,7 @@ Sequence< Property > ImplIntrospectionAccess::getProperties(sal_Int32 PropertyCo return maLastPropertySeq; } -Reference ImplIntrospectionAccess::getMethod(const OUString& Name, sal_Int32 MethodConcepts) +Reference ImplIntrospectionAccess::getMethod(const ::rtl::OUString& Name, sal_Int32 MethodConcepts) throw( NoSuchMethodException, RuntimeException ) { Reference xRet; @@ -1359,7 +1355,7 @@ Reference ImplIntrospectionAccess::getMethod(const OUString& Name, s return xRet; } -sal_Bool ImplIntrospectionAccess::hasMethod(const OUString& Name, sal_Int32 MethodConcepts) +sal_Bool ImplIntrospectionAccess::hasMethod(const ::rtl::OUString& Name, sal_Int32 MethodConcepts) throw( RuntimeException ) { sal_Int32 i = mpStaticImpl->getMethodIndex( Name ); @@ -1463,20 +1459,15 @@ Reference SAL_CALL ImplIntrospectionAccess::queryAdapter( const Type throw( IllegalTypeException, RuntimeException ) { // Gibt es schon einen Adapter? - if( !mpAdapter ) + Reference< XInterface > xAdapter( maAdapter ); + if( !xAdapter.is() ) { - ((ImplIntrospectionAccess*)this)->mpAdapter = - new ImplIntrospectionAdapter( this, maInspectedObject, mpStaticImpl ); - - // Selbst eine Referenz halten - mpAdapter->acquire(); + xAdapter = *( new ImplIntrospectionAdapter( this, maInspectedObject, mpStaticImpl ) ); + maAdapter = xAdapter; } Reference xRet; - Any aIfaceAny( mpAdapter->queryInterface( rType ) ); - if( aIfaceAny.hasValue() ) - xRet = *(Reference*)aIfaceAny.getValue(); - + xAdapter->queryInterface( rType ) >>= xRet; return xRet; } @@ -1486,20 +1477,20 @@ Any ImplIntrospectionAccess::getMaterial(void) throw(RuntimeException) return maInspectedObject; } -// Hilfs-Funktion zur LowerCase-Wandlung eines OUString -OUString toLower( OUString aUStr ) +// Hilfs-Funktion zur LowerCase-Wandlung eines ::rtl::OUString +::rtl::OUString toLower( ::rtl::OUString aUStr ) { // Tabelle fuer XExactName pflegen ::rtl::OUString aOWStr( aUStr.getStr() ); ::rtl::OUString aOWLowerStr = aOWStr.toAsciiLowerCase(); - OUString aLowerUStr( aOWLowerStr.getStr() ); + ::rtl::OUString aLowerUStr( aOWLowerStr.getStr() ); return aLowerUStr; } // Methoden von XExactName -OUString ImplIntrospectionAccess::getExactName( const OUString& rApproximateName ) throw( RuntimeException ) +::rtl::OUString ImplIntrospectionAccess::getExactName( const ::rtl::OUString& rApproximateName ) throw( RuntimeException ) { - OUString aRetStr; + ::rtl::OUString aRetStr; LowerToExactNameMap::iterator aIt = mpStaticImpl->maLowerToExactNameMap.find( toLower( rApproximateName ) ); if( !( aIt == mpStaticImpl->maLowerToExactNameMap.end() ) ) @@ -1750,11 +1741,11 @@ public: Sequence SAL_CALL getImplementationId( ) throw( RuntimeException ); // XServiceInfo - OUString SAL_CALL getImplementationName() throw(); - sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw(); - Sequence< OUString > SAL_CALL getSupportedServiceNames(void) throw(); - static OUString SAL_CALL getImplementationName_Static( ); - static Sequence< OUString > SAL_CALL getSupportedServiceNames_Static(void) throw(); + ::rtl::OUString SAL_CALL getImplementationName() throw(); + sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw(); + Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw(); + static ::rtl::OUString SAL_CALL getImplementationName_Static( ); + static Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_Static(void) throw(); // Methoden von XIntrospection virtual Reference SAL_CALL inspect(const Any& aToInspectObj) @@ -1787,7 +1778,7 @@ ImplIntrospection::ImplIntrospection( const Reference & rX #endif // Spezielle Klassen holen -// Reference< XInterface > xServiceIface = m_xSMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.CoreReflection")) ); +// Reference< XInterface > xServiceIface = m_xSMgr->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.CoreReflection")) ); // if( xServiceIface.is() ) // mxCoreReflection = Reference< XIdlReflection >::query( xServiceIface ); Reference< XPropertySet > xProps( rXSMgr, UNO_QUERY ); @@ -1796,30 +1787,30 @@ ImplIntrospection::ImplIntrospection( const Reference & rX { Reference< XComponentContext > xContext; xProps->getPropertyValue( - OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xContext; + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xContext; OSL_ASSERT( xContext.is() ); if (xContext.is()) { xContext->getValueByName( - OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theCoreReflection") ) ) >>= mxCoreReflection; + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theCoreReflection") ) ) >>= mxCoreReflection; OSL_ENSURE( mxCoreReflection.is(), "### CoreReflection singleton not accessible!?" ); } } if (! mxCoreReflection.is()) { throw DeploymentException( - OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theCoreReflection singleton not accessible") ), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theCoreReflection singleton not accessible") ), Reference< XInterface >() ); } - mxElementAccessClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XElementAccess")) ); - mxNameContainerClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XNameContainer")) ); - mxNameAccessClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XNameAccess")) ); - mxIndexContainerClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XIndexContainer")) ); - mxIndexAccessClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XIndexAccess")) ); - mxEnumerationAccessClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XEnumerationAccess")) ); - mxInterfaceClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface")) ); - mxAggregationClass = mxCoreReflection->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XAggregation")) ); + mxElementAccessClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XElementAccess")) ); + mxNameContainerClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XNameContainer")) ); + mxNameAccessClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XNameAccess")) ); + mxIndexContainerClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XIndexContainer")) ); + mxIndexAccessClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XIndexAccess")) ); + mxEnumerationAccessClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.XEnumerationAccess")) ); + mxInterfaceClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface")) ); + mxAggregationClass = mxCoreReflection->forName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XAggregation")) ); mbDisposed = sal_False; } @@ -1900,16 +1891,16 @@ Sequence< sal_Int8 > ImplIntrospection::getImplementationId() // XServiceInfo -OUString ImplIntrospection::getImplementationName() throw() +::rtl::OUString ImplIntrospection::getImplementationName() throw() { return getImplementationName_Static(); } // XServiceInfo -sal_Bool ImplIntrospection::supportsService(const OUString& ServiceName) throw() +sal_Bool ImplIntrospection::supportsService(const ::rtl::OUString& ServiceName) throw() { - Sequence< OUString > aSNL = getSupportedServiceNames(); - const OUString * pArray = aSNL.getConstArray(); + Sequence< ::rtl::OUString > aSNL = getSupportedServiceNames(); + const ::rtl::OUString * pArray = aSNL.getConstArray(); for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) if( pArray[i] == ServiceName ) return sal_True; @@ -1917,23 +1908,23 @@ sal_Bool ImplIntrospection::supportsService(const OUString& ServiceName) throw() } // XServiceInfo -Sequence< OUString > ImplIntrospection::getSupportedServiceNames(void) throw() +Sequence< ::rtl::OUString > ImplIntrospection::getSupportedServiceNames(void) throw() { return getSupportedServiceNames_Static(); } //************************************************************************* // Helper XServiceInfo -OUString ImplIntrospection::getImplementationName_Static( ) +::rtl::OUString ImplIntrospection::getImplementationName_Static( ) { - return OUString::createFromAscii( IMPLEMENTATION_NAME ); + return ::rtl::OUString::createFromAscii( IMPLEMENTATION_NAME ); } // ORegistryServiceManager_Static -Sequence< OUString > ImplIntrospection::getSupportedServiceNames_Static(void) throw() +Sequence< ::rtl::OUString > ImplIntrospection::getSupportedServiceNames_Static(void) throw() { - Sequence< OUString > aSNS( 1 ); - aSNS.getArray()[0] = OUString::createFromAscii( SERVICE_NAME ); + Sequence< ::rtl::OUString > aSNS( 1 ); + aSNS.getArray()[0] = ::rtl::OUString::createFromAscii( SERVICE_NAME ); return aSNS; } @@ -2013,10 +2004,10 @@ Reference TypeToIdlClass( const Type& rType, const Reference< XMultiS rType.getDescription( &pTD ); if( pTD ) { - OUString sOWName( pTD->pTypeName ); + ::rtl::OUString sOWName( pTD->pTypeName ); if( !xRefl.is() ) { - xRefl = Reference< XIdlReflection >( xMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.CoreReflection")) ), UNO_QUERY ); + xRefl = Reference< XIdlReflection >( xMgr->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.CoreReflection")) ), UNO_QUERY ); OSL_ENSURE( xRefl.is(), "### no corereflection!" ); } xRetClass = xRefl->forName( sOWName ); @@ -2302,7 +2293,7 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns pAccess->mnPropertySetPropCount++; // Namen in Hashtable eintragen, wenn nicht schon bekannt - OUString aPropName = rProp.Name; + ::rtl::OUString aPropName = rProp.Name; // Haben wir den Namen schon? IntrospectionNameMap::iterator aIt = rPropNameMap.find( aPropName ); @@ -2317,9 +2308,9 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns else { OSL_ENSURE( sal_False, - OString( "Introspection: Property \"" ) + - OUStringToOString( aPropName, RTL_TEXTENCODING_ASCII_US ) + - OString( "\" found more than once in PropertySet" ) ); + ::rtl::OString( "Introspection: Property \"" ) + + ::rtl::OUStringToOString( aPropName, RTL_TEXTENCODING_ASCII_US ) + + ::rtl::OString( "\" found more than once in PropertySet" ) ); } // Count pflegen @@ -2404,7 +2395,7 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns // In eigenes Property-Array eintragen Property& rProp = pAllPropArray[ rPropCount ]; - OUString aFieldName = xField->getName(); + ::rtl::OUString aFieldName = xField->getName(); rProp.Name = aFieldName; rProp.Handle = rPropCount; Type aFieldType( xPropType->getTypeClass(), xPropType->getName() ); @@ -2415,7 +2406,7 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns ? READONLY : 0; // Namen in Hashtable eintragen - OUString aPropName = rProp.Name; + ::rtl::OUString aPropName = rProp.Name; // Haben wir den Namen schon? IntrospectionNameMap::iterator aIt = rPropNameMap.find( aPropName ); @@ -2475,9 +2466,9 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns pLocalMethodConcepts[ i ] = 0; } - OUString aMethName; - OUString aPropName; - OUString aStartStr; + ::rtl::OUString aMethName; + ::rtl::OUString aPropName; + ::rtl::OUString aStartStr; for( i = 0 ; i < nSourceMethodCount ; i++ ) { // Methode ansprechen @@ -2502,7 +2493,7 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns } else { - if( aMethName != OUString( RTL_CONSTASCII_USTRINGPARAM("queryInterface")) ) + if( aMethName != ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("queryInterface")) ) { rMethodConcept_i |= MethodConcept::DANGEROUS; continue; @@ -2511,7 +2502,7 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns } else if( rxMethod_i->getDeclaringClass()->equals( mxAggregationClass ) ) { - if( aMethName == OUString( RTL_CONSTASCII_USTRINGPARAM("setDelegator")) ) + if( aMethName == ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("setDelegator")) ) { rMethodConcept_i |= MethodConcept::DANGEROUS; continue; @@ -2544,7 +2535,7 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns // Ist es eine get-Methode? aStartStr = aMethName.copy( 0, 3 ); - if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("get")) ) + if( aStartStr == ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("get")) ) { // Namen der potentiellen Property aPropName = aMethName.copy( 3 ); @@ -2614,15 +2605,15 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns continue; // Name holen und auswerten - OUString aMethName2 = rxMethod_k->getName(); - OUString aStartStr2 = aMethName2.copy( 0, 3 ); - // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! - if( !( aStartStr2 == OUString( RTL_CONSTASCII_USTRINGPARAM("set")) ) ) + ::rtl::OUString aMethName2 = rxMethod_k->getName(); + ::rtl::OUString aStartStr2 = aMethName2.copy( 0, 3 ); + // ACHTUNG: Wegen SDL-Bug NICHT != bei ::rtl::OUString verwenden !!! + if( !( aStartStr2 == ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("set")) ) ) continue; // Ist es denn der gleiche Name? - OUString aPropName2 = aMethName2.copy( 3 ); - // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! + ::rtl::OUString aPropName2 = aMethName2.copy( 3 ); + // ACHTUNG: Wegen SDL-Bug NICHT != bei ::rtl::OUString verwenden !!! if( !( aPropName == aPropName2 ) ) continue; @@ -2665,22 +2656,22 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns } // Ist es eine addListener-Methode? - else if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("add")) ) + else if( aStartStr == ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("add")) ) { - OUString aListenerStr( RTL_CONSTASCII_USTRINGPARAM("Listener" ) ); + ::rtl::OUString aListenerStr( RTL_CONSTASCII_USTRINGPARAM("Listener" ) ); // Namen der potentiellen Property sal_Int32 nStrLen = aMethName.getLength(); sal_Int32 nCopyLen = nStrLen - aListenerStr.getLength(); - OUString aEndStr = aMethName.copy( nCopyLen > 0 ? nCopyLen : 0 ); + ::rtl::OUString aEndStr = aMethName.copy( nCopyLen > 0 ? nCopyLen : 0 ); // Endet das Teil auf Listener? - // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! + // ACHTUNG: Wegen SDL-Bug NICHT != bei ::rtl::OUString verwenden !!! if( !( aEndStr == aListenerStr ) ) continue; // Welcher Listener? - OUString aListenerName = aMethName.copy( 3, nStrLen - aListenerStr.getLength() - 3 ); + ::rtl::OUString aListenerName = aMethName.copy( 3, nStrLen - aListenerStr.getLength() - 3 ); // TODO: Hier koennten noch genauere Pruefungen vorgenommen werden // - Rueckgabe-Typ @@ -2699,21 +2690,21 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns continue; // Name holen und auswerten - OUString aMethName2 = rxMethod_k->getName(); + ::rtl::OUString aMethName2 = rxMethod_k->getName(); sal_Int32 nNameLen = aMethName2.getLength(); sal_Int32 nCopyLen2 = (nNameLen < 6) ? nNameLen : 6; - OUString aStartStr2 = aMethName2.copy( 0, nCopyLen2 ); - OUString aRemoveStr( RTL_CONSTASCII_USTRINGPARAM("remove" ) ); - // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! + ::rtl::OUString aStartStr2 = aMethName2.copy( 0, nCopyLen2 ); + ::rtl::OUString aRemoveStr( RTL_CONSTASCII_USTRINGPARAM("remove" ) ); + // ACHTUNG: Wegen SDL-Bug NICHT != bei ::rtl::OUString verwenden !!! if( !( aStartStr2 == aRemoveStr ) ) continue; // Ist es denn der gleiche Listener? if( aMethName2.getLength() - aRemoveStr.getLength() <= aListenerStr.getLength() ) continue; - OUString aListenerName2 = aMethName2.copy + ::rtl::OUString aListenerName2 = aMethName2.copy ( 6, aMethName2.getLength() - aRemoveStr.getLength() - aListenerStr.getLength() ); - // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! + // ACHTUNG: Wegen SDL-Bug NICHT != bei ::rtl::OUString verwenden !!! if( !( aListenerName == aListenerName2 ) ) continue; @@ -2754,7 +2745,7 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns // Ist es eine set-Methode ohne zugehoerige get-Methode? aStartStr = aMethName.copy( 0, 3 ); - if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("set")) ) + if( aStartStr == ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("set")) ) { // Namen der potentiellen Property aPropName = aMethName.copy( 3 ); @@ -2862,7 +2853,7 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns const Reference& rxMethod = pSourceMethods[i]; // Namen in Hashtable eintragen, wenn nicht schon bekannt - OUString aMethName2 = rxMethod->getName(); + ::rtl::OUString aMethName2 = rxMethod->getName(); IntrospectionNameMap::iterator aIt = rMethodNameMap.find( aMethName2 ); if( aIt == rMethodNameMap.end() ) { @@ -2998,7 +2989,7 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns { Reference xField = pFields[i]; Reference xPropType = xField->getType(); - OUString aPropName = xField->getName(); + ::rtl::OUString aPropName = xField->getName(); // Ist die PropertySequence gross genug? pAccess->checkPropertyArraysSize @@ -3073,7 +3064,7 @@ void * SAL_CALL component_getFactory( { Reference< XSingleServiceFactory > xFactory( createOneInstanceFactory( reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), - OUString::createFromAscii( pImplName ), + ::rtl::OUString::createFromAscii( pImplName ), stoc_inspect::ImplIntrospection_CreateInstance, stoc_inspect::ImplIntrospection::getSupportedServiceNames_Static() ) ); -- cgit v1.2.3 From 8da1858b9454d955701607559a702eb89089ea61 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 22 Mar 2011 13:00:38 +0100 Subject: gridfixes: #i117398# cleaned up the row selection API - made explicit that it is about row selection, leaving room for a future selection of columns - some changes for consistency - do not derive XGridControl from XGrid(Row)Selection, those two are orthogonal - published involved UNO types --- .../com/sun/star/awt/grid/GridSelectionEvent.idl | 29 ++---- .../com/sun/star/awt/grid/SelectionEventType.idl | 66 ------------ offapi/com/sun/star/awt/grid/UnoControlGrid.idl | 18 ++-- offapi/com/sun/star/awt/grid/XGridControl.idl | 4 +- offapi/com/sun/star/awt/grid/XGridRowSelection.idl | 112 +++++++++++++++++++++ offapi/com/sun/star/awt/grid/XGridSelection.idl | 107 -------------------- .../sun/star/awt/grid/XGridSelectionListener.idl | 7 +- offapi/com/sun/star/awt/grid/makefile.mk | 3 +- 8 files changed, 136 insertions(+), 210 deletions(-) delete mode 100644 offapi/com/sun/star/awt/grid/SelectionEventType.idl create mode 100644 offapi/com/sun/star/awt/grid/XGridRowSelection.idl delete mode 100644 offapi/com/sun/star/awt/grid/XGridSelection.idl diff --git a/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl index e9b87c2fe7ed..9ff468f5697e 100644 --- a/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl +++ b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl @@ -31,37 +31,26 @@ #include #endif -#ifndef __com_sun_star_awt_grid_SelectionEventType_idl__ -#include -#endif - //============================================================================= module com { module sun { module star { module awt { module grid { //============================================================================= -/** An event used by a XGridControl to notify changes in the selection. +/** An event used by a XGridControl to notify changes in its row selection. - @see XGridControl + @see XGridRowSelection @see XGridSelectionListener */ -struct GridSelectionEvent: com::sun::star::lang::EventObject +published struct GridSelectionEvent: com::sun::star::lang::EventObject { - //------------------------------------------------------------------------- - - /** the selected row*/ - long Row; - - /** the selected column*/ - long Column; - - /**number of selected rows, if multiple rows selected*/ - long Range; - - /** Contains the action SelectionEventType that was performed **/ - SelectionEventType Action; + /** denotes the indexes of the rows being selected at the time the event was fired. + */ + sequence< long > SelectedRowIndexes; + /** denotes the indexes of the columns being selected at the time the event was fired. + */ + sequence< long > SelectedColumnIndexes; }; //============================================================================= diff --git a/offapi/com/sun/star/awt/grid/SelectionEventType.idl b/offapi/com/sun/star/awt/grid/SelectionEventType.idl deleted file mode 100644 index c7ee61498cc3..000000000000 --- a/offapi/com/sun/star/awt/grid/SelectionEventType.idl +++ /dev/null @@ -1,66 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef __com_sun_star_awt_grid_SelectionEventType_idl__ -#define __com_sun_star_awt_grid_SelectionEventType_idl__ - - -//============================================================================= - -module com { module sun { module star { module awt { module grid { - -//============================================================================= - -/** specifies the type of a selection event, as used by - GridSelectionEvent. - */ -enum SelectionEventType -{ - //------------------------------------------------------------------------- - - /** This value indicates that a selection was added to the grid control - */ - ADD, - - //------------------------------------------------------------------------- - - /** This value indicates that a selection was removed from the grid control - */ - REMOVE, - - //------------------------------------------------------------------------- - - /** This value indicates that a selection was changed - */ - CHANGE - -}; - -//============================================================================= - -}; }; }; }; }; - -#endif diff --git a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl index 542c27085dcb..bdd4d175d564 100644 --- a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl +++ b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl @@ -35,6 +35,10 @@ #include #endif +#ifndef __com_sun_star_awt_grid_XGridRowSelection_idl__ +#include +#endif + //============================================================================= module com { module sun { module star { module awt { module grid { @@ -45,12 +49,12 @@ /** A control that displays a set of tabular data. -

The Column Model

+

The horizontal structure of the grid is defined by the XGridColumnModel implemented in DefaultGridColumnModel The XGridColumn implemented in describes the properties and behavior of a single column. Use the XGridColumnModel::addColumn() to add a column to the column model.

-

+

The Data Model

All row data are stored in the XGridDataModel. Use the DefaultGridDataModel to add XGridDataModel::addRow() or remove XGridDataModel::removeRow() rows. @@ -61,18 +65,18 @@

Selection

If you are interested in knowing when the selection changes implement a XGridSelectionListener and add the instance with the method - XGridSelection::addSelectionListener(). - You than will be notified for any selection change. + XGridRowSelection::addSelectionListener(). + You than will be notified for any selection change.

- The XGridSelection interface provides a bunch of methods to set and get selection for the grid control. -

@since OOo 3.3.0 */ service UnoControlGrid { service com::sun::star::awt::UnoControl; - interface com::sun::star::awt::grid::XGridControl; + interface ::com::sun::star::awt::grid::XGridControl; + + interface ::com::sun::star::awt::grid::XGridRowSelection; }; //============================================================================= diff --git a/offapi/com/sun/star/awt/grid/XGridControl.idl b/offapi/com/sun/star/awt/grid/XGridControl.idl index 3c2c3d241528..4114ca685187 100644 --- a/offapi/com/sun/star/awt/grid/XGridControl.idl +++ b/offapi/com/sun/star/awt/grid/XGridControl.idl @@ -27,8 +27,6 @@ #ifndef __com_sun_star_awt_grid_XGridControl_idl__ #define __com_sun_star_awt_grid_XGridControl_idl__ -#include - //============================================================================= module com { module sun { module star { module awt { module grid { @@ -41,7 +39,7 @@ module com { module sun { module star { module awt { module grid { @since OOo 3.3.0 */ -interface XGridControl : XGridSelection +published interface XGridControl { /** retrieves the column which a given point belongs to diff --git a/offapi/com/sun/star/awt/grid/XGridRowSelection.idl b/offapi/com/sun/star/awt/grid/XGridRowSelection.idl new file mode 100644 index 000000000000..7dd4903ef218 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/XGridRowSelection.idl @@ -0,0 +1,112 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_awt_grid_XGridSelection_idl__ +#define __com_sun_star_awt_grid_XGridSelection_idl__ + +#include +#include + +//============================================================================= + +module com { module sun { module star { module awt { module grid { + +//============================================================================= + +/** This interfaces provides access to the selection of row for UnoControlGrid. + + @since OpenOffice.org 3.4 + */ +published interface XGridRowSelection +{ + /** Selects all rows. + */ + void selectAllRows(); + + /** selects a given row + + @param RowIndex + denotes the index of the row to select + + @raises ::com::sun::star::lang::IndexOutOfBoundsException + if RowIndex does not denote a valid row index + */ + void selectRow( [in] long RowIndex ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** Deselects all selected rows. + */ + void deselectAllRows(); + + /** removes the selection for a given row + + @param RowIndex + denotes the index of the row to deselect + */ + void deselectRow( [in] long RowIndex ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** Returns the indicies of all selected rows. + @returns + a sequence of indicies. + */ + sequence< long > getSelectedRows(); + + /** Returns whether rows are selected. + @returns + if and only if at least one row is selected. + */ + boolean hasSelectedRows(); + + /** Returns whether a specific row is selected. + + @param RowIndex + the index of a row. If the value does not denote a valid row index, i.e. is smaller than 0 + or greater than the number of rows, this is silently ignored, and is returned. + + @returns + if and only if there is a row with the given index, and it is selected currently. + */ + boolean isRowSelected( [in] long RowIndex ); + + /** Adds a listener for the GridSelectionEvent posted after the grid changes. + @param listener + the listener to add. + */ + void addSelectionListener( [in] XGridSelectionListener listener); + + /** Removes a listener previously added with addSelectionListener(). + @param listener + the listener to remove. + */ + void removeSelectionListener( [in] XGridSelectionListener listener); +}; + +//============================================================================= + +}; }; }; }; }; + +#endif diff --git a/offapi/com/sun/star/awt/grid/XGridSelection.idl b/offapi/com/sun/star/awt/grid/XGridSelection.idl deleted file mode 100644 index aa7fd5e42b4b..000000000000 --- a/offapi/com/sun/star/awt/grid/XGridSelection.idl +++ /dev/null @@ -1,107 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef __com_sun_star_awt_grid_XGridSelection_idl__ -#define __com_sun_star_awt_grid_XGridSelection_idl__ - -#include -#include -#include - -//============================================================================= - -module com { module sun { module star { module awt { module grid { - -//============================================================================= - -/** This interfaces provides access to the selection of row for UnoControlGrid. - */ -interface XGridSelection -{ - /** Selects all rows. - */ - void selectAllRows(); - - /** selects a given row - - @param RowIndex - denotes the index of the row to select - */ - void selectRow( [in] long RowIndex ); - - /** Deselects all selected rows. - */ - void deselectAllRows(); - - /** removes the selection for a given row - - @param RowIndex - denotes the index of the row to deselect - */ - void deselectRow( [in] long RowIndex ); - - /** Returns the indicies of all selected rows. - @returns - a sequence of indicies. - */ - sequence< long > getSelection(); - - /** Returns whether rows are selected. - @returns - if rows are selected otherwise . - */ - boolean isSelectionEmpty(); - - /** Returns whether a specific row is selected. - @param - the index of a row. - @returns - if row are selected otherwise . - */ - boolean isSelectedIndex( [in] long index); - - /** Adds a listener for the GridSelectionEvent posted after the grid changes. - @param listener - the listener to add. - */ - void addSelectionListener( [in] XGridSelectionListener listener); - - //------------------------------------------------------------------------- - - /** Removes a listener previously added with addSelectionListener(). - @param listener - the listener to remove. - */ - void removeSelectionListener( [in] XGridSelectionListener listener); - - -}; - -//============================================================================= - -}; }; }; }; }; - -#endif diff --git a/offapi/com/sun/star/awt/grid/XGridSelectionListener.idl b/offapi/com/sun/star/awt/grid/XGridSelectionListener.idl index 61e8d3050b0d..61f36c267dae 100644 --- a/offapi/com/sun/star/awt/grid/XGridSelectionListener.idl +++ b/offapi/com/sun/star/awt/grid/XGridSelectionListener.idl @@ -41,13 +41,10 @@ module com { module sun { module star { module awt { module grid { //============================================================================= -/** An instance of this interface is used by the XGridSelection to +/** An instance of this interface is used by the XGridRowSelection to get notifications about selection changes. - -

Usually you must not implement this interface yourself, but you must notify it correctly if - you implement the XGridSelection yourself

. */ -interface XGridSelectionListener: com::sun::star::lang::XEventListener +published interface XGridSelectionListener: com::sun::star::lang::XEventListener { //------------------------------------------------------------------------- /** Invoked after a selection was changed. diff --git a/offapi/com/sun/star/awt/grid/makefile.mk b/offapi/com/sun/star/awt/grid/makefile.mk index 8499dca27d82..67a566edcdce 100644 --- a/offapi/com/sun/star/awt/grid/makefile.mk +++ b/offapi/com/sun/star/awt/grid/makefile.mk @@ -40,10 +40,9 @@ PACKAGE=com$/sun$/star$/awt$/grid IDLFILES=\ GridColumnEvent.idl\ GridDataEvent.idl\ - SelectionEventType.idl\ GridSelectionEvent.idl\ XGridSelectionListener.idl\ - XGridSelection.idl\ + XGridRowSelection.idl\ XGridColumn.idl\ XGridColumnListener.idl\ XGridDataListener.idl\ -- cgit v1.2.3 From 3dfbdaed02754e90958648967100a06f9a311b3b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 22 Mar 2011 13:00:38 +0100 Subject: gridfixes: #i117398# cleaned up the row selection API - made explicit that it is about row selection, leaving room for a future selection of columns - some changes for consistency - do not derive XGridControl from XGrid(Row)Selection, those two are orthogonal - published involved UNO types --- svtools/source/uno/svtxgridcontrol.cxx | 133 ++++++++++++++------------- svtools/source/uno/svtxgridcontrol.hxx | 35 ++++--- toolkit/source/controls/grid/gridcontrol.cxx | 28 +++--- toolkit/source/controls/grid/gridcontrol.hxx | 18 ++-- 4 files changed, 108 insertions(+), 106 deletions(-) mode change 100644 => 100755 svtools/source/uno/svtxgridcontrol.hxx diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index 61ff74fd3f0a..5f28db28b478 100644 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -48,21 +48,46 @@ #include #include -using namespace ::svt::table; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::awt::grid; -using namespace ::com::sun::star::view; -using namespace ::com::sun::star::style; -using namespace ::com::sun::star::container; -using namespace ::com::sun::star::accessibility; - +/** === begin UNO using === **/ +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Exception; +using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::uno::UNO_QUERY_THROW; +using ::com::sun::star::uno::Any; +using ::com::sun::star::uno::makeAny; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::awt::grid::XGridSelectionListener; +using ::com::sun::star::style::VerticalAlignment; +using ::com::sun::star::style::VerticalAlignment_TOP; +using ::com::sun::star::view::SelectionType; +using ::com::sun::star::view::SelectionType_NONE; +using ::com::sun::star::view::SelectionType_RANGE; +using ::com::sun::star::view::SelectionType_SINGLE; +using ::com::sun::star::view::SelectionType_MULTI; +using ::com::sun::star::awt::grid::XGridDataModel; +using ::com::sun::star::awt::grid::GridInvalidDataException; +using ::com::sun::star::lang::EventObject; +using ::com::sun::star::lang::IndexOutOfBoundsException; +using ::com::sun::star::awt::grid::XGridColumnModel; +using ::com::sun::star::awt::grid::GridSelectionEvent; +using ::com::sun::star::awt::grid::XGridColumn; +using ::com::sun::star::container::ContainerEvent; +using ::com::sun::star::awt::grid::GridDataEvent; +using ::com::sun::star::awt::grid::GridInvalidModelException; +/** === end UNO using === **/ + +namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId; +namespace AccessibleStateType = ::com::sun::star::accessibility::AccessibleStateType; + +using ::svt::table::TableControl; + +typedef ::com::sun::star::util::Color UnoColor; +// --------------------------------------------------------------------------------------------------------------------- SVTXGridControl::SVTXGridControl() :m_pTableModel( new UnoControlTableModel() ) - ,m_bHasColumnHeaders( false ) - ,m_bHasRowHeaders( false ) ,m_bTableModelInitCompleted( false ) - ,m_nSelectedRowCount( 0 ) ,m_aSelectionListeners( *this ) { } @@ -80,7 +105,7 @@ void SVTXGridControl::SetWindow( Window* pWindow ) } // --------------------------------------------------------------------------------------------------------------------- -sal_Int32 SAL_CALL SVTXGridControl::getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException) +sal_Int32 SAL_CALL SVTXGridControl::getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); @@ -92,7 +117,7 @@ sal_Int32 SAL_CALL SVTXGridControl::getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) } // --------------------------------------------------------------------------------------------------------------------- -sal_Int32 SAL_CALL SVTXGridControl::getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException) +sal_Int32 SAL_CALL SVTXGridControl::getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); @@ -128,13 +153,13 @@ sal_Int32 SAL_CALL SVTXGridControl::getCurrentRow( ) throw (RuntimeException) } // --------------------------------------------------------------------------------------------------------------------- -void SAL_CALL SVTXGridControl::addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL SVTXGridControl::addSelectionListener(const Reference< XGridSelectionListener > & listener) throw (RuntimeException) { m_aSelectionListeners.addInterface(listener); } // --------------------------------------------------------------------------------------------------------------------- -void SAL_CALL SVTXGridControl::removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL SVTXGridControl::removeSelectionListener(const Reference< XGridSelectionListener > & listener) throw (RuntimeException) { m_aSelectionListeners.removeInterface(listener); } @@ -457,7 +482,7 @@ Any SVTXGridControl::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru aPropertyValue.clear(); else { - Sequence< ::com::sun::star::util::Color > aAPIColors( aColors->size() ); + Sequence< UnoColor > aAPIColors( aColors->size() ); for ( size_t i=0; isize(); ++i ) { aAPIColors[i] = aColors->at(i).GetColor(); @@ -587,24 +612,27 @@ void SAL_CALL SVTXGridControl::elementReplaced( const ContainerEvent& i_event ) //---------------------------------------------------------------------------------------------------------------------- -void SAL_CALL SVTXGridControl::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) +void SAL_CALL SVTXGridControl::disposing( const EventObject& Source ) throw(RuntimeException) { VCLXWindow::disposing( Source ); } //---------------------------------------------------------------------------------------------------------------------- -void SAL_CALL SVTXGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL SVTXGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (RuntimeException, IndexOutOfBoundsException ) { ::vos::OGuard aGuard( GetMutex() ); TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::selectRow: no control (anymore)!" ); + if ( ( i_rowIndex < 0 ) || ( i_rowIndex >= pTable->GetRowCount() ) ) + throw IndexOutOfBoundsException( ::rtl::OUString(), *this ); + pTable->SelectRow( i_rowIndex, true ); } //---------------------------------------------------------------------------------------------------------------------- -void SAL_CALL SVTXGridControl::selectAllRows() throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL SVTXGridControl::selectAllRows() throw (RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); @@ -615,18 +643,21 @@ void SAL_CALL SVTXGridControl::selectAllRows() throw (::com::sun::star::uno::Run } //---------------------------------------------------------------------------------------------------------------------- -void SAL_CALL SVTXGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL SVTXGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (RuntimeException, IndexOutOfBoundsException ) { ::vos::OGuard aGuard( GetMutex() ); TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::deselectRow: no control (anymore)!" ); + if ( ( i_rowIndex < 0 ) || ( i_rowIndex >= pTable->GetRowCount() ) ) + throw IndexOutOfBoundsException( ::rtl::OUString(), *this ); + pTable->SelectRow( i_rowIndex, false ); } //---------------------------------------------------------------------------------------------------------------------- -void SAL_CALL SVTXGridControl::deselectAllRows() throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL SVTXGridControl::deselectAllRows() throw (RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); @@ -637,12 +668,12 @@ void SAL_CALL SVTXGridControl::deselectAllRows() throw (::com::sun::star::uno::R } //---------------------------------------------------------------------------------------------------------------------- -::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL SVTXGridControl::getSelection() throw (::com::sun::star::uno::RuntimeException) +Sequence< ::sal_Int32 > SAL_CALL SVTXGridControl::getSelectedRows() throw (RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); - ENSURE_OR_RETURN( pTable, "SVTXGridControl::getSelection: no control (anymore)!", Sequence< sal_Int32 >() ); + ENSURE_OR_RETURN( pTable, "SVTXGridControl::getSelectedRows: no control (anymore)!", Sequence< sal_Int32 >() ); sal_Int32 selectionCount = pTable->GetSelectedRowCount(); Sequence< sal_Int32 > selectedRows( selectionCount ); @@ -652,31 +683,31 @@ void SAL_CALL SVTXGridControl::deselectAllRows() throw (::com::sun::star::uno::R } //---------------------------------------------------------------------------------------------------------------------- -::sal_Bool SAL_CALL SVTXGridControl::isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException) +::sal_Bool SAL_CALL SVTXGridControl::hasSelectedRows() throw (RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); - ENSURE_OR_RETURN( pTable, "SVTXGridControl::getSelection: no control (anymore)!", sal_True ); + ENSURE_OR_RETURN( pTable, "SVTXGridControl::hasSelectedRows: no control (anymore)!", sal_True ); return pTable->GetSelectedRowCount() > 0; } //---------------------------------------------------------------------------------------------------------------------- -::sal_Bool SAL_CALL SVTXGridControl::isSelectedIndex( ::sal_Int32 index ) throw (::com::sun::star::uno::RuntimeException) +::sal_Bool SAL_CALL SVTXGridControl::isRowSelected( ::sal_Int32 index ) throw (RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); - ENSURE_OR_RETURN( pTable, "SVTXGridControl::isSelectedIndex: no control (anymore)!", sal_False ); + ENSURE_OR_RETURN( pTable, "SVTXGridControl::isRowSelected: no control (anymore)!", sal_False ); return pTable->IsRowSelected( index ); } //---------------------------------------------------------------------------------------------------------------------- -void SVTXGridControl::dispose() throw(::com::sun::star::uno::RuntimeException) +void SVTXGridControl::dispose() throw(RuntimeException) { - ::com::sun::star::lang::EventObject aObj; + EventObject aObj; aObj.Source = (::cppu::OWeakObject*)this; m_aSelectionListeners.disposeAndClear( aObj ); VCLXWindow::dispose(); @@ -687,7 +718,7 @@ void SVTXGridControl::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent { ::vos::OGuard aGuard( GetMutex() ); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xKeepAlive( this ); + Reference< XWindow > xKeepAlive( this ); TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::ProcessWindowEvent: no control (anymore)!" ); @@ -767,42 +798,13 @@ void SVTXGridControl::ImplCallItemListeners() if ( m_aSelectionListeners.getLength() ) { - sal_Int32 const actSelRowCount = pTable->GetSelectedRowCount(); - ::com::sun::star::awt::grid::GridSelectionEvent aEvent; + GridSelectionEvent aEvent; aEvent.Source = (::cppu::OWeakObject*)this; - aEvent.Column = 0; - sal_Int32 diff = actSelRowCount - m_nSelectedRowCount; - //row added to selection - if(diff >= 1) - { - aEvent.Action = com::sun::star::awt::grid::SelectionEventType(0); - aEvent.Row = pTable->GetSelectedRowIndex( actSelRowCount - 1 ); - aEvent.Range = diff; - } - //selected row changed - else if(diff == 0 && actSelRowCount != 0) - { - aEvent.Row = pTable->GetSelectedRowIndex( actSelRowCount - 1 ); - aEvent.Action = com::sun::star::awt::grid::SelectionEventType(2); - aEvent.Range = 0; - } - else - { - //selection changed: multiple row deselected, only 1 row is selected - if(actSelRowCount == 1) - { - aEvent.Row = pTable->GetSelectedRowIndex( actSelRowCount - 1 ); - aEvent.Action = com::sun::star::awt::grid::SelectionEventType(2); - } - //row is deselected - else - { - aEvent.Row = pTable->GetCurrentRow(); - aEvent.Action = com::sun::star::awt::grid::SelectionEventType(1); - } - aEvent.Range = 0; - } - m_nSelectedRowCount=actSelRowCount; + + sal_Int32 const nSelectedRowCount( pTable->GetSelectedRowCount() ); + aEvent.SelectedRowIndexes.realloc( nSelectedRowCount ); + for ( sal_Int32 i=0; iGetSelectedRowIndex( i ); m_aSelectionListeners.selectionChanged( aEvent ); } } @@ -833,4 +835,3 @@ void SVTXGridControl::impl_updateColumnsFromModel_nothrow() DBG_UNHANDLED_EXCEPTION(); } } - diff --git a/svtools/source/uno/svtxgridcontrol.hxx b/svtools/source/uno/svtxgridcontrol.hxx old mode 100644 new mode 100755 index 525327b3c760..e8cfea21c631 --- a/svtools/source/uno/svtxgridcontrol.hxx +++ b/svtools/source/uno/svtxgridcontrol.hxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -47,20 +48,18 @@ using namespace ::svt::table; -typedef ::cppu::ImplInheritanceHelper3 < VCLXWindow +typedef ::cppu::ImplInheritanceHelper4 < VCLXWindow , ::com::sun::star::awt::grid::XGridControl + , ::com::sun::star::awt::grid::XGridRowSelection , ::com::sun::star::awt::grid::XGridDataListener , ::com::sun::star::container::XContainerListener > SVTXGridControl_Base; class SVTXGridControl : public SVTXGridControl_Base { private: - ::boost::shared_ptr< UnoControlTableModel > m_pTableModel; - bool m_bHasColumnHeaders; - bool m_bHasRowHeaders; - bool m_bTableModelInitCompleted; - sal_Int32 m_nSelectedRowCount; - SelectionListenerMultiplexer m_aSelectionListeners; + ::boost::shared_ptr< UnoControlTableModel > m_pTableModel; + bool m_bTableModelInitCompleted; + SelectionListenerMultiplexer m_aSelectionListeners; protected: virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); @@ -84,23 +83,23 @@ public: // XEventListener virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); - // XGridSelection - virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL selectAllRows() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL deselectAllRows() throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL getSelection() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException); - // XGridControl virtual ::sal_Int32 SAL_CALL getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getCurrentColumn( ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getCurrentRow( ) throw (::com::sun::star::uno::RuntimeException); + // XGridRowSelection + virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException ); + virtual void SAL_CALL selectAllRows() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException ); + virtual void SAL_CALL deselectAllRows() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL getSelectedRows() throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL hasSelectedRows() throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isRowSelected(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); diff --git a/toolkit/source/controls/grid/gridcontrol.cxx b/toolkit/source/controls/grid/gridcontrol.cxx index acda52753a60..5bbf8e20aa87 100644 --- a/toolkit/source/controls/grid/gridcontrol.cxx +++ b/toolkit/source/controls/grid/gridcontrol.cxx @@ -304,8 +304,8 @@ void SAL_CALL UnoGridControl::createPeer( const uno::Reference< awt::XToolkit > { UnoControlBase::createPeer( rxToolkit, rParentPeer ); - const Reference< XGridControl > xGrid( getPeer(), UNO_QUERY_THROW ); - xGrid->addSelectionListener(&m_aSelectionListeners); + const Reference< XGridRowSelection > xGrid( getPeer(), UNO_QUERY_THROW ); + xGrid->addSelectionListener( &m_aSelectionListeners ); } //---------------------------------------------------------------------------------------------------------------------- @@ -387,45 +387,45 @@ sal_Bool SAL_CALL UnoGridControl::setModel( const Reference< XControlModel >& i_ } //---------------------------------------------------------------------------------------------------------------------- -void SAL_CALL UnoGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL UnoGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (RuntimeException, IndexOutOfBoundsException ) { - Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->selectRow( i_rowIndex ); + Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->selectRow( i_rowIndex ); } //---------------------------------------------------------------------------------------------------------------------- void SAL_CALL UnoGridControl::selectAllRows() throw (::com::sun::star::uno::RuntimeException) { - Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->selectAllRows(); + Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->selectAllRows(); } //---------------------------------------------------------------------------------------------------------------------- -void SAL_CALL UnoGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL UnoGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (RuntimeException, IndexOutOfBoundsException ) { - Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->deselectRow( i_rowIndex ); + Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->deselectRow( i_rowIndex ); } //---------------------------------------------------------------------------------------------------------------------- void SAL_CALL UnoGridControl::deselectAllRows() throw (::com::sun::star::uno::RuntimeException) { - Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->deselectAllRows(); + Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->deselectAllRows(); } //---------------------------------------------------------------------------------------------------------------------- -::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL UnoGridControl::getSelection() throw (::com::sun::star::uno::RuntimeException) +::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL UnoGridControl::getSelectedRows() throw (::com::sun::star::uno::RuntimeException) { - return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->getSelection(); + return Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->getSelectedRows(); } //---------------------------------------------------------------------------------------------------------------------- -::sal_Bool SAL_CALL UnoGridControl::isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException) +::sal_Bool SAL_CALL UnoGridControl::hasSelectedRows() throw (::com::sun::star::uno::RuntimeException) { - return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->isSelectionEmpty(); + return Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->hasSelectedRows(); } //---------------------------------------------------------------------------------------------------------------------- -::sal_Bool SAL_CALL UnoGridControl::isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException) +::sal_Bool SAL_CALL UnoGridControl::isRowSelected(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException) { - return Reference< XGridControl >( getPeer(), UNO_QUERY_THROW )->isSelectedIndex( index ); + return Reference< XGridRowSelection >( getPeer(), UNO_QUERY_THROW )->isRowSelected( index ); } //---------------------------------------------------------------------------------------------------------------------- diff --git a/toolkit/source/controls/grid/gridcontrol.hxx b/toolkit/source/controls/grid/gridcontrol.hxx index 61d9f8fc0232..af9f27b19369 100644 --- a/toolkit/source/controls/grid/gridcontrol.hxx +++ b/toolkit/source/controls/grid/gridcontrol.hxx @@ -29,12 +29,13 @@ #define TOOLKIT_GRID_CONTROL_HXX #include +#include #include #include #include #include -#include +#include #include #include @@ -80,8 +81,9 @@ public: // =================================================================== // = UnoGridControl // =================================================================== -typedef ::cppu::ImplInheritanceHelper1 < UnoControlBase +typedef ::cppu::ImplInheritanceHelper2 < UnoControlBase , ::com::sun::star::awt::grid::XGridControl + , ::com::sun::star::awt::grid::XGridRowSelection > UnoGridControl_Base; class UnoGridControl : public UnoGridControl_Base { @@ -102,14 +104,14 @@ public: virtual ::sal_Int32 SAL_CALL getCurrentColumn( ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getCurrentRow( ) throw (::com::sun::star::uno::RuntimeException); - // ::com::sun::star::awt::grid::XGridSelection - virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException); + // ::com::sun::star::awt::grid::XGridRowSelection + virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException ); virtual void SAL_CALL selectAllRows() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL deselectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException ); virtual void SAL_CALL deselectAllRows() throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL getSelection() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL isSelectionEmpty() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL isSelectedIndex(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL getSelectedRows() throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL hasSelectedRows() throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isRowSelected(::sal_Int32 index) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeSelectionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridSelectionListener > & listener) throw (::com::sun::star::uno::RuntimeException); -- cgit v1.2.3 From b5382665c96714dda6da9217dc7264a0c7a0c9b9 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 22 Mar 2011 13:00:39 +0100 Subject: gridfixes: #i117398# added XGridDataModel::getRowData --- offapi/com/sun/star/awt/grid/XGridDataModel.idl | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/offapi/com/sun/star/awt/grid/XGridDataModel.idl b/offapi/com/sun/star/awt/grid/XGridDataModel.idl index 1ff15e1310e0..d77cbd7d78a5 100644 --- a/offapi/com/sun/star/awt/grid/XGridDataModel.idl +++ b/offapi/com/sun/star/awt/grid/XGridDataModel.idl @@ -46,13 +46,13 @@ module com { module sun { module star { module awt { module grid { @since OOo 3.3.0 */ -interface XGridDataModel +published interface XGridDataModel { /** implements life time control for the component */ interface ::com::sun::star::lang::XComponent; - /** allows cloning the complete column model + /** allows cloning the complete data model */ interface ::com::sun::star::util::XCloneable; @@ -69,7 +69,7 @@ interface XGridDataModel @throws ::com::sun::star::lang::IndexOutOfBoundsException if the column or row index do not denote a valid cell position. */ - any getCellData( [in] long Column, [in] long Row ) + any getCellData( [in] long Column, [in] long RowIndex ) raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); /** retrieves the tool tip to be displayed when the mouse hovers over a given cell @@ -82,7 +82,7 @@ interface XGridDataModel @throws ::com::sun::star::lang::IndexOutOfBoundsException if the column or row index do not denote a valid cell position. */ - any getCellToolTip( [in] long Column, [in] long Row ) + any getCellToolTip( [in] long Column, [in] long RowIndex ) raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); /** retrieves the heading of a given row @@ -97,6 +97,20 @@ interface XGridDataModel any getRowHeading( [in] long RowIndex ) raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** retrieves the data for a complete row + +

This method is provided for performance and convenience reasons, it delivers the same result + as subsequent calls to getCellData would.

+ + @param Row + the index of the row whose data should is to be retrieved. + @raises ::com::sun::star::lang::IndexOutOfBoundsException + of the given row index does not denote a valid row. + */ + sequence< any > + getRowData( [in] long RowIndex ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); }; //============================================================================= -- cgit v1.2.3 From d004c1413059aee774dbf0ee9cbab606feb8ef42 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 22 Mar 2011 13:00:39 +0100 Subject: gridfixes: #i117398# added XGridDataModel::getRowData --- toolkit/qa/complex/toolkit/GridControl.java | 29 +++++++++++++++++++++- .../source/controls/grid/defaultgriddatamodel.cxx | 13 ++++++++++ .../source/controls/grid/defaultgriddatamodel.hxx | 1 + .../source/controls/grid/sortablegriddatamodel.cxx | 13 ++++++++++ .../source/controls/grid/sortablegriddatamodel.hxx | 5 ++-- 5 files changed, 58 insertions(+), 3 deletions(-) diff --git a/toolkit/qa/complex/toolkit/GridControl.java b/toolkit/qa/complex/toolkit/GridControl.java index a06a52342417..57fe57e2de94 100755 --- a/toolkit/qa/complex/toolkit/GridControl.java +++ b/toolkit/qa/complex/toolkit/GridControl.java @@ -324,6 +324,33 @@ public class GridControl assertEquals( insertionIndex, newColumn.getIndex() ); } + // ----------------------------------------------------------------------------------------------------------------- + @Test + public void testDataModel() throws Exception + { + impl_recreateGridModel(); + + // ensure that getCellData and getRowData have the same opinion on the data they deliver + final Object[][] data = new Object[][] { + new Object[] { 15, 17, 0 }, + new Object[] { 9, 8, 14 }, + new Object[] { 17, 2, 16 }, + new Object[] { 0, 7, 14 }, + new Object[] { 10, 16, 16 }, + }; + m_dataModel.addRows( new Object[ data.length ], data ); + + for ( int row = 0; row < data.length; ++row ) + { + assertArrayEquals( "getRowData delivers wrong data in row " + row, data[row], m_dataModel.getRowData( row ) ); + for ( int col = 0; col < data[row].length; ++col ) + { + assertEquals( "getCellData delivers wrong data at position (" + col + ", " + row + ")", + data[row][col], m_dataModel.getCellData( col, row ) ); + } + } + } + // ----------------------------------------------------------------------------------------------------------------- @Test public void testSortableDataModel() throws Exception @@ -408,7 +435,7 @@ public class GridControl final List< Object > disposables = new ArrayList< Object >(); try { - // create a siple dialog model/control/peer trinity + // create a simple dialog model/control/peer trinity final XControlModel dialogModel = createInstance( XControlModel.class, "com.sun.star.awt.UnoControlDialogModel" ); disposables.add( dialogModel ); final XPropertySet dialogProps = UnoRuntime.queryInterface( XPropertySet.class, dialogModel ); diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.cxx b/toolkit/source/controls/grid/defaultgriddatamodel.cxx index 4ef99d749ba1..a90e69f6411f 100644 --- a/toolkit/source/controls/grid/defaultgriddatamodel.cxx +++ b/toolkit/source/controls/grid/defaultgriddatamodel.cxx @@ -37,6 +37,7 @@ #include #include +#include //...................................................................................................................... namespace toolkit @@ -174,6 +175,18 @@ namespace toolkit return m_aRowHeaders[ i_row ]; } + //------------------------------------------------------------------------------------------------------------------ + Sequence< Any > SAL_CALL DefaultGridDataModel::getRowData( ::sal_Int32 i_rowIndex ) throw (IndexOutOfBoundsException, RuntimeException) + { + ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + + Sequence< Any > resultData( m_nColumnCount ); + RowData& rRowData = impl_getRowDataAccess_throw( i_rowIndex, m_nColumnCount ); + + ::std::transform( rRowData.begin(), rRowData.end(), resultData.getArray(), ::std::select1st< CellData >() ); + return resultData; + } + //------------------------------------------------------------------------------------------------------------------ void SAL_CALL DefaultGridDataModel::addRow( const Any& i_heading, const Sequence< Any >& i_data ) throw (RuntimeException) { diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.hxx b/toolkit/source/controls/grid/defaultgriddatamodel.hxx index bf4b6cc3355e..c4dc91f522c5 100644 --- a/toolkit/source/controls/grid/defaultgriddatamodel.hxx +++ b/toolkit/source/controls/grid/defaultgriddatamodel.hxx @@ -81,6 +81,7 @@ public: virtual ::com::sun::star::uno::Any SAL_CALL getCellData( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Any SAL_CALL getCellToolTip( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Any SAL_CALL getRowHeading( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getRowData( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); // OComponentHelper virtual void SAL_CALL disposing(); diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index b11f65d264e9..67a7a57d1f4f 100755 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx @@ -768,6 +768,19 @@ namespace toolkit return delegator->getRowHeading( rowIndex ); } + //------------------------------------------------------------------------------------------------------------------ + Sequence< Any > SAL_CALL SortableGridDataModel::getRowData( ::sal_Int32 i_rowIndex ) throw (IndexOutOfBoundsException, RuntimeException) + { + MethodGuard aGuard( *this, rBHelper ); + DBG_CHECK_ME(); + + ::sal_Int32 const rowIndex = impl_getPrivateRowIndex_throw( i_rowIndex ); + + Reference< XMutableGridDataModel > const delegator( m_delegator ); + aGuard.clear(); + return delegator->getRowData( rowIndex ); + } + //------------------------------------------------------------------------------------------------------------------ void SAL_CALL SortableGridDataModel::disposing() { diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.hxx b/toolkit/source/controls/grid/sortablegriddatamodel.hxx index 6f0718fd5b17..a536e734fdd8 100755 --- a/toolkit/source/controls/grid/sortablegriddatamodel.hxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.hxx @@ -98,9 +98,10 @@ namespace toolkit // XGridDataModel virtual ::sal_Int32 SAL_CALL getRowCount() throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getColumnCount() throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getCellData( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getCellToolTip( ::sal_Int32 Column, ::sal_Int32 Row ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getCellData( ::sal_Int32 Column, ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getCellToolTip( ::sal_Int32 Column, ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Any SAL_CALL getRowHeading( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getRowData( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); // OComponentHelper virtual void SAL_CALL disposing(); -- cgit v1.2.3 From b24c3700adbc03ed10d1ed856db628c8928df553 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 22 Mar 2011 13:27:12 +0100 Subject: gridfixes: #i117398# allow to specify selection-related colors in table/grid control models (VCL/UNO) --- offapi/com/sun/star/awt/grid/GridColumnEvent.idl | 2 +- .../com/sun/star/awt/grid/UnoControlGridModel.idl | 52 ++++++++++++++++------ offapi/com/sun/star/awt/grid/XGridColumn.idl | 2 +- .../com/sun/star/awt/grid/XGridColumnListener.idl | 2 +- offapi/com/sun/star/awt/grid/XGridColumnModel.idl | 2 +- offapi/com/sun/star/awt/grid/XGridControl.idl | 2 + offapi/com/sun/star/view/SelectionType.idl | 2 +- 7 files changed, 45 insertions(+), 19 deletions(-) diff --git a/offapi/com/sun/star/awt/grid/GridColumnEvent.idl b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl index 4ab6e71caf51..dc082fb14864 100644 --- a/offapi/com/sun/star/awt/grid/GridColumnEvent.idl +++ b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl @@ -40,7 +40,7 @@ module com { module sun { module star { module awt { module grid { @since OOo 3.3.0 */ -struct GridColumnEvent: com::sun::star::lang::EventObject +published struct GridColumnEvent : ::com::sun::star::lang::EventObject { /** Contains the name of the attributes whose value changed. **/ string AttributeName; diff --git a/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl index a348d4b3e23c..a1aa9f787efa 100644 --- a/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl +++ b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl @@ -45,7 +45,7 @@ module com { module sun { module star { module awt { module grid { @since OOo 3.3.0 */ -service UnoControlGridModel +published service UnoControlGridModel { /** specifies the standard model of an UnoControl. */ service com::sun::star::awt::UnoControlModel; @@ -132,14 +132,14 @@ service UnoControlGridModel /** controls whether or not to paint horizontal and vertical lines between the grid cells. - @see LineColor + @see GridLineColor */ [property] boolean UseGridLines; /** specifies the color to be used when drawing lines between cells

If this property has a value of , the grid control renderer will use some default color, - depending on the system's style settings.

+ depending on the control's style settings.

@see UseGridLines */ @@ -148,17 +148,47 @@ service UnoControlGridModel /** specifies the color to be used when drawing the background of row or column headers

If this property has a value of , the grid control renderer will use some default color, - depending on the system's style settings.

+ depending on the control's style settings.

*/ [property, maybevoid] ::com::sun::star::util::Color HeaderBackgroundColor; /** specifies the color to be used when drawing the text within row or column headers

If this property has a value of , the grid control renderer will use some default color, - depending on the system's style settings.

+ depending on the control's style settings.

*/ [property, maybevoid] ::com::sun::star::util::Color HeaderTextColor; + /** specifies the color to be used when drawing the background of selected cells, while the control has the focus. + +

If this property has a value of , the grid control renderer will use some default color, + depending on the control's style settings.

+ */ + [property, maybevoid] ::com::sun::star::util::Color ActiveSelectionBackgroundColor; + + /** specifies the color to be used when drawing the background of selected cells, while the control does not have + the focus. + +

If this property has a value of , the grid control renderer will use some default color, + depending on the control's style settings.

+ */ + [property, maybevoid] ::com::sun::star::util::Color InactiveSelectionBackgroundColor; + + /** specifies the color to be used when drawing the text of selected cells, while the control has the focus. + +

If this property has a value of , the grid control renderer will use some default color, + depending on the control's style settings.

+ */ + [property, maybevoid] ::com::sun::star::util::Color ActiveSelectionTextColor; + + /** specifies the color to be used when drawing the text of selected cells, while the control does not have + the focus. + +

If this property has a value of , the grid control renderer will use some default color, + depending on the control's style settings.

+ */ + [property, maybevoid] ::com::sun::star::util::Color InactiveSelectionTextColor; + /** specifies the colors to be used as background for data rows.

If this sequence is non-empty, the data rows will be rendered with alternating background colors: Assuming @@ -167,19 +197,13 @@ service UnoControlGridModel

If this sequence is empty, all rows will use the same background color as the control as whole.

-

If this property does not exist at a particular implementation, or is , rows will be painted +

If this property has a value of , rows will be painted in alternating background colors, every second row having a background color derived from the control's selection color.

*/ [property, maybevoid] sequence< ::com::sun::star::util::Color > RowBackgroundColors; /** specifies the vertical alignment of the content in the control. - -
-            TOP
-            MIDDLE
-            BOTTOM
-        
*/ [property] com::sun::star::style::VerticalAlignment VerticalAlign; @@ -190,14 +214,14 @@ service UnoControlGridModel /** specifies the color to be used when drawing cell texts

If this property has a value of , the grid control renderer will use some default color, - depending on the system's style settings.

+ depending on the control's style settings.

*/ [property, maybevoid] ::com::sun::star::util::Color TextColor; /** specifies the color to be used when drawing text lines (underlining and strikethrough)

If this property has a value of , the grid control renderer will use some default color, - depending on the system's style settings.

+ depending on the control's style settings.

*/ [property, maybevoid] com::sun::star::util::Color TextLineColor; diff --git a/offapi/com/sun/star/awt/grid/XGridColumn.idl b/offapi/com/sun/star/awt/grid/XGridColumn.idl index a73025d7715a..8e61a3432dd2 100644 --- a/offapi/com/sun/star/awt/grid/XGridColumn.idl +++ b/offapi/com/sun/star/awt/grid/XGridColumn.idl @@ -42,7 +42,7 @@ module com { module sun { module star { module awt { module grid { /** The XGridColumn defines the properties and behavior of a column in a grid control @since OOo 3.3.0 */ -interface XGridColumn +published interface XGridColumn { /** implements life time control for the component */ diff --git a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl index 9a8a02eca8f2..52e1b4733953 100644 --- a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl +++ b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl @@ -41,7 +41,7 @@ module com { module sun { module star { module awt { module grid { @since OOo 3.3.0 */ -interface XGridColumnListener : ::com::sun::star::lang::XEventListener +published interface XGridColumnListener : ::com::sun::star::lang::XEventListener { /** Invoked after a column was modified. */ diff --git a/offapi/com/sun/star/awt/grid/XGridColumnModel.idl b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl index 257f597fc7d2..b2943c6131eb 100644 --- a/offapi/com/sun/star/awt/grid/XGridColumnModel.idl +++ b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl @@ -49,7 +49,7 @@ module com { module sun { module star { module awt { module grid { @since OOo 3.3.0 */ -interface XGridColumnModel +published interface XGridColumnModel { /** implements life time control for the component */ diff --git a/offapi/com/sun/star/awt/grid/XGridControl.idl b/offapi/com/sun/star/awt/grid/XGridControl.idl index 4114ca685187..8decdb294931 100644 --- a/offapi/com/sun/star/awt/grid/XGridControl.idl +++ b/offapi/com/sun/star/awt/grid/XGridControl.idl @@ -27,6 +27,8 @@ #ifndef __com_sun_star_awt_grid_XGridControl_idl__ #define __com_sun_star_awt_grid_XGridControl_idl__ +#include + //============================================================================= module com { module sun { module star { module awt { module grid { diff --git a/offapi/com/sun/star/view/SelectionType.idl b/offapi/com/sun/star/view/SelectionType.idl index c8aa07d27393..56fe2b036131 100644 --- a/offapi/com/sun/star/view/SelectionType.idl +++ b/offapi/com/sun/star/view/SelectionType.idl @@ -35,7 +35,7 @@ module com { module sun { module star { module view { /** Specifies a selection type for a view that supports a selection model. */ -enum SelectionType +published enum SelectionType { //------------------------------------------------------------------------- -- cgit v1.2.3 From e2de537d59150b7fc13618d5f3821fe2213f974e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 22 Mar 2011 13:27:12 +0100 Subject: gridfixes: #i117398# allow to specify selection-related colors in table/grid control models (VCL/UNO) --- svtools/inc/svtools/table/tablemodel.hxx | 24 +++++++ svtools/source/table/gridtablerenderer.cxx | 27 ++++++-- svtools/source/table/tablecontrol_impl.cxx | 16 +++++ svtools/source/uno/svtxgridcontrol.cxx | 41 ++++++++++++ svtools/source/uno/unocontroltablemodel.cxx | 98 +++++++++++++++++++++++----- svtools/source/uno/unocontroltablemodel.hxx | 8 +++ toolkit/inc/toolkit/helper/property.hxx | 4 ++ toolkit/source/controls/grid/gridcontrol.cxx | 8 +++ toolkit/source/helper/property.cxx | 4 ++ 9 files changed, 206 insertions(+), 24 deletions(-) diff --git a/svtools/inc/svtools/table/tablemodel.hxx b/svtools/inc/svtools/table/tablemodel.hxx index 94f03b684e64..9cfc30c1a338 100755 --- a/svtools/inc/svtools/table/tablemodel.hxx +++ b/svtools/inc/svtools/table/tablemodel.hxx @@ -472,6 +472,30 @@ namespace svt { namespace table */ virtual ::boost::optional< ::Color > getHeaderTextColor() const = 0; + /** returns the color to be used for the background of selected cells, when the control has the focus + + If this value is not set, a default color from the style settings will be used. + */ + virtual ::boost::optional< ::Color > getActiveSelectionBackColor() const = 0; + + /** returns the color to be used for the background of selected cells, when the control does not have the focus + + If this value is not set, a default color from the style settings will be used. + */ + virtual ::boost::optional< ::Color > getInactiveSelectionBackColor() const = 0; + + /** returns the color to be used for the text of selected cells, when the control has the focus + + If this value is not set, a default color from the style settings will be used. + */ + virtual ::boost::optional< ::Color > getActiveSelectionTextColor() const = 0; + + /** returns the color to be used for the text of selected cells, when the control does not have the focus + + If this value is not set, a default color from the style settings will be used. + */ + virtual ::boost::optional< ::Color > getInactiveSelectionTextColor() const = 0; + /** returns the color to be used for rendering cell texts. If this value is not set, a default color from the style settings will be used. diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index 92cf6232e7a3..247da41e9b6a 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -338,13 +338,17 @@ namespace svt { namespace table ::Color backgroundColor = _rStyle.GetFieldColor(); - ::boost::optional< ::Color > aLineColor( m_pImpl->rModel.getLineColor() ); + ::boost::optional< ::Color > const aLineColor( m_pImpl->rModel.getLineColor() ); ::Color lineColor = !aLineColor ? _rStyle.GetSeparatorColor() : *aLineColor; + ::Color const activeSelectionBackColor = + lcl_getEffectiveColor( m_pImpl->rModel.getActiveSelectionBackColor(), _rStyle, &StyleSettings::GetHighlightColor ); if ( _bSelected ) { // selected rows use the background color from the style - backgroundColor = i_hasControlFocus ? _rStyle.GetHighlightColor() : _rStyle.GetDeactiveColor(); + backgroundColor = i_hasControlFocus + ? activeSelectionBackColor + : lcl_getEffectiveColor( m_pImpl->rModel.getInactiveSelectionBackColor(), _rStyle, &StyleSettings::GetDeactiveColor ); if ( !aLineColor ) lineColor = backgroundColor; } @@ -361,7 +365,7 @@ namespace svt { namespace table } else { - Color hilightColor = _rStyle.GetHighlightColor(); + Color hilightColor = activeSelectionBackColor; hilightColor.SetRed( 9 * ( fieldColor.GetRed() - hilightColor.GetRed() ) / 10 + hilightColor.GetRed() ); hilightColor.SetGreen( 9 * ( fieldColor.GetGreen() - hilightColor.GetGreen() ) / 10 + hilightColor.GetGreen() ); hilightColor.SetBlue( 9 * ( fieldColor.GetBlue() - hilightColor.GetBlue() ) / 10 + hilightColor.GetBlue() ); @@ -427,14 +431,16 @@ namespace svt { namespace table StyleSettings const & rStyle; ColPos const nColumn; bool const bSelected; + bool const bHasControlFocus; CellRenderContext( OutputDevice& i_device, Rectangle const & i_contentArea, - StyleSettings const & i_style, ColPos const i_column, bool const i_selected ) + StyleSettings const & i_style, ColPos const i_column, bool const i_selected, bool const i_hasControlFocus ) :rDevice( i_device ) ,aContentArea( i_contentArea ) ,rStyle( i_style ) ,nColumn( i_column ) ,bSelected( i_selected ) + ,bHasControlFocus( i_hasControlFocus ) { } }; @@ -446,7 +452,7 @@ namespace svt { namespace table _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); Rectangle const aContentArea( lcl_getContentArea( *m_pImpl, _rArea ) ); - CellRenderContext const aRenderContext( _rDevice, aContentArea, _rStyle, i_column, _bSelected ); + CellRenderContext const aRenderContext( _rDevice, aContentArea, _rStyle, i_column, _bSelected, i_hasControlFocus ); impl_paintCellContent( aRenderContext ); if ( m_pImpl->bUseGridLines ) @@ -457,7 +463,9 @@ namespace svt { namespace table if ( _bSelected && !aLineColor ) { // if no line color is specified by the model, use the usual selection color for lines in selected cells - lineColor = i_hasControlFocus ? _rStyle.GetHighlightColor() : _rStyle.GetDeactiveColor(); + lineColor = i_hasControlFocus + ? lcl_getEffectiveColor( m_pImpl->rModel.getActiveSelectionBackColor(), _rStyle, &StyleSettings::GetHighlightColor ) + : lcl_getEffectiveColor( m_pImpl->rModel.getInactiveSelectionBackColor(), _rStyle, &StyleSettings::GetDeactiveColor ); } _rDevice.SetLineColor( lineColor ); @@ -542,7 +550,12 @@ namespace svt { namespace table void GridTableRenderer::impl_paintCellText( CellRenderContext const & i_context, ::rtl::OUString const & i_text ) { if ( i_context.bSelected ) - i_context.rDevice.SetTextColor( i_context.rStyle.GetHighlightTextColor() ); + { + ::Color const textColor = i_context.bHasControlFocus + ? lcl_getEffectiveColor( m_pImpl->rModel.getActiveSelectionTextColor(), i_context.rStyle, &StyleSettings::GetHighlightTextColor ) + : lcl_getEffectiveColor( m_pImpl->rModel.getInactiveSelectionTextColor(), i_context.rStyle, &StyleSettings::GetDeactiveTextColor ); + i_context.rDevice.SetTextColor( textColor ); + } else { ::Color const textColor = lcl_getEffectiveColor( m_pImpl->rModel.getTextColor(), i_context.rStyle, &StyleSettings::GetFieldTextColor ); diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 2c23a9c93fe3..bb7be1c4ccfe 100755 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -185,6 +185,22 @@ namespace svt { namespace table { return ::boost::optional< ::Color >(); } + virtual ::boost::optional< ::Color > getActiveSelectionBackColor() const + { + return ::boost::optional< ::Color >(); + } + virtual ::boost::optional< ::Color > getInactiveSelectionBackColor() const + { + return ::boost::optional< ::Color >(); + } + virtual ::boost::optional< ::Color > getActiveSelectionTextColor() const + { + return ::boost::optional< ::Color >(); + } + virtual ::boost::optional< ::Color > getInactiveSelectionTextColor() const + { + return ::boost::optional< ::Color >(); + } virtual ::boost::optional< ::Color > getTextColor() const { return ::boost::optional< ::Color >(); diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index 5f28db28b478..d8324c160d5a 100644 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -311,6 +311,27 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An pTable->Invalidate(); break; + case BASEPROPERTY_ACTIVE_SEL_BACKGROUND_COLOR: + m_pTableModel->setActiveSelectionBackColor( aValue ); + pTable->Invalidate(); + break; + + case BASEPROPERTY_INACTIVE_SEL_BACKGROUND_COLOR: + m_pTableModel->setInactiveSelectionBackColor( aValue ); + pTable->Invalidate(); + break; + + case BASEPROPERTY_ACTIVE_SEL_TEXT_COLOR: + m_pTableModel->setActiveSelectionTextColor( aValue ); + pTable->Invalidate(); + break; + + case BASEPROPERTY_INACTIVE_SEL_TEXT_COLOR: + m_pTableModel->setInactiveSelectionTextColor( aValue ); + pTable->Invalidate(); + break; + + case BASEPROPERTY_TEXTCOLOR: m_pTableModel->setTextColor( aValue ); pTable->Invalidate(); @@ -504,6 +525,22 @@ Any SVTXGridControl::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru lcl_convertColor( m_pTableModel->getHeaderTextColor(), aPropertyValue ); break; + case BASEPROPERTY_ACTIVE_SEL_BACKGROUND_COLOR: + lcl_convertColor( m_pTableModel->getActiveSelectionBackColor(), aPropertyValue ); + break; + + case BASEPROPERTY_INACTIVE_SEL_BACKGROUND_COLOR: + lcl_convertColor( m_pTableModel->getInactiveSelectionBackColor(), aPropertyValue ); + break; + + case BASEPROPERTY_ACTIVE_SEL_TEXT_COLOR: + lcl_convertColor( m_pTableModel->getActiveSelectionTextColor(), aPropertyValue ); + break; + + case BASEPROPERTY_INACTIVE_SEL_TEXT_COLOR: + lcl_convertColor( m_pTableModel->getInactiveSelectionTextColor(), aPropertyValue ); + break; + case BASEPROPERTY_TEXTCOLOR: lcl_convertColor( m_pTableModel->getTextColor(), aPropertyValue ); break; @@ -532,6 +569,10 @@ void SVTXGridControl::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) BASEPROPERTY_GRID_HEADER_TEXT_COLOR, BASEPROPERTY_GRID_LINE_COLOR, BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS, + BASEPROPERTY_ACTIVE_SEL_BACKGROUND_COLOR, + BASEPROPERTY_INACTIVE_SEL_BACKGROUND_COLOR, + BASEPROPERTY_ACTIVE_SEL_TEXT_COLOR, + BASEPROPERTY_INACTIVE_SEL_TEXT_COLOR, 0 ); VCLXWindow::ImplGetPropertyIds( rIds, true ); diff --git a/svtools/source/uno/unocontroltablemodel.cxx b/svtools/source/uno/unocontroltablemodel.cxx index 933363115810..b4c1bed746fa 100644 --- a/svtools/source/uno/unocontroltablemodel.cxx +++ b/svtools/source/uno/unocontroltablemodel.cxx @@ -98,6 +98,10 @@ namespace svt { namespace table ::boost::optional< ::Color > m_aGridLineColor; ::boost::optional< ::Color > m_aHeaderBackgroundColor; ::boost::optional< ::Color > m_aHeaderTextColor; + ::boost::optional< ::Color > m_aActiveSelectionBackColor; + ::boost::optional< ::Color > m_aInactiveSelectionBackColor; + ::boost::optional< ::Color > m_aActiveSelectionTextColor; + ::boost::optional< ::Color > m_aInactiveSelectionTextColor; ::boost::optional< ::Color > m_aTextColor; ::boost::optional< ::Color > m_aTextLineColor; ::boost::optional< ::std::vector< ::Color > > m_aRowColors; @@ -107,23 +111,27 @@ namespace svt { namespace table WeakReference< XGridColumnModel > m_aColumnModel; UnoControlTableModel_Impl() - :aColumns ( ) - ,bHasColumnHeaders ( true ) - ,bHasRowHeaders ( false ) - ,eVScrollMode ( ScrollbarShowNever ) - ,eHScrollMode ( ScrollbarShowNever ) - ,pRenderer ( ) - ,pInputHandler ( ) - ,nRowHeight ( 10 ) - ,nColumnHeaderHeight ( 10 ) - ,nRowHeaderWidth ( 10 ) - ,m_aGridLineColor ( ) - ,m_aHeaderBackgroundColor ( ) - ,m_aHeaderTextColor ( ) - ,m_aTextColor ( ) - ,m_aTextLineColor ( ) - ,m_aRowColors ( ) - ,m_eVerticalAlign ( VerticalAlignment_TOP ) + :aColumns ( ) + ,bHasColumnHeaders ( true ) + ,bHasRowHeaders ( false ) + ,eVScrollMode ( ScrollbarShowNever ) + ,eHScrollMode ( ScrollbarShowNever ) + ,pRenderer ( ) + ,pInputHandler ( ) + ,nRowHeight ( 10 ) + ,nColumnHeaderHeight ( 10 ) + ,nRowHeaderWidth ( 10 ) + ,m_aGridLineColor ( ) + ,m_aHeaderBackgroundColor ( ) + ,m_aHeaderTextColor ( ) + ,m_aActiveSelectionBackColor ( ) + ,m_aInactiveSelectionBackColor ( ) + ,m_aActiveSelectionTextColor ( ) + ,m_aInactiveSelectionTextColor ( ) + ,m_aTextColor ( ) + ,m_aTextLineColor ( ) + ,m_aRowColors ( ) + ,m_eVerticalAlign ( VerticalAlignment_TOP ) { } }; @@ -653,6 +661,34 @@ namespace svt { namespace table return m_pImpl->m_aHeaderTextColor; } + //------------------------------------------------------------------------------------------------------------------ + ::boost::optional< ::Color > UnoControlTableModel::getActiveSelectionBackColor() const + { + DBG_CHECK_ME(); + return m_pImpl->m_aActiveSelectionBackColor; + } + + //------------------------------------------------------------------------------------------------------------------ + ::boost::optional< ::Color > UnoControlTableModel::getInactiveSelectionBackColor() const + { + DBG_CHECK_ME(); + return m_pImpl->m_aInactiveSelectionBackColor; + } + + //------------------------------------------------------------------------------------------------------------------ + ::boost::optional< ::Color > UnoControlTableModel::getActiveSelectionTextColor() const + { + DBG_CHECK_ME(); + return m_pImpl->m_aActiveSelectionTextColor; + } + + //------------------------------------------------------------------------------------------------------------------ + ::boost::optional< ::Color > UnoControlTableModel::getInactiveSelectionTextColor() const + { + DBG_CHECK_ME(); + return m_pImpl->m_aInactiveSelectionTextColor; + } + //------------------------------------------------------------------------------------------------------------------ void UnoControlTableModel::setHeaderTextColor( Any const & i_color ) { @@ -660,6 +696,34 @@ namespace svt { namespace table lcl_setColor( i_color, m_pImpl->m_aHeaderTextColor ); } + //------------------------------------------------------------------------------------------------------------------ + void UnoControlTableModel::setActiveSelectionBackColor( Any const & i_color ) + { + DBG_CHECK_ME(); + lcl_setColor( i_color, m_pImpl->m_aActiveSelectionBackColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void UnoControlTableModel::setInactiveSelectionBackColor( Any const & i_color ) + { + DBG_CHECK_ME(); + lcl_setColor( i_color, m_pImpl->m_aInactiveSelectionBackColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void UnoControlTableModel::setActiveSelectionTextColor( Any const & i_color ) + { + DBG_CHECK_ME(); + lcl_setColor( i_color, m_pImpl->m_aActiveSelectionTextColor ); + } + + //------------------------------------------------------------------------------------------------------------------ + void UnoControlTableModel::setInactiveSelectionTextColor( Any const & i_color ) + { + DBG_CHECK_ME(); + lcl_setColor( i_color, m_pImpl->m_aInactiveSelectionTextColor ); + } + //------------------------------------------------------------------------------------------------------------------ ::boost::optional< ::Color > UnoControlTableModel::getTextColor() const { diff --git a/svtools/source/uno/unocontroltablemodel.hxx b/svtools/source/uno/unocontroltablemodel.hxx index 537c3d9a5249..3c5f52748eee 100644 --- a/svtools/source/uno/unocontroltablemodel.hxx +++ b/svtools/source/uno/unocontroltablemodel.hxx @@ -89,6 +89,10 @@ namespace svt { namespace table virtual ::boost::optional< ::Color > getLineColor() const; virtual ::boost::optional< ::Color > getHeaderBackgroundColor() const; virtual ::boost::optional< ::Color > getHeaderTextColor() const; + virtual ::boost::optional< ::Color > getActiveSelectionBackColor() const; + virtual ::boost::optional< ::Color > getInactiveSelectionBackColor() const; + virtual ::boost::optional< ::Color > getActiveSelectionTextColor() const; + virtual ::boost::optional< ::Color > getInactiveSelectionTextColor() const; virtual ::boost::optional< ::Color > getTextColor() const; virtual ::boost::optional< ::Color > getTextLineColor() const; virtual ::boost::optional< ::std::vector< ::Color > > @@ -130,6 +134,10 @@ namespace svt { namespace table void setLineColor( ::com::sun::star::uno::Any const & i_color ); void setHeaderBackgroundColor( ::com::sun::star::uno::Any const & i_color ); void setHeaderTextColor( ::com::sun::star::uno::Any const & i_color ); + void setActiveSelectionBackColor( ::com::sun::star::uno::Any const & i_color ); + void setInactiveSelectionBackColor( ::com::sun::star::uno::Any const & i_color ); + void setActiveSelectionTextColor( ::com::sun::star::uno::Any const & i_color ); + void setInactiveSelectionTextColor( ::com::sun::star::uno::Any const & i_color ); void setTextColor( ::com::sun::star::uno::Any const & i_color ); void setTextLineColor( ::com::sun::star::uno::Any const & i_color ); void setRowBackgroundColors( ::com::sun::star::uno::Any const & i_APIValue ); diff --git a/toolkit/inc/toolkit/helper/property.hxx b/toolkit/inc/toolkit/helper/property.hxx index c2d6380dcb65..03cd972940a7 100644 --- a/toolkit/inc/toolkit/helper/property.hxx +++ b/toolkit/inc/toolkit/helper/property.hxx @@ -206,6 +206,10 @@ namespace rtl { #define BASEPROPERTY_ROW_HEADER_WIDTH 155 #define BASEPROPERTY_COLUMN_HEADER_HEIGHT 156 #define BASEPROPERTY_USE_GRID_LINES 157 +#define BASEPROPERTY_ACTIVE_SEL_BACKGROUND_COLOR 158 +#define BASEPROPERTY_INACTIVE_SEL_BACKGROUND_COLOR 159 +#define BASEPROPERTY_ACTIVE_SEL_TEXT_COLOR 160 +#define BASEPROPERTY_INACTIVE_SEL_TEXT_COLOR 161 // Keine gebundenen Properties, werden immer aus der Property BASEPROPERTY_FONTDESCRIPTOR entnommen. diff --git a/toolkit/source/controls/grid/gridcontrol.cxx b/toolkit/source/controls/grid/gridcontrol.cxx index 5bbf8e20aa87..3fb784aa7063 100644 --- a/toolkit/source/controls/grid/gridcontrol.cxx +++ b/toolkit/source/controls/grid/gridcontrol.cxx @@ -111,6 +111,10 @@ UnoGridModel::UnoGridModel( const ::com::sun::star::uno::Reference< ::com::sun:: ImplRegisterProperty( BASEPROPERTY_GRID_HEADER_BACKGROUND ); ImplRegisterProperty( BASEPROPERTY_GRID_HEADER_TEXT_COLOR ); ImplRegisterProperty( BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS ); + ImplRegisterProperty( BASEPROPERTY_ACTIVE_SEL_BACKGROUND_COLOR ); + ImplRegisterProperty( BASEPROPERTY_INACTIVE_SEL_BACKGROUND_COLOR ); + ImplRegisterProperty( BASEPROPERTY_ACTIVE_SEL_TEXT_COLOR ); + ImplRegisterProperty( BASEPROPERTY_INACTIVE_SEL_TEXT_COLOR ); ImplRegisterProperty( BASEPROPERTY_VERTICALALIGN ); } @@ -240,6 +244,10 @@ Any UnoGridModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const case BASEPROPERTY_GRID_HEADER_TEXT_COLOR: case BASEPROPERTY_GRID_LINE_COLOR: case BASEPROPERTY_GRID_ROW_BACKGROUND_COLORS: + case BASEPROPERTY_ACTIVE_SEL_BACKGROUND_COLOR: + case BASEPROPERTY_INACTIVE_SEL_BACKGROUND_COLOR: + case BASEPROPERTY_ACTIVE_SEL_TEXT_COLOR: + case BASEPROPERTY_INACTIVE_SEL_TEXT_COLOR: return Any(); default: return UnoControlModel::ImplGetDefaultValue( nPropId ); diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx index a418b4a00b7b..80ddf6d04fce 100644 --- a/toolkit/source/helper/property.cxx +++ b/toolkit/source/helper/property.cxx @@ -292,6 +292,10 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount ) DECL_PROP_3 ( "GridLineColor", GRID_LINE_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), DECL_PROP_3 ( "RowBackgroundColors", GRID_ROW_BACKGROUND_COLORS, Sequence< sal_Int32 >, BOUND, MAYBEDEFAULT, MAYBEVOID ), DECL_PROP_2 ( "UseGridLines", USE_GRID_LINES, sal_Bool, BOUND, MAYBEDEFAULT ), + DECL_PROP_3 ( "ActiveSelectionBackgroundColor", ACTIVE_SEL_BACKGROUND_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), + DECL_PROP_3 ( "InactiveSelectionBackgroundColor", INACTIVE_SEL_BACKGROUND_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), + DECL_PROP_3 ( "ActiveSelectionTextColor", ACTIVE_SEL_TEXT_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), + DECL_PROP_3 ( "InactiveSelectionTextColor", INACTIVE_SEL_TEXT_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), }; pPropertyInfos = aImplPropertyInfos; nElements = sizeof( aImplPropertyInfos ) / sizeof( ImplPropertyInfo ); -- cgit v1.2.3 From 7a95df591643fcc0ff6e2ba7de2179e401c26b60 Mon Sep 17 00:00:00 2001 From: tono Date: Tue, 22 Mar 2011 22:17:06 +0900 Subject: mingwport34: i#117491: libxslt library name is different --- RepositoryFixes.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RepositoryFixes.mk b/RepositoryFixes.mk index 10e06091b845..2cda6eab4141 100644 --- a/RepositoryFixes.mk +++ b/RepositoryFixes.mk @@ -75,7 +75,7 @@ gb_Library_FILENAMES := $(patsubst tl:itl%,tl:itools%,$(gb_Library_FILENAMES)) gb_Library_FILENAMES := $(patsubst vbahelper:ivbahelper%,vbahelper:vbahelper%,$(gb_Library_FILENAMES)) gb_Library_FILENAMES := $(patsubst vos3:ivos3%,vos3:ivos%,$(gb_Library_FILENAMES)) gb_Library_FILENAMES := $(patsubst xml2:ixml2%,xml2:libxml2$(gb_Library_IARCEXT),$(gb_Library_FILENAMES)) -gb_Library_FILENAMES := $(patsubst xslt:ixslt%,xslt:libxslt$(gb_Library_IARCEXT),$(gb_Library_FILENAMES)) +gb_Library_FILENAMES := $(patsubst xslt:ixslt%,xslt:libxslt.dll$(gb_Library_IARCEXT),$(gb_Library_FILENAMES)) gb_Library_FILENAMES := $(patsubst rdf:irdf%,rdf:librdf.dll$(gb_Library_IARCEXT),$(gb_Library_FILENAMES)) gb_Library_FILENAMES := $(patsubst z:iz%,z:zlib%,$(gb_Library_FILENAMES)) ifeq ($(gb_PRODUCT),$(true)) -- cgit v1.2.3 From f9ceb85dc952d9fe954f6865b85182ca892a802d Mon Sep 17 00:00:00 2001 From: tono Date: Tue, 22 Mar 2011 22:20:11 +0900 Subject: mingwport34: i#117493: mingw port of i109096 - WCHAR is not compatible with sal_Unicode in mingw --- sal/osl/w32/module.cxx | 2 +- sal/osl/w32/procimpl.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sal/osl/w32/module.cxx b/sal/osl/w32/module.cxx index 65a17eb1352d..9adf6926f80d 100755 --- a/sal/osl/w32/module.cxx +++ b/sal/osl/w32/module.cxx @@ -78,7 +78,7 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMod //on Windows XP and ERROR_INSUFFICIENT_BUFFER on Windows 7 (64bit) if (hInstance == NULL && Module->length > 260) { - std::vector > vec(Module->length + 1); + std::vector > vec(Module->length + 1); DWORD len = GetShortPathNameW(reinterpret_cast(Module->buffer), &vec[0], Module->length + 1); if (len ) diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx index a2f86422df2a..164afe37b85b 100755 --- a/sal/osl/w32/procimpl.cxx +++ b/sal/osl/w32/procimpl.cxx @@ -314,7 +314,7 @@ namespace /* private */ std::vector > vec(path.getLength() + 1); //GetShortPathNameW only works if the file can be found! const DWORD len = GetShortPathNameW( - path.getStr(), &vec[0], path.getLength() + 1); + reinterpret_cast(path.getStr()), reinterpret_cast(&vec[0]), path.getLength() + 1); if (!len && GetLastError() == ERROR_FILE_NOT_FOUND && extension.getLength()) @@ -323,7 +323,7 @@ namespace /* private */ std::vector > vec2( extPath.getLength() + 1); const DWORD len2 = GetShortPathNameW( - extPath.getStr(), &vec2[0], extPath.getLength() + 1); + reinterpret_cast(extPath.getStr()), reinterpret_cast(&vec2[0]), extPath.getLength() + 1); ret = rtl::OUString(&vec2[0], len2); } else -- cgit v1.2.3 From a989e6436650996d12fe8a01c7894d79bd3c30fc Mon Sep 17 00:00:00 2001 From: tono Date: Tue, 22 Mar 2011 22:20:11 +0900 Subject: mingwport34: i#117493: mingw port of i109096 - WCHAR is not compatible with sal_Unicode in mingw --- l10ntools/source/help/HelpCompiler.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10ntools/source/help/HelpCompiler.hxx b/l10ntools/source/help/HelpCompiler.hxx index 8ce6098d21a9..fa2676c3bac1 100755 --- a/l10ntools/source/help/HelpCompiler.hxx +++ b/l10ntools/source/help/HelpCompiler.hxx @@ -107,7 +107,7 @@ namespace fs { ::rtl::OUString ustrSystemPath; osl::File::getSystemPathFromFileURL(data, ustrSystemPath); - return ustrSystemPath.getStr(); + return reinterpret_cast< wchar_t const * >(ustrSystemPath.getStr()); } #endif std::string native_directory_string() const { return native_file_string(); } -- cgit v1.2.3 From fbd71d9411da9779474a1304d9dff2b56797b11a Mon Sep 17 00:00:00 2001 From: tono Date: Tue, 22 Mar 2011 22:23:51 +0900 Subject: mingwport34: i#117494: mingw port cleanup of library usage --- curl/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curl/makefile.mk b/curl/makefile.mk index cb6ac50dc705..de550333cd33 100644 --- a/curl/makefile.mk +++ b/curl/makefile.mk @@ -100,7 +100,7 @@ CONFIGURE_FLAGS= --without-ssl --enable-ftp --enable-ipv6 --disable-http --disab BUILD_DIR=$(CONFIGURE_DIR)$/lib BUILD_ACTION=make OUT2BIN=$(BUILD_DIR)$/.libs$/libcurl*.dll -OUT2LIB=$(BUILD_DIR)$/.libs$/libcurl*.a +OUT2LIB=$(BUILD_DIR)$/.libs$/libcurl*.dll.a .ELSE # make use of stlport headerfiles EXT_USE_STLPORT=TRUE -- cgit v1.2.3 From 578ab2741eb5c390bb46c78a2228cfb9f8cd8051 Mon Sep 17 00:00:00 2001 From: tono Date: Tue, 22 Mar 2011 22:23:51 +0900 Subject: mingwport34: i#117494: mingw port cleanup of library usage --- RepositoryFixes.mk | 1 - solenv/inc/libs.mk | 4 ---- 2 files changed, 5 deletions(-) diff --git a/RepositoryFixes.mk b/RepositoryFixes.mk index 2cda6eab4141..38c588c7a5f0 100644 --- a/RepositoryFixes.mk +++ b/RepositoryFixes.mk @@ -99,7 +99,6 @@ gb_Library_DLLFILENAMES := $(filter-out $(foreach lib,$(gb_Library_ILIBFILENAMES gb_Library_DLLFILENAMES += $(foreach lib,$(gb_Library_ILIBFILENAMES),$(lib):$(PSDK_HOME)/lib/$(lib)$(gb_Library_ILIBEXT)) gb_Library_DLLFILENAMES := $(patsubst comphelper:comphelper%,comphelper:comphelp%,$(gb_Library_DLLFILENAMES)) -gb_Library_DLLFILENAMES := $(patsubst cppunit:cppunit%,cppunit:cygcppunit-1-12-1%,$(gb_Library_DLLFILENAMES)) gb_Library_DLLFILENAMES := $(patsubst icuuc:icuuc%,icuuc:icuuc40%,$(gb_Library_DLLFILENAMES)) gb_Library_DLLFILENAMES := $(patsubst ucbhelper:ucbhelper%,ucbhelper:ucbhelper4%,$(gb_Library_DLLFILENAMES)) gb_Library_DLLFILENAMES := $(patsubst z:z%,z:zlib%,$(gb_Library_DLLFILENAMES)) diff --git a/solenv/inc/libs.mk b/solenv/inc/libs.mk index 7ee473cb116f..064c87844209 100644 --- a/solenv/inc/libs.mk +++ b/solenv/inc/libs.mk @@ -265,15 +265,11 @@ JVMACCESSLIB = -ljvmaccess$(UDK_MAJOR)$(COMID) .ELSE # "$(GUI)$(COM)"=="WNTGCC" JVMACCESSLIB = -ljvmaccess$(COMID) .ENDIF # "$(GUI)$(COM)"=="WNTGCC" -.IF "$(OS)" == "WNT" -CPPUNITLIB = -lcygcppunit-1-12-1 -.ELSE .IF "$(SYSTEM_CPPUNIT)"=="YES" CPPUNITLIB = $(CPPUNIT_LIBS) .ELSE CPPUNITLIB = -lcppunit .ENDIF -.ENDIF .IF "$(SYSTEM_LIBXSLT)"=="YES" XSLTLIB=$(LIBXSLT_LIBS) .ELSE -- cgit v1.2.3 From d9927740eb00aaf61a18bbf47abacc9e24bffaa9 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 22 Mar 2011 15:31:50 +0100 Subject: fs34b: #i117454# don't ask for the value of the possibly non-existent 'Sorting' HiddenControl --- .../com/sun/star/wizards/document/FormHandler.java | 27 ++++-------------- .../wizards/report/ReportTextImplementation.java | 32 ++++++++++------------ 2 files changed, 21 insertions(+), 38 deletions(-) diff --git a/wizards/com/sun/star/wizards/document/FormHandler.java b/wizards/com/sun/star/wizards/document/FormHandler.java index 828ae4fc67f0..8ca665273d74 100644 --- a/wizards/com/sun/star/wizards/document/FormHandler.java +++ b/wizards/com/sun/star/wizards/document/FormHandler.java @@ -219,23 +219,21 @@ public class FormHandler return xFormsSupplier.getForms(); } - public String getValueofHiddenControl(XNameAccess xNamedForm, String ControlName, String sMsg) throws com.sun.star.wizards.document.FormHandler.UnknownHiddenControlException + public String getValueofHiddenControl(XNameAccess xNamedForm, String ControlName) { + String value = ""; try { if (xNamedForm.hasByName(ControlName)) { - return AnyConverter.toString(com.sun.star.wizards.common.Helper.getUnoPropertyValue(xNamedForm.getByName(ControlName), "HiddenValue")); - } - else - { - throw new UnknownHiddenControlException(xNamedForm, ControlName, sMsg); + value = AnyConverter.toString(com.sun.star.wizards.common.Helper.getUnoPropertyValue(xNamedForm.getByName(ControlName), "HiddenValue")); } } - catch (Exception exception) + catch (Exception ex) { - throw new UnknownHiddenControlException(xNamedForm, ControlName, sMsg); + Logger.getLogger( FormHandler.class.getName() ).log( Level.SEVERE, null, ex ); } + return value; } public void insertHiddenControl(XNameAccess xNameAccess, XNameContainer xNamedForm, String ControlName, String ControlValue) @@ -260,19 +258,6 @@ public class FormHandler } } - public class UnknownHiddenControlException extends java.lang.Throwable - { - - public UnknownHiddenControlException(XNameAccess xNamedForm, String ControlName, String sMsgHiddenControlisMissing) - { - XNamed xNamed = UnoRuntime.queryInterface(XNamed.class, xNamedForm); - String FormName = xNamed.getName(); - sMsgHiddenControlisMissing = JavaTools.replaceSubString(sMsgHiddenControlisMissing, FormName, ""); - sMsgHiddenControlisMissing = JavaTools.replaceSubString(sMsgHiddenControlisMissing, ControlName, ""); - SystemDialog.showMessageBox(xMSFDoc, "ErrorBox", VclWindowPeerAttribute.OK, sMsgHiddenControlisMissing); - } - } - public boolean hasFormByName(String _FormName) { xNamedFormContainer = getDocumentForms(); diff --git a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java index 6a79d0f37d84..28379de73909 100644 --- a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java +++ b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java @@ -224,24 +224,27 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme XNameContainer xNamedForms = getDoc().oFormHandler.getDocumentForms(); Object oDBForm = Helper.getUnoObjectbyName(xNamedForms, ReportWizard.SOREPORTFORMNAME); boolean bgetConnection; - String sQueryName = PropertyNames.EMPTY_STRING; if (oDBForm != null) { String sMsg = sMsgHiddenControlMissing + (char) 13 + sMsgEndAutopilot; XNameAccess xNamedForm = UnoRuntime.queryInterface( XNameAccess.class, oDBForm ); - getRecordParser().Command = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, PropertyNames.COMMAND, sMsg); - String sCommandType = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, PropertyNames.COMMAND_TYPE, sMsg); - String sGroupFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "GroupFieldNames", sMsg); - String sFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "FieldNames", sMsg); - final String sorting = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "Sorting", sMsg); - String sRecordFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "RecordFieldNames", sMsg); - if (xNamedForm.hasByName("QueryName")) - { - sQueryName = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "QueryName", sMsg); - } + getRecordParser().Command = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, PropertyNames.COMMAND); + String sCommandType = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, PropertyNames.COMMAND_TYPE); + String sGroupFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "GroupFieldNames"); + String sFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "FieldNames"); + String sRecordFieldNames = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "RecordFieldNames"); + + String sorting = PropertyNames.EMPTY_STRING; + if ( xNamedForm.hasByName( "Sorting" ) ) + sorting = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "Sorting"); + + String sQueryName = PropertyNames.EMPTY_STRING; + if ( xNamedForm.hasByName( "QueryName" ) ) + sQueryName = getDoc().oFormHandler.getValueofHiddenControl(xNamedForm, "QueryName"); + String[] sFieldNameList = JavaTools.ArrayoutofString(sFieldNames, PropertyNames.SEMI_COLON); String[] sNewList = JavaTools.ArrayoutofString(sRecordFieldNames, PropertyNames.SEMI_COLON); - if ( !PropertyNames.EMPTY_STRING.equals(sorting)) + if ( sorting.length() > 0) { String[] sortList = JavaTools.ArrayoutofString(sorting, PropertyNames.SEMI_COLON); ArrayList aSortFields = new ArrayList(); @@ -308,11 +311,6 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme Logger.getLogger( ReportTextImplementation.class.getName() ).log( Level.SEVERE, null, ex ); return false; } - catch (com.sun.star.wizards.document.FormHandler.UnknownHiddenControlException ex) - { - Logger.getLogger( ReportTextImplementation.class.getName() ).log( Level.SEVERE, null, ex ); - return false; - } } private boolean m_bStopProcess; -- cgit v1.2.3 From 884863b8d334a138882568683bc2e2bcc1bc206d Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 22 Mar 2011 15:54:33 +0100 Subject: dr80: #i117506# byvalue->byref --- sc/source/filter/excel/xechart.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index 07b4a76a9c82..eae1a888a873 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -212,7 +212,7 @@ sal_uInt16 lclGetTimeUnit( sal_Int32 nApiTimeUnit ) return EXC_CHDATERANGE_DAYS; } -bool lclConvertTimeInterval( sal_uInt16 rnValue, sal_uInt16& rnTimeUnit, const Any& rAny ) +bool lclConvertTimeInterval( sal_uInt16& rnValue, sal_uInt16& rnTimeUnit, const Any& rAny ) { cssc::TimeInterval aInterval; bool bAuto = lclIsAutoAnyOrGetValue( aInterval, rAny ); -- cgit v1.2.3 From a02e93fa19376c196f6dbac49edeace626fc2288 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Wed, 23 Mar 2011 14:41:21 +0100 Subject: dr80: #i117511# remove some assertions in xlsx/xlsb import filters --- oox/source/drawingml/shape.cxx | 3 --- oox/source/xls/autofilterbuffer.cxx | 2 +- oox/source/xls/externallinkbuffer.cxx | 13 ++++++++-- oox/source/xls/numberformatsbuffer.cxx | 8 +++--- oox/source/xls/stylesbuffer.cxx | 46 ++++++++++++++++++---------------- 5 files changed, 42 insertions(+), 30 deletions(-) diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 61956c068deb..eac2151787df 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -180,9 +180,6 @@ void Shape::addShape( if ( xShapes.is() ) addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap ); } - Reference< document::XActionLockable > xLockable( mxShape, UNO_QUERY ); - if( xLockable.is() ) - xLockable->removeActionLock(); } catch( const Exception& ) { diff --git a/oox/source/xls/autofilterbuffer.cxx b/oox/source/xls/autofilterbuffer.cxx index 7cf359f6d3c9..bfc33e82056b 100755 --- a/oox/source/xls/autofilterbuffer.cxx +++ b/oox/source/xls/autofilterbuffer.cxx @@ -842,7 +842,7 @@ bool AutoFilterBuffer::finalizeImport( const Reference< XDatabaseRange >& rxData AutoFilter* AutoFilterBuffer::getActiveAutoFilter() { // Excel expects not more than one auto filter per sheet or table - OSL_ENSURE( maAutoFilters.size() == 1, "AutoFilterBuffer::getActiveAutoFilter - too many auto filters" ); + OSL_ENSURE( maAutoFilters.size() <= 1, "AutoFilterBuffer::getActiveAutoFilter - too many auto filters" ); // stick to the last imported auto filter return maAutoFilters.empty() ? 0 : maAutoFilters.back().get(); } diff --git a/oox/source/xls/externallinkbuffer.cxx b/oox/source/xls/externallinkbuffer.cxx index 683ac3582071..9e1bf2e0125f 100644 --- a/oox/source/xls/externallinkbuffer.cxx +++ b/oox/source/xls/externallinkbuffer.cxx @@ -683,10 +683,19 @@ ExternalLinkInfo ExternalLink::getLinkInfo() const ExternalLinkInfo aLinkInfo; switch( meLinkType ) { + case LINKTYPE_SELF: + case LINKTYPE_SAME: + case LINKTYPE_INTERNAL: + aLinkInfo.Type = ::com::sun::star::sheet::ExternalLinkType::SELF; + break; case LINKTYPE_EXTERNAL: aLinkInfo.Type = ::com::sun::star::sheet::ExternalLinkType::DOCUMENT; aLinkInfo.Data <<= maTargetUrl; break; + case LINKTYPE_LIBRARY: + // parser will return library function names in OPCODE_BAD string tokens + aLinkInfo.Type = ::com::sun::star::sheet::ExternalLinkType::SPECIAL; + break; case LINKTYPE_DDE: { aLinkInfo.Type = ::com::sun::star::sheet::ExternalLinkType::DDE; @@ -1043,8 +1052,8 @@ void ExternalLinkBuffer::importExternSheet8( BiffInputStream& rStrm ) Sequence< ExternalLinkInfo > ExternalLinkBuffer::getLinkInfos() const { ::std::vector< ExternalLinkInfo > aLinkInfos; - // should not be used for BIFF12 documents - OSL_ENSURE( (getFilterType() == FILTER_OOXML) && !mbUseRefSheets, "ExternalLinkBuffer::getLinkInfos - unexpected file format" ); + // XML formula parser also used in BIFF12 documents, e.g. replacement formulas in unsupported conditional formattings + OSL_ENSURE( getFilterType() == FILTER_OOXML, "ExternalLinkBuffer::getLinkInfos - unexpected file format" ); // add entry for implicit index 0 (self reference to this document) aLinkInfos.push_back( mxSelfRef->getLinkInfo() ); for( ExternalLinkVec::const_iterator aIt = maExtLinks.begin(), aEnd = maExtLinks.end(); aIt != aEnd; ++aIt ) diff --git a/oox/source/xls/numberformatsbuffer.cxx b/oox/source/xls/numberformatsbuffer.cxx index c77381b2a1c8..f9fd44b94ee0 100644 --- a/oox/source/xls/numberformatsbuffer.cxx +++ b/oox/source/xls/numberformatsbuffer.cxx @@ -1851,14 +1851,16 @@ sal_Int32 lclCreateFormat( const Reference< XNumberFormats >& rxNumFmts, catch( Exception& ) { // BIFF2-BIFF4 stores standard format explicitly in stream - static const OUString saGeneral = CREATE_OUSTRING( "general" ); - if( rFmtCode.equalsIgnoreAsciiCase( saGeneral ) ) + if( rFmtCode.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "general" ) ) ) { nIndex = lclCreatePredefinedFormat( rxNumFmts, 0, rToLocale ); } else { - OSL_ENSURE( false, + // do not assert fractional number formats with fixed denominator + OSL_ENSURE( rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?/" ) ) || + rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?\?/" ) ) || + rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?\?\?/" ) ), OStringBuffer( "lclCreateFormat - cannot create number format '" ). append( OUStringToOString( rFmtCode, osl_getThreadTextEncoding() ) ). append( '\'' ).getStr() ); diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx index 56c26d8b9f67..4733091802d4 100644 --- a/oox/source/xls/stylesbuffer.cxx +++ b/oox/source/xls/stylesbuffer.cxx @@ -2677,9 +2677,9 @@ const sal_Char* const sppcStyleNames[] = "Followed Hyperlink", "Note", // new in OOX "Warning Text", - "", - "", - "", + 0, + 0, + 0, "Title", "Heading 1", "Heading 2", @@ -2727,7 +2727,7 @@ OUString lclGetBuiltinStyleName( sal_Int32 nBuiltinId, const OUString& rName, sa OSL_ENSURE( (0 <= nBuiltinId) && (nBuiltinId < snStyleNamesCount), "lclGetBuiltinStyleName - unknown built-in style" ); OUStringBuffer aStyleName; aStyleName.appendAscii( spcStyleNamePrefix ); - if( (0 <= nBuiltinId) && (nBuiltinId < snStyleNamesCount) && (sppcStyleNames[ nBuiltinId ][ 0 ] != 0) ) + if( (0 <= nBuiltinId) && (nBuiltinId < snStyleNamesCount) && (sppcStyleNames[ nBuiltinId ] != 0) ) aStyleName.appendAscii( sppcStyleNames[ nBuiltinId ] ); else if( rName.getLength() > 0 ) aStyleName.append( rName ); @@ -2738,11 +2738,9 @@ OUString lclGetBuiltinStyleName( sal_Int32 nBuiltinId, const OUString& rName, sa return aStyleName.makeStringAndClear(); } -OUString lclGetBuiltInStyleName( const OUString& rName ) +OUString lclCreateStyleName( const CellStyleModel& rModel ) { - OUStringBuffer aStyleName; - aStyleName.appendAscii( spcStyleNamePrefix ).append( rName ); - return aStyleName.makeStringAndClear(); + return rModel.mbBuiltin ? lclGetBuiltinStyleName( rModel.mnBuiltinId, rModel.maName, rModel.mnLevel ) : rModel.maName; } bool lclIsBuiltinStyleName( const OUString& rStyleName, sal_Int32* pnBuiltinId, sal_Int32* pnNextChar ) @@ -2757,12 +2755,15 @@ bool lclIsBuiltinStyleName( const OUString& rStyleName, sal_Int32* pnBuiltinId, OUString aShortName; for( sal_Int32 nId = 0; nId < snStyleNamesCount; ++nId ) { - aShortName = OUString::createFromAscii( sppcStyleNames[ nId ] ); - if( rStyleName.matchIgnoreAsciiCase( aShortName, nPrefixLen ) && - (nNextChar < nPrefixLen + aShortName.getLength()) ) + if( sppcStyleNames[ nId ] != 0 ) { - nFoundId = nId; - nNextChar = nPrefixLen + aShortName.getLength(); + aShortName = OUString::createFromAscii( sppcStyleNames[ nId ] ); + if( rStyleName.matchIgnoreAsciiCase( aShortName, nPrefixLen ) && + (nNextChar < nPrefixLen + aShortName.getLength()) ) + { + nFoundId = nId; + nNextChar = nPrefixLen + aShortName.getLength(); + } } } } @@ -3008,10 +3009,11 @@ void CellStyleBuffer::finalizeImport() for( CellStyleVector::iterator aIt = maBuiltinStyles.begin(), aEnd = maBuiltinStyles.end(); aIt != aEnd; ++aIt ) { const CellStyleModel& rModel = (*aIt)->getModel(); - OUString aStyleName = lclGetBuiltinStyleName( rModel.mnBuiltinId, rModel.maName, rModel.mnLevel ); - OSL_ENSURE( bReserveAll || (aCellStyles.count( aStyleName ) == 0), - "CellStyleBuffer::finalizeImport - multiple styles with equal built-in identifier" ); - if( aCellStyles.count( aStyleName ) > 0 ) + OUString aStyleName = lclCreateStyleName( rModel ); + /* If a builtin style entry already exists, and we do not reserve all + existing styles, we just stick with the last definition and ignore + the preceding ones. */ + if( bReserveAll && (aCellStyles.count( aStyleName ) > 0) ) aConflictNameStyles.push_back( *aIt ); else aCellStyles[ aStyleName ] = *aIt; @@ -3022,13 +3024,14 @@ void CellStyleBuffer::finalizeImport() for( CellStyleVector::iterator aIt = maUserStyles.begin(), aEnd = maUserStyles.end(); aIt != aEnd; ++aIt ) { const CellStyleModel& rModel = (*aIt)->getModel(); + OUString aStyleName = lclCreateStyleName( rModel ); // #i1624# #i1768# ignore unnamed user styles - if( rModel.maName.getLength() > 0 ) + if( aStyleName.getLength() > 0 ) { - if( aCellStyles.count( rModel.maName ) > 0 ) + if( aCellStyles.count( aStyleName ) > 0 ) aConflictNameStyles.push_back( *aIt ); else - aCellStyles[ rModel.maName ] = *aIt; + aCellStyles[ aStyleName ] = *aIt; } } @@ -3036,11 +3039,12 @@ void CellStyleBuffer::finalizeImport() for( CellStyleVector::iterator aIt = aConflictNameStyles.begin(), aEnd = aConflictNameStyles.end(); aIt != aEnd; ++aIt ) { const CellStyleModel& rModel = (*aIt)->getModel(); + OUString aStyleName = lclCreateStyleName( rModel ); OUString aUnusedName; sal_Int32 nIndex = 0; do { - aUnusedName = OUStringBuffer( rModel.maName ).append( sal_Unicode( ' ' ) ).append( ++nIndex ).makeStringAndClear(); + aUnusedName = OUStringBuffer( aStyleName ).append( sal_Unicode( ' ' ) ).append( ++nIndex ).makeStringAndClear(); } while( aCellStyles.count( aUnusedName ) > 0 ); aCellStyles[ aUnusedName ] = *aIt; -- cgit v1.2.3 From 18ff017b27cee071ddc4d09cb833099fbeb11d2c Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Wed, 23 Mar 2011 14:41:21 +0100 Subject: dr80: #i117511# remove some assertions in xlsx/xlsb import filters --- offapi/com/sun/star/sheet/ExternalLinkType.idl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/offapi/com/sun/star/sheet/ExternalLinkType.idl b/offapi/com/sun/star/sheet/ExternalLinkType.idl index 976524506775..09bcd68ff70e 100644 --- a/offapi/com/sun/star/sheet/ExternalLinkType.idl +++ b/offapi/com/sun/star/sheet/ExternalLinkType.idl @@ -54,6 +54,15 @@ constants ExternalLinkType */ const long DDE = 2; + /** Reference to the own document. + */ + const long SELF = 3; + + /** For special use cases. Behaviour is dependent on the implementation of + the formula parser. + */ + const long SPECIAL = 4; + }; //============================================================================= -- cgit v1.2.3 From aa09f7647e19c161305c75bfcb79da8ef18611af Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Wed, 23 Mar 2011 14:41:21 +0100 Subject: dr80: #i117511# remove some assertions in xlsx/xlsb import filters --- sc/source/core/data/document.cxx | 1 + sc/source/core/data/drwlayer.cxx | 4 ++++ sc/source/core/tool/address.cxx | 10 +++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 714467d8e5eb..5d4026d01eb4 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -5254,6 +5254,7 @@ ScRowBreakIterator* ScDocument::GetRowBreakIterator(SCTAB nTab) const void ScDocument::EnableUndo( bool bVal ) { GetUndoManager()->EnableUndo(bVal); + if( pDrawLayer ) pDrawLayer->EnableUndo(bVal); mbUndoEnabled = bVal; } diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 9cff13d9030f..e07edd3278d1 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -283,6 +283,10 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) : if ( pHitOutlinerPool ) pHitOutlinerPool->SetPoolDefaultItem(SvxFontHeightItem( 423, 100, EE_CHAR_FONTHEIGHT )); // 12Pt + // initial undo mode as in Calc document + if( pDoc ) + EnableUndo( pDoc->IsUndoEnabled() ); + // URL-Buttons haben keinen Handler mehr, machen alles selber if( !nInst++ ) diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 26a194b731ef..7d9059184110 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -377,14 +377,13 @@ const sal_Unicode* ScRange::Parse_XL_Header( } ++p; - // 1-based, sequence starts with an empty element. - if (pExternalLinks && pExternalLinks->getLength() > 1) + if (pExternalLinks && pExternalLinks->hasElements()) { // A numeric "document name" is an index into the sequence. if (CharClass::isAsciiNumeric( rExternDocName)) { sal_Int32 i = rExternDocName.ToInt32(); - if (i <= 0 || i >= pExternalLinks->getLength()) + if (i < 0 || i >= pExternalLinks->getLength()) return start; const sheet::ExternalLinkInfo & rInfo = (*pExternalLinks)[i]; switch (rInfo.Type) @@ -400,6 +399,11 @@ const sal_Unicode* ScRange::Parse_XL_Header( rExternDocName = aStr; } break; + case sheet::ExternalLinkType::SELF : + return start; // ??? + case sheet::ExternalLinkType::SPECIAL : + // silently return nothing (do not assert), caller has to handle this + return NULL; default: DBG_ERROR2( "ScRange::Parse_XL_Header: unhandled ExternalLinkType %d for index %d", rInfo.Type, i); -- cgit v1.2.3 From 22f4dbdfb02a01611d7ac3d3d653f0a975478a75 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 23 Mar 2011 16:30:13 +0100 Subject: aw084: #i108052# Added code to mimic old behaviour and call user layout link when empty paragraph is rendered --- editeng/source/editeng/impedit3.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 352fb8ace115..b9e00cf89008 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -2948,6 +2948,27 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta // Ueber die Portions der Zeile... // -------------------------------------------------- nIndex = pLine->GetStart(); + + // #i108052# When stripping a callback for empty paragraphs is needed. This + // was somehow lost/removed/killed by making the TextPortions with empty + // paragraph to type PORTIONKIND_TAB instead of PORTIONKIND_TEXT. Adding here + // since I could not find out who and why this has changed. + if(bStripOnly && pLine->GetStartPortion() == pLine->GetEndPortion()) + { + const Color aOverlineColor(pOutDev->GetOverlineColor()); + const Color aTextLineColor(pOutDev->GetTextLineColor()); + + GetEditEnginePtr()->DrawingText( + aTmpPos, String(), 0, 0, 0, + aTmpFont, n, nIndex, 0, + 0, + 0, + false, true, false, // support for EOL/EOP TEXT comments + 0, + aOverlineColor, + aTextLineColor); + } + for ( sal_uInt16 y = pLine->GetStartPortion(); y <= pLine->GetEndPortion(); y++ ) { DBG_ASSERT( pPortion->GetTextPortions().Count(), "Zeile ohne Textportion im Paint!" ); -- cgit v1.2.3 From 7e08e537d7334524d4922cd14464f7f2e511ad2e Mon Sep 17 00:00:00 2001 From: "Wolfram Garten [wg]" Date: Thu, 24 Mar 2011 09:33:12 +0100 Subject: i117529: [Automation]: insert language selection for g_tools.bas, g_tools.inc --- testautomation/graphics/optional/includes/global/g_tools.inc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/testautomation/graphics/optional/includes/global/g_tools.inc b/testautomation/graphics/optional/includes/global/g_tools.inc index e8e918b95cbb..10d2c6bbe93a 100644 --- a/testautomation/graphics/optional/includes/global/g_tools.inc +++ b/testautomation/graphics/optional/includes/global/g_tools.inc @@ -275,8 +275,16 @@ testcase tiToolsThesaurusContextMenu end select PrintLog "Thesaurus with 1 word: " + sWord - Call hNewDocument + + printlog "Setting doc language to english" + ToolsOptions + Kontext "ExtrasOptionenDlg" + hToolsOptions("LANGUAGESETTINGS","Languages") + Westlich.Select 34 + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + Call hTextrahmenErstellen (sWord,20,20,50,30) sleep 1 -- cgit v1.2.3 From 2118a875e4967abe1707e8183b45d1b8564a3887 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 24 Mar 2011 12:26:59 +0100 Subject: fs34b: added some diagnostics, so next time a bug like #i117507# happens, we will not - at least in a non-product build - silently ignore it --- .../xforms/submission/serialization_app_xml.cxx | 54 +++++++++++++--------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/forms/source/xforms/submission/serialization_app_xml.cxx b/forms/source/xforms/submission/serialization_app_xml.cxx index 85cf066d6343..7f5e168ad7cd 100644 --- a/forms/source/xforms/submission/serialization_app_xml.cxx +++ b/forms/source/xforms/submission/serialization_app_xml.cxx @@ -31,7 +31,6 @@ #include "serialization.hxx" #include "serialization_app_xml.hxx" -#include #include #include #include @@ -39,8 +38,13 @@ #include #include +#include +#include + #include +#include + CSerializationAppXML::CSerializationAppXML() : m_aFactory(utl::getProcessServiceFactory()) , m_aPipe(CSS::uno::Reference< CSS::io::XOutputStream > (m_aFactory->createInstance( @@ -66,33 +70,39 @@ CSerializationAppXML::serialize_node(const CSS::uno::Reference< CSS::xml::dom::X CSS::uno::Reference< CSS::xml::dom::XDocument > aDoc(rNode, CSS::uno::UNO_QUERY_THROW); aNode = CSS::uno::Reference< CSS::xml::dom::XNode >(aDoc->getDocumentElement(), CSS::uno::UNO_QUERY_THROW); } - if (aNode->getNodeType() != CSS::xml::dom::NodeType_ELEMENT_NODE) - return; + ENSURE_OR_RETURN_VOID( aNode->getNodeType() == CSS::xml::dom::NodeType_ELEMENT_NODE, + "CSerializationAppXML::serialize_node: invalid node type!" ); // clone the node to a new document and serialize that document - CSS::uno::Reference< CSS::lang::XUnoTunnel > aTunnel(aNode, CSS::uno::UNO_QUERY); - if (aTunnel.is()) + CSS::uno::Reference< CSS::lang::XUnoTunnel > xTunnel( aNode, CSS::uno::UNO_QUERY ); + ENSURE_OR_RETURN_VOID( xTunnel.is(), "CSerializationAppXML::serialize_node: unknown implementation, cannot serialize!" ); + + xmlNodePtr aNodePtr = reinterpret_cast< xmlNodePtr >( xTunnel->getSomething(CSS::uno::Sequence< sal_Int8 >()) ); + ENSURE_OR_RETURN_VOID( aNodePtr != NULL, "CSerializationAppXML::serialize_node: unable to obtain the xmlNodePtr!" ); + + xmlDocPtr aDocPtr = xmlNewDoc((xmlChar*)"1.0"); + ENSURE_OR_RETURN_VOID( aDocPtr != NULL, "CSerializationAppXML::serialize_node: unable to create a temporary doc!" ); + + xmlNodePtr aDocNodePtr = xmlDocCopyNode(aNodePtr, aDocPtr, 1); + if (aDocNodePtr != NULL) { - xmlNodePtr aNodePtr = reinterpret_cast< xmlNodePtr >( aTunnel->getSomething(CSS::uno::Sequence< sal_Int8 >()) ); - xmlDocPtr aDocPtr = xmlNewDoc((xmlChar*)"1.0"); - xmlNodePtr aDocNodePtr = xmlDocCopyNode(aNodePtr, aDocPtr, 1); - if (aDocNodePtr != NULL) { - xmlAddChild((xmlNodePtr)aDocPtr, aDocNodePtr); - xmlChar *buffer = NULL; - sal_Int32 size = 0; - xmlDocDumpMemory(aDocPtr, &buffer, (int*)&size); - - // write the xml into the pipe through it's XOutputStream interface - m_aPipe->writeBytes(CSS::uno::Sequence< sal_Int8 >((sal_Int8*)buffer, size)); - xmlFree(buffer); + xmlAddChild( (xmlNodePtr)aDocPtr, aDocNodePtr ); + + xmlChar *buffer = NULL; + int size = 0; + xmlDocDumpMemory( aDocPtr, &buffer, &size ); + + if ( size > ::std::numeric_limits< sal_Int32 >::max() ) + { + OSL_ENSURE( false, "CSerializationAppXML::serialize_node: document too large, doesn't fit into a UNO sequence!" ); + size = ::std::numeric_limits< sal_Int32 >::max(); } - } else { - // can't get tunnel to native backend - // logic for generic implementation could be implemented here... - OSL_ENSURE(sal_False, "unkown dom implementation, cannot serialize"); - return; + // write the xml into the pipe through it's XOutputStream interface + m_aPipe->writeBytes(CSS::uno::Sequence< sal_Int8 >((sal_Int8*)buffer, size)); + xmlFree(buffer); } + xmlFreeDoc( aDocPtr ); } /* -- cgit v1.2.3 From 0323d19d1561ce392b3d8a50f0aff0163eb75878 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 24 Mar 2011 12:27:31 +0100 Subject: fs34b: #i117507# serialize_node: do not reach out into the implementation of the UNO DOM node (which isn't possible anymore), but use the proper UNO API for serialization --- .../xforms/submission/serialization_app_xml.cxx | 128 ++++++++++++--------- .../xforms/submission/serialization_app_xml.hxx | 5 +- forms/source/xforms/submission/submission_put.cxx | 10 +- 3 files changed, 81 insertions(+), 62 deletions(-) diff --git a/forms/source/xforms/submission/serialization_app_xml.cxx b/forms/source/xforms/submission/serialization_app_xml.cxx index 7f5e168ad7cd..63ef50cdc454 100644 --- a/forms/source/xforms/submission/serialization_app_xml.cxx +++ b/forms/source/xforms/submission/serialization_app_xml.cxx @@ -31,101 +31,117 @@ #include "serialization.hxx" #include "serialization_app_xml.hxx" +/** === begin UNO includes === **/ #include #include #include #include #include #include +#include +#include +#include +#include +/** === end UNO includes === **/ #include -#include - -#include +#include +#include #include +/** === begin UNO using === **/ +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Exception; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::uno::UNO_QUERY_THROW; +using ::com::sun::star::uno::UNO_SET_THROW; +using ::com::sun::star::xml::dom::XNode; +using ::com::sun::star::xml::dom::XDocument; +using ::com::sun::star::xml::sax::XSAXSerializable; +using ::com::sun::star::beans::StringPair; +using ::com::sun::star::io::XActiveDataSource; +using ::com::sun::star::xml::dom::NodeType_DOCUMENT_NODE; +using ::com::sun::star::xml::dom::NodeType_ELEMENT_NODE; +using ::com::sun::star::xml::dom::XDocumentBuilder; +using ::com::sun::star::xml::sax::XDocumentHandler; +/** === end UNO using === **/ + CSerializationAppXML::CSerializationAppXML() - : m_aFactory(utl::getProcessServiceFactory()) - , m_aPipe(CSS::uno::Reference< CSS::io::XOutputStream > (m_aFactory->createInstance( - rtl::OUString::createFromAscii("com.sun.star.io.Pipe")), CSS::uno::UNO_QUERY)) + :m_aContext( ::comphelper::getProcessServiceFactory() ) { - OSL_ENSURE(m_aPipe.is(), "cannot create Pipe"); + m_aContext.createComponent( "com.sun.star.io.Pipe", m_xBuffer ); } -CSS::uno::Reference< CSS::io::XInputStream > +Reference< CSS::io::XInputStream > CSerializationAppXML::getInputStream() { // The pipes output is provided through it's // XOutputStream interface aspect - return CSS::uno::Reference< CSS::io::XInputStream >(m_aPipe, CSS::uno::UNO_QUERY); + return Reference< CSS::io::XInputStream >(m_xBuffer, UNO_QUERY); } void -CSerializationAppXML::serialize_node(const CSS::uno::Reference< CSS::xml::dom::XNode >& rNode) +CSerializationAppXML::serialize_node(const Reference< XNode >& rNode) { - CSS::uno::Reference< CSS::xml::dom::XNode > aNode = rNode; - if (aNode->getNodeType() == CSS::xml::dom::NodeType_DOCUMENT_NODE) + try { - CSS::uno::Reference< CSS::xml::dom::XDocument > aDoc(rNode, CSS::uno::UNO_QUERY_THROW); - aNode = CSS::uno::Reference< CSS::xml::dom::XNode >(aDoc->getDocumentElement(), CSS::uno::UNO_QUERY_THROW); - } - ENSURE_OR_RETURN_VOID( aNode->getNodeType() == CSS::xml::dom::NodeType_ELEMENT_NODE, - "CSerializationAppXML::serialize_node: invalid node type!" ); - - // clone the node to a new document and serialize that document - CSS::uno::Reference< CSS::lang::XUnoTunnel > xTunnel( aNode, CSS::uno::UNO_QUERY ); - ENSURE_OR_RETURN_VOID( xTunnel.is(), "CSerializationAppXML::serialize_node: unknown implementation, cannot serialize!" ); + Reference< XSAXSerializable > xSerializer( rNode, UNO_QUERY ); + if ( !xSerializer.is() ) + { + // ensure we have a "real" node + Reference< XNode > xNode = rNode; + if ( xNode->getNodeType() == NodeType_DOCUMENT_NODE ) + { + Reference< XDocument > const xDoc( xNode, UNO_QUERY_THROW ); + xNode.set( xDoc->getDocumentElement(), UNO_QUERY_THROW ); + } + ENSURE_OR_RETURN_VOID( xNode->getNodeType() == NodeType_ELEMENT_NODE, + "CSerializationAppXML::serialize_node: invalid node type!" ); + + // create a new document + Reference< XDocumentBuilder > const xDocBuilder( + m_aContext.createComponent( "com.sun.star.xml.dom.DocumentBuilder" ), UNO_QUERY_THROW ); + Reference< XDocument > const xDocument( xDocBuilder->newDocument(), UNO_SET_THROW ); + + // copy the to-be-serialized node + Reference< XNode > const xImportedNode( xDocument->importNode( xNode, true ), UNO_SET_THROW ); + xDocument->appendChild( xImportedNode ); + + // ask the doc for the serializer + xSerializer.set( xDocument, UNO_QUERY ); + } - xmlNodePtr aNodePtr = reinterpret_cast< xmlNodePtr >( xTunnel->getSomething(CSS::uno::Sequence< sal_Int8 >()) ); - ENSURE_OR_RETURN_VOID( aNodePtr != NULL, "CSerializationAppXML::serialize_node: unable to obtain the xmlNodePtr!" ); + ENSURE_OR_RETURN_VOID( xSerializer.is(), + "CSerializationAppXML::serialize_node: no serialization access to the node/document!" ); - xmlDocPtr aDocPtr = xmlNewDoc((xmlChar*)"1.0"); - ENSURE_OR_RETURN_VOID( aDocPtr != NULL, "CSerializationAppXML::serialize_node: unable to create a temporary doc!" ); + // create a SAXWriter to take the serialization events, and connect it to our pipe + Reference< XDocumentHandler > const xSaxWriter( + m_aContext.createComponent( "com.sun.star.xml.sax.Writer" ), UNO_QUERY_THROW ); + Reference< XActiveDataSource > const xDataSource( xSaxWriter, UNO_QUERY_THROW ); + xDataSource->setOutputStream( m_xBuffer ); - xmlNodePtr aDocNodePtr = xmlDocCopyNode(aNodePtr, aDocPtr, 1); - if (aDocNodePtr != NULL) + // do the serialization + xSerializer->serialize( xSaxWriter, Sequence< StringPair >() ); + } + catch( const Exception& ) { - xmlAddChild( (xmlNodePtr)aDocPtr, aDocNodePtr ); - - xmlChar *buffer = NULL; - int size = 0; - xmlDocDumpMemory( aDocPtr, &buffer, &size ); - - if ( size > ::std::numeric_limits< sal_Int32 >::max() ) - { - OSL_ENSURE( false, "CSerializationAppXML::serialize_node: document too large, doesn't fit into a UNO sequence!" ); - size = ::std::numeric_limits< sal_Int32 >::max(); - } - - // write the xml into the pipe through it's XOutputStream interface - m_aPipe->writeBytes(CSS::uno::Sequence< sal_Int8 >((sal_Int8*)buffer, size)); - xmlFree(buffer); + DBG_UNHANDLED_EXCEPTION(); } - xmlFreeDoc( aDocPtr ); -} - -/* -void -CSerializationAppXML::serialize_nodeset() -{ - CSS::uno::Reference< CSS::xml::dom::XNodeList > aNodeList = m_aXPathObject->getNodeList(); - for (sal_Int32 i=0; igetLength(); i++) - serialize_node(aNodeList->item(i)); - m_aPipe->closeOutput(); } -*/ void CSerializationAppXML::serialize() { if (!m_aFragment.is()) return; - CSS::uno::Reference< CSS::xml::dom::XNode > cur = m_aFragment->getFirstChild(); + Reference< XNode > cur = m_aFragment->getFirstChild(); while (cur.is()) { serialize_node(cur); cur = cur->getNextSibling(); } - m_aPipe->closeOutput(); + m_xBuffer->closeOutput(); } diff --git a/forms/source/xforms/submission/serialization_app_xml.hxx b/forms/source/xforms/submission/serialization_app_xml.hxx index 338df6aea083..7380b5834ed1 100644 --- a/forms/source/xforms/submission/serialization_app_xml.hxx +++ b/forms/source/xforms/submission/serialization_app_xml.hxx @@ -33,12 +33,13 @@ #include "serialization.hxx" +#include class CSerializationAppXML : public CSerialization { private: - CSS::uno::Reference< CSS::lang::XMultiServiceFactory > m_aFactory; - CSS::uno::Reference< CSS::io::XOutputStream > m_aPipe; + ::comphelper::ComponentContext m_aContext; + CSS::uno::Reference< CSS::io::XOutputStream > m_xBuffer; void serialize_node(const CSS::uno::Reference< CSS::xml::dom::XNode >& aNode); void serialize_nodeset(); diff --git a/forms/source/xforms/submission/submission_put.cxx b/forms/source/xforms/submission/submission_put.cxx index 9ed37470ba93..02bd1f485091 100644 --- a/forms/source/xforms/submission/submission_put.cxx +++ b/forms/source/xforms/submission/submission_put.cxx @@ -35,6 +35,7 @@ #include "serialization_urlencoded.hxx" #include +#include #include #include @@ -58,7 +59,8 @@ CSubmission::SubmissionResult CSubmissionPut::submit(const CSS::uno::Reference< CSS::uno::Reference< XCommandEnvironment > aEnvironment; auto_ptr< CSerialization > apSerialization(createSerialization(aInteractionHandler,aEnvironment)); - try { + try + { ucbhelper::Content aContent(m_aURLObj.GetMainURL(INetURLObject::NO_DECODE), aEnvironment); // insert serialized data to content -> PUT @@ -68,10 +70,10 @@ CSubmission::SubmissionResult CSubmissionPut::submit(const CSS::uno::Reference< // no content as a result of put... - } catch (Exception&) + } + catch ( const Exception& ) { - // XXX - OSL_ENSURE(sal_False, "Exception during UCB operatration."); + DBG_UNHANDLED_EXCEPTION(); return UNKNOWN_ERROR; } -- cgit v1.2.3 From d91dbe70121ec3d14d2d392b5bbd1b60624eeb14 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 24 Mar 2011 13:56:14 +0100 Subject: gridfixes: #i117398# XMutableGridDataModel: allow inserting rows at arbitrary positions --- .../sun/star/awt/grid/XMutableGridDataModel.idl | 36 ++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl b/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl index 5e10820ff9ef..20749aaa0c8c 100755 --- a/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl +++ b/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl @@ -41,7 +41,7 @@ module com { module sun { module star { module awt { module grid { */ interface XMutableGridDataModel : XGridDataModel { - /** adds a row to the model. + /** appends a row to the model. @param Heading denotes the heading of the row. @@ -50,7 +50,7 @@ interface XMutableGridDataModel : XGridDataModel */ void addRow( [in] any Heading, [in] sequence< any > Data ); - /** adds multiple rows of data to the model. + /** appends multiple rows of data to the model. @param Headings denotes the headings of the to-be-added rows. @param Data @@ -61,6 +61,38 @@ interface XMutableGridDataModel : XGridDataModel void addRows( [in] sequence< any > Headings, [in] sequence< sequence< any > > Data ) raises ( ::com::sun::star::lang::IllegalArgumentException ); + /** inserts a row into the set of data rows + + @param Index + denotes the position at which the row is to be inserted + @param Heading + denotes the heading of the row. + @param Data + specifies the content of the row. + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Index is smaller than 0 or greater than the number of + rows in the model. + */ + void insertRow( [in] long Index, [in] any Heading, [in] sequence< any > Data ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** inserts multiple rows of data into the model. + @param Index + denotes the position at which the rows are to be inserted + @param Headings + denotes the headings of the to-be-added rows. + @param Data + specifies the data of the rows to be added. + @throws ::com::sun::star::lang::IllegalArgumentException + if Titles and Data are of different length. + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if Index is smaller than 0 or greater than the number of + rows in the model. + */ + void insertRows( [in] long Index, [in] sequence< any > Headings, [in] sequence< sequence< any > > Data ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException + , ::com::sun::star::lang::IllegalArgumentException ); + /** removes a row of data from the model @param RowIndex -- cgit v1.2.3 From 7ca3f3c0a7b848e06b9c9d0bf1b0e44cd58937bf Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 24 Mar 2011 13:56:14 +0100 Subject: gridfixes: #i117398# XMutableGridDataModel: allow inserting rows at arbitrary positions --- toolkit/qa/complex/toolkit/GridControl.java | 2 + .../toolkit/awtgrid/TMutableGridDataModel.java | 153 ++++++++++++++++++++- .../source/controls/grid/defaultgriddatamodel.cxx | 73 ++++++---- .../source/controls/grid/defaultgriddatamodel.hxx | 6 +- .../source/controls/grid/sortablegriddatamodel.cxx | 28 ++++ .../source/controls/grid/sortablegriddatamodel.hxx | 2 + 6 files changed, 230 insertions(+), 34 deletions(-) diff --git a/toolkit/qa/complex/toolkit/GridControl.java b/toolkit/qa/complex/toolkit/GridControl.java index 57fe57e2de94..bee35ea138cd 100755 --- a/toolkit/qa/complex/toolkit/GridControl.java +++ b/toolkit/qa/complex/toolkit/GridControl.java @@ -205,6 +205,8 @@ public class GridControl TMutableGridDataModel test = new TMutableGridDataModel( m_dataModel ); test.testAddRow(); test.testAddRows(); + test.testInsertRow(); + test.testInsertRows(); test.testRemoveRow(); test.testRemoveAllRows(); test.testUpdateCellData(); diff --git a/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java b/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java index c550dd9a047d..7f3c8fb55541 100755 --- a/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java +++ b/toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel.java @@ -53,14 +53,14 @@ public class TMutableGridDataModel */ public void testAddRow() throws IndexOutOfBoundsException { - m_dataModel.addRow( 1, m_rowValues[0] ); + m_dataModel.addRow( m_rowHeadings[0], m_rowValues[0] ); GridDataEvent event = m_listener.assertSingleRowInsertionEvent(); m_listener.reset(); assertEquals( "row insertion: wrong FirstRow (1)", 0, event.FirstRow ); assertEquals( "row insertion: wrong LastRow (1)", 0, event.LastRow ); impl_assertRowData( 0 ); - m_dataModel.addRow( 2, m_rowValues[1] ); + m_dataModel.addRow( m_rowHeadings[1], m_rowValues[1] ); event = m_listener.assertSingleRowInsertionEvent(); m_listener.reset(); assertEquals( "row insertion: wrong FirstRow (2)", 1, event.FirstRow ); @@ -75,7 +75,9 @@ public class TMutableGridDataModel { assertEquals( "precondition not met: call this directly after testAddRow, please!", 2, m_dataModel.getRowCount() ); - m_dataModel.addRows( new Object[] { "3", 4.0, "5" }, new Object[][] { m_rowValues[2], m_rowValues[3], m_rowValues[4] } ); + m_dataModel.addRows( + new Object[] { m_rowHeadings[2], m_rowHeadings[3], m_rowHeadings[4] }, + new Object[][] { m_rowValues[2], m_rowValues[3], m_rowValues[4] } ); GridDataEvent event = m_listener.assertSingleRowInsertionEvent(); assertEquals( "row insertion: wrong FirstRow (1)", 2, event.FirstRow ); assertEquals( "row insertion: wrong LastRow (1)", 4, event.LastRow ); @@ -96,6 +98,145 @@ public class TMutableGridDataModel m_dataModel, "addRows", new Object[] { new Object[0], new Object[1][2] }, IllegalArgumentException.class ); } + /** + * tests the XMutableGridDataModel.insertRow method + */ + public void testInsertRow() throws IndexOutOfBoundsException + { + int expectedRowCount = m_rowValues.length; + assertEquals( "precondition not met: call this directly after testAddRows, please!", expectedRowCount, m_dataModel.getRowCount() ); + + // inserting some row somewhere between the other rows + final Object heading = "inbetweenRow"; + final Object[] inbetweenRow = new Object[] { "foo", "bar", 3, 4, 5 }; + final int insertionPos = 2; + m_dataModel.insertRow( insertionPos, heading, inbetweenRow ); + ++expectedRowCount; + assertEquals( "inserting a row is expected to increment the row count", + expectedRowCount, m_dataModel.getRowCount() ); + + final GridDataEvent event = m_listener.assertSingleRowInsertionEvent(); + assertEquals( "inserting a row results in wrong FirstRow being notified", insertionPos, event.FirstRow ); + assertEquals( "inserting a row results in wrong LastRow being notified", insertionPos, event.LastRow ); + m_listener.reset(); + + for ( int row=0; row rowCount is expected to throw", + m_dataModel, "insertRow", + new Class[] { Integer.class, Object.class, Object[].class }, + new Object[] { expectedRowCount + 1, "", new Object[] { "1", 2, 3 } }, + IndexOutOfBoundsException.class ); + assertException( "inserting a row at a position < 0 is expected to throw", + m_dataModel, "insertRow", + new Class[] { Integer.class, Object.class, Object[].class }, + new Object[] { -1, "", new Object[] { "1", 2, 3 } }, + IndexOutOfBoundsException.class ); + + // remove the row, to create the situation expected by the next test + m_dataModel.removeRow( insertionPos ); + m_listener.reset(); + } + + /** + * tests the XMutableGridDataModel.insertRows method + */ + public void testInsertRows() throws IndexOutOfBoundsException, IllegalArgumentException + { + int expectedRowCount = m_rowValues.length; + assertEquals( "precondition not met: call this directly after testInsertRow, please!", expectedRowCount, m_dataModel.getRowCount() ); + + // inserting some rows somewhere between the other rows + final int insertionPos = 3; + final Object[] rowHeadings = new Object[] { "A", "B", "C" }; + final Object[][] rowData = new Object[][] { + new Object[] { "A", "B", "C", "D", "E" }, + new Object[] { "J", "I", "H", "G", "F" }, + new Object[] { "K", "L", "M", "N", "O" } + }; + final int insertedRowCount = rowData.length; + assertEquals( "invalid test data", rowHeadings.length, insertedRowCount ); + + m_dataModel.insertRows( insertionPos, rowHeadings, rowData ); + expectedRowCount += insertedRowCount; + + final GridDataEvent event = m_listener.assertSingleRowInsertionEvent(); + assertEquals( "inserting multiple rows results in wrong FirstRow being notified", + insertionPos, event.FirstRow ); + assertEquals( "inserting multiple rows results in wrong LastRow being notified", + insertionPos + insertedRowCount - 1, event.LastRow ); + m_listener.reset(); + + for ( int row=0; row= insertionPos ) && ( row < insertionPos + insertedRowCount ) + ? rowData[ row - insertionPos ] + : m_rowValues[ row - insertedRowCount ]; + assertArrayEquals( "row number " + row + " has wrong content content after inserting multiple rows", + expectedRowData, actualRowData ); + + final Object actualHeading = m_dataModel.getRowHeading(row); + final Object expectedHeading = + ( row < insertionPos ) + ? m_rowHeadings[ row ] + : ( row >= insertionPos ) && ( row < insertionPos + insertedRowCount ) + ? rowHeadings[ row - insertionPos ] + : m_rowHeadings[ row - insertedRowCount ]; + assertEquals( "row " + row + " has a wrong heading after invoking insertRows", + expectedHeading, actualHeading ); + } + + // exceptions + assertException( "inserting multiple rows at a position > rowCount is expected to throw an IndexOutOfBoundsException", + m_dataModel, "insertRows", + new Class[] { Integer.class, Object[].class, Object[][].class }, + new Object[] { expectedRowCount + 1, new Object[0], new Object[][] { } }, + IndexOutOfBoundsException.class ); + assertException( "inserting multiple rows at a position < 0 is expected to throw an IndexOutOfBoundsException", + m_dataModel, "insertRows", + new Class[] { Integer.class, Object[].class, Object[][].class }, + new Object[] { -1, new Object[0], new Object[][] { } }, + IndexOutOfBoundsException.class ); + assertException( "inserting multiple rows with inconsistent array lengths is expected to throw an IllegalArgumentException", + m_dataModel, "insertRows", + new Class[] { Integer.class, Object[].class, Object[][].class }, + new Object[] { 0, new Object[0], new Object[][] { new Object[0] } }, + IllegalArgumentException.class ); + + // remove the row, to create the situation expected by the next test + for ( int i=0; i const & i_rowData, sal_Int32 const i_assumedColCount ) + { + OSL_PRECOND( ( i_assumedColCount <= 0 ) || ( i_assumedColCount >= i_rowData.getLength() ), + "DefaultGridDataModel::impl_insertRow: invalid column count!" ); + + // insert heading + m_aRowHeaders.insert( m_aRowHeaders.begin() + i_position, i_heading ); + + // create new data row + RowData newRow( i_assumedColCount > 0 ? i_assumedColCount : i_rowData.getLength() ); + RowData::iterator cellData = newRow.begin(); + for ( const Any* pData = stl_begin( i_rowData ); pData != stl_end( i_rowData ); ++pData, ++cellData ) + cellData->first = *pData; + + // insert data row + m_aData.insert( m_aData.begin() + i_position, newRow ); + } + //------------------------------------------------------------------------------------------------------------------ void SAL_CALL DefaultGridDataModel::addRow( const Any& i_heading, const Sequence< Any >& i_data ) throw (RuntimeException) { - ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + insertRow( getRowCount(), i_heading, i_data ); + } - sal_Int32 const columnCount = i_data.getLength(); + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL DefaultGridDataModel::addRows( const Sequence< Any >& i_headings, const Sequence< Sequence< Any > >& i_data ) throw (IllegalArgumentException, RuntimeException) + { + insertRows( getRowCount(), i_headings, i_data ); + } - // store header name - m_aRowHeaders.push_back( i_heading ); + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL DefaultGridDataModel::insertRow( ::sal_Int32 i_index, const Any& i_heading, const Sequence< Any >& i_data ) throw (RuntimeException, IndexOutOfBoundsException) + { + ::comphelper::ComponentGuard aGuard( *this, rBHelper ); - // store row m_aData - impl_addRow( i_data ); + if ( ( i_index < 0 ) || ( i_index > impl_getRowCount_nolck() ) ) + throw IndexOutOfBoundsException( ::rtl::OUString(), *this ); + + // actually insert the row + impl_insertRow( i_index, i_heading, i_data ); // update column count + sal_Int32 const columnCount = i_data.getLength(); if ( columnCount > m_nColumnCount ) m_nColumnCount = columnCount; - sal_Int32 const rowIndex = sal_Int32( m_aData.size() - 1 ); broadcast( - GridDataEvent( *this, -1, -1, rowIndex, rowIndex ), + GridDataEvent( *this, -1, -1, i_index, i_index ), &XGridDataListener::rowsInserted, aGuard ); } //------------------------------------------------------------------------------------------------------------------ - void DefaultGridDataModel::impl_addRow( Sequence< Any > const & i_rowData, sal_Int32 const i_assumedColCount ) - { - OSL_PRECOND( ( i_assumedColCount <= 0 ) || ( i_assumedColCount >= i_rowData.getLength() ), - "DefaultGridDataModel::impl_addRow: invalid column count!" ); - - RowData newRow( i_assumedColCount > 0 ? i_assumedColCount : i_rowData.getLength() ); - RowData::iterator cellData = newRow.begin(); - for ( const Any* pData = stl_begin( i_rowData ); pData != stl_end( i_rowData ); ++pData, ++cellData ) - cellData->first = *pData; - - m_aData.push_back( newRow ); - } - - //------------------------------------------------------------------------------------------------------------------ - void SAL_CALL DefaultGridDataModel::addRows( const Sequence< Any >& i_headings, const Sequence< Sequence< Any > >& i_data ) throw (IllegalArgumentException, RuntimeException) + void SAL_CALL DefaultGridDataModel::insertRows( ::sal_Int32 i_index, const Sequence< Any>& i_headings, const Sequence< Sequence< Any > >& i_data ) throw (IllegalArgumentException, IndexOutOfBoundsException, RuntimeException) { if ( i_headings.getLength() != i_data.getLength() ) throw IllegalArgumentException( ::rtl::OUString(), *this, -1 ); ::comphelper::ComponentGuard aGuard( *this, rBHelper ); + if ( ( i_index < 0 ) || ( i_index > impl_getRowCount_nolck() ) ) + throw IndexOutOfBoundsException( ::rtl::OUString(), *this ); + sal_Int32 const rowCount = i_headings.getLength(); if ( rowCount == 0 ) return; @@ -249,17 +267,14 @@ namespace toolkit for ( sal_Int32 row=0; row m_nColumnCount ) m_nColumnCount = maxColCount; - sal_Int32 const firstRow = sal_Int32( m_aData.size() - rowCount ); - sal_Int32 const lastRow = sal_Int32( m_aData.size() - 1 ); broadcast( - GridDataEvent( *this, -1, -1, firstRow, lastRow ), + GridDataEvent( *this, -1, -1, i_index, i_index + rowCount - 1 ), &XGridDataListener::rowsInserted, aGuard ); diff --git a/toolkit/source/controls/grid/defaultgriddatamodel.hxx b/toolkit/source/controls/grid/defaultgriddatamodel.hxx index c4dc91f522c5..e679160dc9db 100644 --- a/toolkit/source/controls/grid/defaultgriddatamodel.hxx +++ b/toolkit/source/controls/grid/defaultgriddatamodel.hxx @@ -65,6 +65,8 @@ public: // XMutableGridDataModel virtual void SAL_CALL addRow( const Any& i_heading, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Data ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>& Headings, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& Data ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertRow( ::sal_Int32 i_index, const ::com::sun::star::uno::Any& i_heading, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Data ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); + virtual void SAL_CALL insertRows( ::sal_Int32 i_index, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>& Headings, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& Data ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeRow( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeAllRows( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL updateCellData( ::sal_Int32 ColumnIndex, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); @@ -105,7 +107,9 @@ private: ::comphelper::ComponentGuard & i_instanceLock ); - void impl_addRow( Sequence< Any > const & i_rowData, sal_Int32 const i_assumedColCount = -1 ); + void impl_insertRow( sal_Int32 const i_position, Any const & i_heading, Sequence< Any > const & i_rowData, sal_Int32 const i_assumedColCount = -1 ); + + ::sal_Int32 impl_getRowCount_nolck() const { return sal_Int32( m_aData.size() ); } CellData const & impl_getCellData_throw( sal_Int32 const i_columnIndex, sal_Int32 const i_rowIndex ) const; CellData& impl_getCellDataAccess_throw( sal_Int32 const i_columnIndex, sal_Int32 const i_rowIndex ); diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index 67a7a57d1f4f..8f32644c62e0 100755 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx @@ -606,6 +606,34 @@ namespace toolkit delegator->addRows( i_headings, i_data ); } + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL SortableGridDataModel::insertRow( ::sal_Int32 i_index, const Any& i_heading, const Sequence< Any >& i_data ) throw (RuntimeException, IndexOutOfBoundsException) + { + MethodGuard aGuard( *this, rBHelper ); + DBG_CHECK_ME(); + + ::sal_Int32 const rowIndex = i_index == getRowCount() ? i_index : impl_getPrivateRowIndex_throw( i_index ); + // note that |RowCount| is a valid index in this method, but not for impl_getPrivateRowIndex_throw + + Reference< XMutableGridDataModel > const delegator( m_delegator ); + aGuard.clear(); + delegator->insertRow( i_index, i_heading, i_data ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL SortableGridDataModel::insertRows( ::sal_Int32 i_index, const Sequence< Any>& i_headings, const Sequence< Sequence< Any > >& i_data ) throw (IllegalArgumentException, IndexOutOfBoundsException, RuntimeException) + { + MethodGuard aGuard( *this, rBHelper ); + DBG_CHECK_ME(); + + ::sal_Int32 const rowIndex = i_index == getRowCount() ? i_index : impl_getPrivateRowIndex_throw( i_index ); + // note that |RowCount| is a valid index in this method, but not for impl_getPrivateRowIndex_throw + + Reference< XMutableGridDataModel > const delegator( m_delegator ); + aGuard.clear(); + delegator->insertRows( i_index, i_headings, i_data ); + } + //------------------------------------------------------------------------------------------------------------------ void SAL_CALL SortableGridDataModel::removeRow( ::sal_Int32 i_rowIndex ) throw (IndexOutOfBoundsException, RuntimeException) { diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.hxx b/toolkit/source/controls/grid/sortablegriddatamodel.hxx index a536e734fdd8..8f90801ee50c 100755 --- a/toolkit/source/controls/grid/sortablegriddatamodel.hxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.hxx @@ -85,6 +85,8 @@ namespace toolkit // XMutableGridDataModel virtual void SAL_CALL addRow( const ::com::sun::star::uno::Any& Heading, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Data ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Headings, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& Data ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertRow( ::sal_Int32 i_index, const ::com::sun::star::uno::Any& i_heading, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Data ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); + virtual void SAL_CALL insertRows( ::sal_Int32 i_index, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>& Headings, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& Data ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeRow( ::sal_Int32 RowIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeAllRows( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL updateCellData( ::sal_Int32 ColumnIndex, ::sal_Int32 RowIndex, const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); -- cgit v1.2.3 From 47687683873d79e39616904f16c6750818296b5d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 24 Mar 2011 14:54:54 +0100 Subject: gridfixes: #i117398# published two more types --- offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl | 2 +- offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl index 8c2726f42851..11bc34432674 100644 --- a/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl +++ b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl @@ -45,7 +45,7 @@ @since OOo 3.3.0 */ -service DefaultGridDataModel : ::com::sun::star::awt::grid::XMutableGridDataModel; +published service DefaultGridDataModel : ::com::sun::star::awt::grid::XMutableGridDataModel; //============================================================================= diff --git a/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl b/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl index 20749aaa0c8c..3c0fbf6b654a 100755 --- a/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl +++ b/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl @@ -39,7 +39,7 @@ module com { module sun { module star { module awt { module grid { /** allows to modify the data represented by a XGridDataModel */ -interface XMutableGridDataModel : XGridDataModel +published interface XMutableGridDataModel : XGridDataModel { /** appends a row to the model. -- cgit v1.2.3 From 587cef09950e546b918a31db7d0d0a61035e814d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Mar 2011 11:20:23 +0100 Subject: gridfixes: added missing 'published' keywords --- offapi/com/sun/star/awt/grid/GridDataEvent.idl | 2 +- offapi/com/sun/star/awt/grid/XGridDataListener.idl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/offapi/com/sun/star/awt/grid/GridDataEvent.idl b/offapi/com/sun/star/awt/grid/GridDataEvent.idl index 7430f3d97e66..738b11ed745a 100644 --- a/offapi/com/sun/star/awt/grid/GridDataEvent.idl +++ b/offapi/com/sun/star/awt/grid/GridDataEvent.idl @@ -45,7 +45,7 @@ module com { module sun { module star { module awt { module grid { @since OOo 3.3 */ -struct GridDataEvent: com::sun::star::lang::EventObject +published struct GridDataEvent: com::sun::star::lang::EventObject { /** denotes the first column affected by a change. diff --git a/offapi/com/sun/star/awt/grid/XGridDataListener.idl b/offapi/com/sun/star/awt/grid/XGridDataListener.idl index 9a324aee2668..9840ff9bf779 100644 --- a/offapi/com/sun/star/awt/grid/XGridDataListener.idl +++ b/offapi/com/sun/star/awt/grid/XGridDataListener.idl @@ -49,7 +49,7 @@ module com { module sun { module star { module awt { module grid { @since OOo 3.3 */ -interface XGridDataListener: com::sun::star::lang::XEventListener +published interface XGridDataListener: com::sun::star::lang::XEventListener { /** is called when one or more rows of data have been inserted into a grid control's data model. -- cgit v1.2.3 From aaaf2f77d42fb8b5c997cbf0b71192e29d11dc5a Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Mar 2011 12:14:09 +0100 Subject: gridfixes: added forgotten includes (how did this compile?) --- svtools/source/table/cellvalueconversion.cxx | 2 ++ svtools/source/table/gridtablerenderer.cxx | 1 + 2 files changed, 3 insertions(+) diff --git a/svtools/source/table/cellvalueconversion.cxx b/svtools/source/table/cellvalueconversion.cxx index 6e4d4a4ab7b9..18e28c2cdc82 100755 --- a/svtools/source/table/cellvalueconversion.cxx +++ b/svtools/source/table/cellvalueconversion.cxx @@ -34,11 +34,13 @@ #include #include #include +#include #include #include /** === end UNO includes === **/ #include +#include #include #include #include diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index 247da41e9b6a..35dd636d0e74 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -36,6 +36,7 @@ /** === end UNO includes === **/ #include +#include #include #include #include -- cgit v1.2.3 From fe45eb1b91ec13c6cdfa0e47c1dc295b76fea309 Mon Sep 17 00:00:00 2001 From: "Wolfram Garten [wg]" Date: Fri, 25 Mar 2011 12:26:03 +0100 Subject: i117548: [Automation]: fixing file header problem for some testfiles. --- testautomation/graphics/optional/includes/global/g_clipboard.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/graphics/optional/includes/global/g_clipboard.inc b/testautomation/graphics/optional/includes/global/g_clipboard.inc index 8da14643d748..2be5461617bd 100644 --- a/testautomation/graphics/optional/includes/global/g_clipboard.inc +++ b/testautomation/graphics/optional/includes/global/g_clipboard.inc @@ -29,7 +29,7 @@ '* '* short description : '* -'************************************************************************************** +'\************************************************************************************** testcase tiEditUndo -- cgit v1.2.3 From 1d353781ad23b39100e29cafd86fab4599ac55fd Mon Sep 17 00:00:00 2001 From: "Wolfram Garten [wg]" Date: Fri, 25 Mar 2011 12:26:25 +0100 Subject: i117548: [Automation]: fixing file header problem for some testfiles. --- testautomation/graphics/optional/includes/global/g_convertto.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/graphics/optional/includes/global/g_convertto.inc b/testautomation/graphics/optional/includes/global/g_convertto.inc index 3a829b1ef275..69719accd4e8 100644 --- a/testautomation/graphics/optional/includes/global/g_convertto.inc +++ b/testautomation/graphics/optional/includes/global/g_convertto.inc @@ -29,7 +29,7 @@ '* '* short description : '* -'************************************************************************************** +'\************************************************************************************** ' Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\columbia.dxf") ' Call hGrafikEinfuegen ConvertPath ( gTesttoolPath + "global\input\graf_inp\enter.bmp" ) -- cgit v1.2.3 From 8d94bc3f1c18b55786316fa6bc30c2140da4cdef Mon Sep 17 00:00:00 2001 From: "Wolfram Garten [wg]" Date: Fri, 25 Mar 2011 12:26:43 +0100 Subject: i117548: [Automation]: fixing file header problem for some testfiles. --- testautomation/graphics/optional/includes/global/g_insert.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/graphics/optional/includes/global/g_insert.inc b/testautomation/graphics/optional/includes/global/g_insert.inc index 44d9030413ea..67196c3145d6 100644 --- a/testautomation/graphics/optional/includes/global/g_insert.inc +++ b/testautomation/graphics/optional/includes/global/g_insert.inc @@ -29,7 +29,7 @@ '* '* short description : '* -'************************************************************************************** +'\************************************************************************************** testcase tdInsertObjectOleObjects -- cgit v1.2.3 From 22c8d587fb47249b0fe494feea901f40ce1aaea1 Mon Sep 17 00:00:00 2001 From: "Wolfram Garten [wg]" Date: Fri, 25 Mar 2011 12:26:56 +0100 Subject: i117548: [Automation]: fixing file header problem for some testfiles. --- testautomation/graphics/optional/includes/impress/i_headerfooter.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/graphics/optional/includes/impress/i_headerfooter.inc b/testautomation/graphics/optional/includes/impress/i_headerfooter.inc index d69a6762f886..390654350e29 100644 --- a/testautomation/graphics/optional/includes/impress/i_headerfooter.inc +++ b/testautomation/graphics/optional/includes/impress/i_headerfooter.inc @@ -29,7 +29,7 @@ '* '* short description : Tests the header-footer-function in Impress '* -'******************************************************************* +'\******************************************************************* testcase tiHeaderFooterSlide -- cgit v1.2.3 From f3e3742991b99d067d0024a0f060a7cbe621f7a7 Mon Sep 17 00:00:00 2001 From: "Wolfram Garten [wg]" Date: Fri, 25 Mar 2011 12:27:11 +0100 Subject: i117548: [Automation]: fixing file header problem for some testfiles. --- testautomation/graphics/optional/includes/impress/i_pengine1.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/graphics/optional/includes/impress/i_pengine1.inc b/testautomation/graphics/optional/includes/impress/i_pengine1.inc index ff4d2a035ef0..eeb6293ddb0d 100644 --- a/testautomation/graphics/optional/includes/impress/i_pengine1.inc +++ b/testautomation/graphics/optional/includes/impress/i_pengine1.inc @@ -29,7 +29,7 @@ '* '* short description : Tests the Engine for Presentation '* -'******************************************************************* +'\******************************************************************* testcase tiPengineTabEntrance -- cgit v1.2.3 From d797c9fe1d6975e01e1a203db31f6daf985900c1 Mon Sep 17 00:00:00 2001 From: "Wolfram Garten [wg]" Date: Fri, 25 Mar 2011 12:27:25 +0100 Subject: i117548: [Automation]: fixing file header problem for some testfiles. --- testautomation/graphics/optional/includes/impress/i_pengine2.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/graphics/optional/includes/impress/i_pengine2.inc b/testautomation/graphics/optional/includes/impress/i_pengine2.inc index 56d15f6eee37..5f89299c066d 100644 --- a/testautomation/graphics/optional/includes/impress/i_pengine2.inc +++ b/testautomation/graphics/optional/includes/impress/i_pengine2.inc @@ -29,7 +29,7 @@ '* '* short description : Tests the Presentation-Engines effects '* -'******************************************************************* +'\******************************************************************* testcase tiPengineAnimationEffectsPreview dim bError as boolean -- cgit v1.2.3 From 94682bf8f0d0dbc7c44b8460187b65bca31dfb60 Mon Sep 17 00:00:00 2001 From: "Wolfram Garten [wg]" Date: Fri, 25 Mar 2011 12:27:44 +0100 Subject: i117548: [Automation]: fixing file header problem for some testfiles. --- testautomation/graphics/optional/includes/impress/i_saveloadlayout.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/graphics/optional/includes/impress/i_saveloadlayout.inc b/testautomation/graphics/optional/includes/impress/i_saveloadlayout.inc index 06a7ac89cf9d..87f72b3e6673 100644 --- a/testautomation/graphics/optional/includes/impress/i_saveloadlayout.inc +++ b/testautomation/graphics/optional/includes/impress/i_saveloadlayout.inc @@ -29,7 +29,7 @@ '* '* short description: Save & Load testing of Layout -templates. '* -'************************************************************************************** +'\************************************************************************************** testcase tSaveLoadLayoutEmpty Dim NewFileDir as String -- cgit v1.2.3 From f79cbf2a85542d464a72a8b19423345b5f7bbb6e Mon Sep 17 00:00:00 2001 From: "Wolfram Garten [wg]" Date: Fri, 25 Mar 2011 12:28:03 +0100 Subject: i117548: [Automation]: fixing file header problem for some testfiles. --- testautomation/graphics/optional/includes/impress/i_slidelayer.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/graphics/optional/includes/impress/i_slidelayer.inc b/testautomation/graphics/optional/includes/impress/i_slidelayer.inc index 508394144663..8b9504e7a5be 100644 --- a/testautomation/graphics/optional/includes/impress/i_slidelayer.inc +++ b/testautomation/graphics/optional/includes/impress/i_slidelayer.inc @@ -29,7 +29,7 @@ '* '* short description : '* -'********************************************************************* +'\********************************************************************* ' Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\enter.bmp") ' Inhalt.SetText ConvertPath (gTesttoolPath + "graphics\required\input\leer.sxd") -- cgit v1.2.3 From 761ac8c18debf4029c967af6174aed0a0dba482c Mon Sep 17 00:00:00 2001 From: "Wolfram Garten [wg]" Date: Fri, 25 Mar 2011 12:28:16 +0100 Subject: i117548: [Automation]: fixing file header problem for some testfiles. --- testautomation/graphics/optional/includes/impress/i_slideshow2.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/graphics/optional/includes/impress/i_slideshow2.inc b/testautomation/graphics/optional/includes/impress/i_slideshow2.inc index 2df33261c6f2..f409aeb2e9f6 100644 --- a/testautomation/graphics/optional/includes/impress/i_slideshow2.inc +++ b/testautomation/graphics/optional/includes/impress/i_slideshow2.inc @@ -29,7 +29,7 @@ '* '* short description : '* -'******************************************************************* +'\******************************************************************* testcase tPraesentationAnimation -- cgit v1.2.3 From 2beef9d4a063ca4a29a6f7916f11b7006d0f1af7 Mon Sep 17 00:00:00 2001 From: "Wolfram Garten [wg]" Date: Fri, 25 Mar 2011 12:28:31 +0100 Subject: i117548: [Automation]: fixing file header problem for some testfiles. --- testautomation/graphics/optional/includes/impress/i_slideshow3.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testautomation/graphics/optional/includes/impress/i_slideshow3.inc b/testautomation/graphics/optional/includes/impress/i_slideshow3.inc index 52858e22e7cf..eee2416a1723 100644 --- a/testautomation/graphics/optional/includes/impress/i_slideshow3.inc +++ b/testautomation/graphics/optional/includes/impress/i_slideshow3.inc @@ -29,7 +29,7 @@ '* '* short description : '* -'******************************************************************* +'\******************************************************************* testcase tExtrasInteraktion -- cgit v1.2.3 From 5336c85f0c025c8b29742a881d51ce154d82a532 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Mar 2011 12:36:07 +0100 Subject: fs34b: make compile on Solaris --- stoc/source/inspect/introspection.cxx | 172 +++++++++++++++++----------------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index 626dfb905f2b..22dd4d749598 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -727,6 +727,92 @@ void IntrospectionAccessStatic_Impl::checkInterfaceArraySize( Sequence< Referenc } +//******************************* +//*** ImplIntrospectionAccess *** +//******************************* + +// Neue Impl-Klasse im Rahmen der Introspection-Umstellung auf Instanz-gebundene +// Introspection mit Property-Zugriff ueber XPropertySet. Die alte Klasse +// ImplIntrospectionAccess lebt als IntrospectionAccessStatic_Impl +class ImplIntrospectionAccess : public IntrospectionAccessHelper +{ + friend class ImplIntrospection; + + // Untersuchtes Objekt + Any maInspectedObject; + + // Als Interface + Reference mxIface; + + // Statische Daten der Introspection + IntrospectionAccessStatic_Impl* mpStaticImpl; + + // Adapter-Implementation + WeakReference< XInterface > maAdapter; + + // Letzte Sequence, die bei getProperties geliefert wurde (Optimierung) + Sequence maLastPropertySeq; + sal_Int32 mnLastPropertyConcept; + + // Letzte Sequence, die bei getMethods geliefert wurde (Optimierung) + Sequence > maLastMethodSeq; + sal_Int32 mnLastMethodConcept; + +public: + ImplIntrospectionAccess( const Any& obj, IntrospectionAccessStatic_Impl* pStaticImpl_ ); + ~ImplIntrospectionAccess(); + + // Methoden von XIntrospectionAccess + virtual sal_Int32 SAL_CALL getSuppliedMethodConcepts(void) + throw( RuntimeException ); + virtual sal_Int32 SAL_CALL getSuppliedPropertyConcepts(void) + throw( RuntimeException ); + virtual Property SAL_CALL getProperty(const ::rtl::OUString& Name, sal_Int32 PropertyConcepts) + throw( NoSuchElementException, RuntimeException ); + virtual sal_Bool SAL_CALL hasProperty(const ::rtl::OUString& Name, sal_Int32 PropertyConcepts) + throw( RuntimeException ); + virtual Sequence< Property > SAL_CALL getProperties(sal_Int32 PropertyConcepts) + throw( RuntimeException ); + virtual Reference SAL_CALL getMethod(const ::rtl::OUString& Name, sal_Int32 MethodConcepts) + throw( NoSuchMethodException, RuntimeException ); + virtual sal_Bool SAL_CALL hasMethod(const ::rtl::OUString& Name, sal_Int32 MethodConcepts) + throw( RuntimeException ); + virtual Sequence< Reference > SAL_CALL getMethods(sal_Int32 MethodConcepts) + throw( RuntimeException ); + virtual Sequence< Type > SAL_CALL getSupportedListeners(void) + throw( RuntimeException ); + using OWeakObject::queryAdapter; + virtual Reference SAL_CALL queryAdapter( const Type& rType ) + throw( IllegalTypeException, RuntimeException ); + + // Methoden von XMaterialHolder + virtual Any SAL_CALL getMaterial(void) throw(RuntimeException); + + // Methoden von XExactName + virtual ::rtl::OUString SAL_CALL getExactName( const ::rtl::OUString& rApproximateName ) throw( RuntimeException ); +}; + +ImplIntrospectionAccess::ImplIntrospectionAccess + ( const Any& obj, IntrospectionAccessStatic_Impl* pStaticImpl_ ) + : maInspectedObject( obj ), mpStaticImpl( pStaticImpl_ ), maAdapter() +{ + mpStaticImpl->acquire(); + + // Objekt als Interface merken, wenn moeglich + TypeClass eType = maInspectedObject.getValueType().getTypeClass(); + if( eType == TypeClass_INTERFACE ) + mxIface = *(Reference*)maInspectedObject.getValue(); + + mnLastPropertyConcept = -1; + mnLastMethodConcept = -1; +} + +ImplIntrospectionAccess::~ImplIntrospectionAccess() +{ + mpStaticImpl->release(); +} + + //******************************* //*** ImplIntrospectionAdapter *** //******************************* @@ -899,92 +985,6 @@ Any SAL_CALL ImplIntrospectionAdapter::queryInterface( const Type& rType ) } -//******************************* -//*** ImplIntrospectionAccess *** -//******************************* - -// Neue Impl-Klasse im Rahmen der Introspection-Umstellung auf Instanz-gebundene -// Introspection mit Property-Zugriff ueber XPropertySet. Die alte Klasse -// ImplIntrospectionAccess lebt als IntrospectionAccessStatic_Impl -class ImplIntrospectionAccess : public IntrospectionAccessHelper -{ - friend class ImplIntrospection; - - // Untersuchtes Objekt - Any maInspectedObject; - - // Als Interface - Reference mxIface; - - // Statische Daten der Introspection - IntrospectionAccessStatic_Impl* mpStaticImpl; - - // Adapter-Implementation - WeakReference< XInterface > maAdapter; - - // Letzte Sequence, die bei getProperties geliefert wurde (Optimierung) - Sequence maLastPropertySeq; - sal_Int32 mnLastPropertyConcept; - - // Letzte Sequence, die bei getMethods geliefert wurde (Optimierung) - Sequence > maLastMethodSeq; - sal_Int32 mnLastMethodConcept; - -public: - ImplIntrospectionAccess( const Any& obj, IntrospectionAccessStatic_Impl* pStaticImpl_ ); - ~ImplIntrospectionAccess(); - - // Methoden von XIntrospectionAccess - virtual sal_Int32 SAL_CALL getSuppliedMethodConcepts(void) - throw( RuntimeException ); - virtual sal_Int32 SAL_CALL getSuppliedPropertyConcepts(void) - throw( RuntimeException ); - virtual Property SAL_CALL getProperty(const ::rtl::OUString& Name, sal_Int32 PropertyConcepts) - throw( NoSuchElementException, RuntimeException ); - virtual sal_Bool SAL_CALL hasProperty(const ::rtl::OUString& Name, sal_Int32 PropertyConcepts) - throw( RuntimeException ); - virtual Sequence< Property > SAL_CALL getProperties(sal_Int32 PropertyConcepts) - throw( RuntimeException ); - virtual Reference SAL_CALL getMethod(const ::rtl::OUString& Name, sal_Int32 MethodConcepts) - throw( NoSuchMethodException, RuntimeException ); - virtual sal_Bool SAL_CALL hasMethod(const ::rtl::OUString& Name, sal_Int32 MethodConcepts) - throw( RuntimeException ); - virtual Sequence< Reference > SAL_CALL getMethods(sal_Int32 MethodConcepts) - throw( RuntimeException ); - virtual Sequence< Type > SAL_CALL getSupportedListeners(void) - throw( RuntimeException ); - using OWeakObject::queryAdapter; - virtual Reference SAL_CALL queryAdapter( const Type& rType ) - throw( IllegalTypeException, RuntimeException ); - - // Methoden von XMaterialHolder - virtual Any SAL_CALL getMaterial(void) throw(RuntimeException); - - // Methoden von XExactName - virtual ::rtl::OUString SAL_CALL getExactName( const ::rtl::OUString& rApproximateName ) throw( RuntimeException ); -}; - -ImplIntrospectionAccess::ImplIntrospectionAccess - ( const Any& obj, IntrospectionAccessStatic_Impl* pStaticImpl_ ) - : maInspectedObject( obj ), mpStaticImpl( pStaticImpl_ ), maAdapter() -{ - mpStaticImpl->acquire(); - - // Objekt als Interface merken, wenn moeglich - TypeClass eType = maInspectedObject.getValueType().getTypeClass(); - if( eType == TypeClass_INTERFACE ) - mxIface = *(Reference*)maInspectedObject.getValue(); - - mnLastPropertyConcept = -1; - mnLastMethodConcept = -1; -} - -ImplIntrospectionAccess::~ImplIntrospectionAccess() -{ - mpStaticImpl->release(); -} - - //*************************************************** //*** Implementation von ImplIntrospectionAdapter *** //*************************************************** -- cgit v1.2.3 From cb4dc2368a4fd577fec65c0b5ed05e89a51d9f2d Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Mar 2011 14:07:15 +0100 Subject: gridfixes: corrected @since tag to pass autodoc --- offapi/com/sun/star/awt/grid/XGridColumnListener.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl index 52e1b4733953..be1b0b1714a1 100644 --- a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl +++ b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl @@ -39,7 +39,7 @@ module com { module sun { module star { module awt { module grid { /** An instance of this interface is used by the XGridColumnModel to get notifications about column model changes. - @since OOo 3.3.0 + @since OOo 3.3 */ published interface XGridColumnListener : ::com::sun::star::lang::XEventListener { -- cgit v1.2.3 From 6cff2336809d144488780a621b45fd75ca1232f7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 25 Mar 2011 15:00:20 +0100 Subject: gridfixes: GCC WaE --- toolkit/source/controls/grid/sortablegriddatamodel.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index 8f32644c62e0..abfa123df0de 100755 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx @@ -617,7 +617,7 @@ namespace toolkit Reference< XMutableGridDataModel > const delegator( m_delegator ); aGuard.clear(); - delegator->insertRow( i_index, i_heading, i_data ); + delegator->insertRow( rowIndex, i_heading, i_data ); } //------------------------------------------------------------------------------------------------------------------ @@ -631,7 +631,7 @@ namespace toolkit Reference< XMutableGridDataModel > const delegator( m_delegator ); aGuard.clear(); - delegator->insertRows( i_index, i_headings, i_data ); + delegator->insertRows( rowIndex, i_headings, i_data ); } //------------------------------------------------------------------------------------------------------------------ -- cgit v1.2.3 From 36f99963c43c5d1ba517e74a28ffd5e6e198f5d9 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 27 Mar 2011 22:10:51 +0200 Subject: gridfixes: #i117549# finalize css.awt.tab API --- toolkit/inc/toolkit/awt/vclxtabpagecontainer.hxx | 6 +- toolkit/inc/toolkit/awt/vclxtabpagemodel.hxx | 4 +- .../toolkit/controls/controlmodelcontainerbase.hxx | 4 +- toolkit/inc/toolkit/controls/tabpagecontainer.hxx | 21 ++--- toolkit/inc/toolkit/controls/tabpagemodel.hxx | 49 ------------ toolkit/source/awt/vclxtabpagecontainer.cxx | 8 +- toolkit/source/awt/vclxtabpagemodel.cxx | 4 +- .../source/controls/controlmodelcontainerbase.cxx | 4 +- toolkit/source/controls/tabpagecontainer.cxx | 89 +++++++++++++++++----- toolkit/source/controls/tabpagemodel.cxx | 66 ---------------- 10 files changed, 94 insertions(+), 161 deletions(-) diff --git a/toolkit/inc/toolkit/awt/vclxtabpagecontainer.hxx b/toolkit/inc/toolkit/awt/vclxtabpagecontainer.hxx index d4fe2a727b43..f9c7b01da551 100644 --- a/toolkit/inc/toolkit/awt/vclxtabpagecontainer.hxx +++ b/toolkit/inc/toolkit/awt/vclxtabpagecontainer.hxx @@ -63,12 +63,12 @@ public: // ::com::sun::star::awt::grid::XTabPageContainer virtual ::sal_Int16 SAL_CALL getActiveTabPageID() throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getTabPageCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int16 SAL_CALL getTabPageCount( ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Bool SAL_CALL isTabPageActive( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPage( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPageByID( ::sal_Int16 tabPageID ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addTabPageListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeTabPageListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addTabPageContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeTabPageContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException); static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } diff --git a/toolkit/inc/toolkit/awt/vclxtabpagemodel.hxx b/toolkit/inc/toolkit/awt/vclxtabpagemodel.hxx index 670ed25c0f2d..5d8237f2cacc 100644 --- a/toolkit/inc/toolkit/awt/vclxtabpagemodel.hxx +++ b/toolkit/inc/toolkit/awt/vclxtabpagemodel.hxx @@ -74,8 +74,8 @@ public: virtual void SAL_CALL setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getImageURL() throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getTooltip() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getToolTip() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setToolTip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException); protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); }; diff --git a/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx index 3090eba68749..c607a48f66cd 100644 --- a/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx +++ b/toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx @@ -173,8 +173,8 @@ public: virtual void SAL_CALL setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getImageURL() throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getTooltip() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getToolTip() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setToolTip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException); protected: void startControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel ); diff --git a/toolkit/inc/toolkit/controls/tabpagecontainer.hxx b/toolkit/inc/toolkit/controls/tabpagecontainer.hxx index c7a2e3b8ef90..c660edf2e3e9 100644 --- a/toolkit/inc/toolkit/controls/tabpagecontainer.hxx +++ b/toolkit/inc/toolkit/controls/tabpagecontainer.hxx @@ -76,28 +76,29 @@ public: // ::com::sun::star::lang::XServiceInfo DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageContainerModel, UnoControlModel, szServiceName_UnoControlTabPageContainerModel ) + + // XTabPageContainerModel + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageModel > SAL_CALL createTabPage( ::sal_Int16 TabPageID ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageModel > SAL_CALL loadTabPage( ::sal_Int16 TabPageID, const ::rtl::OUString& ResourceURL ) throw (::com::sun::star::uno::RuntimeException); + // XIndexContainer virtual void SAL_CALL insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeByIndex( sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - // XIndexReplace + // XIndexReplace virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - // XIndexAccess + // XIndexAccess virtual sal_Int32 SAL_CALL getCount() throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - // XElementAccess + // XElementAccess virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw (::com::sun::star::uno::RuntimeException); - //{ - //return ::getCppuType((com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >*)0); - //} - virtual sal_Bool SAL_CALL hasElements() throw (::com::sun::star::uno::RuntimeException); // ::com::sun::star::container::XContainer @@ -125,12 +126,12 @@ public: // ::com::sun::star::awt::tab::XTabPageContainer virtual ::sal_Int16 SAL_CALL getActiveTabPageID() throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getTabPageCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int16 SAL_CALL getTabPageCount( ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Bool SAL_CALL isTabPageActive( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPage( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPageByID( ::sal_Int16 tabPageID ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addTabPageListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeTabPageListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addTabPageContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeTabPageContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL addControl( const ::rtl::OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& Control ) throw (::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo diff --git a/toolkit/inc/toolkit/controls/tabpagemodel.hxx b/toolkit/inc/toolkit/controls/tabpagemodel.hxx index 8d180deb2f97..68924b831af4 100644 --- a/toolkit/inc/toolkit/controls/tabpagemodel.hxx +++ b/toolkit/inc/toolkit/controls/tabpagemodel.hxx @@ -40,55 +40,6 @@ #include #include -// ---------------------------------------------------- -// class TabPageModel -// ---------------------------------------------------- -//typedef ::cppu::ImplHelper2< ::com::sun::star::awt::tab::XTabPageModel, -// ::com::sun::star::lang::XInitialization -// > TabPageAccess_BASE; -// -//class TabPageModel : public TabPageAccess_BASE -//{ -// -//private: -// bool m_bEnabled; -// ::rtl::OUString m_sTitle; -// ::rtl::OUString m_sImageURL; -// ::rtl::OUString m_sTooltip; -// sal_Int16 m_nTabPageId; -// -//public: -// TabPageModel(); -// explicit TabPageModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xCompContext); -// ~TabPageModel(); -// -// // XInitialization -// virtual void SAL_CALL initialize (const com::sun::star::uno::Sequence& rArguments) -// throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); -// -// ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); -// void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } -// void SAL_CALL release() throw() { OWeakAggObject::release(); } -// -// // ::com::sun::star::lang::XTypeProvider -// //::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); -// //::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); -// -// // ::com::sun::star::awt::tab::XTabPageModel -// virtual ::sal_Int16 SAL_CALL getTabPageID() throw (::com::sun::star::uno::RuntimeException); -// virtual ::sal_Bool SAL_CALL getEnabled() throw (::com::sun::star::uno::RuntimeException); -// virtual void SAL_CALL setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException); -// virtual ::rtl::OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException); -// virtual void SAL_CALL setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException); -// virtual ::rtl::OUString SAL_CALL getImageURL() throw (::com::sun::star::uno::RuntimeException); -// virtual void SAL_CALL setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException); -// virtual ::rtl::OUString SAL_CALL getTooltip() throw (::com::sun::star::uno::RuntimeException); -// virtual void SAL_CALL setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException); -//}; -// ---------------------------------------------------- -// class UnoControlTabPageModel -// ---------------------------------------------------- - class UnoControlTabPageModel : public ControlModelContainerBase //public TabPageModel { diff --git a/toolkit/source/awt/vclxtabpagecontainer.cxx b/toolkit/source/awt/vclxtabpagecontainer.cxx index d4f7a5048701..64337153dac1 100644 --- a/toolkit/source/awt/vclxtabpagecontainer.cxx +++ b/toolkit/source/awt/vclxtabpagecontainer.cxx @@ -126,7 +126,7 @@ void SAL_CALL VCLXTabPageContainer::setActiveTabPageID( ::sal_Int16 _activetabpa if ( pTabCtrl ) pTabCtrl->SelectTabPage(_activetabpageid); } -::sal_Int32 SAL_CALL VCLXTabPageContainer::getTabPageCount( ) throw (RuntimeException) +::sal_Int16 SAL_CALL VCLXTabPageContainer::getTabPageCount( ) throw (RuntimeException) { TabControl* pTabCtrl = (TabControl*)GetWindow(); return pTabCtrl != NULL ? pTabCtrl->GetPageCount() : 0; @@ -157,11 +157,11 @@ Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL VCLXTabPageContainer: } return xTabPage; } -void SAL_CALL VCLXTabPageContainer::addTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException) +void SAL_CALL VCLXTabPageContainer::addTabPageContainerListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException) { m_aTabPageListeners.addInterface( listener ); } -void SAL_CALL VCLXTabPageContainer::removeTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException) +void SAL_CALL VCLXTabPageContainer::removeTabPageContainerListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException) { m_aTabPageListeners.removeInterface( listener ); } @@ -209,7 +209,7 @@ void SAL_CALL VCLXTabPageContainer::elementInserted( const ::com::sun::star::con pPage->Hide(); pTabCtrl->SetTabPage(nPageID,pPage); - pTabCtrl->SetHelpText(nPageID,xP->getTooltip()); + pTabCtrl->SetHelpText(nPageID,xP->getToolTip()); pTabCtrl->SetPageImage(nPageID,TkResMgr::getImageFromURL(xP->getImageURL())); pTabCtrl->SelectTabPage(nPageID); m_aTabPages.push_back(xTabPage); diff --git a/toolkit/source/awt/vclxtabpagemodel.cxx b/toolkit/source/awt/vclxtabpagemodel.cxx index c7145992bd7f..936a2301dcb4 100644 --- a/toolkit/source/awt/vclxtabpagemodel.cxx +++ b/toolkit/source/awt/vclxtabpagemodel.cxx @@ -124,12 +124,12 @@ void SAL_CALL VCLXTabPageModel::setImageURL( const ::rtl::OUString& /*_imageurl* { //m_sImageURL = _imageurl; } -::rtl::OUString SAL_CALL VCLXTabPageModel::getTooltip() throw (::com::sun::star::uno::RuntimeException) +::rtl::OUString SAL_CALL VCLXTabPageModel::getToolTip() throw (::com::sun::star::uno::RuntimeException) { //return m_sTooltip; return ::rtl::OUString::createFromAscii(""); } -void SAL_CALL VCLXTabPageModel::setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL VCLXTabPageModel::setToolTip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException) { (void)_tooltip; } diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 1cd40032b31f..3041da60af89 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -785,11 +785,11 @@ void SAL_CALL ControlModelContainerBase::setImageURL( const ::rtl::OUString& _im { m_sImageURL = _imageurl; } -::rtl::OUString SAL_CALL ControlModelContainerBase::getTooltip() throw (::com::sun::star::uno::RuntimeException) +::rtl::OUString SAL_CALL ControlModelContainerBase::getToolTip() throw (::com::sun::star::uno::RuntimeException) { return m_sTooltip; } -void SAL_CALL ControlModelContainerBase::setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException) +void SAL_CALL ControlModelContainerBase::setToolTip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException) { m_sTooltip = _tooltip; } diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx index 808feca02e8a..387e5a50b033 100644 --- a/toolkit/source/controls/tabpagecontainer.cxx +++ b/toolkit/source/controls/tabpagecontainer.cxx @@ -28,19 +28,21 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_toolkit.hxx" +#include #include - -#include -#include +#include #include -#include +#include + +#include #include +#include + #include #include +#include #include #include -#include -#include using ::rtl::OUString; using namespace ::com::sun::star; @@ -49,6 +51,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::view; +using ::com::sun::star::awt::tab::XTabPageModel; #define WRONG_TYPE_EXCEPTION "Type must be ::com::sun::star::awt::tab::XTabPageModel!" // ---------------------------------------------------- @@ -89,13 +92,13 @@ uno::Any UnoControlTabPageContainerModel::ImplGetDefaultValue( sal_uInt16 nPropI ::cppu::IPropertyArrayHelper& UnoControlTabPageContainerModel::getInfoHelper() { - static UnoPropertyArrayHelper* pHelper = NULL; - if ( !pHelper ) - { + static UnoPropertyArrayHelper* pHelper = NULL; + if ( !pHelper ) + { com::sun::star::uno::Sequence aIDs = ImplGetPropertyIds(); - pHelper = new UnoPropertyArrayHelper( aIDs ); + pHelper = new UnoPropertyArrayHelper( aIDs ); } - return *pHelper; + return *pHelper; } Reference< ::com::sun::star::beans::XPropertySetInfo > UnoControlTabPageContainerModel::getPropertySetInfo( ) throw(RuntimeException) { @@ -103,17 +106,61 @@ Reference< ::com::sun::star::beans::XPropertySetInfo > UnoControlTabPageContaine return xInfo; } +namespace +{ + Reference< XTabPageModel > lcl_createTabPageModel( ::comphelper::ComponentContext const & i_context, + Sequence< Any > const & i_initArguments ) + { + try + { + Reference< XTabPageModel > const xTabPageModel( + *( new OGeometryControlModel< UnoControlTabPageModel >( i_context.getLegacyServiceFactory() ) ), + UNO_QUERY_THROW + ); + + Reference< XInitialization > const xInit( xTabPageModel, UNO_QUERY_THROW ); + xInit->initialize( i_initArguments ); + + return xTabPageModel; + } + catch( const RuntimeException& ) + { + throw; + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return NULL; + } +} + +Reference< XTabPageModel > SAL_CALL UnoControlTabPageContainerModel::createTabPage( ::sal_Int16 i_tabPageID ) throw (RuntimeException) +{ + Sequence< Any > aInitArgs(1); + aInitArgs[0] <<= i_tabPageID; + return lcl_createTabPageModel( maContext, aInitArgs ); +} + +Reference< XTabPageModel > SAL_CALL UnoControlTabPageContainerModel::loadTabPage( ::sal_Int16 i_tabPageID, const ::rtl::OUString& i_resourceURL ) throw (RuntimeException) +{ + Sequence< Any > aInitArgs(2); + aInitArgs[0] <<= i_tabPageID; + aInitArgs[1] <<= i_resourceURL; + return lcl_createTabPageModel( maContext, aInitArgs ); +} + void SAL_CALL UnoControlTabPageContainerModel::insertByIndex( ::sal_Int32 nIndex, const com::sun::star::uno::Any& aElement) throw (IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException) { vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - uno::Reference < ::awt::tab::XTabPageModel > xTabPageModel; + uno::Reference < XTabPageModel > xTabPageModel; if(aElement >>= xTabPageModel) { if ( sal_Int32( m_aTabPageVector.size()) ==nIndex ) m_aTabPageVector.push_back( xTabPageModel ); else if ( sal_Int32( m_aTabPageVector.size()) > nIndex ) { - std::vector< uno::Reference< ::awt::tab::XTabPageModel > >::iterator aIter = m_aTabPageVector.begin(); + std::vector< uno::Reference< XTabPageModel > >::iterator aIter = m_aTabPageVector.begin(); aIter += nIndex; m_aTabPageVector.insert( aIter, xTabPageModel ); } @@ -167,12 +214,12 @@ uno::Type SAL_CALL UnoControlTabPageContainerModel::getElementType( ) throw (un // XContainer void UnoControlTabPageContainerModel::addContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException) { - maContainerListeners.addInterface( l ); + maContainerListeners.addInterface( l ); } void UnoControlTabPageContainerModel::removeContainerListener( const Reference< XContainerListener >& l ) throw(RuntimeException) { - maContainerListeners.removeInterface( l ); + maContainerListeners.removeInterface( l ); } // ---------------------------------------------------- @@ -203,7 +250,7 @@ void UnoControlTabPageContainer::createPeer( const uno::Reference< awt::XToolkit Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW ); if ( m_aTabPageListeners.getLength() ) - xTPContainer->addTabPageListener(&m_aTabPageListeners); + xTPContainer->addTabPageContainerListener(&m_aTabPageListeners); } // ------------------------------------------------------------------- @@ -221,7 +268,7 @@ void SAL_CALL UnoControlTabPageContainer::setActiveTabPageID( ::sal_Int16 _activ Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW ); xTPContainer->setActiveTabPageID(_activetabpageid); } -::sal_Int32 SAL_CALL UnoControlTabPageContainer::getTabPageCount( ) throw (RuntimeException) +::sal_Int16 SAL_CALL UnoControlTabPageContainer::getTabPageCount( ) throw (RuntimeException) { vos::OGuard aSolarGuard( Application::GetSolarMutex() ); Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW ); @@ -245,21 +292,21 @@ Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL UnoControlTabPageCont Reference< XTabPageContainer > xTPContainer( getPeer(), UNO_QUERY_THROW ); return xTPContainer->getTabPageByID(tabPageID); } -void SAL_CALL UnoControlTabPageContainer::addTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException) +void SAL_CALL UnoControlTabPageContainer::addTabPageContainerListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException) { m_aTabPageListeners.addInterface( listener ); if( getPeer().is() && m_aTabPageListeners.getLength() == 1 ) { uno::Reference < awt::tab::XTabPageContainer > xTabPageContainer( getPeer(), uno::UNO_QUERY ); - xTabPageContainer->addTabPageListener( &m_aTabPageListeners ); + xTabPageContainer->addTabPageContainerListener( &m_aTabPageListeners ); } } -void SAL_CALL UnoControlTabPageContainer::removeTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException) +void SAL_CALL UnoControlTabPageContainer::removeTabPageContainerListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException) { if( getPeer().is() && m_aTabPageListeners.getLength() == 1 ) { uno::Reference < awt::tab::XTabPageContainer > xTabPageContainer( getPeer(), uno::UNO_QUERY ); - xTabPageContainer->addTabPageListener( &m_aTabPageListeners ); + xTabPageContainer->addTabPageContainerListener( &m_aTabPageListeners ); } m_aTabPageListeners.removeInterface( listener ); } diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx index f498fefd761b..834b7f92e013 100644 --- a/toolkit/source/controls/tabpagemodel.cxx +++ b/toolkit/source/controls/tabpagemodel.cxx @@ -74,72 +74,6 @@ using namespace ::com::sun::star::util; ////HELPER ::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl ); -// ---------------------------------------------------- -// class TabPageModel -// ---------------------------------------------------- - -//TabPageModel::TabPageModel() -//{ -//} -//TabPageModel::TabPageModel( uno::Reference< uno::XComponentContext > const & xCompContext) -//{ -// (void) xCompContext; -//} -// -//TabPageModel::~TabPageModel() -//{ -//} -// -//////----- XInitialization ------------------------------------------------------------------- -//void SAL_CALL TabPageModel::initialize (const Sequence& rArguments) -//{ -// sal_Int16 nPageId; -// if ( rArguments.getLength() == 1 ) -// { -// if ( !( rArguments[ 0 ] >>= nPageId )) -// throw lang::IllegalArgumentException(); -// m_nTabPageId = nPageId; -// } -// else -// m_nTabPageId = -1; -//} -//::sal_Int16 SAL_CALL TabPageModel::getTabPageID() throw (::com::sun::star::uno::RuntimeException) -//{ -// return m_nTabPageId; -//} -//::sal_Bool SAL_CALL TabPageModel::getEnabled() throw (::com::sun::star::uno::RuntimeException) -//{ -// return m_bEnabled; -//} -//void SAL_CALL TabPageModel::setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException) -//{ -// m_bEnabled = _enabled; -//} -//::rtl::OUString SAL_CALL TabPageModel::getTitle() throw (::com::sun::star::uno::RuntimeException) -//{ -// return m_sTitle; -//} -//void SAL_CALL TabPageModel::setTitle( const ::rtl::OUString& _title ) throw (::com::sun::star::uno::RuntimeException) -//{ -// m_sTitle = _title; -//} -//::rtl::OUString SAL_CALL TabPageModel::getImageURL() throw (::com::sun::star::uno::RuntimeException) -//{ -// return m_sImageURL; -//} -//void SAL_CALL TabPageModel::setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException) -//{ -// m_sImageURL = _imageurl; -//} -//::rtl::OUString SAL_CALL TabPageModel::getTooltip() throw (::com::sun::star::uno::RuntimeException) -//{ -// return m_sTooltip; -//} -//void SAL_CALL TabPageModel::setTooltip( const ::rtl::OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException) -//{ -// m_sTooltip = _tooltip; -//} - // ---------------------------------------------------- // class UnoControlTabPageModel // ---------------------------------------------------- -- cgit v1.2.3 From 692667d2e32361f3624f9ac77b0ee7d1b4ebbfa4 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Sun, 27 Mar 2011 22:10:51 +0200 Subject: gridfixes: #i117549# finalize css.awt.tab API --- offapi/com/sun/star/awt/tab/TabPageActivatedEvent.idl | 2 +- offapi/com/sun/star/awt/tab/UnoControlTabPage.idl | 2 +- .../sun/star/awt/tab/UnoControlTabPageContainer.idl | 2 +- .../star/awt/tab/UnoControlTabPageContainerModel.idl | 2 +- .../com/sun/star/awt/tab/UnoControlTabPageModel.idl | 4 ++-- offapi/com/sun/star/awt/tab/XTabPage.idl | 2 +- offapi/com/sun/star/awt/tab/XTabPageContainer.idl | 8 ++++---- .../sun/star/awt/tab/XTabPageContainerListener.idl | 2 +- .../com/sun/star/awt/tab/XTabPageContainerModel.idl | 19 ++++++++++++++++++- offapi/com/sun/star/awt/tab/XTabPageModel.idl | 4 ++-- 10 files changed, 32 insertions(+), 15 deletions(-) diff --git a/offapi/com/sun/star/awt/tab/TabPageActivatedEvent.idl b/offapi/com/sun/star/awt/tab/TabPageActivatedEvent.idl index ef678395fe06..e3fd0c46b1db 100644 --- a/offapi/com/sun/star/awt/tab/TabPageActivatedEvent.idl +++ b/offapi/com/sun/star/awt/tab/TabPageActivatedEvent.idl @@ -41,7 +41,7 @@ module com { module sun { module star { module awt { module tab { @since OOo 3.4 */ -struct TabPageActivatedEvent: com::sun::star::lang::EventObject +published struct TabPageActivatedEvent: com::sun::star::lang::EventObject { /** Contains the ID of the tab page */ diff --git a/offapi/com/sun/star/awt/tab/UnoControlTabPage.idl b/offapi/com/sun/star/awt/tab/UnoControlTabPage.idl index 6244b18e0c77..b4ba2d156314 100644 --- a/offapi/com/sun/star/awt/tab/UnoControlTabPage.idl +++ b/offapi/com/sun/star/awt/tab/UnoControlTabPage.idl @@ -41,7 +41,7 @@ module com { module sun { module star { module awt { module tab { @since OOo 3.4 */ -service UnoControlTabPage +published service UnoControlTabPage { service com::sun::star::awt::UnoControlContainer; diff --git a/offapi/com/sun/star/awt/tab/UnoControlTabPageContainer.idl b/offapi/com/sun/star/awt/tab/UnoControlTabPageContainer.idl index 488ce4b5354a..081d5dda5f65 100644 --- a/offapi/com/sun/star/awt/tab/UnoControlTabPageContainer.idl +++ b/offapi/com/sun/star/awt/tab/UnoControlTabPageContainer.idl @@ -40,7 +40,7 @@ module com { module sun { module star { module awt { module tab { @since OOo 3.4 */ -service UnoControlTabPageContainer +published service UnoControlTabPageContainer { service com::sun::star::awt::UnoControl; diff --git a/offapi/com/sun/star/awt/tab/UnoControlTabPageContainerModel.idl b/offapi/com/sun/star/awt/tab/UnoControlTabPageContainerModel.idl index b97b7881b416..bb9a8456a330 100644 --- a/offapi/com/sun/star/awt/tab/UnoControlTabPageContainerModel.idl +++ b/offapi/com/sun/star/awt/tab/UnoControlTabPageContainerModel.idl @@ -40,7 +40,7 @@ module com { module sun { module star { module awt { module tab { @since OOo 3.4 */ -service UnoControlTabPageContainerModel +published service UnoControlTabPageContainerModel { service com::sun::star::awt::UnoControlModel; diff --git a/offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl b/offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl index 3508e33260c7..266f6a56119a 100644 --- a/offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl +++ b/offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl @@ -38,13 +38,13 @@ module com { module sun { module star { module awt { module tab { /** specifies the standard model of a XTabPageModel. @since OOo 3.4 */ -service UnoControlTabPageModel : XTabPageModel +published service UnoControlTabPageModel : XTabPageModel { /** Creates a new XTabPageModel with a given ID. */ create([in] short tabPageID); - /** Creates a new XTabPageModel with a given ID and a url which is used to load teh tab page model. + /** Creates a new XTabPageModel with a given ID and a url which is used to load the tab page model. */ load([in] short tabPageID,[in] string url); }; diff --git a/offapi/com/sun/star/awt/tab/XTabPage.idl b/offapi/com/sun/star/awt/tab/XTabPage.idl index 616820071f5b..0c79d34075d5 100644 --- a/offapi/com/sun/star/awt/tab/XTabPage.idl +++ b/offapi/com/sun/star/awt/tab/XTabPage.idl @@ -40,7 +40,7 @@ module com { module sun { module star { module awt { module tab { @since OOo 3.4 */ -interface XTabPage +published interface XTabPage { }; diff --git a/offapi/com/sun/star/awt/tab/XTabPageContainer.idl b/offapi/com/sun/star/awt/tab/XTabPageContainer.idl index e62cf4c365c1..cc4f9ebc9e3c 100644 --- a/offapi/com/sun/star/awt/tab/XTabPageContainer.idl +++ b/offapi/com/sun/star/awt/tab/XTabPageContainer.idl @@ -41,13 +41,13 @@ module com { module sun { module star { module awt { module tab { @since OOo 3.4 */ -interface XTabPageContainer +published interface XTabPageContainer { /** Returns the number of tab pages. @returns the number of tab pages. */ - long getTabPageCount(); + short getTabPageCount(); //------------------------------------------------------------------------- @@ -86,7 +86,7 @@ interface XTabPageContainer @param listener the listener to add. */ - [oneway] void addTabPageListener( [in] XTabPageContainerListener listener); + [oneway] void addTabPageContainerListener( [in] XTabPageContainerListener listener); //------------------------------------------------------------------------- @@ -94,7 +94,7 @@ interface XTabPageContainer @param listener the listener to remove. */ - [oneway] void removeTabPageListener( [in] XTabPageContainerListener listener); + [oneway] void removeTabPageContainerListener( [in] XTabPageContainerListener listener); //------------------------------------------------------------------------- /** Specifies the ID of the current active tab page. diff --git a/offapi/com/sun/star/awt/tab/XTabPageContainerListener.idl b/offapi/com/sun/star/awt/tab/XTabPageContainerListener.idl index f46951231513..6bfe04e5babe 100644 --- a/offapi/com/sun/star/awt/tab/XTabPageContainerListener.idl +++ b/offapi/com/sun/star/awt/tab/XTabPageContainerListener.idl @@ -41,7 +41,7 @@ module com { module sun { module star { module awt { module tab { @since OOo 3.4 */ -interface XTabPageContainerListener: com::sun::star::lang::XEventListener +published interface XTabPageContainerListener: com::sun::star::lang::XEventListener { //------------------------------------------------------------------------- /** Invoked after a tab page was activated. diff --git a/offapi/com/sun/star/awt/tab/XTabPageContainerModel.idl b/offapi/com/sun/star/awt/tab/XTabPageContainerModel.idl index cc815209a01d..e2ac2633363f 100644 --- a/offapi/com/sun/star/awt/tab/XTabPageContainerModel.idl +++ b/offapi/com/sun/star/awt/tab/XTabPageContainerModel.idl @@ -34,16 +34,33 @@ module com { module sun { module star { module awt { module tab { +published interface XTabPageModel; + //============================================================================= /** specifies an interface for a UnoControlTabPageContainerModel. @since OOo 3.4 */ -interface XTabPageContainerModel +published interface XTabPageContainerModel { interface com::sun::star::container::XIndexContainer; interface com::sun::star::container::XContainer; + + /** creates a TabPageModel which can be inserted into the container. + @param TabPageID + the id of the tab page + */ + XTabPageModel createTabPage( [in] short TabPageID ); + + /** creates a TabPageModel which can be inserted into the container, by loading it from a user interface + resource file. + @param TabPageID + the id of the tab page + @param ResourceURL + the URL of the user interface resource to load + */ + XTabPageModel loadTabPage( [in] short TabPageID, [in] string ResourceURL ); }; //============================================================================= diff --git a/offapi/com/sun/star/awt/tab/XTabPageModel.idl b/offapi/com/sun/star/awt/tab/XTabPageModel.idl index 15fae422bb17..9d98322a9449 100644 --- a/offapi/com/sun/star/awt/tab/XTabPageModel.idl +++ b/offapi/com/sun/star/awt/tab/XTabPageModel.idl @@ -43,7 +43,7 @@ module com { module sun { module star { module awt { module tab { @since OOo 3.4 */ -interface XTabPageModel +published interface XTabPageModel { //interface com::sun::star::lang::XMultiServiceFactory; @@ -76,7 +76,7 @@ interface XTabPageModel /** specifies a tooltip text that should be displayed in the tab bar. */ - [attribute] string Tooltip; + [attribute] string ToolTip; }; -- cgit v1.2.3 From c2a68abe9a838d960d1441024789294f0df60a89 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 28 Mar 2011 10:44:25 +0200 Subject: impress210: comment not needed parameter --- svx/source/svdraw/svdovirt.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index 53d81b54d27e..b276fcc375a4 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -148,7 +148,7 @@ const Rectangle& SdrVirtObj::GetLastBoundRect() const return aOutRect; } -void SdrVirtObj::RecalcBoundRect(bool bForced) +void SdrVirtObj::RecalcBoundRect(bool /*bForced*/) { aOutRect=rRefObj.GetCurrentBoundRect(); aOutRect+=aAnchor; -- cgit v1.2.3 From 2e090359ecde00a6e47e3d782b2ecb2ddd6984e6 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 28 Mar 2011 10:56:24 +0200 Subject: UNFINISHED: column resizing refactoring --- svtools/source/table/tablecontrol_impl.cxx | 590 +++++++++++++++++------------ svtools/source/table/tablecontrol_impl.hxx | 41 +- 2 files changed, 375 insertions(+), 256 deletions(-) diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index bb7be1c4ccfe..9c42b5ea3303 100755 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -50,6 +50,7 @@ #include #include +#include #define MIN_COLUMN_WIDTH_PIXEL 4 @@ -502,7 +503,7 @@ namespace svt { namespace table // recalc some model-dependent cached info impl_ni_updateCachedModelValues(); - impl_ni_updateScrollbars(); + impl_ni_relayout(); // completely invalidate m_rAntiImpl.Invalidate(); @@ -550,8 +551,8 @@ namespace svt { namespace table if ( i_first <= m_nCurRow ) goTo( m_nCurColumn, m_nCurRow + insertedRows ); - // adjust scrollbars - impl_ni_updateScrollbars(); + // relayout, since the scrollbar need might have changed + impl_ni_relayout(); // notify A1YY events if ( impl_isAccessibleAlive() ) @@ -611,8 +612,8 @@ namespace svt { namespace table m_nCurRow = ROW_INVALID; } - // adjust scrollbars - impl_ni_updateScrollbars(); + // relayout, since the scrollbar need might have changed + impl_ni_relayout(); // notify A11Y events if ( impl_isAccessibleAlive() ) @@ -642,8 +643,7 @@ namespace svt { namespace table void TableControl_Impl::columnInserted( ColPos const i_colIndex ) { m_nColumnCount = m_pModel->getColumnCount(); - impl_ni_updateColumnWidths(); - impl_ni_updateScrollbars(); + impl_ni_relayout(); m_rAntiImpl.Invalidate(); @@ -654,8 +654,7 @@ namespace svt { namespace table void TableControl_Impl::columnRemoved( ColPos const i_colIndex ) { m_nColumnCount = m_pModel->getColumnCount(); - impl_ni_updateColumnWidths(); - impl_ni_updateScrollbars(); + impl_ni_relayout(); m_rAntiImpl.Invalidate(); @@ -666,8 +665,7 @@ namespace svt { namespace table void TableControl_Impl::allColumnsRemoved() { m_nColumnCount = m_pModel->getColumnCount(); - impl_ni_updateColumnWidths(); - impl_ni_updateScrollbars(); + impl_ni_relayout(); m_rAntiImpl.Invalidate(); } @@ -684,11 +682,8 @@ namespace svt { namespace table //------------------------------------------------------------------------------------------------------------------ void TableControl_Impl::tableMetricsChanged() { - long const oldRowHeaderWidthPixel = m_nRowHeaderWidthPixel; impl_ni_updateCachedTableMetrics(); - if ( oldRowHeaderWidthPixel != m_nRowHeaderWidthPixel ) - impl_ni_updateColumnWidths(); - impl_ni_updateScrollbars(); + impl_ni_relayout(); m_rAntiImpl.Invalidate(); } @@ -718,9 +713,8 @@ namespace svt { namespace table { if ( !m_bUpdatingColWidths ) { - impl_ni_updateColumnWidths( i_column ); + impl_ni_relayout( i_column ); invalidate( TableAreaAll ); - impl_ni_updateScrollbars(); } nGroup &= ~COL_ATTRS_WIDTH; @@ -796,67 +790,157 @@ namespace svt { namespace table //------------------------------------------------------------------------------------------------------------------ void TableControl_Impl::impl_ni_updateCachedModelValues() { - m_pInputHandler.reset(); - m_nColumnCount = m_nRowCount = 0; - - impl_ni_updateCachedTableMetrics(); - impl_ni_updateColumnWidths(); - m_pInputHandler = m_pModel->getInputHandler(); if ( !m_pInputHandler ) m_pInputHandler.reset( new DefaultInputHandler ); m_nColumnCount = m_pModel->getColumnCount(); + if ( m_nLeftColumn >= m_nColumnCount ) + m_nLeftColumn = ( m_nColumnCount > 0 ) ? m_nColumnCount - 1 : 0; + m_nRowCount = m_pModel->getRowCount(); + if ( m_nTopRow >= m_nRowCount ) + m_nTopRow = ( m_nRowCount > 0 ) ? m_nRowCount - 1 : 0; + + impl_ni_updateCachedTableMetrics(); } //------------------------------------------------------------------------------------------------------------------ - void TableControl_Impl::impl_ni_updateColumnWidths( ColPos const i_assumeInflexibleColumnsUpToIncluding ) + namespace { - ENSURE_OR_RETURN_VOID( !m_bUpdatingColWidths, "TableControl_Impl::impl_ni_updateColumnWidths: recursive call detected!" ); + //.............................................................................................................. + /// determines whether a scrollbar is needed for the given values + bool lcl_determineScrollbarNeed( long const i_position, ScrollbarVisibility const i_visibility, + long const i_availableSpace, long const i_neededSpace ) + { + if ( i_visibility == ScrollbarShowNever ) + return false; + if ( i_visibility == ScrollbarShowAlways ) + return true; + if ( i_position > 0 ) + return true; + if ( i_availableSpace >= i_neededSpace ) + return false; + return true; + } - m_aColumnWidths.resize( 0 ); - if ( !m_pModel ) - return; + //.............................................................................................................. + void lcl_setButtonRepeat( Window& _rWindow, sal_uLong _nDelay ) + { + AllSettings aSettings = _rWindow.GetSettings(); + MouseSettings aMouseSettings = aSettings.GetMouseSettings(); - const TableSize colCount = m_pModel->getColumnCount(); - if ( colCount == 0 ) - return; + aMouseSettings.SetButtonRepeat( _nDelay ); + aSettings.SetMouseSettings( aMouseSettings ); - m_bUpdatingColWidths = true; - const ::comphelper::FlagGuard aWidthUpdateFlag( m_bUpdatingColWidths ); + _rWindow.SetSettings( aSettings, sal_True ); + } - m_aColumnWidths.reserve( colCount ); + //.............................................................................................................. + bool lcl_updateScrollbar( Window& _rParent, ScrollBar*& _rpBar, + bool const i_needBar, long _nVisibleUnits, + long _nPosition, long _nLineSize, long _nRange, + bool _bHorizontal, const Link& _rScrollHandler ) + { + // do we currently have the scrollbar? + bool bHaveBar = _rpBar != NULL; + + // do we need to correct the scrollbar visibility? + if ( bHaveBar && !i_needBar ) + { + if ( _rpBar->IsTracking() ) + _rpBar->EndTracking(); + DELETEZ( _rpBar ); + } + else if ( !bHaveBar && i_needBar ) + { + _rpBar = new ScrollBar( + &_rParent, + WB_DRAG | ( _bHorizontal ? WB_HSCROLL : WB_VSCROLL ) + ); + _rpBar->SetScrollHdl( _rScrollHandler ); + // get some speed into the scrolling .... + lcl_setButtonRepeat( *_rpBar, 0 ); + } + + if ( _rpBar ) + { + _rpBar->SetRange( Range( 0, _nRange ) ); + _rpBar->SetVisibleSize( _nVisibleUnits ); + _rpBar->SetPageSize( _nVisibleUnits ); + _rpBar->SetLineSize( _nLineSize ); + _rpBar->SetThumbPos( _nPosition ); + _rpBar->Show(); + } + + return ( bHaveBar != i_needBar ); + } + + //.............................................................................................................. + /** returns the number of rows fitting into the given range, + for the given row height. Partially fitting rows are counted, too, if the + respective parameter says so. + */ + TableSize lcl_getRowsFittingInto( long _nOverallHeight, long _nRowHeightPixel, bool _bAcceptPartialRow = false ) + { + return _bAcceptPartialRow + ? ( _nOverallHeight + ( _nRowHeightPixel - 1 ) ) / _nRowHeightPixel + : _nOverallHeight / _nRowHeightPixel; + } + //.............................................................................................................. + /** returns the number of columns fitting into the given area, + with the first visible column as given. Partially fitting columns are counted, too, + if the respective parameter says so. + */ + TableSize lcl_getColumnsVisibleWithin( const Rectangle& _rArea, ColPos _nFirstVisibleColumn, + const TableControl_Impl& _rControl, bool _bAcceptPartialRow ) + { + TableSize visibleColumns = 0; + TableColumnGeometry aColumn( _rControl, _rArea, _nFirstVisibleColumn ); + while ( aColumn.isValid() ) + { + if ( !_bAcceptPartialRow ) + if ( aColumn.getRect().Right() > _rArea.Right() ) + // this column is only partially visible, and this is not allowed + break; + + aColumn.moveRight(); + ++visibleColumns; + } + return visibleColumns; + } + + } + + //------------------------------------------------------------------------------------------------------------------ + long TableControl_Impl::impl_ni_calculateColumnWidths( ColPos const i_assumeInflexibleColumnsUpToIncluding, + bool const i_assumeVerticalScrollbar, ::std::vector< long >& o_newColWidthsPixel ) const + { // the available horizontal space long gridWidthPixel = m_rAntiImpl.GetOutputSizePixel().Width(); + ENSURE_OR_RETURN( !!m_pModel, "TableControl_Impl::impl_ni_calculateColumnWidths: not allowed without a model!", gridWidthPixel ); if ( m_pModel->hasRowHeaders() && ( gridWidthPixel != 0 ) ) { gridWidthPixel -= m_nRowHeaderWidthPixel; } - if ( m_pModel->getVerticalScrollbarVisibility() != ScrollbarShowNever ) + + if ( i_assumeVerticalScrollbar && ( m_pModel->getVerticalScrollbarVisibility() != ScrollbarShowNever ) ) { long nScrollbarMetrics = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize(); gridWidthPixel -= nScrollbarMetrics; } - // TODO: shouldn't we take the visibility of the vertical scroll bar into account here, too? - long const gridWidthAppFont = m_rAntiImpl.PixelToLogic( Size( gridWidthPixel, 0 ), MAP_APPFONT ).Width(); - - // determine the accumulated current width of all columns - for ( ColPos col = 0; col < colCount; ++col ) - { - const PColumnModel pColumn = m_pModel->getColumnModel( col ); - ENSURE_OR_THROW( !!pColumn, "invalid column returned by the model!" ); - - } + // no need to do anything without columns + TableSize const colCount = m_pModel->getColumnCount(); + if ( colCount == 0 ) + return gridWidthPixel; // collect some meta data for our columns: - // - their current (appt-font) metrics + // - their current (pixel) metrics long accumulatedCurrentWidth = 0; ::std::vector< long > currentColWidths; currentColWidths.reserve( colCount ); - // - their effective minimal and maximal width (app-font!) typedef ::std::vector< ::std::pair< long, long > > ColumnLimits; ColumnLimits effectiveColumnLimits; effectiveColumnLimits.reserve( colCount ); @@ -866,13 +950,14 @@ namespace svt { namespace table ::std::vector< ::sal_Int32 > columnFlexibilities; columnFlexibilities.reserve( colCount ); long flexibilityDenominator = 0; + size_t flexibleColumnCount = 0; for ( ColPos col = 0; col < colCount; ++col ) { PColumnModel const pColumn = m_pModel->getColumnModel( col ); ENSURE_OR_THROW( !!pColumn, "invalid column returned by the model!" ); // current width - TableMetrics const currentWidth = pColumn->getWidth(); + long const currentWidth = appFontWidthToPixel( pColumn->getWidth() ); currentColWidths.push_back( currentWidth ); // accumulated width @@ -880,7 +965,7 @@ namespace svt { namespace table // flexibility ::sal_Int32 flexibility = pColumn->getFlexibility(); - OSL_ENSURE( flexibility >= 0, "TableControl_Impl::impl_ni_updateColumnWidths: a column's flexibility should be non-negative." ); + OSL_ENSURE( flexibility >= 0, "TableControl_Impl::impl_ni_calculateColumnWidths: a column's flexibility should be non-negative." ); if ( ( flexibility < 0 ) // normalization || ( !pColumn->isResizable() ) // column not resizeable => no auto-resize || ( col <= i_assumeInflexibleColumnsUpToIncluding ) // column shall be treated as inflexible => respec this @@ -892,18 +977,18 @@ namespace svt { namespace table // if the column is not flexible, it will not be asked for min/max, but we assume the current width as limit then if ( flexibility > 0 ) { - long const minWidth = pColumn->getMinWidth(); + long const minWidth = appFontWidthToPixel( pColumn->getMinWidth() ); if ( minWidth > 0 ) effectiveMin = minWidth; else effectiveMin = MIN_COLUMN_WIDTH_PIXEL; - long const maxWidth = pColumn->getMaxWidth(); - OSL_ENSURE( minWidth <= maxWidth, "TableControl_Impl::impl_ni_updateColumnWidths: pretty undecided 'bout its width limits, this column!" ); + long const maxWidth = appFontWidthToPixel( pColumn->getMaxWidth() ); + OSL_ENSURE( minWidth <= maxWidth, "TableControl_Impl::impl_ni_calculateColumnWidths: pretty undecided 'bout its width limits, this column!" ); if ( ( maxWidth > 0 ) && ( maxWidth >= minWidth ) ) effectiveMax = maxWidth; else - effectiveMax = gridWidthAppFont; // TODO: any better guess here? + effectiveMax = gridWidthPixel; // TODO: any better guess here? if ( effectiveMin == effectiveMax ) // if the min and the max are identical, this implies no flexibility at all @@ -912,27 +997,29 @@ namespace svt { namespace table columnFlexibilities.push_back( flexibility ); flexibilityDenominator += flexibility; + if ( flexibility > 0 ) + ++flexibleColumnCount; effectiveColumnLimits.push_back( ::std::pair< long, long >( effectiveMin, effectiveMax ) ); accumulatedMinWidth += effectiveMin; accumulatedMaxWidth += effectiveMax; } - ::std::vector< long > newWidths( currentColWidths ); + o_newColWidthsPixel = currentColWidths; if ( flexibilityDenominator == 0 ) { // no column is flexible => don't adjust anything } - else if ( gridWidthAppFont > accumulatedCurrentWidth ) + else if ( gridWidthPixel > accumulatedCurrentWidth ) { // we have space to give away ... - long distributeAppFontUnits = gridWidthAppFont - accumulatedCurrentWidth; - if ( gridWidthAppFont > accumulatedMaxWidth ) + long distributePixel = gridWidthPixel - accumulatedCurrentWidth; + if ( gridWidthPixel > accumulatedMaxWidth ) { // ... but the column's maximal widths are still less than we have // => set them all to max for ( size_t i = 0; i < size_t( colCount ); ++i ) { - newWidths[i] = effectiveColumnLimits[i].second; + o_newColWidthsPixel[i] = effectiveColumnLimits[i].second; } } else @@ -942,13 +1029,13 @@ namespace svt { namespace table { startOver = false; // distribute the remaining space amongst all columns with a positive flexibility - for ( size_t i=0; i effectiveColumnLimits[i].second ) { // that was too much, we hit the col's maximum @@ -957,9 +1044,10 @@ namespace svt { namespace table // adjust the flexibility denominator ... flexibilityDenominator -= columnFlexibility; columnFlexibilities[i] = 0; + --flexibleColumnCount; // ... and the remaining width ... long const difference = newColWidth - currentColWidths[i]; - distributeAppFontUnits -= difference; + distributePixel -= difference; // ... this way, we ensure that the width not taken up by this column is consumed by the other // flexible ones (if there are some) @@ -968,22 +1056,46 @@ namespace svt { namespace table startOver = true; } - newWidths[i] = newColWidth; + o_newColWidthsPixel[i] = newColWidth; } } while ( startOver ); + + // are there pixels left (might be caused by rounding errors)? + while ( ( distributePixel > 0 ) && ( flexibleColumnCount > 0 ) ) + { + // yes => ignore relative flexibilities, and subsequently distribute single pixels to all flexible + // columns which did not yet reach their maximum. + for ( size_t i=0; ( i < o_newColWidthsPixel.size() ) && ( distributePixel > 0 ); ++i ) + { + if ( columnFlexibilities[i] == 0 ) + continue; + + OSL_ENSURE( o_newColWidthsPixel[i] <= effectiveColumnLimits[i].second, + "TableControl_Impl::impl_ni_calculateColumnWidths: inconsitency!" ); + if ( o_newColWidthsPixel[i] >= effectiveColumnLimits[i].first ) + { + columnFlexibilities[i] = 0; + --flexibleColumnCount; + continue; + } + + ++o_newColWidthsPixel[i]; + --distributePixel; + } + } } } - else if ( gridWidthAppFont < accumulatedCurrentWidth ) + else if ( gridWidthPixel < accumulatedCurrentWidth ) { // we need to take away some space from the columns which allow it ... - long takeAwayAppFontUnits = accumulatedCurrentWidth - gridWidthAppFont; - if ( gridWidthAppFont < accumulatedMinWidth ) + long takeAwayPixel = accumulatedCurrentWidth - gridWidthPixel; + if ( gridWidthPixel < accumulatedMinWidth ) { // ... but the column's minimal widths are still more than we have // => set them all to min for ( size_t i = 0; i < size_t( colCount ); ++i ) { - newWidths[i] = effectiveColumnLimits[i].first; + o_newColWidthsPixel[i] = effectiveColumnLimits[i].first; } } else @@ -993,13 +1105,13 @@ namespace svt { namespace table { startOver = false; // take away the space we need from the columns with a positive flexibility - for ( size_t i=0; igetColumnModel( col ); - ENSURE_OR_THROW( !!pColumn, "invalid column returned by the model!" ); - pColumn->setWidth( newWidths[col] ); - } + // are there pixels left (might be caused by rounding errors)? + while ( ( takeAwayPixel > 0 ) && ( flexibleColumnCount > 0 ) ) + { + // yes => ignore relative flexibilities, and subsequently take away pixels from all flexible + // columns which did not yet reach their minimum. + for ( size_t i=0; ( i < o_newColWidthsPixel.size() ) && ( takeAwayPixel > 0 ); ++i ) + { + if ( columnFlexibilities[i] == 0 ) + continue; - // if the column resizing happened to leave some space at the right, but there are columns - // scrolled out to the left, scroll them in - while ( ( m_nLeftColumn > 0 ) - && ( accumulatedWidthPixel - m_aColumnWidths[ m_nLeftColumn - 1 ].getStart() <= gridWidthPixel ) - ) - { - --m_nLeftColumn; - } + OSL_ENSURE( o_newColWidthsPixel[i] >= effectiveColumnLimits[i].first, + "TableControl_Impl::impl_ni_calculateColumnWidths: inconsitency!" ); + if ( o_newColWidthsPixel[i] <= effectiveColumnLimits[i].first ) + { + columnFlexibilities[i] = 0; + --flexibleColumnCount; + continue; + } - // now adjust the column metrics, since they currently ignore the horizontal scroll position - if ( m_nLeftColumn > 0 ) - { - const long offsetPixel = m_aColumnWidths[ 0 ].getStart() - m_aColumnWidths[ m_nLeftColumn ].getStart(); - for ( ColumnPositions::iterator colPos = m_aColumnWidths.begin(); - colPos != m_aColumnWidths.end(); - ++colPos - ) - { - colPos->move( offsetPixel ); + --o_newColWidthsPixel[i]; + --takeAwayPixel; + } + } } } + + return gridWidthPixel; } //------------------------------------------------------------------------------------------------------------------ - namespace + void TableControl_Impl::impl_ni_relayout( ColPos const i_assumeInflexibleColumnsUpToIncluding ) { - //.............................................................................................................. - /// determines whether a scrollbar is needed for the given values - bool lcl_determineScrollbarNeed( long const i_position, ScrollbarVisibility const i_visibility, - long const i_availableSpace, long const i_neededSpace ) - { - if ( i_visibility == ScrollbarShowNever ) - return false; - if ( i_visibility == ScrollbarShowAlways ) - return true; - if ( i_position > 0 ) - return true; - if ( i_availableSpace >= i_neededSpace ) - return false; - return true; - } - - //.............................................................................................................. - void lcl_setButtonRepeat( Window& _rWindow, sal_uLong _nDelay ) - { - AllSettings aSettings = _rWindow.GetSettings(); - MouseSettings aMouseSettings = aSettings.GetMouseSettings(); - - aMouseSettings.SetButtonRepeat( _nDelay ); - aSettings.SetMouseSettings( aMouseSettings ); - - _rWindow.SetSettings( aSettings, sal_True ); - } - - //.............................................................................................................. - void lcl_updateScrollbar( Window& _rParent, ScrollBar*& _rpBar, - bool const i_needBar, long _nVisibleUnits, - long _nPosition, long _nLineSize, long _nRange, - bool _bHorizontal, const Link& _rScrollHandler ) - { - // do we currently have the scrollbar? - bool bHaveBar = _rpBar != NULL; - - // do we need to correct the scrollbar visibility? - if ( bHaveBar && !i_needBar ) - { - if ( _rpBar->IsTracking() ) - _rpBar->EndTracking(); - DELETEZ( _rpBar ); - } - else if ( !bHaveBar && i_needBar ) - { - _rpBar = new ScrollBar( - &_rParent, - WB_DRAG | ( _bHorizontal ? WB_HSCROLL : WB_VSCROLL ) - ); - _rpBar->SetScrollHdl( _rScrollHandler ); - // get some speed into the scrolling .... - lcl_setButtonRepeat( *_rpBar, 0 ); - } + ENSURE_OR_RETURN_VOID( !m_bUpdatingColWidths, "TableControl_Impl::impl_ni_relayout: recursive call detected!" ); - if ( _rpBar ) - { - _rpBar->SetRange( Range( 0, _nRange ) ); - _rpBar->SetVisibleSize( _nVisibleUnits ); - _rpBar->SetPageSize( _nVisibleUnits ); - _rpBar->SetLineSize( _nLineSize ); - _rpBar->SetThumbPos( _nPosition ); - _rpBar->Show(); - } - } - - //.............................................................................................................. - /** returns the number of rows fitting into the given range, - for the given row height. Partially fitting rows are counted, too, if the - respective parameter says so. - */ - TableSize lcl_getRowsFittingInto( long _nOverallHeight, long _nRowHeightPixel, bool _bAcceptPartialRow = false ) - { - return _bAcceptPartialRow - ? ( _nOverallHeight + ( _nRowHeightPixel - 1 ) ) / _nRowHeightPixel - : _nOverallHeight / _nRowHeightPixel; - } - - //.............................................................................................................. - /** returns the number of columns fitting into the given area, - with the first visible column as given. Partially fitting columns are counted, too, - if the respective parameter says so. - */ - TableSize lcl_getColumnsVisibleWithin( const Rectangle& _rArea, ColPos _nFirstVisibleColumn, - const TableControl_Impl& _rControl, bool _bAcceptPartialRow ) - { - TableSize visibleColumns = 0; - TableColumnGeometry aColumn( _rControl, _rArea, _nFirstVisibleColumn ); - while ( aColumn.isValid() ) - { - if ( !_bAcceptPartialRow ) - if ( aColumn.getRect().Right() > _rArea.Right() ) - // this column is only partially visible, and this is not allowed - break; - - aColumn.moveRight(); - ++visibleColumns; - } - return visibleColumns; - } - - } + m_aColumnWidths.resize( 0 ); + if ( !m_pModel ) + return; - //------------------------------------------------------------------------------------------------------------------ - void TableControl_Impl::impl_ni_updateScrollbars() - { + ::comphelper::FlagRestorationGuard const aWidthUpdateFlag( m_bUpdatingColWidths, true ); SuppressCursor aHideCursor( *this ); + // layouting steps: + // + // 1. adjust column widths, leaving space for a vertical scrollbar + // 2. determine need for a vertical scrollbar + // - V-YES: all fine, result from 1. is still valid + // - V-NO: result from 1. is still under consideration + // + // 3. determine need for a horizontal scrollbar + // - H-NO: all fine, result from 2. is still valid + // - H-YES: reconsider need for a vertical scrollbar, if result of 2. was V-NO + // - V-YES: all fine, result from 1. is still valid + // - V-NO: redistribute the remaining space (if any) amongst all columns which allow it + + ::std::vector< long > newWidthsPixel; + long gridWidthPixel = impl_ni_calculateColumnWidths( i_assumeInflexibleColumnsUpToIncluding, true, newWidthsPixel ); + // the width/height of a scrollbar, needed several times below long const nScrollbarMetrics = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize(); @@ -1182,18 +1200,13 @@ namespace svt { namespace table Rectangle aDataCellPlayground( Point( 0, 0 ), m_rAntiImpl.GetOutputSizePixel() ); aDataCellPlayground.Left() = m_nRowHeaderWidthPixel; aDataCellPlayground.Top() = m_nColHeaderHeightPixel; - m_nRowCount = m_pModel->getRowCount(); - m_nColumnCount = m_pModel->getColumnCount(); - if ( m_aColumnWidths.empty() ) - impl_ni_updateColumnWidths(); - OSL_ENSURE( m_aColumnWidths.size() == size_t( m_nColumnCount ), "TableControl_Impl::impl_ni_updateScrollbars: inconsistency!" ); - const long nAllColumnsWidth = m_aColumnWidths.empty() - ? 0 - : m_aColumnWidths[ m_nColumnCount - 1 ].getEnd() - m_aColumnWidths[ 0 ].getStart(); + OSL_ENSURE( ( m_nRowCount == m_pModel->getRowCount() ) && ( m_nColumnCount == m_pModel->getColumnCount() ), + "TableControl_Impl::impl_ni_relayout: how is this expected to work with invalid data?" ); + long const nAllColumnsWidth = ::std::accumulate( newWidthsPixel.begin(), newWidthsPixel.end(), 0 ); - const ScrollbarVisibility eVertScrollbar = m_pModel->getVerticalScrollbarVisibility(); - const ScrollbarVisibility eHorzScrollbar = m_pModel->getHorizontalScrollbarVisibility(); + ScrollbarVisibility const eVertScrollbar = m_pModel->getVerticalScrollbarVisibility(); + ScrollbarVisibility const eHorzScrollbar = m_pModel->getHorizontalScrollbarVisibility(); // do we need a vertical scrollbar? bool bNeedVerticalScrollbar = lcl_determineScrollbarNeed( @@ -1204,8 +1217,10 @@ namespace svt { namespace table aDataCellPlayground.Right() -= nScrollbarMetrics; bFirstRoundVScrollNeed = true; } + // do we need a horizontal scrollbar? - const bool bNeedHorizontalScrollbar = lcl_determineScrollbarNeed( m_nLeftColumn, eHorzScrollbar, aDataCellPlayground.GetWidth(), nAllColumnsWidth ); + bool const bNeedHorizontalScrollbar = lcl_determineScrollbarNeed( + m_nLeftColumn, eHorzScrollbar, aDataCellPlayground.GetWidth(), nAllColumnsWidth ); if ( bNeedHorizontalScrollbar ) { aDataCellPlayground.Bottom() -= nScrollbarMetrics; @@ -1224,12 +1239,78 @@ namespace svt { namespace table } } } + + // show or hide the scrollbars as needed + bool const hadVerticalScrollbar = ( m_pVScroll != NULL ); + impl_ni_positionChildWindows( aDataCellPlayground, bNeedVerticalScrollbar, bNeedHorizontalScrollbar ); + + // the initial call to impl_ni_calculateColumnWidths assumed that we need a vertical scrollbar. If, by now, + // we know that this is not the case, re-calculate the column widths. + if ( !bNeedVerticalScrollbar ) + gridWidthPixel = impl_ni_calculateColumnWidths( i_assumeInflexibleColumnsUpToIncluding, false, newWidthsPixel ); + + // update the column objects with the new widths we finally calculated + TableSize const colCount = m_pModel->getColumnCount(); + m_aColumnWidths.reserve( colCount ); + long accumulatedWidthPixel = m_nRowHeaderWidthPixel; + bool anyColumnWidthChanged = false; + for ( ColPos col = 0; col < colCount; ++col ) + { + const long columnStart = accumulatedWidthPixel; + const long columnEnd = columnStart + newWidthsPixel[col]; + m_aColumnWidths.push_back( MutableColumnMetrics( columnStart, columnEnd ) ); + accumulatedWidthPixel = columnEnd; + + // and don't forget to forward this to the column models + PColumnModel const pColumn = m_pModel->getColumnModel( col ); + ENSURE_OR_THROW( !!pColumn, "invalid column returned by the model!" ); + + long const oldColumnWidthAppFont = pColumn->getWidth(); + long const newColumnWidthAppFont = pixelWidthToAppFont( newWidthsPixel[col] ); + pColumn->setWidth( newColumnWidthAppFont ); + + anyColumnWidthChanged |= ( oldColumnWidthAppFont != newColumnWidthAppFont ); + } + + // if the column widths changed, ensure everything is repainted + if ( anyColumnWidthChanged ) + invalidate( TableAreaAll ); + + // if the column resizing happened to leave some space at the right, but there are columns + // scrolled out to the left, scroll them in + while ( ( m_nLeftColumn > 0 ) + && ( accumulatedWidthPixel - m_aColumnWidths[ m_nLeftColumn - 1 ].getStart() <= gridWidthPixel ) + ) + { + --m_nLeftColumn; + } + + // now adjust the column metrics, since they currently ignore the horizontal scroll position + if ( m_nLeftColumn > 0 ) + { + const long offsetPixel = m_aColumnWidths[ 0 ].getStart() - m_aColumnWidths[ m_nLeftColumn ].getStart(); + for ( ColumnPositions::iterator colPos = m_aColumnWidths.begin(); + colPos != m_aColumnWidths.end(); + ++colPos + ) + { + colPos->move( offsetPixel ); + } + } + } + + //------------------------------------------------------------------------------------------------------------------ + void TableControl_Impl::impl_ni_positionChildWindows( Rectangle const & i_dataCellPlayground, + bool const i_verticalScrollbar, bool const i_horizontalScrollbar ) + { + long const nScrollbarMetrics = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize(); + // create or destroy the vertical scrollbar, as needed - lcl_updateScrollbar( + bool verticalVisibilityChanged = lcl_updateScrollbar( m_rAntiImpl, m_pVScroll, - bNeedVerticalScrollbar, - lcl_getRowsFittingInto( aDataCellPlayground.GetHeight(), m_nRowHeightPixel ), + i_verticalScrollbar, + lcl_getRowsFittingInto( i_dataCellPlayground.GetHeight(), m_nRowHeightPixel ), // visible units m_nTopRow, // current position 1, // line size @@ -1237,12 +1318,13 @@ namespace svt { namespace table false, // vertical LINK( this, TableControl_Impl, OnScroll ) // scroll handler ); + // position it if ( m_pVScroll ) { Rectangle aScrollbarArea( - Point( aDataCellPlayground.Right() + 1, 0 ), - Size( nScrollbarMetrics, aDataCellPlayground.Bottom() + 1 ) + Point( i_dataCellPlayground.Right() + 1, 0 ), + Size( nScrollbarMetrics, i_dataCellPlayground.Bottom() + 1 ) ); m_pVScroll->SetPosSizePixel( aScrollbarArea.TopLeft(), aScrollbarArea.GetSize() ); @@ -1252,8 +1334,8 @@ namespace svt { namespace table lcl_updateScrollbar( m_rAntiImpl, m_pHScroll, - bNeedHorizontalScrollbar, - lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false ), + i_horizontalScrollbar, + lcl_getColumnsVisibleWithin( i_dataCellPlayground, m_nLeftColumn, *this, false ), // visible units m_nLeftColumn, // current position 1, // line size @@ -1261,22 +1343,23 @@ namespace svt { namespace table true, // horizontal LINK( this, TableControl_Impl, OnScroll ) // scroll handler ); + // position it if ( m_pHScroll ) { - TableSize const nVisibleUnits = lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false ); + TableSize const nVisibleUnits = lcl_getColumnsVisibleWithin( i_dataCellPlayground, m_nLeftColumn, *this, false ); TableMetrics const nRange = m_nColumnCount; if( m_nLeftColumn + nVisibleUnits == nRange - 1 ) { - if ( m_aColumnWidths[ nRange - 1 ].getStart() - m_aColumnWidths[ m_nLeftColumn ].getEnd() + m_aColumnWidths[ nRange-1 ].getWidth() > aDataCellPlayground.GetWidth() ) + if ( m_aColumnWidths[ nRange - 1 ].getStart() - m_aColumnWidths[ m_nLeftColumn ].getEnd() + m_aColumnWidths[ nRange-1 ].getWidth() > i_dataCellPlayground.GetWidth() ) { m_pHScroll->SetVisibleSize( nVisibleUnits -1 ); m_pHScroll->SetPageSize( nVisibleUnits - 1 ); } } Rectangle aScrollbarArea( - Point( 0, aDataCellPlayground.Bottom() + 1 ), - Size( aDataCellPlayground.Right() + 1, nScrollbarMetrics ) + Point( 0, i_dataCellPlayground.Bottom() + 1 ), + Size( i_dataCellPlayground.Right() + 1, nScrollbarMetrics ) ); m_pHScroll->SetPosSizePixel( aScrollbarArea.TopLeft(), aScrollbarArea.GetSize() ); @@ -1293,19 +1376,19 @@ namespace svt { namespace table { m_pScrollCorner = new ScrollBarBox( &m_rAntiImpl ); m_pScrollCorner->SetSizePixel( Size( nScrollbarMetrics, nScrollbarMetrics ) ); - m_pScrollCorner->SetPosPixel( Point( aDataCellPlayground.Right() + 1, aDataCellPlayground.Bottom() + 1 ) ); + m_pScrollCorner->SetPosPixel( Point( i_dataCellPlayground.Right() + 1, i_dataCellPlayground.Bottom() + 1 ) ); m_pScrollCorner->Show(); } else if(bHaveScrollCorner && bNeedScrollCorner) { - m_pScrollCorner->SetPosPixel( Point( aDataCellPlayground.Right() + 1, aDataCellPlayground.Bottom() + 1 ) ); + m_pScrollCorner->SetPosPixel( Point( i_dataCellPlayground.Right() + 1, i_dataCellPlayground.Bottom() + 1 ) ); m_pScrollCorner->Show(); } // resize the data window m_pDataWindow->SetSizePixel( Size( - aDataCellPlayground.GetWidth() + m_nRowHeaderWidthPixel, - aDataCellPlayground.GetHeight() + m_nColHeaderHeightPixel + i_dataCellPlayground.GetWidth() + m_nRowHeaderWidthPixel, + i_dataCellPlayground.GetHeight() + m_nColHeaderHeightPixel ) ); } @@ -1314,8 +1397,7 @@ namespace svt { namespace table { DBG_CHECK_ME(); - impl_ni_updateColumnWidths(); - impl_ni_updateScrollbars(); + impl_ni_relayout(); checkCursorPosition(); } @@ -1984,6 +2066,12 @@ namespace svt { namespace table return m_pDataWindow->PixelToLogic( Size( i_pixels, 0 ), MAP_APPFONT ).Width(); } + //------------------------------------------------------------------------------------------------------------------ + long TableControl_Impl::appFontWidthToPixel( long const i_appFontUnits ) const + { + return m_pDataWindow->LogicToPixel( Size( i_appFontUnits, 0 ), MAP_APPFONT ).Width(); + } + //------------------------------------------------------------------------------------------------------------------ void TableControl_Impl::hideTracking() { @@ -2244,12 +2332,19 @@ namespace svt { namespace table m_pDataWindow->Invalidate( INVALIDATE_UPDATE ); // update the position at the vertical scrollbar - m_pVScroll->SetThumbPos( m_nTopRow ); - } - - // The scroll bar availaility might change when we scrolled. This is because we do not hide - // the scrollbar when it is, in theory, unnecessary, but currently at a position > 0. In this case, it will - // be auto-hidden when it's scrolled back to pos 0. + if ( m_pVScroll != NULL ) + m_pVScroll->SetThumbPos( m_nTopRow ); + } + + // The scroll bar availaility might change when we scrolled. + // For instance, imagine a view with 10 rows, if which 5 fit into the window, numbered 1 to 10. + // Now let + // - the user scroll to row number 6, so the last 5 rows are visible + // - somebody remove the last 4 rows + // - the user scroll to row number 5 being the top row, so the last two rows are visible + // - somebody remove row number 6 + // - the user scroll to row number 1 + // => in this case, the need for the scrollbar vanishes immediately. if ( m_nTopRow == 0 ) m_rAntiImpl.PostUserEvent( LINK( this, TableControl_Impl, OnUpdateScrollbars ) ); @@ -2314,7 +2409,8 @@ namespace svt { namespace table m_pDataWindow->Invalidate( INVALIDATE_UPDATE ); // update the position at the horizontal scrollbar - m_pHScroll->SetThumbPos( m_nLeftColumn ); + if ( m_pHScroll != NULL ) + m_pHScroll->SetThumbPos( m_nLeftColumn ); } // The scroll bar availaility might change when we scrolled. This is because we do not hide @@ -2567,7 +2663,9 @@ namespace svt { namespace table IMPL_LINK( TableControl_Impl, OnUpdateScrollbars, void*, /**/ ) { DBG_CHECK_ME(); - impl_ni_updateScrollbars(); + // TODO: can't we simply use lcl_updateScrollbar here, so the scrollbars ranges are updated, instead of + // doing a complete re-layout? + impl_ni_relayout(); return 1L; } diff --git a/svtools/source/table/tablecontrol_impl.hxx b/svtools/source/table/tablecontrol_impl.hxx index 04893084fb31..4f3d18aa84fd 100755 --- a/svtools/source/table/tablecontrol_impl.hxx +++ b/svtools/source/table/tablecontrol_impl.hxx @@ -308,6 +308,8 @@ namespace svt { namespace table virtual bool isRowSelected( RowPos i_row ) const; + long appFontWidthToPixel( long const i_appFontUnits ) const; + TableDataWindow& getDataWindow() { return *m_pDataWindow; } const TableDataWindow& getDataWindow() const { return *m_pDataWindow; } ScrollBar* getHorzScrollbar(); @@ -387,26 +389,45 @@ namespace svt { namespace table */ void impl_ni_updateCachedTableMetrics(); - /** updates ->m_aColumnWidthsPixel with the current pixel widths of all model columns + /** does a relayout of the table control - The method is not bound to the classes public invariants, as it's used in - situations where the they must not necessarily be fullfilled. + Column widths, and consequently the availability of the vertical and horizontal scrollbar, are updated + with a call to this method. @param i_assumeInflexibleColumnsUpToIncluding the index of a column up to which all columns should be considered as inflexible, or COL_INVALID. */ - void impl_ni_updateColumnWidths( ColPos const i_assumeInflexibleColumnsUpToIncluding = COL_INVALID ); + void impl_ni_relayout( ColPos const i_assumeInflexibleColumnsUpToIncluding = COL_INVALID ); - /** updates the scrollbars of the control + /** calculates the new width of our columns, taking into account their min and max widths, and their relative + flexibility. - The method is not bound to the classes public invariants, as it's used in - situations where the they must not necessarily be fullfilled. + @param i_assumeInflexibleColumnsUpToIncluding + the index of a column up to which all columns should be considered as inflexible, or + COL_INVALID. + + @param i_assumeVerticalScrollbar + controls whether or not we should assume the presence of a vertical scrollbar. If , and + if the model has a VerticalScrollbarVisibility != ScrollbarShowNever, the method will leave + space for a vertical scrollbar. + + @return + the overall width of the grid, which is available for columns + */ + long impl_ni_calculateColumnWidths( + ColPos const i_assumeInflexibleColumnsUpToIncluding, + bool const i_assumeVerticalScrollbar, + ::std::vector< long >& o_newColWidthsPixel + ) const; - This includes both the existence of the scrollbars, and their - state. + /** positions all child windows, e.g. the both scrollbars, the corner window, and the data window */ - void impl_ni_updateScrollbars(); + void impl_ni_positionChildWindows( + Rectangle const & i_dataCellPlayground, + bool const i_verticalScrollbar, + bool const i_horizontalScrollbar + ); /** scrolls the view by the given number of rows -- cgit v1.2.3 From 66307ce86df99f6bd31f2f78665582b377161cad Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 28 Mar 2011 11:29:50 +0200 Subject: impress210: comment out not needed line --- sd/source/core/EffectMigration.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx index 751ce0911cfc..26d032d8bb6f 100755 --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -1353,7 +1353,7 @@ void EffectMigration::SetAnimationPath( SvxShape* pShape, SdrPathObj* pPathObj ) if( pObj ) { - sd::MainSequencePtr pMainSequence = static_cast(pObj->GetPage())->getMainSequence(); + //sd::MainSequencePtr pMainSequence = static_cast(pObj->GetPage())->getMainSequence(); const Reference< XShape > xShape( pShape ); SdPage* pPage = dynamic_cast< SdPage* >( pPathObj ? pPathObj->GetPage() : 0 ); -- cgit v1.2.3 From fbfe16dd3f245f69f59734148fea29ba9353b069 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 28 Mar 2011 12:10:16 +0200 Subject: fs34b: #i117552# check if query before call getByName in every case --- dbaccess/source/ui/browser/unodatbr.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 8e7c75418875..e5b8a13fb149 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -2191,12 +2191,13 @@ void SbaTableQueryBrowser::populateTree(const Reference& _xNameAcce { if( !m_pTreeView->getListBox().GetEntryPosByName(*pIter,_pParent)) { - Reference xChild(_xNameAccess->getByName(*pIter),UNO_QUERY); DBTreeListUserData* pEntryData = new DBTreeListUserData; pEntryData->eType = _eEntryType; - if ( _eEntryType == etQuery && xChild.is() ) + if ( _eEntryType == etQuery ) { - pEntryData->eType = etQueryContainer; + Reference xChild(_xNameAccess->getByName(*pIter),UNO_QUERY); + if ( xChild.is() ) + pEntryData->eType = etQueryContainer; } implAppendEntry( _pParent, *pIter, pEntryData, pEntryData->eType ); } -- cgit v1.2.3 From 9ad72383ccd8e5c2dfede71439b487d052cbd98c Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 28 Mar 2011 12:32:21 +0200 Subject: impress210: resolve name clash --- sd/source/ui/unoidl/unoobj.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index ddb115a21525..ae148ec547cf 100755 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -661,12 +661,12 @@ void SAL_CALL SdXShape::setPropertyValue( const ::rtl::OUString& aPropertyName, case WID_ANIMPATH: { uno::Reference< drawing::XShape > xShape( aValue, uno::UNO_QUERY ); - SdrPathObj* pObj = xShape.is() ? dynamic_cast< SdrPathObj* >( GetSdrObjectFromXShape( xShape ) ) : NULL; + SdrPathObj* pObj2 = xShape.is() ? dynamic_cast< SdrPathObj* >( GetSdrObjectFromXShape( xShape ) ) : NULL; - if( pObj == NULL ) + if( pObj2 == NULL ) throw lang::IllegalArgumentException(); - EffectMigration::SetAnimationPath( mpShape, pObj ); + EffectMigration::SetAnimationPath( mpShape, pObj2 ); break; } case WID_IMAGEMAP: -- cgit v1.2.3 From f1004e137767c4fc7f6b36422bcf4f7a2d41a94a Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 28 Mar 2011 13:45:42 +0200 Subject: gridfixes: fixed selection handling, part I: RowSelection::HandleMouseDown: always forward to the SelectionEngine, even if the hit row is already selected. This ensures proper de-selection handling in case of Ctrl+Click --- svtools/source/table/mousefunction.cxx | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/svtools/source/table/mousefunction.cxx b/svtools/source/table/mousefunction.cxx index 20d505e911e9..162abc7936c8 100755 --- a/svtools/source/table/mousefunction.cxx +++ b/svtools/source/table/mousefunction.cxx @@ -207,27 +207,14 @@ namespace svt { namespace table TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) ); if ( tableCell.nRow >= 0 ) { - bool bSetCursor = false; if ( i_tableControl.getSelEngine()->GetSelectionMode() == NO_SELECTION ) { - bSetCursor = true; + i_tableControl.activateCell( tableCell.nColumn, tableCell.nRow ); + handled = true; } else { - if ( !i_tableControl.isRowSelected( tableCell.nRow ) ) - { - handled = i_tableControl.getSelEngine()->SelMouseButtonDown( i_event ); - } - else - { - bSetCursor = true; - } - } - - if ( bSetCursor ) - { - i_tableControl.activateCell( tableCell.nColumn, tableCell.nRow ); - handled = true; + handled = i_tableControl.getSelEngine()->SelMouseButtonDown( i_event ); } } -- cgit v1.2.3 From 619fa2b9be49cbc6c14ee1828aa3660b1e0d49a1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 28 Mar 2011 23:16:59 +0200 Subject: fs34b: remaint of CWS debuglevels: UNO API test for ensuring the proper order of events when closing the doc by various means. Two of three test cases disabled currently, due to #i117585# --- sfx2/JunitTest_sfx2_complex.mk | 3 + sfx2/qa/complex/sfx2/DocumentEvents.java | 206 +++++++++++++++++++++++++++++++ sfx2/qa/complex/sfx2/JUnitBasedTest.java | 55 +++++++++ sfx2/qa/complex/sfx2/UndoManager.java | 3 +- 4 files changed, 265 insertions(+), 2 deletions(-) create mode 100755 sfx2/qa/complex/sfx2/DocumentEvents.java create mode 100755 sfx2/qa/complex/sfx2/JUnitBasedTest.java diff --git a/sfx2/JunitTest_sfx2_complex.mk b/sfx2/JunitTest_sfx2_complex.mk index 800612a6c55d..eac148a112d9 100755 --- a/sfx2/JunitTest_sfx2_complex.mk +++ b/sfx2/JunitTest_sfx2_complex.mk @@ -51,6 +51,8 @@ $(eval $(call gb_JunitTest_add_sourcefiles,sfx2_complex,\ sfx2/qa/complex/sfx2/DocumentInfo \ sfx2/qa/complex/sfx2/StandaloneDocumentInfo \ sfx2/qa/complex/sfx2/UndoManager \ + sfx2/qa/complex/sfx2/JUnitBasedTest \ + sfx2/qa/complex/sfx2/DocumentEvents \ sfx2/qa/complex/sfx2/standalonedocinfo/StandaloneDocumentInfoTest \ sfx2/qa/complex/sfx2/standalonedocinfo/TestHelper \ sfx2/qa/complex/sfx2/standalonedocinfo/Test01 \ @@ -69,6 +71,7 @@ $(eval $(call gb_JunitTest_add_classes,sfx2_complex,\ complex.sfx2.DocumentProperties \ complex.sfx2.DocumentMetadataAccess \ complex.sfx2.UndoManager \ + complex.sfx2.DocumentEvents \ )) # #i115674# fails currently: misses some OnUnfocus event # complex.sfx2.GlobalEventBroadcaster \ diff --git a/sfx2/qa/complex/sfx2/DocumentEvents.java b/sfx2/qa/complex/sfx2/DocumentEvents.java new file mode 100755 index 000000000000..a38e13756551 --- /dev/null +++ b/sfx2/qa/complex/sfx2/DocumentEvents.java @@ -0,0 +1,206 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package complex.sfx2; + +import com.sun.star.document.DocumentEvent; +import com.sun.star.document.XDocumentEventBroadcaster; +import com.sun.star.document.XDocumentEventListener; +import com.sun.star.lang.EventObject; +import com.sun.star.lang.XEventListener; +import com.sun.star.uno.Exception; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.util.CloseVetoException; +import com.sun.star.util.XCloseListener; +import com.sun.star.util.XCloseable; +import java.util.Vector; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import static org.junit.Assert.*; +import org.openoffice.test.tools.OfficeDocument; + +/** + * + * @author frank.shoenheit@oracle.com + */ +public class DocumentEvents extends JUnitBasedTest +{ + @Before + public void beforeTest() throws Exception + { + m_document = OfficeDocument.blankTextDocument( this.getORB() ); + } + + @After + public void afterTest() + { + if ( m_document != null ) + { + assertTrue( "closing the test document failed", m_document.close() ); + m_document = null; + } + } + + /** + * sets up the environment for a test which checks the behavior upon closing a doc + */ + private void impl_setupDocCloseTest() + { + m_observedCloseEvents.clear(); + + final XDocumentEventBroadcaster docEventBroadcaster = UnoRuntime.queryInterface( + XDocumentEventBroadcaster.class, m_document.getDocument() ); + docEventBroadcaster.addDocumentEventListener( new DocumentEventListener() ); + + final XCloseable docCloseable = UnoRuntime.queryInterface( XCloseable.class, + m_document.getDocument() ); + docCloseable.addCloseListener( new CloseListener() ); + + m_document.getDocument().addEventListener( new DocDisposeListener() ); + } + + /** + * sets up the environment for a test which checks the behavior upon closing a doc + */ + private void impl_tearDownDocCloseTest( final String i_docCloseMethod ) + { + synchronized( m_document ) + { + try + { + m_document.wait(10000); + } + catch (InterruptedException ex) + { + // don't continue the test if somebody interrupted us ... + return; + } + } + + m_document = null; + synchronized( m_observedCloseEvents ) + { + assertArrayEquals( + "wrong order of events when closing a doc " + i_docCloseMethod, + new CloseEventType[] { CloseEventType.OnUnload, CloseEventType.NotifyClosing, CloseEventType.Disposing }, + m_observedCloseEvents.toArray( new CloseEventType[0] ) + ); + } + } + + @Test + public void testCloseWinEvents() throws Exception + { + impl_setupDocCloseTest(); + m_document.getCurrentView().dispatch( ".uno:CloseWin" ); + impl_tearDownDocCloseTest( "via .uno:CloseWin" ); + } + + //@Test + public void testCloseDocEvents() throws Exception + { + impl_setupDocCloseTest(); + m_document.getCurrentView().dispatch( ".uno:CloseDoc" ); + impl_tearDownDocCloseTest( "via .uno:CloseDoc" ); + } + + //@Test + public void testCloseByAPI() throws Exception + { + impl_setupDocCloseTest(); + // closing the doc by API is synchronous, so do this in a separate thread, else we will get a deadlock + // when the document tries to call back our listener (well, I admit I didn't understand *why* we get this + // deadlock ... :-\ ) + (new DocCloser()).start(); + impl_tearDownDocCloseTest( "by API" ); + } + + private class DocumentEventListener implements XDocumentEventListener + { + + public void documentEventOccured( DocumentEvent i_documentEvent ) + { + if ( i_documentEvent.EventName.equals( "OnUnload" ) ) + { + synchronized( m_observedCloseEvents ) + { + m_observedCloseEvents.add( CloseEventType.OnUnload ); + } + } + } + + public void disposing(EventObject eo) + { + // not interested in + } + }; + + private class CloseListener implements XCloseListener + { + + public void queryClosing(EventObject eo, boolean bln) throws CloseVetoException + { + // not interested in + } + + public void notifyClosing(EventObject eo) + { + synchronized( m_observedCloseEvents ) + { + m_observedCloseEvents.add( CloseEventType.NotifyClosing ); + } + } + + public void disposing(EventObject eo) + { + // not interested in + } + }; + + private class DocDisposeListener implements XEventListener + { + public void disposing(EventObject eo) + { + synchronized( m_observedCloseEvents ) + { + m_observedCloseEvents.add( CloseEventType.Disposing ); + } + synchronized ( m_document ) + { + m_document.notifyAll(); + } + } + }; + + private class DocCloser extends Thread + { + @Override + public void run() + { + try + { + final XCloseable docCloseable = UnoRuntime.queryInterface(XCloseable.class, m_document.getDocument()); + docCloseable.close(true); + } + catch (CloseVetoException ex) + { + Logger.getLogger(DocumentEvents.class.getName()).log(Level.SEVERE, null, ex); + } + } + }; + + private enum CloseEventType + { + OnUnload, + NotifyClosing, + Disposing + }; + + private OfficeDocument m_document = null; + final private Vector< CloseEventType > m_observedCloseEvents = new Vector(); +} diff --git a/sfx2/qa/complex/sfx2/JUnitBasedTest.java b/sfx2/qa/complex/sfx2/JUnitBasedTest.java new file mode 100755 index 000000000000..a43493712c31 --- /dev/null +++ b/sfx2/qa/complex/sfx2/JUnitBasedTest.java @@ -0,0 +1,55 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package complex.sfx2; + +import org.openoffice.test.OfficeConnection; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.XComponentContext; +import org.junit.AfterClass; +import org.junit.BeforeClass; + +/** + * + * @author Frank + */ +public class JUnitBasedTest +{ + // ----------------------------------------------------------------------------------------------------------------- + protected XComponentContext getContext() + { + return m_connection.getComponentContext(); + } + + // ----------------------------------------------------------------------------------------------------------------- + protected XMultiServiceFactory getORB() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface( + XMultiServiceFactory.class, getContext().getServiceManager() ); + return xMSF1; + } + + // ----------------------------------------------------------------------------------------------------------------- + @BeforeClass + public static void setUpConnection() throws Exception + { + System.out.println( "--------------------------------------------------------------------------------" ); + System.out.println( "connecting ..." ); + m_connection.setUp(); + } + + // ----------------------------------------------------------------------------------------------------------------- + @AfterClass + public static void tearDownConnection() throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println(); + System.out.println( "tearing down connection" ); + m_connection.tearDown(); + System.out.println( "--------------------------------------------------------------------------------" ); + } + + private static final OfficeConnection m_connection = new OfficeConnection(); +} diff --git a/sfx2/qa/complex/sfx2/UndoManager.java b/sfx2/qa/complex/sfx2/UndoManager.java index f37530aba726..2fd5147ca6ed 100755 --- a/sfx2/qa/complex/sfx2/UndoManager.java +++ b/sfx2/qa/complex/sfx2/UndoManager.java @@ -221,12 +221,11 @@ public class UndoManager events.replaceByName( "OnViewCreated", scriptDescriptor ); // The below doesn't work: event notification is broken in m96, see http://www.openoffice.org/issues/show_bug.cgi?id=116313 -/* m_callbackCalled = false; + m_callbackCalled = false; m_currentDocument.getCurrentView().dispatch( ".uno:NewWindow" ); assertTrue( "triggering an event did not work as expected - basic script not called", m_callbackCalled ); // same as above: The script didn't close the context, but the OOo framework should have assertEquals( "undo context was not auto-closed as expected", 0, m_undoListener.getCurrentUndoContextDepth() ); - */ // ............................................................................................................. // scenario 4: let the script enter an Undo context, but not close it, as usual. -- cgit v1.2.3 From 368a2263f1f6fa302f0e072c0f7427d71fa3e544 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 29 Mar 2011 09:47:28 +0200 Subject: fs34b: after the test, close all documents opened during the test --- dbaccess/qa/complex/dbaccess/CopyTableWizard.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dbaccess/qa/complex/dbaccess/CopyTableWizard.java b/dbaccess/qa/complex/dbaccess/CopyTableWizard.java index 1facca3d8497..0da7775e7c30 100755 --- a/dbaccess/qa/complex/dbaccess/CopyTableWizard.java +++ b/dbaccess/qa/complex/dbaccess/CopyTableWizard.java @@ -59,6 +59,7 @@ public class CopyTableWizard extends CRMBasedTestCase { private DatabaseApplication source; + private DbaseDatabase destinationDB = null; private DatabaseApplication dest; public CopyTableWizard() @@ -73,6 +74,9 @@ public class CopyTableWizard extends CRMBasedTestCase public void after() { dest.store(); + if ( destinationDB != null ) + destinationDB.close(); + destinationDB = null; super.after(); } @@ -83,8 +87,9 @@ public class CopyTableWizard extends CRMBasedTestCase try { createTestCase(); - source = new DatabaseApplication(this.m_database.getDatabase()); - dest = new DatabaseApplication(new DbaseDatabase(getMSF())); + source = new DatabaseApplication(m_database.getDatabase()); + destinationDB = new DbaseDatabase( getMSF() ); + dest = new DatabaseApplication( destinationDB ); } catch (java.lang.Exception ex) { -- cgit v1.2.3 From 412edefe148e995e9b4b715fc88c2cde63923c8f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 29 Mar 2011 09:49:04 +0200 Subject: gridfixes: GCC WaE --- svtools/source/table/tablecontrol_impl.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 9c42b5ea3303..0de48eaff162 100755 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -1241,7 +1241,6 @@ namespace svt { namespace table } // show or hide the scrollbars as needed - bool const hadVerticalScrollbar = ( m_pVScroll != NULL ); impl_ni_positionChildWindows( aDataCellPlayground, bNeedVerticalScrollbar, bNeedHorizontalScrollbar ); // the initial call to impl_ni_calculateColumnWidths assumed that we need a vertical scrollbar. If, by now, @@ -1306,7 +1305,7 @@ namespace svt { namespace table long const nScrollbarMetrics = m_rAntiImpl.GetSettings().GetStyleSettings().GetScrollBarSize(); // create or destroy the vertical scrollbar, as needed - bool verticalVisibilityChanged = lcl_updateScrollbar( + lcl_updateScrollbar( m_rAntiImpl, m_pVScroll, i_verticalScrollbar, -- cgit v1.2.3 From fbd46bbdd8d405f1a16fb29b34d01062509f6239 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 29 Mar 2011 10:43:06 +0200 Subject: fs34b: #i117545# (patch provided by mathias.bauer@oracle.com) --- sw/source/ui/uno/unomod.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx index 25b09c895687..f8fbfdde04ca 100644 --- a/sw/source/ui/uno/unomod.cxx +++ b/sw/source/ui/uno/unomod.cxx @@ -782,6 +782,12 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c aOpt.setBrowseMode( bVal ); pView->GetWrtShell().ApplyViewOptions( aOpt ); pView->RecheckBrowseMode(); + + // must be set in mpViewOption as this will overwrite settings in _post! + mpViewOption->setBrowseMode( bVal ); + + // disable multiple layout + pView->GetDocShell()->ToggleBrowserMode(bVal, pView ); } } break; -- cgit v1.2.3 From 526cd6b80442bc055139b6e0b516c52d4031f438 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 29 Mar 2011 11:05:24 +0200 Subject: fs34b: integrated complex test cases into GNUMake's subsequentcheck target --- toolkit/JunitTest_toolkit_complex.mk | 56 ++++++++++++++++++++ toolkit/Module_toolkit.mk | 1 + toolkit/prj/build.lst | 1 - toolkit/qa/complex/toolkit/makefile.mk | 97 ---------------------------------- toolkit/qa/unoapi/makefile.mk | 48 ----------------- 5 files changed, 57 insertions(+), 146 deletions(-) create mode 100755 toolkit/JunitTest_toolkit_complex.mk delete mode 100755 toolkit/qa/complex/toolkit/makefile.mk delete mode 100644 toolkit/qa/unoapi/makefile.mk diff --git a/toolkit/JunitTest_toolkit_complex.mk b/toolkit/JunitTest_toolkit_complex.mk new file mode 100755 index 000000000000..77bf7544afc1 --- /dev/null +++ b/toolkit/JunitTest_toolkit_complex.mk @@ -0,0 +1,56 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2011 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +$(eval $(call gb_JunitTest_JunitTest,toolkit_complex)) + +$(eval $(call gb_JunitTest_add_jars,toolkit_complex,\ + $(OUTDIR)/bin/OOoRunner.jar \ + $(OUTDIR)/bin/ridl.jar \ + $(OUTDIR)/bin/test.jar \ + $(OUTDIR)/bin/unoil.jar \ +)) + +$(eval $(call gb_JunitTest_add_sourcefiles,toolkit_complex,\ + toolkit/qa/complex/toolkit/accessibility/_XAccessibleComponent \ + toolkit/qa/complex/toolkit/accessibility/_XAccessibleContext \ + toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster \ + toolkit/qa/complex/toolkit/accessibility/_XAccessibleExtendedComponent \ + toolkit/qa/complex/toolkit/accessibility/_XAccessibleText \ + toolkit/qa/complex/toolkit/Assert \ + toolkit/qa/complex/toolkit/awtgrid/GridDataListener \ + toolkit/qa/complex/toolkit/awtgrid/TMutableGridDataModel \ + toolkit/qa/complex/toolkit/awtgrid/DummyColumn \ + toolkit/qa/complex/toolkit/GridControl \ + toolkit/qa/complex/toolkit/UnitConversion \ +)) + +$(eval $(call gb_JunitTest_add_classes,toolkit_complex,\ + complex.toolkit.GridControl \ + complex.toolkit.UnitConversion \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/toolkit/Module_toolkit.mk b/toolkit/Module_toolkit.mk index 858aecd1c13d..beb7dbc4971f 100644 --- a/toolkit/Module_toolkit.mk +++ b/toolkit/Module_toolkit.mk @@ -36,6 +36,7 @@ $(eval $(call gb_Module_add_targets,toolkit,\ )) $(eval $(call gb_Module_add_subsequentcheck_targets,toolkit,\ + JunitTest_toolkit_complex \ JunitTest_toolkit_unoapi \ )) diff --git a/toolkit/prj/build.lst b/toolkit/prj/build.lst index e11d32c435bf..a0ddbffd8718 100644 --- a/toolkit/prj/build.lst +++ b/toolkit/prj/build.lst @@ -1,3 +1,2 @@ ti toolkit : LIBXSLT:libxslt vcl qadevOOo test NULL ti toolkit\prj nmake - all ti_prj NULL -ti toolkit\qa\complex\toolkit nmake - all ti_complex_toolkit NULL diff --git a/toolkit/qa/complex/toolkit/makefile.mk b/toolkit/qa/complex/toolkit/makefile.mk deleted file mode 100755 index ecb173f9bdac..000000000000 --- a/toolkit/qa/complex/toolkit/makefile.mk +++ /dev/null @@ -1,97 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -.IF "$(OOO_JUNIT_JAR)" == "" -nothing .PHONY: - @echo ----------------------------------------------------- - @echo - JUnit not available, not building anything - @echo ----------------------------------------------------- -.ELSE # IF "$(OOO_JUNIT_JAR)" != "" - -PRJ = ../../.. -PRJNAME = toolkit -TARGET = qa_complex_toolkit -PACKAGE = complex/toolkit - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - -#----- compile .java files ----------------------------------------- - -JARFILES = OOoRunnerLight.jar ridl.jar test.jar unoil.jar -EXTRAJARFILES = $(OOO_JUNIT_JAR) - -JAVAFILES = \ - $(JAVATESTFILES) \ - accessibility/_XAccessibleComponent.java \ - accessibility/_XAccessibleContext.java \ - accessibility/_XAccessibleEventBroadcaster.java \ - accessibility/_XAccessibleExtendedComponent.java \ - accessibility/_XAccessibleText.java \ - Assert.java \ - awtgrid/GridDataListener.java \ - awtgrid/TMutableGridDataModel.java \ - awtgrid/DummyColumn.java \ - -#----- create a jar from compiled files ---------------------------- - -JARTARGET = $(TARGET).jar - -#----- JUnit tests class ------------------------------------------- - -JAVATESTFILES = \ - GridControl.java \ - UnitConversion.java \ - - -# disabled for now - the tests fail on at least one platform -# no issue, yet (not sure this is worth it. Don't know who to give the issue to, and don't know whether the test really makes sense) -DISABLED_JAVA_TEST_FILES=\ - AccessibleStatusBar.java\ - AccessibleStatusBarItem.java - - -# --- Targets ------------------------------------------------------ - -.INCLUDE: target.mk - -ALL : ALLTAR - -# --- subsequent tests --------------------------------------------- - -.IF "$(OOO_SUBSEQUENT_TESTS)" != "" - -.INCLUDE: installationtest.mk - -ALLTAR : javatest - - # Sample how to debug - # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y - -.END # "$(OOO_SUBSEQUENT_TESTS)" == "" - -.END # ELSE "$(OOO_JUNIT_JAR)" != "" diff --git a/toolkit/qa/unoapi/makefile.mk b/toolkit/qa/unoapi/makefile.mk deleted file mode 100644 index 9517601c3917..000000000000 --- a/toolkit/qa/unoapi/makefile.mk +++ /dev/null @@ -1,48 +0,0 @@ -#************************************************************************* -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# -# for a copy of the LGPLv3 License. -#***********************************************************************/ - -.IF "$(OOO_SUBSEQUENT_TESTS)" == "" -nothing .PHONY: -.ELSE - -PRJ = ../.. -PRJNAME = toolkit -TARGET = qa_unoapi - -.IF "$(OOO_JUNIT_JAR)" != "" -PACKAGE = org/openoffice/toolkit/qa/unoapi -JAVATESTFILES = Test.java -JAVAFILES = $(JAVATESTFILES) -JARFILES = OOoRunner.jar ridl.jar test.jar -EXTRAJARFILES = $(OOO_JUNIT_JAR) -.END - -.INCLUDE: settings.mk -.INCLUDE: target.mk -.INCLUDE: installationtest.mk - -ALLTAR : javatest - -.END -- cgit v1.2.3 From 2c1329eb2da092247e6ebf2bce192526222576bd Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 29 Mar 2011 12:01:07 +0200 Subject: fs34b: re-enable checkBrokenScripts - works fine --- sfx2/qa/complex/sfx2/UndoManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/qa/complex/sfx2/UndoManager.java b/sfx2/qa/complex/sfx2/UndoManager.java index 2fd5147ca6ed..a50cff82a4bf 100755 --- a/sfx2/qa/complex/sfx2/UndoManager.java +++ b/sfx2/qa/complex/sfx2/UndoManager.java @@ -159,7 +159,7 @@ public class UndoManager } // ----------------------------------------------------------------------------------------------------------------- -//#i116813# disabled @Test + @Test public void checkBrokenScripts() throws com.sun.star.uno.Exception, InterruptedException { System.out.println( "testing: broken scripts" ); -- cgit v1.2.3 From b15ef680e4ee52cdc44f0e51ea3b64d3070e11e9 Mon Sep 17 00:00:00 2001 From: Thorsten Bosbach Date: Tue, 29 Mar 2011 17:03:39 +0200 Subject: #117505# Collect assertions from nonpro OOo for QUAste status files --- testautomation/global/system/includes/gvariabl.inc | 1 + testautomation/global/system/includes/status.inc | 70 +++++++++++++++++++++- 2 files changed, 68 insertions(+), 3 deletions(-) diff --git a/testautomation/global/system/includes/gvariabl.inc b/testautomation/global/system/includes/gvariabl.inc index d9290ebb2c3c..20a05b164aaa 100644 --- a/testautomation/global/system/includes/gvariabl.inc +++ b/testautomation/global/system/includes/gvariabl.inc @@ -146,6 +146,7 @@ Global gTestAppArea as String '///+ gTestAppArea : name of the testarea (e Global gErrorSum as Integer '///+ gErrorSum : last value of errors in a test Global gWarningSum as Integer '///+ gWarningSum : last value of warnings in a test Global gQaErrorSum as Integer '///+ gQaErrorSum : last value of qaErrors in a test +Global gAssertionSum as Integer '///+ gAssertionSum : last value of Assertions in a test Global gStatusDuration '///+ gStatusDuration : starting time to get at the end the duration of a test Global gTestcaseStart as Date '///+ gTestCaseDuration : starting time of the testcase Global glsStatusPage (32000) as String '///+ glsStatusPage () : list for the output in the status-page diff --git a/testautomation/global/system/includes/status.inc b/testautomation/global/system/includes/status.inc index 83430bfaa332..da3e52e3992b 100644 --- a/testautomation/global/system/includes/status.inc +++ b/testautomation/global/system/includes/status.inc @@ -66,6 +66,7 @@ sub hStatusIn ( sTestAppArea as String, sTestname as String, optional sName as S gErrorSum = getErrorCount() ' not 0! if you run 2-times status in/out in one bas-file! gWarningSum = getWarningCount() gQaErrorSum = getQaErrorCount() + gAssertionSum = 0 ' make sure we have everything to update the status-Database. gDatabasePath = getDatabasePath(privateDatabasePath) @@ -109,6 +110,60 @@ sub hStatusOut ( optional NoKill as Boolean ) PrintLog Chr(13) + "* - End of the test - *" Printlog "Date : " + Date() + " Time: " + Time() Printlog "Duration : " + sLocalTestDuration + ' Output assertion count message only in nonpro version + if (NOT isProduct) then + if (gAssertionSum > 0) then + warnlog " ** " + gAssertionSum + " Assertions" + else + printlog " ** " + gAssertionSum + " Assertions" + endif + endif +end sub + +sub hGetNonproAssertions(sName as string, sDuration as string) + Dim sResultFilePath as string + dim fList(15000) as string + dim i, a as integer + dim aCount as integer + dim x + dim soutput as string + dim xlist(15000) as string + + if (bDebugVersion = true) then + 'Get the path to the RESULT directory and put resultfile into array + sResultFilePath = GetIniValue (gTesttoolIni, gTTProfileName , "LogBaseDir") + gPathSigne + Left(gTestname, Len(gTestname)-4) + ".res" + listRead(fList, sResultFilePath, "UTF8") + for i=1 to listcount(fList(0)) + 'Go through whole file, but only last testrun counts + if (left(fList(i),1,1) = "0") then + 'Line starting with 0 indicates start of new testrun: reset counters + aCount=0 + listalldelete(xlist()) + endif + if (left(fList(i),1,1) = "6") then + 'Assertion found like: + '5;~global\system\includes\master.inc;533;12;65535;"Dial + '0 1: file 2:Line 5:Text + x = split(fList(i), ";") + aCount=aCount+1 + sOutput = sName _ + + Chr(9) + sDuration _ + + Chr(9) + "4" _ + + Chr(9) + mid(fRemoveLineBreaks(x(5)),2, len(fRemoveLineBreaks(x(5)))-2) _ + + Chr(9) + x(2) _ + + Chr(9) + "No Revision found" _ + + Chr(9) + fgetFileName(x(1)) _ + + Chr(9) + ListAppend (xlist(), sOutput) + endif + next i + 'Update global message list + for i = gAssertionSum +1 to listcount(xlist) + ListAppend (glsStatusPage(), xlist(i)) + next i + 'Update global assertion counter + gAssertionSum = aCount + endif end sub sub hStatusAddTestcase() @@ -139,7 +194,7 @@ sub hStatusAddTestcase() '///+ duration => the duration of the testcase sTestcaseDuration = wielange(gTestcaseStart, 1) '(2) - sTestcaseStart = convertDateToDatabase(gTestcaseStart) + " " + convertTimeToDatabase(gTestcaseStart) ' TODO: ask HDE/TBO + sTestcaseStart = convertDateToDatabase(gTestcaseStart) + " " + convertTimeToDatabase(gTestcaseStart) sTCname = GetTestcaseName ' testtool basic command iCut = Instr ( sTCname, "(" ) @@ -177,7 +232,7 @@ sub hStatusAddTestcase() endif ' generate status line for testcase and append to global array - '/// iErrorLevel: 0: no faults; 1: Warning; 2: Error; 3: qaError ///' + '/// iErrorLevel: 0: no faults; 1: Warning; 2: Error; 3: qaError; 4: Assertion ///' iErrorLevel = -1 'D printlog "Iall: " + iAllErrorCount + " W:" + iWarningCount + " E: " + iErrorCount for i = 0 to iAllErrorCount @@ -215,6 +270,7 @@ sub hStatusAddTestcase() gErrorSum = getErrorCount() gQaErrorSum = getQaErrorCount() gWarningSum = getWarningCount() + hGetNonproAssertions(sTCname, sTestcaseDuration) ' workaround to get assertions count end sub sub hStatusWriteOutputFirstFile () @@ -234,6 +290,7 @@ sub hStatusWriteOutputFirstFile () dim sTemp as string dim sFileName as string dim slVersion() as string + dim iDebug as integer dim ilVersion as integer dim sVersionCWS as string dim iPosA as integer @@ -261,7 +318,7 @@ sub hStatusWriteOutputFirstFile () '///+ 13 cws name => if it is the master: 'Master' else the name of the childworkspace '///+ 14 source tree => '///+ 15 product => - '///+ 16 builder => + '///+ 16 debug => '///+ 17 checksum => '///+ data => @@ -307,6 +364,12 @@ sub hStatusWriteOutputFirstFile () sUsername = gReturnAddress endif + if (isProduct()) then + iDebug = 0 + else + iDebug = 1 + endif + ListAppend ( lTestrun(), "fileformat=0.2" ) ListAppend ( lTestrun(), "product=" + sProduct ) ListAppend ( lTestrun(), "sourcetree=" + sSource ) @@ -323,6 +386,7 @@ sub hStatusWriteOutputFirstFile () ListAppend ( lTestrun(), "testname=" + gTestName ) '(10) ' generated in hStatusIn ListAppend ( lTestrun(), "cws=" + sVersionCWS ) ListAppend ( lTestrun(), "ooolanguage=" + iSprache ) '(9) + ListAppend ( lTestrun(), "debug=" + iDebug ) ListAppend ( lTestrun(), "checksum=" + "") ' ListAppend ( lTestrun(), "data=" + ) -- cgit v1.2.3 From 7a8a9644f0c9318bae6a82b44ef0326d0eb1f376 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Wed, 30 Mar 2011 10:57:41 +0200 Subject: impress210: #i41995# using view contact to get bound rect for old path animation import --- sw/inc/dcontact.hxx | 2 +- sw/source/core/draw/dcontact.cxx | 2 +- sw/source/core/draw/dflyobj.cxx | 2 +- sw/source/core/inc/dflyobj.hxx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx index a6f336d2776e..7d5fec3e37c0 100644 --- a/sw/inc/dcontact.hxx +++ b/sw/inc/dcontact.hxx @@ -342,7 +342,7 @@ class SwDrawVirtObj : public SdrVirtObj // #108784# // All overloaded methods which need to use the offset - virtual void RecalcBoundRect(bool bForce = false); + virtual void RecalcBoundRect(); virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const; virtual ::basegfx::B2DPolyPolygon TakeContour() const; virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const; diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 3893f52769f0..c510705c533c 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -2599,7 +2599,7 @@ void SwDrawVirtObj::SetBoundRectDirty() // do nothing to not lose model information in aOutRect } -void SwDrawVirtObj::RecalcBoundRect(bool) +void SwDrawVirtObj::RecalcBoundRect() { // OD 2004-04-05 #i26791# - switch order of calling and // , because calculates diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index a18a8947682c..492b44e5c89f 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -563,7 +563,7 @@ const Rectangle& __EXPORT SwVirtFlyDrawObj::GetLastBoundRect() const } -void __EXPORT SwVirtFlyDrawObj::RecalcBoundRect(bool) +void __EXPORT SwVirtFlyDrawObj::RecalcBoundRect() { SetRect(); } diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx index 64c987c54384..23216709a50a 100644 --- a/sw/source/core/inc/dflyobj.hxx +++ b/sw/source/core/inc/dflyobj.hxx @@ -101,7 +101,7 @@ public: //Wir nehemen die Groessenbehandlung vollstaendig selbst in die Hand. virtual const Rectangle& GetCurrentBoundRect() const; virtual const Rectangle& GetLastBoundRect() const; - virtual void RecalcBoundRect(bool bForce = false); + virtual void RecalcBoundRect(); virtual void RecalcSnapRect(); virtual const Rectangle& GetSnapRect() const; virtual void SetSnapRect(const Rectangle& rRect); -- cgit v1.2.3 From 43b6ecf75260e9e13d668d003a73a8e3bd83f823 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Wed, 30 Mar 2011 10:57:41 +0200 Subject: impress210: #i41995# using view contact to get bound rect for old path animation import --- svx/inc/svx/svdobj.hxx | 3 +-- svx/inc/svx/svdogrp.hxx | 3 --- svx/inc/svx/svdovirt.hxx | 2 +- svx/source/svdraw/svdobj.cxx | 6 +++--- svx/source/svdraw/svdogrp.cxx | 12 ------------ svx/source/svdraw/svdovirt.cxx | 2 +- 6 files changed, 6 insertions(+), 22 deletions(-) diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx index ef915a43ae30..86d6f0717bb7 100644 --- a/svx/inc/svx/svdobj.hxx +++ b/svx/inc/svx/svdobj.hxx @@ -673,8 +673,7 @@ public: // a new method for accessing the last BoundRect. virtual const Rectangle& GetLastBoundRect() const; - // If bForced is true, the boundrect is also calculated when the model is locked - virtual void RecalcBoundRect(bool bForced = false); + virtual void RecalcBoundRect(); void BroadcastObjectChange() const; diff --git a/svx/inc/svx/svdogrp.hxx b/svx/inc/svx/svdogrp.hxx index bae18a85a261..9cf0ad056047 100644 --- a/svx/inc/svx/svdogrp.hxx +++ b/svx/inc/svx/svdogrp.hxx @@ -79,9 +79,6 @@ public: virtual const Rectangle& GetCurrentBoundRect() const; virtual const Rectangle& GetSnapRect() const; - // If bForced is true, the boundrect is also calculated when the model is locked - virtual void RecalcBoundRect(bool bForced = false); - virtual void operator=(const SdrObject& rObj); virtual void TakeObjNameSingul(String& rName) const; diff --git a/svx/inc/svx/svdovirt.hxx b/svx/inc/svx/svdovirt.hxx index b169e9e03958..dba62f84730e 100644 --- a/svx/inc/svx/svdovirt.hxx +++ b/svx/inc/svx/svdovirt.hxx @@ -76,7 +76,7 @@ public: virtual const Rectangle& GetCurrentBoundRect() const; virtual const Rectangle& GetLastBoundRect() const; - virtual void RecalcBoundRect(bool bForced = false); + virtual void RecalcBoundRect(); virtual void SetChanged(); virtual SdrObject* Clone() const; virtual void operator=(const SdrObject& rObj); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 2655a335eedc..cc2ece168ec7 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -926,14 +926,14 @@ const Rectangle& SdrObject::GetLastBoundRect() const return aOutRect; } -void SdrObject::RecalcBoundRect(bool bForced) +void SdrObject::RecalcBoundRect() { // #i101680# suppress BoundRect calculations on import(s) - if(pModel && pModel->isLocked() && !bForced ) + if(pModel && pModel->isLocked()) return; // central new method which will calculate the BoundRect using primitive geometry - if(aOutRect.IsEmpty() || bForced) + if(aOutRect.IsEmpty()) { const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(GetViewContact().getViewIndependentPrimitive2DSequence()); diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index c62732ed044b..152ab501f8e6 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -282,18 +282,6 @@ const Rectangle& SdrObjGroup::GetCurrentBoundRect() const // <-- } -void SdrObjGroup::RecalcBoundRect(bool bForced) -{ - if( bForced ) - { - sal_uIntPtr nAnz=pSub->GetObjCount(); - for( sal_uIntPtr i=0; iGetObj(i)->RecalcBoundRect(true); - } - - SdrObject::RecalcBoundRect(bForced); -} - const Rectangle& SdrObjGroup::GetSnapRect() const { // --> OD 2007-02-01 #144962# diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index b276fcc375a4..c6703f2305df 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -148,7 +148,7 @@ const Rectangle& SdrVirtObj::GetLastBoundRect() const return aOutRect; } -void SdrVirtObj::RecalcBoundRect(bool /*bForced*/) +void SdrVirtObj::RecalcBoundRect() { aOutRect=rRefObj.GetCurrentBoundRect(); aOutRect+=aAnchor; -- cgit v1.2.3 From 64fd6776945540e0ed3bd7e7467d4a00b6bcb7a0 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Wed, 30 Mar 2011 10:57:41 +0200 Subject: impress210: #i41995# using view contact to get bound rect for old path animation import --- sd/source/core/CustomAnimationEffect.cxx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 52d53426f133..9ce0084ddbd3 100755 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -72,6 +72,8 @@ #include +#include +#include #include #include #include @@ -1738,8 +1740,19 @@ void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj SdrObject* pObj = GetSdrObjectFromXShape( getTargetShape() ); if( pObj ) { - pObj->RecalcBoundRect(true); - const Rectangle aBoundRect( pObj->GetCurrentBoundRect() ); + Rectangle aBoundRect(0,0,0,0); + + const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(pObj->GetViewContact().getViewIndependentPrimitive2DSequence()); + const drawinglayer::geometry::ViewInformation2D aViewInformation2D; + const basegfx::B2DRange aRange(drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xPrimitives, aViewInformation2D)); + + if(!aRange.isEmpty()) + { + aBoundRect = Rectangle( + (sal_Int32)floor(aRange.getMinX()), (sal_Int32)floor(aRange.getMinY()), + (sal_Int32)ceil(aRange.getMaxX()), (sal_Int32)ceil(aRange.getMaxY())); + } + const Point aCenter( aBoundRect.Center() ); xPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(-aCenter.X(), -aCenter.Y())); -- cgit v1.2.3 From fec53163e753a20e6749b84ffd6a55b08741435c Mon Sep 17 00:00:00 2001 From: "Wolfram Garten [wg]" Date: Wed, 30 Mar 2011 14:10:21 +0200 Subject: Bug 112593 - [Automation][g_demoguide.bas]test interrupts on windows --- testautomation/graphics/optional/includes/global/g_demoguide.inc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/testautomation/graphics/optional/includes/global/g_demoguide.inc b/testautomation/graphics/optional/includes/global/g_demoguide.inc index 0860e8cb942a..9e1a4ffbf497 100644 --- a/testautomation/graphics/optional/includes/global/g_demoguide.inc +++ b/testautomation/graphics/optional/includes/global/g_demoguide.inc @@ -263,16 +263,15 @@ testcase t_Interoperability Kontext "DocumentImpress" Kontext "Slides" Kontext "SlidesControl" - SlidesControl.OpenContextMenu sleep 1 - hMenuSelectNr (8) + SlidesControl.TypeKeys "" + Kontext "DocumentImpress" DocumentImpress.TypeKeys "", true Kontext "Slides" Kontext "SlidesControl" - SlidesControl.OpenContextMenu sleep 1 - hMenuSelectNr (10) + SlidesControl.TypeKeys "" Printlog " Verify that the slide was moved correctly" Kontext "Slides" -- cgit v1.2.3 From 2d6d500b8dc65a2f2c93b2dc2c1ad2ab0301b265 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Thu, 31 Mar 2011 10:05:04 +0200 Subject: impress210: fixed solaris compile warning --- sw/inc/doc.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index a5331ebef810..257a8a31b4dd 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -599,7 +599,7 @@ private: sal_Bool mbStartIdleTimer ; // idle timer mode start/stop - bool mbSetDrawDefaults; ; // set draw pool defaults for freshly created documents + bool mbSetDrawDefaults ; // set draw pool defaults for freshly created documents static SwAutoCompleteWord *pACmpltWords; // Liste aller Worte fuers AutoComplete -- cgit v1.2.3 From f56617b47a0072d699b40e11bf91ac0ecd4f01e7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 31 Mar 2011 13:00:07 +0200 Subject: gridfixes: #i117549# create/loadTabPage: use a GeometryControlModel only if the parent model is one, too --- toolkit/source/controls/tabpagecontainer.cxx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx index 387e5a50b033..84ecef367e56 100644 --- a/toolkit/source/controls/tabpagecontainer.cxx +++ b/toolkit/source/controls/tabpagecontainer.cxx @@ -109,15 +109,21 @@ Reference< ::com::sun::star::beans::XPropertySetInfo > UnoControlTabPageContaine namespace { Reference< XTabPageModel > lcl_createTabPageModel( ::comphelper::ComponentContext const & i_context, - Sequence< Any > const & i_initArguments ) + Sequence< Any > const & i_initArguments, Reference< XPropertySet > const & i_parentModel ) { try { - Reference< XTabPageModel > const xTabPageModel( - *( new OGeometryControlModel< UnoControlTabPageModel >( i_context.getLegacyServiceFactory() ) ), - UNO_QUERY_THROW - ); + Reference< XPropertySet > const xParentDelegator( i_parentModel, UNO_QUERY_THROW ); + Reference< XPropertySetInfo > const xPSI( xParentDelegator->getPropertySetInfo() ); + bool const isGeometryControlModel = xPSI.is() && xPSI->hasPropertyByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ) ); + Reference< XInterface > xInstance; + if ( isGeometryControlModel ) + xInstance = *( new OGeometryControlModel< UnoControlTabPageModel >( i_context.getLegacyServiceFactory() ) ); + else + xInstance = *( new UnoControlTabPageModel( i_context.getLegacyServiceFactory() ) ); + + Reference< XTabPageModel > const xTabPageModel( xInstance, UNO_QUERY_THROW ); Reference< XInitialization > const xInit( xTabPageModel, UNO_QUERY_THROW ); xInit->initialize( i_initArguments ); @@ -139,7 +145,7 @@ Reference< XTabPageModel > SAL_CALL UnoControlTabPageContainerModel::createTabPa { Sequence< Any > aInitArgs(1); aInitArgs[0] <<= i_tabPageID; - return lcl_createTabPageModel( maContext, aInitArgs ); + return lcl_createTabPageModel( maContext, aInitArgs, this ); } Reference< XTabPageModel > SAL_CALL UnoControlTabPageContainerModel::loadTabPage( ::sal_Int16 i_tabPageID, const ::rtl::OUString& i_resourceURL ) throw (RuntimeException) @@ -147,7 +153,7 @@ Reference< XTabPageModel > SAL_CALL UnoControlTabPageContainerModel::loadTabPage Sequence< Any > aInitArgs(2); aInitArgs[0] <<= i_tabPageID; aInitArgs[1] <<= i_resourceURL; - return lcl_createTabPageModel( maContext, aInitArgs ); + return lcl_createTabPageModel( maContext, aInitArgs, this ); } void SAL_CALL UnoControlTabPageContainerModel::insertByIndex( ::sal_Int32 nIndex, const com::sun::star::uno::Any& aElement) throw (IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException) -- cgit v1.2.3 From 73ab31cd8ff9199678df31d0c500a58ff46303b0 Mon Sep 17 00:00:00 2001 From: marc Date: Thu, 31 Mar 2011 13:21:06 +0200 Subject: check also if the given gPrivateEnvironmentLocation is a path and not a file --- testautomation/global/system/includes/iniinfo.inc | 31 +++++++++++++++-------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/testautomation/global/system/includes/iniinfo.inc b/testautomation/global/system/includes/iniinfo.inc index 3423584253fd..e187f77e4a57 100644 --- a/testautomation/global/system/includes/iniinfo.inc +++ b/testautomation/global/system/includes/iniinfo.inc @@ -122,27 +122,38 @@ sub GetIniInformation call sCheckValgrindStatus() ' set a global path for custom scripts outside of current environment gPrivateEnvironmentLocation = getIniValue(gTesttoolIni, "PrivateEnvironment", "Current") - if (gPrivateEnvironmentLocation <> "" AND gPrivateEnvironmentLocation <> ".") then + if (gPrivateEnvironmentLocation <> "" AND gPrivateEnvironmentLocation <> ".") then ' check if the gPrivateEnvironmentLocation path exists if fileExists(gPrivateEnvironmentLocation) then - ' check if the path ends with a path sign and add the path sign if not - if (Right(gPrivateEnvironmentLocation,1) <> gPathSigne) then - gPrivateEnvironmentLocation = gPrivateEnvironmentLocation & gPathSigne - endif + if getAttr(gPrivateEnvironmentLocation) = 16 then + ' check if the path ends with a path sign and add the path sign if not + if (Right(gPrivateEnvironmentLocation,1) <> gPathSigne) then + gPrivateEnvironmentLocation = gPrivateEnvironmentLocation & gPathSigne + endif + else + qaErrorLog "[PrivateEnvironment] you need to specify a path" + gPrivateEnvironmentLocation = "" + endif else ' check if the gTesttoolPath plus the gPrivateEnvironmentLocation path exists ' f.e. this is for a relative path if fileExists(gTesttoolPath & gPrivateEnvironmentLocation) then + ' check if the gPrivateEnvironmentLocation is a path gPrivateEnvironmentLocation = gTesttoolPath & gPrivateEnvironmentLocation - ' check if the path ends with a path sign and add the path sign if not - if (Right(gPrivateEnvironmentLocation,1) <> gPathSigne) then - gPrivateEnvironmentLocation = gPrivateEnvironmentLocation & gPathSigne - endif + if getAttr(gPrivateEnvironmentLocation) = 16 then + ' check if the path ends with a path sign and add the path sign if not + if (Right(gPrivateEnvironmentLocation,1) <> gPathSigne) then + gPrivateEnvironmentLocation = gPrivateEnvironmentLocation & gPathSigne + endif + else + qaErrorLog "[PrivateEnvironment] you need to specify a path" + gPrivateEnvironmentLocation = "" + endif else qaErrorLog "[PrivateEnvironment] defined in: '" & gTesttoolIni & "', but the path '" & gPrivateEnvironmentLocation & "'does not exist!" gPrivateEnvironmentLocation = "" endif - end if + end if else gPrivateEnvironmentLocation = "" end if -- cgit v1.2.3 From fe8e5fb4ca597c66d9fbb6f56049f4eea8e698f3 Mon Sep 17 00:00:00 2001 From: marc Date: Thu, 31 Mar 2011 13:30:44 +0200 Subject: cws fs34b: #i117507# --- testautomation/dbaccess/optional/includes/xf_Submission.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testautomation/dbaccess/optional/includes/xf_Submission.inc b/testautomation/dbaccess/optional/includes/xf_Submission.inc index 05f0da768cdf..a928d660b093 100644 --- a/testautomation/dbaccess/optional/includes/xf_Submission.inc +++ b/testautomation/dbaccess/optional/includes/xf_Submission.inc @@ -172,8 +172,8 @@ testcase tDataNavigatorSubmission dim sLine as String Line Input #1, sLine - if sLine <> "" then - warnlog "the first line in the xml document should but it is " + sLine + if sLine <> "" then + warnlog "the first line in the xml document should but it is " + sLine endif Line Input #1, sLine if sLine <> "" then -- cgit v1.2.3 From a5f4a3b00662d684b9d22045fae21e54a9adb442 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 31 Mar 2011 14:37:25 +0200 Subject: impress211: #i116339# implement bHandleAllCurrentEvents --- vcl/unx/source/app/saldata.cxx | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/vcl/unx/source/app/saldata.cxx b/vcl/unx/source/app/saldata.cxx index b14c11ac783e..d13185626713 100644 --- a/vcl/unx/source/app/saldata.cxx +++ b/vcl/unx/source/app/saldata.cxx @@ -674,6 +674,8 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) if (p_prioritize_timer != NULL) CheckTimeout(); + const int nMaxEvents = bHandleAllCurrentEvents ? 100 : 1; + // first, check for already queued events. for ( int nFD = 0; nFD < nFDs_; nFD++ ) { @@ -681,20 +683,11 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) if ( pEntry->fd ) { DBG_ASSERT( nFD == pEntry->fd, "wrong fd in Yield()" ); - if ( pEntry->HasPendingEvent() ) + for( int i = 0; i < nMaxEvents && pEntry->HasPendingEvent(); i++ ) { pEntry->HandleNextEvent(); - // #63862# da jetzt alle user-events ueber die interne - // queue kommen, wird die Kontrolle analog zum select - // gesteuerten Zweig einmal bei bWait abgegeben - - /* #i9277# do not reschedule since performance gets down the - the drain under heavy load - YieldMutexReleaser aReleaser; - if ( bWait ) osl_yieldThread(); - */ - - return; + if( ! bHandleAllCurrentEvents ) + return; } } } @@ -781,7 +774,6 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents ) } if ( FD_ISSET( nFD, &ReadFDS ) ) { - int nMaxEvents = bHandleAllCurrentEvents ? 100 : 1; for( int i = 0; pEntry->IsEventQueued() && i < nMaxEvents; i++ ) { pEntry->HandleNextEvent(); -- cgit v1.2.3 From e41058cfe6dc00611384071e3f48f5e4b3462138 Mon Sep 17 00:00:00 2001 From: marc Date: Thu, 31 Mar 2011 16:04:03 +0200 Subject: cws fs34b: fix for report wizard testcase --- testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc b/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc index 8743feae997b..4620d90150d4 100644 --- a/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc +++ b/testautomation/dbaccess/optional/includes/wiz_ReportWizard.inc @@ -86,8 +86,7 @@ testcase tNewReport sleep(10) Kontext "DocumentWriter" - DocumentWriter.TypeKeys "" , true ' EDIT / SELECT TEXT - DocumentWriter.TypeKeys "" , true + DocumentWriter.TypeKeys "" , true ' EDIT / SELECT TEXT DocumentWriter.TypeKeys "" , true DocumentWriter.TypeKeys "" , true @@ -102,7 +101,7 @@ testcase tNewReport ' select next line and check content Kontext "DocumentWriter" - DocumentWriter.TypeKeys "" , true + DocumentWriter.TypeKeys "", 2, true DocumentWriter.TypeKeys "" , true DocumentWriter.TypeKeys "" , true -- cgit v1.2.3 From e0e97d22957503cc65e9707d33727968555d9e3b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 1 Apr 2011 10:52:46 +0200 Subject: gridfixes: impl_ni_relayout: update the child window position/size as very last step, it relies on the other calculations (in particular calculation of the column widths) being finished --- svtools/source/table/tablecontrol_impl.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 0de48eaff162..feab64901636 100755 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -1240,9 +1240,6 @@ namespace svt { namespace table } } - // show or hide the scrollbars as needed - impl_ni_positionChildWindows( aDataCellPlayground, bNeedVerticalScrollbar, bNeedHorizontalScrollbar ); - // the initial call to impl_ni_calculateColumnWidths assumed that we need a vertical scrollbar. If, by now, // we know that this is not the case, re-calculate the column widths. if ( !bNeedVerticalScrollbar ) @@ -1296,6 +1293,9 @@ namespace svt { namespace table colPos->move( offsetPixel ); } } + + // show or hide the scrollbars as needed, and position the data window + impl_ni_positionChildWindows( aDataCellPlayground, bNeedVerticalScrollbar, bNeedHorizontalScrollbar ); } //------------------------------------------------------------------------------------------------------------------ -- cgit v1.2.3 From 19ca2fef84f4d0dd1bfe94d07d164454f9e910d0 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 1 Apr 2011 12:00:33 +0200 Subject: gridfixes: lcl_getAlignmentTextDrawFlags: care for the rare cases that the table has row headers, but no columns at all --- svtools/source/table/gridtablerenderer.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index 35dd636d0e74..341c398b5bcd 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -173,7 +173,9 @@ namespace svt { namespace table } sal_uLong nHorzFlag = TEXT_DRAW_LEFT; - HorizontalAlignment const eHorzAlign = i_impl.rModel.getColumnModel( i_columnPos )->getHorizontalAlign(); + HorizontalAlignment const eHorzAlign = i_impl.rModel.getColumnCount() > 0 + ? i_impl.rModel.getColumnModel( i_columnPos )->getHorizontalAlign() + : HorizontalAlignment_CENTER; switch ( eHorzAlign ) { case HorizontalAlignment_CENTER: nHorzFlag = TEXT_DRAW_CENTER; break; -- cgit v1.2.3 From c6b495aabfc3ad816fce7089215b2152b39dbfa8 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 1 Apr 2011 12:54:55 +0200 Subject: gridfixes: re-enable the mouse listeners which got lost in a previous change. Do this by making the TableControl a CompoundControl, so VCL cares for everything which is needed. Consequently, get rid of the manual notification of the respective VCLEVENT_*'s, and everything related to it --- svtools/inc/svtools/table/tablecontrol.hxx | 3 --- svtools/source/table/tablecontrol.cxx | 18 ++---------------- svtools/source/table/tabledatawindow.cxx | 2 -- svtools/source/table/tabledatawindow.hxx | 6 ------ 4 files changed, 2 insertions(+), 27 deletions(-) diff --git a/svtools/inc/svtools/table/tablecontrol.hxx b/svtools/inc/svtools/table/tablecontrol.hxx index edcca9d11a9a..6237e4fb9b6a 100644 --- a/svtools/inc/svtools/table/tablecontrol.hxx +++ b/svtools/inc/svtools/table/tablecontrol.hxx @@ -215,9 +215,6 @@ namespace svt { namespace table // ............................................................................................................. private: - DECL_DLLPRIVATE_LINK( ImplMouseButtonDownHdl, MouseEvent* ); - DECL_DLLPRIVATE_LINK( ImplMouseButtonUpHdl, MouseEvent* ); - DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* ); private: diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index ef667346d07c..d0e726fa5c53 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -61,14 +61,14 @@ namespace svt { namespace table ,m_pImpl( new TableControl_Impl( *this ) ) { TableDataWindow& rDataWindow = m_pImpl->getDataWindow(); - rDataWindow.SetMouseButtonDownHdl( LINK( this, TableControl, ImplMouseButtonDownHdl ) ); - rDataWindow.SetMouseButtonUpHdl( LINK( this, TableControl, ImplMouseButtonUpHdl ) ); rDataWindow.SetSelectHdl( LINK( this, TableControl, ImplSelectHdl ) ); // by default, use the background as determined by the style settings const Color aWindowColor( GetSettings().GetStyleSettings().GetFieldColor() ); SetBackground( Wallpaper( aWindowColor ) ); SetFillColor( aWindowColor ); + + SetCompoundControl( true ); } // ----------------------------------------------------------------------------------------------------------------- @@ -681,20 +681,6 @@ namespace svt { namespace table return 1; } - //------------------------------------------------------------------------------------------------------------------ - IMPL_LINK( TableControl, ImplMouseButtonDownHdl, MouseEvent*, pData ) - { - CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, pData ); - return 1; - } - - //------------------------------------------------------------------------------------------------------------------ - IMPL_LINK( TableControl, ImplMouseButtonUpHdl, MouseEvent*, pData ) - { - CallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, pData ); - return 1; - } - //------------------------------------------------------------------------------------------------------------------ void TableControl::Select() { diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx index e7b238c5998c..d4d9bb90d080 100644 --- a/svtools/source/table/tabledatawindow.cxx +++ b/svtools/source/table/tabledatawindow.cxx @@ -212,7 +212,6 @@ namespace svt { namespace table { m_aSelectHdl.Call( NULL ); } - m_aMouseButtonDownHdl.Call((MouseEvent*) &rMEvt); } //------------------------------------------------------------------------------------------------------------------ @@ -221,7 +220,6 @@ namespace svt { namespace table if ( !m_rTableControl.getInputHandler()->MouseButtonUp( m_rTableControl, rMEvt ) ) Window::MouseButtonUp( rMEvt ); - m_aMouseButtonUpHdl.Call((MouseEvent*) &rMEvt); m_rTableControl.getAntiImpl().GrabFocus(); } diff --git a/svtools/source/table/tabledatawindow.hxx b/svtools/source/table/tabledatawindow.hxx index 6f78ac49c44d..645c37641870 100644 --- a/svtools/source/table/tabledatawindow.hxx +++ b/svtools/source/table/tabledatawindow.hxx @@ -52,8 +52,6 @@ namespace svt { namespace table friend class TableFunctionSet; private: TableControl_Impl& m_rTableControl; - Link m_aMouseButtonDownHdl; - Link m_aMouseButtonUpHdl; Link m_aSelectHdl; sal_uLong m_nTipWindowHandle; @@ -61,10 +59,6 @@ namespace svt { namespace table TableDataWindow( TableControl_Impl& _rTableControl ); ~TableDataWindow(); - inline void SetMouseButtonDownHdl( const Link& rLink ) { m_aMouseButtonDownHdl = rLink; } - inline const Link& GetMouseButtonDownHdl() const { return m_aMouseButtonDownHdl; } - inline void SetMouseButtonUpHdl( const Link& rLink ) { m_aMouseButtonUpHdl = rLink; } - inline const Link& GetMouseButtonUpHdl() const { return m_aMouseButtonUpHdl; } inline void SetSelectHdl( const Link& rLink ) { m_aSelectHdl = rLink; } inline const Link& GetSelectHdl() const { return m_aSelectHdl; } -- cgit v1.2.3 From 586adfc8c014ecc5bb7e96da8c28f6e6e30fb0ab Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 1 Apr 2011 13:05:33 +0200 Subject: gridfixes: removed useles debug output --- svtools/source/table/tabledatawindow.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx index d4d9bb90d080..ccdd826686f6 100644 --- a/svtools/source/table/tabledatawindow.cxx +++ b/svtools/source/table/tabledatawindow.cxx @@ -158,7 +158,6 @@ namespace svt { namespace table if ( m_nTipWindowHandle ) { - OSL_TRACE( ::rtl::OUStringToOString( sHelpText, RTL_TEXTENCODING_ASCII_US ) ); Help::UpdateTip( m_nTipWindowHandle, this, aControlScreenRect, sHelpText ); } else -- cgit v1.2.3 From 4c9189670ea0b94ea1e77f1c0fbe7b462b69cfb1 Mon Sep 17 00:00:00 2001 From: "Marc Neumann [msc]" Date: Fri, 1 Apr 2011 13:35:53 +0200 Subject: cws:fs34b fix menu item count --- .../dbaccess/required/includes/ReportBuilder01.inc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/testautomation/dbaccess/required/includes/ReportBuilder01.inc b/testautomation/dbaccess/required/includes/ReportBuilder01.inc index d1cce59d4d3f..91faba007d11 100644 --- a/testautomation/dbaccess/required/includes/ReportBuilder01.inc +++ b/testautomation/dbaccess/required/includes/ReportBuilder01.inc @@ -116,13 +116,13 @@ testcase tMainMenuBar 'edit menu - '/// check if there are 11 items in the edit menu. - printlog "check if there are 11 items in the edit menu." + '/// check if there are 14 items in the edit menu. + printlog "check if there are 14 items in the edit menu." ReportDesign.UseMenu hMenuSelectNr(2) iCount = hMenuItemGetCount() - if (iCount <> 11) then - warnlog "There should 11 items in the edit menu but there are " + iCount + " items." + if (iCount <> 14) then + warnlog "There should 14 items in the edit menu but there are " + iCount + " items." end if call hMenuClose() @@ -140,13 +140,13 @@ testcase tMainMenuBar 'insert menu - '/// check if there are 3 items in the insert menu. - printlog "check if there are 3 items in the insert menu." + '/// check if there are 5 items in the insert menu. + printlog "check if there are 5 items in the insert menu." ReportDesign.UseMenu hMenuSelectNr(4) iCount = hMenuItemGetCount() - if (iCount <> 3) then - warnlog "There should 3 items in the insert menu but there are " + iCount + " items." + if (iCount <> 5) then + warnlog "There should 5 items in the insert menu but there are " + iCount + " items." end if call hMenuClose() @@ -336,7 +336,7 @@ testcase tExecuteReport Kontext "ReportDesign" ReportDesign.UseMenu hMenuSelectNr(2) - hMenuSelectNr(11) + hMenuSelectNr(14) sleep(10) -- cgit v1.2.3 From 45842b3d9f84bae6276e2b84264fc1a94b72eee4 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Fri, 1 Apr 2011 15:33:17 +0200 Subject: dr80: #i117511# removed one more assertion --- oox/source/xls/formulabase.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx index 25398f9aa133..366e4a0dbde7 100755 --- a/oox/source/xls/formulabase.cxx +++ b/oox/source/xls/formulabase.cxx @@ -1283,7 +1283,7 @@ bool OpCodeProviderImpl::initFuncOpCodes( const ApiTokenMap& rIntFuncTokenMap, c // set API opcode from ODF function name bIsValid &= initFuncOpCode( *xFuncInfo, xFuncInfo->mbExternal ? rExtFuncTokenMap : rIntFuncTokenMap ); // insert the function info into the maps - if( xFuncInfo->mnApiOpCode != OPCODE_NONAME ) + if( (xFuncInfo->mnApiOpCode != OPCODE_NONAME) && (xFuncInfo->mnApiOpCode != OPCODE_BAD) ) { if( (xFuncInfo->mnApiOpCode == OPCODE_EXTERNAL) && (xFuncInfo->maExtProgName.getLength() > 0) ) maExtProgFuncs[ xFuncInfo->maExtProgName ] = xFuncInfo; -- cgit v1.2.3 From 66e66b326ce4fa6b1507373fe9e4cfbbfd08e257 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 4 Apr 2011 14:29:53 +0200 Subject: impress210: #i78386# looping sound for windows --- avmedia/source/win/player.cxx | 126 +++++++++++++++++++++++++++++++++++++----- avmedia/source/win/player.hxx | 3 + avmedia/source/win/window.cxx | 37 ++++++++----- avmedia/source/win/window.hxx | 2 - 4 files changed, 138 insertions(+), 30 deletions(-) diff --git a/avmedia/source/win/player.cxx b/avmedia/source/win/player.cxx index e5c010dc258a..56efbe6b107b 100644 --- a/avmedia/source/win/player.cxx +++ b/avmedia/source/win/player.cxx @@ -52,6 +52,30 @@ using namespace ::com::sun::star; namespace avmedia { namespace win { +LRESULT CALLBACK MediaPlayerWndProc_2( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM nPar2 ) +{ + Player* pPlayer = (Player*) ::GetWindowLong( hWnd, 0 ); + bool bProcessed = true; + + if( pPlayer ) + { + switch( nMsg ) + { + case( WM_GRAPHNOTIFY ): + pPlayer->processEvent(); + break; + default: + bProcessed = false; + break; + } + } + else + bProcessed = false; + + return( bProcessed ? 0 : DefWindowProc( hWnd, nMsg, nPar1, nPar2 ) ); +} + + bool isWindowsVistaOrHigher() { // POST: return true if we are at least on Windows Vista @@ -59,10 +83,7 @@ bool isWindowsVistaOrHigher() ZeroMemory(&osvi, sizeof(osvi)); osvi.dwOSVersionInfoSize = sizeof(osvi); GetVersionEx(&osvi); - if ( osvi.dwMajorVersion >= 6 ) - return true; - - return false; + return osvi.dwMajorVersion >= 6; } // ---------------- @@ -83,8 +104,10 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : mpVW( NULL ), mpEV( NULL ), mnUnmutedVolume( 0 ), + mnFrameWnd( 0 ), mbMuted( false ), - mbLooping( false ) + mbLooping( false ), + mbAddWindow(sal_True) { ::CoInitialize( NULL ); } @@ -93,6 +116,9 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : Player::~Player() { + if( mnFrameWnd ) + ::DestroyWindow( (HWND) mnFrameWnd ); + ::CoUninitialize(); } @@ -118,7 +144,11 @@ void SAL_CALL Player::disposing() mpMS->Release(); if( mpME ) + { + mpME->SetNotifyWindow( 0, WM_GRAPHNOTIFY, 0); mpME->Release(); + } + if( mpMC ) mpMC->Release(); @@ -143,15 +173,12 @@ bool Player::create( const ::rtl::OUString& rURL ) // Don't use the overlay mixer on Windows Vista // It disables the desktop composition as soon as RenderFile is called // also causes some other problems: video rendering is not reliable - if( !isWindowsVistaOrHigher() ) + if( !isWindowsVistaOrHigher() && SUCCEEDED( CoCreateInstance( CLSID_OverlayMixer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**) &mpOMF ) ) ) { - if( SUCCEEDED( CoCreateInstance( CLSID_OverlayMixer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**) &mpOMF ) ) ) - { - mpGB->AddFilter( mpOMF, L"com_sun_star_media_OverlayMixerFilter" ); + mpGB->AddFilter( mpOMF, L"com_sun_star_media_OverlayMixerFilter" ); - if( !SUCCEEDED( mpOMF->QueryInterface( IID_IDDrawExclModeVideo, (void**) &mpEV ) ) ) - mpEV = NULL; - } + if( !SUCCEEDED( mpOMF->QueryInterface( IID_IDDrawExclModeVideo, (void**) &mpEV ) ) ) + mpEV = NULL; } if( SUCCEEDED( hR = mpGB->RenderFile( reinterpret_cast(rURL.getStr()), NULL ) ) && @@ -193,6 +220,7 @@ const IVideoWindow* Player::getVideoWindow() const void Player::setNotifyWnd( int nNotifyWnd ) { + mbAddWindow = sal_False; if( mpME ) mpME->SetNotifyWindow( (OAHWND) nNotifyWnd, WM_GRAPHNOTIFY, reinterpret_cast< LONG_PTR>( this ) ); } @@ -214,7 +242,7 @@ long Player::processEvent() { long nCode, nParam1, nParam2; - if( mpME && SUCCEEDED( mpME->GetEvent( &nCode, &nParam1, &nParam2, 0 ) ) ) + while( mpME && SUCCEEDED( mpME->GetEvent( &nCode, &nParam1, &nParam2, 0 ) ) ) { if( EC_COMPLETE == nCode ) { @@ -241,8 +269,44 @@ long Player::processEvent() void SAL_CALL Player::start( ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); if( mpMC ) + { + if ( mbAddWindow ) + { + static WNDCLASS* mpWndClass = NULL; + if ( !mpWndClass ) + { + mpWndClass = new WNDCLASS; + + memset( mpWndClass, 0, sizeof( *mpWndClass ) ); + mpWndClass->hInstance = GetModuleHandle( NULL ); + mpWndClass->cbWndExtra = sizeof( DWORD ); + mpWndClass->lpfnWndProc = MediaPlayerWndProc_2; + mpWndClass->lpszClassName = "com_sun_star_media_Sound_Player"; + mpWndClass->hbrBackground = (HBRUSH) ::GetStockObject( BLACK_BRUSH ); + mpWndClass->hCursor = ::LoadCursor( NULL, IDC_ARROW ); + + ::RegisterClass( mpWndClass ); + } + if ( !mnFrameWnd ) + { + mnFrameWnd = (int) ::CreateWindow( mpWndClass->lpszClassName, NULL, + 0, + 0, 0, 0, 0, + (HWND) NULL, NULL, mpWndClass->hInstance, 0 ); + if ( mnFrameWnd ) + { + ::ShowWindow((HWND) mnFrameWnd, SW_HIDE); + ::SetWindowLong( (HWND) mnFrameWnd, 0, (DWORD) this ); + // mpVW->put_Owner( (OAHWND) mnFrameWnd ); + setNotifyWnd( mnFrameWnd ); + } + } + } + mpMC->Run(); + } } // ------------------------------------------------------------------------------ @@ -250,6 +314,8 @@ void SAL_CALL Player::start( ) void SAL_CALL Player::stop( ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + if( mpMC ) mpMC->Stop(); } @@ -259,6 +325,8 @@ void SAL_CALL Player::stop( ) sal_Bool SAL_CALL Player::isPlaying() throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + OAFilterState eFilterState; bool bRet = false; @@ -273,6 +341,8 @@ sal_Bool SAL_CALL Player::isPlaying() double SAL_CALL Player::getDuration( ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + REFTIME aRefTime( 0.0 ); if( mpMP ) @@ -286,6 +356,8 @@ double SAL_CALL Player::getDuration( ) void SAL_CALL Player::setMediaTime( double fTime ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + if( mpMP ) { const bool bPlaying = isPlaying(); @@ -302,6 +374,8 @@ void SAL_CALL Player::setMediaTime( double fTime ) double SAL_CALL Player::getMediaTime( ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + REFTIME aRefTime( 0.0 ); if( mpMP ) @@ -315,6 +389,8 @@ double SAL_CALL Player::getMediaTime( ) void SAL_CALL Player::setStopTime( double fTime ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + if( mpMP ) mpMP->put_StopTime( fTime ); } @@ -324,6 +400,8 @@ void SAL_CALL Player::setStopTime( double fTime ) double SAL_CALL Player::getStopTime( ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + REFTIME aRefTime( 0.0 ); if( mpMP ) @@ -337,6 +415,8 @@ double SAL_CALL Player::getStopTime( ) void SAL_CALL Player::setRate( double fRate ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + if( mpMP ) mpMP->put_Rate( fRate ); } @@ -346,6 +426,8 @@ void SAL_CALL Player::setRate( double fRate ) double SAL_CALL Player::getRate( ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + double fRet( 0.0 ); if( mpMP ) @@ -359,6 +441,8 @@ double SAL_CALL Player::getRate( ) void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + mbLooping = bSet; } @@ -367,6 +451,8 @@ void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) sal_Bool SAL_CALL Player::isPlaybackLoop( ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + return mbLooping; } @@ -375,6 +461,8 @@ sal_Bool SAL_CALL Player::isPlaybackLoop( ) void SAL_CALL Player::setMute( sal_Bool bSet ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + if( mpBA && ( mbMuted != bSet ) ) { mbMuted = bSet; @@ -387,6 +475,8 @@ void SAL_CALL Player::setMute( sal_Bool bSet ) sal_Bool SAL_CALL Player::isMute( ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + return mbMuted; } @@ -395,6 +485,8 @@ sal_Bool SAL_CALL Player::isMute( ) void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + mnUnmutedVolume = static_cast< long >( nVolumeDB ) * 100; if( !mbMuted && mpBA ) @@ -406,6 +498,8 @@ void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) sal_Int16 SAL_CALL Player::getVolumeDB( ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + return( static_cast< sal_Int16 >( mnUnmutedVolume / 100 ) ); } @@ -414,6 +508,8 @@ sal_Int16 SAL_CALL Player::getVolumeDB( ) awt::Size SAL_CALL Player::getPreferredPlayerWindowSize( ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + awt::Size aSize( 0, 0 ); if( mpBV ) @@ -433,6 +529,8 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize( ) uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( const uno::Sequence< uno::Any >& aArguments ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + uno::Reference< ::media::XPlayerWindow > xRet; awt::Size aSize( getPreferredPlayerWindowSize() ); @@ -454,6 +552,8 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber( ) throw (uno::RuntimeException) { + ::osl::MutexGuard aGuard(m_aMutex); + uno::Reference< media::XFrameGrabber > xRet; if( maURL.getLength() > 0 ) diff --git a/avmedia/source/win/player.hxx b/avmedia/source/win/player.hxx index d0c40e274f92..eee9b52ee94b 100644 --- a/avmedia/source/win/player.hxx +++ b/avmedia/source/win/player.hxx @@ -117,8 +117,11 @@ private: IVideoWindow* mpVW; IDDrawExclModeVideo* mpEV; long mnUnmutedVolume; + int mnFrameWnd; + sal_Bool mbMuted; sal_Bool mbLooping; + sal_Bool mbAddWindow; void ImplLayoutVideoWindow(); }; diff --git a/avmedia/source/win/window.cxx b/avmedia/source/win/window.cxx index e077e097cc7b..8d4aeb73a65c 100644 --- a/avmedia/source/win/window.cxx +++ b/avmedia/source/win/window.cxx @@ -179,7 +179,25 @@ LRESULT CALLBACK MediaPlayerWndProc( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM n // - Window - // --------------- -WNDCLASS* Window::mpWndClass = NULL; +WNDCLASS* lcl_getWndClass() +{ + static WNDCLASS* s_pWndClass = NULL; + if ( !s_pWndClass ) + { + s_pWndClass = new WNDCLASS; + + memset( s_pWndClass, 0, sizeof( *s_pWndClass ) ); + s_pWndClass->hInstance = GetModuleHandle( NULL ); + s_pWndClass->cbWndExtra = sizeof( DWORD ); + s_pWndClass->lpfnWndProc = MediaPlayerWndProc; + s_pWndClass->lpszClassName = "com_sun_star_media_PlayerWnd"; + s_pWndClass->hbrBackground = (HBRUSH) ::GetStockObject( BLACK_BRUSH ); + s_pWndClass->hCursor = ::LoadCursor( NULL, IDC_ARROW ); + + ::RegisterClass( s_pWndClass ); + } + return s_pWndClass; +} // ------------------------------------------------------------------------------ @@ -194,20 +212,7 @@ Window::Window( const uno::Reference< lang::XMultiServiceFactory >& rxMgr, Playe { ::osl::MutexGuard aGuard( ImplGetOwnStaticMutex() ); - if( !mpWndClass ) - { - mpWndClass = new WNDCLASS; - - memset( mpWndClass, 0, sizeof( *mpWndClass ) ); - mpWndClass->hInstance = GetModuleHandle( NULL ); - mpWndClass->cbWndExtra = sizeof( DWORD ); - mpWndClass->lpfnWndProc = MediaPlayerWndProc; - mpWndClass->lpszClassName = "com_sun_star_media_PlayerWnd"; - mpWndClass->hbrBackground = (HBRUSH) ::GetStockObject( BLACK_BRUSH ); - mpWndClass->hCursor = ::LoadCursor( NULL, IDC_ARROW ); - - ::RegisterClass( mpWndClass ); - } + lcl_getWndClass(); } // ------------------------------------------------------------------------------ @@ -310,6 +315,8 @@ void Window::ImplLayoutVideoWindow() bool Window::create( const uno::Sequence< uno::Any >& rArguments ) { IVideoWindow* pVideoWindow = const_cast< IVideoWindow* >( mrPlayer.getVideoWindow() ); + WNDCLASS* mpWndClass = lcl_getWndClass(); + if( !mnFrameWnd && pVideoWindow && mpWndClass ) { diff --git a/avmedia/source/win/window.hxx b/avmedia/source/win/window.hxx index 36cff49a742a..3605ba970f7a 100644 --- a/avmedia/source/win/window.hxx +++ b/avmedia/source/win/window.hxx @@ -114,8 +114,6 @@ private: int mnParentWnd; int mnPointerType; - static WNDCLASS* mpWndClass; - void ImplLayoutVideoWindow(); }; -- cgit v1.2.3 From 97924d36a60a35c35673c2d8571edf0de053fbc2 Mon Sep 17 00:00:00 2001 From: "Wolfram Garten [wg]" Date: Mon, 4 Apr 2011 15:24:27 +0200 Subject: Bug 117684 - [Automation]: workarounding faulty get item count in g_line.inc --- testautomation/graphics/optional/includes/global/g_line.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/testautomation/graphics/optional/includes/global/g_line.inc b/testautomation/graphics/optional/includes/global/g_line.inc index eb672b3b9716..758f537c5630 100644 --- a/testautomation/graphics/optional/includes/global/g_line.inc +++ b/testautomation/graphics/optional/includes/global/g_line.inc @@ -363,6 +363,7 @@ testcase tLineConnect Dim i as integer Dim cname as string Dim cfirst as integer + Dim CornerStyles as integer if bAsianLan then QaErrorLog "tLineConnect ends because Asian languages are not fully supported." @@ -517,10 +518,11 @@ testcase tLineConnect else sleep 1 endif + + For i = 1 to CornerStyles + Kontext "TabLinie" + if (i > 1) AND (cname <> CornerStyle.GetSelText) then - For i = 1 to CornerStyle.GetItemCount - Kontext "TabLinie" - if (i > 1) AND (cname <> CornerStyle.GetSelText) then warnlog "Cornerstylename wasnt saved. Should have been: " + cname + ". But was: " + CornerStyle.GetSelText endif CornerStyle.Select i -- cgit v1.2.3 From 6ea2a046f54fa8b06daff4a6dac4998aad7e7f7b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 4 Apr 2011 21:54:59 +0200 Subject: gridfixes: now that there are dedicated factory methods at the TabPageContainerModel, there's no need for a global service constructor for the TabPageModel - it won't do the expected thing, anyway, since it creates a model usable outside a dialog only --- offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl b/offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl index 266f6a56119a..b669375b811e 100644 --- a/offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl +++ b/offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl @@ -38,15 +38,9 @@ module com { module sun { module star { module awt { module tab { /** specifies the standard model of a XTabPageModel. @since OOo 3.4 */ -published service UnoControlTabPageModel : XTabPageModel +published service UnoControlTabPageModel { - /** Creates a new XTabPageModel with a given ID. - */ - create([in] short tabPageID); - - /** Creates a new XTabPageModel with a given ID and a url which is used to load the tab page model. - */ - load([in] short tabPageID,[in] string url); + interface XTabPageModel; }; //============================================================================= -- cgit v1.2.3 From ea3188de3f10ca22f5b859ec1eeef6ea0d2db59b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 7 Apr 2011 08:49:15 +0200 Subject: gridfixes: ensure removal of a column at the grid control adjusts the cursor, if needed --- svtools/source/table/tablecontrol_impl.cxx | 10 ++ svtools/source/uno/svtxgridcontrol.cxx | 37 ++++++- svtools/source/uno/svtxgridcontrol.hxx | 14 ++- toolkit/qa/complex/toolkit/GridControl.java | 155 +++++++++++++++++---------- toolkit/source/controls/grid/gridcontrol.cxx | 8 ++ toolkit/source/controls/grid/gridcontrol.hxx | 1 + 6 files changed, 160 insertions(+), 65 deletions(-) diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index feab64901636..2983b6c667ea 100755 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -654,6 +654,16 @@ namespace svt { namespace table void TableControl_Impl::columnRemoved( ColPos const i_colIndex ) { m_nColumnCount = m_pModel->getColumnCount(); + + // adjust the current column, if it is larger than the column count now + if ( m_nCurColumn >= m_nColumnCount ) + { + if ( m_nColumnCount > 0 ) + goTo( m_nCurColumn - 1, m_nCurRow ); + else + m_nCurColumn = COL_INVALID; + } + impl_ni_relayout(); m_rAntiImpl.Invalidate(); diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index d8324c160d5a..64b8f9241ae0 100644 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -75,12 +75,13 @@ using ::com::sun::star::awt::grid::XGridColumn; using ::com::sun::star::container::ContainerEvent; using ::com::sun::star::awt::grid::GridDataEvent; using ::com::sun::star::awt::grid::GridInvalidModelException; +using ::com::sun::star::util::VetoException; /** === end UNO using === **/ namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId; namespace AccessibleStateType = ::com::sun::star::accessibility::AccessibleStateType; -using ::svt::table::TableControl; +using namespace ::svt::table; typedef ::com::sun::star::util::Color UnoColor; @@ -104,6 +105,20 @@ void SVTXGridControl::SetWindow( Window* pWindow ) impl_checkTableModelInit(); } +// --------------------------------------------------------------------------------------------------------------------- +void SVTXGridControl::impl_checkColumnIndex_throw( ::svt::table::TableControl const & i_table, sal_Int32 const i_columnIndex ) const +{ + if ( ( i_columnIndex < 0 ) || ( i_columnIndex >= i_table.GetColumnCount() ) ) + throw IndexOutOfBoundsException( ::rtl::OUString(), *const_cast< SVTXGridControl* >( this ) ); +} + +// --------------------------------------------------------------------------------------------------------------------- +void SVTXGridControl::impl_checkRowIndex_throw( ::svt::table::TableControl const & i_table, sal_Int32 const i_rowIndex ) const +{ + if ( ( i_rowIndex < 0 ) || ( i_rowIndex >= i_table.GetRowCount() ) ) + throw IndexOutOfBoundsException( ::rtl::OUString(), *const_cast< SVTXGridControl* >( this ) ); +} + // --------------------------------------------------------------------------------------------------------------------- sal_Int32 SAL_CALL SVTXGridControl::getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (RuntimeException) { @@ -152,6 +167,20 @@ sal_Int32 SAL_CALL SVTXGridControl::getCurrentRow( ) throw (RuntimeException) return ( nRow >= 0 ) ? nRow : -1; } +//---------------------------------------------------------------------------------------------------------------------- +void SAL_CALL SVTXGridControl::goToCell( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex ) throw (RuntimeException, IndexOutOfBoundsException, VetoException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); + ENSURE_OR_RETURN_VOID( pTable != NULL, "SVTXGridControl::getCurrentRow: no control (anymore)!" ); + + impl_checkColumnIndex_throw( *pTable, i_columnIndex ); + impl_checkRowIndex_throw( *pTable, i_rowIndex ); + + pTable->GoTo( i_columnIndex, i_rowIndex ); +} + // --------------------------------------------------------------------------------------------------------------------- void SAL_CALL SVTXGridControl::addSelectionListener(const Reference< XGridSelectionListener > & listener) throw (RuntimeException) { @@ -666,8 +695,7 @@ void SAL_CALL SVTXGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (Runtim TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::selectRow: no control (anymore)!" ); - if ( ( i_rowIndex < 0 ) || ( i_rowIndex >= pTable->GetRowCount() ) ) - throw IndexOutOfBoundsException( ::rtl::OUString(), *this ); + impl_checkRowIndex_throw( *pTable, i_rowIndex ); pTable->SelectRow( i_rowIndex, true ); } @@ -691,8 +719,7 @@ void SAL_CALL SVTXGridControl::deselectRow( ::sal_Int32 i_rowIndex ) throw (Runt TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() ); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::deselectRow: no control (anymore)!" ); - if ( ( i_rowIndex < 0 ) || ( i_rowIndex >= pTable->GetRowCount() ) ) - throw IndexOutOfBoundsException( ::rtl::OUString(), *this ); + impl_checkRowIndex_throw( *pTable, i_rowIndex ); pTable->SelectRow( i_rowIndex, false ); } diff --git a/svtools/source/uno/svtxgridcontrol.hxx b/svtools/source/uno/svtxgridcontrol.hxx index e8cfea21c631..ebde9b76c078 100755 --- a/svtools/source/uno/svtxgridcontrol.hxx +++ b/svtools/source/uno/svtxgridcontrol.hxx @@ -46,7 +46,9 @@ #include -using namespace ::svt::table; +namespace svt { namespace table { + class TableControl; +} } typedef ::cppu::ImplInheritanceHelper4 < VCLXWindow , ::com::sun::star::awt::grid::XGridControl @@ -57,9 +59,9 @@ typedef ::cppu::ImplInheritanceHelper4 < VCLXWindow class SVTXGridControl : public SVTXGridControl_Base { private: - ::boost::shared_ptr< UnoControlTableModel > m_pTableModel; - bool m_bTableModelInitCompleted; - SelectionListenerMultiplexer m_aSelectionListeners; + ::boost::shared_ptr< ::svt::table::UnoControlTableModel > m_pTableModel; + bool m_bTableModelInitCompleted; + SelectionListenerMultiplexer m_aSelectionListeners; protected: virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); @@ -88,6 +90,7 @@ public: virtual ::sal_Int32 SAL_CALL getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getCurrentColumn( ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getCurrentRow( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL goToCell( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::util::VetoException); // XGridRowSelection virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException ); @@ -114,5 +117,8 @@ protected: private: void impl_updateColumnsFromModel_nothrow(); void impl_checkTableModelInit(); + + void impl_checkColumnIndex_throw( ::svt::table::TableControl const & i_table, sal_Int32 const i_columnIndex ) const; + void impl_checkRowIndex_throw( ::svt::table::TableControl const & i_table, sal_Int32 const i_rowIndex ) const; }; #endif // _SVT_GRIDCONTROL_HXX_ diff --git a/toolkit/qa/complex/toolkit/GridControl.java b/toolkit/qa/complex/toolkit/GridControl.java index bee35ea138cd..22d6e10c7b60 100755 --- a/toolkit/qa/complex/toolkit/GridControl.java +++ b/toolkit/qa/complex/toolkit/GridControl.java @@ -33,6 +33,7 @@ import com.sun.star.awt.XToolkit; import com.sun.star.awt.grid.DefaultGridDataModel; import com.sun.star.awt.grid.XGridColumn; import com.sun.star.awt.grid.XGridColumnModel; +import com.sun.star.awt.grid.XGridControl; import com.sun.star.awt.grid.XGridDataModel; import com.sun.star.awt.grid.XMutableGridDataModel; import com.sun.star.awt.grid.XSortableMutableGridDataModel; @@ -59,6 +60,8 @@ import java.util.List; import java.util.Random; import org.junit.AfterClass; import org.junit.BeforeClass; +import org.junit.After; +import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; import org.openoffice.test.OfficeConnection; @@ -432,63 +435,88 @@ public class GridControl // ----------------------------------------------------------------------------------------------------------------- @Test - public void testModelViewInteraction() throws Exception + public void testView() throws Exception { - final List< Object > disposables = new ArrayList< Object >(); - try - { - // create a simple dialog model/control/peer trinity - final XControlModel dialogModel = createInstance( XControlModel.class, "com.sun.star.awt.UnoControlDialogModel" ); - disposables.add( dialogModel ); - final XPropertySet dialogProps = UnoRuntime.queryInterface( XPropertySet.class, dialogModel ); - dialogProps.setPropertyValue( "Width", 200 ); - dialogProps.setPropertyValue( "Height", 100 ); - dialogProps.setPropertyValue( "Title", "Grid Control Unit Test" ); - final XControl dialogControl = createInstance( XControl.class, "com.sun.star.awt.UnoControlDialog" ); - disposables.add( dialogControl ); - dialogControl.setModel( dialogModel ); - dialogControl.createPeer( createInstance( XToolkit.class, "com.sun.star.awt.Toolkit" ), null ); - - // insert a grid control model - final XMultiServiceFactory controlModelFactory = UnoRuntime.queryInterface( XMultiServiceFactory.class, - dialogModel ); - XPropertySet gridModelProps = UnoRuntime.queryInterface( XPropertySet.class, - controlModelFactory.createInstance( "com.sun.star.awt.grid.UnoControlGridModel" ) ); - disposables.add( gridModelProps ); - gridModelProps.setPropertyValue( "PositionX", 6 ); - gridModelProps.setPropertyValue( "PositionY", 6 ); - gridModelProps.setPropertyValue( "Width", 188 ); - gridModelProps.setPropertyValue( "Height", 88 ); - final XNameContainer modelContainer = UnoRuntime.queryInterface( XNameContainer.class, dialogModel ); - modelContainer.insertByName( "grid", gridModelProps ); - - // check the respective control has been created - final XControlContainer controlContainer = UnoRuntime.queryInterface( XControlContainer.class, dialogControl ); - final XControl gridControl = controlContainer.getControl( "grid" ); - assertNotNull( "no grid control created in the dialog", gridControl ); - - // in the current implementation (not sure this is a good idea at all), the control (more precise: the peer) - // ensures that if there are no columns in the column model, but in the data model, then the column model - // will implicitly have the needed columns added. - // To ensure that clients which rely on this do not break in the future, check this here. - final XMutableGridDataModel dataModel = UnoRuntime.queryInterface( XMutableGridDataModel.class, - gridModelProps.getPropertyValue( "GridDataModel" ) ); - assertNotNull( dataModel ); - assertEquals( 0, dataModel.getColumnCount() ); - - final XGridColumnModel columnModel = UnoRuntime.queryInterface( XGridColumnModel.class, - gridModelProps.getPropertyValue( "ColumnModel" ) ); - assertNotNull( columnModel ); - assertEquals( 0, columnModel.getColumnCount() ); - - dataModel.addRow( null, new Object[] { 1, 2, 3 } ); - assertEquals( 3, dataModel.getColumnCount() ); - assertEquals( 3, columnModel.getColumnCount() ); - } - finally - { - impl_dispose( disposables.toArray()); - } + final XControl control = impl_createDialogWithGridControl(); + final XPropertySet gridModelProps = + UnoRuntime.queryInterface( XPropertySet.class, control.getModel() ); + + // in the current implementation (not sure this is a good idea at all), the control (more precise: the peer) + // ensures that if there are no columns in the column model, but in the data model, then the column model + // will implicitly have the needed columns added. + // To ensure that clients which rely on this do not break in the future, check this here. + final XMutableGridDataModel dataModel = UnoRuntime.queryInterface( XMutableGridDataModel.class, + gridModelProps.getPropertyValue( "GridDataModel" ) ); + assertNotNull( dataModel ); + assertEquals( 0, dataModel.getColumnCount() ); + + final XGridColumnModel columnModel = UnoRuntime.queryInterface( XGridColumnModel.class, + gridModelProps.getPropertyValue( "ColumnModel" ) ); + assertNotNull( columnModel ); + assertEquals( 0, columnModel.getColumnCount() ); + + final int columnCount = 3; + final int rowCount = 2; + dataModel.addRow( null, new Object[] { 1, 2, 3 } ); + dataModel.addRow( null, new Object[] { 6, 5, 4 } ); + + assertEquals( columnCount, dataModel.getColumnCount() ); + assertEquals( columnCount, columnModel.getColumnCount() ); + + // some cursor traveling + final XGridControl gridControl = UnoRuntime.queryInterface( XGridControl.class, control ); + gridControl.goToCell( 0, 0 ); + assertEquals( "wrong 'current column' (1)", 0, gridControl.getCurrentColumn() ); + assertEquals( "wrong 'current row' (1)", 0, gridControl.getCurrentRow() ); + gridControl.goToCell( columnCount - 1, rowCount - 1 ); + assertEquals( "wrong 'current column' (2)", dataModel.getColumnCount() - 1, gridControl.getCurrentColumn() ); + assertEquals( "wrong 'current row' (2)", dataModel.getRowCount() - 1, gridControl.getCurrentRow() ); + + // removing the last column, while the active cell is in this very last column, is expected to adjust + // the active cell + columnModel.removeColumn( columnCount - 1 ); + assertEquals( "removed the last and active column, active column was not adjusted!", + columnCount - 2, gridControl.getCurrentColumn() ); + // same holds for rows + dataModel.removeRow( rowCount - 1 ); + assertEquals( "removed the last and active row, active row was not adjusted!", + rowCount - 2, gridControl.getCurrentRow() ); + } + + // ----------------------------------------------------------------------------------------------------------------- + private XControl impl_createDialogWithGridControl() throws Exception + { + // create a simple dialog model/control/peer trinity + final XControlModel dialogModel = createInstance( XControlModel.class, "com.sun.star.awt.UnoControlDialogModel" ); + m_disposables.add( dialogModel ); + final XPropertySet dialogProps = UnoRuntime.queryInterface( XPropertySet.class, dialogModel ); + dialogProps.setPropertyValue( "Width", 200 ); + dialogProps.setPropertyValue( "Height", 100 ); + dialogProps.setPropertyValue( "Title", "Grid Control Unit Test" ); + final XControl dialogControl = createInstance( XControl.class, "com.sun.star.awt.UnoControlDialog" ); + m_disposables.add( dialogControl ); + dialogControl.setModel( dialogModel ); + dialogControl.createPeer( createInstance( XToolkit.class, "com.sun.star.awt.Toolkit" ), null ); + + // insert a grid control model + final XMultiServiceFactory controlModelFactory = UnoRuntime.queryInterface( XMultiServiceFactory.class, + dialogModel ); + final XPropertySet gridModelProps = UnoRuntime.queryInterface( XPropertySet.class, + controlModelFactory.createInstance( "com.sun.star.awt.grid.UnoControlGridModel" ) ); + m_disposables.add( gridModelProps ); + gridModelProps.setPropertyValue( "PositionX", 6 ); + gridModelProps.setPropertyValue( "PositionY", 6 ); + gridModelProps.setPropertyValue( "Width", 188 ); + gridModelProps.setPropertyValue( "Height", 88 ); + final XNameContainer modelContainer = UnoRuntime.queryInterface( XNameContainer.class, dialogModel ); + modelContainer.insertByName( "grid", gridModelProps ); + + // check the respective control has been created + final XControlContainer controlContainer = UnoRuntime.queryInterface( XControlContainer.class, dialogControl ); + final XControl gridControl = controlContainer.getControl( "grid" ); + assertNotNull( "no grid control created in the dialog", gridControl ); + + return gridControl; } // ----------------------------------------------------------------------------------------------------------------- @@ -582,6 +610,20 @@ public class GridControl return UnoRuntime.areSame( lhs, rhs ); } + // ----------------------------------------------------------------------------------------------------------------- + @Before + public void initTestCase() + { + m_disposables.clear(); + } + + // ----------------------------------------------------------------------------------------------------------------- + @After + public void cleanupTestCase() + { + impl_dispose( m_disposables.toArray() ); + } + // ----------------------------------------------------------------------------------------------------------------- @BeforeClass public static void setUpConnection() throws java.lang.Exception @@ -713,4 +755,5 @@ public class GridControl private XPropertySet m_gridControlModel; private XGridColumnModel m_columnModel; private XSortableMutableGridDataModel m_dataModel; + private final List< Object > m_disposables = new ArrayList< Object >(); } diff --git a/toolkit/source/controls/grid/gridcontrol.cxx b/toolkit/source/controls/grid/gridcontrol.cxx index 3fb784aa7063..82619d01c7f5 100644 --- a/toolkit/source/controls/grid/gridcontrol.cxx +++ b/toolkit/source/controls/grid/gridcontrol.cxx @@ -54,6 +54,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::view; +using namespace ::com::sun::star::util; namespace toolkit { @@ -394,6 +395,13 @@ sal_Bool SAL_CALL UnoGridControl::setModel( const Reference< XControlModel >& i_ return xGrid->getCurrentRow(); } +//---------------------------------------------------------------------------------------------------------------------- +void SAL_CALL UnoGridControl::goToCell( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex ) throw (RuntimeException, IndexOutOfBoundsException, VetoException) +{ + Reference< XGridControl > const xGrid ( getPeer(), UNO_QUERY_THROW ); + xGrid->goToCell( i_columnIndex, i_rowIndex ); +} + //---------------------------------------------------------------------------------------------------------------------- void SAL_CALL UnoGridControl::selectRow( ::sal_Int32 i_rowIndex ) throw (RuntimeException, IndexOutOfBoundsException ) { diff --git a/toolkit/source/controls/grid/gridcontrol.hxx b/toolkit/source/controls/grid/gridcontrol.hxx index af9f27b19369..de1ac8d657c3 100644 --- a/toolkit/source/controls/grid/gridcontrol.hxx +++ b/toolkit/source/controls/grid/gridcontrol.hxx @@ -103,6 +103,7 @@ public: virtual ::sal_Int32 SAL_CALL getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getCurrentColumn( ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getCurrentRow( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL goToCell( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::util::VetoException); // ::com::sun::star::awt::grid::XGridRowSelection virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException ); -- cgit v1.2.3 From 74fa61e8d3181aad661869be13f8916aea61b59c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 7 Apr 2011 08:49:15 +0200 Subject: gridfixes: impl_ni_calculateColumnWidths: re-calculate the proper values for distributePixel/takeAwayPixel before finally using it to correct the rounding errors --- svtools/source/table/tablecontrol_impl.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 2983b6c667ea..870fef025ee7 100755 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -1072,6 +1072,7 @@ namespace svt { namespace table while ( startOver ); // are there pixels left (might be caused by rounding errors)? + distributePixel = gridWidthPixel - ::std::accumulate( o_newColWidthsPixel.begin(), o_newColWidthsPixel.end(), 0 ); while ( ( distributePixel > 0 ) && ( flexibleColumnCount > 0 ) ) { // yes => ignore relative flexibilities, and subsequently distribute single pixels to all flexible @@ -1146,6 +1147,7 @@ namespace svt { namespace table while ( startOver ); // are there pixels left (might be caused by rounding errors)? + takeAwayPixel = ::std::accumulate( o_newColWidthsPixel.begin(), o_newColWidthsPixel.end(), 0 ) - gridWidthPixel; while ( ( takeAwayPixel > 0 ) && ( flexibleColumnCount > 0 ) ) { // yes => ignore relative flexibilities, and subsequently take away pixels from all flexible -- cgit v1.2.3 From dde654a06ef256b776ec868e02dac21db1346454 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 7 Apr 2011 08:49:15 +0200 Subject: gridfixes: ensure removal of a column at the grid control adjusts the cursor, if needed --- offapi/com/sun/star/awt/grid/XGridControl.idl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/offapi/com/sun/star/awt/grid/XGridControl.idl b/offapi/com/sun/star/awt/grid/XGridControl.idl index 152b63c34a0c..f8413046839a 100644 --- a/offapi/com/sun/star/awt/grid/XGridControl.idl +++ b/offapi/com/sun/star/awt/grid/XGridControl.idl @@ -28,6 +28,8 @@ #define __com_sun_star_awt_grid_XGridControl_idl__ #include +#include +#include //============================================================================= @@ -78,6 +80,24 @@ published interface XGridControl columns, or if grid data model does not contain any rows), then -1 is returned.

*/ long getCurrentRow(); + + /** moves the cursor to the given cell + @param ColumnIndex + the column index of the cell to activate. + @param RowIndex + the row index of the cell to activate. + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if either ColumnIndex or RowIndex are out of range. + @throws ::com::sun::star::util::VetoException + if moving the cursor to another cell is vetoed. + */ + void goToCell( + [in] long ColumnIndex, + [in] long RowIndex + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException + , ::com::sun::star::util::VetoException + ); }; //============================================================================= -- cgit v1.2.3 From 89ee82b47aa1bce8cf23c16049e990588172a820 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 7 Apr 2011 09:11:17 +0200 Subject: gridfixes: impl_getColumnForOrdinate: no need to subtract m_nRowHeaderWidthPixel, m_aColumnWidths already contains it --- svtools/source/table/tablecontrol_impl.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 870fef025ee7..4ecce7359a15 100755 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -2494,18 +2494,16 @@ namespace svt { namespace table if ( i_ordinate < m_nRowHeaderWidthPixel ) return COL_ROW_HEADERS; - long const ordinate = i_ordinate - m_nRowHeaderWidthPixel; - ColumnPositions::const_iterator lowerBound = ::std::lower_bound( m_aColumnWidths.begin(), m_aColumnWidths.end(), - ordinate + 1, + i_ordinate + 1, ColumnInfoPositionLess() ); if ( lowerBound == m_aColumnWidths.end() ) { // point is *behind* the start of the last column ... - if ( ordinate < m_aColumnWidths.rbegin()->getEnd() ) + if ( i_ordinate < m_aColumnWidths.rbegin()->getEnd() ) // ... but still before its end return m_nColumnCount - 1; return COL_INVALID; -- cgit v1.2.3 From 38a2702c6e655c38b4d322d46f4b9becd6c106df Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Mon, 11 Apr 2011 18:15:06 +0200 Subject: masterfix OOO340: #i117770# use system libs if not ENABLE_LIBRSVG --- configure | 18 ++++++++++++++++++ configure.in | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/configure b/configure index 2c64bd652da3..0b2616ffaeae 100755 --- a/configure +++ b/configure @@ -30416,6 +30416,8 @@ fi +if test "$ENABLE_LIBRSVG" = "TRUE" +then echo "$as_me:$LINENO: checking whether to build own version of librsvg" >&5 echo $ECHO_N "checking whether to build own version of librsvg... $ECHO_C" >&6 @@ -30564,6 +30566,22 @@ echo "${ECHO_T}no" >&6 ;; esac +else + SYSTEM_LIBGSF=YES + + SYSTEM_LIBRSVG=YES + + SYSTEM_GDKPIXBUF=YES + + SYSTEM_GLIB=YES + + SYSTEM_GETTEXT=YES + + SYSTEM_LIBCROCO=YES + + SYSTEM_PANGO=YES + +fi echo "$as_me:$LINENO: checking whether to build own version of libpng" >&5 echo $ECHO_N "checking whether to build own version of libpng... $ECHO_C" >&6 diff --git a/configure.in b/configure.in index 10dcbb3cba17..444ce8710fdc 100644 --- a/configure.in +++ b/configure.in @@ -6717,6 +6717,8 @@ fi AC_SUBST(USE_XINERAMA) AC_SUBST(XINERAMA_LINK) +if test "$ENABLE_LIBRSVG" = "TRUE" +then dnl =================================================================== dnl Test whether to build librsvg or rely on the system version dnl =================================================================== @@ -6859,6 +6861,22 @@ case "$_os" in ;; esac AC_SUBST(SYSTEM_LIBGSF) +else + SYSTEM_LIBGSF=YES + AC_SUBST(SYSTEM_LIBGSF) + SYSTEM_LIBRSVG=YES + AC_SUBST(SYSTEM_LIBRSVG) + SYSTEM_GDKPIXBUF=YES + AC_SUBST(SYSTEM_GDKPIXBUF) + SYSTEM_GLIB=YES + AC_SUBST(SYSTEM_GLIB) + SYSTEM_GETTEXT=YES + AC_SUBST(SYSTEM_GETTEXT) + SYSTEM_LIBCROCO=YES + AC_SUBST(SYSTEM_LIBCROCO) + SYSTEM_PANGO=YES + AC_SUBST(SYSTEM_PANGO) +fi dnl =================================================================== dnl Test whether to build libpng or rely on the system version -- cgit v1.2.3 From 4ceef430cc01d0fc071a4f13957a2acdda09c44b Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Tue, 12 Apr 2011 13:34:57 +0200 Subject: masterfix OOO340: #i117792# prevent glib build breaks on wntmsci --- glib/glib-2.28.1-win32.patch | 151 ++++++++++++++++++++++++------------------- 1 file changed, 85 insertions(+), 66 deletions(-) diff --git a/glib/glib-2.28.1-win32.patch b/glib/glib-2.28.1-win32.patch index 6e7c06d68465..60aabb6cea1b 100644 --- a/glib/glib-2.28.1-win32.patch +++ b/glib/glib-2.28.1-win32.patch @@ -144,7 +144,7 @@ { --- misc/glib-2.28.1/gio/makefile.msc 2011-02-11 16:23:12.000000000 +0100 +++ misc/build/glib-2.28.1/gio/makefile.msc 2011-03-04 12:43:54.423706900 +0100 -@@ -3,9 +3,9 @@ +@@ -3,28 +3,22 @@ PRJ_TOP = .. PACKAGE = gio PKG_VER = 2.0 @@ -152,11 +152,16 @@ +!INCLUDE ..\build\win32\make.msc -SUBDIRS = win32 -+SUBDIRS = win32 gvdb +- +-sub-all: +- for %d in ($(SUBDIRS)) do nmake -nologo -f makefile.msc sub-one THIS=%d +- +-sub-one: +- cd $(THIS) +- nmake -nologo -f makefile.msc +- cd .. ++SUBDIRS_ALL = win32.all gvdb.all - sub-all: - for %d in ($(SUBDIRS)) do nmake -nologo -f makefile.msc sub-one THIS=%d -@@ -18,13 +18,15 @@ INCLUDES = \ -FImsvc_recommended_pragmas.h \ -I .. -I ..\glib -I ..\gmodule -I . \ @@ -173,7 +178,7 @@ appinfo_sources = \ gwin32appinfo.c gwin32appinfo.h -@@ -75,19 +77,50 @@ +@@ -75,19 +69,50 @@ $(NULL) OBJECTS = \ @@ -224,7 +229,7 @@ gemblem.obj \ gemblemedicon.obj \ gfile.obj \ -@@ -112,20 +145,39 @@ +@@ -112,20 +137,39 @@ giomodule.obj \ gioscheduler.obj \ giostream.obj \ @@ -264,7 +269,7 @@ gsocket.obj \ gsocketaddress.obj \ gsocketaddressenumerator.obj \ -@@ -135,13 +187,22 @@ +@@ -135,13 +179,22 @@ gsocketcontrolmessage.obj \ gsocketlistener.obj \ gsocketservice.obj \ @@ -287,7 +292,7 @@ gunionvolumemonitor.obj \ gvfs.obj \ gvolume.obj \ -@@ -156,11 +217,15 @@ +@@ -156,11 +209,15 @@ glocalfilemonitor.obj \ glocaldirectorymonitor.obj \ gwin32appinfo.obj \ @@ -304,35 +309,39 @@ libgio_2_0_la_LIBADD = \ $(top_builddir)/glib/libglib-2.0.la \ -@@ -190,14 +255,14 @@ - +@@ -191,13 +248,13 @@ gio-marshal.h: gio-marshal.list $(GLIB_GEN_MARSHAL) --prefix=_gio_marshal gio-marshal.list --header >> xgen-gwmh \ -- && copy /y xgen-gwmh gio-marshal.h \ + && copy /y xgen-gwmh gio-marshal.h \ - && del xgen-gwmh xgen-gwmh~ -+ && $(GNUCOPY) /y xgen-gwmh gio-marshal.h \ + && rm xgen-gwmh xgen-gwmh~ gio-marshal.c: gio-marshal.h echo #include "gio-marshal.h" >> xgen-gwmc \ && $(GLIB_GEN_MARSHAL) --prefix=_gio_marshal gio-marshal.list --body >> xgen-gwmc \ -- && copy xgen-gwmc gio-marshal.c \ + && copy xgen-gwmc gio-marshal.c \ - && del xgen-gwmc xgen-gwmc~ -+ && $(GNUCOPY) xgen-gwmc gio-marshal.c \ + && rm xgen-gwmc xgen-gwmc~ local_sources = \ glocaldirectorymonitor.c \ -@@ -228,7 +293,7 @@ +@@ -220,12 +277,14 @@ + + all : \ + $(PRJ_TOP)\config.h \ +- sub-all \ ++ $(SUBDIRS_ALL) \ + gio-marshal.c \ + gioenumtypes.h \ + gioenumtypes.c \ + libgio-$(PKG_VER)-0.dll ++$(SUBDIRS_ALL): ++ cmd /C "cd $* & nmake -nologo -f makefile.msc all" $(PRJ_TOP)\config.h: $(PRJ_TOP)\config.h.win32 -- copy $(PRJ_TOP)\config.h.win32 $(PRJ_TOP)\config.h -+ $(GNUCOPY) $(PRJ_TOP)\config.h.win32 $(PRJ_TOP)\config.h - - gioenumtypes.h: $(gio_headers) gioenumtypes.h.template - $(PERL) ..\gobject\glib-mkenums --template gioenumtypes.h.template $(gio_headers) > gioenumtypes.h -@@ -245,14 +310,14 @@ + copy $(PRJ_TOP)\config.h.win32 $(PRJ_TOP)\config.h +@@ -245,14 +304,14 @@ RESOURCE = $(PACKAGE).res $(PACKAGE).res : $(PACKAGE).rc @@ -451,7 +460,7 @@ gprimes.obj \ gprintf.obj \ gqsort.obj \ -@@ -88,22 +89,29 @@ +@@ -88,19 +89,26 @@ gthread.obj \ gthreadpool.obj \ gtimer.obj \ @@ -479,14 +488,10 @@ -..\glibconfig.h: ..\glibconfig.h.win32 - copy ..\glibconfig.h.win32 ..\glibconfig.h +glibconfig.h: glibconfig.h.win32 -+ $(GNUCOPY) glibconfig.h.win32 glibconfig.h ++ copy glibconfig.h.win32 glibconfig.h ..\config.h: ..\config.h.win32 -- copy ..\config.h.win32 ..\config.h -+ $(GNUCOPY) ..\config.h.win32 ..\config.h - - localcharset.obj : libcharset\localcharset.c - $(CC) $(CFLAGS) -DLIBDIR=\".\" -c libcharset\localcharset.c + copy ..\config.h.win32 ..\config.h @@ -115,7 +123,7 @@ -DG_GNUC_PRINTF=;G_GNUC_PRINTF -DG_GNUC_FORMAT=;G_GNUC_FORMAT glib.symbols >> glib.def @@ -587,8 +592,7 @@ + gmoduleconf.h: gmoduleconf.h.win32 -- copy gmoduleconf.h.win32 gmoduleconf.h -+ $(GNUCOPY) gmoduleconf.h.win32 gmoduleconf.h + copy gmoduleconf.h.win32 gmoduleconf.h gmodule.res : gmodule.rc - rc -DBUILDNUMBER=0 -r -fo gmodule.res gmodule.rc @@ -602,8 +606,6 @@ - del gmoduleconf.h + rm gmoduleconf.h --- misc/glib-2.28.1/gobject/makefile.msc 2011-02-18 16:35:05.000000000 +0100 -+++ misc/build/glib-2.28.1/gobject/makefile.msc 2011-03-04 12:33:52.399273100 +0100 ---- misc/glib-2.28.1/gobject/makefile.msc 2011-02-18 16:35:05.000000000 +0100 +++ misc/build/glib-2.28.1/gobject/makefile.msc 2011-03-09 09:29:52.712284300 +0100 @@ -7,7 +7,7 @@ @@ -622,7 +624,7 @@ gmarshal.strings \ gobject-query.exe \ libgobject-2.0-0.dll \ -@@ -24,8 +23,10 @@ +@@ -24,6 +23,8 @@ testgobject.exe gobject_OBJECTS = \ @@ -631,9 +633,7 @@ gboxed.obj \ gclosure.obj \ genums.obj \ - gobject.obj \ - gparam.obj \ -@@ -47,21 +49,18 @@ +@@ -47,7 +48,7 @@ -DG_GNUC_PRINTF=;G_GNUC_PRINTF gobject.symbols >> gobject.def gobject.res : gobject.rc @@ -642,15 +642,13 @@ gmarshal.h : gmarshal.list glib-genmarshal.exe echo #ifndef __G_MARSHAL_H__ > xgen-gmh - echo #define __G_MARSHAL_H__ >> xgen-gmh - glib-genmarshal --nostdinc --prefix=g_cclosure_marshal gmarshal.list --header >> xgen-gmh +@@ -56,12 +57,9 @@ echo #endif /* __G_MARSHAL_H__ */ >> xgen-gmh -- copy xgen-gmh gmarshal.h -- + copy xgen-gmh gmarshal.h + -gmarshal.c: gmarshal.list gmarshal.h glib-genmarshal.exe - glib-genmarshal --nostdinc --prefix=g_cclosure_marshal gmarshal.list --body > gmarshal.c -+ $(GNUCOPY) xgen-gmh gmarshal.h - +- libgobject-2.0-0.dll : $(gobject_OBJECTS) gobject.def gobject.res $(CC) $(CFLAGS) -Fm -LD -Fe$@ $(gobject_OBJECTS) gobject.res \ - ..\glib\glib-2.0.lib $(LDFLAGS) /implib:gobject-2.0.lib /def:gobject.def || del $@ @@ -658,7 +656,7 @@ gobject-2.28s.lib : $(gobject_OBJECTS) lib /out:$@ $(gobject_OBJECTS) -@@ -69,7 +68,7 @@ +@@ -69,7 +67,7 @@ # link glib's static version to avoid installing glib-genmarshal.exe : glib-genmarshal.c gmarshal.strings $(CC) -Fe$@ $(CFLAGS) -UGOBJECT_COMPILATION glib-genmarshal.c \ @@ -689,26 +687,47 @@ $(CC) $(CFLAGS) -LD -Fe$@ $(gthread_OBJECTS) gthread.res \ --- misc/glib-2.28.1/makefile.msc 2009-04-01 01:04:20.000000000 +0200 +++ misc/build/glib-2.28.1/makefile.msc 2011-03-04 09:11:06.663432800 +0100 -@@ -1,7 +1,7 @@ +@@ -1,28 +1,25 @@ ## Makefile for building the GLib dlls with Microsoft C ## Use: nmake -f makefile.msc -PARTS = glib gmodule gthread gobject gio tests -+PARTS = "build\win32\dirent" glib gmodule gthread gobject gio tests ++PARTS_ALL = "build\win32\dirent.all" glib.all gmodule.all gthread.all gobject.all gio.all tests.all ++ ++PARTS_CLEAN = "build\win32\dirent.clean" glib.clean gmodule.clean gthread.clean gobject.clean gio.clean tests.clean all : \ config.h \ -@@ -22,7 +22,7 @@ - @cd .. +- glibconfig.h \ +- sub-all +- +-sub-all: +- for %d in ($(PARTS)) do nmake -nologo -f makefile.msc sub-one THIS=%d TARGET=all ++ glib/glibconfig.h \ ++ $(PARTS_ALL) + +-clean : sub-clean ++$(PARTS_ALL): ++ cmd /C "cd $* & nmake -nologo -f makefile.msc all" + +-sub-clean: +- for %d in ($(PARTS)) do nmake -nologo -f makefile.msc sub-one THIS=%d TARGET=clean ++clean : $(PARTS_ALL) + +-sub-one: +- @cd $(THIS) +- @nmake -nologo -f makefile.msc $(TARGET) +- @cd .. ++$(PARTS_CLEAN): ++ cmd /C "cd $* & nmake -nologo -f makefile.msc clean" config.h: config.h.win32 -- copy config.h.win32 config.h -+ $(GNUCOPY) config.h.win32 config.h + copy config.h.win32 config.h -glibconfig.h: glibconfig.h.win32 - copy glibconfig.h.win32 glibconfig.h -+glibconfig.h: glib/glibconfig.h.win32 -+ $(GNUCOPY) glib/glibconfig.h.win32 glib/glibconfig.h ++glib/glibconfig.h: glib/glibconfig.h.win32 ++ copy glib/glibconfig.h.win32 glib/glibconfig.h --- misc/glib-2.28.1/tests/makefile.msc 2011-02-18 16:35:43.000000000 +0100 +++ misc/build/glib-2.28.1/tests/makefile.msc 2011-03-04 08:33:02.079762100 +0100 @@ -7,7 +7,7 @@ @@ -1966,17 +1985,17 @@ + --- misc/glib-2.28.1/gobject/gmarshal.c Wed Aug 20 14:33:55 2008 +++ misc/build/glib-2.28.1/gobject/gmarshal.c Wed Aug 20 14:26:42 2008 -@@ -1,4 +1,13 @@ -+#include "config.h" - -+#include "gsourceclosure.h" -+#include "gboxed.h" -+#include "genums.h" -+#include "gmarshal.h" -+#include "gvalue.h" -+#include "gvaluetypes.h" -+#include "gparam.h" -+#include "gobject.h" - - #ifdef G_ENABLE_DEBUG - #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) +@@ -1,4 +1,13 @@ ++#include "config.h" + ++#include "gsourceclosure.h" ++#include "gboxed.h" ++#include "genums.h" ++#include "gmarshal.h" ++#include "gvalue.h" ++#include "gvaluetypes.h" ++#include "gparam.h" ++#include "gobject.h" + + #ifdef G_ENABLE_DEBUG + #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 From 5cef0b59b904b15ac6d983fe06d25e13cc0b422e Mon Sep 17 00:00:00 2001 From: Martin Hollmichel Date: Fri, 6 May 2011 08:13:12 +0200 Subject: OOO340_m1 --- solenv/inc/minor.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk index 6c29751c1fe5..d1734c0aaad2 100644 --- a/solenv/inc/minor.mk +++ b/solenv/inc/minor.mk @@ -1,5 +1,5 @@ RSCVERSION=340 -RSCREVISION=340m0(Build:9583) -BUILD=9583 -LAST_MINOR=m0 +RSCREVISION=340m1(Build:9584) +BUILD=9584 +LAST_MINOR=m1 SOURCEVERSION=OOO340 -- cgit v1.2.3 From f54255c7afadc3d27bf9b23c7463e4569ce143c4 Mon Sep 17 00:00:00 2001 From: Martin Hollmichel Date: Mon, 9 May 2011 14:07:54 +0200 Subject: corrected merge of gridfixes cws integration --- offapi/com/sun/star/awt/tab/XTabPageContainer.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/offapi/com/sun/star/awt/tab/XTabPageContainer.idl b/offapi/com/sun/star/awt/tab/XTabPageContainer.idl index a48ca69a3759..cc4f9ebc9e3c 100644 --- a/offapi/com/sun/star/awt/tab/XTabPageContainer.idl +++ b/offapi/com/sun/star/awt/tab/XTabPageContainer.idl @@ -86,7 +86,7 @@ published interface XTabPageContainer @param listener the listener to add. */ - [oneway] void addTabPageListener( [in] XTabPageContainerListener listener); + [oneway] void addTabPageContainerListener( [in] XTabPageContainerListener listener); //------------------------------------------------------------------------- @@ -94,7 +94,7 @@ published interface XTabPageContainer @param listener the listener to remove. */ - [oneway] void removeTabPageListener( [in] XTabPageContainerListener listener); + [oneway] void removeTabPageContainerListener( [in] XTabPageContainerListener listener); //------------------------------------------------------------------------- /** Specifies the ID of the current active tab page. -- cgit v1.2.3