[PATCH] SlsRequestQueue updated

Rob Snelders programming at ertai.nl
Mon Apr 2 15:04:00 PDT 2012


---
 sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx |   21 +++++++------------
 sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx |    4 +-
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx b/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx
index 966c5d2..a79ddaf 100644
--- a/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx
@@ -31,10 +31,6 @@
 
 #include <set>
 
-
-#undef VERBOSE
-//#define VERBOSE
-
 namespace sd { namespace slidesorter { namespace cache {
 
 /** This class extends the actual request data with additional information
@@ -118,7 +114,7 @@ void RequestQueue::AddRequest (
 
     // If the request is already a member of the queue then remove it so
     // that the following insertion will use the new prioritization.
-#ifdef VERBOSE
+#if OSL_DEBUG_LEVEL >=2
     bool bRemoved =
 #endif
         RemoveRequest(aKey);
@@ -130,13 +126,12 @@ void RequestQueue::AddRequest (
     Request aRequest (aKey, nPriority, eRequestClass);
     mpRequestQueue->insert(aRequest);
 
-    SSCD_SET_REQUEST_CLASS(rRequestData.GetPage(),eRequestClass);
+    SSCD_SET_REQUEST_CLASS(aKey,eRequestClass);
 
-#ifdef VERBOSE
-    OSL_TRACE("%s request for page %d with priority class %d",
-        bRemoved?"replaced":"added",
-        (rRequestData.GetPage()->GetPageNum()-1)/2,
-        eRequestClass);
+#if OSL_DEBUG_LEVEL >=2
+    SAL_INFO("sd.sls", OSL_THIS_FUNC << ": " << (bRemoved?"replaced":"added")
+        << " request for page " << ((aKey->GetPageNum()-1)/2)
+        << " with priority class " << static_cast<int>(eRequestClass));
 #endif
 }
 
@@ -166,7 +161,7 @@ bool RequestQueue::RemoveRequest (
 
             if (bRequestWasRemoved)
             {
-                SSCD_SET_STATUS(rRequest.GetPage(),NONE);
+                SSCD_SET_STATUS(aKey,NONE);
             }
         }
         else
@@ -195,7 +190,7 @@ void RequestQueue::ChangeClass (
     if (iRequest!=mpRequestQueue->end() && iRequest->meClass!=eNewRequestClass)
     {
         AddRequest(aKey, eNewRequestClass, true);
-        SSCD_SET_REQUEST_CLASS(rRequestData.GetPage(),eNewRequestClass);
+        SSCD_SET_REQUEST_CLASS(aKey,eNewRequestClass);
     }
 }
 
diff --git a/sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx b/sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx
index e59f7e3..9fe0dda 100644
--- a/sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx
+++ b/sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx
@@ -52,7 +52,7 @@ public:
     /** Insert a request with highest or lowest priority in its priority
         class.  When the request is already present then it is first
         removed.  This effect is then a re-prioritization.
-        @param rRequestData
+        @param aKey
             The request.
         @param eRequestClass
             The priority class in which to insert the request with highest
@@ -68,7 +68,7 @@ public:
         bool bInsertWithHighestPriority = false);
 
     /** Remove the specified request from the queue.
-        @param rRequestData
+        @param aKey
             It is OK when the specified request is not a member of the
             queue.
         @return
-- 
1.7.5.4


--------------050506080506060105030009--


More information about the LibreOffice mailing list