Commits

Anonymous committed 2a31965 Merge

CWS-TOOLING: integrate CWS ooo32gsl07_DEV300

  • Participants
  • Parent commits ea847de, c3b07a0

Comments (0)

Files changed (6)

sd/source/ui/slidesorter/controller/SlideSorterController.cxx

 
             case VCLEVENT_WINDOW_GETFOCUS:
                 if (pActiveWindow != NULL && pWindow == pActiveWindow)
-                    GetFocusManager().ShowFocus();
+                    GetFocusManager().ShowFocus(false);
                 break;
 
             case VCLEVENT_WINDOW_LOSEFOCUS:

sd/source/ui/slidesorter/controller/SlsFocusManager.cxx

         }
 
         if (mbPageIsFocused)
-            ShowFocusIndicator(GetFocusedPageDescriptor());
+            ShowFocusIndicator(GetFocusedPageDescriptor(), true);
     }
 }
 
 
 
 
-void FocusManager::ShowFocus (void)
+void FocusManager::ShowFocus (const bool bScrollToFocus)
 {
     mbPageIsFocused = true;
-    ShowFocusIndicator(GetFocusedPageDescriptor());
+    ShowFocusIndicator(GetFocusedPageDescriptor(), bScrollToFocus);
 }
 
 
 
 
 
-void FocusManager::ShowFocusIndicator (const model::SharedPageDescriptor& rpDescriptor)
+void FocusManager::ShowFocusIndicator (
+    const model::SharedPageDescriptor& rpDescriptor,
+    const bool bScrollToFocus)
 {
     if (rpDescriptor.get() != NULL)
     {
         rpDescriptor->SetFocus ();
-        
-        // Scroll the focused page object into the visible area and repaint
-        // it, so that the focus indicator becomes visible.
-        view::SlideSorterView& rView (mrSlideSorter.GetView());
-        mrSlideSorter.GetController().GetSelectionManager()->MakeRectangleVisible (
-            rView.GetPageBoundingBox (
-                GetFocusedPageDescriptor(),
-                view::SlideSorterView::CS_MODEL,
-                view::SlideSorterView::BBT_INFO));
+
+        if (bScrollToFocus)
+        {
+            // Scroll the focused page object into the visible area and repaint
+            // it, so that the focus indicator becomes visible.
+            view::SlideSorterView& rView (mrSlideSorter.GetView());
+            mrSlideSorter.GetController().GetSelectionManager()->MakeRectangleVisible (
+                rView.GetPageBoundingBox (
+                    GetFocusedPageDescriptor(),
+                    view::SlideSorterView::CS_MODEL,
+                    view::SlideSorterView::BBT_INFO));
+        }
 
         mrSlideSorter.GetView().RequestRepaint (rpDescriptor);
         NotifyFocusChangeListeners();

sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx

     void MoveFocus (FocusMoveDirection eDirection);
 
     /** Show the focus indicator of the current slide.
+        @param bScrollToFocus
+            When <TRUE/> (the default) then the view is scrolled so that the
+            focus rectangle lies inside its visible area.
     */
-    void ShowFocus (void);
+    void ShowFocus (const bool bScrollToFocus = true);
 
     /** Hide the focus indicator.
     */
         made visible.
         @param pDescriptor
             When NULL is given then the call is ignored.
+        @param bScrollToFocus
+            When <TRUE/> (the default) then the view is scrolled so that the
+            focus rectangle lies inside its visible area.
     */
-    void ShowFocusIndicator (const model::SharedPageDescriptor& rpDescriptor);
+    void ShowFocusIndicator (
+        const model::SharedPageDescriptor& rpDescriptor,
+        const bool bScrollToFocus);
 
     /** Call all currently registered listeners that a focus change has
         happended.  The focus may be hidden or shown or moved from one page

svx/source/svdraw/svdotextdecomposition.cxx

 	const bool bVerticalWritintg(rSdrBlockTextPrimitive.getOutlinerParaObject().IsVertical());
 	const Size aAnchorTextSize(Size(nAnchorTextWidth, nAnchorTextHeight));
 
-	// check if block text is used (only one of them can be true)
-	const bool bHorizontalIsBlock(SDRTEXTHORZADJUST_BLOCK == eHAdj && !bVerticalWritintg);
-	const bool bVerticalIsBlock(SDRTEXTVERTADJUST_BLOCK == eVAdj && bVerticalWritintg);
-
-    // set minimal paper size hor/ver if needed
-	if(bHorizontalIsBlock)
-	{
-		rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0));
-	}
-	else if(bVerticalIsBlock)
-	{
-		rOutliner.SetMinAutoPaperSize(Size(0, nAnchorTextHeight));
-	}
-
 	if(bIsCell)
 	{
 		// cell text is formated neither like a text object nor like a object
 		// text, so use a special setup here
+		rOutliner.SetMaxAutoPaperSize(aAnchorTextSize);
+
         // #i106214# To work with an unchangeable PaperSize (CellSize in
-        // this case) Set(Min|Max)AutoPaperSize and SetPaperSize have to be used
-		rOutliner.SetMaxAutoPaperSize(aAnchorTextSize);
-		rOutliner.SetMinAutoPaperSize(aAnchorTextSize);
-		rOutliner.SetPaperSize(aAnchorTextSize);
+        // this case) Set(Min|Max)AutoPaperSize and SetPaperSize have to be used.
+        // #i106214# This was not completely correct; to still measure the real 
+        // text height to allow vertical adjust (and vice versa for VerticalWritintg)
+        // only one aspect has to be set, but the other one to zero
+        if(bVerticalWritintg)
+        {
+            // measure the horizontal text size
+    		rOutliner.SetMinAutoPaperSize(Size(0, aAnchorTextSize.Height()));
+        }
+        else
+        {
+            // measure the vertical text size
+    		rOutliner.SetMinAutoPaperSize(Size(aAnchorTextSize.Width(), 0));
+        }
+
+        rOutliner.SetPaperSize(aAnchorTextSize);
 		rOutliner.SetUpdateMode(true);
 		rOutliner.SetText(rSdrBlockTextPrimitive.getOutlinerParaObject());
 	}
 	else
 	{
+	    // check if block text is used (only one of them can be true)
+	    const bool bHorizontalIsBlock(SDRTEXTHORZADJUST_BLOCK == eHAdj && !bVerticalWritintg);
+	    const bool bVerticalIsBlock(SDRTEXTVERTADJUST_BLOCK == eVAdj && bVerticalWritintg);
+
+        // set minimal paper size hor/ver if needed
+	    if(bHorizontalIsBlock)
+	    {
+		    rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0));
+	    }
+	    else if(bVerticalIsBlock)
+	    {
+		    rOutliner.SetMinAutoPaperSize(Size(0, nAnchorTextHeight));
+	    }
+
         if((rSdrBlockTextPrimitive.getWordWrap() || IsTextFrame()) && !rSdrBlockTextPrimitive.getUnlimitedPage())
 		{
             // #i103454# maximal paper size hor/ver needs to be limited to text

vcl/aqua/source/gdi/salatslayout.cxx

 	// to prevent ATS overflowing the Fixed16.16 values
 	// ATS font requests get size limited by downscaling huge fonts
 	// in these cases the font scale becomes something bigger than 1.0
-	float      		mfFontScale;
+	float				mfFontScale;
 
 private:
 	bool	InitGIA( ImplLayoutArgs* pArgs = NULL ) const;
 	bool	GetIdealX() const;
 	bool	GetDeltaY() const;
+	void	InvalidateMeasurements();
 
 	int	Fixed2Vcl( Fixed ) const;       // convert ATSU-Fixed units to VCL units
 	int	AtsuPix2Vcl( int ) const;       // convert ATSU-Pixel units to VCL units
 		mnTrailingSpaceWidth = rArgs.mpDXArray[ mnCharCount-1 ];
 		if( i > 0 )
 			mnTrailingSpaceWidth -= rArgs.mpDXArray[ i-1 ];
-		InitGIA(); // ensure valid mpCharWidths[]
+        InitGIA(); // ensure valid mpCharWidths[], TODO: use GetIdealX() instead?
 		mnTrailingSpaceWidth -= Fixed2Vcl( mpCharWidths[i] );
 		// ignore trailing space for calculating the available width
 		nOrigWidth -= mnTrailingSpaceWidth;
 	if( !nPixelWidth )
 		return;
 
-	// HACK: justification requests which change the width by just one pixel are probably
+	// HACK: justification requests which change the width by just one pixel were probably
 	// #i86038# introduced by lossy conversions between integer based coordinate system
+	// => ignoring such requests has many more benefits than eventual drawbacks
 	if( (nOrigWidth >= nPixelWidth-1) && (nOrigWidth <= nPixelWidth+1) )
 		return;
 
+	// changing the layout will make all previous measurements invalid
+	InvalidateMeasurements();
+		
 	ATSUAttributeTag nTags[3];
 	ATSUAttributeValuePtr nVals[3];
 	ByteCount nBytes[3];
 	if( eStatus != noErr )
 		return;
 
-	// check result of the justied layout
+	// update the measurements of the justified layout to match the justification request
 	if( rArgs.mpDXArray )
 		InitGIA( &rArgs );
 }
 	return true;
 }
 
+// -----------------------------------------------------------------------
+
+#define DELETEAZ( X ) { delete[] X; X = NULL; }
+
+void ATSLayout::InvalidateMeasurements()
+{
+	mnGlyphCount = -1;
+	DELETEAZ( mpGlyphIds );
+	DELETEAZ( mpCharWidths );
+	DELETEAZ( mpChars2Glyphs );
+	DELETEAZ( mpGlyphs2Chars );
+	DELETEAZ( mpGlyphRTLFlags );
+	DELETEAZ( mpGlyphAdvances );
+	DELETEAZ( mpGlyphOrigAdvs );
+	DELETEAZ( mpDeltaY );
+}
+
 // =======================================================================
 
 #if 0

vcl/aqua/source/gdi/salgdi.cxx

             DBG_ERROR( "no screen found" );
         }
         
+        // #i107076# maintaining size-WYSIWYG-ness causes many problems for
+        //           low-DPI, high-DPI or for mis-reporting devices
+        //           => it is better to limit the calculation result then
+        static const int nMinDPI = 72;
+        if( (mnRealDPIX < nMinDPI) || (mnRealDPIY < nMinDPI) )
+            mnRealDPIX = mnRealDPIY = nMinDPI;
+        static const int nMaxDPI = 200;
+        if( (mnRealDPIX > nMaxDPI) || (mnRealDPIY > nMaxDPI) )
+            mnRealDPIX = mnRealDPIY = nMaxDPI;
+
         // for OSX any anisotropy reported for the display resolution is best ignored (e.g. TripleHead2Go)
         mnRealDPIX = mnRealDPIY = (mnRealDPIX + mnRealDPIY + 1) / 2;
-        
+
         pSalData->mnDPIX = mnRealDPIX;
         pSalData->mnDPIY = mnRealDPIY;
     }