[Libreoffice-commits] .: 2 commits - sc/source sw/source

2012-04-03 Thread Noel Power
 sc/source/ui/inc/prevwsh.hxx  |5 +-
 sc/source/ui/view/preview.cxx |5 +-
 sc/source/ui/view/prevwsh.cxx |  104 +-
 sw/source/ui/uiview/pview.cxx |   84 +
 4 files changed, 143 insertions(+), 55 deletions(-)

New commits:
commit f194d18dfeceff104f9c5e500ea4dd94fa1b5b06
Author: Noel Power noel.po...@novell.com
Date:   Tue Apr 3 17:07:54 2012 +0100

Hori/Vert scrollbars in calc preview should be shown only when necessary

diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index 271a352..1ac668a 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -50,6 +50,7 @@ class CommandEvent;
 
 class ScPreviewShell: public SfxViewShell
 {
+friend class ScPreview; // allow access to AdjustPosSizePixel
 ScDocShell* pDocShell;
 
 ScPreview*  pPreview;   // Ausgabe-Fenster
@@ -63,7 +64,8 @@ class ScPreviewShell: public SfxViewShell
 longnMaxVertPos;
 
 SfxBroadcaster* pAccessibilityBroadcaster;
-
+boolGetPageSize( Size aPageSize );
+voidUpdateNeededScrollBars();
 private:
 voidConstruct( Window* pParent );
 DECL_LINK(ScrollHandler, ScrollBar* );
@@ -72,7 +74,6 @@ private:
 protected:
 virtual voidActivate(sal_Bool bMDI);
 virtual voidDeactivate(sal_Bool bMDI);
-
 virtual voidAdjustPosSizePixel( const Point rPos, const Size rSize );
 
 virtual voidInnerResizePixel( const Point rOfs, const Size rSize );
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index bbb7c72..e83224d 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -705,7 +705,10 @@ void ScPreview::SetZoom(sal_uInt16 nNewZoom)
 SetMapMode( aMMMode );
 
 bInSetZoom = true;  // don't scroll during SetYOffset in 
UpdateScrollBars
-pViewShell-UpdateScrollBars();
+if ( Window* pWin = pViewShell-GetWindow() )
+pViewShell-AdjustPosSizePixel( pWin-GetPosPixel(), 
pWin-GetSizePixel() );
+else
+pViewShell-UpdateScrollBars();
 bInSetZoom = false;
 
 bStateValid = false;
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index dfc6268..8b65824 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -134,8 +134,8 @@ void ScPreviewShell::Construct( Window* pParent )
 if (pDrawBC)
 StartListening(*pDrawBC);
 
-pHorScroll-Show();
-pVerScroll-Show();
+pHorScroll-Show( false );
+pVerScroll-Show( false );
 pCorner-Show();
 SetHelpId( HID_SCSHELL_PREVWSH );
 SetName(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(Preview)));
@@ -244,24 +244,15 @@ Size ScPreviewShell::GetOptimalSizePixel() const
 
 void ScPreviewShell::AdjustPosSizePixel( const Point rPos, const Size rSize )
 {
-long nBarW = 
GetViewFrame()-GetWindow().GetSettings().GetStyleSettings().GetScrollBarSize();
-long nBarH = nBarW;
-
-Size aOutSize( rSize.Width()-nBarW, rSize.Height()-nBarH );
+Size aOutSize( rSize );
 pPreview-SetPosSizePixel( rPos, aOutSize );
-pHorScroll-SetPosSizePixel( Point( rPos.X(), rPos.Y() + aOutSize.Height() 
),
- Size( aOutSize.Width(), nBarH ) );
-pVerScroll-SetPosSizePixel( Point( rPos.X() + aOutSize.Width(), rPos.Y() 
),
- Size( nBarW, aOutSize.Height() ) );
-pCorner-SetPosSizePixel( Point( rPos.X() + aOutSize.Width(), rPos.Y() + 
aOutSize.Height() ),
-  Size( nBarW, nBarH ) );
 
 if ( SVX_ZOOM_WHOLEPAGE == eZoom )
 pPreview-SetZoom( pPreview-GetOptimalZoom(false) );
 else if ( SVX_ZOOM_PAGEWIDTH == eZoom )
-pPreview-SetZoom( pPreview-GetOptimalZoom(sal_True) );
+pPreview-SetZoom( pPreview-GetOptimalZoom(true) );
 
-UpdateScrollBars();
+UpdateNeededScrollBars();
 }
 
 void ScPreviewShell::InnerResizePixel( const Point rOfs, const Size rSize )
@@ -274,7 +265,7 @@ void ScPreviewShell::OuterResizePixel( const Point rOfs, 
const Size rSize )
 AdjustPosSizePixel( rOfs,rSize );
 }
 
