[Libreoffice-commits] .: svtools/source

2012-03-26 Thread Caolán McNamara
 svtools/source/filter/wmf/winmtf.cxx |   23 ---
 svtools/source/filter/wmf/winmtf.hxx |3 ---
 2 files changed, 26 deletions(-)

New commits:
commit 6bc1f24ceb2152e791301cd80ed579c26d275a69
Author: Santiago Martinez smvar...@gmail.com
Date:   Sun Mar 25 18:24:32 2012 +0200

Remove unused code in svtools.

diff --git a/svtools/source/filter/wmf/winmtf.cxx 
b/svtools/source/filter/wmf/winmtf.cxx
index 090886e..d9597ff 100644
--- a/svtools/source/filter/wmf/winmtf.cxx
+++ b/svtools/source/filter/wmf/winmtf.cxx
@@ -658,13 +658,6 @@ void WinMtfOutput::SelectObject( sal_Int32 nIndex )
 
 
//---
 
-void WinMtfOutput::SetFont( const Font rFont )
-{
-maFont = rFont;
-}
-
-//---
-
 const Font WinMtfOutput::GetFont() const
 {
 return maFont;
@@ -679,13 +672,6 @@ void WinMtfOutput::SetTextLayoutMode( const sal_uInt32 
nTextLayoutMode )
 
 
//---
 
-sal_uInt32 WinMtfOutput::GetTextLayoutMode() const
-{
-return mnTextLayoutMode;
-}
-
-//---
-
 void WinMtfOutput::SetBkMode( sal_uInt32 nMode )
 {
 mnBkMode = nMode;
@@ -1151,15 +1137,6 @@ void WinMtfOutput::LineTo( const Point rPoint, sal_Bool 
bRecordPath )
 
 
//---
 
-void WinMtfOutput::DrawLine( const Point rSource, const Point rDest )
-{
-UpdateClipRegion();
-UpdateLineStyle();
-mpGDIMetaFile-AddAction( new MetaLineAction( ImplMap( rSource), ImplMap( 
rDest ), maLineStyle.aLineInfo ) );
-}
-
-//---
-
 void WinMtfOutput::DrawRect( const Rectangle rRect, sal_Bool bEdge )
 {
 UpdateClipRegion();
diff --git a/svtools/source/filter/wmf/winmtf.hxx 
b/svtools/source/filter/wmf/winmtf.hxx
index 6f5e778..bf81be5 100644
--- a/svtools/source/filter/wmf/winmtf.hxx
+++ b/svtools/source/filter/wmf/winmtf.hxx
@@ -696,10 +696,8 @@ public:
 voidSelectObject( sal_Int32 nIndex );
 CharSet GetCharSet(){ return maFont.GetCharSet(); };
 WinMtfFillStyleGetFillStyle () { return maFillStyle; }
-voidSetFont( const Font rFont );
 const Font GetFont() const;
 voidSetTextLayoutMode( const sal_uInt32 nLayoutMode );
-sal_uInt32  GetTextLayoutMode() const;
 
 voidClearPath(){ aPathObj.Init(); };
 voidClosePath(){ aPathObj.ClosePath(); };
@@ -708,7 +706,6 @@ public:
 voidMoveTo( const Point rPoint, sal_Bool bRecordPath = 
sal_False );
 voidLineTo( const Point rPoint, sal_Bool bRecordPath = 
sal_False );
 voidDrawPixel( const Point rSource, const Color rColor );
-voidDrawLine( const Point rSource, const Point rDest );
 voidDrawRect( const Rectangle rRect, sal_Bool bEdge = 
sal_True );
 voidDrawRoundRect( const Rectangle rRect, const Size 
rSize );
 voidDrawEllipse( const Rectangle rRect );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2012-03-22 Thread Markus Mohrhard
 svtools/source/control/valueacc.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ffc7968ef27d662bdb2b7418eb0344039312f0bb
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 23 02:56:41 2012 +0100

Memcheck: Jump depends on unitialised variable

diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index 22680c4..37c48c2 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -48,6 +48,7 @@ ValueSetItem::ValueSetItem( ValueSet rParent )
 : mrParent(rParent)
 , mnId(0)
 , meType(VALUESETITEM_NONE)
+, mbVisible(true)
 , mpData(NULL)
 , mpxAcc(NULL)
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2012-03-14 Thread Stephan Bergmann
 svtools/source/contnr/DocumentInfoPreview.cxx |   18 --
 svtools/source/contnr/fileview.cxx|   18 +++---
 svtools/source/contnr/templwin.cxx|   10 +-
 svtools/source/contnr/templwin.src|1 -
 4 files changed, 20 insertions(+), 27 deletions(-)

New commits:
commit 3d69d78bed225039741213f1d6bb435468f3a818
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Mar 14 19:45:08 2012 +0100

Some visual clean up

diff --git a/svtools/source/contnr/DocumentInfoPreview.cxx 
b/svtools/source/contnr/DocumentInfoPreview.cxx
index 805ed0a..b27df17 100644
--- a/svtools/source/contnr/DocumentInfoPreview.cxx
+++ b/svtools/source/contnr/DocumentInfoPreview.cxx
@@ -138,17 +138,15 @@ void ODocumentInfoPreview::fill(
 void ODocumentInfoPreview::insertEntry(
 rtl::OUString const  title, rtl::OUString const  value)
 {
-rtl::OUString p1(rtl::OUString(\n) + title + rtl::OUString(:));
-m_pEditWin.InsertText(p1);
-m_pEditWin.SetAttrib(
-TextAttribFontWeight(WEIGHT_BOLD), m_pEditWin.GetParagraphCount() - 1,
-0, p1.getLength());
-rtl::OUString p2(rtl::OUString(\n) + value);
-m_pEditWin.InsertText(p2);
+if (m_pEditWin.GetText().Len() != 0) {
+m_pEditWin.InsertText(rtl::OUString(\n\n));
+}
+rtl::OUString caption(title + rtl::OUString(:\n));
+m_pEditWin.InsertText(caption);
 m_pEditWin.SetAttrib(
-TextAttribFontWeight(WEIGHT_NORMAL),
-m_pEditWin.GetParagraphCount() - 1, 0, p2.getLength());
-m_pEditWin.InsertText(rtl::OUString(\n));
+TextAttribFontWeight(WEIGHT_BOLD), m_pEditWin.GetParagraphCount() - 2,
+0, caption.getLength() - 1);
+m_pEditWin.InsertText(value);
 }
 
 void ODocumentInfoPreview::insertNonempty(long id, rtl::OUString const  value)
diff --git a/svtools/source/contnr/fileview.cxx 
b/svtools/source/contnr/fileview.cxx
index b686831..de0c2af 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -187,6 +187,7 @@ private:
 sal_BoolmbAutoResize: 1;
 sal_BoolmbEnableDelete  : 1;
 sal_BoolmbEnableRename  : 1;
+boolmbShowHeader;
 
 voidDeleteEntries();
 voidDoQuickSearch( const xub_Unicode rChar );
@@ -722,10 +723,9 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( Window* 
pParentWin,
 mbResizeDisabled( sal_False ),
 mbAutoResize( sal_False ),
 mbEnableDelete  ( sal_True ),
-mbEnableRename  ( sal_True )
-
+mbEnableRename  ( sal_True ),
+mbShowHeader( (nFlags  FILEVIEW_SHOW_NONE) == 0 )
 {
-const bool bViewHeader = (nFlags  FILEVIEW_SHOW_NONE) == 0;
 Size aBoxSize = pParentWin-GetSizePixel();
 mpHeaderBar = new HeaderBar( pParentWin, WB_BUTTONSTYLE | WB_BOTTOMBORDER 
);
 mpHeaderBar-SetPosSizePixel( Point( 0, 0 ), 
mpHeaderBar-CalcWindowSizePixel() );
@@ -760,7 +760,7 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( Window* 
pParentWin,
 SetSelectionMode( MULTIPLE_SELECTION );
 
 Show();
-if( bViewHeader )
+if( mbShowHeader )
 mpHeaderBar-Show();
 
 maResetQuickSearch.SetTimeout( QUICK_SEARCH_TIMEOUT );
@@ -806,9 +806,13 @@ void ViewTabListBox_Impl::Resize()
 if ( mbResizeDisabled || !aBoxSize.Width() )
 return;
 
-Size aBarSize = mpHeaderBar-GetSizePixel();
-aBarSize.Width() = mbAutoResize ? aBoxSize.Width() : 
GetSizePixel().Width();
-mpHeaderBar-SetSizePixel( aBarSize );
+Size aBarSize;
+if ( mbShowHeader )
+{
+aBarSize = mpHeaderBar-GetSizePixel();
+aBarSize.Width() = mbAutoResize ? aBoxSize.Width() : 
GetSizePixel().Width();
+mpHeaderBar-SetSizePixel( aBarSize );
+}
 
 if ( mbAutoResize )
 {
diff --git a/svtools/source/contnr/templwin.cxx 
b/svtools/source/contnr/templwin.cxx
index 3bdb0f7..a2a8315 100644
--- a/svtools/source/contnr/templwin.cxx
+++ b/svtools/source/contnr/templwin.cxx
@@ -427,7 +427,6 @@ SvtFileViewWindow_Impl::SvtFileViewWindow_Impl( 
SvtTemplateWindow* pParent ) :
 aFileView.SetStyle( aFileView.GetStyle() | WB_DIALOGCONTROL | WB_TABSTOP );
 aFileView.SetHelpId( HID_TEMPLATEDLG_FILEVIEW );
 aFileView.Show();
-aFileView.SetPosPixel( Point( 0, 0 ) );
 aFileView.EnableAutoResize();
 aFileView.EnableContextMenu( sal_False );
 aFileView.EnableDelete( sal_False );
@@ -528,14 +527,7 @@ Sequence ::rtl::OUString  
SvtFileViewWindow_Impl::GetNewDocContents() const
 
 void SvtFileViewWindow_Impl::Resize()
 {
-Size aWinSize = GetOutputSizePixel();
-
-static int  x = 0;
-static int  y = 0;
-
-aWinSize.nA += x;
-aWinSize.nB += y;
-aFileView.SetSizePixel( aWinSize );
+aFileView.SetSizePixel(GetOutputSizePixel());
 }
 
 String SvtFileViewWindow_Impl::GetSelectedFile() const
diff --git a/svtools/source/contnr/templwin.src 

[Libreoffice-commits] .: svtools/source svx/source sw/source

2012-02-22 Thread Michael Meeks
 svtools/source/graphic/grfmgr.cxx   |5 -
 svtools/source/graphic/provider.cxx |3 ---
 svx/source/xml/xmlgrhlp.cxx |5 -
 sw/source/core/graphic/ndgrf.cxx|   33 -
 4 files changed, 46 deletions(-)

New commits:
commit fdb9d721c18fb3c3f81f7384ad544e72e969f448
Author: Michael Meeks michael.me...@suse.com
Date:   Wed Feb 22 14:24:52 2012 +

revert slew of debug code committed in error

diff --git a/svtools/source/graphic/grfmgr.cxx 
b/svtools/source/graphic/grfmgr.cxx
index 2124d62..7c2de86 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -422,17 +422,12 @@ String GraphicObject::GetLink() const
 
 void GraphicObject::SetUserData()
 {
-fprintf (stderr, SetUserData to null from '%s'\n,
- mpUserData ? rtl::OUStringToOString(*mpUserData, 
RTL_TEXTENCODING_UTF8).getStr() : null);
 if( mpUserData )
 delete mpUserData, mpUserData = NULL;
 }
 
 void GraphicObject::SetUserData( const String rUserData )
 {
-fprintf (stderr, SetUserData to '%s' from '%s'\n,
- rtl::OUStringToOString(rUserData, RTL_TEXTENCODING_UTF8).getStr(),
- mpUserData ? rtl::OUStringToOString(*mpUserData, 
RTL_TEXTENCODING_UTF8).getStr() : null);
 delete mpUserData, mpUserData = new String( rUserData );
 }
 
diff --git a/svtools/source/graphic/provider.cxx 
b/svtools/source/graphic/provider.cxx
index 185e9dc..d5bcf46 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -867,7 +867,6 @@ void SAL_CALL GraphicProvider::storeGraphic( const 
uno::Reference ::graphic::XG
 
 if( pGraphic  ( pGraphic-GetType() != GRAPHIC_NONE ) )
 {
-fprintf (stderr, provider.cxx - write graphic: ! 
0x%lx\n, (long)pGraphic-GetChecksum() );
 ::Graphic aGraphic( *pGraphic );
 ImplApplyFilterData( aGraphic, aFilterDataSeq );
 
@@ -885,8 +884,6 @@ void SAL_CALL GraphicProvider::storeGraphic( const 
uno::Reference ::graphic::XG
 }
 aMemStrm.Seek( STREAM_SEEK_TO_END );
 pOStm-Write( aMemStrm.GetData(), aMemStrm.Tell() );
-
-fprintf (stderr, provider.cxx - after write graphic: ! 
0x%lx\n, (long)pGraphic-GetChecksum() );
 }
 }
 }
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 9f2c6c8..d73c19e 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -621,8 +621,6 @@ sal_Bool SvXMLGraphicHelper::ImplWriteGraphic( const 
::rtl::OUString rPictureSt
 }
 else if( aGraphic.GetType() == GRAPHIC_GDIMETAFILE )
 {
-fprintf (stderr, xmlgrhlp.cxx - write meta-file ! 
0x%lx\n,
- (long)aGraphic.GetChecksum() );
 pStream-SetVersion( SOFFICE_FILEFORMAT_8 );
 pStream-SetCompressMode( COMPRESSMODE_ZBITMAP );
 
@@ -645,9 +643,6 @@ sal_Bool SvXMLGraphicHelper::ImplWriteGraphic( const 
::rtl::OUString rPictureSt
 rMtf.Write( *pStream, 
GDIMETAFILE_WRITE_REPLACEMENT_RENDERGRAPHIC );
 
 bRet = ( pStream-GetError() == 0 );
-
-fprintf (stderr, xmlgrhlp.cxx - done write meta-file ! 
0x%lx\n,
- (long)aGraphic.GetChecksum() );
 }
 }
 uno::Reference  embed::XTransactedObject  xStorage(
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 907e1f0..151d795 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -63,14 +63,6 @@
 
 using namespace com::sun::star;
 
-static void dbg (SwGrfNode *pNode)
-{
-fprintf (stderr, SwGrfNode created: '%s' 0x%lx\n,
- rtl::OUStringToOString(pNode-GetGrfObj().GetUserData(),
-RTL_TEXTENCODING_UTF8).getStr(),
- (long)pNode-GetGrf().GetChecksum());
-}
-
 // 
 // SwGrfNode
 // 
@@ -91,7 +83,6 @@ SwGrfNode::SwGrfNode(
 
 bGrafikArrived = sal_True;
 ReRead(rGrfName,rFltName, pGraphic, 0, sal_False);
-dbg(this);
 }
 
 SwGrfNode::SwGrfNode( const SwNodeIndex  rWhere,
@@ -109,7 +100,6 @@ SwGrfNode::SwGrfNode( const SwNodeIndex  rWhere,
 bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel= bLoadLowResGrf =
 bFrameInPaint = bScaleImageMap = sal_False;
 bGrafikArrived = sal_True;
-dbg(this);
 }
 
 // Konstruktor fuer den SW/G-Reader. Dieser ctor wird verwendet,
@@ -145,7 +135,6 @@ SwGrfNode::SwGrfNode( const SwNodeIndex  rWhere,
 ((SwBaseLink*)refLink)-Connect();
 }
 }
-dbg(this);
 }
 
 sal_Bool SwGrfNode::ReRead(
@@ -398,9 +387,6 @@ sal_Bool SwGrfNode::ImportGraphic( SvStream rStrm )
 const String aGraphicURL( aGrfObj.GetUserData() );
   

[Libreoffice-commits] .: svtools/source

2012-02-15 Thread Stephan Bergmann
 svtools/source/misc/imap2.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 715ac8c1b402e33930317a69bbdd61ad88133740
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Feb 15 21:55:57 2012 +0100

Fixed some more apparent misuses of RTL_CONSTASCII_USTRINGPARAM

diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index 60225a8..c29525b 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -536,8 +536,8 @@ sal_uLong ImageMap::ImpDetectFormat( SvStream rIStm )
 aStr = aStr.toAsciiLowerCase();
 
 if ( (aStr.indexOfL(RTL_CONSTASCII_STRINGPARAM(rect)) != -1) ||
- (aStr.indexOfL(RTL_CONSTASCII_USTRINGPARAM(circ)) != -1) ||
- (aStr.indexOfL(RTL_CONSTASCII_USTRINGPARAM(poly)) != -1) )
+ (aStr.indexOfL(RTL_CONSTASCII_STRINGPARAM(circ)) != -1) ||
+ (aStr.indexOfL(RTL_CONSTASCII_STRINGPARAM(poly)) != -1) )
 {
 if ( ( aStr.indexOf('(') != -1 ) 
  ( aStr.indexOf(')') != -1 ) )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source unusedcode.easy

2012-02-09 Thread Caolán McNamara
 svtools/source/graphic/descriptor.cxx |7 ---
 svtools/source/graphic/descriptor.hxx |2 --
 unusedcode.easy   |1 -
 3 files changed, 10 deletions(-)

New commits:
commit 295cc6c5bce83c48aa92254687b2251c09115e67
Author: Greg Kroah-Hartman gre...@linuxfoundation.org
Date:   Thu Feb 9 17:07:48 2012 +

unographic: delete unused GraphicDescriptor::isValid()

diff --git a/svtools/source/graphic/descriptor.cxx 
b/svtools/source/graphic/descriptor.cxx
index a2441c9..378162d 100644
--- a/svtools/source/graphic/descriptor.cxx
+++ b/svtools/source/graphic/descriptor.cxx
@@ -116,13 +116,6 @@ void GraphicDescriptor::init( const uno::Reference 
io::XInputStream  rxIStm,
 
 // 
--
 
-bool GraphicDescriptor::isValid() const
-{
-return( mpGraphic ? ( mpGraphic-GetType() != GRAPHIC_NONE ) : ( meType != 
GRAPHIC_NONE ) );
-}
-
-// 
--
-
 void GraphicDescriptor::implCreate( SvStream rIStm, const ::rtl::OUString* 
pURL )
 {
 String aURL;
diff --git a/svtools/source/graphic/descriptor.hxx 
b/svtools/source/graphic/descriptor.hxx
index 2eeff29..a2b7e26 100644
--- a/svtools/source/graphic/descriptor.hxx
+++ b/svtools/source/graphic/descriptor.hxx
@@ -89,8 +89,6 @@ public:
 void init( const ::rtl::OUString rURL ) throw();
 void init( const ::com::sun::star::uno::Reference 
::com::sun::star::io::XInputStream  rxIStm, const ::rtl::OUString rURL ) 
throw();
 
-bool isValid() const;
-
 static ::rtl::OUString getImplementationName_Static() throw();
 static ::com::sun::star::uno::Sequence ::rtl::OUString   
getSupportedServiceNames_Static() throw();
 
diff --git a/unusedcode.easy b/unusedcode.easy
index a8e8543..d6d3b58 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -1541,7 +1541,6 @@ 
ucbhelper::Content::getPropertyValues(com::sun::star::uno::Sequenceint const)
 ucbhelper::Content::insertNewContent(rtl::OUString const, 
com::sun::star::uno::Sequenceint const, 
com::sun::star::uno::Sequencecom::sun::star::uno::Any const, 
com::sun::star::uno::Referencecom::sun::star::io::XInputStream const, 
ucbhelper::Content)
 
ucbhelper::ContentBroker::ContentBroker(com::sun::star::uno::Referencecom::sun::star::lang::XMultiServiceFactory
 const, std::__debug::vectorucbhelper::ContentProviderData, 
std::allocatorucbhelper::ContentProviderData  const)
 ucbhelper::SimpleCertificateValidationRequest::getResponse() const
-unographic::GraphicDescriptor::isValid() const
 utl::NodeValueAccessor::bind(com::sun::star::uno::Any*)
 utl::OConfigurationNode::appendNode(rtl::OUString const, 
utl::OConfigurationNode const) const
 utl::TransliterationWrapper::compareSubstring(String const, int, int, String 
const, int, int) const
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2012-02-05 Thread Matteo Casalin
 svtools/source/control/valueset.cxx |   26 ++
 1 file changed, 10 insertions(+), 16 deletions(-)

New commits:
commit a0e7d661e0d36e3069b77f6f4b1f55352efbee9a
Author: Matteo Casalin matteo.casa...@gmx.com
Date:   Sun Feb 5 12:23:31 2012 +0100

Removed unused variable

diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index cc1d9e6..0c58242 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -339,7 +339,6 @@ void ValueSet::Format()
 WinBits nStyle = GetStyle();
 longnTxtHeight = GetTextHeight();
 longnOff;
-longnSpace;
 longnNoneHeight;
 longnNoneSpace;
 ScrollBar*  pDelScrBar = NULL;
@@ -367,7 +366,6 @@ void ValueSet::Format()
 }
 else
 nOff = 0;
-nSpace = mnSpacing;
 
 // consider size, if NameField does exist
 if ( nStyle  WB_NAMEFIELD )
@@ -388,7 +386,7 @@ void ValueSet::Format()
 if ( nStyle  WB_NONEFIELD )
 {
 nNoneHeight = nTxtHeight+nOff;
-nNoneSpace = nSpace;
+nNoneSpace = mnSpacing;
 if ( nStyle  WB_RADIOSEL )
 nNoneHeight += 8;
 }
@@ -414,7 +412,7 @@ void ValueSet::Format()
 {
 if ( mnUserItemWidth )
 {
-mnCols = (sal_uInt16)((aWinSize.Width()-nScrBarWidth+nSpace) / 
(mnUserItemWidth+nSpace));
+mnCols = (sal_uInt16)((aWinSize.Width()-nScrBarWidth+mnSpacing) / 
(mnUserItemWidth+mnSpacing));
 if ( !mnCols )
 mnCols = 1;
 }
@@ -437,7 +435,7 @@ void ValueSet::Format()
 mnVisLines = mnUserVisLines;
 else if ( mnUserItemHeight )
 {
-mnVisLines = (nCalcHeight-nNoneSpace+nSpace) / 
(mnUserItemHeight+nSpace);
+mnVisLines = (nCalcHeight-nNoneSpace+mnSpacing) / 
(mnUserItemHeight+mnSpacing);
 if ( !mnVisLines )
 mnVisLines = 1;
 }
@@ -454,8 +452,8 @@ void ValueSet::Format()
 }
 
 // calculate item size
-long nColSpace  = (mnCols-1)*nSpace;
-long nLineSpace = ((mnVisLines-1)*nSpace)+nNoneSpace;
+long nColSpace  = (mnCols-1)*mnSpacing;
+long nLineSpace = ((mnVisLines-1)*mnSpacing)+nNoneSpace;
 long nItemWidth;
 long nItemHeight;
 if ( mnUserItemWidth  !mnUserCols )
@@ -583,7 +581,7 @@ void ValueSet::Format()
 // If want also draw parts of items in the last line,
 // then we add one more line if parts of these line are
 // visible
-if ( y+(mnVisLines*(nItemHeight+nSpace))  aWinSize.Height() )
+if ( y+(mnVisLines*(nItemHeight+mnSpacing))  aWinSize.Height() )
 nLastItem += mnCols;
 }
 for ( size_t i = 0; i  nItemCount; i++ )
@@ -612,10 +610,10 @@ void ValueSet::Format()
 if ( !((i+1) % mnCols) )
 {
 x = nStartX;
-y += nItemHeight+nSpace;
+y += nItemHeight+mnSpacing;
 }
 else
-x += nItemWidth+nSpace;
+x += nItemWidth+mnSpacing;
 }
 else
 {
@@ -640,7 +638,7 @@ void ValueSet::Format()
 if ( nStyle  WB_NONEFIELD )
 {
 aPos.Y() = nStartY+nNoneHeight+1;
-aSize.Height() = ((nItemHeight+nSpace)*mnVisLines)-2-nSpace;
+aSize.Height() = 
((nItemHeight+mnSpacing)*mnVisLines)-2-mnSpacing;
 }
 mpScrBar-SetPosSizePixel( aPos, aSize );
 mpScrBar-SetRangeMax( mnLines );
@@ -2380,7 +2378,6 @@ Size ValueSet::CalcWindowSizePixel( const Size 
rItemSize, sal_uInt16 nDesireCol
 SizeaSize( rItemSize.Width()*nCalcCols, 
rItemSize.Height()*nCalcLines );
 WinBits nStyle = GetStyle();
 longnTxtHeight = GetTextHeight();
-longnSpace;
 longn;
 
 if ( nStyle  WB_ITEMBORDER )
@@ -2398,12 +2395,9 @@ Size ValueSet::CalcWindowSizePixel( const Size 
rItemSize, sal_uInt16 nDesireCol
 
 if ( mnSpacing )
 {
-nSpace = mnSpacing;
 aSize.Width()  += mnSpacing*(nCalcCols-1);
 aSize.Height() += mnSpacing*(nCalcLines-1);
 }
-else
-nSpace = 0;
 
 if ( nStyle  WB_NAMEFIELD )
 {
@@ -2414,7 +2408,7 @@ Size ValueSet::CalcWindowSizePixel( const Size 
rItemSize, sal_uInt16 nDesireCol
 
 if ( nStyle  WB_NONEFIELD )
 {
-aSize.Height() += nTxtHeight + n + nSpace;
+aSize.Height() += nTxtHeight + n + mnSpacing;
 if ( nStyle  WB_RADIOSEL )
 aSize.Height() += 8;
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2012-01-31 Thread Julien Nabet
 svtools/source/filter/filter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4d83e7010870fb8d74b19c28f1c4cd3fa616f514
Author: Julien Nabet serval2...@yahoo.fr
Date:   Tue Jan 31 22:56:20 2012 +0100

Fix Possible inefficient checking for 'rChunkData' emptiness

diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx
index bd95ab7..ee1f329 100644
--- a/svtools/source/filter/filter.cxx
+++ b/svtools/source/filter/filter.cxx
@@ -1961,7 +1961,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic 
rGraphic, const String
 if ( aAdditionalChunkSequence[ j 
].Value = aByteSeq )
 {
 std::vector 
vcl::PNGWriter::ChunkData  rChunkData = aPNGWriter.GetChunks();
-if ( rChunkData.size() )
+if ( !rChunkData.empty() )
 {
 sal_uInt32 nChunkLen = 
aByteSeq.getLength();
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2012-01-30 Thread Julien Nabet
 svtools/source/filter/sgvtext.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 10bfc4df5335c6cd2ae700df7485668d896998b5
Author: Julien Nabet serval2...@yahoo.fr
Date:   Mon Jan 30 21:21:34 2012 +0100

Replace literal control characters (thank you Eike !)

diff --git a/svtools/source/filter/sgvtext.cxx 
b/svtools/source/filter/sgvtext.cxx
index 8848c1f..28f950b 100644
--- a/svtools/source/filter/sgvtext.cxx
+++ b/svtools/source/filter/sgvtext.cxx
@@ -136,10 +136,10 @@ extern SgfFontLst* pSgfFonts;
 //EscBold, 
EscLSlnt,EscRSlnt,EscUndln,EscDbUnd,EscKaptF,EscStrik,EscDbStk,
 //EscSupSc,EscSubSc,Esc2DShd,Esc3DShd,Esc4DShd];
 // Justify muss spaetestens am Anfang des Absatzes stehen
-#define  EscSet'' /* Flag setzen  
 */
-#define  EscReset  '' /* Flag loeschen
 */
+#define  EscSet'\x1e' /* Flag setzen   
*/
+#define  EscReset  '\x1f' /* Flag loeschen 
*/
 #define  EscDeflt  '\x11' /* Flag auf default setzen   
 */
-#define  EscToggl  '' /* Flag Toggeln 
 */
+#define  EscToggl  '\x1d' /* Flag Toggeln  
*/
 #define  EscRelat  '%'
 #define  EscNoFlg  0
 #define  EscNoVal  -2147483647 /* -MaxLongInt */
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2012-01-23 Thread Caolán McNamara
 svtools/source/misc/filechangedchecker.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1bc228f769be2999c10beefe224517804bb0316c
Author: Mariusz Dykierek mariuszdykie...@gmail.com
Date:   Mon Jan 23 12:52:55 2012 +

Same expression on both sides of || in if condition

diff --git a/svtools/source/misc/filechangedchecker.cxx 
b/svtools/source/misc/filechangedchecker.cxx
index 514841f..50d73da 100644
--- a/svtools/source/misc/filechangedchecker.cxx
+++ b/svtools/source/misc/filechangedchecker.cxx
@@ -83,7 +83,7 @@ bool FileChangedChecker::hasFileChanged()
 // Check if the seconds time stamp has any difference
 // If so, then our file has changed meanwhile
 if( newTime.Seconds != mLastModTime.Seconds ||
-newTime.Seconds != mLastModTime.Seconds )
+newTime.Nanosec != mLastModTime.Nanosec )
 {
 // Since the file has changed, set the new status as the file status 
and
 // return True
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2012-01-16 Thread Stephan Bergmann
 svtools/source/control/calendar.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e770d5300054d56545bba3c16635a14e92fde807
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Jan 16 16:01:25 2012 +0100

Fix #ifdef SAL_LOG_INFO region.

diff --git a/svtools/source/control/calendar.cxx 
b/svtools/source/control/calendar.cxx
index 0cf3041..0b291e0 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -217,10 +217,10 @@ void Calendar::ImplInit( WinBits nWinStyle )
 {
 #ifdef SAL_LOG_INFO
 lang::Locale aLoc( Application::GetAppLocaleDataWrapper().getLocale() 
);
-#endif
 SAL_INFO( svtools, Calendar::ImplInit: No ``gregorian'' calendar 
available for locale ``
  aLoc.Language  -  aLoc.Country
  '' and other calendars aren't supported. Using en-US 
fallback. );
+#endif
 
 /* If we ever wanted to support other calendars than Gregorian a lot of
  * rewrite would be necessary to internally replace use of class Date
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2012-01-14 Thread Matteo Casalin
 svtools/source/control/valueacc.cxx |2 
 svtools/source/control/valueimp.hxx |3 
 svtools/source/control/valueset.cxx |  175 +---
 3 files changed, 68 insertions(+), 112 deletions(-)

New commits:
commit e4938058e2cc21c705507c365c46f9bfb9ac828c
Author: Matteo Casalin matteo.casa...@poste.it
Date:   Tue Jan 3 14:43:58 2012 +0100

VALUESETITEM_SPACE is never set: remove related code

diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index a8a544b..73e2dea 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -444,7 +444,7 @@ uno::Reference accessibility::XAccessible  SAL_CALL 
ValueSetAcc::getAccessible
 {
 ValueSetItem* pItem = (*mpParent-mpImpl-mpItemList)[ nItemPos ];
 
-if( ( pItem-meType != VALUESETITEM_SPACE )  
!pItem-maRect.IsEmpty() )
+if( !pItem-maRect.IsEmpty() )
xRet = pItem-GetAccessible( mbIsTransientChildrenDisabled );
 }
 }
diff --git a/svtools/source/control/valueimp.hxx 
b/svtools/source/control/valueimp.hxx
index 0a5398d..e393208 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -67,8 +67,7 @@ enum ValueSetItemType
 VALUESETITEM_NONE,
 VALUESETITEM_IMAGE,
 VALUESETITEM_COLOR,
-VALUESETITEM_USERDRAW,
-VALUESETITEM_SPACE
+VALUESETITEM_USERDRAW
 };
 
 // 
diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index a8fdbab..cc1d9e6 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -213,9 +213,6 @@ void ValueSet::ImplInitScrollBar()
 
 void ValueSet::ImplFormatItem( ValueSetItem* pItem )
 {
-if ( pItem-meType == VALUESETITEM_SPACE )
-return;
-
 Rectangle aRect = pItem-maRect;
 WinBits nStyle = GetStyle();
 if ( nStyle  WB_ITEMBORDER )
@@ -1078,14 +1075,7 @@ ValueSetItem* ValueSet::ImplGetItem( size_t nPos )
 
 ValueSetItem* ValueSet::ImplGetFirstItem()
 {
-for ( size_t i = 0, nItemCount = mpImpl-mpItemList-size(); i  
nItemCount; ++i ) {
-ValueSetItem* pItem = (*mpImpl-mpItemList)[ i ];
-if ( pItem-meType != VALUESETITEM_SPACE ) {
-return pItem;
-}
-}
-
-return NULL;
+return mpImpl-mpItemList-size() ? (*mpImpl-mpItemList)[ 0 ] : NULL;
 }
 
 // ---
@@ -1098,7 +1088,7 @@ sal_uInt16 ValueSet::ImplGetVisibleItemCount() const
 {
 ValueSetItem* pItem = (*mpImpl-mpItemList)[ n ];
 
-if( pItem-meType != VALUESETITEM_SPACE  !pItem-maRect.IsEmpty() )
+if( !pItem-maRect.IsEmpty() )
 nRet++;
 }
 
@@ -1116,7 +1106,7 @@ ValueSetItem* ValueSet::ImplGetVisibleItem( sal_uInt16 
nVisiblePos )
 {
 ValueSetItem* pItem = (*mpImpl-mpItemList)[ n ];
 
-if( ( pItem-meType != VALUESETITEM_SPACE )  
!pItem-maRect.IsEmpty()  ( nVisiblePos == nFoundPos++ ) )
+if( !pItem-maRect.IsEmpty()  ( nVisiblePos == nFoundPos++ ) )
 pRet = pItem;
 }
 
@@ -1181,7 +1171,7 @@ void ValueSet::ImplTracking( const Point rPos, sal_Bool 
bRepeat )
 }
 
 ValueSetItem* pItem = ImplGetItem( ImplGetItem( rPos ) );
-if ( pItem  (pItem-meType != VALUESETITEM_SPACE) )
+if ( pItem )
 {
 if( GetStyle()  WB_MENUSTYLEVALUESET )
 mbHighlight = sal_True;
@@ -1209,7 +1199,7 @@ void ValueSet::ImplEndTracking( const Point rPos, 
sal_Bool bCancel )
 else
 pItem = ImplGetItem( ImplGetItem( rPos ) );
 
-if ( pItem  (pItem-meType != VALUESETITEM_SPACE) )
+if ( pItem )
 {
 SelectItem( pItem-mnId );
 if ( !mbSelection  !(GetStyle()  WB_NOPOINTERFOCUS) )
@@ -1236,7 +1226,7 @@ void ValueSet::MouseButtonDown( const MouseEvent rMEvt )
 if ( mbSelection )
 {
 mbHighlight = sal_True;
-if ( pItem  (pItem-meType != VALUESETITEM_SPACE) )
+if ( pItem )
 {
 mnOldItemId  = mnSelItemId;
 mnHighItemId = mnSelItemId;
@@ -1247,7 +1237,7 @@ void ValueSet::MouseButtonDown( const MouseEvent rMEvt )
 }
 else
 {
-if ( pItem  (pItem-meType != VALUESETITEM_SPACE)  
!rMEvt.IsMod2() )
+if ( pItem  !rMEvt.IsMod2() )
 {
 if ( rMEvt.GetClicks() == 1 )
 {
@@ -1341,67 +1331,44 @@ void ValueSet::KeyInput( const KeyEvent rKEvt )
 switch ( rKEvt.GetKeyCode().GetCode() )
 {
 case KEY_HOME:
-if ( mpNoneItem )
-nItemPos = VALUESET_ITEM_NONEITEM;
-else
-{
-nItemPos = 0;
-while ( ImplGetItem( nItemPos )-meType == VALUESETITEM_SPACE )
-nItemPos++;
-}
+nItemPos = mpNoneItem ? VALUESET_ITEM_NONEITEM : 0;
 

[Libreoffice-commits] .: svtools/source

2012-01-11 Thread Lionel Elie Mamane
 svtools/source/brwbox/brwbox1.cxx   |   22 +-
 svtools/source/brwbox/brwbox2.cxx   |   22 --
 svtools/source/brwbox/brwbox3.cxx   |2 +-
 svtools/source/brwbox/brwhead.cxx   |2 +-
 svtools/source/brwbox/datwin.cxx|2 +-
 svtools/source/brwbox/editbrowsebox.cxx |   12 +---
 6 files changed, 29 insertions(+), 33 deletions(-)

New commits:
commit a3261b16471995832f6791b5831c640c72948a95
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Wed Jan 11 18:55:14 2012 +0100

fdo#44283: finish 8a17792f2e5 (Handle/invalid column ID cleanup)

diff --git a/svtools/source/brwbox/brwbox1.cxx 
b/svtools/source/brwbox/brwbox1.cxx
index cca40ce..5ddaa03 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -307,9 +307,9 @@ void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, const 
XubString rText,
 
 if ( getDataWindow()-pHeaderBar )
 {
-// Handlecolumn nicht in der Headerbar
+// Handle column not in the header bar
 sal_uInt16 nHeaderPos = nPos;
-if (nHeaderPos != HEADERBAR_APPEND  !GetColumnId(0))
+if (nHeaderPos != HEADERBAR_APPEND  GetColumnId(0) == HandleColumnId 
)
 nHeaderPos--;
 getDataWindow()-pHeaderBar-InsertItem(
 nItemId, rText, nWidth, nBits, nHeaderPos );
@@ -347,7 +347,7 @@ void BrowseBox::FreezeColumn( sal_uInt16 nItemId, sal_Bool 
bFreeze )
 DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
 
 // never unfreeze the handle-column
-if ( nItemId == 0  !bFreeze )
+if ( nItemId == HandleColumnId  !bFreeze )
 return;
 
 // get the position in the current array
@@ -424,12 +424,8 @@ void BrowseBox::FreezeColumn( sal_uInt16 nItemId, sal_Bool 
bFreeze )
 
 void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos )
 {
-// never set pos of the handle-column
-if ( nColumnId == 0 )
-return;
-
-// do not move handle column
-if (nPos == 0  !(*pCols)[ 0 ]-GetId())
+// never set pos of the handle column
+if ( nColumnId == HandleColumnId )
 return;
 
 // get the position in the current array
@@ -504,7 +500,7 @@ void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, 
sal_uInt16 nPos )
 if ( getDataWindow()-pHeaderBar )
 {
 sal_uInt16 nNewPos = nPos;
-if ( !GetColumnId(0) )
+if ( GetColumnId(0) == HandleColumnId )
 --nNewPos;
 getDataWindow()-pHeaderBar-MoveItem(nColumnId,nNewPos);
 }
@@ -550,7 +546,7 @@ void BrowseBox::SetColumnTitle( sal_uInt16 nItemId, const 
String rTitle )
 DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
 
 // never set title of the handle-column
-if ( nItemId == 0 )
+if ( nItemId == HandleColumnId )
 return;
 
 // get the position in the current array
@@ -2383,8 +2379,8 @@ void BrowseBox::SetMode( BrowserMode nMode )
 if ( pDataWin )
 pDataWin-Invalidate();
 
-// kein Cursor auf Handle-Column
-if ( nCurColId == 0 )
+// no cursor on handle column
+if ( nCurColId == HandleColumnId )
 nCurColId = GetColumnId( 1 );
 
 m_nCurrentMode = nMode;
diff --git a/svtools/source/brwbox/brwbox2.cxx 
b/svtools/source/brwbox/brwbox2.cxx
index 92c29de..9a4a7b2 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -416,8 +416,8 @@ void BrowseBox::DrawCursor()
 else
 bReallyHide |= ( GetCursorHideCount()  0 );
 
-// keine Cursor auf Handle-Column
-if ( nCurColId == 0 )
+// no cursor on handle column
+if ( nCurColId == HandleColumnId )
 nCurColId = GetColumnId(1);
 
 // Cursor-Rechteck berechnen
@@ -1682,8 +1682,8 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent 
rEvt )
 // DataRow?
 if ( rEvt.GetRow() = 0 )
 {
-// Zeilenselektion?
-if ( rEvt.GetColumnId() == 0 || !bColumnCursor )
+// line selection?
+if ( rEvt.GetColumnId() == HandleColumnId || !bColumnCursor )
 {
 if ( bMultiSelection )
 {
@@ -1757,7 +1757,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent 
rEvt )
 }
 else
 {
-if ( bMultiSelection  rEvt.GetColumnId() == 0 )
+if ( bMultiSelection  rEvt.GetColumnId() == HandleColumnId )
 {
 // toggle all-selection
 if ( uRow.pSel-GetSelectCount()  ( GetRowCount() / 2 ) )
@@ -1990,7 +1990,7 @@ void BrowseBox::Dispatch( sal_uInt16 nId )
 if ( bColumnCursor )
 {
 sal_uInt16 nNewId = GetColumnId(ColCount() -1);
-bDone = (nNewId != 0)  GoToColumnId( nNewId );
+bDone = nNewId != HandleColumnId  GoToColumnId( nNewId );
 break;

[Libreoffice-commits] .: svtools/source

2012-01-11 Thread August Sodora
 svtools/source/control/inettbc.cxx |  107 ++---
 1 file changed, 30 insertions(+), 77 deletions(-)

New commits:
commit 116d77f97329a064f67da99fd4c25260008c9ba4
Author: August Sodora aug...@gmail.com
Date:   Wed Jan 11 20:46:25 2012 -0500

SvStringsDtor-std::vector

diff --git a/svtools/source/control/inettbc.cxx 
b/svtools/source/control/inettbc.cxx
index b9b526c..e33809b 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -68,8 +68,6 @@
 #include vector
 #include algorithm
 
-// ---
-
 using namespace ::rtl;
 using namespace ::ucbhelper;
 using namespace ::utl;
@@ -81,34 +79,30 @@ using namespace ::com::sun::star::task;
 using namespace ::com::sun::star::ucb;
 using namespace ::com::sun::star::uno;
 
-// ---
 class SvtURLBox_Impl
 {
 public:
-SvStringsDtor*  pURLs;
-SvStringsDtor*  pCompletions;
+std::vectorrtl::OUString  aURLs;
+std::vectorrtl::OUString  aCompletions;
 const IUrlFilter*   pUrlFilter;
 ::std::vector WildCardm_aFilters;
 
 static sal_Bool TildeParsing( String aText, String aBaseUrl );
 
 inline SvtURLBox_Impl( )
-:pURLs( NULL )
-,pCompletions( NULL )
-,pUrlFilter( NULL )
+:pUrlFilter( NULL )
 {
 FilterMatch::createWildCardFilterList(String(),m_aFilters);
 }
 };
 
-// ---
 class SvtMatchContext_Impl : public ::osl::Thread
 {
 static ::osl::Mutex*pDirMutex;
 
-SvStringsDtor   aPickList;
-SvStringsDtor*  pCompletions;
-SvStringsDtor*  pURLs;
+std::vectorrtl::OUString  aPickList;
+std::vectorrtl::OUString  aCompletions;
+std::vectorrtl::OUString  aURLs;
 svtools::AsynchronLink  aLink;
 String  aBaseURL;
 String  aText;
@@ -124,7 +118,7 @@ class SvtMatchContext_Impl : public ::osl::Thread
 virtual void SAL_CALL   Cancel();
 voidInsert( const String rCompletion, const 
String rURL, sal_Bool bForce = sal_False);
 voidReadFolder( const String rURL, const 
String rMatch, sal_Bool bSmart );
-voidFillPicklist( SvStringsDtor rPickList );
+voidFillPicklist(std::vectorrtl::OUString 
rPickList);
 
 public:
 static ::osl::Mutex*   GetMutex();
@@ -144,7 +138,6 @@ public:
 return pDirMutex;
 }
 
-//-
 SvtMatchContext_Impl::SvtMatchContext_Impl(
 SvtURLBox* pBoxP, const String rText )
 : aLink( STATIC_LINK( this, SvtMatchContext_Impl, Select_Impl ) )
@@ -155,9 +148,6 @@ SvtMatchContext_Impl::SvtMatchContext_Impl(
 , bOnlyDirectories( pBoxP-bOnlyDirectories )
 , bNoSelection( pBoxP-bNoSelection )
 {
-pURLs = new SvStringsDtor;
-pCompletions = new SvStringsDtor;
-
 aLink.CreateMutex();
 
 FillPicklist( aPickList );
@@ -165,16 +155,12 @@ SvtMatchContext_Impl::SvtMatchContext_Impl(
 create();
 }
 
-//-
 SvtMatchContext_Impl::~SvtMatchContext_Impl()
 {
 aLink.ClearPendingCall();
-delete pURLs;
-delete pCompletions;
 }
 
-//-
-void SvtMatchContext_Impl::FillPicklist( SvStringsDtor rPickList )
+void SvtMatchContext_Impl::FillPicklist(std::vectorrtl::OUString rPickList)
 {
 // Einlesung der Historypickliste
 Sequence Sequence PropertyValue   seqPicklist = 
SvtHistoryOptions().GetList( eHISTORY );
@@ -195,22 +181,19 @@ void SvtMatchContext_Impl::FillPicklist( SvStringsDtor 
rPickList )
 {
 seqPropertySet[nProperty].Value = sTitle;
 aURL.SetURL( sTitle );
-const StringPtr pStr = new String( aURL.GetMainURL( 
INetURLObject::DECODE_WITH_CHARSET ) );
-rPickList.Insert( pStr, (sal_uInt16) nItem );
+rPickList.insert(rPickList.begin() + nItem, 
aURL.GetMainURL(INetURLObject::DECODE_WITH_CHARSET));
 break;
 }
 }
 }
 }
 
-//-
 void SAL_CALL SvtMatchContext_Impl::Cancel()
 {
 // Cancel button pressed
 terminate();
 }
 
-//-
 void SvtMatchContext_Impl::Stop()
 {
 bStop = sal_True;
@@ -219,7 +202,6 @@ void SvtMatchContext_Impl::Stop()
 terminate();
 }
 
-//-
 void 

[Libreoffice-commits] .: svtools/source

2011-12-19 Thread Caolán McNamara
 svtools/source/filter/filter.cxx |   36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 71b63586c5fe33fdf836ecb417d11f9c2d4e4b72
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Dec 19 14:48:43 2011 +

Resolves: fdo#43082 can't claim its not a DXF just because didn't see 
SECTION

typedetection doesn't know about 999 COMMENT, it should really.

diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx
index ef07514..f61990b 100644
--- a/svtools/source/filter/filter.cxx
+++ b/svtools/source/filter/filter.cxx
@@ -497,36 +497,36 @@ static sal_Bool ImpPeekGraphicFormat( SvStream rStream, 
String rFormatExtensio
 //--- DXF 
 if( !bTest || ( rFormatExtension.CompareToAscii( DXF, 3 ) == 
COMPARE_EQUAL ) )
 {
-bSomethingTested=sal_True;
+//Binary DXF File Format
+if( strncmp( (const char*) sFirstBytes, AutoCAD Binary DXF, 18 ) == 
0 )
+{
+rFormatExtension = UniString::CreateFromAscii( DXF, 3 );
+return sal_True;
+}
 
+//ASCII DXF File Format
 i=0;
 while (i256  sFirstBytes[i]=32)
-i++;
+++i;
 
-if (i256)
+if (i256  sFirstBytes[i]=='0')
 {
-if( sFirstBytes[i]=='0' )
-i++;
-else
-i=256;
-}
-while( i256  sFirstBytes[i]=32 )
-i++;
+++i;
 
-if (i+7256)
-{
-if (strncmp((char*)(sFirstBytes+i),SECTION,7)==0)
+//only now do we have sufficient data to make a judgement
+//based on a '0' + 'SECTION' == DXF argument
+bSomethingTested=sal_True;
+
+while( i256  sFirstBytes[i]=32 )
+++i;
+
+if (i+7256  (strncmp((const 
char*)(sFirstBytes+i),SECTION,7)==0))
 {
 rFormatExtension = UniString::CreateFromAscii( DXF, 3 );
 return sal_True;
 }
 }
 
-if( strncmp( (char*) sFirstBytes, AutoCAD Binary DXF, 18 ) == 0 )
-{
-rFormatExtension = UniString::CreateFromAscii( DXF, 3 );
-return sal_True;
-}
 }
 
 //--- PCT 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source tools/inc tools/source

2011-12-19 Thread Thorsten Behrens
 svtools/source/filter/filter.cxx |1 
 tools/inc/tools/stream.hxx   |1 
 tools/source/generic/color.cxx   |  146 +-
 tools/source/generic/gen.cxx |  396 ---
 tools/source/generic/poly.cxx|   98 -
 5 files changed, 15 insertions(+), 627 deletions(-)

New commits:
commit 864bc59e66e92eabeef26222301607a7a5745bea
Author: Matteo Casalin matteo.casa...@poste.it
Date:   Sat Dec 17 11:18:58 2011 +0100

Removed COMPRESSMODE_FULL support from SvStream

diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx
index f61990b..8047b7b 100644
--- a/svtools/source/filter/filter.cxx
+++ b/svtools/source/filter/filter.cxx
@@ -2034,7 +2034,6 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic 
rGraphic, const String
 
 SvMemoryStream aMemStm( 65535, 65535 );
 
-aMemStm.SetCompressMode( COMPRESSMODE_FULL 
);
 ( (GDIMetaFile) aGraphic.GetGDIMetaFile() 
).Write( aMemStm );
 
 xActiveDataSource-setOutputStream( 
::com::sun::star::uno::Reference ::com::sun::star::io::XOutputStream (
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 1554776..66312b7 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -90,7 +90,6 @@ typedef sal_uInt16 StreamMode;
 #define NUMBERFORMAT_INT_BIGENDIAN  (sal_uInt16)0x
 #define NUMBERFORMAT_INT_LITTLEENDIAN   (sal_uInt16)0x
 
-#define COMPRESSMODE_FULL   (sal_uInt16)0x
 #define COMPRESSMODE_NONE   (sal_uInt16)0x
 #define COMPRESSMODE_ZBITMAP(sal_uInt16)0x0001
 #define COMPRESSMODE_NATIVE (sal_uInt16)0x0010
diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx
index 6ee5b0d..f06d3d1 100644
--- a/tools/source/generic/color.cxx
+++ b/tools/source/generic/color.cxx
@@ -296,88 +296,18 @@ SvStream operator( SvStream rIStream, Color rColor )
 DBG_ASSERTWARNING( rIStream.GetVersion(), Color:: - Solar-Version not 
set on rIStream );
 
 sal_uInt16  nColorName;
-sal_uInt16  nRed;
-sal_uInt16  nGreen;
-sal_uInt16  nBlue;
 
 rIStream  nColorName;
 
 if ( nColorName  COL_NAME_USER )
 {
-if ( rIStream.GetCompressMode() == COMPRESSMODE_FULL )
-{
-unsigned char   cAry[6];
-sal_uInt16  i = 0;
-
-nRed= 0;
-nGreen  = 0;
-nBlue   = 0;
-
-if ( nColorName  COL_RED_2B )
-i += 2;
-else if ( nColorName  COL_RED_1B )
-i++;
-if ( nColorName  COL_GREEN_2B )
-i += 2;
-else if ( nColorName  COL_GREEN_1B )
-i++;
-if ( nColorName  COL_BLUE_2B )
-i += 2;
-else if ( nColorName  COL_BLUE_1B )
-i++;
-
-rIStream.Read( cAry, i );
-i = 0;
-
-if ( nColorName  COL_RED_2B )
-{
-nRed = cAry[i];
-nRed = 8;
-i++;
-nRed |= cAry[i];
-i++;
-}
-else if ( nColorName  COL_RED_1B )
-{
-nRed = cAry[i];
-nRed = 8;
-i++;
-}
-if ( nColorName  COL_GREEN_2B )
-{
-nGreen = cAry[i];
-nGreen = 8;
-i++;
-nGreen |= cAry[i];
-i++;
-}
-else if ( nColorName  COL_GREEN_1B )
-{
-nGreen = cAry[i];
-nGreen = 8;
-i++;
-}
-if ( nColorName  COL_BLUE_2B )
-{
-nBlue = cAry[i];
-nBlue = 8;
-i++;
-nBlue |= cAry[i];
-i++;
-}
-else if ( nColorName  COL_BLUE_1B )
-{
-nBlue = cAry[i];
-nBlue = 8;
-i++;
-}
-}
-else
-{
-rIStream  nRed;
-rIStream  nGreen;
-rIStream  nBlue;
-}
+sal_uInt16 nRed;
+sal_uInt16 nGreen;
+sal_uInt16 nBlue;
+
+rIStream  nRed;
+rIStream  nGreen;
+rIStream  nBlue;
 
 rColor.mnColor = RGB_COLORDATA( nRed8, nGreen8, nBlue8 );
 }
@@ -441,64 +371,10 @@ SvStream operator( SvStream rOStream, const Color 
rColor )
 nGreen  = (nGreen8) + nGreen;
 nBlue   = (nBlue8) + nBlue;
 
-if ( rOStream.GetCompressMode() == COMPRESSMODE_FULL )
-{
-unsigned char   cAry[6];
-sal_uInt16  i = 0;
-
-if ( nRed  0x00FF )
-{
-nColorName |= COL_RED_2B;
-cAry[i] = (unsigned char)(nRed  0xFF);
-

[Libreoffice-commits] .: svtools/source

2011-12-17 Thread Matus Kukan
 svtools/source/graphic/graphic.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3744cd818383fd954125a6567856e92198792cf1
Author: Matúš Kukan matus.ku...@gmail.com
Date:   Sat Dec 17 13:29:50 2011 +0100

gcc-trunk: avoid confusion

diff --git a/svtools/source/graphic/graphic.hxx 
b/svtools/source/graphic/graphic.hxx
index 7b4f5e0..a1efca0 100644
--- a/svtools/source/graphic/graphic.hxx
+++ b/svtools/source/graphic/graphic.hxx
@@ -58,7 +58,7 @@ public:
 Graphic();
 ~Graphic() throw();
 
-using unographic::GraphicDescriptor::init;
+using ::unographic::GraphicDescriptor::init;
 void init( const ::Graphic rGraphic ) throw();
 
 static const ::Graphic* getImplementation( const 
::com::sun::star::uno::Reference ::com::sun::star::uno::XInterface  rxIFace 
) throw();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2011-12-14 Thread Michael Meeks
 svtools/source/filter/jpeg/jpeg.cxx |   37 
 1 file changed, 21 insertions(+), 16 deletions(-)

New commits:
commit fe40da4cb640819d869d1c925869bc87ede9bbfe
Author: Michael Meeks michael.me...@suse.com
Date:   Wed Dec 14 10:02:39 2011 +

Cleanup jpeg bitmap creation  loading code

diff --git a/svtools/source/filter/jpeg/jpeg.cxx 
b/svtools/source/filter/jpeg/jpeg.cxx
index 6a70340..3143264 100644
--- a/svtools/source/filter/jpeg/jpeg.cxx
+++ b/svtools/source/filter/jpeg/jpeg.cxx
@@ -328,17 +328,26 @@ JPEGReader::~JPEGReader()
 
 // 
 
-void* JPEGReader::CreateBitmap( void* pParam )
+void* JPEGReader::CreateBitmap( void* _pParam )
 {
-SizeaSize( ((JPEGCreateBitmapParam*)pParam)-nWidth,
-((JPEGCreateBitmapParam*)pParam)-nHeight );
-sal_BoolbGray = ((JPEGCreateBitmapParam*)pParam)-bGray != 0;
+JPEGCreateBitmapParam *pParam = (JPEGCreateBitmapParam *) _pParam;
+
+if (pParam-nWidth  SAL_MAX_INT32/8 || pParam-nHeight  SAL_MAX_INT32/8)
+return NULL; // avoid overflows later
+
+SizeaSize( pParam-nWidth, pParam-nHeight );
+sal_BoolbGray = pParam-bGray != 0;
 
 void* pBmpBuf = NULL;
 
 if( pAcc )
 aBmp.ReleaseAccess( pAcc );
 
+sal_uInt64 nSize = aSize.Width();
+nSize *= aSize.Height();
+if (nSize  SAL_MAX_INT32 / 24)
+return NULL;
+
 if( bGray )
 {
 BitmapPalette aGrayPal( 256 );
@@ -359,12 +368,11 @@ void* JPEGReader::CreateBitmap( void* pParam )
 unsigned long nUnit = ((JPEGCreateBitmapParam*)pParam)-density_unit;
 
 if( ( ( 1 == nUnit ) || ( 2 == nUnit ) ) 
-( (JPEGCreateBitmapParam*) pParam )-X_density 
-( (JPEGCreateBitmapParam*) pParam )-Y_density )
+pParam-X_density  pParam-Y_density )
 {
 Point   aEmptyPoint;
-FractionaFractX( 1, 
((JPEGCreateBitmapParam*)pParam)-X_density );
-FractionaFractY( 1, 
((JPEGCreateBitmapParam*)pParam)-Y_density );
+FractionaFractX( 1, pParam-X_density );
+FractionaFractY( 1, pParam-Y_density );
 MapMode aMapMode( nUnit == 1 ? MAP_INCH : MAP_CM, aEmptyPoint, 
aFractX, aFractY );
 SizeaPrefSize = OutputDevice::LogicToLogic( aSize, 
aMapMode, MAP_100TH_MM );
 
@@ -377,8 +385,6 @@ void* JPEGReader::CreateBitmap( void* pParam )
 
 if( pAcc )
 {
-long nAlignedWidth;
-
 const sal_uLong nFormat = pAcc-GetScanlineFormat();
 
 if(
@@ -387,16 +393,15 @@ void* JPEGReader::CreateBitmap( void* pParam )
   )
 {
 pBmpBuf = pAcc-GetBuffer();
-nAlignedWidth = pAcc-GetScanlineSize();
-((JPEGCreateBitmapParam*)pParam)-bTopDown = pAcc-IsTopDown();
+pParam-nAlignedWidth = pAcc-GetScanlineSize();
+pParam-bTopDown = pAcc-IsTopDown();
 }
 else
 {
-nAlignedWidth = AlignedWidth4Bytes( aSize.Width() * ( bGray ? 8 : 
24 ) );
-((JPEGCreateBitmapParam*)pParam)-bTopDown = sal_True;
-pBmpBuf = pBuffer = rtl_allocateMemory( nAlignedWidth * 
aSize.Height() );
+pParam-nAlignedWidth = AlignedWidth4Bytes( aSize.Width() * ( 
bGray ? 8 : 24 ) );
+pParam-bTopDown = sal_True;
+pBmpBuf = pBuffer = rtl_allocateMemory( pParam-nAlignedWidth * 
aSize.Height() );
 }
-((JPEGCreateBitmapParam*)pParam)-nAlignedWidth = nAlignedWidth;
 }
 
 return pBmpBuf;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2011-12-11 Thread Julien Nabet
 svtools/source/svhtml/htmlout.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit a1b970a10e00b34ab6d8608cb02247b8f0195573
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun Dec 11 13:07:04 2011 +0100

Remove ByteString

diff --git a/svtools/source/svhtml/htmlout.cxx 
b/svtools/source/svhtml/htmlout.cxx
index deb530b..cf3f746 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -885,9 +885,8 @@ SvStream HTMLOutFuncs::OutScript( SvStream rStrm,
 {
 // Wir schreiben das Modul mm ANSI-Zeichensatz, aber mit
 // System-Zeilenumbruechen raus.
-ByteString sSource(rtl::OUStringToOString(rSource, eDestEnc));
-sSource.ConvertLineEnd( GetSystemLineEnd() );
-rStrm  sSource.GetBuffer();
+rtl::OString sSource(rtl::OUStringToOString(rSource, eDestEnc));
+rStrm  sSource.getStr()  sNewLine;
 }
 rStrm  sNewLine;
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source sw/source

2011-10-25 Thread Thorsten Behrens
 svtools/source/filter/filter.cxx |   28 ++--
 sw/source/core/graphic/ndgrf.cxx |   10 +-
 2 files changed, 31 insertions(+), 7 deletions(-)

New commits:
commit c0913d78c258f7e49b52f45909b2cebbd9fb6103
Author: Thorsten Behrens tbehr...@suse.com
Date:   Tue Oct 25 21:02:03 2011 +0200

Fix fdo#41995 fallout - recognize .svg in odf containers

More code paths that needed fixing - Writer sports its own Graphic
loading implementation, so that had the need for the stream name
fwd-ing, too. The svg deep type detection was necessary for e.g. the
flat odf - which has inline svg without any filename.

diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx
index b10a4ab..ddab749 100644
--- a/svtools/source/filter/filter.cxx
+++ b/svtools/source/filter/filter.cxx
@@ -667,6 +667,30 @@ static sal_Bool ImpPeekGraphicFormat( SvStream rStream, 
String rFormatExtensio
 // just a simple test for the extension
 if( rFormatExtension.CompareToAscii( SVG, 3 ) == COMPARE_EQUAL )
 return sal_True;
+
+sal_uLong nSize = ( nStreamLen  1024 ) ? 1024 : nStreamLen;
+std::vectorsal_uInt8 aBuf(nSize);
+
+rStream.Seek( nStreamPos );
+rStream.Read( aBuf[0], nSize );
+
+// read the first 1024 bytes  check a few magic string
+// constants (heuristically)
+sal_Int8 aMagic1[] = {'', 's', 'v', 'g'};
+if( std::search(aBuf.begin(), aBuf.end(),
+aMagic1, aMagic1+SAL_N_ELEMENTS(aMagic1)) != 
aBuf.end() )
+{
+rFormatExtension = UniString::CreateFromAscii( SVG, 3 );
+return sal_True;
+}
+
+sal_Int8 aMagic2[] = {'D', 'O', 'C', 'T', 'Y', 'P', 'E', ' ', 's', 
'v', 'g'};
+if( std::search(aBuf.begin(), aBuf.end(),
+aMagic2, aMagic2+SAL_N_ELEMENTS(aMagic2)) != 
aBuf.end() )
+{
+rFormatExtension = UniString::CreateFromAscii( SVG, 3 );
+return sal_True;
+}
 }
 
 //--- TGA 
@@ -743,7 +767,7 @@ sal_uInt16 GraphicFilter::ImpTestOrFindFormat( const 
String rPath, SvStream rS
 else
 {
 String aTmpStr( pConfig-GetImportFormatExtension( rFormat ) );
-if( !ImpPeekGraphicFormat( rStream, aTmpStr, sal_True ) )
+if( !ImpPeekGraphicFormat( rStream, aTmpStr.ToUpperAscii(), sal_True ) 
)
 return GRFILTER_FORMATERROR;
 if ( pConfig-GetImportFormatExtension( rFormat 
).EqualsIgnoreCaseAscii( pcd ) )
 {
@@ -2180,7 +2204,7 @@ IMPL_LINK( GraphicFilter, FilterCallback, ConvertData*, 
pData )
 {
 // Import
 nFormat = GetImportFormatNumberForShortName( String( 
aShortName.GetBuffer(), RTL_TEXTENCODING_UTF8 ) );
-nRet = ImportGraphic( pData-maGraphic, String(), pData-mrStm ) 
== 0;
+nRet = ImportGraphic( pData-maGraphic, String(), pData-mrStm, 
nFormat ) == 0;
 }
 else if( aShortName.Len() )
 {
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index b407c9b..11d9555 100755
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -386,12 +386,11 @@ Size SwGrfNode::GetTwipSize() const
 sal_Bool SwGrfNode::ImportGraphic( SvStream rStrm )
 {
 Graphic aGraphic;
-if( !GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, String(), 
rStrm ) )
+const String aGraphicURL( aGrfObj.GetUserData() );
+if( !GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, 
aGraphicURL, rStrm ) )
 {
-const String aUserData( aGrfObj.GetUserData() );
-
 aGrfObj.SetGraphic( aGraphic );
-aGrfObj.SetUserData( aUserData );
+aGrfObj.SetUserData( aGraphicURL );
 return sal_True;
 }
 
@@ -879,7 +878,8 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const 
SwNodeIndex rIdx ) const
 SvStream* pStrm = _GetStreamForEmbedGrf( refPics, aStrmName );
 if ( pStrm )
 {
-GraphicFilter::GetGraphicFilter().ImportGraphic( aTmpGrf, 
String(), *pStrm );
+const String aGraphicURL( aGrfObj.GetUserData() );
+GraphicFilter::GetGraphicFilter().ImportGraphic( aTmpGrf, 
aGraphicURL, *pStrm );
 delete pStrm;
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2011-10-24 Thread Caolán McNamara
 svtools/source/misc/sampletext.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 21696eadc88f67b4900a580bcd90284b8f449e75
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Oct 24 11:06:01 2011 +0100

seperate words in hebrew text preview

diff --git a/svtools/source/misc/sampletext.cxx 
b/svtools/source/misc/sampletext.cxx
index e1b52c9..33a49c6 100644
--- a/svtools/source/misc/sampletext.cxx
+++ b/svtools/source/misc/sampletext.cxx
@@ -145,9 +145,9 @@ rtl::OUString 
makeShortRepresentativeTextForScript(UScriptCode eScript)
 case USCRIPT_HEBREW:
 {
 const sal_Unicode aHebr[] = {
-0x05D0, 0x05B8, 0x05DC, 0x05B6, 0x05E3, 0x05D1, 0x05B5, 0x05BC,
-0x05D9, 0x05EA, 0x0020, 0x05E2, 0x05B4, 0x05D1, 0x05B0, 0x05E8,
-0x05B4, 0x05D9
+0x05D0, 0x05B8, 0x05DC, 0x05B6, 0x05E3, 0x05BE, 0x05D1, 0x05B5,
+0x05BC, 0x05D9, 0x05EA, 0x0020, 0x05E2, 0x05B4, 0x05D1, 0x05B0,
+0x05E8, 0x05B4, 0x05D9
 };
 sSampleText = rtl::OUString(aHebr, SAL_N_ELEMENTS(aHebr));
 break;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2011-10-13 Thread Julien Nabet
 svtools/source/filter/jpeg/jpeg.cxx |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 93e971ac54e94ad58b4199e5d635133e738c28a1
Author: Julien Nabet serval2...@yahoo.fr
Date:   Thu Oct 13 22:18:00 2011 +0200

A cppcheck cleaning with some simplification

diff --git a/svtools/source/filter/jpeg/jpeg.cxx 
b/svtools/source/filter/jpeg/jpeg.cxx
index 14a6988..f72d9fb 100644
--- a/svtools/source/filter/jpeg/jpeg.cxx
+++ b/svtools/source/filter/jpeg/jpeg.cxx
@@ -193,7 +193,7 @@ extern C void init_source (j_decompress_ptr cinfo)
 
 long StreamRead( SvStream* pSvStm, void* pBuffer, long nBufferSize )
 {
-longnRead;
+longnRead = 0;
 
 if( pSvStm-GetError() != ERRCODE_IO_PENDING )
 {
@@ -203,8 +203,6 @@ long StreamRead( SvStream* pSvStm, void* pBuffer, long 
nBufferSize )
 
 if( pSvStm-GetError() == ERRCODE_IO_PENDING )
 {
-nRead = 0;
-
 // Damit wir wieder an die alte Position
 // seeken koennen, setzen wir den Error temp.zurueck
 pSvStm-ResetError();
@@ -212,8 +210,6 @@ long StreamRead( SvStream* pSvStm, void* pBuffer, long 
nBufferSize )
 pSvStm-SetError( ERRCODE_IO_PENDING );
 }
 }
-else
-nRead = 0;
 
 return nRead;
 }
@@ -225,7 +221,7 @@ extern C boolean fill_input_buffer (j_decompress_ptr 
cinfo)
 
   nbytes = StreamRead(src-infile, src-buffer, BUF_SIZE);
 
-  if (nbytes = 0) {
+  if (!nbytes) {
 if (src-start_of_file) /* Treat empty input file as fatal error */
   ERREXIT(cinfo, JERR_INPUT_EMPTY);
 WARNMS(cinfo, JWRN_JPEG_EOF);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2011-10-05 Thread Caolán McNamara
 svtools/source/filter/wmf/winmtf.hxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 03268fc84e1c3a0fb588ddff340b052f70c5100a
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Oct 5 14:01:15 2011 +0100

rejig this to remove self-assign

diff --git a/svtools/source/filter/wmf/winmtf.hxx 
b/svtools/source/filter/wmf/winmtf.hxx
index 693190c..a7c0b48 100644
--- a/svtools/source/filter/wmf/winmtf.hxx
+++ b/svtools/source/filter/wmf/winmtf.hxx
@@ -738,9 +738,9 @@ public:
 const Point rEndAngle
 );
 voidDrawPolygon( Polygon rPolygon, sal_Bool bRecordPath = 
sal_False );
-voidDrawPolygon( Polygon rPolygon, sal_Bool bDrawTo, 
sal_Bool bRecordPath)
-{ //only for the template compatibility
-bDrawTo = bDrawTo; //to avoid complaints about 
unused parameter
+voidDrawPolygon( Polygon rPolygon, sal_Bool /*bDrawTo*/, 
sal_Bool bRecordPath)
+{
+//For ReadAndDrawPolygon template compatibility
 DrawPolygon(rPolygon, bRecordPath);
 }
 voidDrawPolyPolygon( PolyPolygon rPolyPolygon, sal_Bool 
bRecordPath = sal_False );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2011-09-27 Thread Caolán McNamara
 svtools/source/filter/wmf/enhwmf.cxx |  136 +--
 svtools/source/filter/wmf/winmtf.hxx |3 
 2 files changed, 55 insertions(+), 84 deletions(-)

New commits:
commit f6a34255af1339cd7132b7527dc0c10c10d38249
Author: Marc-Andre Laverdiere marc-an...@atc.tcs.com
Date:   Mon Sep 19 17:27:50 2011 +0530

Minor refactoring on WMF loading

diff --git a/svtools/source/filter/wmf/enhwmf.cxx 
b/svtools/source/filter/wmf/enhwmf.cxx
index 10fa8f3..618f13d 100644
--- a/svtools/source/filter/wmf/enhwmf.cxx
+++ b/svtools/source/filter/wmf/enhwmf.cxx
@@ -351,14 +351,14 @@ void EnhWMFReader::ReadGDIComment()
  * pWMF: the stream containings the polygons
  * */
 template class T
-Polygon WMFReadPolygon(sal_uInt16 nStartIndex, sal_uInt16 nPoints, SvStream 
rWMF)
+Polygon EnhWMFReader::ReadPolygon(sal_uInt16 nStartIndex, sal_uInt16 nPoints)
 {
 Polygon aPolygon(nPoints);
-for (sal_uInt16 i = nStartIndex ; i  nPoints  rWMF.good(); i++ )
+for (sal_uInt16 i = nStartIndex ; i  nPoints  pWMF-good(); i++ )
 {
 T nX, nY;
-rWMF  nX  nY;
-if (!rWMF.good())
+*pWMF  nX  nY;
+if (pWMF-good())
 break;
 aPolygon[ i ] = Point( nX, nY );
 }
@@ -366,6 +366,44 @@ Polygon WMFReadPolygon(sal_uInt16 nStartIndex, sal_uInt16 
nPoints, SvStream rWM
 return aPolygon;
 }
 
+template class T
+void EnhWMFReader::ReadAndDrawPolyPolygon()
+{
+sal_uInt32  i, nPoly, nGesPoints, nPoints;
+pWMF-SeekRel( 0x10 );
+// Number of polygons
+*pWMF  nPoly  nGesPoints;
+if ( pWMF-good() 
+( nGesPoints  SAL_MAX_UINT32 / sizeof(Point) )  //check against 
numeric overflowing
+( nPoly  SAL_MAX_UINT32 / sizeof(sal_uInt16) ) 
+( (  nPoly * sizeof( sal_uInt16 ) ) = ( nEndPos - pWMF-Tell() ) ))
+{
+//Get number of points in each polygon
+sal_uInt16 * pnPoints = new sal_uInt16[ nPoly ];
+for ( i = 0; i  nPoly  pWMF-good(); i++ )
+{
+*pWMF  nPoints;
+pnPoints[ i ] = (sal_uInt16)nPoints;
+} //end for
+if ( pWMF-good()  ( nGesPoints * (sizeof(T)+sizeof(T)) ) = ( 
nEndPos - pWMF-Tell() ) )
+{
+// Get polygon points
+Point * pPtAry  = new Point[ nGesPoints ];
+for ( i = 0; i  nGesPoints  pWMF-good(); i++ )
+{
+T nX, nY;
+*pWMF  nX  nY;
+pPtAry[ i ] = Point( nX, nY );
+} //end for
+// Create PolyPolygon Actions
+PolyPolygon aPolyPoly( (sal_uInt16)nPoly, pnPoints, pPtAry );
+pOut-DrawPolyPolygon( aPolyPoly, bRecordPath );
+delete[] pPtAry;
+} //end if
+delete[] pnPoints;
+} //end if
+}
+
 sal_Bool EnhWMFReader::ReadEnhWMF()
 {
 sal_uInt32  nStretchBltMode = 0;
@@ -452,7 +490,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
 i++;
 nPoints++;
 }
-Polygon aPoly = WMFReadPolygonsal_Int32(i, nPoints, *pWMF);
+Polygon aPoly = ReadPolygonsal_Int32(i, nPoints);
 pOut-DrawPolyBezier( aPoly, bFlag, bRecordPath );
 }
 break;
@@ -461,7 +499,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
 {
 pWMF-SeekRel( 16 );
 *pWMF  nPoints;
-Polygon aPoly = WMFReadPolygonsal_Int32(0, nPoints, *pWMF);
+Polygon aPoly = ReadPolygonsal_Int32(0, nPoints);
 pOut-DrawPolygon( aPoly, bRecordPath );
 }
 break;
@@ -478,7 +516,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
 i++;
 nPoints++;
 }
-Polygon aPolygon = WMFReadPolygonsal_Int32(i, nPoints, 
*pWMF);
+Polygon aPolygon = ReadPolygonsal_Int32(i, nPoints);
 pOut-DrawPolyLine( aPolygon, bFlag, bRecordPath );
 }
 break;
@@ -523,42 +561,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
 
 case EMR_POLYPOLYGON :
 {
-sal_uInt32  i, nPoly, nGesPoints;
-pWMF-SeekRel( 0x10 );
-
-// Number of polygons:
-*pWMF  nPoly  nGesPoints;
-
-if ( ( nGesPoints  SAL_MAX_UINT32 / sizeof(Point) )  ( 
nPoly  SAL_MAX_UINT32 / sizeof(sal_uInt16) ) )
-{
-if ( ( nPoly * sizeof(sal_uInt16) ) = ( nEndPos - 
pWMF-Tell() ) )
-{
-sal_uInt16* pnPoints = new sal_uInt16[ nPoly ];
-
-for ( i = 0; i  nPoly; i++ )
-{
-*pWMF  nPoints;
-pnPoints[ i ] = (sal_uInt16)nPoints;
-}
-
-if ( ( nGesPoints * 
(sizeof(sal_uInt32)+sizeof(sal_uInt32)) ) = ( nEndPos - pWMF-Tell() ) )
-{
-