本文整理汇总了C++中Sheet::getCell方法的典型用法代码示例。如果您正苦于以下问题:C++ Sheet::getCell方法的具体用法?C++ Sheet::getCell怎么用?C++ Sheet::getCell使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sheet
的用法示例。
在下文中一共展示了Sheet::getCell方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: l_cell
static int l_cell(lua_State* L)
{
Sheet* s = toSheet(L, 1);
int row = luaL_checkinteger(L, 2);
int col = luaL_checkinteger(L, 3);
Cell* c = s->getCell(row, col);
if (c)
newCell(L, c);
else
lua_pushnil(L);
return 1;
}
示例2: activated
void CmdSpreadsheetStyleUnderline::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
if (sheetView) {
Sheet * sheet = sheetView->getSheet();
QModelIndexList selection = sheetView->selectedIndexes();
if (selection.size() > 0) {
bool allUnderline = true;
for (QModelIndexList::const_iterator it = selection.begin(); it != selection.end(); ++it) {
const Cell * cell = sheet->getCell(CellAddress((*it).row(), (*it).column()));
if (cell) {
std::set<std::string> style;
cell->getStyle(style);
if (style.find("underline") == style.end()) {
allUnderline = false;
break;
}
}
}
std::vector<Range> ranges = sheetView->selectedRanges();
std::vector<Range>::const_iterator i = ranges.begin();
Gui::Command::openCommand("Set underline text");
for (; i != ranges.end(); ++i) {
if (!allUnderline)
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.setStyle('%s', 'underline', 'add')", sheet->getNameInDocument(),
i->rangeString().c_str());
else
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.setStyle('%s', 'underline', 'remove')", sheet->getNameInDocument(),
i->rangeString().c_str());
}
Gui::Command::commitCommand();
Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()");
}
}
}
}