MCPcopy Create free account
hub / github.com/c3d/tao3D / modifyBlockFormat

Function modifyBlockFormat

tao/text_edit.cpp:417–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417bool modifyBlockFormat(QTextBlockFormat &blockFormat,
418 Layout * where)
419// ----------------------------------------------------------------------------
420// Modify a blockFormat with the given layout
421// ----------------------------------------------------------------------------
422{
423 bool modified = false;
424 if (blockFormat.alignment() !=
425 (where->alongX.toQtHAlign() | where->alongY.toQtVAlign()))
426 {
427 blockFormat.setAlignment(where->alongX.toQtHAlign() |
428 where->alongY.toQtVAlign());
429 modified = true;
430 }
431
432 if (blockFormat.topMargin() != where->top)
433 {
434 blockFormat.setTopMargin(where->top);
435 modified = true;
436 }
437
438 if ( blockFormat.bottomMargin() != where->bottom)
439 {
440 blockFormat.setBottomMargin(where->bottom);
441 modified = true;
442 }
443
444 if ( blockFormat.leftMargin() != where->left)
445 {
446 blockFormat.setLeftMargin(where->left);
447 modified = true;
448 }
449
450 if ( blockFormat.rightMargin() != where->right)
451 {
452 blockFormat.setRightMargin(where->right);
453 modified = true;
454 }
455
456 return modified;
457
458}
459
460
461bool modifyCharFormat(QTextCharFormat &format,

Callers 2

updateCursorMethod · 0.85
DrawSelectionMethod · 0.85

Calls 2

toQtHAlignMethod · 0.80
toQtVAlignMethod · 0.80

Tested by

no test coverage detected