ruler.cxx (79aad27f) ruler.cxx (2bfcd321)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 18 unchanged lines hidden (view full) ---

27#include <string.h>
28#include <tools/debug.hxx>
29#include <vcl/svapp.hxx>
30#include <tools/poly.hxx>
31#include <vcl/i18nhelp.hxx>
32
33#define _SV_RULER_CXX
34#include <svtools/ruler.hxx>
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 18 unchanged lines hidden (view full) ---

27#include <string.h>
28#include <tools/debug.hxx>
29#include <vcl/svapp.hxx>
30#include <tools/poly.hxx>
31#include <vcl/i18nhelp.hxx>
32
33#define _SV_RULER_CXX
34#include <svtools/ruler.hxx>
35
35//IAccessibility2 Implementation 2009-----
36#include <svtools/svtdata.hxx>
37#include <svtools/svtools.hrc>
38using namespace ::rtl;
39using namespace ::com::sun::star;
40using namespace ::com::sun::star::uno;
41using namespace ::com::sun::star::lang;
42using namespace ::com::sun::star::accessibility;
43//-----IAccessibility2 Implementation 2009
36// =======================================================================
37
38#define RULER_OFF 3
39#define RULER_TEXTOFF 2
40#define RULER_RESIZE_OFF 4
41#define RULER_LINE_WIDTH 7
42#define RULER_MIN_SIZE 3
43

--- 250 unchanged lines hidden (view full) ---

294 // Default-Groesse setzen
295 long nDefHeight = GetTextHeight() + RULER_OFF*2 + RULER_TEXTOFF*2 + mnBorderWidth;
296 Size aDefSize;
297 if ( nWinBits & WB_HORZ )
298 aDefSize.Height() = nDefHeight;
299 else
300 aDefSize.Width() = nDefHeight;
301 SetOutputSizePixel( aDefSize );
44// =======================================================================
45
46#define RULER_OFF 3
47#define RULER_TEXTOFF 2
48#define RULER_RESIZE_OFF 4
49#define RULER_LINE_WIDTH 7
50#define RULER_MIN_SIZE 3
51

--- 250 unchanged lines hidden (view full) ---

302 // Default-Groesse setzen
303 long nDefHeight = GetTextHeight() + RULER_OFF*2 + RULER_TEXTOFF*2 + mnBorderWidth;
304 Size aDefSize;
305 if ( nWinBits & WB_HORZ )
306 aDefSize.Height() = nDefHeight;
307 else
308 aDefSize.Width() = nDefHeight;
309 SetOutputSizePixel( aDefSize );
310 //IAccessibility2 Implementation 2009-----
302 SetType(WINDOW_RULER);
311 SetType(WINDOW_RULER);
312 pAccContext = NULL;
313 //-----IAccessibility2 Implementation 2009
303}
304
305// -----------------------------------------------------------------------
306
307Ruler::Ruler( Window* pParent, WinBits nWinStyle ) :
308 Window( pParent, nWinStyle & WB_3DLOOK ),
309 maVirDev( *this ),
310 maMapMode( MAP_100TH_MM ),

--- 7 unchanged lines hidden (view full) ---

318// -----------------------------------------------------------------------
319
320Ruler::~Ruler()
321{
322 if ( mnUpdateEvtId )
323 Application::RemoveUserEvent( mnUpdateEvtId );
324 delete mpSaveData;
325 delete mpDragData;
314}
315
316// -----------------------------------------------------------------------
317
318Ruler::Ruler( Window* pParent, WinBits nWinStyle ) :
319 Window( pParent, nWinStyle & WB_3DLOOK ),
320 maVirDev( *this ),
321 maMapMode( MAP_100TH_MM ),

--- 7 unchanged lines hidden (view full) ---

329// -----------------------------------------------------------------------
330
331Ruler::~Ruler()
332{
333 if ( mnUpdateEvtId )
334 Application::RemoveUserEvent( mnUpdateEvtId );
335 delete mpSaveData;
336 delete mpDragData;
337 //IAccessibility2 Implementation 2009-----
338 if( pAccContext )
339 pAccContext->release();
340 //-----IAccessibility2 Implementation 2009
326}
327
328// -----------------------------------------------------------------------
329
330void Ruler::ImplVDrawLine( long nX1, long nY1, long nX2, long nY2 )
331{
332 if ( nX1 < -RULER_CLIP )
333 {

--- 2840 unchanged lines hidden (view full) ---

3174const RulerLine* Ruler::GetLines() const { return mpData->pLines; }
3175sal_uInt16 Ruler::GetArrowCount() const { return mpData->nArrows; }
3176const RulerArrow* Ruler::GetArrows() const { return mpData->pArrows; }
3177sal_uInt16 Ruler::GetBorderCount() const { return mpData->nBorders; }
3178const RulerBorder* Ruler::GetBorders() const { return mpData->pBorders; }
3179sal_uInt16 Ruler::GetIndentCount() const { return mpData->nIndents; }
3180const RulerIndent* Ruler::GetIndents() const { return mpData->pIndents; }
3181
341}
342
343// -----------------------------------------------------------------------
344
345void Ruler::ImplVDrawLine( long nX1, long nY1, long nX2, long nY2 )
346{
347 if ( nX1 < -RULER_CLIP )
348 {

--- 2840 unchanged lines hidden (view full) ---

3189const RulerLine* Ruler::GetLines() const { return mpData->pLines; }
3190sal_uInt16 Ruler::GetArrowCount() const { return mpData->nArrows; }
3191const RulerArrow* Ruler::GetArrows() const { return mpData->pArrows; }
3192sal_uInt16 Ruler::GetBorderCount() const { return mpData->nBorders; }
3193const RulerBorder* Ruler::GetBorders() const { return mpData->pBorders; }
3194sal_uInt16 Ruler::GetIndentCount() const { return mpData->nIndents; }
3195const RulerIndent* Ruler::GetIndents() const { return mpData->pIndents; }
3196
3197//IAccessibility2 Implementation 2009-----
3198uno::Reference< XAccessible > Ruler::CreateAccessible()
3199{
3200 Window* pParent = GetAccessibleParentWindow();
3201 DBG_ASSERT( pParent, "-SvxRuler::CreateAccessible(): No Parent!" );
3202 uno::Reference< XAccessible > xAccParent = pParent->GetAccessible();
3203 if( xAccParent.is() )
3204 {
3205 // MT: Fixed compiler issue because the address from a temporary object was used.
3206 // BUT: Shoudl it really be a Pointer, instead of const&???
3207 OUString aStr;
3208 if ( mnWinStyle & WB_HORZ )
3209 {
3210 aStr = OUString(XubString(SvtResId(STR_SVT_ACC_RULER_HORZ_NAME)));
3211 }
3212 else
3213 {
3214 aStr = OUString(XubString(SvtResId(STR_SVT_ACC_RULER_VERT_NAME)));
3215 }
3216 pAccContext = new SvtRulerAccessible( xAccParent, *this, aStr );
3217 pAccContext->acquire();
3218 this->SetAccessible(pAccContext);
3219 return pAccContext;
3220 }
3221 else
3222 return uno::Reference< XAccessible >();
3223}
3224//-----IAccessibility2 Implementation 2009