-void ScPreviewShell::UpdateScrollBars()
+bool ScPreviewShell::GetPageSize( Size aPageSize )
 {
 ScDocument* pDoc = pDocShell-GetDocument();
 SCTAB nTab = pPreview-GetTab();
@@ -282,13 +273,87 @@ void ScPreviewShell::UpdateScrollBars()
 ScStyleSheetPool*   pStylePool  = pDoc-GetStyleSheetPool();
 SfxStyleSheetBase*  pStyleSheet = pStylePool-Find( pDoc-GetPageStyle( 
nTab ),
 SFX_STYLE_FAMILY_PAGE 
);
-OSL_ENSURE(pStyleSheet,StyleSheet nicht gefunden);
-if (!pStyleSheet) return;
+OSL_ENSURE(pStyleSheet,No style sheet);
+if (!pStyleSheet) return false;
 const SfxItemSet* pParamSet = pStyleSheet-GetItemSet();
 
-Size aPageSize = ((const SvxSizeItem) 

[Libreoffice-commits] .: 2 commits - sc/source sw/source

2012-03-08 Thread Caolán McNamara
 sc/source/ui/app/inputhdl.cxx |4 
 sw/source/core/fields/docufld.cxx |3 +--
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 2a48994be5501d2204793700f4a169ae455c6658
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Mar 8 16:01:09 2012 +

different types in std::min on 32bit

diff --git a/sw/source/core/fields/docufld.cxx 
b/sw/source/core/fields/docufld.cxx
index 79233a1..b146f55 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -2566,8 +2566,7 @@ const rtl::OUString SwCombinedCharField::GetPar1() const
 
 void SwCombinedCharField::SetPar1(const rtl::OUString rStr)
 {
-sCharacters = rStr.copy(0, std::min(rStr.getLength(),
-static_castsal_Int32(MAX_COMBINED_CHARACTERS)));
+sCharacters = rStr.copy(0, std::minsal_Int32(rStr.getLength(), 
MAX_COMBINED_CHARACTERS));
 }
 
 bool SwCombinedCharField::QueryValue( uno::Any rAny,
commit a3f1614c606629196ca71dc22dab3343b060dced
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Mar 8 16:00:35 2012 +

Resolves: fdo#46923 uninitialized iterators are invalid

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index d5a0868..29a40c5 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -722,7 +722,10 @@ void ScInputHandler::GetFormulaData()
 if ( pFormulaData )
 pFormulaData-clear();
 else
+{
 pFormulaData = new ScTypedCaseStrSet;
+miAutoPosFormula = pFormulaData-end();
+}
 
 if( pFormulaDataPara )
 pFormulaDataPara-clear();
@@ -1524,6 +1527,7 @@ void ScInputHandler::GetColData()
 else
 {
 pColumnData = new ScTypedCaseStrSet;
+miAutoPosColumn = pColumnData-end();
 }
 
 std::vectorScTypedStrData aEntries;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sc/source sw/source

2012-02-03 Thread Michael Stahl
 sc/source/ui/unoobj/cellsuno.cxx  |3 +--
 sw/source/core/unocore/unotbl.cxx |2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 697743161a6047902ee880851b23c9aef1bfa392
Author: Michael Stahl mst...@redhat.com
Date:   Fri Feb 3 21:06:18 2012 +0100

fdo#45115: sc: fix setting borders

Same problem in ScHelperFunctions::GetBorderLine.

diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 1bddc21..7844d9f 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -953,8 +953,7 @@ ScSubTotalFunc lcl_SummaryToSubTotal( 
sheet::GeneralFunction eSummary )
 const ::editeng::SvxBorderLine* ScHelperFunctions::GetBorderLine( 
::editeng::SvxBorderLine rLine, const table::BorderLine rStruct )
 {
 //  Calc needs Twips, and there are 1/100mm in the Uno structure
-rLine.SetStyle( ::editeng::SvxBorderStyle( table::BorderLineStyle::SOLID ) 
);
-rLine.GuessLinesWidths( rLine.GetStyle(),
+rLine.GuessLinesWidths( editeng::NO_STYLE,
 (sal_uInt16)HMMToTwips( rStruct.OuterLineWidth ),
 (sal_uInt16)HMMToTwips( rStruct.InnerLineWidth ),
 (sal_uInt16)HMMToTwips( rStruct.LineDistance ) );
commit ef9881001e4ddfa6bfbe7d83f482393bb76d926a
Author: Michael Stahl mst...@redhat.com
Date:   Fri Feb 3 18:49:56 2012 +0100

fdo#45115: SwXTextTable: fix setting borders

This plus e549f52f16c4a519ed3eddb9c66c19bacc247590 fixes the problem.

diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index a928d15..9526160 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -136,7 +136,7 @@ sal_Bool lcl_LineToSvxLine(const table::BorderLine rLine, 
SvxBorderLine rSvxLi
 {
 rSvxLine.SetColor(Color(rLine.Color));
 
-rSvxLine.GuessLinesWidths( 
editeng::SvxBorderStyle(table::BorderLineStyle::SOLID),
+rSvxLine.GuessLinesWidths( editeng::NO_STYLE,
 MM100_TO_TWIP( rLine.OuterLineWidth ),
 MM100_TO_TWIP( rLine.InnerLineWidth ),
 MM100_TO_TWIP( rLine.LineDistance ) );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits