Kaydet (Commit) ad930bdd authored tarafından Stephan Bergmann's avatar Stephan Bergmann

bool improvements

Change-Id: I171212bbfc2f54a16b5669ab4401a3168e7f0552
üst 0f50845d
...@@ -176,7 +176,7 @@ void BinaryCodec_XOR::initKey( const sal_uInt8 pnPassData[ 16 ] ) ...@@ -176,7 +176,7 @@ void BinaryCodec_XOR::initKey( const sal_uInt8 pnPassData[ 16 ] )
bool BinaryCodec_XOR::initCodec( const uno::Sequence< beans::NamedValue >& aData ) bool BinaryCodec_XOR::initCodec( const uno::Sequence< beans::NamedValue >& aData )
{ {
bool bResult = sal_False; bool bResult = false;
::comphelper::SequenceAsHashMap aHashData( aData ); ::comphelper::SequenceAsHashMap aHashData( aData );
uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault("XOR95EncryptionKey", uno::Sequence< sal_Int8 >() ); uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault("XOR95EncryptionKey", uno::Sequence< sal_Int8 >() );
...@@ -184,7 +184,7 @@ bool BinaryCodec_XOR::initCodec( const uno::Sequence< beans::NamedValue >& aData ...@@ -184,7 +184,7 @@ bool BinaryCodec_XOR::initCodec( const uno::Sequence< beans::NamedValue >& aData
if ( aKey.getLength() == 16 ) if ( aKey.getLength() == 16 )
{ {
(void)memcpy( mpnKey, aKey.getConstArray(), 16 ); (void)memcpy( mpnKey, aKey.getConstArray(), 16 );
bResult = sal_True; bResult = true;
mnBaseKey = (sal_uInt16)aHashData.getUnpackedValueOrDefault("XOR95BaseKey", (sal_Int16)0 ); mnBaseKey = (sal_uInt16)aHashData.getUnpackedValueOrDefault("XOR95BaseKey", (sal_Int16)0 );
mnHash = (sal_uInt16)aHashData.getUnpackedValueOrDefault("XOR95PasswordHash", (sal_Int16)0 ); mnHash = (sal_uInt16)aHashData.getUnpackedValueOrDefault("XOR95PasswordHash", (sal_Int16)0 );
...@@ -283,7 +283,7 @@ BinaryCodec_RCF::~BinaryCodec_RCF() ...@@ -283,7 +283,7 @@ BinaryCodec_RCF::~BinaryCodec_RCF()
bool BinaryCodec_RCF::initCodec( const uno::Sequence< beans::NamedValue >& aData ) bool BinaryCodec_RCF::initCodec( const uno::Sequence< beans::NamedValue >& aData )
{ {
bool bResult = sal_False; bool bResult = false;
::comphelper::SequenceAsHashMap aHashData( aData ); ::comphelper::SequenceAsHashMap aHashData( aData );
uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault("STD97EncryptionKey", uno::Sequence< sal_Int8 >() ); uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault("STD97EncryptionKey", uno::Sequence< sal_Int8 >() );
...@@ -295,7 +295,7 @@ bool BinaryCodec_RCF::initCodec( const uno::Sequence< beans::NamedValue >& aData ...@@ -295,7 +295,7 @@ bool BinaryCodec_RCF::initCodec( const uno::Sequence< beans::NamedValue >& aData
if ( aUniqueID.getLength() == 16 ) if ( aUniqueID.getLength() == 16 )
{ {
(void)memcpy( mpnUnique, aUniqueID.getConstArray(), 16 ); (void)memcpy( mpnUnique, aUniqueID.getConstArray(), 16 );
bResult = sal_False; bResult = false;
} }
else else
OSL_FAIL( "Unexpected document ID!\n" ); OSL_FAIL( "Unexpected document ID!\n" );
......
...@@ -979,8 +979,8 @@ Path2DContext::Path2DContext( ContextHandler2Helper& rParent, const AttributeLis ...@@ -979,8 +979,8 @@ Path2DContext::Path2DContext( ContextHandler2Helper& rParent, const AttributeLis
rPath2D.w = rAttribs.getString( XML_w, aEmptyString ).toInt64(); rPath2D.w = rAttribs.getString( XML_w, aEmptyString ).toInt64();
rPath2D.h = rAttribs.getString( XML_h, aEmptyString ).toInt64(); rPath2D.h = rAttribs.getString( XML_h, aEmptyString ).toInt64();
rPath2D.fill = rAttribs.getToken( XML_fill, XML_norm ); rPath2D.fill = rAttribs.getToken( XML_fill, XML_norm );
rPath2D.stroke = rAttribs.getBool( XML_stroke, sal_True ); rPath2D.stroke = rAttribs.getBool( XML_stroke, true );
rPath2D.extrusionOk = rAttribs.getBool( XML_extrusionOk, sal_True ); rPath2D.extrusionOk = rAttribs.getBool( XML_extrusionOk, true );
} }
Path2DContext::~Path2DContext() Path2DContext::~Path2DContext()
......
...@@ -39,8 +39,8 @@ TableCellContext::TableCellContext( ContextHandler2Helper& rParent, const Attrib ...@@ -39,8 +39,8 @@ TableCellContext::TableCellContext( ContextHandler2Helper& rParent, const Attrib
if ( rAttribs.hasAttribute( XML_gridSpan ) ) if ( rAttribs.hasAttribute( XML_gridSpan ) )
mrTableCell.setGridSpan( rAttribs.getString( XML_gridSpan ).get().toInt32() ); mrTableCell.setGridSpan( rAttribs.getString( XML_gridSpan ).get().toInt32() );
mrTableCell.sethMerge( rAttribs.getBool( XML_hMerge, sal_False ) ); mrTableCell.sethMerge( rAttribs.getBool( XML_hMerge, false ) );
mrTableCell.setvMerge( rAttribs.getBool( XML_vMerge, sal_False ) ); mrTableCell.setvMerge( rAttribs.getBool( XML_vMerge, false ) );
} }
TableCellContext::~TableCellContext() TableCellContext::~TableCellContext()
...@@ -67,7 +67,7 @@ TableCellContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeLis ...@@ -67,7 +67,7 @@ TableCellContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeLis
mrTableCell.setBottomMargin( rAttribs.getInteger( XML_marB, 45720 ) ); mrTableCell.setBottomMargin( rAttribs.getInteger( XML_marB, 45720 ) );
mrTableCell.setVertToken( rAttribs.getToken( XML_vert, XML_horz ) ); // ST_TextVerticalType mrTableCell.setVertToken( rAttribs.getToken( XML_vert, XML_horz ) ); // ST_TextVerticalType
mrTableCell.setAnchorToken( rAttribs.getToken( XML_anchor, XML_t ) ); // ST_TextAnchoringType mrTableCell.setAnchorToken( rAttribs.getToken( XML_anchor, XML_t ) ); // ST_TextAnchoringType
mrTableCell.setAnchorCtr( rAttribs.getBool( XML_anchorCtr, sal_False ) ); mrTableCell.setAnchorCtr( rAttribs.getBool( XML_anchorCtr, false ) );
mrTableCell.setHorzOverflowToken( rAttribs.getToken( XML_horzOverflow, XML_clip ) ); // ST_TextHorzOverflowType mrTableCell.setHorzOverflowToken( rAttribs.getToken( XML_horzOverflow, XML_clip ) ); // ST_TextHorzOverflowType
} }
break; break;
......
...@@ -48,13 +48,13 @@ TableContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& r ...@@ -48,13 +48,13 @@ TableContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& r
{ {
case A_TOKEN( tblPr ): // CT_TableProperties case A_TOKEN( tblPr ): // CT_TableProperties
{ {
mrTableProperties.isRtl() = rAttribs.getBool( XML_rtl, sal_False ); mrTableProperties.isRtl() = rAttribs.getBool( XML_rtl, false );
mrTableProperties.isFirstRow() = rAttribs.getBool( XML_firstRow, sal_False ); mrTableProperties.isFirstRow() = rAttribs.getBool( XML_firstRow, false );
mrTableProperties.isFirstCol() = rAttribs.getBool( XML_firstCol, sal_False ); mrTableProperties.isFirstCol() = rAttribs.getBool( XML_firstCol, false );
mrTableProperties.isLastRow() = rAttribs.getBool( XML_lastRow, sal_False ); mrTableProperties.isLastRow() = rAttribs.getBool( XML_lastRow, false );
mrTableProperties.isLastCol() = rAttribs.getBool( XML_lastCol, sal_False ); mrTableProperties.isLastCol() = rAttribs.getBool( XML_lastCol, false );
mrTableProperties.isBandRow() = rAttribs.getBool( XML_bandRow, sal_False ); mrTableProperties.isBandRow() = rAttribs.getBool( XML_bandRow, false );
mrTableProperties.isBandCol() = rAttribs.getBool( XML_bandCol, sal_False ); mrTableProperties.isBandCol() = rAttribs.getBool( XML_bandCol, false );
} }
break; break;
case A_TOKEN( tableStyle ): // CT_TableStyle case A_TOKEN( tableStyle ): // CT_TableStyle
......
...@@ -42,7 +42,7 @@ Transform2DContext::Transform2DContext( ContextHandler2Helper& rParent, const At ...@@ -42,7 +42,7 @@ Transform2DContext::Transform2DContext( ContextHandler2Helper& rParent, const At
if( !btxXfrm ) if( !btxXfrm )
{ {
mrShape.setRotation( rAttribs.getInteger( XML_rot, 0 ) ); // 60000ths of a degree Positive angles are clockwise; negative angles are counter-clockwise mrShape.setRotation( rAttribs.getInteger( XML_rot, 0 ) ); // 60000ths of a degree Positive angles are clockwise; negative angles are counter-clockwise
mrShape.setFlip( rAttribs.getBool( XML_flipH, sal_False ), rAttribs.getBool( XML_flipV, sal_False ) ); mrShape.setFlip( rAttribs.getBool( XML_flipH, false ), rAttribs.getBool( XML_flipV, false ) );
} }
else else
{ {
......
...@@ -2629,7 +2629,7 @@ HtmlSelectModel::importBinaryModel( BinaryInputStream& rInStrm ) ...@@ -2629,7 +2629,7 @@ HtmlSelectModel::importBinaryModel( BinaryInputStream& rInStrm )
for( std::vector< sal_Int16 >::iterator it = selectedIndices.begin(); it != selectedIndices.end(); ++it, ++index ) for( std::vector< sal_Int16 >::iterator it = selectedIndices.begin(); it != selectedIndices.end(); ++it, ++index )
msIndices[ index ] = *it; msIndices[ index ] = *it;
} }
return sal_True; return true;
} }
......
...@@ -32,19 +32,19 @@ namespace oox { namespace ppt { ...@@ -32,19 +32,19 @@ namespace oox { namespace ppt {
{ {
if ( rAttribs.hasAttribute( XML_sldNum ) ) if ( rAttribs.hasAttribute( XML_sldNum ) )
{ {
rHeaderFooter.mbSlideNumber = rAttribs.getBool( XML_sldNum, sal_True ); rHeaderFooter.mbSlideNumber = rAttribs.getBool( XML_sldNum, true );
} }
if ( rAttribs.hasAttribute( XML_hdr ) ) if ( rAttribs.hasAttribute( XML_hdr ) )
{ {
rHeaderFooter.mbHeader = rAttribs.getBool( XML_hdr, sal_True ); rHeaderFooter.mbHeader = rAttribs.getBool( XML_hdr, true );
} }
if ( rAttribs.hasAttribute( XML_ftr ) ) if ( rAttribs.hasAttribute( XML_ftr ) )
{ {
rHeaderFooter.mbFooter = rAttribs.getBool( XML_ftr, sal_True ); rHeaderFooter.mbFooter = rAttribs.getBool( XML_ftr, true );
} }
if ( rAttribs.hasAttribute( XML_dt ) ) if ( rAttribs.hasAttribute( XML_dt ) )
{ {
rHeaderFooter.mbDateTime = rAttribs.getBool( XML_dt, sal_True ); rHeaderFooter.mbDateTime = rAttribs.getBool( XML_dt, true );
} }
} }
......
...@@ -78,7 +78,7 @@ SlideFragmentHandler::~SlideFragmentHandler() throw() ...@@ -78,7 +78,7 @@ SlideFragmentHandler::~SlideFragmentHandler() throw()
PropertyMap aPropMap; PropertyMap aPropMap;
PropertySet aSlideProp( xSlide ); PropertySet aSlideProp( xSlide );
aPropMap[ PROP_Visible ] = Any( rAttribs.getBool( XML_show, sal_True ) ); aPropMap[ PROP_Visible ] = Any( rAttribs.getBool( XML_show, true ) );
aSlideProp.setProperties( aPropMap ); aSlideProp.setProperties( aPropMap );
return this; return this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment