fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / view / tabvwsh8.cxx
blob65ac59e8e6c526362a1ff540237b6db5acce41ad
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 "scitems.hxx"
21 #include <editeng/boxitem.hxx>
23 #include "tabvwsh.hxx"
24 #include "document.hxx"
26 void ScTabViewShell::SetDefaultFrameLine( const ::editeng::SvxBorderLine* pLine )
28 if ( pLine )
30 delete pCurFrameLine;
31 pCurFrameLine = new ::editeng::SvxBorderLine( &pLine->GetColor(),
32 pLine->GetWidth(),
33 pLine->GetBorderLineStyle() );
35 else if ( pCurFrameLine )
37 delete pCurFrameLine;
38 pCurFrameLine = NULL;
42 bool ScTabViewShell::HasSelection( bool bText ) const
44 bool bHas = false;
45 ScViewData* pData = const_cast<ScViewData*>(&GetViewData()); // const weggecasted
46 if ( bText )
48 // Text enthalten: Anzahl2 >= 1
49 ScDocument* pDoc = pData->GetDocument();
50 ScMarkData& rMark = pData->GetMarkData();
51 ScAddress aCursor( pData->GetCurX(), pData->GetCurY(), pData->GetTabNo() );
52 double fVal = 0.0;
53 if ( pDoc->GetSelectionFunction( SUBTOTAL_FUNC_CNT2, aCursor, rMark, fVal ) )
54 bHas = ( fVal > 0.5 );
56 else
58 ScRange aRange;
59 ScMarkType eMarkType = pData->GetSimpleArea( aRange );
60 if ( eMarkType == SC_MARK_SIMPLE )
61 bHas = ( aRange.aStart != aRange.aEnd ); // more than 1 cell
62 else
63 bHas = true; // multiple selection or filtered
65 return bHas;
68 void ScTabViewShell::UIDeactivated( SfxInPlaceClient* pClient )
70 ClearHighlightRanges();
72 // Move an der ViewShell soll eigentlich vom Sfx gerufen werden, wenn sich
73 // das Frame-Window wegen unterschiedlicher Toolboxen o.ae. verschiebt
74 // (um nicht aus Versehen z.B. Zeichenobjekte zu verschieben, #56515#).
75 // Dieser Mechanismus funktioniert aber momentan nicht, darum hier der Aufruf
76 // per Hand (im Move wird verglichen, ob die Position wirklich geaendert ist).
77 ForceMove();
78 SfxViewShell::UIDeactivated( pClient );
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */