tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / view / tabvwsh8.cxx
blob9a743c295b827c33d6657db5532f43429fc6d1fc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <editeng/borderline.hxx>
22 #include <tabvwsh.hxx>
23 #include <document.hxx>
25 void ScTabViewShell::SetDefaultFrameLine( const ::editeng::SvxBorderLine* pLine )
27 if ( pLine )
29 pCurFrameLine.reset( new ::editeng::SvxBorderLine( &pLine->GetColor(),
30 pLine->GetWidth(),
31 pLine->GetBorderLineStyle() ) );
33 else
34 pCurFrameLine.reset();
37 bool ScTabViewShell::HasSelection( bool bText ) const
39 bool bHas = false;
40 ScViewData& rData = const_cast<ScViewData&>(GetViewData());
41 if ( bText )
43 // Content contained: Count2 >= 1
44 ScDocument& rDoc = rData.GetDocument();
45 ScMarkData& rMark = rData.GetMarkData();
46 ScAddress aCursor( rData.GetCurX(), rData.GetCurY(), rData.GetTabNo() );
47 double fVal = 0.0;
48 if ( rDoc.GetSelectionFunction( SUBTOTAL_FUNC_CNT2, aCursor, rMark, fVal ) )
49 bHas = ( fVal > 0.5 );
51 else
53 ScRange aRange;
54 ScMarkType eMarkType = rData.GetSimpleArea( aRange );
55 if ( eMarkType == SC_MARK_SIMPLE )
56 bHas = ( aRange.aStart != aRange.aEnd ); // more than 1 cell
57 else
58 bHas = true; // multiple selection or filtered
60 return bHas;
63 void ScTabViewShell::UIDeactivated( SfxInPlaceClient* pClient )
65 ClearHighlightRanges();
67 // Move in the ViewShell should really be called from Sfx, when the
68 // frame window is moved due to different toolboxes or other things
69 // (to not move painted objects by mistake, #56515#).
70 // this mechanism does however not work at the moment, that is why this
71 // call is here (in Move it is checked if the position has really changed).
72 ForceMove();
73 SfxViewShell::UIDeactivated( pClient );
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */