diff options
author | Noel Grandin <noel@peralex.com> | 2016-06-23 13:13:28 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-24 10:51:45 +0000 |
commit | 920d4463f6e59b815852c173e2974ffc7b4bb284 (patch) | |
tree | ac56efa2d79ad622f261e8664a57afa7c7ea0e49 /vcl | |
parent | 2b7109a12ab772bf53766d6e06b422c8e687d482 (diff) |
loplugin:singlevalfields in vcl(part1)
Change-Id: I0031199937cc95793951a070c4b3d8910933e69f
Reviewed-on: https://gerrit.libreoffice.org/26595
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl')
27 files changed, 138 insertions, 332 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 3c53cbbd7e32..b9d2432579ba 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -644,7 +644,6 @@ void PushButton::ImplInitPushButtonData() mnDDStyle = PushButtonDropdownStyle::NONE; mbIsActive = false; mbPressed = false; - mbInUserDraw = false; } namespace diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index f8f4b7d9104f..64adaccbe9d5 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -342,13 +342,7 @@ IMPL_LINK_NOARG_TYPED(ComboBox::Impl, ImplPopupModeEndHdl, FloatingWindow*, void IMPL_LINK_TYPED(ComboBox::Impl, ImplAutocompleteHdl, Edit&, rEdit, void) { Selection aSel = rEdit.GetSelection(); - AutocompleteAction eAction = rEdit.GetAutocompleteAction(); - /* If there is no current selection do not auto complete on - Tab/Shift-Tab since then we would not cycle to the next field. - */ - if ( aSel.Len() || - ((eAction != AutocompleteAction::TabForward) && (eAction != AutocompleteAction::TabBackward)) ) { OUString aFullText = rEdit.GetText(); OUString aStartText = aFullText.copy( 0, (sal_Int32)aSel.Max() ); @@ -358,16 +352,6 @@ IMPL_LINK_TYPED(ComboBox::Impl, ImplAutocompleteHdl, Edit&, rEdit, void) nStart = 0; bool bForward = true; - if ( eAction == AutocompleteAction::TabForward ) - nStart++; - else if ( eAction == AutocompleteAction::TabBackward ) - { - bForward = false; - if (nStart) - nStart = nStart - 1; - else if (m_pImplLB->GetEntryList()->GetEntryCount()) - nStart = m_pImplLB->GetEntryList()->GetEntryCount()-1; - } sal_Int32 nPos = LISTBOX_ENTRY_NOTFOUND; if (!m_isMatchCase) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index f1bb069fd4f3..0e267cd9665e 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -296,7 +296,6 @@ void Edit::ImplInitEditData() mnMaxTextLen = EDIT_NOLIMIT; mnWidthInChars = -1; mnMaxWidthChars = -1; - meAutocompleteAction = AutocompleteAction::KeyInput; mbModified = false; mbInternModified = false; mbReadOnly = false; @@ -1642,7 +1641,6 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt ) { if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.getLength()) ) { - meAutocompleteAction = AutocompleteAction::KeyInput; maAutocompleteHdl.Call(*this); } } @@ -1704,32 +1702,6 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt ) } break; - /* #i101255# disable autocomplete tab forward/backward - users expect tab/shift-tab to move the focus to other controls - not suddenly to cycle the autocompletion - case KEY_TAB: - { - if ( !mbReadOnly && !autocompleteSignal.empty() && - maSelection.Min() && (maSelection.Min() == maText.Len()) && - !rKEvt.GetKeyCode().IsMod1() && !rKEvt.GetKeyCode().IsMod2() ) - { - // Kein Autocomplete wenn alles Selektiert oder Edit leer, weil dann - // keine vernuenftige Tab-Steuerung! - if ( rKEvt.GetKeyCode().IsShift() ) - meAutocompleteAction = AutocompleteAction::TabBackward; - else - meAutocompleteAction = AutocompleteAction::TabForward; - - autocompleteSignal( this ); - - // Wurde nichts veraendert, dann TAB fuer DialogControl - if ( GetSelection().Len() ) - bDone = true; - } - } - break; - */ - default: { if ( IsCharInput( rKEvt ) ) @@ -1742,7 +1714,6 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt ) { if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.getLength()) ) { - meAutocompleteAction = AutocompleteAction::KeyInput; maAutocompleteHdl.Call(*this); } } @@ -2100,7 +2071,6 @@ void Edit::Command( const CommandEvent& rCEvt ) { if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.getLength()) ) { - meAutocompleteAction = AutocompleteAction::KeyInput; maAutocompleteHdl.Call(*this); } } diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 3b2c020f457e..03debfb9f1ef 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -505,7 +505,6 @@ void NumericFormatter::ImplInit() mnLastValue = 0; mnMin = 0; mnMax = SAL_MAX_INT64; - mnCorrectedValue = 0; mnDecimalDigits = 2; mnType = FORMAT_NUMERIC; mbThousandSep = true; @@ -1596,7 +1595,7 @@ void MetricFormatter::Reformat() sal_Int64 MetricFormatter::GetCorrectedValue( FieldUnit eOutUnit ) const { // convert to requested units - return MetricField::ConvertValue( mnCorrectedValue, mnBaseValue, GetDecimalDigits(), + return MetricField::ConvertValue( 0/*nCorrectedValue*/, mnBaseValue, GetDecimalDigits(), meUnit, eOutUnit ); } diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 1f17e7569168..7f0e9a8e1135 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -767,7 +767,6 @@ void PatternFormatter::ImplSetMask(const OString& rEditMask, const OUString& rLi PatternFormatter::PatternFormatter() { - mnFormatFlags = 0; mbSameMask = true; mbInPattKeyInput = false; } @@ -798,14 +797,14 @@ OUString PatternFormatter::GetString() const if ( !GetField() ) return OUString(); else - return ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, mnFormatFlags ); + return ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, 0/*nFormatFlags*/ ); } void PatternFormatter::Reformat() { if ( GetField() ) { - ImplSetText( ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, mnFormatFlags ) ); + ImplSetText( ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, 0/*nFormatFlags*/ ) ); if ( !mbSameMask && IsStrictFormat() && !GetField()->IsReadOnly() ) GetField()->SetInsertMode( false ); } @@ -829,7 +828,7 @@ bool PatternField::PreNotify( NotifyEvent& rNEvt ) if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) { if ( ImplPatternProcessKeyInput( GetField(), *rNEvt.GetKeyEvent(), GetEditMask(), GetLiteralMask(), - IsStrictFormat(), GetFormatFlags(), + IsStrictFormat(), 0/*nFormatFlags*/, ImplIsSameMask(), ImplGetInPattKeyInput() ) ) return true; } @@ -855,7 +854,7 @@ void PatternField::Modify() if ( !ImplGetInPattKeyInput() ) { if ( IsStrictFormat() ) - ImplPatternProcessStrictModify( GetField(), GetEditMask(), GetLiteralMask(), GetFormatFlags(), ImplIsSameMask() ); + ImplPatternProcessStrictModify( GetField(), GetEditMask(), GetLiteralMask(), 0/*nFormatFlags*/, ImplIsSameMask() ); else MarkToBeReformatted( true ); } @@ -881,7 +880,7 @@ bool PatternBox::PreNotify( NotifyEvent& rNEvt ) if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) { if ( ImplPatternProcessKeyInput( GetField(), *rNEvt.GetKeyEvent(), GetEditMask(), GetLiteralMask(), - IsStrictFormat(), GetFormatFlags(), + IsStrictFormat(), 0/*nFormatFlags*/, ImplIsSameMask(), ImplGetInPattKeyInput() ) ) return true; } @@ -907,7 +906,7 @@ void PatternBox::Modify() if ( !ImplGetInPattKeyInput() ) { if ( IsStrictFormat() ) - ImplPatternProcessStrictModify( GetField(), GetEditMask(), GetLiteralMask(), GetFormatFlags(), ImplIsSameMask() ); + ImplPatternProcessStrictModify( GetField(), GetEditMask(), GetLiteralMask(), 0/*nFormatFlags*/, ImplIsSameMask() ); else MarkToBeReformatted( true ); } @@ -922,7 +921,7 @@ void PatternBox::ReformatAll() const sal_Int32 nEntryCount = GetEntryCount(); for ( sal_Int32 i=0; i < nEntryCount; ++i ) { - aStr = ImplPatternReformat( GetEntry( i ), GetEditMask(), GetLiteralMask(), GetFormatFlags() ); + aStr = ImplPatternReformat( GetEntry( i ), GetEditMask(), GetLiteralMask(), 0/*nFormatFlags*/ ); RemoveEntryAt(i); InsertEntry( aStr, i ); } diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index 98532d8c4771..36860e48ce8f 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -842,7 +842,6 @@ void FixedBitmap::SetBitmap( const Bitmap& rBitmap ) void FixedImage::ImplInit( vcl::Window* pParent, WinBits nStyle ) { nStyle = ImplInitStyle( nStyle ); - mbInUserDraw = false; Control::ImplInit( pParent, nStyle, nullptr ); ApplySettings(*this); } diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx index 2c529d6bf7fa..03b9e481bbc5 100644 --- a/vcl/source/control/morebtn.cxx +++ b/vcl/source/control/morebtn.cxx @@ -32,7 +32,6 @@ struct ImplMoreButtonData void MoreButton::ImplInit( vcl::Window* pParent, WinBits nStyle ) { mpMBData = new ImplMoreButtonData; - mnDelta = 0; meUnit = MAP_PIXEL; mbState = false; @@ -92,7 +91,7 @@ void MoreButton::Click() { vcl::Window* pParent = GetParent(); Size aSize( pParent->GetSizePixel() ); - long nDeltaPixel = LogicToPixel( Size( 0, mnDelta ), meUnit ).Height(); + long nDeltaPixel = LogicToPixel( Size( 0, 0 ), meUnit ).Height(); // Change status mbState = !mbState; diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index f1af390714d8..b4abe08a4de9 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -90,7 +90,6 @@ void ScrollBar::ImplInit( vcl::Window* pParent, WinBits nStyle ) mnDragDraw = 0; mnStateFlags = 0; meScrollType = SCROLL_DONTKNOW; - meDDScrollType = SCROLL_DONTKNOW; mbCalcSize = true; mbFullDrag = false; diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index 6048d70b543e..96e31060742c 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -55,7 +55,6 @@ void Slider::ImplInit( vcl::Window* pParent, WinBits nStyle ) mnLineSize = 1; mnPageSize = 1; mnDelta = 0; - mnDragDraw = 0; mnStateFlags = 0; meScrollType = SCROLL_DONTKNOW; mbCalcSize = true; diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 5fb6ddfd2688..491a2a06cfe1 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -88,7 +88,6 @@ void TabControl::ImplInit( vcl::Window* pParent, WinBits nStyle ) mnLastWidth = 0; mnLastHeight = 0; - mnBtnSize = 0; mnMaxPageWidth = 0; mnActPageId = 0; mnCurPageId = 0; diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index eaba9167c0a5..8f7765410fa4 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -72,7 +72,6 @@ TextEngine::TextEngine() , mpIMEInfos {nullptr} , mpLocaleDataWrapper {nullptr} , maTextColor {COL_BLACK} - , mnFixCharWidth100 {0} , mnMaxTextLen {0} , mnMaxTextWidth {0} , mnCharHeight {0} @@ -199,7 +198,6 @@ void TextEngine::SetFont( const vcl::Font& rFont ) if ( !mnDefTab ) mnDefTab = 1; mnCharHeight = mpRefDev->GetTextHeight(); - mnFixCharWidth100 = 0; FormatFullDoc(); UpdateViews(); @@ -1206,20 +1204,11 @@ long TextEngine::CalcTextWidth( sal_uInt32 nPara, sal_Int32 nPortionStart, sal_I SAL_WARN_IF( nTabPos != -1 && nTabPos < (nPortionStart+nLen), "vcl", "CalcTextWidth: Tab!" ); #endif - long nWidth; - if ( mnFixCharWidth100 ) - { - nWidth = static_cast<long>(nLen)*mnFixCharWidth100/100; - } - else - { - vcl::Font aFont; - SeekCursor( nPara, nPortionStart+1, aFont, nullptr ); - mpRefDev->SetFont( aFont ); - TextNode* pNode = mpDoc->GetNodes()[ nPara ]; - nWidth = mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen ); - - } + vcl::Font aFont; + SeekCursor( nPara, nPortionStart+1, aFont, nullptr ); + mpRefDev->SetFont( aFont ); + TextNode* pNode = mpDoc->GetNodes()[ nPara ]; + long nWidth = mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen ); return nWidth; } diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 36c05eb10fac..38e72dc5e837 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1163,7 +1163,6 @@ void GraphicFilter::ImplInit() } pErrorEx = new FilterErrorEx; - bAbort = false; } sal_uLong GraphicFilter::ImplSetError( sal_uLong nError, const SvStream* pStm ) @@ -1392,7 +1391,6 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat else nStreamBegin = rIStream.Tell(); - bAbort = false; nStatus = ImpTestOrFindFormat( rPath, rIStream, nFormat ); // if pending, return GRFILTER_OK in order to request more bytes if( rIStream.GetError() == ERRCODE_IO_PENDING ) @@ -1786,9 +1784,6 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat // Set error code or try to set native buffer if( nStatus != GRFILTER_OK ) { - if( bAbort ) - nStatus = GRFILTER_ABORT; - ImplSetError( nStatus, &rIStream ); rIStream.Seek( nStreamBegin ); rGraphic.Clear(); @@ -1880,7 +1875,6 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString #ifndef DISABLE_DYNLOADING OUString aExternalFilterName(pConfig->GetExternalFilterName(nFormat, true)); #endif - bAbort = false; sal_uInt16 nStatus = GRFILTER_OK; GraphicType eType; Graphic aGraphic( rGraphic ); @@ -2150,9 +2144,6 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString } if( nStatus != GRFILTER_OK ) { - if( bAbort ) - nStatus = GRFILTER_ABORT; - ImplSetError( nStatus, &rOStm ); } return nStatus; diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index 2f4fabf08ef9..225d1f7e619b 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -66,8 +66,7 @@ Animation::Animation() : mnLoops ( 0 ), mnPos ( 0 ), mbIsInAnimation ( false ), - mbLoopTerminated ( false ), - mbIsWaiting ( false ) + mbLoopTerminated ( false ) { maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) ); } @@ -78,8 +77,7 @@ Animation::Animation( const Animation& rAnimation ) : mnLoopCount ( rAnimation.mnLoopCount ), mnPos ( rAnimation.mnPos ), mbIsInAnimation ( false ), - mbLoopTerminated ( rAnimation.mbLoopTerminated ), - mbIsWaiting ( rAnimation.mbIsWaiting ) + mbLoopTerminated ( rAnimation.mbLoopTerminated ) { for(const AnimationBitmap* i : rAnimation.maList) @@ -114,7 +112,6 @@ Animation& Animation::operator=( const Animation& rAnimation ) mnLoopCount = rAnimation.mnLoopCount; mnPos = rAnimation.mnPos; mbLoopTerminated = rAnimation.mbLoopTerminated; - mbIsWaiting = rAnimation.mbIsWaiting; mnLoops = mbLoopTerminated ? 0 : mnLoopCount; return *this; diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 371350bfdc1e..8c66d1a0e548 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -573,7 +573,7 @@ BitmapEx ImpGraphic::ImplGetBitmapEx(const GraphicConversionParameters& rParamet { aRetBmpEx.Scale( rParameters.getSizePixel(), - rParameters.getScaleHighQuality() ? BmpScaleFlag::Interpolate : BmpScaleFlag::Fast); + BmpScaleFlag::Fast); } } else if( ( meType != GraphicType::Default ) && ImplIsSupportedGraphic() ) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index f29e8d1083d2..15d764fa4591 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -4842,25 +4842,20 @@ void PDFWriterImpl::createDefaultEditAppearance( PDFWidget& rEdit, const PDFWrit // prepare font to use, draw field border Font aFont = drawFieldBorder( rEdit, rWidget, rSettings ); - sal_Int32 nBest = m_aContext.FieldsUseSystemFonts ? getSystemFont( aFont ): getBestBuiltinFont( aFont ); + sal_Int32 nBest = getSystemFont( aFont ); // prepare DA string OStringBuffer aDA( 32 ); appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetFieldTextColor() ), aDA ); aDA.append( ' ' ); - if( m_aContext.FieldsUseSystemFonts ) - { - aDA.append( "/F" ); - aDA.append( nBest ); - - OStringBuffer aDR( 32 ); - aDR.append( "/Font " ); - aDR.append( getFontDictObject() ); - aDR.append( " 0 R" ); - rEdit.m_aDRDict = aDR.makeStringAndClear(); - } - else - aDA.append( m_aBuiltinFonts[nBest].getNameObject() ); + aDA.append( "/F" ); + aDA.append( nBest ); + + OStringBuffer aDR( 32 ); + aDR.append( "/Font " ); + aDR.append( getFontDictObject() ); + aDR.append( " 0 R" ); + rEdit.m_aDRDict = aDR.makeStringAndClear(); aDA.append( ' ' ); m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aFont.GetFontHeight() ), aDA ); aDA.append( " Tf" ); @@ -4894,7 +4889,7 @@ void PDFWriterImpl::createDefaultListBoxAppearance( PDFWidget& rBox, const PDFWr // prepare font to use, draw field border Font aFont = drawFieldBorder( rBox, rWidget, rSettings ); - sal_Int32 nBest = m_aContext.FieldsUseSystemFonts ? getSystemFont( aFont ): getBestBuiltinFont( aFont ); + sal_Int32 nBest = getSystemFont( aFont ); beginRedirect( pListBoxStream, rBox.m_aRect ); OStringBuffer aAppearance( 64 ); @@ -4917,19 +4912,14 @@ void PDFWriterImpl::createDefaultListBoxAppearance( PDFWidget& rBox, const PDFWr // prepare DA string appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetFieldTextColor() ), aDA ); aDA.append( ' ' ); - if( m_aContext.FieldsUseSystemFonts ) - { - aDA.append( "/F" ); - aDA.append( nBest ); - - OStringBuffer aDR( 32 ); - aDR.append( "/Font " ); - aDR.append( getFontDictObject() ); - aDR.append( " 0 R" ); - rBox.m_aDRDict = aDR.makeStringAndClear(); - } - else - aDA.append( m_aBuiltinFonts[nBest].getNameObject() ); + aDA.append( "/F" ); + aDA.append( nBest ); + + OStringBuffer aDR( 32 ); + aDR.append( "/Font " ); + aDR.append( getFontDictObject() ); + aDR.append( " 0 R" ); + rBox.m_aDRDict = aDR.makeStringAndClear(); aDA.append( ' ' ); m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aFont.GetFontHeight() ), aDA ); aDA.append( " Tf" ); @@ -4960,7 +4950,6 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW nDelta = 1; Rectangle aCheckRect, aTextRect; - if( rWidget.ButtonIsLeft ) { aCheckRect.Left() = rBox.m_aRect.Left() + nDelta; aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2; @@ -4980,26 +4969,6 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta; aTextRect.Bottom() = rBox.m_aRect.Bottom(); } - else - { - aCheckRect.Left() = rBox.m_aRect.Right() - nDelta - aFontSize.Height(); - aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2; - aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height(); - aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height(); - - // #i74206# handle small controls without text area - while( aCheckRect.GetWidth() > rBox.m_aRect.GetWidth() && aCheckRect.GetWidth() > nDelta ) - { - aCheckRect.Left() += nDelta; - aCheckRect.Top() += nDelta/2; - aCheckRect.Bottom() -= nDelta - (nDelta/2); - } - - aTextRect.Left() = rBox.m_aRect.Left(); - aTextRect.Top() = rBox.m_aRect.Top(); - aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta; - aTextRect.Bottom() = rBox.m_aRect.Bottom(); - } setLineColor( Color( COL_BLACK ) ); setFillColor( Color( COL_TRANSPARENT ) ); OStringBuffer aLW( 32 ); @@ -5085,7 +5054,6 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P nDelta = 1; Rectangle aCheckRect, aTextRect; - if( rWidget.ButtonIsLeft ) { aCheckRect.Left() = rBox.m_aRect.Left() + nDelta; aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2; @@ -5105,26 +5073,6 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta; aTextRect.Bottom() = rBox.m_aRect.Bottom(); } - else - { - aCheckRect.Left() = rBox.m_aRect.Right() - nDelta - aFontSize.Height(); - aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2; - aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height(); - aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height(); - - // #i74206# handle small controls without text area - while( aCheckRect.GetWidth() > rBox.m_aRect.GetWidth() && aCheckRect.GetWidth() > nDelta ) - { - aCheckRect.Left() += nDelta; - aCheckRect.Top() += nDelta/2; - aCheckRect.Bottom() -= nDelta - (nDelta/2); - } - - aTextRect.Left() = rBox.m_aRect.Left(); - aTextRect.Top() = rBox.m_aRect.Top(); - aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta; - aTextRect.Bottom() = rBox.m_aRect.Bottom(); - } setLineColor( Color( COL_BLACK ) ); setFillColor( Color( COL_TRANSPARENT ) ); OStringBuffer aLW( 32 ); @@ -7961,10 +7909,7 @@ bool PDFWriterImpl::emitTrailer() aLineS.append( " 0 obj\n" "<</Filter/Standard/V " ); // check the version - if( m_aContext.Encryption.Security128bit ) - aLineS.append( "2/Length 128/R 3" ); - else - aLineS.append( "1/R 2" ); + aLineS.append( "2/Length 128/R 3" ); // emit the owner password, must not be encrypted aLineS.append( "/O(" ); @@ -13320,8 +13265,6 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa rNewWidget.m_aValue = rBox.Text; rNewWidget.m_aListEntries = rBox.Entries; rNewWidget.m_nFlags |= 0x00060000; // combo and edit flag - if( rBox.Sort ) - rNewWidget.m_nFlags |= 0x00080000; PDFWriter::ListBoxWidget aLBox; aLBox.Name = rBox.Name; @@ -13336,7 +13279,7 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa aLBox.TextFont = rBox.TextFont; aLBox.TextColor = rBox.TextColor; aLBox.DropDown = true; - aLBox.Sort = rBox.Sort; + aLBox.Sort = false; aLBox.MultiSelect = false; aLBox.Entries = rBox.Entries; @@ -13365,11 +13308,9 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa #if !defined(ANDROID) && !defined(IOS) else if( rControl.getType() == PDFWriter::Signature) { - const PDFWriter::SignatureWidget& rSig = static_cast<const PDFWriter::SignatureWidget&>(rControl); - sigHidden = rSig.SigHidden; + sigHidden = true; - if ( sigHidden ) - rNewWidget.m_aRect = Rectangle(0, 0, 0, 0); + rNewWidget.m_aRect = Rectangle(0, 0, 0, 0); m_nSignatureObject = createObject(); rNewWidget.m_aValue = OUString::number( m_nSignatureObject ); diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 694c698b8b21..d714f5d8a4ca 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -1277,7 +1277,7 @@ sal_Int32 PDFWriterImpl::computeAccessPermissions( const vcl::PDFWriter::PDFEncr - for 40 bit security the unused bit must be set to 1, since they are not used - for 128 bit security the same bit must be preset to 0 and set later if needed according to the table 3.15, pdf v 1.4 */ - sal_Int32 nAccessPermissions = ( i_rProperties.Security128bit ) ? 0xfffff0c0 : 0xffffffc0 ; + sal_Int32 nAccessPermissions = 0xfffff0c0; /* check permissions for 40 bit security case */ nAccessPermissions |= ( i_rProperties.CanPrintTheDocument ) ? 1 << 2 : 0; @@ -1287,16 +1287,13 @@ sal_Int32 PDFWriterImpl::computeAccessPermissions( const vcl::PDFWriter::PDFEncr o_rKeyLength = SECUR_40BIT_KEY; o_rRC4KeyLength = SECUR_40BIT_KEY+5; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 5 - if( i_rProperties.Security128bit ) - { - o_rKeyLength = SECUR_128BIT_KEY; - o_rRC4KeyLength = 16; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 16, thus maximum - // permitted value is 16 - nAccessPermissions |= ( i_rProperties.CanFillInteractive ) ? 1 << 8 : 0; - nAccessPermissions |= ( i_rProperties.CanExtractForAccessibility ) ? 1 << 9 : 0; - nAccessPermissions |= ( i_rProperties.CanAssemble ) ? 1 << 10 : 0; - nAccessPermissions |= ( i_rProperties.CanPrintFull ) ? 1 << 11 : 0; - } + o_rKeyLength = SECUR_128BIT_KEY; + o_rRC4KeyLength = 16; // for this value see PDF spec v 1.4, algorithm 3.1 step 4, where n is 16, thus maximum + // permitted value is 16 + nAccessPermissions |= ( i_rProperties.CanFillInteractive ) ? 1 << 8 : 0; + nAccessPermissions |= ( i_rProperties.CanExtractForAccessibility ) ? 1 << 9 : 0; + nAccessPermissions |= ( i_rProperties.CanAssemble ) ? 1 << 10 : 0; + nAccessPermissions |= ( i_rProperties.CanPrintFull ) ? 1 << 11 : 0; return nAccessPermissions; } @@ -1368,18 +1365,15 @@ bool PDFWriterImpl::computeEncryptionKey( EncHashTransporter* i_pTransporter, vc rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) ); //step 6, only if 128 bit - if( io_rProperties.Security128bit ) + for( sal_Int32 i = 0; i < 50; i++ ) { - for( sal_Int32 i = 0; i < 50; i++ ) + nError = rtl_digest_updateMD5( aDigest, &nMD5Sum, sizeof( nMD5Sum ) ); + if( nError != rtl_Digest_E_None ) { - nError = rtl_digest_updateMD5( aDigest, &nMD5Sum, sizeof( nMD5Sum ) ); - if( nError != rtl_Digest_E_None ) - { - bSuccess = false; - break; - } - rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) ); + bSuccess = false; + break; } + rtl_digest_getMD5( aDigest, nMD5Sum, sizeof( nMD5Sum ) ); } } else @@ -1514,52 +1508,38 @@ bool PDFWriterImpl::computeUDictionaryValue( EncHashTransporter* i_pTransporter, for( sal_Int32 i = i_nKeyLength, y = 0; y < 5 ; y++ ) io_rProperties.EncryptionKey[i++] = 0; - if( !io_rProperties.Security128bit ) + //or 3.5, for 128 bit security + //step6, initialize the last 16 bytes of the encrypted user password to 0 + for(sal_uInt32 i = MD5_DIGEST_SIZE; i < sal_uInt32(io_rProperties.UValue.size()); i++) + io_rProperties.UValue[i] = 0; + //steps 2 and 3 + if (rtl_digest_updateMD5( aDigest, s_nPadString, sizeof( s_nPadString ) ) != rtl_Digest_E_None + || rtl_digest_updateMD5( aDigest, &io_rProperties.DocumentIdentifier[0], sal_Int32(io_rProperties.DocumentIdentifier.size()) ) != rtl_Digest_E_None) { - //3.4 - //step 2 and 3 - rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode, - &io_rProperties.EncryptionKey[0], 5 , // key and key length - nullptr, 0 ); //destination data area - // encrypt the user password using the key set above, save for later use - rtl_cipher_encodeARCFOUR( aCipher, s_nPadString, sizeof( s_nPadString ), // the data to be encrypted - &io_rProperties.UValue[0], sal_Int32(io_rProperties.UValue.size()) ); //encrypted data, stored in class data member + bSuccess = false; } - else + + sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ]; + rtl_digest_getMD5( aDigest, nMD5Sum, sizeof(nMD5Sum) ); + //Step 4 + rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode, + &io_rProperties.EncryptionKey[0], SECUR_128BIT_KEY, nullptr, 0 ); //destination data area + rtl_cipher_encodeARCFOUR( aCipher, nMD5Sum, sizeof( nMD5Sum ), // the data to be encrypted + &io_rProperties.UValue[0], sizeof( nMD5Sum ) ); //encrypted data, stored in class data member + //step 5 + sal_uInt32 i, y; + sal_uInt8 nLocalKey[SECUR_128BIT_KEY]; + + for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1 { - //or 3.5, for 128 bit security - //step6, initialize the last 16 bytes of the encrypted user password to 0 - for(sal_uInt32 i = MD5_DIGEST_SIZE; i < sal_uInt32(io_rProperties.UValue.size()); i++) - io_rProperties.UValue[i] = 0; - //steps 2 and 3 - if (rtl_digest_updateMD5( aDigest, s_nPadString, sizeof( s_nPadString ) ) != rtl_Digest_E_None - || rtl_digest_updateMD5( aDigest, &io_rProperties.DocumentIdentifier[0], sal_Int32(io_rProperties.DocumentIdentifier.size()) ) != rtl_Digest_E_None) - { - bSuccess = false; - } + for( y = 0; y < sizeof( nLocalKey ) ; y++ ) + nLocalKey[y] = (sal_uInt8)( io_rProperties.EncryptionKey[y] ^ i ); - sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ]; - rtl_digest_getMD5( aDigest, nMD5Sum, sizeof(nMD5Sum) ); - //Step 4 rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode, - &io_rProperties.EncryptionKey[0], SECUR_128BIT_KEY, nullptr, 0 ); //destination data area - rtl_cipher_encodeARCFOUR( aCipher, nMD5Sum, sizeof( nMD5Sum ), // the data to be encrypted - &io_rProperties.UValue[0], sizeof( nMD5Sum ) ); //encrypted data, stored in class data member - //step 5 - sal_uInt32 i, y; - sal_uInt8 nLocalKey[SECUR_128BIT_KEY]; - - for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1 - { - for( y = 0; y < sizeof( nLocalKey ) ; y++ ) - nLocalKey[y] = (sal_uInt8)( io_rProperties.EncryptionKey[y] ^ i ); - - rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode, - nLocalKey, SECUR_128BIT_KEY, // key and key length - nullptr, 0 ); //destination data area, on init can be NULL - rtl_cipher_encodeARCFOUR( aCipher, &io_rProperties.UValue[0], SECUR_128BIT_KEY, // the data to be encrypted - &io_rProperties.UValue[0], SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place" - } + nLocalKey, SECUR_128BIT_KEY, // key and key length + nullptr, 0 ); //destination data area, on init can be NULL + rtl_cipher_encodeARCFOUR( aCipher, &io_rProperties.UValue[0], SECUR_128BIT_KEY, // the data to be encrypted + &io_rProperties.UValue[0], SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place" } } else diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 23dd0f2aa54b..23c93681df66 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -507,7 +507,6 @@ void Printer::ImplInitData() mpInfoPrinter = nullptr; mpPrinter = nullptr; mpDisplayDev = nullptr; - mbIsQueuePrinter = false; mpPrinterOptions = new PrinterOptions; // Add printer to the list diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 7b244caa51cd..3bc2fccad964 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -1128,7 +1128,7 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte for( int nSubPage = 0; nSubPage < nSubPages; nSubPage++ ) { // map current sub page to real page - int nPage = (i_nFilteredPage * nSubPages + nSubPage) / rMPS.nRepeat; + int nPage = i_nFilteredPage * nSubPages + nSubPage; if( nSubPage == nSubPages-1 || nPage == nDocPages-1 ) { @@ -1198,7 +1198,7 @@ int PrinterController::getFilteredPageCount() int nDiv = mpImplData->maMultiPage.nRows * mpImplData->maMultiPage.nColumns; if( nDiv < 1 ) nDiv = 1; - return (getPageCountProtected() * mpImplData->maMultiPage.nRepeat + (nDiv-1)) / nDiv; + return (getPageCountProtected() + (nDiv-1)) / nDiv; } DrawModeFlags PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut ) diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index e8bd5f434823..b1bd83ab5662 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -85,7 +85,6 @@ OutputDevice::OutputDevice() : meOutDevType = OUTDEV_DONTKNOW; meOutDevViewType = OUTDEV_VIEWTYPE_DONTKNOW; mbMap = false; - mbMapIsDefault = true; mbClipRegion = false; mbBackground = false; mbOutput = true; diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index 57c1da27cb64..d2a33b06d6bc 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -127,7 +127,6 @@ void Accelerator::ImplInit() { mnCurId = 0; mnCurRepeat = 0; - mbIsCancel = false; mpDel = nullptr; } @@ -304,7 +303,6 @@ Accelerator& Accelerator::operator=( const Accelerator& rAccel ) maCurKeyCode = vcl::KeyCode(); mnCurId = 0; mnCurRepeat = 0; - mbIsCancel = false; // delete and copy tables ImplDeleteData(); diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx index 3b45dc742571..56a56345dd7d 100644 --- a/vcl/source/window/accmgr.cxx +++ b/vcl/source/window/accmgr.cxx @@ -88,7 +88,6 @@ void ImplAccelManager::EndSequence() for (Accelerator* pTempAccel : *mpSequenceList) { - pTempAccel->mbIsCancel = false; pTempAccel->mpDel = nullptr; } diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 107450a434d6..c81c1b019c8b 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -186,8 +186,7 @@ IMPL_LINK_NOARG_TYPED(ImplDockFloatWin2, DockingHdl, void*, void) } } - if( mpDockWin->IsDockable() && - mpDockWin->GetWindow()->IsVisible() && + if( mpDockWin->GetWindow()->IsVisible() && (tools::Time::GetSystemTicks() - mnLastTicks > 500) && ( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) && !(aState.mnState & KEY_MOD1) && // i43499 CTRL disables docking now @@ -799,8 +798,6 @@ ImplDockingWindowWrapper::ImplDockingWindowWrapper( const vcl::Window *pWindow ) , mnDockBottom(0) , mnFloatBits(WB_BORDER | WB_CLOSEABLE | WB_SIZEABLE | (pWindow->GetStyle() & DOCKWIN_FLOATSTYLES)) , mbDockCanceled(false) - , mbFloatPrevented(false) - , mbDockable(true) , mbDocking(false) , mbLastFloatMode(false) , mbStartFloat(false) @@ -828,9 +825,6 @@ ImplDockingWindowWrapper::~ImplDockingWindowWrapper() bool ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos ) { - if ( !mbDockable ) - return false; - if( !mbStartDockingEnabled ) return false; @@ -926,7 +920,6 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt ) bool bFloatMode = Docking( aPos, aTrackRect ); - mbFloatPrevented = false; if ( mbLastFloatMode != bFloatMode ) { if ( bFloatMode ) diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 236844686a1b..3442d32ea421 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -318,14 +318,11 @@ void DockingWindow::ImplInitDockingWindowData() mnDockBottom = 0; mnFloatBits = 0; mbDockCanceled = false; - mbDockPrevented = false; - mbFloatPrevented = false; mbDockable = false; mbDocking = false; mbDragFull = false; mbLastFloatMode = false; mbStartFloat = false; - mbTrackDock = false; mbPinned = false; mbRollUp = false; mbDockBtn = false; @@ -532,8 +529,6 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt ) if ( mbDragFull ) StartDocking(); bool bFloatMode = Docking( aFramePos, aTrackRect ); - mbDockPrevented = false; - mbFloatPrevented = false; if ( mbLastFloatMode != bFloatMode ) { if ( bFloatMode ) diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx index 050b07948f34..ddb5a9168b88 100644 --- a/vcl/source/window/event.cxx +++ b/vcl/source/window/event.cxx @@ -653,7 +653,6 @@ NotifyEvent::NotifyEvent( MouseNotifyEvent nEventType, vcl::Window* pWindow, mpWindow = pWindow; mpData = const_cast<void*>(pEvent); mnEventType = nEventType; - mnRetValue = 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index f62c9109d12e..9699a1705734 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1481,7 +1481,6 @@ void PrintDialog::updateNup() PrinterController::MultiPageSetup aMPS; aMPS.nRows = nRows; aMPS.nColumns = nCols; - aMPS.nRepeat = 1; aMPS.nLeftMargin = aMPS.nTopMargin = aMPS.nRightMargin = diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 8986f99db13f..71a0be4f948b 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -237,57 +237,47 @@ void SplitWindow::ImplDrawBorder(vcl::RenderContext& rRenderContext) long nDX = mnDX; long nDY = mnDY; - if (mbNoAlign) + switch (meAlign) { - DecorationView aDecoView(&rRenderContext); - Point aTmpPoint; - Rectangle aRect(aTmpPoint, Size(nDX, nDY)); - aDecoView.DrawFrame(aRect, DrawFrameStyle::DoubleIn); - } - else - { - switch (meAlign) - { - case WindowAlign::Bottom: - rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); - rRenderContext.DrawLine(Point(0, 0), Point(nDX - 1, 0)); - rRenderContext.DrawLine(Point(0, nDY - 2), Point(nDX - 1, nDY - 2)); + case WindowAlign::Bottom: + rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); + rRenderContext.DrawLine(Point(0, 0), Point(nDX - 1, 0)); + rRenderContext.DrawLine(Point(0, nDY - 2), Point(nDX - 1, nDY - 2)); - rRenderContext.SetLineColor(rStyleSettings.GetLightColor()); - rRenderContext.DrawLine(Point(0, 1), Point(nDX - 1, 1)); - rRenderContext.DrawLine(Point(0, nDY - 1), Point(nDX - 1, nDY - 1)); - break; - case WindowAlign::Top: - rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); - rRenderContext.DrawLine(Point(0, nDY - 2), Point(nDX - 1, nDY - 2)); - rRenderContext.DrawLine(Point(0, 0), Point(nDX - 1, 0)); + rRenderContext.SetLineColor(rStyleSettings.GetLightColor()); + rRenderContext.DrawLine(Point(0, 1), Point(nDX - 1, 1)); + rRenderContext.DrawLine(Point(0, nDY - 1), Point(nDX - 1, nDY - 1)); + break; + case WindowAlign::Top: + rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); + rRenderContext.DrawLine(Point(0, nDY - 2), Point(nDX - 1, nDY - 2)); + rRenderContext.DrawLine(Point(0, 0), Point(nDX - 1, 0)); - rRenderContext.SetLineColor(rStyleSettings.GetLightColor()); - rRenderContext.DrawLine(Point(0, nDY - 1), Point(nDX - 1, nDY - 1)); - rRenderContext.DrawLine(Point(0, 1), Point(nDX - 1, 1)); - break; - case WindowAlign::Left: - rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); - rRenderContext.DrawLine(Point(nDX - 2, 0), Point(nDX - 2, nDY - 2)); - rRenderContext.DrawLine(Point(0, 0), Point(nDX - 1, 0)); - rRenderContext.DrawLine(Point(0, nDY - 2), Point(nDX - 2, nDY - 2)); - - rRenderContext.SetLineColor(rStyleSettings.GetLightColor()); - rRenderContext.DrawLine(Point(nDX - 1, 0), Point(nDX - 1, nDY - 1)); - rRenderContext.DrawLine(Point(0, 1), Point(nDX - 3, 1)); - rRenderContext.DrawLine(Point(0, nDY - 1), Point(nDX - 2, nDY - 1)); - break; - default: - rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); - rRenderContext.DrawLine(Point(0, 0), Point( 0, nDY - 2)); - rRenderContext.DrawLine(Point(0, 0), Point( nDX - 1, 0)); - rRenderContext.DrawLine(Point(0, nDY - 2), Point(nDX - 1, nDY - 2)); + rRenderContext.SetLineColor(rStyleSettings.GetLightColor()); + rRenderContext.DrawLine(Point(0, nDY - 1), Point(nDX - 1, nDY - 1)); + rRenderContext.DrawLine(Point(0, 1), Point(nDX - 1, 1)); + break; + case WindowAlign::Left: + rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); + rRenderContext.DrawLine(Point(nDX - 2, 0), Point(nDX - 2, nDY - 2)); + rRenderContext.DrawLine(Point(0, 0), Point(nDX - 1, 0)); + rRenderContext.DrawLine(Point(0, nDY - 2), Point(nDX - 2, nDY - 2)); + + rRenderContext.SetLineColor(rStyleSettings.GetLightColor()); + rRenderContext.DrawLine(Point(nDX - 1, 0), Point(nDX - 1, nDY - 1)); + rRenderContext.DrawLine(Point(0, 1), Point(nDX - 3, 1)); + rRenderContext.DrawLine(Point(0, nDY - 1), Point(nDX - 2, nDY - 1)); + break; + default: + rRenderContext.SetLineColor(rStyleSettings.GetShadowColor()); + rRenderContext.DrawLine(Point(0, 0), Point( 0, nDY - 2)); + rRenderContext.DrawLine(Point(0, 0), Point( nDX - 1, 0)); + rRenderContext.DrawLine(Point(0, nDY - 2), Point(nDX - 1, nDY - 2)); - rRenderContext.SetLineColor( rStyleSettings.GetLightColor()); - rRenderContext.DrawLine(Point(1, 1), Point(1, nDY - 3)); - rRenderContext.DrawLine(Point(1, 1), Point(nDX - 1, 1)); - rRenderContext.DrawLine(Point(0, nDY - 1), Point(nDX - 1, nDY - 1)); - } + rRenderContext.SetLineColor( rStyleSettings.GetLightColor()); + rRenderContext.DrawLine(Point(1, 1), Point(1, nDY - 3)); + rRenderContext.DrawLine(Point(1, 1), Point(nDX - 1, 1)); + rRenderContext.DrawLine(Point(0, nDY - 1), Point(nDX - 1, nDY - 1)); } } @@ -1339,7 +1329,6 @@ void SplitWindow::ImplInit( vcl::Window* pParent, WinBits nStyle ) mbFadeInPressed = false; mbFadeOutPressed = false; mbFadeNoButtonMode = false; - mbNoAlign = false; if ( nStyle & WB_NOSPLITDRAW ) { @@ -1349,7 +1338,7 @@ void SplitWindow::ImplInit( vcl::Window* pParent, WinBits nStyle ) if ( nStyle & WB_BORDER ) { - ImplCalcBorder( meAlign, mbNoAlign, mnLeftBorder, mnTopBorder, + ImplCalcBorder( meAlign, false/*bNoAlign*/, mnLeftBorder, mnTopBorder, mnRightBorder, mnBottomBorder ); } else @@ -3168,37 +3157,29 @@ sal_uInt16 SplitWindow::GetItemCount( sal_uInt16 nSetId ) const void SplitWindow::ImplNewAlign() { - if ( mbNoAlign ) + switch ( meAlign ) { + case WindowAlign::Top: + mbHorz = true; + mbBottomRight = false; + break; + case WindowAlign::Bottom: + mbHorz = true; + mbBottomRight = true; + break; + case WindowAlign::Left: mbHorz = false; mbBottomRight = false; - } - else - { - switch ( meAlign ) - { - case WindowAlign::Top: - mbHorz = true; - mbBottomRight = false; - break; - case WindowAlign::Bottom: - mbHorz = true; - mbBottomRight = true; - break; - case WindowAlign::Left: - mbHorz = false; - mbBottomRight = false; - break; - case WindowAlign::Right: - mbHorz = false; - mbBottomRight = true; - break; - } + break; + case WindowAlign::Right: + mbHorz = false; + mbBottomRight = true; + break; } if ( mnWinStyle & WB_BORDER ) { - ImplCalcBorder( meAlign, mbNoAlign, mnLeftBorder, mnTopBorder, + ImplCalcBorder( meAlign, false/*bNoAlign*/, mnLeftBorder, mnTopBorder, mnRightBorder, mnBottomBorder ); } diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 55a0a2fb0f56..c5f07b500868 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -4631,7 +4631,7 @@ bool ToolBox::Docking( const Point& rPos, Rectangle& rRect ) } Rectangle aIntersection = maOutDockRect.GetIntersection( aDockingRect ); - if ( !aIntersection.IsEmpty() && !IsDockingPrevented() ) + if ( !aIntersection.IsEmpty() ) { Rectangle aInRect = maInDockRect; Size aDockSize; |